hobo 0.8.10 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES.txt +126 -2
- data/Rakefile +4 -1
- data/bin/hobo +1 -1
- data/doctest/scopes.rdoctest +11 -4
- data/dryml_generators/rapid/cards.dryml.erb +8 -2
- data/dryml_generators/rapid/forms.dryml.erb +5 -4
- data/dryml_generators/rapid/pages.dryml.erb +150 -65
- data/lib/hobo.rb +1 -1
- data/lib/hobo/accessible_associations.rb +2 -0
- data/lib/hobo/authentication_support.rb +1 -1
- data/lib/hobo/controller.rb +11 -3
- data/lib/hobo/dryml/dryml_doc.rb +1 -1
- data/lib/hobo/fake_initializer.rb +14 -0
- data/lib/hobo/hobo_helper.rb +94 -6
- data/lib/hobo/lifecycles.rb +17 -2
- data/lib/hobo/lifecycles/lifecycle.rb +1 -1
- data/lib/hobo/lifecycles/transition.rb +12 -4
- data/lib/hobo/model.rb +25 -22
- data/lib/hobo/model_controller.rb +42 -37
- data/lib/hobo/model_router.rb +11 -7
- data/lib/hobo/permissions.rb +12 -10
- data/lib/hobo/permissions/associations.rb +1 -1
- data/lib/hobo/static_tags +21 -0
- data/lib/hobo/user.rb +7 -3
- data/lib/hobo/user_controller.rb +7 -7
- data/lib/hobo/view_hints.rb +10 -3
- data/rails_generators/hobo/USAGE +4 -0
- data/rails_generators/hobo_admin_site/USAGE +16 -0
- data/rails_generators/hobo_front_controller/hobo_front_controller_generator.rb +11 -2
- data/rails_generators/hobo_front_controller/templates/controller.rb +6 -0
- data/rails_generators/hobo_front_controller/templates/summary.dryml +103 -0
- data/rails_generators/hobo_model_resource/USAGE +38 -0
- data/rails_generators/hobo_rapid/USAGE +3 -0
- data/rails_generators/hobo_rapid/templates/hobo-rapid.js +7 -3
- data/rails_generators/hobo_rapid/templates/themes/clean/public/stylesheets/clean.css +4 -0
- data/rails_generators/hobo_rapid/templates/themes/clean/public/stylesheets/rapid-ui.css +5 -0
- data/rails_generators/hobo_subsite/USAGE +16 -0
- data/rails_generators/hobo_subsite/hobo_subsite_generator.rb +1 -1
- data/rails_generators/hobo_user_controller/templates/controller.rb +2 -2
- data/rails_generators/hobo_user_model/templates/model.rb +6 -1
- data/taglibs/rapid.dryml +1 -0
- data/taglibs/rapid_core.dryml +4 -4
- data/taglibs/rapid_forms.dryml +29 -21
- data/taglibs/rapid_generics.dryml +3 -1
- data/taglibs/rapid_lifecycles.dryml +14 -9
- data/taglibs/rapid_navigation.dryml +1 -1
- data/taglibs/rapid_plus.dryml +1 -0
- data/taglibs/rapid_summary.dryml +300 -0
- data/taglibs/rapid_support.dryml +1 -1
- data/taglibs/rapid_user_pages.dryml +21 -19
- data/test/permissions/test_permissions.rb +1 -1
- metadata +12 -4
data/CHANGES.txt
CHANGED
@@ -1,4 +1,128 @@
|
|
1
|
-
=== Hobo
|
1
|
+
=== Upgrading to a new version of Hobo ===
|
2
|
+
|
3
|
+
Once you have installed a new version of Hobo, you may wish to run
|
4
|
+
|
5
|
+
rake hobo:run_standard_generators
|
6
|
+
|
7
|
+
This will run all of the standard generators, and pull in any bug
|
8
|
+
fixes or enhancements to generated code. Note that this is quite
|
9
|
+
likely to cause conflicts, so it is highly recommended that you have
|
10
|
+
your code backed up and in a change control system such as git or
|
11
|
+
subversion.
|
12
|
+
|
13
|
+
=== Hobo 0.9.0 ===
|
14
|
+
|
15
|
+
Major enhancements:
|
16
|
+
|
17
|
+
- Internationalization! Through the hard work of soey and Spiralis,
|
18
|
+
we now have internationalization support in Hobo. The manual
|
19
|
+
page is on the
|
20
|
+
[cookbook](http://cookbook.hobocentral.net/manual/i18n). Locales
|
21
|
+
are available on
|
22
|
+
[github](http://github.com/Spiralis/hobo-i18n-locales).
|
23
|
+
|
24
|
+
- Index generation: Matt Jones' automatic index generation code has
|
25
|
+
been merged. The default Rails index names are very long, so this
|
26
|
+
is unlikely to work well on Oracle, which has a 30 character
|
27
|
+
limit. Testing against Postgres, Oracle, SQL Server and JDBC has
|
28
|
+
been extremely limited. To generate indices run script/generate
|
29
|
+
hobo_migration.
|
30
|
+
|
31
|
+
- New projects now have a summary page on /front/summary that
|
32
|
+
provides application information to the administrator. Current
|
33
|
+
projects may add this action by running the
|
34
|
+
`hobo_front_controller` generator.
|
35
|
+
|
36
|
+
- STI derived classes can add additional fields to their parent
|
37
|
+
class with the fields block. Note that the "can't generate a
|
38
|
+
migration for STI base and derived classes all at once" issue
|
39
|
+
still applies. In general, STI handling should now work much
|
40
|
+
better.
|
41
|
+
|
42
|
+
- [Bug 464](https://hobo.lighthouseapp.com/projects/8324/tickets/464-transition-buttons-should-have-a-option-to-link-to-forms-instead-for-transitions-that-take-parameters)
|
43
|
+
The transition-buttons tag now generates buttons that link to the
|
44
|
+
transition page for transitions that require parameters.
|
45
|
+
|
46
|
+
- [Bug 532](https://hobo.lighthouseapp.com/projects/8324/tickets/532)
|
47
|
+
In previous versions, you had to add the new HTML5 tags to
|
48
|
+
RAILS_ROOT/config/dryml_static_tags.txt. This version whitelists
|
49
|
+
all HTML5 tags except for aside, section, header and footer, which
|
50
|
+
conflict with existing Rapid tags.
|
51
|
+
|
52
|
+
Major bug fixes:
|
53
|
+
|
54
|
+
- [Bug 530](https://hobo.lighthouseapp.com/projects/8324-hobo/tickets/530)
|
55
|
+
is a critical bug for invite-only projects. To incorporate the
|
56
|
+
fix, you must rerun your generators or follow the instructions in
|
57
|
+
the [commit](http://github.com/tablatom/hobo/commit/17247eac8a78f8b36dcc3b9684a3e4ec8da32a23)
|
58
|
+
|
59
|
+
- [Bug
|
60
|
+
480](https://hobo.lighthouseapp.com/projects/8324/tickets/480-find_owner_and_association-method-for-has_many-associations)
|
61
|
+
Owner actions now work with has_many associations
|
62
|
+
|
63
|
+
- [Bug 516](https://hobo.lighthouseapp.com/projects/8324/tickets/516-association-name-as-parameter-in-lifecycle-step-almost-works)
|
64
|
+
Specifying a belongs_to association as a lifecycle param works; it appears as a select-one on the generated page.
|
65
|
+
|
66
|
+
- [Bug 515](https://hobo.lighthouseapp.com/projects/8324/tickets/515-virtual-boolean-field-uninitialized-constant-hobobooleancolumn_type)
|
67
|
+
Virtual :boolean fields declared with attr_accessor now work
|
68
|
+
|
69
|
+
- [Bug 484](https://hobo.lighthouseapp.com/projects/8324/tickets/484-transition-actions-with-key-fail-if-model-isnt-visible-to-guests)
|
70
|
+
Transition actions that require a key no longer check if the model is visible to Guest
|
71
|
+
|
72
|
+
- [Bug 485](https://hobo.lighthouseapp.com/projects/8324/tickets/485-make-lifecycles-on-sti-subclasses-behave)
|
73
|
+
Lifecycle support on STI models works now. Note that derived classes DO NOT inherit any of the parent lifecycle implementation.
|
74
|
+
|
75
|
+
- [Bug 387](https://hobo.lighthouseapp.com/projects/8324/tickets/387-inheritance-sti-models-name-not-propagating)
|
76
|
+
STI derived classes now inherit settings like name_attribute correctly.
|
77
|
+
|
78
|
+
- [Bug 533](https://hobo.lighthouseapp.com/projects/8324/tickets/533-remove-id-from-hidden-field-for-check-box)
|
79
|
+
The hidden field generated with a checkbox input shouldn't have an ID.
|
80
|
+
|
81
|
+
- [Bug 526](https://hobo.lighthouseapp.com/projects/8324/tickets/526-routing-error-does-not-render-not-found-page)
|
82
|
+
Routing errors now render not-found-page, rather than the default Rails routing error message.
|
83
|
+
|
84
|
+
Minor Enhancements:
|
85
|
+
|
86
|
+
- Aside collections now have a new-link at the bottom (inside the
|
87
|
+
preview-with-more)
|
88
|
+
[#421](https://hobo.lighthouseapp.com/projects/8324/tickets/421-auto_actions_for-doesnt-create-add-button-in-sidebar)
|
89
|
+
|
90
|
+
- the manual now includes a Generators section, and a subsite
|
91
|
+
tutorial has been added.
|
92
|
+
|
93
|
+
- [Bug
|
94
|
+
386](https://hobo.lighthouseapp.com/projects/8324-hobo/tickets/386)
|
95
|
+
and [Bug
|
96
|
+
501](https://hobo.lighthouseapp.com/projects/8324-hobo/tickets/501)
|
97
|
+
have been fixed, reducing the number of extraneous migrations that
|
98
|
+
the hobo_migration generator creates. These are actually Rails
|
99
|
+
and/or database bugs we're working around. For instance, MySQL
|
100
|
+
does not allow default values for text columns, so Rails silently
|
101
|
+
ignores them. SQLite does not allow scale or precision settings on
|
102
|
+
decimal fields. These types of bugs are good reasons why you
|
103
|
+
should use the same type of database for development, testing and
|
104
|
+
production.
|
105
|
+
|
106
|
+
- A new view_hint, 'inline_booleans', controls whether boolean attributes are displayed in the header (default behavior
|
107
|
+
of Rapid show pages) or inline with the rest of the field-list. You can either pass a list of field names, or 'true'
|
108
|
+
(without quotes) to make all booleans inline.
|
109
|
+
|
110
|
+
- hobo_show now accepts a model instance as a first parameter. This restores symmetry with the other hobo_* actions.
|
111
|
+
|
112
|
+
- on Rails 2.3 and above, routes will be generated with the optional .:format suffix, and the formatted_* routes are skipped.
|
113
|
+
|
114
|
+
- non-required fields that are marked :unique will now allow nil
|
115
|
+
values.
|
116
|
+
|
117
|
+
Minor Bug Fixes
|
118
|
+
|
119
|
+
- [Bug 540](https://hobo.lighthouseapp.com/projects/8324-hobo/tickets/540)
|
120
|
+
Hobo::Permissions::Associations::HasManyThroughAssociations#create!
|
121
|
+
did not save as the "!" implied.
|
122
|
+
|
123
|
+
See the [github log](http://github.com/bryanlarsen/hobo/commits/v0.9.0)
|
124
|
+
|
125
|
+
=== Hobo 0.8.10 ===
|
2
126
|
|
3
127
|
This is a brown paper bag release. The fix for Bug 473 was not
|
4
128
|
properly tested. Thanks Iain Beeston for quickly sending us a patch.
|
@@ -35,7 +159,7 @@ Major bug fixes:
|
|
35
159
|
|
36
160
|
Minor bug fixes and enhancements:
|
37
161
|
|
38
|
-
See the [github log](http://github.com/bryanlarsen/hobo/commits/v0.8.
|
162
|
+
See the [github log](http://github.com/bryanlarsen/hobo/commits/v0.8.9)
|
39
163
|
|
40
164
|
=== Hobo 0.8.8 ===
|
41
165
|
|
data/Rakefile
CHANGED
@@ -9,6 +9,9 @@ $:.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 = ENV['RUBY'] || (defined?(JRUBY_VERSION) ? 'jruby' : 'ruby')
|
13
|
+
RUBYDOCTEST = ENV['RUBYDOCTEST'] || "#{RUBY} `which rubydoctest`"
|
14
|
+
|
12
15
|
desc "Default Task"
|
13
16
|
task :default => [ :test ]
|
14
17
|
|
@@ -26,7 +29,7 @@ namespace "test" do
|
|
26
29
|
desc "Run the doctests"
|
27
30
|
task :doctest do |t|
|
28
31
|
# note, tests in doctest/hobo/ are out of date
|
29
|
-
exit(1) if !system("
|
32
|
+
exit(1) if !system("#{RUBYDOCTEST} doctest/*.rdoctest")
|
30
33
|
end
|
31
34
|
end
|
32
35
|
|
data/bin/hobo
CHANGED
@@ -17,7 +17,7 @@ Options:
|
|
17
17
|
-d | --database <database> # e.g. mysql, sqlite
|
18
18
|
-r | --rails <version> # rails version to use
|
19
19
|
-n | --no-rails # don't run 'rails'. Assumes app-path=='.'
|
20
|
-
--invite-only # add features for an invite-
|
20
|
+
--invite-only # add features for an invite-only website (admin site, no signup)
|
21
21
|
"
|
22
22
|
|
23
23
|
|
data/doctest/scopes.rdoctest
CHANGED
@@ -50,12 +50,17 @@ First off we need to configure ActiveSupport for auto-loading
|
|
50
50
|
We also need to get ActiveRecord set up with a database connection
|
51
51
|
{.hidden}
|
52
52
|
|
53
|
+
>> mysql_adapter = defined?(JRUBY_VERSION) ? 'jdbcmysql' : 'mysql'
|
54
|
+
>> mysql_user = 'root'; mysql_password = ''
|
55
|
+
>> mysql_login = "-u #{mysql_user} --password='#{mysql_password}'"
|
53
56
|
>> mysql_database = "hobofields_doctest"
|
54
|
-
>> system "mysqladmin --force drop #{mysql_database} 2> /dev/null"
|
55
|
-
>> system("mysqladmin create #{mysql_database}") or raise "could not create database"
|
56
|
-
>> ActiveRecord::Base.establish_connection(:adapter =>
|
57
|
+
>> system "mysqladmin #{mysql_login} --force drop #{mysql_database} 2> /dev/null"
|
58
|
+
>> system("mysqladmin #{mysql_login} create #{mysql_database}") or raise "could not create database"
|
59
|
+
>> ActiveRecord::Base.establish_connection(:adapter => mysql_adapter,
|
57
60
|
:database => mysql_database,
|
58
|
-
:host => "localhost"
|
61
|
+
:host => "localhost",
|
62
|
+
:username => mysql_user,
|
63
|
+
:password => mysql_password)
|
59
64
|
{.hidden}
|
60
65
|
|
61
66
|
Some load path manipulation:
|
@@ -69,6 +74,8 @@ Some load path manipulation:
|
|
69
74
|
And we'll require hobo:
|
70
75
|
{.hidden}
|
71
76
|
|
77
|
+
>> require 'will_paginate'
|
78
|
+
>> require 'will_paginate/finder'
|
72
79
|
>> require 'hobosupport'
|
73
80
|
>> require 'hobofields'
|
74
81
|
>> require 'hobo'
|
@@ -18,6 +18,8 @@ has_actions = edit_link || delete_button
|
|
18
18
|
has_body = (!show_link && description_attribute) || creator_link || creator_attribute || primary_collection
|
19
19
|
|
20
20
|
show_title = !show_link && (name_attribute || !has_body)
|
21
|
+
|
22
|
+
model_key = model.name.pluralize.underscore
|
21
23
|
-%>
|
22
24
|
<def tag="card" for="<%= model.name %>">
|
23
25
|
<card class="<%= model_name :dashed %>" param="default" merge>
|
@@ -29,7 +31,9 @@ show_title = !show_link && (name_attribute || !has_body)
|
|
29
31
|
<% if has_actions -%>
|
30
32
|
<div param="actions">
|
31
33
|
<% if edit_link -%>
|
32
|
-
<a action="edit" if="&can_edit?" param="edit-link">
|
34
|
+
<a action="edit" if="&can_edit?" param="edit-link">
|
35
|
+
<ht key="<%= model_key %>.actions.edit">Edit</ht>
|
36
|
+
</a>
|
33
37
|
<% end -%>
|
34
38
|
<% if delete_button -%>
|
35
39
|
<delete-button label="X" param/>
|
@@ -49,7 +53,9 @@ show_title = !show_link && (name_attribute || !has_body)
|
|
49
53
|
<view:<%= creator_attribute %> param="creator"/>
|
50
54
|
<% end -%>
|
51
55
|
<% if primary_collection -%>
|
52
|
-
<count
|
56
|
+
<ht key="<%= primary_collection.to_s.pluralize.underscore %>.collection.count" count="&this.<%= primary_collection %>.size">
|
57
|
+
<count:<%= primary_collection%> param/>
|
58
|
+
</ht>
|
53
59
|
<% end -%>
|
54
60
|
</body:>
|
55
61
|
<% end -%>
|
@@ -4,13 +4,14 @@ 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 = model_name.pluralize.underscore
|
7
8
|
-%>
|
8
9
|
<def tag="form" for="<%= model.name %>">
|
9
10
|
<form merge param="default">
|
10
11
|
<error-messages param/>
|
11
12
|
<field-list fields="<%= form_fields * ', ' %>" param/>
|
12
13
|
<div param="actions">
|
13
|
-
<submit label="Save" param/><or-cancel param="cancel"/>
|
14
|
+
<submit label="#{ht '<%= model_key %>.actions.save', :default=>['Save']}" param/><or-cancel param="cancel"/>
|
14
15
|
</div>
|
15
16
|
</form>
|
16
17
|
</def>
|
@@ -22,7 +23,7 @@ cancel_to_index_page = !cancel_to_index_page && linkable?(:index)
|
|
22
23
|
<error-messages param/>
|
23
24
|
<field-list fields="<%= creator.parameters * ', ' %>" param/>
|
24
25
|
<div param="actions">
|
25
|
-
<submit label="<%= creator.name.to_s.titleize %>" param/><or-cancel param="cancel"/>
|
26
|
+
<submit label="#{ht '<%= model_key %>.actions.<%= creator.name.to_s %>', :default=>['<%= creator.name.to_s.titleize %>']}" param/><or-cancel param="cancel"/>
|
26
27
|
</div>
|
27
28
|
</form>
|
28
29
|
</def>
|
@@ -36,10 +37,10 @@ cancel_to_index_page = !cancel_to_index_page && linkable?(:index)
|
|
36
37
|
<input type="hidden" name="key" value="&this.lifecycle.provided_key" if="&this.lifecycle.provided_key"/>
|
37
38
|
<field-list fields="<%= transition.parameters * ', ' %>" param/>
|
38
39
|
<div param="actions">
|
39
|
-
<submit label="<%= transition.name.to_s.titleize %>" param/><or-cancel param="cancel"/>
|
40
|
+
<submit label="#{ht '<%= model_key %>.actions.<%= transition.name.to_s %>', :default=>['<%= transition.name.to_s.titleize %>']}" param/><or-cancel param="cancel"/>
|
40
41
|
</div>
|
41
42
|
</form>
|
42
43
|
</def>
|
43
44
|
<% end -%>
|
44
45
|
|
45
|
-
<% end # of each_model do -%>
|
46
|
+
<% end # of each_model do -%>
|
@@ -12,29 +12,38 @@
|
|
12
12
|
|
13
13
|
|
14
14
|
<% each_controller do -%>
|
15
|
-
|
15
|
+
|
16
16
|
<!-- ====== <%= model.name %> Pages ====== -->
|
17
17
|
<%
|
18
18
|
new_link = linkable?(:new)
|
19
19
|
new_form = !new_link && linkable?(model, :create, :method => :post)
|
20
|
+
model_key = model_name.pluralize.underscore
|
20
21
|
-%>
|
21
22
|
|
22
|
-
|
23
23
|
<def tag="index-page" for="<%= model.name %>">
|
24
|
-
<page merge title="<%= model_name :title, :plural %>">
|
24
|
+
<page merge title="#{ht '<%= model_key %>.index.title', :default=>['<%= model_name :title, :plural %>'] }">
|
25
25
|
<body: class="index-page <%= model_class %>" param/>
|
26
|
-
|
26
|
+
|
27
27
|
<content: param>
|
28
28
|
<header param="content-header">
|
29
|
-
<h2 param="heading"
|
30
|
-
|
31
|
-
|
29
|
+
<h2 param="heading">
|
30
|
+
<ht key="<%= model_key %>.index.heading">
|
31
|
+
<%= model_name :title, :plural %>
|
32
|
+
</ht>
|
33
|
+
</h2>
|
34
|
+
|
35
|
+
<p param="count" if>
|
36
|
+
<ht key="<%= model_key %>.collection.count" count="&this.size">
|
37
|
+
There <count prefix="are"/>
|
38
|
+
</ht>
|
39
|
+
</p>
|
32
40
|
</header>
|
33
|
-
|
41
|
+
|
34
42
|
<section param="content-body">
|
35
43
|
<% if new_link -%>
|
36
|
-
|
37
|
-
|
44
|
+
<a action="new" to="&model" param="new-link">
|
45
|
+
<ht key="<%= model_key %>.actions.new">New <%=model_name :title %></ht>
|
46
|
+
</a>
|
38
47
|
<% end -%>
|
39
48
|
|
40
49
|
<% if view_hints.paginate? -%>
|
@@ -54,7 +63,9 @@ new_form = !new_link && linkable?(model, :create, :method => :post)
|
|
54
63
|
|
55
64
|
<% if new_form -%>
|
56
65
|
<div param="new-form">
|
57
|
-
<h3 param="new-form-heading">
|
66
|
+
<h3 param="new-form-heading">
|
67
|
+
<ht key="<%= model_key %>.form.new.heading">New <%= model_name :title %></ht>
|
68
|
+
</h3>
|
58
69
|
<form with="&@invalid_record || new_for_current_user(<%= model %>)" param/>
|
59
70
|
</div>
|
60
71
|
|
@@ -66,17 +77,21 @@ new_form = !new_link && linkable?(model, :create, :method => :post)
|
|
66
77
|
|
67
78
|
|
68
79
|
<def tag="new-page" for="<%= model.name %>">
|
69
|
-
<page merge title="New <%=
|
80
|
+
<page merge title="#{ht '<%= model_key %>.new.title', :default=>['New <%=model_name :title %>'] }">
|
70
81
|
<body: class="new-page <%= model_class %>" param/>
|
71
|
-
|
82
|
+
|
72
83
|
<content: param>
|
73
84
|
<section param="content-header">
|
74
|
-
<h2 param="heading">
|
85
|
+
<h2 param="heading">
|
86
|
+
<ht key="<%= model_key %>.new.heading">
|
87
|
+
New <%= model_name :title %>
|
88
|
+
</ht>
|
89
|
+
</h2>
|
75
90
|
</section>
|
76
|
-
|
91
|
+
|
77
92
|
<section param="content-body">
|
78
93
|
<form param>
|
79
|
-
<submit: label="Create <%= model_name :title %>"/>
|
94
|
+
<submit: label="#{ht '<%= model_key %>.actions.create', :default=>['Create <%= model_name :title %>']}"/>
|
80
95
|
</form>
|
81
96
|
</section>
|
82
97
|
</content:>
|
@@ -86,7 +101,7 @@ new_form = !new_link && linkable?(model, :create, :method => :post)
|
|
86
101
|
|
87
102
|
<%
|
88
103
|
back_link = model.dependent_on.detect { |x| !(model.reflections[x].klass < Hobo::User) }
|
89
|
-
boolean_fields = model.columns.select { |c| c.type == :boolean }.*.name
|
104
|
+
boolean_fields = model.columns.select { |c| c.type == :boolean }.*.name - model.view_hints.inline_booleans
|
90
105
|
creator = model.creator_attribute
|
91
106
|
creator_link = creator && model.reflections[creator] && linkable?(model.reflections[creator].klass, :show)
|
92
107
|
edit_link = linkable?(:edit)
|
@@ -111,7 +126,7 @@ unless model.view_hints.secondary_children.empty?
|
|
111
126
|
end
|
112
127
|
-%>
|
113
128
|
<def tag="show-page" for="<%= model.name %>">
|
114
|
-
<page merge title="<%= model_name :title %>">
|
129
|
+
<page merge title="#{ht '<%=model_key %>.show.title', :default=>['<%=model_name :title %>'] }">
|
115
130
|
|
116
131
|
<body: class="show-page <%= model_class %>" param/>
|
117
132
|
|
@@ -121,10 +136,14 @@ end
|
|
121
136
|
<section param="main-content">
|
122
137
|
<% end -%>
|
123
138
|
<header param="content-header">
|
124
|
-
<% if
|
125
|
-
<a:<%= back_link %> param="parent-link">« <name/></a:<%= back_link %>>
|
139
|
+
<% if back_link -%>
|
140
|
+
<a:<%= back_link %> param="parent-link">« <ht key="<%= model_key %>.actions.back" to="<%= back_link %>"><name/></ht></a:<%= back_link %>>
|
126
141
|
<% end -%>
|
127
|
-
<h2 param="heading"
|
142
|
+
<h2 param="heading">
|
143
|
+
<ht key="<%= model_key %>.show.heading" name="&this.respond_to?(:name) ? this.name : ''">
|
144
|
+
<name/>
|
145
|
+
</ht>
|
146
|
+
</h2>
|
128
147
|
<% if boolean_fields -%>
|
129
148
|
|
130
149
|
<record-flags fields="<%= boolean_fields * ', ' %>" param/>
|
@@ -132,16 +151,20 @@ end
|
|
132
151
|
<% if creator_link -%>
|
133
152
|
|
134
153
|
<a:<%= model.creator_attribute %> param="creator-link"/>
|
135
|
-
<% elsif creator -%>
|
154
|
+
<% elsif creator -%>
|
136
155
|
|
137
156
|
<view:get-creator param="creator-name"/>
|
138
157
|
<% end -%>
|
139
158
|
<% if edit_link -%>
|
140
159
|
|
141
|
-
<a action="edit" if="&can_edit?" param="edit-link">
|
160
|
+
<a action="edit" if="&can_edit?" param="edit-link">
|
161
|
+
<ht key="<%= model_key %>.actions.edit" name="&this.respond_to?(:name) ? this.name : ''">
|
162
|
+
Edit <%= model_name :title %>
|
163
|
+
</ht>
|
164
|
+
</a>
|
142
165
|
<% end -%>
|
143
166
|
</header>
|
144
|
-
|
167
|
+
|
145
168
|
<section param="content-body"<%= ' with-flash-messages' if aside_collections %>>
|
146
169
|
<% if main_content -%>
|
147
170
|
<view:<%= main_content %> param="description"/>
|
@@ -151,8 +174,12 @@ end
|
|
151
174
|
<% end -%>
|
152
175
|
<% if collection -%>
|
153
176
|
<section param="collection-section">
|
154
|
-
<h3 param="collection-heading"
|
155
|
-
|
177
|
+
<h3 param="collection-heading">
|
178
|
+
<ht key="<%= model_key %>.collection.heading.<%= (is_user_model ? 'your':'other') %>" >
|
179
|
+
<%= '<Your/>' if is_user_model %><%= collection.to_s.titleize %>
|
180
|
+
</ht>
|
181
|
+
</h3>
|
182
|
+
|
156
183
|
<% if sortable_collection?(collection) -%>
|
157
184
|
<sortable-collection:<%= collection %> param="collection"/>
|
158
185
|
<% else -%>
|
@@ -160,14 +187,22 @@ end
|
|
160
187
|
<% end -%>
|
161
188
|
<% if add_link -%>
|
162
189
|
|
163
|
-
<a:<%= collection %> action="new" if="&can_create?(@<%= model_name.underscore %>.<%= collection %>)" param="new-link">
|
190
|
+
<a:<%= collection %> action="new" if="&can_create?(@<%= model_name.underscore %>.<%= collection %>)" param="new-link">
|
191
|
+
<ht key="<%= collection.to_s.pluralize %>.actions.new">
|
192
|
+
New <%= collection.to_s.singularize.titleize %>
|
193
|
+
</ht>
|
194
|
+
</a:<%= collection %>>
|
164
195
|
<% elsif add_form -%>
|
165
196
|
|
166
197
|
<section param="add-to-collection" if="&can_create?(@<%= model_name.underscore %>.<%= collection %>)">
|
167
|
-
<h3 param="add-form-heading">
|
198
|
+
<h3 param="add-form-heading">
|
199
|
+
<ht key="<%= collection.to_s.pluralize %>.collection.add_form_heading">
|
200
|
+
Add <%= a_or_an collection.to_s.singularize.titleize %>
|
201
|
+
</ht>
|
202
|
+
</h3>
|
168
203
|
<form with="&@<%= collection_class.name.underscore %> || new_for_current_user(@<%= model_name.underscore %>.<%= collection %>)" owner="<%= owner %>" without-cancel param>
|
169
204
|
<field-list: skip="<%= owner %>"/>
|
170
|
-
<submit: label="Add"/>
|
205
|
+
<submit: label="#{ht '<%= collection.to_s.pluralize %>.actions.add', :default=>['Add'] }"/>
|
171
206
|
</form>
|
172
207
|
</section>
|
173
208
|
<% end -%>
|
@@ -176,19 +211,29 @@ end
|
|
176
211
|
</section>
|
177
212
|
<% if aside_collections -%>
|
178
213
|
</section>
|
179
|
-
|
214
|
+
|
180
215
|
<aside param>
|
181
216
|
<% for refl, reverse_refl in aside_collections -%>
|
182
217
|
<% if linkable?(refl.klass, :"index_for_#{reverse_refl.name}") -%>
|
183
218
|
<preview-with-more:<%= refl.name %>.recent param="<%= refl.name %>-preview">
|
184
219
|
<% if is_user_model -%>
|
185
|
-
<heading
|
220
|
+
<heading:>
|
221
|
+
<ht key="hobo.undefined">
|
222
|
+
<Your with="&@<%= model_name.underscore %>"/> <%= refl.name.to_s.titleize %>
|
223
|
+
</ht>
|
224
|
+
</heading:>
|
186
225
|
<% end -%>
|
187
|
-
<more:>
|
226
|
+
<more:>
|
227
|
+
<ht key="hobo.actions.more">more</ht>
|
228
|
+
</more:>
|
188
229
|
</preview-with-more:<%= refl.name %>.recent>
|
189
230
|
<% else -%>
|
190
231
|
<section param="<%= refl.name %>-collection-section">
|
191
|
-
<h3 param="<%= refl.name %>-collection-heading"
|
232
|
+
<h3 param="<%= refl.name %>-collection-heading">
|
233
|
+
<ht key="<%= refl.name.to_s.pluralize %>.collection.heading.other" >
|
234
|
+
<%= refl.name.to_s.titleize %>
|
235
|
+
</ht>
|
236
|
+
</h3>
|
192
237
|
<collection:<%= refl.name %> param="<%= refl.name %>-collection"/>
|
193
238
|
</section>
|
194
239
|
<% end -%>
|
@@ -197,7 +242,7 @@ end
|
|
197
242
|
</section-group>
|
198
243
|
<% end -%>
|
199
244
|
</content:>
|
200
|
-
|
245
|
+
|
201
246
|
</page>
|
202
247
|
</def>
|
203
248
|
|
@@ -206,21 +251,25 @@ end
|
|
206
251
|
name_attribute = model.name_attribute
|
207
252
|
-%>
|
208
253
|
<def tag="edit-page" for="<%= model.name %>">
|
209
|
-
<page merge title="Edit <%=
|
254
|
+
<page merge title="#{ht '<%= model_key %>.edit.title', :default=>['Edit <%=model_name :title %>'] }">
|
210
255
|
|
211
256
|
<body: class="edit-page <%= model_class %>" param/>
|
212
257
|
|
213
258
|
<content:>
|
214
259
|
<section param="content-header">
|
215
|
-
<h2 param="heading">
|
216
|
-
|
260
|
+
<h2 param="heading">
|
261
|
+
<ht key="<%= model_key %>.edit.heading" name="&this.respond_to?(:name) ? this.name : ''">
|
262
|
+
Edit <type-name/>
|
263
|
+
</ht>
|
264
|
+
</h2>
|
265
|
+
<delete-button label="#{ht '<%= model_key %>.actions.delete', :default=>['Remove This <%= model_name :title %>']}" param/>
|
217
266
|
</section>
|
218
267
|
|
219
268
|
<section param="content-body">
|
220
269
|
<form param/>
|
221
270
|
</section>
|
222
271
|
</content:>
|
223
|
-
|
272
|
+
|
224
273
|
</page>
|
225
274
|
</def>
|
226
275
|
|
@@ -241,33 +290,53 @@ new_link = :new.in?(actions)
|
|
241
290
|
-%>
|
242
291
|
<def tag="index-for-<%= owner.dasherize %>-page" polymorphic/>
|
243
292
|
<def tag="index-for-<%= owner.dasherize %>-page" for="<%= model.name %>">
|
244
|
-
<page merge title="<%= model_name :title, :plural %> for #{name :with => @<%= owner %>, :no_wrapper => true}">
|
293
|
+
<page merge title="#{ht '<%= model_key %>.index_for_owner.title', :default=>['<%=model_name :title, :plural %> for']} #{name :with => @<%= owner %>, :no_wrapper => true}">
|
245
294
|
<body: class="index-for-owner-page <%= owner.dasherize %> <%= model_class %>" param/>
|
246
|
-
|
247
295
|
<content: param>
|
248
296
|
<header param="content-header">
|
249
297
|
<% if linkable_owner -%>
|
250
|
-
<div param="back-to">
|
298
|
+
<div param="back-to">
|
299
|
+
<ht key="hobo.actions.back">Back to</ht> <a with="&@<%= owner %>"/>
|
300
|
+
</div>
|
251
301
|
<% end -%>
|
252
302
|
<% if owner_is_user %>
|
253
|
-
<h2 param="heading"
|
303
|
+
<h2 param="heading">
|
304
|
+
<ht key="<%= model_key %>.index_for_owner.heading.your">
|
305
|
+
<Your with="&@<%= owner %>"/> <%= model_name :title, :plural %>
|
306
|
+
</ht>
|
307
|
+
</h2>
|
254
308
|
<% else -%>
|
255
|
-
<h2 param="heading"
|
256
|
-
|
309
|
+
<h2 param="heading">
|
310
|
+
<ht key="<%= model_key %>.index_for_owner.heading.other">
|
311
|
+
<%= model_name :title, :plural %>
|
312
|
+
</ht>
|
313
|
+
</h2>
|
314
|
+
<h3 param="subheading">
|
315
|
+
<ht key="<%= model_key %>.index_for_owner.subheading">
|
316
|
+
For:
|
317
|
+
</ht>
|
318
|
+
<<%= owner_tag %> with="&@<%= owner %>"/>
|
319
|
+
</h3>
|
257
320
|
<% end -%>
|
258
|
-
<p param="count" if>
|
321
|
+
<p param="count" if>
|
322
|
+
<ht key="<%= model_key %>.collection.count" count="&this.size">
|
323
|
+
There <count prefix="are"/>
|
324
|
+
</ht>
|
325
|
+
</p>
|
259
326
|
</header>
|
260
|
-
|
327
|
+
|
261
328
|
<section param="content-body">
|
262
329
|
<% if new_link -%>
|
330
|
+
<a action="new" to="&model" param="new-link">
|
331
|
+
<ht key="<%= model_key %>.actions.new" >New <%=model_name :title %></ht>
|
332
|
+
</a>
|
263
333
|
|
264
|
-
<a action="new" to="&model" param="new-link"/>
|
265
334
|
<% end -%>
|
266
335
|
|
267
336
|
<page-nav param="top-page-nav"/>
|
268
|
-
|
337
|
+
|
269
338
|
<collection param/>
|
270
|
-
|
339
|
+
|
271
340
|
<page-nav param="bottom-page-nav"/>
|
272
341
|
</section>
|
273
342
|
</content:>
|
@@ -279,20 +348,28 @@ new_link = :new.in?(actions)
|
|
279
348
|
<% if :new.in? actions -%>
|
280
349
|
<def tag="new-for-<%= owner.dasherize %>-page" polymorphic/>
|
281
350
|
<def tag="new-for-<%= owner.dasherize %>-page" for="<%= model.name %>">
|
282
|
-
<page merge title="New <%=
|
283
|
-
|
351
|
+
<page merge title="#{ht '<%=model_key %>.new_for_owner.title', :default=>['New <%=model_name :title %> for']} #{name :with => @<%= owner %>}">
|
284
352
|
<body: class="new-for-owner-page <% owner.dasherize %> <%= model_class %>" param/>
|
285
|
-
|
353
|
+
|
286
354
|
<content: param>
|
287
355
|
<header param="content-header">
|
288
|
-
<h2 param="heading">
|
289
|
-
|
356
|
+
<h2 param="heading">
|
357
|
+
<ht key="<%= model_key %>.new_for_owner.heading">
|
358
|
+
New <%= collection_name.singularize.titleize %>
|
359
|
+
</ht>
|
360
|
+
</h2>
|
361
|
+
<h3 param="subheading">
|
362
|
+
<ht key="<%= model_key %>.new_for_owner.subheading">
|
363
|
+
For:
|
364
|
+
</ht>
|
365
|
+
<<%= owner_tag %> with="&@<%= owner %>"/>
|
366
|
+
</h3>
|
290
367
|
</header>
|
291
|
-
|
368
|
+
|
292
369
|
<section param="content-body">
|
293
370
|
<form owner="<%= owner %>" method="post" param>
|
294
371
|
<field-list: skip="<%= owner %>"/>
|
295
|
-
<submit: label="Create <%= model_name :title %>"/>
|
372
|
+
<submit: label="#{ht '<%=model_key %>.actions.create', :default=>['Create <%= model_name :title %>']}"/>
|
296
373
|
</form>
|
297
374
|
</section>
|
298
375
|
</content:>
|
@@ -305,14 +382,18 @@ new_link = :new.in?(actions)
|
|
305
382
|
<% creator_names.each do |creator| -%>
|
306
383
|
<def tag="<%= creator.dasherize %>-page" polymorphic/>
|
307
384
|
<def tag="<%= creator.dasherize %>-page" for="<%= model.name %>">
|
308
|
-
|
309
|
-
<page title="<%= creator.titleize %>" merge>
|
385
|
+
|
386
|
+
<page title="#{ht '<%=model_key %>.<%= creator.underscore %>.title', :default=>['<%= creator.titleize %>']}" merge>
|
310
387
|
|
311
388
|
<body: class="lifecycle-start-page <%= creator.dasherize %>-page" param/>
|
312
389
|
|
313
390
|
<content: param>
|
314
391
|
<header param="content-header">
|
315
|
-
<h2 param="heading"
|
392
|
+
<h2 param="heading">
|
393
|
+
<ht key="<%= model_key %>.<%= creator.underscore %>.heading">
|
394
|
+
<%= creator.titleize %>
|
395
|
+
</ht>
|
396
|
+
</h2>
|
316
397
|
</header>
|
317
398
|
|
318
399
|
<section param="content-body">
|
@@ -327,20 +408,24 @@ new_link = :new.in?(actions)
|
|
327
408
|
<% transition_names.each do |transition| -%>
|
328
409
|
<def tag="<%= transition.dasherize %>-page" polymorphic/>
|
329
410
|
<def tag="<%= transition.dasherize %>-page" for="<%= model.name %>">
|
330
|
-
<page title="<%= transition.titleize %>" merge>
|
331
|
-
|
411
|
+
<page title="#{ht '<%=model_key %>.<%= transition.underscore %>.title', :default=>['<%= transition.titleize %>']}" merge>
|
412
|
+
|
332
413
|
<body: class="lifecycle-transition-page <%= transition.dasherize -%>-page" param/>
|
333
|
-
|
414
|
+
|
334
415
|
<content:>
|
335
416
|
<header param="content-header">
|
336
|
-
<h2 param="heading"
|
417
|
+
<h2 param="heading">
|
418
|
+
<ht key="<%= model_key %>.<%= transition.underscore %>.heading">
|
419
|
+
<%= transition.titleize %>
|
420
|
+
</ht>
|
421
|
+
</h2>
|
337
422
|
</header>
|
338
|
-
|
423
|
+
|
339
424
|
<section param="content-body">
|
340
425
|
<<%= transition.dasherize %>-form param="form"/>
|
341
426
|
</section>
|
342
427
|
</content:>
|
343
|
-
|
428
|
+
|
344
429
|
</page>
|
345
430
|
</def>
|
346
431
|
|