can now delete posts and topics
This commit is contained in:
parent
5bd92689e1
commit
6b0cd847c6
4 changed files with 26 additions and 5 deletions
|
|
@ -1,7 +1,3 @@
|
||||||
.topic_list {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
.topic_list_element {
|
.topic_list_element {
|
||||||
box-shadow: 3px 3px 11px 4px rgb(231, 231, 231);
|
box-shadow: 3px 3px 11px 4px rgb(231, 231, 231);
|
||||||
-webkit-box-shadow: 3px 3px 11px 4px rgb(231, 231, 231);
|
-webkit-box-shadow: 3px 3px 11px 4px rgb(231, 231, 231);
|
||||||
|
|
@ -17,3 +13,13 @@
|
||||||
padding: 0.5em 0.5em 0.5em 1em;
|
padding: 0.5em 0.5em 0.5em 1em;
|
||||||
margin: 2em 0.5em 0.5em 0;
|
margin: 2em 0.5em 0.5em 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.btn-danger {
|
||||||
|
background-color: #dc3545 !important;
|
||||||
|
margin-left: 3em;
|
||||||
|
}
|
||||||
|
|
||||||
|
span {
|
||||||
|
display: block !important;
|
||||||
|
margin: auto;
|
||||||
|
}
|
||||||
|
|
@ -19,6 +19,11 @@
|
||||||
<li class="topic_list_element" draggable="true" ondragstart="drag(event)"
|
<li class="topic_list_element" draggable="true" ondragstart="drag(event)"
|
||||||
id="list_elem_post_{{ post.id }}">
|
id="list_elem_post_{{ post.id }}">
|
||||||
<a href="{% url 'readpost' title=post.title %}">{{ post }}</a>
|
<a href="{% url 'readpost' title=post.title %}">{{ post }}</a>
|
||||||
|
<a href="/admin/blog/blogpost/{{ post.id }}/delete">
|
||||||
|
<button class="btn waves-effect waves-light btn-danger">
|
||||||
|
<span class="material-icons">delete</span>
|
||||||
|
</button>
|
||||||
|
</a>
|
||||||
</li>
|
</li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,11 @@
|
||||||
{% load tree_utils %}
|
{% load tree_utils %}
|
||||||
<li class="topic_list_element" draggable="true" ondragstart="drag(event)"
|
<li class="topic_list_element" draggable="true" ondragstart="drag(event)"
|
||||||
id="list_elem_{{ topic.id }}"> {{ topic.name }}
|
id="list_elem_{{ topic.id }}"> {{ topic.name }}
|
||||||
|
<a href="/admin/blog/topic/{{ topic.id }}/delete">
|
||||||
|
<button class="btn waves-effect waves-light btn-danger"><span class="material-icons">
|
||||||
|
delete
|
||||||
|
</span></button>
|
||||||
|
</a>
|
||||||
{% if topic|has_children %}
|
{% if topic|has_children %}
|
||||||
<ul class="topic_list" ondrop="drop(event)" ondragover="allowDrop(event)" id="list_{{ topic.id }}">
|
<ul class="topic_list" ondrop="drop(event)" ondragover="allowDrop(event)" id="list_{{ topic.id }}">
|
||||||
{% for child in topic|all_children %}
|
{% for child in topic|all_children %}
|
||||||
|
|
@ -16,6 +21,11 @@
|
||||||
<li class="topic_list_element" draggable="true" ondragstart="drag(event)"
|
<li class="topic_list_element" draggable="true" ondragstart="drag(event)"
|
||||||
id="list_elem_post_{{ post.id }}">
|
id="list_elem_post_{{ post.id }}">
|
||||||
<a href="{% url 'readpost' title=post.title %}">{{ post }}</a>
|
<a href="{% url 'readpost' title=post.title %}">{{ post }}</a>
|
||||||
|
<a href="/admin/blog/blogpost/{{ post.id }}/delete">
|
||||||
|
<button class="btn waves-effect waves-light btn-danger">
|
||||||
|
<span class="material-icons">delete</span>
|
||||||
|
</button>
|
||||||
|
</a>
|
||||||
</li>
|
</li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
|
||||||
|
|
@ -4,5 +4,5 @@ from django.urls import path, include
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
path('', include('blog.urls')),
|
path('', include('blog.urls')),
|
||||||
path('admin/', admin.site.urls),
|
path('admin/', admin.site.urls),
|
||||||
path('auth/', include('django.contrib.auth.urls'))
|
path('accounts/', include('django.contrib.auth.urls'))
|
||||||
]
|
]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue