Skip to content
This repository
Browse code

include user rating in reviews

  • Loading branch information...
commit cc032da2887ac74f7decc483480332ede7f76b72 1 parent 1abf1ca
Luke Hatcher lukeman authored
6 symposion/reviews/views.py
@@ -53,9 +53,11 @@ def proposals_generator(request, queryset, user_pk=None, check_speaker=True):
53 53 lookup_params["user"] = request.user
54 54
55 55 try:
56   - obj.latest_vote = LatestVote.objects.get(**lookup_params).css_class()
  56 + obj.user_vote = LatestVote.objects.get(**lookup_params).vote
  57 + obj.user_vote_css = LatestVote.objects.get(**lookup_params).css_class()
57 58 except LatestVote.DoesNotExist:
58   - obj.latest_vote = "no-vote"
  59 + obj.user_vote = None
  60 + obj.user_vote_css = "no-vote"
59 61
60 62 yield obj
61 63
4 symposion/templates/reviews/_review_table.html
@@ -10,11 +10,12 @@
10 10 <th>{% trans "+0" %}</th>
11 11 <th>{% trans "-0" %}</th>
12 12 <th>{% trans "-1" %}</th>
  13 + <th><a href="#" class="tip" title="{% trans "Your Rating" %}"><i class="icon-user"></i></a></th>
13 14 </thead>
14 15
15 16 <tbody>
16 17 {% for proposal in proposals %}
17   - <tr>
  18 + <tr class="{{ proposal.user_vote_css }}">
18 19 <td>{{ proposal.number }}</td>
19 20 <td>
20 21 <a href="{% url review_detail proposal.pk %}">
@@ -29,6 +30,7 @@
29 30 <td>{{ proposal.plus_zero }}</td>
30 31 <td>{{ proposal.minus_zero }}</td>
31 32 <td>{{ proposal.minus_one }}</td>
  33 + <td>{{ proposal.user_vote|default:"" }}</td>
32 34 </tr>
33 35 {% endfor %}
34 36 </tbody>
3  symposion/templates/reviews/base.html
@@ -97,7 +97,8 @@
97 97 <script src="{{ STATIC_URL }}tabletools/js/TableTools.min.js" type="text/javascript"></script>
98 98 <script src="{{ STATIC_URL }}datatables/js/dataTables.bootstrap.js" type="text/javascript"></script>
99 99 <script type="text/javascript">
100   - $(function() {
  100 + $(function() {
  101 + $(".tip").tooltip();
101 102 $("table.table-reviews").dataTable({
102 103 "sDom": "<'row'<'span3'l><'span3'T><'span4'f>r>t<'row'<'span3'i><'span5'p>>",
103 104 "sPaginationType": "bootstrap",

0 comments on commit cc032da

Please sign in to comment.
Something went wrong with that request. Please try again.