Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def message(color, message):
f"\033[95m {currentTime(True)}]\033[0m"
f"\033[9{color}m {message}\033[0m\n"
)
logFile = open("log.log", "a")
logFile = open("log.log", "a", encoding="utf-8")
logFile.write(f"[{currentDate()}" f"|{currentTime(True)}]" f" {message}\n")
logFile.close()

Expand Down
9 changes: 6 additions & 3 deletions routes/editPost.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,16 @@ def editPost(postID):
connection = sqlite3.connect("db/posts.db")
cursor = connection.cursor()
cursor.execute(
f'update posts set title = "{postTitle}" where id = {post[0]}'
"""update posts set title = ? where id = ? """,
(postTitle, post[0]),
)
cursor.execute(
f'update posts set tags = "{postTags}" where id = {post[0]}'
"""update posts set tags = ? where id = ? """,
(postTags, post[0]),
)
cursor.execute(
f'update posts set content = "{postContent}" where id = {post[0]}'
"""update posts set content = ? where id = ? """,
(postContent, post[0]),
)
cursor.execute(
f'update posts set lastEditDate = "{currentDate()}" where id = {post[0]}'
Expand Down
121 changes: 121 additions & 0 deletions static/css/post.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
.post {
display: flex;
flex-direction: column;
max-width: 50rem;
margin-top: 1.5rem;
}

.post p img {
max-width: 100%;
}

.post h1 {
text-align: center;
}

.title {
font-size: 2rem;
}

.bottomBar {
display: flex;
align-items: stretch;
justify-content: space-between;
}

.linkLogin {
color: var(--primaryColor);
transition: 0.25s;
}

.linkLogin:hover {
color: var(--themePrimary);
}

.comment {
display: block;
width: 25rem;
height: 8rem;
background-color: transparent;
border: none;
resize: none;
padding: 1rem;
font-size: 0.8rem;
}

.comment:focus {
outline: none;
}

small {
font-size: 0.75rem;
}

.btnSubmit {
background-color: var(--primaryColor);
color: var(--themeSecondary);
border: 0px;
border-radius: 1rem;
height: 2rem;
width: 5rem;
font-size: 0.75rem;
transition: 0.25s;
margin: auto 0.5rem 0.5rem 0rem;
cursor: pointer;
}

.btnSubmit:hover {
background-color: transparent;
color: var(--primaryColor);
}

.commentForm {
margin: 2rem auto 0 auto;
display: flex;
justify-content: space-between;
width: fit-content;
border: 1px solid var(--primaryColor);
border-radius: 1rem;
}

.comments {
margin: 3rem auto 0 auto;
width: 32rem;
font-size: 0.75rem;
display: flex;
justify-content: space-between;
flex-wrap: wrap;
align-items: center;
}

.commentUserNameContainer {
font-size: 0.7rem;
margin-right: 2rem;
}

.commentUserNameContainer p {
margin: 0;
}

.profilePicture {
margin-right: 0.6rem;
}

.dateTime h5 {
text-align: right;
}

@media screen and (max-width: 600px) {
.comments,
.comments small {
max-width: 100% !important;
}

.commentForm textarea {
width: 100%;
}

.navbar * {
width: 100%;
}
}