beyond_canvas 0.19.2.pre → 0.23.0.pre

Sign up to get free protection for your applications and to get access to all the features.
Files changed (83) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +3 -45
  3. data/app/assets/images/icons/adblocker.svg +5 -0
  4. data/app/assets/images/icons/checkbox_checked.svg +1 -1
  5. data/app/assets/images/icons/checkbox_unchecked.svg +1 -1
  6. data/app/assets/images/icons/external_link.svg +1 -0
  7. data/app/assets/images/icons/toggle.svg +1 -0
  8. data/app/assets/images/icons/toggle_checked.svg +3 -0
  9. data/app/assets/images/icons/toggle_unchecked.svg +3 -0
  10. data/app/assets/javascripts/beyond_canvas/base.js +107 -44
  11. data/app/assets/stylesheets/beyond_canvas/base.scss +21 -18
  12. data/app/assets/stylesheets/beyond_canvas/components/_action_bar.scss +11 -6
  13. data/app/assets/stylesheets/beyond_canvas/components/_breadcrumbs.scss +8 -4
  14. data/app/assets/stylesheets/beyond_canvas/components/_buttons.scss +50 -56
  15. data/app/assets/stylesheets/beyond_canvas/components/_cards.scss +20 -12
  16. data/app/assets/stylesheets/beyond_canvas/components/_collapse.scss +33 -0
  17. data/app/assets/stylesheets/beyond_canvas/components/_flash.scss +13 -12
  18. data/app/assets/stylesheets/beyond_canvas/components/_forms.scss +2 -2
  19. data/app/assets/stylesheets/beyond_canvas/components/_inputs.scss +186 -38
  20. data/app/assets/stylesheets/beyond_canvas/components/_links.scss +80 -4
  21. data/app/assets/stylesheets/beyond_canvas/components/_main.scss +3 -3
  22. data/app/assets/stylesheets/beyond_canvas/components/_menu.scss +13 -0
  23. data/app/assets/stylesheets/beyond_canvas/components/_modals.scss +48 -18
  24. data/app/assets/stylesheets/beyond_canvas/components/_notices.scss +12 -13
  25. data/app/assets/stylesheets/beyond_canvas/components/_scrollbox.scss +5 -4
  26. data/app/assets/stylesheets/beyond_canvas/components/_select2.scss +70 -0
  27. data/app/assets/stylesheets/beyond_canvas/components/_statuses.scss +28 -0
  28. data/app/assets/stylesheets/beyond_canvas/components/_step_list.scss +67 -0
  29. data/app/assets/stylesheets/beyond_canvas/components/_tables.scss +10 -5
  30. data/app/assets/stylesheets/beyond_canvas/components/_titles.scss +1 -1
  31. data/app/assets/stylesheets/beyond_canvas/mailer.scss +2 -1
  32. data/app/assets/stylesheets/beyond_canvas/settings/_base_variables.scss +241 -0
  33. data/app/assets/stylesheets/beyond_canvas/settings/{_variables.scss → _constant_variables.scss} +60 -53
  34. data/app/assets/stylesheets/beyond_canvas/settings/_custom_variables.scss +233 -0
  35. data/app/assets/stylesheets/beyond_canvas/settings/_typography.scss +7 -3
  36. data/app/assets/stylesheets/beyond_canvas/utilities/_mixins.scss +39 -3
  37. data/app/controllers/beyond_canvas/authentications_controller.rb +18 -2
  38. data/app/controllers/beyond_canvas/system_controller.rb +3 -1
  39. data/app/controllers/beyond_canvas/webhooks_controller.rb +49 -0
  40. data/app/controllers/concerns/beyond_canvas/add_blocker_check.rb +17 -0
  41. data/app/controllers/concerns/beyond_canvas/custom_styles.rb +54 -0
  42. data/app/controllers/concerns/beyond_canvas/locale_management.rb +31 -8
  43. data/app/controllers/concerns/beyond_canvas/request_validation.rb +6 -0
  44. data/app/form_builders/beyond_canvas/form_builder.rb +62 -49
  45. data/app/helpers/beyond_canvas/application_helper.rb +48 -4
  46. data/app/helpers/beyond_canvas/form_tag_helper.rb +130 -0
  47. data/app/helpers/beyond_canvas/statuses_helper.rb +26 -0
  48. data/app/javascript/beyond_canvas/base.js +1 -1
  49. data/app/javascript/beyond_canvas/initializers/buttons.js +49 -29
  50. data/app/javascript/beyond_canvas/initializers/collapse.js +8 -0
  51. data/app/javascript/beyond_canvas/initializers/flash.js +33 -11
  52. data/app/javascript/beyond_canvas/initializers/inputs.js +9 -4
  53. data/app/javascript/beyond_canvas/initializers/modals.js +46 -10
  54. data/app/views/beyond_canvas/mailer/_header.html.erb +2 -2
  55. data/app/views/beyond_canvas/shared/_breadcrumbs.html.erb +5 -2
  56. data/app/views/beyond_canvas/shared/_flash.html.erb +14 -10
  57. data/app/views/beyond_canvas/shared/_head.html.erb +4 -0
  58. data/app/views/beyond_canvas/shared/_locales.html.erb +1 -1
  59. data/app/views/layouts/beyond_canvas/application.html.erb +1 -2
  60. data/app/views/layouts/beyond_canvas/public.html.erb +1 -1
  61. data/config/initializers/beyond_canvas/constants.rb +13 -0
  62. data/config/initializers/beyond_canvas/session_store.rb +8 -0
  63. data/lib/beyond_canvas/configuration.rb +9 -1
  64. data/lib/beyond_canvas/engine.rb +7 -0
  65. data/lib/beyond_canvas/rails/routes.rb +27 -7
  66. data/lib/beyond_canvas/version.rb +1 -1
  67. data/lib/beyond_canvas/webhook_event_registration.rb +19 -0
  68. data/lib/beyond_canvas.rb +6 -4
  69. data/lib/generators/beyond_canvas/custom_styles/templates/beyond_canvas_custom_styles.scss +33 -0
  70. data/lib/generators/beyond_canvas/install/install_generator.rb +6 -0
  71. data/lib/generators/beyond_canvas/install/templates/beyond_canvas.rb.erb +38 -1
  72. data/lib/generators/beyond_canvas/model/model_generator.rb +3 -0
  73. data/lib/generators/beyond_canvas/webhook/templates/webhooks_controller.rb +22 -0
  74. data/lib/generators/beyond_canvas/webhook/webhook_generator.rb +15 -0
  75. data/lib/models/concerns/authentication.rb +10 -3
  76. data/lib/models/concerns/utils.rb +6 -5
  77. data/lib/models/concerns/webhook.rb +123 -0
  78. data/lib/models/shop.rb +1 -0
  79. metadata +73 -40
  80. data/app/assets/stylesheets/beyond_canvas/components/_comments.scss +0 -6
  81. data/app/assets/stylesheets/beyond_canvas/components/_containers.scss +0 -37
  82. data/app/views/beyond_canvas/shared/_modal.html.erb +0 -6
  83. data/config/routes.rb +0 -12
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7e521c2269619436efc6e760472ab605213b315b3f14462661a65db7a615a93c
4
- data.tar.gz: 146a2408feda96383da8def8d2647abd8b003e5dcef55a7b439325c4b1f38832
3
+ metadata.gz: b1de2d82164f7101979a0becd0510d4ba32071d9033b6a52fa7994c89884c0c7
4
+ data.tar.gz: 9d78929e71b97c887814da55ae64722be0ac5aa6f835167c9516df056ad99f4b
5
5
  SHA512:
6
- metadata.gz: 34478929f6d039be913f94e7f9ce74544d0481534a8f3e25649ed4daed4f9f677e4b028835263f65e97066f76104b13aa92d8dd7d5ed520425de88d08f6e0df2
7
- data.tar.gz: e434787b9ff264aa0a661b5c2d35fcb311ba199bdfec9408965a57e32118941ab0fb3d1564b2de5c02d297b7711695091a432663a4aad1d5f9f65e0d0931ce6b
6
+ metadata.gz: abeafe5140b724a90a4c156d909dc4c2a06d9a5e757be3ff4a4e1d92c36454181fe584776bceb84fbdd4149cb9483e7494325a21e606dd0a5cc5bbb06ac57051
7
+ data.tar.gz: e738177bf4e47df314ab879242279aa28edb2b128d08a4789936bab37d5a049dc769d57acfe21c1f3ccdc3165a3ef744ef2e99cf1cf717e9a283a81362c43427
data/README.md CHANGED
@@ -3,59 +3,17 @@
3
3
  ![Gem Version](https://img.shields.io/gem/v/beyond_canvas?label=gem%20version)
4
4
  ![License](https://img.shields.io/github/license/ePages-de/beyond_canvas)
5
5
 
6
- ## Installation
7
-
8
- 1. Add this line to your application's Gemfile:
9
-
10
- ```ruby
11
- gem "beyond_canvas"
12
- ```
13
-
14
- 1. Then execute:
15
-
16
- ```bash
17
- $ bundle install
18
- ```
19
-
20
- 1. Restart your server and rename `application.css` to `application.scss` or `application.sass` (in case you prefer to use the `sass` syntax):
21
-
22
- ```bash
23
- $ mv app/assets/stylesheets/application.css app/assets/stylesheets/application.scss
24
- ```
25
-
26
- 1. Delete _all_ Sprockets directives in `application.scss` (`require`, `require_tree` and `require_self`) and use Sass’s native `@import` instead ([Here's why?](https://content.pivotal.io/blog/structure-your-sass-files-with-import)).
27
-
28
- 1. Import Beyond Canvas at the beginning of `application.scss`. Any other styles must be imported after Beyond Canvas to avoid issues:
29
-
30
- ```scss
31
- @import 'beyond_canvas'
32
- ```
33
-
34
- 1. Add the following to `application.js`:
35
-
36
- ```js
37
- //= require beyond_canvas
38
- ```
39
-
40
- 1. Run the generator:
41
-
42
- ```bash
43
- $ rails g beyond_canvas:install
44
- ```
45
-
46
- This will generate `config/initializers/beyond_canvas.rb` file, used for general Beyond Canvas configuration. Read [this wiki entry](https://github.com/ePages-de/beyond_canvas/wiki/Initializer) to get more information about the different configuration options.
47
-
48
6
  ## Documentation
49
7
 
50
- TBD
8
+ Please see the [Beyond Canvas wiki](https://github.com/ePages-de/beyond_canvas/wiki) for additional information about the gem and its features.
51
9
 
52
10
  ## Contributing
53
11
 
54
12
  Please see [CONTRIBUTING](https://github.com/ePages-de/beyond_canvas/blob/master/CONTRIBUTING.md).
55
13
 
56
- ## Changelog
14
+ ## Change log
57
15
 
58
- Beyond Canvas's changelog is available [here](https://github.com/ePages-de/beyond_canvas/blob/master/CHANGELOG.md).
16
+ Beyond Canvas's change log is available [here](https://github.com/ePages-de/beyond_canvas/blob/master/CHANGELOG.md).
59
17
 
60
18
  ## License
61
19
 
@@ -0,0 +1,5 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 265 265">
2
+ <polygon class="surface" points="160.21 93.5 116.18 93.5 85.05 124.63 85.05 168.66 116.18 199.79 132.95 199.79 132.95 259.83 139.95 259.83 139.95 199.79 160.21 199.79 191.34 168.66 191.34 124.63 160.21 93.5"/>
3
+ <path class="bubbles" d="M68.8,38.6a4.46,4.46,0,0,1-4.4-4.5,4.53,4.53,0,0,1,4.5-4.4,4.45,4.45,0,1,1-.1,8.9ZM130.6,1a2.26,2.26,0,0,0-2.3,2.3,2.3,2.3,0,0,0,4.6,0A2.26,2.26,0,0,0,130.6,1ZM54.8,138.6a2.3,2.3,0,1,0,2.3,2.3A2.26,2.26,0,0,0,54.8,138.6Zm56.7-94.4a2.3,2.3,0,1,0-4.6,0,2.2,2.2,0,0,0,2.3,2.3A2.26,2.26,0,0,0,111.5,44.2Zm-39,25.6a2.35,2.35,0,1,0,2.3,2.4A2.23,2.23,0,0,0,72.5,69.8ZM69,105.4a2.3,2.3,0,1,0,2.3,2.3A2.33,2.33,0,0,0,69,105.4ZM30.59,65a2.35,2.35,0,0,0,2.4-2.3,2.23,2.23,0,0,0-2.3-2.4,2.35,2.35,0,1,0-.1,4.7ZM45.2,8a2.35,2.35,0,1,0,2.3,2.4A2.23,2.23,0,0,0,45.2,8Zm-16,92.37a4.45,4.45,0,1,0-4.4-4.5A4.34,4.34,0,0,0,29.2,100.4Zm0,69.5a5.91,5.91,0,0,0-5.9,5.9,5.9,5.9,0,0,0,11.8,0A6,6,0,0,0,29.2,169.9ZM7.7,134.6a2.3,2.3,0,1,0,2.3,2.3A2.26,2.26,0,0,0,7.7,134.6ZM114.8,65.42a4.7,4.7,0,1,0,4.7,4.7A4.69,4.69,0,0,0,114.8,65.42ZM239.5,164a5.9,5.9,0,1,0,5.8,5.9A5.83,5.83,0,0,0,239.5,164Zm-14.72-61.17a4.8,4.8,0,0,0-4.8,4.8,4.8,4.8,0,0,0,9.6,0A4.8,4.8,0,0,0,224.78,102.83ZM257.3,74.5a2.3,2.3,0,1,0,2.3,2.3A2.26,2.26,0,0,0,257.3,74.5Zm-2.63,49.76a2.3,2.3,0,1,0,2.3,2.3A2.26,2.26,0,0,0,254.67,124.26Zm-5.56-92.44a2.3,2.3,0,1,0,2.3,2.3A2.26,2.26,0,0,0,249.11,31.82Zm-27,106.58a2.3,2.3,0,1,0,2.3,2.3A2.2,2.2,0,0,0,222.1,138.4ZM158.8,74.5a2.3,2.3,0,1,0,2.3,2.3A2.33,2.33,0,0,0,158.8,74.5Zm52.31-60.73a2.35,2.35,0,1,0,2.3,2.4A2.23,2.23,0,0,0,211.11,13.77ZM165.7,12.1a4.1,4.1,0,1,0,4.1,4.1A4.12,4.12,0,0,0,165.7,12.1Zm-7.6,33a2.33,2.33,0,0,0-2.3-2.3,2.3,2.3,0,1,0,2.3,2.3Zm46,0a4.7,4.7,0,1,0,4.7,4.7A4.69,4.69,0,0,0,204.1,45.1Zm.38,34.58a2.3,2.3,0,1,0,2.3,2.3A2.33,2.33,0,0,0,204.48,79.68Z" transform="translate(0 -1)"/>
4
+ <path class="outline" d="M144.37,125.34h-7.5V122h-9v6.67h-7.5v14.76h-6.9l-.34,20.28L124,181.85h24.41l3.43-25.75V134.72h-7.5Zm6,10.88V156l-3.25,24.35H124.87l-10.24-17,.32-18.38h5.4v12.35h1.52V130.18h6v22.34h1.5v-29h6v30.21h1.5V126.84h6V156.1h1.5V136.22ZM137.25,263.71V205.82h17.57l31.57-31.57V129.61L154.82,98H110.18L78.61,129.61v44.64l31.57,31.57h17.57v57.89H0v1.5H265v-1.5ZM97.93,191.46,114.7,174.7l-1.06-1.06L96.87,190.4,94.46,188l16.76-16.76-1.06-1.06L93.4,186.92,80.11,173.63v-43.4L110.8,99.54h43.4l13.41,13.4-15.34,15.33,1.06,1.06L168.67,114l2.41,2.42-15.33,15.33,1.06,1.06,15.33-15.33,12.75,12.75v43.4L154.2,204.32H110.8Zm31.32,72.25V205.82h6.5v57.89Z" transform="translate(0 -1)"/>
5
+ </svg>
@@ -1 +1 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" style="background: #ffffff;" width="16" height="16" viewBox="0 0 24 24"><path fill="#97C344" d="M0 0v24h24V0H0zm9.6 18.4l-5.8-5.6 2-2.1 3.7 3.6L18 5.6l2.1 2.1L9.6 18.4z"></path></svg>
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24"><path d="M0 0v24h24V0H0zm9.6 18.4l-5.8-5.6 2-2.1 3.7 3.6L18 5.6l2.1 2.1L9.6 18.4z"></path></svg>
@@ -1 +1 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" style="background: #ffff;" width="16" height="16" viewBox="0 0 24 24"><path fill="#c2bf9d" d="M0 0v24h24V0H0zm21.5 21.5h-19v-19h19v19z"></path></svg>
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24"><path d="M0 0v24h24V0H0zm21.5 21.5h-19v-19h19v19z"></path></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg"><rect x="1" y="1" width="44" height="24" rx="12" ry="12"></rect><path d="M13.3 2.9c-5.6 0-10 4.4-10 10s4.4 10 10 10 10-4.4 10-10-4.4-10-10-10zm-.6 13.5l-1.8 1.9-1.8-1.8L6.6 14l1.8-1.8 2.5 2.6 6.9-6.9 1.8 1.8-6.9 6.7z"></path><path d="M13.3 2.9c-5.6 0-10 4.4-10 10s4.4 10 10 10 10-4.4 10-10-4.5-10-10-10zm5.3 13.4l-1.8 1.8-3.4-3.4-3.4 3.4-1.8-1.8 3.4-3.4-3.4-3.4L10 7.7l3.4 3.4 3.4-3.4 1.8 1.8-3.5 3.4 3.5 3.4z"></path></svg>
@@ -0,0 +1,3 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="3.3 2.9 20 20">
2
+ <path d="M13.3 2.9c-5.6 0-10 4.4-10 10s4.4 10 10 10 10-4.4 10-10-4.4-10-10-10zm-.6 13.5l-1.8 1.9-1.8-1.8L6.6 14l1.8-1.8 2.5 2.6 6.9-6.9 1.8 1.8-6.9 6.7z"/>
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="3.3 2.9 20 20">
2
+ <path d="M13.3 2.9c-5.6 0-10 4.4-10 10s4.4 10 10 10 10-4.4 10-10-4.5-10-10-10zm5.3 13.4l-1.8 1.8-3.4-3.4-3.4 3.4-1.8-1.8 3.4-3.4-3.4-3.4L10 7.7l3.4 3.4 3.4-3.4 1.8 1.8-3.5 3.4 3.5 3.4z"/>
3
+ </svg>
@@ -2,6 +2,7 @@
2
2
  * Warning: This file is auto-generated, do not modify. Instead, make your changes in 'app/javascript/beyond_canvas/' and run `yarn build`
3
3
  */
4
4
  //= require jquery3
5
+ //= require rails-ujs
5
6
  //= require_self
6
7
 
7
8
  (function(factory) {
@@ -11,7 +12,7 @@
11
12
  var SPINNER_ANIMATION_TIMEOUT = 125;
12
13
  var BUTTON_SELECTORS = '[class^="button"]';
13
14
  (function($) {
14
- var onDOMReady = function onDOMReady(e) {
15
+ var onDOMReady = function onDOMReady() {
15
16
  var inputs = $("input, textarea, select").not(":input[type=button], :input[type=submit], :input[type=reset]");
16
17
  inputs.each(function() {
17
18
  var input = $(this);
@@ -23,39 +24,39 @@
23
24
  });
24
25
  });
25
26
  $(BUTTON_SELECTORS).each(function() {
26
- var button = $(this);
27
- button.width(button.width());
28
- button.data("oldWidth", button.width());
29
- if (button.find(".spinner").length == 0) {
30
- button.prepend('\n <div class="spinner">\n <div class="bounce1"></div>\n <div class="bounce2"></div>\n <div class="bounce3"></div>\n </div>');
31
- }
32
- button.closest("form").on("ajax:success", function() {
33
- $.restoreActionElements();
34
- }).on("ajax:error", function() {
35
- $.restoreActionElements();
36
- });
27
+ $(this).buildButton();
37
28
  });
38
29
  };
39
30
  $(document).on("confirm:complete", function() {
40
31
  $.restoreActionElements();
41
32
  });
42
- $(document).on("click", BUTTON_SELECTORS, function() {
33
+ $(document).on("click", BUTTON_SELECTORS, function(e) {
34
+ var _e$target$attributes$;
35
+ var button = $(this);
36
+ if (((_e$target$attributes$ = e.target.attributes.getNamedItem("target")) == null ? void 0 : _e$target$attributes$.value) === "_blank") return;
43
37
  $.disableActionElements();
44
- $(this).showSpinner();
38
+ if (!button.hasClass("button--no-spinner")) {
39
+ $(this).showSpinner();
40
+ }
45
41
  });
46
42
  $(document).on("ready page:load turbolinks:load", onDOMReady);
43
+ $(document).on("beforeunload turbolinks:before-visit", function() {
44
+ $.restoreActionElements();
45
+ });
47
46
  })(jQuery);
48
47
  $.extend({
49
48
  restoreActionElements: function restoreActionElements() {
50
- $(BUTTON_SELECTORS).each(function(_, button) {
51
- setTimeout(function() {
52
- $(button).find(".spinner").hide();
53
- $(button).width($(button).data("oldWidth"));
54
- }, SPINNER_ANIMATION_TIMEOUT);
55
- });
56
- $('a, input[type="submit"], input[type="button"], input[type="reset"], button').each(function() {
57
- $(this).removeClass("actions--disabled");
58
- });
49
+ setTimeout(function() {
50
+ $(BUTTON_SELECTORS).each(function(_, button) {
51
+ setTimeout(function() {
52
+ $(button).find(".spinner").hide();
53
+ $(button).width($(button).data("oldWidth"));
54
+ }, SPINNER_ANIMATION_TIMEOUT);
55
+ });
56
+ $('a, input[type="submit"], input[type="button"], input[type="reset"], button').each(function() {
57
+ $(this).removeClass("actions--disabled");
58
+ });
59
+ }, 100);
59
60
  },
60
61
  disableActionElements: function disableActionElements() {
61
62
  $('a, input[type="submit"], input[type="button"], input[type="reset"], button').each(function() {
@@ -64,6 +65,23 @@
64
65
  }
65
66
  });
66
67
  $.fn.extend({
68
+ buildButton: function buildButton() {
69
+ var button = $(this);
70
+ if (button.is("[class^=button]")) {
71
+ if (!button.hasClass("button--no-spinner")) {
72
+ button.width(button.width());
73
+ button.data("oldWidth", button.width());
74
+ if (button.find(".spinner").length == 0) {
75
+ button.prepend('\n <div class="spinner">\n <div class="bounce1"></div>\n <div class="bounce2"></div>\n <div class="bounce3"></div>\n </div>');
76
+ }
77
+ }
78
+ button.closest("form").on("ajax:success", function() {
79
+ $.restoreActionElements();
80
+ }).on("ajax:error", function() {
81
+ $.restoreActionElements();
82
+ });
83
+ }
84
+ },
67
85
  showSpinner: function showSpinner() {
68
86
  var button = $(this);
69
87
  button.width(button.width() + $(".spinner").outerWidth(true));
@@ -72,6 +90,13 @@
72
90
  }, SPINNER_ANIMATION_TIMEOUT);
73
91
  }
74
92
  });
93
+ (function($) {
94
+ $(document).on("click", "[data-toggle='collapse']", function(e) {
95
+ e.preventDefault();
96
+ $($(this).attr("data-target")).slideToggle();
97
+ $(this).find(".collapse__icon").toggleClass("collapse__icon--open");
98
+ });
99
+ })(jQuery);
75
100
  (function($) {
76
101
  var onDOMReady = function onDOMReady() {
77
102
  $(".flash").each(function() {
@@ -81,23 +106,33 @@
81
106
  $(".flash").addClass("flash--shown");
82
107
  }, 100);
83
108
  };
84
- $(document).on("click", ".flash", function() {
85
- closeAlert();
109
+ $(document).on("click", ".flash__close", function() {
110
+ $.closeAlert();
86
111
  });
87
- $(document).on("ready page:load turbolinks:load", onDOMReady);
112
+ $(document).on("ready page:load turbolinks:load bc.flash.shown", onDOMReady);
88
113
  })(jQuery);
89
- function closeAlert() {
90
- $(".flash").removeClass("flash--shown").delay(700).queue(function() {
91
- $(this).remove();
92
- });
93
- }
114
+ $.extend({
115
+ showFlash: function showFlash(status, message) {
116
+ var flash = '\n <div class="flash">\n <div class="flash__icon flash__icon--' + status + '">\n <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm6 16.538l-4.592-4.548 4.546-4.587-1.416-1.403-4.545 4.589-4.588-4.543-1.405 1.405 4.593 4.552-4.547 4.592 1.405 1.405 4.555-4.596 4.591 4.55 1.403-1.416z"></path></svg>\n </div>\n <div class="flash__message">\n ' + message + '\n </div>\n <div class="flash__close">\n <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M24 20.188l-8.315-8.209 8.2-8.282-3.697-3.697-8.212 8.318-8.31-8.203-3.666 3.666 8.321 8.24-8.206 8.313 3.666 3.666 8.237-8.318 8.285 8.203z"></path></svg>\n </div>\n </div>';
117
+ $(document).trigger("bc.flash.show");
118
+ $("#flash").html(flash);
119
+ $(document).trigger("bc.flash.shown");
120
+ },
121
+ closeAlert: function closeAlert() {
122
+ $(document).trigger("bc.flash.hide");
123
+ $(".flash").removeClass("flash--shown").delay(700).queue(function() {
124
+ $(this).remove();
125
+ });
126
+ $(document).trigger("bc.flash.hidden");
127
+ }
128
+ });
94
129
  (function($) {
95
130
  var onDOMReady = function onDOMReady() {
96
131
  $('input[type="file"]').each(function() {
97
132
  var $input = $(this), $label = $(".input__file__text." + $input.attr("id")), labelVal = $label.html();
98
133
  $input.on("change", function(e) {
99
134
  var fileName = "";
100
- if (this.files && this.files.length > 1) fileName = (this.getAttribute("data-multiple-caption") || "").replace("{count}", this.files.length); else if (e.target.value) fileName = e.target.value.split("\\").pop();
135
+ if (this.files && this.files.length > 1) fileName = (this.getAttribute("data-multiple-caption") || "{count} files selected").replace("{count}", this.files.length); else if (e.target.value) fileName = e.target.value.split("\\").pop();
101
136
  if (fileName) $label.html('<svg class="input__file__icon" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M15 2v5h5v15h-16v-20h11zm1-2h-14v24h20v-18l-6-6z"/></svg>' + fileName); else $label.html(labelVal);
102
137
  });
103
138
  $input.on("focus", function() {
@@ -107,23 +142,51 @@
107
142
  });
108
143
  });
109
144
  };
145
+ $(document).on("ready page:load turbolinks:load", function() {
146
+ var observer = new MutationObserver(function() {
147
+ return onDOMReady();
148
+ });
149
+ onDOMReady();
150
+ observer.observe(document.body, {
151
+ childList: true,
152
+ subtree: true
153
+ });
154
+ });
155
+ })(jQuery);
156
+ (function($) {
157
+ var onDOMReady = function onDOMReady() {
158
+ $(".modal").each(function() {
159
+ $(this).hide().css("visibility", "visible");
160
+ });
161
+ };
162
+ $(document).on("click", '[data-toggle="modal"]', function(e) {
163
+ e.preventDefault();
164
+ var dataTarget = $(this).attr("data-target");
165
+ $.restoreActionElements();
166
+ $(dataTarget).showModal();
167
+ });
168
+ $(document).on("click", '[data-dismiss="modal"]', function(e) {
169
+ e.preventDefault();
170
+ var dataTarget = $(this).closest(".modal");
171
+ $.restoreActionElements();
172
+ $(dataTarget).hideModal();
173
+ });
110
174
  $(document).on("ready page:load turbolinks:load", onDOMReady);
111
175
  })(jQuery);
112
- $.extend({
113
- displayModal: function displayModal(content, options) {
114
- if (options === void 0) {
115
- options = {};
116
- }
117
- $("#modal").find("#modal__content").html(content);
118
- $("#modal").css("display", "flex");
176
+ $.fn.extend({
177
+ showModal: function showModal() {
178
+ var modal = $(this);
179
+ modal.trigger("bc.modal.show");
119
180
  $.restoreActionElements();
120
- $(document).trigger("modal:opened", options["extraEventParameters"]);
181
+ modal.css("display", "flex");
182
+ modal.trigger("bc.modal.shown");
121
183
  },
122
- closeModal: function closeModal() {
123
- $("#modal").find("#modal__content").empty();
124
- $("#modal").css("display", "none");
184
+ hideModal: function hideModal() {
185
+ var modal = $(this);
186
+ modal.trigger("bc.modal.hide");
125
187
  $.restoreActionElements();
126
- $(document).trigger("modal:closed");
188
+ modal.hide();
189
+ modal.trigger("bc.modal.hidden");
127
190
  }
128
191
  });
129
192
  });
@@ -1,37 +1,40 @@
1
1
  @import "bourbon";
2
2
 
3
3
  @import "settings/breakpoints";
4
- @import "settings/variables";
4
+ @import "settings/constant_variables";
5
+ @import "settings/base_variables";
5
6
  @import "settings/reset_css";
6
7
  @import "settings/typography";
7
8
 
8
9
  @import "utilities/functions";
9
10
  @import "utilities/mixins";
10
11
 
11
- @import "components/actions";
12
- @import "components/breadcrumbs";
12
+ @import "components/action_bar"; // Done
13
+ @import "components/actions"; // Done
14
+ @import "components/breadcrumbs"; // Done
13
15
  @import "components/buttons";
14
16
  @import "components/cards";
15
- @import "components/comments";
16
- @import "components/containers";
17
+ @import "components/collapse";
17
18
  @import "components/debug";
18
- @import "components/flash";
19
- @import "components/forms";
19
+ @import "components/flash"; // Done
20
+ @import "components/forms"; // Done
20
21
  @import "components/grids";
21
22
  @import "components/inputs";
22
- @import "components/layouts";
23
+ @import "components/layouts"; // Done
23
24
  @import "components/links";
24
25
  @import "components/main";
25
- @import "components/margins";
26
+ @import "components/margins"; // Done
26
27
  @import "components/markdown";
27
- @import "components/action_bar";
28
- @import "components/modals";
29
- @import "components/notices";
30
- @import "components/relative";
28
+ @import "components/menu";
29
+ @import "components/modals"; // Done
30
+ @import "components/notices"; // Done
31
+ @import "components/relative"; // Done
31
32
  @import "components/scrollbox";
33
+ @import "components/select2"; // Done
32
34
  @import "components/sidebar";
33
- @import "components/spinner";
34
- @import "components/menu";
35
- @import "components/tables";
36
- @import "components/titles";
37
- @import "components/texts";
35
+ @import "components/spinner"; // Done
36
+ @import "components/statuses"; // Done
37
+ @import "components/step_list"; // Done
38
+ @import "components/tables"; // Done
39
+ @import "components/texts"; // Done
40
+ @import "components/titles"; // Done
@@ -1,8 +1,8 @@
1
1
  .action_bar {
2
2
  width: 100%;
3
- height: $action-bar-height;
4
- background-color: $action-bar-background;
5
- border-bottom: $action-bar-shadow;
3
+ height: var(--header-bar-height);
4
+ background-color: var(--workspace-toolbar-background);
5
+ border-bottom: var(--workspace-toolbar-border);
6
6
  padding: 0 25px;
7
7
  box-sizing: border-box;
8
8
  display: flex;
@@ -13,16 +13,21 @@
13
13
  z-index: 999;
14
14
 
15
15
  &--menu {
16
- top: $menu-height;
16
+ top: var(--menu-height);
17
17
  }
18
18
 
19
- &--left {
19
+ &--left,
20
+ &--right {
20
21
  display: flex;
22
+ align-items: center;
23
+ min-width: 50%;
24
+ }
25
+
26
+ &--left {
21
27
  justify-content: flex-start;
22
28
  }
23
29
 
24
30
  &--right {
25
- display: flex;
26
31
  justify-content: flex-end;
27
32
  }
28
33
  }
@@ -5,7 +5,7 @@
5
5
  .home-icon {
6
6
  width: 12px;
7
7
  height: 12px;
8
- fill: $breadcrum-color-current;
8
+ fill: var(--breadcrumb-icon);
9
9
  }
10
10
 
11
11
  .arrow-right {
@@ -13,16 +13,20 @@
13
13
  height: 8px;
14
14
  margin-left: 7px;
15
15
  margin-right: 7px;
16
- fill: $breadcrum-color;
16
+ fill: var(--breadcrumb-text);
17
17
  }
18
18
  }
19
19
 
20
20
  .breadcrumb {
21
21
  &__item {
22
- color: $breadcrum-color-current;
22
+ color: var(--breadcrumb-link);
23
+
24
+ &:hover {
25
+ color: var(--breadcrumb-link-hover);
26
+ }
23
27
 
24
28
  &--current {
25
- color: $breadcrum-color;
29
+ color: var(--breadcrumb-text);
26
30
  pointer-events: none;
27
31
  }
28
32
  }