Browse Source

[minor] [website] enable comments in any web page

version-14
Anand Doshi 11 years ago
parent
commit
4963b5defd
3 changed files with 19 additions and 1 deletions
  1. +6
    -0
      website/doctype/web_page/templates/generators/web_page.html
  2. +6
    -0
      website/doctype/web_page/web_page.py
  3. +7
    -1
      website/doctype/web_page/web_page.txt

+ 6
- 0
website/doctype/web_page/templates/generators/web_page.html View File

@@ -45,6 +45,12 @@
<i class="icon-arrow-down"></i> {{ links.child.title }}</a>
{%- endif -%}
</div>
<div class="clearfix"></div>
{%- endif %}
{% if enable_comments -%}
<hr>
<h3>Comments</h3>
{% include 'lib/website/templates/includes/comments.html' %}
{%- endif %}
{%- endblock %}
</div>


+ 6
- 0
website/doctype/web_page/web_page.py View File

@@ -54,6 +54,12 @@ class DocType():
# parent, child, next sibling links
self.doc.links = self.get_navigation_links()
if self.doc.enable_comments:
self.doc.comment_list = webnotes.conn.sql("""select
comment, comment_by_fullname, creation
from `tabComment` where comment_doctype="Web Page"
and comment_docname=%s order by creation""", self.doc.name, as_dict=1) or []
def get_breadcrumbs(self):
breadcrumbs = []


+ 7
- 1
website/doctype/web_page/web_page.txt View File

@@ -2,7 +2,7 @@
{
"creation": "2013-03-28 10:35:30",
"docstatus": 0,
"modified": "2013-11-12 12:05:20",
"modified": "2013-11-13 15:30:25",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -114,6 +114,12 @@
"fieldtype": "Section Break",
"label": "More"
},
{
"doctype": "DocField",
"fieldname": "enable_comments",
"fieldtype": "Check",
"label": "Enable Comments"
},
{
"doctype": "DocField",
"fieldname": "text_align",


Loading…
Cancel
Save