-
Notifications
You must be signed in to change notification settings - Fork 1
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
Conversation
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.
app/views/radius/_topnavbar.html.erb
Outdated
<nav class="navbar topnavbar" role="navigation"> | ||
<!--START navbar header--> | ||
<div class="navbar-header"> | ||
<a class="navbar-brand" href="//www.radiusnetworks.com/"> |
There was a problem hiding this comment.
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?
app/views/radius/_topnavbar.html.erb
Outdated
</a> | ||
</li> | ||
<li> | ||
<a href="//store.radiusnetworks.com" title="Radius Networks Store"> |
There was a problem hiding this comment.
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
app/views/radius/_topnavbar.html.erb
Outdated
<p class="m0">Teams</p> | ||
<p class="m0 text-muted"> | ||
<small> | ||
You belong to <%= pluralize(current_user.accounts.count ,"team") %> |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 thekracken_url
. It doesn't work forteams_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!