listing all unused lables in admin panel, and imporvements to listing used ones

master
Marek Baczynski 6 years ago
parent 7b7c1145ab
commit b77c030ff0

@ -111,7 +111,15 @@ def list():
for key, value in links.items(): for key, value in links.items():
if len(value['url'])>0: if len(value['url'])>0:
linklist.append({'code':key, 'url':value['url']}) linklist.append({'code':key, 'url':value['url']})
return render_template('list.html', linklist=linklist) return render_template('list.html', linklist=linklist, count=len(linklist))
@app.route("/empty")
def showEmptyCodes():
linklist = []
for key, value in links.items():
if value['url']=='':
linklist.append({'code':key, 'url':value['url']})
return render_template('listempty.html', linklist=linklist, count=len(linklist))
@app.route('/', defaults={'path': ''}) @app.route('/', defaults={'path': ''})
@app.route('/<path:path>') @app.route('/<path:path>')

@ -1,7 +1,7 @@
{% extends 'base.html' %} {% extends 'base.html' %}
{% block content %} {% block content %}
<p>ALL used links: (this many)</p> <p>Showing all <strong>{{count}}</strong> attached links</p>
{% for label in linklist %} {% for label in linklist %}
<p> <p>
<span class="code">{{label['code']}}</span>: <span class="code">{{label['code']}}</span>:

@ -0,0 +1,11 @@
{% extends 'base.html' %}
{% block content %}
<p>Showing all <strong>{{count}}</strong> unused labels:</p>
{% for label in linklist %}
<p>
<span class="code">{{label['code']}}</span>:
<a href="/code/{{label['code']}}.png" class="linkonalist">Show QR</a> | <a href="/{{label['code']}}" class="linkonalist">Edit</a>
</p>
{% endfor %}
{% endblock %}
Loading…
Cancel
Save