hobo 0.9.0 → 0.9.100
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES.txt +132 -0
- data/Rakefile +18 -22
- data/bin/hobo +14 -13
- data/doctest/scopes.rdoctest +1 -0
- data/dryml_generators/rapid/forms.dryml.erb +1 -1
- data/dryml_generators/rapid/pages.dryml.erb +24 -24
- data/lib/hobo.rb +3 -3
- data/lib/hobo/accessible_associations.rb +10 -3
- data/lib/hobo/controller.rb +2 -1
- data/lib/hobo/dryml.rb +7 -2
- data/lib/hobo/dryml/dryml_builder.rb +1 -4
- data/lib/hobo/dryml/dryml_generator.rb +5 -3
- data/lib/hobo/dryml/taglib.rb +3 -8
- data/lib/hobo/dryml/template.rb +3 -10
- data/lib/hobo/dryml/template_handler.rb +3 -2
- data/lib/hobo/hobo_helper.rb +5 -83
- data/lib/hobo/lifecycles.rb +9 -5
- data/lib/hobo/lifecycles/actions.rb +5 -5
- data/lib/hobo/lifecycles/lifecycle.rb +6 -2
- data/lib/hobo/model.rb +14 -36
- data/lib/hobo/model_controller.rb +28 -15
- data/lib/hobo/model_router.rb +1 -1
- data/lib/hobo/permissions.rb +55 -5
- data/lib/hobo/permissions/associations.rb +13 -5
- data/lib/hobo/rapid_helper.rb +4 -10
- data/lib/hobo/scopes/automatic_scopes.rb +9 -1
- data/lib/hobo/translations.rb +88 -0
- data/lib/hobo/user.rb +1 -2
- data/lib/hobo/user_controller.rb +31 -9
- data/lib/hobo/view_hints.rb +38 -6
- data/rails_generators/hobo_model/templates/hints.rb +4 -1
- data/rails_generators/hobo_model_controller/hobo_model_controller_generator.rb +1 -1
- data/rails_generators/hobo_rapid/hobo_rapid_generator.rb +2 -1
- data/rails_generators/hobo_rapid/templates/hobo-rapid.js +9 -0
- data/rails_generators/hobo_rapid/templates/ie7-recalc.js +166 -2
- data/rails_generators/hobo_user_model/templates/model.rb +1 -3
- data/taglibs/rapid.dryml +2 -1
- data/taglibs/rapid_core.dryml +7 -5
- data/taglibs/rapid_editing.dryml +14 -10
- data/taglibs/rapid_forms.dryml +7 -5
- data/taglibs/rapid_generics.dryml +1 -1
- data/taglibs/rapid_lifecycles.dryml +3 -2
- data/taglibs/rapid_pages.dryml +1 -1
- data/taglibs/rapid_support.dryml +1 -1
- data/tasks/hobo_tasks.rake +10 -0
- metadata +7 -7
- data/lib/hobo/bundle.rb +0 -330
data/CHANGES.txt
CHANGED
@@ -4,12 +4,144 @@ Once you have installed a new version of Hobo, you may wish to run
|
|
4
4
|
|
5
5
|
rake hobo:run_standard_generators
|
6
6
|
|
7
|
+
or
|
8
|
+
|
9
|
+
rake hobo:run_invite_only_generators
|
10
|
+
|
7
11
|
This will run all of the standard generators, and pull in any bug
|
8
12
|
fixes or enhancements to generated code. Note that this is quite
|
9
13
|
likely to cause conflicts, so it is highly recommended that you have
|
10
14
|
your code backed up and in a change control system such as git or
|
11
15
|
subversion.
|
12
16
|
|
17
|
+
=== Hobo 0.9.100 (AKA 1.0.RC1) ===
|
18
|
+
|
19
|
+
Deletions:
|
20
|
+
|
21
|
+
- Children must now be specified in the viewhints. Hobo no longer
|
22
|
+
uses the presence of :dependent => :destroy to determine the
|
23
|
+
primary child association.
|
24
|
+
|
25
|
+
- The bundles feature of Hobo which never really worked and was
|
26
|
+
never documented has been removed from this release.
|
27
|
+
|
28
|
+
- The message "You must activate your account before you can log
|
29
|
+
in. Please check your email." which used to be added to the flash
|
30
|
+
message when a user has signed up has been removed from
|
31
|
+
`hobo_do_signup`.
|
32
|
+
|
33
|
+
- Github no longer updates its gem repository. The canonical source
|
34
|
+
for Mislav's will\_paginate, a Hobo dependency, is now
|
35
|
+
gemcutter.org. To add gemcutter.org to your gem source list:
|
36
|
+
|
37
|
+
$ gem install gemcutter
|
38
|
+
$ gem tumble
|
39
|
+
|
40
|
+
Note that `gem tumble` is a toggle, so if you've already added
|
41
|
+
`gemcutter` to your sources list, the above commands will have
|
42
|
+
removed it! Simply run `gem tumble` again to add it back in. In
|
43
|
+
fact, sometimes the first command does the tumble automatically, so
|
44
|
+
it's worth double checking.
|
45
|
+
|
46
|
+
- The fix for
|
47
|
+
[#556](https://hobo.lighthouseapp.com/projects/8324-hobo/tickets/556)
|
48
|
+
means that the migration generator now ignores all models that have
|
49
|
+
a `hobo_model` declaration but not a `fields` declaration. If you
|
50
|
+
have any models that do not have a fields declaration (join
|
51
|
+
tables, for example), you may wish to add a blank fields
|
52
|
+
declaration.
|
53
|
+
|
54
|
+
Major enhancements:
|
55
|
+
|
56
|
+
- Hobo now supports Ruby 1.9.1. Problems have been encountered with
|
57
|
+
Ruby 1.9.1 and Rails 2.3.4. Rails 2.3.3 and 2.3.5 work fine.
|
58
|
+
|
59
|
+
- Hobo has been tested against the new Rails 2.3.5. JRuby users may
|
60
|
+
encounter this bug:
|
61
|
+
https://rails.lighthouseapp.com/projects/8994/tickets/3497.
|
62
|
+
|
63
|
+
- Rails 2.2 is still supported for this release. Support for 2.2
|
64
|
+
may be dropped post-1.0.
|
65
|
+
|
66
|
+
- Translations (ie, the ht functions) has now been moved into its
|
67
|
+
own module. To access the translation functions from elsewhere
|
68
|
+
use `Hobo::Translations.ht`. Alternatively, including the
|
69
|
+
Hobo::Translations module into your class will give you `ht` as a
|
70
|
+
local instance method. (This is one of the things the
|
71
|
+
`hobo_controller` declaration does.)
|
72
|
+
|
73
|
+
- `rake hobo:run_invite_only_generators` was added as an alternative
|
74
|
+
to `rake hobo:run_standard_generators` for those who created their
|
75
|
+
application with the `--invite-only` flag
|
76
|
+
|
77
|
+
- [#409](https://hobo.lighthouseapp.com/projects/8324/tickets/409)
|
78
|
+
The `<editor>` tag has been modified to display the `to_s`
|
79
|
+
representation of the object while in edit mode. The `to_html`
|
80
|
+
representation is still used in view mode. The editor tag for
|
81
|
+
HTML columns has been modified to remove the heavy sanitizing that
|
82
|
+
was previously performed. HtmlString will sanitize before saving
|
83
|
+
to the database. You need to update your hobo-rapid.js for this
|
84
|
+
fix. Run `rake hobo:run_standard_generators` or copy the file
|
85
|
+
directly from
|
86
|
+
http://github.com/tablatom/hobo/blob/master/hobo/rails_generators/hobo_rapid/templates/hobo-rapid.js
|
87
|
+
|
88
|
+
- [#296](https://hobo.lighthouseapp.com/projects/8324/tickets/296)
|
89
|
+
The migration generator now fully understands HABTM join tables. Note that
|
90
|
+
the "decorated join table" functionality that was deprecated in Rails 2.3
|
91
|
+
is NOT supported.
|
92
|
+
|
93
|
+
- [#475](https://hobo.lighthouseapp.com/projects/8324-hobo/tickets/475)
|
94
|
+
User-defined rich types are now loaded from RAILS_ROOT/app/rich_types, if it exists.
|
95
|
+
|
96
|
+
- EnumString's can now be translated. The
|
97
|
+
[manual](http://cookbook.hobocentral.net/manual/hobofields/rich_types)
|
98
|
+
has been updated with the details.
|
99
|
+
|
100
|
+
- ViewHint's can now be translated. Well, they mostly could in 0.9,
|
101
|
+
but it has been cleaned up and [documented with
|
102
|
+
ViewHints](http://cookbook.hobocentral.net/manual/viewhints).
|
103
|
+
|
104
|
+
- Lifecycle states can now be translated. The key is
|
105
|
+
`#{table_name}.states.#{state}` Transitions use the key `#{table_name}.actions.#{transition}`
|
106
|
+
|
107
|
+
Major bug fixes:
|
108
|
+
|
109
|
+
- [#537](https://hobo.lighthouseapp.com/projects/8324-hobo/tickets/537)
|
110
|
+
The `._?.` "smart dot" now returns 'nil' rather than calling its
|
111
|
+
trailing function more often than it used to, more closely
|
112
|
+
matching its documentation.
|
113
|
+
|
114
|
+
- [#457](https://hobo.lighthouseapp.com/projects/8324-hobo/tickets/457)
|
115
|
+
ie7-recalc.js has been updated to improve compatibility with IE6.
|
116
|
+
Please update the copy inside of your application, either by
|
117
|
+
running `rake hobo:run_standard_generators` or by copying the file
|
118
|
+
directly from
|
119
|
+
http://github.com/tablatom/hobo/blob/master/hobo/rails_generators/hobo_rapid/templates/ie7-recalc.js
|
120
|
+
|
121
|
+
- [#512](https://hobo.lighthouseapp.com/projects/8324-hobo/tickets/512)
|
122
|
+
Hobo now has better compatibility with non-DRYML templates
|
123
|
+
|
124
|
+
Minor enhancements:
|
125
|
+
|
126
|
+
- [#554](https://hobo.lighthouseapp.com/projects/8324-hobo/tickets/554)
|
127
|
+
The transition-buttons tag no longer displays transitions that are
|
128
|
+
not `:available_to` the user.
|
129
|
+
|
130
|
+
- [#536](https://hobo.lighthouseapp.com/projects/8324-hobo/tickets/536)
|
131
|
+
documentation for field-list more closely matches reality
|
132
|
+
|
133
|
+
- [#536](https://hobo.lighthouseapp.com/projects/8324-hobo/tickets/543)
|
134
|
+
i18n has been silenced. It's messages can be made to reappear on
|
135
|
+
the log via HOBO_VERBOSE_TRANSLATIONS.
|
136
|
+
|
137
|
+
- [#555](https://hobo.lighthouseapp.com/projects/8324-hobo/tickets/555)
|
138
|
+
Specifying ignore_index :foo will ignore the index named 'foo' on the model
|
139
|
+
when generating migrations - handy for indexes that can't be generated
|
140
|
+
automatically (with a prefix length on MySQL, for instance) or existing
|
141
|
+
indexes in legacy tables.
|
142
|
+
|
143
|
+
Minor bug fixes:
|
144
|
+
|
13
145
|
=== Hobo 0.9.0 ===
|
14
146
|
|
15
147
|
Major enhancements:
|
data/Rakefile
CHANGED
@@ -9,7 +9,7 @@ $:.unshift File.join(File.expand_path(File.dirname(__FILE__)), '/../hobofields/l
|
|
9
9
|
$:.unshift File.join(File.expand_path(File.dirname(__FILE__)), '/../hobosupport/lib')
|
10
10
|
require 'hobo'
|
11
11
|
|
12
|
-
RUBY =
|
12
|
+
RUBY = File.join(Config::CONFIG['bindir'], Config::CONFIG['ruby_install_name']).sub(/.*\s.*/m, '"\&"')
|
13
13
|
RUBYDOCTEST = ENV['RUBYDOCTEST'] || "#{RUBY} `which rubydoctest`"
|
14
14
|
|
15
15
|
desc "Default Task"
|
@@ -47,25 +47,21 @@ end
|
|
47
47
|
|
48
48
|
# --- Packaging and Rubyforge & gemcutter & github--- #
|
49
49
|
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
rubyforge.doc_task = false
|
68
|
-
end
|
69
|
-
rescue LoadError
|
70
|
-
puts "Jeweler not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com"
|
50
|
+
require 'jeweler'
|
51
|
+
Jeweler::Tasks.new do |gemspec|
|
52
|
+
gemspec.version = Hobo::VERSION
|
53
|
+
gemspec.name = "hobo"
|
54
|
+
gemspec.email = "tom@tomlocke.com"
|
55
|
+
gemspec.summary = "The web app builder for Rails"
|
56
|
+
gemspec.homepage = "http://hobocentral.net/"
|
57
|
+
gemspec.authors = ["Tom Locke"]
|
58
|
+
gemspec.rubyforge_project = "hobo"
|
59
|
+
gemspec.add_dependency("rails", [">= 2.2.2"])
|
60
|
+
gemspec.add_dependency("will_paginate", [">= 2.3.11"])
|
61
|
+
gemspec.add_dependency("hobosupport", ["= #{Hobo::VERSION}"])
|
62
|
+
gemspec.add_dependency("hobofields", ["= #{Hobo::VERSION}"])
|
63
|
+
end
|
64
|
+
Jeweler::GemcutterTasks.new
|
65
|
+
Jeweler::RubyforgeTasks.new do |rubyforge|
|
66
|
+
rubyforge.doc_task = false
|
71
67
|
end
|
data/bin/hobo
CHANGED
@@ -3,6 +3,9 @@
|
|
3
3
|
require 'fileutils'
|
4
4
|
require 'pathname'
|
5
5
|
require 'activesupport'
|
6
|
+
require 'rbconfig'
|
7
|
+
|
8
|
+
RUBY = File.join(Config::CONFIG['bindir'], Config::CONFIG['ruby_install_name']).sub(/.*\s.*/m, '"\&"')
|
6
9
|
|
7
10
|
Signal.trap("INT") { puts; exit }
|
8
11
|
|
@@ -22,8 +25,6 @@ Options:
|
|
22
25
|
|
23
26
|
|
24
27
|
### Nasty stuff needed for Windows :-( ###
|
25
|
-
require 'rbconfig'
|
26
|
-
|
27
28
|
if Config::CONFIG["arch"] =~ /win32/
|
28
29
|
require "win32/registry"
|
29
30
|
def system(command)
|
@@ -43,7 +44,7 @@ end
|
|
43
44
|
user_model = "user"
|
44
45
|
create_db = false
|
45
46
|
run_rails = true
|
46
|
-
|
47
|
+
invite_only = ""
|
47
48
|
|
48
49
|
while true
|
49
50
|
case arg_name = ARGV.shift
|
@@ -62,7 +63,7 @@ while true
|
|
62
63
|
when "-n", "--no-rails"
|
63
64
|
run_rails = false
|
64
65
|
when "--invite-only"
|
65
|
-
|
66
|
+
invite_only = "--invite-only"
|
66
67
|
when "--help"
|
67
68
|
puts USAGE
|
68
69
|
exit
|
@@ -93,12 +94,12 @@ if run_rails
|
|
93
94
|
# end
|
94
95
|
end
|
95
96
|
opts << "-d #{database_type}" if database_type
|
96
|
-
system("rails #{opts * ' '} #{app_path}")
|
97
|
+
system("#{RUBY} -S rails #{opts * ' '} #{app_path}")
|
97
98
|
end
|
98
99
|
|
99
100
|
Dir.chdir(app_path) do
|
100
|
-
gen = "
|
101
|
-
plugin = "
|
101
|
+
gen = "#{RUBY} #{File.join('script', 'generate')}"
|
102
|
+
plugin = "#{RUBY} #{File.join('script', 'plugin')}"
|
102
103
|
|
103
104
|
FileUtils.touch("public/stylesheets/application.css")
|
104
105
|
|
@@ -106,24 +107,24 @@ Dir.chdir(app_path) do
|
|
106
107
|
command(gen, "hobo --add-gem --add-routes")
|
107
108
|
|
108
109
|
puts "\nInstalling Hobo Rapid and default theme...\n"
|
109
|
-
command("#{gen} hobo_rapid --import-tags #{
|
110
|
+
command("#{gen} hobo_rapid --import-tags #{invite_only}")
|
110
111
|
|
111
112
|
if user_model
|
112
113
|
puts "\nCreating #{user_model} model and controller...\n"
|
113
|
-
command("#{gen} hobo_user_model #{user_model} #{
|
114
|
-
command("#{gen} hobo_user_controller #{user_model} #{
|
114
|
+
command("#{gen} hobo_user_model #{user_model} #{invite_only}")
|
115
|
+
command("#{gen} hobo_user_controller #{user_model} #{invite_only}")
|
115
116
|
end
|
116
117
|
|
117
118
|
puts "\nCreating standard pages...\n"
|
118
|
-
command("#{gen} hobo_front_controller front --delete-index --add-routes #{
|
119
|
+
command("#{gen} hobo_front_controller front --delete-index --add-routes #{invite_only}")
|
119
120
|
|
120
121
|
if create_db
|
121
122
|
puts "\nCreating databases"
|
122
|
-
command("rake db:create:all")
|
123
|
+
command("#{RUBY} -S rake db:create:all")
|
123
124
|
end
|
124
125
|
end
|
125
126
|
|
126
|
-
if
|
127
|
+
if invite_only.present?
|
127
128
|
puts %(
|
128
129
|
Invite-only website
|
129
130
|
If you wish to prevent all access to the site to non-members, add 'before_filter :login_required'
|
data/doctest/scopes.rdoctest
CHANGED
@@ -4,7 +4,7 @@ form_fields = standard_fields :belongs_to, :has_many
|
|
4
4
|
|
5
5
|
cancel_to_show_page = linkable?(:show)
|
6
6
|
cancel_to_index_page = !cancel_to_index_page && linkable?(:index)
|
7
|
-
model_key =
|
7
|
+
model_key = model.name.tableize
|
8
8
|
-%>
|
9
9
|
<def tag="form" for="<%= model.name %>">
|
10
10
|
<form merge param="default">
|
@@ -4,7 +4,7 @@
|
|
4
4
|
<navigation class="main-nav" merge-attrs param="default">
|
5
5
|
<nav-item href="#{base_url}/">Home</nav-item>
|
6
6
|
<% models.select { |m| linkable?(m, :index) }[0..4].each do |m| -%>
|
7
|
-
<nav-item with="&<%= m.name %>"><%= m.view_hints.
|
7
|
+
<nav-item with="&<%= m.name %>"><ht key="#{model.name.tableize}.nav_item"><%= m.view_hints.model_name_plural %></ht></nav-item>
|
8
8
|
<% end -%>
|
9
9
|
</navigation>
|
10
10
|
</def>
|
@@ -17,18 +17,18 @@
|
|
17
17
|
<%
|
18
18
|
new_link = linkable?(:new)
|
19
19
|
new_form = !new_link && linkable?(model, :create, :method => :post)
|
20
|
-
model_key =
|
20
|
+
model_key = model.name.tableize
|
21
21
|
-%>
|
22
22
|
|
23
23
|
<def tag="index-page" for="<%= model.name %>">
|
24
|
-
<page merge title="#{ht '<%= model_key %>.index.title', :default=>['<%= model_name :
|
24
|
+
<page merge title="#{ht '<%= model_key %>.index.title', :default=>['<%= model_name :plural %>'] }">
|
25
25
|
<body: class="index-page <%= model_class %>" param/>
|
26
26
|
|
27
27
|
<content: param>
|
28
28
|
<header param="content-header">
|
29
29
|
<h2 param="heading">
|
30
30
|
<ht key="<%= model_key %>.index.heading">
|
31
|
-
<%= model_name :
|
31
|
+
<%= model_name :plural %>
|
32
32
|
</ht>
|
33
33
|
</h2>
|
34
34
|
|
@@ -42,7 +42,7 @@ model_key = model_name.pluralize.underscore
|
|
42
42
|
<section param="content-body">
|
43
43
|
<% if new_link -%>
|
44
44
|
<a action="new" to="&model" param="new-link">
|
45
|
-
<ht key="<%= model_key %>.actions.new">New <%=model_name
|
45
|
+
<ht key="<%= model_key %>.actions.new">New <%=model_name %></ht>
|
46
46
|
</a>
|
47
47
|
<% end -%>
|
48
48
|
|
@@ -64,7 +64,7 @@ model_key = model_name.pluralize.underscore
|
|
64
64
|
<% if new_form -%>
|
65
65
|
<div param="new-form">
|
66
66
|
<h3 param="new-form-heading">
|
67
|
-
<ht key="<%= model_key %>.form.new.heading">New <%= model_name
|
67
|
+
<ht key="<%= model_key %>.form.new.heading">New <%= model_name %></ht>
|
68
68
|
</h3>
|
69
69
|
<form with="&@invalid_record || new_for_current_user(<%= model %>)" param/>
|
70
70
|
</div>
|
@@ -77,21 +77,21 @@ model_key = model_name.pluralize.underscore
|
|
77
77
|
|
78
78
|
|
79
79
|
<def tag="new-page" for="<%= model.name %>">
|
80
|
-
<page merge title="#{ht '<%= model_key %>.new.title', :default=>['New <%=model_name
|
80
|
+
<page merge title="#{ht '<%= model_key %>.new.title', :default=>['New <%=model_name %>'] }">
|
81
81
|
<body: class="new-page <%= model_class %>" param/>
|
82
82
|
|
83
83
|
<content: param>
|
84
84
|
<section param="content-header">
|
85
85
|
<h2 param="heading">
|
86
86
|
<ht key="<%= model_key %>.new.heading">
|
87
|
-
New <%= model_name
|
87
|
+
New <%= model_name %>
|
88
88
|
</ht>
|
89
89
|
</h2>
|
90
90
|
</section>
|
91
91
|
|
92
92
|
<section param="content-body">
|
93
93
|
<form param>
|
94
|
-
<submit: label="#{ht '<%= model_key %>.actions.create', :default=>['Create <%= model_name
|
94
|
+
<submit: label="#{ht '<%= model_key %>.actions.create', :default=>['Create <%= model_name %>']}"/>
|
95
95
|
</form>
|
96
96
|
</section>
|
97
97
|
</content:>
|
@@ -100,7 +100,7 @@ model_key = model_name.pluralize.underscore
|
|
100
100
|
|
101
101
|
|
102
102
|
<%
|
103
|
-
back_link = model.
|
103
|
+
back_link = model.view_hints.parent
|
104
104
|
boolean_fields = model.columns.select { |c| c.type == :boolean }.*.name - model.view_hints.inline_booleans
|
105
105
|
creator = model.creator_attribute
|
106
106
|
creator_link = creator && model.reflections[creator] && linkable?(model.reflections[creator].klass, :show)
|
@@ -126,7 +126,7 @@ unless model.view_hints.secondary_children.empty?
|
|
126
126
|
end
|
127
127
|
-%>
|
128
128
|
<def tag="show-page" for="<%= model.name %>">
|
129
|
-
<page merge title="#{ht '<%=model_key %>.show.title', :default=>['<%=model_name
|
129
|
+
<page merge title="#{ht '<%=model_key %>.show.title', :default=>['<%=model_name %>'] }">
|
130
130
|
|
131
131
|
<body: class="show-page <%= model_class %>" param/>
|
132
132
|
|
@@ -159,7 +159,7 @@ end
|
|
159
159
|
|
160
160
|
<a action="edit" if="&can_edit?" param="edit-link">
|
161
161
|
<ht key="<%= model_key %>.actions.edit" name="&this.respond_to?(:name) ? this.name : ''">
|
162
|
-
Edit <%= model_name
|
162
|
+
Edit <%= model_name %>
|
163
163
|
</ht>
|
164
164
|
</a>
|
165
165
|
<% end -%>
|
@@ -187,20 +187,20 @@ end
|
|
187
187
|
<% end -%>
|
188
188
|
<% if add_link -%>
|
189
189
|
|
190
|
-
<a:<%= collection %> action="new" if="&can_create?(@<%=
|
190
|
+
<a:<%= collection %> action="new" if="&can_create?(@<%= model.name.underscore %>.<%= collection %>)" param="new-link">
|
191
191
|
<ht key="<%= collection.to_s.pluralize %>.actions.new">
|
192
192
|
New <%= collection.to_s.singularize.titleize %>
|
193
193
|
</ht>
|
194
194
|
</a:<%= collection %>>
|
195
195
|
<% elsif add_form -%>
|
196
196
|
|
197
|
-
<section param="add-to-collection" if="&can_create?(@<%=
|
197
|
+
<section param="add-to-collection" if="&can_create?(@<%= model.name.underscore %>.<%= collection %>)">
|
198
198
|
<h3 param="add-form-heading">
|
199
199
|
<ht key="<%= collection.to_s.pluralize %>.collection.add_form_heading">
|
200
200
|
Add <%= a_or_an collection.to_s.singularize.titleize %>
|
201
201
|
</ht>
|
202
202
|
</h3>
|
203
|
-
<form with="&@<%= collection_class.name.underscore %> || new_for_current_user(@<%=
|
203
|
+
<form with="&@<%= collection_class.name.underscore %> || new_for_current_user(@<%= model.name.underscore %>.<%= collection %>)" owner="<%= owner %>" without-cancel param>
|
204
204
|
<field-list: skip="<%= owner %>"/>
|
205
205
|
<submit: label="#{ht '<%= collection.to_s.pluralize %>.actions.add', :default=>['Add'] }"/>
|
206
206
|
</form>
|
@@ -219,7 +219,7 @@ end
|
|
219
219
|
<% if is_user_model -%>
|
220
220
|
<heading:>
|
221
221
|
<ht key="hobo.undefined">
|
222
|
-
<Your with="&@<%=
|
222
|
+
<Your with="&@<%= model.name.underscore %>"/> <%= refl.name.to_s.titleize %>
|
223
223
|
</ht>
|
224
224
|
</heading:>
|
225
225
|
<% end -%>
|
@@ -251,7 +251,7 @@ end
|
|
251
251
|
name_attribute = model.name_attribute
|
252
252
|
-%>
|
253
253
|
<def tag="edit-page" for="<%= model.name %>">
|
254
|
-
<page merge title="#{ht '<%= model_key %>.edit.title', :default=>['Edit <%=model_name
|
254
|
+
<page merge title="#{ht '<%= model_key %>.edit.title', :default=>['Edit <%=model_name %>'] }">
|
255
255
|
|
256
256
|
<body: class="edit-page <%= model_class %>" param/>
|
257
257
|
|
@@ -262,7 +262,7 @@ name_attribute = model.name_attribute
|
|
262
262
|
Edit <type-name/>
|
263
263
|
</ht>
|
264
264
|
</h2>
|
265
|
-
<delete-button label="#{ht '<%= model_key %>.actions.delete', :default=>['Remove This <%= model_name
|
265
|
+
<delete-button label="#{ht '<%= model_key %>.actions.delete', :default=>['Remove This <%= model_name %>']}" param/>
|
266
266
|
</section>
|
267
267
|
|
268
268
|
<section param="content-body">
|
@@ -290,7 +290,7 @@ new_link = :new.in?(actions)
|
|
290
290
|
-%>
|
291
291
|
<def tag="index-for-<%= owner.dasherize %>-page" polymorphic/>
|
292
292
|
<def tag="index-for-<%= owner.dasherize %>-page" for="<%= model.name %>">
|
293
|
-
<page merge title="#{ht '<%= model_key %>.index_for_owner.title', :default=>['<%=model_name :
|
293
|
+
<page merge title="#{ht '<%= model_key %>.index_for_owner.title', :default=>['<%=model_name :plural %> for']} #{name :with => @<%= owner %>, :no_wrapper => true}">
|
294
294
|
<body: class="index-for-owner-page <%= owner.dasherize %> <%= model_class %>" param/>
|
295
295
|
<content: param>
|
296
296
|
<header param="content-header">
|
@@ -302,13 +302,13 @@ new_link = :new.in?(actions)
|
|
302
302
|
<% if owner_is_user %>
|
303
303
|
<h2 param="heading">
|
304
304
|
<ht key="<%= model_key %>.index_for_owner.heading.your">
|
305
|
-
<Your with="&@<%= owner %>"/> <%= model_name :
|
305
|
+
<Your with="&@<%= owner %>"/> <%= model_name :plural %>
|
306
306
|
</ht>
|
307
307
|
</h2>
|
308
308
|
<% else -%>
|
309
309
|
<h2 param="heading">
|
310
310
|
<ht key="<%= model_key %>.index_for_owner.heading.other">
|
311
|
-
<%= model_name :
|
311
|
+
<%= model_name :plural %>
|
312
312
|
</ht>
|
313
313
|
</h2>
|
314
314
|
<h3 param="subheading">
|
@@ -328,7 +328,7 @@ new_link = :new.in?(actions)
|
|
328
328
|
<section param="content-body">
|
329
329
|
<% if new_link -%>
|
330
330
|
<a action="new" to="&model" param="new-link">
|
331
|
-
<ht key="<%= model_key %>.actions.new" >New <%=model_name
|
331
|
+
<ht key="<%= model_key %>.actions.new" >New <%=model_name %></ht>
|
332
332
|
</a>
|
333
333
|
|
334
334
|
<% end -%>
|
@@ -348,7 +348,7 @@ new_link = :new.in?(actions)
|
|
348
348
|
<% if :new.in? actions -%>
|
349
349
|
<def tag="new-for-<%= owner.dasherize %>-page" polymorphic/>
|
350
350
|
<def tag="new-for-<%= owner.dasherize %>-page" for="<%= model.name %>">
|
351
|
-
<page merge title="#{ht '<%=model_key %>.new_for_owner.title', :default=>['New <%=model_name
|
351
|
+
<page merge title="#{ht '<%=model_key %>.new_for_owner.title', :default=>['New <%=model_name %> for']} #{name :with => @<%= owner %>}">
|
352
352
|
<body: class="new-for-owner-page <% owner.dasherize %> <%= model_class %>" param/>
|
353
353
|
|
354
354
|
<content: param>
|
@@ -369,7 +369,7 @@ new_link = :new.in?(actions)
|
|
369
369
|
<section param="content-body">
|
370
370
|
<form owner="<%= owner %>" method="post" param>
|
371
371
|
<field-list: skip="<%= owner %>"/>
|
372
|
-
<submit: label="#{ht '<%=model_key %>.actions.create', :default=>['Create <%= model_name
|
372
|
+
<submit: label="#{ht '<%=model_key %>.actions.create', :default=>['Create <%= model_name %>']}"/>
|
373
373
|
</form>
|
374
374
|
</section>
|
375
375
|
</content:>
|