Compare commits

..

No commits in common. "62b13cd684b709fee2d5722e71aa33ff700bfea0" and "79d441d1f650f13cae7fe110c33473bffe01942e" have entirely different histories.

14 changed files with 42 additions and 140 deletions

View File

@ -112,22 +112,3 @@ class LegislativeText(models.Model):
def get_lines(self):
cls = namedtuple('LegLine', ['linenumber', 'linetext'])
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

View File

@ -1,17 +1,15 @@
{% extends "explorer/base.html" %}
{% block content %}
<link rel="stylesheet" type="text/css" href="/static/tn.css" />
<div class="boxed">
<h1>All legislative texts</h1>
{% if legislative_texts %}
<ul>
{% for text in legislative_texts %}
<li><a href="{% url 'viewleg' text.id %}">{{ text.legislation_title }}</a></li>
{% endfor %}
</ul>
{% else %}
<p>No texts available</p>
{% endif %}
</div>
<h1>All legislative texts</h1>
{% if legislative_texts %}
<ul>
{% for text in legislative_texts %}
<li><a href="{% url 'viewleg' text.id %}">{{ text.legislation_title }}</a></li>
{% endfor %}
</ul>
{% else %}
<p>No texts available</p>
{% endif %}
{% endblock content %}

View File

@ -11,7 +11,7 @@
</head>
<body>
<nav id="navbar" class="boxed">
<nav id="navbar">
<div id="leftnav">
<a href="/explorer">explorer</a>
</div>

View File

@ -1,19 +0,0 @@
{% 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,22 +1,19 @@
{% extends "explorer/base.html" %}
{% block content %}
<link rel="stylesheet" type="text/css" href="/static/tn.css" />
<div class="boxed">
<h1>Welcome to explorer</h1>
<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 %}
<ul>
{% for text in legislative_texts %}
<li><a href="{% url 'viewleg' text.id %}">{{ text.legislation_title }}</a></li>
{% endfor %}
</ul>
{% else %}
<p>No texts available</p>
{% endif %}
</div>
{% if legislative_texts %}
<ul>
{% for text in legislative_texts %}
<li><a href="{% url 'viewleg' text.id %}">{{ text.legislation_title }}</a></li>
{% endfor %}
</ul>
{% else %}
<p>No texts available</p>
{% endif %}
{% endblock content %}

View File

@ -1,21 +1,13 @@
{% extends "explorer/base.html" %}
{% 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="leginfo" class="boxed">
<h1 class="no-margin-top">{{ legislation.legislation_title }}</h1>
<h1 class="no-margin-top wrapword">{{ legislation.legislation_title }}</h1>
<p><i>{{ legislation.assembly }}/{{ legislation.committee }}/{{ legislation.docket_order }}</i></p>
<i>{{ legislation.assembly }}/{{ legislation.committee }}/{{ legislation.docket_order }}</i>
<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 id="legislation" class="boxed">

View File

@ -6,5 +6,4 @@ 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,13 +27,3 @@ 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)

View File

@ -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!
DEBUG = True
ALLOWED_HOSTS = ["localhost", "192.168.0.87", "127.0.0.1", "[::1]"]
ALLOWED_HOSTS = ["localhost", "127.0.0.1", "[::1]"]
# Application definition

View File

@ -1,36 +1,12 @@
:root {
--component-bg-color: rgba(10, 10, 10, 0.7);
--text-color: rgb(150, 150, 150);
--accented-text-color: rgb(255, 255, 255);
}
body {
font-family: sans-serif;
}
a {
color: lightblue;
}
a:active {
color: orangered;
}
a:visited {
color: mediumpurple;
}
::-moz-selection ::selection {
color: blue;
}
nav#navbar {
border-bottom: 1px solid black; /* block for top bar */
padding-bottom: 10px;
display: flex; /* make it from left to right */
flex-direction: row;
background-color: var(--component-bg-color);
background-clip: padding-box;
padding-left: 10px;
padding-right: 10px;
}
#leftnav {
@ -48,7 +24,8 @@ nav#navbar {
#legcontainer {
display: flex;
flex-direction: row;
gap: 10px;
gap: 5px;
}
#leginfo {
@ -67,7 +44,6 @@ nav#navbar {
@media only screen and (max-width: 570px) {
#legcontainer {
flex-direction: column;
padding-right: 10px;
}
#leginfo {
width: 100%;
@ -83,19 +59,21 @@ nav#navbar {
padding: 5px;
padding-top: 0px;
border: solid 1px;
background-color: var(--component-bg-color);
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 {
text-align: right;
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.

Before

Width:  |  Height:  |  Size: 149 KiB

View File

@ -1,7 +0,0 @@
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.

Before

Width:  |  Height:  |  Size: 1.8 MiB

View File

@ -1,7 +0,0 @@
body {
background-image: url("/static/un-gen-asm.jpg");
background-position: center;
background-attachment: fixed;
background-repeat: no-repeat;
background-size: cover;
}