Нет описания

customer_template_form.html 1.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. {% extends "base.html" %}
  2. {% load legacy_filters %}
  3. {% load tailwind_filters %}
  4. {% block title %}
  5. {% if view.title %}
  6. {{ view.title }}
  7. {% else %}
  8. {{ view|class_name }}
  9. {% endif %}
  10. {% endblock %}
  11. {% block content %}
  12. <div class="container mx-auto px-4 py-6">
  13. <h1 class="text-2xl font-bold mb-6">
  14. {% if view.title %}
  15. {{ view.title }}
  16. {% elif view|class_name == "CreateViewClass" %}
  17. Create {{ model_verbose_name }}
  18. {% else %}
  19. Update {{ model_verbose_name }}
  20. {% endif %}
  21. </h1>
  22. <!-- Render the Form -->
  23. <form method="post" enctype="multipart/form-data" >
  24. {% csrf_token %}
  25. <div>
  26. {{ form|crispy }}
  27. </div>
  28. <div class='mt-4'>
  29. <button type="submit" class="bg-blue-500 text-white px-4 py-2 rounded hover:bg-blue-600">
  30. Save
  31. </button>
  32. <a href="{% url list_url_name %}" class="bg-gray-300 text-gray-800 px-4 py-2 rounded hover:bg-gray-400">
  33. Cancel
  34. </a>
  35. </div>
  36. </form>
  37. </div>
  38. {% endblock %}