various changes making the website look better
This commit is contained in:
parent
022f41a883
commit
8d49357074
@ -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))
|
||||
|
||||
|
||||
@ -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")
|
||||
|
||||
@ -4,6 +4,6 @@ author: author
|
||||
date: date
|
||||
|
||||
# POST
|
||||
## TITLE
|
||||
# TITLE
|
||||
### DATE OR SUBTITLE
|
||||
POST 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
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -28,8 +28,12 @@
|
||||
<div class="dlog">
|
||||
{% for post in posts %}
|
||||
<div class="post">
|
||||
<div class="post-date">
|
||||
{{ post[0].date }}
|
||||
</div>
|
||||
{{ post[0].body|safe }}
|
||||
<div class="comment-container">
|
||||
<h2>Comments</h2>
|
||||
{% for comment in post[1] %}
|
||||
<div class="comment">
|
||||
<h4>{{ comment.username }}</h4>
|
||||
@ -38,7 +42,7 @@
|
||||
{% endfor %}
|
||||
{% if user %}
|
||||
<div class="comment-editor">
|
||||
<h3>{{ user }}</h3>
|
||||
<h4>{{ user }}</h4>
|
||||
<form method="post" action="/comment/{{ post[0].title }}">
|
||||
{{ form.hidden_tag() }}
|
||||
{{ form.textbox }}
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user