Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3773 - Usability of save and done button #4215

Open
wants to merge 1 commit into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 30 additions & 17 deletions app/views/transcribe/_save_buttons.html.slim
Original file line number Diff line number Diff line change
@@ -1,3 +1,30 @@
ruby:
approve_button = nil
done_button = nil
save_button = nil

if @collection.review_workflow && @page.status == Page::STATUS_NEEDS_REVIEW && current_user.can_review?(@collection)
approve_button = button_tag t('.approve'), name: 'approve_to_transcribed', type: 'submit', id: 'approve_button_top', onclick: 'unsavedNotes(event);', title: "#{t('.approve_to_transcribed_tooltip')}", class: "bggreen", data: { disable_with: t('.please_wait') }
end

if [nil, "", Page::STATUS_INCOMPLETE].include?(@page.status)
if @collection.review_workflow
done_button = button_tag t('.done'), name: 'done_to_needs_review', type: 'submit', id: 'finish_button_top', onclick: 'unsavedNotes(event);', title: "#{t('.finish_to_needs_review_tooltip')}", class: "bggreen", data: { disable_with: t('.please_wait') }
else
done_button = button_tag t('.done'), name: 'done_to_transcribed', type: 'submit', id: 'finish_button_top', onclick: 'unsavedNotes(event);', title: "#{t('.finish_to_transcribed_tooltip')}", class: "bggreen", data: { disable_with: t('.please_wait') }
end
end

# check status of page and configuration of collection
save_button_title = approve_button || done_button ? t('.save_changes') : t('.save')
if @page.status.blank? || @page.status == Page::STATUS_INCOMPLETE || @page.status == Page::STATUS_BLANK
save_button = button_tag save_button_title, name: 'save_to_incomplete', type: 'submit', id: 'save_button_top', onclick: 'unsavedNotes(event);', title: "#{t('.save_to_incomplete_tooltip')}", data: { disable_with: t('.please_wait') }, onclick: 'unsavedNotes(event);'
elsif @page.status == Page::STATUS_NEEDS_REVIEW
save_button = button_tag save_button_title, name: 'save_to_needs_review', type: 'submit', id: 'save_button_top', onclick: 'unsavedNotes(event);', title: "#{t('.save_to_needs_review_tooltip')}", data: { disable_with: t('.please_wait') }
elsif [Page::STATUS_INDEXED, Page::STATUS_TRANSCRIBED].include?(@page.status)
save_button = button_tag save_button_title, name: 'save_to_transcribed', type: 'submit', id: 'save_button_top', onclick: 'unsavedNotes(event);', title: "#{t('.save_to_transcribed_tooltip')}", data: { disable_with: t('.please_wait') }
end

.flex-toolbar_group
-unless @preview_xml
-if @page && [email protected]_plaintext.blank? && @collection.text_entry?
Expand All @@ -8,20 +35,6 @@
-unless @collection.subjects_disabled || @collection.field_based
=button_tag t('.autolink'), name: 'autolink', type: 'submit', title: "#{t('.autolink_tooltip')}"

/ check status of page and configuration of collection
-if @page.status.blank? || @page.status == Page::STATUS_INCOMPLETE || @page.status == Page::STATUS_BLANK
=button_tag t('.save_changes'), name: 'save_to_incomplete', type: 'submit', id: 'save_button_top', onclick: 'unsavedNotes(event);', title: "#{t('.save_to_incomplete_tooltip')}", data: { disable_with: t('.please_wait') }, onclick: 'unsavedNotes(event);'

-if [Page::STATUS_NEEDS_REVIEW].include?(@page.status)
=button_tag t('.save_changes'), name: 'save_to_needs_review', type: 'submit', id: 'save_button_top', onclick: 'unsavedNotes(event);', title: "#{t('.save_to_needs_review_tooltip')}", data: { disable_with: t('.please_wait') }
-elsif [Page::STATUS_INDEXED, Page::STATUS_TRANSCRIBED].include?(@page.status)
=button_tag t('.save_changes'), name: 'save_to_transcribed', type: 'submit', id: 'save_button_top', onclick: 'unsavedNotes(event);', title: "#{t('.save_to_transcribed_tooltip')}", data: { disable_with: t('.please_wait') }

-if [nil, "", Page::STATUS_INCOMPLETE].include?(@page.status)
-if @collection.review_workflow
=button_tag t('.done'), name: 'done_to_needs_review', type: 'submit', id: 'finish_button_top', onclick: 'unsavedNotes(event);', title: "#{t('.finish_to_needs_review_tooltip')}", class: "bggreen", data: { disable_with: t('.please_wait') }
-else
=button_tag t('.done'), name: 'done_to_transcribed', type: 'submit', id: 'finish_button_top', onclick: 'unsavedNotes(event);', title: "#{t('.finish_to_transcribed_tooltip')}", class: "bggreen", data: { disable_with: t('.please_wait') }

-if @collection.review_workflow && @page.status == Page::STATUS_NEEDS_REVIEW && current_user.can_review?(@collection)
=button_tag t('.approve'), name: 'approve_to_transcribed', type: 'submit', id: 'approve_button_top', onclick: 'unsavedNotes(event);', title: "#{t('.approve_to_transcribed_tooltip')}", class: "bggreen", data: { disable_with: t('.please_wait') }
=save_button
=done_button
=approve_button
3 changes: 2 additions & 1 deletion config/locales/transcribe/transcribe-de.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ de:
please_wait: Einen Moment...
preview: Vorschau
preview_tooltip: Vorschau dieser Seite
save_changes: Speichern
save: Speichern
save_changes: Entwurf speichern
save_to_incomplete_tooltip: Eine unvollständige Seite speichern
save_to_needs_review_tooltip: Änderungen speichern
save_to_transcribed_tooltip: Änderungen speichern
Expand Down
3 changes: 2 additions & 1 deletion config/locales/transcribe/transcribe-en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ en:
please_wait: Please wait...
preview: Preview
preview_tooltip: Preview this page
save_changes: Save
save: Save
save_changes: Save draft
save_to_incomplete_tooltip: Save an incomplete page
save_to_needs_review_tooltip: Save your changes
save_to_transcribed_tooltip: Save your changes
Expand Down
3 changes: 2 additions & 1 deletion config/locales/transcribe/transcribe-es.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ es:
please_wait: Espere por favor...
preview: Avance
preview_tooltip: Vista previa de esta página
save_changes: Guardar Cambios
save: Ahorrar
save_changes: Guardar borrador
save_to_incomplete_tooltip: Guardar una página incompleta
save_to_needs_review_tooltip: Guardar tus cambios
save_to_transcribed_tooltip: Guardar tus cambios
Expand Down
3 changes: 2 additions & 1 deletion config/locales/transcribe/transcribe-fr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ fr:
please_wait: S'il vous plaît, attendez...
preview: Aperçu
preview_tooltip: Aperçu de cette page
save_changes: Sauvegarder
save: Sauvegarder
save_changes: Enregistrer le brouillon
save_to_incomplete_tooltip: Enregistrer une page incomplète
save_to_needs_review_tooltip: Enregistrez vos modifications
save_to_transcribed_tooltip: Enregistrez vos modifications
Expand Down
3 changes: 2 additions & 1 deletion config/locales/transcribe/transcribe-pt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ pt:
please_wait: Por favor, espere...
preview: Visualizar
preview_tooltip: Visualizar esta página
save_changes: Salvar
save: Salvar
save_changes: Salvar rascunho
save_to_incomplete_tooltip: Salvar uma página incompleta
save_to_needs_review_tooltip: Salve suas alterações
save_to_transcribed_tooltip: Salve suas alterações
Expand Down
Loading