Skip to content

task: initial url routing and templating - #81

Merged
tyliec merged 14 commits into
mainfrom
tyliec/url-routing-and-templates
Mar 26, 2024
Merged

tyliec merged 14 commits into
mainfrom
tyliec/url-routing-and-templates

Conversation

@tyliec

@tyliec tyliec commented Mar 25, 2024

Copy link
Copy Markdown
Member

Description

As recommended by @stefanw here, this PR introduces:

  • URL pattern matching in uipa_org/theme/urls.py
  • Various template overrides in uipa_org/templates/

Instructions

For anyone else looking at this PR, the way you can introduce new template overrides is as follows:

  • Look at froide/templates and find the correct file/section you are trying to edit, and replicate the same structure under uipa_org/templates
  • Ensure your {% block < > %} statements match the section you are trying to override

This settings code does the magic of importing any new template file automatically under the uipa_org/templates directory.

For introducing any new url routing, look at uipa_org/theme/urls.py's urlpatterns variable here:

urlpatterns += [
# TODO: Remove this when we have a proper about/help page
.

Example

Demo Image

Screenshot 2024-03-24 at 6 17 18 PM

@tyliec
tyliec requested a review from russtoku March 25, 2024 04:20
russtoku
russtoku previously approved these changes Mar 25, 2024

@russtoku russtoku left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. OK to merge for now.

I was able to get the dev website running with the database, search engine, and Vite front end. I also loaded the fixtures and uploaded 113 public bodies.

Minor thing:

  • I did notice that some JavaScript is missing because the drop-down menu for Hello after you login doesn't work.

Comment thread uipa_org/theme/models.py Resolved
Comment thread uipa_org/templates/base.html Resolved

@russtoku russtoku left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. The dev site runs and can load public bodies.

@tyliec
tyliec merged commit b38c929 into main Mar 26, 2024
@tyliec
tyliec deleted the tyliec/url-routing-and-templates branch March 26, 2024 10:54
@russtoku

Copy link
Copy Markdown
Member

Awesome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants