From 0670768068ac5778d9e0f8738e4f1c09a073df86 Mon Sep 17 00:00:00 2001 From: Petko Bordjukov Date: Sat, 15 Aug 2015 01:24:59 +0300 Subject: [PATCH] OpenFest: Tweak event language selection --- lib/open_fest/app/helpers/open_fest/application_helper.rb | 5 +++++ lib/open_fest/app/views/open_fest/events/new.slim | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/open_fest/app/helpers/open_fest/application_helper.rb b/lib/open_fest/app/helpers/open_fest/application_helper.rb index 58f9765..e137b8a 100644 --- a/lib/open_fest/app/helpers/open_fest/application_helper.rb +++ b/lib/open_fest/app/helpers/open_fest/application_helper.rb @@ -1,4 +1,9 @@ module OpenFest module ApplicationHelper + def locale_collection + I18n.available_locales.map do |locale| + [t("locales.#{locale}"), locale] + end + end end end diff --git a/lib/open_fest/app/views/open_fest/events/new.slim b/lib/open_fest/app/views/open_fest/events/new.slim index bcd8909..6446c7b 100644 --- a/lib/open_fest/app/views/open_fest/events/new.slim +++ b/lib/open_fest/app/views/open_fest/events/new.slim @@ -14,7 +14,7 @@ -# TODO length is different for different types of events (translation problem) = form.input :length - = form.input :language, as: :radio_buttons, collection: I18n.available_locales, include_blank: false, default: I18n.locale, wrapper: :default + = form.input :language, as: :radio_buttons, collection: locale_collection, include_blank: false, wrapper: :default, checked: current_user.language = form.input :abstract = form.input :description = form.input :notes