rezamalik15

Django Todo Template with Bootstrap 5

May 15th, 2023
578
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 1.82 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4.     <meta charset="utf-8">
  5.     <meta name="viewport" content="width=device-width, initial-scale=1">
  6.     <title>My Todo List</title>
  7.  
  8.     {% load static %}
  9.     {# <link rel="stylesheet" href="{% static 'todo/style.css' %}"> #}
  10.  
  11.     <link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-KK94CHFLLe+nY2dmCWGMq91rCGa5gtU4mk92HdvYe+M/SXH301p5ILy+dN9+nJOZ" crossorigin="anonymous">
  12.  
  13. </head>
  14. <body>
  15.     <h1>Plan what you want to do!</h1>
  16.  
  17.     <form action="{% url 'todo-add' %}" method="POST">
  18.         {% csrf_token %}
  19.         <input type="text" name="plan">
  20.         <input class="btn btn-primary" type="submit" name="submit" value="Save">
  21.     </form>
  22.  
  23.     <ul>
  24.        {% if todos %}
  25.            {% for todo in todos %}
  26.                 {% if todo.status %}
  27.                    <li class="my-3">
  28.                        <strike>{{ todo.plan }}</strike> |
  29.                        <a href="{% url 'todo-replan' todo.id %}" class="btn btn-success">Replan</a> |
  30.                        <a href="{% url 'todo-delete' todo.id %}" class="btn btn-danger">Delete</a>
  31.                    </li>
  32.                 {% else %}
  33.                     <li class="my-3">
  34.                        {{ todo.plan }} |
  35.                        <a href="{% url 'todo-done' todo.id %}" class="btn btn-primary">Done</a> |
  36.                        <a href="{% url 'todo-delete' todo.id %} " class="btn btn-danger">Delete</a>
  37.                     </li>
  38.                 {% endif %}
  39.            {% endfor %}
  40.        {% endif %}
  41.     </ul>
  42.  
  43.     <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-ENjdO4Dr2bkBIFxQpeoTz1HIcje39Wm4jDKdf19U8gI4ddQ3GYNS7NTKfAdVQSZe" crossorigin="anonymous"></script>
  44. </body>
  45. </html>
Advertisement
Add Comment
Please, Sign In to add comment