georgia 0.7.8 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/MIT-LICENSE +1 -1
- data/README.md +60 -16
- data/Rakefile +17 -10
- data/app/assets/images/georgia/arrow.png +0 -0
- data/app/assets/images/georgia/close.png +0 -0
- data/app/assets/javascripts/georgia/application.js +3 -6
- data/app/assets/javascripts/georgia/bootstrap-vendor.js.coffee +1 -1
- data/app/assets/javascripts/georgia/ckeditor/config.js +1 -1
- data/app/assets/javascripts/georgia/components/flash.js.coffee +1 -1
- data/app/assets/javascripts/georgia/components/media-library.js.coffee +1 -1
- data/app/assets/javascripts/georgia/components/tables.js.coffee +30 -0
- data/app/assets/javascripts/georgia/components/tables/{checkbox.js.coffee → checkboxable.js.coffee} +10 -39
- data/app/assets/javascripts/georgia/components/tables/media.js.coffee +17 -29
- data/app/assets/javascripts/georgia/components/tables/pages.js.coffee +26 -44
- data/app/assets/javascripts/georgia/components/tags.js.coffee +13 -24
- data/app/assets/javascripts/georgia/vendor/ekko-lightbox.min.js +7 -0
- data/app/assets/javascripts/georgia/vendor/textext.core.js +1618 -0
- data/app/assets/javascripts/georgia/vendor/textext.plugin.ajax.js +354 -0
- data/app/assets/javascripts/georgia/vendor/textext.plugin.arrow.js +106 -0
- data/app/assets/javascripts/georgia/vendor/textext.plugin.autocomplete.js +1110 -0
- data/app/assets/javascripts/georgia/vendor/textext.plugin.clear.js +116 -0
- data/app/assets/javascripts/georgia/vendor/textext.plugin.filter.js +242 -0
- data/app/assets/javascripts/georgia/vendor/textext.plugin.focus.js +174 -0
- data/app/assets/javascripts/georgia/vendor/textext.plugin.prompt.js +309 -0
- data/app/assets/javascripts/georgia/vendor/textext.plugin.suggestions.js +175 -0
- data/app/assets/javascripts/georgia/vendor/textext.plugin.tags.js +698 -0
- data/app/assets/stylesheets/georgia/application.css.scss +71 -12
- data/app/assets/stylesheets/georgia/components/_button.scss +3 -20
- data/app/assets/stylesheets/georgia/components/_label.scss +36 -1
- data/app/assets/stylesheets/georgia/components/_portlet.scss +4 -1
- data/app/assets/stylesheets/georgia/components/_status.scss +9 -0
- data/app/assets/stylesheets/georgia/components/_table.scss +7 -0
- data/app/assets/stylesheets/georgia/layout/_base.scss +22 -5
- data/app/assets/stylesheets/georgia/layout/_print.scss +8 -0
- data/app/assets/stylesheets/georgia/modules/_activities.scss +3 -0
- data/app/assets/stylesheets/georgia/modules/_footer.scss +3 -1
- data/app/assets/stylesheets/georgia/modules/_form_with_helpers.scss +2 -2
- data/app/assets/stylesheets/georgia/modules/_header.scss +4 -13
- data/app/assets/stylesheets/georgia/modules/_link.scss +6 -1
- data/app/assets/stylesheets/georgia/modules/_login.scss +7 -0
- data/app/assets/stylesheets/georgia/modules/_media.scss +10 -0
- data/app/assets/stylesheets/georgia/modules/_navigation.scss +5 -0
- data/app/assets/stylesheets/georgia/modules/_pages.scss +3 -0
- data/app/assets/stylesheets/georgia/modules/_results.scss +11 -4
- data/app/assets/stylesheets/georgia/modules/_sidebar.scss +6 -21
- data/app/assets/stylesheets/georgia/modules/_users.scss +3 -0
- data/app/assets/stylesheets/georgia/overrides/_flatly.scss +16 -0
- data/app/assets/stylesheets/georgia/overrides/_textext.scss +54 -0
- data/app/assets/stylesheets/georgia/settings/_base.scss +1 -1
- data/app/assets/stylesheets/georgia/settings/_colors.scss +31 -1
- data/app/assets/stylesheets/georgia/settings/_z-index.scss +2 -2
- data/app/assets/stylesheets/georgia/vendor/_bootswatch-flatly-theme.scss +7 -0
- data/app/assets/stylesheets/georgia/vendor/_ekko-lightbox.min.scss +6 -0
- data/app/assets/stylesheets/georgia/vendor/_select2_bootstrap.scss +497 -0
- data/app/assets/stylesheets/georgia/vendor/_textext.core.scss +29 -0
- data/app/assets/stylesheets/georgia/vendor/_textext.plugin.arrow.scss +13 -0
- data/app/assets/stylesheets/georgia/vendor/_textext.plugin.autocomplete.scss +35 -0
- data/app/assets/stylesheets/georgia/vendor/_textext.plugin.clear.scss +13 -0
- data/app/assets/stylesheets/georgia/vendor/_textext.plugin.focus.scss +12 -0
- data/app/assets/stylesheets/georgia/vendor/_textext.plugin.prompt.scss +16 -0
- data/app/assets/stylesheets/georgia/vendor/_textext.plugin.tags.scss +49 -0
- data/app/controllers/georgia/api/media_controller.rb +4 -2
- data/app/controllers/georgia/api/tags_controller.rb +10 -7
- data/app/controllers/georgia/application_controller.rb +17 -2
- data/app/controllers/georgia/concerns/frontendable.rb +2 -3
- data/app/controllers/georgia/dashboard_controller.rb +5 -7
- data/app/controllers/georgia/links_controller.rb +1 -0
- data/app/controllers/georgia/media_controller.rb +50 -41
- data/app/controllers/georgia/menus_controller.rb +16 -6
- data/app/controllers/georgia/pages_controller.rb +98 -58
- data/app/controllers/georgia/revisions_controller.rb +120 -24
- data/app/controllers/georgia/ui_associations_controller.rb +1 -0
- data/app/controllers/georgia/users_controller.rb +31 -11
- data/app/controllers/georgia/widgets_controller.rb +13 -4
- data/app/helpers/georgia/application_helper.rb +4 -0
- data/app/helpers/georgia/forms_helper.rb +2 -2
- data/app/helpers/georgia/ui_helper.rb +78 -12
- data/app/helpers/georgia/users_helper.rb +21 -0
- data/app/mailers/georgia/notifier.rb +4 -4
- data/app/models/ckeditor/asset.rb +16 -4
- data/app/models/ckeditor/asset_search.rb +15 -0
- data/app/models/ckeditor/attachment_file.rb +7 -0
- data/app/models/ckeditor/picture.rb +10 -0
- data/app/models/georgia/clone.rb +3 -1
- data/app/models/georgia/concerns/contentable.rb +2 -3
- data/app/models/georgia/concerns/searchable.rb +32 -0
- data/app/models/georgia/concerns/taggable.rb +2 -2
- data/app/models/georgia/concerns/treeable.rb +0 -1
- data/app/models/georgia/content.rb +1 -3
- data/app/models/georgia/dashboard.rb +7 -0
- data/app/models/georgia/link.rb +10 -3
- data/app/models/georgia/menu.rb +4 -4
- data/app/models/georgia/page.rb +75 -10
- data/app/models/georgia/revision.rb +10 -5
- data/app/models/georgia/role.rb +5 -5
- data/app/models/georgia/role_assignment.rb +8 -0
- data/app/models/georgia/slide.rb +4 -4
- data/app/models/georgia/status.rb +3 -5
- data/app/models/georgia/ui_association.rb +3 -5
- data/app/models/georgia/ui_section.rb +1 -1
- data/app/models/georgia/user.rb +5 -14
- data/app/models/georgia/widget.rb +3 -3
- data/app/policies/georgia/api_policy.rb +13 -0
- data/app/policies/georgia/application_policy.rb +30 -0
- data/app/policies/georgia/concerns/content_policy.rb +56 -0
- data/app/policies/georgia/concerns/publishing_policy.rb +52 -0
- data/app/policies/georgia/dashboard_policy.rb +19 -0
- data/app/policies/georgia/media_policy.rb +56 -0
- data/app/policies/georgia/navigation_policy.rb +42 -0
- data/app/policies/georgia/page_policy.rb +26 -0
- data/app/policies/georgia/revision_policy.rb +7 -44
- data/app/policies/georgia/ui_association_policy.rb +4 -0
- data/app/policies/georgia/user_policy.rb +46 -0
- data/app/policies/georgia/widget_policy.rb +42 -0
- data/app/presenters/georgia/active_facet_presenter.rb +2 -1
- data/app/presenters/georgia/link_portlet.rb +2 -2
- data/app/presenters/georgia/pagination_presenter.rb +45 -7
- data/app/presenters/georgia/permission_table_presenter.rb +80 -0
- data/app/presenters/georgia/revision_status_message.rb +73 -0
- data/app/presenters/georgia/sidebar_link_presenter.rb +1 -1
- data/app/presenters/georgia/slide_portlet.rb +5 -1
- data/app/routes/georgia/pageable_route_concern.rb +35 -0
- data/app/searches/georgia/media_search.rb +39 -0
- data/app/searches/georgia/page_search.rb +47 -0
- data/app/searches/georgia/search_definition.rb +72 -0
- data/app/searches/georgia/tag_search.rb +32 -0
- data/app/services/georgia/clone_revision.rb +71 -0
- data/app/services/georgia/compress_files.rb +49 -0
- data/app/services/georgia/copy_page.rb +100 -0
- data/app/services/georgia/create_activity.rb +16 -0
- data/app/services/georgia/create_media_asset.rb +53 -0
- data/app/services/georgia/parse_json_tags.rb +21 -0
- data/app/services/georgia/update_revision.rb +52 -0
- data/app/views/georgia/api/media/pictures.html.erb +1 -1
- data/app/views/georgia/ckeditor/assets/_asset.html.erb +2 -4
- data/app/views/georgia/ckeditor/pictures/_picture.html.erb +1 -6
- data/app/views/georgia/dashboard/panels/_messages.html.erb +26 -28
- data/app/views/georgia/dashboard/panels/_reviews.html.erb +23 -22
- data/app/views/georgia/dashboard/show.html.erb +9 -3
- data/app/views/georgia/header/_media.html.erb +2 -2
- data/app/views/georgia/header/_navigation.html.erb +3 -3
- data/app/views/georgia/header/_pages.html.erb +3 -3
- data/app/views/georgia/header/_users.html.erb +2 -2
- data/app/views/georgia/header/_widgets.html.erb +1 -1
- data/app/views/georgia/media/_header.html.erb +4 -2
- data/app/views/georgia/media/create.js.erb +1 -0
- data/app/views/georgia/media/destroy.js.erb +3 -0
- data/app/views/georgia/media/edit.html.erb +35 -30
- data/app/views/georgia/media/search.html.erb +2 -2
- data/app/views/georgia/menus/index.html.erb +1 -1
- data/app/views/georgia/pages/_header.html.erb +4 -4
- data/app/views/georgia/pages/_page.html.erb +1 -1
- data/app/views/georgia/pages/search.html.erb +4 -5
- data/app/views/georgia/pages/settings.html.erb +72 -61
- data/app/views/georgia/revisions/_revision.html.erb +12 -7
- data/app/views/georgia/revisions/edit.html.erb +17 -11
- data/app/views/georgia/revisions/fields/_content.html.erb +1 -2
- data/app/views/georgia/revisions/fields/_message.html.erb +11 -0
- data/app/views/georgia/revisions/fields/_ui_section.html.erb +1 -1
- data/app/views/georgia/revisions/fields/_widgets.html.erb +1 -1
- data/app/views/georgia/revisions/index.html.erb +2 -2
- data/app/views/georgia/revisions/messages/_awaiting_review.html.erb +15 -0
- data/app/views/georgia/revisions/messages/_continue_draft.html.erb +8 -0
- data/app/views/georgia/revisions/messages/_edit_current_revision.html.erb +12 -0
- data/app/views/georgia/revisions/messages/_insufficient_rights.html.erb +6 -0
- data/app/views/georgia/revisions/messages/_request_review.html.erb +7 -0
- data/app/views/georgia/revisions/messages/_review.html.erb +7 -0
- data/app/views/georgia/revisions/messages/_start_draft.html.erb +4 -0
- data/app/views/georgia/revisions/panels/_actions.html.erb +7 -0
- data/app/views/georgia/revisions/panels/_activities.html.erb +6 -0
- data/app/views/georgia/revisions/panels/_drafts.html.erb +28 -0
- data/app/views/georgia/revisions/panels/_info.html.erb +39 -0
- data/app/views/georgia/shared/modals/_media_library.html.erb +3 -1
- data/app/views/georgia/shared/search/_messages.html.erb +1 -1
- data/app/views/georgia/users/_form.html.erb +17 -2
- data/app/views/georgia/users/_user.html.erb +1 -1
- data/app/views/georgia/users/edit.html.erb +0 -1
- data/app/views/georgia/users/index.html.erb +1 -1
- data/app/views/georgia/users/permissions.html.erb +15 -0
- data/app/views/georgia/users/sessions/new.html.erb +3 -3
- data/app/views/layouts/georgia/_footer.html.erb +1 -3
- data/app/views/layouts/georgia/_head.html.erb +3 -4
- data/app/views/layouts/georgia/_header.html.erb +8 -10
- data/app/views/public_activity/_default.html.erb +15 -0
- data/app/views/public_activity/georgia_page/_copy.html.erb +15 -0
- data/app/views/public_activity/georgia_page/_create.html.erb +15 -0
- data/app/views/public_activity/georgia_page/_decline.html.erb +15 -0
- data/app/views/public_activity/georgia_page/_publish.html.erb +15 -0
- data/app/views/public_activity/georgia_page/_unpublish.html.erb +15 -0
- data/app/views/public_activity/georgia_page/_update.html.erb +15 -0
- data/app/views/public_activity/georgia_revision/_approve.html.erb +15 -0
- data/app/views/public_activity/georgia_revision/_decline.html.erb +15 -0
- data/app/views/public_activity/georgia_revision/_draft.html.erb +15 -0
- data/app/views/public_activity/georgia_revision/_restore.html.erb +15 -0
- data/app/views/public_activity/georgia_revision/_review.html.erb +15 -0
- data/app/views/public_activity/georgia_revision/_update.html.erb +15 -0
- data/config/initializers/acts_as_taggable_on.rb +13 -12
- data/config/initializers/ckeditor.rb +36 -16
- data/config/initializers/devise.rb +17 -15
- data/config/initializers/elasticsearch.rb +44 -0
- data/config/initializers/inflections.rb +1 -1
- data/config/routes.rb +13 -36
- data/db/migrate/001_create_ckeditor_assets.rb +6 -5
- data/db/migrate/002_create_georgia_contents.rb +2 -4
- data/db/migrate/008_create_georgia_roles.rb +0 -2
- data/db/migrate/015_add_receives_notifications_to_users.rb +7 -0
- data/db/migrate/016_add_role_id_to_users.rb +7 -0
- data/db/migrate/017_add_status_to_revisions.rb +7 -0
- data/db/migrate/018_create_georgia_role_assignments.rb +11 -0
- data/db/migrate/019_create_activities.rb +23 -0
- data/db/migrate/020_remove_georgia_revisions_state.rb +11 -0
- data/db/migrate/021_add_revised_by_id_to_georgia_revisions.rb +13 -0
- data/lib/generators/georgia/install/install_generator.rb +3 -29
- data/lib/generators/georgia/install/templates/app/controllers/pages_controller.rb +1 -1
- data/lib/generators/georgia/install/templates/config/initializers/georgia.rb +3 -7
- data/lib/generators/georgia/setup/setup_generator.rb +29 -0
- data/lib/georgia.rb +26 -9
- data/lib/georgia/engine.rb +6 -25
- data/lib/georgia/permissions.rb +57 -0
- data/lib/georgia/uploader/adapter.rb +4 -1
- data/lib/georgia/uploader/storage/file.rb +23 -0
- data/lib/georgia/version.rb +1 -1
- data/lib/tasks/georgia_tasks.rake +99 -0
- metadata +463 -461
- data/app/assets/fonts/georgia/signika-bold-webfont.eot +0 -0
- data/app/assets/fonts/georgia/signika-bold-webfont.svg +0 -1711
- 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 +0 -1680
- 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 +0 -1746
- 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/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/jpeg.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/logo.png +0 -0
- data/app/assets/images/georgia/up_arrow.gif +0 -0
- data/app/assets/javascripts/georgia/keybindings.js.coffee +0 -42
- data/app/assets/stylesheets/georgia/components/_state.scss +0 -17
- data/app/assets/stylesheets/georgia/settings/_fonts.scss +0 -3
- data/app/decorators/georgia/link_decorator.rb +0 -9
- data/app/decorators/georgia/links_decorator.rb +0 -4
- data/app/helpers/georgia/internationalization_helper.rb +0 -45
- data/app/helpers/georgia/menus_helper.rb +0 -20
- data/app/helpers/georgia/meta_tags_helper.rb +0 -22
- data/app/helpers/georgia/pages_helper.rb +0 -30
- data/app/helpers/georgia/routes_helper.rb +0 -25
- data/app/helpers/georgia/twitter_helper.rb +0 -24
- data/app/models/ability.rb +0 -19
- data/app/models/acts_as_taggable_on/tag.rb +0 -5
- data/app/models/georgia/concerns/cacheable.rb +0 -18
- data/app/models/georgia/concerns/orderable.rb +0 -21
- data/app/models/georgia/concerns/publishable.rb +0 -35
- data/app/models/georgia/concerns/revisionable.rb +0 -38
- data/app/models/georgia/concerns/slugable.rb +0 -48
- data/app/models/georgia/concerns/statable.rb +0 -64
- data/app/models/georgia/concerns/templatable.rb +0 -20
- data/app/policies/georgia/policy.rb +0 -17
- data/app/presenters/georgia/page_actions_presenter.rb +0 -92
- data/app/presenters/georgia/warning_message.rb +0 -55
- data/app/services/create_media_asset.rb +0 -51
- data/app/sweepers/navigation_sweeper.rb +0 -12
- data/app/views/georgia/media/sidebar/_facets.html.erb +0 -12
- data/app/views/menus/_dropdown_group.html.erb +0 -10
- data/app/views/menus/_dropdown_link.html.erb +0 -3
- data/app/views/menus/_dropdown_menu.html.erb +0 -11
- data/app/views/menus/_link.html.erb +0 -1
- data/app/views/menus/_menu.html.erb +0 -7
- data/config/initializers/simple_form.rb +0 -79
- data/config/locales/georgia.en.yml +0 -4
- data/lib/georgia/indexer.rb +0 -33
- data/lib/georgia/indexer/adapter.rb +0 -44
- data/lib/georgia/indexer/extensions/solr_adapter/acts_as_taggable_on/tag.rb +0 -30
- data/lib/georgia/indexer/extensions/solr_adapter/ckeditor/asset.rb +0 -46
- data/lib/georgia/indexer/extensions/solr_adapter/georgia/page.rb +0 -75
- data/lib/georgia/indexer/extensions/tire_adapter/acts_as_taggable_on/tag.rb +0 -34
- data/lib/georgia/indexer/extensions/tire_adapter/ckeditor/asset.rb +0 -57
- data/lib/georgia/indexer/extensions/tire_adapter/georgia/page.rb +0 -55
- data/lib/georgia/indexer/solr_adapter.rb +0 -20
- data/lib/georgia/indexer/tire_adapter.rb +0 -18
- data/lib/tasks/assets.rake +0 -20
- data/lib/tasks/georgia.rake +0 -65
- data/lib/tasks/sidekiq.rake +0 -8
- data/lib/tasks/solr.rake +0 -21
- data/lib/tasks/upgrade.rake +0 -39
- data/lib/templates/erb/scaffold/_form.html.erb +0 -13
@@ -0,0 +1,29 @@
|
|
1
|
+
.text-core {
|
2
|
+
position: relative;
|
3
|
+
}
|
4
|
+
.text-core .text-wrap {
|
5
|
+
background: #fff;
|
6
|
+
position: absolute;
|
7
|
+
}
|
8
|
+
.text-core .text-wrap textarea,
|
9
|
+
.text-core .text-wrap input {
|
10
|
+
-webkit-box-sizing: border-box;
|
11
|
+
-moz-box-sizing: border-box;
|
12
|
+
box-sizing: border-box;
|
13
|
+
-webkit-border-radius: 0px;
|
14
|
+
-moz-border-radius: 0px;
|
15
|
+
border-radius: 0px;
|
16
|
+
border: 1px solid #9daccc;
|
17
|
+
outline: none;
|
18
|
+
resize: none;
|
19
|
+
position: absolute;
|
20
|
+
z-index: 1;
|
21
|
+
background: none;
|
22
|
+
overflow: hidden;
|
23
|
+
margin: 0;
|
24
|
+
padding: 3px 5px 4px 5px;
|
25
|
+
white-space: nowrap;
|
26
|
+
font: 11px "lucida grande", tahoma, verdana, arial, sans-serif;
|
27
|
+
line-height: 13px;
|
28
|
+
height: auto;
|
29
|
+
}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
.text-core .text-wrap .text-arrow {
|
2
|
+
-webkit-box-sizing: border-box;
|
3
|
+
-moz-box-sizing: border-box;
|
4
|
+
box-sizing: border-box;
|
5
|
+
position: absolute;
|
6
|
+
top: 0;
|
7
|
+
right: 0;
|
8
|
+
width: 22px;
|
9
|
+
height: 22px;
|
10
|
+
background: asset-url("georgia/arrow.png") 50% 50% no-repeat;
|
11
|
+
cursor: pointer;
|
12
|
+
z-index: 2;
|
13
|
+
}
|
@@ -0,0 +1,35 @@
|
|
1
|
+
.text-core .text-wrap .text-dropdown {
|
2
|
+
-webkit-box-sizing: border-box;
|
3
|
+
-moz-box-sizing: border-box;
|
4
|
+
box-sizing: border-box;
|
5
|
+
padding: 0;
|
6
|
+
position: absolute;
|
7
|
+
z-index: 3;
|
8
|
+
background: #fff;
|
9
|
+
border: 1px solid #9daccc;
|
10
|
+
width: 100%;
|
11
|
+
max-height: 100px;
|
12
|
+
padding: 1px;
|
13
|
+
font: 11px "lucida grande", tahoma, verdana, arial, sans-serif;
|
14
|
+
display: none;
|
15
|
+
overflow-x: hidden;
|
16
|
+
overflow-y: auto;
|
17
|
+
}
|
18
|
+
.text-core .text-wrap .text-dropdown.text-position-below {
|
19
|
+
margin-top: 1px;
|
20
|
+
}
|
21
|
+
.text-core .text-wrap .text-dropdown.text-position-above {
|
22
|
+
margin-bottom: 1px;
|
23
|
+
}
|
24
|
+
.text-core .text-wrap .text-dropdown .text-list .text-suggestion {
|
25
|
+
padding: 3px 5px;
|
26
|
+
cursor: pointer;
|
27
|
+
}
|
28
|
+
.text-core .text-wrap .text-dropdown .text-list .text-suggestion em {
|
29
|
+
font-style: normal;
|
30
|
+
text-decoration: underline;
|
31
|
+
}
|
32
|
+
.text-core .text-wrap .text-dropdown .text-list .text-suggestion.text-selected {
|
33
|
+
color: #fff;
|
34
|
+
background: #6d84b4;
|
35
|
+
}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
.text-core .text-wrap .text-clear {
|
2
|
+
-webkit-box-sizing: border-box;
|
3
|
+
-moz-box-sizing: border-box;
|
4
|
+
box-sizing: border-box;
|
5
|
+
position: absolute;
|
6
|
+
top: 0;
|
7
|
+
right: 14px;
|
8
|
+
width: 22px;
|
9
|
+
height: 22px;
|
10
|
+
background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAAYUlEQVR42mP4////P1IwA5RBNIBr+Pj5+/9Tlx78v373OYoCkBgIY2gACWr7tP63CO8BanoBlmyfuQssBsIYGtAVLNpwEsMADA0gAFMIw+hOpEwDSU4i2dMkByvJEUcsAABHaALCQIZDrAAAAABJRU5ErkJggg==") 50% 50% no-repeat;
|
11
|
+
cursor: pointer;
|
12
|
+
z-index: 2;
|
13
|
+
}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
.text-core .text-wrap .text-focus {
|
2
|
+
-webkit-box-shadow: 0px 0px 6px #6d84b4;
|
3
|
+
-moz-box-shadow: 0px 0px 6px #6d84b4;
|
4
|
+
box-shadow: 0px 0px 6px #6d84b4;
|
5
|
+
position: absolute;
|
6
|
+
width: 100%;
|
7
|
+
height: 100%;
|
8
|
+
display: none;
|
9
|
+
}
|
10
|
+
.text-core .text-wrap .text-focus.text-show-focus {
|
11
|
+
display: block;
|
12
|
+
}
|
@@ -0,0 +1,16 @@
|
|
1
|
+
.text-core .text-wrap .text-prompt {
|
2
|
+
-webkit-box-sizing: border-box;
|
3
|
+
-moz-box-sizing: border-box;
|
4
|
+
box-sizing: border-box;
|
5
|
+
position: absolute;
|
6
|
+
width: 100%;
|
7
|
+
height: 100%;
|
8
|
+
margin: 1px 0 0 2px;
|
9
|
+
font: 11px "lucida grande", tahoma, verdana, arial, sans-serif;
|
10
|
+
color: #c0c0c0;
|
11
|
+
overflow: hidden;
|
12
|
+
white-space: pre;
|
13
|
+
}
|
14
|
+
.text-core .text-wrap .text-prompt.text-hide-prompt {
|
15
|
+
display: none;
|
16
|
+
}
|
@@ -0,0 +1,49 @@
|
|
1
|
+
.text-core .text-wrap .text-tags {
|
2
|
+
-webkit-box-sizing: border-box;
|
3
|
+
-moz-box-sizing: border-box;
|
4
|
+
box-sizing: border-box;
|
5
|
+
position: absolute;
|
6
|
+
width: 100%;
|
7
|
+
height: 100%;
|
8
|
+
padding: 3px 35px 3px 3px;
|
9
|
+
cursor: text;
|
10
|
+
}
|
11
|
+
.text-core .text-wrap .text-tags.text-tags-on-top {
|
12
|
+
z-index: 2;
|
13
|
+
}
|
14
|
+
.text-core .text-wrap .text-tags .text-tag {
|
15
|
+
float: left;
|
16
|
+
}
|
17
|
+
.text-core .text-wrap .text-tags .text-tag .text-button {
|
18
|
+
-webkit-border-radius: 2px;
|
19
|
+
-moz-border-radius: 2px;
|
20
|
+
border-radius: 2px;
|
21
|
+
-webkit-box-sizing: border-box;
|
22
|
+
-moz-box-sizing: border-box;
|
23
|
+
box-sizing: border-box;
|
24
|
+
position: relative;
|
25
|
+
float: left;
|
26
|
+
border: 1px solid #9daccc;
|
27
|
+
background: #e2e6f0;
|
28
|
+
color: #000;
|
29
|
+
padding: 0px 17px 0px 3px;
|
30
|
+
margin: 0 2px 2px 0;
|
31
|
+
cursor: pointer;
|
32
|
+
height: 16px;
|
33
|
+
font: 11px "lucida grande", tahoma, verdana, arial, sans-serif;
|
34
|
+
}
|
35
|
+
.text-core .text-wrap .text-tags .text-tag .text-button a.text-remove {
|
36
|
+
position: absolute;
|
37
|
+
right: 3px;
|
38
|
+
top: 2px;
|
39
|
+
display: block;
|
40
|
+
width: 11px;
|
41
|
+
height: 11px;
|
42
|
+
background: asset-url("georgia/close.png") 0 0 no-repeat;
|
43
|
+
}
|
44
|
+
.text-core .text-wrap .text-tags .text-tag .text-button a.text-remove:hover {
|
45
|
+
background-position: 0 -11px;
|
46
|
+
}
|
47
|
+
.text-core .text-wrap .text-tags .text-tag .text-button a.text-remove:active {
|
48
|
+
background-position: 0 -22px;
|
49
|
+
}
|
@@ -3,8 +3,10 @@ module Georgia
|
|
3
3
|
class MediaController < Georgia::ApplicationController
|
4
4
|
|
5
5
|
def pictures
|
6
|
-
|
7
|
-
|
6
|
+
authorize Ckeditor::Asset
|
7
|
+
search_conditions = Georgia::MediaSearch.new(params.merge(only: [:pictures])).definition
|
8
|
+
@search = Ckeditor::Asset.search(search_conditions).page(params[:page]).per(params.fetch(:per, 12))
|
9
|
+
@pictures = Ckeditor::PictureDecorator.decorate_collection(@search.records)
|
8
10
|
render layout: false
|
9
11
|
end
|
10
12
|
|
@@ -1,17 +1,20 @@
|
|
1
|
-
# TODO: Move to Georgia::Indexer
|
2
1
|
module Georgia
|
3
2
|
module Api
|
4
3
|
class TagsController < Georgia::ApplicationController
|
5
4
|
|
6
5
|
respond_to :json
|
7
6
|
|
8
|
-
def
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
7
|
+
def index
|
8
|
+
authorize ActsAsTaggableOn::Tag
|
9
|
+
@tags = ActsAsTaggableOn::Tag.pluck(:name)
|
10
|
+
respond_with(@tags)
|
11
|
+
end
|
13
12
|
|
14
|
-
|
13
|
+
def search
|
14
|
+
authorize ActsAsTaggableOn::Tag
|
15
|
+
search_conditions = Georgia::TagSearch.new(params).definition
|
16
|
+
@search = ActsAsTaggableOn::Tag.search(search_conditions).page(params[:page])
|
17
|
+
respond_with(@search.records.map(&:name))
|
15
18
|
end
|
16
19
|
|
17
20
|
end
|
@@ -1,10 +1,15 @@
|
|
1
1
|
module Georgia
|
2
2
|
class ApplicationController < ActionController::Base
|
3
3
|
|
4
|
-
|
4
|
+
include Pundit
|
5
|
+
after_action :verify_authorized
|
6
|
+
rescue_from Pundit::NotAuthorizedError do
|
7
|
+
redirect_to new_user_session_path
|
8
|
+
end
|
9
|
+
|
5
10
|
layout :layout_by_resource
|
6
11
|
|
7
|
-
protect_from_forgery
|
12
|
+
protect_from_forgery with: :exception
|
8
13
|
|
9
14
|
def current_ability
|
10
15
|
@current_ability ||= Ability.new(current_user)
|
@@ -21,5 +26,15 @@ module Georgia
|
|
21
26
|
devise_controller? ? "georgia/devise" : "georgia/application"
|
22
27
|
end
|
23
28
|
|
29
|
+
def user_not_authorized
|
30
|
+
flash[:alert] = "You are not authorized to perform this action."
|
31
|
+
redirect_to(request.referrer || root_path)
|
32
|
+
end
|
33
|
+
|
34
|
+
# Overwriting the sign_out redirect path method
|
35
|
+
def after_sign_out_path_for(resource_or_scope)
|
36
|
+
new_user_session_path
|
37
|
+
end
|
38
|
+
|
24
39
|
end
|
25
40
|
end
|
@@ -7,8 +7,7 @@ module Georgia
|
|
7
7
|
|
8
8
|
included do
|
9
9
|
|
10
|
-
|
11
|
-
cache_sweeper :navigation_sweeper, only: :show
|
10
|
+
include Pundit
|
12
11
|
|
13
12
|
# Loads the page according to request url
|
14
13
|
# Restore the latest published revision of the given page
|
@@ -33,7 +32,7 @@ module Georgia
|
|
33
32
|
@page = Georgia::Page.from_url(params[:request_path]).first || not_found
|
34
33
|
@page = Georgia::PageDecorator.decorate(@page)
|
35
34
|
@page.current_revision = Georgia::Revision.find(params[:r])
|
36
|
-
authorize
|
35
|
+
authorize @page, :preview?
|
37
36
|
end
|
38
37
|
|
39
38
|
# Triggers a 404 page not found
|
@@ -2,13 +2,11 @@ module Georgia
|
|
2
2
|
class DashboardController < Georgia::ApplicationController
|
3
3
|
|
4
4
|
def show
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
if defined?
|
9
|
-
|
10
|
-
@messages = GeorgiaMailer::Message.ham.latest.limit(5).decorate
|
11
|
-
end
|
5
|
+
authorize Georgia::Dashboard
|
6
|
+
@activities = PublicActivity::Activity.order(created_at: :desc).page(params[:page]).per(20)
|
7
|
+
@awaiting_revisions = Georgia::Revision.where("status = ?", Georgia::Revision.statuses[:review])
|
8
|
+
if defined? Georgia::Mailer::Message and policy(Georgia::Mailer::Message).index?
|
9
|
+
@messages = Georgia::Mailer::Message.ham.latest.limit(5).decorate
|
12
10
|
end
|
13
11
|
end
|
14
12
|
|
@@ -1,66 +1,59 @@
|
|
1
1
|
module Georgia
|
2
2
|
class MediaController < ApplicationController
|
3
3
|
|
4
|
-
load_and_authorize_resource class: Ckeditor::Asset
|
5
|
-
# destroy's :id param is an Array and makes load_resource fails
|
6
|
-
skip_load_resource only: :destroy
|
7
|
-
|
8
4
|
def index
|
5
|
+
authorize Ckeditor::Asset
|
9
6
|
redirect_to action: :search
|
10
7
|
end
|
11
8
|
|
12
9
|
def search
|
13
10
|
@asset = Ckeditor::Asset.new
|
14
|
-
|
15
|
-
|
11
|
+
authorize Ckeditor::Asset
|
12
|
+
search_conditions = Georgia::MediaSearch.new(params).definition
|
13
|
+
@search = Ckeditor::Asset.search(search_conditions).page(params[:page])
|
14
|
+
@assets = Ckeditor::AssetDecorator.decorate_collection(@search.records)
|
16
15
|
end
|
17
16
|
|
18
17
|
def create
|
18
|
+
authorize Ckeditor::Asset
|
19
19
|
begin
|
20
20
|
@assets = params[:assets].map{|asset| CreateMediaAsset.new(asset).call}
|
21
21
|
@assets = Ckeditor::AssetDecorator.decorate_collection(@assets)
|
22
|
-
rescue
|
22
|
+
rescue => ex
|
23
23
|
flash.now[:alert] = ex.message
|
24
24
|
end
|
25
25
|
render layout: false
|
26
26
|
end
|
27
27
|
|
28
28
|
def show
|
29
|
+
@asset = Ckeditor::Asset.find(params[:id])
|
30
|
+
authorize @asset
|
29
31
|
redirect_to edit_media_path(id: params[:id])
|
30
32
|
end
|
31
33
|
|
32
34
|
def edit
|
33
35
|
@asset = Ckeditor::Asset.find(params[:id])
|
36
|
+
authorize @asset
|
34
37
|
end
|
35
38
|
|
36
39
|
def update
|
37
40
|
@asset = Ckeditor::Asset.find(params[:id])
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
format.js { head :ok }
|
42
|
-
end
|
41
|
+
authorize @asset
|
42
|
+
if @asset.update_attributes(sanitized_asset_params)
|
43
|
+
render_success("Asset was successfully updated.")
|
43
44
|
else
|
44
|
-
|
45
|
-
format.html { redirect_to edit_media_path(@asset), alert: "Oups. Something went wrong." }
|
46
|
-
format.js { head :internal_server_error }
|
47
|
-
end
|
45
|
+
render_error
|
48
46
|
end
|
49
47
|
end
|
50
48
|
|
51
49
|
# Destroy multiple assets
|
52
50
|
def destroy
|
53
51
|
@assets = Ckeditor::Asset.where(id: params[:id])
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
format.js { head :ok }
|
58
|
-
end
|
52
|
+
authorize @assets
|
53
|
+
if @assets.destroy_all
|
54
|
+
render_success("Assets were successfully deleted.")
|
59
55
|
else
|
60
|
-
|
61
|
-
format.html { redirect_to search_media_index_path, alert: "Oups. Something went wrong." }
|
62
|
-
format.js { head :internal_server_error }
|
63
|
-
end
|
56
|
+
render_error
|
64
57
|
end
|
65
58
|
end
|
66
59
|
|
@@ -69,24 +62,40 @@ module Georgia
|
|
69
62
|
# We could then have a download spinner while the request is processing, even a progress bar
|
70
63
|
def download
|
71
64
|
ids = params[:ids].split(',')
|
72
|
-
@files = Ckeditor::Asset.
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
65
|
+
@files = Ckeditor::Asset.where(id: ids)
|
66
|
+
authorize @files
|
67
|
+
zip_file = Georgia::CompressFiles.new(@files).file
|
68
|
+
send_file zip_file.path, type: "application/zip", disposition: 'attachment', filename: zip_file.filename
|
69
|
+
end
|
70
|
+
|
71
|
+
private
|
72
|
+
|
73
|
+
def asset_params
|
74
|
+
params.require(:asset).permit(:tag_list)
|
75
|
+
end
|
76
|
+
|
77
|
+
def sanitized_asset_params
|
78
|
+
ParseJsonTags.new(asset_params).call
|
79
|
+
end
|
80
|
+
|
81
|
+
def render_success success_message
|
82
|
+
@status_message = success_message
|
83
|
+
@status = :notice
|
84
|
+
respond_to do |format|
|
85
|
+
format.html { redirect_to :back, notice: @status_message }
|
86
|
+
format.js { render layout: false }
|
87
|
+
format.json { render json: { ids: @assets.map(&:id), message: @status_message, status: @status } }
|
85
88
|
end
|
86
|
-
|
87
|
-
t.close
|
89
|
+
end
|
88
90
|
|
89
|
-
|
91
|
+
def render_error error_message="Oups. Something went wrong."
|
92
|
+
@status_message = error_message
|
93
|
+
@status = :alert
|
94
|
+
respond_to do |format|
|
95
|
+
format.html { redirect_to :back, alert: @status_message }
|
96
|
+
format.js { render layout: false }
|
97
|
+
format.json { render json: { message: @status_message, status: @status } }
|
98
|
+
end
|
90
99
|
end
|
91
100
|
|
92
101
|
end
|
@@ -1,18 +1,19 @@
|
|
1
1
|
module Georgia
|
2
2
|
class MenusController < ApplicationController
|
3
3
|
|
4
|
-
load_and_authorize_resource class: Menu
|
5
|
-
|
6
4
|
def index
|
7
|
-
@menus = Menu.
|
5
|
+
@menus = Menu.all
|
6
|
+
authorize @menus
|
8
7
|
end
|
9
8
|
|
10
9
|
def new
|
11
10
|
@menu = Menu.new
|
11
|
+
authorize @menu
|
12
12
|
end
|
13
13
|
|
14
14
|
def create
|
15
|
-
@menu = Menu.new(
|
15
|
+
@menu = Menu.new(menu_params)
|
16
|
+
authorize @menu
|
16
17
|
if @menu.save
|
17
18
|
respond_to do |format|
|
18
19
|
format.html { redirect_to [:edit, @menu], notice: "#{@menu.title} was successfully created." }
|
@@ -27,19 +28,23 @@ module Georgia
|
|
27
28
|
end
|
28
29
|
|
29
30
|
def show
|
30
|
-
|
31
|
+
@menu = Menu.find(params[:id])
|
32
|
+
authorize @menu
|
33
|
+
redirect_to [:edit, @menu]
|
31
34
|
end
|
32
35
|
|
33
36
|
def edit
|
34
37
|
@menu = Menu.find(params[:id])
|
38
|
+
authorize @menu
|
35
39
|
@links = @menu.links.roots
|
36
40
|
end
|
37
41
|
|
38
42
|
def update
|
39
43
|
@menu = Menu.find(params[:id])
|
44
|
+
authorize @menu
|
40
45
|
update_links_attributes(params[:menu].delete(:ancestry))
|
41
46
|
update_links_menu_id
|
42
|
-
if @menu.
|
47
|
+
if @menu.update(menu_params)
|
43
48
|
respond_to do |format|
|
44
49
|
format.html { redirect_to [:edit, @menu], notice: "#{@menu.title} was successfully updated." }
|
45
50
|
format.js { head :ok }
|
@@ -54,6 +59,7 @@ module Georgia
|
|
54
59
|
|
55
60
|
def destroy
|
56
61
|
@menu = Menu.find(params[:id])
|
62
|
+
authorize @menu
|
57
63
|
@menu.destroy
|
58
64
|
|
59
65
|
redirect_to menus_url
|
@@ -76,5 +82,9 @@ module Georgia
|
|
76
82
|
MenuAncestryParser.new(ancestry_tree).to_hash
|
77
83
|
end
|
78
84
|
|
85
|
+
def menu_params
|
86
|
+
params.require(:menu).permit(:name, :ancestry, links_attributes: [:id, :_destroy, :position, :parent_id, contents_attributes: [:id, :title, :text, :locale]])
|
87
|
+
end
|
88
|
+
|
79
89
|
end
|
80
90
|
end
|