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

Move the contents of the header in the main layout to the pages' templates #15560

Open
octopusinvitro opened this issue Sep 21, 2016 · 0 comments

Comments

@octopusinvitro
Copy link
Contributor

octopusinvitro commented Sep 21, 2016

Problem

We have a lot of logic in the main header to split the behaviour of the page depending on the page that we send to it. This if/else logic is tightly coupled to types. We already abstracted types by creating separate page classes for each type of page, so this logic is in the wrong place.

We also have some logic at the top of the layout.erb template to check for the presence of variables that are present only for some pages. These are there due to the header logic as well.

Proposed Solution

For now I think we should just move the header to the pages templates, and adapt it to each page, since the header is different depending on the type of page we are in. We will have some repetition, but that can be solved once we make the repetition obvious and find the right pattern.

Acceptance Criteria

There is no logic in the main header and each page template has a dedicated header, and there is no variable logic at the top of the layout.erb.

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

No branches or pull requests

2 participants