scaffold_pico 1.1.4 → 1.1.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (40) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE.txt +0 -0
  3. data/README.md +0 -0
  4. data/lib/scaffold/cli.rb +0 -0
  5. data/lib/scaffold/erb_context.rb +0 -0
  6. data/lib/scaffold/generators/base_generator.rb +0 -0
  7. data/lib/scaffold/generators/controller_generator.rb +0 -0
  8. data/lib/scaffold/generators/fabricator_generator.rb +0 -0
  9. data/lib/scaffold/generators/locales_generator.rb +0 -0
  10. data/lib/scaffold/generators/models_generator.rb +0 -0
  11. data/lib/scaffold/generators/routes_generator.rb +0 -0
  12. data/lib/scaffold/generators/views_generator.rb +0 -0
  13. data/lib/scaffold/main.rb +0 -0
  14. data/lib/scaffold/models/resource.rb +0 -0
  15. data/lib/scaffold/rails.rb +0 -0
  16. data/lib/scaffold/services/controller.rb +0 -0
  17. data/lib/scaffold/services/nested_in_resources.rb +0 -0
  18. data/lib/scaffold/services/path.rb +0 -0
  19. data/lib/scaffold/services/resource.rb +0 -0
  20. data/lib/scaffold/services/route.rb +0 -0
  21. data/lib/scaffold/services/view.rb +0 -0
  22. data/lib/scaffold/template_engines/slim.rb +0 -0
  23. data/lib/scaffold_pico.rb +0 -0
  24. data/lib/templates/pico/controller.rb.erb +0 -0
  25. data/lib/templates/pico/fabricators/fabrication.rb.erb +0 -0
  26. data/lib/templates/pico/locales/bg.scaffold_pico.yml.erb +0 -0
  27. data/lib/templates/pico/locales/en.scaffold_pico.yml.erb +0 -0
  28. data/lib/templates/pico/model.rb.erb +0 -0
  29. data/lib/templates/pico/search.rb.erb +1 -1
  30. data/lib/templates/pico/views/materialize/slim/_form.html.slim.erb +0 -0
  31. data/lib/templates/pico/views/materialize/slim/edit.html.slim.erb +18 -17
  32. data/lib/templates/pico/views/materialize/slim/index.html.slim.erb +50 -49
  33. data/lib/templates/pico/views/materialize/slim/new.html.slim.erb +14 -13
  34. data/lib/templates/pico/views/materialize/slim/show.html.slim.erb +24 -23
  35. data/lib/templates/pico/views/zurb/slim/_form.html.slim.erb +0 -0
  36. data/lib/templates/pico/views/zurb/slim/edit.html.slim.erb +0 -0
  37. data/lib/templates/pico/views/zurb/slim/index.html.slim.erb +0 -0
  38. data/lib/templates/pico/views/zurb/slim/new.html.slim.erb +0 -0
  39. data/lib/templates/pico/views/zurb/slim/show.html.slim.erb +0 -0
  40. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 54d6aa9f935ff9204b98ff880dc5a5df4cab415a
4
- data.tar.gz: c3fb84df209e9c391a6dc681b680cb49e868c2f6
3
+ metadata.gz: f7bf0ebf5a68034b8518d22a937ab8fa981bf9d9
4
+ data.tar.gz: '06804700be5657251830719fb3bafeb884519aaf'
5
5
  SHA512:
6
- metadata.gz: c9ea4e9a1e107e18d4fdae253ddc2c2a09eae3987482518c67d97d05f22addfa89a1c1376773ebdac7e9ed39c98bf4ef4f285059cd639ce16ab706047d74545e
7
- data.tar.gz: 01615efab46b43b4b02955016df7457d4f9e90d32335d2f98bac50828c761f9d4523da2a20faf334fb9191bac0636121c0e49d8f29396ff92090f03cbef48c91
6
+ metadata.gz: 95cceedb5fa0ee9fbc17379b6f960259867450d722b73c60be88fda28bd1897ad063263a4e813010cd6306509a3004371c08bd8dffbb36e0af2eb21ffbd068cd
7
+ data.tar.gz: 1fb21fb5b70b53dbb8140b51565dfcc869186c6bd563a16face7e34ebf1d9a2b7d31b65f206eda3223114a80f95f7a1fe7002a074705ad486cc437d1c6afe14c
data/LICENSE.txt CHANGED
File without changes
data/README.md CHANGED
File without changes
data/lib/scaffold/cli.rb CHANGED
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
data/lib/scaffold/main.rb CHANGED
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
data/lib/scaffold_pico.rb CHANGED
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -25,7 +25,7 @@ class <%= @rails.resource.search_class_name %>
25
25
  def results
26
26
  <%= @rails.resource.name %> = @relation
27
27
 
28
- <%= @rails.resource.name %> = @relation.order("updated_at") if <%= @rails.resource.class_name_with_modules %>.respond_to?(:updated_at)
28
+ <%= @rails.resource.name %> = @relation.order("updated_at") if <%= @rails.resource.class_name_with_modules %>.column_names.include?('updated_at')
29
29
 
30
30
  if valid?
31
31
  <% @rails.resource.fields.select {|k,v| @rails.controller.search_fields.include?(k) }.each_pair do |field_name, field_type| %>
@@ -1,22 +1,23 @@
1
- h1 = t('scaffold.edit.title', model: <%= @rails.resource.class_name_with_modules %>.model_name.human(count: 1).mb_chars.downcase)
1
+ .container
2
+ h1 = t('scaffold.edit.title', model: <%= @rails.resource.class_name_with_modules %>.model_name.human(count: 1).mb_chars.downcase)
2
3
 
3
- .section
4
- .left
5
- = link_to <%= @rails.path.collection %>, class: 'waves-effect waves-light btn' do
6
- i.material-icons.right view_list
7
- = t('scaffold.show.actions.index', model: <%= @rails.resource.class_name_with_modules %>.model_name.human(count: 2).mb_chars.downcase)
4
+ .section
5
+ .left
6
+ = link_to <%= @rails.path.collection %>, class: 'waves-effect waves-light btn' do
7
+ i.material-icons.right view_list
8
+ = t('scaffold.show.actions.index', model: <%= @rails.resource.class_name_with_modules %>.model_name.human(count: 2).mb_chars.downcase)
8
9
 
9
10
 
10
- .right
11
- = link_to <%= @rails.path.new_resource %>, class: 'btn waves-effect waves-light' do
12
- i.material-icons.right add
13
- = t('scaffold.actions.new', model: <%= @rails.resource.class_name_with_modules %>.model_name.human(count: 1).mb_chars.downcase)
11
+ .right
12
+ = link_to <%= @rails.path.new_resource %>, class: 'btn waves-effect waves-light' do
13
+ i.material-icons.right add
14
+ = t('scaffold.actions.new', model: <%= @rails.resource.class_name_with_modules %>.model_name.human(count: 1).mb_chars.downcase)
14
15
 
15
- .clearfix
16
+ .clearfix
16
17
 
17
- .card
18
- .card-content
19
- = simple_form_for <%= @rails.path.instance_resource %> do |form|
20
- = render 'form', form: form
21
- .form-actions
22
- = form.button :button, t('scaffold.actions.update', model: <%= @rails.resource.class_name_with_modules %>.model_name.human(count: 1)), :class => 'btn btn-large waves-effect waves'
18
+ .card
19
+ .card-content
20
+ = simple_form_for <%= @rails.path.instance_resource %> do |form|
21
+ = render 'form', form: form
22
+ .form-actions
23
+ = form.button :button, t('scaffold.actions.update', model: <%= @rails.resource.class_name_with_modules %>.model_name.human(count: 1)), :class => 'btn btn-large waves-effect waves'
@@ -1,57 +1,58 @@
1
- h1 = t('scaffold.index.title', model: <%= @rails.resource.class_name_with_modules %>.model_name.human(count: 2))
1
+ .container
2
+ h1 = t('scaffold.index.title', model: <%= @rails.resource.class_name_with_modules %>.model_name.human(count: 2))
2
3
 
3
- .fixed-action-btn style="bottom: 45px; right: 24px;"
4
- = link_to <%= @rails.path.new_resource %>, class: 'btn-floating btn-large waves-effect waves-light red' do
5
- i.material-icons.right add
6
- = t('scaffold.actions.new', model: <%= @rails.resource.class_name_with_modules %>.model_name.human(count: 1).mb_chars.downcase)
4
+ .fixed-action-btn style="bottom: 45px; right: 24px;"
5
+ = link_to <%= @rails.path.new_resource %>, class: 'btn-floating btn-large waves-effect waves-light red' do
6
+ i.material-icons.right add
7
+ = t('scaffold.actions.new', model: <%= @rails.resource.class_name_with_modules %>.model_name.human(count: 1).mb_chars.downcase)
7
8
 
8
9
 
9
10
 
10
- .row
11
- .col.s12.m9
12
- .card
13
- .card-content
14
- table.striped.highlight.responsive-table
15
- thead
16
- tr
17
- <% @rails.resource.fields.select {|k,v| @rails.controller.index_fields.include?(k) }.keys.each do |field_name| %>
18
- th = <%= @rails.resource.class_name_with_modules -%>.human_attribute_name(:<%= field_name -%>)
19
- <% end %>
20
- th colspan=3 = t('scaffold.index.actions')
21
-
22
- tbody
23
- - @<%= @rails.resource.collection_name %>.each do |<%= @rails.resource.name %>|
11
+ .row
12
+ .col.s12.m9
13
+ .card
14
+ .card-content
15
+ table.striped.highlight.responsive-table
16
+ thead
24
17
  tr
25
18
  <% @rails.resource.fields.select {|k,v| @rails.controller.index_fields.include?(k) }.keys.each do |field_name| %>
26
- td = <%= @rails.resource.name %>.<%= field_name -%>
19
+ th = <%= @rails.resource.class_name_with_modules -%>.human_attribute_name(:<%= field_name -%>)
27
20
  <% end %>
28
- td = link_to t('scaffold.index.show'), <%= @rails.path.resource %>
29
- td = link_to t('scaffold.index.edit'), <%= @rails.path.edit_resource %>
30
- td = link_to t('scaffold.index.destroy'), <%= @rails.path.resource %>, data: {:confirm => t('scaffold.confirm')}, :method => :delete
31
- .card-action
32
- = paginate @<%= @rails.resource.collection_name %>
33
-
34
- .col.s12.m3
35
-
36
- aside.card.search
37
- = simple_form_for <%= "@#{@rails.resource.collection_name}_search" %>, as: :<%= @rails.resource.collection_name %>_search, url: <%= @rails.path.collection %>, method: :get do |form|
38
- .card-content
39
- h5 = t('scaffold.index.search.header')
40
- = form.error_notification
41
-
42
- <% @rails.resource.fields.select {|k,v| @rails.controller.search_fields.include?(k) }.each_pair do |field_name, field_type| %>
43
- <% if field_type == 'belongs_to' -%>
44
- = form.input :<%= field_name -%>_id
45
- <% elsif ['date', 'datetime'].include?(field_type) -%>
46
- = form.input :<%= field_name -%>, as: :date, html5: true
47
- <% elsif field_type == 'boolean' -%>
48
- = form.input :<%= field_name -%>, as: :boolean, input_html: {class: 'filled-in'}
49
- <% else %>
50
- = form.input :<%= field_name -%>
51
- <% end -%>
52
- <% end %>
53
-
21
+ th colspan=3 = t('scaffold.index.actions')
22
+
23
+ tbody
24
+ - @<%= @rails.resource.collection_name %>.each do |<%= @rails.resource.name %>|
25
+ tr
26
+ <% @rails.resource.fields.select {|k,v| @rails.controller.index_fields.include?(k) }.keys.each do |field_name| %>
27
+ td = <%= @rails.resource.name %>.<%= field_name -%>
28
+ <% end %>
29
+ td = link_to t('scaffold.index.show'), <%= @rails.path.resource %>
30
+ td = link_to t('scaffold.index.edit'), <%= @rails.path.edit_resource %>
31
+ td = link_to t('scaffold.index.destroy'), <%= @rails.path.resource %>, data: {:confirm => t('scaffold.confirm')}, :method => :delete
54
32
  .card-action
55
- = link_to t('scaffold.index.search.reset'), url_for(<%= @rails.path.collection %>), class: 'waves-effect waves-light btn lime lighten-5 black-text'
56
- = form.submit t('scaffold.index.search.button'), class: 'right waves-effect waves-light btn'
57
- .clearfix
33
+ = paginate @<%= @rails.resource.collection_name %>
34
+
35
+ .col.s12.m3
36
+
37
+ aside.card.search
38
+ = simple_form_for <%= "@#{@rails.resource.collection_name}_search" %>, as: :<%= @rails.resource.collection_name %>_search, url: <%= @rails.path.collection %>, method: :get do |form|
39
+ .card-content
40
+ h5 = t('scaffold.index.search.header')
41
+ = form.error_notification
42
+
43
+ <% @rails.resource.fields.select {|k,v| @rails.controller.search_fields.include?(k) }.each_pair do |field_name, field_type| %>
44
+ <% if field_type == 'belongs_to' -%>
45
+ = form.input :<%= field_name -%>_id
46
+ <% elsif ['date', 'datetime'].include?(field_type) -%>
47
+ = form.input :<%= field_name -%>, as: :date, html5: true
48
+ <% elsif field_type == 'boolean' -%>
49
+ = form.input :<%= field_name -%>, as: :boolean, input_html: {class: 'filled-in'}
50
+ <% else %>
51
+ = form.input :<%= field_name -%>
52
+ <% end -%>
53
+ <% end %>
54
+
55
+ .card-action
56
+ = link_to t('scaffold.index.search.reset'), url_for(<%= @rails.path.collection %>), class: 'waves-effect waves-light btn lime lighten-5 black-text'
57
+ = form.submit t('scaffold.index.search.button'), class: 'right waves-effect waves-light btn'
58
+ .clearfix
@@ -1,16 +1,17 @@
1
- h1 = t('scaffold.new.title', model: <%= @rails.resource.class_name_with_modules %>.model_name.human(count: 1).mb_chars.downcase)
1
+ .container
2
+ h1 = t('scaffold.new.title', model: <%= @rails.resource.class_name_with_modules %>.model_name.human(count: 1).mb_chars.downcase)
2
3
 
3
- .section
4
- .left
5
- = link_to <%= @rails.path.collection %>, class: 'waves-effect waves-light btn' do
6
- i.material-icons.right view_list
7
- = t('scaffold.show.actions.index', model: <%= @rails.resource.class_name_with_modules %>.model_name.human(count: 2).mb_chars.downcase)
4
+ .section
5
+ .left
6
+ = link_to <%= @rails.path.collection %>, class: 'waves-effect waves-light btn' do
7
+ i.material-icons.right view_list
8
+ = t('scaffold.show.actions.index', model: <%= @rails.resource.class_name_with_modules %>.model_name.human(count: 2).mb_chars.downcase)
8
9
 
9
- .clearfix
10
+ .clearfix
10
11
 
11
- .card
12
- .card-content
13
- = simple_form_for <%= @rails.path.instance_resource %> do |form|
14
- = render 'form', form: form
15
- .form-actions
16
- = form.button :button, t('scaffold.actions.create', model: <%= @rails.resource.class_name_with_modules %>.model_name.human(count: 1)), :class => 'btn btn-large waves-effect waves'
12
+ .card
13
+ .card-content
14
+ = simple_form_for <%= @rails.path.instance_resource %> do |form|
15
+ = render 'form', form: form
16
+ .form-actions
17
+ = form.button :button, t('scaffold.actions.create', model: <%= @rails.resource.class_name_with_modules %>.model_name.human(count: 1)), :class => 'btn btn-large waves-effect waves'
@@ -1,26 +1,27 @@
1
- h1 = t('scaffold.show.title', model: <%= @rails.resource.class_name_with_modules %>.model_name.human(count: 1).mb_chars.downcase)
1
+ .container
2
+ h1 = t('scaffold.show.title', model: <%= @rails.resource.class_name_with_modules %>.model_name.human(count: 1).mb_chars.downcase)
2
3
 
3
- .section
4
- .left
5
- = link_to <%= @rails.path.collection %>, class: 'waves-effect waves-light btn' do
6
- i.material-icons.right view_list
7
- = t('scaffold.actions.index', model: <%= @rails.resource.class_name_with_modules %>.model_name.human(count: 2).mb_chars.downcase)
8
- .right
9
- = link_to <%= @rails.path.edit_instance_resource %>, class: 'btn waves-effect waves-light' do
10
- i.material-icons.right mode_edit
11
- = t('scaffold.actions.edit', model: <%= @rails.resource.class_name_with_modules %>.model_name.human(count: 1).mb_chars.downcase)
12
- = link_to <%= @rails.path.new_resource %>, class: 'btn waves-effect waves-light' do
13
- i.material-icons.right add
14
- = t('scaffold.actions.new', model: <%= @rails.resource.class_name_with_modules %>.model_name.human(count: 1).mb_chars.downcase)
4
+ .section
5
+ .left
6
+ = link_to <%= @rails.path.collection %>, class: 'waves-effect waves-light btn' do
7
+ i.material-icons.right view_list
8
+ = t('scaffold.actions.index', model: <%= @rails.resource.class_name_with_modules %>.model_name.human(count: 2).mb_chars.downcase)
9
+ .right
10
+ = link_to <%= @rails.path.edit_instance_resource %>, class: 'btn waves-effect waves-light' do
11
+ i.material-icons.right mode_edit
12
+ = t('scaffold.actions.edit', model: <%= @rails.resource.class_name_with_modules %>.model_name.human(count: 1).mb_chars.downcase)
13
+ = link_to <%= @rails.path.new_resource %>, class: 'btn waves-effect waves-light' do
14
+ i.material-icons.right add
15
+ = t('scaffold.actions.new', model: <%= @rails.resource.class_name_with_modules %>.model_name.human(count: 1).mb_chars.downcase)
15
16
 
16
- .clearfix
17
+ .clearfix
17
18
 
18
- .card
19
- .card-content
20
- table.striped.highlight.responsive-table
21
- tbody
22
- <% @rails.resource.fields.keys.each do |field_name| %>
23
- tr
24
- td = <%= @rails.resource.class_name_with_modules -%>.human_attribute_name(:<%= field_name -%>)
25
- td = @<%= @rails.resource.name %>.<%= field_name -%>
26
- <% end %>
19
+ .card
20
+ .card-content
21
+ table.striped.highlight.responsive-table
22
+ tbody
23
+ <% @rails.resource.fields.keys.each do |field_name| %>
24
+ tr
25
+ td = <%= @rails.resource.class_name_with_modules -%>.human_attribute_name(:<%= field_name -%>)
26
+ td = @<%= @rails.resource.name %>.<%= field_name -%>
27
+ <% end %>
File without changes
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scaffold_pico
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.4
4
+ version: 1.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - gudata
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-10-10 00:00:00.000000000 Z
11
+ date: 2018-03-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -148,7 +148,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
148
148
  version: '0'
149
149
  requirements: []
150
150
  rubyforge_project:
151
- rubygems_version: 2.6.14
151
+ rubygems_version: 2.5.2.2
152
152
  signing_key:
153
153
  specification_version: 4
154
154
  summary: Scaffold should be simple