beyond_canvas 0.17.0.pre → 0.20.0.pre

Sign up to get free protection for your applications and to get access to all the features.
Files changed (24) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/stylesheets/beyond_canvas/base.scss +6 -3
  3. data/app/assets/stylesheets/beyond_canvas/components/_grids.scss +12 -0
  4. data/app/assets/stylesheets/beyond_canvas/components/_inputs.scss +5 -0
  5. data/app/assets/stylesheets/beyond_canvas/components/_margins.scss +4 -0
  6. data/app/assets/stylesheets/beyond_canvas/components/_menu.scss +10 -0
  7. data/app/assets/stylesheets/beyond_canvas/components/_modals.scss +8 -0
  8. data/app/assets/stylesheets/beyond_canvas/components/_scrollbox.scss +35 -0
  9. data/app/assets/stylesheets/beyond_canvas/components/_statuses.scss +27 -0
  10. data/app/assets/stylesheets/beyond_canvas/components/_texts.scss +8 -0
  11. data/app/assets/stylesheets/beyond_canvas/settings/_variables.scss +13 -0
  12. data/app/controllers/beyond_canvas/application_controller.rb +1 -0
  13. data/app/form_builders/beyond_canvas/form_builder.rb +8 -6
  14. data/app/helpers/beyond_canvas/controller_helper.rb +9 -0
  15. data/app/helpers/beyond_canvas/statuses_helper.rb +26 -0
  16. data/app/views/beyond_canvas/shared/_menu.html.erb +1 -1
  17. data/lib/beyond_canvas/engine.rb +1 -4
  18. data/lib/beyond_canvas/version.rb +1 -1
  19. data/lib/generators/beyond_canvas/controller/controller_generator.rb +1 -5
  20. data/lib/generators/beyond_canvas/controller/templates/{controller.erb → shops_controller.rb} +1 -1
  21. data/lib/generators/beyond_canvas/custom_menu/templates/beyond_canvas_custom_menu.html.erb +6 -6
  22. data/lib/generators/beyond_canvas/custom_styles/templates/beyond_canvas_custom_styles.scss +13 -0
  23. data/lib/generators/beyond_canvas/install/templates/beyond_canvas.rb.erb +1 -1
  24. metadata +8 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d68bb535d2ac13479fbf78d65485f4e4d75008ee76b717263460315c6a68fc8b
4
- data.tar.gz: 71d0874d34489a4cf68aaac680865b70668fd95ec5acdb3570e1ac7dee5f5971
3
+ metadata.gz: 546dcb0ade52cea03999f68b2f8866e0d5c34cd714ccda4818f231db0e6996ea
4
+ data.tar.gz: bb27504cda97798e8b9e47ce98ec7efc73e664d3c727b3685ab5e4d77338b5ff
5
5
  SHA512:
6
- metadata.gz: 0faf96cabf37ae07a4b4febc069a8b93a257e0341a5b1136dea1735d7d31df93e6c1f007ead4c9d90aa0ddfc28ce7555d672a8562cd4d0cf767c3241b397abe6
7
- data.tar.gz: a3f482336565147692c27db3332314d00c290af8ce949028c0d8235f0236ad9d1fa2ea3760ea2b65fa28c26db41ec0d5447af3ce6d9b260f338617bccc89a6fe
6
+ metadata.gz: a76c13a79e053ff43dddb6d0bbf4d6c87fec754d2cf710b19cd375b89864b09e178665dcda6b9bbad5d6f60ae9abb492d2187eea98ac3a02b2d561ae7fc229ef
7
+ data.tar.gz: e6ecbdff28acf32f5414998b62f810379cc2d8a8796ad8b501480eca9ef2d93587fe94ef3c44c4baaa9b5da82bf76ff40995b75a30c43143434eaa1c3920be87
@@ -8,6 +8,7 @@
8
8
  @import "utilities/functions";
9
9
  @import "utilities/mixins";
10
10
 
11
+ @import "components/action_bar";
11
12
  @import "components/actions";
12
13
  @import "components/breadcrumbs";
13
14
  @import "components/buttons";
@@ -17,19 +18,21 @@
17
18
  @import "components/debug";
18
19
  @import "components/flash";
19
20
  @import "components/forms";
21
+ @import "components/grids";
20
22
  @import "components/inputs";
21
23
  @import "components/layouts";
22
24
  @import "components/links";
23
25
  @import "components/main";
24
26
  @import "components/margins";
25
27
  @import "components/markdown";
26
- @import "components/action_bar";
28
+ @import "components/menu";
27
29
  @import "components/modals";
28
30
  @import "components/notices";
29
31
  @import "components/relative";
32
+ @import "components/scrollbox";
30
33
  @import "components/sidebar";
31
34
  @import "components/spinner";
32
- @import "components/menu";
35
+ @import "components/statuses";
33
36
  @import "components/tables";
34
- @import "components/titles";
35
37
  @import "components/texts";
38
+ @import "components/titles";
@@ -0,0 +1,12 @@
1
+ .grid {
2
+ &__container {
3
+ display: grid;
4
+ gap: 40px;
5
+ grid-template-columns: repeat(auto-fill, 385px);
6
+ }
7
+
8
+ &__item {
9
+ border: 1px solid #dfdecc;
10
+ padding: 20px;
11
+ }
12
+ }
@@ -29,6 +29,11 @@ select {
29
29
  background-repeat: no-repeat;
30
30
  }
31
31
 
32
+ textarea {
33
+ min-height: 100px;
34
+ resize: vertical;
35
+ }
36
+
32
37
  #{$all-text-inputs},
33
38
  select {
34
39
  &.input__error {
@@ -1,4 +1,8 @@
1
1
  .margin {
2
+ &--clear {
3
+ margin: 0 !important;
4
+ }
5
+
2
6
  &--top {
3
7
  margin-top: 30px;
4
8
  }
@@ -15,14 +15,24 @@
15
15
  height: $menu-logo-height;
16
16
  }
17
17
 
18
+ &--left {
19
+ display: inherit;
20
+ }
21
+
18
22
  &--center {
19
23
  left: 50%;
20
24
  position: absolute;
21
25
  transform: translateX(-50%);
26
+ display: inherit;
27
+ }
28
+
29
+ &--right {
30
+ display: inherit;
22
31
  }
23
32
 
24
33
  &__item {
25
34
  @include margin(0 15px);
35
+ line-height: 1;
26
36
  color: $menu-item-color;
27
37
 
28
38
  &:hover {
@@ -17,6 +17,14 @@
17
17
  }
18
18
  }
19
19
 
20
+ &__headline {
21
+ margin-bottom: 30px;
22
+ font-size: 24px;
23
+ font-weight: normal;
24
+ line-height: 1.2;
25
+ color: rgb(62, 62, 62);
26
+ }
27
+
20
28
  &__close {
21
29
  @include position(absolute, $modal-padding $modal-padding null null);
22
30
  @include size(14px);
@@ -0,0 +1,35 @@
1
+ .scrollbox {
2
+ max-height: 65vh;
3
+ overflow: auto;
4
+ width: 100%;
5
+
6
+ -ms-overflow-style: none;
7
+ scrollbar-width: none;
8
+
9
+ background:
10
+ /* Shadow covers */
11
+ linear-gradient(white 30%, rgba(255,255,255,0)),
12
+ linear-gradient(rgba(255,255,255,0), white 70%) 0 100%,
13
+
14
+ /* Shadows */
15
+ radial-gradient(50% 0, farthest-side, rgba(0,0,0,.2), rgba(0,0,0,0)),
16
+ radial-gradient(50% 100%,farthest-side, rgba(0,0,0,.2), rgba(0,0,0,0)) 0 100%;
17
+ background:
18
+ /* Shadow covers */
19
+ linear-gradient(white 30%, rgba(255,255,255,0)),
20
+ linear-gradient(rgba(255,255,255,0), white 70%) 0 100%,
21
+
22
+ /* Shadows */
23
+ radial-gradient(farthest-side at 50% 0, rgba(0,0,0,.2), rgba(0,0,0,0)),
24
+ radial-gradient(farthest-side at 50% 100%, rgba(0,0,0,.2), rgba(0,0,0,0)) 0 100%;
25
+ background-repeat: no-repeat;
26
+ background-color: white;
27
+ background-size: 100% 40px, 100% 40px, 100% 14px, 100% 14px;
28
+
29
+ /* Opera doesn’t support this in the shorthand */
30
+ background-attachment: local, local, scroll, scroll;
31
+
32
+ &::-webkit-scrollbar {
33
+ display: none;
34
+ }
35
+ }
@@ -0,0 +1,27 @@
1
+ .status {
2
+ @include padding(4px 6px);
3
+ font-size: 12px;
4
+ border-radius: 3px;
5
+ line-height: 1.2;
6
+ font-weight: 500;
7
+
8
+ &--good {
9
+ background-color: $status-good-background;
10
+ color: $status-good-color;
11
+ }
12
+
13
+ &--warning {
14
+ background-color: $status-warning-background;
15
+ color: $status-warning-color;
16
+ }
17
+
18
+ &--danger {
19
+ background-color: $status-danger-background;
20
+ color: $status-danger-color;
21
+ }
22
+
23
+ &--neutral {
24
+ border: 1px solid $status-neutral-background;
25
+ color: $status-neutral-color;
26
+ }
27
+ }
@@ -1,7 +1,15 @@
1
1
  .text {
2
2
  &__align {
3
+ &--left {
4
+ text-align: left;
5
+ }
6
+
3
7
  &--center {
4
8
  text-align: center;
5
9
  }
10
+
11
+ &--right {
12
+ text-align: right;
13
+ }
6
14
  }
7
15
  }
@@ -161,6 +161,19 @@ $notice-error-background: rgb(218, 60, 60) !default;
161
161
  $notice-border-radius: 4px !default;
162
162
  $notice-color: rgb(153, 153, 153) !default;
163
163
 
164
+ // ************************************************************
165
+ // Status
166
+ // ************************************************************
167
+
168
+ $status-good-background: rgb(205,225,165) !default;
169
+ $status-good-color: rgb(85,110,41) !default;
170
+ $status-warning-background: rgb(249,220,166) !default;
171
+ $status-warning-color: rgb(178,120,18) !default;
172
+ $status-danger-background: rgb(247,174,163) !default;
173
+ $status-danger-color: rgb(164,35,34) !default;
174
+ $status-neutral-background: rgb(224,223,205) !default;
175
+ $status-neutral-color: rgb(155,151,100) !default;
176
+
164
177
  // ************************************************************
165
178
  // Breadcrums
166
179
  // ************************************************************
@@ -7,5 +7,6 @@ module BeyondCanvas
7
7
  include ::BeyondCanvas::StatusCodes
8
8
  include ::BeyondCanvas::AuthenticationsHelper
9
9
  include ::BeyondCanvas::DebugHelper
10
+ include ::BeyondCanvas::ControllerHelper
10
11
  end
11
12
  end
@@ -2,10 +2,6 @@
2
2
 
3
3
  module BeyondCanvas
4
4
  class FormBuilder < ActionView::Helpers::FormBuilder # :nodoc:
5
- ############################################################################
6
- # Wrappers
7
- ############################################################################
8
-
9
5
  def field_wrapper(attribute, args, &block)
10
6
  label = args[:label] == false ? nil : args[:label].presence || attribute.to_s.humanize
11
7
 
@@ -38,14 +34,20 @@ module BeyondCanvas
38
34
  end
39
35
  end
40
36
 
41
- %i[email text number password].each do |method|
42
- define_method :"#{method}_field" do |attribute, args = {}|
37
+ %i[email_field text_field number_field password_field text_area].each do |method|
38
+ define_method method do |attribute, args = {}|
43
39
  field_wrapper(attribute, args) do
44
40
  super(attribute, args)
45
41
  end
46
42
  end
47
43
  end
48
44
 
45
+ def select(attribute, choices, options = {}, args = {})
46
+ field_wrapper(attribute, args) do
47
+ super(attribute, choices, options, args)
48
+ end
49
+ end
50
+
49
51
  def check_box(attribute, args = {})
50
52
  inline_wrapper(attribute, args) do
51
53
  filed_identifyer = filed_identifyer(attribute)
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module BeyondCanvas
4
+ module ControllerHelper # :nodoc:
5
+ def beyond_canvas_controller?
6
+ self.class.const_defined?(:BeyondCanvas)
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ module BeyondCanvas
4
+ module StatusesHelper # :nodoc:
5
+ %i[good warning danger neutral].each do |method|
6
+ define_method :"status_#{method}" do |name = nil, html_options = nil, &block|
7
+ status_render(method, name, html_options, &block)
8
+ end
9
+ end
10
+
11
+ private
12
+
13
+ def status_render(method, name = nil, html_options = nil, &block)
14
+ if block_given?
15
+ html_options = name
16
+ name = block
17
+ end
18
+
19
+ html_options ||= {}
20
+
21
+ html_options.merge!(class: "status status--#{method}") { |_key, old_val, new_val| [new_val, old_val].join(' ') }
22
+
23
+ content_tag('span', block_given? ? capture(&name) : name, html_options)
24
+ end
25
+ end
26
+ end
@@ -16,7 +16,7 @@
16
16
 
17
17
  <% path = Rails.application.routes.recognize_path(url) %>
18
18
 
19
- <% options = options.merge(class: 'menu__item--active') { |_key, old_val, new_val| [new_val, old_val].join(' ') if !external_url && path[:controller] == params[:controller] } %>
19
+ <% options = options.merge(class: 'menu__item--active') { |_key, old_val, new_val| [new_val, old_val].join(' ') } if !external_url && (path[:controller] == params[:controller]) %>
20
20
  <% options = options.merge(class: 'menu__item') { |_key, old_val, new_val| [new_val, old_val].join(' ') } %>
21
21
 
22
22
  <%= link_to name, url, options %>
@@ -24,13 +24,10 @@ module BeyondCanvas
24
24
  include ::BeyondCanvas::StatusCodes
25
25
  include ::BeyondCanvas::AuthenticationsHelper
26
26
  include ::BeyondCanvas::DebugHelper
27
+ include ::BeyondCanvas::ControllerHelper
27
28
 
28
29
  ::ActionController::Base.helper BeyondCanvas::Engine.helpers
29
30
  end
30
-
31
- ActiveSupport.on_load :action_mailer do
32
- layout 'beyond_canvas/mailer'
33
- end
34
31
  end
35
32
  end
36
33
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module BeyondCanvas
4
- VERSION = '0.17.0.pre'
4
+ VERSION = '0.20.0.pre'
5
5
  end
@@ -1,18 +1,14 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'rails/generators/active_record'
4
-
5
3
  module BeyondCanvas
6
4
  module Generators
7
5
  class ControllerGenerator < Rails::Generators::Base # :nodoc:
8
6
  desc 'Creates an inherited Beyond Canvas controller in the app/controllers folder'
9
7
 
10
- argument :scope, required: true, desc: 'The scope to create the controller, e.g. shops, users'
11
-
12
8
  source_root File.expand_path('templates', __dir__)
13
9
 
14
10
  def create_controller
15
- template 'controller.erb', "app/controllers/#{scope}_controller.rb"
11
+ template 'shops_controller.rb', "app/controllers/shops_controller.rb"
16
12
  end
17
13
  end
18
14
  end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- class <%= scope.camelize %>Controller < BeyondCanvas::AuthenticationsController
3
+ class ShopsController < BeyondCanvas::AuthenticationsController
4
4
  # before_action :configure_params, only: [:install]
5
5
 
6
6
  # def new
@@ -7,25 +7,25 @@
7
7
  <div class="menu--center">
8
8
 
9
9
  <%
10
- =begin
10
+ =begin %>
11
11
  Add here your menu links. You can use `menu__item` as class name and add
12
12
  `menu__item--selected` as secondary class for selected menu item. E.g:
13
13
 
14
14
  <%= link_to 'About us', about_us_path, class: "menu__item #{ 'menu__item--selected' if params[:controller] == 'about_us' }" %>
15
15
  <%= link_to 'Support', support_path, class: "menu__item #{ 'menu__item--selected' if params[:controller] == 'support' }" %>
16
- =end
17
- %>
16
+ <%
17
+ =end %>
18
18
 
19
19
  </div>
20
20
 
21
21
  <div class="menu--right">
22
22
 
23
23
  <%
24
- =begin
24
+ =begin %>
25
25
  You can also add here some content that will be right-aligned, like a user
26
26
  avatar image or a dropdown account menu.
27
- =end
28
- %>
27
+ <%
28
+ =end %>
29
29
 
30
30
  </div>
31
31
 
@@ -148,6 +148,19 @@
148
148
  // $notice-border-radius: 4px;
149
149
  // $notice-color: rgb(153, 153, 153);
150
150
 
151
+ // ************************************************************
152
+ // Status
153
+ // ************************************************************
154
+
155
+ // $status-good-background: rgb(205,225,165);
156
+ // $status-good-color: rgb(85,110,41);
157
+ // $status-warning-background: rgb(249,220,166);
158
+ // $status-warning-color: rgb(178,120,18);
159
+ // $status-danger-background: rgb(247,174,163);
160
+ // $status-danger-color: rgb(164,35,34);
161
+ // $status-neutral-background: rgb(224,223,205);
162
+ // $status-neutral-color: rgb(155,151,100);
163
+
151
164
  // ************************************************************
152
165
  // Breadcrums
153
166
  // ************************************************************
@@ -83,7 +83,7 @@ BeyondCanvas.setup do |config|
83
83
  #
84
84
  <% unless @skip_webpacker %># <% end %>config.skip_webpacker = <%= @skip_webpacker %>
85
85
 
86
- # ==> Authentication with ePages Beyond API
86
+ # ==> Database encryption
87
87
 
88
88
  config.encryption_key = '<%= SecureRandom.hex(32) %>'
89
89
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: beyond_canvas
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.17.0.pre
4
+ version: 0.20.0.pre
5
5
  platform: ruby
6
6
  authors:
7
7
  - Unai Abrisketa
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2020-09-30 00:00:00.000000000 Z
13
+ date: 2020-11-04 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: attr_encrypted
@@ -240,6 +240,7 @@ files:
240
240
  - app/assets/stylesheets/beyond_canvas/components/_debug.scss
241
241
  - app/assets/stylesheets/beyond_canvas/components/_flash.scss
242
242
  - app/assets/stylesheets/beyond_canvas/components/_forms.scss
243
+ - app/assets/stylesheets/beyond_canvas/components/_grids.scss
243
244
  - app/assets/stylesheets/beyond_canvas/components/_inputs.scss
244
245
  - app/assets/stylesheets/beyond_canvas/components/_layouts.scss
245
246
  - app/assets/stylesheets/beyond_canvas/components/_links.scss
@@ -250,8 +251,10 @@ files:
250
251
  - app/assets/stylesheets/beyond_canvas/components/_modals.scss
251
252
  - app/assets/stylesheets/beyond_canvas/components/_notices.scss
252
253
  - app/assets/stylesheets/beyond_canvas/components/_relative.scss
254
+ - app/assets/stylesheets/beyond_canvas/components/_scrollbox.scss
253
255
  - app/assets/stylesheets/beyond_canvas/components/_sidebar.scss
254
256
  - app/assets/stylesheets/beyond_canvas/components/_spinner.scss
257
+ - app/assets/stylesheets/beyond_canvas/components/_statuses.scss
255
258
  - app/assets/stylesheets/beyond_canvas/components/_tables.scss
256
259
  - app/assets/stylesheets/beyond_canvas/components/_texts.scss
257
260
  - app/assets/stylesheets/beyond_canvas/components/_titles.scss
@@ -273,8 +276,10 @@ files:
273
276
  - app/helpers/beyond_canvas/application_helper.rb
274
277
  - app/helpers/beyond_canvas/authentications_helper.rb
275
278
  - app/helpers/beyond_canvas/cockpit_app_helper.rb
279
+ - app/helpers/beyond_canvas/controller_helper.rb
276
280
  - app/helpers/beyond_canvas/debug_helper.rb
277
281
  - app/helpers/beyond_canvas/locale_switch_helper.rb
282
+ - app/helpers/beyond_canvas/statuses_helper.rb
278
283
  - app/javascript/beyond_canvas/base.js
279
284
  - app/javascript/beyond_canvas/initializers/buttons.js
280
285
  - app/javascript/beyond_canvas/initializers/flash.js
@@ -315,7 +320,7 @@ files:
315
320
  - lib/generators/beyond_canvas/assets/templates/beyond_canvas.scss
316
321
  - lib/generators/beyond_canvas/beyond_api/beyond_api_generator.rb
317
322
  - lib/generators/beyond_canvas/controller/controller_generator.rb
318
- - lib/generators/beyond_canvas/controller/templates/controller.erb
323
+ - lib/generators/beyond_canvas/controller/templates/shops_controller.rb
319
324
  - lib/generators/beyond_canvas/custom_menu/custom_menu_generator.rb
320
325
  - lib/generators/beyond_canvas/custom_menu/templates/beyond_canvas_custom_menu.html.erb
321
326
  - lib/generators/beyond_canvas/custom_styles/custom_styles_generator.rb