fixed tags in kb

This commit is contained in:
Rushabh Mehta
2013-02-22 10:34:22 +05:30
parent d2b2174ee4
commit 0ad995460c
5 changed files with 19 additions and 17 deletions

View File

@@ -90,6 +90,7 @@ KBQuestionView = function(w, qid, qtext) {
$(w.add_answer_area, '<h3>Add your Answer</h3>\
<div class="help">In markdown format</div>');
this.input = $a(w.add_answer_area, 'textarea');
$(this.input).css({width: "90%", height: "200px"});
//wn.tinymce.add_simple(this.input);
this.btn = $btn($a(w.add_answer_area, 'div'), 'Post', function() {
@@ -174,7 +175,8 @@ KBAnswer = function(body, data, ans_list) {
text: data.answer,
inp_class: 'qv-ans-input',
disp_class: 'qv-ans-text',
height: '300px'
height: '300px',
width: '90%'
});
$(edtxt.wrapper).addClass('well');

View File

@@ -25,19 +25,17 @@ pscript.onload_questions = function(wrapper) {
// kb
var kb = new KnowledgeBase(body);
// sidebar
this.sidebar = new wn.widgets.PageSidebar($(wrapper).find('.questions-tags').get(0), {
sections: [
{
title: 'Top Tags',
render: function(body) {
new wn.widgets.TagCloud(body, 'Question', function(tag)
{ kb.set_tag_filter(tag) });
}
wn.model.with_doctype("Question", function() {
this.sidebar_stats = new wn.views.SidebarStats({
doctype: "Question",
stats: ["_user_tags"],
parent: $(wrapper).find('.questions-tags'),
set_filter: function(fieldname, label) {
kb.set_filter(fieldname, label);
//me.set_filter(fieldname, label);
}
]
});
set_title('Knowledge Base');
});
})
}
// knowledge base object
@@ -137,6 +135,9 @@ function KnowledgeBase(w) {
}
this.set_filter = function(fieldname, label) {
this.set_tag_filter({label:label});
}
// add a tag filter to the search in the
// main page
this.set_tag_filter = function(tag) {