<% provide :title, t('.title') %>
<div id="user-index">
  <% if @current_user.is_anonymous? %>
    <h2><%= t('.not_logged_in') %></h2>

    <ul class="link-page">
      <li><%= link_to t('.login'), :action => :login %></li>
      <% if CONFIG["enable_signups"] %>
        <li><%= link_to t('.signup'), :action => :signup %></li>
      <% else %>
        <li><%= t('.no_signup') %></li>
      <% end %>
      <li><%= link_to t('.reset_password'), :action => :reset_password %></li>
    </ul>
  <% else %>
    <h2><%= t('.greet_user', :u => @current_user.name) %></h2>
    <p><%= t('.action_info') %></p>

    <div class="section">
      <ul class="link-page">
        <li><%= link_to t('layouts.menu.account.logout'), logout_path, remote: true, method: :delete %></li>
        <li><%= link_to t('.my_profile'), :action => :show, :id => @current_user.id %></li>
        <li><%= link_to t('.my_mail'), :controller => :dmail, :action => :inbox %></li>
        <li><%= link_to t('.my_favorites'), :controller => :post, :action => :index, :tags => "vote:3:#{@current_user.name} order:vote" %></li>
        <li><%= link_to t('.settings'), :action => :edit %></li>
        <li><%= link_to t('.change_password'), :action => :change_password %></li>
      </ul>
    </div>

    <% if @current_user.is_janitor_or_higher? %>
      <div>
        <h4><%= t('.moderator_tools') %></h4>
        <ul class="link-page">
          <li><%= link_to t('.invites'), :action => :invites %></li>
          <% if @current_user.is_mod_or_higher? %>
            <li><%= link_to t('.blocked_users'), :action => :show_blocked_users %></li>
          <% end %>
        </ul>
      </div>
    <% end %>
  <% end %>
</div>

<%= render :partial => 'footer' %>
