Update qute:bookmarks design.
This commit is contained in:
parent
9b07a9f77f
commit
7cb384aaf3
@ -156,6 +156,11 @@ def qute_bookmarks(_url):
|
|||||||
quickmarks = sorted(objreg.get('quickmark-manager').marks.items(),
|
quickmarks = sorted(objreg.get('quickmark-manager').marks.items(),
|
||||||
key=lambda x: x[0]) # Sort by name
|
key=lambda x: x[0]) # Sort by name
|
||||||
|
|
||||||
|
# bookmark title is url if bookmark has no title
|
||||||
|
for i, item in enumerate(bookmarks):
|
||||||
|
if not item[1]:
|
||||||
|
bookmarks[i] = (item[0], item[0])
|
||||||
|
|
||||||
html = jinja.render('bookmarks.html',
|
html = jinja.render('bookmarks.html',
|
||||||
title='Bookmarks',
|
title='Bookmarks',
|
||||||
bookmarks=bookmarks,
|
bookmarks=bookmarks,
|
||||||
|
@ -1,34 +1,95 @@
|
|||||||
{% extends "base.html" %}
|
{% extends "base.html" %}
|
||||||
|
|
||||||
{% block style %}
|
{% block style %}
|
||||||
table { border: 1px solid grey; border-collapse: collapse; width: 100%;}
|
body {
|
||||||
th, td { border: 1px solid grey; padding: 0px 5px; }
|
background: #fefefe;
|
||||||
th { background: lightgrey; }
|
font-family: sans-serif;
|
||||||
|
margin: 0 auto;
|
||||||
|
max-width: 1280px;
|
||||||
|
padding-left: 20px;
|
||||||
|
padding-right: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
h1 {
|
||||||
|
color: #444;
|
||||||
|
font-weight: normal;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
a {
|
||||||
|
text-decoration: none;
|
||||||
|
color: #2562dc
|
||||||
|
}
|
||||||
|
|
||||||
|
a:hover {
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
|
||||||
|
.url a {
|
||||||
|
color: #444;
|
||||||
|
}
|
||||||
|
|
||||||
|
table {
|
||||||
|
border-collapse: collapse;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
th {
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
tbody tr:nth-child(odd) {
|
||||||
|
background-color: #f8f8f8;
|
||||||
|
}
|
||||||
|
|
||||||
|
.qmarks .name {
|
||||||
|
padding-left: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.empty {
|
||||||
|
background-color: #f8f8f8;
|
||||||
|
color: #444;
|
||||||
|
display: inline-block;
|
||||||
|
text-align: center;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
|
||||||
<table>
|
<h1>Quickmarks</h1>
|
||||||
<tr>
|
|
||||||
<th><h3>Bookmark</h3></th>
|
{% if quickmarks|length %}
|
||||||
<th><h3>URL</h3></th>
|
<table class="qmarks">
|
||||||
</tr>
|
<tbody>
|
||||||
{% for url, title in bookmarks %}
|
|
||||||
<tr>
|
|
||||||
<td><a href="{{url}}">{{title}}</a></td>
|
|
||||||
<td>{{url}}</td>
|
|
||||||
</tr>
|
|
||||||
{% endfor %}
|
|
||||||
<tr>
|
|
||||||
<th><h3>Quickmark</h3></th>
|
|
||||||
<th><h3>URL</h3></th>
|
|
||||||
</tr>
|
|
||||||
{% for name, url in quickmarks %}
|
{% for name, url in quickmarks %}
|
||||||
<tr>
|
<tr>
|
||||||
<td><a href="{{url}}">{{name}}</a></td>
|
<td class="name"><a href="{{url}}">{{name}}</a></td>
|
||||||
<td>{{url}}</td>
|
<td class="url"><a href="{{url}}">{{url}}</a></td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
{% else %}
|
||||||
|
<span class="empty">You have no quickmarks</span>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
<h1>Bookmarks</h1>
|
||||||
|
|
||||||
|
{% if bookmarks|length %}
|
||||||
|
<table class="bmarks">
|
||||||
|
<tbody>
|
||||||
|
{% for url, title in bookmarks %}
|
||||||
|
<tr>
|
||||||
|
<td class="name"><a href="{{url}}">{{title}}</a></td>
|
||||||
|
<td class="url"><a href="{{url}}">{{url}}</a></td>
|
||||||
|
</tr>
|
||||||
|
{% endfor %}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
{% else %}
|
||||||
|
<span class="empty">You have no bookmarks</span>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
Loading…
Reference in New Issue
Block a user