Compare commits
2 Commits
79d441d1f6
...
62b13cd684
Author | SHA1 | Date |
---|---|---|
stupidcomputer | 62b13cd684 | |
stupidcomputer | cc8e1026ac |
|
@ -112,3 +112,22 @@ class LegislativeText(models.Model):
|
||||||
def get_lines(self):
|
def get_lines(self):
|
||||||
cls = namedtuple('LegLine', ['linenumber', 'linetext'])
|
cls = namedtuple('LegLine', ['linenumber', 'linetext'])
|
||||||
return [cls(i + 1, j) for i, j in enumerate(self.text.split('\n'))]
|
return [cls(i + 1, j) for i, j in enumerate(self.text.split('\n'))]
|
||||||
|
|
||||||
|
def is_bill(self):
|
||||||
|
if self.assembly in [
|
||||||
|
"RHB",
|
||||||
|
"BHB",
|
||||||
|
"WHB",
|
||||||
|
"RSB",
|
||||||
|
"BSB",
|
||||||
|
"WSB",
|
||||||
|
"SEN",
|
||||||
|
"HOU",
|
||||||
|
]:
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
|
def is_resolution(self):
|
||||||
|
if self.assembly in ["RGA", "BGA", "WGA", "GEN"]:
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
|
@ -1,15 +1,17 @@
|
||||||
{% extends "explorer/base.html" %}
|
{% extends "explorer/base.html" %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<h1>All legislative texts</h1>
|
<link rel="stylesheet" type="text/css" href="/static/tn.css" />
|
||||||
|
<div class="boxed">
|
||||||
{% if legislative_texts %}
|
<h1>All legislative texts</h1>
|
||||||
<ul>
|
{% if legislative_texts %}
|
||||||
{% for text in legislative_texts %}
|
<ul>
|
||||||
<li><a href="{% url 'viewleg' text.id %}">{{ text.legislation_title }}</a></li>
|
{% for text in legislative_texts %}
|
||||||
{% endfor %}
|
<li><a href="{% url 'viewleg' text.id %}">{{ text.legislation_title }}</a></li>
|
||||||
</ul>
|
{% endfor %}
|
||||||
{% else %}
|
</ul>
|
||||||
<p>No texts available</p>
|
{% else %}
|
||||||
{% endif %}
|
<p>No texts available</p>
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
{% endblock content %}
|
{% endblock content %}
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<nav id="navbar">
|
<nav id="navbar" class="boxed">
|
||||||
<div id="leftnav">
|
<div id="leftnav">
|
||||||
<a href="/explorer">explorer</a>
|
<a href="/explorer">explorer</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -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 %}
|
|
@ -1,19 +1,22 @@
|
||||||
{% extends "explorer/base.html" %}
|
{% extends "explorer/base.html" %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<h1>Welcome to explorer</h1>
|
<link rel="stylesheet" type="text/css" href="/static/tn.css" />
|
||||||
|
<div class="boxed">
|
||||||
|
<h1>Welcome to explorer</h1>
|
||||||
|
|
||||||
<p><i>an interactive database for YMCA CCE legislation</i></p>
|
<p><i>an interactive database for YMCA CCE legislation</i></p>
|
||||||
|
|
||||||
<h2>Some randomly selected legislation</h2>
|
<h2>Some randomly selected legislation</h2>
|
||||||
|
|
||||||
{% if legislative_texts %}
|
{% if legislative_texts %}
|
||||||
<ul>
|
<ul>
|
||||||
{% for text in legislative_texts %}
|
{% for text in legislative_texts %}
|
||||||
<li><a href="{% url 'viewleg' text.id %}">{{ text.legislation_title }}</a></li>
|
<li><a href="{% url 'viewleg' text.id %}">{{ text.legislation_title }}</a></li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
{% else %}
|
{% else %}
|
||||||
<p>No texts available</p>
|
<p>No texts available</p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
</div>
|
||||||
{% endblock content %}
|
{% endblock content %}
|
||||||
|
|
|
@ -1,13 +1,21 @@
|
||||||
{% extends "explorer/base.html" %}
|
{% extends "explorer/base.html" %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
{% 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="legcontainer">
|
||||||
<div id="leginfo" class="boxed">
|
<div id="leginfo" class="boxed">
|
||||||
<h1 class="no-margin-top wrapword">{{ legislation.legislation_title }}</h1>
|
<h1 class="no-margin-top">{{ legislation.legislation_title }}</h1>
|
||||||
|
|
||||||
<i>{{ legislation.assembly }}/{{ legislation.committee }}/{{ legislation.docket_order }}</i>
|
<p><i>{{ legislation.assembly }}/{{ legislation.committee }}/{{ legislation.docket_order }}</i></p>
|
||||||
|
|
||||||
<p>Sponsored by {{ legislation.sponsors }} of {{ legislation.school }}</p>
|
<p>Sponsored by {{ legislation.sponsors }} of {{ legislation.school }}</p>
|
||||||
|
|
||||||
|
<p>Presented as part of the <a href="/explorer/conference/{{ legislation.from_book.id }}">{{ legislation.from_book.name }}</a> conference</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="legislation" class="boxed">
|
<div id="legislation" class="boxed">
|
||||||
|
|
|
@ -6,4 +6,5 @@ urlpatterns = [
|
||||||
path("", views.index, name="index"),
|
path("", views.index, name="index"),
|
||||||
path("all/", views.all, name="all"),
|
path("all/", views.all, name="all"),
|
||||||
path("legislation/<int:legislation_id>/", views.view_legislation, name="viewleg"),
|
path("legislation/<int:legislation_id>/", views.view_legislation, name="viewleg"),
|
||||||
|
path("conference/<int:conference_id>/", views.view_conference, name="viewconf"),
|
||||||
]
|
]
|
||||||
|
|
|
@ -27,3 +27,13 @@ def view_legislation(request, legislation_id):
|
||||||
"lines": legislation.get_lines()
|
"lines": legislation.get_lines()
|
||||||
}
|
}
|
||||||
return render(request, "explorer/legislation.html", context)
|
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)
|
||||||
|
|
|
@ -24,7 +24,7 @@ SECRET_KEY = 'django-insecure-1%p#re)z*_xd9umo0!1foh(yiz&2=*5q#0b4(m42r0^m%kxli#
|
||||||
# SECURITY WARNING: don't run with debug turned on in production!
|
# SECURITY WARNING: don't run with debug turned on in production!
|
||||||
DEBUG = True
|
DEBUG = True
|
||||||
|
|
||||||
ALLOWED_HOSTS = ["localhost", "127.0.0.1", "[::1]"]
|
ALLOWED_HOSTS = ["localhost", "192.168.0.87", "127.0.0.1", "[::1]"]
|
||||||
|
|
||||||
# Application definition
|
# Application definition
|
||||||
|
|
||||||
|
|
|
@ -1,12 +1,36 @@
|
||||||
|
:root {
|
||||||
|
--component-bg-color: rgba(10, 10, 10, 0.7);
|
||||||
|
--text-color: rgb(150, 150, 150);
|
||||||
|
--accented-text-color: rgb(255, 255, 255);
|
||||||
|
}
|
||||||
|
|
||||||
body {
|
body {
|
||||||
font-family: sans-serif;
|
font-family: sans-serif;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
a {
|
||||||
|
color: lightblue;
|
||||||
|
}
|
||||||
|
|
||||||
|
a:active {
|
||||||
|
color: orangered;
|
||||||
|
}
|
||||||
|
|
||||||
|
a:visited {
|
||||||
|
color: mediumpurple;
|
||||||
|
}
|
||||||
|
|
||||||
|
::-moz-selection ::selection {
|
||||||
|
color: blue;
|
||||||
|
}
|
||||||
|
|
||||||
nav#navbar {
|
nav#navbar {
|
||||||
border-bottom: 1px solid black; /* block for top bar */
|
|
||||||
padding-bottom: 10px;
|
|
||||||
display: flex; /* make it from left to right */
|
display: flex; /* make it from left to right */
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
|
background-color: var(--component-bg-color);
|
||||||
|
background-clip: padding-box;
|
||||||
|
padding-left: 10px;
|
||||||
|
padding-right: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#leftnav {
|
#leftnav {
|
||||||
|
@ -24,8 +48,7 @@ nav#navbar {
|
||||||
#legcontainer {
|
#legcontainer {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
|
gap: 10px;
|
||||||
gap: 5px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#leginfo {
|
#leginfo {
|
||||||
|
@ -44,6 +67,7 @@ nav#navbar {
|
||||||
@media only screen and (max-width: 570px) {
|
@media only screen and (max-width: 570px) {
|
||||||
#legcontainer {
|
#legcontainer {
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
padding-right: 10px;
|
||||||
}
|
}
|
||||||
#leginfo {
|
#leginfo {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
@ -59,21 +83,19 @@ nav#navbar {
|
||||||
padding: 5px;
|
padding: 5px;
|
||||||
padding-top: 0px;
|
padding-top: 0px;
|
||||||
border: solid 1px;
|
border: solid 1px;
|
||||||
|
background-color: var(--component-bg-color);
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.wrapword {
|
|
||||||
white-space: -moz-pre-wrap !important;
|
|
||||||
white-space: -pre-wrap;
|
|
||||||
white-space: -o-pre-wrap;
|
|
||||||
white-space: pre-wrap;
|
|
||||||
word-wrap: break-word;
|
|
||||||
white-space: -webkit-pre-wrap;
|
|
||||||
word-break: break-all;
|
|
||||||
white-space: normal;
|
|
||||||
}
|
|
||||||
|
|
||||||
.legnumbers {
|
.legnumbers {
|
||||||
text-align: right;
|
text-align: right;
|
||||||
user-select: none;
|
user-select: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
h1, h2, h3, h4, h5, h6 {
|
||||||
|
color: var(--accented-text-color);
|
||||||
|
}
|
||||||
|
|
||||||
|
p, td, i, ul, li {
|
||||||
|
color: var(--text-color);
|
||||||
|
}
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 149 KiB |
|
@ -0,0 +1,7 @@
|
||||||
|
body {
|
||||||
|
background-image: url("/static/tn-cap.jpg");
|
||||||
|
background-position: center;
|
||||||
|
background-attachment: fixed;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
background-size: cover;
|
||||||
|
}
|
Binary file not shown.
After Width: | Height: | Size: 1.8 MiB |
|
@ -0,0 +1,7 @@
|
||||||
|
body {
|
||||||
|
background-image: url("/static/un-gen-asm.jpg");
|
||||||
|
background-position: center;
|
||||||
|
background-attachment: fixed;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
background-size: cover;
|
||||||
|
}
|
Loading…
Reference in New Issue