five-two-nw-olivander 0.1.2.1 → 0.1.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fc230db07c2624d5ca4398239976b374c1fcdec0a4d741a27387f7ecfd3705dd
4
- data.tar.gz: 45767c0b8bfca58e6ce48672e6c8bc310baec3bc15c2bedf8f34d95e330085a0
3
+ metadata.gz: 44fe284f2bfe724fd9afc389fe29459b92d7358bd2db4bbcc834c575b4defb89
4
+ data.tar.gz: 19de553ddc1641dea2af0b12e41a9c9c4459470972205227d106d6cc61f5660e
5
5
  SHA512:
6
- metadata.gz: b96d61fa31cb64a25fd0ceb3097979d4874763f88891fc503318a7b3f30fde73f306e9973525205f3876b9ea07739f7f4c45b4fa24c814289bcf2564984d0077
7
- data.tar.gz: 74ca5454b8081887b6c16ede1e4fa941248bc8854d41998dab7007011b07fe548efc6b970b1f5ccc6999b58d15a4a90fdb4e328e1b20992e0404c1397186a9fd
6
+ metadata.gz: 29b8d4a75d6680a5283562bcd52e746a74c21cff1b9f0ed6982d6132c05cafc28659343a5f9ed6d18de437c36bb08a9966ba21cf6cd873c98028137785b59358
7
+ data.tar.gz: b698a84298b468c808c630332a19e90f8061b4f8ef232324a8c890e15fa5c0cd5c6d2adbc0408085dcfce1e2334a69d98a811f4ab8f4d405eda5eea55392ceb6
@@ -0,0 +1,176 @@
1
+ # frozen_string_literal: true
2
+ #
3
+ # Uncomment this and change the path if necessary to include your own
4
+ # components.
5
+ # See https://github.com/heartcombo/simple_form#custom-components to know
6
+ # more about custom components.
7
+ # Dir[Rails.root.join('lib/components/**/*.rb')].each { |f| require f }
8
+ #
9
+ # Use this setup block to configure all options available in SimpleForm.
10
+ SimpleForm.setup do |config|
11
+ # Wrappers are used by the form builder to generate a
12
+ # complete input. You can remove any component from the
13
+ # wrapper, change the order or even add your own to the
14
+ # stack. The options given below are used to wrap the
15
+ # whole input.
16
+ config.wrappers :default, class: :input,
17
+ hint_class: :field_with_hint, error_class: :field_with_errors, valid_class: :field_without_errors do |b|
18
+ ## Extensions enabled by default
19
+ # Any of these extensions can be disabled for a
20
+ # given input by passing: `f.input EXTENSION_NAME => false`.
21
+ # You can make any of these extensions optional by
22
+ # renaming `b.use` to `b.optional`.
23
+
24
+ # Determines whether to use HTML5 (:email, :url, ...)
25
+ # and required attributes
26
+ b.use :html5
27
+
28
+ # Calculates placeholders automatically from I18n
29
+ # You can also pass a string as f.input placeholder: "Placeholder"
30
+ b.use :placeholder
31
+
32
+ ## Optional extensions
33
+ # They are disabled unless you pass `f.input EXTENSION_NAME => true`
34
+ # to the input. If so, they will retrieve the values from the model
35
+ # if any exists. If you want to enable any of those
36
+ # extensions by default, you can change `b.optional` to `b.use`.
37
+
38
+ # Calculates maxlength from length validations for string inputs
39
+ # and/or database column lengths
40
+ b.optional :maxlength
41
+
42
+ # Calculate minlength from length validations for string inputs
43
+ b.optional :minlength
44
+
45
+ # Calculates pattern from format validations for string inputs
46
+ b.optional :pattern
47
+
48
+ # Calculates min and max from length validations for numeric inputs
49
+ b.optional :min_max
50
+
51
+ # Calculates readonly automatically from readonly attributes
52
+ b.optional :readonly
53
+
54
+ ## Inputs
55
+ # b.use :input, class: 'input', error_class: 'is-invalid', valid_class: 'is-valid'
56
+ b.use :label_input
57
+ b.use :hint, wrap_with: { tag: :span, class: :hint }
58
+ b.use :error, wrap_with: { tag: :span, class: :error }
59
+
60
+ ## full_messages_for
61
+ # If you want to display the full error message for the attribute, you can
62
+ # use the component :full_error, like:
63
+ #
64
+ # b.use :full_error, wrap_with: { tag: :span, class: :error }
65
+ end
66
+
67
+ # The default wrapper to be used by the FormBuilder.
68
+ config.default_wrapper = :default
69
+
70
+ # Define the way to render check boxes / radio buttons with labels.
71
+ # Defaults to :nested for bootstrap config.
72
+ # inline: input + label
73
+ # nested: label > input
74
+ config.boolean_style = :nested
75
+
76
+ # Default class for buttons
77
+ config.button_class = 'btn'
78
+
79
+ # Method used to tidy up errors. Specify any Rails Array method.
80
+ # :first lists the first message for each field.
81
+ # Use :to_sentence to list all errors for each field.
82
+ # config.error_method = :first
83
+
84
+ # Default tag used for error notification helper.
85
+ config.error_notification_tag = :div
86
+
87
+ # CSS class to add for error notification helper.
88
+ config.error_notification_class = 'error_notification'
89
+
90
+ # Series of attempts to detect a default label method for collection.
91
+ # config.collection_label_methods = [ :to_label, :name, :title, :to_s ]
92
+
93
+ # Series of attempts to detect a default value method for collection.
94
+ # config.collection_value_methods = [ :id, :to_s ]
95
+
96
+ # You can wrap a collection of radio/check boxes in a pre-defined tag, defaulting to none.
97
+ # config.collection_wrapper_tag = nil
98
+
99
+ # You can define the class to use on all collection wrappers. Defaulting to none.
100
+ # config.collection_wrapper_class = nil
101
+
102
+ # You can wrap each item in a collection of radio/check boxes with a tag,
103
+ # defaulting to :span.
104
+ # config.item_wrapper_tag = :span
105
+
106
+ # You can define a class to use in all item wrappers. Defaulting to none.
107
+ # config.item_wrapper_class = nil
108
+
109
+ # How the label text should be generated altogether with the required text.
110
+ # config.label_text = lambda { |label, required, explicit_label| "#{required} #{label}" }
111
+
112
+ # You can define the class to use on all labels. Default is nil.
113
+ # config.label_class = nil
114
+
115
+ # You can define the default class to be used on forms. Can be overriden
116
+ # with `html: { :class }`. Defaulting to none.
117
+ # config.default_form_class = nil
118
+
119
+ # You can define which elements should obtain additional classes
120
+ # config.generate_additional_classes_for = [:wrapper, :label, :input]
121
+
122
+ # Whether attributes are required by default (or not). Default is true.
123
+ # config.required_by_default = true
124
+
125
+ # Tell browsers whether to use the native HTML5 validations (novalidate form option).
126
+ # These validations are enabled in SimpleForm's internal config but disabled by default
127
+ # in this configuration, which is recommended due to some quirks from different browsers.
128
+ # To stop SimpleForm from generating the novalidate option, enabling the HTML5 validations,
129
+ # change this configuration to true.
130
+ config.browser_validations = false
131
+
132
+ # Custom mappings for input types. This should be a hash containing a regexp
133
+ # to match as key, and the input type that will be used when the field name
134
+ # matches the regexp as value.
135
+ # config.input_mappings = { /count/ => :integer }
136
+
137
+ # Custom wrappers for input types. This should be a hash containing an input
138
+ # type as key and the wrapper that will be used for all inputs with specified type.
139
+ # config.wrapper_mappings = { string: :prepend }
140
+
141
+ # Namespaces where SimpleForm should look for custom input classes that
142
+ # override default inputs.
143
+ # config.custom_inputs_namespaces << "CustomInputs"
144
+
145
+ # Default priority for time_zone inputs.
146
+ # config.time_zone_priority = nil
147
+
148
+ # Default priority for country inputs.
149
+ # config.country_priority = nil
150
+
151
+ # When false, do not use translations for labels.
152
+ # config.translate_labels = true
153
+
154
+ # Automatically discover new inputs in Rails' autoload path.
155
+ # config.inputs_discovery = true
156
+
157
+ # Cache SimpleForm inputs discovery
158
+ # config.cache_discovery = !Rails.env.development?
159
+
160
+ # Default class for inputs
161
+ # config.input_class = nil
162
+
163
+ # Define the default class of the input wrapper of the boolean input.
164
+ config.boolean_label_class = 'checkbox'
165
+
166
+ # Defines if the default input wrapper class should be included in radio
167
+ # collection wrappers.
168
+ # config.include_default_input_wrapper_class = true
169
+
170
+ # Defines which i18n scope will be used in Simple Form.
171
+ # config.i18n_scope = 'simple_form'
172
+
173
+ # Defines validation classes to the input_field. By default it's nil.
174
+ # config.input_field_valid_class = 'is-valid'
175
+ # config.input_field_error_class = 'is-invalid'
176
+ end
@@ -0,0 +1,31 @@
1
+ en:
2
+ simple_form:
3
+ "yes": 'Yes'
4
+ "no": 'No'
5
+ required:
6
+ text: 'required'
7
+ mark: '*'
8
+ # You can uncomment the line below if you need to overwrite the whole required html.
9
+ # When using html, text and mark won't be used.
10
+ # html: '<abbr title="required">*</abbr>'
11
+ error_notification:
12
+ default_message: "Please review the problems below:"
13
+ # Examples
14
+ # labels:
15
+ # defaults:
16
+ # password: 'Password'
17
+ # user:
18
+ # new:
19
+ # email: 'E-mail to sign in.'
20
+ # edit:
21
+ # email: 'E-mail.'
22
+ # hints:
23
+ # defaults:
24
+ # username: 'User name to sign in.'
25
+ # password: 'No special characters, please.'
26
+ # include_blanks:
27
+ # defaults:
28
+ # age: 'Rather not say'
29
+ # prompts:
30
+ # defaults:
31
+ # age: 'Select your age'
@@ -3,4 +3,5 @@ require 'effective_datatables'
3
3
  require 'haml-rails'
4
4
  require 'chartkick'
5
5
  require 'view_component'
6
+ require 'simple_form'
6
7
  require 'olivander'
@@ -1,3 +1,3 @@
1
1
  module Olivander
2
- VERSION = "0.1.2.1"
2
+ VERSION = "0.1.2.2"
3
3
  end
@@ -0,0 +1,15 @@
1
+ <%# frozen_string_literal: true %>
2
+ <%%= simple_form_for(@<%= singular_table_name %>) do |f| %>
3
+ <%%= f.error_notification %>
4
+ <%%= f.error_notification message: f.object.errors[:base].to_sentence if f.object.errors[:base].present? %>
5
+
6
+ <div class="form-inputs">
7
+ <%- attributes.each do |attribute| -%>
8
+ <%%= f.<%= attribute.reference? ? :association : :input %> :<%= attribute.name %> %>
9
+ <%- end -%>
10
+ </div>
11
+
12
+ <div class="form-actions">
13
+ <%%= f.button :submit %>
14
+ </div>
15
+ <%% end %>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: five-two-nw-olivander
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2.1
4
+ version: 0.1.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Dennis
@@ -199,6 +199,8 @@ files:
199
199
  - app/views/layouts/olivander/adminlte/main.html.haml
200
200
  - app/views/layouts/olivander/application.html.haml
201
201
  - config/initializers/effective_datatables.rb.old
202
+ - config/initializers/simple_form.rb
203
+ - config/locales/simple_form.en.yml
202
204
  - config/routes.rb
203
205
  - lib/five-two-nw-olivander.rb
204
206
  - lib/olivander.rb
@@ -208,6 +210,7 @@ files:
208
210
  - lib/olivander/menus/menu_item.rb
209
211
  - lib/olivander/version.rb
210
212
  - lib/tasks/olivander_tasks.rake
213
+ - lib/templates/erb/scaffold/_form.html.erb
211
214
  homepage: https://rubygems.org/gems/olivander
212
215
  licenses:
213
216
  - MIT