sync
This commit is contained in:
41
app/views/artists/_form.html.erb
Normal file
41
app/views/artists/_form.html.erb
Normal file
@@ -0,0 +1,41 @@
|
||||
<%= form_for(@artist) do |f| %>
|
||||
<%= error_messages_for "artist" %>
|
||||
|
||||
<table class="form">
|
||||
<tr>
|
||||
<th width="15%"><%= f.label :name %>
|
||||
<td width="85%"><%= f.text_field "name", :size => 30 %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
<%= f.label :other_names %>
|
||||
</th>
|
||||
<td>
|
||||
<%= f.text_field "other_names", :size => 30 %>
|
||||
<span class="info">Separate with commas</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><%= f.label :group_name %></th>
|
||||
<td><%= f.text_field "group_name", :size => 30 %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><%= f.label :url_string, "URLs" %></th>
|
||||
<td><%= f.text_area "url_string", :size => "50x6", :class => "no-block" %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><%= f.label :notes %></th>
|
||||
<td>
|
||||
<%= f.text_area "notes", :size => "50x10", :class => "no-block" %>
|
||||
<span class="info"><%= link_to "Formatting help", wiki_page_path(:id => "help:dtext") %></span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>
|
||||
<%= submit_tag "Save" %>
|
||||
<%= button_to_function "Cancel", "history.back()" %>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<% end %>
|
||||
6
app/views/artists/_search.html.erb
Normal file
6
app/views/artists/_search.html.erb
Normal file
@@ -0,0 +1,6 @@
|
||||
<div id="search-form" style="margin-bottom: 1em;">
|
||||
<% form_tag(artists_path, :method => :get) do %>
|
||||
<%= text_field_tag "name", params[:name], :size => 40 %>
|
||||
<%= submit_tag "Search" %>
|
||||
<% end %>
|
||||
</div>
|
||||
12
app/views/artists/_secondary_nav_links.html.erb
Normal file
12
app/views/artists/_secondary_nav_links.html.erb
Normal file
@@ -0,0 +1,12 @@
|
||||
<% content_for(:secondary_nav_links) do %>
|
||||
<menu>
|
||||
<li><%= link_to "Listing", artists_path %></li>
|
||||
<li><%= link_to "New", new_artist_path %></li>
|
||||
<li><%= link_to "Recent changes", artist_versions_path %></li>
|
||||
<% if @artist && !@artist.new_record? %>
|
||||
<li>|</li>
|
||||
<li><%= link_to "Edit", edit_artist_path(@artist) %></li>
|
||||
<li><%= link_to "Show", artist_path(@artist) %></li>
|
||||
<% end %>
|
||||
</menu>
|
||||
<% end %>
|
||||
3
app/views/artists/edit.html.erb
Normal file
3
app/views/artists/edit.html.erb
Normal file
@@ -0,0 +1,3 @@
|
||||
<div id="artist-edit">
|
||||
<%= render :partial => "form" %>
|
||||
</div>
|
||||
35
app/views/artists/index.html.erb
Normal file
35
app/views/artists/index.html.erb
Normal file
@@ -0,0 +1,35 @@
|
||||
<div id="artist-index">
|
||||
<%= render :partial => "search" %>
|
||||
|
||||
<table class="highlightable" width="100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="5%"></th>
|
||||
<th width="95%">Name</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @artists.each do |artist| %>
|
||||
<% content_tag(:tr, :id => "artist-#{artist.id}") do %>
|
||||
<td>
|
||||
<%= link_to "P", posts_path(:tags => artist.name), :title => "Find posts for artist" %>
|
||||
<%= link_to "E", edit_artist_path(artist), :title => "Edit artist" %>
|
||||
<%= link_to "D", artist_path(artist, :method => :delete, :confirm => "Do you really want to delete this artist?") %>
|
||||
</td>
|
||||
<td>
|
||||
<%= link_to h(artist.name), artist_path(artist) %>
|
||||
<% if !artist.group_name.blank? %>
|
||||
[<%= link_to(artist.group_name, artist_path(artist)) %>]
|
||||
<% end %>
|
||||
</td>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div id="paginator">
|
||||
<%= will_paginate(@artists) %>
|
||||
</div>
|
||||
|
||||
<%= render :partial => "secondary_nav_links" %>
|
||||
</div>
|
||||
5
app/views/artists/new.html.erb
Normal file
5
app/views/artists/new.html.erb
Normal file
@@ -0,0 +1,5 @@
|
||||
<div id="artist-new">
|
||||
<%= render :partial => "form" %>
|
||||
</div>
|
||||
|
||||
<%= render :partial => "secondary_nav_links" %>
|
||||
90
app/views/artists/show.html.erb
Normal file
90
app/views/artists/show.html.erb
Normal file
@@ -0,0 +1,90 @@
|
||||
<div id="artists-show">
|
||||
<h1>Artist: <%= @artist.name.tr("_", " ") %></h1>
|
||||
|
||||
<% unless @artist.notes.blank? %>
|
||||
<div style="margin-bottom: 1em;">
|
||||
<%= format_text(@artist.notes) %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div style="margin-bottom: 1em;">
|
||||
<table width="100%">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th width="15%">Status</th>
|
||||
<td width="85%">
|
||||
<% if @artist.is_banned? %>
|
||||
Banned
|
||||
<% elsif @artist.is_active? %>
|
||||
Active
|
||||
<% else %>
|
||||
Inactive
|
||||
<% end %>
|
||||
</td>
|
||||
</tr>
|
||||
<% if @artist.has_tag_alias? %>
|
||||
<tr>
|
||||
<th>Tag Alias</th>
|
||||
<td>
|
||||
<%= @artist.tag_alias_name %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<% if !@artist.other_names.blank? %>
|
||||
<tr>
|
||||
<th>Other Names</th>
|
||||
<td>
|
||||
<%= link_to_artists(@artist.other_names.split(/,/)) %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<% if !@artist.group_name.blank? %>
|
||||
<tr>
|
||||
<th>Group</th>
|
||||
<td>
|
||||
<%= link_to_artist(@artist.group_name) %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<% if @artist.members.any? %>
|
||||
<tr>
|
||||
<th>Members</th>
|
||||
<td>
|
||||
<%= link_to_artists(@artist.members.map(&:name)) %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<% @artist.urls.each do |url| %>
|
||||
<tr>
|
||||
<th>URLs</th>
|
||||
<td>
|
||||
<%= link_to h(url.to_s), h(url.to_s) %>
|
||||
<% if CurrentUser.user.is_moderator? %>
|
||||
(<%= link_to("mass edit", mass_edit_admin_posts_path(:antecedent => "-#{@artist.name} source:#{ArtistUrl.normalize_for_search(url.to_s)}", :consequent => @artist.name)) %>)
|
||||
<% end %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<p class="legend"><span class="new-artist">*</span> Indicates new artist</p>
|
||||
|
||||
<div style="margin-bottom: 1em;">
|
||||
<h4>Recent Posts</h4>
|
||||
<div style="margin: 1em 0;">
|
||||
<%#= @post_set.presenter.post_previews_html %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<% content_for("footer") do %>
|
||||
<li>|</li>
|
||||
<li><%= link_to "Posts", posts_path(:tags => @artist.name) %></li>
|
||||
<li><%= link_to "Edit", edit_artist_path(@artist) %></li>
|
||||
<li><%= link_to "Delete", artist_path(@artist, :method => :delete) %></li>
|
||||
<li><%= link_to "History", artist_versions_path(:artist_id => @artist.id) %></li>
|
||||
<% end %>
|
||||
|
||||
<%= render :partial => "secondary_nav_links" %>
|
||||
</div>
|
||||
Reference in New Issue
Block a user