mondo-generators 0.6.3 → 0.6.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION +1 -1
- data/mondo-generators.gemspec +3 -1
- data/rails_generators/mondo_authentication/lib/insert_commands.rb +4 -4
- data/rails_generators/mondo_authentication/mondo_authentication_generator.rb +7 -2
- data/rails_generators/mondo_authentication/templates/authorization_rules.rb +1 -0
- data/rails_generators/mondo_authentication/templates/locales/en.yml +1 -3
- data/rails_generators/mondo_authentication/templates/locales/it.yml +1 -3
- data/rails_generators/mondo_authentication/templates/static_pages_controller.rb +4 -0
- data/rails_generators/mondo_authentication/templates/views/home.html.haml +4 -0
- data/rails_generators/mondo_authentication/templates/views/show.html.haml +1 -1
- data/rails_generators/mondo_layout/templates/layout.html.haml +2 -2
- data/rails_generators/mondo_layout/templates/stylesheets/partials/_header.sass +1 -1
- metadata +4 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.6.
|
1
|
+
0.6.4
|
data/mondo-generators.gemspec
CHANGED
@@ -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.
|
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.
|
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
|
|
@@ -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
|
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
|
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"
|
@@ -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
|
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
|
-
|
38
|
+
#footer_content
|
39
39
|
.span-3.alignright
|
40
40
|
%h3
|
41
41
|
<%= app_name %>
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 6
|
8
|
-
-
|
9
|
-
version: 0.6.
|
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
|