mirror of
https://github.com/aquatix/digimarks.git
synced 2025-12-07 00:15:10 +01:00
Listing of bookmarks needs a userkey
This commit is contained in:
@@ -58,8 +58,12 @@ class Bookmark(db.Model):
|
|||||||
def index():
|
def index():
|
||||||
return object_list('index.html', Bookmark.select())
|
return object_list('index.html', Bookmark.select())
|
||||||
|
|
||||||
@app.route('/add/')
|
@app.route('/<userkey>/')
|
||||||
def add():
|
def bookmarks(userkey):
|
||||||
|
return object_list('bookmarks.html', Bookmark.select())
|
||||||
|
|
||||||
|
@app.route('/<userkey>/add/')
|
||||||
|
def add(userkey):
|
||||||
password = request.args.get('password')
|
password = request.args.get('password')
|
||||||
if password != PASSWORD:
|
if password != PASSWORD:
|
||||||
abort(404)
|
abort(404)
|
||||||
|
|||||||
34
templates/bookmarks.html
Normal file
34
templates/bookmarks.html
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>Bookmarks</title>
|
||||||
|
<link rel=stylesheet type=text/css href="{{ url_for('static', filename='css/bootstrap.min.css') }}" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div class="container">
|
||||||
|
<div class="row">
|
||||||
|
<div class="page-header">
|
||||||
|
<h1>Bookmarks</h1>
|
||||||
|
</div>
|
||||||
|
<ul class="thumbnails">
|
||||||
|
{% for bookmark in object_list %}
|
||||||
|
<li class="span6">
|
||||||
|
<div class="thumbnail">
|
||||||
|
<a href="{{ bookmark.url }}" title="{{ bookmark.url }}">
|
||||||
|
<img style="width:450px;" src="{{ bookmark.image }}" />
|
||||||
|
</a>
|
||||||
|
<p><a href="{{ bookmark.url }}">{{ bookmark.url|urlize(25) }}</a></p>
|
||||||
|
<p>{{ bookmark.created_date.strftime("%m/%d/%Y %H:%M") }}</p>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
{% endfor %}
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<div class="pagination">
|
||||||
|
{% if page > 1 %}<a href="./?page={{ page - 1 }}">Previous</a>{% endif %}
|
||||||
|
{% if pagination.get_pages() > page %}<a href="./?page={{ page + 1 }}">Next</a>{% endif %}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
Reference in New Issue
Block a user