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 `browse/posts` and `browse/users` pages and update search functionality #53

Closed altheaden closed 6 months ago

altheaden commented 6 months ago

This PR adds two new pages with routes /browse/posts and /browse/users which stem from one page template, browse.html.

The header now has a button for each of these browse pages, which have replaced the search bar that was there before. Now, the search bars appear within each page, and search only for posts and users, respectively.

I've re-organized how searching is handled in the server.py file, abstracting most of its functionality out into a helper function that is shared between the routes for these two pages and a route for the search results page. This change is also reflected in the new search.html template, which is effectively taking over the role of the results.html template. The results.html template is now only for getting the results of a search as a list, while the search.html template actually shows the "search results" page (with the header "Search results:", etc.), and includes the results.html template.

The DB manager now passes the post author's UID and username to the post search results so these can be linked in the results.

Finally, I made a few small CSS changes, mainly relating to the header.