shoestrap 0.0.4 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
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
- <%= real_table_name %>:
4
+ <%= singular_table_name.gsub('cms_', '') %>:
5
5
  <%- attributes.each do |attr| -%>
6
6
  <%= attr.name %>: TRANSLATEME
7
7
  <%- end %>
8
8
  models:
9
- <%= real_table_name %>: TRANSLATEME
9
+ <%= singular_table_name.gsub('cms_', '') %>: TRANSLATEME
@@ -0,0 +1,10 @@
1
+ de:
2
+ cms:
3
+ <%= real_table_name %>:
4
+ index:
5
+ title: TRANSLATEME
6
+ new: TRANSLATEME
7
+ edit:
8
+ title: TRANSLATEME
9
+ new:
10
+ title: 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.4'
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,5 +1,5 @@
1
1
  = link_to '<%= app_name %>', '#', :class => 'brand'
2
2
  %p.navbar-text.pull-right
3
- = link_to t('.logout'), kuhsaft.destroy_cms_admin_session_path, :method => :delete
3
+ = link_to t('.logout'), '<REPLACE-ME>', :method => :delete
4
4
  = render_navigation(:context => :cms)
5
5
 
@@ -1,5 +1,5 @@
1
1
  <% sg_table_name = singular_table_name.gsub('cms_','') -%>
2
- %h1= "#{ t('cms.<%= sg_table_name %>') } #{ t('cms.edit') }"
2
+ %h1= t('.title')
3
3
 
4
4
  = render 'form'
5
5
 
@@ -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('cms.<%= pl_table_name %>')
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('cms.new') } <%= human_name %>
9
+ #{ t('.new') }
10
10
 
11
11
  %table.table.table-bordered.table-striped
12
12
  %tr
13
13
  <% for attribute in attributes -%>
14
- %th= t('cms.<%= attribute.human_name %>')
14
+ %th= <%= class_name.gsub('Cms::','') %>.human_attribute_name :<%= attribute.name %>
15
15
  <% end -%>
16
16
  %th
17
17
  %th
@@ -1,4 +1,4 @@
1
- %h1= t('cms.<%= singular_table_name.gsub('cms_', '') %>')
1
+ %h1= t('.title')
2
2
 
3
3
  = render 'form'
4
4
 
@@ -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, "'#{human_name} was successfully created.'" %> }
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, "'#{human_name} was successfully updated.'" %> }
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"' %> }
@@ -6,6 +6,13 @@ de:
6
6
  show: Anzeigen
7
7
  back: Zurück
8
8
  new: Neue
9
+ create:
10
+ success: "%{name} wurde erfolgreich erstellt"
11
+ update:
12
+ success: "%{name} wurde erfolgreich aktualisiert"
13
+
14
+ navigation:
15
+ items:
9
16
 
10
17
  simple_form:
11
18
  "yes": 'Ja'
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
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-01-24 00:00:00.000000000 Z
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