Skip to content

Commit

Permalink
Merge branch 'develop' into devel-activeadmin-2.0
Browse files Browse the repository at this point in the history
* develop:
  Update CSS for new error messages
  Update changelog
  Fix typos in translations, fix HOLDING WITHOUT SILGUM in de
  Update Verovio to version 3.6.0
  Bump rdoc from 6.2.1 to 6.3.2
  Show the right message in edit
  Fix invalid yml in locale files
  #1035 Add big warning for holdings missing
  Properly localize the "delete tag" message in the marc editor
  Better English message

# Conflicts:
#	Gemfile.lock
  • Loading branch information
xhero committed Sep 6, 2021
2 parents 987fdd9 + a4c9892 commit b0cddee
Show file tree
Hide file tree
Showing 23 changed files with 373 additions and 201 deletions.
37 changes: 37 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,6 +1,43 @@
Muscat Changelog
================

v 7.1.2
* Update to rails 5.2.6
* Fix #1120, move 595 so it is displayed
* Update paper_trail
* Fix works not saving
* Add "follow" pattern to notifications
* Add more solr installation notes
* Fix #891 use better field analyzer for shelfmark
* Bump addressable from 2.7.0 to 2.8.0
* #1132 Add icon to holdings with digital images
* Merge pull request #1131 from rism-digital/dependabot/bundler/addressable-2.8.0
* Fix #1132 Add css
* Add "external resource" filter in source list
* Fix missing field for sunspot
* Make 856x from holdings searchable
* Fix #1125 and other translations
* Add redirect after a login
* Fix #1135, make sure 001 is preserved
* Fix autocomplete with the new subfield layout structure
* Cleanup javascript, avoid warning about items with the same name
* Fix #1137, do not display 787 as initial entry
* Fix #1136, completely remove 511
* Fix #1133, collections go only in composite volumes, also clean up the code a bit
* Fix #1118, add and remove tags
* Fix #1138, implement validation to avoid 787 and 773 pointing to themselves.
* Fix #1128 Add new validations
* Fix #1128, properly show errors on select items
* Show all subtags for 852, remove the partial, it was used for linking but that is done automatically now.
* Fix #516, make sure the + sign is only in the first element
* Properly localize the "delete tag" message in the marc editor
* Fix #1035 Add big warning for holdings missing
* Bump rdoc from 6.2.1 to 6.3.2
* Update Verovio to version 3.6.0
* Merge pull request #1139 from rism-digital/dependabot/bundler/rdoc-6.3.2
* Fix typos in translations, fix HOLDING WITHOUT SILGUM in de
* Update CSS for new error messages

v 7.1.1
* #1124 Fix 670 autocomplete
* #1124 Fix holdings :unapproved
Expand Down
6 changes: 5 additions & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,11 @@ GEM
activerecord (>= 5.2.4)
activesupport (>= 5.2.4)
i18n
rdoc (6.2.1)
polyamorous (= 2.3.2)
rb-fsevent (0.10.4)
rb-inotify (0.10.1)
ffi (~> 1.0)
rdoc (6.3.2)
recaptcha (5.6.0)
json
redcarpet (3.5.1)
Expand Down
14 changes: 13 additions & 1 deletion app/admin/source.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,12 @@ def show
@editor_profile = EditorConfiguration.get_show_layout @item
@prev_item, @next_item, @prev_page, @next_page = Source.near_items_as_ransack(params, @item)

if @item.get_record_type == :edition || @item.get_record_type == :libretto_edition || @item.get_record_type == :theoretica_edition
if @item.holdings.empty?
flash.now[:error] = I18n.t(:holding_missing_show, new_holding: I18n.t(:new_holding))
end
end

respond_to do |format|
format.html
format.xml { render :xml => @item.marc.to_xml(@item.updated_at, @item.versions) }
Expand All @@ -81,6 +87,7 @@ def show

def edit
flash.now[:error] = params[:validation_error] if params[:validation_error]

@item = Source.find(params[:id])
@holdings = @item.holdings
@show_history = true if params[:show_history]
Expand All @@ -91,7 +98,12 @@ def edit
@page_title = "#{I18n.t(:edit)}#{record_type} [#{@item.id}]"

template = EditorConfiguration.get_source_default_file(@item.get_record_type) + ".marc"


if @item.get_record_type == :edition || @item.get_record_type == :libretto_edition || @item.get_record_type == :theoretica_edition
if @item.holdings.empty?
flash.now[:error] = I18n.t(:holding_missing, new_holding: I18n.t(:new_holding))
end
end

# Try to load the MARC object.
# This is the same trap as in show but here we
Expand Down
1 change: 0 additions & 1 deletion app/assets/javascripts/active_admin.js.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@
#= require jquery.autosize.min
#= require jquery.hotkeys
#= require js.cookie
#= require rism.localisation
#= require autocomplete-rails
#= require inline_autocomplete_ujs
#= require tag_header_events
Expand Down
26 changes: 20 additions & 6 deletions app/assets/javascripts/marc_editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function marc_editor_set_dirty() {
}

function marc_editor_init_tags( id ) {

marc_editor_show_last_tab();

// Set event hooks
Expand Down Expand Up @@ -83,6 +83,12 @@ function marc_editor_get_triggers() {
// Ajax sends back and URL to redirect to or an error
var savedNr = 0;
function _marc_editor_send_form(form_name, rails_model, redirect) {

// Before saving, if this is a new edition
// nag the user with an alert to remember
// to add holding records
marc_editor_holding_warning();

savedNr++;
redirect = redirect || false;
form = $('form', "#" + form_name);
Expand Down Expand Up @@ -519,13 +525,10 @@ function marc_editor_incipit(clef, keysig, timesig, incipit, target, width) {
// width is option
width = typeof width !== 'undefined' ? width : 720;

var pae = "@start:pae-file\n";
pae = pae + "@clef:" + clef + "\n";
var pae = "@clef:" + clef + "\n";
pae = pae + "@keysig:" + keysig + "\n";
pae = pae + "@key:\n";
pae = pae + "@timesig:" + timesig + "\n";
pae = pae + "@data: " + incipit + "\n";
pae = pae + "@end:pae-file\n";
pae = pae + "@data: " + incipit;

// Do the call to the verovio helper
render_music(pae, 'pae', target, width);
Expand Down Expand Up @@ -600,6 +603,17 @@ function marc_editor_remove_subfield(id) {
}
}

function marc_editor_holding_warning() {
var record_type = $("#record_type").val()
var source_id = $("#id").val()

// Edition, libretto edition and theoretica edition
if (source_id == "" && (record_type == 8 || record_type == 5 || record_type == 7)) {
alert(I18n.t("holding_missing_alert", { new_holding: I18n.t("new_holding") }));
}

}

// Hardcoded for marc_editor_panel
function marc_editor_get_model() {
return $("#marc_editor_panel").data("editor-model");
Expand Down
8 changes: 2 additions & 6 deletions app/assets/javascripts/mei_transformations.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,7 @@ function translateIncipCode(incip, out_format) {
continue;
}

pae = "@start:pae-file\n";
pae = pae + "@data: " + incipcode.textContent + "\n";
pae = pae + "@end:pae-file\n";
var pae = "@data: " + incipcode.textContent + "\n";

globalIncipitStrings.push(pae);

Expand Down Expand Up @@ -78,9 +76,7 @@ function typesetIncipits(incip, out_format) {
continue;
}

pae = "@start:pae-file\n";
pae = pae + "@data: " + incipcode.textContent + "\n";
pae = pae + "@end:pae-file\n";
var pae = "@data: " + incipcode.textContent + "\n";
in_data = pae;
} else {
incipcode = incip[index].getElementsByTagName('score')[0];
Expand Down
9 changes: 0 additions & 9 deletions app/assets/javascripts/rism.localisation.js

This file was deleted.

4 changes: 2 additions & 2 deletions app/assets/javascripts/tag_header_events.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ used for _tag_header partial

function tag_header_delete(button_id) {
// FIXME dialog should not be hardcoded
$('#dialog').html('<p>' + delete_field_confirm + '</p>');
$('#dialog').html('<p>' + I18n.t("marc_editor.delete_field_confirm") + '</p>');
$("#dialog").dialog();
$("#dialog").dialog( 'option', 'title', delete_msg );
$("#dialog").dialog( 'option', 'title', I18n.t("marc_editor.delete_msg") );
$("#dialog").dialog( 'option', 'width', 300);
$("#dialog").dialog( 'option', 'buttons', {
OK: function() {
Expand Down
6 changes: 3 additions & 3 deletions app/assets/javascripts/verovio_preload.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ function load_verovio() {
// an incipit into a target div. It will do the preloading
// in the background
function render_music(music, format, target, width) {
width = typeof width !== 'undefined' ? width : 720;
var width = typeof width !== 'undefined' ? width : 720;

if (vrvToolkit == null) {
deferred_render_data.push({
Expand All @@ -52,7 +52,7 @@ function render_music(music, format, target, width) {

if (format === "pae") {
var options = {
from: 'pae',
inputFrom: 'pae',
pageMarginTop: 40,
pageMarginBottom: 60,
pageMarginLeft: 20,
Expand All @@ -64,7 +64,7 @@ function render_music(music, format, target, width) {
};

vrvToolkit.setOptions( options );
vrvToolkit.loadData(music + "\n" );
vrvToolkit.loadData(music);
var svg = vrvToolkit.renderToSVG(1, {});
$(target).html(svg);
} else {
Expand Down
7 changes: 2 additions & 5 deletions app/views/advanced/_advanced_search_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -176,13 +176,10 @@ link = send(search_function)
pae_incipit = "1-"
}

pae = "@start:pae-file\n";
pae = pae + "@clef:" + pae_clef + "\n";
var pae = "@clef:" + pae_clef + "\n";
pae = pae + "@keysig:" + pae_keysig + "\n";
pae = pae + "@key:\n";
pae = pae + "@timesig:" + pae_timesig + "\n";
pae = pae + "@data: " + pae_incipit + "\n";
pae = pae + "@end:pae-file\n"
pae = pae + "@data: " + pae_incipit;
render_music(pae, 'pae');

}
Expand Down
6 changes: 2 additions & 4 deletions app/views/marc_show/_show_incipit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,11 @@

<script type="text/javascript">

pae = "@start:pae-file\n";
pae = pae + "@clef:<%= clef %>\n";
var pae = "@clef:<%= clef %>\n";
pae = pae + "@keysig:<%= key %>\n";
pae = pae + "@key:<%= key_or_mode %>\n";
pae = pae + "@timesig:<%= time %>\n";
pae = pae + "@data: <%= notation %>\n";
pae = pae + "@end:pae-file\n"
pae = pae + "@data: <%= notation %>";
render_music(pae, 'pae', $("#" + "<%=image_render_div%>"));

function show_hide_pae(id) {
Expand Down
9 changes: 8 additions & 1 deletion config/locales/de.yml
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,10 @@ de:
finished: "Beendet"
lib_siglum: "Bibliothekssigel"
holding_records: "Exemplarinformation"
holding_no_siglum: "HOLDING WITHOUT SILGUM"
holding_no_siglum: "Unmarkierte Kopie"
holding_missing: "This printed source does not have any holdings attached yet. Please add your library siglum, shelfmark, and other copy-specific information to this record by clicking the \"%{new_holding}\" button on the right."
holding_missing_alert: "This printed source does not have any holdings attached yet. Please add your library siglum, shelfmark, and other copy-specific information to this record by clicking the \"%{new_holding}\" button on the right after you save."
holding_missing_show: "This printed source does not have any holdings attached yet. Please add your library siglum, shelfmark, and other copy-specific information to this record by editinf this record and clicking the \"%{new_holding}\" button on the right."
new_holding: "Neuer Examplareintrag"
new_holding_page: "Neuer Exemplareintrag"
new_digital_object_image: "Neues Bild hinzufügen"
Expand Down Expand Up @@ -780,6 +783,10 @@ de:
"Number of printed copies": "Anzahl der gedruckten Exemplare"
publisher: "Verleger"

marc_editor:
delete_msg: "Löschen"
delete_field_confirm: "Sind Sie sicher, dass Sie dieses Feld löschen möchten?"

cookies:
message: "Unsere Website verwendet Cookies, um Ihre Browser-Erfahrung zu verbessern. Durch die Nutzung unserer Website stimmen Sie der Verwendung von Cookies zu."
dimiss: "Akzeptieren und schließen"
Expand Down
8 changes: 7 additions & 1 deletion config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,9 @@ en:
lib_siglum: "Library Siglum"
holding_records: "Exemplar Information"
holding_no_siglum: "Holding without silgum"
holding_missing: "This printed source does not have any holdings attached yet. Please add your library siglum, shelfmark, and other copy-specific information to this record by clicking the \"%{new_holding}\" button on the right."
holding_missing_alert: "This printed source does not have any holdings attached yet. Please add your library siglum, shelfmark, and other copy-specific information to this record by clicking the \"%{new_holding}\" button on the right after you save."
holding_missing_show: "This printed source does not have any holdings attached yet. Please add your library siglum, shelfmark, and other copy-specific information to this record by editing this record and clicking the \"%{new_holding}\" button on the right."
new_holding: "Add holdings"
new_holding_page: "New holdings information"
new_digital_object_image: "Attach a new image"
Expand Down Expand Up @@ -756,7 +759,7 @@ en:
correct: "The record has no validation errors [200]"
begins_with_message: "Must begin with \"{0}\""
required_if_message: "Field is mandatory because {0} ${1} is not empty"
cannot_link_to_self: "Cannot create a link to itself (%{id})."
cannot_link_to_self: "The record cannot link to itself (%{id})."

incipit_search:
incipit_search: "Incipit Search"
Expand All @@ -782,6 +785,9 @@ en:
"Number of printed copies": "Number of printed copies"
publisher: "Publisher"

marc_editor:
delete_msg: "Delete"
delete_field_confirm: "Are you sure you want to delete this field?"

cookies:
message: "Our website uses cookies to make your browsing experience better. By using our site you agree to our use of cookies."
Expand Down
7 changes: 7 additions & 0 deletions config/locales/es.yml
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,9 @@ es:
lib_siglum: "Sigla del repositorio"
holding_records: "Información del ejemplar"
holding_no_siglum: "EJEMPLAR SIN SIGLA"
holding_missing: "This printed source does not have any holdings attached yet. Please add your library siglum, shelfmark, and other copy-specific information to this record by clicking the \"%{new_holding}\" button on the right."
holding_missing_alert: "This printed source does not have any holdings attached yet. Please add your library siglum, shelfmark, and other copy-specific information to this record by clicking the \"%{new_holding}\" button on the right after you save."
holding_missing_show: "This printed source does not have any holdings attached yet. Please add your library siglum, shelfmark, and other copy-specific information to this record by editing this record and clicking the \"%{new_holding}\" button on the right."
new_holding: "Crear nuevo registro de ejemplar"
new_holding_page: "Nuevo registro de ejemplar"
new_digital_object_image: "Añadir una nueva imagen"
Expand Down Expand Up @@ -780,6 +783,10 @@ es:
"Number of printed copies": "Número de copias impresas"
publisher: "Publicador"

marc_editor:
delete_msg: "Borrar"
delete_field_confirm: "¿Está seguro de que desea eliminar este campo?"

cookies:
message: "Nuestro sitio web utiliza cookies para mejorar su experiencia de navegación. Al usar nuestro sitio, Ud. manifiesta su conformidad con el uso de cookies."
dimiss: "Aceptar y cerrar"
Expand Down
8 changes: 8 additions & 0 deletions config/locales/fr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,10 @@ fr:
lib_siglum: "Sigle de bibliothèque"
holding_records: "Copie"
holding_no_siglum: "Copie sans cote"
holding_missing: "Cette source imprimée n'a pas encore des copies attachées. Veuillez ajouter le sigle de votre bibliothèque, la cote et d'autres informations spécifiques à cet exemplaire à cette fiche en cliquant sur le bouton \"%{new_holding}\" à droite."
holding_missing_alert: "Cette source imprimée n'a pas encore des copies attachées. Veuillez ajouter le sigle de votre bibliothèque, la cote et d'autres informations spécifiques à cet exemplaire à cette fiche en cliquant sur le bouton \"%{new_holding}\" à droite après avoir enregistré."
holding_missing_show: "Cette source imprimée n'a pas encore des copies attachées. Veuillez ajouter le sigle de votre bibliothèque, la cote et d'autres informations spécifiques à cet exemplaire à cette fiche en entrant en mode édition et en cliquant sur le bouton \"%{new_holding}\" à droite."

new_holding: "Ajouter une copie"
new_holding_page: "Copie non enregistré"
new_digital_object_image: "Attacher une nouvelle image"
Expand Down Expand Up @@ -780,6 +784,10 @@ fr:
"Number of printed copies": "Nombre d'exemplaires imprimés"
publisher: "Editeur"

marc_editor:
delete_msg: "Supprimer"
delete_field_confirm: "Êtes-vous sûr de vouloir supprimer ce champ?"

cookies:
message: "Notre site utilise des cookies pour améliorer votre expérience de navigation. En utilisant notre site, vous acceptez notre utilisation des cookies."
dimiss: "Accepter et fermer"
Expand Down
7 changes: 7 additions & 0 deletions config/locales/it.yml
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,9 @@ it:
lib_siglum: "Sigla della biblioteca"
holding_records: "Esemplari"
holding_no_siglum: "Esemplare senza sigla di biblioteca"
holding_missing: "Questa fonte stampata non ha ancora nessun esemplare allegato. Per favore, aggiungi la sigla della tua biblioteca, la segnatura e altre informazioni specifiche su questa copia in questo record cliccando il pulsante \"%{new_holding}\" sulla destra."
holding_missing_alert: "Questa fonte stampata non ha ancora nessun esemplare allegato. Per favore, aggiungi la sigla della tua biblioteca, la segnatura e altre informazioni specifiche su questa copia in questo record cliccando il pulsante \"%{new_holding}\" sulla destra dopo aver salvato"
holding_missing_show: "Questa fonte stampata non ha ancora nessun esemplare allegato. Per favore, aggiungi la sigla della tua biblioteca, la segnatura e altre informazioni specifiche su questa copia in questo record entrando nella modalità di modifica e cliccando il pulsante \"%{new_holding}\" sulla destra."
new_holding: "Nuovo Esemplare"
new_holding_page: "Esemplare non salvato"
new_digital_object_image: "Aggiungi una nuova immagine"
Expand Down Expand Up @@ -783,6 +786,10 @@ it:
"Number of printed copies": "Numero di esemplari a stampa"
publisher: "Editore"

marc_editor:
delete_msg: "Elimina"
delete_field_confirm: "Sei sicuro di voler eliminare questo campo?"

cookies:
message: "Il nostro sito web utilizza cookie per funzionare. Se utilizzate il nostro sito accettata il nostro utilizzo dei cookie."
dimiss: "Accetta e chiudi"
Expand Down
2 changes: 1 addition & 1 deletion config/locales/marc_records/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -740,7 +740,7 @@ en:
series_statement: Series statement fields
set: Set
shelfmark: Shelfmark
shelfmark_olim: Shelfmark (olim)
shelfmark_olim: Former shelfmark (olim)
short_title: Short title
sigla: Sigla
siglum: Siglum
Expand Down
2 changes: 1 addition & 1 deletion config/locales/marc_records/pl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -740,7 +740,7 @@ pl:
series_statement: Pola uwag do serii
set: Zbiór
shelfmark: Sygnatura
shelfmark_olim: Sygnatura (wcześniejsza)
shelfmark_olim: Dawna sygnatura (wcześniejsza)
short_title: Skrócony tytuł
sigla: Sigla
siglum: Siglum
Expand Down
Loading

0 comments on commit b0cddee

Please sign in to comment.