From 174bd73b8923b680c7e4ed4dd6a201f4d2efcc24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juanjo=20Baz=C3=A1n?= Date: Tue, 1 Sep 2015 18:46:27 +0200 Subject: [PATCH 1/2] removes official_level_0_name setting --- app/helpers/admin_helper.rb | 4 ++-- config/locales/admin.en.yml | 2 +- config/locales/admin.es.yml | 2 +- db/seeds.rb | 1 - 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/app/helpers/admin_helper.rb b/app/helpers/admin_helper.rb index 09d325e08..a1c7cf7b5 100644 --- a/app/helpers/admin_helper.rb +++ b/app/helpers/admin_helper.rb @@ -5,8 +5,8 @@ module AdminHelper end def official_level_options - options = [] - (0..5).each do |i| + options = [["",0]] + (1..5).each do |i| options << [[t("admin.officials.level_#{i}"), Setting.value_for("official_level_#{i}_name")].compact.join(': '), i] end options diff --git a/config/locales/admin.en.yml b/config/locales/admin.en.yml index 9e9c7e61d..fae6a38c6 100644 --- a/config/locales/admin.en.yml +++ b/config/locales/admin.en.yml @@ -80,7 +80,7 @@ en: registered_at: "Registered at:" hidden_at: "Hidden at:" officials: - level_0: Level 0 + level_0: Not an official level_1: Level 1 level_2: Level 2 level_3: Level 3 diff --git a/config/locales/admin.es.yml b/config/locales/admin.es.yml index 1735b9f20..13984ab39 100644 --- a/config/locales/admin.es.yml +++ b/config/locales/admin.es.yml @@ -80,7 +80,7 @@ es: registered_at: "Fecha de alta:" hidden_at: "Bloqueado:" officials: - level_0: Nivel 0 + level_0: "No es cargo público" level_1: Nivel 1 level_2: Nivel 2 level_3: Nivel 3 diff --git a/db/seeds.rb b/db/seeds.rb index 6158a2a8d..600808d1b 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -1,6 +1,5 @@ # Names for the moderation console, as a hint for moderators # to know better how to assign users with official positions -Setting.create(key: 'official_level_0_name', value: 'No cargo público') Setting.create(key: 'official_level_1_name', value: 'Empleados públicos') Setting.create(key: 'official_level_2_name', value: 'Organización Municipal') Setting.create(key: 'official_level_3_name', value: 'Directores generales') From c6c32a079566088c1db07dac26e3896d8dde49fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juanjo=20Baz=C3=A1n?= Date: Tue, 1 Sep 2015 19:56:37 +0200 Subject: [PATCH 2/2] adds translation for admin settings' keys names --- app/views/admin/settings/index.html.erb | 2 +- config/locales/settings.en.yml | 8 ++++++++ config/locales/settings.es.yml | 8 ++++++++ spec/factories.rb | 4 ++-- spec/features/admin/settings_spec.rb | 6 +++--- 5 files changed, 22 insertions(+), 6 deletions(-) create mode 100644 config/locales/settings.en.yml create mode 100644 config/locales/settings.es.yml diff --git a/app/views/admin/settings/index.html.erb b/app/views/admin/settings/index.html.erb index 15ae47b8e..3cebe96b5 100644 --- a/app/views/admin/settings/index.html.erb +++ b/app/views/admin/settings/index.html.erb @@ -3,7 +3,7 @@