scaffold_cn 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/generators/{scaffoldcn → scaffold_cn}/USAGE +1 -1
- data/lib/generators/{scaffoldcn/scaffoldcn_generator.rb → scaffold_cn/scaffold_cn_generator.rb} +9 -5
- data/lib/generators/{scaffoldcn/templates/config/locales/zh-CN.yml → scaffold_cn/templates/config/locales/defaults/zh_CN.yml} +1 -1
- data/lib/generators/{scaffoldcn/templates/config/locales/devise.zh-CN.yml → scaffold_cn/templates/config/locales/devise/zh_CN.yml} +1 -1
- data/lib/generators/{scaffoldcn/templates/config/locales/model.yml → scaffold_cn/templates/config/locales/models/zh_CN.yml} +1 -1
- data/lib/generators/scaffold_cn/templates/config/locales/views/zh_CN.yml +9 -0
- data/lib/generators/{scaffoldcn → scaffold_cn}/templates/lib/templates/erb/scaffold/_form.html.erb +1 -1
- data/lib/generators/scaffold_cn/templates/lib/templates/erb/scaffold/edit.html.erb +6 -0
- data/lib/generators/{scaffoldcn → scaffold_cn}/templates/lib/templates/erb/scaffold/index.html.erb +4 -4
- data/lib/generators/scaffold_cn/templates/lib/templates/erb/scaffold/new.html.erb +5 -0
- data/lib/generators/{scaffoldcn → scaffold_cn}/templates/lib/templates/erb/scaffold/show.html.erb +2 -2
- data/lib/scaffold_cn/version.rb +1 -1
- metadata +13 -12
- data/lib/generators/scaffoldcn/templates/lib/templates/erb/scaffold/edit.html.erb +0 -6
- data/lib/generators/scaffoldcn/templates/lib/templates/erb/scaffold/new.html.erb +0 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e2251202088ec724267c3cbc70057a3305173265
|
4
|
+
data.tar.gz: 832db0b08fabc33b74e480c4ffa861fba81953ac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7bb41ec0af55ce36f70bbdbf921597c33c0971a794d016ec979195d13f1e8ac9e4506c74d17cd422437b277874926eb07f64a7ce1cfce3693a11d13684e5f6c0
|
7
|
+
data.tar.gz: 0f2aa3f1a3fe70f5676808d01eca16ee6594a3eae794d905a8266f086b6977e8e93c93234f68dcb368c9971b6222bb6a2e366af021692ebec8e2550709c87f3d
|
data/lib/generators/{scaffoldcn/scaffoldcn_generator.rb → scaffold_cn/scaffold_cn_generator.rb}
RENAMED
@@ -1,18 +1,22 @@
|
|
1
1
|
#class CnGenerator < Rails::Generators::NamedBase
|
2
|
-
class
|
2
|
+
class Scaffold_cnGenerator < Rails::Generators::Base
|
3
3
|
source_root File.expand_path('../templates', __FILE__)
|
4
4
|
|
5
|
-
def
|
5
|
+
def generate_scaffold_cn type
|
6
|
+
puts "type: #{type}"
|
6
7
|
templates = [
|
7
8
|
'lib/templates/erb/scaffold/_form.html.erb',
|
8
9
|
'lib/templates/erb/scaffold/edit.html.erb',
|
9
10
|
'lib/templates/erb/scaffold/index.html.erb',
|
10
11
|
'lib/templates/erb/scaffold/new.html.erb',
|
11
12
|
'lib/templates/erb/scaffold/show.html.erb',
|
12
|
-
'config/locales/
|
13
|
-
'config/locales/
|
13
|
+
'config/locales/defaults/zh_CN.yml',
|
14
|
+
'config/locales/models/zh_CN.yml',
|
15
|
+
'config/locales/views/zh_CN.yml',
|
16
|
+
'config/locales/devise/zh_CN.yml']
|
14
17
|
templates.each do |path|
|
15
|
-
|
18
|
+
template path, path
|
16
19
|
end
|
17
20
|
end
|
18
21
|
end
|
22
|
+
|
data/lib/generators/{scaffoldcn → scaffold_cn}/templates/lib/templates/erb/scaffold/index.html.erb
RENAMED
@@ -1,4 +1,4 @@
|
|
1
|
-
<h1><%%= <%= human_name %>.model_name.human
|
1
|
+
<h1><%%= <%= human_name %>.model_name.human %><%=t(:index)%></h1>
|
2
2
|
|
3
3
|
<table>
|
4
4
|
<thead>
|
@@ -16,9 +16,9 @@
|
|
16
16
|
<% attributes.reject(&:password_digest?).each do |attribute| -%>
|
17
17
|
<td><%%= <%= singular_table_name %>.<%= attribute.name %> %></td>
|
18
18
|
<% end -%>
|
19
|
-
<td><%%= link_to
|
20
|
-
<td><%%= link_to
|
21
|
-
<td><%%= link_to
|
19
|
+
<td><%%= link_to t(:show), <%= singular_table_name %> %></td>
|
20
|
+
<td><%%= link_to t(:edit), edit_<%= singular_table_name %>_path(<%= singular_table_name %>) %></td>
|
21
|
+
<td><%%= link_to t(:delete), <%= singular_table_name %>, method: :delete, data: { confirm: t(:confirm_delete) } %></td>
|
22
22
|
</tr>
|
23
23
|
<%% end %>
|
24
24
|
</tbody>
|
data/lib/generators/{scaffoldcn → scaffold_cn}/templates/lib/templates/erb/scaffold/show.html.erb
RENAMED
@@ -7,5 +7,5 @@
|
|
7
7
|
</p>
|
8
8
|
|
9
9
|
<% end -%>
|
10
|
-
<%%= link_to
|
11
|
-
<%%= link_to
|
10
|
+
<%%= link_to t(:edit), edit_<%= singular_table_name %>_path(@<%= singular_table_name %>) %> |
|
11
|
+
<%%= link_to t(:back), <%= index_helper %>_path %>
|
data/lib/scaffold_cn/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: scaffold_cn
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- homeway
|
@@ -45,16 +45,17 @@ executables: []
|
|
45
45
|
extensions: []
|
46
46
|
extra_rdoc_files: []
|
47
47
|
files:
|
48
|
-
- lib/generators/
|
49
|
-
- lib/generators/
|
50
|
-
- lib/generators/
|
51
|
-
- lib/generators/
|
52
|
-
- lib/generators/
|
53
|
-
- lib/generators/
|
54
|
-
- lib/generators/
|
55
|
-
- lib/generators/
|
56
|
-
- lib/generators/
|
57
|
-
- lib/generators/
|
48
|
+
- lib/generators/scaffold_cn/scaffold_cn_generator.rb
|
49
|
+
- lib/generators/scaffold_cn/templates/config/locales/defaults/zh_CN.yml
|
50
|
+
- lib/generators/scaffold_cn/templates/config/locales/devise/zh_CN.yml
|
51
|
+
- lib/generators/scaffold_cn/templates/config/locales/models/zh_CN.yml
|
52
|
+
- lib/generators/scaffold_cn/templates/config/locales/views/zh_CN.yml
|
53
|
+
- lib/generators/scaffold_cn/templates/lib/templates/erb/scaffold/_form.html.erb
|
54
|
+
- lib/generators/scaffold_cn/templates/lib/templates/erb/scaffold/edit.html.erb
|
55
|
+
- lib/generators/scaffold_cn/templates/lib/templates/erb/scaffold/index.html.erb
|
56
|
+
- lib/generators/scaffold_cn/templates/lib/templates/erb/scaffold/new.html.erb
|
57
|
+
- lib/generators/scaffold_cn/templates/lib/templates/erb/scaffold/show.html.erb
|
58
|
+
- lib/generators/scaffold_cn/USAGE
|
58
59
|
- lib/scaffold_cn/version.rb
|
59
60
|
- lib/scaffold_cn.rb
|
60
61
|
- MIT-LICENSE
|
@@ -93,7 +94,7 @@ files:
|
|
93
94
|
- test/integration/navigation_test.rb
|
94
95
|
- test/scaffold_cn_test.rb
|
95
96
|
- test/test_helper.rb
|
96
|
-
homepage:
|
97
|
+
homepage: https://github.com/homeway/scaffold_cn
|
97
98
|
licenses: []
|
98
99
|
metadata: {}
|
99
100
|
post_install_message:
|