file_upload.html 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. {% extends "base_generic.html" %}
  2. {% load static %}
  3. {% load crispy_forms_tags %}
  4. {% crispy media media.helper %}
  5. {% block content %}
  6. <div class="container-fluid">
  7. <h3 style="margin-top: 10px">{{product.name}} Media </h3>
  8. <table class="table table-sm table-hover">
  9. {% for pic in images %}
  10. <tr class="">
  11. <td scope="col"><img src="{{ pic.image_small.url }}?v={{ pic.pk }}" width="50" height="50" alt="{{ pic.name_for }}"> </td>
  12. <td scope="col"> {{pic.name_for }} </td>
  13. <td scope="col"> <a href="{% url 'delete-media' pk=pic.pk %}"><button type="button" class="btn btn-default"><i class="fas fa-trash-alt"></i> Löschen</button> </a> </td>
  14. </tr>
  15. {% endfor %}
  16. {% for pic in video %}
  17. <tr class="">
  18. <td scope="col"><img src="{{pic.image.url}}?v={{ pic.pk }}" width="50" height="50" alt="Video: {{ pic.name_for }}"> </td>
  19. <td scope="col"> {{pic.name_for }} </td>
  20. <td scope="col"> <a href="{% url 'delete-video' pk=pic.pk %}"><button type="button" class="btn btn-default"><i class="fas fa-trash-alt"></i> Löschen</button> </a></td>
  21. </tr>
  22. {% endfor %}
  23. </table>
  24. <a href="{% url 'product-detail-type' pk=product.pk type=product.type %}"> <input class="btn mybtn border-thin" value="Show Site"></a>
  25. </div>
  26. <div class="">
  27. &nbsp;
  28. </div>
  29. <div class="container-fluid">
  30. <h4 style="margin-top: 10px">Laden Sie neue Medien hoch</h4>
  31. {% if warning%}
  32. <div class="alert alert-danger rounded-0" role="alert">
  33. {{warning}}
  34. </div>
  35. {% endif %}
  36. <p style="margin-top: 10px">Bitte laden Sie nicht mehr als sieben Bilder und zwei Videos hoch.</p>
  37. <p style="margin-top: 10px">Für eine optimale Darstellung sollten die Bilder eine Auflösung von 1920x1080 bzw. eine Seitenverhältnis von 16:9 (FullHD) haben.</p>
  38. {% if video_count and media_count%}
  39. <p style="margin-top: 10px">Sie haben zu viele Medienelemente hochgeladen. Sie können Medien löschen, um sie erneut hochzuladen.</p>
  40. {% elif video_count%}
  41. <p style="margin-top: 10px">Sie haben zu viele Videos hochgeladen. Stellen Sie sicher, dass Sie nur Fotos hochladen.</p>
  42. <link rel="stylesheet" href="{% static "ajaxuploader/css/fileuploader.css" %}">
  43. <script src="{% static "jquery/dist/jquery.js" %}"></script>
  44. <script src="{% static "ajaxuploader/js/fileuploader.js" %}"></script>
  45. <script src="{% static "file_form/file_form.js" %}"></script>
  46. <script>
  47. $(function() {
  48. initUploadFields($('#upload_mab'));
  49. });
  50. </script>
  51. <form id='upload_mab' enctype="multipart/form-data" method="post">
  52. {% csrf_token %}
  53. <div class="col-sm-10">
  54. {% crispy media %}
  55. {% include 'django_file_form/upload_template.html' %}
  56. </div>
  57. <div class="col-sm-10">
  58. <div class="buttonHolder">
  59. <input type="submit" name="add" class="btn mybtn border-thin" value="Medien hinzufügen">
  60. </div>
  61. </div>
  62. </form>
  63. {% elif media_count%}
  64. <p style="margin-top: 10px">Sie haben zu viele Fotos hochgeladen. Stellen Sie sicher, dass Sie nur Videos hochladen.</p>
  65. <link rel="stylesheet" href="{% static "ajaxuploader/css/fileuploader.css" %}">
  66. <script src="{% static "jquery/dist/jquery.js" %}"></script>
  67. <script src="{% static "ajaxuploader/js/fileuploader.js" %}"></script>
  68. <script src="{% static "file_form/file_form.js" %}"></script>
  69. <script>
  70. $(function() {
  71. initUploadFields($('#upload_mab'));
  72. });
  73. </script>
  74. <form id='upload_mab' enctype="multipart/form-data" method="post">
  75. {% csrf_token %}
  76. <div class="col-sm-10">
  77. {% crispy media %}
  78. {% include 'django_file_form/upload_template.html' %}
  79. </div>
  80. <div class="col-sm-10">
  81. <div class="buttonHolder">
  82. <input type="submit" name="add" class="btn mybtn border-thin" value="Medien hinzufügen">
  83. </div>
  84. </div>
  85. </form>
  86. {% else %}
  87. <link rel="stylesheet" href="{% static "ajaxuploader/css/fileuploader.css" %}">
  88. <script src="{% static "jquery/dist/jquery.js" %}"></script>
  89. <script src="{% static "ajaxuploader/js/fileuploader.js" %}"></script>
  90. <script src="{% static "file_form/file_form.js" %}"></script>
  91. <script>
  92. $(function() {
  93. initUploadFields($('#upload_mab'));
  94. });
  95. </script>
  96. <form id='upload_mab' enctype="multipart/form-data" method="post">
  97. {% csrf_token %}
  98. <div class="col-sm-10">
  99. {% crispy media %}
  100. {% include 'django_file_form/upload_template.html' %}
  101. </div>
  102. <div class="col-sm-10">
  103. <div class="buttonHolder">
  104. <input type="submit" name="add" class="btn mybtn border-thin" value="Medien hinzufügen">
  105. </div>
  106. </div>
  107. </form>
  108. {% endif %}
  109. </div>
  110. <div class="">
  111. &nbsp;
  112. </div>
  113. {% endblock %}