Merge pull request #3103 from consul/backport-update_legislation_milestone_form
Edit only existing languages in milestones summary
This commit is contained in:
@@ -1,4 +1,6 @@
|
|||||||
<%= render "admin/shared/globalize_locales", resource: @process %>
|
<%= render "admin/shared/globalize_tabs",
|
||||||
|
resource: @process,
|
||||||
|
display_style: lambda { |locale| enable_translation_style(@process, locale) } %>
|
||||||
|
|
||||||
<%= translatable_form_for [:admin, @process] do |f| %>
|
<%= translatable_form_for [:admin, @process] do |f| %>
|
||||||
<%= f.translatable_fields do |translations_form| %>
|
<%= f.translatable_fields do |translations_form| %>
|
||||||
|
|||||||
@@ -8,17 +8,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<ul class="tabs" data-tabs id="globalize_locale">
|
<%= render "admin/shared/globalize_tabs", resource: resource, display_style: display_style %>
|
||||||
<% 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>
|
|
||||||
|
|
||||||
<div class="small-12 medium-6">
|
<div class="small-12 medium-6">
|
||||||
<%= select_tag :translation_locale,
|
<%= select_tag :translation_locale,
|
||||||
|
|||||||
11
app/views/admin/shared/_globalize_tabs.html.erb
Normal file
11
app/views/admin/shared/_globalize_tabs.html.erb
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
<ul class="tabs" data-tabs id="globalize_locale">
|
||||||
|
<% 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>
|
||||||
@@ -192,6 +192,9 @@ feature 'Admin legislation processes' do
|
|||||||
scenario "Edit milestones summary", :js do
|
scenario "Edit milestones summary", :js do
|
||||||
visit admin_legislation_process_milestones_path(process)
|
visit admin_legislation_process_milestones_path(process)
|
||||||
|
|
||||||
|
expect(page).not_to have_link "Remove language"
|
||||||
|
expect(page).not_to have_field "translation_locale"
|
||||||
|
|
||||||
within(".translatable-fields[data-locale='en']") do
|
within(".translatable-fields[data-locale='en']") do
|
||||||
fill_in_ckeditor find("textarea", visible: false)[:id],
|
fill_in_ckeditor find("textarea", visible: false)[:id],
|
||||||
with: "There is still a long journey ahead of us"
|
with: "There is still a long journey ahead of us"
|
||||||
|
|||||||
Reference in New Issue
Block a user