some changes to the interface

This commit is contained in:
stupidcomputer 2024-06-21 22:14:07 -05:00
parent 79d441d1f6
commit cc8e1026ac
11 changed files with 113 additions and 43 deletions

View File

@ -112,3 +112,24 @@ 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,15 +1,17 @@
{% extends "explorer/base.html" %}
{% block content %}
<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 %}
<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>
{% endblock content %}

View File

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

View File

@ -1,19 +1,22 @@
{% extends "explorer/base.html" %}
{% 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 %}
<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 %}
{% 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>
{% endblock content %}

View File

@ -2,12 +2,20 @@
{% block content %}
<div id="legcontainer">
<div id="leginfo" class="boxed">
<h1 class="no-margin-top wrapword">{{ legislation.legislation_title }}</h1>
{% 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 %}
<i>{{ legislation.assembly }}/{{ legislation.committee }}/{{ legislation.docket_order }}</i>
<div id="leginfo" class="boxed">
<h1 class="no-margin-top">{{ legislation.legislation_title }}</h1>
<p><i>{{ legislation.assembly }}/{{ legislation.committee }}/{{ legislation.docket_order }}</i></p>
<p>Sponsored by {{ legislation.sponsors }} of {{ legislation.school }}</p>
<p>Presented as part of the {{ legislation.from_book.name }} conference</p>
</div>
<div id="legislation" class="boxed">

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

View File

@ -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 {
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 {
@ -24,8 +48,7 @@ nav#navbar {
#legcontainer {
display: flex;
flex-direction: row;
gap: 5px;
gap: 10px;
}
#leginfo {
@ -44,6 +67,7 @@ nav#navbar {
@media only screen and (max-width: 570px) {
#legcontainer {
flex-direction: column;
padding-right: 10px;
}
#leginfo {
width: 100%;
@ -59,21 +83,19 @@ 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.

After

Width:  |  Height:  |  Size: 149 KiB

View File

@ -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

View File

@ -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;
}