advanced_haml_scaffold_generator 1.0.3 → 1.0.5

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: 3cc8b85d517c680c4a0a2e776232fcab61cfc42a
4
- data.tar.gz: 75218a88d4a47cbe770f7aeaa0d4132401b2dc08
3
+ metadata.gz: 68597275fbe8ab50e518ce1dcffa8e0e064e61d7
4
+ data.tar.gz: 7bcc2e58236aaed3a5c82dec74253b02d8440637
5
5
  SHA512:
6
- metadata.gz: 3ca4ff1766bfc79bba7820a67dbebe9d569c4cb4e3bd7715e018fe3752afa30c6cce4a4348bb235ec51ec79fa2141339dcf5198a9ddf7ade65e4164b32c66638
7
- data.tar.gz: 76aea0880a458cf16f93d42f7510ddf97205828b61db06f3acbae775850402000be376e1791fc63f2af05a5f7b47d7256a722da13fad45ef3f3eccaf894ed3af
6
+ metadata.gz: cab15c4810c826072e88a7522fe6ce5c9b7d9236d7ca3746396fec213172ea2bb158d995f16791fbba39461b2b8f2faa63bbd7c5837884990859060f7b77f92c
7
+ data.tar.gz: 4b9dc4371d153bb3ddeee069be2e9c8c1c2001502d4e1e2aac23f4f513850f91e1f0685dd9e54bda8b9f0b9014092b02ee7b08f6231e72f4dcb8648ca47f2000
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.3
1
+ 1.0.5
@@ -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.3 ruby lib
5
+ # stub: advanced_haml_scaffold_generator 1.0.5 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "advanced_haml_scaffold_generator"
9
- s.version = "1.0.3"
9
+ s.version = "1.0.5"
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-07-01"
14
+ s.date = "2016-08-26"
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 = [
@@ -30,6 +30,7 @@ Gem::Specification.new do |s|
30
30
  "lib/rails/generators/haml/base.rb",
31
31
  "lib/rails/generators/haml/scaffold/scaffold_generator.rb",
32
32
  "lib/rails/generators/haml/scaffold/templates/_form.html.haml",
33
+ "lib/rails/generators/haml/scaffold/templates/destroy.js.coffee",
33
34
  "lib/rails/generators/haml/scaffold/templates/edit.html.haml",
34
35
  "lib/rails/generators/haml/scaffold/templates/index.html.haml",
35
36
  "lib/rails/generators/haml/scaffold/templates/layout.html.haml",
@@ -40,7 +41,7 @@ Gem::Specification.new do |s|
40
41
  ]
41
42
  s.homepage = "http://github.com/dima4p/advanced_haml_scaffold_generator"
42
43
  s.licenses = ["MIT"]
43
- s.rubygems_version = "2.2.2"
44
+ s.rubygems_version = "2.5.1"
44
45
  s.summary = "Extention of the haml generator that is aware of i18n and so forth"
45
46
 
46
47
  if s.respond_to? :specification_version then
@@ -21,6 +21,10 @@ module Haml
21
21
  copy_view :index
22
22
  end
23
23
 
24
+ def copy_destroy_file
25
+ copy_coffee :destroy
26
+ end
27
+
24
28
  def copy_edit_file
25
29
  copy_view :edit
26
30
  end
@@ -43,9 +47,14 @@ module Haml
43
47
  end
44
48
 
45
49
  protected
46
- def copy_view(view)
50
+
51
+ def copy_coffee(view)
52
+ template "#{view}.js.coffee", File.join("app/views", controller_file_path, "#{view}.js.coffee")
53
+ end
54
+
55
+ def copy_view(view)
47
56
  template "#{view}.html.haml", File.join("app/views", controller_file_path, "#{view}.html.haml")
48
- end
57
+ end
49
58
  end
50
59
  end
51
60
  end
@@ -17,7 +17,7 @@
17
17
  - if @<%= singular_table_name %>.errors.any?
18
18
  #error_explanation
19
19
  %h2
20
- = t 'errors.template.header', model: t('.<%= singular_table_name %>'), count: @<%= singular_table_name %>.errors.count
20
+ = t 'errors.template.header', model: t('.<%= singular_name %>'), count: @<%= singular_name %>.errors.count
21
21
  %ul
22
22
  - @<%= singular_table_name %>.errors.full_messages.each do |msg|
23
23
  %li= msg
@@ -0,0 +1,4 @@
1
+ url = '<%%= <%= singular_name %>_path @<%= singular_name %> %>'
2
+ line = $("a[href='#{url}']").closest('tr')
3
+ line.fadeOut 1000, ->
4
+ line.remove()
@@ -14,11 +14,11 @@
14
14
  <% for attribute in attributes.reject(&:password_digest?) -%>
15
15
  <% if attribute.reference? -%>
16
16
  - g.column name: <%= class_name %>.human_attribute_name(:<%= attribute.name %>),
17
- :attribute => '<%= attribute.name %>_id' do |<%= singular_table_name %>|
17
+ attribute: '<%= attribute.name %>_id' do |<%= singular_table_name %>|
18
18
  - <%= singular_table_name %>.<%= attribute.name %>.try :name
19
19
  <% else -%>
20
20
  - g.column name: <%= class_name %>.human_attribute_name(:<%= attribute.name %>),
21
- :attribute => '<%= attribute.name %>' do |<%= singular_table_name %>|
21
+ attribute: '<%= attribute.name %>' do |<%= singular_table_name %>|
22
22
  - <%= singular_table_name %>.<%= attribute.name %>
23
23
  <% end -%>
24
24
  <% end -%>
@@ -51,11 +51,11 @@
51
51
  <% for attribute in attributes.reject(&:password_digest?) -%>
52
52
  %th= <%= class_name %>.human_attribute_name :<%= attribute.name %>
53
53
  <% end -%>
54
- %th{:colspan => 3}= t 'actions'
54
+ %th{colspan: 3}= t 'actions'
55
55
 
56
56
  %tbody
57
57
  - @<%= plural_table_name %>.each do |<%= singular_table_name %>|
58
- %tr{ :class => cycle(:odd, :even) }
58
+ %tr{class: cycle(:odd, :even)}
59
59
  <% for attribute in attributes.reject(&:password_digest?) -%>
60
60
  <% if attribute.reference? -%>
61
61
  %td= <%= singular_table_name %>.<%= attribute.name %>.try :name
@@ -79,7 +79,7 @@
79
79
  %td.action= link_to t('show'), <%= singular_table_name %>, class: 'show'
80
80
  %td.action= link_to t('edit'), edit_<%= singular_table_name %>_path(<%= singular_table_name %>), class: 'edit'
81
81
  %td.action= link_to t('destroy'), <%= singular_table_name %>,
82
- data: {confirm: t('.confirm', :default => 'Are you sure?')},
82
+ data: {confirm: t('.confirm', default: 'Are you sure?')},
83
83
  method: :delete, class: 'destroy'
84
84
  <% end -%>
85
85
  <% else -%>
@@ -89,11 +89,11 @@
89
89
  <% for attribute in attributes.reject(&:password_digest?) -%>
90
90
  %th= <%= class_name %>.human_attribute_name :<%= attribute.name %>
91
91
  <% end -%>
92
- %th{:colspan => 3}= t 'actions'
92
+ %th{colspan: 3}= t 'actions'
93
93
 
94
94
  %tbody
95
95
  - @<%= plural_table_name %>.each do |<%= singular_table_name %>|
96
- %tr{ :class => cycle(:odd, :even) }
96
+ %tr{class: cycle(:odd, :even)}
97
97
  <% for attribute in attributes.reject(&:password_digest?) -%>
98
98
  <% if attribute.reference? -%>
99
99
  %td= <%= singular_table_name %>.<%= attribute.name %>.try :name
@@ -117,7 +117,7 @@
117
117
  %td.action= link_to t('show'), <%= singular_table_name %>, class: 'show'
118
118
  %td.action= link_to t('edit'), edit_<%= singular_table_name %>_path(<%= singular_table_name %>), class: 'edit'
119
119
  %td.action= link_to t('destroy'), <%= singular_table_name %>,
120
- data: {confirm: t('.confirm', :default => 'Are you sure?')},
120
+ data: {confirm: t('.confirm', default: 'Are you sure?')},
121
121
  method: :delete, class: 'destroy'
122
122
  <% end -%>
123
123
  <% end -%>
@@ -5,7 +5,7 @@
5
5
  = yield(:title) || "Untitled"
6
6
  |
7
7
  = t :application_name
8
- %meta{"http-equiv"=>"Content-Type", :content=>"text/html; charset=utf-8"}/
8
+ %meta{"http-equiv"=>"Content-Type", content: "text/html; charset=utf-8"}/
9
9
  = favicon_link_tag 'application.ico'
10
10
  = stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true
11
11
  = javascript_include_tag 'application', 'data-turbolinks-track' => true
@@ -14,15 +14,15 @@
14
14
  = csrf_meta_tag
15
15
  = yield(:head)
16
16
 
17
- %body{:lang => I18n.locale,
18
- :class => [controller.controller_name, controller.action_name, yield(:body_class)]}
17
+ %body{lang: I18n.locale,
18
+ class: [controller.controller_name, controller.action_name, yield(:body_class)]}
19
19
  -# @debug_ability.each do |ability|
20
20
  %p
21
21
  = ability.inspect
22
22
  #container
23
23
  #content
24
24
  - flash.each do |name, msg|
25
- = content_tag :div, msg.html_safe, :id => "flash_#{name}"
25
+ = content_tag :div, msg.html_safe, id: "flash_#{name}"
26
26
 
27
27
  - if respond_to?(:show_title?) and show_title?
28
28
  %h1
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.3
4
+ version: 1.0.5
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-07-01 00:00:00.000000000 Z
11
+ date: 2016-08-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -100,6 +100,7 @@ files:
100
100
  - lib/rails/generators/haml/base.rb
101
101
  - lib/rails/generators/haml/scaffold/scaffold_generator.rb
102
102
  - lib/rails/generators/haml/scaffold/templates/_form.html.haml
103
+ - lib/rails/generators/haml/scaffold/templates/destroy.js.coffee
103
104
  - lib/rails/generators/haml/scaffold/templates/edit.html.haml
104
105
  - lib/rails/generators/haml/scaffold/templates/index.html.haml
105
106
  - lib/rails/generators/haml/scaffold/templates/layout.html.haml
@@ -127,7 +128,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
127
128
  version: '0'
128
129
  requirements: []
129
130
  rubyforge_project:
130
- rubygems_version: 2.2.2
131
+ rubygems_version: 2.5.1
131
132
  signing_key:
132
133
  specification_version: 4
133
134
  summary: Extention of the haml generator that is aware of i18n and so forth