Mercurial > hg > agora-ahsan
changeset 196:134f726fd62c draft
Removed extrawhitespaces and moved comments template files to templates folder
author | Ahsan Ali Shahid <ahsan.ali.shahid@gmail.com> |
---|---|
date | Thu, 04 Jul 2013 15:45:50 +0500 |
parents | baf8776dc44d |
children | 1341435d4d33 |
files | apps/treecomments/forms.py apps/treecomments/models.py apps/treecomments/views.py comments/form.html comments/list.html comments/rawcomment.html static/css/agora.less static/js/agora.js templates/comments/form.html templates/comments/list.html templates/comments/rawcomment.html templates/snippet/snippet_details.djhtml |
diffstat | 9 files changed, 9 insertions(+), 32 deletions(-) [+] |
line wrap: on
line diff
--- a/apps/treecomments/forms.py +++ b/apps/treecomments/forms.py @@ -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
--- a/apps/treecomments/models.py +++ b/apps/treecomments/models.py @@ -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):
--- a/apps/treecomments/views.py +++ b/apps/treecomments/views.py @@ -1,1 +0,0 @@ -# Create your views here.
--- a/static/css/agora.less +++ b/static/css/agora.less @@ -433,7 +433,6 @@ max-width:700px; border-left: 1px solid #e8e8e8; margin: 5px; - } #comment-box {
--- a/static/js/agora.js +++ b/static/js/agora.js @@ -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
rename from comments/form.html rename to templates/comments/form.html --- a/comments/form.html +++ b/templates/comments/form.html @@ -9,7 +9,7 @@ {{ form.security_hash }} {# if it is has a parent #} - {% if node.id %} + {% if node.id %} <input type="hidden" name="parent" id="parent_id" value="{{ node.id }}" /> <input type = 'button' value = "Reply" onClick= "$(this).ShowCommentForm({{ node.id }})" id = "{{ node.id }}-button" class = "reply-button"/> @@ -20,15 +20,12 @@ <h4> {%if node.id%} Reply: - {%else%} Comment: + {%else%} Comment: {%endif%} </h4> - {{form.comment}} + {{form.comment}} <br/> <input type="submit" value = "Submit" class = 'reply-button' > </div> - - - -</form> + </form> \ No newline at end of file
rename from comments/rawcomment.html rename to templates/comments/rawcomment.html --- a/comments/rawcomment.html +++ b/templates/comments/rawcomment.html @@ -19,11 +19,6 @@ <p class = "comment-bar"><a href = "{{ object.get_absolute_url }}#c{{ node.id }}"><strong>{{ node.user }} </strong> ยท {{ node.submit_date|timesince }} ago </a> </p> <p class = "comment"><p class = "comment-body"> {{ node.comment }} </p> - - - - - {% render_comment_form for object %} </div> {# recursion tree logic #}
--- a/templates/snippet/snippet_details.djhtml +++ b/templates/snippet/snippet_details.djhtml @@ -81,9 +81,7 @@ {% include "snippet/snippet_box.djhtml" with lines=snippet.content_splitted %} <br /> - <h2> Comments for this snippet: </h2> - -{% with snippet as object %}{% include "comments/rawcomment.html" %}{% endwith %}. + <h2> Comments for this snippet: </h2>{% with snippet as object %}{% include "comments/rawcomment.html" %}{% endwith %}. <h2 id="revise">{% trans "Revise this snippet" %}</h2> @@ -175,5 +173,4 @@ <script type="text/javascript"> {%include "snippet/snippet_details.js" %} </script> -{% endblock script_footer %} - \ No newline at end of file +{% endblock script_footer %} \ No newline at end of file