users: add /profile page (fix #4151).

* Add /profile, /profile.json endpoints.
* Make "My Account" link to /profile.
* Add 'User ID' field to profile page.
This commit is contained in:
evazion
2019-09-01 14:08:55 -05:00
parent a932b25608
commit ff92b32f02
9 changed files with 51 additions and 8 deletions

View File

@@ -12,7 +12,7 @@
<li>|</li>
<% if @user.id == CurrentUser.user.id %>
<%= subnav_link_to "Settings", edit_user_path(CurrentUser.user) %>
<%= subnav_link_to "Profile", user_path(CurrentUser.user) %>
<%= subnav_link_to "Profile", profile_path %>
<%= subnav_link_to "Messages #{CurrentUser.user.dmail_count}", dmails_current_folder_path %>
<% if !@user.is_platinum? %>

View File

@@ -2,6 +2,10 @@
<h2>Statistics</h2>
<table width="100%" class="user-statistics">
<tbody>
<tr>
<th>User ID</th>
<td><%= user.id %></td>
</tr>
<tr>
<th>Join Date</th>
<td><%= presenter.join_date %></td>

View File

@@ -2,11 +2,11 @@
<div id="a-show">
<h1><%= link_to_user @user %></h1>
<%= render "statistics", :presenter => @presenter, :user => @user %>
<%= render "statistics", presenter: @user.presenter, user: @user %>
<% if !CurrentUser.is_admin? && !@user.enable_privacy_mode? || CurrentUser.id == @user.id %>
<%= render "posts/partials/common/inline_blacklist" %>
<%= render "post_summary", :presenter => @presenter, :user => @user %>
<%= render "post_summary", presenter: @user.presenter, user: @user %>
<% end %>
</div>
</div>
@@ -14,7 +14,7 @@
<%= render "secondary_links" %>
<% content_for(:page_title) do %>
User - <%= @presenter.name %> - <%= Danbooru.config.app_name %>
User - <%= @user.presenter.name %> - <%= Danbooru.config.app_name %>
<% end %>
<% content_for(:html_header, auto_discovery_link_tag(:atom, comments_url(:atom, search: { post_tags_match: "user:#{@user.name}" }), title: "Comments on #{@user.name}'s uploads")) %>