# HG changeset patch # User Ahsan Ali Shahid # Date 1372934750 -18000 # Node ID 134f726fd62cc91033ba235d31925320e5bf8af8 # Parent baf8776dc44d42911bb9d0721ddcfa360a22cd11 Removed extrawhitespaces and moved comments template files to templates folder diff -r baf8776dc44d -r 134f726fd62c apps/treecomments/forms.py --- a/apps/treecomments/forms.py Tue Jul 02 02:09:21 2013 +0500 +++ b/apps/treecomments/forms.py Thu Jul 04 15:45:50 2013 +0500 @@ -5,11 +5,9 @@ class TreeCommentsForm(CommentForm): parent = forms.ModelChoiceField(queryset=TreeComments.objects.all(), required=False, widget=forms.HiddenInput) - def get_comment_model(self): return TreeComments - def get_comment_create_data(self): data = super(TreeCommentsForm,self).get_comment_create_data() data['parent'] = self.cleaned_data['parent'] - return data \ No newline at end of file + return data \ No newline at end of file diff -r baf8776dc44d -r 134f726fd62c apps/treecomments/models.py --- a/apps/treecomments/models.py Tue Jul 02 02:09:21 2013 +0500 +++ b/apps/treecomments/models.py Thu Jul 04 15:45:50 2013 +0500 @@ -1,6 +1,6 @@ from django.contrib.comments.models import Comment from mptt.models import MPTTModel, TreeForeignKey -# Create your models here. + class TreeComments(MPTTModel,Comment): diff -r baf8776dc44d -r 134f726fd62c apps/treecomments/views.py --- a/apps/treecomments/views.py Tue Jul 02 02:09:21 2013 +0500 +++ b/apps/treecomments/views.py Thu Jul 04 15:45:50 2013 +0500 @@ -1,1 +0,0 @@ -# Create your views here. diff -r baf8776dc44d -r 134f726fd62c comments/form.html --- a/comments/form.html Tue Jul 02 02:09:21 2013 +0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,34 +0,0 @@ -{% load comments i18n %} - - -
- {% csrf_token %} - {{ form.object_pk }} - {{ form.content_type }} - {{ form.timestamp }} - {{ form.security_hash }} - {# if it is has a parent #} - - {% if node.id %} - - - - {% endif %} - -
-

- {%if node.id%} - Reply: - {%else%} Comment: - {%endif%} -

- {{form.comment}} - -
- -
- - - -
diff -r baf8776dc44d -r 134f726fd62c comments/list.html --- a/comments/list.html Tue Jul 02 02:09:21 2013 +0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,14 +0,0 @@ -Override -
- {% for comment in comment_list %} -
- {{ comment.submit_date }} - {{ comment.name }} -
-
{{ comment.user_name }}
-
{{ comment.ip_address }}
-
{{ comment.user_email }}
-
-

{{ comment.user_url }}

-
- {% endfor %} -
diff -r baf8776dc44d -r 134f726fd62c comments/rawcomment.html --- a/comments/rawcomment.html Tue Jul 02 02:09:21 2013 +0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,44 +0,0 @@ -{% load comments %} -{% load mptt_tags %} -
- - - -{% if user.is_authenticated %} - - -{% render_comment_form for object %} - -{% get_comment_list for object as comments %} - -{% if comments %} -{% recursetree comments %} - - -
- -

{{ node.user }} · {{ node.submit_date|timesince }} ago

-

{{ node.comment }}

- - - - - - {% render_comment_form for object %} -
- {# recursion tree logic #} - {% if not node.is_leaf_node %} -
- {{ children }} -
- {% endif %} - -{% endrecursetree %} -{% endif%} - -{% else %} -

You need to be logged in to see comments

- -{% endif%} - -
\ No newline at end of file diff -r baf8776dc44d -r 134f726fd62c static/css/agora.less --- a/static/css/agora.less Tue Jul 02 02:09:21 2013 +0500 +++ b/static/css/agora.less Thu Jul 04 15:45:50 2013 +0500 @@ -433,7 +433,6 @@ max-width:700px; border-left: 1px solid #e8e8e8; margin: 5px; - } #comment-box { diff -r baf8776dc44d -r 134f726fd62c static/js/agora.js --- a/static/js/agora.js Tue Jul 02 02:09:21 2013 +0500 +++ b/static/js/agora.js Thu Jul 04 15:45:50 2013 +0500 @@ -40,9 +40,6 @@ $.fn.ShowCommentForm = function(id){ $(this).hide(); $('#' + id).show(); - - - }; $(document).ready(function () { @@ -83,10 +80,5 @@ currentStyle = newStyle; }); }); - - - } -)(jQuery); - - +)(jQuery); \ No newline at end of file diff -r baf8776dc44d -r 134f726fd62c templates/comments/form.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/templates/comments/form.html Thu Jul 04 15:45:50 2013 +0500 @@ -0,0 +1,31 @@ +{% load comments i18n %} + + +
+ {% csrf_token %} + {{ form.object_pk }} + {{ form.content_type }} + {{ form.timestamp }} + {{ form.security_hash }} + {# if it is has a parent #} + + {% if node.id %} + + + + {% endif %} + +
+

+ {%if node.id%} + Reply: + {%else%} Comment: + {%endif%} +

+ {{form.comment}} + +
+ +
+
\ No newline at end of file diff -r baf8776dc44d -r 134f726fd62c templates/comments/list.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/templates/comments/list.html Thu Jul 04 15:45:50 2013 +0500 @@ -0,0 +1,14 @@ +Override +
+ {% for comment in comment_list %} +
+ {{ comment.submit_date }} - {{ comment.name }} +
+
{{ comment.user_name }}
+
{{ comment.ip_address }}
+
{{ comment.user_email }}
+
+

{{ comment.user_url }}

+
+ {% endfor %} +
diff -r baf8776dc44d -r 134f726fd62c templates/comments/rawcomment.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/templates/comments/rawcomment.html Thu Jul 04 15:45:50 2013 +0500 @@ -0,0 +1,39 @@ +{% load comments %} +{% load mptt_tags %} +
+ + + +{% if user.is_authenticated %} + + +{% render_comment_form for object %} + +{% get_comment_list for object as comments %} + +{% if comments %} +{% recursetree comments %} + + +
+ +

{{ node.user }} · {{ node.submit_date|timesince }} ago

+

{{ node.comment }}

+ {% render_comment_form for object %} +
+ {# recursion tree logic #} + {% if not node.is_leaf_node %} +
+ {{ children }} +
+ {% endif %} + +{% endrecursetree %} +{% endif%} + +{% else %} +

You need to be logged in to see comments

+ +{% endif%} + +
\ No newline at end of file diff -r baf8776dc44d -r 134f726fd62c templates/snippet/snippet_details.djhtml --- a/templates/snippet/snippet_details.djhtml Tue Jul 02 02:09:21 2013 +0500 +++ b/templates/snippet/snippet_details.djhtml Thu Jul 04 15:45:50 2013 +0500 @@ -81,9 +81,7 @@ {% include "snippet/snippet_box.djhtml" with lines=snippet.content_splitted %}
-

Comments for this snippet:

- -{% with snippet as object %}{% include "comments/rawcomment.html" %}{% endwith %}. +

Comments for this snippet:

{% with snippet as object %}{% include "comments/rawcomment.html" %}{% endwith %}.

{% trans "Revise this snippet" %}

@@ -175,5 +173,4 @@ -{% endblock script_footer %} - \ No newline at end of file +{% endblock script_footer %} \ No newline at end of file