hobo 1.1.0 → 1.3.0.RC
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES.txt +238 -287
- data/Rakefile +14 -31
- data/VERSION +1 -0
- data/{lib/hobo → app/controllers}/dev_controller.rb +6 -6
- data/app/controllers/dryml_support_controller.rb +13 -0
- data/{rails_generators/hobo_front_controller/templates → app/views/dev}/summary.dryml +7 -10
- data/bin/hobo +12 -144
- data/config/initializers/inflections.rb +3 -0
- data/config/routes.rb +6 -0
- data/{doctest → doctests}/hobo/lifecycles.rdoctest +40 -59
- data/{doctest → doctests/hobo}/model.rdoctest +33 -40
- data/{doctest → doctests/hobo}/multi_model_forms.rdoctest +15 -19
- data/{doctest → doctests/hobo}/scopes.rdoctest +27 -41
- data/doctests/prepare_testapp.rb +8 -0
- data/hobo.gemspec +26 -199
- data/lib/generators/hobo/activation_email.rb +11 -0
- data/lib/generators/hobo/admin_subsite/admin_subsite_generator.rb +35 -0
- data/lib/generators/hobo/admin_subsite/templates/admin.css +20 -0
- data/lib/generators/hobo/admin_subsite/templates/admin_tag_injection.erb +10 -0
- data/{rails_generators/hobo_admin_site → lib/generators/hobo/admin_subsite}/templates/application.dryml +0 -0
- data/{rails_generators/hobo_admin_site/templates/controller.rb → lib/generators/hobo/admin_subsite/templates/controller.rb.erb} +5 -5
- data/lib/generators/hobo/admin_subsite/templates/users_index.dryml +7 -0
- data/lib/generators/hobo/assets/assets_generator.rb +18 -0
- data/{rails_generators/hobo → lib/generators/hobo/assets}/templates/application.css +0 -0
- data/lib/generators/hobo/assets/templates/application.dryml.erb +9 -0
- data/{rails_generators/hobo → lib/generators/hobo/assets}/templates/dryml-support.js +2 -2
- data/lib/generators/hobo/assets/templates/dryml_taglibs_initializer.rb +1 -0
- data/lib/generators/hobo/assets/templates/en_injection.yml +19 -0
- data/{rails_generators/hobo → lib/generators/hobo/assets}/templates/guest.rb +1 -1
- data/lib/generators/hobo/controller.rb +35 -0
- data/lib/generators/hobo/controller/controller_generator.rb +6 -0
- data/lib/generators/hobo/controller/templates/controller.rb.erb +7 -0
- data/{rails_generators/hobo_front_controller → lib/generators/hobo/front_controller}/USAGE +0 -0
- data/lib/generators/hobo/front_controller/front_controller_generator.rb +55 -0
- data/{rails_generators/hobo_front_controller/templates/controller.rb → lib/generators/hobo/front_controller/templates/controller.rb.erb} +0 -0
- data/{rails_generators/hobo_front_controller → lib/generators/hobo/front_controller}/templates/index.dryml +6 -12
- data/lib/generators/hobo/i18n/i18n_generator.rb +35 -0
- data/lib/generators/hobo/i18n/templates/app.de.yml +30 -0
- data/lib/generators/hobo/i18n/templates/app.en.yml +25 -0
- data/lib/generators/hobo/i18n/templates/app.es.yml +31 -0
- data/lib/generators/hobo/i18n/templates/app.fr.yml +26 -0
- data/lib/generators/hobo/i18n/templates/app.it.yml +28 -0
- data/lib/generators/hobo/i18n/templates/app.pt-PT.yml +25 -0
- data/lib/generators/hobo/i18n/templates/app.ru.yml +24 -0
- data/lib/generators/hobo/i18n/templates/hobo.de.yml +204 -0
- data/lib/generators/hobo/i18n/templates/hobo.en.yml +195 -0
- data/lib/generators/hobo/i18n/templates/hobo.es.yml +202 -0
- data/lib/generators/hobo/i18n/templates/hobo.fr.yml +195 -0
- data/lib/generators/hobo/i18n/templates/hobo.it.yml +202 -0
- data/lib/generators/hobo/i18n/templates/hobo.pt-PT.yml +196 -0
- data/lib/generators/hobo/i18n/templates/hobo.ru.yml +200 -0
- data/lib/generators/hobo/invite_only.rb +18 -0
- data/lib/generators/hobo/model/USAGE +19 -0
- data/lib/generators/hobo/model/model_generator.rb +11 -0
- data/{rails_generators/hobo_model/templates/model.rb → lib/generators/hobo/model/templates/model_injection.rb.erb} +0 -2
- data/{rails_generators/hobo_rapid → lib/generators/hobo/rapid}/USAGE +0 -0
- data/lib/generators/hobo/rapid/rapid_generator.rb +24 -0
- data/{rails_generators/hobo_rapid → lib/generators/hobo/rapid}/templates/IE7.js +0 -0
- data/{rails_generators/hobo_rapid → lib/generators/hobo/rapid}/templates/blank.gif +0 -0
- data/{rails_generators/hobo_rapid → lib/generators/hobo/rapid}/templates/hobo-rapid.css +0 -0
- data/{rails_generators/hobo_rapid → lib/generators/hobo/rapid}/templates/hobo-rapid.js +65 -65
- data/{rails_generators/hobo_rapid → lib/generators/hobo/rapid}/templates/ie7-recalc.js +21 -21
- data/{rails_generators/hobo_rapid → lib/generators/hobo/rapid}/templates/lowpro.js +31 -31
- data/{rails_generators/hobo_rapid → lib/generators/hobo/rapid}/templates/reset.css +1 -1
- data/lib/generators/hobo/rapid/templates/themes/clean-sidemenu/public/images/100-ACD3E6-DBE1E5-H.png +0 -0
- data/lib/generators/hobo/rapid/templates/themes/clean-sidemenu/public/images/100-DBE1E5-FCFEF5-H.png +0 -0
- data/lib/generators/hobo/rapid/templates/themes/clean-sidemenu/public/images/300-3B5F87-ACD3E6-H.png +0 -0
- data/{rails_generators/hobo_rapid/templates/themes/clean → lib/generators/hobo/rapid/templates/themes/clean-sidemenu}/public/images/spinner.gif +0 -0
- data/lib/generators/hobo/rapid/templates/themes/clean-sidemenu/public/stylesheets/clean-sidemenu.css +81 -0
- data/lib/generators/hobo/rapid/templates/themes/clean-sidemenu/views/clean-sidemenu.dryml +30 -0
- data/{rails_generators/hobo_rapid → lib/generators/hobo/rapid}/templates/themes/clean/public/images/101-3B5F87-ACD3E6.png +0 -0
- data/{rails_generators/hobo_rapid → lib/generators/hobo/rapid}/templates/themes/clean/public/images/30-3E547A-242E42.png +0 -0
- data/{rails_generators/hobo_rapid → lib/generators/hobo/rapid}/templates/themes/clean/public/images/30-DBE1E5-FCFEF5.png +0 -0
- data/{rails_generators/hobo_rapid → lib/generators/hobo/rapid}/templates/themes/clean/public/images/300-ACD3E6-fff.png +0 -0
- data/{rails_generators/hobo_rapid → lib/generators/hobo/rapid}/templates/themes/clean/public/images/50-ACD3E6-fff.png +0 -0
- data/{rails_generators/hobo_rapid → lib/generators/hobo/rapid}/templates/themes/clean/public/images/fieldbg.gif +0 -0
- data/{rails_generators/hobo_rapid → lib/generators/hobo/rapid}/templates/themes/clean/public/images/pencil.png +0 -0
- data/{rails_generators/hobo_rapid → lib/generators/hobo/rapid}/templates/themes/clean/public/images/small_close.png +0 -0
- data/lib/generators/hobo/rapid/templates/themes/clean/public/images/spinner.gif +0 -0
- data/{rails_generators/hobo_rapid → lib/generators/hobo/rapid}/templates/themes/clean/public/stylesheets/clean.css +16 -16
- data/{rails_generators/hobo_rapid → lib/generators/hobo/rapid}/templates/themes/clean/public/stylesheets/rapid-ui.css +3 -3
- data/{rails_generators/hobo_rapid → lib/generators/hobo/rapid}/templates/themes/clean/views/clean.dryml +1 -1
- data/lib/generators/hobo/resource/resource_generator.rb +23 -0
- data/lib/generators/hobo/routes/USAGE +9 -0
- data/lib/generators/hobo/routes/router.rb +115 -0
- data/lib/generators/hobo/routes/routes_generator.rb +40 -0
- data/lib/generators/hobo/routes/templates/hobo_routes.rb.erb +33 -0
- data/lib/generators/hobo/setup_wizard/USAGE +4 -0
- data/lib/generators/hobo/setup_wizard/setup_wizard_generator.rb +274 -0
- data/lib/generators/hobo/subsite.rb +48 -0
- data/lib/generators/hobo/subsite/subsite_generator.rb +16 -0
- data/{rails_generators/hobo_subsite → lib/generators/hobo/subsite}/templates/application.dryml +0 -0
- data/{rails_generators/hobo_subsite/templates/controller.rb → lib/generators/hobo/subsite/templates/controller.rb.erb} +1 -1
- data/lib/generators/hobo/subsite_taglib/subsite_taglib_generator.rb +16 -0
- data/{rails_generators/hobo_admin_site/templates/site_taglib.dryml → lib/generators/hobo/subsite_taglib/templates/taglib.dryml.erb} +9 -10
- data/lib/generators/hobo/taglib.rb +12 -0
- data/lib/generators/hobo/test_framework/test_framework_generator.rb +72 -0
- data/lib/generators/hobo/test_options.rb +19 -0
- data/{rails_generators/hobo_user_controller → lib/generators/hobo/user_controller}/templates/accept_invitation.dryml +0 -0
- data/lib/generators/hobo/user_controller/templates/controller.rb.erb +31 -0
- data/lib/generators/hobo/user_controller/user_controller_generator.rb +25 -0
- data/lib/generators/hobo/user_mailer/templates/activation.erb +9 -0
- data/{rails_generators/hobo_user_model → lib/generators/hobo/user_mailer}/templates/forgot_password.erb +2 -2
- data/{rails_generators/hobo_user_model → lib/generators/hobo/user_mailer}/templates/invite.erb +2 -2
- data/lib/generators/hobo/user_mailer/templates/mailer.rb.erb +25 -0
- data/lib/generators/hobo/user_mailer/user_mailer_generator.rb +33 -0
- data/lib/generators/hobo/user_model/USAGE +12 -0
- data/{rails_generators/hobo_user_model/templates/model.rb → lib/generators/hobo/user_model/templates/model_injection.rb.erb} +40 -20
- data/lib/generators/hobo/user_model/user_model_generator.rb +23 -0
- data/lib/generators/hobo/user_resource/user_resource_generator.rb +27 -0
- data/lib/hobo.rb +29 -129
- data/lib/hobo/controller.rb +37 -47
- data/lib/hobo/controller/authentication_support.rb +109 -0
- data/lib/hobo/{model_controller.rb → controller/model.rb} +71 -79
- data/lib/hobo/{user_controller.rb → controller/user.rb} +59 -49
- data/lib/hobo/engine.rb +80 -0
- data/lib/hobo/extensions/action_controller/hobo_methods.rb +44 -0
- data/lib/hobo/extensions/action_mailer/helper.rb +38 -0
- data/lib/{action_view_extensions/helpers → hobo/extensions/action_view}/tag_helper.rb +5 -2
- data/lib/hobo/extensions/action_view/translation_helper.rb +25 -0
- data/lib/hobo/extensions/active_model/name.rb +16 -0
- data/lib/hobo/extensions/active_model/translation.rb +35 -0
- data/lib/{active_record/association_collection.rb → hobo/extensions/active_record/associations/collection.rb} +8 -17
- data/lib/{active_record/association_proxy.rb → hobo/extensions/active_record/associations/proxy.rb} +6 -7
- data/lib/hobo/extensions/active_record/associations/reflection.rb +23 -0
- data/lib/hobo/extensions/active_record/associations/scope.rb +35 -0
- data/lib/hobo/extensions/active_record/hobo_methods.rb +11 -0
- data/lib/hobo/extensions/active_record/permissions.rb +159 -0
- data/lib/hobo/extensions/active_record/relation_with_origin.rb +28 -0
- data/lib/hobo/extensions/array.rb +27 -0
- data/lib/hobo/extensions/enumerable.rb +12 -0
- data/lib/hobo/extensions/i18n.rb +17 -0
- data/lib/hobo/{hobo_helper.rb → helper.rb} +58 -31
- data/lib/hobo/helper/translations.rb +54 -0
- data/lib/hobo/helper/translations/normalizer.rb +39 -0
- data/lib/hobo/model.rb +61 -95
- data/lib/hobo/model/accessible_associations.rb +178 -0
- data/lib/hobo/{find_for.rb → model/find_for.rb} +17 -17
- data/lib/hobo/model/guest.rb +25 -0
- data/lib/hobo/model/include_in_save.rb +55 -0
- data/lib/hobo/model/lifecycles.rb +119 -0
- data/lib/hobo/model/lifecycles/actions.rb +146 -0
- data/lib/hobo/model/lifecycles/creator.rb +74 -0
- data/lib/hobo/model/lifecycles/lifecycle.rb +243 -0
- data/lib/hobo/model/lifecycles/state.rb +22 -0
- data/lib/hobo/model/lifecycles/transition.rb +70 -0
- data/lib/hobo/model/permissions.rb +448 -0
- data/lib/hobo/model/scopes.rb +38 -0
- data/lib/hobo/model/scopes/apply_scopes.rb +21 -0
- data/lib/hobo/model/scopes/automatic_scopes.rb +428 -0
- data/lib/hobo/model/user_base.rb +184 -0
- data/lib/hobo/model/view_hints.rb +123 -0
- data/{rapid_generators → lib/hobo/rapid/generators}/rapid/cards.dryml.erb +2 -2
- data/{rapid_generators → lib/hobo/rapid/generators}/rapid/forms.dryml.erb +3 -3
- data/{rapid_generators → lib/hobo/rapid/generators}/rapid/pages.dryml.erb +38 -51
- data/lib/hobo/rapid/helper.rb +166 -0
- data/{taglibs → lib/hobo/rapid/taglibs}/rapid.dryml +6 -5
- data/{taglibs → lib/hobo/rapid/taglibs}/rapid_core.dryml +286 -118
- data/{taglibs → lib/hobo/rapid/taglibs}/rapid_document_tags.dryml +2 -2
- data/{taglibs → lib/hobo/rapid/taglibs}/rapid_editing.dryml +45 -45
- data/{taglibs → lib/hobo/rapid/taglibs}/rapid_forms.dryml +190 -158
- data/{taglibs → lib/hobo/rapid/taglibs}/rapid_generics.dryml +12 -9
- data/lib/hobo/rapid/taglibs/rapid_i18n.dryml +107 -0
- data/{taglibs → lib/hobo/rapid/taglibs}/rapid_lifecycles.dryml +7 -7
- data/{taglibs → lib/hobo/rapid/taglibs}/rapid_navigation.dryml +15 -15
- data/{taglibs → lib/hobo/rapid/taglibs}/rapid_pages.dryml +37 -36
- data/{taglibs → lib/hobo/rapid/taglibs}/rapid_plus.dryml +107 -43
- data/{taglibs → lib/hobo/rapid/taglibs}/rapid_summary.dryml +28 -57
- data/{taglibs → lib/hobo/rapid/taglibs}/rapid_support.dryml +9 -9
- data/{taglibs → lib/hobo/rapid/taglibs}/rapid_user_pages.dryml +41 -40
- data/lib/hobo/routes.rb +31 -0
- data/{doctest → test/doctest}/hobo/hobo_helper.rdoctest +11 -11
- data/test/irt/generators/admin_subsite.irt +27 -0
- data/test/irt/generators/assets.irt +16 -0
- data/test/irt/generators/controller.irt +6 -0
- data/test/irt/generators/front_controller.irt +30 -0
- data/test/irt/generators/helper.rb +31 -0
- data/test/irt/generators/model.irt +28 -0
- data/test/irt/generators/partials/_account_user_model_tests.rb +21 -0
- data/test/irt/generators/partials/_accounts_users_controller_tests.rb +15 -0
- data/test/irt/generators/partials/_default_user_model_tests.rb +21 -0
- data/test/irt/generators/partials/_default_users_controller_tests.rb +16 -0
- data/test/irt/generators/partials/_house_controller_tests.rb +15 -0
- data/test/irt/generators/partials/_house_model_tests.rb +18 -0
- data/test/irt/generators/partials/_subsite_taglib_admin.rb +4 -0
- data/test/irt/generators/partials/_subsite_taglib_admin_invite_only.rb +3 -0
- data/test/irt/generators/partials/_subsite_taglib_noopt.rb +4 -0
- data/test/irt/generators/partials/_subsite_taglib_variables.rb +27 -0
- data/test/irt/generators/partials/_user_mailer_tests.rb +19 -0
- data/test/irt/generators/rapid.irt +29 -0
- data/test/irt/generators/resource.irt +8 -0
- data/test/irt/generators/subsite.irt +52 -0
- data/test/irt/generators/subsite_taglib.irt +23 -0
- data/test/irt/generators/test_framework.irt +62 -0
- data/test/irt/generators/user_controller.irt +10 -0
- data/test/irt/generators/user_mailer.irt +20 -0
- data/test/irt/generators/user_model.irt +10 -0
- data/test/irt/generators/user_resource.irt +14 -0
- data/test/irt/readme.txt +7 -0
- data/test/permissions/models/models.rb +27 -24
- data/test/permissions/test_permissions.rb +104 -104
- metadata +239 -217
- data/lib/active_record/association_reflection.rb +0 -20
- data/lib/active_record/viewhints_validations_interceptor.rb +0 -9
- data/lib/hobo/accessible_associations.rb +0 -183
- data/lib/hobo/authentication_support.rb +0 -131
- data/lib/hobo/generator.rb +0 -26
- data/lib/hobo/guest.rb +0 -25
- data/lib/hobo/include_in_save.rb +0 -55
- data/lib/hobo/lifecycles.rb +0 -137
- data/lib/hobo/lifecycles/actions.rb +0 -142
- data/lib/hobo/lifecycles/creator.rb +0 -72
- data/lib/hobo/lifecycles/lifecycle.rb +0 -249
- data/lib/hobo/lifecycles/state.rb +0 -22
- data/lib/hobo/lifecycles/transition.rb +0 -70
- data/lib/hobo/model_router.rb +0 -290
- data/lib/hobo/permissions.rb +0 -451
- data/lib/hobo/permissions/associations.rb +0 -175
- data/lib/hobo/rapid_helper.rb +0 -157
- data/lib/hobo/scopes.rb +0 -43
- data/lib/hobo/scopes/apply_scopes.rb +0 -23
- data/lib/hobo/scopes/association_proxy_extensions.rb +0 -62
- data/lib/hobo/scopes/automatic_scopes.rb +0 -421
- data/lib/hobo/scopes/named_scope_extensions.rb +0 -39
- data/lib/hobo/tasks/rails.rb +0 -4
- data/lib/hobo/translations.rb +0 -93
- data/lib/hobo/undefined_access_error.rb +0 -5
- data/lib/hobo/user.rb +0 -182
- data/lib/hobo/view_hints.rb +0 -115
- data/rails/init.rb +0 -10
- data/rails_generators/hobo/USAGE +0 -4
- data/rails_generators/hobo/hobo_generator.rb +0 -53
- data/rails_generators/hobo/templates/application.dryml +0 -1
- data/rails_generators/hobo/templates/initializer.rb +0 -2
- data/rails_generators/hobo_admin_site/USAGE +0 -16
- data/rails_generators/hobo_admin_site/hobo_admin_site_generator.rb +0 -45
- data/rails_generators/hobo_admin_site/templates/admin.css +0 -2
- data/rails_generators/hobo_admin_site/templates/users_index.dryml +0 -5
- data/rails_generators/hobo_front_controller/hobo_front_controller_generator.rb +0 -95
- data/rails_generators/hobo_front_controller/templates/functional_test.rb +0 -8
- data/rails_generators/hobo_front_controller/templates/helper.rb +0 -2
- data/rails_generators/hobo_model/USAGE +0 -25
- data/rails_generators/hobo_model/hobo_model_generator.rb +0 -43
- data/rails_generators/hobo_model/templates/fixtures.yml +0 -6
- data/rails_generators/hobo_model/templates/hints.rb +0 -7
- data/rails_generators/hobo_model/templates/unit_test.rb +0 -8
- data/rails_generators/hobo_model_controller/USAGE +0 -30
- data/rails_generators/hobo_model_controller/hobo_model_controller_generator.rb +0 -46
- data/rails_generators/hobo_model_controller/templates/controller.rb +0 -7
- data/rails_generators/hobo_model_controller/templates/functional_test.rb +0 -8
- data/rails_generators/hobo_model_controller/templates/helper.rb +0 -2
- data/rails_generators/hobo_model_resource/USAGE +0 -38
- data/rails_generators/hobo_model_resource/hobo_model_resource_generator.rb +0 -73
- data/rails_generators/hobo_model_resource/templates/controller.rb +0 -7
- data/rails_generators/hobo_model_resource/templates/functional_test.rb +0 -8
- data/rails_generators/hobo_model_resource/templates/helper.rb +0 -2
- data/rails_generators/hobo_rapid/hobo_rapid_generator.rb +0 -94
- data/rails_generators/hobo_subsite/USAGE +0 -16
- data/rails_generators/hobo_subsite/hobo_subsite_generator.rb +0 -73
- data/rails_generators/hobo_subsite/templates/site_taglib.dryml +0 -13
- data/rails_generators/hobo_user_controller/USAGE +0 -34
- data/rails_generators/hobo_user_controller/hobo_user_controller_generator.rb +0 -65
- data/rails_generators/hobo_user_controller/templates/controller.rb +0 -29
- data/rails_generators/hobo_user_controller/templates/functional_test.rb +0 -8
- data/rails_generators/hobo_user_controller/templates/helper.rb +0 -2
- data/rails_generators/hobo_user_model/USAGE +0 -16
- data/rails_generators/hobo_user_model/hobo_user_model_generator.rb +0 -46
- data/rails_generators/hobo_user_model/templates/fixtures.yml +0 -19
- data/rails_generators/hobo_user_model/templates/mailer.rb +0 -29
- data/rails_generators/hobo_user_model/templates/unit_test.rb +0 -8
- data/script/destroy +0 -14
- data/script/generate +0 -14
- data/taglibs/rapid_translations.dryml +0 -36
- data/tasks/environments.rake +0 -19
- data/tasks/hobo_tasks.rake +0 -58
- data/test/generators/test_generator_helper.rb +0 -29
- data/test/generators/test_helper.rb +0 -1
- data/test/generators/test_hobo_model_controller_generator.rb +0 -56
@@ -18,16 +18,18 @@
|
|
18
18
|
<!-- Renders a message such as "No products to display". If the collection (`this`) is empty, `style="display:none"` is added. This means the message is still present and can be revealed with JavaScript if all items in the collection are removed with ajax remove buttons.
|
19
19
|
-->
|
20
20
|
<def tag="empty-collection-message">
|
21
|
-
<
|
22
|
-
<
|
23
|
-
|
24
|
-
|
25
|
-
|
21
|
+
<unless test="&this.member_class.nil?">
|
22
|
+
<div class="empty-collection-message" style="#{'display:none' if !this.empty?}" param="default">
|
23
|
+
<ht key="#{this.member_class.name.underscore}.collection.empty_message">
|
24
|
+
No <collection-name/> to display
|
25
|
+
</ht>
|
26
|
+
</div>
|
27
|
+
</unless>
|
26
28
|
</def>
|
27
29
|
|
28
30
|
|
29
31
|
<!-- Repeats the body of the tag inside a `<ul>` list with one item for each object in the collection (`this`). If no body is given, renders a `<card>` inside the `<li>`.
|
30
|
-
|
32
|
+
|
31
33
|
The `<li>` tags are automatically given a 'model ID' CSS class, which means the ajax `<remove-button>` will automatically be able to remove items from the collection. Also adds 'even' and 'odd' CSS classes.
|
32
34
|
-->
|
33
35
|
<def tag="collection">
|
@@ -39,7 +41,8 @@ The `<li>` tags are automatically given a 'model ID' CSS class, which means the
|
|
39
41
|
<empty-collection-message param="empty-message"/>
|
40
42
|
</def>
|
41
43
|
|
42
|
-
<!-- Renders a
|
43
|
-
<def tag="record-flags" attrs="fields"><%=
|
44
|
-
|
44
|
+
<!-- Renders a `separator` separated list of any fields passed in the `fields` attribute that are true (in the Ruby sense). For example, if a forum post had a boolean field `sticky`, this tag can be used to automatically label sticky posts "Sticky". Similarly, you could automatically add an "Administrator" label to the user's home page (this is seen in the default Hobo app). -->
|
45
|
+
<def tag="record-flags" attrs="fields, separator"><%=
|
46
|
+
separator ||= ', '
|
47
|
+
comma_split(fields).select { |f| this.send(f) }.map { |f| this.class.human_attribute_name(f) }.join(separator)
|
45
48
|
%></def>
|
@@ -0,0 +1,107 @@
|
|
1
|
+
<!-- Rapid i18n provides tags related with the Rails-I18n project -->
|
2
|
+
|
3
|
+
<!-- Wrapper around ActiveModel::Name#human
|
4
|
+
|
5
|
+
#### Attributes
|
6
|
+
|
7
|
+
- model - (optional) should be a model class or a record object (default to this)
|
8
|
+
- count - (optional) used to pick the inflected string for the model. It should be an integer.
|
9
|
+
-->
|
10
|
+
|
11
|
+
<def tag="model-name-human" attrs="model, count"><%=
|
12
|
+
model ||= this
|
13
|
+
model = model.class unless model.kind_of? Class
|
14
|
+
# prepare symbolized attributes for merging
|
15
|
+
attrs = {}
|
16
|
+
all_attributes.each_pair{|k,v| attrs[k.to_sym] = v}
|
17
|
+
model.model_name.human( attrs )
|
18
|
+
%>
|
19
|
+
</def>
|
20
|
+
|
21
|
+
|
22
|
+
<!-- Wrapper around ActiveRecord::Base.human_attribute_name.
|
23
|
+
|
24
|
+
#### Attributes
|
25
|
+
|
26
|
+
- attribute - the attribute to lookup
|
27
|
+
- model - (optional) should be a model class or a record object (default to this)
|
28
|
+
- count - (optional) should be an integer
|
29
|
+
|
30
|
+
-->
|
31
|
+
|
32
|
+
<def tag="human-attribute-name" attrs="attribute, model"><%=
|
33
|
+
model ||= this
|
34
|
+
model = model.class unless model.kind_of? Class
|
35
|
+
# prepare symbolized attributes for merging
|
36
|
+
attrs = {}
|
37
|
+
all_attributes.each_pair{|k,v| attrs[k.to_sym] = v}
|
38
|
+
model.human_attribute_name( attribute.to_sym, attrs )
|
39
|
+
%>
|
40
|
+
</def>
|
41
|
+
|
42
|
+
<!-- Used to localize and pluralize collection names.
|
43
|
+
A collection name is a special case of an attribute name, (indeed you should store the collection names as attribute names in the locale files), so this tag internally uses human_attribute_name to return them.
|
44
|
+
|
45
|
+
With the `your` attribute and in the special case the context is a Hobo::Model::UserMixin instance it automatically embeds the `your` tag funtionality. (note: :name is added by default as an interpolable variable)
|
46
|
+
|
47
|
+
### Attributes
|
48
|
+
|
49
|
+
- collection - the attribute/collection key to lookup in the `activerecord.attributes` namespace. (e.g. 'roles')
|
50
|
+
- count - used to pick the inflected string for the collection. It should be an integer.
|
51
|
+
- your - wraps the collection name in a `Your` tag
|
52
|
+
|
53
|
+
### Example
|
54
|
+
|
55
|
+
|
56
|
+
it:
|
57
|
+
activerecord:
|
58
|
+
attributes:
|
59
|
+
post:
|
60
|
+
comments:
|
61
|
+
one: "Commento"
|
62
|
+
other: "Commenti"
|
63
|
+
user:
|
64
|
+
roles:
|
65
|
+
one: "Ruolo"
|
66
|
+
other: "Ruoli"
|
67
|
+
tags:
|
68
|
+
your:
|
69
|
+
roles:
|
70
|
+
current_user:
|
71
|
+
one: "Il tuo Ruolo"
|
72
|
+
other: "I tuoi Ruoli"
|
73
|
+
other_user:
|
74
|
+
one: "Ruolo di {{name}}"
|
75
|
+
other: Ruoli di {{name}}"
|
76
|
+
|
77
|
+
# context is a Post instance ('your' is ignored)
|
78
|
+
<human-collection-name collection="comments" count="&user.comments.count" your/>
|
79
|
+
I18n.locale = :en => "Comment" or "Comments"
|
80
|
+
I18n.locale = :it => "Commento" or "Commenti"
|
81
|
+
|
82
|
+
# context is an User instance
|
83
|
+
<human-collection-name collection="roles' count="&user.roles.count" your/>
|
84
|
+
I18n.locale = :en => "Your Role" or "Jim's Role" or "Your Roles" or "Jim's Roles"
|
85
|
+
I18n.locale = :it => "Il tuo Ruolo" or "Il Ruolo di Jim" or "I tuoi Ruoli" or "I Ruoli di Jim"
|
86
|
+
(output is the same as <Your key="roles" count=>"&user.roles.count"/> )
|
87
|
+
|
88
|
+
<human-collection-name collection="roles" count="&user.roles.count"/>
|
89
|
+
I18n.locale = :en => "Role" or "Roles"
|
90
|
+
I18n.locale = :it => "Ruolo" or "Ruoli"
|
91
|
+
-->
|
92
|
+
<def tag="human-collection-name" attrs="collection, count, your"><%
|
93
|
+
raise Hobo::Error, "The 'collection' attribute must be defined" if collection.blank?
|
94
|
+
belong_class = this.kind_of?(Class) ? this : this.class
|
95
|
+
raise Hobo::Error, "The context is not an ActiveRecord::Base instance or class. (this = #{this.typed_id rescue this.inspect})" unless belong_class < ActiveRecord::Base
|
96
|
+
# prepare symbolized attributes for merging
|
97
|
+
attrs = {}
|
98
|
+
all_attributes.each_pair{|k,v| attrs[k.to_sym] = v} -%>
|
99
|
+
<% if your && belong_class < Hobo::Model::UserBase && this.kind_of?(Hobo::Model::UserBase) && I18n.locale == :en -%>
|
100
|
+
<your key="&collection" merge-attrs="&{:name=>this.name}.merge(attrs)" capitalize>
|
101
|
+
<%= belong_class.human_attribute_name(collection.to_sym, attrs) %>
|
102
|
+
</your>
|
103
|
+
<% else -%>
|
104
|
+
<%= belong_class.human_attribute_name( collection.to_sym, attrs ) %>
|
105
|
+
<% end %>
|
106
|
+
</def>
|
107
|
+
|
@@ -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
|
|
@@ -21,11 +21,11 @@ Transitions with parameters are implemented using a form. HTML does not allow f
|
|
21
21
|
end
|
22
22
|
transition_name = transition.name
|
23
23
|
has_params = !transition.options[:params].blank?
|
24
|
-
ajax_attributes, html_attributes = attributes.partition_hash(Hobo::
|
24
|
+
ajax_attributes, html_attributes = attributes.partition_hash(Hobo::Rapid::Helper::AJAX_ATTRS)
|
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,9 +48,9 @@ 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
|
-
<% ajax_attrs, html_attrs = attributes.partition_hash(Hobo::
|
53
|
+
<% ajax_attrs, html_attrs = attributes.partition_hash(Hobo::Rapid::Helper::AJAX_ATTRS) %>
|
54
54
|
<div merge-attrs="&html_attrs" class="transitions">
|
55
55
|
<% transitions = this.lifecycle.publishable_transitions_for(current_user) %>
|
56
56
|
<if test="&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>
|
@@ -1,13 +1,13 @@
|
|
1
1
|
<!-- Support for navigation links, account navigation (log in, out etc.) and pagination navigation. -->
|
2
2
|
|
3
3
|
<!-- General purpose navigation bar. Renders a `<ul class="navigation">`. This tag is intended to be used in conunction with `<nav-item>`. The main feature of this pair of tags (over, say, just using a plain `<ul>` list), is that it's easy to have a 'current' CSS class added to the appropriate nav item (so you can highlight the page/section the user is)
|
4
|
-
|
4
|
+
|
5
5
|
The main navigation in the default hobo app is implemented with `<navigation>` but this tag is also appropriate for any sub-navigation.
|
6
|
-
|
6
|
+
|
7
7
|
### Attributes
|
8
8
|
|
9
|
-
- `current` - the textual content of the nav item that should have the 'current' CSS class added (see example)
|
10
|
-
|
9
|
+
- `current` - the textual content of the nav item that should have the 'current' CSS class added (see example)
|
10
|
+
|
11
11
|
### Example
|
12
12
|
|
13
13
|
The normal usage is to define your own navigation tag that calls `<navigation>`.
|
@@ -25,7 +25,7 @@ Then in your pages you can call the tag like this
|
|
25
25
|
- On the 'red' page: `<sub-nav current="red"/>`
|
26
26
|
- On the 'green' page: `<sub-nav current="green"/>`
|
27
27
|
- and so on.
|
28
|
-
|
28
|
+
|
29
29
|
-->
|
30
30
|
<def tag="navigation" attrs="current">
|
31
31
|
<ul class="navigation" merge-attrs>
|
@@ -57,7 +57,7 @@ Example 2: navigation based on a collection of items. Each item will be transfo
|
|
57
57
|
|
58
58
|
-->
|
59
59
|
<def tag="nav-item" attrs="name">
|
60
|
-
<% body = parameters.default
|
60
|
+
<% body = parameters.default
|
61
61
|
body = h(this.to_s) if body.blank?
|
62
62
|
name ||= body.gsub(/<.*?>/, '').strip
|
63
63
|
-%>
|
@@ -69,7 +69,7 @@ Example 2: navigation based on a collection of items. Each item will be transfo
|
|
69
69
|
|
70
70
|
|
71
71
|
<!-- Account Navigation (log in / out / signup)
|
72
|
-
|
72
|
+
|
73
73
|
When logged in, this renders:
|
74
74
|
|
75
75
|
- "Logged in as ..."
|
@@ -80,22 +80,22 @@ When not logged in, renders:
|
|
80
80
|
|
81
81
|
- Log in link
|
82
82
|
- Sign up link
|
83
|
-
|
83
|
+
|
84
84
|
This is a simple tag - just look at the source if you need to know more detail.
|
85
85
|
|
86
86
|
-->
|
87
87
|
<def tag="account-nav">
|
88
88
|
<do with="¤t_user">
|
89
89
|
<ul class="navigation account-nav" param>
|
90
|
-
<li if="&
|
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"><
|
93
|
-
<li class='nav-item' param="account"><a action="account"><
|
94
|
-
<li class='nav-item' param="log-out"><a href="&logout_url"><
|
92
|
+
<li class='nav-item' param="logged-in-as"><a to="¤t_user"><t key="hobo.actions.logged_in_as" name="&name">Logged in as <name/></t></a></li>
|
93
|
+
<li class='nav-item' param="account"><a action="account"><t key="hobo.actions.account">Account</t></a></li>
|
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>
|
96
96
|
<else>
|
97
|
-
<li class='nav-item' param="log-in"><a href="&login_url"><
|
98
|
-
<li if="&signup_url" class="nav-item" param="sign-up"><a href="&signup_url"><
|
97
|
+
<li class='nav-item' param="log-in"><a href="&login_url"><t key="hobo.actions.login">Log in</t></a></li>
|
98
|
+
<li if="&signup_url" class="nav-item" param="sign-up"><a href="&signup_url"><t key="hobo.actions.signup">Sign up</t></a></li>
|
99
99
|
</else>
|
100
100
|
</ul>
|
101
101
|
</do>
|
@@ -104,5 +104,5 @@ This is a simple tag - just look at the source if you need to know more detail.
|
|
104
104
|
|
105
105
|
<!--- A simple wrapper around the `will_paginate` helper. All options to `will_paginate` are available as attributes -->
|
106
106
|
<def tag="page-nav">
|
107
|
-
<%= will_paginate this, attributes.symbolize_keys.reverse_merge(:inner_window => 2, :previous_label => translate("hobo.actions.previous", :default=>"
|
107
|
+
<%= will_paginate this, attributes.symbolize_keys.reverse_merge(:inner_window => 2, :previous_label => translate("hobo.actions.previous", :default=>"« Prev"), :next_label =>translate("hobo.actions.next", :default=>"Next »")) %>
|
108
108
|
</def>
|
@@ -1,15 +1,15 @@
|
|
1
1
|
<!-- Rapid-Pages provides tags for working with entire pages. It includes the main `<page>` tag which is the starting point for all pages in Rapid, various supporting tags for things such as stylesheet and javascript includes. Also defines the standard error pages for permission-denied and not-found.
|
2
2
|
-->
|
3
|
-
|
3
|
+
|
4
4
|
<!-- The basic page structure for all the pages in a Hobo Rapid application. Providing the doctype, page title, standard stylesheet javascript includes, the ajax progress spinner, default header with app-name, account navigation, main navigation, and live search, empty section for the page content, flash message (if any) and an empty page footer.
|
5
|
-
|
5
|
+
|
6
6
|
The easiest way to see what this tag does is to look at the source.
|
7
|
-
|
7
|
+
|
8
8
|
### Attributes
|
9
9
|
|
10
10
|
- `title` - the page title, will have ": `<app-name>`" appended
|
11
11
|
- `full-title` - the full page title. Set this if you do not want the app name suffix.
|
12
|
-
|
12
|
+
|
13
13
|
-->
|
14
14
|
<def tag="page" attrs="title, full-title">
|
15
15
|
<% full_title ||= "#{title} : #{app_name}" %>
|
@@ -17,14 +17,14 @@ The easiest way to see what this tag does is to look at the source.
|
|
17
17
|
<head param>
|
18
18
|
<title param><%= strip_tags full_title %></title>
|
19
19
|
<do param="stylesheets">
|
20
|
-
<!-- note that this is probably overridden in your app/views/taglibs/themes/xxx/xxx.dryml -->
|
20
|
+
<!-- note that this is probably overridden in your app/views/taglibs/themes/xxx/xxx.dryml -->
|
21
21
|
<stylesheet name="reset, hobo-rapid"/>
|
22
22
|
<theme-stylesheet />
|
23
23
|
<stylesheet name="application" param="app-stylesheet"/>
|
24
24
|
</do>
|
25
25
|
|
26
26
|
<do param="scripts">
|
27
|
-
<javascript param name="prototype, effects, dragdrop, controls, lowpro, hobo-rapid"/>
|
27
|
+
<javascript param name="prototype, effects, dragdrop, controls, rails, lowpro, hobo-rapid"/>
|
28
28
|
<if-ie version="lt IE 7" param="fix-ie6">
|
29
29
|
<javascript name="IE7"/>
|
30
30
|
<javascript name="ie7-recalc"/>
|
@@ -32,13 +32,14 @@ The easiest way to see what this tag does is to look at the source.
|
|
32
32
|
<do param="custom-scripts"/>
|
33
33
|
<javascript param="application-javascript" name="application"/>
|
34
34
|
</do>
|
35
|
+
<%= csrf_meta_tag %>
|
35
36
|
</head>
|
36
37
|
|
37
38
|
<body param>
|
38
39
|
<set-scoped flash-rendered="&false">
|
39
40
|
<ajax-progress param/>
|
40
41
|
<header class="page-header" param>
|
41
|
-
<account-nav if="&login_url(Hobo::
|
42
|
+
<account-nav if="&login_url(Hobo::Model::UserBase.default_user_model)" param/>
|
42
43
|
<h1 param="app-name"><a href="#{base_url}/"><app-name/></a></h1>
|
43
44
|
<live-search param if="&defined_route? :site_search"/>
|
44
45
|
<main-nav current="&title" param/>
|
@@ -54,10 +55,10 @@ The easiest way to see what this tag does is to look at the source.
|
|
54
55
|
|
55
56
|
<!-- Renderes dynamically generated JavaScript required by `hobo-rapid.js`, including the information required to perform automatic part updates -->
|
56
57
|
<def tag="page-scripts">
|
57
|
-
<
|
58
|
+
<do param="default">
|
58
59
|
<hobo-rapid-javascripts/>
|
59
|
-
<part-contexts-
|
60
|
-
</
|
60
|
+
<part-contexts-javascripts/>
|
61
|
+
</do>
|
61
62
|
</def>
|
62
63
|
|
63
64
|
|
@@ -71,11 +72,11 @@ The easiest way to see what this tag does is to look at the source.
|
|
71
72
|
<def tag="edit-page" polymorphic/>
|
72
73
|
|
73
74
|
<!-- The page rendered by default in the case of a permission-denied error
|
74
|
-
|
75
|
+
|
75
76
|
### Attributes
|
76
77
|
|
77
78
|
- `message` - The main message to display. Defaults to "That operation is not allowed"
|
78
|
-
|
79
|
+
|
79
80
|
-->
|
80
81
|
<def tag="permission-denied-page" attrs="message">
|
81
82
|
<% message ||= "That operation is not allowed" %>
|
@@ -97,14 +98,14 @@ The easiest way to see what this tag does is to look at the source.
|
|
97
98
|
|
98
99
|
|
99
100
|
<!-- The page rendered by default in the case of a not-found error
|
100
|
-
|
101
|
+
|
101
102
|
### Attributes
|
102
103
|
|
103
|
-
- `message` - The main message to display. Defaults to "The page you
|
104
|
-
|
104
|
+
- `message` - The main message to display. Defaults to "The page you requested cannot be found."
|
105
|
+
|
105
106
|
-->
|
106
107
|
<def tag="not-found-page" attrs="message">
|
107
|
-
<% message ||= "The page you
|
108
|
+
<% message ||= t("hobo.messages.not_found", :default=>["The page you requested cannot be found."]) %>
|
108
109
|
<page merge>
|
109
110
|
<body: class="not-found"/>
|
110
111
|
<content: param>
|
@@ -117,53 +118,53 @@ The easiest way to see what this tag does is to look at the source.
|
|
117
118
|
|
118
119
|
|
119
120
|
<!-- Renders one of five HTML DOCTYPE declarations, according to the `version` attribute.
|
120
|
-
|
121
|
+
|
121
122
|
### Attributes
|
122
123
|
- 'version' - the doctype version, must be one of:
|
123
|
-
|
124
|
+
|
124
125
|
- HTML 4.01 STRICT
|
125
126
|
- HTML 4.01 TRANSITIONAL
|
126
127
|
- XHTML 1.0 STRICT
|
127
128
|
- XHTML 1.0 TRANSITIONAL
|
128
129
|
- XHTML 1.1
|
129
|
-
|
130
|
+
|
130
131
|
See the source for the actual output
|
131
132
|
|
132
133
|
-->
|
133
|
-
<def tag="doctype" attrs="version"><%=
|
134
|
+
<def tag="doctype" attrs="version"><%=raw(
|
134
135
|
case version.upcase
|
135
136
|
when "HTML 4.01 STRICT"
|
136
|
-
'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" ' +
|
137
|
+
'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" ' +
|
137
138
|
'"http://www.w3.org/TR/html4/strict.dtd">'
|
138
139
|
when "HTML 4.01 TRANSITIONAL"
|
139
|
-
'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" ' +
|
140
|
+
'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" ' +
|
140
141
|
'"http://www.w3.org/TR/html4/loose.dtd">'
|
141
142
|
when "XHTML 1.0 STRICT"
|
142
|
-
'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" ' +
|
143
|
+
'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" ' +
|
143
144
|
'"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">'
|
144
145
|
when "XHTML 1.0 TRANSITIONAL"
|
145
|
-
'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" ' +
|
146
|
+
'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" ' +
|
146
147
|
'"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'
|
147
148
|
when "XHTML 1.1"
|
148
|
-
'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" ' +
|
149
|
+
'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" ' +
|
149
150
|
'"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">'
|
150
|
-
end
|
151
|
+
end)
|
151
152
|
%></def>
|
152
153
|
|
153
154
|
|
154
155
|
<!-- Renders an `<html>` tag along with the DOCTYPE specified in the `doctype` attribute.
|
155
|
-
|
156
|
+
|
156
157
|
### Attributes
|
157
|
-
|
158
|
+
|
158
159
|
- `doctype` - the version of the DOCTYPE required. See the `version` attribute to `<doctype>`
|
159
160
|
-->
|
160
161
|
<def tag="html" attrs="doctype">
|
161
162
|
<% doctype ||= 'XHTML 1.0 TRANSITIONAL' -%>
|
162
163
|
<doctype version="&doctype"/>
|
163
164
|
<% attributes.reverse_merge!(:xmlns => "http://www.w3.org/1999/xhtml") if doctype.upcase =~ /^XHTML/ -%>
|
164
|
-
<%= "<html#{tag_options(attributes)}>" %>
|
165
|
+
<%=raw "<html#{tag_options(attributes, true)}>" %>
|
165
166
|
<set-scoped xmldoctype="&doctype.upcase =~ /^XHTML/"><do param="default"/></set-scoped>
|
166
|
-
<%= "</html>" %>
|
167
|
+
<%=raw "</html>" %>
|
167
168
|
</def>
|
168
169
|
|
169
170
|
<!-- empty tags should be written as <br> in HTML and <br /> in XHTML -->
|
@@ -192,15 +193,15 @@ See the source for the actual output
|
|
192
193
|
|
193
194
|
|
194
195
|
<!-- Renders a conditional comment in order to have some content ignored by all browsers other than Internet Explorer
|
195
|
-
|
196
|
-
### Example
|
196
|
+
|
197
|
+
### Example
|
197
198
|
|
198
199
|
|
199
200
|
<if-ie version="lt IE 7"> ... </if-ie>
|
200
|
-
|
201
|
+
|
201
202
|
-->
|
202
203
|
<def tag="if-ie" attrs="version">
|
203
|
-
<%= "<!--[if #{version || 'IE'}]>" %><do param="default"/><%= "<![endif]-->" %>
|
204
|
+
<%=raw "<!--[if #{version || 'IE'}]>" %><do param="default"/><%=raw "<![endif]-->" %>
|
204
205
|
</def>
|
205
206
|
|
206
207
|
<!-- Simple wrapper for the `stylesheet_link_tag` helper. The `name` attribute can be a comma-separated list of stylesheet names.
|
@@ -229,7 +230,7 @@ See the source for the actual output
|
|
229
230
|
### Attributes
|
230
231
|
|
231
232
|
- `type` - which flash message to display. Defaults to `:notice`
|
232
|
-
|
233
|
+
|
233
234
|
### CSS Classes
|
234
235
|
|
235
236
|
The flash is output in a `<div class="flash notice">`, where `notice` is the `type` specified.
|
@@ -245,7 +246,7 @@ The flash is output in a `<div class="flash notice">`, where `notice` is the `ty
|
|
245
246
|
<def tag="flash-messages" attrs="names"><%=
|
246
247
|
scope.flash_rendered = true if scope.respond_to? :flash_rendered
|
247
248
|
names = names.nil? ? flash.keys : comma_split(names)
|
248
|
-
names.map { |name| flash_message :type => name }.
|
249
|
+
names.map { |name| flash_message :type => name }.safe_join
|
249
250
|
%></def>
|
250
251
|
|
251
252
|
<!-- Renders `<div id="ajax-progress"><div><span id="ajax-progress-text"></span></div></div>`. The theme will style this as an ajax progress 'spinner' -->
|