Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overhaul of stupid bad code #21

Merged
merged 23 commits into from
Jan 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
c34da05
[refactoring] begin adapting to better backend
king-millez Aug 13, 2021
bf63f80
[refactoring] actually check if streams are live
king-millez Aug 13, 2021
e9516d8
[refactoring] use SQL rather than unstable JSON
king-millez Aug 13, 2021
e08e3fa
[refactoring] DB optimisation
king-millez Aug 13, 2021
ffb65f4
[styling] nicer font
king-millez Aug 13, 2021
dfeb957
[styling] fix "," and "and " being highlighted
king-millez Aug 13, 2021
8491cb9
[styling] pill buttons yo #23
king-millez Aug 13, 2021
60b6f0f
[styling] kill the info page with fire #23
king-millez Aug 13, 2021
bd54f8f
[styling] better info #23
king-millez Aug 14, 2021
e91ebb6
[styling] solid dropdown btns
king-millez Aug 14, 2021
9485968
[widget] use jQuery
king-millez Aug 14, 2021
948d156
[styling] homepage scroll
king-millez Aug 14, 2021
7526ad3
[styling] don't duplicate dropdown if error occurs
king-millez Aug 16, 2021
bd0f603
[styling] better stream titles in widget
king-millez Aug 16, 2021
e81af80
[styling] arrows, not scroll bar for >3 streams
king-millez Aug 16, 2021
9dadb56
[styling] truncated titles + widget on title click
king-millez Aug 16, 2021
2faa04e
[js] append missing ";" in displayTitle
king-millez Aug 17, 2021
5e26f13
[mobile] pages don't look horrible
king-millez Aug 19, 2021
94855b0
[mobile] stream widget styling for mobile
king-millez Aug 19, 2021
72fa335
[vic] add vic_com.webp
king-millez Aug 22, 2021
85cfb62
[styling] center streams on all devices
king-millez Aug 23, 2021
b23def7
Use dev branch of legistream-backend
king-millez Jan 15, 2022
983cff5
Close stream when exterior is clicked, closes #22
king-millez Jan 15, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .github/img/f11-ss.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ secrets.py
__pycache__
db.sqlite3
media
migrations/
poetry.lock

# Backup files #
*.bak
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ Submit a pull request when you've finished working on your desired feature, issu

Your request won't be merged until at least two of us have had a look through your PR and approved it.

If you submit anything that deliberately opens up security risks, **don't expect to be submitting anything else in the future**.
If you submit anything that deliberately opens up security risks, **don't expect to be submitting anything else in the future**.
57 changes: 23 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# legistream (legistream-site)

![Legistream Screenshot](/gh-images/f11-ss.png)
![Legistream Screenshot](/.github/img/f11-ss.png)

Legistream is the easiest way to stream Australian parliaments live. Legistream bypasses the need to use the often slow and outdated state/territory parliament websites, streamlining the experience. Legistream also bypasses the need to use a Flash player on both the NT and QLD websites, offering a more secure viewing option for people interested in those jurisdictions.

Expand All @@ -14,40 +14,19 @@ Legistream uses our Python package [legistream-backend](https://github.com/OpenG

You can find instructions for different hosts [here](https://www.rabbitmq.com/download.html).

## Virtual Environment
## Poetry

Begin by setting up a virtual environment:
Install `poetry` with `pip`:

```sh
pip3 install virtualenv
```
```sh
virtualenv legistr_venv
```

##### Windows

```sh
legistr_venv/Scripts/activate
```

##### Linux/MacOS

```sh
source legistr_venv/bin/activate
```

You should now be loaded into the virtual environment, and your terminal should look like this:

```
(legistr_venv) /.../git/legistream-site/ >
```
```sh
pip3 install poetry
```

## Install Dependencies

```sh
pip3 install -r requirements.txt
```
```sh
poetry update
```

## Create secrets.py

Expand Down Expand Up @@ -79,25 +58,35 @@ DEBUG = True
On first run:

```sh
python3 manage.py migrate
poetry run python3 manage.py makemigrations legistream
```

```sh
poetry run python3 manage.py migrate
```

Clear pending tasks:

```sh
poetry run celery -A legistream_site purge
```

Start the Celery worker:

```sh
celery -A legistream_site worker -l info --pool=solo
poetry run celery -A legistream_site worker -l info --pool=solo
```

Start Celery Beat:

```sh
celery -A legistream_site beat -l info
poetry run celery -A legistream_site beat -l info
```

To run the server, use this command:

```sh
python3 manage.py runserver --insecure
poetry run python3 manage.py runserver --insecure
```

If you get any errors, make sure you've set up your virtual environment correctly and that you've installed all the required dependencies.
Expand Down
Binary file removed docs/Adobe XD Mockups/00. Mock 1.png
Binary file not shown.
Binary file removed docs/Adobe XD Mockups/00. Mock 2.png
Binary file not shown.
13 changes: 0 additions & 13 deletions docs/Homepage Info.md

This file was deleted.

Binary file not shown.
Binary file removed docs/Legistream Development/02. Basic CSS.mp4
Binary file not shown.
Binary file removed docs/Legistream Development/03. Dark CSS.PNG
Binary file not shown.
Binary file removed docs/Legistream Development/04. Near 1.0 styles.mp4
Binary file not shown.
Binary file not shown.
Binary file removed docs/Legistream Development/06. NT stream demo.mp4
Binary file not shown.
Binary file removed gh-images/doc-img/live-now.png
Binary file not shown.
Binary file removed gh-images/f11-ss.png
Binary file not shown.
9 changes: 9 additions & 0 deletions legistream/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import os
import inspect
import legistream_backend


modpath = f'{os.path.dirname(inspect.getfile(legistream_backend))}/site/'

module_list = [os.path.splitext(f)[0] for f in os.listdir(modpath)
if os.path.isfile(os.path.join(modpath, f))]
10 changes: 0 additions & 10 deletions legistream/act.py

This file was deleted.

3 changes: 0 additions & 3 deletions legistream/admin.py

This file was deleted.

24 changes: 0 additions & 24 deletions legistream/fed.py

This file was deleted.

Empty file removed legistream/migrations/__init__.py
Empty file.
4 changes: 3 additions & 1 deletion legistream/models.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from django.db import models

# Create your models here.

class Streams(models.Model):
streams_dict = models.CharField(max_length=300)
16 changes: 0 additions & 16 deletions legistream/nsw.py

This file was deleted.

21 changes: 0 additions & 21 deletions legistream/nt.py

This file was deleted.

10 changes: 0 additions & 10 deletions legistream/qld.py

This file was deleted.

12 changes: 0 additions & 12 deletions legistream/sa.py

This file was deleted.

Binary file removed legistream/static/legistream/aud/the-kevin.mp3
Binary file not shown.
75 changes: 75 additions & 0 deletions legistream/static/legistream/css/home-content.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
#home-info {
position: absolute;
top: calc(100% - 10px);
z-index: -1;
}
#scroll-top {
rotate: 90deg;
position: absolute;
border-radius: 15px;
bottom: 65px;
right: 35px;
padding-left: 20px;
}
#scroll-top:hover {
color: rgb(68, 219, 78);
cursor: pointer;
}
#scroll-top img {
height: 30px;
padding-top: 22%;
}
#info-block {
width: 48%;
}
#info-block h1, #info-block h2 {
font-family: gilroy;
}
#info-block h1 {
font-size: 300%;
}
#info-block h2 {
font-size: 200%;
margin-top: 20px;
}
#info-block p {
font-family: pn-light;
font-size: 150%;
}
#info-block a {
color: rgb(68, 219, 78);
}
#info-block a:hover {
color: rgb(49, 161, 57);
}
.dark-div {
display: flex;
background-color: rgb(16,16,16);
width: 100%;
align-items: center;
flex-direction: column;
padding-bottom: 50px;
}
#grn-break {
width: 100%;
height: 10px;
background-color: rgb(68, 219, 78);
margin-bottom: 50px;
}
#grn-break:hover {
cursor: pointer;
}
@media only screen and (min-resolution: 117dpi) and (max-resolution: 119dpi), only screen and (min-resolution: 131dpi) and (max-resolution: 133dpi), only screen and (min-resolution: 145dpi) and (max-resolution: 154dpi), only screen and (min-resolution: 162dpi) and (max-resolution: 164dpi), only screen and (min-resolution: 169dpi) {
#info-block p {
font-size: 110%;
}
#info-block {
width: 70%;
}
#scroll-top {
margin-right: -30px;
}
#scroll-top img {
height: 15px;
}
}
Loading