From 0ad995460c3551175be9cfc0920d35b5c4873be8 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Fri, 22 Feb 2013 10:34:22 +0530 Subject: [PATCH] fixed tags in kb --- public/js/kb_common.js | 1 + utilities/page/question_view/question_view.js | 4 ++- utilities/page/questions/questions.js | 25 ++++++++++--------- website/templates/html/product_in_list.html | 2 +- website/templates/pages/attributions.html | 4 +-- 5 files changed, 19 insertions(+), 17 deletions(-) diff --git a/public/js/kb_common.js b/public/js/kb_common.js index 1e3fcba15a..6dca3f8dbb 100644 --- a/public/js/kb_common.js +++ b/public/js/kb_common.js @@ -108,6 +108,7 @@ EditableText = function(args) { this.set_display(me.text); if(me.height) me.$w.find('.ed-text-input').css('height', me.height); + if(me.width) me.$w.find('.ed-text-input').css('width', me.width); // edit me.$w.find('.ed-text-edit').click(function() { diff --git a/utilities/page/question_view/question_view.js b/utilities/page/question_view/question_view.js index ea1a2dc70a..e479e131c5 100644 --- a/utilities/page/question_view/question_view.js +++ b/utilities/page/question_view/question_view.js @@ -90,6 +90,7 @@ KBQuestionView = function(w, qid, qtext) { $(w.add_answer_area, '

Add your Answer

\
In markdown format
'); 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'); diff --git a/utilities/page/questions/questions.js b/utilities/page/questions/questions.js index 0e88728d22..e7e99b5323 100644 --- a/utilities/page/questions/questions.js +++ b/utilities/page/questions/questions.js @@ -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) { diff --git a/website/templates/html/product_in_list.html b/website/templates/html/product_in_list.html index 5daa44e167..43b0134c1d 100644 --- a/website/templates/html/product_in_list.html +++ b/website/templates/html/product_in_list.html @@ -6,7 +6,7 @@ {% include 'html/product_missing_image.html' %} {% endif %} -
+

{{ item_name }}

Item Code: {{ name }}

diff --git a/website/templates/pages/attributions.html b/website/templates/pages/attributions.html index e587484377..2d195ba9cd 100644 --- a/website/templates/pages/attributions.html +++ b/website/templates/pages/attributions.html @@ -11,8 +11,7 @@ {% set title="ERPNext - Web Based, Open Source ERP" %} {% block content %} -
-
+

This website is made using these Awesome Open Source Projects


@@ -105,6 +104,5 @@

Note: A link to this page must be easily accessible.

-
{% endblock %} \ No newline at end of file