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.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/README.md +1 -1
- data/lib/admin-panel/version.rb +1 -1
- data/lib/generators/admin_panel/install/templates/helpers/admin_helper.rb +16 -0
- data/lib/generators/admin_panel/install/templates/views/erb/admin/passwords/edit.html.erb +1 -1
- data/lib/generators/admin_panel/install/templates/views/erb/admin/passwords/new.html.erb +1 -1
- data/lib/generators/admin_panel/install/templates/views/erb/kaminari/admin-bootstrap/_first_page.html.erb +3 -1
- data/lib/generators/admin_panel/install/templates/views/erb/kaminari/admin-bootstrap/_last_page.html.erb +3 -1
- data/lib/generators/admin_panel/install/templates/views/erb/kaminari/admin-bootstrap/_next_page.html.erb +3 -1
- data/lib/generators/admin_panel/install/templates/views/erb/kaminari/admin-bootstrap/_prev_page.html.erb +3 -1
- data/lib/generators/admin_panel/install/templates/views/haml/admin/passwords/edit.html.haml +1 -1
- data/lib/generators/admin_panel/install/templates/views/haml/admin/passwords/new.html.haml +1 -1
- data/lib/generators/admin_panel/install/templates/views/haml/kaminari/admin-bootstrap/_first_page.html.haml +2 -1
- data/lib/generators/admin_panel/install/templates/views/haml/kaminari/admin-bootstrap/_last_page.html.haml +2 -1
- data/lib/generators/admin_panel/install/templates/views/haml/kaminari/admin-bootstrap/_next_page.html.haml +2 -1
- data/lib/generators/admin_panel/install/templates/views/haml/kaminari/admin-bootstrap/_prev_page.html.haml +2 -1
- data/lib/generators/admin_panel/scaffold/templates/views/erb/_form.html.erb.erb +1 -8
- data/lib/generators/admin_panel/scaffold/templates/views/erb/index.html.erb.erb +1 -1
- data/lib/generators/admin_panel/scaffold/templates/views/haml/_form.html.haml.erb +1 -6
- data/lib/generators/admin_panel/scaffold/templates/views/haml/index.html.haml.erb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 411322c79a98a6ff879a3d5031817c8ce3cc34d8
|
4
|
+
data.tar.gz: ddfa1c1bf2d15383efb007118a86089d2e5d2e00
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b11dfa997f355fa2358000d8a91a36be5e45af027f720311596286229a04a5bcf59abba48ea6152046de939181d5723021bf887394687fdc8004466ef53418d4
|
7
|
+
data.tar.gz: fdc813690e37d685f181939d9073762d4c0db8e1b59d06a6fe0d36bb0b1fed30602e198e02d2943c6fedbab79aae2890d6df01b3b4eda9a1876fd2ebfc3922be
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
admin-panel (0.1.
|
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.
|
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
data/lib/admin-panel/version.rb
CHANGED
@@ -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
|
-
<%=
|
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
|
-
<%=
|
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
|
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
|
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
|
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
|
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
|
-
=
|
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
|
-
=
|
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
|
@@ -1,11 +1,4 @@
|
|
1
|
-
<%%=
|
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,
|
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
|
-
=
|
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,
|
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
|
+
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-
|
11
|
+
date: 2014-07-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|