mondo-generators 0.6.3 → 0.6.4

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.6.3
1
+ 0.6.4
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{mondo-generators}
8
- s.version = "0.6.3"
8
+ s.version = "0.6.4"
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"]
@@ -31,11 +31,13 @@ Gem::Specification.new do |s|
31
31
  "rails_generators/mondo_authentication/templates/migration.rb",
32
32
  "rails_generators/mondo_authentication/templates/session.rb",
33
33
  "rails_generators/mondo_authentication/templates/sessions_controller.rb",
34
+ "rails_generators/mondo_authentication/templates/static_pages_controller.rb",
34
35
  "rails_generators/mondo_authentication/templates/user.rb",
35
36
  "rails_generators/mondo_authentication/templates/users_controller.rb",
36
37
  "rails_generators/mondo_authentication/templates/users_helper.rb",
37
38
  "rails_generators/mondo_authentication/templates/views/_form.html.haml",
38
39
  "rails_generators/mondo_authentication/templates/views/edit.html.haml",
40
+ "rails_generators/mondo_authentication/templates/views/home.html.haml",
39
41
  "rails_generators/mondo_authentication/templates/views/index.html.haml",
40
42
  "rails_generators/mondo_authentication/templates/views/login.html.haml",
41
43
  "rails_generators/mondo_authentication/templates/views/mass_new.html.haml",
@@ -14,10 +14,10 @@ Rails::Generator::Commands::Create.class_eval do
14
14
  def route_resource_with_options(resource, route_options = {})
15
15
  sentinel = 'ActionController::Routing::Routes.draw do |map|'
16
16
 
17
- logger.route "map.resource #{resource}, #{route_options}"
17
+ logger.route "map.resource #{resource}, :member => { #{route_options[:members]} }, :collection => { #{route_options[:collections]} }"
18
18
  unless options[:pretend]
19
19
  gsub_file 'config/routes.rb', /(#{Regexp.escape(sentinel)})/mi do |match|
20
- "#{match}\n map.resource #{resource}, #{route_options}\n"
20
+ "#{match}\n map.resource #{resource}, :member => { #{route_options[:members]} }, :collection => { #{route_options[:collections]} }\n"
21
21
  end
22
22
  end
23
23
  end
@@ -55,7 +55,7 @@ Rails::Generator::Commands::Destroy.class_eval do
55
55
 
56
56
  def route_resource_with_options(resource, route_options = {})
57
57
  look_for = "\n map.resource #{resource}, #{route_options}\n"
58
- logger.route "map.resource #{resource}, #{route_options}"
58
+ logger.route "map.resource #{resource}, :member => { #{route_options[:members]} }, :collection => { #{route_options[:collections]} }"
59
59
  unless options[:pretend]
60
60
  gsub_file 'config/routes.rb', /(#{look_for})/mi, ''
61
61
  end
@@ -84,7 +84,7 @@ Rails::Generator::Commands::List.class_eval do
84
84
  end
85
85
 
86
86
  def route_resource_with_options(resource, route_options = {})
87
- logger.route "map.resource #{resource}, #{route_options}"
87
+ logger.route "map.resource #{resource}, :member => { #{route_options[:members]} }, :collection => { #{route_options[:collections]} }"
88
88
  end
89
89
 
90
90
  def route_name(name, path, options = {})
@@ -17,6 +17,10 @@ class MondoAuthenticationGenerator < Rails::Generator::Base
17
17
  m.directory "app/views"
18
18
  m.directory "lib"
19
19
 
20
+ m.directory "app/views/static_pages"
21
+ m.template "static_pages_controller.rb", "app/controllers/static_pages_controller.rb"
22
+ m.template "views/home.html.haml", "app/views/static_pages/home.html.haml"
23
+
20
24
  m.directory "app/views/#{user_plural_name}"
21
25
  m.template "user.rb", "app/models/#{user_singular_name}.rb"
22
26
  m.template "users_controller.rb", "app/controllers/#{user_plural_name}_controller.rb"
@@ -40,9 +44,10 @@ class MondoAuthenticationGenerator < Rails::Generator::Base
40
44
  m.route_name :signup, '/signup', :controller => user_plural_name, :action => 'new'
41
45
  m.route_name :logout, '/logout', :controller => session_plural_name, :action => 'destroy'
42
46
  m.route_name :login, '/login', :controller => session_plural_name, :action => 'new'
47
+ m.route_name :root, '/', :controller => 'static_pages', :action => 'home'
48
+
43
49
  m.route_resources session_plural_name
44
- m.route_resources user_plural_name
45
- m.insert_into "config/routes.rb", 'map.resources :users, :collection => { :mass_new => :get, :mass_create => :post }'
50
+ m.route_resource_with_options user_plural_name, :collections => ':mass_new => :get, :mass_create => :post'
46
51
 
47
52
  m.insert_into "app/controllers/#{application_controller_name}.rb", 'include Authentication'
48
53
 
@@ -1,5 +1,6 @@
1
1
  authorization do
2
2
  role :guest do
3
+ has_permission_on :<%= user_plural_name %>, :to => :create
3
4
  end
4
5
 
5
6
  role :<%= user_singular_name %> do
@@ -47,9 +47,7 @@ en:
47
47
  new_user_link: "Add new user"
48
48
  mass_new_users_link: "Mass add new Users"
49
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"
50
+ email_message: "We will use your email only for communications strictly related to the application."
53
51
  profile_label: "Profile"
54
52
  new:
55
53
  title: "New user"
@@ -47,9 +47,7 @@ it:
47
47
  new_user_link: "Aggiungi nuovo utente"
48
48
  mass_new_users_link: "Aggiungi utenti in massa"
49
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"
50
+ email_message: "Useremo la tua email solo per comunicazioni strettamente correlate all'applicazione."
53
51
  profile_label: "Profilo"
54
52
  new:
55
53
  title: "Nuovo utente"
@@ -0,0 +1,4 @@
1
+ class StaticPagesController < ApplicationController
2
+ def home
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ - title "Home Page"
2
+
3
+ %p
4
+ Find me in "app\views\static_pages\home.html.haml"
@@ -7,4 +7,4 @@
7
7
  %small= t("users.show.email_message")
8
8
  - if permitted_to? :update, @<%= user_singular_name %>
9
9
  %p.buttons
10
- = link_to t("label.edit"), edit_<%= user_singular_name %>_path(@<%= user_singular_name %>)
10
+ = link_to "#{image_tag("icons/edit.gif")} #{t("label.edit")} #{t("users.show.profile_label")}", edit_<%= user_singular_name %>_path(@<%= user_singular_name %>)
@@ -14,7 +14,7 @@
14
14
  #wrap
15
15
  #header
16
16
  %h1
17
- = link_to <%= app_name %>, root_path
17
+ = link_to "<%= app_name %>", root_path
18
18
  %span.alt Subtitle
19
19
  #navbar
20
20
  #menu
@@ -35,7 +35,7 @@
35
35
  = yield
36
36
 
37
37
  #footer
38
- #footer_content
38
+ #footer_content
39
39
  .span-3.alignright
40
40
  %h3
41
41
  <%= app_name %>
@@ -16,7 +16,7 @@
16
16
  .alt
17
17
  :margin-left 0.5em
18
18
  :font-size 70%
19
- :color #aca
19
+ :color #aaa
20
20
 
21
21
  #navbar
22
22
  +clearfix
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 6
8
- - 3
9
- version: 0.6.3
8
+ - 4
9
+ version: 0.6.4
10
10
  platform: ruby
11
11
  authors:
12
12
  - Luca Tironi
@@ -42,11 +42,13 @@ files:
42
42
  - rails_generators/mondo_authentication/templates/migration.rb
43
43
  - rails_generators/mondo_authentication/templates/session.rb
44
44
  - rails_generators/mondo_authentication/templates/sessions_controller.rb
45
+ - rails_generators/mondo_authentication/templates/static_pages_controller.rb
45
46
  - rails_generators/mondo_authentication/templates/user.rb
46
47
  - rails_generators/mondo_authentication/templates/users_controller.rb
47
48
  - rails_generators/mondo_authentication/templates/users_helper.rb
48
49
  - rails_generators/mondo_authentication/templates/views/_form.html.haml
49
50
  - rails_generators/mondo_authentication/templates/views/edit.html.haml
51
+ - rails_generators/mondo_authentication/templates/views/home.html.haml
50
52
  - rails_generators/mondo_authentication/templates/views/index.html.haml
51
53
  - rails_generators/mondo_authentication/templates/views/login.html.haml
52
54
  - rails_generators/mondo_authentication/templates/views/mass_new.html.haml