mirror of
https://github.com/krateng/maloja.git
synced 2023-08-10 21:12:55 +03:00
Updated admin panel and issues page
This commit is contained in:
parent
56cc06d905
commit
2c754c75ce
89
maloja/web/jinja/issues.jinja
Normal file
89
maloja/web/jinja/issues.jinja
Normal file
@ -0,0 +1,89 @@
|
|||||||
|
{% extends "base.jinja" %}
|
||||||
|
{% block title %}Maloja - Issues{% endblock %}
|
||||||
|
|
||||||
|
|
||||||
|
{% block scripts %}
|
||||||
|
<script src="/cookies.js"></script>
|
||||||
|
<script>
|
||||||
|
function newrule() {
|
||||||
|
keys = ""
|
||||||
|
for (var i = 1; i < arguments.length; i++) {
|
||||||
|
keys += encodeURIComponent(arguments[i]) + "&"
|
||||||
|
}
|
||||||
|
console.log(keys)
|
||||||
|
|
||||||
|
|
||||||
|
var xhttp = new XMLHttpRequest();
|
||||||
|
xhttp.open("POST","/api/newrule?", true);
|
||||||
|
xhttp.send(keys);
|
||||||
|
e = arguments[0]
|
||||||
|
line = e.parentNode
|
||||||
|
line.parentNode.removeChild(line)
|
||||||
|
}
|
||||||
|
|
||||||
|
function fullrebuild() {
|
||||||
|
|
||||||
|
var xhttp = new XMLHttpRequest();
|
||||||
|
xhttp.open("POST","/api/rebuild", true);
|
||||||
|
xhttp.send()
|
||||||
|
window.location = "/wait";
|
||||||
|
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{% set issuedata = dbp.issues() %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
|
||||||
|
<table class="top_info">
|
||||||
|
<tr>
|
||||||
|
<td class="image">
|
||||||
|
<div style="background-image:url('/favicon.png')"></div>
|
||||||
|
</td>
|
||||||
|
<td class="text">
|
||||||
|
<h1>Possible Issues</h1><br/>
|
||||||
|
<span>with your library</span>
|
||||||
|
<!--<p class="stats">KEY_ISSUES Issues</p>-->
|
||||||
|
|
||||||
|
<p>Maloja can identify possible problems with consistency or redundancy in your library. After making any changes, you should <a class="textlink" onclick='fullrebuild()'>rebuild your library</a>.</p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<table class="list">
|
||||||
|
|
||||||
|
{% if issuedata.inconsistent %}
|
||||||
|
<tr>
|
||||||
|
<td>The current database wasn't built with all current rules in effect. Any problem below might be a false alarm and fixing it could create redundant rules.</td>
|
||||||
|
<td class='button important' onclick="fullrebuild()"><div>Rebuild the database</div></td>
|
||||||
|
</tr>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% for issue in issuedata.duplicates %}
|
||||||
|
<tr>
|
||||||
|
<td>{{ htmlgenerators.artistLink(issue[0]) }} is a possible duplicate of {{ htmlgenerators.artistLink(issue[1]) }}</td>
|
||||||
|
<td class='button' onclick="newrule(this,'replaceartist','{{ issue[0] }}','{{ issue[1] }}')"><div>{{ issue[1] }} is correct</div></td>
|
||||||
|
<td class='button' onclick="newrule(this,'replaceartist','{{ issue[1] }}','{{ issue[0] }}')"><div>{{ issue[0] }} is correct</div></td>
|
||||||
|
</tr>
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
|
{% for issue in issuedata.combined %}
|
||||||
|
<tr>
|
||||||
|
<td>{{ artistLink(issue[0]) }} sounds like the combination of {{ len(issue[1]) }} artists:
|
||||||
|
{{ issue[1]|join(", ") }}
|
||||||
|
</td>
|
||||||
|
<td class='button' onclick="newrule(this,'replaceartist','{{ issue[0] }}','{{ issue[1] | join('␟') }}')"><div>Fix it</div></td>
|
||||||
|
</tr>
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
|
{% for issue in issuedata.newartists %}
|
||||||
|
<tr>
|
||||||
|
<td>Is '{{ issue[0] }}' in '{{ htmlgenerators.artistLink(issue[1]) }}' an artist?</td>
|
||||||
|
<td class='button' onclick="newrule(this,'replaceartist','{{ issue[1] }}','{{ (issue[2] + [issue[0]]) | join('␟') }}')"><div>Yes</div></td>
|
||||||
|
</tr>
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
|
</table>
|
||||||
|
|
||||||
|
{% endblock %}
|
@ -53,22 +53,6 @@
|
|||||||
window.location.reload(true);
|
window.location.reload(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
function buttonlock() {
|
|
||||||
button = document.getElementById("adminmodebutton")
|
|
||||||
if (apikeycorrect) {
|
|
||||||
button.classList.remove("locked");
|
|
||||||
if (button.innerHTML == "Activate") { button.onclick = activate; }
|
|
||||||
else { button.onclick = deactivate; }
|
|
||||||
// ugh
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
button.classList.add("locked");
|
|
||||||
button.onclick = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
window.addEventListener("load",function(){checkAPIkey(buttonlock)});
|
|
||||||
// we do this twice, but this one ensures that the button is correctly locked / unlocked after the api key has been checked
|
|
||||||
</script>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
@ -83,9 +67,7 @@
|
|||||||
<div style="background-image:url('/favicon.png')"></div>
|
<div style="background-image:url('/favicon.png')"></div>
|
||||||
</td>
|
</td>
|
||||||
<td class="text">
|
<td class="text">
|
||||||
<h1>Admin Panel</h1><br/>
|
<h1>Admin Panel</h1>
|
||||||
<br/><br/>
|
|
||||||
API Key: <input id='apikey' onchange='checkAPIkey(buttonlock);' style='width:300px;'/><br/><br/>
|
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@ -101,8 +83,8 @@
|
|||||||
<h2>Admin Mode</h2>
|
<h2>Admin Mode</h2>
|
||||||
|
|
||||||
Admin Mode allows you to manually scrobble from various places on the web interface instead of just the dedicated page.<br/><br/>
|
Admin Mode allows you to manually scrobble from various places on the web interface instead of just the dedicated page.<br/><br/>
|
||||||
<pyhp if="adminmode"><span id="adminmodebutton" class="button locked">Deactivate</span></pyhp>
|
<pyhp if="adminmode"><span id="adminmodebutton" class="button">Deactivate</span></pyhp>
|
||||||
<pyhp if="not adminmode"><span id="adminmodebutton" class="button locked">Activate</span></pyhp>
|
<pyhp if="not adminmode"><span id="adminmodebutton" class="button">Activate</span></pyhp>
|
||||||
|
|
||||||
<h2>Links</h2>
|
<h2>Links</h2>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user