web47core 3.2.38 → 3.2.51

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.
Files changed (44) hide show
  1. checksums.yaml +4 -4
  2. data/app/helpers/core_card_nav_items_helper.rb +6 -6
  3. data/app/helpers/core_dropdown_helper.rb +8 -8
  4. data/app/helpers/core_floating_action_button_helper.rb +8 -8
  5. data/app/helpers/core_form_checkbox_helper.rb +43 -0
  6. data/app/helpers/core_form_helper.rb +195 -160
  7. data/app/helpers/core_form_input_helper.rb +74 -0
  8. data/app/helpers/core_form_select_helper.rb +65 -0
  9. data/app/helpers/core_form_textarea_helper.rb +26 -0
  10. data/app/helpers/core_table_helper.rb +23 -0
  11. data/app/helpers/model_modal_helper.rb +19 -19
  12. data/app/helpers/svg_icon_helper.rb +6 -3
  13. data/app/views/cron_servers/index.html.haml +3 -3
  14. data/app/views/cron_tabs/index.html.haml +1 -1
  15. data/app/views/delayed_job_workers/index.html.haml +3 -3
  16. data/app/views/delayed_jobs/index.html.haml +4 -0
  17. data/app/views/icons/_bed-filled.html.erb +1 -0
  18. data/app/views/icons/_bed-outline.html.erb +1 -0
  19. data/app/views/icons/_binary-tree-2.html.erb +1 -0
  20. data/app/views/icons/_cancel.html.erb +1 -0
  21. data/app/views/icons/_circle-plus-filled.html.erb +1 -0
  22. data/app/views/icons/_circle-plus-outline.html.erb +1 -0
  23. data/app/views/icons/_dots-vertical.html.erb +1 -0
  24. data/app/views/icons/_edit.html.erb +1 -0
  25. data/app/views/icons/_heartbeat.html.erb +1 -0
  26. data/app/views/icons/_hourglass.html.erb +1 -0
  27. data/app/views/icons/_player-play-filled.html.erb +1 -0
  28. data/app/views/icons/_player-play-outline.html.erb +1 -0
  29. data/app/views/icons/_repeat.html.erb +1 -0
  30. data/app/views/icons/_rotate.html.erb +1 -0
  31. data/app/views/icons/_run.html.erb +1 -0
  32. data/app/views/icons/_skull.html.erb +1 -0
  33. data/app/views/icons/_thumb-down-filled.html.erb +1 -0
  34. data/app/views/icons/_thumb-down-outline.html.erb +1 -0
  35. data/app/views/icons/_thumb-up-filled.html.erb +1 -0
  36. data/app/views/icons/_thumb-up-outline.html.erb +1 -0
  37. data/app/views/icons/_trash-filled.html.erb +1 -0
  38. data/app/views/icons/_trash-outline.html.erb +1 -0
  39. data/app/views/icons/_treadmill.html.erb +1 -0
  40. data/config/locales/en.yml +14 -0
  41. data/lib/app/models/concerns/standard_model.rb +8 -7
  42. data/lib/web47core/version.rb +1 -1
  43. metadata +28 -2
  44. data/app/helpers/core_remix_icon_helper.rb +0 -23
@@ -0,0 +1,74 @@
1
+ module CoreFormInputHelper
2
+
3
+ # @abstract Render a email text field
4
+ # @param [Mongoid::Document] model - The model to render the field for
5
+ # @param [Symbol] field - The field to render
6
+ # @param [Hash] options - Options to pass to the field
7
+ def form_number_field(model, field, options = {})
8
+ options[:type] ||= :number
9
+ options[:step] ||= 1
10
+ options[:min] ||= 0
11
+ form_text_field(model, field, options)
12
+ end
13
+
14
+ # @abstract Render a email text field
15
+ # @param [Mongoid::Document] model - The model to render the field for
16
+ # @param [Symbol] field - The field to render
17
+ # @param [Hash] options - Options to pass to the field
18
+ def form_email_field(model, field, options = {})
19
+ options[:type] ||= :email
20
+ form_text_field(model, field, options)
21
+ end
22
+
23
+ # @abstract Render a text field
24
+ # @param [Mongoid::Document] model - The model to render the field for
25
+ # @param [Symbol] field - The field to render
26
+ # @param [Hash] options - Options to pass to the field
27
+ def form_url_field(model, field, options = {})
28
+ options[:type] ||= :url
29
+ form_text_field(model, field, options)
30
+ end
31
+
32
+ # @abstract Render a text field
33
+ # @param [Mongoid::Document] model - The model to render the field for
34
+ # @param [Symbol] field - The field to render
35
+ # @param [Hash] options - Options to pass to the field
36
+ def form_password(model, field, options = {})
37
+ options[:type] = :password
38
+ form_text_field(model, field, options)
39
+ end
40
+
41
+ # @abstract Render a text field
42
+ # @param [Mongoid::Document] model - The model to render the field for
43
+ # @param [Symbol] field - The field to render
44
+ # @param [Hash] options - Options to pass to the field
45
+ def form_text_field(model, field, options = {})
46
+ label_options = options.clone
47
+ classes = options[:classes] || []
48
+ classes << 'mb-3'
49
+ value = model.send(field)
50
+ options[:type] ||= :text
51
+ options[:value] = value
52
+ options[:disabled] ||= false
53
+ tag_options = text_field_options(model, field, options)
54
+ content_tag(:div, class: classes.join(' ')) do
55
+ concat(form_label_tag(model, field, value, label_options))
56
+ concat(tag(:input, tag_options))
57
+ end
58
+ end
59
+
60
+ # @abstract Build the options for a text field, place holder, hint, etc.
61
+ # @param [Mongoid::Document] model - The model to render the field for
62
+ # @param [Symbol] field - The field to render
63
+ # @param [Hash] options - Options to pass to the field
64
+ def text_field_options(model, field, options = {})
65
+ classes = %w[form-control]
66
+ classes += options[:input_classes] if options[:input_classes].present?
67
+ options[:name] = form_field_name(model, field, options)
68
+ options[:id] = form_field_id(model, field, options)
69
+ place_holder = options[:place_holder] || form_place_holder_text(model, field)
70
+ options[:placeholder] = place_holder if place_holder.present?
71
+ options[:class] = classes.uniq
72
+ options
73
+ end
74
+ end
@@ -0,0 +1,65 @@
1
+ module CoreFormSelectHelper
2
+ def form_select(model, field, options = {})
3
+ value = model.send(field)
4
+ raise 'Prompt needed' if value.blank? && options[:prompt].blank? && !options[:no_label]
5
+
6
+ label_options = options.clone
7
+ # hint = input_hint(model, field)
8
+ # if hint.present?
9
+ # base_classes = %w[tooltipped]
10
+ # data = { tooltip: I18n.t(hint_key), position: :top }
11
+ # else
12
+ # base_classes = []
13
+ # data = {}
14
+ # end
15
+ classes = (options[:classes] || []).compact.join(' ')
16
+ content_tag(:div, class: classes, data: {}) do
17
+ concat(form_label_tag(model, field, value, options))
18
+ concat(form_select_tag(model, field, label_options))
19
+ end
20
+ end
21
+
22
+ def form_select_tag(model, field, options = {})
23
+ select_content = {
24
+ id: form_field_id(model, field, options),
25
+ name: form_field_name(model, field, options),
26
+ class: [options[:input_classes], 'form-select'].compact.join(' '),
27
+ disabled: options[:disabled]
28
+ }
29
+ content_tag(:select, select_content) do
30
+ form_select_option_key_values(model.send(field), options).each do |value|
31
+ concat(content_tag(:option, value: value[:key], selected: value[:selected]) do
32
+ concat(value[:value])
33
+ end)
34
+ end
35
+ end
36
+ end
37
+
38
+ def form_select_option_key_values(value, options)
39
+ select_options = []
40
+ select_options << { key: '', value: options[:prompt], selected: false } if options[:prompt].present?
41
+ options[:options].each do |option_value|
42
+ option_value[:display_name] = option_value.display_name if option_value.respond_to?(:display_name)
43
+ option_value[:display_name] = option_value.user_display_name if option_value.respond_to?(:user_display_name)
44
+ select_options << case option_value
45
+ when String, Integer
46
+ { key: option_value,
47
+ value: option_value,
48
+ selected: value.eql?(option_value) }
49
+ when Array
50
+ { key: option_value.last,
51
+ value: option_value.first,
52
+ selected: value.to_s.eql?(option_value.last.to_s) }
53
+ when Hash
54
+ { key: option_value[:key],
55
+ value: option_value[:value],
56
+ selected: value.eql?(option_value[:key]) }
57
+ else
58
+ { key: option_value[:_id].to_s,
59
+ value: option_value[:display_name] || option_value[:name],
60
+ selected: value.eql?(option_value) }
61
+ end
62
+ end
63
+ select_options
64
+ end
65
+ end
@@ -0,0 +1,26 @@
1
+ module CoreFormTextareaHelper
2
+ #
3
+ # Text area
4
+ #
5
+ def form_text_area(model, field, options = {})
6
+ classes = options[:classes] || %w[s12]
7
+ value = model.send(field)
8
+ # options[:value] = value
9
+ # options[:disabled] ||= false
10
+ # tag_options = {class: []} # text_field_options(model, field, options)
11
+ # tag_options[:class] += ['materialize-textarea']
12
+ content_tag(:div, class: (%w[input-field col] + classes).join(' ')) do
13
+ concat(form_label_tag(model, field, value, options))
14
+ concat(text_area_tag(model, field, value, options))
15
+ end
16
+ end
17
+ alias_method :form_textarea, :form_text_area
18
+
19
+ def text_area_tag(model, field, value, options = {})
20
+ tag_options = text_field_options(model, field, options)
21
+ tag_options[:class] += ['form-control']
22
+ content_tag(:textarea, tag_options) do
23
+ concat(value)
24
+ end
25
+ end
26
+ end
@@ -4,6 +4,16 @@
4
4
  # Methods useful for building out tables
5
5
  #
6
6
  module CoreTableHelper
7
+ def card_table_header_actions_tag(clazz, path, classes: [], icon_name: :add, title: 'Add')
8
+ return unless can?(:create, clazz)
9
+
10
+ classes << 'btn'
11
+ content_tag(:a, class: classes.join(' '), href: path) do
12
+ concat(svg_icon(icon_name))
13
+ concat(content_tag(:span, title))
14
+ end
15
+ end
16
+
7
17
  #
8
18
  # Format the table header
9
19
  # @param name - Name of the header, either the text or a localized value
@@ -77,4 +87,17 @@ module CoreTableHelper
77
87
  end)
78
88
  end
79
89
  end
90
+
91
+ # @abstract Return a table data cell with a boolean value
92
+ # @param value [Boolean] - The value to display
93
+ # @return [String] - The HTML for the cell
94
+ def table_data_boolean(value, show_false: true)
95
+ content_tag(:td, class: 'text-center', data: { order: value ? 0 : 1 }) do
96
+ if value
97
+ svg_icon(:check, color: :green)
98
+ else
99
+ svg_icon(:x, color: :red) if show_false
100
+ end
101
+ end
102
+ end
80
103
  end
@@ -69,20 +69,20 @@ module ModelModalHelper
69
69
  end
70
70
 
71
71
  def model_modal_action(model, _options = {})
72
- content_tag(:a, data: { bs_toggle: :modal, bs_target: "#modal-#{model.id}" }) do
72
+ content_tag(:a, href: '#', data: { bs_toggle: :modal, bs_target: "#modal-#{model.id}" }) do
73
73
  concat(model.name)
74
74
  end
75
75
  end
76
76
 
77
77
  def model_modal(model, edit_path, options = {})
78
78
  content_tag(:div, class: 'modal', id: "modal-#{model.id}", tabindex: -1) do
79
- concat(model_modal_dialog(model, options))
79
+ concat(model_modal_dialog(model, edit_path, options))
80
80
  end
81
81
  end
82
82
 
83
83
  def model_modal_dialog(model, edit_path, options = {})
84
84
  content_tag(:div, class: 'modal-dialog', role: :document) do
85
- concat(model_modal_content(model, options))
85
+ concat(model_modal_content(model, edit_path, options))
86
86
  end
87
87
  end
88
88
 
@@ -90,17 +90,17 @@ module ModelModalHelper
90
90
  model_modal_content(model, options) + model_modal_footer(model, "#{request.url}/edit")
91
91
  end
92
92
 
93
- def model_modal_content(model, options = {})
93
+ def model_modal_content(model, edit_path, options = {})
94
94
  content_tag(:div, class: 'modal-content') do
95
95
  concat(model_modal_header(model, edit_path, options))
96
- concat(model_modal_body(model, edit_path, options))
96
+ model_modal_body(model, edit_path, options)
97
97
  concat(model_modal_footer(model, edit_path))
98
98
  end
99
99
  end
100
100
 
101
101
  def model_modal_header(model, edit_path, options = {})
102
102
  content_tag(:div, class: 'modal-header') do
103
- concat(content_tag(:h2) { model.name })
103
+ concat(content_tag(:h2) { model.name.titleize })
104
104
  concat(tag(:button, class: 'btn-close', data: { bs_dismiss: :modal }, aria_label: :close))
105
105
  end
106
106
  end
@@ -115,7 +115,7 @@ module ModelModalHelper
115
115
  def model_modal_tabs(model, _options = {})
116
116
  content_tag(:ul, class: 'nav nav-tabs', data: { bs_toggle: :tabs }) do
117
117
  concat(content_tag(:li, class: 'nav-item') do
118
- content_tag(:a, class: 'nav-link', href: "#field-tab-#{model.id}", data: { bs_toggle: :tab }) { model.class.to_s.titleize }
118
+ content_tag(:a, class: 'nav-link active', href: "#field-tab-#{model.id}", data: { bs_toggle: :tab }) { model.class.to_s.titleize }
119
119
  end)
120
120
  concat(content_tag(:li, class: 'nav-item') do
121
121
  content_tag(:a, class: 'nav-link', href: "#standard-tab-#{model.id}", data: { bs_toggle: :tab }) { 'Details' }
@@ -137,13 +137,13 @@ module ModelModalHelper
137
137
  end
138
138
 
139
139
  def model_modal_standard_tab(model, options = {})
140
- content_tag(:div, id: "standard-tab-#{model.id}", class: 'col s12') do
141
- concat(model_modal_standard(model, options))
140
+ content_tag(:div, id: "standard-tab-#{model.id}", class: 'tab-pane', role: :tabpanel) do
141
+ concat(model_modal_standard_fields(model, options))
142
142
  end
143
143
  end
144
144
 
145
145
  def model_modal_fields_tab(model, options = {})
146
- content_tag(:div, id: "field-tab-#{model.id}", class: 'tab-pane active') do
146
+ content_tag(:div, id: "field-tab-#{model.id}", class: 'tab-pane active', role: :tabpanel) do
147
147
  concat(model_modal_fields(model, options))
148
148
  end
149
149
  end
@@ -175,9 +175,9 @@ module ModelModalHelper
175
175
  end
176
176
 
177
177
  def model_modal_fields(model, _options = {})
178
- content_tag(:div, class: '.datagrid') do
179
- model.class.allowed_param_names.sort.each do |field_name|
180
- next if %w[_id _type created_at updated_at search_text sort_text].include?(field_name)
178
+ content_tag(:div, class: 'datagrid m-2') do
179
+ field_names = ((model.class.allowed_param_names) + %w(description name)).uniq.sort
180
+ field_names.each do |field_name|
181
181
  next if model.respond_to?(field_name) && model.send(field_name).blank?
182
182
 
183
183
  concat(model_modal_field(model, field_name))
@@ -185,9 +185,9 @@ module ModelModalHelper
185
185
  end
186
186
  end
187
187
 
188
- def model_modal_standard(model, _options = {})
189
- content_tag(:div, class: '.datagrid') do
190
- %w[_id _type created_at updated_at search_text sort_text].each do |field_name|
188
+ def model_modal_standard_fields(model, _options = {})
189
+ content_tag(:div, class: 'datagrid m-2') do
190
+ model.class::STANDARD_FIELDS.each do |field_name|
191
191
  concat(model_modal_field(model, field_name))
192
192
  end
193
193
  end
@@ -211,11 +211,11 @@ module ModelModalHelper
211
211
  related_model.present? ? related_model.name : 'N/A'
212
212
  end
213
213
  when FalseClass
214
- 'No'
214
+ svg_icon(:x, color: :red)
215
215
  when TrueClass
216
- 'Yes'
216
+ svg_icon(:check, color: :green)
217
217
  when Mongoid::Boolean
218
- value ? 'Yes' : 'No'
218
+ value ? svg_icon(:check, color: :green) : svg_icon(:x, color: :red)
219
219
  when Date, DateTime, Time
220
220
  current_user.local_time(value, :long)
221
221
  when Integer, Array, Hash, Float
@@ -4,12 +4,12 @@ module SvgIconHelper
4
4
  # @return [View]
5
5
  def svg_icon(name, size: 24, type: :outline, classes: [], color: 'currentColor', stroke_width: 2)
6
6
  classes = if size <= 24
7
- ['icon', classes].compact.flatten.join(' ')
7
+ ['icon', classes].flatten.compact.join(' ')
8
8
  else
9
9
  classes.compact.flatten.join(' ')
10
10
  end
11
11
  key = "icon_partial_path:#{name}:#{type}"
12
- (partial, stroke) = Rails.cache.fetch(key, expires_in: 1.hour) do
12
+ (partial, stroke) = Rails.cache.fetch(key, expires_in: SystemConfiguration.long_cache) do
13
13
  path_with_type = "icons/#{name}-#{type}"
14
14
  path_without_type = "icons/#{name}"
15
15
 
@@ -36,7 +36,10 @@ module SvgIconHelper
36
36
  stroke_linejoin: 'round') do
37
37
  render partial
38
38
  end
39
- rescue StandardError
39
+ rescue StandardError => e
40
+ # puts e.message
41
+ # puts e.backtrace
42
+
40
43
  tag.svg(xmlns: "http://www.w3.org/2000/svg",
41
44
  viewBox: "0 0 24 24",
42
45
  width: size,
@@ -14,10 +14,10 @@
14
14
  %tr
15
15
  %td=[server.host_name, server.pid].join(':')
16
16
  %td.align-content-center
17
+ - if server.primary?
18
+ = svg_icon(:primary)
17
19
  - if server.alive?
18
- = remix_icon('heart-2', type: :fill)
19
- - if server.alive?
20
- = remix_icon('router', type: :fill)
20
+ = svg_icon(:alive)
21
21
  %td= current_user.local_time(server.last_check_in_at)
22
22
  %td
23
23
  =dropdown_menu do
@@ -26,7 +26,7 @@
26
26
  %td=tab.wday
27
27
  %td
28
28
  - if tab.valid_environment?
29
- = remix_icon('check', type: :fill)
29
+ = svg_icon('check', type: :fill)
30
30
  %td
31
31
  =dropdown_menu do
32
32
  =edit_dropdown_item(tab, edit_cron_tab_path(tab))
@@ -18,11 +18,11 @@
18
18
  %td=worker.pid
19
19
  %td
20
20
  - if worker.dead?
21
- = remix_icon(:dislike, tooltip_text: 'Dead')
21
+ = svg_icon(:dead)
22
22
  - elsif worker.running?
23
- = remix_icon(:run, tooltip_text: 'Running')
23
+ = svg_icon(:running)
24
24
  - else
25
- = remix_icon(:zzz, tooltip_text: 'Waiting for jobs')
25
+ = svg_icon(:sleeping)
26
26
  %td=current_user.local_time(worker.last_check_in_at)
27
27
  %td=worker.runs.count
28
28
  %td.actions
@@ -5,6 +5,10 @@
5
5
  = refresh_floating_action_link(Delayed::Backend::Mongoid::Job, class_action_path(:resbumit_all, failed_only:true), title: t('.resubmit_failed'), confirm: t('.confirm_resubmit_failed'))
6
6
  = refresh_floating_action_link(Delayed::Backend::Mongoid::Job, class_action_path(:resbumit_all, failed_only:false), title: t('.resubmit_all'), confirm: t('.confirm_resubmit_all'))
7
7
  .card
8
+ .card-header
9
+ .card-title
10
+ %h4=t('.title')
11
+
8
12
  .card-body
9
13
  .table-responsive.text-no-wrap
10
14
  %table.table.card-table.border.table-striped
@@ -0,0 +1 @@
1
+ <path d="M3 6a1 1 0 0 1 .993 .883l.007 .117v6h6v-5a1 1 0 0 1 .883 -.993l.117 -.007h8a3 3 0 0 1 2.995 2.824l.005 .176v8a1 1 0 0 1 -1.993 .117l-.007 -.117v-3h-16v3a1 1 0 0 1 -1.993 .117l-.007 -.117v-11a1 1 0 0 1 1 -1z" /><path d="M7 8a2 2 0 1 1 -1.995 2.15l-.005 -.15l.005 -.15a2 2 0 0 1 1.995 -1.85z" />
@@ -0,0 +1 @@
1
+ <path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M10 3a1 1 0 1 0 2 0a1 1 0 0 0 -2 0" /><path d="M3 14l4 1l.5 -.5" /><path d="M12 18v-3l-3 -2.923l.75 -5.077" /><path d="M6 10v-2l4 -1l2.5 2.5l2.5 .5" /><path d="M21 22a1 1 0 0 0 -1 -1h-16a1 1 0 0 0 -1 1" /><path d="M18 21l1 -11l2 -1" />
@@ -0,0 +1 @@
1
+ <path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M14 6a2 2 0 1 0 -4 0a2 2 0 0 0 4 0z" /><path d="M7 14a2 2 0 1 0 -4 0a2 2 0 0 0 4 0z" /><path d="M21 14a2 2 0 1 0 -4 0a2 2 0 0 0 4 0z" /><path d="M14 18a2 2 0 1 0 -4 0a2 2 0 0 0 4 0z" /><path d="M12 8v8" /><path d="M6.316 12.496l4.368 -4.992" /><path d="M17.684 12.496l-4.366 -4.99" />
@@ -0,0 +1 @@
1
+ <path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M3 12a9 9 0 1 0 18 0a9 9 0 1 0 -18 0" /><path d="M18.364 5.636l-12.728 12.728" />
@@ -0,0 +1 @@
1
+ <path d="M4.929 4.929a10 10 0 1 1 14.141 14.141a10 10 0 0 1 -14.14 -14.14zm8.071 4.071a1 1 0 1 0 -2 0v2h-2a1 1 0 1 0 0 2h2v2a1 1 0 1 0 2 0v-2h2a1 1 0 1 0 0 -2h-2v-2z" />
@@ -0,0 +1 @@
1
+ <path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0" /><path d="M9 12h6" /><path d="M12 9v6" />
@@ -0,0 +1 @@
1
+ <path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M12 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0" /><path d="M12 19m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0" /><path d="M12 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0" />
@@ -0,0 +1 @@
1
+ <path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M7 7h-1a2 2 0 0 0 -2 2v9a2 2 0 0 0 2 2h9a2 2 0 0 0 2 -2v-1" /><path d="M20.385 6.585a2.1 2.1 0 0 0 -2.97 -2.97l-8.415 8.385v3h3l8.385 -8.415z" /><path d="M16 5l3 3" />
@@ -0,0 +1 @@
1
+ <path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M19.5 13.572l-7.5 7.428l-2.896 -2.868m-6.117 -8.104a5 5 0 0 1 9.013 -3.022a5 5 0 1 1 7.5 6.572" /><path d="M3 13h2l2 3l2 -6l1 3h3" />
@@ -0,0 +1 @@
1
+ <path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M6.5 7h11" /><path d="M6.5 17h11" /><path d="M6 20v-2a6 6 0 1 1 12 0v2a1 1 0 0 1 -1 1h-10a1 1 0 0 1 -1 -1z" /><path d="M6 4v2a6 6 0 1 0 12 0v-2a1 1 0 0 0 -1 -1h-10a1 1 0 0 0 -1 1z" />
@@ -0,0 +1 @@
1
+ <path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M7 4v16l13 -8z" />
@@ -0,0 +1 @@
1
+ <path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M19.95 11a8 8 0 1 0 -.5 4m.5 5v-5h-5" />
@@ -0,0 +1 @@
1
+ <path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M4 12v-3a3 3 0 0 1 3 -3h13m-3 -3l3 3l-3 3" /><path d="M20 12v3a3 3 0 0 1 -3 3h-13m3 3l-3 -3l3 -3" />
@@ -0,0 +1 @@
1
+ <path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M19.95 11a8 8 0 1 0 -.5 4m.5 5v-5h-5" />
@@ -0,0 +1 @@
1
+ <path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M13 4m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0" /><path d="M4 17l5 1l.75 -1.5" /><path d="M15 21l0 -4l-4 -3l1 -6" /><path d="M7 12l0 -3l5 -1l3 3l3 1" />
@@ -0,0 +1 @@
1
+ <path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M12 4c4.418 0 8 3.358 8 7.5c0 1.901 -.755 3.637 -2 4.96l0 2.54a1 1 0 0 1 -1 1h-10a1 1 0 0 1 -1 -1v-2.54c-1.245 -1.322 -2 -3.058 -2 -4.96c0 -4.142 3.582 -7.5 8 -7.5z" /><path d="M10 17v3" /><path d="M14 17v3" /><path d="M9 11m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0" /><path d="M15 11m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0" />
@@ -0,0 +1 @@
1
+ <path d="M13 21.008a3 3 0 0 0 2.995 -2.823l.005 -.177v-4h2a3 3 0 0 0 2.98 -2.65l.015 -.173l.005 -.177l-.02 -.196l-1.006 -5.032c-.381 -1.625 -1.502 -2.796 -2.81 -2.78l-.164 .008h-8a1 1 0 0 0 -.993 .884l-.007 .116l.001 9.536a1 1 0 0 0 .5 .866a2.998 2.998 0 0 1 1.492 2.396l.007 .202v1a3 3 0 0 0 3 3z" /><path d="M5 14.008a1 1 0 0 0 .993 -.883l.007 -.117v-9a1 1 0 0 0 -.883 -.993l-.117 -.007h-1a2 2 0 0 0 -1.995 1.852l-.005 .15v7a2 2 0 0 0 1.85 1.994l.15 .005h1z" />
@@ -0,0 +1 @@
1
+ <path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M7 13v-8a1 1 0 0 0 -1 -1h-2a1 1 0 0 0 -1 1v7a1 1 0 0 0 1 1h3a4 4 0 0 1 4 4v1a2 2 0 0 0 4 0v-5h3a2 2 0 0 0 2 -2l-1 -5a2 3 0 0 0 -2 -2h-7a3 3 0 0 0 -3 3" />
@@ -0,0 +1 @@
1
+ <path d="M13 3a3 3 0 0 1 2.995 2.824l.005 .176v4h2a3 3 0 0 1 2.98 2.65l.015 .174l.005 .176l-.02 .196l-1.006 5.032c-.381 1.626 -1.502 2.796 -2.81 2.78l-.164 -.008h-8a1 1 0 0 1 -.993 -.883l-.007 -.117l.001 -9.536a1 1 0 0 1 .5 -.865a2.998 2.998 0 0 0 1.492 -2.397l.007 -.202v-1a3 3 0 0 1 3 -3z" /><path d="M5 10a1 1 0 0 1 .993 .883l.007 .117v9a1 1 0 0 1 -.883 .993l-.117 .007h-1a2 2 0 0 1 -1.995 -1.85l-.005 -.15v-7a2 2 0 0 1 1.85 -1.995l.15 -.005h1z" />
@@ -0,0 +1 @@
1
+ <path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M7 11v8a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1v-7a1 1 0 0 1 1 -1h3a4 4 0 0 0 4 -4v-1a2 2 0 0 1 4 0v5h3a2 2 0 0 1 2 2l-1 5a2 3 0 0 1 -2 2h-7a3 3 0 0 1 -3 -3" />
@@ -0,0 +1 @@
1
+ <path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M20 6a1 1 0 0 1 .117 1.993l-.117 .007h-.081l-.919 11a3 3 0 0 1 -2.824 2.995l-.176 .005h-8c-1.598 0 -2.904 -1.249 -2.992 -2.75l-.005 -.167l-.923 -11.083h-.08a1 1 0 0 1 -.117 -1.993l.117 -.007h16z" /><path d="M14 2a2 2 0 0 1 2 2a1 1 0 0 1 -1.993 .117l-.007 -.117h-4l-.007 .117a1 1 0 0 1 -1.993 -.117a2 2 0 0 1 1.85 -1.995l.15 -.005h4z" />
@@ -0,0 +1 @@
1
+ <path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M4 7l16 0" /><path d="M10 11l0 6" /><path d="M14 11l0 6" /><path d="M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12" /><path d="M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3" />
@@ -0,0 +1 @@
1
+ <path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M10 3a1 1 0 1 0 2 0a1 1 0 0 0 -2 0" /><path d="M3 14l4 1l.5 -.5" /><path d="M12 18v-3l-3 -2.923l.75 -5.077" /><path d="M6 10v-2l4 -1l2.5 2.5l2.5 .5" /><path d="M21 22a1 1 0 0 0 -1 -1h-16a1 1 0 0 0 -1 1" /><path d="M18 21l1 -11l2 -1" />
@@ -46,6 +46,20 @@ en:
46
46
  switchboard_base_url: Base URL
47
47
  switchboard_stack_id: Stack ID
48
48
  switchboard_stack_api_token: API Token
49
+ nav:
50
+ icons:
51
+ dead: skull
52
+ running: treadmill
53
+ sleeping: bed-outline
54
+ alive: heartbeat
55
+ primary: binary-tree-2
56
+ add: circle-plus-outline
57
+ delete: trash-outline
58
+ more_menu: dots-vertical
59
+ replay: rotate
60
+ start: player-play-outline
61
+ demote: thumb-down-outline
62
+ promote: thumb-up-outline
49
63
  system_configurations:
50
64
  show:
51
65
  title: "%{name} System Configuration"
@@ -10,24 +10,25 @@ module StandardModel
10
10
  include Mongoid::Timestamps
11
11
  include App47Logger
12
12
 
13
+ unless defined? FILER_NAMES
14
+ STANDARD_FIELDS = %w[created_at updated_at _type _id search_text sort_text last_modified_by_email
15
+ last_modified_by_name created_by_email created_by_name last_modified_by_id created_by_id
16
+ last_modified_by_type created_by_type].sort
17
+ end
18
+
13
19
  def self.included(base)
14
20
  base.class_eval do
15
- #
21
+ # Constants
16
22
  # Fields
17
- #
18
23
  field :last_modified_by_email, type: String
19
24
  field :last_modified_by_name, type: String
20
25
  field :created_by_email, type: String
21
26
  field :created_by_name, type: String
22
- #
23
27
  # Relationships
24
- #
25
28
  belongs_to :last_modified_by, polymorphic: true, optional: true
26
29
  belongs_to :created_by, polymorphic: true, optional: true
27
30
  has_many Web47core::Config.audit_model_log_symbol, dependent: :nullify, inverse_of: :model
28
- #
29
31
  # Callbacks
30
- #
31
32
  after_save :clear_cache
32
33
  before_destroy :clear_cache
33
34
  before_save :capture_user_info
@@ -62,7 +63,7 @@ module StandardModel
62
63
  #
63
64
  def allowed_param_names(filter_names = [], include_relationships = true)
64
65
  # Always filter out the mongoid reserved items
65
- filter_names += %w[created_at updated_at _type _id search_text sort_text]
66
+ filter_names += STANDARD_FIELDS
66
67
  associations = many_to_many_associations
67
68
  # filter out the relationship names so we don't have dups
68
69
  associations.each { |association| filter_names << association.keys.first }
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Web47core
4
- VERSION = '3.2.38'
4
+ VERSION = '3.2.51'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: web47core
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.38
4
+ version: 3.2.51
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Schroeder
@@ -529,14 +529,17 @@ files:
529
529
  - app/helpers/core_dropdown_helper.rb
530
530
  - app/helpers/core_flash_toast_helper.rb
531
531
  - app/helpers/core_floating_action_button_helper.rb
532
+ - app/helpers/core_form_checkbox_helper.rb
532
533
  - app/helpers/core_form_helper.rb
534
+ - app/helpers/core_form_input_helper.rb
535
+ - app/helpers/core_form_select_helper.rb
536
+ - app/helpers/core_form_textarea_helper.rb
533
537
  - app/helpers/core_helper.rb
534
538
  - app/helpers/core_html5_form_helper.rb
535
539
  - app/helpers/core_job_state_helper.rb
536
540
  - app/helpers/core_link_helper.rb
537
541
  - app/helpers/core_menu_helper.rb
538
542
  - app/helpers/core_nav_bar_helper.rb
539
- - app/helpers/core_remix_icon_helper.rb
540
543
  - app/helpers/core_select_two_helper.rb
541
544
  - app/helpers/core_sso_servers_helper.rb
542
545
  - app/helpers/core_table_helper.rb
@@ -553,7 +556,30 @@ files:
553
556
  - app/views/delayed_job_workers/index.html.haml
554
557
  - app/views/delayed_jobs/index.html.haml
555
558
  - app/views/delayed_jobs/show.html.haml
559
+ - app/views/icons/_bed-filled.html.erb
560
+ - app/views/icons/_bed-outline.html.erb
561
+ - app/views/icons/_binary-tree-2.html.erb
562
+ - app/views/icons/_cancel.html.erb
556
563
  - app/views/icons/_check.html.erb
564
+ - app/views/icons/_circle-plus-filled.html.erb
565
+ - app/views/icons/_circle-plus-outline.html.erb
566
+ - app/views/icons/_dots-vertical.html.erb
567
+ - app/views/icons/_edit.html.erb
568
+ - app/views/icons/_heartbeat.html.erb
569
+ - app/views/icons/_hourglass.html.erb
570
+ - app/views/icons/_player-play-filled.html.erb
571
+ - app/views/icons/_player-play-outline.html.erb
572
+ - app/views/icons/_repeat.html.erb
573
+ - app/views/icons/_rotate.html.erb
574
+ - app/views/icons/_run.html.erb
575
+ - app/views/icons/_skull.html.erb
576
+ - app/views/icons/_thumb-down-filled.html.erb
577
+ - app/views/icons/_thumb-down-outline.html.erb
578
+ - app/views/icons/_thumb-up-filled.html.erb
579
+ - app/views/icons/_thumb-up-outline.html.erb
580
+ - app/views/icons/_trash-filled.html.erb
581
+ - app/views/icons/_trash-outline.html.erb
582
+ - app/views/icons/_treadmill.html.erb
557
583
  - app/views/status/index.html.haml
558
584
  - app/views/system_configurations/edit.html.haml
559
585
  - app/views/system_configurations/show.html.haml
@@ -1,23 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- #
4
- # Draw remix icons on the page, includes tooltip mark up
5
- #
6
- module CoreRemixIconHelper
7
- def menu_remix_icon(icon_name, classes: [], type: :line, tooltip_text: nil, tooltip_placement: 'top')
8
- classes += %w[menu-icon]
9
- remix_icon(icon_name, classes: classes, type: type, tooltip_text: tooltip_text, tooltip_placement: tooltip_placement, size: 20)
10
- end
11
-
12
- # Render a material icon tag
13
- def remix_icon(icon_name, classes: [], type: :line, tooltip_text: nil, tooltip_placement: 'top', size: 14)
14
- classes += ['ri', 'icon-base', "ri-#{icon_name}-#{type}", "icon-#{size}px"]
15
- options = { class: classes }
16
- if tooltip_text.present?
17
- options['data-bs-toggle'] = 'tooltip'
18
- options['data-bs-placement'] = tooltip_placement
19
- options['data-bs-title'] = tooltip_text
20
- end
21
- content_tag(:i, options) {}
22
- end
23
- end