effective_developer 0.2.3 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/effective_developer/version.rb +1 -1
- data/lib/generators/effective/form_generator.rb +2 -0
- data/lib/scaffolds/controllers/controller.rb +1 -1
- data/lib/scaffolds/datatables/datatable.rb +9 -11
- data/lib/scaffolds/forms/default/_form.html.haml +3 -3
- data/lib/scaffolds/forms/fields/_field_nested_resource.html.haml +1 -1
- data/lib/scaffolds/forms/tabpanel/_tab_nested_resource.html.haml +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: a7cf57c2a6d450e95f10d7b78b614bc4a1b3f6a6
|
4
|
+
data.tar.gz: a9d76503a9e842f76aa89969ef51f17b58e9d01d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 446d3d327210b316c3b65e707f4ad541921b0b69029c880522469eef72a3c0521e07927613e45140b1b38fb407edd81a3c32258586f7c892474958a251eb8dde
|
7
|
+
data.tar.gz: c16dc301b6e0e62a3dee3a49a6580b8c63252b52ca318261ff71cf22d2e408e96fde4ad576e9f48a2c0bf16852f759ec46ab139d958e15264878544b16ef25c3
|
@@ -43,6 +43,8 @@ module Effective
|
|
43
43
|
resource.nested_resources.each do |nested_resource|
|
44
44
|
@nested_resource = nested_resource
|
45
45
|
template 'forms/tabpanel/_tab_nested_resource.html.haml', resource.view_file("form_#{nested_resource.plural_name}", partial: true)
|
46
|
+
|
47
|
+
@nested_resource = Effective::Resource.new(nested_resource)
|
46
48
|
template 'forms/fields/_nested_resource_fields.html.haml', File.join('app/views', resource.namespace.to_s, (resource.namespace.present? ? '' : resource.class_path), nested_resource.name.to_s.underscore.pluralize, '_fields.html.haml')
|
47
49
|
end
|
48
50
|
end
|
@@ -10,7 +10,7 @@ class <%= resource.namespaced_class_name.pluralize %>Controller < <%= [resource.
|
|
10
10
|
@page_title = '<%= resource.plural_name.titleize %>'
|
11
11
|
authorize! :index, <%= resource.class_name %>
|
12
12
|
|
13
|
-
@datatable = <%= resource.namespaced_class_name.pluralize %>Datatable.new(
|
13
|
+
@datatable = <%= resource.namespaced_class_name.pluralize %>Datatable.new(self)
|
14
14
|
end
|
15
15
|
|
16
16
|
<% end -%>
|
@@ -1,42 +1,40 @@
|
|
1
1
|
class <%= resource.namespaced_class_name.pluralize %>Datatable < Effective::Datatable
|
2
2
|
<% if resource.scopes.present? -%>
|
3
|
-
|
3
|
+
filters do<% ([:all] + resource.scopes).uniq.each_with_index do |scope, index| %>
|
4
4
|
scope :<%= scope -%><%= ', default: true' if index == 0 -%>
|
5
5
|
<% end %>
|
6
6
|
end
|
7
7
|
|
8
8
|
<% end -%>
|
9
9
|
datatable do
|
10
|
-
|
10
|
+
order :<%= (attributes.find { |att| att.name == 'updated_at' } || attributes.first).name -%>, :desc
|
11
11
|
|
12
12
|
<% resource.belong_tos.each do |reference| -%>
|
13
|
-
|
13
|
+
col :<%= reference.name %>
|
14
14
|
<% end -%>
|
15
15
|
|
16
16
|
<% attributes.each do |attribute| -%>
|
17
|
-
|
17
|
+
col :<%= attribute.name %>
|
18
18
|
<% end -%>
|
19
19
|
|
20
20
|
<% if non_crud_actions.present? -%>
|
21
|
-
|
21
|
+
actions_col do |<%= singular_name %>|
|
22
22
|
<% non_crud_actions.each_with_index do |action, index| -%>
|
23
23
|
glyphicon_to('ok', <%= resource.action_path_helper(action, at: false) %>, title: '<%= action.titleize %>')<%= ' +' if (index+1) < (invoked_actions - crud_actions).length %>
|
24
24
|
<% end -%>
|
25
25
|
end
|
26
26
|
<% else -%>
|
27
|
-
|
27
|
+
actions_col
|
28
28
|
<% end -%>
|
29
29
|
end
|
30
30
|
|
31
31
|
<% if resource.scopes.blank? -%>
|
32
|
-
|
32
|
+
collection do
|
33
33
|
<%= resource.class_name %>.all
|
34
34
|
end
|
35
35
|
<% else -%>
|
36
|
-
|
37
|
-
|
38
|
-
col = col.send(current_scope) if current_scope
|
39
|
-
col
|
36
|
+
collection do
|
37
|
+
<%= resource.class_name %>.all
|
40
38
|
end
|
41
39
|
<% end -%>
|
42
40
|
|
@@ -10,7 +10,7 @@
|
|
10
10
|
<% if defined?(EffectiveResources) -%>
|
11
11
|
= simple_form_submit(f)
|
12
12
|
<% else -%>
|
13
|
-
f.button :submit, 'Save', data: { disable_with: 'Saving...' }
|
14
|
-
f.button :submit, 'Save and Continue', data: { disable_with: 'Saving...' }
|
15
|
-
f.button :submit, 'Save and Add New', data: { disable_with: 'Saving...' }
|
13
|
+
= f.button :submit, 'Save', data: { disable_with: 'Saving...' }
|
14
|
+
= f.button :submit, 'Save and Continue', data: { disable_with: 'Saving...' }
|
15
|
+
= f.button :submit, 'Save and Add New', data: { disable_with: 'Saving...' }
|
16
16
|
<% end -%>
|
@@ -8,4 +8,4 @@
|
|
8
8
|
= link_to_add_association(f, :<%= nested_resource.plural_name %>, partial: '<%= [resource.namespace.presence, nested_resource.plural_name].compact.join('/') %>/fields') do
|
9
9
|
%button.btn.btn-success
|
10
10
|
%span.glyphicon.glyphicon-plus-sign
|
11
|
-
Add another <%= nested_resource.name.titleize.downcase %>
|
11
|
+
Add another <%= nested_resource.name.to_s.titleize.downcase %>
|
@@ -1,3 +1,3 @@
|
|
1
|
-
%p There are #{pluralize(f.object.<%= nested_resource.plural_name %>.length, '<%= nested_resource.name.titleize.downcase %>')}.
|
1
|
+
%p There are #{pluralize(f.object.<%= nested_resource.plural_name %>.length, '<%= nested_resource.name.to_s.titleize.downcase %>')}.
|
2
2
|
|
3
3
|
<%= render_field(nested_resource) %>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: effective_developer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Code and Effect
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-04-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|