opale 0.1.1 → 0.1.2

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
  SHA256:
3
- metadata.gz: 2c72c3714e244a6f69e138cd460efafe5d4d02f163e4437a8782155aceb10675
4
- data.tar.gz: a7416b23ea13b5802fd631b3a4e47166682b969163ec9437ae1230e67087e8ff
3
+ metadata.gz: 162612fa2efac54e4064fcbad9bbca6a329a347076382c5cc90e9c581fa9154b
4
+ data.tar.gz: b7238b0112cf5381716f7d2a7da65467d876601d0400cebc6b8554fc93adaa59
5
5
  SHA512:
6
- metadata.gz: 1f0b5c96ecae25fb323e3bc3116f856afbbe907076e9a0f5f3c2b2636c7a8ecb933c4232d73ee1e9888418bab32dd00f3f74ee121d7f387cbbe3c99a8116f7a5
7
- data.tar.gz: d14f4f126ffce2177ead6c9c492c1231592332f225db3012aeeb5753828f6a1eca3abcd2d999a4a26bb7e4e9be84bd80e34ba4e7fd037201992b602100a7540a
6
+ metadata.gz: 4ac7a1d2446435b6a8fb4ca60205ef3b04ed19c0748e980eae44ecfb6926427f0542ea1ff57f8aec965e16fd4dde0cf69b707322dbb653bb2a87f3809625d235
7
+ data.tar.gz: 1ef99c34a09f7b9f64f718a9ed94c8330cffc81f709e4e74079d0d1b9a72679ff17c834b36f196bdee42859bf259854f01403feb2584c1c488dec293a31dcf94
@@ -1,24 +1,26 @@
1
- module SortableHelper
2
- def search_form_fields(table_name = nil, &block)
3
- searching_field = hidden_field_tag :searching, true
4
- table_name_field = hidden_field_tag :table_name, table_name unless table_name.nil?
5
- sort_field = hidden_field_tag :sort, params[:sort] || :updated_at
6
- direction_field = hidden_field_tag :direction, params[:direction] || :desc
1
+ module Opale
2
+ module SortableHelper
3
+ def search_form_fields(table_name = nil, &block)
4
+ searching_field = hidden_field_tag :searching, true
5
+ table_name_field = hidden_field_tag :table_name, table_name unless table_name.nil?
6
+ sort_field = hidden_field_tag :sort, params[:sort] || :updated_at
7
+ direction_field = hidden_field_tag :direction, params[:direction] || :desc
7
8
 
8
- searching_field.concat(sort_field)
9
- searching_field.concat(direction_field)
10
- searching_field.concat(table_name_field)
9
+ searching_field.concat(sort_field)
10
+ searching_field.concat(direction_field)
11
+ searching_field.concat(table_name_field)
11
12
 
12
- searching_field
13
- end
13
+ searching_field
14
+ end
14
15
 
15
- def th(options, &block)
16
- css_class = options[:table_name] == sort_column ? "current #{sort_direction}" : nil
17
- # direction = options[:table_name] == sort_column && sort_direction == 'asc' ? 'desc' : 'asc'
16
+ def th(options, &block)
17
+ css_class = options[:table_name] == sort_column ? "current #{sort_direction}" : nil
18
+ # direction = options[:table_name] == sort_column && sort_direction == 'asc' ? 'desc' : 'asc'
18
19
 
19
- content_tag :th, class: options[:class], style: options[:style] do
20
- link_to '#', { class: css_class, onclick: "sortable(event, '#{options[:table_name]}')" } do
21
- block.call unless block.nil?
20
+ content_tag :th, class: options[:class], style: options[:style] do
21
+ link_to '#', { class: css_class, onclick: "sortable(event, '#{options[:table_name]}')" } do
22
+ block.call unless block.nil?
23
+ end
22
24
  end
23
25
  end
24
26
  end
@@ -0,0 +1,9 @@
1
+ require 'opale/helpers/sortable_helper'
2
+
3
+ module Opale
4
+ class Railtie < Rails::Railtie
5
+ initializer 'opale.helpers.sortable_helper' do
6
+ ActionView::Base.send :include, SortableHelper
7
+ end
8
+ end
9
+ end
data/lib/opale/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Opale
2
- VERSION = '0.1.1'
2
+ VERSION = '0.1.2'
3
3
  end
data/opale-0.1.1.gem ADDED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opale
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Poulpy
@@ -84,8 +84,10 @@ files:
84
84
  - bin/setup
85
85
  - lib/controllers/concerns/sortable.rb
86
86
  - lib/helpers/sortables_helper.rb
87
+ - lib/opale/railtie.rb
87
88
  - lib/opale/version.rb
88
89
  - opale-0.1.0.gem
90
+ - opale-0.1.1.gem
89
91
  - opale.gemspec
90
92
  - spec/opale_spec.rb
91
93
  - spec/spec_helper.rb