i18n_rails_helpers 1.4.12 → 2.0.0.beta0

Sign up to get free protection for your applications and to get access to all the features.
data/MIT-LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ Copyright (c) 2010-2014 Simon Hürlimann <simon.huerlimann@cyt.ch>
2
+ Copyright (c) 2010-2014 CyT <http://www.cyt.ch>
3
+
4
+ Permission is hereby granted, free of charge, to any person obtaining
5
+ a copy of this software and associated documentation files (the
6
+ "Software"), to deal in the Software without restriction, including
7
+ without limitation the rights to use, copy, modify, merge, publish,
8
+ distribute, sublicense, and/or sell copies of the Software, and to
9
+ permit persons to whom the Software is furnished to do so, subject to
10
+ the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be
13
+ included in all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
19
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
20
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,27 @@
1
+ I18nRailsHelpers
2
+ ================
3
+
4
+ [![Build Status](https://secure.travis-ci.org/huerlisi/i18n_rails_helpers.png)](http://travis-ci.org/huerlisi/i18n_rails_helpers)
5
+
6
+ Rails i18n view helpers for things like crud actions, models and and attributes.
7
+
8
+ Install
9
+ =======
10
+
11
+ In Rails simply add
12
+
13
+ gem 'i18n_rails_helpers'
14
+
15
+ Example
16
+ =======
17
+
18
+ t_attr('first_name') # 'Vorname' # when called in patients_controller views
19
+ t_model # 'Konto' # when called in patients_controller views
20
+ t_title('delete') # 'Konto löschen' # when called in accounts_controller views
21
+ t_action('index') # 'Liste'
22
+ t_confirm_delete(@account) # 'Konto Kasse wirklich löschen'
23
+
24
+ License
25
+ =======
26
+
27
+ Released under the MIT license.
data/Rakefile ADDED
@@ -0,0 +1,28 @@
1
+ begin
2
+ require 'bundler/setup'
3
+ rescue LoadError
4
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
5
+ end
6
+
7
+ require 'rdoc/task'
8
+
9
+ RDoc::Task.new(:rdoc) do |rdoc|
10
+ rdoc.rdoc_dir = 'rdoc'
11
+ rdoc.title = 'I18nRailsHelpers'
12
+ rdoc.options << '--line-numbers'
13
+ rdoc.rdoc_files.include('README.md')
14
+ rdoc.rdoc_files.include('{app,config,db,lib}/**/*.rb')
15
+ end
16
+
17
+ APP_RAKEFILE = File.expand_path('../spec/dummy/Rakefile', __FILE__)
18
+ load 'rails/tasks/engine.rake'
19
+
20
+ Bundler::GemHelper.install_tasks
21
+
22
+ require 'rspec/core'
23
+ require 'rspec/core/rake_task'
24
+
25
+ desc 'Run all specs in spec directory (excluding plugin specs)'
26
+ RSpec::Core::RakeTask.new(:spec)
27
+
28
+ task default: :spec
@@ -0,0 +1,12 @@
1
+ // Fix spacing for contextual buttons on page headers
2
+ .ctx {
3
+ float: right;
4
+ }
5
+
6
+ .ctx-page-header, .ctx-h1, .ctx-h2, .ctx-h3, .ctx-h4 {
7
+ margin-top: 5px;
8
+ }
9
+
10
+ .page-header {
11
+ margin-top: 0;
12
+ }
@@ -32,7 +32,8 @@ module BootstrapHelper
32
32
  # Icons
33
33
  # =====
34
34
  def boot_icon(type)
35
- content_tag(:i, '', :class => "icon-#{type}")
35
+ classes = I18nRailsHelpers.boot_icon_class_template % [type]
36
+ content_tag(:i, '', :class => classes)
36
37
  end
37
38
 
38
39
  # Labels
@@ -44,7 +44,7 @@ module ContextualLinkHelpers
44
44
 
45
45
  options.merge!(:class => classes.join(" "))
46
46
  link_to(url_for(url), options) do
47
- content_tag(:i, "", :class => "icon-#{action_to_icon(icon)}") + " " + title
47
+ boot_icon(action_to_icon(icon)) + " " + title
48
48
  end
49
49
  end
50
50
 
@@ -31,7 +31,7 @@ module ListLinkHelpers
31
31
  icon ||= action
32
32
 
33
33
  link_to(url_for(url), options) do
34
- content_tag(:i, "", :class => "icon-#{action_to_icon(icon)}")
34
+ boot_icon action_to_icon(icon)
35
35
  end
36
36
  end
37
37
 
@@ -19,6 +19,7 @@ de:
19
19
  update: "Bearbeiten"
20
20
  show: "Anzeigen"
21
21
  new: "Erfassen"
22
+ create: "Erfassen"
22
23
  delete: "Löschen"
23
24
  destroy: "Löschen"
24
25
  back: "Zurück"
@@ -19,6 +19,7 @@ en:
19
19
  update: "Edit"
20
20
  show: "Show"
21
21
  new: "New"
22
+ create: "New"
22
23
  delete: "Delete"
23
24
  destroy: "Delete"
24
25
  back: "Back"
@@ -1,7 +1,7 @@
1
1
  require 'rails'
2
2
 
3
3
  module I18nRailsHelpers
4
- class Railtie < Rails::Engine
4
+ class Engine < Rails::Engine
5
5
  initializer 'i18n_rails_helpers.helper' do
6
6
  ActionView::Base.send :include, I18nHelpers
7
7
  ActionView::Base.send :include, ContextualLinkHelpers
@@ -1,3 +1,3 @@
1
1
  module I18nRailsHelpers
2
- VERSION = "1.4.12"
2
+ VERSION = "2.0.0.beta0"
3
3
  end
@@ -1,4 +1,4 @@
1
- require 'i18n_rails_helpers/railtie' if defined?(::Rails::Railtie)
1
+ require 'i18n_rails_helpers/engine'
2
2
 
3
3
  module I18nRailsHelpers
4
4
  # Configuration
@@ -24,4 +24,8 @@ module I18nRailsHelpers
24
24
  # CSS class to use for contextual links
25
25
  mattr_accessor :contextual_link_class
26
26
  @@contextual_link_class = 'btn'
27
+
28
+ # Bootstrap icon class
29
+ mattr_accessor :boot_icon_class_template
30
+ @@boot_icon_class_template = 'icon icon-%s '
27
31
  end
metadata CHANGED
@@ -1,43 +1,126 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: i18n_rails_helpers
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.12
5
- prerelease:
4
+ version: 2.0.0.beta0
5
+ prerelease: 6
6
6
  platform: ruby
7
7
  authors:
8
- - Simon Hürlimann (CyT)
8
+ - Simon Huerlimann (CyT)
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-05-30 00:00:00.000000000 Z
13
- dependencies: []
12
+ date: 2014-07-06 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: rails
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>'
20
+ - !ruby/object:Gem::Version
21
+ version: 3.0.0
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>'
28
+ - !ruby/object:Gem::Version
29
+ version: 3.0.0
30
+ - !ruby/object:Gem::Dependency
31
+ name: sqlite3
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ type: :development
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
46
+ - !ruby/object:Gem::Dependency
47
+ name: rspec-rails
48
+ requirement: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ! '>='
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
54
+ type: :development
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ - !ruby/object:Gem::Dependency
63
+ name: capybara
64
+ requirement: !ruby/object:Gem::Requirement
65
+ none: false
66
+ requirements:
67
+ - - ! '>='
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
70
+ type: :development
71
+ prerelease: false
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ! '>='
76
+ - !ruby/object:Gem::Version
77
+ version: '0'
78
+ - !ruby/object:Gem::Dependency
79
+ name: factory_girl_rails
80
+ requirement: !ruby/object:Gem::Requirement
81
+ none: false
82
+ requirements:
83
+ - - ! '>='
84
+ - !ruby/object:Gem::Version
85
+ version: '0'
86
+ type: :development
87
+ prerelease: false
88
+ version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
91
+ - - ! '>='
92
+ - !ruby/object:Gem::Version
93
+ version: '0'
14
94
  description: Rails i18n view helpers for things like crud actions, models and and
15
95
  attributes.
16
- email: simon.huerlimann@cyt.ch
96
+ email:
97
+ - simon.huerlimann@cyt.ch
17
98
  executables: []
18
99
  extensions: []
19
- extra_rdoc_files:
20
- - README.markdown
100
+ extra_rdoc_files: []
21
101
  files:
22
- - app/helpers/bootstrap_helper.rb
23
- - app/helpers/contextual_link_helpers.rb
24
- - app/helpers/i18n_helpers.rb
25
- - app/helpers/list_link_helpers.rb
102
+ - app/views/application/show.html.haml
103
+ - app/views/application/new.html.haml
26
104
  - app/views/application/_list.html.haml
27
105
  - app/views/application/edit.html.haml
28
106
  - app/views/application/index.html.haml
29
- - app/views/application/new.html.haml
30
- - app/views/application/show.html.haml
31
- - config/locales/de.yml
107
+ - app/helpers/bootstrap_helper.rb
108
+ - app/helpers/i18n_helpers.rb
109
+ - app/helpers/contextual_link_helpers.rb
110
+ - app/helpers/list_link_helpers.rb
111
+ - app/assets/stylesheets/i18n_rails_helpers.scss
32
112
  - config/locales/en.yml
33
- - lib/boot_form_builder.rb
113
+ - config/locales/de.yml
34
114
  - lib/i18n_rails_helpers.rb
35
- - lib/i18n_rails_helpers/railtie.rb
115
+ - lib/i18n_rails_helpers/engine.rb
36
116
  - lib/i18n_rails_helpers/version.rb
37
- - rails/init.rb
38
- - README.markdown
117
+ - lib/boot_form_builder.rb
118
+ - MIT-LICENSE
119
+ - Rakefile
120
+ - README.md
39
121
  homepage: https://github.com/huerlisi/i18n_rails_helpers
40
- licenses: []
122
+ licenses:
123
+ - MIT
41
124
  post_install_message:
42
125
  rdoc_options: []
43
126
  require_paths:
@@ -51,9 +134,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
51
134
  required_rubygems_version: !ruby/object:Gem::Requirement
52
135
  none: false
53
136
  requirements:
54
- - - ! '>='
137
+ - - ! '>'
55
138
  - !ruby/object:Gem::Version
56
- version: '0'
139
+ version: 1.3.1
57
140
  requirements: []
58
141
  rubyforge_project:
59
142
  rubygems_version: 1.8.23
data/README.markdown DELETED
@@ -1,20 +0,0 @@
1
- I18nRailsHelpers
2
- ================
3
-
4
- Rails i18n view helpers for things like crud actions, models and and attributes.
5
-
6
-
7
- Example
8
- =======
9
-
10
- t_attr('first_name') => 'Vorname' # when called in patients_controller views
11
- t_model => 'Konto' # when called in patients_controller views
12
- t_title('delete') => 'Konto löschen' # when called in accounts_controller views
13
- t_action('index') => 'Liste'
14
- t_confirm_delete(@account) => 'Konto Kasse wirklich löschen'
15
-
16
-
17
- Copyright (c) 2010 Simon Hürlimann <simon.huerlimann@cyt.ch>
18
- Copyright (c) 2010 CyT <http://www.cyt.ch>
19
-
20
- Released under the MIT license.
data/rails/init.rb DELETED
@@ -1,7 +0,0 @@
1
- # Register helpers for Rails < 3
2
- require File.join(File.dirname(__FILE__), *%w[.. lib i18n_rails_helpers])
3
- ActionView::Base.send :include, I18nRailsHelpers
4
- require File.join(File.dirname(__FILE__), *%w[.. lib contextual_link_helpers])
5
- ActionView::Base.send :include, ContextualLinkHelpers
6
- require File.join(File.dirname(__FILE__), *%w[.. lib list_link_helpers.rb])
7
- ActionView::Base.send :include, ListLinkHelpers