1
0
Fork 0
This repository has been archived on 2023-03-27. You can view files and clone it, but cannot push or open issues or pull requests.
lpr-partynest/app/views/application/_navbar.html.erb

75 lines
2.7 KiB
Text
Raw Normal View History

2018-11-26 10:04:15 -05:00
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
<a class="navbar-brand" href="<%= root_path %>">
2018-12-05 13:15:04 -05:00
<%= translate :title %>
2018-11-26 10:04:15 -05:00
</a>
2018-12-07 20:40:02 -05:00
<button class="navbar-toggler"
type="button"
data-toggle="collapse"
data-target="#navbarSupportedContent"
aria-controls="navbarSupportedContent"
aria-expanded="false"
aria-label="Toggle navigation">
2018-11-26 10:04:15 -05:00
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
2019-02-01 17:22:28 -05:00
<ul class="navbar-nav ml-auto mr-3">
2019-02-01 17:58:44 -05:00
<% if current_account %>
2019-02-01 17:22:28 -05:00
<li class="nav-item dropdown">
2019-02-01 17:58:44 -05:00
<%= link_to current_account.username,
2019-02-01 17:22:28 -05:00
'#',
id: :navbarDropdown,
2019-02-01 17:06:27 -05:00
role: :button,
2019-02-01 17:22:28 -05:00
class: 'nav-link dropdown-toggle',
'data-toggle': :dropdown,
'aria-haspopup': true,
'aria-expanded': false %>
2019-02-01 17:06:27 -05:00
2019-02-01 17:22:28 -05:00
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
2019-02-01 18:41:33 -05:00
<% if policy(current_account).show? %>
<%= link_to translate('users.shared.links.profile'),
account_path(current_account),
role: :button,
class: 'dropdown-item' %>
<% end %>
2018-12-07 20:47:49 -05:00
2019-02-01 18:41:33 -05:00
<% if policy(%i[settings profile]).edit? %>
<%= link_to translate('users.shared.links.settings'),
edit_settings_profile_path,
role: :button,
class: 'dropdown-item' %>
<% end %>
2019-02-01 17:06:27 -05:00
2019-03-23 19:24:09 -04:00
<% if policy(%i[users session]).destroy? %>
2019-02-01 17:22:28 -05:00
<div class="dropdown-divider"></div>
2019-03-23 19:24:09 -04:00
<%= link_to translate('users.shared.links.sign_out'),
destroy_user_session_path,
method: :delete,
role: :button,
class: 'dropdown-item' %>
2019-02-01 17:22:28 -05:00
<% end %>
</div>
</li>
<% end %>
2018-12-07 20:40:02 -05:00
</ul>
2018-11-29 17:43:24 -05:00
2019-03-23 19:24:09 -04:00
<div>
<% if policy(%i[users session]).new? %>
<%= link_to translate('users.shared.links.sign_in'),
new_user_session_path,
role: :button,
class: 'btn btn-light mr-2' %>
<% end %>
2019-02-01 17:22:28 -05:00
2019-03-23 19:24:09 -04:00
<% if policy(%i[users registration]).new? %>
<%= link_to translate('users.shared.links.sign_up'),
new_user_registration_path,
role: :button,
class: 'btn btn-primary' %>
<% end %>
</div>
2018-11-26 10:04:15 -05:00
</div>
</nav>