tenon 1.1.8 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.rdoc +768 -69
- data/Rakefile +7 -13
- data/app/assets/javascripts/tenon/application.js +4 -0
- data/app/controllers/tenon/assets_controller.rb +22 -23
- data/app/controllers/tenon/base_controller.rb +22 -13
- data/app/controllers/tenon/index_controller.rb +0 -4
- data/app/controllers/tenon/item_versions_controller.rb +20 -8
- data/app/controllers/tenon/resources_controller.rb +100 -30
- data/app/controllers/tenon/simple_resources_controller.rb +7 -7
- data/app/controllers/tenon/styleguides_controller.rb +10 -0
- data/app/decorators/tenon/application_decorator.rb +4 -8
- data/app/decorators/tenon/asset_decorator.rb +0 -25
- data/app/filterers/tenon/generic_filterer.rb +24 -0
- data/app/form_builders/tenon/form_builder.rb +189 -19
- data/app/helpers/tenon/active_link_to_helper.rb +9 -0
- data/app/helpers/tenon/application_helper.rb +4 -23
- data/app/helpers/tenon/asset_helper.rb +2 -2
- data/app/helpers/tenon/back_to_index_path_helper.rb +13 -0
- data/app/helpers/tenon/breadcrumbs_helper.rb +33 -0
- data/app/helpers/tenon/flash_helper.rb +14 -0
- data/app/helpers/tenon/icon_helper.rb +7 -0
- data/app/helpers/tenon/input_block_helper.rb +25 -0
- data/app/helpers/tenon/item_version_helper.rb +22 -9
- data/app/helpers/tenon/nav_helper.rb +21 -17
- data/app/helpers/tenon/piece_helper.rb +2 -7
- data/app/helpers/tenon/platform_hints_helper.rb +3 -5
- data/app/helpers/tenon/styleguide_helper.rb +15 -0
- data/app/helpers/tenon/tenon_content_helper.rb +11 -6
- data/app/helpers/tenon/tenon_helper.rb +19 -9
- data/app/models/tenon/application_record.rb +5 -0
- data/app/models/tenon/asset.rb +2 -2
- data/app/models/tenon/item_asset.rb +1 -1
- data/app/models/tenon/item_version.rb +1 -1
- data/app/models/tenon/styleguide.rb +11 -0
- data/app/models/tenon/tenon_content/piece.rb +13 -13
- data/app/models/tenon/tenon_content/row.rb +1 -1
- data/app/models/tenon/tenon_content/row_types/four_column_image.rb +4 -4
- data/app/models/tenon/tenon_content/row_types/four_column_image_and_text.rb +8 -8
- data/app/models/tenon/tenon_content/row_types/four_column_text.rb +4 -4
- data/app/models/tenon/tenon_content/row_types/full_width_embedded_content.rb +1 -1
- data/app/models/tenon/tenon_content/row_types/full_width_image.rb +1 -1
- data/app/models/tenon/tenon_content/row_types/full_width_text.rb +1 -1
- data/app/models/tenon/tenon_content/row_types/left_image_right_text.rb +2 -2
- data/app/models/tenon/tenon_content/row_types/left_text_right_image.rb +2 -2
- data/app/models/tenon/tenon_content/row_types/left_wrapped_image_with_text.rb +2 -2
- data/app/models/tenon/tenon_content/row_types/right_wrapped_image_with_text.rb +2 -2
- data/app/models/tenon/tenon_content/row_types/six_column_image.rb +6 -6
- data/app/models/tenon/tenon_content/row_types/six_column_image_and_text.rb +12 -12
- data/app/models/tenon/tenon_content/row_types/three_column_image.rb +3 -3
- data/app/models/tenon/tenon_content/row_types/three_column_image_and_text.rb +6 -6
- data/app/models/tenon/tenon_content/row_types/three_column_text.rb +3 -3
- data/app/models/tenon/tenon_content/row_types/two_column_image.rb +2 -2
- data/app/models/tenon/tenon_content/row_types/two_column_image_and_text.rb +4 -4
- data/app/models/tenon/tenon_content/row_types/two_column_text.rb +2 -2
- data/app/models/tenon/tenon_content/row_types/two_column_with_background_image.rb +3 -3
- data/app/models/tenon/tenon_content/row_types.rb +17 -17
- data/app/policies/my_settings_policy.rb +2 -0
- data/app/policies/tenon/application_policy.rb +63 -0
- data/app/policies/tenon/asset_policy.rb +4 -0
- data/app/policies/tenon/item_version_policy.rb +4 -0
- data/app/serializers/item_version_serializer.rb +23 -0
- data/app/serializers/tenon/application_serializer.rb +37 -0
- data/app/serializers/tenon/asset_serializer.rb +5 -0
- data/app/serializers/tenon/paginating_serializer.rb +18 -0
- data/app/views/layouts/tenon/application.html.haml +28 -18
- data/app/views/tenon/assets/_form.html.haml +29 -12
- data/app/views/tenon/assets/crop.html.haml +13 -13
- data/app/views/tenon/assets/edit.html.haml +1 -12
- data/app/views/tenon/assets/index.html.haml +5 -19
- data/app/views/tenon/assets/new.html.haml +1 -0
- data/app/views/tenon/fields/_asset.html.haml +26 -27
- data/app/views/tenon/fields/_base.html.haml +7 -0
- data/app/views/tenon/fields/_base_inline.html.haml +4 -0
- data/app/views/tenon/fields/_check_box.html.haml +9 -0
- data/app/views/tenon/fields/_collection_select.html.haml +4 -0
- data/app/views/tenon/fields/_color_field.html.haml +3 -0
- data/app/views/tenon/fields/_date_picker.html.haml +2 -0
- data/app/views/tenon/fields/_date_time_picker.html.haml +6 -0
- data/app/views/tenon/fields/_email_field.html.haml +2 -0
- data/app/views/tenon/fields/_inline_check_box.html.haml +5 -0
- data/app/views/tenon/fields/_inline_radio_button.html.haml +5 -0
- data/app/views/tenon/fields/_number_field.html.haml +2 -0
- data/app/views/tenon/fields/_password_field.html.haml +2 -0
- data/app/views/tenon/fields/_phone_field.html.haml +2 -0
- data/app/views/tenon/fields/_radio_button.html.haml +9 -0
- data/app/views/tenon/fields/_rich_text.html.haml +3 -6
- data/app/views/tenon/fields/_select.html.haml +3 -0
- data/app/views/tenon/fields/_text_area.html.haml +2 -0
- data/app/views/tenon/fields/_text_field.html.haml +2 -0
- data/app/views/tenon/fields/_title_text_field.html.haml +2 -0
- data/app/views/tenon/fields/_url_field.html.haml +2 -0
- data/app/views/tenon/index/index.html.haml +8 -29
- data/app/views/tenon/item_assets/new.html.haml +20 -22
- data/app/views/tenon/item_versions/_item_version.json.jbuilder +4 -4
- data/app/views/tenon/item_versions/index.html.haml +14 -6
- data/app/views/tenon/item_versions/new.html.haml +8 -10
- data/app/views/tenon/settings/_contact.html.haml +14 -19
- data/app/views/tenon/settings/_general.html.haml +15 -11
- data/app/views/tenon/settings/_seo.html.haml +10 -9
- data/app/views/tenon/settings/show.html.haml +12 -31
- data/app/views/tenon/shared/_account_dropdown.html.haml +6 -0
- data/app/views/tenon/shared/_app_info.html.haml +5 -0
- data/app/views/tenon/shared/_breadcrumbs.html.haml +1 -0
- data/app/views/tenon/shared/_burger.html.haml +5 -0
- data/app/views/tenon/shared/_default_form_toolbar.html.haml +26 -0
- data/app/views/tenon/shared/_draft_controls.html.haml +18 -0
- data/app/views/tenon/shared/_i18n_language_nav.html.haml +2 -2
- data/app/views/tenon/shared/_main_nav.html.haml +3 -14
- data/app/views/tenon/shared/_platform_hints.html.haml +15 -15
- data/app/views/tenon/shared/_seo_fields.html.haml +8 -6
- data/app/views/tenon/shared/_site_title.html.haml +6 -0
- data/app/views/tenon/shared/_util_nav.html.haml +4 -27
- data/app/views/tenon/shared/_version_warning.html.haml +11 -11
- data/app/views/tenon/styleguides/_buttons.html.haml +118 -0
- data/app/views/tenon/styleguides/_colors.html.haml +59 -0
- data/app/views/tenon/styleguides/_forms.html.haml +4 -0
- data/app/views/tenon/styleguides/_icons.html.haml +21 -0
- data/app/views/tenon/styleguides/_typography.html.haml +27 -0
- data/app/views/tenon/styleguides/buttons/_colors.html.haml +43 -0
- data/app/views/tenon/styleguides/buttons/_styles.html.haml +59 -0
- data/app/views/tenon/styleguides/colors/_helpers.html.haml +48 -0
- data/app/views/tenon/styleguides/colors/_variables.html.haml +31 -0
- data/app/views/tenon/styleguides/forms/_default.html.haml +92 -0
- data/app/views/tenon/styleguides/forms/_html5.html.haml +31 -0
- data/app/views/tenon/styleguides/forms/_tenon_content.html.haml +15 -0
- data/app/views/tenon/styleguides/index.html.haml +52 -0
- data/app/views/tenon/styleguides/typography/_blockquote.html.haml +7 -0
- data/app/views/tenon/styleguides/typography/_inline.html.haml +8 -0
- data/app/views/tenon/styleguides/typography/_lists.html.haml +40 -0
- data/app/views/tenon/styleguides/typography/_paragraphs.html.haml +17 -0
- data/app/views/tenon/styleguides/typography/_small.html.haml +18 -0
- data/app/views/tenon/styleguides/typography/_styles.html.haml +14 -0
- data/app/views/tenon/styleguides/typography/_variables.html.haml +43 -0
- data/app/views/tenon/tenon_content/_display.html.haml +2 -2
- data/app/views/tenon/tenon_content/_embed_modal.html.haml +3 -3
- data/app/views/tenon/tenon_content/_fields.html.haml +21 -35
- data/app/views/tenon/tenon_content/_row.html.haml +14 -13
- data/app/views/tenon/tenon_content/{_builder.html.haml → _tenon_content.html.haml} +2 -2
- data/app/views/tenon/tenon_content/piece_types/form/_background_image.html.haml +6 -6
- data/app/views/tenon/tenon_content/piece_types/form/_embedded_content.html.haml +2 -1
- data/app/views/tenon/tenon_content/piece_types/form/_image.html.haml +37 -29
- data/app/views/tenon/tenon_content/row_types/display/_four_column_image.html.haml +4 -4
- data/app/views/tenon/tenon_content/row_types/display/_four_column_image_and_text.html.haml +3 -3
- data/app/views/tenon/tenon_content/row_types/display/_four_column_text.html.haml +4 -4
- data/app/views/tenon/tenon_content/row_types/display/_full_width_embedded_content.html.haml +3 -3
- data/app/views/tenon/tenon_content/row_types/display/_full_width_image.html.haml +3 -3
- data/app/views/tenon/tenon_content/row_types/display/_full_width_text.html.haml +3 -3
- data/app/views/tenon/tenon_content/row_types/display/_left_image_right_text.html.haml +8 -8
- data/app/views/tenon/tenon_content/row_types/display/_left_text_right_image.html.haml +7 -7
- data/app/views/tenon/tenon_content/row_types/display/_left_wrapped_image_with_text.html.haml +6 -6
- data/app/views/tenon/tenon_content/row_types/display/_right_wrapped_image_with_text.html.haml +7 -7
- data/app/views/tenon/tenon_content/row_types/display/_six_column_image.html.haml +4 -4
- data/app/views/tenon/tenon_content/row_types/display/_six_column_image_and_text.html.haml +5 -5
- data/app/views/tenon/tenon_content/row_types/display/_three_column_image.html.haml +4 -4
- data/app/views/tenon/tenon_content/row_types/display/_three_column_image_and_text.html.haml +4 -4
- data/app/views/tenon/tenon_content/row_types/display/_three_column_text.html.haml +4 -4
- data/app/views/tenon/tenon_content/row_types/display/_two_column_image.html.haml +3 -3
- data/app/views/tenon/tenon_content/row_types/display/_two_column_image_and_text.html.haml +4 -4
- data/app/views/tenon/tenon_content/row_types/display/_two_column_text.html.haml +3 -3
- data/app/views/tenon/tenon_content/row_types/display/_two_column_with_background_image.html.haml +3 -3
- data/app/views/tenon/tenon_content/row_types/form/_four_column_image.html.haml +2 -2
- data/app/views/tenon/tenon_content/row_types/form/_four_column_image_and_text.html.haml +3 -3
- data/app/views/tenon/tenon_content/row_types/form/_four_column_text.html.haml +3 -3
- data/app/views/tenon/tenon_content/row_types/form/_full_width_embedded_content.html.haml +3 -3
- data/app/views/tenon/tenon_content/row_types/form/_full_width_image.html.haml +3 -3
- data/app/views/tenon/tenon_content/row_types/form/_full_width_text.html.haml +3 -3
- data/app/views/tenon/tenon_content/row_types/form/_left_image_right_text.html.haml +9 -8
- data/app/views/tenon/tenon_content/row_types/form/_left_text_right_image.html.haml +6 -6
- data/app/views/tenon/tenon_content/row_types/form/_left_wrapped_image_with_text.html.haml +7 -7
- data/app/views/tenon/tenon_content/row_types/form/_right_wrapped_image_with_text.html.haml +7 -7
- data/app/views/tenon/tenon_content/row_types/form/_six_column_image.html.haml +2 -2
- data/app/views/tenon/tenon_content/row_types/form/_six_column_image_and_text.html.haml +3 -3
- data/app/views/tenon/tenon_content/row_types/form/_three_column_image.html.haml +2 -2
- data/app/views/tenon/tenon_content/row_types/form/_three_column_image_and_text.html.haml +3 -3
- data/app/views/tenon/tenon_content/row_types/form/_three_column_text.html.haml +3 -3
- data/app/views/tenon/tenon_content/row_types/form/_two_column_image.html.haml +2 -2
- data/app/views/tenon/tenon_content/row_types/form/_two_column_image_and_text.html.haml +3 -3
- data/app/views/tenon/tenon_content/row_types/form/_two_column_text.html.haml +3 -3
- data/app/views/tenon/tenon_content/row_types/form/_two_column_with_background_image.html.haml +2 -2
- data/config/initializers/class_extensions/hash.rb +1 -1
- data/config/initializers/client_side_validations.rb +27 -0
- data/config/initializers/tenon.rb +0 -14
- data/config/routes.rb +10 -46
- data/db/migrate/20151117171000_drop_default_tenon_resources.rb +15 -0
- data/db/migrate/20160119185645_remove_tenon_users.rb +7 -0
- data/db/migrate/20160126123154_remove_tenon_callouts_subscribers.rb +8 -0
- data/db/migrate/20160126194219_convert_piece_size_to_int.rb +6 -0
- data/lib/ckeditor/plugins/pastefromword/filter/default.js +1 -1
- data/lib/generators/tenon/scaffold/scaffold_generator.rb +52 -27
- data/lib/generators/tenon/scaffold/templates/controller.rb +7 -4
- data/lib/generators/tenon/scaffold/templates/policy.rb +2 -0
- data/lib/generators/tenon/scaffold/templates/serializer.rb +2 -0
- data/lib/generators/tenon/scaffold/templates/view__form.html.haml +49 -54
- data/lib/generators/tenon/scaffold/templates/view_edit.html.haml +1 -8
- data/lib/generators/tenon/scaffold/templates/view_index.html.haml +8 -24
- data/lib/generators/tenon/scaffold/templates/view_new.html.haml +1 -8
- data/lib/tasks/tenon_tasks.rake +2 -2
- data/lib/templates/active_record/model/model.rb +12 -13
- data/lib/templates/migration/templates/create_table_migration.rb +1 -1
- data/lib/tenon/can_be_foreign.rb +1 -1
- data/lib/tenon/engine.rb +26 -32
- data/lib/tenon/filterers/base_filterer.rb +64 -0
- data/lib/tenon/has_history/attr_serializer.rb +6 -6
- data/lib/tenon/proxy_attachment.rb +2 -2
- data/lib/tenon/version.rb +1 -1
- data/lib/tenon.rb +1 -3
- data/vendor/assets/javascripts/bootstrap.modal.js +1 -1
- data/vendor/assets/javascripts/date_picker/picker.date.js +1429 -0
- data/vendor/assets/javascripts/date_picker/picker.js +1122 -0
- data/vendor/assets/javascripts/number-to-words.es6 +35 -0
- data/vendor/assets/stylesheets/bootstrap.scss +1 -1
- metadata +206 -972
- data/app/assets/images/tenon/icons/delete.png +0 -0
- data/app/assets/images/tenon/icons/edit.png +0 -0
- data/app/assets/images/tenon/icons/thumbdown.png +0 -0
- data/app/assets/images/tenon/icons/thumbup.png +0 -0
- data/app/assets/images/tenon/select2-spinner.gif +0 -0
- data/app/assets/images/tenon/select2.png +0 -0
- data/app/assets/images/tenon/select2x2.png +0 -0
- data/app/assets/javascripts/tenon/controllers/assets.js.coffee +0 -3
- data/app/assets/javascripts/tenon/controllers/index.js.coffee +0 -6
- data/app/assets/javascripts/tenon/controllers/tenon.js.coffee +0 -1
- data/app/assets/javascripts/tenon/features/asset_attachment.js.coffee +0 -37
- data/app/assets/javascripts/tenon/features/asset_cropping.js.coffee +0 -49
- data/app/assets/javascripts/tenon/features/asset_detachment.js.coffee +0 -11
- data/app/assets/javascripts/tenon/features/asset_list_post_crop_handler.js.coffee +0 -15
- data/app/assets/javascripts/tenon/features/asset_uploader.js.coffee +0 -88
- data/app/assets/javascripts/tenon/features/box_toggles.js.coffee +0 -17
- data/app/assets/javascripts/tenon/features/cocoon_hooks.js.coffee +0 -12
- data/app/assets/javascripts/tenon/features/date_time_picker.js.coffee +0 -25
- data/app/assets/javascripts/tenon/features/editor.js.coffee +0 -24
- data/app/assets/javascripts/tenon/features/file_select_widget.js.erb +0 -39
- data/app/assets/javascripts/tenon/features/flash.js.coffee +0 -13
- data/app/assets/javascripts/tenon/features/focus_first_field.js.coffee +0 -8
- data/app/assets/javascripts/tenon/features/hamburger_navigation.js.coffee +0 -26
- data/app/assets/javascripts/tenon/features/header_menu.js.coffee +0 -20
- data/app/assets/javascripts/tenon/features/i18n_fields.js.coffee +0 -23
- data/app/assets/javascripts/tenon/features/infinite_loading.js.coffee +0 -12
- data/app/assets/javascripts/tenon/features/item_version_autosave.js.coffee +0 -35
- data/app/assets/javascripts/tenon/features/item_version_index_handler.js.coffee +0 -3
- data/app/assets/javascripts/tenon/features/main_menu.js.coffee +0 -11
- data/app/assets/javascripts/tenon/features/modal_forms.js.coffee +0 -44
- data/app/assets/javascripts/tenon/features/modal_windows.js.coffee +0 -104
- data/app/assets/javascripts/tenon/features/multiple_asset_attachment.js.coffee +0 -8
- data/app/assets/javascripts/tenon/features/nested_fields.js +0 -95
- data/app/assets/javascripts/tenon/features/nested_lists.js +0 -10
- data/app/assets/javascripts/tenon/features/nested_set_writer.js.coffee +0 -65
- data/app/assets/javascripts/tenon/features/new_item_version_handler.js.coffee +0 -32
- data/app/assets/javascripts/tenon/features/pagination.js.coffee +0 -21
- data/app/assets/javascripts/tenon/features/protect_changes.js.coffee +0 -25
- data/app/assets/javascripts/tenon/features/quick_search.js.coffee +0 -41
- data/app/assets/javascripts/tenon/features/record_approval.js.coffee +0 -33
- data/app/assets/javascripts/tenon/features/record_boolean_toggle.js.coffee +0 -37
- data/app/assets/javascripts/tenon/features/record_deletion.js.coffee +0 -24
- data/app/assets/javascripts/tenon/features/record_list.js.coffee +0 -86
- data/app/assets/javascripts/tenon/features/record_list_updater.js.coffee +0 -56
- data/app/assets/javascripts/tenon/features/s3_direct_upload.js.coffee +0 -43
- data/app/assets/javascripts/tenon/features/sidebar_active_links.js.coffee +0 -20
- data/app/assets/javascripts/tenon/features/sortable_nested_fields.js.coffee +0 -17
- data/app/assets/javascripts/tenon/features/tenon_content/aesthetics.js.coffee +0 -31
- data/app/assets/javascripts/tenon/features/tenon_content/asset_attachment.js.coffee +0 -15
- data/app/assets/javascripts/tenon/features/tenon_content/asset_link.js.coffee +0 -11
- data/app/assets/javascripts/tenon/features/tenon_content/base.js.coffee +0 -16
- data/app/assets/javascripts/tenon/features/tenon_content/bottombar_toggler.js.coffee +0 -15
- data/app/assets/javascripts/tenon/features/tenon_content/caption_toggler.js.coffee +0 -11
- data/app/assets/javascripts/tenon/features/tenon_content/column_sizing.js.coffee +0 -53
- data/app/assets/javascripts/tenon/features/tenon_content/column_swap.js.coffee +0 -44
- data/app/assets/javascripts/tenon/features/tenon_content/editor.js.coffee +0 -34
- data/app/assets/javascripts/tenon/features/tenon_content/embedded_content_modal_handler.js.coffee +0 -12
- data/app/assets/javascripts/tenon/features/tenon_content/image_asset_link.js.coffee +0 -5
- data/app/assets/javascripts/tenon/features/tenon_content/image_controls.js.coffee +0 -63
- data/app/assets/javascripts/tenon/features/tenon_content/image_links.js.coffee +0 -54
- data/app/assets/javascripts/tenon/features/tenon_content/library.js.coffee +0 -39
- data/app/assets/javascripts/tenon/features/tenon_content/library_filter.js.coffee +0 -17
- data/app/assets/javascripts/tenon/features/tenon_content/pop_out.js.coffee +0 -46
- data/app/assets/javascripts/tenon/features/tenon_content/post_crop_handler.js.coffee +0 -22
- data/app/assets/javascripts/tenon/features/tenon_content/sidebar_navigation.js.coffee +0 -26
- data/app/assets/javascripts/tenon/features/tenon_content/sortable.js.coffee +0 -18
- data/app/assets/javascripts/tenon/features/tenon_content/stretch_to_fill.js.coffee +0 -50
- data/app/assets/javascripts/tenon/features/tenon_content/wrapped_sizing.js.coffee +0 -48
- data/app/assets/javascripts/tenon/features/tenon_content.js.coffee +0 -1
- data/app/assets/javascripts/tenon/features/video_feeds.js.coffee +0 -4
- data/app/assets/javascripts/tenon/manifest.json +0 -44
- data/app/assets/javascripts/tenon/medium-on-tenon.js +0 -1465
- data/app/assets/javascripts/tenon/templates/assets/asset_field.jst.eco +0 -17
- data/app/assets/javascripts/tenon/templates/assets/asset_progress.jst.eco +0 -8
- data/app/assets/javascripts/tenon/templates/assets/asset_row.jst.eco +0 -21
- data/app/assets/javascripts/tenon/templates/assets/asset_select.jst.eco +0 -1
- data/app/assets/javascripts/tenon/templates/comments/comment_row.jst.eco +0 -23
- data/app/assets/javascripts/tenon/templates/contacts/contact_row.jst.eco +0 -56
- data/app/assets/javascripts/tenon/templates/errors.jst.eco +0 -13
- data/app/assets/javascripts/tenon/templates/events/event_row.jst.eco +0 -22
- data/app/assets/javascripts/tenon/templates/galleries/gallery_row.jst.eco +0 -12
- data/app/assets/javascripts/tenon/templates/item_versions/item_version_row.jst.eco +0 -22
- data/app/assets/javascripts/tenon/templates/modal.jst.eco +0 -14
- data/app/assets/javascripts/tenon/templates/pages/page_row.jst.eco +0 -21
- data/app/assets/javascripts/tenon/templates/post_categories/post_category_row.jst.eco +0 -12
- data/app/assets/javascripts/tenon/templates/posts/post_row.jst.eco +0 -30
- data/app/assets/javascripts/tenon/templates/redirects/redirect_row.jst.eco +0 -18
- data/app/assets/javascripts/tenon/templates/tenon_callouts/tenon_callout_row.jst.eco +0 -19
- data/app/assets/javascripts/tenon/templates/tenon_content/popped_out.jst.eco +0 -6
- data/app/assets/javascripts/tenon/templates/users/user_row.jst.eco +0 -21
- data/app/assets/javascripts/tenon/tenon.js +0 -68
- data/app/assets/javascripts/tenon/tenon_dispatcher.js.coffee +0 -25
- data/app/assets/javascripts/tenon/tenon_manifest.js +0 -45
- data/app/assets/stylesheets/tenon/colors-custom.scss +0 -25
- data/app/assets/stylesheets/tenon/colors-named.scss +0 -22
- data/app/assets/stylesheets/tenon/helpers.scss +0 -28
- data/app/assets/stylesheets/tenon/layout/assets.scss +0 -49
- data/app/assets/stylesheets/tenon/layout/breakpoints.scss +0 -48
- data/app/assets/stylesheets/tenon/layout/global.scss +0 -36
- data/app/assets/stylesheets/tenon/layout/grid.scss +0 -145
- data/app/assets/stylesheets/tenon/layout/main-nav.scss +0 -149
- data/app/assets/stylesheets/tenon/layout/margins.scss +0 -3
- data/app/assets/stylesheets/tenon/layout/mobile.scss +0 -5
- data/app/assets/stylesheets/tenon/layout/sidebar.scss +0 -102
- data/app/assets/stylesheets/tenon/layout/util-nav.scss +0 -51
- data/app/assets/stylesheets/tenon/mixins.scss +0 -81
- data/app/assets/stylesheets/tenon/styleguide.scss +0 -6
- data/app/assets/stylesheets/tenon/tenon.scss +0 -71
- data/app/assets/stylesheets/tenon/typography.scss +0 -65
- data/app/assets/stylesheets/tenon/ui/alerts.scss +0 -65
- data/app/assets/stylesheets/tenon/ui/asset-attachment.scss +0 -136
- data/app/assets/stylesheets/tenon/ui/asset-cropping.scss +0 -51
- data/app/assets/stylesheets/tenon/ui/asset-uploads.scss +0 -26
- data/app/assets/stylesheets/tenon/ui/buttons.scss +0 -65
- data/app/assets/stylesheets/tenon/ui/callouts.scss +0 -26
- data/app/assets/stylesheets/tenon/ui/comments.scss +0 -57
- data/app/assets/stylesheets/tenon/ui/forms.scss +0 -204
- data/app/assets/stylesheets/tenon/ui/generic-loader.scss +0 -21
- data/app/assets/stylesheets/tenon/ui/header-tools.scss +0 -116
- data/app/assets/stylesheets/tenon/ui/i18n.scss +0 -18
- data/app/assets/stylesheets/tenon/ui/list-style-toggle.scss +0 -39
- data/app/assets/stylesheets/tenon/ui/login.scss +0 -97
- data/app/assets/stylesheets/tenon/ui/medium-editor.scss +0 -114
- data/app/assets/stylesheets/tenon/ui/modals.scss +0 -179
- data/app/assets/stylesheets/tenon/ui/pagination.scss +0 -113
- data/app/assets/stylesheets/tenon/ui/progress-bars.scss +0 -131
- data/app/assets/stylesheets/tenon/ui/quick-search.scss +0 -20
- data/app/assets/stylesheets/tenon/ui/record-grids.scss +0 -95
- data/app/assets/stylesheets/tenon/ui/record-lists.scss +0 -154
- data/app/assets/stylesheets/tenon/ui/section-headers.scss +0 -30
- data/app/assets/stylesheets/tenon/ui/select2-custom.scss +0 -70
- data/app/assets/stylesheets/tenon/ui/tables.scss +0 -19
- data/app/assets/stylesheets/tenon/ui/tabs.scss +0 -7
- data/app/assets/stylesheets/tenon/ui/tenon-content-library.scss +0 -80
- data/app/assets/stylesheets/tenon/ui/tenon-content-popped-out.scss +0 -92
- data/app/assets/stylesheets/tenon/ui/tenon-content.scss +0 -318
- data/app/assets/stylesheets/tenon/ui/thinking.scss +0 -3
- data/app/assets/stylesheets/tenon/ui/toolbox.scss +0 -31
- data/app/assets/stylesheets/tenon/z-indexes.scss +0 -35
- data/app/assets/stylesheets/tenon_addons.scss +0 -1
- data/app/controllers/tenon/comments_controller.rb +0 -51
- data/app/controllers/tenon/contacts_controller.rb +0 -65
- data/app/controllers/tenon/events_controller.rb +0 -9
- data/app/controllers/tenon/galleries_controller.rb +0 -9
- data/app/controllers/tenon/pages_controller.rb +0 -51
- data/app/controllers/tenon/post_categories_controller.rb +0 -9
- data/app/controllers/tenon/posts_controller.rb +0 -28
- data/app/controllers/tenon/redirects_controller.rb +0 -25
- data/app/controllers/tenon/tenon_callouts_controller.rb +0 -7
- data/app/controllers/tenon/users_controller.rb +0 -64
- data/app/decorators/tenon/comment_decorator.rb +0 -22
- data/app/decorators/tenon/contact_decorator.rb +0 -13
- data/app/decorators/tenon/event_decorator.rb +0 -11
- data/app/decorators/tenon/gallery_decorator.rb +0 -4
- data/app/decorators/tenon/page_decorator.rb +0 -11
- data/app/decorators/tenon/post_category_decorator.rb +0 -4
- data/app/decorators/tenon/post_decorator.rb +0 -4
- data/app/decorators/tenon/redirect_decorator.rb +0 -2
- data/app/decorators/tenon/tenon_callout_decorator.rb +0 -4
- data/app/decorators/tenon/user_decorator.rb +0 -4
- data/app/mailers/tenon/comment_mailer.rb +0 -16
- data/app/mailers/tenon/contact_mailer.rb +0 -15
- data/app/models/ability.rb +0 -32
- data/app/models/tenon/comment.rb +0 -47
- data/app/models/tenon/comment_subscriber.rb +0 -7
- data/app/models/tenon/contact.rb +0 -46
- data/app/models/tenon/event.rb +0 -45
- data/app/models/tenon/gallery.rb +0 -15
- data/app/models/tenon/page.rb +0 -105
- data/app/models/tenon/photo.rb +0 -10
- data/app/models/tenon/post.rb +0 -35
- data/app/models/tenon/post_category.rb +0 -7
- data/app/models/tenon/redirect.rb +0 -17
- data/app/models/tenon/role.rb +0 -8
- data/app/models/tenon/role_assignment.rb +0 -6
- data/app/models/tenon/s3_direct_upload.rb +0 -75
- data/app/models/tenon/tenon_callout.rb +0 -16
- data/app/models/tenon/user.rb +0 -60
- data/app/views/devise/confirmations/new.html.erb +0 -12
- data/app/views/devise/confirmations/new.html.haml +0 -0
- data/app/views/devise/mailer/confirmation_instructions.html.haml +0 -7
- data/app/views/devise/mailer/reset_password_instructions.html.haml +0 -15
- data/app/views/devise/mailer/unlock_instructions.html.haml +0 -9
- data/app/views/devise/passwords/edit.html.haml +0 -22
- data/app/views/devise/passwords/new.html.haml +0 -17
- data/app/views/devise/registrations/edit.html.haml +0 -0
- data/app/views/devise/registrations/new.html.haml +0 -22
- data/app/views/devise/sessions/new.html.haml +0 -28
- data/app/views/devise/shared/_links.erb +0 -19
- data/app/views/devise/shared/_links.haml +0 -0
- data/app/views/devise/unlocks/new.html.erb +0 -12
- data/app/views/devise/unlocks/new.html.haml +0 -0
- data/app/views/layouts/tenon/login.html.haml +0 -19
- data/app/views/tenon/assets/_asset.json.jbuilder +0 -7
- data/app/views/tenon/assets/_sidebar_index.html.haml +0 -18
- data/app/views/tenon/assets/create.json.jbuilder +0 -1
- data/app/views/tenon/assets/index.json.jbuilder +0 -5
- data/app/views/tenon/assets/update.json.jbuilder +0 -1
- data/app/views/tenon/comment_mailer/comment_notification.html.haml +0 -7
- data/app/views/tenon/comments/_sidebar_index.html.haml +0 -22
- data/app/views/tenon/comments/index.html.haml +0 -19
- data/app/views/tenon/comments/index.json.jbuilder +0 -22
- data/app/views/tenon/contact_mailer/contact_notification.html.haml +0 -15
- data/app/views/tenon/contacts/_sidebar_index.html.haml +0 -32
- data/app/views/tenon/contacts/index.html.haml +0 -19
- data/app/views/tenon/contacts/index.json.jbuilder +0 -15
- data/app/views/tenon/events/_form.html.haml +0 -44
- data/app/views/tenon/events/edit.html.haml +0 -8
- data/app/views/tenon/events/index.html.haml +0 -23
- data/app/views/tenon/events/index.json.jbuilder +0 -16
- data/app/views/tenon/events/new.html.haml +0 -8
- data/app/views/tenon/galleries/_form.html.haml +0 -38
- data/app/views/tenon/galleries/_photo_fields.html.haml +0 -3
- data/app/views/tenon/galleries/edit.html.haml +0 -8
- data/app/views/tenon/galleries/index.html.haml +0 -22
- data/app/views/tenon/galleries/index.json.jbuilder +0 -15
- data/app/views/tenon/galleries/new.html.haml +0 -8
- data/app/views/tenon/pages/_form.html.haml +0 -58
- data/app/views/tenon/pages/edit.html.haml +0 -8
- data/app/views/tenon/pages/index.html.haml +0 -23
- data/app/views/tenon/pages/index.json.jbuilder +0 -22
- data/app/views/tenon/pages/new.html.haml +0 -8
- data/app/views/tenon/post_categories/_form.html.haml +0 -11
- data/app/views/tenon/post_categories/_post_category.json.jbuilder +0 -2
- data/app/views/tenon/post_categories/create.json.jbuilder +0 -1
- data/app/views/tenon/post_categories/edit.html.haml +0 -1
- data/app/views/tenon/post_categories/index.html.haml +0 -30
- data/app/views/tenon/post_categories/index.json.jbuilder +0 -5
- data/app/views/tenon/post_categories/update.json.jbuilder +0 -1
- data/app/views/tenon/posts/_form.html.haml +0 -65
- data/app/views/tenon/posts/edit.html.haml +0 -8
- data/app/views/tenon/posts/index.html.haml +0 -27
- data/app/views/tenon/posts/index.json.jbuilder +0 -20
- data/app/views/tenon/posts/new.html.haml +0 -8
- data/app/views/tenon/redirects/_form.html.haml +0 -42
- data/app/views/tenon/redirects/_redirect.json.jbuilder +0 -3
- data/app/views/tenon/redirects/edit.html.haml +0 -8
- data/app/views/tenon/redirects/index.html.haml +0 -29
- data/app/views/tenon/redirects/index.json.jbuilder +0 -5
- data/app/views/tenon/redirects/new.html.haml +0 -8
- data/app/views/tenon/shared/_posts_nav.html.haml +0 -8
- data/app/views/tenon/shared/menu_items/_assets.html.haml +0 -3
- data/app/views/tenon/shared/menu_items/_comments.html.haml +0 -2
- data/app/views/tenon/shared/menu_items/_events.html.haml +0 -6
- data/app/views/tenon/shared/menu_items/_galleries.html.haml +0 -6
- data/app/views/tenon/shared/menu_items/_pages.html.haml +0 -6
- data/app/views/tenon/shared/menu_items/_posts.html.haml +0 -7
- data/app/views/tenon/shared/menu_items/_settings.html.haml +0 -2
- data/app/views/tenon/shared/menu_items/_users.html.haml +0 -2
- data/app/views/tenon/shared/section_header/_quick_search.html.haml +0 -3
- data/app/views/tenon/shared/section_header/_sidebar_toggle.html.haml +0 -1
- data/app/views/tenon/tenon_callouts/_form.html.haml +0 -45
- data/app/views/tenon/tenon_callouts/_tenon_callout.json.jbuilder +0 -1
- data/app/views/tenon/tenon_callouts/edit.html.haml +0 -8
- data/app/views/tenon/tenon_callouts/index.html.haml +0 -24
- data/app/views/tenon/tenon_callouts/index.json.jbuilder +0 -5
- data/app/views/tenon/tenon_callouts/new.html.haml +0 -8
- data/app/views/tenon/users/_form.html.haml +0 -50
- data/app/views/tenon/users/edit.html.haml +0 -8
- data/app/views/tenon/users/index.html.haml +0 -23
- data/app/views/tenon/users/index.json.jbuilder +0 -28
- data/app/views/tenon/users/new.html.haml +0 -8
- data/config/initializers/devise.rb +0 -258
- data/config/locales/devise.en.yml +0 -60
- data/config/locales/tenon.en.yml +0 -313
- data/db/seeds.rb +0 -47
- data/lib/generators/tenon/scaffold/templates/view__item.json.jbuilder +0 -1
- data/lib/generators/tenon/scaffold/templates/view_index.json.jbuilder +0 -5
- data/lib/generators/tenon/scaffold/templates/view_item_row.jst.eco +0 -13
- data/lib/generators/tenon/scaffold_small/scaffold_small_generator.rb +0 -8
- data/lib/generators/tenon/scaffold_small/templates/controller.rb +0 -19
- data/lib/generators/tenon/scaffold_small/templates/decorator.rb +0 -2
- data/lib/generators/tenon/scaffold_small/templates/view__form.html.haml +0 -26
- data/lib/generators/tenon/scaffold_small/templates/view__item.json.jbuilder +0 -2
- data/lib/generators/tenon/scaffold_small/templates/view_create.json.jbuilder +0 -1
- data/lib/generators/tenon/scaffold_small/templates/view_index.html.haml +0 -27
- data/lib/generators/tenon/scaffold_small/templates/view_index.json.jbuilder +0 -5
- data/lib/generators/tenon/scaffold_small/templates/view_item_row.jst.eco +0 -12
- data/lib/generators/tenon/scaffold_small/templates/view_update.json.jbuilder +0 -1
- data/lib/tenon/can_have_comments.rb +0 -16
- data/lib/tenon/config/events.rb +0 -29
- data/lib/tenon/factories/comments.rb +0 -10
- data/lib/tenon/factories/contacts.rb +0 -9
- data/lib/tenon/factories/events.rb +0 -7
- data/lib/tenon/factories/galleries.rb +0 -5
- data/lib/tenon/factories/pages.rb +0 -5
- data/lib/tenon/factories/posts.rb +0 -10
- data/lib/tenon/factories/redirects.rb +0 -9
- data/lib/tenon/factories/tenon_callouts.rb +0 -9
- data/lib/tenon/factories/users.rb +0 -26
- data/lib/tenon/warning_generator.rb +0 -29
- data/spec/controllers/tenon/assets_controller_spec.rb +0 -262
- data/spec/controllers/tenon/comments_controller_spec.rb +0 -173
- data/spec/controllers/tenon/contacts_controller_spec.rb +0 -174
- data/spec/controllers/tenon/index_controller_spec.rb +0 -31
- data/spec/controllers/tenon/item_assets_controller_spec.rb +0 -29
- data/spec/controllers/tenon/pages_controller_spec.rb +0 -67
- data/spec/controllers/tenon/posts_controller_spec.rb +0 -31
- data/spec/controllers/tenon/resources_controller_spec.rb +0 -352
- data/spec/controllers/tenon/settings_controller_spec.rb +0 -65
- data/spec/controllers/tenon/simple_resources_controller_spec.rb +0 -42
- data/spec/controllers/tenon/users_controller_spec.rb +0 -112
- data/spec/decorators/tenon/application_decorator_spec.rb +0 -75
- data/spec/decorators/tenon/asset_decorator_spec.rb +0 -101
- data/spec/decorators/tenon/comment_decorator_spec.rb +0 -43
- data/spec/decorators/tenon/contact_decorator_spec.rb +0 -24
- data/spec/decorators/tenon/event_decorator_spec.rb +0 -26
- data/spec/decorators/tenon/page_decorator_spec.rb +0 -23
- data/spec/decorators/tenon/tenon_content/row_type_decorator_spec.rb +0 -20
- data/spec/features/settings_spec.rb +0 -75
- data/spec/features/tenon/assets_spec.rb +0 -88
- data/spec/features/tenon/comments_spec.rb +0 -51
- data/spec/features/tenon/contacts_spec.rb +0 -51
- data/spec/features/tenon/events_spec.rb +0 -104
- data/spec/features/tenon/galleries_spec.rb +0 -107
- data/spec/features/tenon/i18n_spec.rb +0 -106
- data/spec/features/tenon/pages_spec.rb +0 -97
- data/spec/features/tenon/post_categories_spec.rb +0 -91
- data/spec/features/tenon/posts_spec.rb +0 -93
- data/spec/features/tenon/tenon_callouts_spec.rb +0 -101
- data/spec/features/tenon/users_spec.rb +0 -98
- data/spec/fixtures/files/test.png +0 -0
- data/spec/lib/tenon/asset_style_generator_spec.rb +0 -84
- data/spec/lib/tenon/can_be_foreign_spec.rb +0 -20
- data/spec/lib/tenon/can_have_comments_spec.rb +0 -22
- data/spec/lib/tenon/has_asset_spec.rb +0 -46
- data/spec/lib/tenon/has_history/attr_serializer_spec.rb +0 -63
- data/spec/lib/tenon/i18n_lookup_spec.rb +0 -88
- data/spec/lib/tenon/proxy_attachment_spec.rb +0 -96
- data/spec/lib/tenon/reorderable_spec.rb +0 -25
- data/spec/lib/tenon/tenon_content_spec.rb +0 -22
- data/spec/lib/tenon/warning_generator_spec.rb +0 -153
- data/spec/models/tenon/asset_spec.rb +0 -98
- data/spec/models/tenon/comment_spec.rb +0 -81
- data/spec/models/tenon/contact_spec.rb +0 -62
- data/spec/models/tenon/event_spec.rb +0 -79
- data/spec/models/tenon/gallery_spec.rb +0 -12
- data/spec/models/tenon/item_asset_spec.rb +0 -19
- data/spec/models/tenon/my_settings_spec.rb +0 -27
- data/spec/models/tenon/page_spec.rb +0 -60
- data/spec/models/tenon/post_spec.rb +0 -48
- data/spec/models/tenon/redirect_spec.rb +0 -31
- data/spec/models/tenon/tenon_callout_spec.rb +0 -10
- data/spec/models/tenon/tenon_content/row_spec.rb +0 -34
- data/spec/models/tenon/user_spec.rb +0 -59
- data/spec/services/tenon/redirector_spec.rb +0 -30
- data/spec/spec_helper.rb +0 -79
- data/spec/support/integration_example_group.rb +0 -35
- data/spec/support/request_helpers.rb +0 -10
- data/vendor/assets/javascripts/backstretch.js +0 -4
- data/vendor/assets/javascripts/bootstrap.collapse.js +0 -179
- data/vendor/assets/javascripts/bootstrap.datetimepicker.js +0 -954
- data/vendor/assets/javascripts/bootstrap.tabs.js +0 -135
- data/vendor/assets/javascripts/cufon/Aller_400.font.js +0 -7
- data/vendor/assets/javascripts/cufon/Aller_700.font.js +0 -7
- data/vendor/assets/javascripts/cufon/cufon.js +0 -7
- data/vendor/assets/javascripts/jquery.corner.js +0 -249
- data/vendor/assets/javascripts/jquery.hoverIntent.js +0 -115
- data/vendor/assets/javascripts/jquery.radioSlider.js +0 -55
- data/vendor/assets/javascripts/jscrollpane.js +0 -1435
- data/vendor/assets/javascripts/select2.js +0 -3
- data/vendor/assets/javascripts/underscore.inflection.js +0 -177
- data/vendor/assets/stylesheets/bootstrap.datetimepicker.css +0 -152
- data/vendor/assets/stylesheets/bootstrap.tables.scss +0 -201
- data/vendor/assets/stylesheets/jscrollpane.scss +0 -20
- data/vendor/assets/stylesheets/select2.css +0 -1
@@ -5,7 +5,7 @@ module Tenon
|
|
5
5
|
alias_method :super_label, :label
|
6
6
|
|
7
7
|
def tenon_content(method_name)
|
8
|
-
@template.render 'tenon/tenon_content/
|
8
|
+
@template.render 'tenon/tenon_content/tenon_content',
|
9
9
|
f: self,
|
10
10
|
field: method_name
|
11
11
|
end
|
@@ -13,47 +13,210 @@ module Tenon
|
|
13
13
|
def asset(method_name, opts = {})
|
14
14
|
defaults = {
|
15
15
|
label: nil,
|
16
|
+
wrapper_class: 'panel',
|
16
17
|
# Remove button triggers cocoon's remove child event?
|
17
18
|
remove_association: false
|
18
19
|
}
|
19
20
|
opts = defaults.merge(opts)
|
20
|
-
|
21
21
|
@template.render 'tenon/fields/asset',
|
22
22
|
f: self,
|
23
23
|
label_tag: label(method_name, opts[:label]),
|
24
|
-
|
24
|
+
method_name: method_name,
|
25
25
|
proxy_attachment: object.send(method_name),
|
26
26
|
opts: opts
|
27
27
|
end
|
28
28
|
|
29
29
|
def rich_text(method_name, opts = {})
|
30
30
|
defaults = {
|
31
|
-
placeholder: '--'
|
31
|
+
placeholder: '--'
|
32
32
|
}
|
33
33
|
opts = defaults.merge(opts)
|
34
34
|
|
35
35
|
@template.render 'tenon/fields/rich_text',
|
36
36
|
f: self,
|
37
|
-
|
37
|
+
method_name: method_name,
|
38
38
|
label_tag: label(method_name, opts[:label]),
|
39
39
|
opts: opts
|
40
40
|
end
|
41
41
|
alias_method :me_text, :rich_text
|
42
42
|
|
43
43
|
alias_method :super_text_field, :text_field
|
44
|
-
def text_field(method_name,
|
45
|
-
|
44
|
+
def text_field(method_name, opts = {})
|
45
|
+
defaults = {
|
46
|
+
placeholder: '--'
|
47
|
+
}
|
48
|
+
opts = defaults.merge(opts)
|
49
|
+
|
50
|
+
@template.render 'tenon/fields/text_field',
|
51
|
+
f: self,
|
52
|
+
method_name: method_name,
|
53
|
+
opts: opts
|
46
54
|
end
|
47
55
|
|
48
|
-
def
|
49
|
-
|
50
|
-
|
51
|
-
|
56
|
+
def title_text_field(method_name, opts = {})
|
57
|
+
defaults = {
|
58
|
+
placeholder: '--'
|
59
|
+
}
|
60
|
+
opts = defaults.merge(opts)
|
61
|
+
|
62
|
+
@template.render 'tenon/fields/title_text_field',
|
63
|
+
f: self,
|
64
|
+
method_name: method_name,
|
65
|
+
opts: opts
|
66
|
+
end
|
67
|
+
|
68
|
+
alias_method :super_email_field, :email_field
|
69
|
+
def email_field(method_name, opts = {})
|
70
|
+
defaults = {
|
71
|
+
placeholder: '--'
|
72
|
+
}
|
73
|
+
opts = defaults.merge(opts)
|
74
|
+
|
75
|
+
@template.render 'tenon/fields/email_field',
|
76
|
+
f: self,
|
77
|
+
method_name: method_name,
|
78
|
+
opts: opts
|
79
|
+
end
|
80
|
+
|
81
|
+
alias_method :super_password_field, :password_field
|
82
|
+
def password_field(method_name, opts = {})
|
83
|
+
defaults = {
|
84
|
+
placeholder: '--'
|
85
|
+
}
|
86
|
+
opts = defaults.merge(opts)
|
87
|
+
|
88
|
+
@template.render 'tenon/fields/password_field',
|
89
|
+
f: self,
|
90
|
+
method_name: method_name,
|
91
|
+
opts: opts
|
92
|
+
end
|
93
|
+
|
94
|
+
alias_method :super_number_field, :number_field
|
95
|
+
def number_field(method_name, opts = {})
|
96
|
+
defaults = {
|
97
|
+
placeholder: '--'
|
98
|
+
}
|
99
|
+
opts = defaults.merge(opts)
|
100
|
+
|
101
|
+
@template.render 'tenon/fields/number_field',
|
102
|
+
f: self,
|
103
|
+
method_name: method_name,
|
104
|
+
opts: opts
|
105
|
+
end
|
106
|
+
|
107
|
+
alias_method :super_phone_field, :phone_field
|
108
|
+
def phone_field(method_name, opts = {})
|
109
|
+
defaults = {
|
110
|
+
placeholder: '--'
|
111
|
+
}
|
112
|
+
opts = defaults.merge(opts)
|
113
|
+
|
114
|
+
@template.render 'tenon/fields/phone_field',
|
115
|
+
f: self,
|
116
|
+
method_name: method_name,
|
117
|
+
opts: opts
|
118
|
+
end
|
119
|
+
|
120
|
+
alias_method :super_url_field, :url_field
|
121
|
+
def url_field(method_name, opts = {})
|
122
|
+
defaults = {
|
123
|
+
placeholder: '--'
|
124
|
+
}
|
125
|
+
opts = defaults.merge(opts)
|
126
|
+
|
127
|
+
@template.render 'tenon/fields/url_field',
|
128
|
+
f: self,
|
129
|
+
method_name: method_name,
|
130
|
+
opts: opts
|
131
|
+
end
|
132
|
+
|
133
|
+
alias_method :super_color_field, :color_field
|
134
|
+
def color_field(method_name, opts = {})
|
135
|
+
defaults = {
|
136
|
+
placeholder: '--'
|
137
|
+
}
|
138
|
+
opts = defaults.merge(opts)
|
139
|
+
|
140
|
+
@template.render 'tenon/fields/color_field',
|
141
|
+
f: self,
|
142
|
+
method_name: method_name,
|
143
|
+
opts: opts
|
52
144
|
end
|
53
145
|
|
54
146
|
alias_method :super_text_area, :text_area
|
55
|
-
def text_area(method_name,
|
56
|
-
|
147
|
+
def text_area(method_name, opts = {})
|
148
|
+
@template.render 'tenon/fields/text_area',
|
149
|
+
f: self,
|
150
|
+
method_name: method_name,
|
151
|
+
opts: opts
|
152
|
+
end
|
153
|
+
|
154
|
+
alias_method :super_select, :select
|
155
|
+
def select(method_name, choices, opts = {}, html_opts = {})
|
156
|
+
@template.render 'tenon/fields/select',
|
157
|
+
f: self,
|
158
|
+
method_name: method_name,
|
159
|
+
choices: choices,
|
160
|
+
opts: opts,
|
161
|
+
html_opts: html_opts
|
162
|
+
end
|
163
|
+
|
164
|
+
alias_method :super_check_box, :check_box
|
165
|
+
def check_box(method_name, opts = {})
|
166
|
+
@template.render 'tenon/fields/check_box',
|
167
|
+
f: self,
|
168
|
+
method_name: method_name,
|
169
|
+
opts: opts
|
170
|
+
end
|
171
|
+
|
172
|
+
def inline_check_box(method_name, opts = {})
|
173
|
+
@template.render 'tenon/fields/inline_check_box',
|
174
|
+
f: self,
|
175
|
+
method_name: method_name,
|
176
|
+
opts: opts
|
177
|
+
end
|
178
|
+
|
179
|
+
alias_method :super_radio_button, :radio_button
|
180
|
+
def radio_button(method_name, value, opts = {})
|
181
|
+
@template.render 'tenon/fields/radio_button',
|
182
|
+
f: self,
|
183
|
+
method_name: method_name,
|
184
|
+
value: value,
|
185
|
+
opts: opts
|
186
|
+
end
|
187
|
+
|
188
|
+
def inline_radio_button(method_name, value, opts = {})
|
189
|
+
@template.render 'tenon/fields/inline_radio_button',
|
190
|
+
f: self,
|
191
|
+
method_name: method_name,
|
192
|
+
value: value,
|
193
|
+
opts: opts
|
194
|
+
end
|
195
|
+
|
196
|
+
alias_method :super_collection_select, :collection_select
|
197
|
+
def collection_select(method_name, collection, value_method, text_method, opts = {}, html_opts = {})
|
198
|
+
@template.render 'tenon/fields/collection_select',
|
199
|
+
f: self,
|
200
|
+
method_name: method_name,
|
201
|
+
collection: collection,
|
202
|
+
value_method: value_method,
|
203
|
+
text_method: text_method,
|
204
|
+
opts: opts,
|
205
|
+
html_opts: html_opts
|
206
|
+
end
|
207
|
+
|
208
|
+
def date_picker(method_name, opts = {})
|
209
|
+
@template.render 'tenon/fields/date_picker',
|
210
|
+
f: self,
|
211
|
+
method_name: method_name,
|
212
|
+
opts: opts
|
213
|
+
end
|
214
|
+
|
215
|
+
def date_time_picker(method_name, opts = {})
|
216
|
+
@template.render 'tenon/fields/date_time_picker',
|
217
|
+
f: self,
|
218
|
+
method_name: method_name,
|
219
|
+
opts: opts
|
57
220
|
end
|
58
221
|
|
59
222
|
def text_area_content(method_name, options = {}, language = nil, language_title = nil)
|
@@ -91,22 +254,29 @@ module Tenon
|
|
91
254
|
end
|
92
255
|
end
|
93
256
|
|
94
|
-
|
95
|
-
|
96
|
-
def label(method_name, label, language = nil, language_title = nil)
|
257
|
+
def label(method_name, label, required = false, inline = false, language = nil, language_title = nil)
|
97
258
|
if label == false
|
98
259
|
''.html_safe
|
99
260
|
else
|
100
261
|
label ||= method_name.to_s.titleize
|
101
262
|
label = language_title ? label + " (#{language_title.to_s.titleize})" : label
|
102
|
-
|
263
|
+
label_class = ['input-block__label']
|
264
|
+
label_class = ['input-block__label--inline'] if inline
|
265
|
+
if required
|
266
|
+
label += content_tag(:span, 'Required', class: 'input-block__required-msg')
|
267
|
+
end
|
268
|
+
super(get_method(method_name, language), label.html_safe, class: label_class.join(' '))
|
103
269
|
end
|
104
270
|
end
|
105
271
|
|
272
|
+
private
|
273
|
+
|
106
274
|
def build_content(generator, method_name, options)
|
107
275
|
content = send(generator, method_name, options)
|
108
|
-
|
109
|
-
|
276
|
+
if Tenon::I18nLookup.new(@object.class).fields.include? method_name.to_s
|
277
|
+
content = internationalize_content(generator, method_name, content, options)
|
278
|
+
end
|
279
|
+
content_tag(:div, content, class: 'form-field')
|
110
280
|
end
|
111
281
|
|
112
282
|
def internationalize_content(generator, method_name, content, options = {})
|
@@ -0,0 +1,9 @@
|
|
1
|
+
module Tenon
|
2
|
+
module ActiveLinkToHelper
|
3
|
+
def active_link_to(name = nil, options = {}, html_options = nil, &block)
|
4
|
+
options[:class] = '' unless options[:class].present?
|
5
|
+
options[:class] += ' --is-active' if name == request.original_fullpath
|
6
|
+
link_to(name, options, html_options, &block)
|
7
|
+
end
|
8
|
+
end
|
9
|
+
end
|
@@ -1,15 +1,7 @@
|
|
1
1
|
module Tenon
|
2
2
|
module ApplicationHelper
|
3
|
-
def
|
4
|
-
|
5
|
-
%w(notice alert warning error).each do |msg|
|
6
|
-
unless flash[msg.to_sym].blank?
|
7
|
-
content = content_tag(:p, flash[msg.to_sym])
|
8
|
-
content += link_to fa_icon('times'), '#', id: 'flash-dismiss'
|
9
|
-
messages << content_tag(:div, content, class: "flash flash-#{msg}")
|
10
|
-
end
|
11
|
-
end
|
12
|
-
messages.join('').html_safe
|
3
|
+
def thisicon(icon)
|
4
|
+
content_tag(:i, icon, class: 'material-icon')
|
13
5
|
end
|
14
6
|
|
15
7
|
def menu_item(title, link, options = {})
|
@@ -21,11 +13,6 @@ module Tenon
|
|
21
13
|
link_to(title, link, class: klass)
|
22
14
|
end
|
23
15
|
|
24
|
-
# now uses http://github.com/mdeering/gravatar_image_tag
|
25
|
-
def gravatar_for(object)
|
26
|
-
gravatar_image_tag(object.email)
|
27
|
-
end
|
28
|
-
|
29
16
|
def table_row(*args)
|
30
17
|
html = '<tr>'
|
31
18
|
args.each_with_index do |cell, i|
|
@@ -79,12 +66,6 @@ module Tenon
|
|
79
66
|
false
|
80
67
|
end
|
81
68
|
|
82
|
-
def current_translations
|
83
|
-
I18n.backend.send(:init_translations) unless I18n.backend.initialized?
|
84
|
-
@translations ||= I18n.backend.send(:translations)
|
85
|
-
@translations[I18n.locale].with_indifferent_access
|
86
|
-
end
|
87
|
-
|
88
69
|
private
|
89
70
|
|
90
71
|
def h5bp_opening_tag(ie_versions = 6..8)
|
@@ -97,7 +78,7 @@ module Tenon
|
|
97
78
|
ie_versions.each do |version|
|
98
79
|
next if version == max
|
99
80
|
|
100
|
-
klass = ie_versions.select
|
81
|
+
klass = ie_versions.select{ |e| e > version }.map{ |e| "ie-lt#{e}" }.join(' ')
|
101
82
|
|
102
83
|
htmls << if_ie("<html lang='#{I18n.locale}' dir='ltr' class='noscript #{klass}'>", version: version)
|
103
84
|
end
|
@@ -139,7 +120,7 @@ module Tenon
|
|
139
120
|
end
|
140
121
|
end
|
141
122
|
|
142
|
-
|
123
|
+
# humanizing various things
|
143
124
|
def human(object)
|
144
125
|
if object.is_a?(Date)
|
145
126
|
object.strftime('%B %d, %Y')
|
@@ -0,0 +1,13 @@
|
|
1
|
+
module Tenon
|
2
|
+
# Generate a back button that includes the previous query if there was one
|
3
|
+
module BackToIndexPathHelper
|
4
|
+
def back_to_index_path(obj)
|
5
|
+
path = polymorphic_path(obj.class)
|
6
|
+
if cookies["last-query-#{path}.json"].present?
|
7
|
+
query = JSON.parse(cookies["last-query-#{path}.json"])
|
8
|
+
path = polymorphic_path(obj.class, query)
|
9
|
+
end
|
10
|
+
path
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
module Tenon
|
2
|
+
module BreadcrumbsHelper
|
3
|
+
def breadcrumb_links
|
4
|
+
links = []
|
5
|
+
if controller_name != 'index'
|
6
|
+
path = polymorphic_path(controller_name)
|
7
|
+
links << make_link(controller_name.titleize, path)
|
8
|
+
|
9
|
+
if %w( new edit ).include?(action_name)
|
10
|
+
links << make_link(member_title, member_path)
|
11
|
+
end
|
12
|
+
end
|
13
|
+
links
|
14
|
+
end
|
15
|
+
|
16
|
+
private
|
17
|
+
|
18
|
+
def make_link(title, path)
|
19
|
+
{
|
20
|
+
title: title,
|
21
|
+
path: path
|
22
|
+
}
|
23
|
+
end
|
24
|
+
|
25
|
+
def member_path
|
26
|
+
request.path
|
27
|
+
end
|
28
|
+
|
29
|
+
def member_title
|
30
|
+
action_name.titleize
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
module Tenon
|
2
|
+
module FlashHelper
|
3
|
+
def flash_messages
|
4
|
+
messages = []
|
5
|
+
%w(notice alert warning error).each do |msg|
|
6
|
+
unless flash[msg.to_sym].blank?
|
7
|
+
content = content_tag(:div, flash[msg.to_sym], class: 'flash__message')
|
8
|
+
messages << content_tag(:div, content, class: "flash flash--#{msg}")
|
9
|
+
end
|
10
|
+
end
|
11
|
+
messages.join('').html_safe
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
module Tenon
|
2
|
+
module InputBlockHelper
|
3
|
+
def input_block(label, opts = {}, &blk)
|
4
|
+
content_tag :div, class: 'input-block' do
|
5
|
+
block_label_tag(label) +
|
6
|
+
content_tag(:div, capture(&blk), class: 'input-block__inline-group' ) +
|
7
|
+
block_explanation(opts[:explanation])
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
private
|
12
|
+
|
13
|
+
def block_label_tag(text)
|
14
|
+
content_tag(:label, text, class: 'input-block__label')
|
15
|
+
end
|
16
|
+
|
17
|
+
def block_explanation(text)
|
18
|
+
if text.present?
|
19
|
+
return content_tag(:div, text, class: 'input-block__explanation')
|
20
|
+
else
|
21
|
+
return ''
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -5,36 +5,48 @@ module Tenon
|
|
5
5
|
|
6
6
|
default_opts = {
|
7
7
|
builder: Tenon::FormBuilder,
|
8
|
-
data: data
|
8
|
+
data: data,
|
9
|
+
validate: true
|
9
10
|
}
|
10
11
|
|
11
12
|
form_for(obj, default_opts.merge(opts), &blk)
|
12
13
|
end
|
13
14
|
|
14
|
-
def
|
15
|
+
def save_draft_link(obj)
|
15
16
|
path = new_item_version_path(item_type: class_for(obj), item_id: obj.id)
|
16
|
-
css_class = '
|
17
|
+
css_class = 'draft'
|
17
18
|
data = {
|
18
19
|
'modal-remote' => true,
|
19
20
|
'modal-handler' => 'Tenon.features.NewItemVersionHandler',
|
20
|
-
'modal-title' =>
|
21
|
+
'modal-title' => 'Save Draft'
|
21
22
|
}
|
22
|
-
link_to
|
23
|
+
link_to path, class: css_class, data: data do
|
24
|
+
content_tag(:i, 'cloud_queue', class: 'material-icon') +
|
25
|
+
'Save Draft'
|
26
|
+
end
|
23
27
|
end
|
24
28
|
|
25
29
|
def clear_draft_link
|
26
30
|
path = url_for(version: nil)
|
27
|
-
link_to
|
31
|
+
link_to 'Load Active Version', path, class: 'delete-link'
|
28
32
|
end
|
29
33
|
|
30
34
|
def load_draft_link(obj)
|
31
35
|
path = item_versions_path(item_type: obj.class.to_s, item_id: obj.id)
|
32
36
|
data = {
|
33
37
|
'modal-remote' => true,
|
34
|
-
'modal-title' =>
|
38
|
+
'modal-title' => 'Load Draft',
|
35
39
|
'modal-handler' => 'Tenon.features.ItemVersionIndexHandler'
|
36
40
|
}
|
37
|
-
link_to
|
41
|
+
link_to 'Load Draft', path, class: 'delete-link', data: data
|
42
|
+
end
|
43
|
+
|
44
|
+
def item_version_active_path(obj)
|
45
|
+
if obj.persisted?
|
46
|
+
polymorphic_path [:edit, obj]
|
47
|
+
else
|
48
|
+
new_polymorphic_path obj.class
|
49
|
+
end
|
38
50
|
end
|
39
51
|
|
40
52
|
private
|
@@ -52,7 +64,8 @@ module Tenon
|
|
52
64
|
'item-type' => class_for(obj),
|
53
65
|
'item-id' => obj.id,
|
54
66
|
'autosave' => !params[:version],
|
55
|
-
'version-create-path' => item_versions_path
|
67
|
+
'version-create-path' => item_versions_path,
|
68
|
+
'protect-changes' => true
|
56
69
|
}
|
57
70
|
|
58
71
|
if opts[:data]
|
@@ -1,34 +1,38 @@
|
|
1
1
|
module Tenon
|
2
2
|
module NavHelper
|
3
|
-
def nav_item(text,
|
4
|
-
|
5
|
-
content
|
6
|
-
content_tag(:li, content)
|
3
|
+
def nav_item(text, path, icon, link_opts = {}, &blk)
|
4
|
+
content = link(text, path, icon, link_opts)
|
5
|
+
content += subnav(&blk) if block_given?
|
6
|
+
content_tag(:li, content, class: "main-nav__item #{active_class(path, link_opts[:active])}")
|
7
7
|
end
|
8
8
|
|
9
9
|
private
|
10
10
|
|
11
|
-
def
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
11
|
+
def subnav(&blk)
|
12
|
+
icons = content_tag(:i, 'keyboard_arrow_down', class: 'main-nav__open-icon')
|
13
|
+
icons += content_tag(:i, 'keyboard_arrow_up', class: 'main-nav__close-icon')
|
14
|
+
content = link_to(icons, '#', class: 'main-nav__link-toggle')
|
15
|
+
content += content_tag(:ul, capture(&blk), class: 'main-nav__sub-nav')
|
16
|
+
content
|
17
17
|
end
|
18
18
|
|
19
|
-
def link(text, path,
|
20
|
-
content = content_tag(:i,
|
21
|
-
content += text
|
22
|
-
opts[:class] ||= ''
|
19
|
+
def link(text, path, icon, opts = {})
|
20
|
+
content = content_tag(:i, icon, class: 'material-icon')
|
21
|
+
content += content_tag(:span, text)
|
22
|
+
opts[:class] ||= 'main-nav__link action-icon'
|
23
|
+
opts[:class] += ' main-nav__link--sub' if opts[:sub]
|
23
24
|
opts[:title] ||= text
|
24
|
-
opts[:class] += " #{active_class(path, opts[:active])}"
|
25
25
|
link_to(content, path, opts)
|
26
26
|
end
|
27
27
|
|
28
28
|
def active_class(path, active)
|
29
29
|
path = url_for(path).split('/')[0..2].join('/')[1..-1]
|
30
|
-
tenon_path = tenon.root_path.gsub(
|
31
|
-
|
30
|
+
tenon_path = tenon.root_path.gsub(%r{^\/}, '') + controller_name
|
31
|
+
if active || path == tenon_path
|
32
|
+
'main-nav__item--active main-nav__item--open'
|
33
|
+
else
|
34
|
+
''
|
35
|
+
end
|
32
36
|
end
|
33
37
|
end
|
34
38
|
end
|
@@ -29,7 +29,7 @@ module Tenon
|
|
29
29
|
sizes = breakpoints[:full]
|
30
30
|
|
31
31
|
# calculate the image size at :full breakpoint based on the piece width
|
32
|
-
image_size = (piece.
|
32
|
+
image_size = (piece.size.to_f / 12.0 * content_size(sizes, piece)).to_i
|
33
33
|
|
34
34
|
# round up to nearest 200
|
35
35
|
image_size = image_size.round(-2)
|
@@ -45,7 +45,7 @@ module Tenon
|
|
45
45
|
# item_type-specific tenon_content width not defined.
|
46
46
|
def generate_sizes(piece, breakpoints)
|
47
47
|
breakpoints.map do |name, sizes|
|
48
|
-
"(min-width: #{sizes[:browser]}px) #{(piece.
|
48
|
+
"(min-width: #{sizes[:browser]}px) #{(piece.size.to_f / 12.0 * 100 * content_size(sizes, piece) / sizes[:browser]).to_i}vw"
|
49
49
|
end.join(', ')
|
50
50
|
end
|
51
51
|
|
@@ -60,11 +60,6 @@ module Tenon
|
|
60
60
|
end.join(', ')
|
61
61
|
end
|
62
62
|
|
63
|
-
# Handle 'twelve' pieces that have size set to '' in the db
|
64
|
-
def piece_size(piece)
|
65
|
-
piece_size = piece.size == '' ? 'twelve' : piece.size
|
66
|
-
end
|
67
|
-
|
68
63
|
def computed_style(piece, style)
|
69
64
|
computed_style = "#{piece.image.style_prefix}_#{style}"
|
70
65
|
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module Tenon
|
2
|
+
module StyleguideHelper
|
3
|
+
def color_spans(arr, join = ', ')
|
4
|
+
arr.map{|c| color_span(c)}.join(join).html_safe
|
5
|
+
end
|
6
|
+
|
7
|
+
def color_span(color)
|
8
|
+
content_tag(:span, color, class: "color-#{color}")
|
9
|
+
end
|
10
|
+
|
11
|
+
def expandable_toggle
|
12
|
+
link_to i('keyboard_arrow_down'), '#', class: 'expand'
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -5,15 +5,15 @@ module Tenon
|
|
5
5
|
'data-association-insertion-node' => "##{field}-tenon-content",
|
6
6
|
'data-association-insertion-method' => 'append',
|
7
7
|
'data-searchable-title' => title.downcase,
|
8
|
-
:
|
9
|
-
:
|
8
|
+
partial: 'tenon/tenon_content/row',
|
9
|
+
render_options: {
|
10
10
|
locals: {
|
11
11
|
row_partial: "tenon/tenon_content/row_types/form/#{row_type.to_s.underscore}",
|
12
12
|
field: field,
|
13
13
|
title: title
|
14
14
|
}
|
15
15
|
},
|
16
|
-
:
|
16
|
+
wrap_object: proc do |row|
|
17
17
|
row.set_row_type(row_type)
|
18
18
|
row.decorate
|
19
19
|
end
|
@@ -22,8 +22,13 @@ module Tenon
|
|
22
22
|
end
|
23
23
|
|
24
24
|
def row_link_content(title, row_type)
|
25
|
-
|
26
|
-
|
25
|
+
content = image_tag(
|
26
|
+
"tenon/tenon-content/#{row_type}.png",
|
27
|
+
class: 'tn-tc-library__image',
|
28
|
+
id: row_type,
|
29
|
+
data: { :'row-type' => row_type }
|
30
|
+
)
|
31
|
+
content + content_tag(:p, title, class: 'tn-tc-library__title')
|
27
32
|
end
|
28
33
|
|
29
34
|
def tenon_content_sizes
|
@@ -32,7 +37,7 @@ module Tenon
|
|
32
37
|
links << link_to(name.to_s.titleize, '#', class: 'btn btn-white', data: { size: size_for_breakpoint(widths[:default]) })
|
33
38
|
end
|
34
39
|
last = Tenon.config.breakpoints.front_end.values.last
|
35
|
-
links << link_to(
|
40
|
+
links << link_to('Mobile', '#', class: 'btn btn-white', data: { size: 320, mobile: true })
|
36
41
|
links.join('').html_safe
|
37
42
|
end
|
38
43
|
|