admin-panel 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (22) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +2 -2
  3. data/README.md +1 -1
  4. data/lib/admin-panel/version.rb +1 -1
  5. data/lib/generators/admin_panel/install/templates/helpers/admin_helper.rb +16 -0
  6. data/lib/generators/admin_panel/install/templates/views/erb/admin/passwords/edit.html.erb +1 -1
  7. data/lib/generators/admin_panel/install/templates/views/erb/admin/passwords/new.html.erb +1 -1
  8. data/lib/generators/admin_panel/install/templates/views/erb/kaminari/admin-bootstrap/_first_page.html.erb +3 -1
  9. data/lib/generators/admin_panel/install/templates/views/erb/kaminari/admin-bootstrap/_last_page.html.erb +3 -1
  10. data/lib/generators/admin_panel/install/templates/views/erb/kaminari/admin-bootstrap/_next_page.html.erb +3 -1
  11. data/lib/generators/admin_panel/install/templates/views/erb/kaminari/admin-bootstrap/_prev_page.html.erb +3 -1
  12. data/lib/generators/admin_panel/install/templates/views/haml/admin/passwords/edit.html.haml +1 -1
  13. data/lib/generators/admin_panel/install/templates/views/haml/admin/passwords/new.html.haml +1 -1
  14. data/lib/generators/admin_panel/install/templates/views/haml/kaminari/admin-bootstrap/_first_page.html.haml +2 -1
  15. data/lib/generators/admin_panel/install/templates/views/haml/kaminari/admin-bootstrap/_last_page.html.haml +2 -1
  16. data/lib/generators/admin_panel/install/templates/views/haml/kaminari/admin-bootstrap/_next_page.html.haml +2 -1
  17. data/lib/generators/admin_panel/install/templates/views/haml/kaminari/admin-bootstrap/_prev_page.html.haml +2 -1
  18. data/lib/generators/admin_panel/scaffold/templates/views/erb/_form.html.erb.erb +1 -8
  19. data/lib/generators/admin_panel/scaffold/templates/views/erb/index.html.erb.erb +1 -1
  20. data/lib/generators/admin_panel/scaffold/templates/views/haml/_form.html.haml.erb +1 -6
  21. data/lib/generators/admin_panel/scaffold/templates/views/haml/index.html.haml.erb +1 -1
  22. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1bf5b58ee1a00b74bdb5a6024a683cbbeeb43e06
4
- data.tar.gz: c19d95f38cc2e2ea6749ba2727da21f4c5616306
3
+ metadata.gz: 411322c79a98a6ff879a3d5031817c8ce3cc34d8
4
+ data.tar.gz: ddfa1c1bf2d15383efb007118a86089d2e5d2e00
5
5
  SHA512:
6
- metadata.gz: 76a72acf852f9706c05b987f870b440749738995e5d99270283cf6d28c7da3f54c39b19b01189b4415c1faacbba1cf17948b65503a09a21792e924037eeebb24
7
- data.tar.gz: fdad1aea621dd26acb342a792b730f22ed0880d1a04f4a7c3a1fcffb3bd5f790522e1082bbd8ab67c7821386ae134a0ed6f098cca7eb89d4f94abc9ea47a1cfc
6
+ metadata.gz: b11dfa997f355fa2358000d8a91a36be5e45af027f720311596286229a04a5bcf59abba48ea6152046de939181d5723021bf887394687fdc8004466ef53418d4
7
+ data.tar.gz: fdc813690e37d685f181939d9073762d4c0db8e1b59d06a6fe0d36bb0b1fed30602e198e02d2943c6fedbab79aae2890d6df01b3b4eda9a1876fd2ebfc3922be
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- admin-panel (0.1.3)
4
+ admin-panel (0.1.5)
5
5
  bootstrap-sass (~> 3.1)
6
6
  devise (~> 3.2)
7
7
  kaminari (~> 0.16)
@@ -35,7 +35,7 @@ GEM
35
35
  railties (>= 3.0)
36
36
  rspec-rails (>= 2.2)
37
37
  bcrypt (3.1.7)
38
- bootstrap-sass (3.1.1.1)
38
+ bootstrap-sass (3.2.0.0)
39
39
  sass (~> 3.2)
40
40
  builder (3.2.2)
41
41
  devise (3.2.4)
data/README.md CHANGED
@@ -9,7 +9,7 @@ Installation
9
9
  Start with adding these gems to your Gemfile:
10
10
 
11
11
  ```ruby
12
- gem 'admin-panel', '~> 0.1.3'
12
+ gem 'admin-panel', '~> 0.1.5'
13
13
  gem 'devise', '~> 3.2'
14
14
  gem 'simple_form', '3.1.0.rc1'
15
15
  gem 'bootstrap-sass', '~> 3.1'
@@ -1,3 +1,3 @@
1
1
  module AdminPanel
2
- VERSION = '0.1.4'
2
+ VERSION = '0.1.5'
3
3
  end
@@ -20,4 +20,20 @@ module AdminHelper
20
20
  def per_page_class(klass, i)
21
21
  (params[:per_page].to_i == i || (params[:per_page].nil? && klass.default_per_page == i)) ? 'btn-primary' : 'btn-default'
22
22
  end
23
+
24
+ def simple_bootstrap_form_for(resource, opts={}, &block)
25
+ type = opts.delete(:type) || :horizontal
26
+ raise 'Supported types: horizontal, vertical' unless type.to_sym.in? [ :horizontal, :vertical ]
27
+
28
+ opts = {
29
+ html: { class: "form-#{type}" },
30
+ wrapper: :"#{type}_form",
31
+ wrapper_mappings: { check_boxes: :"#{type}_radio_and_checkboxes",
32
+ radio_buttons: :"#{type}_radio_and_checkboxes",
33
+ file: :"#{type}_file_input",
34
+ boolean: :"#{type}_boolean" }
35
+ }.merge!(opts)
36
+
37
+ simple_form_for(resource, opts, &block)
38
+ end
23
39
  end
@@ -1,6 +1,6 @@
1
1
  <h2>Change your password</h2>
2
2
 
3
- <%= simple_form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f| %>
3
+ <%= simple_bootstrap_form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f| %>
4
4
  <%= f.error_notification %>
5
5
 
6
6
  <%= f.input :reset_password_token, as: :hidden %>
@@ -1,6 +1,6 @@
1
1
  <h2>Forgot your password?</h2>
2
2
 
3
- <%= simple_form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f| %>
3
+ <%= simple_bootstrap_form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f| %>
4
4
  <%= f.error_notification %>
5
5
 
6
6
  <div class="form-inputs">
@@ -8,6 +8,8 @@
8
8
  -%>
9
9
  <% unless current_page.first? -%>
10
10
  <li class="first">
11
- <%= link_to raw(t 'views.pagination.first'), url, {:remote => remote} %>
11
+ <%= link_to url, {:remote => remote} do %>
12
+ <i class="glyphicon glyphicon-fast-backward"></i>
13
+ <% end %>
12
14
  </li>
13
15
  <% end -%>
@@ -8,6 +8,8 @@
8
8
  -%>
9
9
  <% unless current_page.last? -%>
10
10
  <li class="last">
11
- <%= link_to raw(t 'views.pagination.last'), url, {:remote => remote} %>
11
+ <%= link_to url, {:remote => remote} do %>
12
+ <i class="glyphicon glyphicon-fast-forward"></i>
13
+ <% end %>
12
14
  </li>
13
15
  <% end -%>
@@ -9,6 +9,8 @@
9
9
 
10
10
  <% unless current_page.last? -%>
11
11
  <li class="next">
12
- <%= link_to raw(t 'views.pagination.next'), url, :remote => remote, :rel => 'next' %>
12
+ <%= link_to url, :remote => remote, :rel => 'next' do %>
13
+ <i class="glyphicon glyphicon-forward"></i>
14
+ <% end %>
13
15
  </li>
14
16
  <% end -%>
@@ -8,6 +8,8 @@
8
8
  -%>
9
9
  <% unless current_page.first? -%>
10
10
  <li class="prev">
11
- <%= link_to raw(t 'views.pagination.previous'), url, :remote => remote, :rel => 'prev' %>
11
+ <%= link_to url, :remote => remote, :rel => 'prev' do %>
12
+ <i class="glyphicon glyphicon-backward"></i>
13
+ <% end %>
12
14
  </li>
13
15
  <% end -%>
@@ -1,5 +1,5 @@
1
1
  %h2 Change your password
2
- = simple_form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f|
2
+ = simple_bootstrap_form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f|
3
3
  = f.error_notification
4
4
 
5
5
  = f.input :reset_password_token, as: :hidden
@@ -1,6 +1,6 @@
1
1
  %h2 Forgot your password?
2
2
 
3
- = simple_form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f|
3
+ = simple_bootstrap_form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f|
4
4
  = f.error_notification
5
5
 
6
6
  .form-inputs
@@ -8,4 +8,5 @@
8
8
  -#
9
9
  - unless current_page.first?
10
10
  %li.first
11
- = link_to raw(t 'views.pagination.first'), url, {:remote => remote}
11
+ = link_to url, {:remote => remote} do
12
+ %i.glyphicon.glyphicon-fast-backward
@@ -8,4 +8,5 @@
8
8
 
9
9
  - unless current_page.last?
10
10
  %li.last
11
- = link_to raw(t 'views.pagination.last'), url, {:remote => remote}
11
+ = link_to url, {:remote => remote} do
12
+ %i.glyphicon.glyphicon-fast-forward
@@ -9,4 +9,5 @@
9
9
 
10
10
  - unless current_page.last?
11
11
  %li.next
12
- = link_to raw(t 'views.pagination.next'), url, :remote => remote, :rel => 'next'
12
+ = link_to url, :remote => remote, :rel => 'next' do
13
+ %i.glyphicon.glyphicon-forward
@@ -8,4 +8,5 @@
8
8
 
9
9
  - unless current_page.first?
10
10
  %li.prev
11
- = link_to raw(t 'views.pagination.previous'), url, :remote => remote, :rel => 'prev'
11
+ = link_to url, :remote => remote, :rel => 'prev' do
12
+ %i.glyphicon.glyphicon-backward
@@ -1,11 +1,4 @@
1
- <%%= simple_form_for(<%= "[:#{prefix}, @#{singular_table_name}]" %>, html: { class: 'form-horizontal' },
2
- wrapper: :horizontal_form,
3
- wrapper_mappings: {
4
- check_boxes: :horizontal_radio_and_checkboxes,
5
- radio_buttons: :horizontal_radio_and_checkboxes,
6
- file: :horizontal_file_input,
7
- boolean: :horizontal_boolean
8
- }) do |f| %>
1
+ <%%= simple_bootstrap_form_for <%= "[:#{prefix}, @#{singular_table_name}]" %> do |f| %>
9
2
  <%%= f.error_notification %>
10
3
 
11
4
  <div class="form-inputs">
@@ -41,7 +41,7 @@
41
41
  <div class="col-md-4 text-right">
42
42
  <div class="btn-group per-page">
43
43
  <%% [ 10, 25, 100, 250, 500, 1000 ].each do |i| %>
44
- <%%= link_to i, { action: :index, page: params[:page], per_page: i }, class: "btn #{per_page_class(<%= class_name %>, i)}" %>
44
+ <%%= link_to i, params.merge(page: 1, per_page: i), class: "btn #{per_page_class(<%= class_name %>, i)}" %>
45
45
  <%% end %>
46
46
  </div>
47
47
  </div>
@@ -1,9 +1,4 @@
1
- = simple_form_for(<%= "[:#{prefix}, @#{singular_table_name}]" %>, html: { class: 'form-horizontal' },
2
- wrapper: :horizontal_form,
3
- wrapper_mappings: { check_boxes: :horizontal_radio_and_checkboxes,
4
- radio_buttons: :horizontal_radio_and_checkboxes,
5
- file: :horizontal_file_input,
6
- boolean: :horizontal_boolean }) do |f|
1
+ = simple_bootstrap_form_for <%= "[:#{prefix}, @#{singular_table_name}]" %> do |f|
7
2
 
8
3
  = f.error_notification
9
4
 
@@ -35,4 +35,4 @@
35
35
  .col-md-4.text-right
36
36
  .btn-group.per-page
37
37
  - [ 10, 25, 100, 250, 500, 1000 ].each do |i|
38
- = link_to i, { action: :index, page: params[:page], per_page: i }, class: "btn #{per_page_class(<%= class_name %>, i)}"
38
+ = link_to i, params.merge(page: 1, per_page: i), class: "btn #{per_page_class(<%= class_name %>, i)}"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: admin-panel
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michał Matyas
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-30 00:00:00.000000000 Z
11
+ date: 2014-07-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler