hobo 1.3.0.pre15 → 1.3.0.pre16

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.3.0.pre15
1
+ 1.3.0.pre16
@@ -7,6 +7,7 @@ module Hobo
7
7
 
8
8
  include Generators::Hobo::Subsite
9
9
  include Generators::Hobo::InviteOnly
10
+ include Generators::HoboSupport::EvalTemplate
10
11
 
11
12
  def self.banner
12
13
  "rails generate hobo:admin_subsite [NAME=admin] [options]"
@@ -29,14 +30,9 @@ module Hobo
29
30
  end
30
31
 
31
32
  def append_admin_tag_into_application_taglib
32
- source = File.expand_path(find_in_source_paths('admin_tag_injection.erb'))
33
33
  destination = File.join(Rails.root, "app/views/taglibs/application.dryml")
34
- context = instance_eval('binding')
35
- append_file destination do
36
- ERB.new(::File.binread(source), nil, '-').result(context)
37
- end
34
+ append_file(destination) { eval_template('admin_tag_injection.erb') }
38
35
  end
39
36
 
40
-
41
37
  end
42
38
  end
@@ -2,7 +2,9 @@
2
2
  <extend tag="page">
3
3
  <old-page merge>
4
4
  <footer:>
5
- <a href="&<%= file_name %>_<%= options[:user_resource_name].underscore.pluralize %>_url" if="&current_user.administrator?">Admin</a>
5
+ <a href="&<%= file_name %>_<%= options[:user_resource_name].underscore.pluralize %>_url" if="&current_user.administrator?">
6
+ <t key="hobo.admin.subsite_name"><%= name.titleize %></t>
7
+ </a>
6
8
  </footer:>
7
9
  </old-page>
8
10
  </extend>
@@ -1,5 +1,7 @@
1
1
  <index-page without-new-form>
2
2
  <after-count:>
3
- <a with="&<%= options[:user_resource_name].camelize %>" action="invite">Invite a new user</a>
3
+ <a with="&<%= options[:user_resource_name].camelize %>" action="invite">
4
+ <t key="hobo.admin.invite_new_user">Invite a new user</t>
5
+ </a>
4
6
  </after-count:>
5
7
  </index-page>
@@ -15,7 +15,6 @@ en:
15
15
  # other: Users
16
16
  # attributes:
17
17
  # user:
18
- # created_at: Created at
19
18
  # name: Name
20
19
  # password: Password
21
20
  # password_confirmation: Password Confirmation
@@ -85,7 +85,7 @@ en:
85
85
  previous: "Previous"
86
86
  next: "Next"
87
87
  add: "Add"
88
- show_all: "show all..."
88
+ show_all: "Show all %{model}..."
89
89
  delete: "Delete %{model}"
90
90
  save: "Save %{model}"
91
91
  cancel: "Cancel"
@@ -175,6 +175,13 @@ en:
175
175
  dev_user_changer:
176
176
  guest: "Guest"
177
177
 
178
+ admin:
179
+ subsite_name: "Admin"
180
+ invite_new_user: "Invite a new user"
181
+
182
+ subsite:
183
+ back_link: "View Site"
184
+
178
185
  boolean_yes: "Yes"
179
186
  boolean_no: "No"
180
187
  password_hidden: "[password hidden]"
@@ -91,7 +91,7 @@
91
91
  previous: "Precedente"
92
92
  next: "Proxima"
93
93
  add: "Añadir"
94
- show_all: "todos..."
94
+ show_all: "Muestra todos %{model}..."
95
95
  delete: "Borrar %{model}"
96
96
  save: "Guardar %{model}"
97
97
  cancel: "Cancelar"
@@ -181,6 +181,13 @@
181
181
  dev_user_changer:
182
182
  guest: "Invitado"
183
183
 
184
+ admin:
185
+ subsite_name: "Administración"
186
+ invite_new_user: "Invitar Nuevo Usuario"
187
+
188
+ subsite:
189
+ back_link: "Sitio Principal"
190
+
184
191
  boolean_yes: "Si"
185
192
  boolean_no: "No"
186
193
  password_hidden: "[contraseña]"
@@ -91,7 +91,7 @@ it:
91
91
  previous: "Precedente"
92
92
  next: "Prossimo"
93
93
  add: "Aggiungere"
94
- show_all: "vedi tutti..."
94
+ show_all: "Mostra tutti..."
95
95
  delete: "Elimina %{model}"
96
96
  save: "Registra %{model}"
97
97
  cancel: "Annulla"
@@ -182,6 +182,13 @@ it:
182
182
  dev_user_changer:
183
183
  guest: "Invitato"
184
184
 
185
+ admin:
186
+ subsite_name: "Amministrazione"
187
+ invite_new_user: "Invita Nuovo Utente"
188
+
189
+ subsite:
190
+ back_link: "Sito Principale"
191
+
185
192
  boolean_yes: "Si"
186
193
  boolean_no: "No"
187
194
  password_hidden: "[parola chiave]"
@@ -86,7 +86,7 @@
86
86
  previous: "Anterior"
87
87
  next: "Seguinte"
88
88
  add: "Adicionar"
89
- show_all: "mostrar tudo..."
89
+ show_all: "Mostrar tudo %{model}..."
90
90
  delete: "Apagar %{model}"
91
91
  save: "Gravar %{model}"
92
92
  cancel: "Cancelar"
@@ -176,6 +176,13 @@
176
176
  dev_user_changer:
177
177
  guest: "Visitante"
178
178
 
179
+ admin:
180
+ subsite_name: "Administração"
181
+ invite_new_user: "Invitar Novo Utilizador"
182
+
183
+ subsite:
184
+ back_link: "Sítio Principal"
185
+
179
186
  boolean_yes: "Sim"
180
187
  boolean_no: "Não"
181
188
  password_hidden: "[palavra-chave]"
@@ -16,7 +16,7 @@
16
16
  <stylesheet name="<%= file_name %>"/>
17
17
  </append-stylesheets:>
18
18
  <footer:>
19
- <a href="#{base_url}/">View Site</a> |
19
+ <a href="#{base_url}/"><t key="hobo.subsite.back_link">View Site</t></a>
20
20
  </footer:>
21
21
  </old-page>
22
22
  </extend>
@@ -4,7 +4,7 @@ class Array
4
4
  attr_accessor :member_class, :origin, :origin_attribute
5
5
 
6
6
  def to_url_path
7
- base_path = origin_object.try.to_url_path
7
+ base_path = origin.try.to_url_path
8
8
  "#{base_path}/#{origin_attribute}" unless base_path.blank?
9
9
  end
10
10
 
data/lib/hobo/helper.rb CHANGED
@@ -58,7 +58,7 @@ module Hobo
58
58
  options[:subsite] ||= self.subsite
59
59
  subsite, method = options.get :subsite, :method
60
60
 
61
- if obj.respond_to?(:member_class) && obj.respond_to?(:origin)
61
+ if obj.respond_to?(:member_class) && obj.respond_to?(:origin) && obj.origin
62
62
  # Asking for URL of a collection, e.g. category/1/adverts or category/1/adverts/new
63
63
 
64
64
  refl = obj.origin.class.reverse_reflection(obj.origin_attribute)
@@ -112,7 +112,10 @@ module Hobo
112
112
 
113
113
  def app_name(add_subsite=true)
114
114
  an = Rails.application.config.hobo.app_name
115
- an = an + " - #{subsite.titleize}" if add_subsite && subsite
115
+ if add_subsite && subsite
116
+ subsite_name = I18n.t 'hobo.admin.subsite_name', :default => subsite.titleize
117
+ an = an + " - #{subsite_name}"
118
+ end
116
119
  an
117
120
  end
118
121
 
@@ -74,7 +74,7 @@ module Hobo
74
74
  # the singularize method is used because Hobo does not keep the ActiveRecord convention in its tags
75
75
  # no default needed because human_name defaults to the model name
76
76
  # try because Hobo class is not an ActiveRecord::Base subclass
77
- translated_pluralized_model = klass.try.model_name.try.human(:count=>options[:count])
77
+ translated_pluralized_model = klass.try.model_name.try.human(:count=>options[:count]||1)
78
78
  options[:model] = translated_pluralized_model
79
79
  end
80
80
 
@@ -113,8 +113,8 @@ This tag assumes the controller has a `reorder` action and the model has a `posi
113
113
  <ht key="#{model_class.to_s.tableize}.actions.new">New <%= model_class.model_name.human %></ht>
114
114
  </a>
115
115
  <collection param/>
116
- <unless test="&this.empty?">
117
- <a param="show-all"><ht key="#{model_class.to_s.tableize}.actions.show_all">Show all <%= name.pluralize.titleize %>...</ht></a>
116
+ <unless test="&this.empty? || this.size <= model_class.count">
117
+ <a param="show-all"><ht key="#{model_class.to_s.tableize}.actions.show_all" count="100">Show all <%= name.pluralize.titleize %>...</ht></a>
118
118
  </unless>
119
119
  </section>
120
120
  </def>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hobo
3
3
  version: !ruby/object:Gem::Version
4
- hash: -1637175966
4
+ hash: -1637175965
5
5
  prerelease: true
6
6
  segments:
7
7
  - 1
8
8
  - 3
9
9
  - 0
10
- - pre15
11
- version: 1.3.0.pre15
10
+ - pre16
11
+ version: 1.3.0.pre16
12
12
  platform: ruby
13
13
  authors:
14
14
  - Tom Locke
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2010-11-03 00:00:00 -04:00
19
+ date: 2010-11-08 00:00:00 -04:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
@@ -59,13 +59,13 @@ dependencies:
59
59
  requirements:
60
60
  - - "="
61
61
  - !ruby/object:Gem::Version
62
- hash: -1637175966
62
+ hash: -1637175965
63
63
  segments:
64
64
  - 1
65
65
  - 3
66
66
  - 0
67
- - pre15
68
- version: 1.3.0.pre15
67
+ - pre16
68
+ version: 1.3.0.pre16
69
69
  type: :runtime
70
70
  version_requirements: *id003
71
71
  - !ruby/object:Gem::Dependency
@@ -76,13 +76,13 @@ dependencies:
76
76
  requirements:
77
77
  - - "="
78
78
  - !ruby/object:Gem::Version
79
- hash: -1637175966
79
+ hash: -1637175965
80
80
  segments:
81
81
  - 1
82
82
  - 3
83
83
  - 0
84
- - pre15
85
- version: 1.3.0.pre15
84
+ - pre16
85
+ version: 1.3.0.pre16
86
86
  type: :runtime
87
87
  version_requirements: *id004
88
88
  - !ruby/object:Gem::Dependency
@@ -93,13 +93,13 @@ dependencies:
93
93
  requirements:
94
94
  - - "="
95
95
  - !ruby/object:Gem::Version
96
- hash: -1637175966
96
+ hash: -1637175965
97
97
  segments:
98
98
  - 1
99
99
  - 3
100
100
  - 0
101
- - pre15
102
- version: 1.3.0.pre15
101
+ - pre16
102
+ version: 1.3.0.pre16
103
103
  type: :runtime
104
104
  version_requirements: *id005
105
105
  - !ruby/object:Gem::Dependency