Files
danbooru/app/views/users/_secondary_links.html.erb
evazion 6468df6d44 dmails: allow marking dmails as unread.
* Add ability to mark dmails as unread.
* Fix users.unread_dmail_count to not count deleted dmails.
* Fix show action so that API calls don't mark dmails as read.
* Don't show the unread dmail notice on the /dmails page itself.
* Stop using users.has_mail flag.
2020-02-01 15:49:33 -06:00

43 lines
1.7 KiB
Plaintext

<% content_for(:secondary_links) do %>
<%= quick_search_form_for(:name_matches, users_path, "users", autocomplete: "user", redirect: true) %>
<%= subnav_link_to "Listing", users_path %>
<%= subnav_link_to "Search", search_users_path %>
<% if CurrentUser.user.is_anonymous? %>
<%= subnav_link_to "Sign up", new_user_path %>
<% end %>
<% if @user && !@user.new_record? && !CurrentUser.user.is_anonymous? %>
<li>|</li>
<% if @user.id == CurrentUser.user.id %>
<%= subnav_link_to "Profile", profile_path %>
<%= subnav_link_to "Settings", settings_path %>
<%= subnav_link_to "Messages #{unread_dmail_indicator(CurrentUser.user)}", dmails_path(search: { folder: "received" }) %>
<% if !@user.is_platinum? %>
<%= subnav_link_to "Upgrade", new_user_upgrade_path %>
<% end %>
<% else %>
<%= subnav_link_to "Send message", new_dmail_path(:dmail => {:to_id => @user.id}) %>
<% if !@user.is_platinum? %>
<%= subnav_link_to "Gift upgrade", new_user_upgrade_path(:user_id => @user.id) %>
<% end %>
<% if @user.reportable_by?(CurrentUser.user) %>
<%= subnav_link_to "Report user", new_moderation_report_path(moderation_report: { model_type: "User", model_id: @user.id }), remote: true %>
<% end %>
<% end %>
<% if CurrentUser.user.is_moderator? %>
<%= subnav_link_to "Promote", edit_admin_user_path(@user) %>
<% if @user.is_banned? %>
<%= subnav_link_to "Unban", ban_path(@user.recent_ban) %>
<% else %>
<%= subnav_link_to "Ban", new_ban_path(:ban => {:user_id => @user.id}) %>
<% end %>
<% end %>
<li>|</li>
<%= subnav_link_to "Log out", logout_path %>
<% end %>
<% end %>