i18n_rails_helpers 0.18.2 → 1.0.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/config/locales/de.yml +3 -3
- data/config/locales/en.yml +1 -0
- data/lib/contextual_link_helpers.rb +22 -10
- data/lib/i18n_rails_helpers/version.rb +1 -1
- metadata +6 -6
data/config/locales/de.yml
CHANGED
@@ -9,15 +9,15 @@ de:
|
|
9
9
|
edit: "%{model} bearbeiten"
|
10
10
|
update: "%{model} bearbeiten"
|
11
11
|
show: "%{model} anzeigen"
|
12
|
-
new: "%{model}
|
13
|
-
create: "%{model}
|
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: "
|
20
|
+
new: "Erfassen"
|
21
21
|
delete: "Löschen"
|
22
22
|
back: "Zurück"
|
23
23
|
previous: "Zurück"
|
data/config/locales/en.yml
CHANGED
@@ -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
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
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,
|
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
|
|
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:
|
4
|
+
hash: 23
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
|
+
- 1
|
7
8
|
- 0
|
8
|
-
-
|
9
|
-
|
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-
|
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.
|
68
|
+
rubygems_version: 1.8.15
|
69
69
|
signing_key:
|
70
70
|
specification_version: 3
|
71
71
|
summary: I18n Rails helpers
|