th_simple_admin_panel 0.0.6 → 0.0.7

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,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NzA5ODEwYzJmOTQ2N2UwOGI3ZDhhODJiNjc3YzNmNTNiZDNmMjg5NQ==
4
+ YTE0YTEyYjU3M2EyY2Y1N2VkZDE1YTJkYzFkNTk1OGRlMTc1YzJkNA==
5
5
  data.tar.gz: !binary |-
6
- NTdjYTlhMjUxMGZjOGRlNTQ4ZGM0NzU5N2E5ODJjMzE4Yjg2NGRlYw==
6
+ NjQ2M2M2NDdiMmVjYTViYjIzZDg3NTYwNTRiMzY0NTBhNDViNTIzMg==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- NzA2NTFjNzEzMmY3NTU5N2RkM2VkNjg0NGJjYTU4Yjc2NWI5MDBmYzMxZDQx
10
- M2M3MGM4YWVhZTc3NDhhZWQ5NzYyZTE4YWMyZjgxNDAyZDI2ZWI4YmFhZTQw
11
- MGVjOGE2OGJiNWFiYTQyZDlmYTkzNTlkYjViMDRkYWMyMTE2MjE=
9
+ NTVkYjk5ZjFlMWQxMmNjODcyOWZjYTJiYWVkODdjODgyZTBlZGFkYzA1ZTBi
10
+ Y2M1Y2Y4NjAwOWVjNjVjM2ViNWY1ZmU1MzZjNTQ5NzU5Nzc5NzMxOWIzZWU1
11
+ ZjQyOWUyNTQwMDBkYzAyYTA3Y2EzMjMyMzBkYzQ2OWRmNmY2NTM=
12
12
  data.tar.gz: !binary |-
13
- NGNhMGNmMDc5ODY3MDhkM2MyZDU2YTAzNTJmMjExMmMxYzcxMzFlMmRkZjBk
14
- NTA1NjNkOWE5MGUxY2Q2NjlmYTk0MTFlMzczNjE4MjUwYzljMWE1YzRjNjEw
15
- OWZlZTliOTM4MzE2Zjg5NjE4YjRjODhiM2U4YzIyMzI5ZWFlZGE=
13
+ ZGQ3ZGY1MmI5NTU1ODc0NWViMTQ0MTFiZjExNTcxZmUwYTI4OTc1OWI1ZDAz
14
+ Mzc1ODgyNjA5MmZkOGIwNGE3OWQ0ODAwODc2ODQzODkyNWRiZTBiMjhjODE5
15
+ OTk3OWNhMGZmNzRkMDIyNGYwYWQxMTI0MDAwOGQxODFkOWVhZWU=
@@ -14,4 +14,4 @@
14
14
 
15
15
  ul.breadcrumb li.pull-right {
16
16
  margin-left: 3px;
17
- }
17
+ }
@@ -15,6 +15,17 @@
15
15
  <% if controller.respond_to?(:new) && can?(:create, resource_class) && (new_resource_path rescue nil).present? %>
16
16
  <li class="pull-right"><%= link_to icon("plus") + " Aanmaken", new_resource_path, class: "btn btn-mini" %></li>
17
17
  <% end %>
18
+
19
+ <% if respond_to?(:keyword_search_key) && keyword_search_key.present? %>
20
+ <li class="pull-right">
21
+ <form data-accesskey="q" class="breadcrumb-search-form">
22
+ <input type="text" class="input-small breadcrumb-search-input" placeholder="Zoek" name="qs" value="<%= params[:qs] %>">
23
+ <%= content_for :keyword_search_fields %>
24
+ <input type="submit" style="display: none;">
25
+ </form>
26
+ </li>
27
+ <% end %>
28
+
18
29
  <% elsif params[:action] == "show" %>
19
30
  <li><%= link_to resource_class.model_name.human(count: 2), collection_path %> <span class="divider">/</span></li>
20
31
  <li class="active"><%= label_for_resource resource %></li>
@@ -8,6 +8,7 @@ module SimpleAdminPanel::ControllerExtensions
8
8
  before_filter :authenticate_user!
9
9
  before_filter :require_admin
10
10
  before_filter :require_active
11
+ before_filter :apply_keyword_search_key
11
12
  end
12
13
 
13
14
  protected
@@ -23,6 +24,13 @@ module SimpleAdminPanel::ControllerExtensions
23
24
  redirect_to root_path
24
25
  end
25
26
 
27
+ def apply_keyword_search_key
28
+ if respond_to?(:keyword_search_key)
29
+ params[:search] ||= {}
30
+ params[:search][keyword_search_key] = params[:qs] if keyword_search_key.present? && params[:qs].present?
31
+ end
32
+ end
33
+
26
34
  module ClassMethods
27
35
  end
28
- end
36
+ end
@@ -1,3 +1,3 @@
1
1
  module SimpleAdminPanel
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: th_simple_admin_panel
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Toby Hinloopen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-05 00:00:00.000000000 Z
11
+ date: 2014-04-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails