lotus_admin 1.5.2 → 1.5.3

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: 1a6d6f7dab65888fc3cc1d0c1823baa23eb80d80605bc11c292bccff92f2242a
4
- data.tar.gz: 72edd101b774056720d793cbab45c79f52519add43976762c1a32f1962719037
3
+ metadata.gz: '0009428266da5d0d9c3ea09cbbea1c6f4f2e7f09c9da6a5792c5f2891f9f7f09'
4
+ data.tar.gz: 8e0480793bc75ea33106336c1a5fb75d79c09ef1e93fc4b596c92761019fdf93
5
5
  SHA512:
6
- metadata.gz: 442cdf1f5eaf5ee45be321bfdf1dcbd0cf503101abf3a1f441e98521bb3d70a37b802e6526319edac810f46932ece767d389290fb379a27ff73ba87f917ed2f2
7
- data.tar.gz: 7427bb13393baf8774e1be6bdc0613bccec45baaac602fb718e8abdedc659c4219bef7ad0b09b94a6c8a0e3bc7da890271635a2d6ca836b01513819512fb9f7c
6
+ metadata.gz: 7a92fecdde33a23f2fb010d551aaf90f3db1688d767c01154f0c6d6394a3adc3fa1092edc9575b9a4cce5375a7f8e18f3b1e0bb32241acf8b0d726a9f7f4c971
7
+ data.tar.gz: 5ffdaafacaba4d838bab07471d727614ff17cacd4da9fae3f75b3aab13254050be2986aa7b57fc80ff8ce0b7678161ee6e6a37637dea2bdf8fe362aa8e8c1c64
@@ -12,14 +12,13 @@ $ ->
12
12
  }
13
13
 
14
14
  setup_datepickers = (container)->
15
- container.find('.input-group.date, .form-control.date').datetimepicker
15
+ container.find('.input-group.date').datetimepicker
16
16
  format: 'YYYY-MM-DD',
17
17
  icons: icons
18
18
 
19
- container.find('.input-group.datetime, .form-control.datetime').datetimepicker
19
+ container.find('.input-group.datetime').datetimepicker
20
20
  format: 'YYYY-MM-DD hh:mm a',
21
- icons: icons,
22
- debug: true
21
+ icons: icons
23
22
 
24
23
  # On page load
25
24
  setup_datepickers($('body'))
@@ -0,0 +1,22 @@
1
+ class CurrencyInput < SimpleForm::Inputs::Base
2
+ def input(wrapper_options)
3
+ currency = options.delete(:currency) || default_currency
4
+ merged_input_options = merge_wrapper_options(input_html_options, wrapper_options)
5
+
6
+ content_tag(:div, input_group(currency, merged_input_options), class: "input-group")
7
+ end
8
+
9
+ private
10
+
11
+ def input_group(currency, merged_input_options)
12
+ "#{currency_addon(currency)} #{@builder.text_field(attribute_name, merged_input_options)}".html_safe
13
+ end
14
+
15
+ def currency_addon(currency)
16
+ content_tag(:span, currency, class: "input-group-addon")
17
+ end
18
+
19
+ def default_currency
20
+ "$"
21
+ end
22
+ end
@@ -0,0 +1,28 @@
1
+ class DateTimeInput < SimpleForm::Inputs::Base
2
+ def input(wrapper_options)
3
+ merged_input_options = merge_wrapper_options(input_html_options, wrapper_options)
4
+
5
+ content_tag(:div, input_group(merged_input_options), class: "input-group datetime")
6
+ end
7
+
8
+ private
9
+
10
+ def input_group(merged_input_options)
11
+ "#{calendar_addon} #{@builder.text_field(attribute_name, merged_input_options)}".html_safe
12
+ end
13
+
14
+ def calendar_addon
15
+ content_tag(:span, calendar_icon, class: "input-group-addon")
16
+ end
17
+
18
+ def calendar_icon
19
+ @builder.template.fa_icon(:calendar)
20
+ end
21
+
22
+ def input_html_options
23
+ super.merge({
24
+ class: 'datetime',
25
+ value: @builder.object.public_send(attribute_name)&.strftime('%Y-%m-%d %l:%M %P')
26
+ })
27
+ end
28
+ end
@@ -1,3 +1,3 @@
1
1
  module LotusAdmin
2
- VERSION = '1.5.2'
2
+ VERSION = '1.5.3'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lotus_admin
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.2
4
+ version: 1.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Millsaps-Brewer
@@ -405,7 +405,9 @@ files:
405
405
  - app/helpers/lotus_admin/panel_helpers.rb
406
406
  - app/helpers/lotus_admin/render_helpers.rb
407
407
  - app/helpers/lotus_admin/sidebar_helpers.rb
408
+ - app/inputs/currency_input.rb
408
409
  - app/inputs/date_picker_input.rb
410
+ - app/inputs/date_time_input.rb
409
411
  - app/jobs/lotus_admin/application_job.rb
410
412
  - app/mailers/lotus_admin/application_mailer.rb
411
413
  - app/mailers/lotus_admin/user_mailer.rb