allura
リビジョン | c85b54e49c35798279190de30cb8443d0ccab25b (tree) |
---|---|
日時 | 2012-07-18 04:25:22 |
作者 | Yuriy <yuriyarhipovua@yand...> |
コミッター | Cory Johns |
[#4481] ticket:103 fix http://rb.42cc.co/r/74/
@@ -683,7 +683,7 @@ class VotableArtifact(MappedClass): | ||
683 | 683 | self.votes_down = self.votes_down - 1 |
684 | 684 | self.votes_up_users.append(user.username) |
685 | 685 | self.votes_up += 1 |
686 | - self.votes += 1 | |
686 | + self.votes = self.votes_up - self.votes_down | |
687 | 687 | |
688 | 688 | def vote_down(self, user): |
689 | 689 | if user.username in self.votes_down_users: |
@@ -694,7 +694,7 @@ class VotableArtifact(MappedClass): | ||
694 | 694 | self.votes_up = self.votes_up - 1 |
695 | 695 | self.votes_down_users.append(user.username) |
696 | 696 | self.votes_down += 1 |
697 | - self.votes -= 1 | |
697 | + self.votes = self.votes_up - self.votes_down | |
698 | 698 | |
699 | 699 | def user_voted(self, user): |
700 | 700 | """Check that user voted for this artifact. |
@@ -32,7 +32,7 @@ | ||
32 | 32 | {% elif col['name'] == 'assigned_to' %} |
33 | 33 | <td>{% if t.assigned_to_id %}{{t.assigned_to.display_name}}{% endif %}</td> |
34 | 34 | {% elif col['name'] == 'votes' %} |
35 | - <td>{{ t.votes }}</td> | |
35 | + <td><div style="color:{%if t.votes>0 %}green{%endif%}{%if t.votes<0 %}red{%endif%}">{{ t.votes }}</div></td> | |
36 | 36 | {% else %} |
37 | 37 | {% set fld = c.app.globals.get_custom_field(col['name']) %} |
38 | 38 | {% if fld and fld.type == 'user' %} |