advanced_haml_scaffold_generator 1.0.2 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 75d940b81c39cc111b35e451fa7d3f05af279123
4
- data.tar.gz: 6a7be976e4046d997003525e34f11b297a02d299
3
+ metadata.gz: 3cc8b85d517c680c4a0a2e776232fcab61cfc42a
4
+ data.tar.gz: 75218a88d4a47cbe770f7aeaa0d4132401b2dc08
5
5
  SHA512:
6
- metadata.gz: 183c022779fb74b4086de57820f1280b24abfab7a4dd5737e7e733637a8a8c87a626292c542c0ec15f50746d1e583dddcf59553f0f6b8f1e24bda66c7cfcdcc6
7
- data.tar.gz: 8268788df3662ec01336e1a5d5c41c1696da76459d290d057d89e67d823b8cf6da7aca7f2365330a09755001e107d7f53569f8d736a96708eb31bf4d5c3940a4
6
+ metadata.gz: 3ca4ff1766bfc79bba7820a67dbebe9d569c4cb4e3bd7715e018fe3752afa30c6cce4a4348bb235ec51ec79fa2141339dcf5198a9ddf7ade65e4164b32c66638
7
+ data.tar.gz: 76aea0880a458cf16f93d42f7510ddf97205828b61db06f3acbae775850402000be376e1791fc63f2af05a5f7b47d7256a722da13fad45ef3f3eccaf894ed3af
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.2
1
+ 1.0.3
@@ -2,16 +2,16 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: advanced_haml_scaffold_generator 1.0.2 ruby lib
5
+ # stub: advanced_haml_scaffold_generator 1.0.3 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "advanced_haml_scaffold_generator"
9
- s.version = "1.0.2"
9
+ s.version = "1.0.3"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib"]
13
13
  s.authors = ["Dmitri Koulikoff"]
14
- s.date = "2015-02-20"
14
+ s.date = "2015-07-01"
15
15
  s.description = "Extention of the haml generator that generates templates with the use of i18n, cancan and WiceGrid, adds classes to buttons and uses :title helper"
16
16
  s.email = "dima@koulikoff.ru"
17
17
  s.extra_rdoc_files = [
@@ -40,7 +40,7 @@ Gem::Specification.new do |s|
40
40
  ]
41
41
  s.homepage = "http://github.com/dima4p/advanced_haml_scaffold_generator"
42
42
  s.licenses = ["MIT"]
43
- s.rubygems_version = "2.4.5"
43
+ s.rubygems_version = "2.2.2"
44
44
  s.summary = "Extention of the haml generator that is aware of i18n and so forth"
45
45
 
46
46
  if s.respond_to? :specification_version then
@@ -7,43 +7,82 @@
7
7
  %p.nav= link_to t('.new_<%= singular_table_name %>'), new_<%= singular_table_name %>_path, class: 'new'
8
8
  <% end -%>
9
9
 
10
+ - if @<%= plural_table_name %>.limit(1).size > 0
10
11
  <% if defined? Wice::WiceGrid -%>
11
- - if @grid
12
- = grid @grid do |g|
12
+ - if @grid
13
+ = grid @grid do |g|
13
14
  <% for attribute in attributes.reject(&:password_digest?) -%>
14
15
  <% if attribute.reference? -%>
15
- - g.column name: <%= class_name %>.human_attribute_name(:<%= attribute.name %>),
16
- :attribute => '<%= attribute.name %>_id' do |<%= singular_table_name %>|
17
- - <%= singular_table_name %>.<%= attribute.name %>.try :name
16
+ - g.column name: <%= class_name %>.human_attribute_name(:<%= attribute.name %>),
17
+ :attribute => '<%= attribute.name %>_id' do |<%= singular_table_name %>|
18
+ - <%= singular_table_name %>.<%= attribute.name %>.try :name
18
19
  <% else -%>
19
- - g.column name: <%= class_name %>.human_attribute_name(:<%= attribute.name %>),
20
- :attribute => '<%= attribute.name %>' do |<%= singular_table_name %>|
21
- - <%= singular_table_name %>.<%= attribute.name %>
20
+ - g.column name: <%= class_name %>.human_attribute_name(:<%= attribute.name %>),
21
+ :attribute => '<%= attribute.name %>' do |<%= singular_table_name %>|
22
+ - <%= singular_table_name %>.<%= attribute.name %>
22
23
  <% end -%>
23
24
  <% end -%>
24
25
  <% if options[:cancan] -%>
25
- - g.column do |<%= singular_table_name %>|
26
- - if can? :show, <%= singular_table_name %>
26
+ - g.column do |<%= singular_table_name %>|
27
+ - if can? :show, <%= singular_table_name %>
28
+ - link_to t('show'), <%= singular_table_name %>, class: 'show'
29
+ - g.column do |<%= singular_table_name %>|
30
+ - if can? :edit, <%= singular_table_name %>
31
+ - link_to t('edit'), edit_<%= singular_table_name %>_path(<%= singular_table_name %>), class: 'edit'
32
+ - g.column do |<%= singular_table_name %>|
33
+ - if can? :destroy, <%= singular_table_name %>
34
+ - link_to t('destroy'), <%= singular_table_name %>,
35
+ data: {confirm: t('.confirm', default: 'Are you sure?')},
36
+ method: :delete, class: 'destroy'
37
+ <% else -%>
38
+ - g.column do |<%= singular_table_name %>|
27
39
  - link_to t('show'), <%= singular_table_name %>, class: 'show'
28
- - g.column do |<%= singular_table_name %>|
29
- - if can? :edit, <%= singular_table_name %>
40
+ - g.column do |<%= singular_table_name %>|
30
41
  - link_to t('edit'), edit_<%= singular_table_name %>_path(<%= singular_table_name %>), class: 'edit'
31
- - g.column do |<%= singular_table_name %>|
32
- - if can? :destroy, <%= singular_table_name %>
42
+ - g.column do |<%= singular_table_name %>|
33
43
  - link_to t('destroy'), <%= singular_table_name %>,
34
44
  data: {confirm: t('.confirm', default: 'Are you sure?')},
35
45
  method: :delete, class: 'destroy'
46
+ <% end -%>
47
+ -else
48
+ %table
49
+ %thead
50
+ %tr
51
+ <% for attribute in attributes.reject(&:password_digest?) -%>
52
+ %th= <%= class_name %>.human_attribute_name :<%= attribute.name %>
53
+ <% end -%>
54
+ %th{:colspan => 3}= t 'actions'
55
+
56
+ %tbody
57
+ - @<%= plural_table_name %>.each do |<%= singular_table_name %>|
58
+ %tr{ :class => cycle(:odd, :even) }
59
+ <% for attribute in attributes.reject(&:password_digest?) -%>
60
+ <% if attribute.reference? -%>
61
+ %td= <%= singular_table_name %>.<%= attribute.name %>.try :name
36
62
  <% else -%>
37
- - g.column do |<%= singular_table_name %>|
38
- - link_to t('show'), <%= singular_table_name %>, class: 'show'
39
- - g.column do |<%= singular_table_name %>|
40
- - link_to t('edit'), edit_<%= singular_table_name %>_path(<%= singular_table_name %>), class: 'edit'
41
- - g.column do |<%= singular_table_name %>|
42
- - link_to t('destroy'), <%= singular_table_name %>,
43
- data: {confirm: t('.confirm', default: 'Are you sure?')},
44
- method: :delete, class: 'destroy'
63
+ %td= <%= singular_table_name %>.<%= attribute.name %>
64
+ <% end -%>
45
65
  <% end -%>
46
- -else
66
+ <% if options[:cancan] -%>
67
+ %td.action
68
+ - if can? :show, <%= singular_table_name %>
69
+ = link_to t('show'), <%= singular_table_name %>, class: 'show'
70
+ %td.action
71
+ - if can? :edit, <%= singular_table_name %>
72
+ = link_to t('edit'), edit_<%= singular_table_name %>_path(<%= singular_table_name %>), class: 'edit'
73
+ %td.action
74
+ - if can? :destroy, <%= singular_table_name %>
75
+ = link_to t('destroy'), <%= singular_table_name %>,
76
+ data: {confirm: t('.confirm', default: 'Are you sure?')},
77
+ method: :delete, class: 'destroy'
78
+ <% else -%>
79
+ %td.action= link_to t('show'), <%= singular_table_name %>, class: 'show'
80
+ %td.action= link_to t('edit'), edit_<%= singular_table_name %>_path(<%= singular_table_name %>), class: 'edit'
81
+ %td.action= link_to t('destroy'), <%= singular_table_name %>,
82
+ data: {confirm: t('.confirm', :default => 'Are you sure?')},
83
+ method: :delete, class: 'destroy'
84
+ <% end -%>
85
+ <% else -%>
47
86
  %table
48
87
  %thead
49
88
  %tr
@@ -81,42 +120,7 @@
81
120
  data: {confirm: t('.confirm', :default => 'Are you sure?')},
82
121
  method: :delete, class: 'destroy'
83
122
  <% end -%>
84
- <% else -%>
85
- %table
86
- %thead
87
- %tr
88
- <% for attribute in attributes.reject(&:password_digest?) -%>
89
- %th= <%= class_name %>.human_attribute_name :<%= attribute.name %>
90
- <% end -%>
91
- %th{:colspan => 3}= t 'actions'
92
-
93
- %tbody
94
- - @<%= plural_table_name %>.each do |<%= singular_table_name %>|
95
- %tr{ :class => cycle(:odd, :even) }
96
- <% for attribute in attributes.reject(&:password_digest?) -%>
97
- <% if attribute.reference? -%>
98
- %td= <%= singular_table_name %>.<%= attribute.name %>.try :name
99
- <% else -%>
100
- %td= <%= singular_table_name %>.<%= attribute.name %>
101
- <% end -%>
102
- <% end -%>
103
- <% if options[:cancan] -%>
104
- %td.action
105
- - if can? :show, <%= singular_table_name %>
106
- = link_to t('show'), <%= singular_table_name %>, class: 'show'
107
- %td.action
108
- - if can? :edit, <%= singular_table_name %>
109
- = link_to t('edit'), edit_<%= singular_table_name %>_path(<%= singular_table_name %>), class: 'edit'
110
- %td.action
111
- - if can? :destroy, <%= singular_table_name %>
112
- = link_to t('destroy'), <%= singular_table_name %>,
113
- data: {confirm: t('.confirm', default: 'Are you sure?')},
114
- method: :delete, class: 'destroy'
115
- <% else -%>
116
- %td.action= link_to t('show'), <%= singular_table_name %>, class: 'show'
117
- %td.action= link_to t('edit'), edit_<%= singular_table_name %>_path(<%= singular_table_name %>), class: 'edit'
118
- %td.action= link_to t('destroy'), <%= singular_table_name %>,
119
- data: {confirm: t('.confirm', :default => 'Are you sure?')},
120
- method: :delete, class: 'destroy'
121
- <% end -%>
122
123
  <% end -%>
124
+ - else
125
+ .empty
126
+ = t '.empty'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: advanced_haml_scaffold_generator
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dmitri Koulikoff
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-20 00:00:00.000000000 Z
11
+ date: 2015-07-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -127,7 +127,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
127
127
  version: '0'
128
128
  requirements: []
129
129
  rubyforge_project:
130
- rubygems_version: 2.4.5
130
+ rubygems_version: 2.2.2
131
131
  signing_key:
132
132
  specification_version: 4
133
133
  summary: Extention of the haml generator that is aware of i18n and so forth