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

Refactor templates and includes #1528

Closed
5 tasks
thekaveman opened this issue Jul 13, 2023 · 6 comments
Closed
5 tasks

Refactor templates and includes #1528

thekaveman opened this issue Jul 13, 2023 · 6 comments
Labels
chore Chores and tasks for code cleanup, dev experience, etc. front-end HTML/CSS/JavaScript and Django templates

Comments

@thekaveman
Copy link
Member

thekaveman commented Jul 13, 2023

This should follow the completion of #1442.

The results of #1442 and related efforts are to create many more template includes, template variables, and generally move more display to the templates (the goal!)

We opted to take an incremental approach and not worry about being super DRY, mostly focusing on getting the translation strings into templates and not as much template or include structure and what we were repeating.

This task is to go back to the templates and look for opportunities to cleanup:

  • base.html and other core template structure
  • flow or agency specific template structure
  • error page template structure
  • the many {% include %} templates structure
  • button templates and styles
@thekaveman thekaveman added chore Chores and tasks for code cleanup, dev experience, etc. front-end HTML/CSS/JavaScript and Django templates labels Jul 13, 2023
@thekaveman thekaveman moved this from Todo to Blocked in Digital Services Jul 13, 2023
@thekaveman thekaveman moved this from Blocked to Todo in Digital Services Jul 25, 2023
@machikoyasuda
Copy link
Member

One thing we can do: Now that the app officially doesn't have anymore text next to call to action buttons, we can delete this whole section from base.html -

https://github.com/cal-itp/benefits/blob/dev/benefits/core/templates/core/base.html#L87
image

@machikoyasuda
Copy link
Member

While going through the app's typography, I noticed that there is 1 that does not have proper h1, h2, h3 ordering. Enrollment Index goes from H1 (the heading) to H3 (the Media Item title). On other page that uses Media Item, Eligibility Start, there's a H2 in between the heading and the Media Items, so that one's okay with Media Item titles being H3s.

This is somewhat related to this issue, because it's related to how we're sharing code through the Media Items include across pages, but it might lead to a situation like this where we have to change one small thing to get valid HTML.

image

@machikoyasuda
Copy link
Member

@machikoyasuda
Copy link
Member

Delete, unused:
image

@thekaveman
Copy link
Member Author

While going through the app's typography, I noticed that there is 1 that does not have proper h1, h2, h3 ordering. Enrollment Index goes from H1 (the heading) to H3 (the Media Item title). On other page that uses Media Item, Eligibility Start, there's a H2 in between the heading and the Media Items, so that one's okay with Media Item titles being H3s.

This is somewhat related to this issue, because it's related to how we're sharing code through the Media Items include across pages, but it might lead to a situation like this where we have to change one small thing to get valid HTML.

This was fixed in #1976

@thekaveman
Copy link
Member Author

This feels too generic of an issue and not something that is causing a direct problem right now. We can come back with more specific refactor issues if needed.

@thekaveman thekaveman closed this as not planned Won't fix, can't repro, duplicate, stale Jun 11, 2024
@github-project-automation github-project-automation bot moved this from Todo to Done in Digital Services Jun 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Chores and tasks for code cleanup, dev experience, etc. front-end HTML/CSS/JavaScript and Django templates
Projects
Archived in project
Development

No branches or pull requests

2 participants