rademade_admin 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/cells/menu/item.slim +12 -11
- data/app/cells/menu/sub_item.slim +5 -4
- data/app/controllers/rademade_admin/abstract_controller.rb +4 -0
- data/app/controllers/rademade_admin/application_controller.rb +0 -4
- data/app/controllers/rademade_admin/model_controller.rb +13 -4
- data/app/views/rademade_admin/_blocks/form/_control.html.erb +1 -1
- data/lib/rademade_admin/version.rb +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: 9b5a2cb3531638de5873ab10f39c9d89b5628d6e
|
4
|
+
data.tar.gz: 377c15c9e31e321d6fac8e2994c2b88acfebe8c3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3fbfa9b7ec35b66ea9df3a88bfff40ce06ad34940d935b2768ef33e08b5317292eb702c71ac93085b9bb0be8446dd6cf3a6841cfc4f229fcea40b3541fc3cf67
|
7
|
+
data.tar.gz: 57d1a457a2b782f2626e9fd4f0378cc0d018655b8ebfba0df2fbef067b9b8d1abd3d78eea98f2d57bfcd9a1dae26c3dbbed801690038c59616432f884f9311b0
|
data/app/cells/menu/item.slim
CHANGED
@@ -1,15 +1,16 @@
|
|
1
|
-
|
1
|
+
- if @uri
|
2
|
+
li class=('menu-box' + (@is_active ? ' active' : ''))
|
2
3
|
|
3
|
-
|
4
|
-
|
5
|
-
|
4
|
+
.pointer
|
5
|
+
.arrow
|
6
|
+
.arrow_border
|
6
7
|
|
7
|
-
|
8
|
-
|
9
|
-
|
8
|
+
a href="#{@uri}" class=('menu-link' + (@has_sub_items ? ' dropdown-toggle' : ''))
|
9
|
+
i(class="#{@ico_class}")
|
10
|
+
span #{@name}
|
10
11
|
|
11
|
-
|
12
|
-
|
12
|
+
- if @has_sub_items
|
13
|
+
span.caret
|
13
14
|
|
14
|
-
|
15
|
-
|
15
|
+
- if @has_sub_items
|
16
|
+
=render_cell(:menu, :sub_items, @sub_items)
|
@@ -1,4 +1,5 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
1
|
+
- if @uri
|
2
|
+
li class=('menu-box' + (@is_active ? ' active' : ''))
|
3
|
+
a.menu-link(href="#{@uri}") #{@name}
|
4
|
+
- if @has_sub_items
|
5
|
+
=render_cell(:menu, :sub_items, @sub_items)
|
@@ -20,9 +20,9 @@ module RademadeAdmin
|
|
20
20
|
saver = RademadeAdmin::Saver.new(model_info, params)
|
21
21
|
saver.create_model
|
22
22
|
saver.save_data
|
23
|
-
success_insert
|
23
|
+
success_insert saver.item
|
24
24
|
rescue Exception => e
|
25
|
-
|
25
|
+
render_record_errors e
|
26
26
|
end
|
27
27
|
|
28
28
|
def update
|
@@ -30,9 +30,9 @@ module RademadeAdmin
|
|
30
30
|
saver = RademadeAdmin::Saver.new(model_info, params)
|
31
31
|
saver.find_model
|
32
32
|
saver.save_data
|
33
|
-
success_update
|
33
|
+
success_update saver.item
|
34
34
|
rescue Exception => e
|
35
|
-
|
35
|
+
render_record_errors e
|
36
36
|
end
|
37
37
|
|
38
38
|
def destroy
|
@@ -163,5 +163,14 @@ module RademadeAdmin
|
|
163
163
|
def additional_options
|
164
164
|
MenuCell.current_model = model
|
165
165
|
end
|
166
|
+
|
167
|
+
def render_record_errors(e)
|
168
|
+
if e.respond_to? :record
|
169
|
+
render_errors e.record.errors
|
170
|
+
else
|
171
|
+
render_errors e.message
|
172
|
+
end
|
173
|
+
end
|
174
|
+
|
166
175
|
end
|
167
176
|
end
|
@@ -1,3 +1,3 @@
|
|
1
1
|
<%= f.button :submit, :class => 'blue-btn' %>
|
2
2
|
<span class="btn-sep"><%= t('rademade_admin.or') %></span>
|
3
|
-
<%= link_to t('rademade_admin.cancel'), admin_list_uri(@model), :class => 'cancel-btn' %>
|
3
|
+
<%= link_to t('rademade_admin.cancel'), admin_list_uri(@model) || '', :class => 'cancel-btn' %>
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rademade_admin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vladislav Melanitskiy
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2014-12-
|
13
|
+
date: 2014-12-13 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rails
|