votes_cid.html 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. {% extends "base_generic.html" %}
  2. {% load tags %}
  3. {% block script %}
  4. <script>
  5. $(document).ready(function(){
  6. $('form').submit(function () {
  7. if () {
  8. alert('CID doubled');
  9. return false;
  10. }
  11. });
  12. });
  13. </script>
  14. {% endblock %}
  15. {% block content %}
  16. <div class="container-fluid">
  17. {% if user.is_superuser %}
  18. <h3 style="margin-top: 10px">Votesoverwiev </h3>
  19. <form class="form-inline" method="POST"> {% csrf_token %}
  20. <table class="table table-sm table-hover">
  21. <caption>* FP = Future trends & Prototypes; AA = Animated Architecture; MA = Money Architecture; SMA = Spatial Media Art; PAUI = Participatory Architecture & Urban Interaction</caption>
  22. <thead class="">
  23. <tr>
  24. <th scope="col"></th>
  25. <th scope="col"> Product</th>
  26. <th scope="col"> Category</th>
  27. <th scope="col"> Average</th>
  28. <th scope="col"> CID</th>
  29. <th scope="col"> submitted</th>
  30. </tr>
  31. {% for Product in Product_list %}
  32. <tr class="{% get_sucsess Product %}" >
  33. <td scope="col"><img src="{{Product.media_set.first.image_small.url}}" width="50" height="50" alt="{{ Product.pk }}"> </td>
  34. <td scope="col"> <a href="{% url 'product-detail' Product.pk %}"> {{Product.name|upper }} </a></td>
  35. <td scope="col">
  36. {% for category in Product.category.all %}
  37. {{category.short_name}}{% if not forloop.last %} | {% endif %}
  38. {% endfor %}
  39. </td>
  40. <td scope="col"> {% get_avg Product %}</td>
  41. <td scope="col"> <input type="text" id="{{ Product.pk }}cid" name="{{ Product.pk }}.cid" placeholder="{{Product.class_cid}}"> </td>
  42. <td scope="col"> <input type="text" id="{{ Product.pk }}sub" name="{{ Product.pk }}.sub" placeholder="{{Product.sumbitted}}"> </td>
  43. </tr>
  44. {% endfor %}
  45. </table>
  46. <button class="btn border-dark rounded-0 mybtn" type="submit">Submit </button>
  47. </form>
  48. {% else %}
  49. <p>You are not authorized to view this page. </p>
  50. {% endif %}
  51. {% endblock %}