From 85f4566bba6a661211d32b8b3d80ed90f80c7629 Mon Sep 17 00:00:00 2001 From: sarken Date: Mon, 13 Jun 2016 04:05:33 -0400 Subject: [PATCH 1/2] AO3-3597 Let admins edit language when previewing work --- app/views/works/preview_tags.html.erb | 1 + features/admins/admin_works.feature | 18 ++++++++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/app/views/works/preview_tags.html.erb b/app/views/works/preview_tags.html.erb index 0498afb9cae..2f81f7b55a7 100644 --- a/app/views/works/preview_tags.html.erb +++ b/app/views/works/preview_tags.html.erb @@ -19,6 +19,7 @@ <%= form.hidden_field :relationship_string, :value => "#{@work.relationship_string}" %> <%= form.hidden_field :character_string, :value => "#{@work.character_string}" %> <%= form.hidden_field :freeform_string, :value => "#{@work.freeform_string}" %> + <%= form.hidden_field :language_id, :value => "#{@work.language.id}" %>
<%= ts('Post Work') %> diff --git a/features/admins/admin_works.feature b/features/admins/admin_works.feature index a9315454be6..6b280f7afe1 100644 --- a/features/admins/admin_works.feature +++ b/features/admins/admin_works.feature @@ -189,7 +189,7 @@ Feature: Admin Actions for Works and Bookmarks Then I should not see "rolex" And I should see "I loved this!" - Scenario: Admin can edit language on works + Scenario: Admin can edit language on works when posting without previewing Given basic tags And basic languages And I am logged in as "regular_user" @@ -200,4 +200,18 @@ Feature: Admin Actions for Works and Bookmarks When I select "Deutsch" from "Choose a language" And I press "Post Without Preview" Then I should see "Deutsch" - And I should not see "English" \ No newline at end of file + And I should not see "English" + + Scenario: Admin can edit language on works when previewing first + Given basic tags + And basic languages + And I am logged in as "regular_user" + And I post the work "Wrong Language" + When I am logged in as an admin + And I view the work "Wrong Language" + And I follow "Edit Tags" + When I select "Deutsch" from "Choose a language" + And I press "Preview" + And I press "Update" + Then I should see "Deutsch" + And I should not see "English" \ No newline at end of file From 500db9ac7f3b514f38d55b284b1c114ce795460c Mon Sep 17 00:00:00 2001 From: sarken Date: Mon, 13 Jun 2016 04:07:41 -0400 Subject: [PATCH 2/2] AO3-3597 Change admin option to more accurate Edit Tags and Language --- app/views/admin/_admin_options.html.erb | 2 +- features/admins/admin_works.feature | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/views/admin/_admin_options.html.erb b/app/views/admin/_admin_options.html.erb index 17d437d013b..ad3445d618e 100644 --- a/app/views/admin/_admin_options.html.erb +++ b/app/views/admin/_admin_options.html.erb @@ -31,7 +31,7 @@ <% end %> <% if @work.present? %> -
  • <%= link_to ts("Edit Tags"), edit_tags_work_path(@work) %>
  • +
  • <%= link_to ts("Edit Tags and Language"), edit_tags_work_path(@work) %>
  • <% end %> <% if item.class == ExternalWork %>
  • <%= link_to ts("Edit External Work"), edit_external_work_path(item) %>
  • diff --git a/features/admins/admin_works.feature b/features/admins/admin_works.feature index 6b280f7afe1..f4d83bf5b84 100644 --- a/features/admins/admin_works.feature +++ b/features/admins/admin_works.feature @@ -70,7 +70,7 @@ Feature: Admin Actions for Works and Bookmarks And I post the work "Changes" with fandom "User-Added Fandom" with freeform "User-Added Freeform" with category "M/M" When I am logged in as an admin And I view the work "Changes" - And I follow "Edit Tags" + And I follow "Edit Tags and Language" When I select "Mature" from "Rating" And I uncheck "No Archive Warnings Apply" And I check "Choose Not To Use Archive Warnings" @@ -196,7 +196,7 @@ Feature: Admin Actions for Works and Bookmarks And I post the work "Wrong Language" When I am logged in as an admin And I view the work "Wrong Language" - And I follow "Edit Tags" + And I follow "Edit Tags and Language" When I select "Deutsch" from "Choose a language" And I press "Post Without Preview" Then I should see "Deutsch" @@ -209,7 +209,7 @@ Feature: Admin Actions for Works and Bookmarks And I post the work "Wrong Language" When I am logged in as an admin And I view the work "Wrong Language" - And I follow "Edit Tags" + And I follow "Edit Tags and Language" When I select "Deutsch" from "Choose a language" And I press "Preview" And I press "Update"