refinerycms-core 4.0.3 → 4.1.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.
Files changed (107) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/config/refinery_core_manifest.js +9 -1
  3. data/app/assets/images/refinery/logo-large.png +0 -0
  4. data/app/assets/images/refinery/logo-medium.png +0 -0
  5. data/app/assets/images/refinery/logo-site-bar.png +0 -0
  6. data/app/assets/images/refinery/logo-small-medium.png +0 -0
  7. data/app/assets/images/refinery/logo-small.png +0 -0
  8. data/app/assets/images/refinery/logo-tiny.png +0 -0
  9. data/app/assets/images/refinery/logo.png +0 -0
  10. data/app/assets/images/refinery/refinery-cms-logo.svg +1 -558
  11. data/app/assets/javascripts/refinery/admin.js.erb +37 -21
  12. data/app/assets/javascripts/refinery/ajaxy_pagination.js +16 -0
  13. data/app/assets/javascripts/refinery/image_crop.js +101 -0
  14. data/app/assets/javascripts/refinery/interface.js.erb +42 -0
  15. data/app/assets/javascripts/refinery/refinery.js.erb +3 -3
  16. data/app/assets/javascripts/refinery/submit_continue.js.erb +23 -0
  17. data/app/assets/stylesheets/refinery/components/_file_type_icons.scss +36 -0
  18. data/app/assets/stylesheets/refinery/components/_icons.scss +89 -47
  19. data/app/assets/stylesheets/refinery/global/_colours.scss +12 -5
  20. data/app/assets/stylesheets/refinery/mixins/_images.scss +99 -0
  21. data/app/assets/stylesheets/refinery/mixins/_locales.scss +22 -0
  22. data/app/assets/stylesheets/refinery/mixins/_rounded.scss +9 -23
  23. data/app/assets/stylesheets/refinery/plugins/_ui.scss +7 -4
  24. data/app/assets/stylesheets/refinery/refinery.scss +4 -1
  25. data/app/assets/stylesheets/refinery/sections/_layout.scss +490 -265
  26. data/app/controllers/refinery/admin/dialogs_controller.rb +6 -6
  27. data/app/helpers/refinery/action_helper.rb +75 -0
  28. data/app/helpers/refinery/icon_helper.rb +51 -0
  29. data/app/helpers/refinery/image_helper.rb +1 -1
  30. data/app/helpers/refinery/pagination_helper.rb +1 -0
  31. data/app/helpers/refinery/site_bar_helper.rb +10 -7
  32. data/app/helpers/refinery/tag_helper.rb +5 -36
  33. data/app/helpers/refinery/translation_helper.rb +12 -1
  34. data/app/views/refinery/_head.html.erb +1 -0
  35. data/app/views/refinery/_matomo_analytics.html.erb +18 -0
  36. data/app/views/refinery/_site_bar.html.erb +9 -9
  37. data/app/views/refinery/admin/_error_messages.html.erb +4 -4
  38. data/app/views/refinery/admin/_locale_picker.html.erb +8 -14
  39. data/config/initializers/assets.rb +5 -1
  40. data/config/initializers/zeitwerk.rb +12 -0
  41. data/config/locales/en.yml +3 -1
  42. data/config/locales/sk.yml +7 -0
  43. data/lib/generators/refinery/cms/cms_generator.rb +24 -20
  44. data/lib/generators/refinery/core/templates/config/initializers/refinery/core.rb.erb +5 -0
  45. data/lib/generators/refinery/dummy/dummy_generator.rb +32 -10
  46. data/lib/generators/refinery/dummy/templates/rails/application.rb.erb +27 -7
  47. data/lib/generators/refinery/dummy/templates/rails/boot.rb.erb +1 -2
  48. data/lib/generators/refinery/dummy/templates/rails/database.yml +55 -14
  49. data/lib/generators/refinery/dummy/templates/rails/manifest.js +3 -0
  50. data/lib/generators/refinery/dummy/templates/rails/storage.yml +7 -0
  51. data/lib/generators/refinery/engine/engine_generator.rb +1 -0
  52. data/lib/generators/refinery/engine/templates/Gemfile +1 -2
  53. data/lib/generators/refinery/engine/templates/Rakefile +2 -2
  54. data/lib/generators/refinery/engine/templates/app/controllers/refinery/namespace/admin/plural_name_controller.rb.erb +1 -1
  55. data/lib/generators/refinery/engine/templates/app/controllers/refinery/namespace/plural_name_controller.rb.erb +1 -1
  56. data/lib/generators/refinery/engine/templates/app/models/refinery/namespace/singular_name.rb.erb +1 -0
  57. data/lib/generators/refinery/engine/templates/app/views/refinery/namespace/admin/plural_name/_form.html.erb +1 -1
  58. data/lib/generators/refinery/engine/templates/db/migrate/1_create_namespace_plural_name.rb.erb +15 -4
  59. data/lib/generators/refinery/engine/templates/lib/generators/refinery/extension_plural_name_generator.rb.erb +1 -1
  60. data/lib/generators/refinery/engine/templates/lib/refinery/plural_name.rb.erb +1 -1
  61. data/lib/refinery/admin/base_controller.rb +2 -2
  62. data/lib/refinery/application_controller.rb +1 -2
  63. data/lib/refinery/cli.rb +1 -1
  64. data/lib/refinery/core/configuration.rb +4 -1
  65. data/lib/refinery/core/engine.rb +20 -0
  66. data/lib/refinery/core.rb +0 -1
  67. data/lib/refinery/crud.rb +33 -32
  68. data/lib/refinery/extension_generation.rb +55 -8
  69. data/lib/refinery/generators/generated_attribute.rb +13 -0
  70. data/lib/refinery/plugins.rb +1 -1
  71. data/lib/refinery/version.rb +4 -4
  72. data/lib/refinery.rb +9 -2
  73. data/lib/refinerycms/core.rb +1 -0
  74. data/lib/tasks/refinery.rake +3 -3
  75. data/refinerycms-core.gemspec +21 -27
  76. data/spec/controllers/refinery/sitemap_controller_spec.rb +1 -1
  77. data/spec/helpers/refinery/tag_helper_spec.rb +1 -1
  78. data/spec/helpers/refinery/translation_helper_spec.rb +46 -10
  79. data/spec/lib/generators/refinery/cms/cms_generator_spec.rb +6 -6
  80. data/spec/lib/generators/refinery/engine/engine_generator_multiple_resources_spec.rb +23 -2
  81. data/spec/lib/refinery/cli_spec.rb +2 -2
  82. data/spec/lib/refinery/{users_manager_spec.rb → core/users_manager_spec.rb} +1 -1
  83. data/spec/lib/refinery/crud_spec.rb +2 -1
  84. data/spec/presenters/refinery/translated_field_presenter_spec.rb +5 -7
  85. data/spec/support/refinery.rb +2 -2
  86. data/spec/{features → system}/refinery/admin/custom_assets_spec.rb +1 -1
  87. data/spec/system/refinery/admin/dialogs_spec.rb +29 -0
  88. data/spec/{features → system}/refinery/admin/xhr_paging_spec.rb +10 -7
  89. data/spec/{features → system}/refinery/application_layout_spec.rb +3 -4
  90. data/spec/{features → system}/refinery/core_spec.rb +1 -1
  91. data/spec/{features → system}/refinery/site_bar_spec.rb +5 -3
  92. data/vendor/assets/javascripts/canvas-to-blob.js +126 -0
  93. data/vendor/assets/javascripts/cropper.js +3715 -0
  94. data/vendor/assets/stylesheets/cropper.css +305 -0
  95. metadata +108 -171
  96. checksums.yaml.gz.sig +0 -0
  97. data/app/assets/javascripts/refinery/ajaxy_pagination.js.coffee +0 -10
  98. data/app/assets/javascripts/refinery/interface.js.coffee.erb +0 -33
  99. data/app/assets/javascripts/refinery/submit_continue.js.coffee.erb +0 -12
  100. data/spec/features/refinery/admin/dialogs_spec.rb +0 -29
  101. data/spec/support/database_cleaner.rb +0 -21
  102. data.tar.gz.sig +0 -0
  103. metadata.gz.sig +0 -5
  104. /data/lib/generators/refinery/cms/templates/config/{database.yml.mysql → database.mysql.yml} +0 -0
  105. /data/lib/generators/refinery/cms/templates/config/{database.yml.postgresql → database.postgresql.yml} +0 -0
  106. /data/lib/generators/refinery/cms/templates/config/{database.yml.sqlite3 → database.sqlite3.yml} +0 -0
  107. /data/lib/refinery/{users_manager.rb → core/users_manager.rb} +0 -0
@@ -443,7 +443,7 @@ var link_dialog = {
443
443
  }
444
444
  }
445
445
 
446
- $('.form-actions-dialog #cancel_button').trigger('click');
446
+ $('.form-actions-dialog #cancel_button').click;
447
447
  });
448
448
  },
449
449
 
@@ -636,7 +636,7 @@ var page_options = {
636
636
  if( typeof(visual_editor_init) == "function" ) {
637
637
  visual_editor_init();
638
638
  }
639
-
639
+
640
640
 
641
641
  // Wipe the title and increment the index counter by one.
642
642
  $('#new_page_part_index').val(parseInt($('#new_page_part_index').val(), 10) + 1);
@@ -746,7 +746,7 @@ function ImageDialog(options) {
746
746
  };
747
747
 
748
748
  this.init_select = function() {
749
- $('#existing_image_area_content ul li img').click(function() {
749
+ $(document).on('click', '#existing_image_area_content ul li img, #existing_image_area_crops ul li img', function() {
750
750
  self.toggle_image($(this));
751
751
  });
752
752
 
@@ -758,37 +758,52 @@ function ImageDialog(options) {
758
758
 
759
759
  this.toggle_image = function(img) {
760
760
  if (img.length > 0) {
761
- if (!self.settings.multiple) $('#existing_image_area_content ul li.selected').removeClass('selected');
761
+ if (!self.settings.multiple) {
762
+ $('#existing_image_area_content ul li.selected, #existing_image_area_crops ul li.selected').removeClass('selected');
763
+ }
762
764
 
763
765
  img.parent().toggleClass('selected');
764
- var imageId = img.attr('data-id');
765
- var geometry = $('#existing_image_size_area li.selected a').attr('data-geometry');
766
- var size = $('#existing_image_size_area li.selected a').attr('data-size');
767
- var resize = $("#wants_to_resize_image").is(':checked');
768
766
 
769
- image_url = resize ? img.attr('data-' + size) : img.attr('data-original');
767
+ if(img.parent().find('.crops').length) {
768
+ $('#existing_image_area_crops').html(img.parent().find('.crops').html());
769
+ }
770
+
771
+ self.prepare_wysiwyg();
772
+ }
773
+ };
774
+
775
+ this.prepare_wysiwyg = function(){
776
+ var geometry = $('#existing_image_size_area select#resize option:selected').attr('data-geometry');
777
+ var size = $('#existing_image_size_area select#resize').val();
778
+ var resize = $("#wants_to_resize_image").is(':checked');
779
+
780
+ var img = $(document).find('#existing_image_area_content ul li.selected img:first-child');
781
+
782
+ if(img.length == 0) img = $(document).find('#existing_image_area_crops ul li.selected img');
783
+
784
+ image_url = resize && size != 0 ? img.attr('data-' + size) : img.attr('data-original');
770
785
 
771
- if (parent) {
772
- if ((visual_editor_src = parent.document.getElementById('visual_editor_src')) != null) {
786
+ if (parent) {
787
+ if ((visual_editor_src = parent.document.getElementById('visual_editor_src')) != null) {
773
788
  visual_editor_src.value = image_url;
774
- }
775
- if ((visual_editor_title = parent.document.getElementById('visual_editor_title')) != null) {
789
+ }
790
+ if ((visual_editor_title = parent.document.getElementById('visual_editor_title')) != null) {
776
791
  visual_editor_title.value = img.attr('title');
777
- }
778
- if ((visual_editor_alt = parent.document.getElementById('visual_editor_alt')) != null) {
792
+ }
793
+ if ((visual_editor_alt = parent.document.getElementById('visual_editor_alt')) != null) {
779
794
  visual_editor_alt.value = img.attr('alt');
780
- }
781
- if ((visual_editor_size = parent.document.getElementById('visual_editor_size')) != null
782
- && typeof(geometry) != 'undefined') {
795
+ }
796
+ if ((visual_editor_size = parent.document.getElementById('visual_editor_size')) != null
797
+ && typeof(geometry) != 'undefined') {
783
798
  visual_editor_size.value = geometry.replace(/[<>=]/g, '');
784
- }
785
799
  }
786
800
  }
787
- };
801
+ }
788
802
 
789
803
  this.submit_image_choice = function(e) {
790
804
  e.preventDefault();
791
- selected_images = $('#existing_image_area_content ul li.selected img');
805
+ selected_images = $(document).find('#existing_image_area_content ul li.selected img:first-child');
806
+ if(selected_images.length == 0) selected_images = $(document).find('#existing_image_area_crops ul li.selected img');
792
807
  selected_images = self.settings.multiple ? selected_images.get() : selected_images.get(0);
793
808
 
794
809
  if(selected_images && $.isFunction(self.callback))
@@ -830,6 +845,7 @@ function ImageDialog(options) {
830
845
  image_area = $('#existing_image_area').not('#visual_editor_iframe_body #existing_image_area');
831
846
  image_area.find('.form-actions input#submit_button').click($.proxy(function(e) {
832
847
  e.preventDefault();
848
+ self.prepare_wysiwyg();
833
849
  $(this.document.getElementById('visual_editor_dialog_submit')).click();
834
850
  }, parent));
835
851
  image_area.find('.form-actions a.close_dialog').click(close_dialog);
@@ -0,0 +1,16 @@
1
+ window.init_ajaxy_pagination = function() {
2
+ if (typeof window.history.pushState === "function") {
3
+ $(".pagination_container .pagination a").on("click", function(e) {
4
+ let navigate_to = this.href.replace(/(\&(amp\;)?)?from_page\=\d+/, "");
5
+ navigate_to += "&from_page=" + $(".current").text();
6
+ navigate_to = navigate_to.replace("?&", "?").replace(/\s+/, "");
7
+
8
+ const current_state_location = location.pathname + location.href.split(location.pathname)[1];
9
+
10
+ window.history.pushState({ path: current_state_location }, "", navigate_to);
11
+ $(document).paginateTo(navigate_to);
12
+
13
+ e.preventDefault();
14
+ });
15
+ }
16
+ };
@@ -0,0 +1,101 @@
1
+ window.onload = function () {
2
+ 'use strict';
3
+
4
+ const image = document.getElementById('crop');
5
+ const ratios = document.getElementById('ratios');
6
+ const defaultAspectRatio = ratios.querySelector('button').getAttribute('data-value');
7
+ const submitCropSubmit = document.getElementById('save_crop');
8
+ let selectedCropRatio, cropWidth, cropHeight;
9
+
10
+ let options = {
11
+ aspectRatio: defaultAspectRatio,
12
+ crop: function (e) {
13
+ let data = e.detail;
14
+ cropWidth = data.width;
15
+ cropHeight = data.height;
16
+ },
17
+ zoomOnWheel: false
18
+ };
19
+
20
+ let cropper = new Cropper(image, options);
21
+
22
+ // Toggle aspect ratio after initialization
23
+ ratios.querySelectorAll('button').forEach(function(ratioButton) {
24
+ ratioButton.addEventListener('click', function() {
25
+ options.aspectRatio = ratioButton.getAttribute('data-value');
26
+ selectedCropRatio = ratioButton.getAttribute('data-ratio');
27
+
28
+ cropper.destroy();
29
+ cropper = new Cropper(image, options);
30
+ });
31
+ });
32
+
33
+ submitCropSubmit.addEventListener('click', function(e) {
34
+ e.preventDefault();
35
+
36
+ const filename = image.getAttribute('data-filename');
37
+ const mimeType = image.getAttribute('data-mime-type');
38
+
39
+ const imageId = image.getAttribute('data-image-id');
40
+ const form = document.getElementById('crop_image_'+imageId);
41
+ const actionUrl = form.getAttribute('action');
42
+
43
+ cropper.getCroppedCanvas().toBlob(function(blob) {
44
+ let formData = new FormData(form);
45
+
46
+ formData.append('image', blob, filename);
47
+ formData.append('ratio', selectedCropRatio);
48
+ formData.append('height', cropHeight);
49
+ formData.append('width', cropWidth);
50
+
51
+ ajaxPostNewCrop(formData, actionUrl);
52
+ }, mimeType);
53
+ });
54
+
55
+ function ajaxPostNewCrop(formData, actionUrl) {
56
+ let xhr = new XMLHttpRequest();
57
+
58
+ xhr.open('PATCH', actionUrl, true);
59
+ xhr.send(formData);
60
+ xhr.onreadystatechange = function() {
61
+ if (xhr.readyState === 4) {
62
+ if (xhr.status === 200) {
63
+ const response = JSON.parse(xhr.responseText);
64
+ appendNewCropInList(response.crop, 'crop-list');
65
+ }
66
+ }
67
+ };
68
+ }
69
+
70
+ function appendNewCropInList(newCrop, listId) {
71
+ initCropList(listId);
72
+
73
+ let child = document.createElement('div');
74
+ child.innerHTML = newCrop;
75
+ child = child.firstChild;
76
+
77
+ return document.getElementById(listId).appendChild(child);
78
+ }
79
+
80
+ function initCropList(listId){
81
+ let cropsId = document.getElementById('crops');
82
+ let cropListId = document.getElementById(listId);
83
+
84
+ if(cropListId == null) {
85
+ cropListId = document.createElement('ul');
86
+ cropListId.setAttribute("id", listId);
87
+ cropListId.setAttribute("class", "clearfix");
88
+ cropsId.appendChild(cropListId);
89
+ }
90
+
91
+ hideNoCropsYetText();
92
+ }
93
+
94
+ function hideNoCropsYetText(){
95
+ const noCropsYetText = document.getElementById('no-crops-yet');
96
+
97
+ if(noCropsYetText !== null && noCropsYetText.style.display != 'none') {
98
+ noCropsYetText.style.display = 'none';
99
+ }
100
+ }
101
+ };
@@ -0,0 +1,42 @@
1
+ window.init_interface = function() {
2
+ if (parent && parent.document.location.href !== document.location.href) {
3
+ $("body#dialog_container.dialog").addClass("iframed");
4
+ }
5
+
6
+ $("input:submit:not(.button)").addClass("button");
7
+
8
+ if (typeof visual_editor_init_interface_hook !== 'undefined') {
9
+ visual_editor_init_interface_hook();
10
+ }
11
+
12
+ $("#current_locale li a").click(function(e) {
13
+ $("#current_locale li a span.action").each(function() {
14
+ $(this).css("display", $(this).css("display") === "none" ? "" : "none");
15
+ });
16
+
17
+ $("#other_locales").animate({
18
+ opacity: "toggle",
19
+ height: "toggle"
20
+ }, 250);
21
+
22
+ $("html,body").animate({ scrollTop: $("#other_locales").parent().offset().top }, 250);
23
+ e.preventDefault();
24
+ });
25
+
26
+ $(".form-actions .form-actions-left input:submit#submit_button").click(function(e) {
27
+ $(this).nextAll('#spinner').removeClass('hidden_icon').addClass('unhidden_icon');
28
+ });
29
+
30
+ $(".form-actions.form-actions-dialog .form-actions-left a.close_dialog").click(function(e) {
31
+ let titlebar_close_button = $('.ui-dialog-titlebar-close');
32
+ if (parent) {
33
+ titlebar_close_button = parent.$('.ui-dialog-titlebar-close');
34
+ }
35
+ titlebar_close_button.click();
36
+ e.preventDefault();
37
+ });
38
+
39
+ $("a.suppress").on("click", function(e) {
40
+ e.preventDefault();
41
+ });
42
+ };
@@ -1,9 +1,9 @@
1
1
  /*
2
2
  *= require jquery
3
3
  *= require jquery_ujs
4
- *= require jquery-ui/dialog
5
- *= require jquery-ui/sortable
6
- *= require jquery-ui/tabs
4
+ *= require jquery-ui/widgets/dialog
5
+ *= require jquery-ui/widgets/sortable
6
+ *= require jquery-ui/widgets/tabs
7
7
  *= require modernizr-min
8
8
  *= require jquery/jquery.html5-placeholder-shim
9
9
  *= require jquery/jquery.timers
@@ -0,0 +1,23 @@
1
+ <%# encoding: utf-8 %>
2
+ window.init_submit_continue = function() {
3
+ $("#submit_continue_button").click(submit_and_continue);
4
+
5
+ $("form").change(function(e) {
6
+ $(this).attr("data-changes-made", true);
7
+ });
8
+
9
+ const continue_editing_button = $("#continue_editing");
10
+ if (continue_editing_button.length > 0 && continue_editing_button.attr("rel") !== "no-prompt") {
11
+ $("#editor_switch a").click(function(e) {
12
+ if ($("form[data-changes-made]").length > 0) {
13
+ if (!confirm("<%= ::I18n.t("refinery.js.admin.confirm_changes") %>")) {
14
+ e.preventDefault();
15
+ }
16
+ }
17
+ });
18
+ }
19
+
20
+ $("input[id=page_custom_slug]").change(function() {
21
+ $("#submit_continue_button").remove();
22
+ });
23
+ };
@@ -0,0 +1,36 @@
1
+ %icon-font { font-family: 'FontAwesome', Helvetica, Arial, sans-serif; }
2
+ $adobe_red: B30C00FF;
3
+ $ms_word_blue: #1558BB;
4
+ $msxl_green: #0F7C42;
5
+ $mspp_brown: #C94B26;
6
+ /* icons */
7
+
8
+ .pdf_icon {@include icon(file-pdf-o, $adobe_red);}
9
+
10
+ .word_icon {@include icon(file-word-o, $ms_word_blue);}
11
+
12
+ .excel_icon {@include icon(file-excel-o, $msxl_green);}
13
+
14
+ .powerpoint_icon {@include icon(file-powerpoint-o, $mspp_brown);}
15
+
16
+ .photo_icon {@include icon(file-photo-o);}
17
+
18
+ .picture_icon {@include icon(file-picture-o);}
19
+
20
+ .plain_icon {@include icon('file-text')} // text/plain
21
+
22
+ .image_icon {@include icon(file-image-o);}
23
+
24
+ .zip_icon {@include icon(file-zip-o);}
25
+
26
+ .archive_icon {@include icon(file-archive-o);}
27
+
28
+ .sound_icon {@include icon(file-sound-o);}
29
+
30
+ .audio_icon {@include icon(file-audio-o);}
31
+
32
+ .movie_icon {@include icon(file-movie-o);}
33
+
34
+ .video_icon {@include icon(file-video-o);}
35
+
36
+ .code_icon {@include icon(file-code-o);}
@@ -2,62 +2,104 @@
2
2
 
3
3
  /* icons */
4
4
 
5
- .add_icon {@include icon('plus-circle');}
6
- .back_icon {@include icon('arrow-left');}
7
- .close_icon {@include icon('times-circle')}
5
+ .add_icon {@include icon('plus-circle');}
6
+
7
+ .back_icon {@include icon('arrow-left');}
8
+
9
+ .close_icon {@include icon('times-circle')}
8
10
 
9
11
  .delete_icon,
10
- .delete_section_icon {@include icon('minus-circle', $icon_delete_colour);}
11
-
12
- .download_icon {@include icon('download');}
13
- .edit_email_icon {@include icon('envelope-o');}
14
- .edit_icon {@include icon('edit', $icon_edit_colour);}
15
- .email_icon {@include icon('envelope-o');}
16
- .error_icon {@include icon('question-circle', $icon_error_colour);}
17
- .failure_icon {@include icon('times');}
18
- .folder_icon {@include icon('folder',$icon_folder_colour)}
19
- .go_icon {@include icon('caret-square-o-right');}
20
- .info_icon {@include icon('info-circle');}
21
- .loading_icon {@include icon('spinner'); @extend .fa-spin}
22
- .page_icon {@include icon('file-o',$icon_page_colour)}
23
- .preview_icon {@include icon('eye', $icon_preview_colour)}
24
- .remove_icon {@include icon('unlink', $icon_delete_colour);}
25
- .reorder_done_icon {@include icon('thumbs-o-up')}
26
- .reorder_h_icon {@include icon('exchange');}
27
- .reorder_icon {@include icon('unsorted');}
12
+ .delete_section_icon {@include icon('minus-circle', $icon_delete_colour);}
13
+
14
+ .download_icon {@include icon('download');}
15
+
16
+ .edit_email_icon {@include icon('envelope-o');}
17
+
18
+ .edit_icon {@include icon('edit', $icon_edit_colour);}
19
+
20
+ .edit_locale_icon {@include icon('edit', $icon_locale_colour, $size: 1.2rem)}
21
+
22
+ .locale_icon {@include icon('comment', $icon_locale_colour) }
23
+
24
+ .email_icon {@include icon('envelope-o');}
25
+
26
+ .error_icon {@include icon('question-circle', $icon_error_colour);}
27
+
28
+ .failure_icon {@include icon('times');}
29
+
30
+ .folder_icon {@include icon('folder', $icon_folder_colour)}
31
+
32
+ .folderopen_icon {@include icon('folder-open', $icon_folder_colour)}
33
+
34
+ .go_icon {@include icon('caret-square-o-right');}
35
+
36
+ .info_icon {@include icon('info-circle');}
37
+
38
+ .loading_icon {@include icon('spinner'); @extend .fa-spin}
39
+
40
+ .page_icon {@include icon('file-o', $icon_page_colour)}
41
+
42
+ .preview_icon {@include icon('eye', $icon_preview_colour)}
43
+
44
+ .remove_icon {@include icon('unlink', $icon_delete_colour);}
45
+
46
+ .reorder_done_icon {@include icon('thumbs-o-up')}
47
+
48
+ .reorder_h_icon {@include icon('exchange');}
49
+
50
+ .reorder_icon {@include icon('unsorted');}
51
+
28
52
  .reorder_icon.loading {@include icon('spinner')}
29
- .search_icon {@include icon('search')}
30
- .settings_icon {@include icon('gear')}
31
- .sortdown_icon {@include icon('sort-down')}
32
- .sortup_icon {@include icon('sort-up')}
33
- .spam_empty_icon {@include icon('trash-o');}
34
- .spam_icon {@include icon('trash');}
35
- .success_icon {@include icon('check');}
53
+
54
+ .search_icon {@include icon('search')}
55
+
56
+ .settings_icon {@include icon('gear')}
57
+
58
+ .sortdown_icon {@include icon('sort-down')}
59
+
60
+ .sortup_icon {@include icon('sort-up')}
61
+
62
+ .spam_empty_icon {@include icon('trash-o');}
63
+
64
+ .spam_icon {@include icon('trash');}
65
+
66
+ .success_icon {@include icon('check');}
67
+
36
68
  .switch_view_grid_icon {@include icon('th')}
69
+
37
70
  .switch_view_list_icon {@include icon('list')}
38
- .upload_icon {@include icon('upload');}
39
- .user_comment_icon {@include icon('comment-o');}
40
- .warning_icon {@include icon('warning', $icon_warning_colour)}
41
71
 
42
- .hidden_icon {display:none}
72
+ .upload_icon {@include icon('upload');}
73
+
74
+ .user_comment_icon {@include icon('comment-o');}
75
+
76
+ .warning_icon {@include icon('warning', $icon_warning_colour)}
77
+
78
+ .hidden_icon {display: none}
79
+
43
80
  .unhidden_icon {display: inline-block}
44
81
 
45
- // stacked icon/text used for locales
46
- .locale_marker {
47
- display: inline-block;
48
- font-size: 8px;
49
- margin-right: 10px;
50
- position: relative;
51
- top: -8px;
52
- .fa-stack strong {
53
- left: 7px;
54
- line-height: 1em;
55
- position: absolute;
56
- top: 9px;
57
- }
82
+ .locale_icon {
83
+ position: relative;
84
+ // icon_base (the icon) occupies the ::before position
85
+ @include icon_base($locale_icon_colour, $size: 1.5rem);
86
+
87
+ &::after {
88
+ position: absolute;
89
+ left: 0.3rem;
90
+ font-size: 0.8rem;
91
+ color: $locale_text_colour;
92
+ font-weight: bold;
93
+ content: attr(id);
94
+ text-transform: uppercase;
95
+ }
58
96
  }
59
97
 
60
98
  // don't want underlines on icons
61
- #content a[class$='icon'] {border-bottom: none}
62
- #content a[class$='icon']:hover {border-bottom: none}
99
+ #content {
100
+ a[class$='icon'] {
101
+ border-bottom: none;
63
102
 
103
+ &:hover {border-bottom: none}
104
+ }
105
+ }
@@ -7,15 +7,22 @@ $icon_locale_colour: #b7e3fc; // pale blue
7
7
  $icon_page_colour: #86cffa; //
8
8
  $icon_warning_colour: #FF6600; // orange
9
9
 
10
- $info_icon_blue: #316CC8;
10
+ $info_icon_blue: #022864;
11
11
 
12
12
  $icon_preview_colour: $icon_default_colour;
13
13
  $icon_edit_colour: $icon_default_colour;
14
14
  $icon_add_colour: $icon_default_colour;
15
15
 
16
+ $locale_icon_colour: $icon_locale_colour; // pale blue
17
+ $locale_text_colour: #444444AA;
18
+ $locale_selected_background: #65c3f7;
19
+ $locale_hover_background: #cae7fb;
20
+ $current_active_locale: #22A7F2;
21
+ $locale_active_background: #22A7F2;
22
+
16
23
  $action_background_colour: lighten($icon_locale_colour,10%);
17
- $action_border_colour: $icon_locale_colour;
24
+ $action_border_colour: #b7e3fc;
18
25
 
19
- // $icon_preview_colour: #7f00ff; // violet
20
- // $icon_edit_colour: #007fff; // azure
21
- // $icon_add_colour: #7fff00; // chartreuse
26
+ $index_entry_hover_background: #f1f1f1;
27
+ $index_entry_actions_background: #f1f1f1;
28
+ $index_entry_actions_border: #788;
@@ -0,0 +1,99 @@
1
+ @mixin indexImage {
2
+ padding: 0;
3
+ margin: 0;
4
+ line-height: 1.2;
5
+ a.edit_link {
6
+ display: inline-block;
7
+ font-weight: bold;
8
+ height: fit-content;
9
+
10
+ &:has(img) { border-bottom: 0}
11
+ }
12
+ .alt {font-style: italic}
13
+ .filename {font-style: italic}
14
+ .title {text-transform: capitalize}
15
+ }
16
+
17
+ @mixin gridImage {
18
+ @include indexImage;
19
+
20
+ a:has(img) ~ * {
21
+ display: inline-block;
22
+ margin-right: 2px;
23
+ }
24
+ .actions {
25
+ @include imageActions {
26
+ justify-content: flex-start;
27
+ };
28
+ margin: 0 0.25rem;
29
+ border: 0.5px solid $index_entry_actions_border;
30
+ background-color: $index_entry_actions_background;
31
+ border-radius: 2px;
32
+ }
33
+ }
34
+
35
+ @mixin listImage {
36
+ @include indexImage;
37
+ //margin: 0 12px 12px 0;
38
+ padding: 0;
39
+ overflow: hidden;
40
+ display: flex;
41
+ flex-direction: row;
42
+ justify-content: flex-start;
43
+ align-items: baseline;
44
+ gap: 1rem;
45
+ .actions {
46
+ @include imageActions {
47
+ margin-left: auto;
48
+ justify-content: flex-end;
49
+ }
50
+ }
51
+
52
+ &:hover {
53
+ background-color: $index_entry_hover_background;
54
+ }
55
+ }
56
+
57
+ @mixin imageIndexLayout {
58
+ list-style-type: none;
59
+ width: 100%;
60
+ padding: 0;
61
+ line-height: 1.2;
62
+ @content;
63
+ }
64
+
65
+ // apply to #image_grid
66
+ @mixin imageGridLayout {
67
+ @include imageIndexLayout {
68
+ padding-inline-start: 0;
69
+ display: grid;
70
+ grid-template-columns: repeat(4, 150px);
71
+ grid-template-rows: auto;
72
+ gap: 15px;
73
+ }
74
+ }
75
+
76
+ // apply to #image_list
77
+ @mixin imageListLayout {
78
+ @include imageIndexLayout {
79
+ margin: 10px 0 15px 0;
80
+ }
81
+ }
82
+
83
+ @mixin imageActions {
84
+ // unset some
85
+ position: relative;
86
+ top: unset;
87
+ right: unset;
88
+ width: auto;
89
+
90
+ display: flex;
91
+ flex-direction: row;
92
+ gap: 0.5rem;
93
+ line-height: 1.5;
94
+ a {
95
+ float: none;
96
+ margin: 0;
97
+ }
98
+ @content;
99
+ }
@@ -0,0 +1,22 @@
1
+ @mixin locale_button {
2
+ padding: 7px 3px 3px 3px;
3
+ background-color: #cdcdcd;
4
+ border-bottom: 0;
5
+ display: flex;
6
+ flex-direction: row;
7
+ gap: 0.25rem;
8
+ align-items: center;
9
+ font-size: 1rem;
10
+ &.selected { background-color: $locale_selected_background; }
11
+ &:active { background-color: $locale_active_background;}
12
+ }
13
+
14
+ @mixin locale_group {
15
+ display: inline-flex;
16
+ flex-direction: row;
17
+ justify-content: flex-start;
18
+ gap: 0.5rem;
19
+ margin: 0;
20
+ padding: 0;
21
+ @content;
22
+ }