refactor artist views
This commit is contained in:
42
app/views/artists/_summary.html.erb
Normal file
42
app/views/artists/_summary.html.erb
Normal file
@@ -0,0 +1,42 @@
|
||||
<!--
|
||||
artist
|
||||
-->
|
||||
<ul>
|
||||
<li><strong>Status</strong> <%= artist.status %></li>
|
||||
|
||||
<% if !artist.is_banned? || CurrentUser.is_member? %>
|
||||
<% if artist.has_tag_alias? %>
|
||||
<li><strong>Tag Alias</strong> <%= artist.tag_alias_name %></li>
|
||||
<% end %>
|
||||
<% if artist.other_names.present? %>
|
||||
<li><strong>Other Names</strong> <%= link_to_artists(artist.other_names.split(/ /)) %></li>
|
||||
<% end %>
|
||||
<% if artist.group_name.present? %>
|
||||
<li><strong>Group</strong> <%= link_to_artist(artist.group_name) %></li>
|
||||
<% end %>
|
||||
<% if artist.members.any? %>
|
||||
<li><strong>Members</strong> <%= link_to_artists(artist.members.map(&:name)) %></li>
|
||||
<% end %>
|
||||
<% if artist.domains.any? %>
|
||||
<li><strong>Domains</strong></li>
|
||||
<ul>
|
||||
<% artist.domains.each do |url, count| %>
|
||||
<li><%= url %>: <%= count %></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
<% end %>
|
||||
<% if artist.urls.any? %>
|
||||
<li><strong>URLs</strong></li>
|
||||
<ul>
|
||||
<% artist.urls.each do |url| %>
|
||||
<li>
|
||||
<%= link_to h(url.to_s), h(url.to_s) %>
|
||||
<% if CurrentUser.user.is_moderator? %>
|
||||
[<%= link_to("mass edit", edit_moderator_tag_path(:antecedent => "-#{artist.name} source:#{ArtistUrl.normalize_for_search(url.to_s)}", :consequent => artist.name)) %>]
|
||||
<% end %>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</ul>
|
||||
@@ -12,45 +12,7 @@
|
||||
|
||||
<% if @artist.visible? %>
|
||||
<div>
|
||||
<ul>
|
||||
<li><strong>Status</strong> <%= @artist.status %></li>
|
||||
|
||||
<% if !@artist.is_banned? || CurrentUser.user.is_member? %>
|
||||
<% if @artist.has_tag_alias? %>
|
||||
<li><strong>Tag Alias</strong> <%= @artist.tag_alias_name %></li>
|
||||
<% end %>
|
||||
<% if @artist.other_names.present? %>
|
||||
<li><strong>Other Names</strong> <%= link_to_artists(@artist.other_names.split(/ /)) %></li>
|
||||
<% end %>
|
||||
<% if @artist.group_name.present? %>
|
||||
<li><strong>Group</strong> <%= link_to_artist(@artist.group_name) %></li>
|
||||
<% end %>
|
||||
<% if @artist.members.any? %>
|
||||
<li><strong>Members</strong> <%= link_to_artists(@artist.members.map(&:name)) %></li>
|
||||
<% end %>
|
||||
<% if @artist.domains.any? %>
|
||||
<li><strong>Domains</strong></li>
|
||||
<ul>
|
||||
<% @artist.domains.each do |url, count| %>
|
||||
<li><%= url %>: <%= count %></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
<% end %>
|
||||
<% if @artist.urls.any? %>
|
||||
<li><strong>URLs</strong></li>
|
||||
<ul>
|
||||
<% @artist.urls.each do |url| %>
|
||||
<li>
|
||||
<%= link_to h(url.to_s), h(url.to_s) %>
|
||||
<% if CurrentUser.user.is_moderator? %>
|
||||
[<%= link_to("mass edit", edit_moderator_tag_path(:antecedent => "-#{@artist.name} source:#{ArtistUrl.normalize_for_search(url.to_s)}", :consequent => @artist.name)) %>]
|
||||
<% end %>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</ul>
|
||||
<%= render "summary", artist: @artist %>
|
||||
</div>
|
||||
|
||||
<% else %>
|
||||
|
||||
@@ -13,43 +13,7 @@
|
||||
<% end %>
|
||||
|
||||
<div>
|
||||
<ul>
|
||||
<li><strong>Status</strong> <%= artist.status %></li>
|
||||
<% if artist.has_tag_alias? %>
|
||||
<li><strong>Tag Alias</strong> <%= artist.tag_alias_name %></li>
|
||||
<% end %>
|
||||
<% if artist.other_names.present? %>
|
||||
<li><strong>Other Names</strong> <%= link_to_artists(artist.other_names.split(/ /)) %></li>
|
||||
<% end %>
|
||||
<% if artist.group_name.present? %>
|
||||
<li><strong>Group</strong> <%= link_to_artist(artist.group_name) %></li>
|
||||
<% end %>
|
||||
<% if artist.members.any? %>
|
||||
<li><strong>Members</strong> <%= link_to_artists(artist.members.map(&:name)) %></li>
|
||||
<% end %>
|
||||
<% if artist.domains.any? %>
|
||||
<li><strong>Domains</strong></li>
|
||||
<ul>
|
||||
<% artist.domains.each do |url, count| %>
|
||||
<li><%= url %>: <%= count %></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
<% end %>
|
||||
<% if artist.urls.any? %>
|
||||
<li><strong>URLs</strong></li>
|
||||
<ul>
|
||||
<% artist.urls.each do |url| %>
|
||||
<li>
|
||||
<%= link_to h(url.to_s), h(url.to_s) %>
|
||||
<% if CurrentUser.user.is_moderator? %>
|
||||
[<%= link_to("mass edit", edit_moderator_tag_path(:antecedent => "-#{artist.name} source:#{ArtistUrl.normalize_for_search(url.to_s)}", :consequent => artist.name)) %>]
|
||||
<% end %>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
<% end %>
|
||||
</ul>
|
||||
|
||||
<%= render "artists/summary", artist: artist %>
|
||||
<%= artist_alias_and_implication_list(artist) %>
|
||||
|
||||
<p class="links">
|
||||
@@ -67,7 +31,6 @@
|
||||
<% end %>
|
||||
|
||||
<%= format_text(wiki_page.presenter.excerpt, :ragel => true) %>
|
||||
|
||||
<%= wiki_page_alias_and_implication_list(wiki_page) %>
|
||||
|
||||
<p class="links">
|
||||
@@ -89,7 +52,9 @@
|
||||
<%= format_text(post_set.pool.description, :ragel => true) %>
|
||||
</div>
|
||||
|
||||
<p class="links"><%= link_to "View pool", pool_path(post_set.pool.id) %></p>
|
||||
<p class="links">
|
||||
<%= link_to "View pool", pool_path(post_set.pool.id) %>
|
||||
</p>
|
||||
<% end %>
|
||||
<% elsif post_set.has_favgroup? %>
|
||||
<h4>
|
||||
|
||||
@@ -39,10 +39,10 @@
|
||||
<td>
|
||||
<%= presenter.upload_count(self) %>
|
||||
<% if presenter.has_uploads? %>
|
||||
(<%= link_to "tag changes report", reports_upload_tags_path(user_id: user.id) %>)
|
||||
[<%= link_to "tag changes report", reports_upload_tags_path(user_id: user.id) %>]
|
||||
<% end %>
|
||||
<% if CurrentUser.is_moderator? %>
|
||||
(<%= link_to "sample", posts_path(:tags => "user:#{user.name} order:random limit:300") %>)
|
||||
[<%= link_to "sample", posts_path(:tags => "user:#{user.name} order:random limit:300") %>]
|
||||
<% end %>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -52,7 +52,7 @@
|
||||
<td>
|
||||
<%= presenter.deleted_upload_count(self) %>
|
||||
<% if CurrentUser.is_moderator? %>
|
||||
(<%= link_to "sample", posts_path(:tags => "user:#{user.name} order:random limit:300 status:deleted") %>)
|
||||
[<%= link_to "sample", posts_path(:tags => "user:#{user.name} order:random limit:300 status:deleted") %>]
|
||||
<% end %>
|
||||
|
||||
</td>
|
||||
@@ -63,7 +63,7 @@
|
||||
<td>
|
||||
<%= presenter.favorite_count(self) %>
|
||||
<% if CurrentUser.is_moderator? %>
|
||||
(<%= link_to "sample", posts_path(:tags => "fav:#{user.name} order:random limit:300") %>)
|
||||
[<%= link_to "sample", posts_path(:tags => "fav:#{user.name} order:random limit:300") %>]
|
||||
<% end %>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
Reference in New Issue
Block a user