This repository was archived by the owner on Nov 30, 2018. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +19
-4
lines changed Expand file tree Collapse file tree 3 files changed +19
-4
lines changed Original file line number Diff line number Diff line change 6
6
require 'active_admin/globalize/form_builder_extension'
7
7
require 'active_admin/globalize/active_record_extension'
8
8
require 'active_admin/globalize/index_table_for_extension'
9
+ require 'active_admin/view_helpers/flag_helper'
9
10
10
11
ActiveRecord ::Base . send :extend , ActiveAdmin ::Globalize ::ActiveRecordExtension
11
12
Original file line number Diff line number Diff line change @@ -12,12 +12,9 @@ def translation_status
12
12
end
13
13
def translation_status_flags
14
14
column I18n . t ( "active_admin.globalize.translations" ) do |obj |
15
- obj . translated_locales . map do |l |
16
- image_tag '%s.gif' % [ l . to_s ]
17
- end . join ( " " ) . html_safe
15
+ obj . translated_locales . map { |l | flag_icon ( l ) } . join ( ' ' ) . html_safe
18
16
end
19
17
end
20
18
end
21
19
end
22
20
end
23
-
Original file line number Diff line number Diff line change
1
+ require 'active_admin/view_helpers'
2
+
3
+ module ActiveAdmin
4
+ module ViewHelpers
5
+ module FlagHelper
6
+
7
+ # Return an image tag with background of given locale
8
+ def flag_icon ( locale )
9
+ image_tag ( 'active_admin/transparent.gif' , class : "flag flag-#{ locale } " )
10
+ end
11
+
12
+ end
13
+
14
+ # Register as ActiveAdmin view helper
15
+ include FlagHelper
16
+ end
17
+ end
You can’t perform that action at this time.
0 commit comments