add a conference view

This commit is contained in:
stupidcomputer 2024-06-21 22:42:19 -05:00
parent cc8e1026ac
commit 62b13cd684
5 changed files with 37 additions and 9 deletions

View File

@ -131,5 +131,3 @@ class LegislativeText(models.Model):
if self.assembly in ["RGA", "BGA", "WGA", "GEN"]:
return True
return False

View File

@ -0,0 +1,19 @@
{% extends "explorer/base.html" %}
{% block content %}
{% if sample.is_bill %}
<link rel="stylesheet" type="text/css" href="/static/tn.css" />
{% elif sample.is_resolution %}
<link rel="stylesheet" type="text/css" href="/static/un.css" />
{% endif %}
<div class="boxed">
<h1>{{ book.name }} Conference</h1>
<ul>
{% for text in legislation %}
<li><a href="/explorer/legislation/{{ text.id }}">{{ text.legislation_title }}</a></li>
{% endfor %}
</ul>
</div>
{% endblock content %}

View File

@ -1,13 +1,13 @@
{% extends "explorer/base.html" %}
{% block content %}
<div id="legcontainer">
{% if legislation.is_bill %}
<link rel="stylesheet" type="text/css" href="/static/tn.css" />
{% elif legislation.is_resolution %}
<link rel="stylesheet" type="text/css" href="/static/un.css" />
{% endif %}
{% if legislation.is_bill %}
<link rel="stylesheet" type="text/css" href="/static/tn.css" />
{% elif legislation.is_resolution %}
<link rel="stylesheet" type="text/css" href="/static/un.css" />
{% endif %}
<div id="legcontainer">
<div id="leginfo" class="boxed">
<h1 class="no-margin-top">{{ legislation.legislation_title }}</h1>
@ -15,7 +15,7 @@
<p>Sponsored by {{ legislation.sponsors }} of {{ legislation.school }}</p>
<p>Presented as part of the {{ legislation.from_book.name }} conference</p>
<p>Presented as part of the <a href="/explorer/conference/{{ legislation.from_book.id }}">{{ legislation.from_book.name }}</a> conference</p>
</div>
<div id="legislation" class="boxed">

View File

@ -6,4 +6,5 @@ urlpatterns = [
path("", views.index, name="index"),
path("all/", views.all, name="all"),
path("legislation/<int:legislation_id>/", views.view_legislation, name="viewleg"),
path("conference/<int:conference_id>/", views.view_conference, name="viewconf"),
]

View File

@ -27,3 +27,13 @@ def view_legislation(request, legislation_id):
"lines": legislation.get_lines()
}
return render(request, "explorer/legislation.html", context)
def view_conference(request, conference_id):
book = get_object_or_404(LegislationBook, pk=conference_id)
results = LegislativeText.objects.filter(from_book=book)
context = {
"book": book,
"legislation": results,
"sample": results[0]
}
return render(request, "explorer/conference.html", context)