page.html 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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}}')">{% if item.sd_groupe %}[{{ item.sd_groupe }}] {% endif %}{{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. {% if page.groupe %}
  57. <h4> <i class="fas fa-tags"></i> Les Groupes </h4>
  58. <p class="card-text">
  59. {% for grp in page.groupe %}
  60. <a href="{{request.path}}?grp={{grp.g_nom_slugify}}" class="btn btn-dark mb-2" tabindex="-1" role="button" aria-disabled="true">{{grp.g_nom}}</a>
  61. {% endfor %}
  62. <a href="{{request.path}}" class="btn btn-dark mb-2" tabindex="-1" role="button" aria-disabled="true">Aucun</a>
  63. {% endif %}
  64. </div>
  65. {% endif %}
  66. {% endblock %}
  67. {% block script %}
  68. <script type="text/javascript">
  69. function bt_open_url(url){
  70. {% comment %} window.open(url,'_blank'); {% endcomment %}
  71. window.location.href=url;
  72. };
  73. </script>
  74. {% endblock %}