settings_index.tpl 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. <script>
  2. $(document).ready(function() {
  3. $.ajax({
  4. url:'{{ web_admin_ajax_url }}?a=version',
  5. success:function(version){
  6. $(".admin-block-version").html(version);
  7. }
  8. });
  9. {% if _u.is_admin %}
  10. (function(CKEDITOR) {
  11. CKEDITOR.replace('extra_content');
  12. var extraContentEditor = CKEDITOR.instances.extra_content;
  13. $('a.admin-edit-block').on('click', function(e) {
  14. e.preventDefault();
  15. var $self = $(this);
  16. var extraContent = $.ajax('{{ _p.web_ajax }}admin.ajax.php', {
  17. type: 'post',
  18. data: {
  19. a: 'get_extra_content',
  20. block: $self.data('id')
  21. }
  22. });
  23. $.when(extraContent).done(function(content) {
  24. extraContentEditor.setData(content);
  25. $('#extra-block').val($self.data('id'));
  26. $('#modal-extra-title').text($self.data('label'));
  27. $('#modal-extra').modal('show');
  28. });
  29. });
  30. })(window.CKEDITOR);
  31. {% endif %}
  32. });
  33. </script>
  34. <section id="settings">
  35. {% for block_item in blocks %}
  36. {% if loop.index % 2 == 0 %}
  37. <div class="row">
  38. {% endif %}
  39. <div id="tabs-{{ loop.index }}" class="col-md-6">
  40. <div class="panel panel-default {{ block_item.class }}">
  41. <div class="panel-heading">
  42. {{ block_item.icon }} {{ block_item.label }}
  43. {% if block_item.editable and _u.is_admin %}
  44. <a class="admin-edit-block pull-right" href="#" data-label="{{ block_item.label }}" title="{{ 'Edit' | get_lang }}" data-id="{{ block_item.class }}">
  45. <img src="{{ _p.web_img }}icons/22/edit.png" alt="{{ 'Edit' | get_lang }}">
  46. </a>
  47. {% endif %}
  48. </div>
  49. <div class="panel-body">
  50. <div style="display: block;">
  51. {{ block_item.search_form }}
  52. </div>
  53. {% if block_item.items is not null %}
  54. <div class="block-items-admin">
  55. <ul class="list-items-admin">
  56. {% for url in block_item.items %}
  57. <li>
  58. <a href="{{ url.url }}">
  59. {{ url.label }}
  60. </a>
  61. </li>
  62. {% endfor %}
  63. </ul>
  64. </div>
  65. {% endif %}
  66. {% if block_item.extra is not null %}
  67. <div>
  68. {{ block_item.extra }}
  69. </div>
  70. {% endif %}
  71. {% if block_item.extraContent %}
  72. <div>{{ block_item.extraContent }}</div>
  73. {% endif %}
  74. </div>
  75. </div>
  76. </div>
  77. {% if loop.index % 2 == 0 %}
  78. </div>
  79. {% endif %}
  80. {% endfor %}
  81. </section>
  82. {% if _u.is_admin %}
  83. <div class="modal fade" id="modal-extra">
  84. <div class="modal-dialog">
  85. <div class="modal-content">
  86. <div class="modal-header">
  87. <button type="button" class="close" data-dismiss="modal" aria-label="{{ 'Close' | get_lang }}">
  88. <span aria-hidden="true">&times;</span>
  89. </button>
  90. <h4 class="modal-title" id="modal-extra-title">{{ 'Blocks' | get_lang }}</h4>
  91. </div>
  92. <div class="modal-body">
  93. {{ extraDataForm }}
  94. </div>
  95. </div>
  96. </div>
  97. </div>
  98. {% endif %}