This commit is contained in:
albert
2010-10-08 19:07:47 -04:00
parent f051e04550
commit cb3d7e9e9b
14 changed files with 335 additions and 197 deletions

View File

@@ -1,41 +1,8 @@
<%= 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>
<%= simple_form_for(@artist) do |f| %>
<%= f.input :name %>
<%= f.input :other_names, :hint => "Separate with commas", :as => :text %>
<%= f.input :group_name %>
<%= f.input :url_string, :label => "URLs", :as => :text, :size => "10x5" %>
<%= f.input :notes, :as => :text %>
<%= f.button :submit %>
<% end %>

View File

@@ -1,4 +1,4 @@
<% content_for(:secondary_nav_links) do %>
<% content_for(:secondary_links) do %>
<menu>
<li><%= link_to "Listing", artists_path %></li>
<li><%= link_to "New", new_artist_path %></li>

View File

@@ -1,3 +1,7 @@
<div id="artist-edit">
<%= render :partial => "form" %>
<div id="artists">
<div id="edit">
<%= render :partial => "form" %>
</div>
</div>
<%= render :partial => "secondary_links" %>

View File

@@ -1,35 +1,37 @@
<div id="artist-index">
<%= render :partial => "search" %>
<div id="artists">
<div id="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>
<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 %>
<% end %>
</tbody>
</table>
</tbody>
</table>
<div id="paginator">
<%= will_paginate(@artists) %>
<div id="paginator">
<%= will_paginate(@artists) %>
</div>
<%= render :partial => "secondary_links" %>
</div>
<%= render :partial => "secondary_nav_links" %>
</div>

View File

@@ -1,5 +1,7 @@
<div id="artist-new">
<%= render :partial => "form" %>
<div id="artists">
<div id="new">
<%= render :partial => "form" %>
</div>
</div>
<%= render :partial => "secondary_nav_links" %>
<%= render :partial => "secondary_links" %>

View File

@@ -1,90 +1,84 @@
<div id="artists-show">
<h1>Artist: <%= @artist.name.tr("_", " ") %></h1>
<% unless @artist.notes.blank? %>
<div id="artists">
<div id="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;">
<%= 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? %>
<table width="100%">
<tbody>
<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)) %>)
<th width="15%">Status</th>
<td width="85%">
<% if @artist.is_banned? %>
Banned
<% elsif @artist.is_active? %>
Active
<% else %>
Inactive
<% 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 %>
<% 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>
<%= render :partial => "secondary_links" %>
</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>

View File

@@ -1,41 +1,43 @@
<div id="session-new">
<section>
<h2>Login</h2>
<% form_tag(sessions_path) do %>
<table width="100%">
<tfoot>
<tr>
<td></td>
<td><%= submit_tag "Login" %></td>
</tr>
</tfoot>
<tbody>
<tr>
<th width="15%">
<%= label_tag :name %>
</th>
<td width="85%">
<%= text_field_tag :name %>
</td>
</tr>
<tr>
<th><%= label_tag :password %></th>
<td><%= password_field_tag :password %></td>
</tr>
</tbody>
</table>
<% end %>
</section>
<div id="sessions">
<div id="new">
<section>
<h2>Login</h2>
<% form_tag(sessions_path) do %>
<table width="100%">
<tfoot>
<tr>
<td></td>
<td><%= submit_tag "Login" %></td>
</tr>
</tfoot>
<tbody>
<tr>
<th width="15%">
<%= label_tag :name %>
</th>
<td width="85%">
<%= text_field_tag :name %>
</td>
</tr>
<tr>
<th><%= label_tag :password %></th>
<td><%= password_field_tag :password %></td>
</tr>
</tbody>
</table>
<% end %>
</section>
<aside>
<h2>Help</h2>
<ul>
<li><%= link_to "I don't have an account", new_user_path %></li>
<li><%= link_to "I forgot my password", reset_password_info_path %></li>
<li><%= link_to "I forgot my login", login_reminder_info_path %></li>
<li><%= link_to "I want to delete my account", delete_account_info_path %></li>
</ul>
</aside>
<aside>
<h2>Help</h2>
<ul>
<li><%= link_to "I don't have an account", new_user_path %></li>
<li><%= link_to "I forgot my password", reset_password_info_path %></li>
<li><%= link_to "I forgot my login", login_reminder_info_path %></li>
<li><%= link_to "I want to delete my account", delete_account_info_path %></li>
</ul>
</aside>
</div>
</div>
<% content_for(:page_title) do %>