diff options
| author | Bobby <[email protected]> | 2023-06-11 19:02:56 -0400 |
|---|---|---|
| committer | Bobby <[email protected]> | 2023-06-11 19:02:56 -0400 |
| commit | 114460370c2613ea103b6eb709b3ea076d045bc9 (patch) | |
| tree | 4c8880f06f1bc688ee8dc33a71279afe2abb75f6 /templates | |
| parent | 9ec43e3db2ee50be54bf2cb27da3266f697af850 (diff) | |
| download | thatcomputerscientist-114460370c2613ea103b6eb709b3ea076d045bc9.tar.xz thatcomputerscientist-114460370c2613ea103b6eb709b3ea076d045bc9.zip | |
Admin area improvements and comments management
Diffstat (limited to 'templates')
| -rw-r--r-- | templates/blog/partials/sidebar.html | 2 | ||||
| -rw-r--r-- | templates/blog_admin/comments.html | 63 | ||||
| -rw-r--r-- | templates/blog_admin/partials/posts_topbar.html | 2 | ||||
| -rw-r--r-- | templates/blog_admin/posts.html | 27 |
4 files changed, 76 insertions, 18 deletions
diff --git a/templates/blog/partials/sidebar.html b/templates/blog/partials/sidebar.html index 9699436b..68018db5 100644 --- a/templates/blog/partials/sidebar.html +++ b/templates/blog/partials/sidebar.html @@ -244,7 +244,7 @@ <img src="{% static 'images/site/icons/right_hand.gif' %}" alt="Archive" border="0"> </span> <span> - <a href="#"> + <a href="{% url 'blog-admin:comments' %}"> Manage Comments </a> </span> diff --git a/templates/blog_admin/comments.html b/templates/blog_admin/comments.html new file mode 100644 index 00000000..95ae1d96 --- /dev/null +++ b/templates/blog_admin/comments.html @@ -0,0 +1,63 @@ +{% extends 'blog/partials/base.html' %} {% block content %} +{% load static %} +<div class="main"> + <h2 class="mtctitem" {% if not messages %}style="border: none; margin-bottom: 0;"{% endif %}>{{ title }}</h2> +{% for message in messages %} +<div style="text-align:center;padding:0;"> + <p class="{{message.tags}}" style="text-align:center; margin-bottom: 15px;">{{ message }}</p> +</div> +{% endfor %} +<table id="tabular"> + <thead> + <tr> + <th colspan="3">Text</th> + <th>Author</th> + <th colspan="2">Post</th> + <th>Comment Date</th> + <th>Actions</th> + </tr> + </thead> + <tbody> + {% for comment in comments %} + <tr> + <td colspan="3">{{ comment.body }}</td> + <td>{% if comment.user %}{{ comment.user.username }}{% else %}{{ comment.anonymous_user.name }}{% endif %}</td> + <td colspan="2">{{ comment.post.title }}</td> + <td>{{ comment.created_at | date:"d.m.Y" }}</td> + <td> + <a href="{% url 'admin:blog_comment_change' comment.id %}">Edit</a> + <a href="{% url 'admin:blog_comment_delete' comment.id %}">Delete</a> + </td> + </tr> + {% endfor %} + </tbody> +</table> +{% if num_pages and page %} + <div class="pagination"> + <center> + <table id="pagination"> + <tr> + {% if page == 1 %} + <td><a class="disabled">«</a></td> + <td style="margin-right: 15px;"><a class="disabled">‹</a></td> + {% else %} + <td><a href="{% url 'blog-admin:comments' %}?page=1">«</a></td> + <td style="margin-right: 15px;"><a href="{% url 'blog-admin:comments' %}?page={{ page|add:'-1' }}">‹</a></td> + {% endif %} + {% load times %} + {% for i in num_pages|times %} + <td><a {% if i == page %}class="active"{% endif %} href="{% url 'blog-admin:comments' %}?page={{ i }}">{{ i }}</a></td> + {% endfor %} + {% if page == num_pages %} + <td style="margin-left: 15px;" class="disabled"><a class="disabled">›</a></td> + <td><a class="disabled">»</a></td> + {% else %} + <td style="margin-left: 15px;"><a href="{% url 'blog-admin:comments' %}?page={{ page|add:'1' }}">›</a></td> + <td><a href="{% url 'blog-admin:comments' %}?page={{ num_pages }}">»</a></td> + {% endif %} + </tr> + </table> + </center> + </div> +{% endif %} +{% endblock %}
\ No newline at end of file diff --git a/templates/blog_admin/partials/posts_topbar.html b/templates/blog_admin/partials/posts_topbar.html index 1e486c31..b9bad541 100644 --- a/templates/blog_admin/partials/posts_topbar.html +++ b/templates/blog_admin/partials/posts_topbar.html @@ -1,4 +1,4 @@ -<div style="float: right; position: relative; top: -10px;"> +<div style="position: relative; top: -30px;"> <form style="display: inline-block;" action="{% url 'blog-admin:posts-search' %}" method="get"> <input style="display: inline;" type="text" name="q" placeholder="Search Posts" autocomplete="off"/> <input style="display: inline;" type="submit" value="Search" class="button" /> diff --git a/templates/blog_admin/posts.html b/templates/blog_admin/posts.html index 30cfdb93..a8aac92c 100644 --- a/templates/blog_admin/posts.html +++ b/templates/blog_admin/posts.html @@ -9,11 +9,12 @@ <p class="{{message.tags}}" style="text-align:center; margin-bottom: 15px;">{{ message }}</p> </div> {% endfor %} - <table id="posts"> + <table id="tabular"> <thead> <tr> - - <th colspan="3">Article</th> + <th style="width: 28px; text-align: center;"></th> + <th style="width: 90px; text-align: center;">Cover</th> + <th colspan='1'>Article</th> <th>Author</th> <th>Created</th> <th>Category</th> @@ -23,29 +24,23 @@ <tbody> {% for post in posts %} <tr> - <td style="position: relative;"> + <td> {% if post.is_public %} - {% comment %} <span class="label label-success">Published</span> {% endcomment %} - <span> - <img src="{% static 'images/site/icons/eye_open.png' %}" alt="Home" border="0" width="24" height="24"> - </span> + <img src="{% static 'images/site/icons/eye_open.png' %}" alt="Home" border="0" width="24" height="24" style="margin-left: 2px;"> {% else %} - {% comment %} <span class="label label-warning">Draft</span> {% endif %} {% endcomment %} - <span> - <img src="{% static 'images/site/icons/eye_closed.png' %}" alt="Home" border="0" width="24" height="24"> - </span> + <img src="{% static 'images/site/icons/eye_closed.png' %}" alt="Home" border="0" width="24" height="24" style="margin-left: 2px;"> {% endif %} </td> <td> - <img src="{% url 'ignis:post_image' '80' post.id %}.gif" alt="Cover Image" style="width: 80px; display: block;"> + <img src="{% url 'ignis:post_image' '80' post.id %}.gif" alt="Cover Image" style="width: 80px; display: block; margin: 0 auto;"> </td> - <td> + <td colspan='1'> <a href="{% url 'blog:post' post.slug %}"> - <p>{{ post.title }}</p> + {{ post.title }} </a> </td> <td><a href="{% url 'blog:user_activity' post.author %}">{{ post.author }}</a></td> - <td>{{ post.date }}</td> + <td>{{ post.date | date:"d M Y" }}</td> <td><a href="{% url 'blog:categories' %}/{{ post.category.slug }}">{{ post.category }}</a></td> <td> <p><a href="{% url 'blog-admin:new-post'%}?mode=edit&post_id={{post.id}}">Edit Post Metadata</a></p> |
