Implement add bookmark route

This commit is contained in:
Sascha Ißbrücker
2019-06-28 19:37:41 +02:00
parent e2a834a56c
commit c653206dd3
11 changed files with 100 additions and 13 deletions

View File

@@ -9,10 +9,10 @@
{% for bookmark in bookmarks %}
<li>
<p>
<a href="{{ bookmark.url }}" target="_blank">{{ bookmark.title }}</a>
<a href="{{ bookmark.url }}" target="_blank">{{ bookmark.resolved_title }}</a>
</p>
{% if bookmark.description is not None %}
<p>{{ bookmark.description }}</p>
{% if bookmark.resolved_description is not None %}
<p>{{ bookmark.resolved_description }}</p>
{% endif %}
<p>
<a href="{% url 'bookmarks:edit' bookmark.id %}">Edit</a>

View File

@@ -2,4 +2,23 @@
{% block content %}
<h2>New bookmark</h2>
<form action="{% url 'bookmarks:new' %}" method="post">
{% csrf_token %}
<div class="field">
<label for="{{ form.url.id_for_label }}">URL</label>
{{ form.url }}
{{ form.url.errors }}
</div>
<div class="field">
<label for="{{ form.title.id_for_label }}">Title</label>
{{ form.title }}
{{ form.title.errors }}
</div>
<div class="field">
<label for="{{ form.description.id_for_label }}">Description</label>
{{ form.description }}
{{ form.description.errors }}
</div>
<input type="submit" value="Add">
</form>
{% endblock %}