shoestrap 0.0.4 → 0.1.0
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.
- data/CHANGELOG.md +11 -0
- data/lib/generators/shoestrap/cms_generator.rb +6 -2
- data/lib/generators/shoestrap/templates/model.yml.erb +2 -2
- data/lib/generators/shoestrap/templates/view.yml.erb +10 -0
- data/lib/shoestrap/app_builder.rb +2 -2
- data/shoestrap.gemspec +1 -1
- data/templates/_main_navigation.html.haml.erb +1 -1
- data/templates/haml/scaffold/edit.html.haml +1 -1
- data/templates/haml/scaffold/index.html.haml +3 -3
- data/templates/haml/scaffold/new.html.haml +1 -1
- data/templates/haml/scaffold/show.html.haml +11 -0
- data/templates/rails/scaffold_controller/controller.rb +2 -2
- data/templates/shoestrap.yml +7 -0
- metadata +4 -2
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,16 @@
|
|
1
1
|
#Changelog
|
2
2
|
|
3
|
+
## 0.1.0 - 2013-02-06
|
4
|
+
|
5
|
+
* replace logout link with placeholder, as kuhsaft does not ship with
|
6
|
+
devise anymore
|
7
|
+
* copy shoestrap.yml into config/locales/de/views/cms
|
8
|
+
* add navigation translation into shoestrap.yml with translation key 'cms.navigation.items'
|
9
|
+
* inject translationkey into cms_navigation.rb
|
10
|
+
* use human_attribute_name as label in 'show' template
|
11
|
+
* remove title (h1) on 'show' template
|
12
|
+
* use '[index_path_name].new' as translation key for new button on 'index' template
|
13
|
+
|
3
14
|
## 0.0.4
|
4
15
|
|
5
16
|
* fix update/create actions in generated controller
|
@@ -31,12 +31,16 @@ module Shoestrap
|
|
31
31
|
|
32
32
|
def generate_nav_link
|
33
33
|
inject_into_file 'config/cms_navigation.rb', :before => 'primary.dom_class = \'nav\'' do
|
34
|
-
"primary.item :#{real_table_name}, t('cms.#{real_table_name}'), #{plural_table_name}_path\n "
|
34
|
+
"primary.item :#{real_table_name}, t('cms.navigation.items.#{real_table_name}'), #{plural_table_name}_path\n "
|
35
|
+
end
|
36
|
+
inject_into_file 'config/locales/de/views/cms/shoestrap.yml', :after => 'items:' do
|
37
|
+
"#{real_table_name}:TRANSLATEME\n"
|
35
38
|
end
|
36
39
|
end
|
37
40
|
|
38
41
|
def generate_translations
|
39
|
-
template 'model.yml.erb', "config/locales/de/#{real_table_name}.yml"
|
42
|
+
template 'model.yml.erb', "config/locales/de/models/#{real_table_name}.yml"
|
43
|
+
template 'view.yml.erb', "config/locales/de/views/cms/#{real_table_name}.yml"
|
40
44
|
end
|
41
45
|
|
42
46
|
protected
|
@@ -1,9 +1,9 @@
|
|
1
1
|
de:
|
2
2
|
activerecord:
|
3
3
|
attributes:
|
4
|
-
<%=
|
4
|
+
<%= singular_table_name.gsub('cms_', '') %>:
|
5
5
|
<%- attributes.each do |attr| -%>
|
6
6
|
<%= attr.name %>: TRANSLATEME
|
7
7
|
<%- end %>
|
8
8
|
models:
|
9
|
-
<%=
|
9
|
+
<%= singular_table_name.gsub('cms_', '') %>: TRANSLATEME
|
@@ -74,8 +74,8 @@ module Shoestrap
|
|
74
74
|
eos
|
75
75
|
end
|
76
76
|
|
77
|
-
empty_directory 'config/locales/de'
|
78
|
-
copy_file 'shoestrap.yml', 'config/locales/de/shoestrap.yml'
|
77
|
+
empty_directory 'config/locales/de/views/cms'
|
78
|
+
copy_file 'shoestrap.yml', 'config/locales/de/views/cms/shoestrap.yml'
|
79
79
|
template 'application.html.haml', 'app/views/layouts/application.html.haml'
|
80
80
|
remove_file 'app/views/layouts/application.html.erb'
|
81
81
|
end
|
data/shoestrap.gemspec
CHANGED
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
|
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = "shoestrap"
|
6
|
-
s.version = '0.0
|
6
|
+
s.version = '0.1.0'
|
7
7
|
s.platform = Gem::Platform::RUBY
|
8
8
|
s.authors = ["Immanuel Häussermann", "Felipe Kaufmann", "Phil Schilter", "Noëlle Rosenberg"]
|
9
9
|
s.email = "info@screenconcept.ch"
|
@@ -1,17 +1,17 @@
|
|
1
1
|
<% pl_table_name = plural_table_name.gsub('cms_','') -%>
|
2
2
|
<% sg_table_name = singular_table_name.gsub('cms_','') -%>
|
3
|
-
%h1= t('
|
3
|
+
%h1= t('.title')
|
4
4
|
|
5
5
|
.row-fluid.actions
|
6
6
|
.pull-right.padded
|
7
7
|
= link_to new_cms_<%= sg_table_name %>_path, :class => 'btn btn-primary' do
|
8
8
|
%i.icon-plus-sign.icon-white
|
9
|
-
#{ t('
|
9
|
+
#{ t('.new') }
|
10
10
|
|
11
11
|
%table.table.table-bordered.table-striped
|
12
12
|
%tr
|
13
13
|
<% for attribute in attributes -%>
|
14
|
-
%th=
|
14
|
+
%th= <%= class_name.gsub('Cms::','') %>.human_attribute_name :<%= attribute.name %>
|
15
15
|
<% end -%>
|
16
16
|
%th
|
17
17
|
%th
|
@@ -0,0 +1,11 @@
|
|
1
|
+
%p#notice= notice
|
2
|
+
|
3
|
+
<% for attribute in attributes -%>
|
4
|
+
%p
|
5
|
+
%b #{<%= class_name.gsub('Cms::','') %>.human_attribute_name :<%= attribute.name %>}:
|
6
|
+
= @<%= singular_table_name %>.<%= attribute.name %>
|
7
|
+
<% end -%>
|
8
|
+
|
9
|
+
= link_to t('cms.edit'), edit_<%= singular_table_name %>_path(@<%= singular_table_name %>)
|
10
|
+
\|
|
11
|
+
= link_to t('cms.back'), <%= index_helper %>_path
|
@@ -49,7 +49,7 @@ class <%= controller_class_name %>Controller < Kuhsaft::Cms::AdminController
|
|
49
49
|
|
50
50
|
respond_to do |format|
|
51
51
|
if @<%= orm_instance.save %>
|
52
|
-
format.html { redirect_to <%= singular_table_name %>_path(@<%= singular_table_name %>), <%= key_value :notice, "'#{
|
52
|
+
format.html { redirect_to <%= singular_table_name %>_path(@<%= singular_table_name %>), <%= key_value :notice, "t('cms.create.success', name: #{class_name.gsub('Cms::','')}.model_name.human)"%> }
|
53
53
|
format.json { render <%= key_value :json, "@#{singular_table_name}" %>, <%= key_value :status, ':created' %>, <%= key_value :location, "#{singular_table_name}_path(@#{singular_table_name})" %> }
|
54
54
|
else
|
55
55
|
format.html { render <%= key_value :action, '"new"' %> }
|
@@ -65,7 +65,7 @@ class <%= controller_class_name %>Controller < Kuhsaft::Cms::AdminController
|
|
65
65
|
|
66
66
|
respond_to do |format|
|
67
67
|
if @<%= orm_instance.update_attributes("params[:#{singular_table_name.gsub('cms_','')}]") %>
|
68
|
-
format.html { redirect_to <%= singular_table_name %>_path(@<%= singular_table_name %>), <%= key_value :notice, "'#{
|
68
|
+
format.html { redirect_to <%= singular_table_name %>_path(@<%= singular_table_name %>), <%= key_value :notice, "t('cms.update.success', name: #{class_name.gsub('Cms::','')}.model_name.human)"%> }
|
69
69
|
format.json { head :no_content }
|
70
70
|
else
|
71
71
|
format.html { render <%= key_value :action, '"edit"' %> }
|
data/templates/shoestrap.yml
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shoestrap
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -12,7 +12,7 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date: 2013-
|
15
|
+
date: 2013-02-06 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: rspec
|
@@ -84,6 +84,7 @@ files:
|
|
84
84
|
- lib/generators/shoestrap/templates/migration.rb
|
85
85
|
- lib/generators/shoestrap/templates/model.rb
|
86
86
|
- lib/generators/shoestrap/templates/model.yml.erb
|
87
|
+
- lib/generators/shoestrap/templates/view.yml.erb
|
87
88
|
- lib/shoestrap.rb
|
88
89
|
- lib/shoestrap/app_builder.rb
|
89
90
|
- shoestrap.gemspec
|
@@ -99,6 +100,7 @@ files:
|
|
99
100
|
- templates/haml/scaffold/edit.html.haml
|
100
101
|
- templates/haml/scaffold/index.html.haml
|
101
102
|
- templates/haml/scaffold/new.html.haml
|
103
|
+
- templates/haml/scaffold/show.html.haml
|
102
104
|
- templates/index.html.haml
|
103
105
|
- templates/kuhsaft.css.sass
|
104
106
|
- templates/rails/scaffold_controller/controller.rb
|