mondo-generators 0.6.2 → 0.6.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. data/VERSION +1 -1
  2. data/mondo-generators.gemspec +5 -3
  3. data/rails_generators/mondo_authentication/lib/insert_commands.rb +23 -0
  4. data/rails_generators/mondo_authentication/mondo_authentication_generator.rb +5 -4
  5. data/rails_generators/mondo_authentication/templates/locales/en.yml +30 -27
  6. data/rails_generators/mondo_authentication/templates/locales/it.yml +31 -24
  7. data/rails_generators/mondo_authentication/templates/migration.rb +1 -0
  8. data/rails_generators/mondo_authentication/templates/user.rb +15 -1
  9. data/rails_generators/mondo_authentication/templates/users_controller.rb +9 -5
  10. data/rails_generators/mondo_authentication/templates/views/_form.html.haml +19 -14
  11. data/rails_generators/mondo_authentication/templates/views/edit.html.haml +0 -1
  12. data/rails_generators/mondo_authentication/templates/views/index.html.haml +9 -6
  13. data/rails_generators/mondo_authentication/templates/views/login.html.haml +16 -9
  14. data/rails_generators/mondo_authentication/templates/views/mass_new.html.haml +1 -1
  15. data/rails_generators/mondo_authentication/templates/views/new.html.haml +0 -1
  16. data/rails_generators/mondo_authentication/templates/views/show.html.haml +7 -2
  17. data/rails_generators/mondo_layout/mondo_layout_generator.rb +3 -0
  18. data/rails_generators/mondo_layout/templates/images/accept.gif +0 -0
  19. data/rails_generators/mondo_layout/templates/images/back.gif +0 -0
  20. data/rails_generators/mondo_layout/templates/images/bullet_black.gif +0 -0
  21. data/rails_generators/mondo_layout/templates/images/cancel.gif +0 -0
  22. data/rails_generators/mondo_layout/templates/images/delete.gif +0 -0
  23. data/rails_generators/mondo_layout/templates/images/edit.gif +0 -0
  24. data/rails_generators/mondo_layout/templates/images/en.gif +0 -0
  25. data/rails_generators/mondo_layout/templates/images/error.gif +0 -0
  26. data/rails_generators/mondo_layout/templates/images/it.gif +0 -0
  27. data/rails_generators/mondo_layout/templates/images/new.gif +0 -0
  28. data/rails_generators/mondo_layout/templates/images/no.gif +0 -0
  29. data/rails_generators/mondo_layout/templates/images/notice.gif +0 -0
  30. data/rails_generators/mondo_layout/templates/images/success.gif +0 -0
  31. data/rails_generators/mondo_layout/templates/images/yes.gif +0 -0
  32. data/rails_generators/mondo_layout/templates/layout.html.haml +32 -24
  33. data/rails_generators/mondo_layout/templates/stylesheets/_colors.sass +5 -3
  34. data/rails_generators/mondo_layout/templates/stylesheets/_mixins.sass +3 -1
  35. data/rails_generators/mondo_layout/templates/stylesheets/partials/_base.sass +18 -22
  36. data/rails_generators/mondo_layout/templates/stylesheets/partials/_content.sass +3 -3
  37. data/rails_generators/mondo_layout/templates/stylesheets/partials/_errors.sass +4 -5
  38. data/rails_generators/mondo_layout/templates/stylesheets/partials/_footer.sass +18 -8
  39. data/rails_generators/mondo_layout/templates/stylesheets/partials/_header.sass +25 -21
  40. data/rails_generators/mondo_layout/templates/stylesheets/partials/_typography.sass +17 -2
  41. data/rails_generators/mondo_layout/templates/stylesheets/partials/_users.sass +3 -2
  42. data/rails_generators/mondo_scaffold/templates/views/haml/_form.html.haml +1 -0
  43. data/rails_generators/mondo_scaffold/templates/views/haml/edit.html.haml +1 -1
  44. data/rails_generators/mondo_scaffold/templates/views/haml/index.html.haml +5 -5
  45. data/rails_generators/mondo_scaffold/templates/views/haml/new.html.haml +1 -1
  46. data/rails_generators/mondo_scaffold/templates/views/haml/show.html.haml +1 -1
  47. metadata +14 -5
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.6.2
1
+ 0.6.3
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{mondo-generators}
8
- s.version = "0.6.2"
8
+ s.version = "0.6.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Luca Tironi"]
12
- s.date = %q{2010-02-04}
12
+ s.date = %q{2010-03-26}
13
13
  s.description = %q{A collection of useful generator scripts for Rails.}
14
14
  s.email = %q{luca.tironi@gmail.com}
15
15
  s.extra_rdoc_files = [
@@ -51,8 +51,10 @@ Gem::Specification.new do |s|
51
51
  "rails_generators/mondo_layout/templates/images/cancel.gif",
52
52
  "rails_generators/mondo_layout/templates/images/delete.gif",
53
53
  "rails_generators/mondo_layout/templates/images/edit.gif",
54
+ "rails_generators/mondo_layout/templates/images/en.gif",
54
55
  "rails_generators/mondo_layout/templates/images/error.gif",
55
56
  "rails_generators/mondo_layout/templates/images/help_triangle.gif",
57
+ "rails_generators/mondo_layout/templates/images/it.gif",
56
58
  "rails_generators/mondo_layout/templates/images/navbar_bkg.gif",
57
59
  "rails_generators/mondo_layout/templates/images/new.gif",
58
60
  "rails_generators/mondo_layout/templates/images/no.gif",
@@ -96,7 +98,7 @@ Gem::Specification.new do |s|
96
98
  s.homepage = %q{http://gemcutter.org/gems/mondo-generators}
97
99
  s.rdoc_options = ["--charset=UTF-8"]
98
100
  s.require_paths = ["lib"]
99
- s.rubygems_version = %q{1.3.5}
101
+ s.rubygems_version = %q{1.3.6}
100
102
  s.summary = %q{A collection of useful generator scripts for Rails.}
101
103
 
102
104
  if s.respond_to? :specification_version then
@@ -11,6 +11,17 @@ Rails::Generator::Commands::Create.class_eval do
11
11
  end
12
12
  end
13
13
 
14
+ def route_resource_with_options(resource, route_options = {})
15
+ sentinel = 'ActionController::Routing::Routes.draw do |map|'
16
+
17
+ logger.route "map.resource #{resource}, #{route_options}"
18
+ unless options[:pretend]
19
+ gsub_file 'config/routes.rb', /(#{Regexp.escape(sentinel)})/mi do |match|
20
+ "#{match}\n map.resource #{resource}, #{route_options}\n"
21
+ end
22
+ end
23
+ end
24
+
14
25
  def route_name(name, path, route_options = {})
15
26
  sentinel = 'ActionController::Routing::Routes.draw do |map|'
16
27
 
@@ -42,6 +53,14 @@ Rails::Generator::Commands::Destroy.class_eval do
42
53
  end
43
54
  end
44
55
 
56
+ def route_resource_with_options(resource, route_options = {})
57
+ look_for = "\n map.resource #{resource}, #{route_options}\n"
58
+ logger.route "map.resource #{resource}, #{route_options}"
59
+ unless options[:pretend]
60
+ gsub_file 'config/routes.rb', /(#{look_for})/mi, ''
61
+ end
62
+ end
63
+
45
64
  def route_name(name, path, route_options = {})
46
65
  look_for = "\n map.#{name} '#{path}', :controller => '#{route_options[:controller]}', :action => '#{route_options[:action]}'"
47
66
  logger.route "map.#{name} '#{path}', :controller => '#{route_options[:controller]}', :action => '#{route_options[:action]}'"
@@ -64,6 +83,10 @@ Rails::Generator::Commands::List.class_eval do
64
83
  logger.route "map.resource #{resource_list}"
65
84
  end
66
85
 
86
+ def route_resource_with_options(resource, route_options = {})
87
+ logger.route "map.resource #{resource}, #{route_options}"
88
+ end
89
+
67
90
  def route_name(name, path, options = {})
68
91
  logger.route "map.#{name} '#{path}', :controller => '{options[:controller]}', :action => '#{options[:action]}'"
69
92
  end
@@ -37,10 +37,11 @@ class MondoAuthenticationGenerator < Rails::Generator::Base
37
37
  m.template "authorization_rules.rb", "config/authorization_rules.rb"
38
38
  m.migration_template "migration.rb", "db/migrate", :migration_file_name => "create_#{user_plural_name}"
39
39
 
40
- m.route_name :signup, 'signup', :controller => user_plural_name, :action => 'new'
41
- m.route_name :logout, 'logout', :controller => session_plural_name, :action => 'destroy'
42
- m.route_name :login, 'login', :controller => session_plural_name, :action => 'new'
40
+ m.route_name :signup, '/signup', :controller => user_plural_name, :action => 'new'
41
+ m.route_name :logout, '/logout', :controller => session_plural_name, :action => 'destroy'
42
+ m.route_name :login, '/login', :controller => session_plural_name, :action => 'new'
43
43
  m.route_resources session_plural_name
44
+ m.route_resources user_plural_name
44
45
  m.insert_into "config/routes.rb", 'map.resources :users, :collection => { :mass_new => :get, :mass_create => :post }'
45
46
 
46
47
  m.insert_into "app/controllers/#{application_controller_name}.rb", 'include Authentication'
@@ -96,7 +97,7 @@ protected
96
97
  <<-EOS
97
98
  Creates user model and controllers to handle registration and authentication.
98
99
 
99
- USAGE: #{$0} #{spec.name} [user_name] [sessions_controller_name]
100
+ USAGE: #{$0} [user_name] [sessions_controller_name]
100
101
  EOS
101
102
  end
102
103
  end
@@ -1,17 +1,26 @@
1
1
  en:
2
2
  label:
3
- create: Create
4
- update: Update
5
- email: Email
6
- password: Password
7
- login: Login
8
- signup: Signup
9
- logout: Logout
10
- show: Show
11
- edit: Edit
12
- destroy: Delete
13
- back: Back
3
+ create: "Create"
4
+ update: "Update"
5
+ email: "Email"
6
+ password: "Password"
7
+ login: "Login"
8
+ signup: "Signup"
9
+ logout: "Logout"
10
+ show: "Show"
11
+ edit: "Edit"
12
+ destroy: "Delete"
13
+ back: "Back"
14
14
  welcome: "Welcome, "
15
+ continue_reading: "..."
16
+ close: "Close"
17
+ help: "Help"
18
+ faq: "Faq"
19
+ continue: "Continue"
20
+ you: "(you)"
21
+
22
+ navbar:
23
+ myprofile: "My Profile"
15
24
 
16
25
  confirm:
17
26
  logout: "Are you sure you want to logout?"
@@ -27,27 +36,21 @@ en:
27
36
  update:
28
37
  notice: "Account successfully updated."
29
38
 
30
- roles:
31
- index:
32
- title: "Roles"
33
- new_role_link: "Add new role"
34
- new:
35
- title: "New role"
36
- create:
37
- notice: "Role successfully created."
38
- edit:
39
- title: "Edit role"
40
- update:
41
- notice: "Role successfully updated."
42
- destroy:
43
- notice: "Role successfully deleted."
44
-
45
39
  users:
40
+ first_name: "First Name"
41
+ last_name: "Last Name"
42
+ language: "Language"
43
+ roles: "Roles"
46
44
  index:
47
45
  title: "Users"
48
46
  search: "Search"
49
47
  new_user_link: "Add new user"
50
48
  mass_new_users_link: "Mass add new Users"
49
+ show:
50
+ email_message: "We will use your email only for communications strictly related to HandShake."
51
+ current_game: "Current Game:"
52
+ goto_game: "Go to game"
53
+ profile_label: "Profile"
51
54
  new:
52
55
  title: "New user"
53
56
  create:
@@ -55,7 +58,7 @@ en:
55
58
  mass_new:
56
59
  title: "Mass add new Users"
57
60
  label: "Insert new users"
58
- help: "Please insert users comma separated as <strong>First Name,Last Name,Email,Password</strong>"
61
+ help: "Please insert users comma separated as <strong>First Name,Last Name,Email,Password,Language('en' or 'it')</strong>"
59
62
  mass_create:
60
63
  notice: "Users successfully created."
61
64
  error: "You didn't insert any user!"
@@ -1,17 +1,26 @@
1
1
  it:
2
2
  label:
3
- create: Aggiungi
4
- update: Aggiona
5
- email: Email
6
- password: Password
7
- login: Login
8
- signup: Registrati
9
- logout: Logout
10
- show: Vedi
11
- edit: Modifica
12
- destroy: Cancella
13
- back: Indietro
14
- welcome: "Ciao, "
3
+ create: "Aggiungi"
4
+ update: "Aggiorna"
5
+ email: "Email"
6
+ password: "Password"
7
+ login: "Entra"
8
+ signup: "Registrati"
9
+ logout: "Esci"
10
+ show: "Vedi"
11
+ edit: "Modifica"
12
+ destroy: "Cancella"
13
+ back: "Indietro"
14
+ welcome: "Benvenuto, "
15
+ continue_reading: "..."
16
+ close: "Chiudi"
17
+ help: "Aiuto"
18
+ faq: "Faq"
19
+ continue: "Continua"
20
+ you: "(tu)"
21
+
22
+ navbar:
23
+ myprofile: "Profilo"
15
24
 
16
25
  confirm:
17
26
  logout: "Sei sicuro di voler fare logout?"
@@ -28,11 +37,20 @@ it:
28
37
  notice: "Account modificato con successo."
29
38
 
30
39
  users:
40
+ first_name: "Nome"
41
+ last_name: "Cognome"
42
+ language: "Lingua"
43
+ roles: "Ruoli"
31
44
  index:
32
45
  title: "Utenti"
33
46
  search: "Cerca"
34
47
  new_user_link: "Aggiungi nuovo utente"
35
48
  mass_new_users_link: "Aggiungi utenti in massa"
49
+ show:
50
+ email_message: "Useremo la tua email solo per comunicazioni strettamente correlate ad HandShake."
51
+ current_game: "Partita Corrente:"
52
+ goto_game: "Vai alla partita"
53
+ profile_label: "Profilo"
36
54
  new:
37
55
  title: "Nuovo utente"
38
56
  create:
@@ -40,7 +58,7 @@ it:
40
58
  mass_new:
41
59
  title: "Aggiungi utenti in massa"
42
60
  label: "Inserisci nuovi utenti"
43
- help: "Ti preghiamo di inserire gli utenti separati da virgole nell'ordine <strong>Nome,Cognome,Email,Password</strong>"
61
+ help: "Ti preghiamo di inserire gli utenti separati da virgole nell'ordine <strong>Nome,Cognome,Email,Password,Lingua('en' or 'it')</strong>"
44
62
  mass_create:
45
63
  notice: "Utenti creati con successo."
46
64
  error: "Non hai inserito nessun utente!"
@@ -51,17 +69,6 @@ it:
51
69
  destroy:
52
70
  notice: "Utente cancellato con successo."
53
71
 
54
- user_sessions:
55
- new:
56
- title: "Login"
57
- login: "Il tuo login"
58
- email: "La tua email"
59
- password: "La tua password"
60
- create:
61
- notice: "Login eseguito con successo."
62
- destroy:
63
- notice: "Logout eseguito con successo."
64
-
65
72
  # Italian translations for Ruby on Rails
66
73
  # by Claudio Poli (masterkain@gmail.com)
67
74
  # maintained by Simone Carletti (weppos@weppos.net)
@@ -12,6 +12,7 @@ class Create<%= user_plural_class_name %> < ActiveRecord::Migration
12
12
  t.string :perishable_token, :limit => 20
13
13
 
14
14
  t.integer :roles_mask, :default => 1
15
+ t.boolean :active, :default => false, :null => false
15
16
 
16
17
  t.integer :login_count, :null => false, :default => 0
17
18
  t.integer :failed_login_count, :null => false, :default => 0
@@ -1,20 +1,29 @@
1
1
  class <%= user_class_name %> < ActiveRecord::Base
2
2
  acts_as_authentic
3
3
 
4
- attr_accessible :first_name, :last_name, :full_name, :email, :password, :password_confirmation, :language, :roles
4
+ attr_accessible :first_name, :last_name, :full_name, :email, :password, :password_confirmation, :language, :roles, :current_game_id, :active
5
5
 
6
+ default_scope :order => "LOWER(last_name) ASC"
6
7
  named_scope :with_role, lambda { |role| {:conditions => "roles_mask & #{2**ROLES.index(role.to_s)} > 0"} }
8
+ named_scope :active, :conditions => ["active=?", true]
9
+ named_scope :deleted, :conditions => ["active=?", false]
7
10
 
8
11
  ROLES = %w[<%= user_singular_name %> admin]
9
12
 
10
13
  def roles=(roles)
11
14
  self.roles_mask = (roles & ROLES).map { |r| 2**ROLES.index(r) }.sum
15
+ save
12
16
  end
13
17
 
14
18
  def roles
15
19
  ROLES.reject { |r| ((roles_mask || 0) & 2**ROLES.index(r)).zero? }
16
20
  end
17
21
 
22
+ def add_role(role)
23
+ r = self.roles.push(role)
24
+ self.roles = r
25
+ end
26
+
18
27
  def role_symbols
19
28
  roles.map(&:to_sym)
20
29
  end
@@ -26,4 +35,9 @@ class <%= user_class_name %> < ActiveRecord::Base
26
35
  def full_name
27
36
  "#{first_name} #{last_name}".strip
28
37
  end
38
+
39
+ def deactivate!
40
+ self.active = false
41
+ save
42
+ end
29
43
  end
@@ -1,8 +1,12 @@
1
1
  class <%= user_plural_class_name %>Controller < ApplicationController
2
- filter_access_to :all
2
+ filter_resource_access :additional_collection => [:mass_new, :mass_create]
3
3
 
4
4
  def index
5
- @<%= user_plural_name %> = <%= user_class_name %>.paginate(:per_page => 20, :page => params[:page], :conditions => search_conditions)
5
+ unless params[:deleted]
6
+ @<%= user_plural_name %> = <%= user_class_name %>.active.paginate(:per_page => 20, :page => params[:page], :conditions => search_conditions)
7
+ else
8
+ @<%= user_plural_name %> = <%= user_class_name %>.deleted.paginate(:per_page => 20, :page => params[:page], :conditions => search_conditions)
9
+ end
6
10
  end
7
11
 
8
12
  def show
@@ -30,8 +34,8 @@ class <%= user_plural_class_name %>Controller < ApplicationController
30
34
  unless params[:text_area].blank?
31
35
  lines = params[:text_area].split("\r\n")
32
36
  for line in lines
33
- first_name, last_name, email, password = line.split(",")
34
- <%= user_class_name %>.create!(:first_name => first_name, :last_name => last_name, :email => email, :password => password, :password_confirmation => password)
37
+ first_name, last_name, email, password, lang = line.split(",")
38
+ <%= user_class_name %>.create!(:first_name => first_name, :last_name => last_name, :email => email, :password => password, :password_confirmation => password, :language => lang, :active => true)
35
39
  end
36
40
  flash[:success] = t("users.mass_create.notice")
37
41
  redirect_to <%= user_plural_name %>_url
@@ -58,7 +62,7 @@ class <%= user_plural_class_name %>Controller < ApplicationController
58
62
 
59
63
  def destroy
60
64
  @<%= user_singular_name %> = <%= user_class_name %>.find(params[:id])
61
- @<%= user_singular_name %>.destroy
65
+ @<%= user_singular_name %>.deactivate!
62
66
  flash[:notice] = t("users.destroy.notice")
63
67
  redirect_to <%= user_plural_name %>_url
64
68
  end
@@ -12,26 +12,31 @@
12
12
  = f.label :email
13
13
  %br
14
14
  = f.text_field :email, :disabled => disabled
15
- %p
16
- = f.label :language
17
- %br
18
- = f.select :language, [["English", "en"], ["Italiano", "it"]]
19
- %p
20
- = f.label :password
21
- %br
22
- = f.password_field :password
23
- %p
24
- = f.label :password_confirmation
25
- %br
26
- = f.password_field :password_confirmation
27
15
  - if permitted_to? :manage, @<%= user_singular_name %>
28
16
  %p
29
- = f.label :roles
17
+ = f.label :password
18
+ %br
19
+ = f.password_field :password
20
+ %p
21
+ = f.label :password_confirmation
22
+ %br
23
+ = f.password_field :password_confirmation
24
+ %p
25
+ = f.label :language, t("users.language")
26
+ %br
27
+ = f.select :language, [["English", "en"], ["Italiano", "it"]]
28
+ %p
29
+ = f.label :active
30
+ %br
31
+ = f.select :active, [["Active", true], ["Passive", false]]
32
+ %p
33
+ = f.label :roles, t("users.roles")
30
34
  %br
31
35
  - for role in User::ROLES
32
- = check_box_tag "user[roles][]", role, @<%= user_singular_name %>.roles.include?(role), :disabled => (@<%= user_singular_name %> == @current_<%= user_singular_name %> ? true : false)
36
+ = check_box_tag "<%= user_singular_name %>[roles][]", role, @<%= user_singular_name %>.roles.include?(role), :disabled => (@<%= user_singular_name %> == @current_<%= user_singular_name %> ? true : false)
33
37
  =h role.humanize
34
38
  %br
35
39
  %p
36
40
  %button.button.positive{:type => "submit"}
41
+ = image_tag "icons/yes.gif"
37
42
  = submit_button
@@ -1,5 +1,4 @@
1
1
  - title t("users.edit.title")
2
- - page "admin_page"
3
2
 
4
3
  - form_for @<%= user_singular_name %> do |f|
5
4
  = render :partial => "form", :locals => { :f => f, :submit_button => t("label.update") }
@@ -1,15 +1,17 @@
1
1
  - title t("users.index.title")
2
- - page "admin_page"
3
2
 
4
3
  %table
5
4
  %thead
6
5
  %tr
7
- %td{:colspan => 2}
6
+ %td
7
+ = page_entries_info @<%= user_plural_name %>
8
8
  = will_paginate @<%= user_plural_name %>
9
- %td{:style => "text-align:right;"}
9
+ %td{:colspan => 2, :style => "text-align:right;"}
10
10
  = link_to t("users.index.new_user_link"), new_<%= user_singular_name %>_path
11
11
  |
12
12
  = link_to t("users.index.mass_new_users_link"), mass_new_<%= user_plural_name %>_path
13
+ |
14
+ = params[:deleted] ? link_to(t("users.index.title"), <%= user_plural_name %>_path) : link_to("Zombies", <%= user_plural_name %>_path(:deleted => true))
13
15
  %td
14
16
  #search
15
17
  - form_tag <%= user_plural_name %>_path, :method => :get do
@@ -18,7 +20,7 @@
18
20
  %tbody
19
21
  %tr
20
22
  %th <%= user_class_name %>
21
- %th Active
23
+ %th Lang
22
24
  %th Roles
23
25
  %th Actions
24
26
  - for user in @<%= user_plural_name %>
@@ -32,11 +34,12 @@
32
34
  %br
33
35
  = <%= user_singular_name %>.email
34
36
  %td
37
+ = image_tag "icons/#{<%= user_singular_name %>.language}.gif", :class => "icon"
35
38
  %td
36
39
  = <%= user_singular_name %>.roles.join(', ')
37
40
  %td
38
- = link_to t("label.edit"), edit_<%= user_singular_name %>_path(<%= user_singular_name %>), :class => "button"
39
- = link_to t("label.destroy"), <%= user_singular_name %>_path(<%= user_singular_name %>), :confirm => t("confirm.destroy"), :method => :delete, :class => "button negative" unless <%= user_singular_name %> == current_<%= user_singular_name %>
41
+ = link_to "#{image_tag("icons/edit.gif")} #{t("label.edit")}", edit_<%= user_singular_name %>_path(<%= user_singular_name %>), :class => "button"
42
+ = link_to "#{image_tag("icons/edit.gif")} #{t("label.destroy")}", <%= user_singular_name %>_path(<%= user_singular_name %>), :confirm => t("confirm.destroy"), :method => :delete, :class => "button negative" unless <%= user_singular_name %> == current_<%= user_singular_name %>
40
43
 
41
44
  %tfoot
42
45
  %tr
@@ -1,15 +1,22 @@
1
1
  - title t("user_sessions.new.title")
2
- - page "home_page"
3
2
 
4
3
  - form_for @<%= session_singular_name %> do |f|
5
4
  = f.error_messages
6
- %p
5
+ %div.span-24.last
7
6
  = f.label :email, t("user_sessions.new.email")
8
- %br
9
- = f.text_field :email, :class => "bigfield span-8"
10
- %p
7
+ %div.span-12
8
+ = f.text_field :email, :class => "bigfield span-23"
9
+ %div.span-11.last
10
+ %div.help
11
+ It should be a valid email.
12
+ %div.span-24.last
11
13
  = f.label :password, t("user_sessions.new.password")
12
- %br
13
- = f.password_field :password, :class => "bigfield span-8"
14
- %button.button.positive{:type => "submit"}
15
- = t("label.login")
14
+ %div.span-12
15
+ = f.password_field :password, :class => "bigfield span-23"
16
+ %div.span-11.last
17
+ %div.help
18
+ Remember to turn caps lock off!
19
+ %div.span-24.last
20
+ %button.button.positive{:type => "submit"}
21
+ = image_tag "icons/yes.gif"
22
+ = t("label.login")
@@ -1,5 +1,4 @@
1
1
  - title t("users.mass_new.title")
2
- - page "admin_page"
3
2
 
4
3
  - form_tag mass_create_<%= user_plural_name %>_path, :method => :post do
5
4
  %p
@@ -9,5 +8,6 @@
9
8
  = text_area_tag "text_area", nil, :rows => 10, :class => "span-17"
10
9
  %p
11
10
  %button.button.positive{:type => "submit"}
11
+ = image_tag "icons/yes.gif"
12
12
  = t("label.create")
13
13
  = link_to t("label.back"), <%= user_plural_name %>_path, :class => "button"
@@ -1,5 +1,4 @@
1
1
  - title t("users.new.title")
2
- - page "admin_page"
3
2
 
4
3
  - form_for @<%= user_singular_name %> do |f|
5
4
  = render :partial => "form", :locals => { :f => f, :submit_button => t("label.create") }
@@ -1,5 +1,10 @@
1
1
  - title "#{@<%= user_singular_name %>.full_name}"
2
- - page "home_page"
3
2
 
3
+ %p
4
+ %strong Email:
5
+ = @<%= user_singular_name %>.email
6
+ %br
7
+ %small= t("users.show.email_message")
4
8
  - if permitted_to? :update, @<%= user_singular_name %>
5
- = link_to t("label.edit"), edit_<%= user_singular_name %>_path(@<%= user_singular_name %>)
9
+ %p.buttons
10
+ = link_to t("label.edit"), edit_<%= user_singular_name %>_path(@<%= user_singular_name %>)
@@ -41,6 +41,9 @@ class MondoLayoutGenerator < Rails::Generator::Base
41
41
  m.file "images/notice.gif", "public/images/icons/notice.gif"
42
42
  m.file "images/success.gif", "public/images/icons/success.gif"
43
43
 
44
+ m.file "images/en.gif", "public/images/icons/en.gif"
45
+ m.file "images/it.gif", "public/images/icons/it.gif"
46
+
44
47
  m.file "images/yes.gif", "public/images/icons/yes.gif"
45
48
  m.file "images/no.gif", "public/images/icons/no.gif"
46
49
  m.file "images/accept.gif", "public/images/icons/accept.gif"
@@ -9,35 +9,43 @@
9
9
  /[if lt IE 8]
10
10
  = stylesheet_link_tag 'compiled/ie.css', :media => 'screen, projection'
11
11
  = javascript_include_tag :defaults
12
+ = yield(:head)
12
13
  %body{:id => yield(:page)}
13
14
  #wrap
14
15
  #header
15
- %h1 <%= app_name %>
16
+ %h1
17
+ = link_to <%= app_name %>, root_path
18
+ %span.alt Subtitle
16
19
  #navbar
17
- %ul
18
- - if logged_in?
19
- %li
20
- = t("label.welcome")
21
- = link_to current_user.full_name, user_path(@current_user)
22
- %li
23
- = link_to "Home", root_path
24
- %li
25
- = link_to "Logout", logout_path
26
- - else
27
- %li
28
- = link_to "Home", root_path
29
- %li
30
- = link_to "Login", login_path
20
+ #menu
21
+ %ul
22
+ - if logged_in?
23
+ %li== #{t("label.welcome")} #{current_user.full_name}
24
+ %li= link_to "Home", root_path
25
+ %li= link_to "Logout", logout_path
26
+ - else
27
+ %li= link_to "Home", root_path
28
+ %li= link_to "Login", login_path
31
29
  #flash_box{:onclick => "new Effect.Fade(this, {duration: 0.1, from: 0.7});", :style => "display: none;"}
32
30
  - flash_message
33
- #content.container
34
- %h2= yield(:title)
35
- = yield
36
- .push
31
+ #content
32
+ #title
33
+ %h2= yield(:title)
34
+ #main
35
+ = yield
37
36
 
38
37
  #footer
39
- %p.right
40
- Right Footer
41
- %p.left
42
- Left Footer
43
-
38
+ #footer_content
39
+ .span-3.alignright
40
+ %h3
41
+ <%= app_name %>
42
+ %small
43
+ Subtitle
44
+ .span-3
45
+ %ul
46
+ %li= link_to "Home", root_path
47
+ .span-7
48
+ &nbsp;
49
+ .span-10.last.alignright
50
+ %p
51
+ = link_to "Credits", "http://www.rubyonrails.com", :popup => true
@@ -1,12 +1,14 @@
1
- !body_background_color = #fff
2
- !header_background_color = #111
1
+ !body_background_color = #eee
2
+ !header_background_color = #222
3
3
  !navbar_background_color = #fff
4
4
  !content_background_color = #fff
5
- !footer_background_color = #fff
5
+ !footer_background_color = #eee
6
6
 
7
7
  !font_color = #464646
8
+ !headline_color = #333
8
9
  !link_color = #4183c4
9
10
  !link_hover_color = #08f
11
+ !weak_color = #666
10
12
 
11
13
  !feedback_border_color ||= #DDD
12
14
  !success_color ||= #264409
@@ -12,4 +12,6 @@
12
12
  :padding-right 24px
13
13
  =weak
14
14
  :font-size 90%
15
- :color #888
15
+ :color = !weak_color
16
+ =strong
17
+ :font-weight bold
@@ -10,47 +10,43 @@ body
10
10
  :text-align left
11
11
 
12
12
  #wrap
13
- :min-height 100%
14
- :height auto !important
15
- :height 100%
16
- :margin-bottom = -!footer_height
17
-
18
- .push
19
- :height = !footer_height
20
-
21
- .box
22
- :background #efefef
23
- :padding 1.5em 1.5em 0.1em 1.5em
24
- :margin-bottom 1em
25
-
26
- .box_bordered
27
- :border 2px dashed #999
28
- :padding 1.5em 1.5em 0.1em 1.5em
29
- :margin-bottom 1em
13
+ :min-width 950px
14
+ :background = !content_background_color
15
+ #main
16
+ :min-height 500px
17
+ :height auto !important
18
+ :height 500px
30
19
 
31
20
  a
32
21
  img
33
22
  :border 0
34
23
 
35
24
  img.icon
36
- :vertical-align text-bottom
25
+ :vertical-align middle
37
26
 
38
27
  .float_left
39
28
  +float
40
29
  .float_right
41
30
  +float("right")
42
31
 
32
+ .aligncenter
33
+ :text-align center
34
+ .alignleft
35
+ :text-align left
36
+ .alignright
37
+ :text-align right
38
+
43
39
  br.clear
44
40
  :clear both
45
41
 
46
42
  span.handle
47
43
  :cursor move
48
44
 
49
- span.hide_container
50
- span.hide_element
45
+ .hide_container
46
+ .hide_element
51
47
  :display none
52
- span.hide_container:hover
53
- span.hide_element
48
+ .hide_container:hover
49
+ .hide_element
54
50
  :display inline
55
51
 
56
52
  @import header.sass
@@ -1,8 +1,8 @@
1
1
  .container
2
2
  :width 90%
3
- :min-height 225px
4
3
  #content
5
- :margin 1.5em 0 0 20px
6
- :padding 0
4
+ +clearfix
5
+ :margin 1.5em 10% 0
6
+ :padding 0 0 1.5em
7
7
  :text-align left
8
8
  :background transparent
@@ -3,11 +3,11 @@
3
3
  label
4
4
  :color #cf0000
5
5
  #errorExplanation
6
- :margin-bottom 1.5em
6
+ :margin-bottom 1.5em
7
7
  :background-color #fff
8
8
  h2
9
9
  :margin 0
10
- :padding 3px
10
+ :padding 3px 7px
11
11
  :text-align left
12
12
  :font-weight bold
13
13
  :color #fff
@@ -18,6 +18,5 @@
18
18
  :padding 1em 1em 0
19
19
  ul
20
20
  :margin 0
21
- :padding 0.5em 0 1em 3em
22
- :border-bottom 2px solid #cf0000
23
- :list-style-type square
21
+ :padding 0.5em 0 1em 1em
22
+ :border-bottom 2px solid #cf0000
@@ -1,14 +1,24 @@
1
1
  #footer
2
2
  +clearfix
3
3
  :min-width 910px
4
- :height = !footer_height
5
4
  :margin 0
6
- :padding 0.4em 20px 0
5
+ :padding 1.5em 0 1.5em
7
6
  :border-top 1px solid #ccc
8
7
  :background = !footer_background_color
9
- p
10
- :margin 0
11
- p.left
12
- +float
13
- p.right
14
- +float("right")
8
+ #footer_content
9
+ +clearfix
10
+ :margin 0 10%
11
+ h3
12
+ :margin-bottom 0
13
+ p, ul
14
+ :color #aaa
15
+ :margin 0
16
+ ul
17
+ li
18
+ :background-image none
19
+ :padding-left 0
20
+ a, a:visited, a:focus, a:active
21
+ +strong
22
+ :color #aaa
23
+ a:hover
24
+ :color #666
@@ -1,22 +1,26 @@
1
1
  #header
2
2
  +clearfix
3
- :min-width 910px
4
- :padding 0 20px
5
3
  :background = !header_background_color
4
+ :text-align left
6
5
  h1
7
6
  :margin-top 0.3em
7
+ :margin-left 10%
8
+ :margin-right 10%
8
9
  :font-size 2em
9
10
  :color #fff
10
11
  :font-family = !headline_fonts
12
+ a
13
+ :color #fff
14
+ a:hover
15
+ :color #eee
11
16
  .alt
12
17
  :margin-left 0.5em
13
18
  :font-size 70%
14
- :color #aaa
19
+ :color #aca
15
20
 
16
21
  #navbar
17
22
  +clearfix
18
- :min-width 910px
19
- :padding 5px 20px
23
+ :padding 5px 0
20
24
  :background
21
25
  :color = !navbar_background_color
22
26
  :image url('../../images/navbar_bkg.gif')
@@ -25,22 +29,22 @@
25
29
  :border
26
30
  :top 1px solid #ccc
27
31
  :bottom 1px solid #ccc
28
- ul
29
- +float("right")
30
- :margin 0
31
- +no-bullets
32
- +horizontal-list(1em)
33
- :font-family = !headline_fonts
34
- :border-left 1px solid #ccc
35
- li
36
- :background-image none
37
- :border
38
- :left 1px solid #fff
39
- :right 1px solid #ccc
40
- a
41
- +link-colors(#464646,#000)
42
- :text-decoration none
43
- :font-weight bold
32
+ #menu
33
+ :margin 0 10%
34
+ ul
35
+ +float("right")
36
+ +horizontal-list(1em)
37
+ :font-family = !headline_fonts
38
+ :border-left 1px solid #ccc
39
+ li
40
+ :background-image none
41
+ :border
42
+ :left 1px solid #fff
43
+ :right 1px solid #ccc
44
+ a
45
+ +link-colors(#464646,#000)
46
+ :text-decoration none
47
+ :font-weight bold
44
48
 
45
49
  #flash_box
46
50
  :left 0
@@ -35,5 +35,20 @@ a:hover
35
35
  :text-decoration none
36
36
  :color = !link_hover_color
37
37
 
38
- .quiet, small
39
- +weak
38
+ .weak, .quiet, small
39
+ +weak
40
+ .strong, .loud, strong
41
+ :font-weight bold
42
+ .italic
43
+ :font-style italic
44
+
45
+ .odd
46
+ :background-color #fafafa
47
+ .even
48
+ :background-color #eee
49
+
50
+ hr
51
+ :width 95%
52
+ :color #ccc
53
+ :background-color #ccc
54
+ :border 1px solid #ccc
@@ -19,13 +19,14 @@
19
19
  +float
20
20
  :width 24px
21
21
  :height 24px
22
- :margin-top 5px
22
+ :margin-top 0
23
23
  :margin-right 5px
24
24
  :margin-bottom 5px
25
25
  :background-color #C4CDE0
26
26
  img.fb_profile_pic_rendered
27
27
  :width 24px
28
28
  :height 24px
29
-
29
+ .user_data
30
+ :line-height 1
30
31
  #search
31
32
  :text-align right
@@ -6,4 +6,5 @@
6
6
  = f.<%= attribute.field_type %> :<%= attribute.name %>
7
7
  <%- end -%>
8
8
  %button.button.positive{:type => "submit"}
9
+ = image_tag "icons/yes.gif"
9
10
  = submit_button
@@ -9,7 +9,7 @@
9
9
 
10
10
  <%- if actions? :show, :destroy, :index -%>
11
11
  <%- if action? :destroy -%>
12
- = link_to t("label.destroy"), <%= singular_name %>, :confirm => t("confirm.destroy"), :method => :delete, :class => "button negative"
12
+ = link_to "#{image_tag("icons/delete.gif")} #{t("label.destroy")}", @<%= singular_name %>, :confirm => t("confirm.destroy"), :method => :delete, :class => "button negative"
13
13
  <%- end -%>
14
14
  <%- if action? :index -%>
15
15
  = link_to t("label.back"), <%= plural_name %>_path, :class => "button"
@@ -1,8 +1,8 @@
1
1
  - title "<%= plural_name.titleize %>"
2
2
 
3
3
  <%- if actions? :new -%>
4
- %p
5
- = link_to "New <%= singular_name.titleize %>", new_<%= singular_name %>_path
4
+ %p.buttons
5
+ = link_to "#{image_tag("icons/new.gif")} New <%= singular_name.titleize %>", new_<%= singular_name %>_path
6
6
  <%- end -%>
7
7
 
8
8
  %table
@@ -19,11 +19,11 @@
19
19
  <%- end -%>
20
20
  %td
21
21
  <%- if action? :show -%>
22
- = link_to t("label.show"), <%= singular_name %>, :class => "button positive"
22
+ = link_to "#{image_tag("icons/go.gif")} t("label.show")}", <%= singular_name %>, :class => "button positive"
23
23
  <%- end -%>
24
24
  <%- if action? :edit -%>
25
- = link_to t("label.edit"), edit_<%= singular_name %>_path(<%= singular_name %>), :class => "button"
25
+ = link_to "#{image_tag("icons/edit.gif")} t("label.edit")}", edit_<%= singular_name %>_path(<%= singular_name %>), :class => "button"
26
26
  <%- end -%>
27
27
  <%- if action? :destroy -%>
28
- = link_to t("label.destroy"), <%= singular_name %>, :confirm => t("confirm.destroy"), :method => :delete, :class => "button negative"
28
+ = link_to "#{image_tag("icons/delete.gif")} t("label.destroy")}", <%= singular_name %>, :confirm => t("confirm.destroy"), :method => :delete, :class => "button negative"
29
29
  <%- end -%>
@@ -8,5 +8,5 @@
8
8
  <%- end -%>
9
9
 
10
10
  <%- if action? :index -%>
11
- = link_to "Back to List", <%= plural_name %>_path, :class => "button"
11
+ = link_to "Back", <%= plural_name %>_path, :class => "button"
12
12
  <%- end -%>
@@ -8,7 +8,7 @@
8
8
 
9
9
  %p.buttons
10
10
  <%- if action? :edit -%>
11
- = link_to t("label.edit"), edit_<%= singular_name %>_path(<%= singular_name %>), :class => "button positive"
11
+ = link_to "#{image_tag("icons/edit.gif")} t("label.edit")}", edit_<%= singular_name %>_path(<%= singular_name %>), :class => "button positive"
12
12
  <%- end -%>
13
13
  <%- if action? :index -%>
14
14
  = link_to t("label.back"), <%= plural_name %>_path, :class => "button"
metadata CHANGED
@@ -1,7 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mondo-generators
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.2
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 6
8
+ - 3
9
+ version: 0.6.3
5
10
  platform: ruby
6
11
  authors:
7
12
  - Luca Tironi
@@ -9,7 +14,7 @@ autorequire:
9
14
  bindir: bin
10
15
  cert_chain: []
11
16
 
12
- date: 2010-02-04 00:00:00 +01:00
17
+ date: 2010-03-26 00:00:00 +01:00
13
18
  default_executable:
14
19
  dependencies: []
15
20
 
@@ -57,8 +62,10 @@ files:
57
62
  - rails_generators/mondo_layout/templates/images/cancel.gif
58
63
  - rails_generators/mondo_layout/templates/images/delete.gif
59
64
  - rails_generators/mondo_layout/templates/images/edit.gif
65
+ - rails_generators/mondo_layout/templates/images/en.gif
60
66
  - rails_generators/mondo_layout/templates/images/error.gif
61
67
  - rails_generators/mondo_layout/templates/images/help_triangle.gif
68
+ - rails_generators/mondo_layout/templates/images/it.gif
62
69
  - rails_generators/mondo_layout/templates/images/navbar_bkg.gif
63
70
  - rails_generators/mondo_layout/templates/images/new.gif
64
71
  - rails_generators/mondo_layout/templates/images/no.gif
@@ -111,18 +118,20 @@ required_ruby_version: !ruby/object:Gem::Requirement
111
118
  requirements:
112
119
  - - ">="
113
120
  - !ruby/object:Gem::Version
121
+ segments:
122
+ - 0
114
123
  version: "0"
115
- version:
116
124
  required_rubygems_version: !ruby/object:Gem::Requirement
117
125
  requirements:
118
126
  - - ">="
119
127
  - !ruby/object:Gem::Version
128
+ segments:
129
+ - 0
120
130
  version: "0"
121
- version:
122
131
  requirements: []
123
132
 
124
133
  rubyforge_project:
125
- rubygems_version: 1.3.5
134
+ rubygems_version: 1.3.6
126
135
  signing_key:
127
136
  specification_version: 3
128
137
  summary: A collection of useful generator scripts for Rails.