comfortable_mexican_sofa 2.0.18 → 2.0.19

Sign up to get free protection for your applications and to get access to all the features.
Files changed (137) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/.travis.yml +19 -14
  4. data/Gemfile +2 -2
  5. data/LICENSE +1 -1
  6. data/README.md +4 -2
  7. data/app/assets/config/manifest.js +0 -0
  8. data/app/assets/javascripts/comfy/admin/cms/application.js +1 -2
  9. data/app/assets/javascripts/comfy/vendor/bootstrap.bundle.min.js +7 -0
  10. data/app/assets/javascripts/comfy/vendor/bootstrap.bundle.min.js.map +1 -0
  11. data/app/assets/stylesheets/comfy/vendor/bootstrap/_alert.scss +1 -1
  12. data/app/assets/stylesheets/comfy/vendor/bootstrap/_badge.scss +8 -1
  13. data/app/assets/stylesheets/comfy/vendor/bootstrap/_breadcrumb.scss +0 -0
  14. data/app/assets/stylesheets/comfy/vendor/bootstrap/_button-group.scss +9 -18
  15. data/app/assets/stylesheets/comfy/vendor/bootstrap/_buttons.scss +9 -16
  16. data/app/assets/stylesheets/comfy/vendor/bootstrap/_card.scss +36 -48
  17. data/app/assets/stylesheets/comfy/vendor/bootstrap/_carousel.scss +37 -76
  18. data/app/assets/stylesheets/comfy/vendor/bootstrap/_close.scss +15 -8
  19. data/app/assets/stylesheets/comfy/vendor/bootstrap/_code.scss +5 -5
  20. data/app/assets/stylesheets/comfy/vendor/bootstrap/_custom-forms.scss +140 -54
  21. data/app/assets/stylesheets/comfy/vendor/bootstrap/_dropdown.scss +34 -9
  22. data/app/assets/stylesheets/comfy/vendor/bootstrap/_forms.scss +29 -34
  23. data/app/assets/stylesheets/comfy/vendor/bootstrap/_functions.scss +8 -8
  24. data/app/assets/stylesheets/comfy/vendor/bootstrap/_grid.scss +0 -0
  25. data/app/assets/stylesheets/comfy/vendor/bootstrap/_images.scss +2 -2
  26. data/app/assets/stylesheets/comfy/vendor/bootstrap/_input-group.scss +43 -8
  27. data/app/assets/stylesheets/comfy/vendor/bootstrap/_jumbotron.scss +1 -0
  28. data/app/assets/stylesheets/comfy/vendor/bootstrap/_list-group.scss +39 -5
  29. data/app/assets/stylesheets/comfy/vendor/bootstrap/_media.scss +0 -0
  30. data/app/assets/stylesheets/comfy/vendor/bootstrap/_mixins.scss +6 -0
  31. data/app/assets/stylesheets/comfy/vendor/bootstrap/_modal.scss +78 -17
  32. data/app/assets/stylesheets/comfy/vendor/bootstrap/_nav.scss +2 -0
  33. data/app/assets/stylesheets/comfy/vendor/bootstrap/_navbar.scss +9 -14
  34. data/app/assets/stylesheets/comfy/vendor/bootstrap/_pagination.scss +0 -5
  35. data/app/assets/stylesheets/comfy/vendor/bootstrap/_popover.scss +47 -59
  36. data/app/assets/stylesheets/comfy/vendor/bootstrap/_print.scss +1 -1
  37. data/app/assets/stylesheets/comfy/vendor/bootstrap/_progress.scss +15 -6
  38. data/app/assets/stylesheets/comfy/vendor/bootstrap/_reboot.scss +47 -44
  39. data/app/assets/stylesheets/comfy/vendor/bootstrap/_root.scss +0 -0
  40. data/app/assets/stylesheets/comfy/vendor/bootstrap/_spinners.scss +55 -0
  41. data/app/assets/stylesheets/comfy/vendor/bootstrap/_tables.scss +5 -8
  42. data/app/assets/stylesheets/comfy/vendor/bootstrap/_toasts.scss +44 -0
  43. data/app/assets/stylesheets/comfy/vendor/bootstrap/_tooltip.scss +1 -1
  44. data/app/assets/stylesheets/comfy/vendor/bootstrap/_transitions.scss +0 -2
  45. data/app/assets/stylesheets/comfy/vendor/bootstrap/_type.scss +16 -16
  46. data/app/assets/stylesheets/comfy/vendor/bootstrap/_utilities.scss +2 -0
  47. data/app/assets/stylesheets/comfy/vendor/bootstrap/_variables.scss +371 -177
  48. data/app/assets/stylesheets/comfy/vendor/bootstrap/bootstrap-grid.scss +4 -7
  49. data/app/assets/stylesheets/comfy/vendor/bootstrap/bootstrap-reboot.scss +3 -3
  50. data/app/assets/stylesheets/comfy/vendor/bootstrap/bootstrap.scss +5 -3
  51. data/app/assets/stylesheets/comfy/vendor/bootstrap/mixins/_alert.scss +0 -0
  52. data/app/assets/stylesheets/comfy/vendor/bootstrap/mixins/_background-variant.scss +0 -0
  53. data/app/assets/stylesheets/comfy/vendor/bootstrap/mixins/_badge.scss +7 -2
  54. data/app/assets/stylesheets/comfy/vendor/bootstrap/mixins/_border-radius.scss +29 -1
  55. data/app/assets/stylesheets/comfy/vendor/bootstrap/mixins/_box-shadow.scss +16 -1
  56. data/app/assets/stylesheets/comfy/vendor/bootstrap/mixins/_breakpoints.scss +3 -3
  57. data/app/assets/stylesheets/comfy/vendor/bootstrap/mixins/_buttons.scss +12 -14
  58. data/app/assets/stylesheets/comfy/vendor/bootstrap/mixins/_caret.scss +4 -8
  59. data/app/assets/stylesheets/comfy/vendor/bootstrap/mixins/_clearfix.scss +0 -0
  60. data/app/assets/stylesheets/comfy/vendor/bootstrap/mixins/_deprecate.scss +10 -0
  61. data/app/assets/stylesheets/comfy/vendor/bootstrap/mixins/_float.scss +3 -0
  62. data/app/assets/stylesheets/comfy/vendor/bootstrap/mixins/_forms.scss +58 -13
  63. data/app/assets/stylesheets/comfy/vendor/bootstrap/mixins/_gradients.scss +0 -0
  64. data/app/assets/stylesheets/comfy/vendor/bootstrap/mixins/_grid-framework.scss +3 -4
  65. data/app/assets/stylesheets/comfy/vendor/bootstrap/mixins/_grid.scss +9 -10
  66. data/app/assets/stylesheets/comfy/vendor/bootstrap/mixins/_hover.scss +1 -1
  67. data/app/assets/stylesheets/comfy/vendor/bootstrap/mixins/_image.scss +2 -2
  68. data/app/assets/stylesheets/comfy/vendor/bootstrap/mixins/_list-group.scss +0 -0
  69. data/app/assets/stylesheets/comfy/vendor/bootstrap/mixins/_lists.scss +0 -0
  70. data/app/assets/stylesheets/comfy/vendor/bootstrap/mixins/_nav-divider.scss +0 -0
  71. data/app/assets/stylesheets/comfy/vendor/bootstrap/mixins/_pagination.scss +1 -1
  72. data/app/assets/stylesheets/comfy/vendor/bootstrap/mixins/_reset-text.scss +1 -1
  73. data/app/assets/stylesheets/comfy/vendor/bootstrap/mixins/_resize.scss +0 -0
  74. data/app/assets/stylesheets/comfy/vendor/bootstrap/mixins/_screen-reader.scss +0 -0
  75. data/app/assets/stylesheets/comfy/vendor/bootstrap/mixins/_size.scss +1 -0
  76. data/app/assets/stylesheets/comfy/vendor/bootstrap/mixins/_table-row.scss +10 -1
  77. data/app/assets/stylesheets/comfy/vendor/bootstrap/mixins/_text-emphasis.scss +5 -3
  78. data/app/assets/stylesheets/comfy/vendor/bootstrap/mixins/_text-hide.scss +1 -3
  79. data/app/assets/stylesheets/comfy/vendor/bootstrap/mixins/_text-truncate.scss +0 -0
  80. data/app/assets/stylesheets/comfy/vendor/bootstrap/mixins/_transition.scss +5 -2
  81. data/app/assets/stylesheets/comfy/vendor/bootstrap/mixins/_visibility.scss +1 -0
  82. data/app/assets/stylesheets/comfy/vendor/bootstrap/utilities/_align.scss +0 -0
  83. data/app/assets/stylesheets/comfy/vendor/bootstrap/utilities/_background.scss +0 -0
  84. data/app/assets/stylesheets/comfy/vendor/bootstrap/utilities/_borders.scss +17 -1
  85. data/app/assets/stylesheets/comfy/vendor/bootstrap/utilities/_clearfix.scss +0 -0
  86. data/app/assets/stylesheets/comfy/vendor/bootstrap/utilities/_display.scss +6 -18
  87. data/app/assets/stylesheets/comfy/vendor/bootstrap/utilities/_embed.scss +7 -20
  88. data/app/assets/stylesheets/comfy/vendor/bootstrap/utilities/_flex.scss +0 -0
  89. data/app/assets/stylesheets/comfy/vendor/bootstrap/utilities/_float.scss +5 -3
  90. data/app/assets/stylesheets/comfy/vendor/bootstrap/utilities/_overflow.scss +5 -0
  91. data/app/assets/stylesheets/comfy/vendor/bootstrap/utilities/_position.scss +0 -5
  92. data/app/assets/stylesheets/comfy/vendor/bootstrap/utilities/_screenreaders.scss +0 -0
  93. data/app/assets/stylesheets/comfy/vendor/bootstrap/utilities/_shadows.scss +0 -0
  94. data/app/assets/stylesheets/comfy/vendor/bootstrap/utilities/_sizing.scss +8 -0
  95. data/app/assets/stylesheets/comfy/vendor/bootstrap/utilities/_spacing.scss +23 -1
  96. data/app/assets/stylesheets/comfy/vendor/bootstrap/utilities/_stretched-link.scss +19 -0
  97. data/app/assets/stylesheets/comfy/vendor/bootstrap/utilities/_text.scss +19 -5
  98. data/app/assets/stylesheets/comfy/vendor/bootstrap/utilities/_visibility.scss +4 -2
  99. data/app/assets/stylesheets/comfy/vendor/bootstrap/vendor/_rfs.scss +204 -0
  100. data/app/models/comfy/cms/file.rb +6 -1
  101. data/app/models/comfy/cms/fragment.rb +6 -2
  102. data/app/models/comfy/cms/layout.rb +16 -8
  103. data/app/models/comfy/cms/page.rb +12 -17
  104. data/app/views/comfy/admin/cms/files/index.html.haml +4 -2
  105. data/app/views/comfy/admin/cms/pages/_form.html.haml +2 -2
  106. data/app/views/comfy/admin/cms/pages/index.html.haml +2 -2
  107. data/config/locales/ar.yml +262 -0
  108. data/config/locales/ca.yml +0 -1
  109. data/config/locales/cs.yml +0 -1
  110. data/config/locales/da.yml +0 -1
  111. data/config/locales/de.yml +60 -61
  112. data/config/locales/en.yml +0 -1
  113. data/config/locales/es.yml +0 -1
  114. data/config/locales/fi.yml +0 -1
  115. data/config/locales/fr.yml +0 -1
  116. data/config/locales/gr.yml +0 -1
  117. data/config/locales/hr.yml +262 -0
  118. data/config/locales/it.yml +0 -1
  119. data/config/locales/ja.yml +0 -1
  120. data/config/locales/nb.yml +0 -1
  121. data/config/locales/nl.yml +0 -1
  122. data/config/locales/pl.yml +0 -1
  123. data/config/locales/pt-BR.yml +0 -1
  124. data/config/locales/ru.yml +0 -1
  125. data/config/locales/sk.yml +0 -1
  126. data/config/locales/sv.yml +0 -1
  127. data/config/locales/tr.yml +0 -1
  128. data/config/locales/uk.yml +0 -1
  129. data/config/locales/zh-CN.yml +0 -1
  130. data/config/locales/zh-TW.yml +0 -1
  131. data/lib/comfortable_mexican_sofa/configuration.rb +2 -0
  132. data/lib/comfortable_mexican_sofa/seeds.rb +6 -2
  133. data/lib/comfortable_mexican_sofa/version.rb +1 -1
  134. data/lib/tasks/cms_seeds.rake +7 -7
  135. metadata +15 -5
  136. data/app/assets/javascripts/comfy/vendor/bootstrap.min.js +0 -7
  137. data/app/assets/javascripts/comfy/vendor/popper.min.js +0 -6
@@ -0,0 +1,204 @@
1
+ // stylelint-disable property-blacklist, scss/dollar-variable-default
2
+
3
+ // SCSS RFS mixin
4
+ //
5
+ // Automated font-resizing
6
+ //
7
+ // See https://github.com/twbs/rfs
8
+
9
+ // Configuration
10
+
11
+ // Base font size
12
+ $rfs-base-font-size: 1.25rem !default;
13
+ $rfs-font-size-unit: rem !default;
14
+
15
+ // Breakpoint at where font-size starts decreasing if screen width is smaller
16
+ $rfs-breakpoint: 1200px !default;
17
+ $rfs-breakpoint-unit: px !default;
18
+
19
+ // Resize font-size based on screen height and width
20
+ $rfs-two-dimensional: false !default;
21
+
22
+ // Factor of decrease
23
+ $rfs-factor: 10 !default;
24
+
25
+ @if type-of($rfs-factor) != "number" or $rfs-factor <= 1 {
26
+ @error "`#{$rfs-factor}` is not a valid $rfs-factor, it must be greater than 1.";
27
+ }
28
+
29
+ // Generate enable or disable classes. Possibilities: false, "enable" or "disable"
30
+ $rfs-class: false !default;
31
+
32
+ // 1 rem = $rfs-rem-value px
33
+ $rfs-rem-value: 16 !default;
34
+
35
+ // Safari iframe resize bug: https://github.com/twbs/rfs/issues/14
36
+ $rfs-safari-iframe-resize-bug-fix: false !default;
37
+
38
+ // Disable RFS by setting $enable-responsive-font-sizes to false
39
+ $enable-responsive-font-sizes: true !default;
40
+
41
+ // Cache $rfs-base-font-size unit
42
+ $rfs-base-font-size-unit: unit($rfs-base-font-size);
43
+
44
+ // Remove px-unit from $rfs-base-font-size for calculations
45
+ @if $rfs-base-font-size-unit == "px" {
46
+ $rfs-base-font-size: $rfs-base-font-size / ($rfs-base-font-size * 0 + 1);
47
+ }
48
+ @else if $rfs-base-font-size-unit == "rem" {
49
+ $rfs-base-font-size: $rfs-base-font-size / ($rfs-base-font-size * 0 + 1 / $rfs-rem-value);
50
+ }
51
+
52
+ // Cache $rfs-breakpoint unit to prevent multiple calls
53
+ $rfs-breakpoint-unit-cache: unit($rfs-breakpoint);
54
+
55
+ // Remove unit from $rfs-breakpoint for calculations
56
+ @if $rfs-breakpoint-unit-cache == "px" {
57
+ $rfs-breakpoint: $rfs-breakpoint / ($rfs-breakpoint * 0 + 1);
58
+ }
59
+ @else if $rfs-breakpoint-unit-cache == "rem" or $rfs-breakpoint-unit-cache == "em" {
60
+ $rfs-breakpoint: $rfs-breakpoint / ($rfs-breakpoint * 0 + 1 / $rfs-rem-value);
61
+ }
62
+
63
+ // Responsive font-size mixin
64
+ @mixin rfs($fs, $important: false) {
65
+ // Cache $fs unit
66
+ $fs-unit: if(type-of($fs) == "number", unit($fs), false);
67
+
68
+ // Add !important suffix if needed
69
+ $rfs-suffix: if($important, " !important", "");
70
+
71
+ // If $fs isn't a number (like inherit) or $fs has a unit (not px or rem, like 1.5em) or $ is 0, just print the value
72
+ @if not $fs-unit or $fs-unit != "" and $fs-unit != "px" and $fs-unit != "rem" or $fs == 0 {
73
+ font-size: #{$fs}#{$rfs-suffix};
74
+ }
75
+ @else {
76
+ // Variables for storing static and fluid rescaling
77
+ $rfs-static: null;
78
+ $rfs-fluid: null;
79
+
80
+ // Remove px-unit from $fs for calculations
81
+ @if $fs-unit == "px" {
82
+ $fs: $fs / ($fs * 0 + 1);
83
+ }
84
+ @else if $fs-unit == "rem" {
85
+ $fs: $fs / ($fs * 0 + 1 / $rfs-rem-value);
86
+ }
87
+
88
+ // Set default font-size
89
+ @if $rfs-font-size-unit == rem {
90
+ $rfs-static: #{$fs / $rfs-rem-value}rem#{$rfs-suffix};
91
+ }
92
+ @else if $rfs-font-size-unit == px {
93
+ $rfs-static: #{$fs}px#{$rfs-suffix};
94
+ }
95
+ @else {
96
+ @error "`#{$rfs-font-size-unit}` is not a valid unit for $rfs-font-size-unit. Use `px` or `rem`.";
97
+ }
98
+
99
+ // Only add media query if font-size is bigger as the minimum font-size
100
+ // If $rfs-factor == 1, no rescaling will take place
101
+ @if $fs > $rfs-base-font-size and $enable-responsive-font-sizes {
102
+ $min-width: null;
103
+ $variable-unit: null;
104
+
105
+ // Calculate minimum font-size for given font-size
106
+ $fs-min: $rfs-base-font-size + ($fs - $rfs-base-font-size) / $rfs-factor;
107
+
108
+ // Calculate difference between given font-size and minimum font-size for given font-size
109
+ $fs-diff: $fs - $fs-min;
110
+
111
+ // Base font-size formatting
112
+ // No need to check if the unit is valid, because we did that before
113
+ $min-width: if($rfs-font-size-unit == rem, #{$fs-min / $rfs-rem-value}rem, #{$fs-min}px);
114
+
115
+ // If two-dimensional, use smallest of screen width and height
116
+ $variable-unit: if($rfs-two-dimensional, vmin, vw);
117
+
118
+ // Calculate the variable width between 0 and $rfs-breakpoint
119
+ $variable-width: #{$fs-diff * 100 / $rfs-breakpoint}#{$variable-unit};
120
+
121
+ // Set the calculated font-size.
122
+ $rfs-fluid: calc(#{$min-width} + #{$variable-width}) #{$rfs-suffix};
123
+ }
124
+
125
+ // Rendering
126
+ @if $rfs-fluid == null {
127
+ // Only render static font-size if no fluid font-size is available
128
+ font-size: $rfs-static;
129
+ }
130
+ @else {
131
+ $mq-value: null;
132
+
133
+ // RFS breakpoint formatting
134
+ @if $rfs-breakpoint-unit == em or $rfs-breakpoint-unit == rem {
135
+ $mq-value: #{$rfs-breakpoint / $rfs-rem-value}#{$rfs-breakpoint-unit};
136
+ }
137
+ @else if $rfs-breakpoint-unit == px {
138
+ $mq-value: #{$rfs-breakpoint}px;
139
+ }
140
+ @else {
141
+ @error "`#{$rfs-breakpoint-unit}` is not a valid unit for $rfs-breakpoint-unit. Use `px`, `em` or `rem`.";
142
+ }
143
+
144
+ @if $rfs-class == "disable" {
145
+ // Adding an extra class increases specificity,
146
+ // which prevents the media query to override the font size
147
+ &,
148
+ .disable-responsive-font-size &,
149
+ &.disable-responsive-font-size {
150
+ font-size: $rfs-static;
151
+ }
152
+ }
153
+ @else {
154
+ font-size: $rfs-static;
155
+ }
156
+
157
+ @if $rfs-two-dimensional {
158
+ @media (max-width: #{$mq-value}), (max-height: #{$mq-value}) {
159
+ @if $rfs-class == "enable" {
160
+ .enable-responsive-font-size &,
161
+ &.enable-responsive-font-size {
162
+ font-size: $rfs-fluid;
163
+ }
164
+ }
165
+ @else {
166
+ font-size: $rfs-fluid;
167
+ }
168
+
169
+ @if $rfs-safari-iframe-resize-bug-fix {
170
+ // stylelint-disable-next-line length-zero-no-unit
171
+ min-width: 0vw;
172
+ }
173
+ }
174
+ }
175
+ @else {
176
+ @media (max-width: #{$mq-value}) {
177
+ @if $rfs-class == "enable" {
178
+ .enable-responsive-font-size &,
179
+ &.enable-responsive-font-size {
180
+ font-size: $rfs-fluid;
181
+ }
182
+ }
183
+ @else {
184
+ font-size: $rfs-fluid;
185
+ }
186
+
187
+ @if $rfs-safari-iframe-resize-bug-fix {
188
+ // stylelint-disable-next-line length-zero-no-unit
189
+ min-width: 0vw;
190
+ }
191
+ }
192
+ }
193
+ }
194
+ }
195
+ }
196
+
197
+ // The font-size & responsive-font-size mixin uses RFS to rescale font sizes
198
+ @mixin font-size($fs, $important: false) {
199
+ @include rfs($fs, $important);
200
+ }
201
+
202
+ @mixin responsive-font-size($fs, $important: false) {
203
+ @include rfs($fs, $important);
204
+ }
@@ -23,7 +23,12 @@ class Comfy::Cms::File < ActiveRecord::Base
23
23
  # -- Callbacks ---------------------------------------------------------------
24
24
  before_validation :assign_label, on: :create
25
25
  before_create :assign_position
26
- after_save :process_attachment
26
+ # active_storage attachment behavior changed in rails 6 - see PR#892 for details
27
+ if Rails::VERSION::MAJOR >= 6
28
+ before_save :process_attachment
29
+ else
30
+ after_save :process_attachment
31
+ end
27
32
 
28
33
  # -- Validations -------------------------------------------------------------
29
34
  validates :label, presence: true
@@ -11,8 +11,12 @@ class Comfy::Cms::Fragment < ActiveRecord::Base
11
11
  attr_reader :files
12
12
 
13
13
  # -- Callbacks ---------------------------------------------------------------
14
- after_save :remove_attachments,
15
- :add_attachments
14
+ # active_storage attachment behavior changed in rails 6 - see PR#892 for details
15
+ if Rails::VERSION::MAJOR >= 6
16
+ before_save :remove_attachments, :add_attachments
17
+ else
18
+ after_save :remove_attachments, :add_attachments
19
+ end
16
20
 
17
21
  # -- Relationships -----------------------------------------------------------
18
22
  belongs_to :record, polymorphic: true, touch: true
@@ -29,16 +29,24 @@ class Comfy::Cms::Layout < ActiveRecord::Base
29
29
 
30
30
  # -- Class Methods -----------------------------------------------------------
31
31
  # Tree-like structure for layouts
32
- def self.options_for_select(site, layout = nil, current_layout = nil, depth = 0, spacer = ". . ")
33
- out = []
34
- [current_layout || site.layouts.roots.order(:position)].flatten.each do |l|
35
- next if layout == l
36
- out << ["#{spacer * depth}#{l.label}", l.id]
37
- l.children.order(:position).each do |child|
38
- out += options_for_select(site, layout, child, depth + 1, spacer)
32
+ def self.options_for_select(site, current_layout = nil)
33
+ options = []
34
+
35
+ options_for_layout = ->(layout, depth = 0) do
36
+ return if layout == current_layout
37
+
38
+ options << ["#{'. . ' * depth}#{layout.label}", layout.id]
39
+
40
+ layout.children.order(:position).each do |child_layout|
41
+ options_for_layout.call(child_layout, depth + 1)
39
42
  end
40
43
  end
41
- out.compact
44
+
45
+ site.layouts.roots.order(:position).each do |layout|
46
+ options_for_layout.call(layout)
47
+ end
48
+
49
+ options
42
50
  end
43
51
 
44
52
  # List of available application layouts
@@ -47,28 +47,23 @@ class Comfy::Cms::Page < ActiveRecord::Base
47
47
 
48
48
  # -- Class Methods -----------------------------------------------------------
49
49
  # Tree-like structure for pages
50
- def self.options_for_select(site:, page: nil, current_page: nil, depth: 0, exclude_self: true, spacer: ". . ")
51
- return [] if (current_page ||= site.pages.root) == page && exclude_self || !current_page
52
- out = []
50
+ def self.options_for_select(site:, current_page: nil, exclude_self: false)
51
+ options = []
53
52
 
54
- unless current_page == page
55
- out << ["#{spacer * depth}#{current_page.label}", current_page.id]
56
- end
53
+ options_for_page = ->(page, depth = 0) do
54
+ return if page.nil?
55
+ return if exclude_self && page == current_page
56
+
57
+ options << ["#{'. . ' * depth}#{page.label}", page.id]
57
58
 
58
- if current_page.children_count.nonzero?
59
- current_page.children.each do |child|
60
- out += options_for_select(
61
- site: site,
62
- page: page,
63
- current_page: child,
64
- depth: depth + 1,
65
- exclude_self: exclude_self,
66
- spacer: spacer
67
- )
59
+ page.children.order(:position).each do |child_page|
60
+ options_for_page.call(child_page, depth + 1)
68
61
  end
69
62
  end
70
63
 
71
- out.compact
64
+ options_for_page.call(site.pages.root)
65
+
66
+ options
72
67
  end
73
68
 
74
69
  # -- Instance Methods --------------------------------------------------------
@@ -2,11 +2,13 @@
2
2
  = render "comfy/admin/cms/categories/index", type: "Comfy::Cms::File"
3
3
 
4
4
  :ruby
5
+ session_id = request.session_options[:id]
6
+ session_id_value = session_id.respond_to?(:public_id) ? session_id.public_id : session_id.to_s
5
7
  cms_uploader_data = {
6
8
  cms_uploader: {
7
9
  url: comfy_admin_cms_site_files_path(@site, source: :plupload, categories: params[:categories]),
8
- token: {name: request_forgery_protection_token, value: form_authenticity_token},
9
- session: {name: Rails.application.config.session_options[:key], value: request.session_options[:id]}
10
+ token: { name: request_forgery_protection_token, value: form_authenticity_token },
11
+ session: { name: Rails.application.config.session_options[:key], value: session_id_value }
10
12
  }
11
13
  }
12
14
 
@@ -5,7 +5,7 @@
5
5
  - if @page.parent.present?
6
6
  = form.text_field :slug, data: { slug: true }, prepend: @page.parent.full_path
7
7
 
8
- - if (options = ::Comfy::Cms::Page.options_for_select(site: @site, page: @page, exclude_self: true)).present?
8
+ - if (options = ::Comfy::Cms::Page.options_for_select(site: @site, current_page: @page, exclude_self: true)).present?
9
9
  = form.select :parent_id, options, bootstrap: {custom_control: true}
10
10
 
11
11
  - if (options = ::Comfy::Cms::Layout.options_for_select(@site)).present?
@@ -18,7 +18,7 @@
18
18
 
19
19
  = render "comfy/admin/cms/categories/form", form: form
20
20
 
21
- - if (options = ::Comfy::Cms::Page.options_for_select(site: @site, page: @page)).present?
21
+ - if (options = ::Comfy::Cms::Page.options_for_select(site: @site, current_page: @page)).present?
22
22
  = form.select :target_page_id, [["---- #{t('.select_target_page')} ----", nil]] + options, bootstrap: {custom_control: true}
23
23
 
24
24
  = form.check_box :is_published
@@ -5,9 +5,9 @@
5
5
  = link_to t('.new_link'), new_comfy_admin_cms_site_page_path(@site), class: "btn btn-secondary float-right"
6
6
  %h2= t('.title')
7
7
 
8
- = comfy_admin_partial "comfy/admin/cms/partials/pages_beforea"
8
+ = comfy_admin_partial "comfy/admin/cms/partials/pages_before"
9
9
 
10
10
  %ul.list.sortable
11
11
  = render partial: "index_branch", collection: @pages
12
12
 
13
- = comfy_admin_partial "comfy/admin/cms/partials/pages_after"
13
+ = comfy_admin_partial "comfy/admin/cms/partials/pages_after"
@@ -0,0 +1,262 @@
1
+ ar:
2
+ activerecord:
3
+ models:
4
+ comfy/cms/site: الموقع
5
+ comfy/cms/layout: تصميم
6
+ comfy/cms/page: الصفحة
7
+ comfy/cms/snippet: قصاصة
8
+ comfy/cms/file: ملف
9
+ comfy/cms/translation: الترجمة
10
+
11
+ attributes:
12
+ comfy/cms/site:
13
+ identifier: المعرّف
14
+ label: عنوان
15
+ hostname: اسم مضيف الموقع
16
+ path: مسار
17
+ locale: اللغة
18
+ comfy/cms/layout:
19
+ identifier: المعرّف
20
+ label: اسم التخطيط
21
+ app_layout: التصميم
22
+ parent_id: التخطيط الرئيسي
23
+ content: المحتوى
24
+ css: أوراق الأنماط
25
+ js: جافا سكريبت
26
+ comfy/cms/page:
27
+ label: عنوان
28
+ layout_id: تصميم
29
+ slug: كلمة الدلالة
30
+ full_path: المسار الكامل
31
+ parent_id: الآب
32
+ target_page_id: إعادة توجيه الي
33
+ content: المحتوى
34
+ is_published: نشرت
35
+ comfy/cms/file:
36
+ label: عنوان
37
+ file: ملف
38
+ description: الوصف
39
+ comfy/cms/snippet:
40
+ label: عنوان
41
+ identifier: المعرّف
42
+ content: المحتوى
43
+ comfy/cms/translation:
44
+ locale: اللغة
45
+ label: عنوان
46
+ layout_id: تصميم
47
+ is_published: نشرت
48
+
49
+ comfy:
50
+ cms:
51
+ content:
52
+ site_not_found: غير موجود
53
+ layout_not_found: تخطيط غير موجود
54
+ page_not_found: الصفحة غير موجودة
55
+
56
+ admin:
57
+ cms:
58
+ base:
59
+ site_not_found: غير موجود
60
+ seeds_enabled: يتم تمكين بذور CMS. سيتم تجاهل جميع التغييرات التي أجريت هنا.
61
+ sites: المواقع الخاصة بي
62
+ layouts: مخطط
63
+ pages: الصفحات
64
+ snippets: مقتطفات
65
+ files: ملفات
66
+
67
+ sites:
68
+ created: موقع جديد تم انشاءه
69
+ creation_failure: فشل في إنشاء الموقع
70
+ updated: تحديث الموقع
71
+ update_failure: فشل في تحديث الموقع
72
+ deleted: تم الحذف
73
+ not_found: غير موجود
74
+
75
+ index:
76
+ title: المواقع الخاصة بي
77
+ new_link: إنشاء جديد
78
+ select: اختيار الموقع
79
+ edit: تعديل
80
+ delete: حذف
81
+ are_you_sure: هل أنت متأكد أنك تريد حذف هذا؟
82
+ new:
83
+ title: موقع جديد
84
+ edit:
85
+ title: تعديل
86
+ form:
87
+ create: إنشاء موقع
88
+ cancel: إلغاء
89
+ update: تحديث الموقع
90
+
91
+ layouts:
92
+ created: إنشاء تخطيط
93
+ creation_failure: لا يمكن إنشاء النسق
94
+ updated: تم تحديث التصميم
95
+ update_failure: فشل في تحديث التصميم
96
+ deleted: تم حذف التصميم
97
+ not_found: تخطيط غير موجود
98
+
99
+ index:
100
+ title: مخطط
101
+ new_link: إنشاء تخطيط جديد
102
+ index_branch:
103
+ add_child_layout: إضافة تخطيط الطفل
104
+ edit: تعديل
105
+ delete: حذف
106
+ are_you_sure: هل أنت متاكد؟
107
+ new:
108
+ title: تصميم جديد
109
+ edit:
110
+ title: تحرير التخطيط
111
+ form:
112
+ select_parent_layout: التخطيط الرئيسي
113
+ select_app_layout: حدد تخطيط التطبيق
114
+ create: انشاء تصميم
115
+ cancel: إلغاء
116
+ update: تحديث التخطيط
117
+
118
+ pages:
119
+ created: تم إنشاء الصفحة
120
+ creation_failure: فشل في إنشاء الصفحة
121
+ updated: تحديث الصفحة
122
+ update_failure: فشل في تحديث الصفحة
123
+ deleted: تم حذف الصفحة
124
+ not_found: الصفحة غير موجودة
125
+ layout_not_found: لم يتم العثور على تخطيطات يرجى إنشاء واحد.
126
+
127
+ index:
128
+ title: الصفحات
129
+ new_link: إنشاء صفحة جديدة
130
+ index_branch:
131
+ toggle: تبديل
132
+ add_child_page: أضف صفحة فرعية
133
+ edit: تعديل
134
+ delete: حذف
135
+ are_you_sure: هل أنت متاكد؟
136
+ new:
137
+ title: صفحة جديدة
138
+ edit:
139
+ title: تعديل
140
+ form:
141
+ select_target_page: لا إعادة توجيه
142
+ preview: معاينة
143
+ create: إنشاء صفحة
144
+ cancel: إلغاء
145
+ update: تحديث الصفحة
146
+ choose_link: اختر الصفحة...
147
+
148
+ fragments:
149
+ form_fragments:
150
+ no_tags: |-
151
+ لا يحتوي التخطيط على علامات محتوى محددة.<br/>
152
+ تحرير محتوى تخطيط لتضمين علامة التجزئة. فمثلا: <code>{{cms:wysiwyg content}}</code>
153
+
154
+ translations:
155
+ created: تم إنشاء الترجمة
156
+ creation_failure: فشل في إنشاء الترجمة
157
+ updated: تم تحديث الترجمة
158
+ update_failure: فشل في تحديث الترجمة
159
+ deleted: تم حذف الترجمة
160
+ not_found: لم يتم العثور على الترجمة
161
+
162
+ new:
163
+ title: ترجمة جديدة
164
+ edit:
165
+ title: تحرير الترجمة
166
+ form:
167
+ preview: معاينة
168
+ create: إنشاء
169
+ update: تحديث
170
+ cancel: الرجوع إلى
171
+ sidebar:
172
+ new: ترجمة جديدة
173
+ confirm: هل أنت متاكد؟
174
+
175
+ snippets:
176
+ created: تم إنشاء مقتطف
177
+ creation_failure: فشل في إنشاء مقتطف
178
+ updated: تم تحديث المقتطف
179
+ update_failure: فشل تحديث المقتطف
180
+ deleted: تم حذف المقتطف
181
+ not_found: مقتطف غير موجود
182
+
183
+ index:
184
+ title: مقتطفات
185
+ new_link: إنشاء مقتطف جديد
186
+ edit: تعديل
187
+ delete: حذف
188
+ are_you_sure: هل أنت متاكد؟
189
+ new:
190
+ title: مقتطف جديد
191
+ edit:
192
+ title: تحرير مقتطف
193
+ form:
194
+ create: إنشاء مقتطف جديد
195
+ cancel: إلغاء
196
+ update: تحديث مقتطف
197
+
198
+ revisions:
199
+ reverted: محتوى عاد
200
+ record_not_found: لم يتم العثور على السجل
201
+ not_found: لم يتم العثور على المراجعة
202
+
203
+ show:
204
+ title: مراجعات لـ
205
+ revision: الإصدار
206
+ update: تحديث لهذا المراجعة
207
+ cancel: إلغاء
208
+ content: المحتوى
209
+ changes: التغييرات
210
+ previous: السابق
211
+ current: الحالي
212
+ sidebar:
213
+ revision:
214
+ zero: لا مراجعات
215
+ one: '٪ {count} المراجعة'
216
+ few: '٪ {count} المراجعات'
217
+ many: '٪ {count} المراجعات'
218
+ other: '٪ {count} المراجعات'
219
+
220
+ files:
221
+ created: الملفات المحملة
222
+ creation_failure: فشل تحميل الملفات
223
+ updated: تم تحديث الملف
224
+ update_failure: فشل في تحديث الملف
225
+ deleted: تم حذف الملف‬
226
+ not_found: لم يتم العثور على الملف
227
+
228
+ index:
229
+ title: ملفات
230
+ new_link: رفع ملف جديد
231
+ button: رفع الملفات
232
+ new:
233
+ title: ملف جديد
234
+ edit:
235
+ title: تعديل
236
+ form:
237
+ current_file: الملف الحالي
238
+ create: رفع ملف
239
+ cancel: إلغاء
240
+ update: تحديث الملف
241
+ delete: حذف الملف
242
+ are_you_sure: هل أنت متاكد؟
243
+ page_form:
244
+ are_you_sure: هل أنت متاكد؟
245
+ file:
246
+ edit: تعديل
247
+ delete: حذف
248
+ are_you_sure: هل أنت متاكد؟
249
+
250
+ categories:
251
+ index:
252
+ edit: تعديل
253
+ done: تم
254
+ all: كل الفئات
255
+ add: إضافة
256
+ add_placeholder: إضافة فئة
257
+ show:
258
+ are_you_sure: هل أنت متاكد؟
259
+ edit:
260
+ save: حفظ
261
+ form:
262
+ label: الفئات