actionset 0.5.0 → 0.5.1

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
  SHA1:
3
- metadata.gz: f859bd2af027550824912a5fa2ea15856bf355b9
4
- data.tar.gz: fb7d494de37f4eddc01697c032d20de7a6526870
3
+ metadata.gz: 2cc1754eed05ab67bf65fe136f44a632ba04ea39
4
+ data.tar.gz: ba34642fd14eb52a4a06a878eeacc8f15f5a244e
5
5
  SHA512:
6
- metadata.gz: 61ba01690350f529f1fb1ad0b7cc4084500b57878f055e3ac2d93f80ac7ca4d54df1b4a65a64136e851e5674a0198a8a7c602449a1774fbd319f400311c9a0c5
7
- data.tar.gz: bb723d0784f6a44a6b5f01d05b4ed1ac5c50c3156d0983fafbb58ebcfd5fb0b3fc9238204c9e3d48ee3ae4a10ee8674d280eda6c1018b4e1d8270ee68e38e123
6
+ metadata.gz: 9c9e268b59574dc5ea13129989a742ed921ab866f7bb679a33bc219ed8569a7d627fa4e403604a7514cb00119b1128e12b7a7f05f7185cf39a87e012430b3abc
7
+ data.tar.gz: 8fae13323ed5efef44857f881cf1b65fb62293e1a7eaed4f922343741d8beb0fb1c5737acf3d0a2ef72b270e9983e1a71d82a178f18f0633da67540aa1410e16
data/CHANGELOG CHANGED
@@ -1,3 +1,7 @@
1
+ v 0.5.1
2
+ - Fix the sorting path helper to only ever allow single-vector sorting
3
+ - Fix the pagination description helper to have proper HTML spacing
4
+ - Add an `export_path_for(format)` helper for generating a path
1
5
  v 0.5.0
2
6
  - Replace the use of `@filters` with the helper method `form_for_object_from_param(:filter)`
3
7
  - Fix the pagination and sorting path helper methods to ensure they don't remove pre-existing params
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative '../params/current_helper'
4
+
5
+ module Export
6
+ module PathForHelper
7
+ include Params::CurrentHelper
8
+
9
+ def export_path_for(format)
10
+ url_for export_params_for(format)
11
+ end
12
+
13
+ private
14
+
15
+ def export_params_for(format)
16
+ current_params
17
+ .deep_merge(only_path: true,
18
+ transform: {
19
+ format: format
20
+ })
21
+ end
22
+ end
23
+ end
@@ -9,7 +9,7 @@ module Pagination
9
9
  include Pagination::TotalPagesForHelper
10
10
 
11
11
  def pagination_current_page_description_for(set)
12
- description = "Page <strong>#{pagination_current_page_for(set)}</strong> of <strong>#{pagination_total_pages_for(set)}</strong>".html_safe
12
+ description = "Page&nbsp;<strong>#{pagination_current_page_for(set)}</strong>&nbsp;of&nbsp;<strong>#{pagination_total_pages_for(set)}</strong>".html_safe
13
13
 
14
14
  content_tag(:span,
15
15
  description,
@@ -4,6 +4,8 @@ require_relative '../params/current_helper'
4
4
 
5
5
  module Pagination
6
6
  module PathForHelper
7
+ include Params::CurrentHelper
8
+
7
9
  def pagination_path_for(page)
8
10
  page ||= 1
9
11
  url_for paginate_params_for(page)
@@ -16,10 +16,10 @@ module Sort
16
16
 
17
17
  def sort_params_for(attribute)
18
18
  current_params
19
- .deep_merge(only_path: true,
20
- sort: {
21
- attribute => next_sort_direction_for(attribute)
22
- })
19
+ .merge(only_path: true,
20
+ sort: {
21
+ attribute => next_sort_direction_for(attribute)
22
+ })
23
23
  end
24
24
  end
25
25
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ActionSet
4
- VERSION = '0.5.0'
4
+ VERSION = '0.5.1'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: actionset
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stephen Margheim
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-09-01 00:00:00.000000000 Z
11
+ date: 2018-09-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activeset
@@ -227,6 +227,7 @@ files:
227
227
  - bin/setup
228
228
  - config.ru
229
229
  - lib/action_set.rb
230
+ - lib/action_set/helpers/export/path_for_helper.rb
230
231
  - lib/action_set/helpers/helper_methods.rb
231
232
  - lib/action_set/helpers/pagination/current_page_description_for_helper.rb
232
233
  - lib/action_set/helpers/pagination/current_page_for_helper.rb