1
0
mirror of https://github.com/krateng/maloja.git synced 2023-08-10 21:12:55 +03:00

Simplified some of the webpage building logic

This commit is contained in:
Krateng
2018-12-22 12:47:49 +01:00
parent 7465eadf83
commit eb9c9b2f69
7 changed files with 52 additions and 47 deletions

View File

@@ -12,7 +12,7 @@ def replacedict(keys,dbport):
if db_data["inconsistent"]:
html += "<tr>"
html += "<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>"
html += """<td class='button important' onclick="fullrebuild()">Rebuild the database</td>"""
html += """<td class='button important' onclick="fullrebuild()"><div>Rebuild the database</div></td>"""
html += "</tr>"
i += 1
for d in db_data["duplicates"]:
@@ -20,8 +20,8 @@ def replacedict(keys,dbport):
html += "<td>'" + artistLink(d[0]) + "'"
html += " is a possible duplicate of "
html += "'" + artistLink(d[1]) + "'</td>"
html += """<td class='button' onclick="newrule(this,'replaceartist','""" + d[0] + """','""" + d[1] + """')">""" + d[1] + """ is correct</td>"""
html += """<td class='button' onclick="newrule(this,'replaceartist','""" + d[1] + """','""" + d[0] + """')">""" + d[0] + """ is correct</td>"""
html += """<td class='button' onclick="newrule(this,'replaceartist','""" + d[0] + """','""" + d[1] + """')"><div>""" + d[1] + """ is correct</div></td>"""
html += """<td class='button' onclick="newrule(this,'replaceartist','""" + d[1] + """','""" + d[0] + """')"><div>""" + d[0] + """ is correct</div></td>"""
html += "</tr>"
i += 1
for c in db_data["combined"]:
@@ -30,13 +30,13 @@ def replacedict(keys,dbport):
for a in c[1]:
html += "'" + artistLink(a) + "' "
html += "</td>"
html += """<td class='button' onclick="newrule(this,'replaceartist','""" + c[0] + """','""" + "".join(c[1]) + """')">Fix it</td>"""
html += """<td class='button' onclick="newrule(this,'replaceartist','""" + c[0] + """','""" + "".join(c[1]) + """')"><div>Fix it</div></td>"""
html += "</tr>"
i += 1
for n in db_data["newartists"]:
html += "<tr>"
html += "<td>Is '" + n[0] + "' in '" + artistLink(n[1]) + "' an artist?</td>"
html += """<td class='button' onclick="newrule(this,'replaceartist','""" + n[1] + """','""" + "".join(n[2] + [n[0]]) + """')">Yes</td>"""
html += """<td class='button' onclick="newrule(this,'replaceartist','""" + n[1] + """','""" + "".join(n[2] + [n[0]]) + """')"><div>Yes</div></td>"""
html += "</tr>"
i += 1