Add a notes template, slightly alter query
This commit is contained in:
parent
27e7624198
commit
9fb69bbf64
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,3 +1,4 @@
|
||||
__pycache__
|
||||
*.egg-info
|
||||
*.sqlite
|
||||
stickynotes.cfg
|
||||
|
18
stickynotes/templates/notes.html
Normal file
18
stickynotes/templates/notes.html
Normal file
@ -0,0 +1,18 @@
|
||||
{% extends "base.html" %}
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
{% for note in notes %}
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
{% if note.title %}
|
||||
<h5 class="card-title"><a href="/{{note.url}}">{{note.title}}</a></h5>
|
||||
{% else %}
|
||||
<h5 class="card-title"><a href="/{{note.url}}">{{note.url}}</a></h5>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endblock %}
|
@ -132,7 +132,7 @@ def view(note_url):
|
||||
|
||||
:param note_url: The note to show
|
||||
"""
|
||||
note = StickyNote.query.filter(StickyNote.url == note_url).scalar()
|
||||
note = StickyNote.query.filter(StickyNote.url == note_url).first()
|
||||
if not note:
|
||||
flash('That note does not exist', 'danger')
|
||||
return redirect('/')
|
||||
|
Loading…
Reference in New Issue
Block a user