Skip to content

Commit

Permalink
added voting tags
Browse files Browse the repository at this point in the history
  • Loading branch information
prsnca committed Aug 6, 2014
1 parent 2a81f2b commit e4f727c
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 1 deletion.
21 changes: 21 additions & 0 deletions committeeVotes/static/site.css
Original file line number Diff line number Diff line change
Expand Up @@ -551,6 +551,26 @@ ul, ol, table {
margin-top: 10px;
}

.minister-vote {
text-align: center;
background-clip: content-box;
font-weight: bold;
}

.yay {
background-color: #3ac8a8 !important;
}

.nay {
background-color: #ec6752 !important;
}

.abstain {
background-color: #87ceeb !important;
}



.good {
fill: #3ac8a8
}
Expand Down Expand Up @@ -602,3 +622,4 @@ ul, ol, table {
.social-links ul li a:hover, .party-member-info-links ul li a:hover {
opacity: 1
}

3 changes: 2 additions & 1 deletion committeeVotes/templates/committeeVotes/minister_detail.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{% extends "base.html" %}
{% load custom_tags %}
{% block content %}
{% load staticfiles %}

Expand Down Expand Up @@ -35,7 +36,7 @@ <h2>
{% for v in votes %}
<tr>
<td><a href="{% url 'bill' v.bill.id %}">{{ v.bill }}</a></td>
<td>{{ v.vote }}</td>
<td class="minister-vote {{ v.vote | vote_style }}">{{ v.vote }}</td>
</tr>
{% endfor %}
</table>
Expand Down
14 changes: 14 additions & 0 deletions committeeVotes/templatetags/custom_tags.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# coding: utf-8
from django import template
from django.template.defaultfilters import stringfilter

register = template.Library()

Expand All @@ -11,5 +13,17 @@ def active_page(request, view_name):
except Resolver404:
return ""

@register.filter(name='vote_style')
@stringfilter
def vote_style(value):
vote = value.encode('utf-8')
if vote == 'בעד':
return "yay"
elif vote == 'נגד':
return "nay"
else:
return "abstain"

register.simple_tag(active_page)
#register.filter('vote_style', vote_style)

0 comments on commit e4f727c

Please sign in to comment.