i18n_rails_helpers 0.18.2 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -9,15 +9,15 @@ de:
9
9
  edit: "%{model} bearbeiten"
10
10
  update: "%{model} bearbeiten"
11
11
  show: "%{model} anzeigen"
12
- new: "%{model} anlegen"
13
- create: "%{model} anlegen"
12
+ new: "%{model} erfassen"
13
+ create: "%{model} erfassen"
14
14
  delete: "%{model} löschen"
15
15
  action:
16
16
  index: "Liste"
17
17
  edit: "Bearbeiten"
18
18
  update: "Bearbeiten"
19
19
  show: "Anzeigen"
20
- new: "Anlegen"
20
+ new: "Erfassen"
21
21
  delete: "Löschen"
22
22
  back: "Zurück"
23
23
  previous: "Zurück"
@@ -1,6 +1,7 @@
1
1
  en:
2
2
  messages:
3
3
  confirm_delete: "Really delete %{model} %{record}?"
4
+ select_prompt: "Select %{model}"
4
5
 
5
6
  crud:
6
7
  title:
@@ -1,19 +1,31 @@
1
1
  module ContextualLinkHelpers
2
2
  # CRUD helpers
3
+ def action_to_icon(action)
4
+ case action
5
+ when 'new'
6
+ "plus"
7
+ when 'show'
8
+ "eye-open"
9
+ when 'edit'
10
+ "edit"
11
+ when 'delete'
12
+ "trash"
13
+ when "index", "list"
14
+ "list-alt"
15
+ when "update"
16
+ "refresh"
17
+ end
18
+ end
19
+
3
20
  def icon_link_to(action, url = nil, options = {})
4
21
  url ||= {:action => action}
5
- icon = options.delete(:icon)
6
- icon ||= action
7
-
8
- options.merge!(:class => "icon icon-#{icon}")
9
-
10
- link_to(t_action(action), url_for(url), options)
22
+ options.merge!(:class => "btn")
23
+ link_to(url_for(url), options) do
24
+ content_tag(:i, "", :class => "icon-#{action_to_icon(action)}") + " " + t_action(action)
25
+ end
11
26
  end
12
27
 
13
- def contextual_link_to(action, resource_or_model = nil, link_options = {})
14
- # We don't want to change the passed in link_options
15
- options = link_options.dup
16
-
28
+ def contextual_link_to(action, resource_or_model = nil, options = {})
17
29
  # Handle both symbols and strings
18
30
  action = action.to_s
19
31
 
@@ -1,3 +1,3 @@
1
1
  module I18nRailsHelpers
2
- VERSION = "0.18.2"
2
+ VERSION = "1.0.0"
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: i18n_rails_helpers
3
3
  version: !ruby/object:Gem::Version
4
- hash: 83
4
+ hash: 23
5
5
  prerelease:
6
6
  segments:
7
+ - 1
7
8
  - 0
8
- - 18
9
- - 2
10
- version: 0.18.2
9
+ - 0
10
+ version: 1.0.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - "Simon H\xC3\xBCrlimann (CyT)"
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-04-03 00:00:00 Z
18
+ date: 2012-04-02 00:00:00 Z
19
19
  dependencies: []
20
20
 
21
21
  description: Rails i18n view helpers for things like crud actions, models and and attributes.
@@ -65,7 +65,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
65
65
  requirements: []
66
66
 
67
67
  rubyforge_project:
68
- rubygems_version: 1.8.10
68
+ rubygems_version: 1.8.15
69
69
  signing_key:
70
70
  specification_version: 3
71
71
  summary: I18n Rails helpers