breeze_cms 1.0.0 → 1.0.2
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.
- checksums.yaml +4 -4
- data/app/assets/stylesheets/breeze/breeze.css +396 -390
- data/app/assets/stylesheets/breeze/breeze.email.css +288 -283
- data/app/assets/stylesheets/breeze_tailwind_styles.css +5 -1
- data/app/controllers/breeze/images_controller.rb +14 -4
- data/app/controllers/breeze/pages_controller.rb +3 -10
- data/app/controllers/breeze/view_controller.rb +6 -1
- data/app/models/breeze/active_yaml.rb +23 -0
- data/app/models/breeze/image.rb +30 -20
- data/app/views/breeze/images/_editor.haml +12 -0
- data/app/views/breeze/images/show.haml +25 -10
- data/app/views/breeze/view/cards/_card_normal_round.haml +1 -1
- data/app/views/breeze/view/page.haml +2 -0
- data/config/breeze/option_definitions.yml +7 -2
- data/config/breeze/page_styles.yml +4 -2
- data/config/initializers/simple_form_tailwind.rb +148 -0
- data/lib/breeze/engine.rb +8 -5
- data/lib/breeze/version.rb +1 -1
- metadata +23 -37
- data/config/initializers/simple_form.rb +0 -212
@@ -1,212 +0,0 @@
|
|
1
|
-
require "simple_form"
|
2
|
-
|
3
|
-
# frozen_string_literal: true
|
4
|
-
#
|
5
|
-
# Uncomment this and change the path if necessary to include your own
|
6
|
-
# components.
|
7
|
-
# See https://github.com/heartcombo/simple_form#custom-components to know
|
8
|
-
# more about custom components.
|
9
|
-
# Dir[Rails.root.join('lib/components/**/*.rb')].each { |f| require f }
|
10
|
-
#
|
11
|
-
# Use this setup block to configure all options available in SimpleForm.
|
12
|
-
SimpleForm.setup do |config|
|
13
|
-
# Wrappers are used by the form builder to generate a
|
14
|
-
# complete input. You can remove any component from the
|
15
|
-
# wrapper, change the order or even add your own to the
|
16
|
-
# stack. The options given below are used to wrap the
|
17
|
-
# whole input.
|
18
|
-
|
19
|
-
config.wrappers :default, tag: 'div', class: 'mt-4', error_class: '', valid_class: '' do |b|
|
20
|
-
b.use :html5
|
21
|
-
b.use :placeholder
|
22
|
-
b.optional :maxlength
|
23
|
-
b.optional :minlength
|
24
|
-
b.optional :pattern
|
25
|
-
b.optional :min_max
|
26
|
-
b.optional :readonly
|
27
|
-
|
28
|
-
b.use :label, class: "block text-sm font-medium text-gray-700"
|
29
|
-
b.use :input,
|
30
|
-
class: 'appearance-none block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm placeholder-gray-400 focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm',
|
31
|
-
error_class: 'block w-full pr-10 border-red-300 text-red-900 placeholder-red-300 focus:outline-none focus:ring-red-500 focus:border-red-500 sm:text-sm rounded-md'
|
32
|
-
b.use :full_error, wrap_with: { tag: 'p', class: 'mt-2 text-sm text-red-600' }
|
33
|
-
b.use :hint, wrap_with: { tag: :p, class: "mt-2 text-sm text-gray-500" }
|
34
|
-
end
|
35
|
-
|
36
|
-
config.wrappers :prepend_string, tag: 'div', class: '', error_class: '', valid_class: '' do |b|
|
37
|
-
b.use :html5
|
38
|
-
b.use :placeholder
|
39
|
-
b.optional :maxlength
|
40
|
-
b.optional :minlength
|
41
|
-
b.optional :pattern
|
42
|
-
b.optional :min_max
|
43
|
-
b.optional :readonly
|
44
|
-
|
45
|
-
b.use :label, class: "block text-sm font-medium text-gray-700"
|
46
|
-
|
47
|
-
b.wrapper tag: 'div', class: 'mt-1 flex rounded-md shadow-sm' do |d|
|
48
|
-
d.use :prepend
|
49
|
-
d.use :input,
|
50
|
-
class: "flex-1 min-w-0 block w-full px-3 py-2 rounded-none rounded-r-md focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm border-gray-300",
|
51
|
-
error_class: "flex-1 min-w-0 block w-full px-3 py-2 rounded-none rounded-r-md focus:ring-red-500 focus:border-red-500 sm:text-sm border-red-300 text-red-900 placeholder-red-300"
|
52
|
-
end
|
53
|
-
b.use :full_error, wrap_with: { tag: "p", class: "mt-2 text-sm text-red-600" }
|
54
|
-
b.use :hint, wrap_with: { tag: :p, class: "mt-2 text-sm text-gray-500" }
|
55
|
-
end
|
56
|
-
|
57
|
-
config.wrappers :append_string, tag: 'div', class: '', error_class: '', valid_class: '' do |b|
|
58
|
-
b.use :html5
|
59
|
-
b.use :placeholder
|
60
|
-
b.optional :maxlength
|
61
|
-
b.optional :minlength
|
62
|
-
b.optional :pattern
|
63
|
-
b.optional :min_max
|
64
|
-
b.optional :readonly
|
65
|
-
|
66
|
-
b.use :label, class: "block text-sm font-medium text-gray-700"
|
67
|
-
|
68
|
-
b.wrapper tag: 'div', class: 'mt-1 flex rounded-md shadow-sm' do |d|
|
69
|
-
d.use :input,
|
70
|
-
class: "flex-1 min-w-0 block w-full px-3 py-2 rounded-none rounded-l-md focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm border-gray-300",
|
71
|
-
error_class: "flex-1 min-w-0 block w-full px-3 py-2 rounded-none rounded-l-md focus:ring-red-500 focus:border-red-500 sm:text-sm border-red-300 text-red-900 placeholder-red-300"
|
72
|
-
d.use :append
|
73
|
-
end
|
74
|
-
b.use :full_error, wrap_with: { tag: "p", class: "mt-2 text-sm text-red-600" }
|
75
|
-
b.use :hint, wrap_with: { tag: :p, class: "mt-2 text-sm text-gray-500" }
|
76
|
-
end
|
77
|
-
|
78
|
-
config.wrappers :corner_hint, tag: :div do |b|
|
79
|
-
b.use :html5
|
80
|
-
b.use :placeholder
|
81
|
-
b.optional :maxlength
|
82
|
-
b.optional :minlength
|
83
|
-
b.optional :pattern
|
84
|
-
b.optional :min_max
|
85
|
-
b.optional :readonly
|
86
|
-
|
87
|
-
b.wrapper tag: :div, class: "flex justify-between", error_class: nil, valid_class: nil do |c|
|
88
|
-
c.use :label, class: "block text-sm font-medium text-gray-700"
|
89
|
-
c.use :hint, wrap_with: { tag: :span, class: "text-sm text-gray-500" }
|
90
|
-
end
|
91
|
-
|
92
|
-
b.use :input,
|
93
|
-
class: "appearance-none block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm placeholder-gray-400 focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm",
|
94
|
-
error_class: "block w-full pr-10 border-red-300 text-red-900 placeholder-red-300 focus:outline-none focus:ring-red-500 focus:border-red-500 sm:text-sm rounded-md"
|
95
|
-
b.use :full_error, wrap_with: { tag: "p", class: "mt-2 text-sm text-red-600" }
|
96
|
-
end
|
97
|
-
|
98
|
-
# The default wrapper to be used by the FormBuilder.
|
99
|
-
config.default_wrapper = :default
|
100
|
-
|
101
|
-
# Define the way to render check boxes / radio buttons with labels.
|
102
|
-
# Defaults to :nested for bootstrap config.
|
103
|
-
# inline: input + label
|
104
|
-
# nested: label > input
|
105
|
-
config.boolean_style = :nested
|
106
|
-
|
107
|
-
# Default class for buttons
|
108
|
-
config.button_class = nil
|
109
|
-
|
110
|
-
# Method used to tidy up errors. Specify any Rails Array method.
|
111
|
-
# :first lists the first message for each field.
|
112
|
-
# Use :to_sentence to list all errors for each field.
|
113
|
-
# config.error_method = :first
|
114
|
-
|
115
|
-
# Default tag used for error notification helper.
|
116
|
-
config.error_notification_tag = :div
|
117
|
-
|
118
|
-
# CSS class to add for error notification helper.
|
119
|
-
config.error_notification_class = ''
|
120
|
-
|
121
|
-
# Series of attempts to detect a default label method for collection.
|
122
|
-
# config.collection_label_methods = [ :to_label, :name, :title, :to_s ]
|
123
|
-
|
124
|
-
# Series of attempts to detect a default value method for collection.
|
125
|
-
# config.collection_value_methods = [ :id, :to_s ]
|
126
|
-
|
127
|
-
# You can wrap a collection of radio/check boxes in a pre-defined tag, defaulting to none.
|
128
|
-
# config.collection_wrapper_tag = nil
|
129
|
-
|
130
|
-
# You can define the class to use on all collection wrappers. Defaulting to none.
|
131
|
-
# config.collection_wrapper_class = nil
|
132
|
-
|
133
|
-
# You can wrap each item in a collection of radio/check boxes with a tag,
|
134
|
-
# defaulting to :span.
|
135
|
-
# config.item_wrapper_tag = :span
|
136
|
-
|
137
|
-
# You can define a class to use in all item wrappers. Defaulting to none.
|
138
|
-
# config.item_wrapper_class = nil
|
139
|
-
|
140
|
-
# How the label text should be generated altogether with the required text.
|
141
|
-
config.label_text = lambda { |label, required, explicit_label| "#{label}" }
|
142
|
-
|
143
|
-
# You can define the class to use on all labels. Default is nil.
|
144
|
-
# config.label_class = nil
|
145
|
-
|
146
|
-
# You can define the default class to be used on forms. Can be overriden
|
147
|
-
# with `html: { :class }`. Defaulting to none.
|
148
|
-
config.default_form_class = nil
|
149
|
-
config.form_class = nil
|
150
|
-
|
151
|
-
# You can define which elements should obtain additional classes
|
152
|
-
config.generate_additional_classes_for = []
|
153
|
-
|
154
|
-
# Whether attributes are required by default (or not). Default is true.
|
155
|
-
# config.required_by_default = true
|
156
|
-
|
157
|
-
# Tell browsers whether to use the native HTML5 validations (novalidate form option).
|
158
|
-
# These validations are enabled in SimpleForm's internal config but disabled by default
|
159
|
-
# in this configuration, which is recommended due to some quirks from different browsers.
|
160
|
-
# To stop SimpleForm from generating the novalidate option, enabling the HTML5 validations,
|
161
|
-
# change this configuration to true.
|
162
|
-
config.browser_validations = false
|
163
|
-
|
164
|
-
# Custom mappings for input types. This should be a hash containing a regexp
|
165
|
-
# to match as key, and the input type that will be used when the field name
|
166
|
-
# matches the regexp as value.
|
167
|
-
# config.input_mappings = { /count/ => :integer }
|
168
|
-
|
169
|
-
# Custom wrappers for input types. This should be a hash containing an input
|
170
|
-
# type as key and the wrapper that will be used for all inputs with specified type.
|
171
|
-
config.wrapper_mappings = {
|
172
|
-
string: :default,
|
173
|
-
prepend_string: :prepend_string,
|
174
|
-
append_string: :append_string,
|
175
|
-
}
|
176
|
-
|
177
|
-
# Namespaces where SimpleForm should look for custom input classes that
|
178
|
-
# override default inputs.
|
179
|
-
# config.custom_inputs_namespaces << "CustomInputs"
|
180
|
-
|
181
|
-
# Default priority for time_zone inputs.
|
182
|
-
# config.time_zone_priority = nil
|
183
|
-
|
184
|
-
# Default priority for country inputs.
|
185
|
-
# config.country_priority = nil
|
186
|
-
|
187
|
-
# When false, do not use translations for labels.
|
188
|
-
# config.translate_labels = true
|
189
|
-
|
190
|
-
# Automatically discover new inputs in Rails' autoload path.
|
191
|
-
# config.inputs_discovery = true
|
192
|
-
|
193
|
-
# Cache SimpleForm inputs discovery
|
194
|
-
# config.cache_discovery = !Rails.env.development?
|
195
|
-
|
196
|
-
# Default class for inputs
|
197
|
-
# config.input_class = nil
|
198
|
-
|
199
|
-
# Define the default class of the input wrapper of the boolean input.
|
200
|
-
config.boolean_label_class = 'checkbox'
|
201
|
-
|
202
|
-
# Defines if the default input wrapper class should be included in radio
|
203
|
-
# collection wrappers.
|
204
|
-
# config.include_default_input_wrapper_class = true
|
205
|
-
|
206
|
-
# Defines which i18n scope will be used in Simple Form.
|
207
|
-
# config.i18n_scope = 'simple_form'
|
208
|
-
|
209
|
-
# Defines validation classes to the input_field. By default it's nil.
|
210
|
-
# config.input_field_valid_class = 'is-valid'
|
211
|
-
# config.input_field_error_class = 'is-invalid'
|
212
|
-
end
|