recourse 1.4.6 → 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0001a13724dd02841bb57d1af987087453d716627571a2454706c34a8af80897
4
- data.tar.gz: b70beaf55e55c6e99ef5299b05b35a19a11f2929d7174aeaf82d5dd6baef9637
3
+ metadata.gz: 70e221d8d801766c3388a255088fcb140e2a0dcbc3eff2e7fcc51f3d6af890af
4
+ data.tar.gz: eb4c01528a57ca202092d7d8d844e1adbe80838106395218da8e12d7778b7136
5
5
  SHA512:
6
- metadata.gz: 3a33c339eb600b5a842877fcc77d064681dadd148ba753f5ccbf819609fb4851db560a70a2db979861d56e1a2ebbbc0fdb2637e88f42281c6f639101a2b25404
7
- data.tar.gz: 013d53f3a96a5cea9d919532d5dba608be9d1e3025d76fbcd178e547855006fe8cafb9bd952e60207234a1f140a04513bc1a68dab8f91feae02995908b42a572
6
+ metadata.gz: 6287e3d6fc903ef1d38ea249a14adc48798de63c9c0c36648f9b99ec2518bc34963bff6d5fda86e6b2c53bbb1bb7ffd9624d6c9ead518afc389d0aa4cb94e6a9
7
+ data.tar.gz: 63e8cfe48fd2b8797ff986e67e98101db5a678daded480da04c31a1946c7184827b6a4e1cad78d48b64f7e8fc4e5bbe1028e2f9d790e1b32eb31ca8c3f930438
@@ -5,12 +5,12 @@ module NavigableHelper
5
5
  'Answers' => 'question-circle', 'Apps' => 'window', 'Assessments' => 'clipboard-check',
6
6
  'Bookings' => 'calendar-check', 'Brands' => 'buildings', 'Campaigns' => 'megaphone',
7
7
  'Conversations' => 'chat-dots', 'Counties' => 'map', 'Episodes' => 'collection-play',
8
- 'Evaluations' => 'speedometer2', 'Franchises' => 'shop', 'Logout' => 'box-arrow-right',
9
- 'Markets' => 'pin-map', 'Offer questions' => 'gift', 'Optimizations' => 'sliders',
10
- 'Platforms' => 'plugin', 'Prompts' => 'terminal', 'Providers' => 'people-fill',
11
- 'Satisfaction questions' => 'emoji-smile', 'Searches' => 'search', 'Settings' => 'gear',
12
- 'Specialties' => 'award', 'Specialty matches' => 'award', 'Verticals' => 'bar-chart',
13
- 'ZIPs' => 'geo-alt-fill',
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, 'app'
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
- form.search_field model.search_field, search_field_params(placeholder: model.search_prompt)
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-8 col-sm-6 col-md-4 d-flex', role: 'search',
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-control form-control-sm flex-grow-1', placeholder: placeholder,
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
- <table class='table caption-top table-hover table-responsive'>
11
- <thead>
12
- <tr>
13
- <% @recourse_headers = true %>
14
- <%= render 'row', key => recourses.first %>
15
- </tr>
16
- </thead>
17
- <tbody class='table-group-divider'>
18
- <% @recourse_headers = false %>
19
- <% recourses.each do |recourse| %>
20
- <%# cache_if (cached && !params.key?(:q)), [recourse, controller_path] do %>
21
- <tr><%= render 'row', key => recourse %></tr>
22
- <%# end %>
23
- <% end %>
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
- </table>
32
+ </table>
33
+ </div>
26
34
 
27
35
  <% if pagy %>
28
36
  <div class='d-flex align-items-center'>
@@ -1,3 +1,3 @@
1
1
  module Recourse
2
- VERSION = '1.4.6'
2
+ VERSION = '2.0.0'
3
3
  end
data/lib/recourse.rb CHANGED
@@ -3,7 +3,7 @@ require 'ransack'
3
3
  require 'recourse/engine'
4
4
 
5
5
  # @see https://ddnexus.github.io/pagy/resources/initializer/
6
- Pagy::OPTIONS[:limit] = 15
6
+ Pagy::OPTIONS[:limit] = 20
7
7
 
8
8
  # A module to manage administered resources.
9
9
  module Recourse
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: recourse
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.6
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Claudio Baccigalupo