franklindyer / agora-app

Simple and (hopefully) secure social media application. Also a project for spring 2024 CS 444 cybersecurity class at UNM.
4 stars 1 forks source link

Add post writing and editing pages #56

Closed altheaden closed 6 months ago

altheaden commented 6 months ago

This PR adds two new functionalities - writing new posts and editing existing posts - both of which operate within the new write-post.html template.

There is a new button on the profile page which allows a user to write a new post, and clicking on any existing post now gives the user an "edit post" button if they are the author of the post they're viewing.

Editing/writing a new post functions within the limits set in the limits dict in the parameters file. This means the user will be limited from writing a post title or body that is too long, and also too short. The title field is required, but the body is not.

After editing a post or creating a new post, the user is redirected to the page for viewing their post. This required a change in the data manager, interpreter, and server to return the PID after inserting a post.

Issues: Currently, scrolling for the edit post view is restricted to within the box, which feels ugly. I am going to fix this when I overhaul a few existing template functionalities with js in a later PR. However, everything functions as expected, it's just not pretty.

franklindyer commented 6 months ago

Nice! These look good to me.