Skip to content

Commit

Permalink
added committee decisions
Browse files Browse the repository at this point in the history
  • Loading branch information
prsnca committed Jun 11, 2014
1 parent 6f7595f commit 9c12385
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 10 deletions.
18 changes: 16 additions & 2 deletions committeeVotes/management/commands/all_imports.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,19 @@

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "committeeVotes.settings") # Replace with your app name.

BILL_FIELDS = ['name','description', 'oknesset_url']
def vote_to_bool(vote):
if not vote or vote == '':
return None
if vote == 'בעד':
return True
elif vote == 'נגד':
return False

BILL_FIELDS = [
('name', None),
('oknesset_url', None),
('passed', vote_to_bool)
]


#
Expand All @@ -37,8 +49,10 @@ def handle(self, *args, **options):

for d in r:
bill = Bill()
for header in BILL_FIELDS:
for header, conv_func in BILL_FIELDS:
value = d[header]
if conv_func:
value = conv_func(value)
setattr(bill, header, value)
try:
bill.full_clean()
Expand Down
2 changes: 1 addition & 1 deletion committeeVotes/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
# Create your models here.
class Bill(models.Model):
name = models.CharField(max_length=500)
description = models.TextField()
oknesset_url = models.CharField(max_length=100, blank=True, null=True)
passed = models.NullBooleanField()
def __unicode__(self):
return self.name

Expand Down
24 changes: 17 additions & 7 deletions committeeVotes/templates/committeeVotes/detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,25 @@ <h3 class="pull-left" title="שם ההצעה">
{% endif %}
</div>
</div>


<div class="row">
<div class="col-md-12">
<div class="well" title="תוכן ההצעה">
{{ bill.description }}
</div>
{% if not bill.passed == None %}
<div class="row">
<div class="col-md-8">
<h2 title="החלטת הועדה">
החלטת הועדה:
{% if bill.passed %}
<span class="badge" style="background-color:green; vertical-align:middle; font-size:24px;">
בעד
</span>
{% endif %}
{% if not bill.passed %}
<span class="badge" style="background-color:red; vertical-align:middle; font-size:24px;">
נגד
</span>
{% endif %}
</h2>
</div>
</div>
{% endif %}

<div class="row">
{% for vote_type, votes in votes_by_type %}
Expand Down
12 changes: 12 additions & 0 deletions committeeVotes/templates/committeeVotes/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@
{% block content %}

<div class="container">
<div class="row">
<div class="col-md-12">
<h3>
רקע
</h3>
<div class="well">
וועדת שרים לענייני חקיקה היא המקום בו הממשלה מחליטה האם היא תומכת או מתנגדת להצעות חוק. כל הצעות
החוק עוברות דרך הוועדה, וללא תמיכת הממשלה אין להצעת החוק כמעט שום סיכוי לעבור בכנסת. הוועדה מתנהלת
בחוסר שקיפות חריג, כך שכל המידע באתר נמסר מרצונם החופשי של שרים החברים בוועדה ותומכים בשקיפות.
</div>
</div>
</div>

<div class="row">
<div class="col-md-6">
Expand Down

0 comments on commit 9c12385

Please sign in to comment.