diff --git a/app/app.py b/app/app.py index b2a4ccc..99679d7 100644 --- a/app/app.py +++ b/app/app.py @@ -128,7 +128,8 @@ def index(): comments = comment.get_comments(post.title) posts_and_comments.append(({ "body" : post.body, - "title" : post.title + "title" : post.title, + "date" : post.get_date() }, comments)) diff --git a/app/post.py b/app/post.py index 8c51279..9accc64 100644 --- a/app/post.py +++ b/app/post.py @@ -25,5 +25,7 @@ class Post: date = lines[3].split(":")[1].strip() self.date = datetime.datetime.strptime(date, "%d-%m-%Y") - self.body = markdown.markdown(f'# [{self.title}]({self.url})\n' + ''.join(lines[7:])) + self.body = markdown.markdown(f'# [{self.title}]({self.url})\n' + ''.join(lines[7:]), extensions=['footnotes']) + def get_date(self) -> str: + return self.date.strftime("%B %d, %Y") diff --git a/app/posts/POST_TEMPLATE.md b/app/posts/POST_TEMPLATE.md index 7fd0fb8..23f96f1 100644 --- a/app/posts/POST_TEMPLATE.md +++ b/app/posts/POST_TEMPLATE.md @@ -4,6 +4,6 @@ author: author date: date # POST -## TITLE +# TITLE ### DATE OR SUBTITLE POST TEXT diff --git a/app/resources/status.text b/app/resources/status.text index 0fece64..00201ed 100644 --- a/app/resources/status.text +++ b/app/resources/status.text @@ -101,6 +101,7 @@ Buildings that you know // People come and go // Are a certain way And then you get the news that obliterates your view // Amputate your truths // The signifiance has changed Hospital inane // Meaningless and grey // But lie within the walls and the signifiance will change What would it take for us to change the game? // Maybe our existence is signifiance in vain +Is that what we consider changing? // Ah, save me # Candles by King Gizzard & The Lizard Wizard This little man is too hot to handle // Set the funeral on fire with the candles diff --git a/app/static/style.css b/app/static/style.css index 14450f9..9bdca92 100644 --- a/app/static/style.css +++ b/app/static/style.css @@ -19,6 +19,10 @@ html { --primary20: hsla(209, 61%, 71%, 20%); --primary40: hsla(209, 61%, 71%, 40%); --secondary: hsl(277, 81%, 33%); + --secondary10: hsla(277, 81%, 33%, 10%); + --secondary20: hsla(277, 81%, 33%, 20%); + --secondary30: hsla(277, 81%, 33%, 30%); + --secondary40: hsla(277, 81%, 33%, 40%); --secondary50: hsla(277, 81%, 33%, 50%); --accent: hsl(291, 81%, 60%); --accent75: hsla(291, 81%, 60%, 75%); @@ -43,7 +47,24 @@ a:hover { color: var(--accent); } +blockquote { + background-color: var(--secondary10); + border-style: var(--borders-style); + border-radius: 7.5px; + padding: 0.25em; +} +.post blockquote p { + text-indent: 1.5em; +} + +.post blockquote li p { + text-indent: 0; +} + +li { + margin-left: 4em; +} /* Other */ @@ -206,6 +227,10 @@ a:hover { text-indent: 3em; } +.post-date { + float: right; +} + .comment-container { background-color: var(--primary40); border-style: var(--borders-style); @@ -215,6 +240,24 @@ a:hover { margin: 1em; } +.comment { + background-color: var(--primary40); + border-style: var(--borders-style); + border-radius: 5px; + + margin: 0.25em; + padding: 0.25em; +} + +.comment h4 { + margin: 0.25em; +} + +.comment p { + margin: 0.25em; + text-indent: 1em; +} + .comment-editor textarea { width: 80%; height: 6em; diff --git a/app/templates/index.html b/app/templates/index.html index 461277f..a38e515 100644 --- a/app/templates/index.html +++ b/app/templates/index.html @@ -28,8 +28,12 @@
{% for post in posts %}
+ {{ post[0].body|safe }}
+

Comments

{% for comment in post[1] %}

{{ comment.username }}

@@ -38,7 +42,7 @@ {% endfor %} {% if user %}
-

{{ user }}

+

{{ user }}

{{ form.hidden_tag() }} {{ form.textbox }} diff --git a/app/user.py b/app/user.py index d8b2659..e7ae060 100644 --- a/app/user.py +++ b/app/user.py @@ -40,7 +40,7 @@ def add_user(): # check if user exists if username in user_data: - flask.abort(400) + return 'ERROR PROCESSING REQUEST - That user already exists' # Store password / server side cookie user_data[username] = base64.b64encode(password.encode()).decode() @@ -71,11 +71,11 @@ def login_user(): # check if user exists if username not in user_data: - flask.abort(400) + return 'ERROR PROCESSING REQUEST - Bad username OR password' # Does password match? if user_data[username] != password: - flask.abort(400) + return 'ERROR PROCESSING REQUEST - Bad username OR password' flask.session['username'] = username