# HG changeset patch # User Ahsan Ali Shahid # Date 1377039126 -18000 # Node ID a22259c9862e67fa97b860481278d0718faffa1d # Parent d534881629ff939949fab3f4de372788e2bfb77e Removed redundant code for ratings field and add a separate template file for ratings field. Now ratings will be handled by Jquery. diff -r d534881629ff -r a22259c9862e static/js/agora.js --- a/static/js/agora.js Mon Aug 19 20:30:19 2013 +0500 +++ b/static/js/agora.js Wed Aug 21 03:52:06 2013 +0500 @@ -80,5 +80,9 @@ currentStyle = newStyle; }); }); + $("input[name=Rate]").change(function() + { + $("#rate_form").submit(); + }); } )(jQuery); \ No newline at end of file diff -r d534881629ff -r a22259c9862e templates/snippet/rate_form.djhtml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/templates/snippet/rate_form.djhtml Wed Aug 21 03:52:06 2013 +0500 @@ -0,0 +1,12 @@ +
+
+{% csrf_token%} +

Rate this Snippet:

+
    +{% for x in "12345" %} +
  • +{% endfor %} +
+ +
+
\ No newline at end of file diff -r d534881629ff -r a22259c9862e templates/snippet/snippet_details.djhtml --- a/templates/snippet/snippet_details.djhtml Mon Aug 19 20:30:19 2013 +0500 +++ b/templates/snippet/snippet_details.djhtml Wed Aug 21 03:52:06 2013 +0500 @@ -86,21 +86,7 @@ {% include "snippet/snippet_box.djhtml" with lines=snippet.content_splitted %}
-
- -
- {% csrf_token%} -

Rate this Snippet:

-
    -
  • -
  • -
  • -
  • -
  • -
- -
-
+ {% include "snippet/rate_form.djhtml" %}

Comments for this snippet:

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