Merge pull request #3579 from rockandror/translations-new-interface
Responsive translation interface
This commit is contained in:
@@ -40,14 +40,15 @@ App.Forms =
|
||||
hideOrShowFieldsAfterSelection: ->
|
||||
$("[name='progress_bar[kind]']").on
|
||||
change: ->
|
||||
title_field = $("[name^='progress_bar'][name$='[title]']").parent()
|
||||
locale = App.Globalize.selected_language()
|
||||
title_field = $(".translatable-fields[data-locale=#{locale}]")
|
||||
|
||||
if this.value == "primary"
|
||||
title_field.hide()
|
||||
$("#globalize_locales").hide()
|
||||
$(".globalize-languages").hide()
|
||||
else
|
||||
title_field.show()
|
||||
$("#globalize_locales").show()
|
||||
$(".globalize-languages").show()
|
||||
|
||||
$("[name='progress_bar[kind]']").change()
|
||||
|
||||
|
||||
@@ -1,37 +1,47 @@
|
||||
App.Globalize =
|
||||
|
||||
selected_language: ->
|
||||
$("#select_language").val()
|
||||
|
||||
display_locale: (locale) ->
|
||||
App.Globalize.enable_locale(locale)
|
||||
$(".js-globalize-locale-link").each ->
|
||||
if $(this).data("locale") == locale
|
||||
$(this).show()
|
||||
App.Globalize.highlight_locale($(this))
|
||||
$(".js-globalize-locale option:selected").removeAttr("selected")
|
||||
return
|
||||
App.Globalize.add_language(locale)
|
||||
$(".js-add-language option:selected").removeAttr("selected")
|
||||
|
||||
display_translations: (locale) ->
|
||||
$(".js-select-language option[value=#{locale}]").prop("selected", true)
|
||||
$(".js-globalize-attribute").each ->
|
||||
if $(this).data("locale") == locale
|
||||
$(this).show()
|
||||
else
|
||||
$(this).hide()
|
||||
$(".js-delete-language").hide()
|
||||
$("#js_delete_#{locale}").show()
|
||||
$(".js-delete-" + locale).show()
|
||||
|
||||
highlight_locale: (element) ->
|
||||
$(".js-globalize-locale-link").removeClass("is-active")
|
||||
element.addClass("is-active")
|
||||
add_language: (locale) ->
|
||||
language_option = $(".js-add-language [value=#{locale}]")
|
||||
if $(".js-select-language option[value=#{locale}]").length == 0
|
||||
option = new Option(language_option.text(), language_option.val())
|
||||
$(".js-select-language").append(option)
|
||||
$(".js-select-language option[value=#{locale}]").prop("selected", true)
|
||||
|
||||
remove_language: (locale) ->
|
||||
$(".js-globalize-attribute[data-locale=#{locale}]").each ->
|
||||
$(this).val("").hide()
|
||||
if CKEDITOR.instances[$(this).attr("id")]
|
||||
CKEDITOR.instances[$(this).attr("id")].setData("")
|
||||
$(".js-globalize-locale-link[data-locale=#{locale}]").hide()
|
||||
next = $(".js-globalize-locale-link:visible").first()
|
||||
App.Globalize.highlight_locale(next)
|
||||
App.Globalize.display_translations(next.data("locale"))
|
||||
App.Globalize.resetEditor(this)
|
||||
|
||||
$(".js-select-language option[value=#{locale}]").remove()
|
||||
next = $(".js-select-language option:not([value=''])").first()
|
||||
App.Globalize.display_translations(next.val())
|
||||
App.Globalize.disable_locale(locale)
|
||||
App.Globalize.update_description()
|
||||
|
||||
if $(".js-select-language option").length == 1
|
||||
$(".js-select-language option").prop("selected", true)
|
||||
|
||||
resetEditor: (element) ->
|
||||
if CKEDITOR.instances[$(element).attr("id")]
|
||||
CKEDITOR.instances[$(element).attr("id")].setData("")
|
||||
|
||||
enable_locale: (locale) ->
|
||||
App.Globalize.destroy_locale_field(locale).val(false)
|
||||
@@ -43,8 +53,8 @@ App.Globalize =
|
||||
|
||||
enabled_locales: ->
|
||||
$.map(
|
||||
$(".js-globalize-locale-link:visible"),
|
||||
(element) -> $(element).data("locale")
|
||||
$(".js-select-language:first option:not([value=''])"),
|
||||
(element) -> $(element).val()
|
||||
)
|
||||
|
||||
destroy_locale_field: (locale) ->
|
||||
@@ -54,20 +64,34 @@ App.Globalize =
|
||||
$("#enabled_translations_#{locale}")
|
||||
|
||||
refresh_visible_translations: ->
|
||||
locale = $(".js-globalize-locale-link.is-active").data("locale")
|
||||
locale = $(".js-select-language").val()
|
||||
App.Globalize.display_translations(locale)
|
||||
|
||||
update_description: ->
|
||||
count = App.Globalize.enabled_locales().length
|
||||
description = App.Globalize.language_description(count)
|
||||
$(".js-languages-description").html(description)
|
||||
$(".js-languages-count").text(count)
|
||||
|
||||
language_description: (count) ->
|
||||
switch count
|
||||
when 0 then $(".globalize-languages").data("zero-languages-description")
|
||||
when 1 then $(".globalize-languages").data("one-languages-description")
|
||||
else $(".globalize-languages").data("other-languages-description")
|
||||
|
||||
initialize: ->
|
||||
$(".js-globalize-locale").on "change", ->
|
||||
App.Globalize.display_translations($(this).val())
|
||||
App.Globalize.display_locale($(this).val())
|
||||
|
||||
$(".js-globalize-locale-link").on "click", ->
|
||||
locale = $(this).data("locale")
|
||||
$(".js-add-language").on "change", ->
|
||||
locale = $(this).val()
|
||||
App.Globalize.display_translations(locale)
|
||||
App.Globalize.highlight_locale($(this))
|
||||
App.Globalize.display_locale(locale)
|
||||
App.Globalize.update_description()
|
||||
|
||||
$(".js-delete-language").on "click", ->
|
||||
$(".js-select-language").on "change", ->
|
||||
locale = $(this).val()
|
||||
App.Globalize.display_translations(locale)
|
||||
|
||||
$(".js-delete-language").on "click", (e) ->
|
||||
e.preventDefault()
|
||||
locale = $(this).data("locale")
|
||||
$(this).hide()
|
||||
App.Globalize.remove_language(locale)
|
||||
|
||||
@@ -197,6 +197,10 @@ a {
|
||||
padding-top: $line-height;
|
||||
}
|
||||
|
||||
.padding-top {
|
||||
padding-top: $line-height;
|
||||
}
|
||||
|
||||
.light {
|
||||
background: $light;
|
||||
}
|
||||
@@ -1080,6 +1084,19 @@ form {
|
||||
}
|
||||
}
|
||||
|
||||
.translatable-fields {
|
||||
|
||||
&.highlight {
|
||||
display: inline-block;
|
||||
padding-top: $line-height;
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.translation-locale {
|
||||
padding-top: $line-height;
|
||||
}
|
||||
|
||||
// 07. Callout
|
||||
// -----------
|
||||
|
||||
|
||||
@@ -1,17 +1,76 @@
|
||||
module GlobalizeHelper
|
||||
|
||||
def options_for_locale_select
|
||||
options_for_select(locale_options, nil)
|
||||
def options_for_select_language(resource)
|
||||
options_for_select(available_locales(resource), first_available_locale(resource))
|
||||
end
|
||||
|
||||
def locale_options
|
||||
I18n.available_locales.map do |locale|
|
||||
[name_for_locale(locale), locale]
|
||||
def available_locales(resource)
|
||||
I18n.available_locales.select{ |locale| enabled_locale?(resource, locale) }.map do |locale|
|
||||
[name_for_locale(locale), locale , { data: { locale: locale } }]
|
||||
end
|
||||
end
|
||||
|
||||
def enabled_locale?(resource, locale)
|
||||
return site_customization_enable_translation?(locale) if resource.blank?
|
||||
|
||||
if resource.translations.empty?
|
||||
locale == I18n.locale
|
||||
else
|
||||
resource.locales_not_marked_for_destruction.include?(locale)
|
||||
end
|
||||
end
|
||||
|
||||
def first_available_locale(resource)
|
||||
return first_i18n_content_translation_locale if resource.blank?
|
||||
|
||||
if translations_for_locale?(resource, I18n.locale)
|
||||
I18n.locale
|
||||
elsif resource.translations.any?
|
||||
resource.translations.first.locale
|
||||
else
|
||||
I18n.locale
|
||||
end
|
||||
end
|
||||
|
||||
def first_i18n_content_translation_locale
|
||||
if I18nContentTranslation.existing_languages.count == 0 ||
|
||||
I18nContentTranslation.existing_languages.include?(I18n.locale)
|
||||
I18n.locale
|
||||
else
|
||||
I18nContentTranslation.existing_languages.first
|
||||
end
|
||||
end
|
||||
|
||||
def translations_for_locale?(resource, locale)
|
||||
resource.present? && resource.translations.any? &&
|
||||
resource.locales_not_marked_for_destruction.include?(locale)
|
||||
end
|
||||
|
||||
def selected_languages_description(resource)
|
||||
t("shared.translations.languages_in_use_html", count: active_languages_count(resource))
|
||||
end
|
||||
|
||||
def active_languages_count(resource)
|
||||
if resource.blank?
|
||||
languages_count
|
||||
elsif resource.locales_not_marked_for_destruction.size > 0
|
||||
resource.locales_not_marked_for_destruction.size
|
||||
else
|
||||
1
|
||||
end
|
||||
end
|
||||
|
||||
def languages_count
|
||||
count = I18nContentTranslation.existing_languages.count
|
||||
count > 0 ? count : 1
|
||||
end
|
||||
|
||||
def display_translation_style(resource, locale)
|
||||
"display: none;" unless display_translation?(resource, locale)
|
||||
end
|
||||
|
||||
def display_translation?(resource, locale)
|
||||
if !resource || resource.translations.blank? ||
|
||||
if !resource || resource.translations.empty? ||
|
||||
resource.locales_not_marked_for_destruction.include?(I18n.locale)
|
||||
locale == I18n.locale
|
||||
else
|
||||
@@ -19,38 +78,31 @@ module GlobalizeHelper
|
||||
end
|
||||
end
|
||||
|
||||
def display_translation_style(resource, locale)
|
||||
"display: none;" unless display_translation?(resource, locale)
|
||||
def display_destroy_locale_style(resource, locale)
|
||||
"display: none;" unless display_destroy_locale_link?(resource, locale)
|
||||
end
|
||||
|
||||
def display_destroy_locale_link?(resource, locale)
|
||||
first_available_locale(resource) == locale
|
||||
end
|
||||
|
||||
def options_for_add_language
|
||||
options_for_select(all_language_options, nil)
|
||||
end
|
||||
|
||||
def all_language_options
|
||||
I18n.available_locales.map do |locale|
|
||||
[name_for_locale(locale), locale]
|
||||
end
|
||||
end
|
||||
|
||||
def translation_enabled_tag(locale, enabled)
|
||||
hidden_field_tag("enabled_translations[#{locale}]", (enabled ? 1 : 0))
|
||||
end
|
||||
|
||||
def enable_translation_style(resource, locale)
|
||||
"display: none;" unless enable_locale?(resource, locale)
|
||||
end
|
||||
|
||||
def enable_locale?(resource, locale)
|
||||
if resource.translations.any?
|
||||
resource.locales_not_marked_for_destruction.include?(locale)
|
||||
else
|
||||
locale == I18n.locale
|
||||
end
|
||||
end
|
||||
|
||||
def highlight_class(resource, locale)
|
||||
"is-active" if display_translation?(resource, locale)
|
||||
end
|
||||
|
||||
def globalize(locale, &block)
|
||||
Globalize.with_locale(locale) do
|
||||
yield
|
||||
end
|
||||
end
|
||||
|
||||
def same_locale?(locale1, locale2)
|
||||
locale1 == locale2
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -11,7 +11,11 @@ module TranslatableFormHelper
|
||||
end
|
||||
|
||||
def backend_translations_enabled?
|
||||
(controller.class.parents & [Admin, Management, Valuation]).any?
|
||||
(controller.class.parents & [Admin, Management, Valuation, Tracking]).any?
|
||||
end
|
||||
|
||||
def highlight_translation_html_class
|
||||
"highlight" if translations_interface_enabled?
|
||||
end
|
||||
|
||||
class TranslatableFormBuilder < FoundationRailsHelper::FormBuilder
|
||||
@@ -66,9 +70,13 @@ module TranslatableFormHelper
|
||||
end
|
||||
end
|
||||
|
||||
def highlight_translation_html_class
|
||||
@template.highlight_translation_html_class
|
||||
end
|
||||
|
||||
def translations_options(resource, locale)
|
||||
{
|
||||
class: "translatable-fields js-globalize-attribute",
|
||||
class: "translatable-fields js-globalize-attribute #{highlight_translation_html_class}",
|
||||
style: @template.display_translation_style(resource.globalized_model, locale),
|
||||
data: { locale: locale }
|
||||
}
|
||||
|
||||
@@ -1,19 +1,33 @@
|
||||
<%= render "admin/shared/globalize_locales", resource: @admin_notification %>
|
||||
<%= render "shared/globalize_locales", resource: @admin_notification %>
|
||||
|
||||
<%= translatable_form_for [:admin, @admin_notification] do |f| %>
|
||||
<%= render "shared/errors", resource: @admin_notification %>
|
||||
|
||||
<%= f.select :segment_recipient, options_for_select(user_segments_options,
|
||||
@admin_notification[:segment_recipient]) %>
|
||||
<%= f.text_field :link %>
|
||||
<div class="row">
|
||||
<div class="small-12 column">
|
||||
<%= f.select :segment_recipient, options_for_select(user_segments_options,
|
||||
@admin_notification[:segment_recipient]) %>
|
||||
</div>
|
||||
<div class="small-12 column">
|
||||
<%= f.text_field :link %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<%= f.translatable_fields do |translations_form| %>
|
||||
<%= translations_form.text_field :title %>
|
||||
<%= translations_form.text_area :body %>
|
||||
<% end %>
|
||||
<div class="row">
|
||||
<%= f.translatable_fields do |translations_form| %>
|
||||
<div class="small-12 column">
|
||||
<%= translations_form.text_field :title %>
|
||||
</div>
|
||||
<div class="small-12 column">
|
||||
<%= translations_form.text_area :body %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="margin-top">
|
||||
<%= f.submit t("admin.admin_notifications.#{admin_submit_action(@admin_notification)}.submit_button"),
|
||||
class: "button success" %>
|
||||
<div class="row">
|
||||
<div class="small-12 column margin-top">
|
||||
<%= f.submit t("admin.admin_notifications.#{admin_submit_action(@admin_notification)}.submit_button"),
|
||||
class: "button success" %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<%= render "admin/shared/globalize_locales", resource: @banner %>
|
||||
<%= render "shared/globalize_locales", resource: @banner %>
|
||||
|
||||
<%= translatable_form_for [:admin, @banner] do |f| %>
|
||||
|
||||
|
||||
@@ -1,24 +1,34 @@
|
||||
<%= render "admin/shared/globalize_locales", resource: @group %>
|
||||
<%= render "shared/globalize_locales", resource: @group %>
|
||||
|
||||
<div class="small-12 medium-6">
|
||||
<%= translatable_form_for [:admin, @budget, @group], url: path do |f| %>
|
||||
<%= translatable_form_for [:admin, @budget, @group], url: path do |f| %>
|
||||
|
||||
<%= render "shared/errors", resource: @group %>
|
||||
<%= render "shared/errors", resource: @group %>
|
||||
|
||||
<div class="row">
|
||||
<%= f.translatable_fields do |translations_form| %>
|
||||
<%= translations_form.text_field :name,
|
||||
label: t("admin.budget_groups.form.name"),
|
||||
maxlength: 50,
|
||||
placeholder: t("admin.budget_groups.form.name") %>
|
||||
<div class="small-12 medium-6 column end">
|
||||
<%= translations_form.text_field :name,
|
||||
label: t("admin.budget_groups.form.name"),
|
||||
maxlength: 50,
|
||||
placeholder: t("admin.budget_groups.form.name") %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<% if @group.persisted? %>
|
||||
<% if @group.persisted? %>
|
||||
<div class="row">
|
||||
<div class="small-12 medium-6 column">
|
||||
<%= f.select :max_votable_headings,
|
||||
(1..@group.headings.count),
|
||||
label: t("admin.budget_groups.max_votable_headings"),
|
||||
placeholder: t("admin.budget_groups.max_votable_headings") %>
|
||||
<% end %>
|
||||
|
||||
<%= f.submit t("admin.budget_groups.form.#{action}"), class: "button success" %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="small-12 medium-6 column">
|
||||
<%= f.submit t("admin.budget_groups.form.#{action}"), class: "button success" %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
@@ -1,52 +1,57 @@
|
||||
<%= render "admin/shared/globalize_locales", resource: @heading %>
|
||||
<%= render "shared/globalize_locales", resource: @heading %>
|
||||
|
||||
<div class="small-12 medium-6">
|
||||
<%= translatable_form_for [:admin, @budget, @group, @heading], url: path do |f| %>
|
||||
|
||||
<%= translatable_form_for [:admin, @budget, @group, @heading], url: path do |f| %>
|
||||
|
||||
<%= render "shared/errors", resource: @heading %>
|
||||
<%= render "shared/errors", resource: @heading %>
|
||||
|
||||
<div class="row">
|
||||
<%= f.translatable_fields do |translations_form| %>
|
||||
<%= translations_form.text_field :name,
|
||||
label: t("admin.budget_headings.form.name"),
|
||||
maxlength: 50,
|
||||
placeholder: t("admin.budget_headings.form.name") %>
|
||||
<div class="small-12 medium-6 column end">
|
||||
<%= translations_form.text_field :name,
|
||||
label: t("admin.budget_headings.form.name"),
|
||||
maxlength: 50,
|
||||
placeholder: t("admin.budget_headings.form.name") %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<%= f.text_field :price,
|
||||
label: t("admin.budget_headings.form.amount"),
|
||||
maxlength: 8,
|
||||
placeholder: t("admin.budget_headings.form.amount") %>
|
||||
<div class="row">
|
||||
<div class="small-12 medium-6 column">
|
||||
<%= f.text_field :price,
|
||||
label: t("admin.budget_headings.form.amount"),
|
||||
maxlength: 8,
|
||||
placeholder: t("admin.budget_headings.form.amount") %>
|
||||
|
||||
<%= f.label :population, t("admin.budget_headings.form.population") %>
|
||||
<p class="help-text" id="budgets-population-help-text">
|
||||
<%= t("admin.budget_headings.form.population_info") %>
|
||||
</p>
|
||||
<%= f.text_field :population,
|
||||
label: false,
|
||||
maxlength: 8,
|
||||
placeholder: t("admin.budget_headings.form.population"),
|
||||
data: {toggle_focus: "population-info"},
|
||||
aria: {describedby: "budgets-population-help-text"} %>
|
||||
<%= f.label :population, t("admin.budget_headings.form.population") %>
|
||||
<p class="help-text" id="budgets-population-help-text">
|
||||
<%= t("admin.budget_headings.form.population_info") %>
|
||||
</p>
|
||||
<%= f.text_field :population,
|
||||
label: false,
|
||||
maxlength: 8,
|
||||
placeholder: t("admin.budget_headings.form.population"),
|
||||
data: {toggle_focus: "population-info"},
|
||||
aria: {describedby: "budgets-population-help-text"} %>
|
||||
|
||||
<%= f.text_field :latitude,
|
||||
label: t("admin.budget_headings.form.latitude"),
|
||||
maxlength: 22,
|
||||
placeholder: "latitude" %>
|
||||
<%= f.text_field :latitude,
|
||||
label: t("admin.budget_headings.form.latitude"),
|
||||
maxlength: 22,
|
||||
placeholder: "latitude" %>
|
||||
|
||||
<%= f.text_field :longitude,
|
||||
label: t("admin.budget_headings.form.longitude"),
|
||||
maxlength: 22,
|
||||
placeholder: "longitude" %>
|
||||
<p class="help-text" id="budgets-coordinates-help-text">
|
||||
<%= t("admin.budget_headings.form.coordinates_info") %>
|
||||
</p>
|
||||
<%= f.text_field :longitude,
|
||||
label: t("admin.budget_headings.form.longitude"),
|
||||
maxlength: 22,
|
||||
placeholder: "longitude" %>
|
||||
<p class="help-text" id="budgets-coordinates-help-text">
|
||||
<%= t("admin.budget_headings.form.coordinates_info") %>
|
||||
</p>
|
||||
|
||||
<%= f.check_box :allow_custom_content, label: t("admin.budget_headings.form.allow_content_block") %>
|
||||
<p class="help-text" id="budgets-content-blocks-help-text">
|
||||
<%= t("admin.budget_headings.form.content_blocks_info") %>
|
||||
</p>
|
||||
<%= f.check_box :allow_custom_content, label: t("admin.budget_headings.form.allow_content_block") %>
|
||||
<p class="help-text" id="budgets-content-blocks-help-text">
|
||||
<%= t("admin.budget_headings.form.content_blocks_info") %>
|
||||
</p>
|
||||
|
||||
<%= f.submit t("admin.budget_headings.form.#{action}"), class: "button success" %>
|
||||
<% end %>
|
||||
</div>
|
||||
<%= f.submit t("admin.budget_headings.form.#{action}"), class: "button success" %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
@@ -2,132 +2,134 @@
|
||||
<span class="icon-angle-left"></span> <%= t("shared.back") %>
|
||||
<% end %>
|
||||
|
||||
<%= render "admin/shared/globalize_locales", resource: @investment %>
|
||||
<%= render "shared/globalize_locales", resource: @investment %>
|
||||
|
||||
<%= translatable_form_for @investment,
|
||||
url: admin_budget_budget_investment_path(@budget, @investment) do |f| %>
|
||||
<div class="row">
|
||||
<%= translatable_form_for @investment,
|
||||
url: admin_budget_budget_investment_path(@budget, @investment) do |f| %>
|
||||
|
||||
<%= render "shared/errors", resource: @investment %>
|
||||
<%= render "shared/errors", resource: @investment %>
|
||||
|
||||
<% Budget::Investment.filter_params(params).to_h.each do |filter_name, filter_value| %>
|
||||
<%= hidden_field_tag filter_name, filter_value %>
|
||||
<% end %>
|
||||
|
||||
<div class="row expanded">
|
||||
<%= f.translatable_fields do |translations_form| %>
|
||||
<div class="small-12 column">
|
||||
<%= translations_form.text_field :title,
|
||||
maxlength: Budget::Investment.title_max_length %>
|
||||
</div>
|
||||
|
||||
<div class="ckeditor small-12 column">
|
||||
<%= translations_form.cktext_area :description,
|
||||
maxlength: Budget::Investment.description_max_length,
|
||||
ckeditor: { language: I18n.locale } %>
|
||||
</div>
|
||||
<% Budget::Investment.filter_params(params).to_h.each do |filter_name, filter_value| %>
|
||||
<%= hidden_field_tag filter_name, filter_value %>
|
||||
<% end %>
|
||||
|
||||
<div class="small-12 column">
|
||||
<%= f.label :tag_list, t("admin.budget_investments.edit.user_tags") %>
|
||||
<%= f.text_field :tag_list,
|
||||
value: @investment.tag_list.sort.join(","),
|
||||
label: false %>
|
||||
</div>
|
||||
<div class="row expanded">
|
||||
<%= f.translatable_fields do |translations_form| %>
|
||||
<div class="small-12 column">
|
||||
<%= translations_form.text_field :title,
|
||||
maxlength: Budget::Investment.title_max_length %>
|
||||
</div>
|
||||
|
||||
<div class="small-12 column">
|
||||
<div class="small-12 medium-6">
|
||||
<%= f.text_field :external_url %>
|
||||
<div class="ckeditor small-12 column">
|
||||
<%= translations_form.cktext_area :description,
|
||||
maxlength: Budget::Investment.description_max_length,
|
||||
ckeditor: { language: I18n.locale } %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div class="small-12 column">
|
||||
<%= f.label :tag_list, t("admin.budget_investments.edit.user_tags") %>
|
||||
<%= f.text_field :tag_list,
|
||||
value: @investment.tag_list.sort.join(","),
|
||||
label: false %>
|
||||
</div>
|
||||
|
||||
<div class="small-12 medium-6">
|
||||
<%= f.select :heading_id, budget_heading_select_options(@budget), include_blank: t("admin.budget_investments.edit.select_heading") %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="small-12 column">
|
||||
<div class="small-12 medium-6">
|
||||
<%= f.text_field :external_url %>
|
||||
</div>
|
||||
|
||||
<div class="row expanded margin-top">
|
||||
|
||||
<div class="small-12 column">
|
||||
<h2 id="classification"><%= t("admin.budget_investments.edit.classification") %></h2>
|
||||
|
||||
<div class="small-12 medium-6">
|
||||
<%= f.select(:administrator_id,
|
||||
@admins.collect{ |a| [a.description_or_name_and_email, a.id ] },
|
||||
{ include_blank: t("admin.budget_investments.edit.undefined") }) %>
|
||||
<div class="small-12 medium-6">
|
||||
<%= f.select :heading_id, budget_heading_select_options(@budget), include_blank: t("admin.budget_investments.edit.select_heading") %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="small-12 column">
|
||||
<%= f.label :valuation_tag_list, t("admin.budget_investments.edit.tags") %>
|
||||
<div class="tags">
|
||||
<% @tags.each do |tag| %>
|
||||
<a class="js-add-tag-link"><%= tag.name %></a>
|
||||
<div class="row expanded margin-top">
|
||||
|
||||
<div class="small-12 column">
|
||||
<h2 id="classification"><%= t("admin.budget_investments.edit.classification") %></h2>
|
||||
|
||||
<div class="small-12 medium-6">
|
||||
<%= f.select(:administrator_id,
|
||||
@admins.collect{ |a| [a.description_or_name_and_email, a.id ] },
|
||||
{ include_blank: t("admin.budget_investments.edit.undefined") }) %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="small-12 column">
|
||||
<%= f.label :valuation_tag_list, t("admin.budget_investments.edit.tags") %>
|
||||
<div class="tags">
|
||||
<% @tags.each do |tag| %>
|
||||
<a class="js-add-tag-link"><%= tag.name %></a>
|
||||
<% end %>
|
||||
</div>
|
||||
<%= f.text_field :valuation_tag_list,
|
||||
value: @investment.valuation_tag_list.sort.join(","),
|
||||
label: false,
|
||||
placeholder: t("admin.budget_investments.edit.tags_placeholder"),
|
||||
class: "js-tag-list" %>
|
||||
</div>
|
||||
|
||||
<div class="small-12 column margin-top">
|
||||
<%= f.label :valuator_ids, t("admin.budget_investments.edit.user_groups") %>
|
||||
<ul>
|
||||
<%= f.collection_check_boxes :valuator_group_ids, @valuator_groups, :id, :name do |group| %>
|
||||
<li><%= group.label(title: group.object.name) { group.check_box + truncate(group.object.name, length: 60) } %></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="small-12 column">
|
||||
<hr>
|
||||
<%= f.label :valuator_ids, t("admin.budget_investments.edit.assigned_valuators") %>
|
||||
<ul>
|
||||
<%= f.collection_check_boxes :valuator_ids, @valuators, :id, :email do |b| %>
|
||||
<li><%= b.label(title: valuator_label(b.object)) { b.check_box + truncate(b.object.description_or_email, length: 60) } %></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="small-12 column">
|
||||
<hr>
|
||||
<%= f.label :tracker_ids, t("admin.budget_investments.edit.assigned_trackers") %>
|
||||
<ul>
|
||||
<%= f.collection_check_boxes :tracker_ids, @trackers, :id, :email do |b| %>
|
||||
<li><%= b.label(title: tracker_label(b.object)) { b.check_box + truncate(b.object.description_or_email, length: 60) } %></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row expanded margin-top">
|
||||
<% if @investment.incompatible? || @investment.winner? %>
|
||||
<div class="small-12 medium-3 column">
|
||||
<h2 id="incompatible"><%= t("admin.budget_investments.edit.compatibility") %></h2>
|
||||
<%= f.label :incompatible do %>
|
||||
<%= f.check_box :incompatible, title: t("admin.budget_investments.edit.compatibility"), label: false %>
|
||||
<span class="checkbox"><%= t("admin.budget_investments.edit.mark_as_incompatible") %></span>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="small-12 medium-3 column float-left">
|
||||
<h2 id="selected"><%= t("admin.budget_investments.edit.selection") %></h2>
|
||||
<%= f.label :selected do %>
|
||||
<%= f.check_box :selected, title: t("admin.budget_investments.edit.selection"), label: false %>
|
||||
<span class="checkbox"><%= t("admin.budget_investments.edit.mark_as_selected") %></span>
|
||||
<% end %>
|
||||
</div>
|
||||
<%= f.text_field :valuation_tag_list,
|
||||
value: @investment.valuation_tag_list.sort.join(","),
|
||||
label: false,
|
||||
placeholder: t("admin.budget_investments.edit.tags_placeholder"),
|
||||
class: "js-tag-list" %>
|
||||
</div>
|
||||
|
||||
<div class="small-12 column">
|
||||
<%= f.text_field :milestone_tag_list,
|
||||
value: @investment.milestone_tag_list.sort.join(", "),
|
||||
label: t("admin.budget_investments.edit.milestone_tags") %>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="small-12 column margin-top">
|
||||
<%= f.label :valuator_ids, t("admin.budget_investments.edit.user_groups") %>
|
||||
<ul>
|
||||
<%= f.collection_check_boxes :valuator_group_ids, @valuator_groups, :id, :name do |group| %>
|
||||
<li><%= group.label(title: group.object.name) { group.check_box + truncate(group.object.name, length: 60) } %></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
<%= f.submit(class: "button", value: t("admin.budget_investments.edit.submit_button")) %>
|
||||
</div>
|
||||
|
||||
<div class="small-12 column">
|
||||
<hr>
|
||||
<%= f.label :valuator_ids, t("admin.budget_investments.edit.assigned_valuators") %>
|
||||
<ul>
|
||||
<%= f.collection_check_boxes :valuator_ids, @valuators, :id, :email do |b| %>
|
||||
<li><%= b.label(title: valuator_label(b.object)) { b.check_box + truncate(b.object.description_or_email, length: 60) } %></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="small-12 column">
|
||||
<hr>
|
||||
<%= f.label :tracker_ids, t("admin.budget_investments.edit.assigned_trackers") %>
|
||||
<ul>
|
||||
<%= f.collection_check_boxes :tracker_ids, @trackers, :id, :email do |b| %>
|
||||
<li><%= b.label(title: tracker_label(b.object)) { b.check_box + truncate(b.object.description_or_email, length: 60) } %></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row expanded margin-top">
|
||||
<% if @investment.incompatible? || @investment.winner? %>
|
||||
<div class="small-12 medium-3 column">
|
||||
<h2 id="incompatible"><%= t("admin.budget_investments.edit.compatibility") %></h2>
|
||||
<%= f.label :incompatible do %>
|
||||
<%= f.check_box :incompatible, title: t("admin.budget_investments.edit.compatibility"), label: false %>
|
||||
<span class="checkbox"><%= t("admin.budget_investments.edit.mark_as_incompatible") %></span>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="small-12 medium-3 column float-left">
|
||||
<h2 id="selected"><%= t("admin.budget_investments.edit.selection") %></h2>
|
||||
<%= f.label :selected do %>
|
||||
<%= f.check_box :selected, title: t("admin.budget_investments.edit.selection"), label: false %>
|
||||
<span class="checkbox"><%= t("admin.budget_investments.edit.mark_as_selected") %></span>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="small-12 column">
|
||||
<%= f.text_field :milestone_tag_list,
|
||||
value: @investment.milestone_tag_list.sort.join(", "),
|
||||
label: t("admin.budget_investments.edit.milestone_tags") %>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="small-12 column margin-top">
|
||||
<%= f.submit(class: "button", value: t("admin.budget_investments.edit.submit_button")) %>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
@@ -1,65 +1,74 @@
|
||||
<%= render "admin/shared/globalize_locales", resource: @phase %>
|
||||
<%= render "shared/globalize_locales", resource: @phase %>
|
||||
|
||||
<%= translatable_form_for [:admin, @phase.budget, @phase] do |f| %>
|
||||
|
||||
<%= render "shared/errors", resource: @phase %>
|
||||
|
||||
<div class="small-12 medium-6 column">
|
||||
<%= f.label :starts_at, t("admin.budget_phases.edit.start_date") %>
|
||||
<%= f.text_field :starts_at,
|
||||
value: format_date_for_calendar_form(@phase.starts_at),
|
||||
class: "js-calendar-full",
|
||||
id: "start_date",
|
||||
label: false %>
|
||||
</div>
|
||||
<div class="small-12 medium-6 column">
|
||||
<%= f.label :ends_at, t("admin.budget_phases.edit.end_date") %>
|
||||
<%= f.text_field :ends_at,
|
||||
value: format_date_for_calendar_form(@phase.ends_at),
|
||||
class: "js-calendar-full",
|
||||
id: "end_date",
|
||||
label: false %>
|
||||
<div class="row">
|
||||
<div class="small-12 medium-6 column">
|
||||
<%= f.label :starts_at, t("admin.budget_phases.edit.start_date") %>
|
||||
<%= f.text_field :starts_at,
|
||||
value: format_date_for_calendar_form(@phase.starts_at),
|
||||
class: "js-calendar-full",
|
||||
id: "start_date",
|
||||
label: false %>
|
||||
</div>
|
||||
<div class="small-12 medium-6 column">
|
||||
<%= f.label :ends_at, t("admin.budget_phases.edit.end_date") %>
|
||||
<%= f.text_field :ends_at,
|
||||
value: format_date_for_calendar_form(@phase.ends_at),
|
||||
class: "js-calendar-full",
|
||||
id: "end_date",
|
||||
label: false %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="small-12 column">
|
||||
<div class="row">
|
||||
<%= f.translatable_fields do |translations_form| %>
|
||||
<div class="small-12 column">
|
||||
<%= f.label :description, t("admin.budget_phases.edit.description") %>
|
||||
|
||||
<%= f.label :description, t("admin.budget_phases.edit.description") %>
|
||||
<span class="help-text" id="phase-description-help-text">
|
||||
<%= t("admin.budget_phases.edit.description_help_text") %>
|
||||
</span>
|
||||
|
||||
<span class="help-text" id="phase-description-help-text">
|
||||
<%= t("admin.budget_phases.edit.description_help_text") %>
|
||||
</span>
|
||||
|
||||
<div class="ckeditor">
|
||||
<%= translations_form.cktext_area :description,
|
||||
maxlength: Budget::Phase::DESCRIPTION_MAX_LENGTH,
|
||||
label: false %>
|
||||
<div class="ckeditor">
|
||||
<%= translations_form.cktext_area :description,
|
||||
maxlength: Budget::Phase::DESCRIPTION_MAX_LENGTH,
|
||||
label: false %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<%= f.label :summary, t("admin.budget_phases.edit.summary") %>
|
||||
<div class="small-12 column">
|
||||
<%= f.label :summary, t("admin.budget_phases.edit.summary") %>
|
||||
|
||||
<span class="help-text" id="phase-summary-help-text">
|
||||
<%= t("admin.budget_phases.edit.summary_help_text") %>
|
||||
</span>
|
||||
<span class="help-text" id="phase-summary-help-text">
|
||||
<%= t("admin.budget_phases.edit.summary_help_text") %>
|
||||
</span>
|
||||
|
||||
<div class="ckeditor">
|
||||
<%= translations_form.cktext_area :summary,
|
||||
maxlength: Budget::Phase::SUMMARY_MAX_LENGTH,
|
||||
label: false%>
|
||||
<div class="ckeditor">
|
||||
<%= translations_form.cktext_area :summary,
|
||||
maxlength: Budget::Phase::SUMMARY_MAX_LENGTH,
|
||||
label: false %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="small-12 column margin-top">
|
||||
<%= f.check_box :enabled, label: t("admin.budget_phases.edit.enabled") %>
|
||||
<div class="row">
|
||||
<div class="small-12 column margin-top">
|
||||
<%= f.check_box :enabled, label: t("admin.budget_phases.edit.enabled") %>
|
||||
|
||||
<span class="help-text" id="phase-summary-help-text">
|
||||
<%= t("admin.budget_phases.edit.enabled_help_text") %>
|
||||
</span>
|
||||
<span class="help-text" id="phase-summary-help-text">
|
||||
<%= t("admin.budget_phases.edit.enabled_help_text") %>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="small-12 medium-4 large-3 column end margin-top">
|
||||
<%= f.submit t("admin.budget_phases.edit.save_changes"), class: "button success expanded" %>
|
||||
<div class="row">
|
||||
<div class="small-12 medium-4 large-3 column end margin-top">
|
||||
<%= f.submit t("admin.budget_phases.edit.save_changes"), class: "button success expanded" %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<% end %>
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
<%= back_link_to edit_admin_budget_path(@phase.budget) %>
|
||||
|
||||
<div class="small-12 column">
|
||||
<h2><%= t("admin.budgets.edit.title") %> - <%= t("budgets.phase.#{@phase.kind}") %></h2>
|
||||
<div class="row">
|
||||
<div class="small-12 column">
|
||||
<h2><%= t("admin.budgets.edit.title") %> - <%= t("budgets.phase.#{@phase.kind}") %></h2>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<%= render "/admin/budget_phases/form" %>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<%= render "admin/shared/globalize_locales", resource: @budget %>
|
||||
<%= render "shared/globalize_locales", resource: @budget %>
|
||||
|
||||
<%= translatable_form_for [:admin, @budget] do |f| %>
|
||||
|
||||
@@ -6,16 +6,18 @@
|
||||
|
||||
<%= render "shared/errors", resource: @budget %>
|
||||
|
||||
<div class="small-12 medium-9 column">
|
||||
<div class="row">
|
||||
<%= f.translatable_fields do |translations_form| %>
|
||||
<%= translations_form.text_field :name,
|
||||
label: t("activerecord.attributes.budget.name"),
|
||||
maxlength: Budget.title_max_length,
|
||||
placeholder: t("activerecord.attributes.budget.name") %>
|
||||
<div class="small-12 medium-9 column end">
|
||||
<%= translations_form.text_field :name,
|
||||
label: t("activerecord.attributes.budget.name"),
|
||||
maxlength: Budget.title_max_length,
|
||||
placeholder: t("activerecord.attributes.budget.name") %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="margin-top">
|
||||
<div class="row margin-top">
|
||||
<div class="small-12 medium-6 column">
|
||||
<%= f.select :phase, budget_phases_select_options %>
|
||||
</div>
|
||||
@@ -58,76 +60,80 @@
|
||||
</div>
|
||||
|
||||
<% if @budget.phases.present? %>
|
||||
<div class="small-12 column">
|
||||
<table id="budget-phases-table" class="table-for-mobile">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><%= t("admin.budgets.edit.phase") %></th>
|
||||
<th><%= t("admin.budgets.edit.dates") %></th>
|
||||
<th class="text-center"><%= t("admin.budgets.edit.enabled") %></th>
|
||||
<th><%= t("admin.budgets.edit.actions") %></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<div class="row">
|
||||
<div class="small-12 column">
|
||||
<table id="budget-phases-table" class="table-for-mobile">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><%= t("admin.budgets.edit.phase") %></th>
|
||||
<th><%= t("admin.budgets.edit.dates") %></th>
|
||||
<th class="text-center"><%= t("admin.budgets.edit.enabled") %></th>
|
||||
<th><%= t("admin.budgets.edit.actions") %></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<% @budget.phases.order(:id).each do |phase| %>
|
||||
<tr id="<%= dom_id(phase) %>" class="phase">
|
||||
<td>
|
||||
<%= t("budgets.phase.#{phase.kind}") %>
|
||||
<% if @budget.current_phase == phase %>
|
||||
<span class="label success"><strong><%= t("admin.budgets.edit.active") %></strong></span>
|
||||
<% end %>
|
||||
</td>
|
||||
<td>
|
||||
<% if phase.starts_at.present? || phase.ends_at.present? %>
|
||||
<%= l(phase.starts_at.to_date) if phase.starts_at.present? %>
|
||||
-
|
||||
<%= l(phase.ends_at.to_date) if phase.ends_at.present? %>
|
||||
<% else %>
|
||||
<em><%= t("admin.budgets.edit.blank_dates") %></em>
|
||||
<% end %>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<span class="budget-phase-enabled <%= phase.enabled? ? "enabled" : "disabled" %>"></span>
|
||||
</td>
|
||||
<td>
|
||||
<%= link_to t("admin.budgets.edit.edit_phase"),
|
||||
edit_admin_budget_budget_phase_path(@budget, phase),
|
||||
method: :get, class: "button hollow expanded" %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</table>
|
||||
<% @budget.phases.order(:id).each do |phase| %>
|
||||
<tr id="<%= dom_id(phase) %>" class="phase">
|
||||
<td>
|
||||
<%= t("budgets.phase.#{phase.kind}") %>
|
||||
<% if @budget.current_phase == phase %>
|
||||
<span class="label success"><strong><%= t("admin.budgets.edit.active") %></strong></span>
|
||||
<% end %>
|
||||
</td>
|
||||
<td>
|
||||
<% if phase.starts_at.present? || phase.ends_at.present? %>
|
||||
<%= l(phase.starts_at.to_date) if phase.starts_at.present? %>
|
||||
-
|
||||
<%= l(phase.ends_at.to_date) if phase.ends_at.present? %>
|
||||
<% else %>
|
||||
<em><%= t("admin.budgets.edit.blank_dates") %></em>
|
||||
<% end %>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<span class="budget-phase-enabled <%= phase.enabled? ? "enabled" : "disabled" %>"></span>
|
||||
</td>
|
||||
<td>
|
||||
<%= link_to t("admin.budgets.edit.edit_phase"),
|
||||
edit_admin_budget_budget_phase_path(@budget, phase),
|
||||
method: :get, class: "button hollow expanded" %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div class="small-12 column">
|
||||
<%= render "admin/shared/show_results_fields", form: f %>
|
||||
</div>
|
||||
|
||||
<div class="small-12 column">
|
||||
<div class="clear small-12 medium-4 large-3 inline-block">
|
||||
<%= f.submit nil, class: "button success" %>
|
||||
<div class="row">
|
||||
<div class="small-12 column">
|
||||
<%= render "admin/shared/show_results_fields", form: f %>
|
||||
</div>
|
||||
|
||||
<div class="float-right">
|
||||
<% if display_calculate_winners_button?(@budget) %>
|
||||
<%= link_to calculate_winner_button_text(@budget),
|
||||
calculate_winners_admin_budget_path(@budget),
|
||||
method: :put,
|
||||
class: "button hollow" %>
|
||||
<% end %>
|
||||
<div class="small-12 column">
|
||||
<div class="clear small-12 medium-4 large-3 inline-block">
|
||||
<%= f.submit nil, class: "button success" %>
|
||||
</div>
|
||||
|
||||
<% if @budget.has_winning_investments? %>
|
||||
<%= link_to t("budgets.show.see_results"),
|
||||
budget_results_path(@budget),
|
||||
class: "button hollow margin-left" %>
|
||||
<% end %>
|
||||
<% if @budget.persisted? %>
|
||||
<%= link_to t("admin.budgets.edit.delete"),
|
||||
admin_budget_path(@budget),
|
||||
method: :delete,
|
||||
class: "delete float-right margin-left" %>
|
||||
<% end %>
|
||||
<div class="float-right">
|
||||
<% if display_calculate_winners_button?(@budget) %>
|
||||
<%= link_to calculate_winner_button_text(@budget),
|
||||
calculate_winners_admin_budget_path(@budget),
|
||||
method: :put,
|
||||
class: "button hollow" %>
|
||||
<% end %>
|
||||
|
||||
<% if @budget.has_winning_investments? %>
|
||||
<%= link_to t("budgets.show.see_results"),
|
||||
budget_results_path(@budget),
|
||||
class: "button hollow margin-left" %>
|
||||
<% end %>
|
||||
<% if @budget.persisted? %>
|
||||
<%= link_to t("admin.budgets.edit.delete"),
|
||||
admin_budget_path(@budget),
|
||||
method: :delete,
|
||||
class: "delete float-right margin-left" %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
<%= back_link_to admin_budgets_path %>
|
||||
|
||||
<div class="small-12 column">
|
||||
<h2><%= t("admin.budgets.edit.title") %></h2>
|
||||
<div class="row">
|
||||
<div class="small-12 column">
|
||||
<h2><%= t("admin.budgets.edit.title") %></h2>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<%= render "/admin/budgets/form" %>
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
<div class="small-12 column">
|
||||
<h2><%= t("admin.budgets.new.title") %></h2>
|
||||
</div>
|
||||
<h2><%= t("admin.budgets.new.title") %></h2>
|
||||
|
||||
<%= render "/admin/budgets/form" %>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<%= render "admin/shared/globalize_locales", resource: @draft_version %>
|
||||
<%= render "shared/globalize_locales", resource: @draft_version %>
|
||||
|
||||
<%= translatable_form_for [:admin, @process, @draft_version], url: url, html: {data: {watch_changes: true}} do |f| %>
|
||||
|
||||
@@ -15,73 +15,77 @@
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<%= f.translatable_fields do |translations_form| %>
|
||||
<div class="small-12 medium-9 column">
|
||||
<%= translations_form.text_field :title,
|
||||
placeholder: t("admin.legislation.draft_versions.form.title_placeholder") %>
|
||||
</div>
|
||||
<div class="row">
|
||||
<%= f.translatable_fields do |translations_form| %>
|
||||
<div class="small-12 medium-9 column">
|
||||
<%= translations_form.text_field :title,
|
||||
placeholder: t("admin.legislation.draft_versions.form.title_placeholder") %>
|
||||
</div>
|
||||
|
||||
<div class="small-12 medium-9 column">
|
||||
<%= translations_form.text_area :changelog,
|
||||
hint: t("admin.legislation.draft_versions.form.use_markdown"),
|
||||
rows: 5,
|
||||
placeholder: t("admin.legislation.draft_versions.form.changelog_placeholder") %>
|
||||
</div>
|
||||
<div class="small-12 medium-9 column">
|
||||
<%= translations_form.text_area :changelog,
|
||||
hint: t("admin.legislation.draft_versions.form.use_markdown"),
|
||||
rows: 5,
|
||||
placeholder: t("admin.legislation.draft_versions.form.changelog_placeholder") %>
|
||||
</div>
|
||||
|
||||
<div class="small-12 medium-4 column">
|
||||
<%= translations_form.label :body, nil, hint: t("admin.legislation.draft_versions.form.use_markdown") %>
|
||||
</div>
|
||||
<div class="small-12 medium-4 column">
|
||||
<%= translations_form.label :body, nil, hint: t("admin.legislation.draft_versions.form.use_markdown") %>
|
||||
</div>
|
||||
|
||||
<div class="markdown-editor clear">
|
||||
<div class="small-12 medium-8 column fullscreen-container">
|
||||
<div class="markdown-editor-header truncate">
|
||||
<%= t("admin.legislation.draft_versions.form.title_html",
|
||||
draft_version_title: @draft_version.title,
|
||||
process_title: @process.title ) %>
|
||||
<div class="markdown-editor clear">
|
||||
<div class="small-12 medium-8 column fullscreen-container">
|
||||
<div class="markdown-editor-header truncate">
|
||||
<%= t("admin.legislation.draft_versions.form.title_html",
|
||||
draft_version_title: @draft_version.title,
|
||||
process_title: @process.title ) %>
|
||||
</div>
|
||||
|
||||
<div class="markdown-editor-buttons">
|
||||
<%= f.submit(class: "button", value: t("admin.legislation.draft_versions.#{admin_submit_action(@draft_version)}.submit_button")) %>
|
||||
</div>
|
||||
|
||||
<%= link_to "#", class: "fullscreen-toggle" do %>
|
||||
<span data-closed-text="<%= t("admin.legislation.draft_versions.form.launch_text_editor") %>"
|
||||
data-open-text="<%= t("admin.legislation.draft_versions.form.close_text_editor") %>">
|
||||
<strong><%= t("admin.legislation.draft_versions.form.launch_text_editor") %></strong>
|
||||
</span>
|
||||
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="markdown-editor-buttons">
|
||||
<%= f.submit(class: "button", value: t("admin.legislation.draft_versions.#{admin_submit_action(@draft_version)}.submit_button")) %>
|
||||
<div class="small-12 medium-6 column markdown-area">
|
||||
<%= translations_form.text_area :body,
|
||||
label: false,
|
||||
rows: 10,
|
||||
placeholder: t("admin.legislation.draft_versions.form.body_placeholder") %>
|
||||
</div>
|
||||
|
||||
<%= link_to "#", class: "fullscreen-toggle" do %>
|
||||
<span data-closed-text="<%= t("admin.legislation.draft_versions.form.launch_text_editor")%>"
|
||||
data-open-text="<%= t("admin.legislation.draft_versions.form.close_text_editor")%>">
|
||||
<strong><%= t("admin.legislation.draft_versions.form.launch_text_editor")%></strong>
|
||||
</span>
|
||||
|
||||
<% end %>
|
||||
<div class="small-12 medium-6 column markdown-preview">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="small-12 medium-6 column markdown-area">
|
||||
<%= translations_form.text_area :body,
|
||||
label: false,
|
||||
rows: 10,
|
||||
placeholder: t("admin.legislation.draft_versions.form.body_placeholder") %>
|
||||
</div>
|
||||
|
||||
<div class="small-12 medium-6 column markdown-preview">
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div class="small-12 medium-9 column">
|
||||
<%= f.label :status %>
|
||||
<% ::Legislation::DraftVersion::VALID_STATUSES.each do |status| %>
|
||||
<%= f.radio_button :status, status, label: false %>
|
||||
<%= f.label "status_#{status}", t("admin.legislation.draft_versions.statuses.#{status}") %>
|
||||
<span class="help-text"><%= t("admin.legislation.draft_versions.form.hints.status.#{status}") %></span>
|
||||
<br>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="small-12 medium-9 column">
|
||||
<%= f.label :final_version %>
|
||||
<%= f.check_box :final_version, label: false %>
|
||||
<span class="help-text"><%= t("admin.legislation.draft_versions.form.hints.final_version") %></span>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="small-12 medium-9 column">
|
||||
<%= f.label :status %>
|
||||
<% ::Legislation::DraftVersion::VALID_STATUSES.each do |status| %>
|
||||
<%= f.radio_button :status, status, label: false %>
|
||||
<%= f.label "status_#{status}", t("admin.legislation.draft_versions.statuses.#{status}") %>
|
||||
<span class="help-text"><%= t("admin.legislation.draft_versions.form.hints.status.#{status}") %></span>
|
||||
<br>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="small-12 medium-3 column clear end margin-top">
|
||||
<%= f.submit(class: "button success expanded", value: t("admin.legislation.draft_versions.#{admin_submit_action(@draft_version)}.submit_button")) %>
|
||||
<div class="small-12 medium-9 column">
|
||||
<%= f.label :final_version %>
|
||||
<%= f.check_box :final_version, label: false %>
|
||||
<span class="help-text"><%= t("admin.legislation.draft_versions.form.hints.final_version") %></span>
|
||||
</div>
|
||||
|
||||
<div class="small-12 medium-3 column clear end margin-top">
|
||||
<%= f.submit(class: "button success expanded", value: t("admin.legislation.draft_versions.#{admin_submit_action(@draft_version)}.submit_button")) %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
@@ -11,9 +11,7 @@
|
||||
|
||||
<%= render "admin/legislation/processes/subnav", process: @process, active: "draft_versions" %>
|
||||
|
||||
<div class="small-12 column">
|
||||
<h3><%= t("admin.legislation.draft_versions.new.title") %></h3>
|
||||
</div>
|
||||
<h3><%= t("admin.legislation.draft_versions.new.title") %></h3>
|
||||
|
||||
<%= render "form", url: admin_legislation_process_draft_versions_path(@process) %>
|
||||
</div>
|
||||
|
||||
@@ -1,28 +1,34 @@
|
||||
<%= render "admin/shared/globalize_tabs",
|
||||
<%= render "shared/globalize_locales",
|
||||
resource: @process,
|
||||
display_style: lambda { |locale| enable_translation_style(@process, locale) } %>
|
||||
display_style: lambda { |locale| enable_translation_style(@process, locale) },
|
||||
manage_languages: false %>
|
||||
|
||||
<%= translatable_form_for [:admin, @process], url: url, html: {data: {watch_changes: true}} do |f| %>
|
||||
|
||||
<%= render "shared/errors", resource: @process %>
|
||||
|
||||
<div class="small-12 column margin-top">
|
||||
<%= f.check_box :homepage_enabled, label: t("admin.legislation.processes.form.homepage_enabled") %>
|
||||
<div class="row">
|
||||
<div class="small-12 column margin-top">
|
||||
<%= f.check_box :homepage_enabled, label: t("admin.legislation.processes.form.homepage_enabled") %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<%= f.translatable_fields do |translations_form| %>
|
||||
<div class="small-12 column">
|
||||
<div class="ckeditor">
|
||||
<%= translations_form.cktext_area :homepage,
|
||||
language: I18n.locale,
|
||||
label: t("admin.legislation.processes.form.homepage"),
|
||||
ckeditor: { height: 500, toolbar: "admin" },
|
||||
hint: t("admin.legislation.processes.form.homepage_description") %>
|
||||
<div class="row">
|
||||
<%= f.translatable_fields do |translations_form| %>
|
||||
<div class="small-12 column">
|
||||
<div class="ckeditor">
|
||||
<%= translations_form.cktext_area :homepage,
|
||||
language: I18n.locale,
|
||||
label: t("admin.legislation.processes.form.homepage"),
|
||||
ckeditor: { height: 500, toolbar: "admin" },
|
||||
hint: t("admin.legislation.processes.form.homepage_description") %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="small-12 medium-3 column end margin-top">
|
||||
<%= f.submit(class: "button success expanded", value: t("admin.legislation.processes.#{admin_submit_action(@process)}.submit_button")) %>
|
||||
<div class="row">
|
||||
<div class="small-12 medium-3 column end margin-top">
|
||||
<%= f.submit(class: "button success expanded", value: t("admin.legislation.processes.#{admin_submit_action(@process)}.submit_button")) %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
@@ -1,13 +1,20 @@
|
||||
<%= render "admin/shared/globalize_tabs",
|
||||
<%= render "shared/globalize_locales",
|
||||
resource: @process,
|
||||
display_style: lambda { |locale| enable_translation_style(@process, locale) } %>
|
||||
display_style: lambda { |locale| enable_translation_style(@process, locale) },
|
||||
manage_languages: false %>
|
||||
|
||||
<%= translatable_form_for [:admin, @process] do |f| %>
|
||||
<%= f.translatable_fields do |translations_form| %>
|
||||
<div class="ckeditor">
|
||||
<%= translations_form.cktext_area :milestones_summary, ckeditor: { language: I18n.locale } %>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="row">
|
||||
<%= f.translatable_fields do |translations_form| %>
|
||||
<div class="ckeditor column">
|
||||
<%= translations_form.cktext_area :milestones_summary, ckeditor: { language: I18n.locale } %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<%= f.submit class: "button success" %>
|
||||
<div class="row">
|
||||
<div class="column">
|
||||
<%= f.submit class: "button success" %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
@@ -1,256 +1,261 @@
|
||||
<%= render "admin/shared/globalize_locales", resource: @process %>
|
||||
<%= render "shared/globalize_locales", resource: @process %>
|
||||
|
||||
<%= translatable_form_for [:admin, @process], html: {data: {watch_changes: true}} do |f| %>
|
||||
|
||||
<% if @process.errors.any? %>
|
||||
|
||||
<div id="error_explanation" data-alert class="callout alert" data-closable>
|
||||
<button class="close-button" aria-label="<%= t("application.close") %>" type="button" data-close>
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<div id="error_explanation" data-alert class="callout alert" data-closable>
|
||||
<button class="close-button" aria-label="<%= t("application.close") %>" type="button" data-close>
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
|
||||
<strong>
|
||||
<%= @process.errors.count %>
|
||||
<%= t("admin.legislation.processes.errors.form.error", count: @process.errors.count) %>
|
||||
</strong>
|
||||
</div>
|
||||
<strong>
|
||||
<%= @process.errors.count %>
|
||||
<%= t("admin.legislation.processes.errors.form.error", count: @process.errors.count) %>
|
||||
</strong>
|
||||
</div>
|
||||
|
||||
<% end %>
|
||||
<div class="row">
|
||||
<div class="small-12 medium-4 column">
|
||||
<label><%= t("admin.legislation.processes.form.draft_phase") %></label>
|
||||
<p class="help-text"><%= t("admin.legislation.processes.form.draft_phase_description") %></p>
|
||||
</div>
|
||||
|
||||
<div class="small-12 medium-4 column">
|
||||
<label><%= t("admin.legislation.processes.form.draft_phase") %></label>
|
||||
<p class="help-text"><%= t("admin.legislation.processes.form.draft_phase_description") %></p>
|
||||
</div>
|
||||
<div class="small-12 medium-3 column">
|
||||
<%= f.text_field :draft_start_date,
|
||||
value: format_date_for_calendar_form(@process.draft_start_date),
|
||||
class: "js-calendar-full",
|
||||
id: "draft_start_date" %>
|
||||
</div>
|
||||
|
||||
<div class="small-12 medium-3 column">
|
||||
<%= f.text_field :draft_start_date,
|
||||
value: format_date_for_calendar_form(@process.draft_start_date),
|
||||
class: "js-calendar-full",
|
||||
id: "draft_start_date" %>
|
||||
</div>
|
||||
<div class="small-12 medium-3 column">
|
||||
<%= f.text_field :draft_end_date,
|
||||
value: format_date_for_calendar_form(@process.draft_end_date),
|
||||
class: "js-calendar-full",
|
||||
id: "draft_end_date" %>
|
||||
</div>
|
||||
<div class="small-12 medium-2 column margin-top">
|
||||
<%= f.check_box :draft_phase_enabled, checked: @process.draft_phase.enabled?, label: t("admin.legislation.processes.form.enabled") %>
|
||||
</div>
|
||||
|
||||
<div class="small-12 medium-3 column">
|
||||
<%= f.text_field :draft_end_date,
|
||||
value: format_date_for_calendar_form(@process.draft_end_date),
|
||||
class: "js-calendar-full",
|
||||
id: "draft_end_date" %>
|
||||
</div>
|
||||
<div class="small-12 medium-2 column margin-top">
|
||||
<%= f.check_box :draft_phase_enabled, checked: @process.draft_phase.enabled?, label: t("admin.legislation.processes.form.enabled") %>
|
||||
</div>
|
||||
<div class="small-12 column">
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<div class="small-12 column">
|
||||
<hr>
|
||||
</div>
|
||||
<div class="small-12 medium-4 column">
|
||||
<label><%= t("admin.legislation.processes.form.process") %></label>
|
||||
</div>
|
||||
|
||||
<div class="small-12 medium-4 column">
|
||||
<label><%= t("admin.legislation.processes.form.process") %></label>
|
||||
</div>
|
||||
<div class="small-12 medium-3 column">
|
||||
<%= f.text_field :start_date,
|
||||
value: format_date_for_calendar_form(@process.start_date),
|
||||
class: "js-calendar-full",
|
||||
id: "start_date" %>
|
||||
</div>
|
||||
|
||||
<div class="small-12 medium-3 column">
|
||||
<%= f.text_field :start_date,
|
||||
value: format_date_for_calendar_form(@process.start_date),
|
||||
class: "js-calendar-full",
|
||||
id: "start_date" %>
|
||||
</div>
|
||||
<div class="small-12 medium-3 column">
|
||||
<%= f.text_field :end_date,
|
||||
value: format_date_for_calendar_form(@process.end_date),
|
||||
class: "js-calendar-full",
|
||||
id: "end_date" %>
|
||||
</div>
|
||||
<div class="small-12 medium-2 column margin-top">
|
||||
<%= f.check_box :published, checked: @process.published?, label: t("admin.legislation.processes.form.enabled") %>
|
||||
</div>
|
||||
|
||||
<div class="small-12 medium-3 column">
|
||||
<%= f.text_field :end_date,
|
||||
value: format_date_for_calendar_form(@process.end_date),
|
||||
class: "js-calendar-full",
|
||||
id: "end_date" %>
|
||||
</div>
|
||||
<div class="small-12 medium-2 column margin-top">
|
||||
<%= f.check_box :published, checked: @process.published?, label: t("admin.legislation.processes.form.enabled") %>
|
||||
</div>
|
||||
<div class="small-12 column">
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<div class="small-12 column">
|
||||
<hr>
|
||||
</div>
|
||||
<div class="small-12 medium-4 column">
|
||||
<label><%= t("admin.legislation.processes.form.debate_phase") %></label>
|
||||
</div>
|
||||
|
||||
<div class="small-12 medium-4 column">
|
||||
<label><%= t("admin.legislation.processes.form.debate_phase") %></label>
|
||||
</div>
|
||||
<div class="small-12 medium-3 column">
|
||||
<%= f.text_field :debate_start_date,
|
||||
value: format_date_for_calendar_form(@process.debate_start_date),
|
||||
class: "js-calendar-full",
|
||||
id: "debate_start_date" %>
|
||||
</div>
|
||||
|
||||
<div class="small-12 medium-3 column">
|
||||
<%= f.text_field :debate_start_date,
|
||||
value: format_date_for_calendar_form(@process.debate_start_date),
|
||||
class: "js-calendar-full",
|
||||
id: "debate_start_date" %>
|
||||
</div>
|
||||
<div class="small-12 medium-3 column">
|
||||
<%= f.text_field :debate_end_date,
|
||||
value: format_date_for_calendar_form(@process.debate_end_date),
|
||||
class: "js-calendar-full",
|
||||
id: "debate_end_date" %>
|
||||
</div>
|
||||
<div class="small-12 medium-2 column margin-top">
|
||||
<%= f.check_box :debate_phase_enabled, checked: @process.debate_phase.enabled?, label: t("admin.legislation.processes.form.enabled") %>
|
||||
</div>
|
||||
|
||||
<div class="small-12 medium-3 column">
|
||||
<%= f.text_field :debate_end_date,
|
||||
value: format_date_for_calendar_form(@process.debate_end_date),
|
||||
class: "js-calendar-full",
|
||||
id: "debate_end_date" %>
|
||||
</div>
|
||||
<div class="small-12 medium-2 column margin-top">
|
||||
<%= f.check_box :debate_phase_enabled, checked: @process.debate_phase.enabled?, label: t("admin.legislation.processes.form.enabled") %>
|
||||
</div>
|
||||
<div class="small-12 column">
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<div class="small-12 column">
|
||||
<hr>
|
||||
</div>
|
||||
<div class="small-12 medium-4 column">
|
||||
<label><%= t("admin.legislation.processes.form.proposals_phase") %></label>
|
||||
</div>
|
||||
|
||||
<div class="small-12 medium-4 column">
|
||||
<label><%= t("admin.legislation.processes.form.proposals_phase") %></label>
|
||||
</div>
|
||||
<div class="small-12 medium-3 column">
|
||||
<%= f.text_field :proposals_phase_start_date,
|
||||
value: format_date_for_calendar_form(@process.proposals_phase_start_date),
|
||||
class: "js-calendar-full",
|
||||
id: "proposals_phase_start_date" %>
|
||||
</div>
|
||||
|
||||
<div class="small-12 medium-3 column">
|
||||
<%= f.text_field :proposals_phase_start_date,
|
||||
value: format_date_for_calendar_form(@process.proposals_phase_start_date),
|
||||
class: "js-calendar-full",
|
||||
id: "proposals_phase_start_date" %>
|
||||
</div>
|
||||
<div class="small-12 medium-3 column">
|
||||
<%= f.text_field :proposals_phase_end_date,
|
||||
value: format_date_for_calendar_form(@process.proposals_phase_end_date),
|
||||
class: "js-calendar-full",
|
||||
id: "proposals_phase_end_date" %>
|
||||
</div>
|
||||
<div class="small-12 medium-2 column margin-top">
|
||||
<%= f.check_box :proposals_phase_enabled, checked: @process.proposals_phase.enabled?, label: t("admin.legislation.processes.form.enabled") %>
|
||||
</div>
|
||||
|
||||
<div class="small-12 medium-3 column">
|
||||
<%= f.text_field :proposals_phase_end_date,
|
||||
value: format_date_for_calendar_form(@process.proposals_phase_end_date),
|
||||
class: "js-calendar-full",
|
||||
id: "proposals_phase_end_date" %>
|
||||
</div>
|
||||
<div class="small-12 medium-2 column margin-top">
|
||||
<%= f.check_box :proposals_phase_enabled, checked: @process.proposals_phase.enabled?, label: t("admin.legislation.processes.form.enabled") %>
|
||||
</div>
|
||||
<div class="small-12 column">
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<div class="small-12 column">
|
||||
<hr>
|
||||
</div>
|
||||
<div class="small-12 medium-4 column">
|
||||
<label><%= t("admin.legislation.processes.form.allegations_phase") %></label>
|
||||
</div>
|
||||
|
||||
<div class="small-12 medium-4 column">
|
||||
<label><%= t("admin.legislation.processes.form.allegations_phase") %></label>
|
||||
</div>
|
||||
<div class="small-12 medium-3 column">
|
||||
<%= f.text_field :allegations_start_date,
|
||||
value: format_date_for_calendar_form(@process.allegations_start_date),
|
||||
class: "js-calendar-full",
|
||||
id: "allegations_start_date" %>
|
||||
</div>
|
||||
|
||||
<div class="small-12 medium-3 column">
|
||||
<%= f.text_field :allegations_start_date,
|
||||
value: format_date_for_calendar_form(@process.allegations_start_date),
|
||||
class: "js-calendar-full",
|
||||
id: "allegations_start_date" %>
|
||||
</div>
|
||||
<div class="small-12 medium-3 column">
|
||||
<%= f.text_field :allegations_end_date,
|
||||
value: format_date_for_calendar_form(@process.allegations_end_date),
|
||||
class: "js-calendar-full",
|
||||
id: "allegations_end_date" %>
|
||||
</div>
|
||||
<div class="small-12 medium-2 column margin-top">
|
||||
<%= f.check_box :allegations_phase_enabled, checked: @process.allegations_phase.enabled?, label: t("admin.legislation.processes.form.enabled") %>
|
||||
</div>
|
||||
|
||||
<div class="small-12 medium-3 column">
|
||||
<%= f.text_field :allegations_end_date,
|
||||
value: format_date_for_calendar_form(@process.allegations_end_date),
|
||||
class: "js-calendar-full",
|
||||
id: "allegations_end_date" %>
|
||||
</div>
|
||||
<div class="small-12 medium-2 column margin-top">
|
||||
<%= f.check_box :allegations_phase_enabled, checked: @process.allegations_phase.enabled?, label: t("admin.legislation.processes.form.enabled") %>
|
||||
</div>
|
||||
<div class="small-12 column">
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<div class="small-12 column">
|
||||
<hr>
|
||||
</div>
|
||||
<div class="small-12 medium-3 column end">
|
||||
<%= f.text_field :draft_publication_date,
|
||||
value: format_date_for_calendar_form(@process.draft_publication_date),
|
||||
class: "js-calendar-full",
|
||||
id: "draft_publication_date" %>
|
||||
</div>
|
||||
<div class="small-12 medium-2 column margin-top">
|
||||
<%= f.check_box :draft_publication_enabled, checked: @process.draft_publication.enabled?, label: t("admin.legislation.processes.form.enabled") %>
|
||||
</div>
|
||||
|
||||
<div class="small-12 medium-3 column end">
|
||||
<%= f.text_field :draft_publication_date,
|
||||
value: format_date_for_calendar_form(@process.draft_publication_date),
|
||||
class: "js-calendar-full",
|
||||
id: "draft_publication_date" %>
|
||||
</div>
|
||||
<div class="small-12 medium-2 column margin-top">
|
||||
<%= f.check_box :draft_publication_enabled, checked: @process.draft_publication.enabled?, label: t("admin.legislation.processes.form.enabled") %>
|
||||
</div>
|
||||
<div class="small-12 column">
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<div class="small-12 column">
|
||||
<hr>
|
||||
</div>
|
||||
<div class="small-12 medium-3 column end">
|
||||
<%= f.text_field :result_publication_date,
|
||||
value: format_date_for_calendar_form(@process.result_publication_date),
|
||||
class: "js-calendar-full",
|
||||
id: "result_publication_date" %>
|
||||
</div>
|
||||
<div class="small-12 medium-2 column margin-top">
|
||||
<%= f.check_box :result_publication_enabled, checked: @process.result_publication.enabled?, label: t("admin.legislation.processes.form.enabled") %>
|
||||
</div>
|
||||
|
||||
<div class="small-12 medium-3 column end">
|
||||
<%= f.text_field :result_publication_date,
|
||||
value: format_date_for_calendar_form(@process.result_publication_date),
|
||||
class: "js-calendar-full",
|
||||
id: "result_publication_date" %>
|
||||
</div>
|
||||
<div class="small-12 medium-2 column margin-top">
|
||||
<%= f.check_box :result_publication_enabled, checked: @process.result_publication.enabled?, label: t("admin.legislation.processes.form.enabled") %>
|
||||
</div>
|
||||
<div class="small-12 column">
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<div class="small-12 column">
|
||||
<hr>
|
||||
</div>
|
||||
<div class="documents small-12 column">
|
||||
<%= render "documents/nested_documents", documentable: @process, f: f %>
|
||||
</div>
|
||||
|
||||
<div class="documents small-12 column">
|
||||
<%= render "documents/nested_documents", documentable: @process, f: f %>
|
||||
</div>
|
||||
<div class="small-12 column">
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<div class="small-12 column">
|
||||
<hr>
|
||||
</div>
|
||||
<div class="images small-12 column">
|
||||
<%= render "images/nested_image", imageable: @process, f: f %>
|
||||
</div>
|
||||
|
||||
<div class="images small-12 column">
|
||||
<%= render "images/nested_image", imageable: @process, f: f %>
|
||||
</div>
|
||||
<div class="small-12 column">
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<div class="small-12 column">
|
||||
<hr>
|
||||
</div>
|
||||
<div class="small-12 column">
|
||||
<h3><%= t("admin.legislation.processes.form.banner_title") %></h3>
|
||||
</div>
|
||||
|
||||
<div class="small-12 column">
|
||||
<h3><%= t("admin.legislation.processes.form.banner_title") %></h3>
|
||||
</div>
|
||||
|
||||
<div class="small-6 large-3 column">
|
||||
<%= f.label :background_color, nil, for: "background_color_input" %>
|
||||
<p class="help-text"><%= t("admin.shared.color_help") %></p>
|
||||
<div class="row collapse">
|
||||
<div class="small-12 medium-6 column">
|
||||
<%= f.text_field :background_color, label: false, type: :color,
|
||||
value: bg_color_or_default %>
|
||||
</div>
|
||||
<div class="small-12 medium-6 column">
|
||||
<%= f.text_field :background_color, label: false, id: "background_color_input" %>
|
||||
<div class="small-6 large-3 column">
|
||||
<%= f.label :background_color, nil, for: "background_color_input" %>
|
||||
<p class="help-text"><%= t("admin.shared.color_help") %></p>
|
||||
<div class="row collapse">
|
||||
<div class="small-12 medium-6 column">
|
||||
<%= f.text_field :background_color, label: false, type: :color,
|
||||
value: bg_color_or_default %>
|
||||
</div>
|
||||
<div class="small-12 medium-6 column">
|
||||
<%= f.text_field :background_color, label: false, id: "background_color_input" %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="small-6 large-3 column end">
|
||||
<%= f.label :font_color, nil, for: "font_color_input" %>
|
||||
<p class="help-text"><%= t("admin.shared.color_help") %></p>
|
||||
<div class="row collapse">
|
||||
<div class="small-12 medium-6 column">
|
||||
<%= f.text_field :font_color, label: false, type: :color, value: font_color_or_default %>
|
||||
</div>
|
||||
<div class="small-12 medium-6 column">
|
||||
<%= f.text_field :font_color, label: false, id: "font_color_input" %>
|
||||
<div class="small-6 large-3 column end">
|
||||
<%= f.label :font_color, nil, for: "font_color_input" %>
|
||||
<p class="help-text"><%= t("admin.shared.color_help") %></p>
|
||||
<div class="row collapse">
|
||||
<div class="small-12 medium-6 column">
|
||||
<%= f.text_field :font_color, label: false, type: :color, value: font_color_or_default %>
|
||||
</div>
|
||||
<div class="small-12 medium-6 column">
|
||||
<%= f.text_field :font_color, label: false, id: "font_color_input" %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="small-12 column">
|
||||
<hr>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="small-12 column">
|
||||
<hr>
|
||||
<div class="row">
|
||||
<%= f.translatable_fields do |translations_form| %>
|
||||
<div class="small-12 medium-9 column">
|
||||
<%= translations_form.text_field :title,
|
||||
placeholder: t("admin.legislation.processes.form.title_placeholder") %>
|
||||
</div>
|
||||
|
||||
<div class="small-12 medium-9 column">
|
||||
<%= translations_form.text_area :summary,
|
||||
rows: 2,
|
||||
placeholder: t("admin.legislation.processes.form.summary_placeholder"),
|
||||
hint: t("admin.legislation.processes.form.use_markdown") %>
|
||||
</div>
|
||||
|
||||
<div class="small-12 medium-9 column">
|
||||
<%= translations_form.text_area :description,
|
||||
rows: 5,
|
||||
placeholder: t("admin.legislation.processes.form.description_placeholder"),
|
||||
hint: t("admin.legislation.processes.form.use_markdown") %>
|
||||
</div>
|
||||
|
||||
<div class="small-12 medium-9 column end">
|
||||
<%= translations_form.text_area :additional_info,
|
||||
rows: 10,
|
||||
placeholder: t("admin.legislation.processes.form.additional_info_placeholder"),
|
||||
hint: t("admin.legislation.processes.form.use_markdown") %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<%= f.translatable_fields do |translations_form| %>
|
||||
<div class="small-12 medium-9 column">
|
||||
<%= translations_form.text_field :title,
|
||||
placeholder: t("admin.legislation.processes.form.title_placeholder") %>
|
||||
<div class="row">
|
||||
<div class="small-12 medium-3 column clear end">
|
||||
<%= f.submit(class: "button success expanded", value: t("admin.legislation.processes.#{admin_submit_action(@process)}.submit_button")) %>
|
||||
</div>
|
||||
|
||||
<div class="small-12 medium-9 column">
|
||||
<%= translations_form.text_area :summary,
|
||||
rows: 2,
|
||||
placeholder: t("admin.legislation.processes.form.summary_placeholder"),
|
||||
hint: t("admin.legislation.processes.form.use_markdown") %>
|
||||
</div>
|
||||
|
||||
<div class="small-12 medium-9 column">
|
||||
<%= translations_form.text_area :description,
|
||||
rows: 5,
|
||||
placeholder: t("admin.legislation.processes.form.description_placeholder"),
|
||||
hint: t("admin.legislation.processes.form.use_markdown") %>
|
||||
</div>
|
||||
|
||||
<div class="small-12 medium-9 column end">
|
||||
<%= translations_form.text_area :additional_info,
|
||||
rows: 10,
|
||||
placeholder: t("admin.legislation.processes.form.additional_info_placeholder"),
|
||||
hint: t("admin.legislation.processes.form.use_markdown") %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div class="small-12 medium-3 column clear end">
|
||||
<%= f.submit(class: "button success expanded", value: t("admin.legislation.processes.#{admin_submit_action(@process)}.submit_button")) %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<%= render "admin/shared/globalize_locales", resource: @question %>
|
||||
<%= render "shared/globalize_locales", resource: @question %>
|
||||
|
||||
<%= translatable_form_for [:admin, @process, @question], url: url, html: {data: {watch_changes: true}} do |f| %>
|
||||
|
||||
@@ -17,33 +17,37 @@
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<%= f.translatable_fields do |translations_form| %>
|
||||
<div class="small-12 medium-9 column end">
|
||||
<%= translations_form.text_area :title,
|
||||
rows: 5,
|
||||
placeholder: t("admin.legislation.questions.form.title_placeholder"),
|
||||
label: t("admin.legislation.questions.form.title") %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div class="small-12 medium-9 column">
|
||||
<%= f.label :question_options, t("admin.legislation.questions.form.question_options") %>
|
||||
<div class="row">
|
||||
<%= f.translatable_fields do |translations_form| %>
|
||||
<div class="small-12 medium-9 column end">
|
||||
<%= translations_form.text_area :title,
|
||||
rows: 5,
|
||||
placeholder: t("admin.legislation.questions.form.title_placeholder"),
|
||||
label: t("admin.legislation.questions.form.title") %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div id="nested_question_options">
|
||||
<%= f.fields_for :question_options do |ff| %>
|
||||
<%= render "question_option_fields", f: ff %>
|
||||
<% end %>
|
||||
<div class="row">
|
||||
<div class="small-12 medium-9 column">
|
||||
<%= f.label :question_options, t("admin.legislation.questions.form.question_options") %>
|
||||
</div>
|
||||
|
||||
<div class="js-add-fields-container">
|
||||
<div class="small-12 medium-9 column">
|
||||
<%= link_to_add_association t("admin.legislation.questions.form.add_option"),
|
||||
f, :question_options, class: "button hollow" %>
|
||||
<div id="nested_question_options">
|
||||
<%= f.fields_for :question_options do |ff| %>
|
||||
<%= render "question_option_fields", f: ff %>
|
||||
<% end %>
|
||||
|
||||
<div class="js-add-fields-container">
|
||||
<div class="small-12 medium-9 column">
|
||||
<%= link_to_add_association t("admin.legislation.questions.form.add_option"),
|
||||
f, :question_options, class: "button hollow" %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="small-12 medium-6 large-3 clear column end margin-top">
|
||||
<%= f.submit(class: "button success expanded", value: t("admin.legislation.questions.#{admin_submit_action(@question)}.submit_button")) %>
|
||||
<div class="small-12 medium-6 large-3 clear column end margin-top">
|
||||
<%= f.submit(class: "button success expanded", value: t("admin.legislation.questions.#{admin_submit_action(@question)}.submit_button")) %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
@@ -10,13 +10,15 @@
|
||||
|
||||
<%= render "admin/legislation/processes/subnav", process: @process, active: "questions" %>
|
||||
|
||||
<div class="small-12 column">
|
||||
<h3 class="inline-block"><%= t("admin.legislation.questions.edit.title", question_title: @question.title) %></h3>
|
||||
<div class="row">
|
||||
<div class="small-12 column">
|
||||
<h3 class="inline-block"><%= t("admin.legislation.questions.edit.title", question_title: @question.title) %></h3>
|
||||
|
||||
<div class="float-right">
|
||||
<%= link_to t("admin.legislation.questions.index.delete"), admin_legislation_process_question_path(@process, @question),
|
||||
method: :delete,
|
||||
class: "button hollow alert" %>
|
||||
<div class="float-right">
|
||||
<%= link_to t("admin.legislation.questions.index.delete"), admin_legislation_process_question_path(@process, @question),
|
||||
method: :delete,
|
||||
class: "button hollow alert" %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -9,9 +9,10 @@
|
||||
<h2><%= @process.title %></h2>
|
||||
|
||||
<%= render "admin/legislation/processes/subnav", process: @process, active: "questions" %>
|
||||
|
||||
<div class="small-12 column">
|
||||
<h3><%= t("admin.legislation.questions.new.title") %></h3>
|
||||
<div class="row">
|
||||
<div class="small-12 column">
|
||||
<h3><%= t("admin.legislation.questions.new.title") %></h3>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<%= render "form", url: admin_legislation_process_questions_path(@process) %>
|
||||
|
||||
@@ -1,20 +1,24 @@
|
||||
<%= render "admin/shared/globalize_locales", resource: @active_poll %>
|
||||
<%= render "shared/globalize_locales", resource: @active_poll %>
|
||||
|
||||
<%= translatable_form_for(@active_poll, url: form_url) do |f| %>
|
||||
|
||||
<%= render "shared/errors", resource: @active_poll %>
|
||||
|
||||
<%= f.translatable_fields do |translations_form| %>
|
||||
<div class="ckeditor">
|
||||
<span class="help-text"><%= t("admin.active_polls.form.description.help_text") %></span>
|
||||
<%= translations_form.cktext_area :description,
|
||||
maxlength: ActivePoll.description_max_length,
|
||||
label: t("admin.active_polls.form.description.text") %>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="row">
|
||||
<%= f.translatable_fields do |translations_form| %>
|
||||
<div class="ckeditor column">
|
||||
<span class="help-text"><%= t("admin.active_polls.form.description.help_text") %></span>
|
||||
<%= translations_form.cktext_area :description,
|
||||
maxlength: ActivePoll.description_max_length,
|
||||
label: t("admin.active_polls.form.description.text") %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="small-12 medium-4 large-2 margin-top">
|
||||
<%= f.submit(class: "button success", value: t("shared.save")) %>
|
||||
<div class="row">
|
||||
<div class="small-12 medium-4 large-2 margin-top column">
|
||||
<%= f.submit(class: "button success", value: t("shared.save")) %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<% end %>
|
||||
|
||||
@@ -1,44 +1,49 @@
|
||||
<%= render "admin/shared/globalize_locales", resource: @poll %>
|
||||
<%= render "shared/globalize_locales", resource: @poll %>
|
||||
|
||||
<%= translatable_form_for [:admin, @poll] do |f| %>
|
||||
<%= render "shared/errors", resource: @poll %>
|
||||
|
||||
<div class="clear">
|
||||
<div class="small-12 medium-6 column">
|
||||
<%= f.text_field :starts_at,
|
||||
value: @poll.starts_at.present? ? l(@poll.starts_at.to_date) : nil,
|
||||
class: "js-calendar-full" %>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="clear">
|
||||
<div class="small-12 medium-6 column">
|
||||
<%= f.text_field :starts_at,
|
||||
value: @poll.starts_at.present? ? l(@poll.starts_at.to_date) : nil,
|
||||
class: "js-calendar-full" %>
|
||||
</div>
|
||||
|
||||
<div class="small-12 medium-6 column">
|
||||
<%= f.text_field :ends_at,
|
||||
value: @poll.ends_at.present? ? l(@poll.ends_at.to_date) : nil,
|
||||
class: "js-calendar-full" %>
|
||||
<div class="small-12 medium-6 column">
|
||||
<%= f.text_field :ends_at,
|
||||
value: @poll.ends_at.present? ? l(@poll.ends_at.to_date) : nil,
|
||||
class: "js-calendar-full" %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<%= f.translatable_fields do |translations_form| %>
|
||||
<div class="small-12 medium-6 column">
|
||||
<%= translations_form.text_field :name %>
|
||||
</div>
|
||||
|
||||
<%= f.translatable_fields do |translations_form| %>
|
||||
<div class="small-12 medium-6 column">
|
||||
<%= translations_form.text_field :name %>
|
||||
</div>
|
||||
<div class="small-12 column">
|
||||
<%= translations_form.text_area :summary, rows: 4 %>
|
||||
</div>
|
||||
|
||||
<div class="small-12 column">
|
||||
<%= translations_form.text_area :summary, rows: 4 %>
|
||||
</div>
|
||||
|
||||
<div class="small-12 column">
|
||||
<%= translations_form.text_area :description, rows: 8 %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div class="small-12 column">
|
||||
<%= render "images/admin_image", imageable: @poll, f: f %>
|
||||
<div class="small-12 column">
|
||||
<%= translations_form.text_area :description, rows: 8 %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="clear">
|
||||
<div class="small-6 medium-6 column">
|
||||
<%= f.check_box :geozone_restricted, data: { checkbox_toggle: "#geozones" } %>
|
||||
<div class="row">
|
||||
<div class="small-12 column">
|
||||
<%= render "images/admin_image", imageable: @poll, f: f %>
|
||||
</div>
|
||||
|
||||
<div class="clear">
|
||||
<div class="small-6 medium-6 column">
|
||||
<%= f.check_box :geozone_restricted, data: { checkbox_toggle: "#geozones" } %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -54,10 +59,13 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="clear">
|
||||
<div class="small-12 medium-4 large-2 column">
|
||||
<%= f.submit t("admin.polls.#{admin_submit_action(@poll)}.submit_button"),
|
||||
class: "button success expanded margin-top" %>
|
||||
<div class="row">
|
||||
<div class="clear">
|
||||
<div class="small-12 medium-4 large-2 column">
|
||||
<%= f.submit t("admin.polls.#{admin_submit_action(@poll)}.submit_button"),
|
||||
class: "button success expanded margin-top" %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<% end %>
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
<div class="small-12 column">
|
||||
<%= back_link_to %>
|
||||
<div class="row">
|
||||
<div class="small-12 column">
|
||||
<%= back_link_to %>
|
||||
|
||||
<h2><%= t("admin.polls.new.title") %></h2>
|
||||
<h2><%= t("admin.polls.new.title") %></h2>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="polls-form">
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<%= render "admin/shared/globalize_locales", resource: @question %>
|
||||
<%= render "shared/globalize_locales", resource: @question %>
|
||||
|
||||
<%= translatable_form_for(@question, url: form_url) do |f| %>
|
||||
|
||||
@@ -6,25 +6,33 @@
|
||||
|
||||
<%= f.hidden_field :proposal_id %>
|
||||
|
||||
<div class="small-12">
|
||||
<% if @poll.present? %>
|
||||
<%= f.hidden_field :poll_id, value: @poll.id %>
|
||||
<% elsif @question.poll.present? %>
|
||||
<%= f.hidden_field :poll_id, value: @question.poll.id %>
|
||||
<% else %>
|
||||
<div class="small-12 medium-6 large-4">
|
||||
<% select_options = Poll.all.map { |p| [p.name, p.id] } %>
|
||||
<%= f.select :poll_id,
|
||||
options_for_select(select_options),
|
||||
prompt: t("admin.questions.index.select_poll"),
|
||||
label: t("admin.questions.new.poll_label") %>
|
||||
<div class="row">
|
||||
<div class="small-12">
|
||||
<% if @poll.present? %>
|
||||
<%= f.hidden_field :poll_id, value: @poll.id %>
|
||||
<% elsif @question.poll.present? %>
|
||||
<%= f.hidden_field :poll_id, value: @question.poll.id %>
|
||||
<% else %>
|
||||
<div class="small-12 medium-6 large-4 column">
|
||||
<% select_options = Poll.all.map { |p| [p.name, p.id] } %>
|
||||
<%= f.select :poll_id,
|
||||
options_for_select(select_options),
|
||||
prompt: t("admin.questions.index.select_poll"),
|
||||
label: t("admin.questions.new.poll_label") %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<%= f.translatable_fields do |translations_form| %>
|
||||
<div class="column">
|
||||
<%= translations_form.text_field :title %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<%= f.translatable_fields do |translations_form| %>
|
||||
<%= translations_form.text_field :title %>
|
||||
<% end %>
|
||||
|
||||
<div class="row">
|
||||
<% if !@question.persisted? %>
|
||||
<%= fields_for :votation_type do |votation_f| %>
|
||||
<div class="small-12 medium-6">
|
||||
@@ -56,8 +64,10 @@
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="small-12 medium-4 large-2 margin-top">
|
||||
<div class="row">
|
||||
<div class="small-12 medium-4 large-2 margin-top column">
|
||||
<%= f.submit(class: "button success expanded", value: t("shared.save")) %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<%= render "admin/shared/globalize_locales", resource: @answer %>
|
||||
<%= render "shared/globalize_locales", resource: @answer %>
|
||||
|
||||
<%= translatable_form_for(@answer, url: form_url) do |f| %>
|
||||
|
||||
@@ -9,16 +9,21 @@
|
||||
|
||||
<%= f.hidden_field :question_id, value: @answer.question_id || @question.id %>
|
||||
|
||||
<%= f.translatable_fields do |translations_form| %>
|
||||
<%= translations_form.text_field :title %>
|
||||
<div class="row">
|
||||
<%= f.translatable_fields do |translations_form| %>
|
||||
<div class="column end">
|
||||
<%= translations_form.text_field :title %>
|
||||
</div>
|
||||
<div class="ckeditor column">
|
||||
<%= translations_form.cktext_area :description, maxlength: Poll::Question.description_max_length %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="ckeditor">
|
||||
<%= translations_form.cktext_area :description, maxlength: Poll::Question.description_max_length %>
|
||||
<div class="row">
|
||||
<div class="small-12 medium-4 large-2 margin-top column">
|
||||
<%= f.submit(class: "button success expanded", value: t("shared.save")) %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div class="small-12 medium-4 large-2 margin-top">
|
||||
<%= f.submit(class: "button success expanded", value: t("shared.save")) %>
|
||||
</div>
|
||||
|
||||
<% end %>
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
<div id="globalize_locales">
|
||||
<% I18n.available_locales.each do |locale| %>
|
||||
<div class="text-right">
|
||||
<%= link_to t("admin.translations.remove_language"), "#",
|
||||
id: "js_delete_#{locale}",
|
||||
style: display_translation_style(resource, locale),
|
||||
class: "delete js-delete-language",
|
||||
data: { locale: locale } %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<%= render "admin/shared/globalize_tabs", resource: resource, display_style: display_style %>
|
||||
|
||||
<div class="small-12 medium-6">
|
||||
<%= select_tag :translation_locale,
|
||||
options_for_locale_select,
|
||||
prompt: t("admin.translations.add_language"),
|
||||
class: "js-globalize-locale" %>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,3 +0,0 @@
|
||||
<%= render "admin/shared/common_globalize_locales",
|
||||
resource: resource,
|
||||
display_style: lambda { |locale| enable_translation_style(resource, locale) } %>
|
||||
@@ -1,11 +0,0 @@
|
||||
<ul class="tabs" data-tabs>
|
||||
<% I18n.available_locales.each do |locale| %>
|
||||
<li class="tabs-title">
|
||||
<%= link_to name_for_locale(locale), "#",
|
||||
style: display_style.call(locale),
|
||||
class: "js-globalize-locale-link #{highlight_class(resource, locale)}",
|
||||
data: { locale: locale },
|
||||
remote: true %>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
@@ -1,3 +1,4 @@
|
||||
<%= render "admin/shared/common_globalize_locales",
|
||||
<%= render "shared/common_globalize_locales",
|
||||
resource: nil,
|
||||
display_style: lambda { |locale| site_customization_display_translation_style(locale) } %>
|
||||
display_style: lambda { |locale| site_customization_display_translation_style(locale) },
|
||||
manage_languages: defined?(manage_languages) ? manage_languages : true %>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<%= render "admin/shared/globalize_locales", resource: @page %>
|
||||
<%= render "shared/globalize_locales", resource: @page %>
|
||||
|
||||
<%= translatable_form_for [:admin, @page], html: {class: "edit_page", data: {watch_changes: true}} do |f| %>
|
||||
<% if @page.errors.any? %>
|
||||
@@ -13,41 +13,51 @@
|
||||
</strong>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="row">
|
||||
<div class="small-12 column">
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<div class="small-12 column">
|
||||
<hr>
|
||||
<div class="small-12 medium-4 column">
|
||||
<h3><%= t("admin.site_customization.pages.form.options") %></h3>
|
||||
<%= f.label :status %>
|
||||
<% ::SiteCustomization::Page::VALID_STATUSES.each do |status| %>
|
||||
<%= f.radio_button :status, status, label: false %>
|
||||
<%= f.label "status_#{status}", t("admin.site_customization.pages.page.status_#{status}") %>
|
||||
<br>
|
||||
<% end %>
|
||||
|
||||
<%= f.check_box :more_info_flag, class: "small" %>
|
||||
<%= f.check_box :print_content_flag %>
|
||||
</div>
|
||||
|
||||
<div class="small-12 medium-6 column">
|
||||
<%= f.label :slug %>
|
||||
<p class="help-text"><%= t("admin.site_customization.pages.new.slug_help_html") %>
|
||||
<%= f.text_field :slug, label: false, size: 80, maxlength: 80 %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="small-12 medium-4 column">
|
||||
<h3><%= t("admin.site_customization.pages.form.options") %></h3>
|
||||
<%= f.label :status %>
|
||||
<% ::SiteCustomization::Page::VALID_STATUSES.each do |status| %>
|
||||
<%= f.radio_button :status, status, label: false %>
|
||||
<%= f.label "status_#{status}", t("admin.site_customization.pages.page.status_#{status}") %>
|
||||
<br>
|
||||
<% end %>
|
||||
|
||||
<%= f.check_box :more_info_flag, class: "small" %>
|
||||
<%= f.check_box :print_content_flag %>
|
||||
<div class="row">
|
||||
<div class="small-12 column">
|
||||
<hr>
|
||||
<%= f.translatable_fields do |translations_form| %>
|
||||
<div class="small-12 column end">
|
||||
<%= translations_form.text_field :title %>
|
||||
</div>
|
||||
<div class="small-12 column">
|
||||
<%= translations_form.text_field :subtitle %>
|
||||
</div>
|
||||
<div class="ckeditor column">
|
||||
<%= translations_form.cktext_area :content,
|
||||
ckeditor: { language: I18n.locale, toolbar: "admin" } %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="small-12 medium-6 column">
|
||||
<%= f.label :slug %>
|
||||
<p class="help-text"><%= t("admin.site_customization.pages.new.slug_help_html") %>
|
||||
<%= f.text_field :slug, label: false, size: 80, maxlength: 80 %>
|
||||
</div>
|
||||
<div class="small-12 column">
|
||||
<hr>
|
||||
<%= f.translatable_fields do |translations_form| %>
|
||||
<%= translations_form.text_field :title %>
|
||||
<%= translations_form.text_field :subtitle %>
|
||||
<div class="ckeditor">
|
||||
<%= translations_form.cktext_area :content,
|
||||
ckeditor: { language: I18n.locale, toolbar: "admin" } %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div class="small-12 medium-6 large-3 margin-top">
|
||||
<div class="row">
|
||||
<div class="small-12 medium-6 large-3 margin-top column">
|
||||
<%= f.submit class: "button success expanded" %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -3,11 +3,12 @@
|
||||
<% end %>
|
||||
|
||||
<%= back_link_to admin_site_customization_pages_path %>
|
||||
<div class="row">
|
||||
<div class="small-12 column">
|
||||
<h2 class="inline-block"><%= t("admin.site_customization.pages.edit.title", page_title: @page.title) %></h2>
|
||||
|
||||
<div class="small-12 column">
|
||||
<h2 class="inline-block"><%= t("admin.site_customization.pages.edit.title", page_title: @page.title) %></h2>
|
||||
|
||||
<%= link_to t("admin.site_customization.pages.index.delete"), admin_site_customization_page_path(@page), method: :delete, class: "delete float-right" %>
|
||||
<%= link_to t("admin.site_customization.pages.index.delete"), admin_site_customization_page_path(@page), method: :delete, class: "delete float-right" %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<%= render "form" %>
|
||||
|
||||
@@ -3,9 +3,10 @@
|
||||
<% end %>
|
||||
|
||||
<%= back_link_to admin_site_customization_pages_path %>
|
||||
|
||||
<div class="small-12 column">
|
||||
<h2><%= t("admin.site_customization.pages.new.title") %></h2>
|
||||
<div class="row">
|
||||
<div class="small-12 column">
|
||||
<h2><%= t("admin.site_customization.pages.new.title") %></h2>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<%= render "form" %>
|
||||
|
||||
@@ -1,41 +1,55 @@
|
||||
<%= render "admin/shared/globalize_locales", resource: @card %>
|
||||
<%= render "shared/globalize_locales", resource: @card %>
|
||||
|
||||
<%= translatable_form_for [:admin, @card] do |f| %>
|
||||
|
||||
<%= f.translatable_fields do |translations_form| %>
|
||||
<div class="small-12 medium-6">
|
||||
<%= translations_form.text_field :label %>
|
||||
</div>
|
||||
<div class="row">
|
||||
<%= f.translatable_fields do |translations_form| %>
|
||||
<div class="small-12 medium-6 column end">
|
||||
<%= translations_form.text_field :label %>
|
||||
</div>
|
||||
|
||||
<%= translations_form.text_field :title %>
|
||||
<div class="column">
|
||||
<%= translations_form.text_field :title %>
|
||||
</div>
|
||||
|
||||
<%= translations_form.text_area :description, rows: 5 %>
|
||||
<div class="column">
|
||||
<%= translations_form.text_area :description, rows: 5 %>
|
||||
</div>
|
||||
|
||||
<div class="small-12 medium-6">
|
||||
<%= translations_form.text_field :link_text %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div class="small-12 medium-6">
|
||||
<%= f.text_field :link_url %>
|
||||
<div class="small-12 medium-6 column end">
|
||||
<%= translations_form.text_field :link_text %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<% unless @card.header? %>
|
||||
<%= f.label :columns %>
|
||||
<p class="help-text"><%= t("admin.site_customization.pages.cards.columns_help") %></p>
|
||||
<div class="small-12 medium-4 large-2">
|
||||
<%= f.select :columns, (1..12), label: false %>
|
||||
<div class="row">
|
||||
<div class="small-12 medium-6 column">
|
||||
<%= f.text_field :link_url %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<% unless @card.header? %>
|
||||
<div class="column">
|
||||
<%= f.label :columns %>
|
||||
<p class="help-text"><%= t("admin.site_customization.pages.cards.columns_help") %></p>
|
||||
<div class="small-12 medium-4 large-2">
|
||||
<%= f.select :columns, (1..12), label: false %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<%= f.hidden_field :header, value: @card.header? %>
|
||||
<%= f.hidden_field :site_customization_page_id, value: @card.site_customization_page_id %>
|
||||
|
||||
<div class="image-form">
|
||||
<div class="image small-12 column">
|
||||
<%= render "images/nested_image", imageable: @card, f: f %>
|
||||
<div class="row">
|
||||
<div class="image-form">
|
||||
<div class="image small-12 column">
|
||||
<%= render "images/nested_image", imageable: @card, f: f %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="column">
|
||||
<%= f.submit(t("admin.homepage.#{action_name}.#{@card.header? ? "submit_header" : "submit_card"}"), class: "button success") %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<%= f.submit(t("admin.homepage.#{action_name}.#{@card.header? ? "submit_header" : "submit_card"}"), class: "button success") %>
|
||||
<% end %>
|
||||
|
||||
@@ -1,13 +1,16 @@
|
||||
<%= render "admin/shared/globalize_locales", resource: @investment %>
|
||||
|
||||
<%= translatable_form_for(@investment, url: form_url, method: :post, html: { multipart: true }) do |f| %>
|
||||
|
||||
<%= render "shared/errors", resource: @investment %>
|
||||
|
||||
<div class="row">
|
||||
<div class="row column">
|
||||
<div class="small-12 medium-8 column">
|
||||
<%= f.select :heading_id, budget_heading_select_options(@budget), {include_blank: true, } %>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="small-12 column">
|
||||
<%= render "shared/globalize_locales", resource: @investment %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<%= f.translatable_fields do |translations_form| %>
|
||||
<div class="small-12 column">
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
<%= render "admin/shared/globalize_locales", resource: @debate %>
|
||||
<%= render "shared/globalize_locales", resource: @debate %>
|
||||
|
||||
<%= translatable_form_for(@debate) do |f| %>
|
||||
|
||||
<%= render "shared/errors", resource: @debate %>
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="row column">
|
||||
<%= f.translatable_fields do |translations_form| %>
|
||||
<div class="small-12 column">
|
||||
<%= translations_form.text_field :title,
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<%= render "admin/shared/globalize_locales", resource: @proposal %>
|
||||
<%= render "shared/globalize_locales", resource: @proposal %>
|
||||
|
||||
<%= translatable_form_for(@proposal, url: form_url) do |f| %>
|
||||
|
||||
<%= render "shared/errors", resource: @proposal %>
|
||||
|
||||
<div class="row">
|
||||
<div class="row column">
|
||||
<%= f.translatable_fields do |translations_form| %>
|
||||
<div class="small-12 column">
|
||||
<%= translations_form.text_field :title,
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<%= t("proposals.retire_form.warning") %>
|
||||
</div>
|
||||
|
||||
<%= render "admin/shared/globalize_locales", resource: @proposal %>
|
||||
<%= render "shared/globalize_locales", resource: @proposal, manage_languages: false %>
|
||||
|
||||
<%= translatable_form_for(@proposal, url: retire_proposal_path(@proposal)) do |f| %>
|
||||
<%= render "shared/errors", resource: @proposal %>
|
||||
|
||||
32
app/views/shared/_common_globalize_locales.html.erb
Normal file
32
app/views/shared/_common_globalize_locales.html.erb
Normal file
@@ -0,0 +1,32 @@
|
||||
<div class="row globalize-languages column padding-top <%= highlight_translation_html_class %>"
|
||||
data-zero-languages-description="<%= t("shared.translations.languages_in_use_html", count: 0) %>"
|
||||
data-one-languages-description="<%= t("shared.translations.languages_in_use_html", count: 1) %>"
|
||||
data-other-languages-description="<%= t("shared.translations.languages_in_use_html", count: 2) %>">
|
||||
<div class="small-6 large-3 column">
|
||||
<span class="small">
|
||||
<strong class="js-languages-description"><%= selected_languages_description(resource) %></strong>
|
||||
</span>
|
||||
<%= select_tag :select_language,
|
||||
options_for_select_language(resource),
|
||||
prompt: t("shared.translations.select_language_prompt"),
|
||||
class: "js-select-language" %>
|
||||
<div class="margin-bottom">
|
||||
<% if manage_languages %>
|
||||
<% I18n.available_locales.each do |locale| %>
|
||||
<%= link_to t("shared.translations.remove_language"), "#",
|
||||
style: display_destroy_locale_style(resource, locale),
|
||||
class: "delete js-delete-language js-delete-#{locale}",
|
||||
data: { locale: locale } %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="small-6 large-3 column margin-top end">
|
||||
<% if manage_languages %>
|
||||
<%= select_tag :add_language,
|
||||
options_for_add_language,
|
||||
prompt: t("shared.translations.add_language"),
|
||||
class: "js-add-language" %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
6
app/views/shared/_globalize_locales.html.erb
Normal file
6
app/views/shared/_globalize_locales.html.erb
Normal file
@@ -0,0 +1,6 @@
|
||||
<% if translations_interface_enabled? %>
|
||||
<%= render "shared/common_globalize_locales",
|
||||
resource: resource,
|
||||
display_style: lambda { |locale| enable_translation_style(resource, locale) },
|
||||
manage_languages: defined?(manage_languages) ? manage_languages : true %>
|
||||
<% end %>
|
||||
@@ -1,36 +1,45 @@
|
||||
<%= render "admin/shared/globalize_locales", resource: @milestone %>
|
||||
<%= render "shared/globalize_locales", resource: @milestone %>
|
||||
|
||||
<%= translatable_form_for [:tracking, *resource_hierarchy_for(@milestone)] do |f| %>
|
||||
|
||||
<div class="small-12 medium-6 margin-bottom">
|
||||
<%= f.select :status_id,
|
||||
@statuses.collect { |s| [s.name, s.id] },
|
||||
{ include_blank: @statuses.any? ? "" : t("tracking.milestones.form.no_statuses_defined") },
|
||||
{ disabled: @statuses.blank? } %>
|
||||
<%= link_to t("tracking.milestones.form.admin_statuses"),
|
||||
admin_milestone_statuses_path %>
|
||||
<div class="row">
|
||||
<div class="small-12 medium-6 margin-bottom column">
|
||||
<%= f.select :status_id,
|
||||
@statuses.collect { |s| [s.name, s.id] },
|
||||
{ include_blank: @statuses.any? ? "" : t("tracking.milestones.form.no_statuses_defined") },
|
||||
{ disabled: @statuses.blank? } %>
|
||||
<%= link_to t("tracking.milestones.form.admin_statuses"),
|
||||
admin_milestone_statuses_path %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<%= f.translatable_fields do |translations_form| %>
|
||||
<%= translations_form.hidden_field :title, value: l(Time.current, format: :datetime),
|
||||
maxlength: Milestone.title_max_length %>
|
||||
|
||||
<%= translations_form.text_area :description,
|
||||
rows: 5,
|
||||
label: t("tracking.milestones.new.description") %>
|
||||
<% end %>
|
||||
|
||||
<%= f.label :publication_date, t("tracking.milestones.new.date") %>
|
||||
<%= f.text_field :publication_date,
|
||||
value: @milestone.publication_date.present? ? l(@milestone.publication_date.to_date) : nil,
|
||||
label: false,
|
||||
class: "js-calendar-full" %>
|
||||
|
||||
<%= render "images/admin_image", imageable: @milestone, f: f %>
|
||||
|
||||
<div class="documents">
|
||||
<%= render "documents/nested_documents", documentable: @milestone, f: f %>
|
||||
<div class="row">
|
||||
<%= f.translatable_fields do |translations_form| %>
|
||||
<div class="column">
|
||||
<%= translations_form.hidden_field :title, value: l(Time.current, format: :datetime),
|
||||
maxlength: Milestone.title_max_length %>
|
||||
<%= translations_form.text_area :description,
|
||||
rows: 5,
|
||||
label: t("tracking.milestones.new.description") %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<%= f.submit nil, class: "button success" %>
|
||||
<div class="row">
|
||||
<div class="column">
|
||||
<%= f.label :publication_date, t("tracking.milestones.new.date") %>
|
||||
<%= f.text_field :publication_date,
|
||||
value: @milestone.publication_date.present? ? l(@milestone.publication_date.to_date) : nil,
|
||||
label: false,
|
||||
class: "js-calendar-full" %>
|
||||
|
||||
<%= render "images/admin_image", imageable: @milestone, f: f %>
|
||||
|
||||
<div class="documents">
|
||||
<%= render "documents/nested_documents", documentable: @milestone, f: f %>
|
||||
</div>
|
||||
|
||||
<%= f.submit nil, class: "button success" %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
@@ -1,31 +1,40 @@
|
||||
<%= render "admin/shared/globalize_locales", resource: @progress_bar %>
|
||||
<%= render "shared/globalize_locales", resource: @progress_bar %>
|
||||
|
||||
<%= translatable_form_for [:tracking, *resource_hierarchy_for(@progress_bar)] do |f| %>
|
||||
|
||||
<div class="small-12 medium-6">
|
||||
<%= f.enum_select :kind %>
|
||||
<div class="row">
|
||||
<div class="small-12 medium-6 column">
|
||||
<%= f.enum_select :kind %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<%= f.translatable_fields do |translations_form| %>
|
||||
<div class="small-12 medium-6">
|
||||
<%= translations_form.text_field :title %>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="row">
|
||||
<%= f.translatable_fields do |translations_form| %>
|
||||
<div class="small-12 medium-6 column end">
|
||||
<%= translations_form.text_field :title %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<% progress_options = { min: ProgressBar::RANGE.min, max: ProgressBar::RANGE.max, step: 1 } %>
|
||||
<div class="small-12 medium-6 large-2">
|
||||
<%= f.text_field :percentage, { type: :range,
|
||||
id: "percentage_range",
|
||||
class: "column" }.merge(progress_options) %>
|
||||
</div>
|
||||
<div class="small-12 medium-6 large-2">
|
||||
<div class="input-group">
|
||||
<%= f.text_field :percentage, { type: :number,
|
||||
label: false,
|
||||
class: "input-group-field" }.merge(progress_options) %>
|
||||
<span class="input-group-label">%</span>
|
||||
<div class="row">
|
||||
<div class="small-12 medium-6 large-2 column">
|
||||
<%= f.text_field :percentage, { type: :range,
|
||||
id: "percentage_range",
|
||||
class: "column" }.merge(progress_options) %>
|
||||
</div>
|
||||
|
||||
<div class="small-12 medium-6 large-2 column">
|
||||
<div class="input-group">
|
||||
<%= f.text_field :percentage, { type: :number,
|
||||
label: false,
|
||||
class: "input-group-field" }.merge(progress_options) %>
|
||||
<span class="input-group-label">%</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="column">
|
||||
<%= f.submit nil, class: "button success" %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<%= f.submit nil, class: "button success" %>
|
||||
<% end %>
|
||||
|
||||
@@ -1630,9 +1630,6 @@ en:
|
||||
submit_header: Save header
|
||||
card_title: Edit card
|
||||
submit_card: Save card
|
||||
translations:
|
||||
remove_language: Remove language
|
||||
add_language: Add language
|
||||
change_log:
|
||||
title: "Change Log"
|
||||
id: "ID"
|
||||
|
||||
@@ -825,6 +825,14 @@ en:
|
||||
legislation_process: "Download legislation processes"
|
||||
budget: "Download budgets"
|
||||
investments: "Download projects"
|
||||
translations:
|
||||
select_language_prompt: Choose language
|
||||
remove_language: Remove language
|
||||
add_language: Add language
|
||||
languages_in_use_html:
|
||||
zero: "<span class='js-languages-count'>0</span> languages in use"
|
||||
one: "<span class='js-languages-count'>1</span> language in use"
|
||||
other: "<span class='js-languages-count'>%{count}</span> languages in use"
|
||||
social:
|
||||
facebook: "%{org} Facebook"
|
||||
twitter: "%{org} Twitter"
|
||||
|
||||
@@ -1628,9 +1628,6 @@ es:
|
||||
submit_header: Guardar encabezado
|
||||
card_title: Editar tarjeta
|
||||
submit_card: Guardar tarjeta
|
||||
translations:
|
||||
remove_language: Eliminar idioma
|
||||
add_language: Añadir idioma
|
||||
change_log:
|
||||
title: "Historial"
|
||||
id: "ID"
|
||||
|
||||
@@ -822,6 +822,14 @@ es:
|
||||
legislation_process: "Descargar procesos legislativos"
|
||||
budget: "Descargar presupuestos"
|
||||
investments: "Descargar proyectos"
|
||||
translations:
|
||||
select_language_prompt: Seleccionar idioma
|
||||
remove_language: Eliminar idioma
|
||||
add_language: Añadir idioma
|
||||
languages_in_use_html:
|
||||
zero: "<span class='js-languages-count'>0</span> idiomas en uso"
|
||||
one: "<span class='js-languages-count'>1</span> idioma en uso"
|
||||
other: "<span class='js-languages-count'>%{count}</span> idiomas en uso"
|
||||
social:
|
||||
facebook: "Facebook de %{org}"
|
||||
twitter: "Twitter de %{org}"
|
||||
|
||||
@@ -113,10 +113,10 @@ describe "Admin banners magement" do
|
||||
scenario "Publish a banner with a translation different than the current locale", :js do
|
||||
visit new_admin_banner_path
|
||||
|
||||
expect(page).to have_link "English"
|
||||
expect_to_have_language_selected "English"
|
||||
|
||||
click_link "Remove language"
|
||||
select "Français", from: "translation_locale"
|
||||
select "Français", from: "add_language"
|
||||
|
||||
fill_in "Title", with: "En Français"
|
||||
fill_in "Description", with: "Link en Français"
|
||||
@@ -132,8 +132,7 @@ describe "Admin banners magement" do
|
||||
click_button "Save changes"
|
||||
click_link "Edit banner"
|
||||
|
||||
expect(page).to have_link "Français"
|
||||
expect(page).not_to have_link "English"
|
||||
expect_to_have_language_selected "Français"
|
||||
expect(page).to have_field "Title", with: "En Français"
|
||||
end
|
||||
|
||||
|
||||
@@ -188,7 +188,7 @@ describe "Admin budget groups" do
|
||||
|
||||
visit edit_admin_budget_group_path(budget, group)
|
||||
|
||||
select "Español", from: "translation_locale"
|
||||
select "Español", from: :add_language
|
||||
fill_in "Group name", with: "Spanish name"
|
||||
click_button "Save group"
|
||||
|
||||
@@ -197,7 +197,7 @@ describe "Admin budget groups" do
|
||||
|
||||
visit edit_admin_budget_group_path(budget, group)
|
||||
|
||||
click_link "English"
|
||||
select "English", from: :select_language
|
||||
fill_in "Group name", with: "New English Name"
|
||||
click_button "Save group"
|
||||
|
||||
|
||||
@@ -212,7 +212,7 @@ describe "Admin budget headings" do
|
||||
|
||||
visit edit_admin_budget_group_heading_path(budget, group, heading)
|
||||
|
||||
select "Español", from: "translation_locale"
|
||||
select "Español", from: :add_language
|
||||
fill_in "Heading name", with: "Spanish name"
|
||||
click_button "Save heading"
|
||||
|
||||
@@ -221,7 +221,7 @@ describe "Admin budget headings" do
|
||||
|
||||
visit edit_admin_budget_group_heading_path(budget, group, heading)
|
||||
|
||||
click_link "English"
|
||||
select "English", from: :select_language
|
||||
fill_in "Heading name", with: "New English Name"
|
||||
click_button "Save heading"
|
||||
|
||||
|
||||
@@ -227,7 +227,7 @@ describe "Admin budgets" do
|
||||
|
||||
visit edit_admin_budget_path(budget)
|
||||
|
||||
select "Español", from: "translation_locale"
|
||||
select "Español", from: :add_language
|
||||
fill_in "Name", with: "Spanish name"
|
||||
click_button "Update Budget"
|
||||
|
||||
@@ -236,7 +236,7 @@ describe "Admin budgets" do
|
||||
|
||||
visit edit_admin_budget_path(budget)
|
||||
|
||||
click_link "English"
|
||||
select "English", from: :select_language
|
||||
fill_in "Name", with: "New English Name"
|
||||
click_button "Update Budget"
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ describe "Admin legislation draft versions" do
|
||||
fill_in "Changes", with: "Version 3 changes"
|
||||
fill_in "Text", with: "Version 3 body"
|
||||
|
||||
within(".end") do
|
||||
within("form .end") do
|
||||
click_button "Create version"
|
||||
end
|
||||
|
||||
|
||||
@@ -282,4 +282,25 @@ describe "Admin collaborative legislation" do
|
||||
expect(page).to have_content "There is still a long journey ahead of us"
|
||||
end
|
||||
end
|
||||
|
||||
context "Special interface translation behaviour" do
|
||||
let!(:process) { create(:legislation_process) }
|
||||
|
||||
before { Setting["feature.translation_interface"] = true }
|
||||
after { Setting["feature.translation_interface"] = nil }
|
||||
|
||||
scenario "Cant manage translations on homepage form" do
|
||||
visit edit_admin_legislation_process_homepage_path(process)
|
||||
|
||||
expect(page).not_to have_css "#add_language"
|
||||
expect(page).not_to have_link "Remove language"
|
||||
end
|
||||
|
||||
scenario "Cant manage translations on milestones summary form" do
|
||||
visit admin_legislation_process_milestones_path(process)
|
||||
|
||||
expect(page).not_to have_css "#add_language"
|
||||
expect(page).not_to have_link "Remove language"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -173,7 +173,7 @@ describe "Admin legislation questions" do
|
||||
|
||||
find("#nested_question_options input").set("Option 1")
|
||||
|
||||
click_link "Español"
|
||||
select "Español", from: :select_language
|
||||
|
||||
find("#nested_question_options input").set("Opción 1")
|
||||
|
||||
@@ -182,7 +182,7 @@ describe "Admin legislation questions" do
|
||||
|
||||
expect(page).to have_field(field_en[:id], with: "Option 1")
|
||||
|
||||
click_link "Español"
|
||||
select "Español", from: :select_language
|
||||
|
||||
expect(page).to have_field(field_es[:id], with: "Opción 1")
|
||||
end
|
||||
@@ -190,13 +190,13 @@ describe "Admin legislation questions" do
|
||||
scenario "Add new question option after changing active locale", :js do
|
||||
visit edit_question_url
|
||||
|
||||
click_link "Español"
|
||||
select "Español", from: :select_language
|
||||
|
||||
click_on "Add option"
|
||||
|
||||
find("#nested_question_options input").set("Opción 1")
|
||||
|
||||
click_link "English"
|
||||
select "English", from: :select_language
|
||||
|
||||
find("#nested_question_options input").set("Option 1")
|
||||
|
||||
@@ -206,7 +206,7 @@ describe "Admin legislation questions" do
|
||||
|
||||
expect(page).to have_field(field_en[:id], with: "Option 1")
|
||||
|
||||
click_link "Español"
|
||||
select "Español", from: :select_language
|
||||
|
||||
expect(page).to have_field(field_es[:id], with: "Opción 1")
|
||||
end
|
||||
|
||||
@@ -68,7 +68,7 @@ describe "Admin custom information texts" do
|
||||
|
||||
visit admin_site_customization_information_texts_path
|
||||
|
||||
select "Français", from: "translation_locale"
|
||||
select "Français", from: :add_language
|
||||
fill_in "contents[content_#{key}]values[value_fr]", with: "Aide personalise sur les débats"
|
||||
|
||||
click_button "Save"
|
||||
@@ -76,25 +76,26 @@ describe "Admin custom information texts" do
|
||||
expect(page).to have_content "Translation updated successfully"
|
||||
|
||||
visit admin_site_customization_information_texts_path
|
||||
select "Français", from: :select_language
|
||||
|
||||
select "Français", from: "translation_locale"
|
||||
expect(page).to have_content "Aide personalise sur les débats"
|
||||
expect(page).not_to have_content "Aide sur les débats"
|
||||
end
|
||||
|
||||
scenario "Update a translation", :js do
|
||||
key = "proposals.form.proposal_title"
|
||||
create(:i18n_content, key: key, value_fr: "Titre de la proposition")
|
||||
|
||||
visit admin_site_customization_information_texts_path(tab: "proposals")
|
||||
|
||||
select "Français", from: "translation_locale"
|
||||
select "Français", from: :select_language
|
||||
fill_in "contents_content_#{key}values_value_fr", with: "Titre personalise de la proposition"
|
||||
|
||||
click_button "Save"
|
||||
expect(page).to have_content "Translation updated successfully"
|
||||
|
||||
visit admin_site_customization_information_texts_path(tab: "proposals")
|
||||
click_link "Français"
|
||||
select "Français", from: :select_language
|
||||
|
||||
expect(page).to have_content "Titre personalise de la proposition"
|
||||
expect(page).not_to have_content "Titre de la proposition"
|
||||
@@ -113,14 +114,15 @@ describe "Admin custom information texts" do
|
||||
|
||||
visit admin_site_customization_information_texts_path(tab: "debates")
|
||||
|
||||
click_link "Español"
|
||||
select "Español", from: :select_language
|
||||
click_link "Remove language"
|
||||
click_button "Save"
|
||||
|
||||
expect(page).not_to have_link "Español"
|
||||
|
||||
visit admin_site_customization_information_texts_path(tab: "debates")
|
||||
click_link "English"
|
||||
select "English", from: :select_language
|
||||
|
||||
expect(page).to have_content "Start a new debate"
|
||||
expect(page).to have_content "Custom debate title"
|
||||
|
||||
|
||||
@@ -604,6 +604,21 @@ describe "Proposals" do
|
||||
expect(page).to have_content unfeasible.title
|
||||
expect(page).not_to have_content duplicated.title
|
||||
end
|
||||
|
||||
context "Special interface translation behaviour" do
|
||||
before { Setting["feature.translation_interface"] = true }
|
||||
after { Setting["feature.translation_interface"] = nil }
|
||||
|
||||
scenario "Cant manage translations" do
|
||||
proposal = create(:proposal)
|
||||
login_as(proposal.author)
|
||||
|
||||
visit retire_form_proposal_path(proposal)
|
||||
|
||||
expect(page).not_to have_css "#add_language"
|
||||
expect(page).not_to have_link "Remove language"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
scenario "Update should not be posible if logged user is not the author" do
|
||||
|
||||
@@ -72,9 +72,9 @@ shared_examples "edit_translatable" do |factory_name, path_name, input_fields, t
|
||||
translatable.update(attributes)
|
||||
visit path
|
||||
|
||||
select "English", from: :translation_locale
|
||||
select "English", from: :select_language
|
||||
click_link "Remove language"
|
||||
select "Español", from: :translation_locale
|
||||
select "Español", from: :select_language
|
||||
click_link "Remove language"
|
||||
click_button update_button_text
|
||||
|
||||
@@ -91,9 +91,9 @@ shared_examples "edit_translatable" do |factory_name, path_name, input_fields, t
|
||||
translatable.update(attributes)
|
||||
visit path
|
||||
|
||||
select "English", from: :translation_locale
|
||||
select "English", from: :select_language
|
||||
click_link "Remove language"
|
||||
select "Español", from: :translation_locale
|
||||
select "Español", from: :select_language
|
||||
click_link "Remove language"
|
||||
click_button update_button_text
|
||||
visit budgets_path
|
||||
@@ -111,9 +111,9 @@ shared_examples "edit_translatable" do |factory_name, path_name, input_fields, t
|
||||
translatable.update(attributes)
|
||||
visit path
|
||||
|
||||
select "English", from: :translation_locale
|
||||
select "English", from: :select_language
|
||||
click_link "Remove language"
|
||||
select "Español", from: :translation_locale
|
||||
select "Español", from: :select_language
|
||||
click_link "Remove language"
|
||||
click_button update_button_text
|
||||
visit polls_path
|
||||
@@ -126,7 +126,7 @@ shared_examples "edit_translatable" do |factory_name, path_name, input_fields, t
|
||||
scenario "Add a translation", :js do
|
||||
visit path
|
||||
|
||||
select "Français", from: "translation_locale"
|
||||
select "Français", from: :add_language
|
||||
fields.each { |field| fill_in_field field, :fr, with: text_for(field, :fr) }
|
||||
click_button update_button_text
|
||||
|
||||
@@ -135,10 +135,10 @@ shared_examples "edit_translatable" do |factory_name, path_name, input_fields, t
|
||||
|
||||
expect_page_to_have_translatable_field field, :en, with: text_for(field, :en)
|
||||
|
||||
click_link "Español"
|
||||
select "Español", from: :select_language
|
||||
expect_page_to_have_translatable_field field, :es, with: text_for(field, :es)
|
||||
|
||||
click_link "Français"
|
||||
select "Français", from: :select_language
|
||||
expect_page_to_have_translatable_field field, :fr, with: text_for(field, :fr)
|
||||
end
|
||||
|
||||
@@ -149,13 +149,13 @@ shared_examples "edit_translatable" do |factory_name, path_name, input_fields, t
|
||||
|
||||
visit path
|
||||
|
||||
select "Français", from: "translation_locale"
|
||||
select "Français", from: :add_language
|
||||
fill_in_field field, :fr, with: ""
|
||||
click_button update_button_text
|
||||
|
||||
expect(page).to have_css "#error_explanation"
|
||||
|
||||
click_link "Français"
|
||||
select "Français", from: :select_language
|
||||
|
||||
expect_page_to_have_translatable_field field, :fr, with: ""
|
||||
end
|
||||
@@ -163,7 +163,7 @@ shared_examples "edit_translatable" do |factory_name, path_name, input_fields, t
|
||||
scenario "Update a translation", :js do
|
||||
visit path
|
||||
|
||||
click_link "Español"
|
||||
select "Español", from: :select_language
|
||||
field = fields.sample
|
||||
updated_text = "Corrección de #{text_for(field, :es)}"
|
||||
|
||||
@@ -186,7 +186,7 @@ shared_examples "edit_translatable" do |factory_name, path_name, input_fields, t
|
||||
field = required_fields.sample
|
||||
|
||||
visit path
|
||||
click_link "Español"
|
||||
select "Español", from: :select_language
|
||||
|
||||
expect_page_to_have_translatable_field field, :es, with: text_for(field, :es)
|
||||
|
||||
@@ -195,22 +195,21 @@ shared_examples "edit_translatable" do |factory_name, path_name, input_fields, t
|
||||
|
||||
expect(page).to have_css "#error_explanation"
|
||||
|
||||
click_link "Español"
|
||||
select "Español", from: :select_language
|
||||
|
||||
expect_page_to_have_translatable_field field, :es, with: ""
|
||||
end
|
||||
|
||||
scenario "Update a translation not having the current locale", :js do
|
||||
translatable.translations.destroy_all
|
||||
|
||||
translatable.translations.create(
|
||||
fields.map { |field| [field, text_for(field, :fr)] }.to_h.merge(locale: :fr)
|
||||
)
|
||||
|
||||
visit path
|
||||
|
||||
expect(page).not_to have_link "English"
|
||||
expect(page).to have_link "Français"
|
||||
expect_to_have_language_selected "Français"
|
||||
expect_not_to_have_language "English"
|
||||
|
||||
click_button update_button_text
|
||||
|
||||
@@ -219,22 +218,22 @@ shared_examples "edit_translatable" do |factory_name, path_name, input_fields, t
|
||||
path = updated_path_for(translatable)
|
||||
visit path
|
||||
|
||||
expect(page).not_to have_link "English"
|
||||
expect(page).to have_link "Français"
|
||||
expect_to_have_language_selected "Français"
|
||||
expect_not_to_have_language "English"
|
||||
end
|
||||
|
||||
scenario "Remove a translation", :js do
|
||||
visit path
|
||||
|
||||
click_link "Español"
|
||||
select "Español", from: :select_language
|
||||
click_link "Remove language"
|
||||
|
||||
expect(page).not_to have_link "Español"
|
||||
expect_not_to_have_language "Español"
|
||||
|
||||
click_button update_button_text
|
||||
|
||||
visit path
|
||||
expect(page).not_to have_link "Español"
|
||||
expect_not_to_have_language "Español"
|
||||
end
|
||||
|
||||
scenario "Remove a translation with invalid data", :js do
|
||||
@@ -244,19 +243,20 @@ shared_examples "edit_translatable" do |factory_name, path_name, input_fields, t
|
||||
|
||||
visit path
|
||||
|
||||
click_link "Español"
|
||||
select "Español", from: :select_language
|
||||
click_link "Remove language"
|
||||
|
||||
click_link "English"
|
||||
select "English", from: :select_language
|
||||
fill_in_field field, :en, with: ""
|
||||
click_button update_button_text
|
||||
|
||||
expect(page).to have_css "#error_explanation"
|
||||
expect_page_to_have_translatable_field field, :en, with: ""
|
||||
expect(page).not_to have_link "Español"
|
||||
expect_to_have_language_selected "English"
|
||||
expect_not_to_have_language "Español"
|
||||
|
||||
visit path
|
||||
click_link "Español"
|
||||
select "Español", from: :select_language
|
||||
|
||||
expect_page_to_have_translatable_field field, :es, with: text_for(field, :es)
|
||||
end
|
||||
@@ -279,7 +279,7 @@ shared_examples "edit_translatable" do |factory_name, path_name, input_fields, t
|
||||
scenario "Add a translation for a locale with non-underscored name", :js do
|
||||
visit path
|
||||
|
||||
select "Português brasileiro", from: "translation_locale"
|
||||
select "Português brasileiro", from: :add_language
|
||||
fields.each { |field| fill_in_field field, :"pt-BR", with: text_for(field, :"pt-BR") }
|
||||
click_button update_button_text
|
||||
|
||||
@@ -293,24 +293,22 @@ shared_examples "edit_translatable" do |factory_name, path_name, input_fields, t
|
||||
end
|
||||
|
||||
context "Globalize javascript interface" do
|
||||
scenario "Highlight current locale", :js do
|
||||
scenario "Select current locale when its translation exists", :js do
|
||||
visit path
|
||||
|
||||
expect(find("a.js-globalize-locale-link.is-active")).to have_content "English"
|
||||
expect_to_have_language_selected "English"
|
||||
|
||||
select("Español", from: "locale-switcher")
|
||||
|
||||
expect(find("a.js-globalize-locale-link.is-active")).to have_content "Español"
|
||||
expect_to_have_language_selected "Español"
|
||||
end
|
||||
|
||||
scenario "Highlight selected locale", :js do
|
||||
scenario "Select first locale of existing translations when current locale translation
|
||||
does not exists", :js do
|
||||
translatable.translations.where(locale: :en).destroy_all
|
||||
visit path
|
||||
|
||||
expect(find("a.js-globalize-locale-link.is-active")).to have_content "English"
|
||||
|
||||
click_link "Español"
|
||||
|
||||
expect(find("a.js-globalize-locale-link.is-active")).to have_content "Español"
|
||||
expect_to_have_language_selected "Español"
|
||||
end
|
||||
|
||||
scenario "Show selected locale form", :js do
|
||||
@@ -319,7 +317,7 @@ shared_examples "edit_translatable" do |factory_name, path_name, input_fields, t
|
||||
|
||||
expect_page_to_have_translatable_field field, :en, with: text_for(field, :en)
|
||||
|
||||
click_link "Español"
|
||||
select "Español", from: :select_language
|
||||
|
||||
expect_page_to_have_translatable_field field, :es, with: text_for(field, :es)
|
||||
end
|
||||
@@ -327,14 +325,81 @@ shared_examples "edit_translatable" do |factory_name, path_name, input_fields, t
|
||||
scenario "Select a locale and add it to the form", :js do
|
||||
visit path
|
||||
|
||||
select "Français", from: "translation_locale"
|
||||
|
||||
expect(page).to have_link "Français"
|
||||
|
||||
click_link "Français"
|
||||
select "Français", from: :add_language
|
||||
|
||||
expect_to_have_language_selected "Français"
|
||||
expect_page_to_have_translatable_field fields.sample, :fr, with: ""
|
||||
end
|
||||
|
||||
context "Languages in use" do
|
||||
scenario "Show default description" do
|
||||
visit path
|
||||
|
||||
expect(page).to have_content "2 languages in use"
|
||||
end
|
||||
|
||||
scenario "Increase description count after add new language", :js do
|
||||
visit path
|
||||
|
||||
select "Français", from: :add_language
|
||||
|
||||
expect(page).to have_content "3 languages in use"
|
||||
end
|
||||
|
||||
scenario "Decrease description count after remove a language", :js do
|
||||
visit path
|
||||
|
||||
click_link "Remove language"
|
||||
|
||||
expect(page).to have_content "1 language in use"
|
||||
end
|
||||
end
|
||||
|
||||
context "When translation interface feature setting" do
|
||||
describe "At frontend" do
|
||||
before do
|
||||
unless front_end_path_to_visit?(path_name)
|
||||
skip "When path is from backend"
|
||||
end
|
||||
end
|
||||
|
||||
scenario "Is enabled translation interface should be rendered" do
|
||||
visit path
|
||||
|
||||
expect(page).to have_css ".globalize-languages"
|
||||
end
|
||||
|
||||
scenario "Is disabled translation interface should not be rendered" do
|
||||
Setting["feature.translation_interface"] = nil
|
||||
|
||||
visit path
|
||||
|
||||
expect(page).not_to have_css ".globalize-languages"
|
||||
end
|
||||
end
|
||||
|
||||
describe "At backend" do
|
||||
before do
|
||||
if front_end_path_to_visit?(path_name)
|
||||
skip "When path is from frontend"
|
||||
end
|
||||
end
|
||||
|
||||
scenario "Is enabled translation interface should be rendered" do
|
||||
visit path
|
||||
|
||||
expect(page).to have_css ".globalize-languages"
|
||||
end
|
||||
|
||||
scenario "Is disabled translation interface should be rendered" do
|
||||
Setting["feature.translation_interface"] = nil
|
||||
|
||||
visit path
|
||||
|
||||
expect(page).to have_css ".globalize-languages"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -71,7 +71,7 @@ shared_examples "new_translatable" do |factory_name, path_name, input_fields, te
|
||||
visit new_translatable_path
|
||||
|
||||
fill_in_new_translatable_form :en
|
||||
select "Français", from: "translation_locale"
|
||||
select "Français", from: :add_language
|
||||
fill_in_new_translatable_form :fr
|
||||
click_button create_button_text
|
||||
|
||||
@@ -81,7 +81,7 @@ shared_examples "new_translatable" do |factory_name, path_name, input_fields, te
|
||||
scenario "Add only single translation at once not having the current locale", :js do
|
||||
visit new_translatable_path
|
||||
click_link "Remove language"
|
||||
select "Français", from: "translation_locale"
|
||||
select "Français", from: :add_language
|
||||
|
||||
fill_in_new_translatable_form :fr
|
||||
click_button create_button_text
|
||||
@@ -92,7 +92,7 @@ shared_examples "new_translatable" do |factory_name, path_name, input_fields, te
|
||||
scenario "Add a translation for a locale with non-underscored name", :js do
|
||||
visit new_translatable_path
|
||||
click_link "Remove language"
|
||||
select "Português brasileiro", from: "translation_locale"
|
||||
select "Português brasileiro", from: :add_language
|
||||
|
||||
fill_in_new_translatable_form :"pt-BR"
|
||||
click_button create_button_text
|
||||
@@ -127,7 +127,7 @@ shared_examples "new_translatable" do |factory_name, path_name, input_fields, te
|
||||
scenario "Highlight current locale", :js do
|
||||
visit new_translatable_path
|
||||
|
||||
expect(find("a.js-globalize-locale-link.is-active")).to have_content "English"
|
||||
expect_to_have_language_selected "English"
|
||||
end
|
||||
|
||||
scenario "Highlight new locale added", :js do
|
||||
@@ -135,24 +135,64 @@ shared_examples "new_translatable" do |factory_name, path_name, input_fields, te
|
||||
|
||||
select("Español", from: "locale-switcher")
|
||||
|
||||
expect(find("a.js-globalize-locale-link.is-active")).to have_content "Español"
|
||||
expect_to_have_language_selected "Español"
|
||||
end
|
||||
|
||||
scenario "Select a locale and add it to the form", :js do
|
||||
visit new_translatable_path
|
||||
|
||||
select "Français", from: "translation_locale"
|
||||
select "Français", from: :add_language
|
||||
|
||||
expect(find("a.js-globalize-locale-link.is-active")).to have_content "Français"
|
||||
expect_page_to_have_translatable_field fields.sample, :fr, with: ""
|
||||
end
|
||||
|
||||
scenario "Remove a translation", :js do
|
||||
visit new_translatable_path
|
||||
|
||||
expect(find("#select_language").value).to eq "en"
|
||||
click_link "Remove language"
|
||||
|
||||
expect(page).not_to have_link "English"
|
||||
expect_not_to_have_language("English")
|
||||
end
|
||||
|
||||
context "Languages in use" do
|
||||
scenario "Show default description" do
|
||||
visit new_translatable_path
|
||||
|
||||
expect(page).to have_content "1 language in use"
|
||||
end
|
||||
|
||||
scenario "Increase description count after add new language", :js do
|
||||
visit new_translatable_path
|
||||
|
||||
select "Español", from: :add_language
|
||||
|
||||
expect(page).to have_content "2 languages in use"
|
||||
end
|
||||
|
||||
scenario "Decrease description count after remove a language", :js do
|
||||
visit new_translatable_path
|
||||
|
||||
click_link "Remove language"
|
||||
|
||||
expect(page).to have_content "0 languages in use"
|
||||
end
|
||||
end
|
||||
|
||||
context "When translation interface feature setting" do
|
||||
scenario "Is enabled translation interface should be rendered" do
|
||||
visit new_translatable_path
|
||||
|
||||
expect(page).to have_css ".globalize-languages"
|
||||
end
|
||||
|
||||
scenario "Is disabled translation interface should not be rendered" do
|
||||
Setting["feature.translation_interface"] = nil
|
||||
|
||||
visit new_translatable_path
|
||||
|
||||
expect(page).not_to have_css ".globalize-languages"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -58,6 +58,18 @@ module Translations
|
||||
end
|
||||
|
||||
def front_end_path_to_visit?(path)
|
||||
path[/admin|managment|valuation/].blank?
|
||||
path[/admin|managment|valuation|tracking/].blank?
|
||||
end
|
||||
|
||||
def expect_to_have_language(language)
|
||||
expect(page).to have_select :select_language, with_options: [language]
|
||||
end
|
||||
|
||||
def expect_not_to_have_language(language)
|
||||
expect(page).not_to have_select :select_language, with_options: [language]
|
||||
end
|
||||
|
||||
def expect_to_have_language_selected(language)
|
||||
expect(page).to have_select :select_language, selected: language
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user