computer-science-club

computer-science-club
git clone https://git.prime8.dev/computer-science-club.git
Log | Files | Refs | README | LICENSE

commit 701fa648a1e25dfffa9335fb641ecba74af62a5f
parent 8bbaacc7d6319f54e403b79a03d96dc80027515f
Author: Damian Myrda <damian@prime8.dev>
Date:   Tue, 17 Sep 2024 16:24:50 -0500

Refactor

Diffstat:
D.pre-commit-config.yaml | 9---------
ADockerfile | 22++++++++++++++++++++++
Mconfig.py | 10+++++++---
Ddatabase.db | 0
Ddatabase.json | 12------------
Mdatabase.py | 50+++++---------------------------------------------
Mmain.py | 35++++++++++++++++++++++++-----------
Mmodels/discussion.py | 33+--------------------------------
Mmodels/event.py | 25+++++++++----------------
Mmodels/group.py | 31+++++++++----------------------
Mmodels/member.py | 5+----
Mmodels/project.py | 5-----
Mmodels/update.py | 14+++-----------
Drun.sh | 4----
Mschoology.py | 139++++++++++++++++++++++++++++++++++++++-----------------------------------------
Mstatic/intro.css | 9++++++++-
Astatic/main.css | 26++++++++++++++++++++++++++
Dstatic/style.css | 20--------------------
Mtemplates/discussions.html | 24+++++++++++++-----------
Mtemplates/elements/authors.html | 7++++---
Mtemplates/elements/datetime.html | 10+++++++---
Mtemplates/elements/discussions.html | 9++++++---
Mtemplates/elements/events.html | 20+++++++++++++-------
Mtemplates/elements/projects.html | 26+++++++++++++++++++-------
Mtemplates/elements/space.html | 14+++++++-------
Mtemplates/elements/updates.html | 23+++++++++++++++--------
Mtemplates/home.html | 35++++++++++++++++++++++++-----------
Mtemplates/members.html | 10++++++----
Mtemplates/projects.html | 35++++++++++++++++++++++-------------
Mtemplates/updates.html | 24+++++++++++++-----------
30 files changed, 331 insertions(+), 355 deletions(-)

diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml @@ -1,9 +0,0 @@ -repos: - - repo: https://github.com/psf/black - rev: 24.4.2 - hooks: - - id: black - - repo: https://github.com/pre-commit/mirrors-prettier - rev: v4.0.0-alpha.8 - hooks: - - id: prettier diff --git a/Dockerfile b/Dockerfile @@ -0,0 +1,22 @@ +FROM python:3.11-slim + +RUN apt-get update && apt-get install -y \ + build-essential \ + && rm -rf /var/lib/apt/lists/* + +WORKDIR /app/ +COPY . /app/ + +RUN pip install --no-cache-dir \ + gunicorn \ + flask \ + schoolopy \ + cachecontrol \ + google-auth \ + google_auth_oauthlib + +ENV PATH="/app/venv/bin:$PATH" + +EXPOSE 80 + +CMD ["gunicorn", "-b", "0.0.0.0:80", "main:app"] diff --git a/config.py b/config.py @@ -1,3 +1,7 @@ -DOMAIN = "https://schoology.d214.org" -GROUP_ID = 6454678062 -REDIRECT_URL = "127.0.0.1:5000" +import os + +DOMAIN = "https://" + os.environ["DOMAIN"] + +GROUP_ID = os.environ["GROUP_ID"] +SCHOOLOGY_API_KEY = os.environ["SCHOOLOGY_API_KEY"] +SCHOOLOGY_API_SECRET = os.environ["SCHOOLOGY_API_SECRET"] diff --git a/database.db b/database.db Binary files differ. diff --git a/database.json b/database.json @@ -1,12 +0,0 @@ -{ - "py/object": "database.Data", - "projects": [ - { - "py/object": "project.Project", - "name": "Computer Science Club Website", - "description": "(this website)", - "authors": ["Damian Myrda"], - "source": "https://github.com/moncheeta/computer_science_club.git" - } - ] -} diff --git a/database.py b/database.py @@ -1,38 +1,13 @@ from models import Project -import jsonpickle as json import sqlite3 import pickle -class Data: - projects = [] - - def __init__(self, projects=[]): - self.projects = projects - - -class JSONDatabase: +class Database: def __init__(self): - self.projects = [] - self.read() - - def read(self): - with open("database.json", "r") as file: - self.projects = json.decode(file.read()).projects - return self.projects - - def write(self): - with open("database.json", "w") as file: - file.write(json.encode(Data(self.projects))) - - def add(self, project): - self.projects.append(project) - self.write() - - -class SQLDatabase: - def __init__(self): - self.connection = sqlite3.connect("database.db", check_same_thread=False) + self.connection = sqlite3.connect( + "database.db", check_same_thread=False + ) self.cursor = self.connection.cursor() self.cursor.execute( """CREATE TABLE IF NOT EXISTS projects ( @@ -75,19 +50,4 @@ class SQLDatabase: self.write() -class ProjectDatabase: - def __init__(self): - # self.database = JSONDatabase() - self.database = SQLDatabase() - - def read(self): - return self.database.read() - - def write(self): - self.database.write() - - def add(self, project): - self.database.add(project) - - -database = ProjectDatabase() +database = Database() diff --git a/main.py b/main.py @@ -5,30 +5,36 @@ sys.path.append(os.path.join(PROJECT_DIR, "config.py")) sys.path.append(os.path.join(PROJECT_DIR, "models")) sys.path.append(os.path.join(PROJECT_DIR, "projects.py")) sys.path.append(os.path.join(PROJECT_DIR, "schoology.py")) -from config import REDIRECT_URL -from models import Project +from config import DOMAIN +from models import Group, Project from database import database from schoology import group from flask import Flask, request, redirect, abort, render_template, session from cachecontrol import CacheControl app = Flask(__name__) -app.secret_key = "https://computer-science-club.moncheeto.repl.co" +app.secret_key = DOMAIN @app.route("/") def index(): - return render_template("home.html", group=group, account=session.get("name")) + return render_template( + "home.html", group=group, account=session.get("name") + ) @app.route("/updates") def updates(): - return render_template("updates.html", group=group, account=session.get("name")) + return render_template( + "updates.html", group=group, account=session.get("name") + ) @app.route("/discussions") def discussions(): - return render_template("discussions.html", group=group, account=session.get("name")) + return render_template( + "discussions.html", group=group, account=session.get("name") + ) @app.route("/projects", methods=["GET", "POST"]) @@ -63,7 +69,9 @@ def add_project(): @app.route("/members") def members(): - return render_template("members.html", group=group, account=session.get("name")) + return render_template( + "members.html", group=group, account=session.get("name") + ) import requests @@ -81,10 +89,11 @@ GOOGLE_AUTH_SCOPES = [ "openid", ] os.environ["OAUTHLIB_INSECURE_TRANSPORT"] = "1" + flow = Flow.from_client_secrets_file( client_secrets_file=GOOGLE_CLIENT_SECRETS_FILE, scopes=GOOGLE_AUTH_SCOPES, - redirect_uri="http://" + REDIRECT_URL + "/login/callback", + redirect_uri=DOMAIN + "/login/callback", ) @@ -103,9 +112,13 @@ def login_callback(): credentials = flow.credentials request_session = requests.session() cached_session = CacheControl(request_session) - token_request = google.auth.transport.requests.Request(session=cached_session) + token_request = google.auth.transport.requests.Request( + session=cached_session + ) id_info = id_token.verify_oauth2_token( - id_token=credentials._id_token, request=token_request, audience=GOOGLE_CLIENT_ID + id_token=credentials._id_token, + request=token_request, + audience=GOOGLE_CLIENT_ID, ) session["name"] = id_info.get("name") return redirect("/") @@ -118,4 +131,4 @@ def logout(): if __name__ == "__main__": - app.run(host="0.0.0.0") + app.run(host="0.0.0.0", port=80) diff --git a/models/discussion.py b/models/discussion.py @@ -2,38 +2,7 @@ from config import DOMAIN class Discussion: - name = "" - description = "" - link = f"{DOMAIN}/discussion/" - def __init__(self, id, name, description): - self.link += str(id) - self.name = name - self.description = description - - -from datetime import datetime -from config import DOMAIN - - -class Event: - name = "" - description = "" - start = datetime.now() - end = None - differentDay = False - link = f"{DOMAIN}/event/" - - def __init__(self, id, name, description, start, end): - self.link += str(id) self.name = name self.description = description - self.start = start - self.end = end - if ( - end - and self.end.year >= self.start.year - and self.end.month >= self.start.month - and self.end.day > start.day - ): - differentDay = True + self.link = f"{DOMAIN}/discussion/{str(id)}" diff --git a/models/event.py b/models/event.py @@ -1,25 +1,18 @@ -from datetime import datetime from config import DOMAIN class Event: - name = "" - description = "" - start = datetime.now() - end = None - differentDay = False - link = f"{DOMAIN}/event/" - - def __init__(self, id, name, description, start, end): - self.link += str(id) + def __init__(self, id, name, description, start, end=None): self.name = name self.description = description + self.link = f"{DOMAIN}/event/{str(id)}" self.start = start self.end = end - if ( - end - and self.end.year >= self.start.year - and self.end.month >= self.start.month - and self.end.day > start.day + if end and ( + self.end.year != self.start.year + or self.end.month != self.start.month + or self.end.day != start.day ): - differentDay = True + self.differentDay = True + else: + self.differentDay = False diff --git a/models/group.py b/models/group.py @@ -1,25 +1,12 @@ class Group: - name = "" - description = "" - picture = "https://www.shutterstock.com/image-vector/computer-science-icon-outline-thin-600nw-1613513884.jpg" - leaders = [] - members = [] - events = [] - updates = [] - discussions = [] - projects = [] - - def __init__( - self, name, description, events, updates, discussions, projects, members - ): + def __init__(self, name, description): self.name = name self.description = description - self.events = events - self.updates = updates - self.discussions = discussions - self.projects = projects - for member in members: - if member.leader: - self.leaders.append(member) - continue - self.members.append(member) + self.picture = "https://www.shutterstock.com/image-vector/computer-science-icon-outline-thin-600nw-1613513884.jpg" + + self.events = [] + self.updates = [] + self.discussions = [] + + self.leaders = [] + self.members = [] diff --git a/models/member.py b/models/member.py @@ -1,7 +1,4 @@ class Member: - name = "" - leader = False - - def __init__(self, name="", leader=False): + def __init__(self, name, leader=False): self.name = name self.leader = leader diff --git a/models/project.py b/models/project.py @@ -1,9 +1,4 @@ class Project: - name = "" - description = "" - authors = [] - source = None - def __init__(self, name, description, authors, source=None): self.name = name self.description = description diff --git a/models/update.py b/models/update.py @@ -1,13 +1,5 @@ -from datetime import datetime -from member import Member - - class Update: - member = Member() - text = "" - time = datetime.now() - - def __init__(self, member, text, time): + def __init__(self, member, content, created): self.member = member - self.text = text - self.time = time + self.content = content + self.created = created diff --git a/run.sh b/run.sh @@ -1,4 +0,0 @@ -#!/usr/bin/env bash - -. ./bin/activate -flask --app main.py run diff --git a/schoology.py b/schoology.py @@ -1,77 +1,72 @@ -import os +from config import DOMAIN, GROUP_ID, SCHOOLOGY_API_KEY, SCHOOLOGY_API_SECRET from datetime import datetime -from config import DOMAIN, GROUP_ID from models import Group, Event, Update, Discussion, Member -from database import database from schoolopy import Schoology, Auth +from database import database + + +auth = Auth( + SCHOOLOGY_API_KEY, + SCHOOLOGY_API_SECRET, + domain=DOMAIN, +) +api = Schoology(auth) +api.limit = 64 + +group = Group( + api.get_group(GROUP_ID).title, api.get_group(GROUP_ID).description +) + + +def get_members(): + for enrolled in api.get_group_enrollments(GROUP_ID): + member = Member(enrolled.name_display) + if enrolled.admin == 1: + group.leaders.append(member) + else: + group.members.append(member) + + +def find_member(name): + for member in group.members: + if member.name == name: + return member + return None + + +def get_updates(): + for update in api.get_group_updates(GROUP_ID): + user = api.get_user(update.uid) + member = find_member(user.name_display) + if not member: + continue + created = datetime.utcfromtimestamp(int(update.created)) + group.updates.append(Update(member, update.body, created)) + + +def get_events(): + for event in api.get_group_events(GROUP_ID): + start = datetime.strptime(event.start, "%Y-%m-%d %H:%M:%S") + end = None + if event.has_end: + end = datetime.strptime(event.end, "%Y-%m-%d %H:%M:%S") + event = Event(event.id, event.title, event.description, start, end) + group.events.append(event) + + +def get_discussions(): + for discussion in api.get_group_discussions(GROUP_ID): + group.discussions.append( + Discussion(discussion.id, discussion.title, discussion.body) + ) + + +def update(): + get_members() + get_updates() + get_events() + get_discussions() + group.projects = database.read() -class SchoologyAPI: - api = None - auth = Auth( - os.environ["SCHOOLOGY_API_KEY"], - os.environ["SCHOOLOGY_API_SECRET"], - domain=DOMAIN, - ) - - def __init__(self): - self.api = Schoology(self.auth) - self.api.limit = 64 - - def name(self): - return self.api.get_group(GROUP_ID).title - - def description(self): - return self.api.get_group(GROUP_ID).description - - def events(self): - events = [] - for event in self.api.get_group_events(GROUP_ID): - start = datetime.strptime(event.start, "%Y-%m-%d %H:%M:%S") - end = None - if event.has_end: - end = datetime.strptime(event.end, "%Y-%m-%d %H:%M:%S") - event = Event(event.id, event.title, event.description, start, end) - events.append(event) - return events - - def updates(self): - updates = [] - for update in self.api.get_group_updates(GROUP_ID): - user = self.api.get_user(update.uid) - member = Member(user.name_display) - # time = datetime.utcfromtimestamp(int(update.created)) - time = datetime.utcfromtimestamp(int(update.last_updated)) - updates.append(Update(member, update.body, time)) - return updates - - def discussions(self): - discussions = [] - for discussion in self.api.get_group_discussions(GROUP_ID): - discussions.append( - Discussion(discussion.id, discussion.title, discussion.body) - ) - return discussions - - def members(self): - members = [] - for enrolled in self.api.get_group_enrollments(GROUP_ID): - member = Member(enrolled.name_display) - if enrolled.admin == 1: - member.leader = True - members.append(member) - return members - - def group(self): - name = self.name() - description = self.description() - events = self.events() - updates = self.updates() - discussions = self.discussions() - projects = database.read() - members = self.members() - return Group(name, description, events, updates, discussions, projects, members) - - -api = SchoologyAPI() -group = api.group() +update() diff --git a/static/intro.css b/static/intro.css @@ -1,7 +1,14 @@ * { color: #ffff82; - text-align: center; background-color: black; + text-align: center; +} + +html, body { + width: 100%; + height: 100%; + margin: 0; + padding: 0; } #board { diff --git a/static/main.css b/static/main.css @@ -0,0 +1,26 @@ +* { + color: white; + background-color: black; + font-family: monospace; +} + +html, body { + width: 100%; + height: 100%; + margin: 0; +} + +body { + padding: 8px; +} + +input, textarea { + color: black; +} + +center { + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + position: absolute; +} diff --git a/static/style.css b/static/style.css @@ -1,20 +0,0 @@ -* { - color: white; - font-family: monospace; -} - -body { - background-color: black; -} - -input, -textarea { - color: black; -} - -center { - top: 50%; - left: 50%; - transform: translate(-50%, -50%); - position: absolute; -} diff --git a/templates/discussions.html b/templates/discussions.html @@ -1,23 +1,25 @@ +<!DOCTYPE html> <html> <head> - {% import "elements/metadata.html" as metadata %} {{ metadata.head(group, - "Discussions") }} + {% import "elements/metadata.html" as metadata %} + {{ metadata.head(group, "Discussions") }} <link rel="stylesheet" - href="{{ url_for('static', filename='style.css') }}" + href="{{ url_for('static', filename='main.css') }}" /> </head> - <header> - {% import "elements/navigation.html" as navigation %} {{ - navigation.bar(account) }} - </header> - <body> - {% import "elements/space.html" as space %} {{ space.stars(500) }} + <header> + {% import "elements/navigation.html" as navigation %} + {{ navigation.bar(account) }} + </header> + + {% import "elements/space.html" as space %} + {{ space.stars(500) }} <h1>Discussions</h1> - {% import "elements/discussions.html" as discussions %} {{ - discussions.list(group.discussions) }} + {% import "elements/discussions.html" as discussions %} + {{ discussions.list(group.discussions) }} </body> </html> diff --git a/templates/elements/authors.html b/templates/elements/authors.html @@ -1,8 +1,9 @@ {% macro view(author) -%} <a>{{ author }}</a> -{%- endmacro %} {% macro list(authors) -%} +{%- endmacro %} + +{% macro list(authors) -%} <div> - By: {{ view(authors[0]) }}{% for author in authors[1:] %}, {{ author }}{% - endfor %} + By: {{ view(authors[0]) }}{% for author in authors[1:] %}, {{ author }}{% endfor %} </div> {%- endmacro %} diff --git a/templates/elements/datetime.html b/templates/elements/datetime.html @@ -1,3 +1,7 @@ -{% macro time(time) -%} {{ time.hour }}:{{ time.minute }} {%- endmacro %} {% -macro date(date) -%} {{ date.year }}.{{ date.month }}.{{ date.day }} {%- -endmacro %} +{% macro time(time) -%} +{{ time.hour }}:{{ time.minute }} +{%- endmacro %} + +{% macro date(date) -%} +{{ date.year }}.{{ date.month }}.{{ date.day }} +{%-endmacro %} diff --git a/templates/elements/discussions.html b/templates/elements/discussions.html @@ -2,7 +2,10 @@ <a target="_blank" href="{{ discussion.link }}"> {{ discussion.name }} {{ discussion.description }} </a> -{%- endmacro %} {% macro list(discussions) -%} {% for discussion in discussions -%} +{%- endmacro %} + +{% macro list(discussions) -%} +{% for discussion in discussions %} <div>{{ view(discussion) }}</div> -{% endfor %} {%- endmacro %} +{% endfor %} +{%- endmacro %} diff --git a/templates/elements/events.html b/templates/elements/events.html @@ -5,13 +5,19 @@ if event.end %} {% if event.differentDay %} to {{ datetime.date(event.end) }} {% endif %} {% endif %} </a> -{%- endmacro %} {% macro next(event) -%} +{%- endmacro %} + +{% macro next(event) -%} <a target="_blank" href="{{ event.link }}"> - Upcoming: {{ event.name }} at {{ datetime.time(event.start) }} {% if event.end - %} to {{ datetime.time(event.end) }} {% endif %} on {{ - datetime.date(event.start) }} {% if event.end %} {% if event.differentDay %} - to {{ datetime.date(event.end) }} {% endif %} {% endif %} + Upcoming: {{ event.name }} at {{ datetime.time(event.start) }} {% if event.end %} to {{ + datetime.time(event.end) }} {% endif %} on {{ datetime.date(event.start) }} {% + if event.end %} {% if event.differentDay %} to {{ datetime.date(event.end) }} + {% endif %} {% endif %} </a> -{%- endmacro %} {% macro upcoming(events) -%} {% for event in events %} +{%- endmacro %} + +{% macro upcoming(events) -%} +{% for event in events %} <div>view(event)</div> -{% endfor %} {%- endmacro %} +{% endfor %} +{%- endmacro %} diff --git a/templates/elements/projects.html b/templates/elements/projects.html @@ -1,20 +1,32 @@ -{% import "elements/authors.html" as authors %} {% macro view(project) -%} +{% import "elements/authors.html" as authors %} + +{% macro view(project) -%} <h2>{{ project.name }}</h2> {% if project.description %} <p>{{ project.description }}</p> -{% endif %} {% if project.source %} +{% endif %} +{% if project.source %} <a target="_blank" href="{{ project.source }}">Source Code</a> <br /> -{% endif %} {{ authors.list(project.authors) }} {% if project.images %} {% for -image in project.images %} +{% endif %} +{{ authors.list(project.authors) }} +{% if project.images %} +{% for image in project.images %} <img src="{{ image }}" /> -{% endfor %} {% endif %} {%- endmacro %} {% macro list(projects) -%} {% for -project in projects %} +{% endfor %} +{% endif %} +{%- endmacro %} + +{% macro list(projects) -%} +{% for project in projects %} <div> {{ view(project) }} <br /> </div> -{% endfor %} {%- endmacro %} {% macro new() -%} +{% endfor %} +{%- endmacro %} + +{% macro new() -%} <center> <h1>Add New Project</h1> <form method="post" enctype="multipart/form-data"> diff --git a/templates/elements/space.html b/templates/elements/space.html @@ -2,12 +2,18 @@ <style> #star { position: absolute; + background-color: white !important; width: 1px; height: 1px; - background-color: white; } </style> <script> + function randomPosition() { + var rw = Math.floor(Math.random() * window.innerWidth); + var rh = Math.floor(Math.random() * window.innerHeight); + return [rw, rh]; + } + for (let i = 0; i < {{ num }}; i++) { let star = document.createElement("div"); star.id = "star"; @@ -16,11 +22,5 @@ star.style.left = w + "px"; document.body.append(star); } - - function randomPosition() { - var rw = Math.floor(Math.random() * window.innerWidth); - var rh = Math.floor(Math.random() * window.innerHeight); - return [rw, rh]; - } </script> {%- endmacro %} diff --git a/templates/elements/updates.html b/templates/elements/updates.html @@ -1,13 +1,20 @@ -{% import "elements/datetime.html" as datetime %} {% macro view(update) -%} +{% import "elements/datetime.html" as datetime %} + +{% macro recent(update) -%} <p> - {{ update.member.name }} on {{ datetime.date(update.time) }} at {{ - datetime.time(update.time) }}: {{ update.text }} + Annocement from {{ update.member.name }}: {{ update.content }} </p> -{%- endmacro %} {% macro recent(update) -%} +{%- endmacro %} + +{% macro view(update) -%} <p> - Annocement from {{ update.member.name }} on {{ datetime.date(update.time) }} - at {{ datetime.time(update.time) }}: {{ update.text }} + {{ update.member.name }} on {{ datetime.date(update.created) }} at {{ + datetime.time(update.created) }}: {{ update.content }} </p> -{%- endmacro %} {% macro list(updates) -%} {% for update in updates %} +{%- endmacro %} + +{% macro list(updates) -%} +{% for update in updates %} <div>{{ view(update) }}</div> -{% endfor %} {%- endmacro %} +{% endfor %} +{%- endmacro %} diff --git a/templates/home.html b/templates/home.html @@ -1,26 +1,39 @@ +<!DOCTYPE html> <html> <head> - {% import "elements/metadata.html" as metadata %} {{ metadata.head(group)}} + {% import "elements/metadata.html" as metadata %} + {{ metadata.head(group)}} <link rel="stylesheet" - href="{{ url_for('static', filename='style.css') }}" + href="{{ url_for('static', filename='main.css') }}" /> </head> - <header> - {% import "elements/navigation.html" as navigation %} {{ - navigation.bar(account) }} - </header> - <body> - {% import "elements/space.html" as space %} {{ space.stars(500) }} + <header> + {% import "elements/navigation.html" as navigation %} {{ + navigation.bar(account) }} + </header> + + {% import "elements/space.html" as space %} + {{ space.stars(500) }} <center> <h1>{{ group.name }}</h1> <p>{{ group.description }}</p> - {% import "elements/events.html" as events %} {{ - events.next(group.events[0]) }} {% import "elements/updates.html" as - updates %} {{ updates.recent(group.updates[0]) }} + {% import "elements/events.html" as events %} + {% if group.events | length > 0 %} + {{ events.next(group.events[0]) }} + {% else %} + <p>No upcoming events.</p> + {% endif %} + + {% import "elements/updates.html" as updates %} + {% if group.updates | length > 0 %} + {{ updates.recent(group.updates[0]) }} + {% else %} + <p>No recent updates.</p> + {% endif %} </center> </body> </html> diff --git a/templates/members.html b/templates/members.html @@ -1,7 +1,8 @@ +<!DOCTYPE html> <html> <head> - {% import "elements/metadata.html" as metadata %} {{ metadata.head(group, - "Members") }} + {% import "elements/metadata.html" as metadata %} + {{ metadata.head(group, "Members") }} <link rel="stylesheet" href="{{ url_for('static', filename='intro.css') }}" @@ -9,7 +10,8 @@ </head> <body> - {% import "elements/space.html" as space %} {{ space.stars(200) }} + {% import "elements/space.html" as space %} + {{ space.stars(200) }} <div id="board"> <div id="content"> <center> @@ -26,7 +28,7 @@ <p>{{ member.name }}</p> {% endfor %} <br /> - <h2>CREATED BY</h2> + <h2>THIS WAS CREATED BY</h2> <p>Damian Myrda</p> </center> </div> diff --git a/templates/projects.html b/templates/projects.html @@ -1,26 +1,35 @@ +<!DOCTYPE html> <html> <head> - {% import "elements/metadata.html" as metadata %} {% if create %} {{ - metadata.head(group, "New Project") }} {% else %} {{ metadata.head(group, - "Projects") }} {% endif %} + {% import "elements/metadata.html" as metadata %} + {% if create %} + {{ metadata.head(group, "New Project") }} + {% else %} + {{ metadata.head(group, "Projects") }} + {% endif %} <link rel="stylesheet" - href="{{ url_for('static', filename='style.css') }}" + href="{{ url_for('static', filename='main.css') }}" /> </head> - <header> - {% import "elements/navigation.html" as navigation %} {{ - navigation.bar(account) }} - </header> - <body> - {% import "elements/space.html" as space %} {{ space.stars(500) }} {% import - "elements/projects.html" as projects %} {% if create %} {{ projects.new() }} + <header> + {% import "elements/navigation.html" as navigation %} + {{ navigation.bar(account) }} + </header> + + {% import "elements/space.html" as space %} + {{ space.stars(500) }} + {% import "elements/projects.html" as projects %} + {% if create %} + {{ projects.new() }} {% else %} <h1>Projects</h1> - {{ projects.list(group.projects) }} {% if account %} + {{ projects.list(group.projects) }} + {% if account %} <a href="/projects/add">Add a Project</a> - {% endif %} {% endif %} + {% endif %} + {% endif %} </body> </html> diff --git a/templates/updates.html b/templates/updates.html @@ -1,23 +1,25 @@ +<!DOCTYPE html> <html> <head> - {% import "elements/metadata.html" as metadata %} {{ metadata.head(group, - "Updates") }} + {% import "elements/metadata.html" as metadata %} + {{ metadata.head(group, "Updates") }} <link rel="stylesheet" - href="{{ url_for('static', filename='style.css') }}" + href="{{ url_for('static', filename='main.css') }}" /> </head> - <header> - {% import "elements/navigation.html" as navigation %} {{ - navigation.bar(account) }} - </header> - <body> - {% import "elements/space.html" as space %} {{ space.stars(500) }} + <header> + {% import "elements/navigation.html" as navigation %} + {{ navigation.bar(account) }} + </header> + + {% import "elements/space.html" as space %} + {{ space.stars(500) }} <h1>Updates</h1> - {% import "elements/updates.html" as updates %} {{ - updates.list(group.updates) }} + {% import "elements/updates.html" as updates %} + {{ updates.list(group.updates) }} </body> </html>