소스 검색

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

version-14
Anand Doshi 11 년 전
부모
커밋
4963b5defd
3개의 변경된 파일19개의 추가작업 그리고 1개의 파일을 삭제
  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 파일 보기

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


+ 6
- 0
website/doctype/web_page/web_page.py 파일 보기

@@ -54,6 +54,12 @@ class DocType():
# parent, child, next sibling links # parent, child, next sibling links
self.doc.links = self.get_navigation_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): def get_breadcrumbs(self):
breadcrumbs = [] breadcrumbs = []


+ 7
- 1
website/doctype/web_page/web_page.txt 파일 보기

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


불러오는 중...
취소
저장