houdini/app/views/layouts/_user_menu.html.erb
2021-04-23 12:59:42 -05:00

49 lines
1.7 KiB
Text

<%- # License: AGPL-3.0-or-later WITH WTO-AP-3.0-or-later
# Full license explanation at https://github.com/houdiniproject/houdini/blob/master/LICENSE -%>
<% if current_user %>
<section class='sideNav-section'>
<a class='sideNav-link' href='<%= profile_url(current_user.profile) %>'>
<% if current_user.profile.picture.attached? %>
<%= image_tag rails_storage_proxy_url(current_user.profile.picture_by_size(:tiny)), class: 'sideNav-profile' %>
<% else %>
<i class="sideNav-icon icon-user-1"></i>
<% end %>
<span class='sideNav-text'><%= current_user.profile.name.blank? ? 'Your Profile' : current_user.profile.name %></span>
</a>
</section>
<section class='sideNav-section'>
<a class='sideNav-link' href='<%= settings_path %>'>
<i class='sideNav-icon icon-setting-gear'></i>
<span class='sideNav-text'>Settings</span>
</a>
<% if current_role?([:nonprofit_admin,:nonprofit_associate]) %>
<% if Houdini.hoster.terms_and_privacy&.help_url %>
<a class='sideNav-link' href='<%=Houdini.terms_and_privacy.help_url %>'>
<i class='sideNav-icon icon-question-mark'></i>
<span class='sideNav-text'>Help</span>
</a>
<% end %>
<% end %>
<a class='sideNav-link' href='<%= destroy_user_session_path %>'>
<i class='sideNav-icon icon-log-out-1'></i>
<span class='sideNav-text'>Logout</span>
</a>
</section>
<% else %>
<section class='sideNav-section'>
<a class='sideNav-link' open-modal='loginModal'>
<i class='sideNav-icon icon-key-2'></i>
<span class='sideNav-text'>Login</span>
</a>
<a class='sideNav-link' open-modal='chooseRoleModal'>
<i class='sideNav-icon icon-user-add-1'></i>
<span class='sideNav-text'>Sign up</span>
</a>
</section>
<% end %>