diff --git a/CHANGELOG b/CHANGELOG index b4b8fa32a..b95a13be4 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -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 diff --git a/Gemfile.lock b/Gemfile.lock index e17e26c5c..c82f97357 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -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) diff --git a/app/admin/source.rb b/app/admin/source.rb index 4b715312e..f2410190e 100644 --- a/app/admin/source.rb +++ b/app/admin/source.rb @@ -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) } @@ -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] @@ -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 diff --git a/app/assets/javascripts/active_admin.js.coffee b/app/assets/javascripts/active_admin.js.coffee index 615a44ca4..4ec697112 100644 --- a/app/assets/javascripts/active_admin.js.coffee +++ b/app/assets/javascripts/active_admin.js.coffee @@ -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 diff --git a/app/assets/javascripts/marc_editor.js b/app/assets/javascripts/marc_editor.js index 4e4a1173f..8de2b06e9 100644 --- a/app/assets/javascripts/marc_editor.js +++ b/app/assets/javascripts/marc_editor.js @@ -14,7 +14,7 @@ function marc_editor_set_dirty() { } function marc_editor_init_tags( id ) { - + marc_editor_show_last_tab(); // Set event hooks @@ -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); @@ -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); @@ -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"); diff --git a/app/assets/javascripts/mei_transformations.js b/app/assets/javascripts/mei_transformations.js index 9c275bd8b..c76258329 100644 --- a/app/assets/javascripts/mei_transformations.js +++ b/app/assets/javascripts/mei_transformations.js @@ -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); @@ -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]; diff --git a/app/assets/javascripts/rism.localisation.js b/app/assets/javascripts/rism.localisation.js deleted file mode 100644 index 54d74ac72..000000000 --- a/app/assets/javascripts/rism.localisation.js +++ /dev/null @@ -1,9 +0,0 @@ -select_msg = "Select a value" -new_secondary = "New autority record" -view_secondary = "View autority record" -// -delete_msg = "Delete" -delete_field_confirm = "Are you sure you want to delete this field?" -// -quick_search = "Quick search in the source database" -tips_on_quick_search = "Tips on quick search:" \ No newline at end of file diff --git a/app/assets/javascripts/tag_header_events.js b/app/assets/javascripts/tag_header_events.js index 7e6bb7c94..411ef877b 100644 --- a/app/assets/javascripts/tag_header_events.js +++ b/app/assets/javascripts/tag_header_events.js @@ -41,9 +41,9 @@ used for _tag_header partial function tag_header_delete(button_id) { // FIXME dialog should not be hardcoded - $('#dialog').html('
' + delete_field_confirm + '
'); + $('#dialog').html('' + I18n.t("marc_editor.delete_field_confirm") + '
'); $("#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() { diff --git a/app/assets/javascripts/verovio_preload.js b/app/assets/javascripts/verovio_preload.js index 7bfe73797..2c4ba6635 100644 --- a/app/assets/javascripts/verovio_preload.js +++ b/app/assets/javascripts/verovio_preload.js @@ -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({ @@ -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, @@ -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 { diff --git a/app/views/advanced/_advanced_search_form.html.erb b/app/views/advanced/_advanced_search_form.html.erb index 9e41ab007..a60beef3a 100644 --- a/app/views/advanced/_advanced_search_form.html.erb +++ b/app/views/advanced/_advanced_search_form.html.erb @@ -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'); } diff --git a/app/views/marc_show/_show_incipit.html.erb b/app/views/marc_show/_show_incipit.html.erb index 93b47ecb8..0b2c9c6a5 100644 --- a/app/views/marc_show/_show_incipit.html.erb +++ b/app/views/marc_show/_show_incipit.html.erb @@ -84,13 +84,11 @@