Merge branch 'shf_rename' of github.com:webnotes/erpnext into shf_rename
This commit is contained in:
commit
d24ac3ca9a
@ -1735,7 +1735,6 @@ body {
|
|||||||
|
|
||||||
h1, h2, h3, h4, h5 {
|
h1, h2, h3, h4, h5 {
|
||||||
font-family: "Helvetica Neue", Helvetica, "Helvetica Neue", sans-serif;
|
font-family: "Helvetica Neue", Helvetica, "Helvetica Neue", sans-serif;
|
||||||
font-weight: normal;
|
|
||||||
margin-top: 0.2em;
|
margin-top: 0.2em;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3571,7 +3570,6 @@ div.appframe-toolbar {
|
|||||||
*/
|
*/
|
||||||
h1, h2, h3, h4, h5 {
|
h1, h2, h3, h4, h5 {
|
||||||
font-family: "Helvetica Neue", "Open Sans", Helvetica, sans-serif;
|
font-family: "Helvetica Neue", "Open Sans", Helvetica, sans-serif;
|
||||||
font-weight: normal;
|
|
||||||
margin-top: 0.2em;
|
margin-top: 0.2em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1215,7 +1215,6 @@ body {
|
|||||||
|
|
||||||
h1, h2, h3, h4, h5 {
|
h1, h2, h3, h4, h5 {
|
||||||
font-family: "Helvetica Neue", Helvetica, "Helvetica Neue", sans-serif;
|
font-family: "Helvetica Neue", Helvetica, "Helvetica Neue", sans-serif;
|
||||||
font-weight: normal;
|
|
||||||
margin-top: 0.2em;
|
margin-top: 0.2em;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1888,7 +1887,6 @@ div.appframe-toolbar {
|
|||||||
*/
|
*/
|
||||||
h1, h2, h3, h4, h5 {
|
h1, h2, h3, h4, h5 {
|
||||||
font-family: "Helvetica Neue", "Open Sans", Helvetica, sans-serif;
|
font-family: "Helvetica Neue", "Open Sans", Helvetica, sans-serif;
|
||||||
font-weight: normal;
|
|
||||||
margin-top: 0.2em;
|
margin-top: 0.2em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -25,9 +25,9 @@ KBItemToolbar = function(args, kb) {
|
|||||||
this.wrapper = $a(this.parent, 'div', '', {});
|
this.wrapper = $a(this.parent, 'div', '', {});
|
||||||
this.line1 = $a(this.wrapper, 'div', '', {color: '#888', fontSize:'11px', margin:'7px 0px'});
|
this.line1 = $a(this.wrapper, 'div', '', {color: '#888', fontSize:'11px', margin:'7px 0px'});
|
||||||
this.make_timestamp();
|
this.make_timestamp();
|
||||||
this.make_vote();
|
|
||||||
if(this.with_tags)
|
if(this.with_tags)
|
||||||
this.make_tags();
|
this.make_tags();
|
||||||
|
this.setup_del();
|
||||||
}
|
}
|
||||||
|
|
||||||
this.make_timestamp = function() {
|
this.make_timestamp = function() {
|
||||||
@ -38,24 +38,11 @@ KBItemToolbar = function(args, kb) {
|
|||||||
|
|
||||||
// allow system manager to delete questions / answers
|
// allow system manager to delete questions / answers
|
||||||
if(has_common(user_roles, ['Administrator', 'System Manager'])) {
|
if(has_common(user_roles, ['Administrator', 'System Manager'])) {
|
||||||
this.line1.innerHTML += ' | '
|
this.line1.innerHTML += ' | <a style="cursor:pointer;"\
|
||||||
$ln(this.line1, 'delete', me.del);
|
class="del-link">delete</a>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.make_vote = function() {
|
|
||||||
this.line1.innerHTML += ' | '
|
|
||||||
new KBPoints(this.line1, this.det.points, this.det._users_voted, this.doctype, this.det.name, this.det.owner);
|
|
||||||
}
|
|
||||||
|
|
||||||
this.del = function() {
|
|
||||||
this.innerHTML = 'deleting...'; this.disabled = 1;
|
|
||||||
$c_page('knowledge_base', 'questions', 'delete', {dt:me.doctype, dn:me.det.name}, function(r,rt) {
|
|
||||||
// reload the list
|
|
||||||
kb.list.run()
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
this.make_tags = function() {
|
this.make_tags = function() {
|
||||||
this.line1.innerHTML += ' | '
|
this.line1.innerHTML += ' | '
|
||||||
this.tags_area = $a(this.line1, 'span', 'kb-tags')
|
this.tags_area = $a(this.line1, 'span', 'kb-tags')
|
||||||
@ -64,50 +51,23 @@ KBItemToolbar = function(args, kb) {
|
|||||||
this.doctype, this.det.name, 0, kb.set_tag_filter)
|
this.doctype, this.det.name, 0, kb.set_tag_filter)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.setup_del = function() {
|
||||||
|
$(this.line1).find('.del-link').click(function() {
|
||||||
|
console.log(1);
|
||||||
|
this.innerHTML = 'deleting...';
|
||||||
|
this.disabled = 1;
|
||||||
|
$c_page('knowledge_base', 'questions', 'delete', {
|
||||||
|
dt: me.doctype, dn: me.det.name}, function(r,rt) {
|
||||||
|
// reload the list
|
||||||
|
kb.list.run()
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
this.make();
|
this.make();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// kb points
|
|
||||||
// x points | Vote Up | Vote Down (if not voted and not guest)
|
|
||||||
KBPoints = function(parent, points, voted, dt, dn, owner) {
|
|
||||||
var me = this;
|
|
||||||
voted = voted ? voted.split(',') : [];
|
|
||||||
|
|
||||||
this.wrapper = $a(parent, 'span', '', {fontSize: '11px', marginRight: '7px', marginLeft: '7px'});
|
|
||||||
|
|
||||||
this.render_points = function(p) {
|
|
||||||
if(!this.points_area)
|
|
||||||
this.points_area = $a(this.wrapper, 'span');
|
|
||||||
this.points_area.innerHTML = cint(p) + ' point' + (p>1 ? 's' : '');
|
|
||||||
}
|
|
||||||
|
|
||||||
this.render_points(points);
|
|
||||||
|
|
||||||
// vote up or down
|
|
||||||
// if user has not already voted
|
|
||||||
|
|
||||||
if(user!='Guest' && !in_list(voted, user) && user!=owner) {
|
|
||||||
this.vote_up = $a(this.wrapper, 'img', 'lib/images/ui/vote_up.gif', {margin:'0px 0px -2px 7px', cursor: 'pointer'});
|
|
||||||
this.vote_down = $a(this.wrapper, 'img', 'lib/images/ui/vote_down.gif', {margin:'0px 0px -3px 0px', cursor: 'pointer'});
|
|
||||||
|
|
||||||
this.vote_up.title = 'Vote Up'; this.vote_down.title = 'Vote Down';
|
|
||||||
|
|
||||||
var callback = function(r, rt) {
|
|
||||||
if(r.exc) { msgprint(r.exc); return; }
|
|
||||||
$dh(me.vote_up); $dh(me.vote_down);
|
|
||||||
me.render_points(r.message);
|
|
||||||
}
|
|
||||||
|
|
||||||
this.vote_up.onclick = function() {
|
|
||||||
$c_page('knowledge_base', 'questions', 'vote', {vote:'up', dn:dn, dt:dt}, callback);
|
|
||||||
}
|
|
||||||
this.vote_down.onclick = function() {
|
|
||||||
$c_page('knowledge_base', 'questions', 'vote', {vote:'down', dn:dn, dt:dt}, callback);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// displays an editable text,
|
// displays an editable text,
|
||||||
// needs parent, text, disp_class, inp_class
|
// needs parent, text, disp_class, inp_class
|
||||||
// dt, dn
|
// dt, dn
|
||||||
@ -116,59 +76,68 @@ EditableText = function(args) {
|
|||||||
$.extend(this, args);
|
$.extend(this, args);
|
||||||
var me = this;
|
var me = this;
|
||||||
|
|
||||||
this.wrapper = $a(me.parent, 'div');
|
me.$w = $(repl('<div class="ed-text">\
|
||||||
this.display = $a(me.wrapper, 'div', me.disp_class, '', me.text);
|
<div class="ed-text-display %(disp_class)s"></div>\
|
||||||
this.input = $a(me.wrapper, 'textarea', me.inp_class, {display:'none'});
|
<a class="ed-text-edit" style="cursor: pointer; float: right;">[edit]</a>\
|
||||||
|
<textarea class="ed-text-input %(inp_class)s hide"></textarea><br>\
|
||||||
|
<div class="help hide">Formatted as <a href="http://en.wikipedia.org/wiki/Markdown#Syntax_examples"\
|
||||||
|
target="_blank">markdown</a></div>\
|
||||||
|
<button class="btn btn-small btn-info hide ed-text-save">Save</button>\
|
||||||
|
<a class="ed-text-cancel hide" style="cursor: pointer;">Cancel</a>\
|
||||||
|
</div>', args)).appendTo(me.parent);
|
||||||
|
|
||||||
var div = $a(me.wrapper, 'div', '', {marginTop:'5px', height:'23px'});
|
this.set_display = function(txt) {
|
||||||
|
me.$w.find('.ed-text-display').html(wn.markdown(txt));
|
||||||
// edit text
|
me.text = txt;
|
||||||
this.edit_btn = $a(div, 'a', '', {cursor:'pointer'}, '[edit]');
|
|
||||||
|
|
||||||
this.edit_btn.onclick = function() {
|
|
||||||
me.input.value = me.display.innerHTML;
|
|
||||||
me.show_as_input();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.set_display(me.text);
|
||||||
|
|
||||||
|
if(me.height) me.$w.find('.ed-text-input').css('height', me.height);
|
||||||
|
|
||||||
|
// edit
|
||||||
|
me.$w.find('.ed-text-edit').click(function() {
|
||||||
|
me.$w.find('.ed-text-input').val(me.text);
|
||||||
|
me.show_as_input();
|
||||||
|
})
|
||||||
|
|
||||||
// save button - save the new text
|
// save button - save the new text
|
||||||
// check if text is written
|
me.$w.find('.ed-text-save').click(
|
||||||
this.save_btn = $btn(div, 'Save', function() {
|
function() {
|
||||||
var v = me.rich_text ? wn.tinymce.get_value(me.input) : me.input.value;
|
var v = me.$w.find('.ed-text-input').val();
|
||||||
if(!v) {
|
// check if text is written
|
||||||
msgprint('Please write something!');
|
if(!v) {
|
||||||
return;
|
msgprint('Please write something!');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var btn = this;
|
||||||
|
$(btn).set_working();
|
||||||
|
$c_page('knowledge_base', 'question_view', 'update_item', {
|
||||||
|
dt: me.dt, dn: me.dn, fn: me.fieldname, text: v
|
||||||
|
},
|
||||||
|
function(r) {
|
||||||
|
$(btn).done_working();
|
||||||
|
if(r.exc) {msgprint(r.exc); return; }
|
||||||
|
me.set_display(v);
|
||||||
|
me.show_as_text();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
me.save_btn.set_working();
|
)
|
||||||
$c_page('knowledge_base', 'question_view', 'update_item', {
|
|
||||||
dt: me.dt, dn: me.dn, fn: me.fieldname, text: v
|
|
||||||
},
|
|
||||||
function(r, rt) {
|
|
||||||
me.save_btn.done_working();
|
|
||||||
if(r.exc) {msgprint(r.exc); return; }
|
|
||||||
me.display.innerHTML = v;
|
|
||||||
me.show_as_text();
|
|
||||||
});
|
|
||||||
}, {display: 'none'});
|
|
||||||
|
|
||||||
// cancel button
|
// cancel button
|
||||||
this.cancel_btn = $a(div, 'span', 'link_type', {color: '#555', display:'none'}, 'Cancel', {marginLeft:'7px'});
|
me.$w.find('.ed-text-cancel').click(function() {
|
||||||
this.cancel_btn.onclick = function() {
|
|
||||||
me.show_as_text();
|
me.show_as_text();
|
||||||
}
|
})
|
||||||
|
|
||||||
this.show_as_text = function() {
|
this.show_as_text = function() {
|
||||||
$ds(me.display); $ds(me.edit_btn);
|
me.$w.find('.ed-text-display, .ed-text-edit').toggle(true);
|
||||||
if(me.rich_text)
|
me.$w.find('.ed-text-input, .ed-text-save, .ed-text-cancel, .help').toggle(false);
|
||||||
wn.tinymce.remove(me.input);
|
|
||||||
$dh(me.input); $dh(me.save_btn); $dh(me.cancel_btn);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.show_as_input = function() {
|
this.show_as_input = function() {
|
||||||
$ds(me.input); $ds(me.save_btn); $ds(me.cancel_btn);
|
me.$w.find('.ed-text-display, .ed-text-edit').toggle(false);
|
||||||
$dh(me.edit_btn); $dh(me.display);
|
me.$w.find('.ed-text-input, .ed-text-save, .ed-text-cancel, .help').toggle(true);
|
||||||
if(me.rich_text)
|
|
||||||
wn.tinymce.add_simple(me.input, '300px');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -1,13 +1,12 @@
|
|||||||
<div class="layout-wrapper">
|
<div class="layout-wrapper layout-wrapper-appframe">
|
||||||
<a class="close" onclick="window.history.back();">×</a>
|
<div class="layout-appframe"></div>
|
||||||
<h1>Knowledge Base</h1>
|
<div class="layout-main">
|
||||||
<hr>
|
<div class="qv-question-wrapper">
|
||||||
<p style="text-align: right"><a href="#!questions">← Back to Questions</a></p>
|
</div>
|
||||||
<div class="qv-question-wrapper">
|
<hr>
|
||||||
|
<div class="qv-answer-wrapper">
|
||||||
|
</div>
|
||||||
|
<div class="add-answer-link"></div>
|
||||||
|
<div class="add-answer-area"></div>
|
||||||
</div>
|
</div>
|
||||||
<hr>
|
|
||||||
<div class="qv-answer-wrapper">
|
|
||||||
</div>
|
|
||||||
<div class="add-answer-link"></div>
|
|
||||||
<div class="add-answer-area"></div>
|
|
||||||
</div>
|
</div>
|
@ -15,6 +15,9 @@
|
|||||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
pscript['onload_question-view'] = function(wrapper) {
|
pscript['onload_question-view'] = function(wrapper) {
|
||||||
|
wrapper.appframe = new wn.ui.AppFrame($(wrapper).find('.layout-appframe'));
|
||||||
|
wrapper.appframe.title('<a href="#questions">Knowledge Base</a>');
|
||||||
|
|
||||||
wrapper.add_answer_area = $('.add-answer-area').get(0);
|
wrapper.add_answer_area = $('.add-answer-area').get(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -71,12 +74,10 @@ KBQuestionView = function(w, qid, qtext) {
|
|||||||
|
|
||||||
// add a link to open add answer
|
// add a link to open add answer
|
||||||
this.make_answer_box_link = function() {
|
this.make_answer_box_link = function() {
|
||||||
$('.add-answer-link').html('<button class="btn btn-small">\
|
wn.pages['question-view'].appframe.add_button('Add your answer', function() {
|
||||||
<i class="icon-plus"></i> Add you answer</button>').find('button').click(
|
$(this).toggle(false);
|
||||||
function() {
|
me.make_answer_box();
|
||||||
$(this).toggle(false);
|
}, 'icon-plus');
|
||||||
me.make_answer_box();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// answer box
|
// answer box
|
||||||
@ -130,21 +131,21 @@ KBAnswerList = function(args) {
|
|||||||
$.extend(this, args);
|
$.extend(this, args);
|
||||||
|
|
||||||
this.make_list = function() {
|
this.make_list = function() {
|
||||||
|
wn.pages['question-view'].appframe.clear_buttons();
|
||||||
this.list = new wn.ui.Listing({
|
this.list = new wn.ui.Listing({
|
||||||
parent: me.parent,
|
parent: me.parent,
|
||||||
|
appframe: wn.pages['question-view'].appframe,
|
||||||
as_dict: 1,
|
as_dict: 1,
|
||||||
no_result_message: 'No answers yet, be the first one to answer!',
|
no_result_message: 'No answers yet, be the first one to answer!',
|
||||||
render_row: function(body, data) {
|
render_row: function(body, data) {
|
||||||
new KBAnswer(body, data, me)
|
new KBAnswer(body, data, me)
|
||||||
},
|
},
|
||||||
get_query: function() {
|
get_query: function() {
|
||||||
return repl("SELECT t1.name, t1.owner, t1.answer, t1.points, t1._users_voted, t2.first_name, "
|
return repl("SELECT t1.name, t1.owner, t1.answer, t1._users_voted, t2.first_name, "
|
||||||
+"t2.last_name, t1.modified from tabAnswer t1, tabProfile t2 "
|
+"t2.last_name, t1.modified from tabAnswer t1, tabProfile t2 "
|
||||||
+"where question='%(qid)s' and t1.owner = t2.name "
|
+"where question='%(qid)s' and t1.owner = t2.name "
|
||||||
+"order by t1.points desc, t1.modified desc", {qid: me.qid})
|
+"order by t1.modified desc", {qid: me.qid})
|
||||||
},
|
}
|
||||||
title: 'Answers'
|
|
||||||
});
|
});
|
||||||
|
|
||||||
this.list.run();
|
this.list.run();
|
||||||
@ -158,7 +159,6 @@ KBAnswerList = function(args) {
|
|||||||
// kb answer
|
// kb answer
|
||||||
// answer
|
// answer
|
||||||
// by xxx | on xxx
|
// by xxx | on xxx
|
||||||
// points yyy
|
|
||||||
KBAnswer = function(body, data, ans_list) {
|
KBAnswer = function(body, data, ans_list) {
|
||||||
body.className = 'qv-answer';
|
body.className = 'qv-answer';
|
||||||
var edtxt = new EditableText({
|
var edtxt = new EditableText({
|
||||||
@ -169,7 +169,7 @@ KBAnswer = function(body, data, ans_list) {
|
|||||||
text: data.answer,
|
text: data.answer,
|
||||||
inp_class: 'qv-ans-input',
|
inp_class: 'qv-ans-input',
|
||||||
disp_class: 'qv-ans-text',
|
disp_class: 'qv-ans-text',
|
||||||
rich_text: 1
|
height: '300px'
|
||||||
});
|
});
|
||||||
|
|
||||||
$(edtxt.wrapper).addClass('well');
|
$(edtxt.wrapper).addClass('well');
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
<div class="layout-wrapper layout-wrapper-background">
|
<div class="layout-wrapper layout-wrapper-background">
|
||||||
|
<div class="layout-appframe"></div>
|
||||||
<div class="layout-main-section">
|
<div class="layout-main-section">
|
||||||
<a class="close" onclick="window.history.back();">×</a>
|
|
||||||
<h1>Knowledge Base</h1>
|
|
||||||
<hr>
|
|
||||||
<div class="well kb-search-wrapper">
|
<div class="well kb-search-wrapper">
|
||||||
<textarea></textarea>
|
<textarea></textarea>
|
||||||
<div>
|
<div>
|
||||||
|
@ -17,6 +17,9 @@
|
|||||||
pscript.onload_questions = function(wrapper) {
|
pscript.onload_questions = function(wrapper) {
|
||||||
body = $(wrapper).find('.layout-main-section').get(0);
|
body = $(wrapper).find('.layout-main-section').get(0);
|
||||||
|
|
||||||
|
wrapper.appframe = new wn.ui.AppFrame($(wrapper).find('.layout-appframe'));
|
||||||
|
wrapper.appframe.title('Knowledge Base');
|
||||||
|
|
||||||
// kb
|
// kb
|
||||||
var kb = new KnowledgeBase(body);
|
var kb = new KnowledgeBase(body);
|
||||||
|
|
||||||
@ -60,7 +63,7 @@ function KnowledgeBase(w) {
|
|||||||
if(this.search.value==$(this.search).attr('default_text')) {
|
if(this.search.value==$(this.search).attr('default_text')) {
|
||||||
msgprint('Please enter some text'); return;
|
msgprint('Please enter some text'); return;
|
||||||
}
|
}
|
||||||
this.suggest();
|
this.add_question([]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// suggest a few users who can answer
|
// suggest a few users who can answer
|
||||||
@ -123,7 +126,7 @@ function KnowledgeBase(w) {
|
|||||||
cond += ' and t1.`_user_tags` like "%' + f + '%"'
|
cond += ' and t1.`_user_tags` like "%' + f + '%"'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return repl('select t1.name, t1.owner, t1.question, t1.points, t1.modified, t1._user_tags, '
|
return repl('select t1.name, t1.owner, t1.question, t1.modified, t1._user_tags, '
|
||||||
+'t1._users_voted, t2.first_name, t2.last_name '
|
+'t1._users_voted, t2.first_name, t2.last_name '
|
||||||
+'from tabQuestion t1, tabProfile t2 '
|
+'from tabQuestion t1, tabProfile t2 '
|
||||||
+'where t1.docstatus!=2 '
|
+'where t1.docstatus!=2 '
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
h1, h2, h3, h4, h5 {
|
h1, h2, h3, h4, h5 {
|
||||||
font-family: "Helvetica Neue", "Open Sans", Helvetica, sans-serif;
|
font-family: "Helvetica Neue", "Open Sans", Helvetica, sans-serif;
|
||||||
font-weight: normal;
|
|
||||||
margin-top: 0.2em;
|
margin-top: 0.2em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
<div class="layout_wrapper">
|
<div class="layout-wrapper layout-wrapper-background">
|
||||||
<div class="web-content" id="content-about-us">
|
<div class="web-content" id="content-about-us">
|
||||||
{% if doc.headline %}
|
<div class="layout-main-section">
|
||||||
<h1>{{ doc.headline }}</h1>
|
{% if doc.headline %}
|
||||||
{% endif %}
|
<h1>{{ doc.headline }}</h1>
|
||||||
<div class="web-main-section">
|
{% endif %}
|
||||||
|
|
||||||
{{ doc.main_section_html }}
|
{{ doc.main_section_html }}
|
||||||
|
|
||||||
{% if doc.about_team %}
|
{% if doc.about_team %}
|
||||||
@ -28,7 +29,7 @@
|
|||||||
</table>
|
</table>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
<div class="web-side-section">
|
<div class="layout-side-section">
|
||||||
{{ doc.side_section_html }}
|
{{ doc.side_section_html }}
|
||||||
</div>
|
</div>
|
||||||
<div style="clear: both"></div>
|
<div style="clear: both"></div>
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
<div class="layout_wrapper">
|
<div class="layout-wrapper layout-wrapper-background">
|
||||||
<div class="web-content" id="blog-{{ doc.name }}">
|
<div class="web-content" id="blog-{{ doc.name }}">
|
||||||
<h1>Blog</h1>
|
<div class="layout-main-section">
|
||||||
<div class="web-main-section">
|
<h1>Blog</h1>
|
||||||
<h3>{{ doc.title }}</h3>
|
<h3>{{ doc.title }}</h3>
|
||||||
<div class="help">By {{ doc.full_name }} on {{ doc.updated }}</div>
|
<div class="help">By {{ doc.full_name }} on {{ doc.updated }}</div>
|
||||||
<br>
|
<br>
|
||||||
{{ doc.content_html }}
|
{{ doc.content_html }}
|
||||||
</div>
|
</div>
|
||||||
<div class="web-side-section">
|
<div class="layout-side-section">
|
||||||
<p><a href="#!blog">All Blogs</a></p>
|
<p><a href="#!blog">All Blogs</a></p>
|
||||||
<h4>Subscribe</h4>
|
<h4>Subscribe</h4>
|
||||||
<p>
|
<p>
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
<div class="layout_wrapper">
|
<div class="layout-wrapper layout-wrapper-background">
|
||||||
<div class="web-content" id="content-contact-us">
|
<div class="web-content" id="content-contact-us">
|
||||||
{% if doc.headline %}
|
<div class="layout-main-section">
|
||||||
<h1>{{ doc.headline }}</h1>
|
{% if doc.headline %}
|
||||||
{% endif %}
|
<h1>{{ doc.headline }}</h1>
|
||||||
<div class="web-main-section">
|
{% endif %}
|
||||||
<label>Your Name*</label>
|
<label>Your Name*</label>
|
||||||
<div><input name="contact-name" type="text"/></div>
|
<div><input name="contact-name" type="text"/></div>
|
||||||
<br>
|
<br>
|
||||||
@ -16,7 +16,7 @@
|
|||||||
<div><button class="btn primary">Send</button></div>
|
<div><button class="btn primary">Send</button></div>
|
||||||
{{ doc.main_section_html }}
|
{{ doc.main_section_html }}
|
||||||
</div>
|
</div>
|
||||||
<div class="web-side-section">
|
<div class="layout-side-section">
|
||||||
{{ doc.side_section_html }}
|
{{ doc.side_section_html }}
|
||||||
</div>
|
</div>
|
||||||
<div style="clear: both"></div>
|
<div style="clear: both"></div>
|
||||||
|
@ -1,26 +1,21 @@
|
|||||||
<div class="layout_wrapper">
|
<div class="layout-wrapper layout-wrapper-background">
|
||||||
<div class="web-content" id="content-{{ doc.name }}"
|
<div class="web-content" id="content-{{ doc.name }}"
|
||||||
style="text-align: {{ doc.text_align }};">
|
style="text-align: {{ doc.text_align }};">
|
||||||
{% if doc.head_section and doc.layout=='Two column with header' %}
|
|
||||||
<div class="web-head-section">
|
|
||||||
{{ doc.head_section_html }}
|
|
||||||
</div>
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% if doc.layout.startswith('Two column') %}
|
{% if doc.layout.startswith('Two column') %}
|
||||||
<div class="web-main-section">
|
<div class="layout-main-section">
|
||||||
|
{% else %}
|
||||||
|
<div class="layout-main">
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{{ doc.main_section_html }}
|
{{ doc.main_section_html }}
|
||||||
{% if doc.next_page_html %}
|
{% if doc.next_page_html %}
|
||||||
{{ doc.next_page_html }}
|
{{ doc.next_page_html }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if doc.layout.startswith('Two column') %}
|
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% if doc.layout.startswith('Two column') %}
|
{% if doc.layout.startswith('Two column') %}
|
||||||
<div class="web-side-section">
|
<div class="layout-side-section">
|
||||||
{{ doc.side_section_html }}
|
{{ doc.side_section_html }}
|
||||||
{% if doc.see_also %}
|
{% if doc.see_also %}
|
||||||
<div class="info-box">
|
<div class="info-box">
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
<div class="layout_wrapper">
|
<div class="layout-wrapper layout-wrapper-background">
|
||||||
<div class="web-content" id="content-blog">
|
<div class="web-content" id="content-blog">
|
||||||
<h1>Blog</h1>
|
<div class="layout-main-section">
|
||||||
<br>
|
<h1>Blog</h1>
|
||||||
<div class="web-main-section">
|
<br>
|
||||||
</div>
|
</div>
|
||||||
<div class="web-side-section">
|
<div class="layout-side-section">
|
||||||
<!-- for later
|
<!-- for later
|
||||||
<h4>Get Updates</h4>
|
<h4>Get Updates</h4>
|
||||||
<p>
|
<p>
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
pscript.onload_blog = function(wrapper) {
|
pscript.onload_blog = function(wrapper) {
|
||||||
wrapper.blog_list = new wn.ui.Listing({
|
wrapper.blog_list = new wn.ui.Listing({
|
||||||
parent: $(wrapper).find('.web-main-section').get(0),
|
parent: $(wrapper).find('.layout-main-section').get(0),
|
||||||
query: 'select tabBlog.name, title, left(content, 300) as content, tabBlog.modified, \
|
query: 'select tabBlog.name, title, left(content, 300) as content, tabBlog.modified, \
|
||||||
ifnull(first_name, "") as first_name, ifnull(last_name, "") as last_name \
|
ifnull(first_name, "") as first_name, ifnull(last_name, "") as last_name \
|
||||||
from tabProfile, tabBlog\
|
from tabProfile, tabBlog\
|
||||||
|
@ -186,7 +186,7 @@ wn.dom.set_box_shadow=function(ele,spread){$(ele).css('-moz-box-shadow','0px 0px
|
|||||||
$(ele).css('-webkit-box-shadow','0px 0px '+spread+'px rgba(0,0,0,0.3);')
|
$(ele).css('-webkit-box-shadow','0px 0px '+spread+'px rgba(0,0,0,0.3);')
|
||||||
$(ele).css('-box-shadow','0px 0px '+spread+'px rgba(0,0,0,0.3);')};(function($){$.fn.add_options=function(options_list){for(var i=0;i<options_list.length;i++){var v=options_list[i];value=v.value||v;label=v.label||v;$('<option>').html(label).attr('value',value).appendTo(this);}
|
$(ele).css('-box-shadow','0px 0px '+spread+'px rgba(0,0,0,0.3);')};(function($){$.fn.add_options=function(options_list){for(var i=0;i<options_list.length;i++){var v=options_list[i];value=v.value||v;label=v.label||v;$('<option>').html(label).attr('value',value).appendTo(this);}
|
||||||
$(this).val(options_list[0].value||options_list[0]);}
|
$(this).val(options_list[0].value||options_list[0]);}
|
||||||
$.fn.set_working=function(){var ele=this.get(0);if(ele.loading_img){$di(ele.loading_img)}else{ele.disabled=1;ele.loading_img=$('<img src="lib/images/ui/button-load.gif" \
|
$.fn.set_working=function(){var ele=this.get(0);if(ele.loading_img){$(ele.loading_img).toggle(true);}else{ele.disabled=1;ele.loading_img=$('<img src="lib/images/ui/button-load.gif" \
|
||||||
style="margin-left: 4px; margin-bottom: -2px; display: inline;" />').insertAfter(ele);}}
|
style="margin-left: 4px; margin-bottom: -2px; display: inline;" />').insertAfter(ele);}}
|
||||||
$.fn.done_working=function(){var ele=this.get(0);ele.disabled=0;if(ele.loading_img){$(ele.loading_img).toggle(false);};}})(jQuery);
|
$.fn.done_working=function(){var ele=this.get(0);ele.disabled=0;if(ele.loading_img){$(ele.loading_img).toggle(false);};}})(jQuery);
|
||||||
/*
|
/*
|
||||||
@ -433,7 +433,7 @@ if(data.docstatus==0||data.docstatus==null){data.docstatus_icon='icon-pencil';da
|
|||||||
*/
|
*/
|
||||||
wn.provide('wn.views.pageview');wn.views.pageview={pages:{},with_page:function(name,callback){if(!locals.Page[name]){wn.call({method:'webnotes.widgets.page.getpage',args:{'name':name},callback:callback});}else{callback();}},show:function(name){if(!name)name=wn.boot.home_page;wn.views.pageview.with_page(name,function(r){if(r&&r.exc){if(!r['403'])wn.container.change_to('404');}else if(!wn.pages[name]){wn.views.pageview.pages[name]=new wn.views.Page(name);}
|
wn.provide('wn.views.pageview');wn.views.pageview={pages:{},with_page:function(name,callback){if(!locals.Page[name]){wn.call({method:'webnotes.widgets.page.getpage',args:{'name':name},callback:callback});}else{callback();}},show:function(name){if(!name)name=wn.boot.home_page;wn.views.pageview.with_page(name,function(r){if(r&&r.exc){if(!r['403'])wn.container.change_to('404');}else if(!wn.pages[name]){wn.views.pageview.pages[name]=new wn.views.Page(name);}
|
||||||
wn.container.change_to(name);});}}
|
wn.container.change_to(name);});}}
|
||||||
wn.views.Page=Class.extend({init:function(name){this.name=name;var me=this;this.pagedoc=locals.Page[this.name];this.wrapper=wn.container.add_page(this.name);this.wrapper.label=this.pagedoc.title||this.pagedoc.name;this.wrapper.innerHTML=this.pagedoc.content;wn.dom.eval(this.pagedoc.__script||this.pagedoc.script||'');wn.dom.set_style(this.pagedoc.style);this.trigger('onload');$(this.wrapper).bind('show',function(){cur_frm=null;me.trigger('onshow');me.trigger('refresh');});},trigger:function(eventname){var me=this;try{if(pscript[eventname+'_'+this.name]){pscript[eventname+'_'+this.name](me.wrapper);}else if(me.wrapper[eventname]){me.wrapper[eventname](me.wrapper);}}catch(e){console.log(e);}}})
|
wn.views.Page=Class.extend({init:function(name){this.name=name;var me=this;this.pagedoc=locals.Page[this.name];this.wrapper=wn.container.add_page(this.name);this.wrapper.label=this.pagedoc.title||this.pagedoc.name;this.wrapper.innerHTML=this.pagedoc.content;wn.dom.eval(this.pagedoc.__script||this.pagedoc.script||'');wn.dom.set_style(this.pagedoc.style||'');this.trigger('onload');$(this.wrapper).bind('show',function(){cur_frm=null;me.trigger('onshow');me.trigger('refresh');});},trigger:function(eventname){var me=this;try{if(pscript[eventname+'_'+this.name]){pscript[eventname+'_'+this.name](me.wrapper);}else if(me.wrapper[eventname]){me.wrapper[eventname](me.wrapper);}}catch(e){console.log(e);}}})
|
||||||
wn.views.make_404=function(){var page=wn.container.add_page('404');$(page).html('<div class="layout-wrapper">\
|
wn.views.make_404=function(){var page=wn.container.add_page('404');$(page).html('<div class="layout-wrapper">\
|
||||||
<h1>Not Found</h1><br>\
|
<h1>Not Found</h1><br>\
|
||||||
<p>Sorry we were unable to find what you were looking for.</p>\
|
<p>Sorry we were unable to find what you were looking for.</p>\
|
||||||
@ -929,7 +929,7 @@ if(f.init)f.init();f.make_body();return f;}
|
|||||||
wn.ui.AppFrame=Class.extend({init:function(parent){this.buttons={};this.$w=$('<div></div>').appendTo(parent);this.$titlebar=$('<div class="appframe-titlebar">\
|
wn.ui.AppFrame=Class.extend({init:function(parent){this.buttons={};this.$w=$('<div></div>').appendTo(parent);this.$titlebar=$('<div class="appframe-titlebar">\
|
||||||
<span class="appframe-title"></span>\
|
<span class="appframe-title"></span>\
|
||||||
<span class="close">×</span>\
|
<span class="close">×</span>\
|
||||||
</div>').appendTo(this.$w);this.$w.find('.close').click(function(){window.history.back();})},title:function(txt){this.$titlebar.find('.appframe-title').text(txt);},add_button:function(label,click,icon){if(!this.$w.find('.appframe-toolbar').length)
|
</div>').appendTo(this.$w);this.$w.find('.close').click(function(){window.history.back();})},title:function(txt){this.$titlebar.find('.appframe-title').html(txt);},add_button:function(label,click,icon){if(!this.$w.find('.appframe-toolbar').length)
|
||||||
this.$w.append('<div class="appframe-toolbar"></div>');args={label:label,icon:''};if(icon){args.icon='<i class="'+icon+'"></i>';}
|
this.$w.append('<div class="appframe-toolbar"></div>');args={label:label,icon:''};if(icon){args.icon='<i class="'+icon+'"></i>';}
|
||||||
this.buttons[label]=$(repl('<button class="btn btn-small">\
|
this.buttons[label]=$(repl('<button class="btn btn-small">\
|
||||||
%(icon)s %(label)s</button>',args)).click(click).appendTo(this.$w.find('.appframe-toolbar'));return this.buttons[label];},clear_buttons:function(){this.$w.find('.appframe-toolbar').empty();}})
|
%(icon)s %(label)s</button>',args)).click(click).appendTo(this.$w.find('.appframe-toolbar'));return this.buttons[label];},clear_buttons:function(){this.$w.find('.appframe-toolbar').empty();}})
|
||||||
|
@ -73,7 +73,7 @@ wn.dom.set_box_shadow=function(ele,spread){$(ele).css('-moz-box-shadow','0px 0px
|
|||||||
$(ele).css('-webkit-box-shadow','0px 0px '+spread+'px rgba(0,0,0,0.3);')
|
$(ele).css('-webkit-box-shadow','0px 0px '+spread+'px rgba(0,0,0,0.3);')
|
||||||
$(ele).css('-box-shadow','0px 0px '+spread+'px rgba(0,0,0,0.3);')};(function($){$.fn.add_options=function(options_list){for(var i=0;i<options_list.length;i++){var v=options_list[i];value=v.value||v;label=v.label||v;$('<option>').html(label).attr('value',value).appendTo(this);}
|
$(ele).css('-box-shadow','0px 0px '+spread+'px rgba(0,0,0,0.3);')};(function($){$.fn.add_options=function(options_list){for(var i=0;i<options_list.length;i++){var v=options_list[i];value=v.value||v;label=v.label||v;$('<option>').html(label).attr('value',value).appendTo(this);}
|
||||||
$(this).val(options_list[0].value||options_list[0]);}
|
$(this).val(options_list[0].value||options_list[0]);}
|
||||||
$.fn.set_working=function(){var ele=this.get(0);if(ele.loading_img){$di(ele.loading_img)}else{ele.disabled=1;ele.loading_img=$('<img src="lib/images/ui/button-load.gif" \
|
$.fn.set_working=function(){var ele=this.get(0);if(ele.loading_img){$(ele.loading_img).toggle(true);}else{ele.disabled=1;ele.loading_img=$('<img src="lib/images/ui/button-load.gif" \
|
||||||
style="margin-left: 4px; margin-bottom: -2px; display: inline;" />').insertAfter(ele);}}
|
style="margin-left: 4px; margin-bottom: -2px; display: inline;" />').insertAfter(ele);}}
|
||||||
$.fn.done_working=function(){var ele=this.get(0);ele.disabled=0;if(ele.loading_img){$(ele.loading_img).toggle(false);};}})(jQuery);
|
$.fn.done_working=function(){var ele=this.get(0);ele.disabled=0;if(ele.loading_img){$(ele.loading_img).toggle(false);};}})(jQuery);
|
||||||
/*
|
/*
|
||||||
@ -320,7 +320,7 @@ if(data.docstatus==0||data.docstatus==null){data.docstatus_icon='icon-pencil';da
|
|||||||
*/
|
*/
|
||||||
wn.provide('wn.views.pageview');wn.views.pageview={pages:{},with_page:function(name,callback){if(!locals.Page[name]){wn.call({method:'webnotes.widgets.page.getpage',args:{'name':name},callback:callback});}else{callback();}},show:function(name){if(!name)name=wn.boot.home_page;wn.views.pageview.with_page(name,function(r){if(r&&r.exc){if(!r['403'])wn.container.change_to('404');}else if(!wn.pages[name]){wn.views.pageview.pages[name]=new wn.views.Page(name);}
|
wn.provide('wn.views.pageview');wn.views.pageview={pages:{},with_page:function(name,callback){if(!locals.Page[name]){wn.call({method:'webnotes.widgets.page.getpage',args:{'name':name},callback:callback});}else{callback();}},show:function(name){if(!name)name=wn.boot.home_page;wn.views.pageview.with_page(name,function(r){if(r&&r.exc){if(!r['403'])wn.container.change_to('404');}else if(!wn.pages[name]){wn.views.pageview.pages[name]=new wn.views.Page(name);}
|
||||||
wn.container.change_to(name);});}}
|
wn.container.change_to(name);});}}
|
||||||
wn.views.Page=Class.extend({init:function(name){this.name=name;var me=this;this.pagedoc=locals.Page[this.name];this.wrapper=wn.container.add_page(this.name);this.wrapper.label=this.pagedoc.title||this.pagedoc.name;this.wrapper.innerHTML=this.pagedoc.content;wn.dom.eval(this.pagedoc.__script||this.pagedoc.script||'');wn.dom.set_style(this.pagedoc.style);this.trigger('onload');$(this.wrapper).bind('show',function(){cur_frm=null;me.trigger('onshow');me.trigger('refresh');});},trigger:function(eventname){var me=this;try{if(pscript[eventname+'_'+this.name]){pscript[eventname+'_'+this.name](me.wrapper);}else if(me.wrapper[eventname]){me.wrapper[eventname](me.wrapper);}}catch(e){console.log(e);}}})
|
wn.views.Page=Class.extend({init:function(name){this.name=name;var me=this;this.pagedoc=locals.Page[this.name];this.wrapper=wn.container.add_page(this.name);this.wrapper.label=this.pagedoc.title||this.pagedoc.name;this.wrapper.innerHTML=this.pagedoc.content;wn.dom.eval(this.pagedoc.__script||this.pagedoc.script||'');wn.dom.set_style(this.pagedoc.style||'');this.trigger('onload');$(this.wrapper).bind('show',function(){cur_frm=null;me.trigger('onshow');me.trigger('refresh');});},trigger:function(eventname){var me=this;try{if(pscript[eventname+'_'+this.name]){pscript[eventname+'_'+this.name](me.wrapper);}else if(me.wrapper[eventname]){me.wrapper[eventname](me.wrapper);}}catch(e){console.log(e);}}})
|
||||||
wn.views.make_404=function(){var page=wn.container.add_page('404');$(page).html('<div class="layout-wrapper">\
|
wn.views.make_404=function(){var page=wn.container.add_page('404');$(page).html('<div class="layout-wrapper">\
|
||||||
<h1>Not Found</h1><br>\
|
<h1>Not Found</h1><br>\
|
||||||
<p>Sorry we were unable to find what you were looking for.</p>\
|
<p>Sorry we were unable to find what you were looking for.</p>\
|
||||||
@ -589,7 +589,7 @@ $(wrapper).hide().fadeIn(1000);}
|
|||||||
wn.ui.AppFrame=Class.extend({init:function(parent){this.buttons={};this.$w=$('<div></div>').appendTo(parent);this.$titlebar=$('<div class="appframe-titlebar">\
|
wn.ui.AppFrame=Class.extend({init:function(parent){this.buttons={};this.$w=$('<div></div>').appendTo(parent);this.$titlebar=$('<div class="appframe-titlebar">\
|
||||||
<span class="appframe-title"></span>\
|
<span class="appframe-title"></span>\
|
||||||
<span class="close">×</span>\
|
<span class="close">×</span>\
|
||||||
</div>').appendTo(this.$w);this.$w.find('.close').click(function(){window.history.back();})},title:function(txt){this.$titlebar.find('.appframe-title').text(txt);},add_button:function(label,click,icon){if(!this.$w.find('.appframe-toolbar').length)
|
</div>').appendTo(this.$w);this.$w.find('.close').click(function(){window.history.back();})},title:function(txt){this.$titlebar.find('.appframe-title').html(txt);},add_button:function(label,click,icon){if(!this.$w.find('.appframe-toolbar').length)
|
||||||
this.$w.append('<div class="appframe-toolbar"></div>');args={label:label,icon:''};if(icon){args.icon='<i class="'+icon+'"></i>';}
|
this.$w.append('<div class="appframe-toolbar"></div>');args={label:label,icon:''};if(icon){args.icon='<i class="'+icon+'"></i>';}
|
||||||
this.buttons[label]=$(repl('<button class="btn btn-small">\
|
this.buttons[label]=$(repl('<button class="btn btn-small">\
|
||||||
%(icon)s %(label)s</button>',args)).click(click).appendTo(this.$w.find('.appframe-toolbar'));return this.buttons[label];},clear_buttons:function(){this.$w.find('.appframe-toolbar').empty();}})
|
%(icon)s %(label)s</button>',args)).click(click).appendTo(this.$w.find('.appframe-toolbar'));return this.buttons[label];},clear_buttons:function(){this.$w.find('.appframe-toolbar').empty();}})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user