hobo 1.3.0.pre19 → 1.3.0.pre20
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/CHANGES.txt +282 -234
- data/VERSION +1 -1
- data/lib/generators/hobo/admin_subsite/templates/controller.rb.erb +5 -5
- data/lib/generators/hobo/assets/templates/dryml-support.js +2 -2
- data/lib/generators/hobo/i18n/templates/hobo.it.yml +1 -1
- data/lib/generators/hobo/rapid/templates/hobo-rapid.js +64 -64
- data/lib/generators/hobo/rapid/templates/ie7-recalc.js +21 -21
- data/lib/generators/hobo/rapid/templates/lowpro.js +31 -31
- data/lib/generators/hobo/rapid/templates/reset.css +1 -1
- data/lib/generators/hobo/rapid/templates/themes/clean/public/stylesheets/clean.css +15 -15
- data/lib/generators/hobo/rapid/templates/themes/clean/public/stylesheets/rapid-ui.css +3 -3
- data/lib/generators/hobo/rapid/templates/themes/clean/views/clean.dryml +1 -1
- data/lib/generators/hobo/setup_wizard/setup_wizard_generator.rb +15 -14
- data/lib/generators/hobo/subsite/templates/controller.rb.erb +1 -1
- data/lib/generators/hobo/user_controller/templates/controller.rb.erb +2 -2
- data/lib/hobo.rb +1 -0
- data/lib/hobo/controller.rb +6 -6
- data/lib/hobo/controller/authentication_support.rb +1 -1
- data/lib/hobo/controller/model.rb +10 -10
- data/lib/hobo/controller/user.rb +6 -6
- data/lib/hobo/engine.rb +6 -0
- data/lib/hobo/extensions/action_view/translation_helper.rb +20 -0
- data/lib/hobo/extensions/active_model/translation.rb +1 -1
- data/lib/hobo/extensions/i18n.rb +16 -0
- data/lib/hobo/helper.rb +2 -2
- data/lib/hobo/helper/translations.rb +61 -80
- data/lib/hobo/model/lifecycles/lifecycle.rb +5 -1
- data/lib/hobo/model/lifecycles/transition.rb +1 -0
- data/lib/hobo/rapid/generators/rapid/cards.dryml.erb +2 -2
- data/lib/hobo/rapid/generators/rapid/forms.dryml.erb +2 -2
- data/lib/hobo/rapid/generators/rapid/pages.dryml.erb +7 -7
- data/lib/hobo/rapid/taglibs/rapid.dryml +1 -1
- data/lib/hobo/rapid/taglibs/rapid_core.dryml +8 -8
- data/lib/hobo/rapid/taglibs/rapid_document_tags.dryml +2 -2
- data/lib/hobo/rapid/taglibs/rapid_forms.dryml +9 -9
- data/lib/hobo/rapid/taglibs/rapid_generics.dryml +1 -1
- data/lib/hobo/rapid/taglibs/rapid_i18n.dryml +0 -17
- data/lib/hobo/rapid/taglibs/rapid_lifecycles.dryml +5 -5
- data/lib/hobo/rapid/taglibs/rapid_navigation.dryml +1 -1
- data/lib/hobo/rapid/taglibs/rapid_plus.dryml +6 -6
- data/lib/hobo/rapid/taglibs/rapid_user_pages.dryml +8 -8
- data/test/permissions/test_permissions.rb +103 -103
- metadata +15 -14
- data/lib/hobo/rapid/taglibs/rapid_translations.dryml +0 -36
@@ -198,7 +198,7 @@ module Hobo
|
|
198
198
|
timestamp = record.read_attribute(key_timestamp_field)
|
199
199
|
if timestamp
|
200
200
|
timestamp = timestamp.getutc
|
201
|
-
Digest::SHA1.hexdigest("#{record.id}-#{state_name}-#{timestamp}")
|
201
|
+
Digest::SHA1.hexdigest("#{record.id}-#{state_name}-#{timestamp}-#{Rails.application.config.secret_token}")
|
202
202
|
end
|
203
203
|
end
|
204
204
|
|
@@ -211,6 +211,10 @@ module Hobo
|
|
211
211
|
provided_key && provided_key == key && !key_expired?
|
212
212
|
end
|
213
213
|
|
214
|
+
def clear_key
|
215
|
+
record.write_attribute key_timestamp_field, nil
|
216
|
+
end
|
217
|
+
|
214
218
|
def invariants_satisfied?
|
215
219
|
self.class.invariants.all? { |i| record.instance_eval(&i) }
|
216
220
|
end
|
@@ -19,7 +19,7 @@ has_body = (!show_link && description_attribute) || creator_link || creator_a
|
|
19
19
|
|
20
20
|
show_title = !show_link && (name_attribute || !has_body)
|
21
21
|
|
22
|
-
model_key = model.
|
22
|
+
model_key = model.to_s.underscore
|
23
23
|
-%>
|
24
24
|
<def tag="card" for="<%= model.name %>">
|
25
25
|
<card class="<%= model_class %>" param="default" merge>
|
@@ -53,7 +53,7 @@ model_key = model.name.pluralize.underscore
|
|
53
53
|
<view:<%= creator_attribute %> param="creator"/>
|
54
54
|
<% end -%>
|
55
55
|
<% if primary_collection -%>
|
56
|
-
<ht key="<%= primary_collection.to_s.
|
56
|
+
<ht key="<%= primary_collection.to_s.underscore %>.collection.count" count="&this.<%= primary_collection %>.size">
|
57
57
|
<count:<%= primary_collection%> param/>
|
58
58
|
</ht>
|
59
59
|
<% end -%>
|
@@ -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 = model.
|
7
|
+
model_key = model.to_s.underscore
|
8
8
|
-%>
|
9
9
|
<def tag="form" for="<%= model.name %>">
|
10
10
|
<form merge param="default">
|
@@ -43,4 +43,4 @@ model_key = model.name.tableize
|
|
43
43
|
</def>
|
44
44
|
<% end -%>
|
45
45
|
|
46
|
-
<% end # of each_model do -%>
|
46
|
+
<% end # of each_model do -%>
|
@@ -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 %>"><ht key="<%= m.
|
7
|
+
<nav-item with="&<%= m.name %>"><ht key="<%= m.to_s.underscore %>.nav_item" count="100"><model-name-human count="100"/></ht></nav-item>
|
8
8
|
<% end -%>
|
9
9
|
</navigation>
|
10
10
|
</def>
|
@@ -17,7 +17,7 @@
|
|
17
17
|
<%
|
18
18
|
new_link = linkable?(:new)
|
19
19
|
new_form = !new_link && linkable?(model, :create, :method => :post)
|
20
|
-
model_key = model.
|
20
|
+
model_key = model.to_s.underscore
|
21
21
|
-%>
|
22
22
|
|
23
23
|
<def tag="index-page" for="<%= model.name %>">
|
@@ -177,7 +177,7 @@ end
|
|
177
177
|
<% if collection -%>
|
178
178
|
<section param="collection-section">
|
179
179
|
<h3 param="collection-heading">
|
180
|
-
<ht key="<%= collection.to_s.
|
180
|
+
<ht key="<%= collection.to_s.underscore %>.collection.heading" count="&this.<%= collection.to_s %>.count" >
|
181
181
|
<human-collection-name collection="<%= collection %>" your/>
|
182
182
|
</ht>
|
183
183
|
</h3>
|
@@ -190,7 +190,7 @@ end
|
|
190
190
|
<% if add_link -%>
|
191
191
|
|
192
192
|
<a:<%= collection %> action="new" if="&can_create?(@<%= model.name.underscore %>.<%= collection %>)" param="new-link">
|
193
|
-
<ht key="<%= collection.to_s.
|
193
|
+
<ht key="<%= collection.to_s.underscore %>.actions.new" count="1">
|
194
194
|
New <%= collection.to_s.singularize.titleize %>
|
195
195
|
</ht>
|
196
196
|
</a:<%= collection %>>
|
@@ -198,13 +198,13 @@ end
|
|
198
198
|
|
199
199
|
<section param="add-to-collection" if="&can_create?(@<%= model.name.underscore %>.<%= collection %>)">
|
200
200
|
<h3 param="add-form-heading">
|
201
|
-
<ht key="<%= collection.to_s.
|
201
|
+
<ht key="<%= collection.to_s.underscore %>.collection.add_form_heading" count="1">
|
202
202
|
Add <%= a_or_an collection.to_s.singularize.titleize %>
|
203
203
|
</ht>
|
204
204
|
</h3>
|
205
205
|
<form with="&@<%= collection_class.name.underscore %> || new_for_current_user(@<%= model.name.underscore %>.<%= collection %>)" owner="<%= owner %>" without-cancel param>
|
206
206
|
<field-list: skip="<%= owner %>"/>
|
207
|
-
<submit: label="#{ht '<%= sq_escape collection.to_s.
|
207
|
+
<submit: label="#{ht '<%= sq_escape collection.to_s.underscore %>.actions.add', :default=>['Add'] }"/>
|
208
208
|
</form>
|
209
209
|
</section>
|
210
210
|
<% end -%>
|
@@ -223,7 +223,7 @@ end
|
|
223
223
|
<% else -%>
|
224
224
|
<section param="<%= refl.name %>-collection-section">
|
225
225
|
<h3 param="<%= refl.name %>-collection-heading">
|
226
|
-
<ht key="<%= refl.
|
226
|
+
<ht key="<%= refl.klass.to_s.underscore %>.collection.heading" count="&this.<%= refl.name.to_s %>.count" >
|
227
227
|
<human-collection-name collection="<%= refl.name %>" your/>
|
228
228
|
</ht>
|
229
229
|
</h3>
|
@@ -1,6 +1,6 @@
|
|
1
1
|
<!--
|
2
2
|
|
3
|
-
The Rapid tag library makes web development go fast. The Rapid tag library is your friend.
|
3
|
+
The Rapid tag library makes web development go fast. The Rapid tag library is your friend.
|
4
4
|
|
5
5
|
(This taglib defines no tags - it just includes all the other taglibs. Move along. Nothing to see here.)
|
6
6
|
|
@@ -493,7 +493,7 @@ Assuming the context is a blog post...
|
|
493
493
|
%></def>
|
494
494
|
|
495
495
|
<!-- Renders 'Yes' for true and 'No' for false -->
|
496
|
-
<def tag="view" for="boolean"><%= this ?
|
496
|
+
<def tag="view" for="boolean"><%= this ? t('hobo.boolean_yes', :default => 'Yes') : t('hobo.boolean_no', :default => 'No') %></def>
|
497
497
|
|
498
498
|
<!-- Renders a link (`<a>`) to `this` -->
|
499
499
|
<def tag="view" for="ActiveRecord::Base"><a merge-attrs/></def>
|
@@ -591,7 +591,7 @@ You can pass a summary attribute, which will generate a complete localized sente
|
|
591
591
|
else
|
592
592
|
key = summary.kind_of?(String) ? summary : "default"
|
593
593
|
default = c == 1 ? "There is 1 #{label}" : "There are #{c} #{label}"
|
594
|
-
|
594
|
+
t "tags.count.#{key}", {:count=>c, :label=>label, :default=>default}.merge(attributes)
|
595
595
|
end
|
596
596
|
end
|
597
597
|
%></span></def>
|
@@ -661,12 +661,12 @@ The "titleize" attribute is deprecated: use "capitalize" instead.
|
|
661
661
|
when attributes[:do] then 'do'
|
662
662
|
end -%>
|
663
663
|
<if test="&this == current_user">
|
664
|
-
<%= s =
|
664
|
+
<%= s = t("tags.you.current_user.#{k || attributes.keys.first || 'default'}",:default=>"you #{k}")
|
665
665
|
(titleize||capitalize) ? s.sub(/^./){|c| c.upcase} : s %>
|
666
666
|
</if>
|
667
667
|
<else>
|
668
668
|
<do param="default">
|
669
|
-
<%= s =
|
669
|
+
<%= s = t("tags.you.other_user.#{k || attributes.keys.first || 'default'}", :name=>this.name,
|
670
670
|
:default=>"#{this.name} #{'has' if attributes[:have]}#{'is' if attributes[:are]}#{'does' if attributes[:do]}")
|
671
671
|
(titleize||capitalize) ? s.sub(/^./){|c| c.upcase} : s %>
|
672
672
|
</do>
|
@@ -738,14 +738,14 @@ Notes
|
|
738
738
|
options = {:default=>[d], :count=>(attrs[:count]||1), :name=>this.name}
|
739
739
|
your_key = key.split('.').last
|
740
740
|
unless key.eql?(your_key) || attrs.has_key?(your_key.to_sym)
|
741
|
-
options[your_key.to_sym] =
|
741
|
+
options[your_key.to_sym] = t(key, :count=>options[:count], :default=>your_key.titleize)
|
742
742
|
end
|
743
743
|
s = if this == current_user
|
744
744
|
options[:default].unshift :"tags.your.default.current_user"
|
745
|
-
|
745
|
+
t("tags.your.#{your_key}.current_user", options.merge(attrs))
|
746
746
|
else
|
747
747
|
options[:default].unshift :"tags.your.default.other_user"
|
748
|
-
|
748
|
+
t("tags.your.#{your_key}.other_user", options.merge(attrs))
|
749
749
|
end
|
750
750
|
capitalize ? s.sub(/^./){|c| c.upcase} : s
|
751
751
|
%></def>
|
@@ -774,7 +774,7 @@ Notes
|
|
774
774
|
<def tag="dev-user-changer">
|
775
775
|
<set user="&Hobo::Model::User.default_user_model"/>
|
776
776
|
<select-menu if="&user && Rails.env.development?"
|
777
|
-
first-option="#{
|
777
|
+
first-option="#{t('hobo.dev_user_changer.guest', {:default=>'Guest'})}" options="&user.all(:limit => 30).*.login"
|
778
778
|
onchange="location.href = '#{dev_support_path :action=>:set_current_user}?login=' + encodeURIComponent(this.options[this.selectedIndex].value)"
|
779
779
|
selected="#{current_user.login}"
|
780
780
|
class="dev-user-changer"
|
@@ -1,6 +1,6 @@
|
|
1
1
|
<!-- Extra tags for semantic markup -->
|
2
2
|
|
3
|
-
<!-- Used as a semantic wrapper around a group of sections and asides. CSS layouts can be provided based on this structure.
|
3
|
+
<!-- Used as a semantic wrapper around a group of sections and asides. CSS layouts can be provided based on this structure.
|
4
4
|
|
5
5
|
### Usage
|
6
6
|
|
@@ -13,7 +13,7 @@
|
|
13
13
|
<def tag="section-group"><div class="section-group"><div class="section-group-inner" merge-attrs param="default"></div></div></def>
|
14
14
|
|
15
15
|
<!-- A proposed HTML 5 tag for representing a generic document or application section. Slightly more semantic than `<div>` for indicating document structure. For the time being, `<section>` is output as `<div class="section">`. In Hobo, `<section>` also has one other important behaviour which is different to using `<div>` directly, when the content of the section is empty, the wrapper tag will disappear. e.g.
|
16
|
-
|
16
|
+
|
17
17
|
<section>My Section</section> -> <div class="section">My Section</div>
|
18
18
|
<section><% # empty %></section> -> (nothing is generated)
|
19
19
|
-->
|
@@ -575,8 +575,8 @@ All the standard ajax attributes *except the callbacks* are supported (see the m
|
|
575
575
|
else
|
576
576
|
{ :type => "button" }
|
577
577
|
end)
|
578
|
-
label ||=
|
579
|
-
confirm =
|
578
|
+
label ||= t("hobo.actions.remove", :default=>"Remove")
|
579
|
+
confirm = t("hobo.messages.confirm", :default=>"Are you sure?") if confirm.nil?
|
580
580
|
|
581
581
|
add_classes!(attributes,
|
582
582
|
image ? "image-button" : "button",
|
@@ -623,7 +623,7 @@ All of the standard ajax attributes are supported (see the main taglib documenti
|
|
623
623
|
new = class_or_assoc.new(fields)
|
624
624
|
new.set_creator(current_user)
|
625
625
|
if can_create?(new)
|
626
|
-
label ||= ht("#{new.class.
|
626
|
+
label ||= ht("#{new.class.to_s.underscore}.actions.new", :default=>"New #{new.class.model_name.human}")
|
627
627
|
ajax_attributes = { :message => message }
|
628
628
|
class_name = new.class.name.underscore
|
629
629
|
ajax_attributes[:params] = { class_name => fields } unless fields.empty?
|
@@ -652,7 +652,7 @@ For situations where there are too many target records to practically include in
|
|
652
652
|
|
653
653
|
-->
|
654
654
|
<def tag="select-one" attrs="include-none, blank-message, options, sort, limit, text-method"><%
|
655
|
-
raise Hobo::PermissionDeniedError.new("Not allowed to edit #{this_field}") if !attributes[:disabled] && !can_edit?
|
655
|
+
raise Hobo::PermissionDeniedError.new("Not allowed to edit #{this_field}") if !attributes[:disabled] && !can_edit?
|
656
656
|
blank_message ||= ht("#{this_type.name.tableize}.message.no", :default=>"(No #{this_type.model_name.human})")
|
657
657
|
limit ||= 100
|
658
658
|
|
@@ -783,7 +783,7 @@ If you wish to set `min-chars` to 0, you will require this [patch to controls.js
|
|
783
783
|
<h2 param="heading"><t key="activerecord.errors.template.header" model="&this.class.model_name.human" count="&this.errors.size"/></h2>
|
784
784
|
<t key="activerecord.errors.template.body"></t>
|
785
785
|
<ul param>
|
786
|
-
<% this.errors.
|
786
|
+
<% this.errors.to_a.each do |message| -%>
|
787
787
|
<li param><%= message %></li>
|
788
788
|
<% end -%>
|
789
789
|
</ul>
|
@@ -797,12 +797,12 @@ An input for `has_many :through` associations that lets the user chose the items
|
|
797
797
|
To use this tag, the model of the items the user is chosing *must* have unique names, and the
|
798
798
|
-->
|
799
799
|
<def tag="select-many" attrs="options, targets, remove-label, prompt, disabled, name"><%
|
800
|
-
prompt ||= ht("#{this_field.
|
800
|
+
prompt ||= ht("#{this_field.underscore}.form.select_many.prompt", :default=>"Add #{this_field.titleize.singularize}")
|
801
801
|
options ||= this_field_reflection.klass.all(:conditions =>this.send(:conditions)).select {|x| can_view?(x)}
|
802
802
|
name ||= param_name_for_this
|
803
803
|
|
804
804
|
values = this
|
805
|
-
remove_label ||=
|
805
|
+
remove_label ||= t("hobo.actions.remove", :default=>'Remove')
|
806
806
|
-%>
|
807
807
|
<div class="input select-many" merge-attrs>
|
808
808
|
<div style="display:none" class="item-proto">
|
@@ -883,7 +883,7 @@ Use the `uri` option to specify a redirect location:
|
|
883
883
|
<def tag="select-menu" attrs="options, selected, first-option, first-value, key">
|
884
884
|
<% key ||= 'default'
|
885
885
|
%w[options first_option first_value].each do |a|
|
886
|
-
str =
|
886
|
+
str = t("tags.select_menu.#{key}.#{a}", :default=>'')
|
887
887
|
eval "#{a} = str unless str.blank?"
|
888
888
|
end
|
889
889
|
-%>
|
@@ -1026,7 +1026,7 @@ end
|
|
1026
1026
|
<input type="hidden" class="empty-input" id="#{underize param_name_for_this}" name="#{param_name_for_this}" value="" disabled="&(!this.empty? || minimum>0)" />
|
1027
1027
|
<fake-field-context fake-field="-1" context="&template">
|
1028
1028
|
<div param="empty-message">
|
1029
|
-
<ht key="#{this.class.
|
1029
|
+
<ht key="#{this.class.to_s.underscore}.collection.empty_message">
|
1030
1030
|
No <%= this.class.name.titleize.downcase.pluralize %>.
|
1031
1031
|
</ht>
|
1032
1032
|
</div>
|
@@ -20,7 +20,7 @@
|
|
20
20
|
<def tag="empty-collection-message">
|
21
21
|
<unless test="&this.member_class.nil?">
|
22
22
|
<div class="empty-collection-message" style="#{'display:none' if !this.empty?}" param="default">
|
23
|
-
<ht key="#{this.member_class.
|
23
|
+
<ht key="#{this.member_class.to_s.underscore}.collection.empty_message">
|
24
24
|
No <collection-name/> to display
|
25
25
|
</ht>
|
26
26
|
</div>
|
@@ -1,22 +1,5 @@
|
|
1
1
|
<!-- Rapid i18n provides tags related with the Rails-I18n project -->
|
2
2
|
|
3
|
-
<!-- Simple wrapper around I18n.t.
|
4
|
-
The tag content is used as the :default option. It is overridden by an explicit 'default' attribute.
|
5
|
-
There is a default :count => 1
|
6
|
-
|
7
|
-
### Attributes
|
8
|
-
|
9
|
-
- key: the key to lookup
|
10
|
-
- all the attributes accepted by the wrapped method
|
11
|
-
|
12
|
-
-->
|
13
|
-
<def tag="t"><%=
|
14
|
-
options = {}
|
15
|
-
all_attributes.each_pair{|k,v| options[k.to_sym] = h(v)}
|
16
|
-
k = options.delete(:key)
|
17
|
-
I18n.t(k, {:default=>all_parameters.default}.merge(options)).html_safe
|
18
|
-
%></def>
|
19
|
-
|
20
3
|
<!-- Wrapper around ActiveModel::Name#human
|
21
4
|
|
22
5
|
#### Attributes
|
@@ -1,14 +1,14 @@
|
|
1
1
|
<!-- Contains view-layer support for Hobo's lifecycles. Note that lifecycle forms are generated automatically in `app/views/taglibs/auto/rapid/forms.dryml` - this library contains only lifecycle push-buttons. -->
|
2
2
|
|
3
3
|
<!-- A push-button to invoke a lifecycle transition either as a page-reload or as an ajax call.
|
4
|
-
|
4
|
+
|
5
5
|
### Attributes
|
6
6
|
|
7
7
|
- `transition` - the name of the transition to invoke. Required
|
8
8
|
- `update` - one or more DOM IDs of ajax parts to update after the transition
|
9
9
|
- `label` - the label on the button. Defaults to the name of the transition
|
10
10
|
|
11
|
-
All of the [standard ajax attributes](/api_taglibs/rapid_forms) are also supported.
|
11
|
+
All of the [standard ajax attributes](/api_taglibs/rapid_forms) are also supported.
|
12
12
|
|
13
13
|
### Warning
|
14
14
|
|
@@ -25,7 +25,7 @@ Transitions with parameters are implemented using a form. HTML does not allow f
|
|
25
25
|
|
26
26
|
html_attributes[:method] ||= has_params ? :get : :put
|
27
27
|
add_classes!(html_attributes, "transition-button #{transition_name}-button")
|
28
|
-
label = ht("#{this.class.
|
28
|
+
label = ht("#{this.class.to_s.underscore}.actions.#{transition_name}", :default => (label || transition_name.to_s.titleize))
|
29
29
|
url = object_url(this, transition_name, :method => html_attributes[:method])
|
30
30
|
|
31
31
|
if (update || !ajax_attributes.empty?) && !has_params
|
@@ -48,7 +48,7 @@ For example, you could use this on a `Friendship` card: the person invited to ha
|
|
48
48
|
This tag behaves similarly to repeat: an else tag may be used to handle the case of no buttons:
|
49
49
|
|
50
50
|
<transition-buttons/><else>Sorry, no buttons to press.</else>
|
51
|
-
-->
|
51
|
+
-->
|
52
52
|
<def tag="transition-buttons">
|
53
53
|
<% ajax_attrs, html_attrs = attributes.partition_hash(Hobo::Rapid::Helper::AJAX_ATTRS) %>
|
54
54
|
<div merge-attrs="&html_attrs" class="transitions">
|
@@ -59,4 +59,4 @@ This tag behaves similarly to repeat: an else tag may be used to handle the case
|
|
59
59
|
<% end %>
|
60
60
|
</if>
|
61
61
|
</div>
|
62
|
-
</def>
|
62
|
+
</def>
|
@@ -89,7 +89,7 @@ This is a simple tag - just look at the source if you need to know more detail.
|
|
89
89
|
<ul class="navigation account-nav" param>
|
90
90
|
<li if="&Rails.env.development?" param="dev-user-changer"><dev-user-changer/></li>
|
91
91
|
<if test="&logged_in?">
|
92
|
-
<li class='nav-item' param="logged-in-as"><a to="¤t_user"><t key="hobo.actions.
|
92
|
+
<li class='nav-item' param="logged-in-as"><a to="¤t_user"><t key="hobo.actions.logged_in_as_html" name="&name">Logged in as <name/></t></a></li>
|
93
93
|
<li class='nav-item' param="account"><a action="account"><t key="hobo.actions.account">Account</t></a></li>
|
94
94
|
<li class='nav-item' param="log-out"><a href="&logout_url"><t key="hobo.actions.logout">Log out</t></a></li>
|
95
95
|
</if>
|
@@ -17,7 +17,7 @@ An [worked example](/tutorials/agility#improve_the_project_page_with_a_searchabl
|
|
17
17
|
<hidden-fields for-query-string skip="page, search"/>
|
18
18
|
<span><t key="hobo.table_plus.search">Search</t></span>
|
19
19
|
<input class="search" type="search" name="search" value="¶ms[:search]"/>
|
20
|
-
<submit label="&
|
20
|
+
<submit label="&t('hobo.table_plus.submit_label', :default=>'Go')" class="search-button" param="search-submit"/>
|
21
21
|
</form>
|
22
22
|
</div>
|
23
23
|
</div>
|
@@ -105,16 +105,16 @@ This tag assumes the controller has a `reorder` action and the model has a `posi
|
|
105
105
|
name ||= model_class.name.downcase.pluralize -%>
|
106
106
|
<section class="#{name.dasherize} collection-preview" param="default">
|
107
107
|
<h3 param="heading">
|
108
|
-
<ht key="#{
|
108
|
+
<ht key="#{model_class.to_s.underscore}.collection.heading" count="&this.size">
|
109
109
|
<do param="heading-content"><%= name.pluralize.titleize %></do>
|
110
110
|
</ht>
|
111
111
|
</h3>
|
112
112
|
<a with="&model_class" action="new" if="&can_create?(model_class.new)" param="new-link">
|
113
|
-
<ht key="#{model_class.to_s.
|
113
|
+
<ht key="#{model_class.to_s.underscore}.actions.new">New <%= model_class.model_name.human %></ht>
|
114
114
|
</a>
|
115
115
|
<collection param/>
|
116
116
|
<unless test="&this.empty? || this.size <= model_class.count">
|
117
|
-
<a param="show-all"><ht key="#{model_class.to_s.
|
117
|
+
<a param="show-all"><ht key="#{model_class.to_s.underscore}.actions.show_all" count="100">Show all <%= name.pluralize.titleize %>...</ht></a>
|
118
118
|
</unless>
|
119
119
|
</section>
|
120
120
|
</def>
|
@@ -210,9 +210,9 @@ Besides the "tags.filter_menu.default.no_filter" key is used as default of the a
|
|
210
210
|
|
211
211
|
-->
|
212
212
|
<def tag="filter-menu" attrs="param-name, options, no-filter, id">
|
213
|
-
<% opt =
|
213
|
+
<% opt = t("tags.filter_menu.#{param_name}.options", :default=>'')
|
214
214
|
options = opt unless opt.blank?
|
215
|
-
no_filter =
|
215
|
+
no_filter = t("tags.filter_menu.#{param_name}.no_filter", :default=>[:"tags.filter_menu.default.no_filter", no_filter, "All"]) %>
|
216
216
|
<form action="&request.fullpath" method="get" class="filter-menu" merge-attrs="id">
|
217
217
|
<div>
|
218
218
|
<% opt = options.first.kind_of?(Array) ? options.*.last : options
|
@@ -39,7 +39,7 @@
|
|
39
39
|
</labelled-item>
|
40
40
|
</labelled-item-list>
|
41
41
|
<div param="actions">
|
42
|
-
<submit label="#{
|
42
|
+
<submit label="#{t 'hobo.actions.login', :default=>['Log in'] }" param/><if test="&signup_url" class='nav-item'>
|
43
43
|
<t key="hobo.support.or">or</t> <a param="signup" href="&signup_url"><t key="hobo.login.signup">Sign up</t></a></if>
|
44
44
|
</div>
|
45
45
|
</form>
|
@@ -48,7 +48,7 @@
|
|
48
48
|
<!-- Simple log-in page -->
|
49
49
|
<def tag="login-page">
|
50
50
|
<% remember_me = true if remember_me.nil? %>
|
51
|
-
<simple-page title="#{
|
51
|
+
<simple-page title="#{t 'hobo.login.title', :default=>['Log in'] }" merge>
|
52
52
|
|
53
53
|
<body: class="login-page" param/>
|
54
54
|
|
@@ -69,7 +69,7 @@
|
|
69
69
|
<!-- The page that initiates the forgotten password process. Contains a single text-input where the user can provide
|
70
70
|
their email address -->
|
71
71
|
<def tag="forgot-password-page">
|
72
|
-
<simple-page title="#{
|
72
|
+
<simple-page title="#{t 'hobo.forgot_password.title', :default=>['Forgotten Password'] }" merge>
|
73
73
|
|
74
74
|
<body: class="forgot-password-page" param/>
|
75
75
|
|
@@ -92,7 +92,7 @@
|
|
92
92
|
</labelled-item>
|
93
93
|
</labelled-item-list>
|
94
94
|
<div param="actions">
|
95
|
-
<submit label="#{
|
95
|
+
<submit label="#{t 'hobo.actions.send', :default=>['Send'] }" param/>
|
96
96
|
</div>
|
97
97
|
</form>
|
98
98
|
</section>
|
@@ -105,7 +105,7 @@
|
|
105
105
|
entered is in our records". This is to avoid a privacy concern that the forgotten-password mechanism can be otherwise used to tell
|
106
106
|
if a given email is associated with an account or not. -->
|
107
107
|
<def tag="forgot-password-email-sent-page">
|
108
|
-
<simple-page title="#{
|
108
|
+
<simple-page title="#{t 'hobo.forgot_password_sent.title', :default=>['Forgotten Password - Sent'] }" merge>
|
109
109
|
<body: class="forgot-password-page" param/>
|
110
110
|
|
111
111
|
<content: param>
|
@@ -132,7 +132,7 @@ if a given email is associated with an account or not. -->
|
|
132
132
|
<!-- The page that is displayed on attempting to log in to an account that has been disabled. -->
|
133
133
|
<def tag="account-disabled-page">
|
134
134
|
|
135
|
-
<simple-page title="#{
|
135
|
+
<simple-page title="#{t 'hobo.account_disabled_page.title', :default=>['Account Disabled'] }" merge>
|
136
136
|
|
137
137
|
<body: class="account-disabled-page" param/>
|
138
138
|
|
@@ -153,7 +153,7 @@ if a given email is associated with an account or not. -->
|
|
153
153
|
<!-- Basic account page that provides the ability for the user to change their email address and password. -->
|
154
154
|
<def tag="account-page">
|
155
155
|
|
156
|
-
<page title="#{
|
156
|
+
<page title="#{t 'hobo.account_page.title', :default=>['Your Account'] }" merge>
|
157
157
|
|
158
158
|
<body: class="user-account-page #{type_name}" param/>
|
159
159
|
|
@@ -171,7 +171,7 @@ if a given email is associated with an account or not. -->
|
|
171
171
|
</field-list>
|
172
172
|
|
173
173
|
<div class="actions" param="actions">
|
174
|
-
<submit label="#{
|
174
|
+
<submit label="#{t 'hobo.actions.save_account', :default=>'Save'}" param/>
|
175
175
|
</div>
|
176
176
|
</form>
|
177
177
|
</section>
|