diff --git a/maloja/apis/native_v1.py b/maloja/apis/native_v1.py index e8e557e..ba6b71a 100644 --- a/maloja/apis/native_v1.py +++ b/maloja/apis/native_v1.py @@ -44,7 +44,7 @@ errors = { "error":{ 'type':'missing_scrobble_data', 'value':e.params, - 'desc':"A scrobble requires these parameters." + 'desc':"The scrobble is missing needed parameters." } }), database.exceptions.EntityExists: lambda e: (409,{ diff --git a/maloja/web/jinja/abstracts/base.jinja b/maloja/web/jinja/abstracts/base.jinja index ad38cdd..b88b902 100644 --- a/maloja/web/jinja/abstracts/base.jinja +++ b/maloja/web/jinja/abstracts/base.jinja @@ -86,6 +86,9 @@ {% block icon_bar %}{% endblock %} {% include 'icons/settings.jinja' %} +
diff --git a/maloja/web/jinja/artist.jinja b/maloja/web/jinja/artist.jinja index 5675127..d8f4fbc 100644 --- a/maloja/web/jinja/artist.jinja +++ b/maloja/web/jinja/artist.jinja @@ -32,6 +32,7 @@ {% include 'icons/edit.jinja' %} {% include 'icons/merge.jinja' %} {% include 'icons/merge_mark.jinja' %} + {% include 'icons/merge_cancel.jinja' %} {% endif %} {% endblock %} diff --git a/maloja/web/jinja/icons/merge.jinja b/maloja/web/jinja/icons/merge.jinja index ff722fd..da65e8b 100644 --- a/maloja/web/jinja/icons/merge.jinja +++ b/maloja/web/jinja/icons/merge.jinja @@ -1,4 +1,4 @@ -
+
diff --git a/maloja/web/jinja/icons/merge_cancel.jinja b/maloja/web/jinja/icons/merge_cancel.jinja new file mode 100644 index 0000000..161d007 --- /dev/null +++ b/maloja/web/jinja/icons/merge_cancel.jinja @@ -0,0 +1,10 @@ +
+ + + + +
diff --git a/maloja/web/jinja/icons/merge_mark.jinja b/maloja/web/jinja/icons/merge_mark.jinja index 74bdad5..62deac8 100644 --- a/maloja/web/jinja/icons/merge_mark.jinja +++ b/maloja/web/jinja/icons/merge_mark.jinja @@ -1,4 +1,4 @@ -
+
diff --git a/maloja/web/jinja/track.jinja b/maloja/web/jinja/track.jinja index dfc5815..561dc68 100644 --- a/maloja/web/jinja/track.jinja +++ b/maloja/web/jinja/track.jinja @@ -27,6 +27,7 @@ {% include 'icons/edit.jinja' %} {% include 'icons/merge.jinja' %} {% include 'icons/merge_mark.jinja' %} + {% include 'icons/merge_cancel.jinja' %} {% endif %} {% endblock %} diff --git a/maloja/web/static/css/grisons.css b/maloja/web/static/css/grisons.css index 625b877..797fced 100644 --- a/maloja/web/static/css/grisons.css +++ b/maloja/web/static/css/grisons.css @@ -156,5 +156,5 @@ input:focus { .hide { - display:none; + display:none !important; } diff --git a/maloja/web/static/js/edit.js b/maloja/web/static/js/edit.js index b108fbb..d9c674a 100644 --- a/maloja/web/static/js/edit.js +++ b/maloja/web/static/js/edit.js @@ -108,6 +108,38 @@ function doneEditing() { // MERGING +function showValidMergeIcons() { + const lcst = window.sessionStorage; + var key = "marked_for_merge_" + entity_type; + var current_stored = (lcst.getItem(key) || '').split(","); + current_stored = current_stored.filter((x)=>x).map((x)=>parseInt(x)); + + var mergeicon = document.getElementById('mergeicon'); + var mergemarkicon = document.getElementById('mergemarkicon'); + var mergecancelicon = document.getElementById('mergecancelicon'); + + mergeicon.classList.add('hide'); + mergemarkicon.classList.add('hide'); + mergecancelicon.classList.add('hide'); + + if (current_stored.length == 0) { + mergemarkicon.classList.remove('hide'); + } + else { + mergecancelicon.classList.remove('hide'); + + if (current_stored.includes(entity_id)) { + + } + else { + mergemarkicon.classList.remove('hide'); + mergeicon.classList.remove('hide'); + } + } + +} + + function markForMerge() { const lcst = window.sessionStorage; var key = "marked_for_merge_" + entity_type; @@ -117,6 +149,7 @@ function markForMerge() { current_stored = [...new Set(current_stored)]; lcst.setItem(key,current_stored); //this already formats it correctly notify("Success","Marked " + entity_name + " for merge, currently " + current_stored.length + " marked!") + showValidMergeIcons(); } function merge() { @@ -147,3 +180,10 @@ function merge() { lcst.removeItem(key); } + +function cancelMerge() { + const lcst = window.sessionStorage; + var key = "marked_for_merge_" + entity_type; + lcst.setItem(key,[]); + showValidMergeIcons(); +}