rails_admin_globalize 0.0.3 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.md +43 -0
- data/app/assets/javascripts/rails_admin/custom/rails_admin_globalize.js.coffee +14 -0
- data/app/views/rails_admin/main/_file_upload.haml +12 -0
- data/app/views/rails_admin/main/_globalize_field.haml +18 -5
- data/app/views/rails_admin/main/globalize.html.haml +45 -52
- data/config/locales/globalize.en.yml +3 -1
- data/config/locales/globalize.fr.yml +14 -0
- data/config/locales/globalize.it.yml +9 -6
- data/lib/rails_admin_globalize/version.rb +1 -1
- data/lib/rails_admin_globalize.rb +18 -8
- metadata +82 -32
- data/README.rdoc +0 -37
- data/app/assets/javascripts/rails_admin/custom/rails_admin_globalize.js +0 -17
- data/app/assets/javascripts/rails_admin/custom/sync.sh +0 -27
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 927c8a8954c108c63292029086d82b5d2237606f
|
4
|
+
data.tar.gz: b75ef15e8c1b916398b3f7de031c7783e7ef76e5
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: b37cea88bc9a6010f886391b8ac2cd07e5637ac98f6c3bbbd54dd414caca97313d852bee8d635032944c372f4449b6b252da3f6865693451bb49bf54a41fe753
|
7
|
+
data.tar.gz: 1be861d4e79391cb37a28aca4c0211f98543aab886a28817772041ea2b5158978c2170da32feb73f5bd8f0606b01c83f751b78c60a6251c7cdef44b8be4a6481
|
data/README.md
ADDED
@@ -0,0 +1,43 @@
|
|
1
|
+
# Rails Admin Globalize custom action.
|
2
|
+
|
3
|
+
this code is untested and need a good rewrite, but work.
|
4
|
+
treat it as a prototype.
|
5
|
+
|
6
|
+
|
7
|
+
# Usage:
|
8
|
+
|
9
|
+
Add the gem to your bundler:
|
10
|
+
```ruby
|
11
|
+
gem "rails_admin"
|
12
|
+
gem "globalize3"
|
13
|
+
gem "rails_admin_globalize"
|
14
|
+
```
|
15
|
+
|
16
|
+
Add globalize to the list of actions in rails_admin's initializer:
|
17
|
+
```ruby
|
18
|
+
RailsAdmin.config do |config|
|
19
|
+
|
20
|
+
config.actions do
|
21
|
+
dashboard do ; end
|
22
|
+
globalize do ; end
|
23
|
+
index do ; end
|
24
|
+
new do ; end
|
25
|
+
export do ; end
|
26
|
+
bulk_delete do ; end
|
27
|
+
show do ; end
|
28
|
+
edit do ; end
|
29
|
+
delete do ; end
|
30
|
+
history_show do ; end
|
31
|
+
show_in_app do ; end
|
32
|
+
end
|
33
|
+
|
34
|
+
end
|
35
|
+
```
|
36
|
+
|
37
|
+
# At this point:
|
38
|
+
- a translation Action appear in rails_admin near the edit button .
|
39
|
+
- the configuration for the field was ereditated from edit action configuration .
|
40
|
+
- has_many and has_one fields of translated models is included in the translations form .
|
41
|
+
- the translation look for I18n.avaiable_locales
|
42
|
+
- take this as a prototype and use as your own risk :-)
|
43
|
+
- clone/fork/improve
|
@@ -0,0 +1,14 @@
|
|
1
|
+
jQuery ->
|
2
|
+
$locale_select = $("#target_locale_select")
|
3
|
+
|
4
|
+
$locale_select.on 'change', (e) ->
|
5
|
+
url = $locale_select.data("target-url")
|
6
|
+
location.replace updateQueryStringParameter(url, "target_locale", $locale_select.val())
|
7
|
+
|
8
|
+
updateQueryStringParameter = (uri, key, value) ->
|
9
|
+
separator = if (uri.indexOf('?') != -1) then "&" else "?"
|
10
|
+
reg_exp = new RegExp("([?|&])#{key}=.*?(&|$)", "i")
|
11
|
+
if (uri.match(reg_exp))
|
12
|
+
return uri.replace(reg_exp, "$1#{key}=#{value}$2")
|
13
|
+
else
|
14
|
+
return "#{uri}#{separator}#{key}=#{value}"
|
@@ -0,0 +1,12 @@
|
|
1
|
+
- file = form.object.send(field.method_name).presence
|
2
|
+
.toggle{:style => ('display:none;' if file && field.delete_method && form.object.send(field.delete_method) == '1')}
|
3
|
+
- if value = field.pretty_value
|
4
|
+
= value
|
5
|
+
= form.file_field(field.name, field.html_attributes.reverse_merge({ :data => { :fileupload => true }}))
|
6
|
+
- if field.optional? && field.errors.blank? && file && field.delete_method
|
7
|
+
%a.btn.btn-info{:href => '#', :'data-toggle' => 'button', :onclick => "$(this).siblings('[type=checkbox]').click(); $(this).siblings('.toggle').toggle('slow'); jQuery(this).toggleClass('btn-danger btn-info'); return false"}
|
8
|
+
%i.icon-white.icon-trash
|
9
|
+
= I18n.t('admin.actions.delete.menu').capitalize + " #{field.label.downcase}"
|
10
|
+
= form.check_box(field.delete_method, :style => 'display:none;' )
|
11
|
+
- if field.cache_method
|
12
|
+
= form.hidden_field(field.cache_method)
|
@@ -1,7 +1,9 @@
|
|
1
|
-
|
1
|
+
:ruby
|
2
|
+
in_error = object.errors.present? && object.errors.messages.keys.include?(field.method_name)
|
3
|
+
|
2
4
|
.control-group{:class=>("#{field.css_class} #{field.type}_type #{'error' if in_error}")}
|
3
5
|
.controls{:class => field.type.eql?('text') ? 'well' : ''}
|
4
|
-
- if field.type
|
6
|
+
- if field.type == :text
|
5
7
|
:ruby
|
6
8
|
if field.ckeditor
|
7
9
|
richtext = 'ckeditor'
|
@@ -27,14 +29,25 @@
|
|
27
29
|
:jspath => field.bootstrap_wysihtml5_js_location,
|
28
30
|
:config_options => field.bootstrap_wysihtml5_config_options.to_json
|
29
31
|
}
|
32
|
+
elsif field.respond_to?(:rich) && field.rich
|
33
|
+
richtext = 'rich'
|
30
34
|
else
|
31
35
|
richtext = false
|
32
36
|
js_data = {}
|
33
37
|
end
|
34
38
|
|
35
39
|
= form.text_area field.method_name, field.html_attributes.reverse_merge(:data => { :richtext => richtext, :options => js_data.to_json }).reverse_merge(:value => object.send(field.name))
|
40
|
+
|
41
|
+
- elsif field.type == :rich_editor
|
42
|
+
= render :partial => "rails_admin/main/form_rich_text", :locals => { form: form, field: field }
|
43
|
+
|
44
|
+
- elsif field.type == :carrierwave || field.type == :jcrop
|
45
|
+
= render :partial => "file_upload", :locals => { form: form, field: field } #if false
|
46
|
+
=# link_to("EDIT", rails_admin.edit_path(object.class.to_s.gsub("::","~").underscore,object.id), :target=>"_blank")
|
47
|
+
|
36
48
|
- else
|
37
49
|
= form.send(field.view_helper, field.method_name, field.html_attributes)
|
38
|
-
|
39
|
-
|
40
|
-
|
50
|
+
|
51
|
+
- if in_error
|
52
|
+
- I18n.with_locale @current_locale do
|
53
|
+
= content_tag(:span, "#{object.errors.messages[field.method_name]}", :class => 'help-inline', :style=>"color: #B94A48").html_safe
|
@@ -1,37 +1,39 @@
|
|
1
|
-
|
2
|
-
=
|
1
|
+
:ruby
|
2
|
+
translations_field = @object.translated_attributes.keys.collect(&:to_sym)
|
3
3
|
|
4
|
-
|
5
|
-
|
4
|
+
default_locale = I18n.locale
|
5
|
+
target_locale = @target_locale
|
6
6
|
|
7
|
-
|
7
|
+
rails_admin_proxy = @model_config
|
8
8
|
|
9
|
-
|
10
|
-
- target_locale = @target_locale
|
9
|
+
rails_admin_fields = @object.class.rails_admin.edit.with(:view=>self, :object=>@object, :controller=>@controller).visible_fields.inject({}) { |a,f| a[f.name] = f if translations_field.include?(f.name) ; a }
|
11
10
|
|
12
|
-
|
11
|
+
@associated_translations = @object.class.reflect_on_all_associations(:has_many).collect{|r| r.name if r.klass.respond_to?(:translation_options) }.compact
|
12
|
+
@associated_translations+= @object.class.reflect_on_all_associations(:has_one).collect{|r| r.name if r.klass.respond_to?(:translation_options) }.compact
|
13
13
|
|
14
|
-
|
14
|
+
@associated_translations = @object.associated_translations if @object.respond_to?("associated_translations")
|
15
|
+
@associated_translations = @associated_translations.compact.flatten.uniq
|
15
16
|
|
16
|
-
=
|
17
|
-
|
17
|
+
= javascript_include_tag "rails_admin/custom/rails_admin_globalize.js"
|
18
|
+
= stylesheet_link_tag "rails_admin/custom/rails_admin_globalize.css"
|
19
|
+
|
20
|
+
|
21
|
+
%p= raw I18n.translate("admin.actions.globalize.subtitle", :locale_name => "<strong>#{I18n.locale}</strong>".upcase)
|
18
22
|
|
23
|
+
= rails_admin_form_for @object, :url => rails_admin.globalize_path(@abstract_model, @object.id), :as => @abstract_model.param_key, :html => {:multipart => true, :class => 'globalize-form'} do |form|
|
24
|
+
= select_tag 'target_locale', options_for_select( @available_locales, @target_locale ), :id => "target_locale_select", :"data-target-url" => rails_admin.globalize_path(@object.class.to_s.split("::").map(&:underscore).join("~"), @object.id)
|
19
25
|
- rails_admin_fields.keys.each do |t|
|
20
|
-
%h5
|
26
|
+
%h5 #{@object.class.human_attribute_name(t.to_sym)}:
|
21
27
|
.row-fluid
|
22
28
|
.span4
|
23
29
|
.controls.well{ :class => "#{rails_admin_fields[t].type}_type" }
|
24
|
-
.original-content
|
30
|
+
.original-content
|
31
|
+
= raw @object.send(t)
|
32
|
+
|
25
33
|
.span8
|
26
34
|
- I18n.with_locale target_locale do
|
27
|
-
= render :partial => "globalize_field", :locals => {:object => @object, :form => form, :field => rails_admin_fields[t]}
|
28
|
-
|
29
|
-
- @associated_translations = @object.class.reflect_on_all_associations(:has_many).collect{|r| r.name if r.klass.respond_to?(:translation_options) }.compact
|
30
|
-
- @associated_translations += @object.class.reflect_on_all_associations(:has_one).collect{|r| r.name if r.klass.respond_to?(:translation_options) }.compact
|
35
|
+
= render :partial => "globalize_field", :locals => { :object => @object, :form => form, :field => rails_admin_fields[t] }
|
31
36
|
|
32
|
-
|
33
|
-
- @associated_translations = @object.associated_translations if @object.respond_to?("associated_translations")
|
34
|
-
- @associated_translations = @associated_translations.compact.flatten.uniq
|
35
37
|
- if @associated_translations
|
36
38
|
- @associated_translations.each do |association|
|
37
39
|
|
@@ -46,11 +48,12 @@
|
|
46
48
|
- if obj
|
47
49
|
%h4= raw I18n.translate("admin.actions.globalize.associated_translations", :associated_model => "<strong>#{rails_admin_proxy.label_plural}</strong>")
|
48
50
|
- rails_admin_fields.each do |t, field|
|
49
|
-
%h5
|
51
|
+
%h5 #{subform.object.class.human_attribute_name(t.to_sym)}:
|
50
52
|
.row-fluid
|
51
53
|
.span4
|
52
54
|
.controls.well{ :class => "#{rails_admin_fields[t].type}_type" }
|
53
55
|
.original-content= raw obj.send(t)
|
56
|
+
|
54
57
|
.span8
|
55
58
|
- I18n.with_locale target_locale do
|
56
59
|
= render :partial => "globalize_field", :locals => {:field => field, :object => obj, :form => subform}
|
@@ -61,38 +64,28 @@
|
|
61
64
|
|
62
65
|
- if @sub_associated_translations[:has_many].present?
|
63
66
|
- @sub_associated_translations[:has_many].each do |has_many_associated_model|
|
64
|
-
|
65
67
|
- associated_model = obj.send(has_many_associated_model)
|
66
|
-
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
.
|
76
|
-
.
|
77
|
-
.
|
78
|
-
|
79
|
-
|
80
|
-
|
68
|
+
- if associated_model && associated_model.first
|
69
|
+
- associated_translations_field = associated_model.first.translated_attributes.keys.collect(&:to_sym)
|
70
|
+
- associated_rails_admin_proxy = associated_model.first.class.rails_admin
|
71
|
+
- associated_rails_admin_fields = associated_rails_admin_proxy.visible_fields.inject({}) { |a,f| a[f.name] = f if associated_translations_field.include?(f.name) ;a }
|
72
|
+
|
73
|
+
= subform.fields_for has_many_associated_model.to_sym do |subsubform|
|
74
|
+
- sub_obj = subsubform.object
|
75
|
+
- associated_rails_admin_fields.each do |t, field|
|
76
|
+
%h5 #{subsubform.object.class.human_attribute_name(t.to_sym)}:
|
77
|
+
.row-fluid
|
78
|
+
.span4
|
79
|
+
.controls.well{ :class => "#{associated_rails_admin_fields[t].type}_type" }
|
80
|
+
.original-content= raw sub_obj.send(t)
|
81
|
+
|
82
|
+
.span8
|
83
|
+
- I18n.with_locale target_locale do
|
84
|
+
= render :partial => "globalize_field", :locals => {:field => field, :object => sub_obj, :form => subsubform}
|
81
85
|
|
82
86
|
- if @sub_associated_translations[:has_one].present?
|
83
87
|
- @sub_associated_translations[:has_one].each do |has_one_associated_model|
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
.form-actions
|
89
|
-
%button.btn.btn-primary{:type => "submit", :name => "_save", :'data-disable-with' => t("admin.form.save")}
|
90
|
-
%i.icon-white.icon-ok
|
91
|
-
= t("admin.form.save")
|
92
|
-
%span.extra_buttons
|
93
|
-
- if authorized? :globalize, @abstract_model
|
94
|
-
%button.btn.btn-info{:type => "submit", :name => "_add_edit", :'data-disable-with' => t("admin.form.save_and_edit")}
|
95
|
-
= t("admin.form.save_and_edit")
|
96
|
-
%button.btn{:type => "submit", :name => "_continue", :'data-disable-with' => t("admin.form.cancel")}
|
97
|
-
%i.icon-remove
|
98
|
-
= t("admin.form.cancel")
|
88
|
+
- # TODO
|
89
|
+
|
90
|
+
.form-horizontal
|
91
|
+
= render 'submit_buttons'
|
@@ -0,0 +1,14 @@
|
|
1
|
+
fr:
|
2
|
+
admin:
|
3
|
+
actions:
|
4
|
+
globalize:
|
5
|
+
title: "Traduction"
|
6
|
+
subtitle: "Traduire depuis %{locale_name} pour la langue sélectionnée :"
|
7
|
+
menu: "Traduire"
|
8
|
+
breadcrumb: "Traduction"
|
9
|
+
link: "Traduction"
|
10
|
+
bulk_link: "Traduire les %{model_label_plural} sélectionnés"
|
11
|
+
done: "Traduit"
|
12
|
+
rails_admin:
|
13
|
+
globalize:
|
14
|
+
success: "Traduction enregistrée"
|
@@ -1,15 +1,18 @@
|
|
1
|
+
# enconding: utf-8
|
1
2
|
it:
|
2
3
|
admin:
|
3
4
|
actions:
|
4
5
|
globalize:
|
5
|
-
title: Traduci
|
6
|
+
title: "Traduci"
|
6
7
|
subtitle: "Inserisci la traduzione dalla lingua %{locale_name} alla lingua selezionata:"
|
7
|
-
menu: Traduci
|
8
|
-
breadcrumb: Traduci
|
9
|
-
link: Traduci
|
8
|
+
menu: "Traduci"
|
9
|
+
breadcrumb: "Traduci"
|
10
|
+
link: "Traduci"
|
10
11
|
bulk_link: "Traduci %{model_label_plural}"
|
11
|
-
done: Tradotto
|
12
|
+
done: "Tradotto"
|
12
13
|
associated_translations: "Traduzioni per %{associated_model}"
|
14
|
+
|
13
15
|
rails_admin:
|
14
16
|
globalize:
|
15
|
-
|
17
|
+
error: "Non é stato possibile salvare la traduzione."
|
18
|
+
success: "Traduzione salvata correttamente"
|
@@ -8,11 +8,13 @@ require 'rails_admin/config/actions'
|
|
8
8
|
module RailsAdmin
|
9
9
|
module Config
|
10
10
|
module Actions
|
11
|
-
|
12
11
|
class Globalize < Base
|
13
|
-
|
14
12
|
RailsAdmin::Config::Actions.register(self)
|
15
13
|
|
14
|
+
register_instance_option :pjax? do
|
15
|
+
false
|
16
|
+
end
|
17
|
+
|
16
18
|
register_instance_option :member? do
|
17
19
|
true
|
18
20
|
end
|
@@ -30,7 +32,7 @@ module RailsAdmin
|
|
30
32
|
end
|
31
33
|
|
32
34
|
register_instance_option :http_methods do
|
33
|
-
[:get
|
35
|
+
[:get, :put, :patch]
|
34
36
|
end
|
35
37
|
|
36
38
|
register_instance_option :controller do
|
@@ -44,16 +46,24 @@ module RailsAdmin
|
|
44
46
|
|
45
47
|
else
|
46
48
|
loc = @current_locale = I18n.locale
|
47
|
-
@target_locale = params[:target_locale]
|
48
|
-
|
49
|
+
I18n.locale = @target_locale = params[:target_locale]
|
50
|
+
|
51
|
+
satisfy_strong_params!
|
52
|
+
sanitize_params_for!(:update)
|
53
|
+
|
54
|
+
@object.set_attributes(params[@abstract_model.param_key])
|
55
|
+
@authorization_adapter && @authorization_adapter.attributes_for(:update, @abstract_model).each do |name, value|
|
56
|
+
@object.send("#{name}=", value)
|
57
|
+
end
|
49
58
|
|
50
|
-
|
59
|
+
binding.pry
|
51
60
|
|
52
|
-
|
53
|
-
|
61
|
+
if @object.save
|
62
|
+
I18n.locale = loc
|
54
63
|
flash[:notice] = I18n.t("rails_admin.globalize.success")
|
55
64
|
redirect_to back_or_index
|
56
65
|
else
|
66
|
+
I18n.locale = loc
|
57
67
|
flash[:alert] = I18n.t("rails_admin.globalize.error")
|
58
68
|
end
|
59
69
|
end
|
metadata
CHANGED
@@ -1,91 +1,141 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails_admin_globalize
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
5
|
-
prerelease:
|
4
|
+
version: 0.1.0
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Andrea Zaupa
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2014-06-16 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: rails
|
16
|
-
requirement:
|
17
|
-
none: false
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
18
16
|
requirements:
|
19
|
-
- -
|
17
|
+
- - ">="
|
20
18
|
- !ruby/object:Gem::Version
|
21
19
|
version: '3.2'
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
|
-
version_requirements:
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '3.2'
|
25
27
|
- !ruby/object:Gem::Dependency
|
26
28
|
name: rails_admin
|
27
|
-
requirement:
|
28
|
-
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: globalize
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: haml-rails
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
29
58
|
requirements:
|
30
|
-
- -
|
59
|
+
- - ">="
|
31
60
|
- !ruby/object:Gem::Version
|
32
|
-
version: 0
|
61
|
+
version: '0'
|
33
62
|
type: :runtime
|
34
63
|
prerelease: false
|
35
|
-
version_requirements:
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: coffee-rails
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
36
83
|
- !ruby/object:Gem::Dependency
|
37
|
-
name:
|
38
|
-
requirement:
|
39
|
-
none: false
|
84
|
+
name: sass-rails
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
40
86
|
requirements:
|
41
|
-
- -
|
87
|
+
- - ">="
|
42
88
|
- !ruby/object:Gem::Version
|
43
|
-
version: 0
|
89
|
+
version: '0'
|
44
90
|
type: :runtime
|
45
91
|
prerelease: false
|
46
|
-
version_requirements:
|
47
|
-
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
description: Rails Admin plugin to manage Globalize translations
|
48
98
|
email:
|
49
99
|
- azaupa@gmail.com
|
50
100
|
executables: []
|
51
101
|
extensions: []
|
52
102
|
extra_rdoc_files: []
|
53
103
|
files:
|
54
|
-
-
|
55
|
-
-
|
104
|
+
- MIT-LICENSE
|
105
|
+
- README.md
|
106
|
+
- Rakefile
|
107
|
+
- app/assets/javascripts/rails_admin/custom/rails_admin_globalize.js.coffee
|
56
108
|
- app/assets/stylesheets/rails_admin/custom/rails_admin_globalize.css.scss
|
109
|
+
- app/views/rails_admin/main/_file_upload.haml
|
57
110
|
- app/views/rails_admin/main/_globalize_field.haml
|
58
111
|
- app/views/rails_admin/main/globalize.html.haml
|
59
112
|
- config/locales/globalize.en.yml
|
113
|
+
- config/locales/globalize.fr.yml
|
60
114
|
- config/locales/globalize.it.yml
|
115
|
+
- lib/rails_admin_globalize.rb
|
61
116
|
- lib/rails_admin_globalize/engine.rb
|
62
117
|
- lib/rails_admin_globalize/version.rb
|
63
|
-
- lib/rails_admin_globalize.rb
|
64
|
-
- MIT-LICENSE
|
65
|
-
- Rakefile
|
66
|
-
- README.rdoc
|
67
118
|
homepage: https://github.com/andreazaupa/rails_admin_globalize
|
68
119
|
licenses: []
|
120
|
+
metadata: {}
|
69
121
|
post_install_message:
|
70
122
|
rdoc_options: []
|
71
123
|
require_paths:
|
72
124
|
- lib
|
73
125
|
required_ruby_version: !ruby/object:Gem::Requirement
|
74
|
-
none: false
|
75
126
|
requirements:
|
76
|
-
- -
|
127
|
+
- - ">="
|
77
128
|
- !ruby/object:Gem::Version
|
78
129
|
version: '0'
|
79
130
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
80
|
-
none: false
|
81
131
|
requirements:
|
82
|
-
- -
|
132
|
+
- - ">="
|
83
133
|
- !ruby/object:Gem::Version
|
84
134
|
version: '0'
|
85
135
|
requirements: []
|
86
136
|
rubyforge_project:
|
87
|
-
rubygems_version:
|
137
|
+
rubygems_version: 2.2.2
|
88
138
|
signing_key:
|
89
|
-
specification_version:
|
90
|
-
summary:
|
139
|
+
specification_version: 4
|
140
|
+
summary: Rails Admin plugin to manage Globalize translations
|
91
141
|
test_files: []
|
data/README.rdoc
DELETED
@@ -1,37 +0,0 @@
|
|
1
|
-
= RailsAdminGlobalize
|
2
|
-
|
3
|
-
= Usage
|
4
|
-
|
5
|
-
add the gem to your bundler
|
6
|
-
|
7
|
-
gem "rails_admin"
|
8
|
-
gem "globalize3"
|
9
|
-
gem "rails_admin_globalize"
|
10
|
-
|
11
|
-
######
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
######
|
17
|
-
|
18
|
-
|
19
|
-
add globalize to the list of actions in rails_admin's initializer
|
20
|
-
|
21
|
-
RailsAdmin.config do |config|
|
22
|
-
|
23
|
-
config.actions do
|
24
|
-
dashboard do ; end
|
25
|
-
globalize do ; end
|
26
|
-
index do ; end
|
27
|
-
new do ; end
|
28
|
-
export do ; end
|
29
|
-
bulk_delete do ; end
|
30
|
-
show do ; end
|
31
|
-
edit do ; end
|
32
|
-
delete do ; end
|
33
|
-
history_show do ; end
|
34
|
-
show_in_app do ; end
|
35
|
-
end
|
36
|
-
end
|
37
|
-
|
@@ -1,17 +0,0 @@
|
|
1
|
-
$(function() {
|
2
|
-
$("#target_locale_select").live("change", function(e) {
|
3
|
-
var url = $("#target_locale_select").data("target-url");
|
4
|
-
location.replace(updateQueryStringParameter(url, "target_locale", $("#target_locale_select").val()));
|
5
|
-
});
|
6
|
-
});
|
7
|
-
|
8
|
-
function updateQueryStringParameter(uri, key, value) {
|
9
|
-
var re = new RegExp("([?|&])" + key + "=.*?(&|$)", "i");
|
10
|
-
var separator = uri.indexOf('?') !== -1 ? "&" : "?";
|
11
|
-
if (uri.match(re)) {
|
12
|
-
return uri.replace(re, '$1' + key + "=" + value + '$2');
|
13
|
-
}
|
14
|
-
else {
|
15
|
-
return uri + separator + key + "=" + value;
|
16
|
-
}
|
17
|
-
}
|
@@ -1,27 +0,0 @@
|
|
1
|
-
|
2
|
-
rsync -avz --delete -r --exclude 'document_storages' --exclude "system/bft_catalogs/" deploy@192.168.254.97:/space/apache/htdocs/bftconfigurator/shared/system/ /Users/Andrea/Public/configurator/
|
3
|
-
|
4
|
-
rsync -avz --delete -r deploy@gungan:/space/apache/htdocs/bft-corporate/shared/system/uploads/ /Users/Andrea/Code/bft-corporate/public/system/uploads/
|
5
|
-
|
6
|
-
rsync -avz --delete -r deploy@gungan:/space/apache/htdocs/stagings/bft-oauth/shared/system/ /Users/Andrea/Code/bft-oauth/public/system/
|
7
|
-
|
8
|
-
echo "drop database bft_dev;" | mysql -uroot
|
9
|
-
echo "create database bft_dev;" | mysql -uroot
|
10
|
-
|
11
|
-
echo "drop database bft_conf_dev;" | mysql -uroot
|
12
|
-
echo "create database bft_conf_dev;" | mysql -uroot
|
13
|
-
|
14
|
-
echo "drop database oauth_dev;" | mysql -uroot
|
15
|
-
echo "create database oauth_dev;" | mysql -uroot
|
16
|
-
|
17
|
-
mysqldump -ubftcorporate_st -p'[£rjeh232]' -h192.168.254.97 bftcorporate_stag | mysql -uroot bft_dev
|
18
|
-
mysqldump -ubftstaging -p'bi3ffet1st' -h192.168.254.94 bftstaging | mysql -uroot bft_conf_dev
|
19
|
-
mysqldump -ubftoauth_stag -p'dsf454!' -h192.168.254.89 bftoauth_stag | mysql -uroot oauth_dev
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|