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 %>

View File

@@ -0,0 +1,52 @@
# Use this setup block to configure all options available in SimpleForm.
SimpleForm.setup do |config|
# Components used by the form builder to generate a complete input. You can remove
# any of them, change the order, or even add your own components to the stack.
# config.components = [ :label_input, :hint, :error ]
# Default tag used on hints.
# config.hint_tag = :span
# Default tag used on errors.
# config.error_tag = :span
# Method used to tidy up errors.
# config.error_method = :first
# Default tag used for error notification helper.
# config.error_notification_tag = :p
# You can wrap all inputs in a pre-defined tag.
# config.wrapper_tag = :div
# CSS class to add to all wrapper tags.
# config.wrapper_class = :input
# CSS class to add to the wrapper if the field has errors.
# config.wrapper_error_class = :field_with_errors
# How the label text should be generated altogether with the required text.
# config.label_text = lambda { |label, required| "#{required} #{label}" }
# Whether attributes are required by default (or not). Default is true.
# config.required_by_default = true
# Series of attemps to detect a default label method for collection.
# config.collection_label_methods = [ :to_label, :name, :title, :to_s ]
# Series of attemps to detect a default value method for collection.
# config.collection_value_methods = [ :id, :to_s ]
# Collection of methods to detect if a file type was given.
# config.file_methods = [ :file?, :public_filename ]
# Default priority for time_zone inputs.
# config.time_zone_priority = nil
# Default priority for country inputs.
# config.country_priority = nil
# Default size for text inputs.
config.default_input_size = 30
end

View File

@@ -0,0 +1,24 @@
en:
simple_form:
"yes": 'Yes'
"no": 'No'
required:
text: 'required'
mark: '*'
# You can uncomment the line below if you need to overwrite the whole required html.
# When using html, text and mark won't be used.
# html: '<abbr title="required">*</abbr>'
error_notification:
default_message: "Some errors were found, please take a look:"
# Labels and hints examples
# labels:
# password: 'Password'
# user:
# new:
# email: 'E-mail para efetuar o sign in.'
# edit:
# email: 'E-mail.'
# hints:
# username: 'User name to sign in.'
# password: 'No special characters, please.'

View File

@@ -0,0 +1,23 @@
<%%= simple_form_for(@<%= singular_name %>) do |f| %>
<%% if @<%= singular_name %>.errors.any? %>
<div id="error_explanation">
<h2><%%= pluralize(@<%= singular_name %>.errors.count, "error") %> prohibited this <%= singular_name %> from being saved:</h2>
<ul>
<%% @<%= singular_name %>.errors.full_messages.each do |msg| %>
<li><%%= msg %></li>
<%% end %>
</ul>
</div>
<%% end %>
<div class="inputs">
<%- attributes.each do |attribute| -%>
<%%= f.<%= attribute.reference? ? :association : :input %> :<%= attribute.name %> %>
<%- end -%>
</div>
<div class="actions">
<%%= f.button :submit %>
</div>
<%% end %>

View File

@@ -85,7 +85,7 @@ img {
border: none;
vertical-align: middle; }
input[type=text], input[type=password], textarea, button {
input[type=text], input[type=password], input[type=url], textarea, button {
border: 1px solid #AAA;
font-size: 1em;
-moz-border-radius: 4px;
@@ -100,6 +100,9 @@ input[type=submit] {
font-size: 1em;
cursor: pointer; }
input:focus, textarea:focus {
background-color: #FFD; }
input[type=submit]:hover {
background-color: #F6F6F6; }
@@ -154,6 +157,28 @@ aside.sidebar > section > ul li {
aside.sidebar > section > ul ul li {
margin-left: 1em; }
/*** Simple Form ***/
form.simple_form input[type=submit] {
margin-left: 10em; }
form.simple_form div.input {
margin-bottom: 0.5em; }
form.simple_form div.input input, form.simple_form div.input textarea {
width: 300px; }
form.simple_form div.input textarea {
height: 100px; }
form.simple_form div.input label {
vertical-align: top;
display: inline-block;
width: 10em;
cursor: pointer;
font-weight: bold; }
form.simple_form div.input span.hint {
margin-left: 10em;
color: #666;
font-style: italic;
vertical-align: top;
display: block; }
/*** Comments ***/
div.comment-response > div {
margin-top: 1em; }

View File

@@ -110,7 +110,7 @@ img {
vertical-align: middle;
}
input[type=text], input[type=password], textarea, button {
input[type=text], input[type=password], input[type=url], textarea, button {
border: 1px solid #AAA;
font-size: 1em;
-moz-border-radius: 4px;
@@ -127,6 +127,10 @@ input[type=submit] {
cursor: pointer;
}
input:focus, textarea:focus {
background-color: #FFD;
}
input[type=submit]:hover {
background-color: #F6F6F6;
}
@@ -203,6 +207,42 @@ aside.sidebar > section > ul ul li {
}
/*** Simple Form ***/
form.simple_form {
input[type=submit] {
margin-left: 10em;
}
div.input {
margin-bottom: 0.5em;
input, textarea {
width: 300px;
}
textarea {
height: 100px;
}
label {
vertical-align: top;
display: inline-block;
width: 10em;
cursor: pointer;
font-weight: bold;
}
span.hint {
margin-left: 10em;
color: #666;
font-style: italic;
vertical-align: top;
display: block;
}
}
}
/*** Comments ***/
div.comment-response {
}

View File

@@ -0,0 +1,3 @@
#!/bin/sh
sass --watch public/stylesheets/src/default.scss:public/stylesheets/compiled/default.css