Skip to content

Commit

Permalink
2313 - Abandon subject without losing transcription
Browse files Browse the repository at this point in the history
  • Loading branch information
WillNigel23 committed Jul 16, 2024
1 parent 2f20955 commit aee5305
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 5 deletions.
6 changes: 6 additions & 0 deletions app/controllers/transcribe_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ def active?
end

def display_page
rollback_article_categories(params[:rollback_ids]) if params[:rollback_ids]&.any?

@collection = page.collection unless @collection
@auto_fullscreen = cookies[:auto_fullscreen] || 'no';
@layout_mode = cookies[:transcribe_layout_mode] || @collection.default_orientation
Expand Down Expand Up @@ -608,6 +610,10 @@ def record_translation_deed

private

def rollback_article_categories(article_ids)
Article.where(id: article_ids).update(categories: [])
end

def page_params
params.require(:page).permit(:source_text, :source_translation, :title)
end
Expand Down
16 changes: 11 additions & 5 deletions app/views/transcribe/assign_categories.html.slim
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
ruby:
if @text_type == 'translation'
cancel_path = collection_translate_page_path(@collection.owner, @collection, @work, @page.id, rollback_ids: @unassigned_articles.pluck(:id))
continue_path = collection_translate_page_path(@collection.owner, @collection, @work, @next_page_id)
else
cancel_path = collection_transcribe_page_path(@collection.owner, @collection, @work, @page.id, rollback_ids: @unassigned_articles.pluck(:id))
continue_path = collection_transcribe_page_path(@collection.owner, @collection, @work, @next_page_id)
end

=render({ :partial => '/shared/page_tabs', :locals => { :selected => 3, :page_id => @page.id }})

.headline
Expand All @@ -21,8 +30,5 @@ p.big =t('.uncategorized_subjects_mentioned')
option(data-level=level value=c.id selected=selected aria-label=t('.options') *language_attrs(@collection)) =c.title

span.legend
-if @text_type == 'translation'
-next_path = collection_translate_page_path(@collection.owner, @collection, @work, @page.id)
-else
-next_path = collection_transcribe_page_path(@collection.owner, @collection, @work, @page.id)
=link_to t('.continue'), next_path, class: 'button outline round'
=link_to t('.cancel'), cancel_path, class: 'button outline round', style: 'margin: 0 0.5rem';
=link_to t('.continue'), continue_path, class: 'button outline round', style: 'margin: 0 0.5rem';
1 change: 1 addition & 0 deletions config/locales/transcribe/transcribe-de.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ de:
transcribe:
assign_categories:
assign_categories: Kategorien zuweisen
cancel: Stornieren
continue: Weitermachen
manage_categories: Kategorien verwalten
options: Optionen
Expand Down
1 change: 1 addition & 0 deletions config/locales/transcribe/transcribe-en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ en:
transcribe:
assign_categories:
assign_categories: Assign categories
cancel: Cancel
continue: Continue
manage_categories: Manage Categories
options: options
Expand Down
1 change: 1 addition & 0 deletions config/locales/transcribe/transcribe-es.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ es:
transcribe:
assign_categories:
assign_categories: Asignar categorías
cancel: Cancelar
continue: Continuar
manage_categories: Administrar Categorías
options: Opciones
Expand Down
1 change: 1 addition & 0 deletions config/locales/transcribe/transcribe-fr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ fr:
transcribe:
assign_categories:
assign_categories: Attribuer des catégories
cancel: Annuler
continue: Continuer
manage_categories: Gérer les catégories
options: options
Expand Down
1 change: 1 addition & 0 deletions config/locales/transcribe/transcribe-pt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ pt:
transcribe:
assign_categories:
assign_categories: Atribuir categorias
cancel: Cancelar
continue: Continuar
manage_categories: Controlar Categorias
options: opções
Expand Down

0 comments on commit aee5305

Please sign in to comment.