metamaps--metamaps/app/views/layouts/_account.html.erb

46 lines
1.7 KiB
Plaintext
Raw Normal View History

<%#
# @file
# The inner HTML of the account box that comes up in the bottom left
#%>
<% if authenticated? %>
<% account = current_user %>
<h3 class="accountHeader">Hello <%= account.name.split[0...1][0] %>!</h3>
<ul>
2014-08-10 17:06:58 +00:00
<li class="accountIcon accountSettings"><%= link_to "Account", edit_user_url(account),
:data => { :bypass => 'true'} %></li>
<% if account.admin %>
2014-08-10 17:06:58 +00:00
<li class="accountIcon accountAdmin"><%= link_to "Admin", metacodes_path,
:data => { :bypass => 'true'} %></li>
<% end %>
2014-02-07 17:55:11 +00:00
<li class="accountIcon accountInvite openLightbox" data-open="invite"><span>Share Invite</span></li>
2014-08-10 17:06:58 +00:00
<li class="accountIcon accountLogout"><%= link_to "Logout", "/sign_out", id: "Logout",
:data => { :bypass => 'true'} %></li>
</ul>
<% else %>
<h3 class="accountHeader">Sign In</h3>
<%= form_for(resource, :as => resource_name, :url => session_path(resource_name), :html => { class: "loginAnywhere" }) do |f| %>
<div>
<%= f.label :email %>
<%= f.email_field :email, :autofocus => true %>
</div>
<div>
<%= f.label :password %>
<%= f.password_field :password %>
</div>
<% if devise_mapping.rememberable? -%>
<div><%= f.check_box :remember_me %> <%= f.label :remember_me %><div class="clearfloat"></div></div>
<% end -%>
<div>
<%= f.submit "Sign in" %><br>
</div>
<% end %>
<div class="links">
<%- if devise_mapping.recoverable? && controller_name != 'passwords' %>
<%= link_to "Forgot your password?", new_password_path(resource_name) %>
<% end -%>
<a href="/request">Request Invite</a>
</div>
<% end %>