recursive tags_w_lists
This commit is contained in:
parent
bd87247240
commit
ef62052984
@ -131,7 +131,7 @@ def tags_w_lists():
|
||||
t = {'tag': k, 'desc': v['desc']}
|
||||
l = []
|
||||
for m in v['lists']:
|
||||
l += recursive_info(m)
|
||||
l += recursive_info(m, keep_hierachy=True)
|
||||
t['lists'] = l
|
||||
tags.append(t)
|
||||
return tags
|
||||
@ -189,11 +189,23 @@ def recursive_urls(msg):
|
||||
return r
|
||||
|
||||
# <li><a href="' + h.url+ '" target="_blank">' + h.subject + '</a> -- <i>' + h.author_name + '</i>
|
||||
def recursive_info(msg):
|
||||
def recursive_info(msg, keep_hierachy=False):
|
||||
|
||||
r = [{'url': msg['url'], 'subject': msg['subject'], 'author_name': msg['author_name']}]
|
||||
|
||||
if keep_hierachy:
|
||||
rr = []
|
||||
|
||||
if 'follow-up' in list(msg.keys()):
|
||||
for m in msg['follow-up']:
|
||||
if keep_hierachy:
|
||||
rr += recursive_info(m)
|
||||
else:
|
||||
r += recursive_info(m)
|
||||
|
||||
if keep_hierachy:
|
||||
r[0]['follow'] = rr #note: change of field name
|
||||
|
||||
return r
|
||||
|
||||
def commit_selection(li, url, tag):
|
||||
|
||||
@ -1,54 +1,11 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>URLCOLLECT</title>
|
||||
<link rel="stylesheet" href="{{ url_for('static',filename='jquery.tag-editor.css') }}">
|
||||
<link rel="stylesheet" href="{{ url_for('static',filename='lestyle.css') }}">
|
||||
</head>
|
||||
<body>
|
||||
<form action="/collect" method="get" id="collect">
|
||||
<h2>*************************************GET::</h2>
|
||||
|
||||
<label for="url">url</label>
|
||||
<input type="text" name="url" id="url">
|
||||
|
||||
<br><br>
|
||||
{% for l in lists %}
|
||||
{{l}} <input type="radio" name="list" value="{{l}}">
|
||||
{% endfor %}
|
||||
|
||||
|
||||
<br><br>
|
||||
|
||||
<label for="tags">tags</label>
|
||||
<input type="text" name="tags" id="tags">
|
||||
|
||||
<br><br>
|
||||
<label for="tags">existing tags: </label>
|
||||
<pre id="list_tags">
|
||||
{% for t in tags %}
|
||||
{{t}}
|
||||
{% endfor %}
|
||||
</pre>
|
||||
|
||||
<br><br>
|
||||
|
||||
<button type="submit" id="submit">collect!</button>
|
||||
|
||||
<br><br>
|
||||
---
|
||||
<br>
|
||||
<pre id="report"></pre>
|
||||
---
|
||||
<br>
|
||||
<pre id="serv"></pre>
|
||||
|
||||
</form>
|
||||
<div id="collected"></div>
|
||||
<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
|
||||
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
|
||||
<script src="{{ url_for('static',filename='jquery.caret.min.js') }}"></script>
|
||||
<script src="{{ url_for('static',filename='jquery.tag-editor.min.js') }}"></script>
|
||||
<script src="{{ url_for('static',filename='collect.js') }}"></script>
|
||||
<h1>-INDEX-</h1>
|
||||
<h2><a href="/search">SEARCH</a></h2>
|
||||
<h2><a href="/tags">TAGS</a></h2>
|
||||
<h2><a href="/tags_w_lists">TAGS_W_LISTS</a></h2>
|
||||
</body>
|
||||
</html>
|
||||
@ -22,8 +22,13 @@
|
||||
</form>
|
||||
<lists>
|
||||
<ul>
|
||||
{% for h in v.lists %}
|
||||
{% for h in v.lists recursive %}
|
||||
<li data-tag="{{v.tag}}" data-url="{{h.url}}"><a href="{{h.url}}" target="_blank">{{h.subject}}</a> -- <i>{{h.author_name}}</i> <button class="del">del</button></li>
|
||||
{% if h.follow %}
|
||||
<ul>
|
||||
{{ loop(h.follow) }}
|
||||
</ul>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</lists>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user