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

Fix navigation issues #1685

Merged
merged 6 commits into from
Oct 23, 2020
Merged

Fix navigation issues #1685

merged 6 commits into from
Oct 23, 2020

Conversation

MarcSkovMadsen
Copy link
Collaborator

For users serving multiple apps/ pages the templates provide no way to navigate to the root of the site. This PR will provide that. See #1684.

So far I've added navigation to the root of the site from the logo for all templates.

image

@MarcSkovMadsen
Copy link
Collaborator Author

MarcSkovMadsen commented Oct 23, 2020

I've added a site parameter to the base template and implemented the functionality for the vanilla Template.

The purpose is to enable navigation to the root in a multi page application with no-logo.

image

image

@MarcSkovMadsen
Copy link
Collaborator Author

MarcSkovMadsen commented Oct 23, 2020

I've applied the same changes to the material and golden. Had to update vanilla a bit to keep things consistent.

If won't touch bootstrap now as it does not work for me at all. So I cannot really test these changes in isolation.

Looks nice also with logo, site title and app title.

image

and the original behaviour without a site title still works.

image

@MarcSkovMadsen
Copy link
Collaborator Author

Ready for review @philippjfr . I would need this to showcase things at awesome-panel.org and for work because I run multipage apps.

@MarcSkovMadsen MarcSkovMadsen added status: ready type: enhancement Minor feature or improvement to an existing feature and removed in progress labels Oct 23, 2020
@MarcSkovMadsen
Copy link
Collaborator Author

And let me know if there is anything I can do to make reviewing and merging this easier. Thanks.

Copy link
Member

@philippjfr philippjfr left a comment

Choose a reason for hiding this comment

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

Just a few minor comments.

@@ -29,13 +29,11 @@
<button class="material-icons mdc-top-app-bar__navigation-icon mdc-icon-button">menu</button>
{% endif %}
<div class="title-bar">
<span class="mdc-top-app-bar__title">
Copy link
Member

Choose a reason for hiding this comment

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

We should continue using this class, can you achieve what you need by adding a second more readable class?

{% if app_title %}
<span id="app-title">
<a class="title" href="" >{{ app_title }}</a>
</span>
Copy link
Member

Choose a reason for hiding this comment

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

Why no site here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Simply because bootstrap does not Work for me. Cf. Yesterdays test report and comment above.

Copy link
Member

Choose a reason for hiding this comment

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

I've fixed this.

Copy link
Member

Choose a reason for hiding this comment

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

This PR is not against the latest version, you seem to forget pulling before you start making PRs 🙂

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I don't believe so. I'm quite sure I git fetch, git pull holoviz master when I start. I think its because you do work in the mean time. Otherwise there is something technically I don't understand.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ok. I can see you merged the bootstrap fixes yesterday. I must be doing something wrong with git. I simply don't understand it.

@@ -38,7 +38,7 @@ def test_template_with_sidebar(template_class=pn.template.VanillaTemplate, theme
logo=LOGO,
theme=theme
)

vanilla.site="My Site"
Copy link
Member

Choose a reason for hiding this comment

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

Not a big deal but why not set this in the constructor?

Copy link
Collaborator Author

@MarcSkovMadsen MarcSkovMadsen Oct 23, 2020

Choose a reason for hiding this comment

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

Background: The site is as "optional" parameter for users that serve multiple applications. They can specify it in the constructor the acceptsparams. They can also specify it afterwards. Just as they can for the title.

Is your question why I did not make site a named parameter in the __init__ function?

If your question is why I did not specify it in the constructor, then the answer is that I wanted to test the callback that is set up. Just as for the title.

@MarcSkovMadsen
Copy link
Collaborator Author

MarcSkovMadsen commented Oct 23, 2020

I will start fixing now. Should I git pull holoviz master into this?

UPDATE: I WILL DO.

@MarcSkovMadsen
Copy link
Collaborator Author

Ready for review @philippjfr

I've fixed your comments (except the site comment) and also fixed the boostrap padding+scrollbar problems from the testreport #1680

@philippjfr
Copy link
Member

Thanks, looks good!

@philippjfr philippjfr merged commit ffb640b into master Oct 23, 2020
@philippjfr philippjfr deleted the template-navigation-fixes branch October 23, 2020 16:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready for review status: ready type: enhancement Minor feature or improvement to an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants