advanced_haml_scaffold_generator 1.0.3 → 2.2.1
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 +5 -5
- data/VERSION +1 -1
- data/advanced_haml_scaffold_generator.gemspec +26 -31
- data/lib/rails/generators/haml/scaffold/scaffold_generator.rb +11 -2
- data/lib/rails/generators/haml/scaffold/templates/_form.html.haml +12 -6
- data/lib/rails/generators/haml/scaffold/templates/destroy.js.coffee +4 -0
- data/lib/rails/generators/haml/scaffold/templates/edit.html.haml +2 -1
- data/lib/rails/generators/haml/scaffold/templates/index.html.haml +10 -10
- data/lib/rails/generators/haml/scaffold/templates/layout.html.haml +4 -4
- data/lib/rails/generators/haml/scaffold/templates/new.html.haml +1 -1
- data/lib/rails/generators/haml/scaffold/templates/show.html.haml +2 -2
- metadata +4 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: fef652438f66d749087ba82ed59a7fbc08fc6ac733f7ab23b4e211bd50fa4da1
|
|
4
|
+
data.tar.gz: c8d01a88e1097e479311295cb7e056133e2b64ba83a36d4d0715183c947ae8ce
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e9abf6cbba9b17d981b21c175c1f83b06ec6c06d803f2792b2205591d607836e2f7caf5c6853e10f14ae1e528922bb83ffb4d0b91b8e95d517fba90a04cfd64a
|
|
7
|
+
data.tar.gz: a646413cf08486fcc15f51f5586de56e868ed4a4f53b6af3cb03b1a702bfb68ff187e9bb1e928d9879abb20d44e0b6924947ff1b19a46c947a14e0dc8de23de1
|
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
2.2.1
|
|
@@ -2,18 +2,18 @@
|
|
|
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
|
|
5
|
+
# stub: advanced_haml_scaffold_generator 2.2.1 ruby lib
|
|
6
6
|
|
|
7
7
|
Gem::Specification.new do |s|
|
|
8
|
-
s.name = "advanced_haml_scaffold_generator"
|
|
9
|
-
s.version = "
|
|
8
|
+
s.name = "advanced_haml_scaffold_generator".freeze
|
|
9
|
+
s.version = "2.2.1"
|
|
10
10
|
|
|
11
|
-
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
|
12
|
-
s.require_paths = ["lib"]
|
|
13
|
-
s.authors = ["Dmitri Koulikoff"]
|
|
14
|
-
s.date = "
|
|
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
|
-
s.email = "dima@koulikoff.ru"
|
|
11
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
|
|
12
|
+
s.require_paths = ["lib".freeze]
|
|
13
|
+
s.authors = ["Dmitri Koulikoff".freeze]
|
|
14
|
+
s.date = "2020-06-17"
|
|
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".freeze
|
|
16
|
+
s.email = "dima@koulikoff.ru".freeze
|
|
17
17
|
s.extra_rdoc_files = [
|
|
18
18
|
"LICENSE.txt",
|
|
19
19
|
"README.rdoc"
|
|
@@ -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",
|
|
@@ -38,33 +39,27 @@ Gem::Specification.new do |s|
|
|
|
38
39
|
"spec/advanced_haml_scaffold_generator_spec.rb",
|
|
39
40
|
"spec/spec_helper.rb"
|
|
40
41
|
]
|
|
41
|
-
s.homepage = "http://github.com/dima4p/advanced_haml_scaffold_generator"
|
|
42
|
-
s.licenses = ["MIT"]
|
|
43
|
-
s.rubygems_version = "
|
|
44
|
-
s.summary = "Extention of the haml generator that is aware of i18n and so forth"
|
|
42
|
+
s.homepage = "http://github.com/dima4p/advanced_haml_scaffold_generator".freeze
|
|
43
|
+
s.licenses = ["MIT".freeze]
|
|
44
|
+
s.rubygems_version = "3.1.2".freeze
|
|
45
|
+
s.summary = "Extention of the haml generator that is aware of i18n and so forth".freeze
|
|
45
46
|
|
|
46
47
|
if s.respond_to? :specification_version then
|
|
47
48
|
s.specification_version = 4
|
|
49
|
+
end
|
|
48
50
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
else
|
|
56
|
-
s.add_dependency(%q<rspec>, ["~> 3.1"])
|
|
57
|
-
s.add_dependency(%q<rdoc>, ["~> 4.1"])
|
|
58
|
-
s.add_dependency(%q<bundler>, ["~> 1.6"])
|
|
59
|
-
s.add_dependency(%q<jeweler>, ["~> 2.0"])
|
|
60
|
-
s.add_dependency(%q<simplecov>, ["~> 0.0"])
|
|
61
|
-
end
|
|
51
|
+
if s.respond_to? :add_runtime_dependency then
|
|
52
|
+
s.add_development_dependency(%q<rspec>.freeze, ["~> 3.1"])
|
|
53
|
+
s.add_development_dependency(%q<rdoc>.freeze, ["~> 4.1"])
|
|
54
|
+
s.add_development_dependency(%q<bundler>.freeze, ["~> 1.6"])
|
|
55
|
+
s.add_development_dependency(%q<jeweler>.freeze, ["~> 2.0"])
|
|
56
|
+
s.add_development_dependency(%q<simplecov>.freeze, ["~> 0.0"])
|
|
62
57
|
else
|
|
63
|
-
s.add_dependency(%q<rspec
|
|
64
|
-
s.add_dependency(%q<rdoc
|
|
65
|
-
s.add_dependency(%q<bundler
|
|
66
|
-
s.add_dependency(%q<jeweler
|
|
67
|
-
s.add_dependency(%q<simplecov
|
|
58
|
+
s.add_dependency(%q<rspec>.freeze, ["~> 3.1"])
|
|
59
|
+
s.add_dependency(%q<rdoc>.freeze, ["~> 4.1"])
|
|
60
|
+
s.add_dependency(%q<bundler>.freeze, ["~> 1.6"])
|
|
61
|
+
s.add_dependency(%q<jeweler>.freeze, ["~> 2.0"])
|
|
62
|
+
s.add_dependency(%q<simplecov>.freeze, ["~> 0.0"])
|
|
68
63
|
end
|
|
69
64
|
end
|
|
70
65
|
|
|
@@ -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
|
-
|
|
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
|
-
|
|
57
|
+
end
|
|
49
58
|
end
|
|
50
59
|
end
|
|
51
60
|
end
|
|
@@ -1,25 +1,31 @@
|
|
|
1
1
|
<% if Gem::Specification.map(&:name).include?('simple_form') -%>
|
|
2
|
-
= simple_form_for(
|
|
2
|
+
= simple_form_for(<%= singular_table_name %>) do |f|
|
|
3
3
|
= f.error_notification
|
|
4
4
|
|
|
5
5
|
.form-inputs
|
|
6
6
|
<%- attributes.each do |attribute| -%>
|
|
7
|
-
= f.<%= attribute.reference? ? :association : :input %> :<%= attribute.column_name %>
|
|
8
7
|
<% if attribute.password_digest? -%>
|
|
8
|
+
= f.input :password
|
|
9
9
|
= f.input :password_confirmation
|
|
10
|
+
<% else -%>
|
|
11
|
+
<% if attribute.reference? -%>
|
|
12
|
+
= f.association :<%= attribute.column_name.gsub(/_id$/, '') %>, prompt: t('.<%= attribute.column_name.gsub(/_id$/, '') %>', default: 'Choose')
|
|
13
|
+
<% else -%>
|
|
14
|
+
= f.input :<%= attribute.column_name %>
|
|
15
|
+
<% end -%>
|
|
10
16
|
<% end -%>
|
|
11
17
|
<%- end -%>
|
|
12
18
|
|
|
13
19
|
.form-actions
|
|
14
20
|
= f.button :submit
|
|
15
21
|
<% else -%>
|
|
16
|
-
= form_for(
|
|
17
|
-
- if
|
|
22
|
+
= form_for(<%= singular_table_name %>) do |f|
|
|
23
|
+
- if <%= singular_table_name %>.errors.any?
|
|
18
24
|
#error_explanation
|
|
19
25
|
%h2
|
|
20
|
-
= t 'errors.template.header', model: t('.<%=
|
|
26
|
+
= t 'errors.template.header', model: t('.<%= singular_name %>'), count: <%= singular_name %>.errors.count
|
|
21
27
|
%ul
|
|
22
|
-
-
|
|
28
|
+
- <%= singular_table_name %>.errors.full_messages.each do |msg|
|
|
23
29
|
%li= msg
|
|
24
30
|
|
|
25
31
|
<% for attribute in attributes -%>
|
|
@@ -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
|
-
|
|
17
|
+
class: '<%= attribute.name %>', 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
|
-
|
|
21
|
+
class: '<%= attribute.name %>', attribute: '<%= attribute.name %>' do |<%= singular_table_name %>|
|
|
22
22
|
- <%= singular_table_name %>.<%= attribute.name %>
|
|
23
23
|
<% end -%>
|
|
24
24
|
<% end -%>
|
|
@@ -51,16 +51,16 @@
|
|
|
51
51
|
<% for attribute in attributes.reject(&:password_digest?) -%>
|
|
52
52
|
%th= <%= class_name %>.human_attribute_name :<%= attribute.name %>
|
|
53
53
|
<% end -%>
|
|
54
|
-
%th{:
|
|
54
|
+
%th{colspan: 3}= t 'actions'
|
|
55
55
|
|
|
56
56
|
%tbody
|
|
57
57
|
- @<%= plural_table_name %>.each do |<%= singular_table_name %>|
|
|
58
|
-
%tr{
|
|
58
|
+
%tr{class: cycle(:odd, :even)}
|
|
59
59
|
<% for attribute in attributes.reject(&:password_digest?) -%>
|
|
60
60
|
<% if attribute.reference? -%>
|
|
61
|
-
%td
|
|
61
|
+
%td.<%= attribute.name %>= <%= singular_table_name %>.<%= attribute.name %>.try :name
|
|
62
62
|
<% else -%>
|
|
63
|
-
%td
|
|
63
|
+
%td.<%= attribute.name %>= <%= singular_table_name %>.<%= attribute.name %>
|
|
64
64
|
<% end -%>
|
|
65
65
|
<% end -%>
|
|
66
66
|
<% if options[:cancan] -%>
|
|
@@ -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', :
|
|
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{:
|
|
92
|
+
%th{colspan: 3}= t 'actions'
|
|
93
93
|
|
|
94
94
|
%tbody
|
|
95
95
|
- @<%= plural_table_name %>.each do |<%= singular_table_name %>|
|
|
96
|
-
%tr{
|
|
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', :
|
|
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", :
|
|
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{:
|
|
18
|
-
:
|
|
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, :
|
|
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
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
<% for attribute in attributes.reject(&:password_digest?) -%>
|
|
16
16
|
%dt= <%= class_name %>.human_attribute_name :<%= attribute.name %>
|
|
17
17
|
<% if attribute.reference? -%>
|
|
18
|
-
%dd
|
|
18
|
+
%dd.<%= attribute.name %>= @<%= singular_table_name %>.<%= attribute.name %>.try :name
|
|
19
19
|
<% else -%>
|
|
20
|
-
%dd
|
|
20
|
+
%dd.<%= attribute.name %>= @<%= singular_table_name %>.<%= attribute.name %>
|
|
21
21
|
<% end -%>
|
|
22
22
|
<% end -%>
|
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:
|
|
4
|
+
version: 2.2.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Dmitri Koulikoff
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2020-06-17 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
|
|
@@ -126,8 +127,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
126
127
|
- !ruby/object:Gem::Version
|
|
127
128
|
version: '0'
|
|
128
129
|
requirements: []
|
|
129
|
-
|
|
130
|
-
rubygems_version: 2.2.2
|
|
130
|
+
rubygems_version: 3.1.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
|