georgia 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/README.md +27 -0
- data/Rakefile +27 -0
- data/app/assets/fonts/georgia/signika-bold-webfont.eot +0 -0
- data/app/assets/fonts/georgia/signika-bold-webfont.svg +1711 -0
- data/app/assets/fonts/georgia/signika-bold-webfont.ttf +0 -0
- data/app/assets/fonts/georgia/signika-bold-webfont.woff +0 -0
- data/app/assets/fonts/georgia/signika-light-webfont.eot +0 -0
- data/app/assets/fonts/georgia/signika-light-webfont.svg +1680 -0
- data/app/assets/fonts/georgia/signika-light-webfont.ttf +0 -0
- data/app/assets/fonts/georgia/signika-light-webfont.woff +0 -0
- data/app/assets/fonts/georgia/signika-regular-webfont.eot +0 -0
- data/app/assets/fonts/georgia/signika-regular-webfont.svg +1746 -0
- data/app/assets/fonts/georgia/signika-regular-webfont.ttf +0 -0
- data/app/assets/fonts/georgia/signika-regular-webfont.woff +0 -0
- data/app/assets/images/georgia/bg-body-bar.jpg +0 -0
- data/app/assets/images/georgia/checkmark.png +0 -0
- data/app/assets/images/georgia/content-types/avi.jpg +0 -0
- data/app/assets/images/georgia/content-types/css.jpg +0 -0
- data/app/assets/images/georgia/content-types/csv.jpg +0 -0
- data/app/assets/images/georgia/content-types/doc.jpg +0 -0
- data/app/assets/images/georgia/content-types/docx.jpg +0 -0
- data/app/assets/images/georgia/content-types/eps.jpg +0 -0
- data/app/assets/images/georgia/content-types/gif.jpg +0 -0
- data/app/assets/images/georgia/content-types/gz.jpg +0 -0
- data/app/assets/images/georgia/content-types/html.jpg +0 -0
- data/app/assets/images/georgia/content-types/jpg.jpg +0 -0
- data/app/assets/images/georgia/content-types/mp3.jpg +0 -0
- data/app/assets/images/georgia/content-types/ods.jpg +0 -0
- data/app/assets/images/georgia/content-types/odt.jpg +0 -0
- data/app/assets/images/georgia/content-types/pdf.jpg +0 -0
- data/app/assets/images/georgia/content-types/png.jpg +0 -0
- data/app/assets/images/georgia/content-types/ppt.jpg +0 -0
- data/app/assets/images/georgia/content-types/pptx.jpg +0 -0
- data/app/assets/images/georgia/content-types/rar.jpg +0 -0
- data/app/assets/images/georgia/content-types/tar.jpg +0 -0
- data/app/assets/images/georgia/content-types/txt.jpg +0 -0
- data/app/assets/images/georgia/content-types/wav.jpg +0 -0
- data/app/assets/images/georgia/content-types/xls.jpg +0 -0
- data/app/assets/images/georgia/content-types/zip.jpg +0 -0
- data/app/assets/images/georgia/down_arrow.gif +0 -0
- data/app/assets/images/georgia/grippy_large.png +0 -0
- data/app/assets/images/georgia/indeterminate.png +0 -0
- data/app/assets/images/georgia/logo.png +0 -0
- data/app/assets/images/georgia/select2-spinner.gif +0 -0
- data/app/assets/images/georgia/select2.png +0 -0
- data/app/assets/images/georgia/select2x2.png +0 -0
- data/app/assets/images/georgia/transparent.jpg +0 -0
- data/app/assets/images/georgia/up_arrow.gif +0 -0
- data/app/assets/images/ui-bg_glass_75_ffffff_1x400.png +0 -0
- data/app/assets/javascripts/georgia/application.js +20 -0
- data/app/assets/javascripts/georgia/bootstrap-vendor.js.coffee +13 -0
- data/app/assets/javascripts/georgia/ckeditor/config.js +22 -0
- data/app/assets/javascripts/georgia/components/asset-replacer.js.coffee +25 -0
- data/app/assets/javascripts/georgia/components/asset-uploader.js.coffee +44 -0
- data/app/assets/javascripts/georgia/components/flash.js.coffee +15 -0
- data/app/assets/javascripts/georgia/components/forms/menu.js.coffee +66 -0
- data/app/assets/javascripts/georgia/components/forms/revision.js.coffee +22 -0
- data/app/assets/javascripts/georgia/components/forms/spinning.js.coffee +51 -0
- data/app/assets/javascripts/georgia/components/media-library.js.coffee +57 -0
- data/app/assets/javascripts/georgia/components/portlets/link.js.coffee +14 -0
- data/app/assets/javascripts/georgia/components/portlets/slide.js.coffee +38 -0
- data/app/assets/javascripts/georgia/components/portlets/widget.js.coffee +47 -0
- data/app/assets/javascripts/georgia/components/position_sort.js.coffee +20 -0
- data/app/assets/javascripts/georgia/components/tables/checkbox.js.coffee +123 -0
- data/app/assets/javascripts/georgia/components/tables/media.js.coffee +59 -0
- data/app/assets/javascripts/georgia/components/tables/messages.js.coffee +59 -0
- data/app/assets/javascripts/georgia/components/tables/pages.js.coffee +93 -0
- data/app/assets/javascripts/georgia/components/tags.js.coffee +36 -0
- data/app/assets/javascripts/georgia/components/widget.js.coffee +32 -0
- data/app/assets/javascripts/georgia/featured-image.js.coffee +8 -0
- data/app/assets/javascripts/georgia/keybindings.js.coffee +42 -0
- data/app/assets/javascripts/georgia/toggle.js.coffee +4 -0
- data/app/assets/javascripts/georgia/vendor/bootstrap-datetimepicker.js +28 -0
- data/app/assets/javascripts/georgia/vendor/jquery.mjs.nestedSortable.js +608 -0
- data/app/assets/javascripts/georgia/vendor/jquery.ui.touch-punch.js +160 -0
- data/app/assets/javascripts/georgia/vendor/moment.js +6 -0
- data/app/assets/stylesheets/georgia/application.css.scss +16 -0
- data/app/assets/stylesheets/georgia/components/_box.scss +29 -0
- data/app/assets/stylesheets/georgia/components/_button.scss +60 -0
- data/app/assets/stylesheets/georgia/components/_checkbox.scss +48 -0
- data/app/assets/stylesheets/georgia/components/_form.scss +8 -0
- data/app/assets/stylesheets/georgia/components/_help.scss +4 -0
- data/app/assets/stylesheets/georgia/components/_icon.scss +7 -0
- data/app/assets/stylesheets/georgia/components/_input.scss +48 -0
- data/app/assets/stylesheets/georgia/components/_label.scss +4 -0
- data/app/assets/stylesheets/georgia/components/_modal.scss +14 -0
- data/app/assets/stylesheets/georgia/components/_nav-list.scss +13 -0
- data/app/assets/stylesheets/georgia/components/_note.scss +31 -0
- data/app/assets/stylesheets/georgia/components/_portlet.scss +57 -0
- data/app/assets/stylesheets/georgia/components/_progress.scss +4 -0
- data/app/assets/stylesheets/georgia/components/_state.scss +17 -0
- data/app/assets/stylesheets/georgia/components/_table.scss +8 -0
- data/app/assets/stylesheets/georgia/components/_transparent.scss +3 -0
- data/app/assets/stylesheets/georgia/layout/_base.scss +94 -0
- data/app/assets/stylesheets/georgia/layout/_devise.scss +5 -0
- data/app/assets/stylesheets/georgia/mixins/_clearfix.scss +12 -0
- data/app/assets/stylesheets/georgia/mixins/_ellipsis.scss +8 -0
- data/app/assets/stylesheets/georgia/mixins/_inflectors.scss +1 -0
- data/app/assets/stylesheets/georgia/mixins/_opacity.scss +6 -0
- data/app/assets/stylesheets/georgia/mixins/_utilities.scss +13 -0
- data/app/assets/stylesheets/georgia/modules/_facets.scss +4 -0
- data/app/assets/stylesheets/georgia/modules/_footer.scss +9 -0
- data/app/assets/stylesheets/georgia/modules/_form_with_helpers.scss +17 -0
- data/app/assets/stylesheets/georgia/modules/_header.scss +66 -0
- data/app/assets/stylesheets/georgia/modules/_link.scss +51 -0
- data/app/assets/stylesheets/georgia/modules/_login.scss +7 -0
- data/app/assets/stylesheets/georgia/modules/_media.scss +55 -0
- data/app/assets/stylesheets/georgia/modules/_menu.scss +7 -0
- data/app/assets/stylesheets/georgia/modules/_message.scss +53 -0
- data/app/assets/stylesheets/georgia/modules/_notifications.scss +26 -0
- data/app/assets/stylesheets/georgia/modules/_pages.scss +7 -0
- data/app/assets/stylesheets/georgia/modules/_pagination.scss +41 -0
- data/app/assets/stylesheets/georgia/modules/_results.scss +46 -0
- data/app/assets/stylesheets/georgia/modules/_revision.scss +18 -0
- data/app/assets/stylesheets/georgia/modules/_sidebar.scss +71 -0
- data/app/assets/stylesheets/georgia/modules/_slide.scss +11 -0
- data/app/assets/stylesheets/georgia/modules/_subpage.scss +25 -0
- data/app/assets/stylesheets/georgia/modules/_users.scss +3 -0
- data/app/assets/stylesheets/georgia/modules/_widget.scss +45 -0
- data/app/assets/stylesheets/georgia/overrides/_select2.scss +5 -0
- data/app/assets/stylesheets/georgia/settings/_base.scss +6 -0
- data/app/assets/stylesheets/georgia/settings/_colors.scss +41 -0
- data/app/assets/stylesheets/georgia/settings/_fonts.scss +3 -0
- data/app/assets/stylesheets/georgia/settings/_z-index.scss +7 -0
- data/app/assets/stylesheets/georgia/vendor/_autocomplete.scss +50 -0
- data/app/assets/stylesheets/georgia/vendor/_bootstrap-datetimepicker.scss +174 -0
- data/app/assets/stylesheets/georgia/vendor/_select2.scss +18 -0
- data/app/assets/stylesheets/georgia/vendor/_tooltip.scss +98 -0
- data/app/controllers/georgia/api/media_controller.rb +18 -0
- data/app/controllers/georgia/api/tags_controller.rb +22 -0
- data/app/controllers/georgia/application_controller.rb +25 -0
- data/app/controllers/georgia/concerns/frontendable.rb +45 -0
- data/app/controllers/georgia/concerns/helpers.rb +28 -0
- data/app/controllers/georgia/dashboard_controller.rb +14 -0
- data/app/controllers/georgia/links_controller.rb +13 -0
- data/app/controllers/georgia/media_controller.rb +101 -0
- data/app/controllers/georgia/menus_controller.rb +80 -0
- data/app/controllers/georgia/messages_controller.rb +74 -0
- data/app/controllers/georgia/pages_controller.rb +180 -0
- data/app/controllers/georgia/revisions_controller.rb +89 -0
- data/app/controllers/georgia/slides_controller.rb +13 -0
- data/app/controllers/georgia/ui_associations_controller.rb +12 -0
- data/app/controllers/georgia/users/sessions_controller.rb +7 -0
- data/app/controllers/georgia/users_controller.rb +51 -0
- data/app/controllers/georgia/widgets_controller.rb +67 -0
- data/app/controllers/messages_controller.rb +29 -0
- data/app/decorators/ckeditor/asset_decorator.rb +13 -0
- data/app/decorators/ckeditor/assets_decorator.rb +4 -0
- data/app/decorators/ckeditor/picture_decorator.rb +9 -0
- data/app/decorators/ckeditor/pictures_decorator.rb +4 -0
- data/app/decorators/georgia/application_decorator.rb +6 -0
- data/app/decorators/georgia/link_decorator.rb +9 -0
- data/app/decorators/georgia/links_decorator.rb +4 -0
- data/app/decorators/georgia/message_decorator.rb +21 -0
- data/app/decorators/georgia/messages_decorator.rb +4 -0
- data/app/decorators/georgia/page_decorator.rb +31 -0
- data/app/decorators/georgia/pages_decorator.rb +4 -0
- data/app/decorators/georgia/revision_decorator.rb +28 -0
- data/app/decorators/georgia/slide_decorator.rb +4 -0
- data/app/decorators/georgia/widget_decorator.rb +4 -0
- data/app/decorators/pagination_decorator.rb +3 -0
- data/app/decorators/sunspot/highlighted_hit_decorator.rb +29 -0
- data/app/helpers/georgia/checkboxes_helper.rb +13 -0
- data/app/helpers/georgia/devise_helper.rb +15 -0
- data/app/helpers/georgia/facets_helper.rb +35 -0
- data/app/helpers/georgia/forms_helper.rb +68 -0
- data/app/helpers/georgia/header_helper.rb +10 -0
- data/app/helpers/georgia/internationalization_helper.rb +32 -0
- data/app/helpers/georgia/menus_helper.rb +20 -0
- data/app/helpers/georgia/messages_helper.rb +9 -0
- data/app/helpers/georgia/meta_tags_helper.rb +22 -0
- data/app/helpers/georgia/modals_helper.rb +7 -0
- data/app/helpers/georgia/pages_helper.rb +22 -0
- data/app/helpers/georgia/pagination_helper.rb +10 -0
- data/app/helpers/georgia/routes_helper.rb +25 -0
- data/app/helpers/georgia/sidebar_helper.rb +13 -0
- data/app/helpers/georgia/states_helper.rb +17 -0
- data/app/helpers/georgia/twitter_helper.rb +24 -0
- data/app/helpers/georgia/ui_helper.rb +51 -0
- data/app/mailers/georgia/notifier.rb +33 -0
- data/app/models/ability.rb +19 -0
- data/app/models/ckeditor/asset.rb +61 -0
- data/app/models/ckeditor/attachment_file.rb +7 -0
- data/app/models/ckeditor/picture.rb +15 -0
- data/app/models/georgia/clone.rb +101 -0
- data/app/models/georgia/concerns/cacheable.rb +18 -0
- data/app/models/georgia/concerns/contentable.rb +22 -0
- data/app/models/georgia/concerns/indexable.rb +67 -0
- data/app/models/georgia/concerns/orderable.rb +21 -0
- data/app/models/georgia/concerns/publishable.rb +35 -0
- data/app/models/georgia/concerns/revisionable.rb +38 -0
- data/app/models/georgia/concerns/slugable.rb +46 -0
- data/app/models/georgia/concerns/statable.rb +64 -0
- data/app/models/georgia/concerns/taggable.rb +19 -0
- data/app/models/georgia/concerns/templatable.rb +20 -0
- data/app/models/georgia/concerns/treeable.rb +26 -0
- data/app/models/georgia/content.rb +15 -0
- data/app/models/georgia/link.rb +27 -0
- data/app/models/georgia/menu.rb +13 -0
- data/app/models/georgia/message.rb +47 -0
- data/app/models/georgia/page.rb +20 -0
- data/app/models/georgia/revision.rb +22 -0
- data/app/models/georgia/role.rb +10 -0
- data/app/models/georgia/slide.rb +13 -0
- data/app/models/georgia/status.rb +29 -0
- data/app/models/georgia/ui_association.rb +27 -0
- data/app/models/georgia/ui_section.rb +12 -0
- data/app/models/georgia/user.rb +27 -0
- data/app/models/georgia/widget.rb +32 -0
- data/app/parsers/georgia/menu_ancestry_parser.rb +41 -0
- data/app/policies/georgia/policy.rb +17 -0
- data/app/policies/georgia/revision_policy.rb +53 -0
- data/app/presenters/georgia/active_facet_presenter.rb +25 -0
- data/app/presenters/georgia/facet_presenter.rb +26 -0
- data/app/presenters/georgia/link_portlet.rb +101 -0
- data/app/presenters/georgia/list_facet_presenter.rb +32 -0
- data/app/presenters/georgia/media_library_presenter.rb +44 -0
- data/app/presenters/georgia/message_actions_presenter.rb +51 -0
- data/app/presenters/georgia/page_actions_presenter.rb +94 -0
- data/app/presenters/georgia/pagination_presenter.rb +58 -0
- data/app/presenters/georgia/portlet.rb +30 -0
- data/app/presenters/georgia/presenter.rb +17 -0
- data/app/presenters/georgia/sidebar_link_presenter.rb +55 -0
- data/app/presenters/georgia/single_active_facet_presenter.rb +10 -0
- data/app/presenters/georgia/slide_portlet.rb +79 -0
- data/app/presenters/georgia/subpage_portlet.rb +36 -0
- data/app/presenters/georgia/warning_message.rb +55 -0
- data/app/presenters/georgia/widget_portlet.rb +75 -0
- data/app/sweepers/navigation_sweeper.rb +12 -0
- data/app/uploaders/ckeditor_attachment_file_uploader.rb +16 -0
- data/app/uploaders/ckeditor_picture_uploader.rb +36 -0
- data/app/uploaders/georgia/attachment_uploader.rb +16 -0
- data/app/views/georgia/api/media/pictures.html.erb +17 -0
- data/app/views/georgia/ckeditor/assets/_asset.html.erb +23 -0
- data/app/views/georgia/ckeditor/attachment_files/_attachment_file.html.erb +1 -0
- data/app/views/georgia/ckeditor/pictures/_picture.html.erb +26 -0
- data/app/views/georgia/dashboard/panels/_messages.html.erb +30 -0
- data/app/views/georgia/dashboard/panels/_reviews.html.erb +24 -0
- data/app/views/georgia/dashboard/show.html.erb +18 -0
- data/app/views/georgia/header/_dashboard.html.erb +1 -0
- data/app/views/georgia/header/_media.html.erb +3 -0
- data/app/views/georgia/header/_messages.html.erb +3 -0
- data/app/views/georgia/header/_navigation.html.erb +3 -0
- data/app/views/georgia/header/_pages.html.erb +3 -0
- data/app/views/georgia/header/_users.html.erb +3 -0
- data/app/views/georgia/header/_widgets.html.erb +3 -0
- data/app/views/georgia/links/show.html.erb +1 -0
- data/app/views/georgia/media/_header.html.erb +27 -0
- data/app/views/georgia/media/create.js.erb +1 -0
- data/app/views/georgia/media/edit.html.erb +74 -0
- data/app/views/georgia/media/search.html.erb +36 -0
- data/app/views/georgia/media/sidebar/_facets.html.erb +12 -0
- data/app/views/georgia/menus/_menu.html.erb +7 -0
- data/app/views/georgia/menus/create.js.erb +5 -0
- data/app/views/georgia/menus/edit.html.erb +37 -0
- data/app/views/georgia/menus/index.html.erb +36 -0
- data/app/views/georgia/messages/_message.html.erb +26 -0
- data/app/views/georgia/messages/destroy.js.erb +3 -0
- data/app/views/georgia/messages/search.html.erb +58 -0
- data/app/views/georgia/messages/show.html.erb +46 -0
- data/app/views/georgia/notifier/notify_admins.html.erb +10 -0
- data/app/views/georgia/notifier/notify_editors.html.erb +10 -0
- data/app/views/georgia/notifier/notify_support.html.erb +9 -0
- data/app/views/georgia/pages/_header.html.erb +22 -0
- data/app/views/georgia/pages/_page.html.erb +19 -0
- data/app/views/georgia/pages/_subpage.html.erb +1 -0
- data/app/views/georgia/pages/create.js.erb +6 -0
- data/app/views/georgia/pages/search.html.erb +32 -0
- data/app/views/georgia/pages/settings.html.erb +79 -0
- data/app/views/georgia/pages/templates/_custom.html.erb +7 -0
- data/app/views/georgia/pages/templates/_default.html.erb +7 -0
- data/app/views/georgia/pages/templates/_one-column.html.erb +7 -0
- data/app/views/georgia/pages/templates/_sidebar-left.html.erb +10 -0
- data/app/views/georgia/pages/templates/_sidebar-right.html.erb +10 -0
- data/app/views/georgia/revisions/_revision.html.erb +11 -0
- data/app/views/georgia/revisions/edit.html.erb +36 -0
- data/app/views/georgia/revisions/fields/_content.html.erb +43 -0
- data/app/views/georgia/revisions/fields/_slides.html.erb +19 -0
- data/app/views/georgia/revisions/fields/_template.html.erb +8 -0
- data/app/views/georgia/revisions/fields/_ui_section.html.erb +14 -0
- data/app/views/georgia/revisions/fields/_widgets.html.erb +11 -0
- data/app/views/georgia/revisions/index.html.erb +25 -0
- data/app/views/georgia/shared/_messages.html.erb +11 -0
- data/app/views/georgia/shared/modals/_media_library.html.erb +35 -0
- data/app/views/georgia/shared/modals/_menu.html.erb +20 -0
- data/app/views/georgia/shared/modals/_page.html.erb +20 -0
- data/app/views/georgia/shared/modals/_progress.html.erb +15 -0
- data/app/views/georgia/shared/modals/_widget.html.erb +24 -0
- data/app/views/georgia/shared/search/_messages.html.erb +4 -0
- data/app/views/georgia/slides/new.html.erb +1 -0
- data/app/views/georgia/ui_associations/new.html.erb +1 -0
- data/app/views/georgia/users/_form.html.erb +27 -0
- data/app/views/georgia/users/_user.html.erb +9 -0
- data/app/views/georgia/users/edit.html.erb +22 -0
- data/app/views/georgia/users/index.html.erb +25 -0
- data/app/views/georgia/users/new.html.erb +19 -0
- data/app/views/georgia/users/registrations/new.html.erb +20 -0
- data/app/views/georgia/users/sessions/new.html.erb +17 -0
- data/app/views/georgia/widgets/_widget.html.erb +35 -0
- data/app/views/georgia/widgets/create.js.erb +5 -0
- data/app/views/georgia/widgets/index.html.erb +31 -0
- data/app/views/layouts/georgia/_footer.html.erb +7 -0
- data/app/views/layouts/georgia/_head.html.erb +15 -0
- data/app/views/layouts/georgia/_header.html.erb +40 -0
- data/app/views/layouts/georgia/_messages.html.erb +7 -0
- data/app/views/layouts/georgia/_sidebar.html.erb +9 -0
- data/app/views/layouts/georgia/application.html.erb +16 -0
- data/app/views/layouts/georgia/devise.html.erb +11 -0
- data/app/views/menus/_dropdown_group.html.erb +10 -0
- data/app/views/menus/_dropdown_link.html.erb +3 -0
- data/app/views/menus/_dropdown_menu.html.erb +11 -0
- data/app/views/menus/_link.html.erb +1 -0
- data/app/views/menus/_menu.html.erb +7 -0
- data/app/views/messages/create.js.erb +0 -0
- data/app/workers/spam_worker.rb +12 -0
- data/config/initializers/acts_as_taggable_on.rb +19 -0
- data/config/initializers/ckeditor.rb +18 -0
- data/config/initializers/devise.rb +254 -0
- data/config/initializers/inflections.rb +3 -0
- data/config/initializers/revisions.rb +5 -0
- data/config/initializers/simple_form.rb +79 -0
- data/config/locales/georgia.en.yml +4 -0
- data/config/routes.rb +79 -0
- data/db/migrate/001_create_ckeditor_assets.rb +25 -0
- data/db/migrate/002_create_georgia_contents.rb +18 -0
- data/db/migrate/003_create_georgia_links.rb +12 -0
- data/db/migrate/004_create_georgia_menus.rb +10 -0
- data/db/migrate/005_create_georgia_messages.rb +21 -0
- data/db/migrate/006_create_georgia_pages.rb +21 -0
- data/db/migrate/007_create_georgia_revisions.rb +12 -0
- data/db/migrate/008_create_georgia_roles.rb +10 -0
- data/db/migrate/009_create_georgia_slides.rb +11 -0
- data/db/migrate/010_create_georgia_ui_associations.rb +13 -0
- data/db/migrate/011_create_georgia_ui_sections.rb +9 -0
- data/db/migrate/012_create_georgia_users.rb +24 -0
- data/db/migrate/013_create_georgia_widgets.rb +9 -0
- data/db/migrate/014_create_roles_users.rb +11 -0
- data/db/migrate/015_create_tags.rb +20 -0
- data/lib/generators/georgia/install/install_generator.rb +60 -0
- data/lib/generators/georgia/install/templates/Procfile +1 -0
- data/lib/generators/georgia/install/templates/README +14 -0
- data/lib/generators/georgia/install/templates/app/controllers/pages_controller.rb +13 -0
- data/lib/generators/georgia/install/templates/config/initializers/georgia.rb +15 -0
- data/lib/generators/georgia/upgrade/templates/add_anti_spam_to_messages.rb +12 -0
- data/lib/generators/georgia/upgrade/templates/add_contents_counter_cache_to_images.rb +15 -0
- data/lib/generators/georgia/upgrade/templates/add_public_to_georgia_pages.rb +8 -0
- data/lib/generators/georgia/upgrade/templates/add_state_to_georgia_pages.rb +13 -0
- data/lib/generators/georgia/upgrade/templates/create_georgia_revisions.rb +12 -0
- data/lib/generators/georgia/upgrade/upgrade_generator.rb +34 -0
- data/lib/georgia.rb +23 -0
- data/lib/georgia/assets.rb +8 -0
- data/lib/georgia/assets/cloud_files_connection.rb +22 -0
- data/lib/georgia/assets/transferable_picture.rb +51 -0
- data/lib/georgia/engine.rb +58 -0
- data/lib/georgia/paths.rb +22 -0
- data/lib/georgia/version.rb +3 -0
- data/lib/tasks/assets.rake +106 -0
- data/lib/tasks/georgia.rake +61 -0
- data/lib/tasks/install.rake +19 -0
- data/lib/tasks/sidekiq.rake +8 -0
- data/lib/tasks/solr.rake +30 -0
- data/lib/tasks/upgrade.rake +39 -0
- data/lib/templates/erb/scaffold/_form.html.erb +13 -0
- metadata +857 -0
@@ -0,0 +1,32 @@
|
|
1
|
+
module Georgia
|
2
|
+
class Widget < ActiveRecord::Base
|
3
|
+
|
4
|
+
include Concerns::Contentable
|
5
|
+
|
6
|
+
has_many :ui_associations, dependent: :destroy
|
7
|
+
has_many :ui_sections, through: :ui_associations
|
8
|
+
has_many :revisions, through: :ui_associations
|
9
|
+
has_many :pages, through: :revisions
|
10
|
+
|
11
|
+
scope :footer, joins(:ui_sections).where(georgia_ui_sections: {name: 'Footer'})
|
12
|
+
scope :submenu, joins(:ui_sections).where(georgia_ui_sections: {name: 'Submenu'})
|
13
|
+
scope :sidebar, joins(:ui_sections).where(georgia_ui_sections: {name: 'Sidebar'})
|
14
|
+
|
15
|
+
validate :content_presence
|
16
|
+
|
17
|
+
def content_presence
|
18
|
+
contents.each do |content|
|
19
|
+
errors.add(:base, I18n.t("locales.#{content.locale}") + ' Title is required.') unless content.title.present?
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
def featured?
|
24
|
+
@featured ||= pages.any?
|
25
|
+
end
|
26
|
+
|
27
|
+
def featured_count
|
28
|
+
@featured_count ||= pages.count
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
module Georgia
|
2
|
+
class MenuAncestryParser
|
3
|
+
|
4
|
+
def initialize serialized_string
|
5
|
+
@ancestry = serialized_string
|
6
|
+
end
|
7
|
+
|
8
|
+
def to_hash
|
9
|
+
pairs = split_parent_child_pairs
|
10
|
+
parsed_hash = {}
|
11
|
+
pairs.each_with_index do |p, index|
|
12
|
+
attributes = LinkAttributes.new(p)
|
13
|
+
parsed_hash[attributes.id] = {position: index+1, parent_id: attributes.parent_id}
|
14
|
+
end
|
15
|
+
parsed_hash
|
16
|
+
end
|
17
|
+
|
18
|
+
private
|
19
|
+
|
20
|
+
def split_parent_child_pairs
|
21
|
+
@ancestry.split('&')
|
22
|
+
end
|
23
|
+
|
24
|
+
class LinkAttributes
|
25
|
+
|
26
|
+
def initialize serialized_string
|
27
|
+
@serialized_string = serialized_string
|
28
|
+
end
|
29
|
+
|
30
|
+
def id
|
31
|
+
@serialized_string.split('=')[0][5..-2]
|
32
|
+
end
|
33
|
+
|
34
|
+
def parent_id
|
35
|
+
parent_id = @serialized_string.split('=')[1]
|
36
|
+
parent_id == 'null' ? nil : parent_id.to_i
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
end
|
41
|
+
end
|
@@ -0,0 +1,53 @@
|
|
1
|
+
module Georgia
|
2
|
+
class RevisionPolicy < Policy
|
3
|
+
|
4
|
+
attr_reader :page, :attributes
|
5
|
+
attr_accessor :revision
|
6
|
+
|
7
|
+
def initialize controller, page, revision, attributes
|
8
|
+
@page = page
|
9
|
+
@revision = revision
|
10
|
+
@attributes = attributes
|
11
|
+
super
|
12
|
+
end
|
13
|
+
|
14
|
+
def self.update controller, page, revision, attributes
|
15
|
+
new(controller, page, revision, attributes).update_attributes
|
16
|
+
end
|
17
|
+
|
18
|
+
def update_attributes
|
19
|
+
if can? :manage, revision
|
20
|
+
admin_update_attributes
|
21
|
+
elsif can? :review, revision
|
22
|
+
contributor_update_attributes
|
23
|
+
else
|
24
|
+
false
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
private
|
29
|
+
|
30
|
+
def admin_update_attributes
|
31
|
+
page.store if current_revision?
|
32
|
+
revision.update_attributes(attributes)
|
33
|
+
end
|
34
|
+
|
35
|
+
def contributor_update_attributes
|
36
|
+
if current_revision?
|
37
|
+
page.store
|
38
|
+
page.approve_revision(page.revisions.last)
|
39
|
+
end
|
40
|
+
revision.review
|
41
|
+
revision.update_attributes(attributes)
|
42
|
+
end
|
43
|
+
|
44
|
+
def current_revision?
|
45
|
+
@is_current_revision ||= (page.current_revision == revision)
|
46
|
+
end
|
47
|
+
|
48
|
+
def current_review?
|
49
|
+
@is_current_review ||= (revision.review? and revision.revised_by?(current_user))
|
50
|
+
end
|
51
|
+
|
52
|
+
end
|
53
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
module Georgia
|
2
|
+
class ActiveFacetPresenter < Presenter
|
3
|
+
|
4
|
+
attr_reader :text, :param
|
5
|
+
|
6
|
+
def initialize view_context, text, param, options={}
|
7
|
+
super
|
8
|
+
@text = text
|
9
|
+
@param = param
|
10
|
+
@options = options
|
11
|
+
end
|
12
|
+
|
13
|
+
def to_s
|
14
|
+
link_to url_for(unmerged_params), class: 'label label-primary' do
|
15
|
+
"#{text} #{icon_tag('times')}".html_safe
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
private
|
20
|
+
|
21
|
+
def unmerged_params
|
22
|
+
params.merge(param => ((params[param] || []) - [text]))
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
module Georgia
|
2
|
+
class FacetPresenter < Presenter
|
3
|
+
|
4
|
+
attr_reader :active, :text, :param, :options
|
5
|
+
alias :active? :active
|
6
|
+
|
7
|
+
def initialize view_context, text, param, options={}
|
8
|
+
super
|
9
|
+
@text = text
|
10
|
+
@param = param
|
11
|
+
@active = options.fetch(:active, get_active_state_from_params)
|
12
|
+
@options = options
|
13
|
+
end
|
14
|
+
|
15
|
+
def to_s
|
16
|
+
active? ? content_tag(:em, text) : link_to(text, url_for(params.merge(param => text)), class: 'label label-default')
|
17
|
+
end
|
18
|
+
|
19
|
+
private
|
20
|
+
|
21
|
+
def get_active_state_from_params
|
22
|
+
params[param] and params[param] == text
|
23
|
+
end
|
24
|
+
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,101 @@
|
|
1
|
+
module Georgia
|
2
|
+
class LinkPortlet < Portlet
|
3
|
+
|
4
|
+
delegate :text_field_tag, :link_portlet_tag, to: :view_context
|
5
|
+
|
6
|
+
def initialize view_context, link, args={}
|
7
|
+
@content = args.fetch(:content, link.content)
|
8
|
+
super
|
9
|
+
end
|
10
|
+
|
11
|
+
def to_s
|
12
|
+
form = ActiveSupport::SafeBuffer.new
|
13
|
+
form << handle_tag
|
14
|
+
form << link_form_fields
|
15
|
+
form << actions_tag
|
16
|
+
output = ActiveSupport::SafeBuffer.new
|
17
|
+
output << content_tag(:div, form)
|
18
|
+
output << (last_descendant? ? empty_portlet_list : children_portlets)
|
19
|
+
portlet_tag(output)
|
20
|
+
end
|
21
|
+
|
22
|
+
private
|
23
|
+
|
24
|
+
def children_portlets
|
25
|
+
output = ActiveSupport::SafeBuffer.new
|
26
|
+
sublinks.each do |link|
|
27
|
+
output << link_portlet_tag(link)
|
28
|
+
end
|
29
|
+
content_tag(:ol, output, class: 'hide')
|
30
|
+
end
|
31
|
+
|
32
|
+
def empty_portlet_list
|
33
|
+
content_tag(:ol, nil)
|
34
|
+
end
|
35
|
+
|
36
|
+
def link_form_fields
|
37
|
+
content_tag(:span, class: 'link-form') do
|
38
|
+
hidden_fields +
|
39
|
+
label_field_tag +
|
40
|
+
permalink_field_tag
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
def hidden_fields
|
45
|
+
destroy_input_tag + (id_input_tag if persisted?) + locale_input_tag
|
46
|
+
end
|
47
|
+
|
48
|
+
def label_field_tag
|
49
|
+
text_field_tag("menu[links_attributes][#{id}][contents_attributes][#{content_id}][title]", @content.title, class: 'form-control input-label input-sm', placeholder: 'Label')
|
50
|
+
end
|
51
|
+
|
52
|
+
def permalink_field_tag
|
53
|
+
text_field_tag("menu[links_attributes][#{id}][contents_attributes][#{content_id}][text]", @content.text, class: 'form-control input-permalink input-sm', placeholder: 'Permalink, e.g. /my-url')
|
54
|
+
end
|
55
|
+
|
56
|
+
def destroy_input_tag
|
57
|
+
hidden_field_tag("menu[links_attributes][#{id}][_destroy]", 0, class: 'js-destroy')
|
58
|
+
end
|
59
|
+
|
60
|
+
def id_input_tag
|
61
|
+
hidden_field_tag("menu[links_attributes][#{id}][id]", id)
|
62
|
+
end
|
63
|
+
|
64
|
+
def locale_input_tag
|
65
|
+
hidden_field_tag("menu[links_attributes][#{id}][contents_attributes][#{content_id}][locale]", @content.locale)
|
66
|
+
end
|
67
|
+
|
68
|
+
def expand_tag options={}
|
69
|
+
options[:class] = 'toggle btn btn-warning js-expand'
|
70
|
+
options[:class] << ' hide' if last_descendant?
|
71
|
+
link_to('#', options) {icon_tag('caret-down') + icon_tag('caret-up hide')}
|
72
|
+
end
|
73
|
+
|
74
|
+
def remove_tag
|
75
|
+
link_to(icon_tag('times'), '#', class: 'btn btn-danger js-remove-link')
|
76
|
+
end
|
77
|
+
|
78
|
+
def actions_tag options={}
|
79
|
+
content_tag(:div, class: 'actions') do
|
80
|
+
expand_tag + remove_tag
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
84
|
+
def last_descendant?
|
85
|
+
!sublinks.any?
|
86
|
+
end
|
87
|
+
|
88
|
+
def sublinks
|
89
|
+
@portlet.persisted? ? @portlet.children : []
|
90
|
+
end
|
91
|
+
|
92
|
+
def content_id
|
93
|
+
@content.persisted? ? @content.id : 0
|
94
|
+
end
|
95
|
+
|
96
|
+
def dom_id portlet
|
97
|
+
portlet.persisted? ? view_context.dom_id(portlet) : "link_#{id}"
|
98
|
+
end
|
99
|
+
|
100
|
+
end
|
101
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
module Georgia
|
2
|
+
class ListFacetPresenter < Presenter
|
3
|
+
|
4
|
+
attr_reader :list, :param, :options
|
5
|
+
|
6
|
+
def initialize view_context, list, param, options={}
|
7
|
+
super
|
8
|
+
@list = list
|
9
|
+
@param = param
|
10
|
+
@options = options
|
11
|
+
end
|
12
|
+
|
13
|
+
def to_s
|
14
|
+
output = ActiveSupport::SafeBuffer.new
|
15
|
+
list.each do |text|
|
16
|
+
output << link_to(text, url_for(merged_params(text)), class: 'label label-default') unless active?(text)
|
17
|
+
end
|
18
|
+
output
|
19
|
+
end
|
20
|
+
|
21
|
+
private
|
22
|
+
|
23
|
+
def active?(text)
|
24
|
+
params[param] and params[param].include?(text)
|
25
|
+
end
|
26
|
+
|
27
|
+
def merged_params(text)
|
28
|
+
params.merge(param => ((params[param] || []) + [text]))
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
module Georgia
|
2
|
+
class MediaLibraryPresenter
|
3
|
+
|
4
|
+
attr_accessor :view_context
|
5
|
+
|
6
|
+
delegate :content_tag, :link_to, :picture_tag, :hidden_field_tag, :icon_tag, to: :view_context
|
7
|
+
|
8
|
+
def initialize view_context, imageable, args={}
|
9
|
+
@view_context = view_context
|
10
|
+
@imageable = imageable
|
11
|
+
@target = args.fetch(:target, 'media_library_image')
|
12
|
+
@input = args.fetch(:input, image_input_tag)
|
13
|
+
end
|
14
|
+
|
15
|
+
def to_s
|
16
|
+
content_tag(:div, class: 'media-library-image', id: @target) do
|
17
|
+
media_featured_tag + choose_image_button_tag + @input
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
def choose_image_button_tag
|
22
|
+
link_to("#{icon_tag('picture-o')} Choose Image".html_safe, '#', class: 'btn btn-primary js-media-library', data: {media: "##{@target}", toggle: 'modal', target: '#media_library'})
|
23
|
+
end
|
24
|
+
|
25
|
+
def media_featured_tag
|
26
|
+
content_tag :div, class: 'media-featured js-media-image' do
|
27
|
+
picture_tag(image, format: :thumb)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
def image_input_tag
|
32
|
+
hidden_field_tag(:image, image_id)
|
33
|
+
end
|
34
|
+
|
35
|
+
def image
|
36
|
+
@imageable.image
|
37
|
+
end
|
38
|
+
|
39
|
+
def image_id
|
40
|
+
@imageable.image_id
|
41
|
+
end
|
42
|
+
|
43
|
+
end
|
44
|
+
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
module Georgia
|
2
|
+
class MessageActionsPresenter
|
3
|
+
|
4
|
+
attr_reader :view, :message
|
5
|
+
delegate :icon_tag, :content_tag, :link_to, :controller_name, :url_for, :main_app, :can?, :caret_tag, to: :view
|
6
|
+
|
7
|
+
def initialize view, message
|
8
|
+
@view = view
|
9
|
+
@message = (message.decorated? ? message.object : message)
|
10
|
+
end
|
11
|
+
|
12
|
+
def to_s
|
13
|
+
html = ActiveSupport::SafeBuffer.new
|
14
|
+
html << content_tag(:li, link_to_print)
|
15
|
+
if spam?
|
16
|
+
html << content_tag(:li, link_to_ham) if can?(:ham, message)
|
17
|
+
else
|
18
|
+
html << content_tag(:li, link_to_spam) if can?(:spam, message)
|
19
|
+
end
|
20
|
+
html << content_tag(:li, link_to_trash) if can?(:destroy, message)
|
21
|
+
html
|
22
|
+
end
|
23
|
+
|
24
|
+
private
|
25
|
+
|
26
|
+
def link_to_print
|
27
|
+
link_to "#{icon_tag('print')} Print".html_safe, "javascript:window.print()", target: '_blank'
|
28
|
+
end
|
29
|
+
|
30
|
+
def link_to_reply
|
31
|
+
link_to "#{icon_tag('reply')} Reply".html_safe, "mailto:#{@message.email}", target: '_blank'
|
32
|
+
end
|
33
|
+
|
34
|
+
def link_to_ham
|
35
|
+
link_to "#{icon_tag('thumbs-up')} Mark as ham".html_safe, [:ham, @message]
|
36
|
+
end
|
37
|
+
|
38
|
+
def link_to_spam
|
39
|
+
link_to "#{icon_tag('thumbs-down')} Mark as spam".html_safe, [:spam, @message]
|
40
|
+
end
|
41
|
+
|
42
|
+
def link_to_trash
|
43
|
+
link_to "#{icon_tag('trash-o')} Trash".html_safe, @message, method: :delete, data: {confirm: 'Are you sure?'}
|
44
|
+
end
|
45
|
+
|
46
|
+
def spam?
|
47
|
+
@message.spam?
|
48
|
+
end
|
49
|
+
|
50
|
+
end
|
51
|
+
end
|
@@ -0,0 +1,94 @@
|
|
1
|
+
module Georgia
|
2
|
+
class PageActionsPresenter < Presenter
|
3
|
+
|
4
|
+
attr_accessor :page, :revision, :options
|
5
|
+
|
6
|
+
def initialize view, page, revision, options={}
|
7
|
+
@page = (page.decorated? ? page.object : page)
|
8
|
+
@revision = (revision.decorated? ? revision.object : revision)
|
9
|
+
@options = options
|
10
|
+
super
|
11
|
+
end
|
12
|
+
|
13
|
+
def to_s
|
14
|
+
content_tag :div, class: 'dropdown' do
|
15
|
+
link_to("Actions #{caret_tag}".html_safe, '#', role: :button, class: 'btn btn-warning', data: {toggle: 'dropdown'}) +
|
16
|
+
content_tag(:ul, action_list, class: 'dropdown-menu', role: :menu)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
def action_list
|
21
|
+
html = ActiveSupport::SafeBuffer.new
|
22
|
+
html << content_tag(:li, link_to_edit) if can?(:edit, page)
|
23
|
+
# html << content_tag(:li, link_to_settings) if can?(:settings, page)
|
24
|
+
html << content_tag(:li, link_to_preview) if can?(:preview, page)
|
25
|
+
html << content_tag(:li, link_to_copy) if can?(:copy, page)
|
26
|
+
if page.current_revision and page.current_revision.published?
|
27
|
+
html << content_tag(:li, link_to_publish) if can?(:publish, page) and !page.published?
|
28
|
+
html << content_tag(:li, link_to_unpublish) if can?(:unpublish, page) and page.published?
|
29
|
+
end
|
30
|
+
html << content_tag(:li, link_to_flush_cache) if can?(:flush_cache, page)
|
31
|
+
html << content_tag(:li, link_to_revisions) if can?(:index, Revision)
|
32
|
+
html
|
33
|
+
end
|
34
|
+
|
35
|
+
private
|
36
|
+
|
37
|
+
def link_to_preview
|
38
|
+
link_to "#{icon_tag('eye')} Preview".html_safe, [:preview, page, revision], options.reverse_merge(target: '_blank')
|
39
|
+
end
|
40
|
+
|
41
|
+
def link_to_settings
|
42
|
+
link_to "#{icon_tag('cogs')} Settings".html_safe, [:settings, page], options
|
43
|
+
end
|
44
|
+
|
45
|
+
def link_to_edit
|
46
|
+
link_to "#{icon_tag('pencil')} Edit".html_safe, [:edit, page], options
|
47
|
+
end
|
48
|
+
|
49
|
+
def link_to_settings
|
50
|
+
link_to "#{icon_tag('cogs')} Settings".html_safe, [:settings, page], options
|
51
|
+
end
|
52
|
+
|
53
|
+
def link_to_copy
|
54
|
+
link_to "#{icon_tag('copy')} Copy".html_safe, [:copy, page], options
|
55
|
+
end
|
56
|
+
|
57
|
+
def link_to_flush_cache
|
58
|
+
link_to "#{icon_tag('fire-extinguisher')} Flush Cache".html_safe, georgia.flush_cache_pages_path(id: [page.id]), options.merge(method: :post)
|
59
|
+
end
|
60
|
+
|
61
|
+
def link_to_publish
|
62
|
+
link_to "#{icon_tag('thumbs-up')} Publish".html_safe, georgia.publish_pages_path(id: [page.id]), options.merge(method: :post)
|
63
|
+
end
|
64
|
+
|
65
|
+
def link_to_unpublish
|
66
|
+
link_to "#{icon_tag('thumbs-down')} Unpublish".html_safe, georgia.unpublish_pages_path(id: [page.id]), options.merge(data: {confirm: 'Are you sure?'}, method: :post)
|
67
|
+
end
|
68
|
+
|
69
|
+
def link_to_review
|
70
|
+
link_to "#{icon_tag('flag')} Ask for Review".html_safe, [:review, page], options
|
71
|
+
end
|
72
|
+
|
73
|
+
def link_to_approve
|
74
|
+
link_to "#{icon_tag('thumbs-up')} Approve".html_safe, [:approve, page], options
|
75
|
+
end
|
76
|
+
|
77
|
+
def link_to_decline
|
78
|
+
link_to "#{icon_tag('thumbs-down')} Decline".html_safe, [:decline, page], options
|
79
|
+
end
|
80
|
+
|
81
|
+
def link_to_delete
|
82
|
+
options = {}
|
83
|
+
options[:data] ||= {}
|
84
|
+
options[:data][:confirm] = 'Are you sure?'
|
85
|
+
options[:method] ||= :delete
|
86
|
+
link_to "#{icon_tag('icon-trash')} Delete".html_safe, page, options
|
87
|
+
end
|
88
|
+
|
89
|
+
def link_to_revisions
|
90
|
+
link_to "#{icon_tag('copy')} Revisions".html_safe, [page, :revisions], options
|
91
|
+
end
|
92
|
+
|
93
|
+
end
|
94
|
+
end
|