recourse 1.4.5 → 2.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/app/helpers/navigable_helper.rb +11 -11
- data/app/helpers/searchable_helper.rb +7 -3
- data/app/views/recourses/_table.html.erb +23 -15
- data/lib/recourse/version.rb +1 -1
- data/lib/recourse.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 70e221d8d801766c3388a255088fcb140e2a0dcbc3eff2e7fcc51f3d6af890af
|
|
4
|
+
data.tar.gz: eb4c01528a57ca202092d7d8d844e1adbe80838106395218da8e12d7778b7136
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6287e3d6fc903ef1d38ea249a14adc48798de63c9c0c36648f9b99ec2518bc34963bff6d5fda86e6b2c53bbb1bb7ffd9624d6c9ead518afc389d0aa4cb94e6a9
|
|
7
|
+
data.tar.gz: 63e8cfe48fd2b8797ff986e67e98101db5a678daded480da04c31a1946c7184827b6a4e1cad78d48b64f7e8fc4e5bbe1028e2f9d790e1b32eb31ca8c3f930438
|
|
@@ -3,14 +3,14 @@ module NavigableHelper
|
|
|
3
3
|
# Boostrap icons to be used for specific resources.
|
|
4
4
|
NAVIGATION_ICONS = {
|
|
5
5
|
'Answers' => 'question-circle', 'Apps' => 'window', 'Assessments' => 'clipboard-check',
|
|
6
|
-
'
|
|
7
|
-
'
|
|
8
|
-
'
|
|
9
|
-
'Logout' => 'box-arrow-right', '
|
|
10
|
-
'
|
|
11
|
-
'
|
|
12
|
-
'
|
|
13
|
-
'ZIPs' => 'geo-alt-fill',
|
|
6
|
+
'Bookings' => 'calendar-check', 'Brands' => 'buildings', 'Campaigns' => 'megaphone',
|
|
7
|
+
'Conversations' => 'chat-dots', 'Counties' => 'map', 'Episodes' => 'collection-play',
|
|
8
|
+
'Evaluations' => 'speedometer2', 'Franchises' => 'shop', 'Home' => 'home',
|
|
9
|
+
'Logout' => 'box-arrow-right', 'Markets' => 'pin-map', 'Offer questions' => 'gift',
|
|
10
|
+
'Optimizations' => 'sliders', 'Platforms' => 'plugin', 'Prompts' => 'terminal',
|
|
11
|
+
'Providers' => 'people-fill', 'Satisfaction questions' => 'emoji-smile', 'Searches' => 'search',
|
|
12
|
+
'Settings' => 'gear', 'Specialties' => 'award', 'Specialty matches' => 'award',
|
|
13
|
+
'Verticals' => 'bar-chart', 'ZIPs' => 'geo-alt-fill',
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
# @return [Array<String, String>] caption and URL of each link a top-level resource.
|
|
@@ -24,8 +24,8 @@ module NavigableHelper
|
|
|
24
24
|
private
|
|
25
25
|
|
|
26
26
|
# @return [String] a meaningful icon based on the resource name, or a generic one if not found.
|
|
27
|
-
def navigation_icon_for(caption)
|
|
28
|
-
icon = NAVIGATION_ICONS.fetch caption, '
|
|
29
|
-
tag.i class: "bi bi-#{icon}"
|
|
27
|
+
def navigation_icon_for(caption, style: nil)
|
|
28
|
+
icon = NAVIGATION_ICONS.fetch caption, 'house-door-fill'
|
|
29
|
+
tag.i class: "bi bi-#{icon}", style: style
|
|
30
30
|
end
|
|
31
31
|
end
|
|
@@ -24,19 +24,23 @@ private
|
|
|
24
24
|
end
|
|
25
25
|
|
|
26
26
|
def search_field_for(form, model:)
|
|
27
|
-
|
|
27
|
+
adorn = tag.svg width: 16, height: 16, viewBox: '0 0 16 16', xmlns: 'http://www.w3.org/2000/svg' do
|
|
28
|
+
tag.path d: 'M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001q.044.06.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1 1 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0'
|
|
29
|
+
end
|
|
30
|
+
field = form.search_field model.search_field, search_field_params(placeholder: model.search_prompt)
|
|
31
|
+
tag.div safe_join([adorn, field]), class: 'form-control form-control-sm form-adorn'
|
|
28
32
|
end
|
|
29
33
|
|
|
30
34
|
def search_form_params(url:)
|
|
31
35
|
{
|
|
32
|
-
url: url, class: 'col-
|
|
36
|
+
url: url, class: 'col-4 d-flex', role: 'search',
|
|
33
37
|
data: { turbo_frame: :results, turbo_action: :advance },
|
|
34
38
|
}
|
|
35
39
|
end
|
|
36
40
|
|
|
37
41
|
def search_field_params(placeholder:)
|
|
38
42
|
{
|
|
39
|
-
class: 'form-
|
|
43
|
+
class: 'form-ghost', placeholder: placeholder,
|
|
40
44
|
oninput: 'debouncedSubmit(this.form)', aria: { label: 'Search' }
|
|
41
45
|
}
|
|
42
46
|
end
|
|
@@ -7,22 +7,30 @@
|
|
|
7
7
|
<p>No <%= controller_path.split('/').last %>.</p>
|
|
8
8
|
<% else %>
|
|
9
9
|
<%# cache_if cached, [recourses, (recourses.unscoped.size if cached), controller_path].compact do %>
|
|
10
|
-
<
|
|
11
|
-
<
|
|
12
|
-
<
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
10
|
+
<div class='table-responsive'>
|
|
11
|
+
<table class='table caption-top table-hover align-middle md:table-stacked'>
|
|
12
|
+
<thead>
|
|
13
|
+
<tr>
|
|
14
|
+
<% @recourse_headers = true %>
|
|
15
|
+
<%= render 'row', key => recourses.first %>
|
|
16
|
+
<!-- <th scope='col' class='text-end'>Edit</th> -->
|
|
17
|
+
</tr>
|
|
18
|
+
</thead>
|
|
19
|
+
<tbody>
|
|
20
|
+
<% @recourse_headers = false %>
|
|
21
|
+
<% recourses.each do |recourse| %>
|
|
22
|
+
<%# cache_if (cached && !params.key?(:q)), [recourse, controller_path] do %>
|
|
23
|
+
<tr>
|
|
24
|
+
<%= render 'row', key => recourse %>
|
|
25
|
+
<%#= column header: 'Edit', class: 'text-end' do %>
|
|
26
|
+
<%#= edit_link_to action: :edit, id: 1 %>
|
|
27
|
+
<%# end %>
|
|
28
|
+
</tr>
|
|
29
|
+
<%# end %>
|
|
30
|
+
<% end %>
|
|
24
31
|
</tbody>
|
|
25
|
-
|
|
32
|
+
</table>
|
|
33
|
+
</div>
|
|
26
34
|
|
|
27
35
|
<% if pagy %>
|
|
28
36
|
<div class='d-flex align-items-center'>
|
data/lib/recourse/version.rb
CHANGED
data/lib/recourse.rb
CHANGED