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

Add topnavbar to theme assets #15

Merged
merged 2 commits into from
Jun 15, 2018
Merged

Add topnavbar to theme assets #15

merged 2 commits into from
Jun 15, 2018

Conversation

csexton
Copy link
Member

@csexton csexton commented Jun 1, 2018

Converted the topnavbar to erb and added the partial.

This allow us to easily update the top navigation across any site that uses the radius theme and have it be consistent. The instigator here was removing the link to the plans page. Ya know, since there is no more plans page.

I added helpers for building the urls, most of them check to see if the equivalent route is defined and return that if so. These should only be defined in the Kracken Rails app itself, so the links in that dropdown will use the local app.

This works great for most links. The destroy_user_session_path is only defined in Kracken Rails, so can check if that exists; if it does use it, else build the url from the kracken_url. It doesn't work for teams_path, many of the client apps have a team controller so checking for that won't work well.

Finding a way to detect if we are in the Kracken Rails app proved to be tricky and out of the scope of this change. I am open to suggestions if you got 'em!

image

Converted the topnavbar to erb and added the partial.

This allow us to easily update the top navigation across any site that
uses the radius theme and have it be consistent. The instigator here was
removing the link to the plans page. Ya know, since there is no more
plans page.

I added helpers for building the urls, most of them check to see if the
equivalent route is defined and return that if so. These should only be
defined in the Kracken Rails app itself, so the links in that dropdown
will use the local app.

This works great for most links. The `destroy_user_session_path` is only
defined in Kracken Rails, so can check if that exists; if it does use it, else
build the url from the `kracken_url`. It doesn't work for `teams_path`,
many of the client apps have a team controller so checking for that
won't work well.

Finding a way to detect if we are in the Kracken Rails app proved to be
tricky and out of the scope of this change.
@csexton csexton requested a review from cupakromer June 4, 2018 15:03
<nav class="navbar topnavbar" role="navigation">
<!--START navbar header-->
<div class="navbar-header">
<a class="navbar-brand" href="//www.radiusnetworks.com/">
Copy link
Contributor

Choose a reason for hiding this comment

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

Any reason to not hardcode this to HTTPS?

</a>
</li>
<li>
<a href="//store.radiusnetworks.com" title="Radius Networks Store">
Copy link
Contributor

Choose a reason for hiding this comment

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

Same comment here about forcing HTTPS

<p class="m0">Teams</p>
<p class="m0 text-muted">
<small>
You belong to <%= pluralize(current_user.accounts.count ,"team") %>
Copy link
Contributor

Choose a reason for hiding this comment

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

This will have problems on new apps as they do not have Account any more. Just teams.

Copy link
Contributor

@cupakromer cupakromer left a comment

Choose a reason for hiding this comment

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

:shipit:

@csexton csexton merged commit 8f2162f into master Jun 15, 2018
@csexton csexton deleted the topnavbar branch June 15, 2018 14:57
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