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">
<div id="edit">
<%= render :partial => "form" %> <%= render :partial => "form" %>
</div> </div>
</div>
<%= render :partial => "secondary_links" %>

View File

@@ -1,4 +1,5 @@
<div id="artist-index"> <div id="artists">
<div id="index">
<%= render :partial => "search" %> <%= render :partial => "search" %>
<table class="highlightable" width="100%"> <table class="highlightable" width="100%">
@@ -31,5 +32,6 @@
<%= will_paginate(@artists) %> <%= will_paginate(@artists) %>
</div> </div>
<%= render :partial => "secondary_nav_links" %> <%= render :partial => "secondary_links" %>
</div>
</div> </div>

View File

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

View File

@@ -1,4 +1,5 @@
<div id="artists-show"> <div id="artists">
<div id="show">
<h1>Artist: <%= @artist.name.tr("_", " ") %></h1> <h1>Artist: <%= @artist.name.tr("_", " ") %></h1>
<% unless @artist.notes.blank? %> <% unless @artist.notes.blank? %>
@@ -78,13 +79,6 @@
</div> </div>
</div> </div>
<% content_for("footer") do %> <%= render :partial => "secondary_links" %>
<li>|</li> </div>
<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,4 +1,5 @@
<div id="session-new"> <div id="sessions">
<div id="new">
<section> <section>
<h2>Login</h2> <h2>Login</h2>
<% form_tag(sessions_path) do %> <% form_tag(sessions_path) do %>
@@ -37,6 +38,7 @@
</ul> </ul>
</aside> </aside>
</div> </div>
</div>
<% content_for(:page_title) do %> <% content_for(:page_title) do %>
/ login / login

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