diff --git a/app/controllers/admin/members_controller.rb b/app/controllers/admin/members_controller.rb
index c07e189..5320055 100644
--- a/app/controllers/admin/members_controller.rb
+++ b/app/controllers/admin/members_controller.rb
@@ -149,6 +149,9 @@ class Admin::MembersController < OrbitMemberController
# @custom_field_value = MemberProfileFieldValue.put_field_values(@member, m.last, nil, field_value)
# end
end
+ if user_params
+ @member.user.update_attributes(user_params)
+ end
format.html { redirect_to admin_members_path, notice: 'Successfully Updated the User' }
@@ -286,11 +289,11 @@ class Admin::MembersController < OrbitMemberController
# Never trust parameters from the scary internet, only allow the white list through.
def member_profile_params
- params.require(:member_profile).permit!
+ params.require(:member_profile).permit! rescue nil
end
def user_params
- params.require(:user).permit!
+ params.require(:user).permit! rescue nil
end
diff --git a/app/helpers/attribute_fields_helper.rb b/app/helpers/attribute_fields_helper.rb
index fa7ca09..5829d51 100644
--- a/app/helpers/attribute_fields_helper.rb
+++ b/app/helpers/attribute_fields_helper.rb
@@ -212,7 +212,7 @@ protected
link_entry_ary = ["##{get_pairing_tab_class({})}","_#{key}"]
link_entry_ary << ".add_more_item_#{add_more_counter}" if can_add_more
link_entry = link_entry_ary.join
- link_to(I18nVariable.from_locale(key),link_entry,:data=>{:toggle=>"tab"},:class=>"btn #{(key == I18n.locale.to_s ? "active" : nil)}",:for=>key)
+ link_to("#{t(locale).to_s}",link_entry,:data=>{:toggle=>"tab"},:class=>"btn #{(key == I18n.locale.to_s ? "active" : nil)}",:for=>key)
end # of VALID_LOCALES.collect for tabs
buff2 << link_to((content_tag :i,'',:class=>'icon-edit'),"##{get_pairing_tab_class({})}_m_window", :role=>"button",:class=>'btn',:data=>{:toggle=>"modal"}) if self.markup == 'address'
@@ -261,7 +261,7 @@ protected
link_entry_ary = ["##{get_pairing_tab_class({})}","_#{key}"]
link_entry_ary << ".add_more_item_#{add_more_counter}" if can_add_more
link_entry = link_entry_ary.join
- link_to(I18nVariable.from_locale(key),link_entry,:data=>{:toggle=>"tab"},:class=>"btn #{(key == I18n.locale.to_s ? "active" : nil)}",:for=>key)
+ link_to("#{t(locale).to_s}",link_entry,:data=>{:toggle=>"tab"},:class=>"btn #{(key == I18n.locale.to_s ? "active" : nil)}",:for=>key)
end # of VALID_LOCALES.collect for tabs
buff2 << link_to((content_tag :i,'',:class=>'icon-edit'),"#address-field", :role=>"button",:class=>'btn',:data=>{:toggle=>"modal"}) if self.markup == 'address'
@@ -275,16 +275,6 @@ protected
tmp1 << tmp2
end
- # tmp << content_tag(:ul,:class=> 'nav nav-pills') do
- # VALID_LOCALES.each.collect do |key|
- # # link_entry = self.add_more ? "#{add_more_tab(:tab_btn,loop_counter,key)}" : "#tab"+id.to_s+"_#{key}"
- # link_entry_ary = [".#{get_pairing_tab_class({})}",".#{key}"]
- # link_entry_ary << ".add_more_item_#{add_more_counter}" if can_add_more
- # link_entry = link_entry_ary.join
- # content_tag(:li,link_to(I18nVariable.from_locale(key),link_entry,:data=>{:toggle=>"tab"}),:class=>(key == I18n.locale.to_s ? "active" : nil),:for=>key)
- # end.join.html_safe # of VALID_LOCALES.collect for tabs
- # end # of content ul
-
end
end
diff --git a/app/models/i18n_variable.rb b/app/models/i18n_variable.rb
deleted file mode 100644
index 90660ac..0000000
--- a/app/models/i18n_variable.rb
+++ /dev/null
@@ -1,24 +0,0 @@
-class I18nVariable
-
- include Mongoid::Document
- include Mongoid::Timestamps
-
- field :key
- field :document_class, type: String
- field :parent_id, type: BSON::ObjectId
-
- belongs_to :language_value, polymorphic: true
-
- def method_missing(*field)
- if field.size > 1
- self.write_attribute(field[0].to_s.delete('=').to_sym, field[1])
- else
- self[field[0]]
- end
- end
-
- def self.from_locale(locale)
- I18nVariable.find_by(key: locale)[I18n.locale]
- end
-
-end
diff --git a/app/views/admin/members/_info.html.erb b/app/views/admin/members/_info.html.erb
index f1b836c..6a3fe01 100644
--- a/app/views/admin/members/_info.html.erb
+++ b/app/views/admin/members/_info.html.erb
@@ -31,7 +31,7 @@ console.log(<%= @fname%>);
<% active = (locale == @site_in_use_locales.first ? "active" : "") %>
-
+
<% end %>
@@ -40,7 +40,7 @@ console.log(<%= @fname%>);
diff --git a/app/views/admin/members/_member_basic.html.erb b/app/views/admin/members/_member_basic.html.erb
index f83f16a..1cbaeba 100644
--- a/app/views/admin/members/_member_basic.html.erb
+++ b/app/views/admin/members/_member_basic.html.erb
@@ -78,7 +78,7 @@
@@ -145,7 +145,7 @@
diff --git a/app/views/admin/members/_user_basic_privilege.html.erb b/app/views/admin/members/_user_basic_privilege.html.erb
index d7f0899..01264ad 100644
--- a/app/views/admin/members/_user_basic_privilege.html.erb
+++ b/app/views/admin/members/_user_basic_privilege.html.erb
@@ -13,13 +13,12 @@
<%= @member.name %>
- <%= form_for @user, :html => { :class=>"form-horizontal main-forms", :id=>"user-forms"} do |m| %>
+ <%= form_for @user, html: { class: "form-horizontal main-forms", id: "user-forms"} do |m| %>
diff --git a/app/views/admin/members/edit_privilege.html.erb b/app/views/admin/members/edit_privilege.html.erb
index d45df46..4177e29 100644
--- a/app/views/admin/members/edit_privilege.html.erb
+++ b/app/views/admin/members/edit_privilege.html.erb
@@ -13,22 +13,20 @@
<%= javascript_include_tag "lib/jquery.tmpl.min.js" %>
<%= javascript_include_tag "lib/bootstrap-fileupload.js" %>
<%= javascript_include_tag "lib/member/role-forms.js" %>
- <%= javascript_include_tag "lib/member/textarea-lang-btn.js" %>
<% end -%>
-<%= form_for @member, :url => admin_member_path(@member), :html => { :multipart => true , :class=>"form-horizontal main-forms", :id=>"user-forms"} do |f| %>
+<%= form_for @member, url: admin_member_path(@member), html: { multipart: true , class: "form-horizontal main-forms", id: "user-forms"} do |f| %>
diff --git a/app/views/admin/sites/sitemap.html.erb b/app/views/admin/sites/sitemap.html.erb
index a30eaad..262bbeb 100644
--- a/app/views/admin/sites/sitemap.html.erb
+++ b/app/views/admin/sites/sitemap.html.erb
@@ -17,7 +17,7 @@
<% @site_in_use_locales.each_with_index do |locale, i| %>
>
- <%= I18nVariable.from_locale(locale) %>
+ <%= t(locale).to_s %>
<% end %>
diff --git a/app/views/js/_support_member_form_js.erb b/app/views/js/_support_member_form_js.erb
index e86ceb7..d72b3f5 100644
--- a/app/views/js/_support_member_form_js.erb
+++ b/app/views/js/_support_member_form_js.erb
@@ -24,14 +24,14 @@
<% @site_in_use_locales.each do |locale| %>
<% active = (locale == @site_in_use_locales.first ? "active" : "") %>
-
+
<% end %>
@@ -94,7 +94,7 @@
<% active = (locale == @site_in_use_locales.first ? "active" : "") %>
-
+
<% end %>
@@ -105,7 +105,7 @@
<% @site_in_use_locales.each do |locale| %>
<% active = (locale == @site_in_use_locales.first ? "active" : "") %>
- <%= I18nVariable.from_locale(locale) %>
+ <%= t(locale).to_s %>
<% end %>
@@ -162,7 +162,7 @@
"${_placeholder[0]+'_<%= locale %>'}"
{{/if}}
>
- ]' }"
{{else}}
@@ -185,7 +185,7 @@
{{else}}
"${'#'+_placeholder[0]+'_<%= locale %>'}"
{{/if}}
- data-toggle="tab"><%= I18nVariable.from_locale(locale) %>
+ data-toggle="tab"><%= t(locale).to_s %>
<% end %>
@@ -203,7 +203,7 @@
<%= content_tag :div,:class=>"input-append" do%>
<% @site_in_use_locales.each do |locale| %>
<% last = (locale == @site_in_use_locales.last ? true : false) %>
-
+
<% if last %>
<% end %>
@@ -259,7 +259,7 @@
<%= content_tag :div,:class=>"input-append" do%>
<% @site_in_use_locales.each do |locale| %>
<% last = (locale == @site_in_use_locales.last ? true : false) %>
-
+
<% if last %>
<% end %>
diff --git a/app/views/shared/attribute_field/_address_modal_dialog.html.erb b/app/views/shared/attribute_field/_address_modal_dialog.html.erb
index 5d2fb2d..c7fefca 100644
--- a/app/views/shared/attribute_field/_address_modal_dialog.html.erb
+++ b/app/views/shared/attribute_field/_address_modal_dialog.html.erb
@@ -10,7 +10,7 @@
<% site.valid_locales.each do |locale|%>
<% active = (locale == I18n.locale.to_s ? ["active"] : [] ) %>
<%= content_tag :li,:class=>active,:for=>locale do%>
- <%= link_to I18nVariable.from_locale(locale),".#{btn_class}.address_modal.#{locale}",:data=>{:toggle=>"tab"}%>
+ <%= link_to t(locale).to_s,".#{btn_class}.address_modal.#{locale}",:data=>{:toggle=>"tab"}%>
<% end %>
<% end %>
diff --git a/app/views/shared/attribute_field/_list_block.html.erb b/app/views/shared/attribute_field/_list_block.html.erb
index f47b450..86aca57 100644
--- a/app/views/shared/attribute_field/_list_block.html.erb
+++ b/app/views/shared/attribute_field/_list_block.html.erb
@@ -11,7 +11,7 @@
<% @site_in_use_locales.each do |locale| %>
<% last = (locale == @site_in_use_locales.last ? true : false) %>
<% p_value = value[locale.to_s] rescue nil%>
- <%= text_field("#{field_name}[0]", locale,:placeholder=>I18nVariable.from_locale(locale),:class=>"input-medium",:data=>{:type=>"option_lang_0_#{locale}"}) %>
+ <%= text_field("#{field_name}[0]", locale,:placeholder=>t(locale).to_s,:class=>"input-medium",:data=>{:type=>"option_lang_0_#{locale}"}) %>
<% if last %>
<% end %>
@@ -24,7 +24,7 @@
<% @site_in_use_locales.each do |locale| %>
<% last = (locale == @site_in_use_locales.last ? true : false) %>
<% p_value = value[locale.to_s] rescue nil%>
- <%= text_field("#{field_name}[#{index}]", locale,:value=>p_value,:placeholder=>I18nVariable.from_locale(locale),:class=>"input-medium", :data=>{:type=>"option_lang_#{index}_#{locale}"}) %>
+ <%= text_field("#{field_name}[#{index}]", locale,:value=>p_value,:placeholder=>t(locale).to_s,:class=>"input-medium", :data=>{:type=>"option_lang_#{index}_#{locale}"}) %>
<% if last %>
<% end %>
diff --git a/app/views/shared/attribute_field/_placeholder_block.html.erb b/app/views/shared/attribute_field/_placeholder_block.html.erb
index 7cd2f70..ee2dd6e 100644
--- a/app/views/shared/attribute_field/_placeholder_block.html.erb
+++ b/app/views/shared/attribute_field/_placeholder_block.html.erb
@@ -8,7 +8,7 @@
<% active = (locale == @site_in_use_locales.first ? "active in" : "'") %>
<%= content_tag :div,:class=>"tab-pane fade #{active}",:id=>"#{name_to_id(field_name)}_#{locale}" do%>
<% locale_value = values[locale.to_s] rescue nil%>
- <%= text_field(field_name, locale,:value=>locale_value,:placeholder=>I18nVariable.from_locale(locale),:data=>{:type=>"lang_#{locale}"}) %>
+ <%= text_field(field_name, locale,:value=>locale_value,:placeholder=> "#{t(locale).to_s}",:data=>{:type=>"lang_#{locale}"}) %>
<% end %>
<% end %>
@@ -16,7 +16,7 @@
<% @site_in_use_locales.each do |locale| %>
<% active = (locale == @site_in_use_locales.first ? "active" : "") %>
- <%= link_to I18nVariable.from_locale(locale),"##{name_to_id(field_name)}_#{locale}",:class=>"btn #{active}",:data=>{:toggle=>"tab"}%>
+ <%= link_to t(locale).to_s,"##{name_to_id(field_name)}_#{locale}",:class=>"btn #{active}",:data=>{:toggle=>"tab"}%>
<% end %>
diff --git a/built_in_extensions.rb b/built_in_extensions.rb
index 0874e83..7ca1d50 100644
--- a/built_in_extensions.rb
+++ b/built_in_extensions.rb
@@ -6,4 +6,4 @@ gem 'links', git: 'git@gitlab.tp.rulingcom.com:saurabh/links.git'
gem 'page_content', git: 'git@gitlab.tp.rulingcom.com:saurabh/pagecontent.git'
gem 'faq', git: 'git@gitlab.tp.rulingcom.com:saurabh/faq.git'
#Personal Plugins
-gem 'personal_journal', git: 'git@gitlab.tp.rulingcom.com:saurabh/personal-journal.git'
\ No newline at end of file
+gem 'personal_journal', path: '/Users/saurabhbhatia/personal_journal'
\ No newline at end of file