123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- {% extends 'myapp/base.html' %}
- {% load static %}
- {% block msg %}
- {% if messages %}
- {% for message in messages %}
- <div {% if message.tags %} class="alert alert-{{message.tags}} alert-dismissible fade show" {% endif %}>
- <strong>{{message}}</strong>
- <button type="button" class="close" data-dismiss="alert" aria-label="Close">
- <span aria-hidden="true">×</span>
- </button>
- </div>
- {% endfor %}
- {% endif %}
- {% endblock msg %}
- {% block side %}
- <div class="col-sm-2 my-5 text-center">
- <h4 class="my-7">Profile</h4>
- <h5>{{full_name}}</h5>
- {% for group in groups %}
- <p>{{group.name}}</p>
- {% endfor %}
- </div>
- {% endblock side %}
-
- {% block content %}
- <div class="col-sm-10">
- <h3 class="text-dark my-5">Dashboard Page</h3>
- <a href="{% url 'addpost' %}" class="btn btn-success">Add Post</a>
- <h4 class="text-center alert alert-info mt-3">Show Post Information</h4>
- {% if posts %}
- <table class="table table-hover bg-white">
- <thead>
- <tr class="text-center">
- <th scope="col" style="width:2%">ID</th>
- <th scope="col" style="width:28%">Title</th>
- <th scope="col" style="width:55%">Description</th>
- <th scope="col" style="width:15%">Action</th>
- </tr>
- </thead>
- <tbody>
- {% for post in posts %}
- <tr>
- <th scope="row">{{post.id}}</th>
- <td>{{post.title}}</td>
- <td>{{post.desc}}</td>
- <td class="text-center">
- <a href="{% url 'updatepost' post.id %}" class="btn btn-warning btn-sm">Edit</a>
- {% if perms.myapp.delete_post %}
- <form action="{% url 'deletepost' post.id %}" method="post" class="d-inline">
- {% csrf_token %}
- <input type="submit" value="Delete" class="btn btn-danger btn-sm">
- </form>
- {% endif %}
- </td>
- </tr>
- {% endfor %}
- </tbody>
- </table>
- {% else %}
- <h4 class="text-center alert alert-warning">No Records</h4>
- {% endif %}
- </div>
- {% endblock content %}
|