diff --git a/app/views/sessions/new.html.erb b/app/views/sessions/new.html.erb
index 62a03644a..02ba7ddfe 100644
--- a/app/views/sessions/new.html.erb
+++ b/app/views/sessions/new.html.erb
@@ -1,41 +1,43 @@
-
-
- Login
- <% form_tag(sessions_path) do %>
-
-
-
- |
- <%= submit_tag "Login" %> |
-
-
-
-
- |
- <%= label_tag :name %>
- |
-
- <%= text_field_tag :name %>
- |
-
-
- | <%= label_tag :password %> |
- <%= password_field_tag :password %> |
-
-
-
- <% end %>
-
+
+
+
+ Login
+ <% form_tag(sessions_path) do %>
+
+
+
+ |
+ <%= submit_tag "Login" %> |
+
+
+
+
+ |
+ <%= label_tag :name %>
+ |
+
+ <%= text_field_tag :name %>
+ |
+
+
+ | <%= label_tag :password %> |
+ <%= password_field_tag :password %> |
+
+
+
+ <% end %>
+
-
+
+
<% content_for(:page_title) do %>
diff --git a/config/initializers/simple_form.rb b/config/initializers/simple_form.rb
new file mode 100644
index 000000000..040e7e3f1
--- /dev/null
+++ b/config/initializers/simple_form.rb
@@ -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
diff --git a/config/locales/simple_form.en.yml b/config/locales/simple_form.en.yml
new file mode 100644
index 000000000..409e2651d
--- /dev/null
+++ b/config/locales/simple_form.en.yml
@@ -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: '
*'
+ 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.'
+
diff --git a/lib/templates/erb/scaffold/_form.html.erb b/lib/templates/erb/scaffold/_form.html.erb
new file mode 100644
index 000000000..62de5dff8
--- /dev/null
+++ b/lib/templates/erb/scaffold/_form.html.erb
@@ -0,0 +1,23 @@
+<%%= simple_form_for(@<%= singular_name %>) do |f| %>
+ <%% if @<%= singular_name %>.errors.any? %>
+
+
<%%= pluralize(@<%= singular_name %>.errors.count, "error") %> prohibited this <%= singular_name %> from being saved:
+
+
+ <%% @<%= singular_name %>.errors.full_messages.each do |msg| %>
+ - <%%= msg %>
+ <%% end %>
+
+
+ <%% end %>
+
+
+ <%- attributes.each do |attribute| -%>
+ <%%= f.<%= attribute.reference? ? :association : :input %> :<%= attribute.name %> %>
+ <%- end -%>
+
+
+
+ <%%= f.button :submit %>
+
+<%% end %>
diff --git a/public/stylesheets/compiled/default.css b/public/stylesheets/compiled/default.css
index 10389ab8e..adf90659e 100644
--- a/public/stylesheets/compiled/default.css
+++ b/public/stylesheets/compiled/default.css
@@ -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; }
diff --git a/public/stylesheets/src/default.scss b/public/stylesheets/src/default.scss
index 0a28fcd65..6ab838948 100644
--- a/public/stylesheets/src/default.scss
+++ b/public/stylesheets/src/default.scss
@@ -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 {
}
diff --git a/script/custom/watch_stylesheets b/script/custom/watch_stylesheets
new file mode 100755
index 000000000..26eac9ea7
--- /dev/null
+++ b/script/custom/watch_stylesheets
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+sass --watch public/stylesheets/src/default.scss:public/stylesheets/compiled/default.css