page.html 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. {% extends 'base.html' %}
  2. {% load crispy_forms_tags %}
  3. {% load static %}
  4. {% block main %}
  5. <div class="card-body">
  6. {% if not page.output or page.err %}
  7. {{page.p_contenu|safe}}
  8. {% else %}
  9. {% if page.err %}{{page.err|safe}}{% endif %}
  10. {% if page.output and page.err %}<hr>{% endif %}
  11. {% if page.output %}{{page.output|safe|urlize}}{% endif %}
  12. {% endif %}
  13. {% if page.speeddial %}
  14. <h3>Speed Dial</h3>
  15. <div class="container mb-4">
  16. <div class="row">
  17. {% for item in page.speeddial %}
  18. <div class="col-sm col-lg-3 mb-1">
  19. <div class="card bg-{{item.sd_color}}" style="padding: 1px;">
  20. <div class="card-body d-flex flex-row" style=" background : white; opacity: 0.85;">
  21. <div class="p-2"><a class="text-decoration-none" href="{{item.sd_adresse}}" target="_blank"><i class="{% if item.sd_icone != '' %}{{item.sd_icone }}{% else %}fas fa-external-link-square-alt{% endif %}"></i></a></div>
  22. <div class="p-2 w-80" onmouseover="this.style.cursor='pointer';" onclick="bt_open_url('{{item.sd_adresse|escapejs}}')">{{item.sd_titre}}</div>
  23. </div>
  24. </div>
  25. </div>
  26. {% endfor %}
  27. </div>
  28. </div>
  29. {% endif%}
  30. {% if page.form and not page.output %}
  31. <div class="col-sm-9 p-0 m-3">
  32. <div class="card text-white bg-dark">
  33. {% if page.p_f_titre %}<div class="card-header">{{page.p_f_titre}}</div>{% endif %}
  34. <div class="card-body">
  35. <form action="{{page.p_adresse}}" method="post">{% csrf_token %}
  36. {{ page.form|crispy }}
  37. <input type="submit" class="btn btn-success mt-1" value="Valider">
  38. </form>
  39. </div>
  40. </div>
  41. </div>
  42. {% endif %}
  43. </div>
  44. {% endblock %}
  45. {% block right_panel %}
  46. {% if page.p_right != "" %}
  47. <div class="card-body">
  48. {% if page.form and page.output %}
  49. {% if page.p_f_titre %}<div class="card-header">{{page.p_f_titre}}</div>{% endif %}
  50. <form class="mb-2" action="{{page.p_adresse}}" method="post">{% csrf_token %}
  51. {{ page.form|crispy }}
  52. <input type="submit" class="btn btn-success mt-1" value="Valider">
  53. </form>
  54. {% endif %}
  55. {{page.p_right|safe}}
  56. </div>
  57. {% endif %}
  58. {% endblock %}
  59. {% block script %}
  60. <script type="text/javascript">
  61. function bt_open_url(url){
  62. {% comment %} window.open(url,'_blank'); {% endcomment %}
  63. window.location.href=url;
  64. };
  65. </script>
  66. {% endblock %}