Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create new base.html file and replace base.html for new design #4815

Open
mlissner opened this issue Dec 12, 2024 · 0 comments
Open

Create new base.html file and replace base.html for new design #4815

mlissner opened this issue Dec 12, 2024 · 0 comments
Assignees

Comments

@mlissner
Copy link
Member

mlissner commented Dec 12, 2024

I think all of our templates inherit from base.html with a tag like:

{% extends "base.html" %}

We can't get very far on the redesign until base.html is replaced with a new template that uses tailwind and components.

I think what we can do to make this transition is to add a waffle to all of the new pages.

Ideally, we could do something like:

{% load waffle_tags %}
{% flag "is_new_design" %}
   {% extends "new_base.html" %}
{% else %}
   {% extends "base.html" %}
{% endif %}

Unfortunately, that won't work because the extends tag has to go first, so what we need to do instead is move it to the view with something like:

def my_view(request):
    is_new_design = waffle.flag_is_active(request, "is_new_design")
    context = {"is_new_design": is_new_design}
    return TemplateResponse(request, "help/alert_help.html", context)

And then in your template, you can do:

{% extends is_new_view|yesno:"new_base.html,base.html" %}

From here: https://stackoverflow.com/a/7817990/64911

Later, when the new view is launched, we remove the flags, and we're good to go.


So to complete this ticket:

  1. Create new_base.html as a clone of base.html, but using tailwind and components. As an MVP, it should just have blank spaces for the header, navbar, and footer.
  2. Apply new_base.html to /components as an MVP.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: To Do
Development

No branches or pull requests

2 participants