Skip to content

Commit

Permalink
added meeting pages
Browse files Browse the repository at this point in the history
  • Loading branch information
prsnca committed May 17, 2014
1 parent 463b320 commit a589e0b
Show file tree
Hide file tree
Showing 6 changed files with 106 additions and 3 deletions.
1 change: 1 addition & 0 deletions committeeVotes/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
class Bill(models.Model):
name = models.CharField(max_length=500)
description = models.TextField()
#oknesset_url = models.CharField(max_length=100, blank=True, null=True)
def __unicode__(self):
return self.name

Expand Down
5 changes: 5 additions & 0 deletions committeeVotes/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@
<a href="{% url 'ministers' %}">
השרים
</a>
</li>
<li>
<a href="{% url 'meetings' %}">
ישיבות הועדה
</a>
</li>
</ul>
<ul class="nav navbar-nav">
Expand Down
36 changes: 36 additions & 0 deletions committeeVotes/templates/committeeVotes/meeting_detail.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{% extends "base.html" %}
{% block content %}
{% load staticfiles %}

<div class="container">


<div class="row">
<div class="col-md-12">
<h2>
ישיבת הועדה שנערכה בתאריך {{ meeting.took_place }}
</h2>

<h3>
הצעות החוק שעלו בישיבה
</h3>


<table class="table table-hover">
<thead>
<th>
שם ההצעה
</th>
</thead>
{% for b in bills %}
<tr>
<td><a href="{% url 'detail' b.id %}">{{b}}</a></td>
</tr>
{% endfor %}
</table>
</div>
</div>
</div>


{% endblock %}
44 changes: 44 additions & 0 deletions committeeVotes/templates/committeeVotes/meetings.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{% extends "base.html" %}
{% block content %}
{% load staticfiles %}

<div class="container">

<div class="row">
<div class="col-md-6">
<h2>
ישיבות הועדה
</h2>
</div>
</div>
<div class="row">
<div class="col-md-12">
<table class="table table-hover">
<thead>
<tr>
<th class="text-right">
תאריך הישיבה
</th>
<th class="text-right">
מספר ההצעות שנידונו
</th>

</tr>
</thead>
{% for m in meetings %}

<tr>
<td><a href="{% url 'meeting' m.id %}">{{ m.took_place | date }}</a></td>
<td>{{ m.proposed_bills.count }}</td>
</tr>
{% endfor %}
</table>

</div>
</div>


</div>


{% endblock %}
14 changes: 13 additions & 1 deletion committeeVotes/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from django.shortcuts import render, get_object_or_404
from django.http import HttpResponse
from django.core.urlresolvers import reverse
from committeeVotes.models import Bill, Minister, Vote, VoteType
from committeeVotes.models import Bill, Minister, Vote, VoteType, Meeting
import json

def index(request):
Expand Down Expand Up @@ -69,3 +69,15 @@ def ministers(request):
context = {'ministers': ministers}
return render(request, 'committeeVotes/ministers.html', context)

def meetings(request):
meetings = Meeting.objects.all()
context = {'meetings': meetings}
return render(request, 'committeeVotes/meetings.html', context)

def meeting_details(request, meeting_id):
meeting = get_object_or_404(Meeting,pk=meeting_id)
bills = meeting.proposed_bills.all()
context = {'meeting': meeting,
'bills': bills}
return render(request, 'committeeVotes/meeting_detail.html', context)

9 changes: 7 additions & 2 deletions openCommittee/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,15 @@


url(r'^$', views.index, name='index'),
url(r'^bills/$', views.bills, name='bills'),
url(r'^bills/(?P<bill_id>\d+)/$', views.detail, name='detail'),
url(r'^minister/(?P<minister_id>\d+)/$', views.minister_details, name='minister'),

url(r'^minister/$', views.ministers, name='ministers'),
url(r'^bills/$', views.bills, name='bills'),
url(r'^minister/(?P<minister_id>\d+)/$', views.minister_details, name='minister'),

url(r'meetings/$',views.meetings, name='meetings'),
url(r'^meetings/(?P<meeting_id>\d+)/$', views.meeting_details, name='meeting'),

url(r'^search.json', views.search, name='search'),
url(r'^bills.json', views.searchBills, name='searchBills'),
url(r'^ministers.json', views.searchMinisters, name='searchMinisters'),
Expand Down

0 comments on commit a589e0b

Please sign in to comment.