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| %> <%= simple_form_for(@artist) do |f| %>
<%= error_messages_for "artist" %> <%= f.input :name %>
<%= f.input :other_names, :hint => "Separate with commas", :as => :text %>
<table class="form"> <%= f.input :group_name %>
<tr> <%= f.input :url_string, :label => "URLs", :as => :text, :size => "10x5" %>
<th width="15%"><%= f.label :name %> <%= f.input :notes, :as => :text %>
<td width="85%"><%= f.text_field "name", :size => 30 %></td> <%= f.button :submit %>
</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 %> <% end %>

View File

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

View File

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

View File

@@ -1,35 +1,37 @@
<div id="artist-index"> <div id="artists">
<%= render :partial => "search" %> <div id="index">
<%= render :partial => "search" %>
<table class="highlightable" width="100%"> <table class="highlightable" width="100%">
<thead> <thead>
<tr> <tr>
<th width="5%"></th> <th width="5%"></th>
<th width="95%">Name</th> <th width="95%">Name</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<% @artists.each do |artist| %> <% @artists.each do |artist| %>
<% content_tag(:tr, :id => "artist-#{artist.id}") do %> <% content_tag(:tr, :id => "artist-#{artist.id}") do %>
<td> <td>
<%= link_to "P", posts_path(:tags => artist.name), :title => "Find posts for artist" %> <%= 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 "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?") %> <%= link_to "D", artist_path(artist, :method => :delete, :confirm => "Do you really want to delete this artist?") %>
</td> </td>
<td> <td>
<%= link_to h(artist.name), artist_path(artist) %> <%= link_to h(artist.name), artist_path(artist) %>
<% if !artist.group_name.blank? %> <% if !artist.group_name.blank? %>
[<%= link_to(artist.group_name, artist_path(artist)) %>] [<%= link_to(artist.group_name, artist_path(artist)) %>]
<% end %> <% end %>
</td> </td>
<% end %>
<% end %> <% end %>
<% end %> </tbody>
</tbody> </table>
</table>
<div id="paginator"> <div id="paginator">
<%= will_paginate(@artists) %> <%= will_paginate(@artists) %>
</div>
<%= render :partial => "secondary_links" %>
</div> </div>
<%= render :partial => "secondary_nav_links" %>
</div> </div>

View File

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

View File

@@ -1,90 +1,84 @@
<div id="artists-show"> <div id="artists">
<h1>Artist: <%= @artist.name.tr("_", " ") %></h1> <div id="show">
<h1>Artist: <%= @artist.name.tr("_", " ") %></h1>
<% unless @artist.notes.blank? %>
<% unless @artist.notes.blank? %>
<div style="margin-bottom: 1em;">
<%= format_text(@artist.notes) %>
</div>
<% end %>
<div style="margin-bottom: 1em;"> <div style="margin-bottom: 1em;">
<%= format_text(@artist.notes) %> <table width="100%">
</div> <tbody>
<% 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> <tr>
<th>Tag Alias</th> <th width="15%">Status</th>
<td> <td width="85%">
<%= @artist.tag_alias_name %> <% if @artist.is_banned? %>
</td> Banned
</tr> <% elsif @artist.is_active? %>
<% end %> Active
<% if !@artist.other_names.blank? %> <% else %>
<tr> Inactive
<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 %> <% end %>
</td> </td>
</tr> </tr>
<% end %> <% if @artist.has_tag_alias? %>
</tbody> <tr>
</table> <th>Tag Alias</th>
</div> <td>
<%= @artist.tag_alias_name %>
<p class="legend"><span class="new-artist">*</span> Indicates new artist</p> </td>
</tr>
<div style="margin-bottom: 1em;"> <% end %>
<h4>Recent Posts</h4> <% if !@artist.other_names.blank? %>
<div style="margin: 1em 0;"> <tr>
<%#= @post_set.presenter.post_previews_html %> <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> </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> </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> </div>

View File

@@ -1,41 +1,43 @@
<div id="session-new"> <div id="sessions">
<section> <div id="new">
<h2>Login</h2> <section>
<% form_tag(sessions_path) do %> <h2>Login</h2>
<table width="100%"> <% form_tag(sessions_path) do %>
<tfoot> <table width="100%">
<tr> <tfoot>
<td></td> <tr>
<td><%= submit_tag "Login" %></td> <td></td>
</tr> <td><%= submit_tag "Login" %></td>
</tfoot> </tr>
<tbody> </tfoot>
<tr> <tbody>
<th width="15%"> <tr>
<%= label_tag :name %> <th width="15%">
</th> <%= label_tag :name %>
<td width="85%"> </th>
<%= text_field_tag :name %> <td width="85%">
</td> <%= text_field_tag :name %>
</tr> </td>
<tr> </tr>
<th><%= label_tag :password %></th> <tr>
<td><%= password_field_tag :password %></td> <th><%= label_tag :password %></th>
</tr> <td><%= password_field_tag :password %></td>
</tbody> </tr>
</table> </tbody>
<% end %> </table>
</section> <% end %>
</section>
<aside> <aside>
<h2>Help</h2> <h2>Help</h2>
<ul> <ul>
<li><%= link_to "I don't have an account", new_user_path %></li> <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 password", reset_password_info_path %></li>
<li><%= link_to "I forgot my login", login_reminder_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> <li><%= link_to "I want to delete my account", delete_account_info_path %></li>
</ul> </ul>
</aside> </aside>
</div>
</div> </div>
<% content_for(:page_title) do %> <% 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; border: none;
vertical-align: middle; } 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; border: 1px solid #AAA;
font-size: 1em; font-size: 1em;
-moz-border-radius: 4px; -moz-border-radius: 4px;
@@ -100,6 +100,9 @@ input[type=submit] {
font-size: 1em; font-size: 1em;
cursor: pointer; } cursor: pointer; }
input:focus, textarea:focus {
background-color: #FFD; }
input[type=submit]:hover { input[type=submit]:hover {
background-color: #F6F6F6; } background-color: #F6F6F6; }
@@ -154,6 +157,28 @@ aside.sidebar > section > ul li {
aside.sidebar > section > ul ul li { aside.sidebar > section > ul ul li {
margin-left: 1em; } 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 ***/ /*** Comments ***/
div.comment-response > div { div.comment-response > div {
margin-top: 1em; } margin-top: 1em; }

View File

@@ -110,7 +110,7 @@ img {
vertical-align: middle; 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; border: 1px solid #AAA;
font-size: 1em; font-size: 1em;
-moz-border-radius: 4px; -moz-border-radius: 4px;
@@ -127,6 +127,10 @@ input[type=submit] {
cursor: pointer; cursor: pointer;
} }
input:focus, textarea:focus {
background-color: #FFD;
}
input[type=submit]:hover { input[type=submit]:hover {
background-color: #F6F6F6; 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 ***/ /*** Comments ***/
div.comment-response { div.comment-response {
} }

View File

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