ndr_ui 4.1.4 → 5.0.0
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/CHANGELOG.md +6 -7
- data/Rakefile +3 -3
- data/app/assets/fonts/bootstrap-icons.woff +0 -0
- data/app/assets/fonts/bootstrap-icons.woff2 +0 -0
- data/app/assets/javascripts/ndr_ui/index.js +1 -0
- data/app/assets/stylesheets/ndr_ui/bootstrap-icons.scss +2090 -0
- data/app/assets/stylesheets/ndr_ui/index.scss +5 -3
- data/app/builders/ndr_ui/bootstrap/datepicker.rb +4 -4
- data/app/builders/ndr_ui/bootstrap/form_control_class.rb +2 -2
- data/app/builders/ndr_ui/bootstrap/inline_errors_and_warnings.rb +2 -2
- data/app/builders/ndr_ui/bootstrap/input_group_addons.rb +4 -10
- data/app/builders/ndr_ui/bootstrap/readonly.rb +12 -12
- data/app/builders/ndr_ui/bootstrap_builder.rb +32 -25
- data/app/helpers/ndr_ui/bootstrap/{accordion.rb → accordion_helper.rb} +49 -16
- data/app/helpers/ndr_ui/bootstrap/breadcrumbs_helper.rb +4 -4
- data/app/helpers/ndr_ui/bootstrap/card_helper.rb +94 -0
- data/app/helpers/ndr_ui/bootstrap/dropdown_helper.rb +16 -13
- data/app/helpers/ndr_ui/bootstrap/modal_helper.rb +15 -13
- data/app/helpers/ndr_ui/bootstrap_helper.rb +68 -64
- data/app/helpers/ndr_ui/css_helper.rb +1 -4
- data/lib/ndr_ui/engine.rb +2 -1
- data/lib/ndr_ui/version.rb +1 -1
- metadata +63 -16
- data/SECURITY.md +0 -35
- data/app/helpers/ndr_ui/bootstrap/panel_helper.rb +0 -87
|
@@ -50,6 +50,7 @@ module NdrUi
|
|
|
50
50
|
# # => <div class="modal-header">Check it out!!</div>
|
|
51
51
|
def bootstrap_modal_header_tag(*args, &block)
|
|
52
52
|
return bootstrap_modal_header_tag(capture(&block), *args) if block_given?
|
|
53
|
+
|
|
53
54
|
options = args.extract_options!
|
|
54
55
|
options.stringify_keys!
|
|
55
56
|
|
|
@@ -58,10 +59,11 @@ module NdrUi
|
|
|
58
59
|
# end
|
|
59
60
|
|
|
60
61
|
heading = content_tag(:h4, args.first, class: 'modal-title')
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
62
|
+
if options.delete('dismissible')
|
|
63
|
+
heading = button_tag(content_tag(:span, '×', 'aria-hidden': 'true'),
|
|
64
|
+
type: 'button', class: 'btn-close', 'data-bs-dismiss': 'modal',
|
|
65
|
+
'aria-label': 'Close') + heading
|
|
66
|
+
end
|
|
65
67
|
content_tag(:div, heading, class: 'modal-header')
|
|
66
68
|
end
|
|
67
69
|
|
|
@@ -109,21 +111,21 @@ module NdrUi
|
|
|
109
111
|
# <%= bootstrap_modal_footer_tag('Button text', readonly: true)
|
|
110
112
|
# # =>
|
|
111
113
|
# <div class="modal-footer">
|
|
112
|
-
# <button name="button" type="submit" class="btn btn-default" data-dismiss="modal">
|
|
114
|
+
# <button name="button" type="submit" class="btn btn-default" data-bs-dismiss="modal">
|
|
113
115
|
# Close
|
|
114
116
|
# </button>
|
|
115
117
|
# </div>
|
|
116
118
|
#
|
|
117
119
|
# <%= bootstrap_modal_footer_tag(readonly: false) do
|
|
118
|
-
# button_tag('Non-readonly default', class: 'btn btn-default',
|
|
119
|
-
# button_tag('Non-readonly primary', class: 'btn btn-primary',
|
|
120
|
+
# button_tag('Non-readonly default', class: 'btn btn-default', 'data-bs-dismiss': 'modal') +
|
|
121
|
+
# button_tag('Non-readonly primary', class: 'btn btn-primary', 'data-bs-dismiss': 'modal')
|
|
120
122
|
# end %>
|
|
121
123
|
# # =>
|
|
122
124
|
# <div class="modal-footer">
|
|
123
|
-
# <button name="button" type="submit" class="btn btn-default" data-dismiss="modal">
|
|
125
|
+
# <button name="button" type="submit" class="btn btn-default" data-bs-dismiss="modal">
|
|
124
126
|
# Non-readonly default
|
|
125
127
|
# </button>
|
|
126
|
-
# <button name="button" type="submit" class="btn btn-primary" data-dismiss="modal">
|
|
128
|
+
# <button name="button" type="submit" class="btn btn-primary" data-bs-dismiss="modal">
|
|
127
129
|
# Non-readonly primary
|
|
128
130
|
# </button>
|
|
129
131
|
# </div>
|
|
@@ -131,7 +133,7 @@ module NdrUi
|
|
|
131
133
|
# <%= bootstrap_modal_footer_tag('Button text') %>
|
|
132
134
|
# # =>
|
|
133
135
|
# <div class="modal-footer">
|
|
134
|
-
# <button name="button" type="submit" class="btn btn-default" data-dismiss="modal">
|
|
136
|
+
# <button name="button" type="submit" class="btn btn-default" data-bs-dismiss="modal">
|
|
135
137
|
# Button text
|
|
136
138
|
# </button>
|
|
137
139
|
# </div>
|
|
@@ -139,7 +141,7 @@ module NdrUi
|
|
|
139
141
|
# <%= bootstrap_modal_footer_tag %>
|
|
140
142
|
# # =>
|
|
141
143
|
# <div class="modal-footer">
|
|
142
|
-
# <button name="button" type="submit" class="btn btn-default" data-dismiss="modal">
|
|
144
|
+
# <button name="button" type="submit" class="btn btn-default" data-bs-dismiss="modal">
|
|
143
145
|
# Don't save
|
|
144
146
|
# </button>
|
|
145
147
|
# <input type="submit" name="commit" value="Save" class="btn btn-primary"
|
|
@@ -189,7 +191,7 @@ module NdrUi
|
|
|
189
191
|
# Pear form
|
|
190
192
|
# </div>
|
|
191
193
|
# <div class="modal-footer">
|
|
192
|
-
# <button type="button" class="btn btn-default" data-dismiss="modal">
|
|
194
|
+
# <button type="button" class="btn btn-default" data-bs-dismiss="modal">
|
|
193
195
|
# Don't save
|
|
194
196
|
# </button>
|
|
195
197
|
# <input name="commit" class="btn-primary btn" data-disable-with="Saving…"
|
|
@@ -216,7 +218,7 @@ module NdrUi
|
|
|
216
218
|
end
|
|
217
219
|
|
|
218
220
|
def bootstrap_modal_button(label)
|
|
219
|
-
button_tag(label, class: 'btn btn-default',
|
|
221
|
+
button_tag(label, class: 'btn btn-default', 'data-bs-dismiss': 'modal')
|
|
220
222
|
end
|
|
221
223
|
|
|
222
224
|
private
|
|
@@ -1,10 +1,23 @@
|
|
|
1
1
|
module NdrUi
|
|
2
2
|
# Provides helper methods for the Twitter Bootstrap framework
|
|
3
3
|
module BootstrapHelper # rubocop:disable Metrics/ModuleLength
|
|
4
|
+
include ::NdrUi::Bootstrap::AccordionHelper
|
|
4
5
|
include ::NdrUi::Bootstrap::BreadcrumbsHelper
|
|
6
|
+
include ::NdrUi::Bootstrap::CardHelper
|
|
5
7
|
include ::NdrUi::Bootstrap::DropdownHelper
|
|
6
8
|
include ::NdrUi::Bootstrap::ModalHelper
|
|
7
|
-
|
|
9
|
+
|
|
10
|
+
TYPE_STYLE_MAP = {
|
|
11
|
+
important: :danger,
|
|
12
|
+
default: :secondary
|
|
13
|
+
}.freeze
|
|
14
|
+
|
|
15
|
+
# ensure `form-control` and `form-select` classes added to select_tag
|
|
16
|
+
def select_tag(name, option_tags = nil, options = {})
|
|
17
|
+
options = css_class_options_merge(options, %w[form-control form-select])
|
|
18
|
+
|
|
19
|
+
super(name, option_tags, options)
|
|
20
|
+
end
|
|
8
21
|
|
|
9
22
|
# Creates an alert box of the given +type+. It supports the following alert box types
|
|
10
23
|
# <tt>:alert</tt>, <tt>:danger</tt>, <tt>:info</tt> and <tt>:success</tt>.
|
|
@@ -29,8 +42,8 @@ module NdrUi
|
|
|
29
42
|
# ==== Examples
|
|
30
43
|
#
|
|
31
44
|
# <%= bootstrap_alert_tag(:info, 'Check it out!!') %>
|
|
32
|
-
# # => <div class="alert alert-info"><a href="#" class="close"
|
|
33
|
-
# data-dismiss="alert"
|
|
45
|
+
# # => <div class="alert alert-info"><a href="#" class="btn-close"
|
|
46
|
+
# data-bs-dismiss="alert"></a>Check it out!!</div>
|
|
34
47
|
#
|
|
35
48
|
# You can use a block as well if your alert message is hard to fit into the message parameter.
|
|
36
49
|
# ERb example:
|
|
@@ -38,8 +51,8 @@ module NdrUi
|
|
|
38
51
|
# <%= bootstrap_alert_tag(:info) do %>
|
|
39
52
|
# Check it out!!
|
|
40
53
|
# <% end %>
|
|
41
|
-
# # => <div class="alert alert-info"><button type="button" class="close"
|
|
42
|
-
# data-dismiss="alert"
|
|
54
|
+
# # => <div class="alert alert-info"><button type="button" class="btn-close"
|
|
55
|
+
# data-bs-dismiss="alert"></button>Check it out!!</div>
|
|
43
56
|
#
|
|
44
57
|
# Ids for css and/or javascript are easy to produce:
|
|
45
58
|
#
|
|
@@ -51,7 +64,7 @@ module NdrUi
|
|
|
51
64
|
if block_given?
|
|
52
65
|
message = capture(&block)
|
|
53
66
|
options = args[1] || {}
|
|
54
|
-
|
|
67
|
+
bootstrap_alert_tag(type, message, options)
|
|
55
68
|
else
|
|
56
69
|
message = args[1] || ''
|
|
57
70
|
options = args[2] || {}
|
|
@@ -65,10 +78,9 @@ module NdrUi
|
|
|
65
78
|
end
|
|
66
79
|
options['class'] = classes.join(' ')
|
|
67
80
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
"data-dismiss": 'alert') + message if options.delete('dismissible')
|
|
81
|
+
if options.delete('dismissible')
|
|
82
|
+
message = button_tag('', type: 'button', class: 'btn-close', 'data-bs-dismiss': 'alert') + message
|
|
83
|
+
end
|
|
72
84
|
content_tag(:div, message, options)
|
|
73
85
|
end
|
|
74
86
|
end
|
|
@@ -87,8 +99,8 @@ module NdrUi
|
|
|
87
99
|
# # => <span class="label label-info">Check it out!!</span>
|
|
88
100
|
#
|
|
89
101
|
def bootstrap_label_tag(type, message)
|
|
90
|
-
|
|
91
|
-
content_tag(:span, message, class:
|
|
102
|
+
style = TYPE_STYLE_MAP[type] || type
|
|
103
|
+
content_tag(:span, message, class: "badge text-bg-#{style}")
|
|
92
104
|
end
|
|
93
105
|
|
|
94
106
|
# Creates an bootstrap badge of the given +type+. Bootstrap 3 does not support any types.
|
|
@@ -100,13 +112,11 @@ module NdrUi
|
|
|
100
112
|
# ==== Examples
|
|
101
113
|
#
|
|
102
114
|
# <%= bootstrap_badge_tag(:success, 'Check it out!!') %>
|
|
103
|
-
# # => <span class="badge">Check it out!!</span>
|
|
115
|
+
# # => <span class="badge rounded-pill text-bg-success">Check it out!!</span>
|
|
104
116
|
#
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
def bootstrap_badge_tag(_type, count)
|
|
109
|
-
content_tag(:span, count, class: 'badge')
|
|
117
|
+
def bootstrap_badge_tag(type, count)
|
|
118
|
+
style = TYPE_STYLE_MAP[type] || type
|
|
119
|
+
content_tag(:span, count, class: "badge rounded-pill text-bg-#{style}")
|
|
110
120
|
end
|
|
111
121
|
|
|
112
122
|
# Creates a simple bootstrap navigation caret.
|
|
@@ -132,13 +142,15 @@ module NdrUi
|
|
|
132
142
|
# ==== Examples
|
|
133
143
|
#
|
|
134
144
|
# <%= bootstrap_dropdown_toggle_tag('Check it out!!') %>
|
|
135
|
-
# # => <a href="#" class="dropdown-toggle" data-toggle="dropdown">
|
|
136
|
-
# out!! <b class="caret"></b></a>
|
|
145
|
+
# # => <a href="#" role="button" class="nav-link dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false">
|
|
146
|
+
# Check it out!! <b class="caret"></b></a>
|
|
137
147
|
def bootstrap_dropdown_toggle_tag(body)
|
|
138
148
|
link_to(ERB::Util.html_escape(body) + ' '.html_safe + bootstrap_caret_tag,
|
|
139
149
|
'#',
|
|
140
|
-
|
|
141
|
-
'
|
|
150
|
+
role: 'button',
|
|
151
|
+
class: 'nav-link dropdown-toggle',
|
|
152
|
+
'data-bs-toggle': 'dropdown',
|
|
153
|
+
'aria-expanded': 'false')
|
|
142
154
|
end
|
|
143
155
|
|
|
144
156
|
# Creates a simple bootstrap icon.
|
|
@@ -149,10 +161,17 @@ module NdrUi
|
|
|
149
161
|
#
|
|
150
162
|
# ==== Examples
|
|
151
163
|
#
|
|
152
|
-
# <%= bootstrap_icon_tag(:search) %>
|
|
164
|
+
# <%= bootstrap_icon_tag(:search, :bi) %>
|
|
165
|
+
# # => <i class="bi-search"></i>
|
|
166
|
+
#
|
|
167
|
+
# <%= bootstrap_icon_tag(:search, :glyphicon) %>
|
|
153
168
|
# # => <span class="glyphicon glyphicon-search"></span>
|
|
154
|
-
def bootstrap_icon_tag(type)
|
|
155
|
-
|
|
169
|
+
def bootstrap_icon_tag(type, set = :glyphicon)
|
|
170
|
+
if set == :bi
|
|
171
|
+
content_tag(:i, '', class: "bi-#{type}")
|
|
172
|
+
else
|
|
173
|
+
content_tag(:span, '', class: "glyphicon glyphicon-#{type}")
|
|
174
|
+
end
|
|
156
175
|
end
|
|
157
176
|
|
|
158
177
|
# Creates a simple bootstrap icon spinner.
|
|
@@ -184,16 +203,16 @@ module NdrUi
|
|
|
184
203
|
# ==== Examples
|
|
185
204
|
#
|
|
186
205
|
# <%= bootstrap_tab_nav_tag("Fruits", "#fruits", true) %>
|
|
187
|
-
# # => <li class="active"><a href="#fruits" data-toggle="tab">Fruits</a></li>
|
|
206
|
+
# # => <li class="active"><a href="#fruits" data-bs-toggle="tab">Fruits</a></li>
|
|
188
207
|
def bootstrap_tab_nav_tag(title, linkto, active = false)
|
|
189
208
|
content_tag('li',
|
|
190
|
-
link_to(title, linkto,
|
|
209
|
+
link_to(title, linkto, 'data-bs-toggle': 'tab'),
|
|
191
210
|
active ? { class: 'active' } : {})
|
|
192
211
|
end
|
|
193
212
|
|
|
194
213
|
# Convenience wrapper for a bootstrap_list_link_to with badge
|
|
195
214
|
def bootstrap_list_badge_and_link_to(type, count, name, path)
|
|
196
|
-
html = content_tag(:div, bootstrap_badge_tag(type, count), class: '
|
|
215
|
+
html = content_tag(:div, bootstrap_badge_tag(type, count), class: 'float-end') + name
|
|
197
216
|
bootstrap_list_link_to(html, path)
|
|
198
217
|
end
|
|
199
218
|
|
|
@@ -219,25 +238,21 @@ module NdrUi
|
|
|
219
238
|
|
|
220
239
|
# Identical signature to form_for, but uses NdrUi::BootstrapBuilder.
|
|
221
240
|
# See ActionView::Helpers::FormHelper for details
|
|
222
|
-
def bootstrap_form_for(record_or_name_or_array, *args, &
|
|
241
|
+
def bootstrap_form_for(record_or_name_or_array, *args, &_proc)
|
|
223
242
|
options = args.extract_options!
|
|
224
243
|
options[:html] ||= {}
|
|
225
244
|
|
|
226
245
|
# :horizontal
|
|
227
|
-
|
|
228
|
-
# set the form html class for horizontal bootstrap forms
|
|
229
|
-
options[:html][:class] ||= ''
|
|
230
|
-
classes = (options[:html][:class].split(' ') << 'form-horizontal').uniq.join(' ')
|
|
231
|
-
options[:html][:class] = classes
|
|
232
|
-
end
|
|
246
|
+
horizontal = options.delete(:horizontal)
|
|
233
247
|
|
|
234
248
|
# stimuls controller, default `form_controller`
|
|
235
249
|
options[:html][:'data-controller'] ||= ''
|
|
236
|
-
controllers = (options[:html][:'data-controller'].split
|
|
250
|
+
controllers = (options[:html][:'data-controller'].split << 'form').uniq.join(' ')
|
|
237
251
|
options[:html][:'data-controller'] = controllers
|
|
238
252
|
|
|
239
253
|
# We switch autocomplete off by default
|
|
240
254
|
raise 'autocomplete should be defined an html option' if options[:autocomplete]
|
|
255
|
+
|
|
241
256
|
options[:html][:autocomplete] ||= 'off'
|
|
242
257
|
|
|
243
258
|
form_for(record_or_name_or_array, *(args << options.merge(builder: NdrUi::BootstrapBuilder))) do |form|
|
|
@@ -256,21 +271,14 @@ module NdrUi
|
|
|
256
271
|
options[:builder] = NdrUi::BootstrapBuilder
|
|
257
272
|
horizontal = options.delete(:horizontal)
|
|
258
273
|
|
|
259
|
-
# :horizontal
|
|
260
|
-
if horizontal
|
|
261
|
-
# set the form html class for horizontal bootstrap forms
|
|
262
|
-
options[:html][:class] ||= ''
|
|
263
|
-
classes = (options[:html][:class].split(' ') << 'form-horizontal').uniq.join(' ')
|
|
264
|
-
options[:html][:class] = classes
|
|
265
|
-
end
|
|
266
|
-
|
|
267
274
|
# stimuls controller, default `form_controller`
|
|
268
275
|
options[:html][:'data-controller'] ||= ''
|
|
269
|
-
controllers = (options[:html][:'data-controller'].split
|
|
276
|
+
controllers = (options[:html][:'data-controller'].split << 'form').uniq.join(' ')
|
|
270
277
|
options[:html][:'data-controller'] = controllers
|
|
271
278
|
|
|
272
279
|
# We switch autocomplete off by default
|
|
273
280
|
raise 'autocomplete should be defined an html option' if options[:autocomplete]
|
|
281
|
+
|
|
274
282
|
options[:html][:autocomplete] ||= 'off'
|
|
275
283
|
|
|
276
284
|
form_with(**options) do |form|
|
|
@@ -331,7 +339,7 @@ module NdrUi
|
|
|
331
339
|
#
|
|
332
340
|
# <%= bootstrap_progressbar_tag(40), type: :danger %>
|
|
333
341
|
# # => <div class="progress progress-striped active" title="40%"><div
|
|
334
|
-
# class="progress-bar
|
|
342
|
+
# class="progress-bar bg-danger" style="width:40%"></div></div>
|
|
335
343
|
#
|
|
336
344
|
# ==== Browser compatibility
|
|
337
345
|
#
|
|
@@ -349,7 +357,7 @@ module NdrUi
|
|
|
349
357
|
classes << 'progress-striped'
|
|
350
358
|
|
|
351
359
|
type = options.delete('type').to_s
|
|
352
|
-
type = "
|
|
360
|
+
type = " bg-#{type}" if type.present?
|
|
353
361
|
|
|
354
362
|
# Animate the progress bar unless something has broken:
|
|
355
363
|
classes << 'active' unless type == 'danger'
|
|
@@ -372,22 +380,18 @@ module NdrUi
|
|
|
372
380
|
# bootstrap_horizontal_form_group("The Label", [3, 9]) { 'This is the content' }
|
|
373
381
|
# # =>
|
|
374
382
|
# <div class="form-group">
|
|
375
|
-
# <label class="col-sm-3
|
|
383
|
+
# <label class="col-sm-3 col-form-label">The Label</label>
|
|
376
384
|
# <div class="col-sm-9">This is the content</div>
|
|
377
385
|
# </div>
|
|
378
386
|
#
|
|
379
387
|
def bootstrap_horizontal_form_group(label = nil, ratio = [2, 10], &block)
|
|
380
|
-
label, ratio = nil, label if label.is_a?(Array)
|
|
381
|
-
|
|
382
388
|
l, r = ratio[0..1].map(&:to_i)
|
|
383
389
|
offset = label.nil? ? " col-sm-offset-#{l}" : ''
|
|
384
390
|
|
|
385
391
|
# Main content:
|
|
386
392
|
content = content_tag(:div, class: "col-sm-#{r}" + offset, &block)
|
|
387
393
|
# Prepend optional label:
|
|
388
|
-
unless label.nil?
|
|
389
|
-
content = content_tag(:label, label, class: "col-sm-#{l} control-label") + content
|
|
390
|
-
end
|
|
394
|
+
content = content_tag(:label, label, class: "col-sm-#{l} col-form-label") + content unless label.nil?
|
|
391
395
|
|
|
392
396
|
content_tag(:div, content, class: 'form-group')
|
|
393
397
|
end
|
|
@@ -454,12 +458,12 @@ module NdrUi
|
|
|
454
458
|
# ==== Examples
|
|
455
459
|
#
|
|
456
460
|
# <%= new_link('#') %>
|
|
457
|
-
# # => <a title="New" class="btn btn-primary btn-
|
|
461
|
+
# # => <a title="New" class="btn btn-primary btn-sm" href="#">
|
|
458
462
|
# <span class="glyphicon glyphicon-plus-sign"></span>
|
|
459
463
|
# </a>
|
|
460
464
|
#
|
|
461
465
|
# <%= new_link(Post.new) %>
|
|
462
|
-
# # => <a title="New" class="btn btn-primary btn-
|
|
466
|
+
# # => <a title="New" class="btn btn-primary btn-sm" href="/posts/new">
|
|
463
467
|
# <span class="glyphicon glyphicon-plus-sign"></span>
|
|
464
468
|
# </a>
|
|
465
469
|
#
|
|
@@ -469,7 +473,7 @@ module NdrUi
|
|
|
469
473
|
path = new_polymorphic_path(path) if can_generate_polymorphic_path?(path)
|
|
470
474
|
|
|
471
475
|
defaults = {
|
|
472
|
-
icon: 'plus-sign', title: 'New', path: path, class: 'btn btn-primary btn-
|
|
476
|
+
icon: 'plus-sign', title: 'New', path: path, class: 'btn btn-primary btn-sm'
|
|
473
477
|
}
|
|
474
478
|
|
|
475
479
|
link_to_with_icon(defaults.merge(options))
|
|
@@ -484,7 +488,7 @@ module NdrUi
|
|
|
484
488
|
# ==== Examples
|
|
485
489
|
#
|
|
486
490
|
# <%= details_link('#') %>
|
|
487
|
-
# # => <a title="Details" class="btn btn-default btn-
|
|
491
|
+
# # => <a title="Details" class="btn btn-default btn-sm" href="#">
|
|
488
492
|
# <span class="glyphicon glyphicon-share-alt"></span>
|
|
489
493
|
# </a>
|
|
490
494
|
#
|
|
@@ -503,7 +507,7 @@ module NdrUi
|
|
|
503
507
|
# ==== Examples
|
|
504
508
|
#
|
|
505
509
|
# <%= edit_link(#) %>
|
|
506
|
-
# # => <a title="Edit" class="btn btn-default btn-
|
|
510
|
+
# # => <a title="Edit" class="btn btn-default btn-sm" href="#">
|
|
507
511
|
# <span class="glyphicon glyphicon-pencil"></span>
|
|
508
512
|
# </a>
|
|
509
513
|
#
|
|
@@ -524,7 +528,7 @@ module NdrUi
|
|
|
524
528
|
# ==== Examples
|
|
525
529
|
#
|
|
526
530
|
# <%= delete_link('#') %>
|
|
527
|
-
# # => <a title="Delete" class="btn btn-
|
|
531
|
+
# # => <a title="Delete" class="btn btn-sm btn-outline-danger" rel="nofollow" href="#"
|
|
528
532
|
# data-method="delete" data-confirm="Are you sure?">
|
|
529
533
|
# <span class="glyphicon glyphicon-trash icon-white"></span>
|
|
530
534
|
# </a>'
|
|
@@ -533,8 +537,8 @@ module NdrUi
|
|
|
533
537
|
|
|
534
538
|
defaults = {
|
|
535
539
|
icon: 'trash icon-white', title: 'Delete', path: path,
|
|
536
|
-
class: 'btn btn-
|
|
537
|
-
'data-confirm': I18n.
|
|
540
|
+
class: 'btn btn-sm btn-outline-danger', method: :delete,
|
|
541
|
+
'data-confirm': I18n.t(:'ndr_ui.confirm_delete', locale: options[:locale])
|
|
538
542
|
}
|
|
539
543
|
|
|
540
544
|
link_to_with_icon(defaults.merge(options))
|
|
@@ -575,13 +579,13 @@ module NdrUi
|
|
|
575
579
|
# ==== Examples
|
|
576
580
|
#
|
|
577
581
|
# <%= link_to_with_icon( { icon: 'trash icon-white', title: 'Delete', path: '#' } ) %>
|
|
578
|
-
# # => <a title="Delete" class="btn btn-default btn-
|
|
582
|
+
# # => <a title="Delete" class="btn btn-default btn-sm" href="#">
|
|
579
583
|
# <span class="glyphicon glyphicon-trash icon-white"></span>
|
|
580
584
|
# </a>'
|
|
581
585
|
def link_to_with_icon(options = {})
|
|
582
|
-
options[:class] ||= 'btn btn-default btn-
|
|
586
|
+
options[:class] ||= 'btn btn-default btn-sm'
|
|
583
587
|
icon = bootstrap_icon_tag(options.delete(:icon))
|
|
584
|
-
content = options.delete(:text) ? icon
|
|
588
|
+
content = options.delete(:text) ? "#{icon} #{options[:title]}" : icon
|
|
585
589
|
link_to content, options.delete(:path), options
|
|
586
590
|
end
|
|
587
591
|
|
|
@@ -6,10 +6,7 @@ module NdrUi
|
|
|
6
6
|
options = options.symbolize_keys
|
|
7
7
|
css_classes += options[:class].split(' ') if options.include?(:class)
|
|
8
8
|
yield(css_classes) if block_given?
|
|
9
|
-
options[:class] = css_classes.join(' ') unless css_classes.empty?
|
|
10
|
-
unless css_classes == css_classes.uniq
|
|
11
|
-
fail "Multiple css class definitions: #{css_classes.inspect}"
|
|
12
|
-
end
|
|
9
|
+
options[:class] = css_classes.uniq.join(' ') unless css_classes.empty?
|
|
13
10
|
|
|
14
11
|
options
|
|
15
12
|
end
|
data/lib/ndr_ui/engine.rb
CHANGED
data/lib/ndr_ui/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,28 +1,43 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ndr_ui
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 5.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- NDR Development Team
|
|
8
|
+
autorequire:
|
|
8
9
|
bindir: bin
|
|
9
10
|
cert_chain: []
|
|
10
|
-
date:
|
|
11
|
+
date: 2025-01-24 00:00:00.000000000 Z
|
|
11
12
|
dependencies:
|
|
12
13
|
- !ruby/object:Gem::Dependency
|
|
13
|
-
name: bootstrap
|
|
14
|
+
name: bootstrap
|
|
14
15
|
requirement: !ruby/object:Gem::Requirement
|
|
15
16
|
requirements:
|
|
16
17
|
- - "~>"
|
|
17
18
|
- !ruby/object:Gem::Version
|
|
18
|
-
version: 3.
|
|
19
|
+
version: 5.3.3
|
|
19
20
|
type: :runtime
|
|
20
21
|
prerelease: false
|
|
21
22
|
version_requirements: !ruby/object:Gem::Requirement
|
|
22
23
|
requirements:
|
|
23
24
|
- - "~>"
|
|
24
25
|
- !ruby/object:Gem::Version
|
|
25
|
-
version: 3.
|
|
26
|
+
version: 5.3.3
|
|
27
|
+
- !ruby/object:Gem::Dependency
|
|
28
|
+
name: dartsass-sprockets
|
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
|
30
|
+
requirements:
|
|
31
|
+
- - ">="
|
|
32
|
+
- !ruby/object:Gem::Version
|
|
33
|
+
version: '0'
|
|
34
|
+
type: :runtime
|
|
35
|
+
prerelease: false
|
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
37
|
+
requirements:
|
|
38
|
+
- - ">="
|
|
39
|
+
- !ruby/object:Gem::Version
|
|
40
|
+
version: '0'
|
|
26
41
|
- !ruby/object:Gem::Dependency
|
|
27
42
|
name: jquery-rails
|
|
28
43
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -43,20 +58,20 @@ dependencies:
|
|
|
43
58
|
requirements:
|
|
44
59
|
- - ">="
|
|
45
60
|
- !ruby/object:Gem::Version
|
|
46
|
-
version: '
|
|
61
|
+
version: '6.1'
|
|
47
62
|
- - "<"
|
|
48
63
|
- !ruby/object:Gem::Version
|
|
49
|
-
version: '
|
|
64
|
+
version: '7.3'
|
|
50
65
|
type: :runtime
|
|
51
66
|
prerelease: false
|
|
52
67
|
version_requirements: !ruby/object:Gem::Requirement
|
|
53
68
|
requirements:
|
|
54
69
|
- - ">="
|
|
55
70
|
- !ruby/object:Gem::Version
|
|
56
|
-
version: '
|
|
71
|
+
version: '6.1'
|
|
57
72
|
- - "<"
|
|
58
73
|
- !ruby/object:Gem::Version
|
|
59
|
-
version: '
|
|
74
|
+
version: '7.3'
|
|
60
75
|
- !ruby/object:Gem::Dependency
|
|
61
76
|
name: sprockets
|
|
62
77
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -99,20 +114,34 @@ dependencies:
|
|
|
99
114
|
- - ">="
|
|
100
115
|
- !ruby/object:Gem::Version
|
|
101
116
|
version: '0'
|
|
117
|
+
- !ruby/object:Gem::Dependency
|
|
118
|
+
name: psych
|
|
119
|
+
requirement: !ruby/object:Gem::Requirement
|
|
120
|
+
requirements:
|
|
121
|
+
- - "<"
|
|
122
|
+
- !ruby/object:Gem::Version
|
|
123
|
+
version: '5'
|
|
124
|
+
type: :development
|
|
125
|
+
prerelease: false
|
|
126
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
127
|
+
requirements:
|
|
128
|
+
- - "<"
|
|
129
|
+
- !ruby/object:Gem::Version
|
|
130
|
+
version: '5'
|
|
102
131
|
- !ruby/object:Gem::Dependency
|
|
103
132
|
name: mocha
|
|
104
133
|
requirement: !ruby/object:Gem::Requirement
|
|
105
134
|
requirements:
|
|
106
135
|
- - "~>"
|
|
107
136
|
- !ruby/object:Gem::Version
|
|
108
|
-
version: '
|
|
137
|
+
version: '2.0'
|
|
109
138
|
type: :development
|
|
110
139
|
prerelease: false
|
|
111
140
|
version_requirements: !ruby/object:Gem::Requirement
|
|
112
141
|
requirements:
|
|
113
142
|
- - "~>"
|
|
114
143
|
- !ruby/object:Gem::Version
|
|
115
|
-
version: '
|
|
144
|
+
version: '2.0'
|
|
116
145
|
- !ruby/object:Gem::Dependency
|
|
117
146
|
name: ndr_dev_support
|
|
118
147
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -127,6 +156,20 @@ dependencies:
|
|
|
127
156
|
- - ">="
|
|
128
157
|
- !ruby/object:Gem::Version
|
|
129
158
|
version: '6.0'
|
|
159
|
+
- !ruby/object:Gem::Dependency
|
|
160
|
+
name: net-smtp
|
|
161
|
+
requirement: !ruby/object:Gem::Requirement
|
|
162
|
+
requirements:
|
|
163
|
+
- - ">="
|
|
164
|
+
- !ruby/object:Gem::Version
|
|
165
|
+
version: '0'
|
|
166
|
+
type: :development
|
|
167
|
+
prerelease: false
|
|
168
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
169
|
+
requirements:
|
|
170
|
+
- - ">="
|
|
171
|
+
- !ruby/object:Gem::Version
|
|
172
|
+
version: '0'
|
|
130
173
|
- !ruby/object:Gem::Dependency
|
|
131
174
|
name: pry
|
|
132
175
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -195,7 +238,8 @@ files:
|
|
|
195
238
|
- LICENSE.txt
|
|
196
239
|
- README.md
|
|
197
240
|
- Rakefile
|
|
198
|
-
-
|
|
241
|
+
- app/assets/fonts/bootstrap-icons.woff
|
|
242
|
+
- app/assets/fonts/bootstrap-icons.woff2
|
|
199
243
|
- app/assets/images/ndr_ui/indicator-danger.gif
|
|
200
244
|
- app/assets/images/ndr_ui/indicator-white.gif
|
|
201
245
|
- app/assets/images/ndr_ui/logo-partition.svg
|
|
@@ -204,6 +248,7 @@ files:
|
|
|
204
248
|
- app/assets/javascripts/ndr_ui/datepicker.js
|
|
205
249
|
- app/assets/javascripts/ndr_ui/index.js
|
|
206
250
|
- app/assets/javascripts/ndr_ui/timeago.js
|
|
251
|
+
- app/assets/stylesheets/ndr_ui/bootstrap-icons.scss
|
|
207
252
|
- app/assets/stylesheets/ndr_ui/datepicker.scss
|
|
208
253
|
- app/assets/stylesheets/ndr_ui/index.scss
|
|
209
254
|
- app/assets/stylesheets/ndr_ui/ndrs_styling.scss
|
|
@@ -215,11 +260,11 @@ files:
|
|
|
215
260
|
- app/builders/ndr_ui/bootstrap/label_tooltips.rb
|
|
216
261
|
- app/builders/ndr_ui/bootstrap/readonly.rb
|
|
217
262
|
- app/builders/ndr_ui/bootstrap_builder.rb
|
|
218
|
-
- app/helpers/ndr_ui/bootstrap/
|
|
263
|
+
- app/helpers/ndr_ui/bootstrap/accordion_helper.rb
|
|
219
264
|
- app/helpers/ndr_ui/bootstrap/breadcrumbs_helper.rb
|
|
265
|
+
- app/helpers/ndr_ui/bootstrap/card_helper.rb
|
|
220
266
|
- app/helpers/ndr_ui/bootstrap/dropdown_helper.rb
|
|
221
267
|
- app/helpers/ndr_ui/bootstrap/modal_helper.rb
|
|
222
|
-
- app/helpers/ndr_ui/bootstrap/panel_helper.rb
|
|
223
268
|
- app/helpers/ndr_ui/bootstrap_helper.rb
|
|
224
269
|
- app/helpers/ndr_ui/css_helper.rb
|
|
225
270
|
- app/helpers/ndr_ui/timeago_helper.rb
|
|
@@ -398,6 +443,7 @@ homepage: https://github.com/NHSDigital/ndr_ui
|
|
|
398
443
|
licenses:
|
|
399
444
|
- MIT
|
|
400
445
|
metadata: {}
|
|
446
|
+
post_install_message:
|
|
401
447
|
rdoc_options: []
|
|
402
448
|
require_paths:
|
|
403
449
|
- lib
|
|
@@ -405,14 +451,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
405
451
|
requirements:
|
|
406
452
|
- - ">="
|
|
407
453
|
- !ruby/object:Gem::Version
|
|
408
|
-
version: 3.
|
|
454
|
+
version: 3.0.0
|
|
409
455
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
410
456
|
requirements:
|
|
411
457
|
- - ">="
|
|
412
458
|
- !ruby/object:Gem::Version
|
|
413
459
|
version: '0'
|
|
414
460
|
requirements: []
|
|
415
|
-
rubygems_version: 3.
|
|
461
|
+
rubygems_version: 3.3.27
|
|
462
|
+
signing_key:
|
|
416
463
|
specification_version: 4
|
|
417
464
|
summary: NDR UI Rails Engine
|
|
418
465
|
test_files: []
|
data/SECURITY.md
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
# Security
|
|
2
|
-
|
|
3
|
-
NHS England takes security and the protection of private data extremely seriously. If you believe you have found a vulnerability or other issue which has compromised or could compromise the security of any of our systems and/or private data managed by our systems, please do not hesitate to contact us using the methods outlined below.
|
|
4
|
-
|
|
5
|
-
## Table of Contents
|
|
6
|
-
|
|
7
|
-
- [Security](#security)
|
|
8
|
-
- [Table of Contents](#table-of-contents)
|
|
9
|
-
- [Reporting a vulnerability](#reporting-a-vulnerability)
|
|
10
|
-
- [Email](#email)
|
|
11
|
-
- [NCSC](#ncsc)
|
|
12
|
-
- [General Security Enquiries](#general-security-enquiries)
|
|
13
|
-
|
|
14
|
-
## Reporting a vulnerability
|
|
15
|
-
|
|
16
|
-
Please note, email is our preferred method of receiving reports.
|
|
17
|
-
|
|
18
|
-
### Email
|
|
19
|
-
|
|
20
|
-
If you wish to notify us of a vulnerability via email, please include detailed information on the nature of the vulnerability and any steps required to reproduce it.
|
|
21
|
-
|
|
22
|
-
You can reach us at:
|
|
23
|
-
|
|
24
|
-
- [Brian.Shand@nhs.net](mailto:Brian.Shand@nhs.net)
|
|
25
|
-
- [cybersecurity@nhs.net](mailto:cybersecurity@nhs.net)
|
|
26
|
-
|
|
27
|
-
### NCSC
|
|
28
|
-
|
|
29
|
-
You can send your report to the National Cyber Security Centre, who will assess your report and pass it on to NHS England if necessary.
|
|
30
|
-
|
|
31
|
-
You can report vulnerabilities here: [https://www.ncsc.gov.uk/information/vulnerability-reporting](https://www.ncsc.gov.uk/information/vulnerability-reporting)
|
|
32
|
-
|
|
33
|
-
## General Security Enquiries
|
|
34
|
-
|
|
35
|
-
If you have general enquiries regarding our cybersecurity, please reach out to us at [cybersecurity@nhs.net](mailto:cybersecurity@nhs.net)
|