pages.html.twig 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425
  1. {% extends 'partials/base.html.twig' %}
  2. {% macro spanToggle(input, length) %}
  3. {{ (repeat('  ', (length - input|length) / 2) ~ input ~ repeat('  ', (length - input|length) / 2))|raw }}
  4. {% endmacro %}
  5. {% macro loop(page, depth, twig_vars) %}
  6. {% import _self as self %}
  7. {% set config = twig_vars['config'] %}
  8. {% set separator = config.system.param_sep %}
  9. {% set display_field = config.plugins.admin.pages_list_display_field %}
  10. {% set base_url = twig_vars['base_url_relative'] %}
  11. {% set base_url_relative_frontend = twig_vars['base_url_relative_frontend'] %}
  12. {% set base_url_simple = twig_vars['base_url_simple'] %}
  13. {% set admin_route = twig_vars['admin_route'] %}
  14. {% set admin_lang = twig_vars['admin_lang'] %}
  15. {% set warn = twig_vars['warn'] %}
  16. {% set uri = twig_vars['uri'] %}
  17. {% if page.header.admin.children_display_order == 'collection' and page.header.content.order.by %}
  18. {% if page.header.content.order.custom %}
  19. {% set pcol = page.children().order(page.header.content.order.by, page.header.content.order.dir|default('asc'), page.header.content.order.custom) %}
  20. {% else %}
  21. {% set pcol = page.children().order(page.header.content.order.by, page.header.content.order.dir|default('asc')) %}
  22. {% endif %}
  23. {% else %}
  24. {% set pcol = page.children() %}
  25. {% endif %}
  26. {% for p in pcol %}
  27. {% set description = (not p.page ? "PLUGIN_ADMIN.FOLDER"|tu ~ ' • ' : "PLUGIN_ADMIN.PAGE"|tu ~ ' • ') ~
  28. (p.modular ? "PLUGIN_ADMIN.MODULAR"|tu ~ ' • ' : '') ~
  29. (p.routable ? "PLUGIN_ADMIN.ROUTABLE"|tu ~ ' • ' : "PLUGIN_ADMIN.NON_ROUTABLE"|tu ~ ' • ') ~
  30. (p.visible ? "PLUGIN_ADMIN.VISIBLE"|tu ~ ' • ' : "PLUGIN_ADMIN.NON_VISIBLE"|tu ~ ' • ') ~
  31. (p.published ? "PLUGIN_ADMIN.PUBLISHED"|tu ~ ' • ' : "PLUGIN_ADMIN.NON_PUBLISHED"|tu ~ ' • ') %}
  32. {% set page_url = getPageUrl(p) %}
  33. <li class="page-item" data-nav-id="{{ p.route }}">
  34. <div class="row page-item__row">
  35. <span class="page-item__toggle" {{ p.children(0).count > 0 ? 'data-toggle="children"' : ''}}>
  36. <i class="page-icon fa fa-fw fa-circle-o {{ p.children(0).count > 0 ? 'children-closed' : ''}} {{ p.modular ? 'modular' : (not p.routable ? 'not-routable' : (not p.visible ? 'not-visible' : (not p.page ? 'folder' : ''))) }}"></i>
  37. </span>
  38. <div class="page-item__content">
  39. <div class="page-item__content-name">
  40. <span data-hint="{{ description|trim(' &bull; ')|raw }}" class="hint--top page-item__content-hint">
  41. {% set page_label = attribute(p.header, display_field)|defined(attribute(p, display_field))|defined(p.title) %}
  42. <a href="{{ page_url }}" class="page-edit">{{ page_label|e }}</a>
  43. </span>
  44. {% if p.language %}
  45. <span class="badge lang {% if p.language == admin_lang %}info{% endif %}">{{p.language}}</span>
  46. {% endif %}
  47. {% if p.home %}
  48. <span class="page-home"><i class="fa fa-home"></i></span>
  49. {% endif %}
  50. </div>
  51. <p class="page-route">{{ p.header.routes.default ?: p.route }} <span class="spacer"><i class="fa fa-long-arrow-right"></i></span> {{ p.template() }}</p>
  52. </div>
  53. <span class="page-item__tools">
  54. {% if config.plugins.admin.frontend_preview_target != 'inline' %}
  55. {% set preview_target = config.plugins.admin.frontend_preview_target %}
  56. {% set preview_html = (base_url_relative_frontend|rtrim('/') ~ (p.home ? '' : p.route)) ?: '/' %}
  57. {% set preview_link = p.routable ? '<a class="page-view" target="' ~ preview_target ~ '" href="' ~ preview_html ~ '" title="' ~ "PLUGIN_ADMIN.PREVIEW"|tu ~ '"> <i class="fa fa-fw fa-eye"></i></a>' : '' %}
  58. {% else %}
  59. {% set preview_html = (base_url|rtrim('/') ~ '/preview' ~ (p.home ? '' : p.route)) ?: '/' %}
  60. {% set preview_link = p.routable ? '<a class="page-view" href="' ~ preview_html ~ '" title="' ~ "PLUGIN_ADMIN.PREVIEW"|tu ~ '"> <i class="fa fa-fw fa-eye"></i></a>' : '' %}
  61. {% endif %}
  62. {{ preview_link|raw }}
  63. {% if warn %}
  64. <a href="#delete" data-remodal-target="delete" data-delete-url="{{ uri.addNonce(page_url ~ '/task' ~ separator ~ 'delete', 'admin-form', 'admin-nonce') }}" class="page-delete" ><i class="fa fa-close"></i></a>
  65. {% else %}
  66. <a href="{{ uri.addNonce(page_url ~ '/task' ~ separator ~ 'delete', 'admin-form', 'admin-nonce') }}" class="page-delete" ><i class="fa fa-close"></i></a>
  67. {% endif %}
  68. </span>
  69. </div>
  70. {% if p.children().count > 0 %}
  71. <ul class="depth-{{ depth + 1 }}" style="display:none;">
  72. {{ self.loop(p, depth + 1, twig_vars) }}
  73. </ul>
  74. {% endif %}
  75. </li>
  76. {% endfor %}
  77. {% endmacro %}
  78. {% import _self as macro %}
  79. {% if admin.route %}
  80. {% set context = admin.page(true) %}
  81. {% endif %}
  82. {% if uri.param('new') %}
  83. {% set mode = 'new' %}
  84. {% elseif context %}
  85. {% set mode = 'edit' %}
  86. {% if context.exists %}
  87. {% set page_url = base_url ~ '/pages' ~ (context.header.routes.default ?: context.rawRoute) %}
  88. {% set exists = true %}
  89. {% set title = (context.exists ? "PLUGIN_ADMIN.EDIT"|tu : "PLUGIN_ADMIN.CREATE"|tu ) ~ " " ~ (context.header.title ?: context.title) %}
  90. {% else %}
  91. {% set title = "PLUGIN_ADMIN.ADD_PAGE"|tu %}
  92. {% endif %}
  93. {% else %}
  94. {% set mode = 'list' %}
  95. {% set title = "PLUGIN_ADMIN.PAGES"|tu %}
  96. {% endif %}
  97. {% set modular = context.modular ? 'modular_' : '' %}
  98. {% set warn = config.plugins.admin.warnings.delete_page %}
  99. {% set admin_lang = admin.session.admin_lang ?: 'en' %}
  100. {% set page_lang = context.language %}
  101. {% set type = 'page' %}
  102. {% block stylesheets %}
  103. {% if mode == 'edit' %}
  104. {% do assets.addCss(theme_url~'/css/codemirror/codemirror.css') %}
  105. {% endif %}
  106. {{ parent() }}
  107. {% endblock %}
  108. {% block javascripts %}
  109. {{ parent() }}
  110. {% endblock %}
  111. {% if config.plugins.admin.frontend_preview_target != 'inline' %}
  112. {% set preview_html = (base_url_relative_frontend|rtrim('/') ~ (context.home ? '' : context.route)) ?: '/' %}
  113. {% set preview_target = config.plugins.admin.frontend_preview_target %}
  114. {% set preview_link = context.routable ? '<a class="button" target="' ~ preview_target ~ '" href="' ~ preview_html ~ '" title="' ~ "PLUGIN_ADMIN.PREVIEW"|tu ~ '"> <i class="fa fa-fw fa-eye" style="font-size:18px;margin-right:0;"></i></a>' : '' %}
  115. {% else %}
  116. {% set preview_html = (base_url|rtrim('/') ~ '/preview' ~ (context.home ? '' : context.route)) ?: '/' %}
  117. {% set preview_link = context.routable ? '<a class="button" href="' ~ preview_html ~ '" title="' ~ "PLUGIN_ADMIN.PREVIEW"|tu ~ '"> <i class="fa fa-fw fa-eye" style="font-size:18px;margin-right:0;"></i></a>' : '' %}
  118. {% endif %}
  119. {% block titlebar %}
  120. <div class="button-bar">
  121. {% if mode == 'list' %}
  122. <a class="button" href="{{ base_url }}"><i class="fa fa-reply"></i> {{ "PLUGIN_ADMIN.BACK"|tu }}</a>
  123. {% for key, add_modal in config.plugins.admin.add_modals %}
  124. {% if add_modal.show_in|defined('bar') == 'bar' %}
  125. <a class="button {{ add_modal.link_classes }}" href="#modal-add_modal-{{ key }}" data-remodal-target="modal-add_modal-{{ key }}"><i class="fa fa-plus"></i> {{ add_modal.label|tu }}</a>
  126. {% endif %}
  127. {% endfor %}
  128. <div class="button-group">
  129. <button type="button" class="button disabled" href="#modal" data-remodal-target="modal">
  130. <i class="fa fa-plus"></i> {{ "PLUGIN_ADMIN.ADD"|tu }}
  131. </button>
  132. <button type="button" class="button dropdown-toggle" data-toggle="dropdown">
  133. <i class="fa fa-caret-down"></i>
  134. </button>
  135. <ul class="dropdown-menu">
  136. <li><a class="button" href="#modal" data-remodal-target="modal">{{ "PLUGIN_ADMIN.ADD_PAGE"|tu }}</a></li>
  137. <li><a class="button" href="#modal-folder" data-remodal-target="modal-folder">{{ "PLUGIN_ADMIN.ADD_FOLDER"|tu }}</a></li>
  138. {% if admin.modularTypes is not empty %}
  139. <li><a class="button" href="#modular" data-remodal-target="modular">{{ "PLUGIN_ADMIN.ADD_MODULAR"|tu }}</a></li>
  140. {% endif %}
  141. {% for key, add_modal in config.plugins.admin.add_modals %}
  142. {% if add_modal.show_in|defined('bar') == 'dropdown' %}
  143. <li><a class="button {{ add_modal.link_classes }}" href="#modal-add_modal-{{ key }}" data-remodal-target="modal-add_modal-{{ key }}">{{ add_modal.label|tu }}</a></li>
  144. {% endif %}
  145. {% endfor %}
  146. </ul>
  147. </div>
  148. {% if admin.multilang %}
  149. <div class="button-group">
  150. <button type="button" class="button disabled">
  151. <i class="fa fa-flag-o"></i>
  152. {% set langName = admin.siteLanguages[admin_lang] %}
  153. {{ langName[:1]|upper ~ langName[1:] }}
  154. </button>
  155. {% if admin.languages_enabled|length > 1 %}
  156. <button type="button" class="button dropdown-toggle" data-toggle="dropdown">
  157. <i class="fa fa-caret-down"></i>
  158. </button>
  159. <ul class="dropdown-menu language-switcher">
  160. {% for langCode in admin.languages_enabled %}
  161. {% set langName = admin.siteLanguages[langCode] %}
  162. {% if langCode != admin_lang %}
  163. <li><a href="{{ uri.addNonce(base_url_relative ~ theme.slug ~ '/pages/task' ~ config.system.param_sep ~ 'switchlanguage/lang' ~ config.system.param_sep ~ langCode, 'admin-form', 'admin-nonce') }}">{{ langName[:1]|upper ~ langName[1:] }}</a></li>
  164. {% endif %}
  165. {% endfor %}
  166. </ul>
  167. {% endif %}
  168. </div>
  169. {% endif %}
  170. {% elseif mode == 'edit' %}
  171. {{ preview_link|raw }}
  172. <a class="button" href="{{ base_url }}/pages" title="{{ "PLUGIN_ADMIN.BACK"|tu }}"><i class="fa fa-reply"></i></a>
  173. {% set siblings = context.parent().children() %}
  174. {% if not siblings.isFirst(context.path) %}
  175. {% set sib = siblings.nextSibling(context.path) %}
  176. {% set sib_url = base_url ~ '/pages' ~ (sib.header.routes.default ?: sib.rawRoute) %}
  177. <a class="button hidden-mobile" href="{{ sib_url }}" title="{{ "PLUGIN_ADMIN.PREVIOUS"|tu }}"><i class="fa fa-chevron-left"></i></a>
  178. {% endif %}
  179. {% if not siblings.isLast(context.path) %}
  180. {% set sib = siblings.prevSibling(context.path) %}
  181. {% set sib_url = base_url ~ '/pages' ~ (sib.header.routes.default ?: sib.rawRoute) %}
  182. <a class="button hidden-mobile" href="{{ sib_url }}" title="{{ "PLUGIN_ADMIN.NEXT"|tu }}"><i class="fa fa-chevron-right"></i></a>
  183. {% endif %}
  184. {% if exists %}
  185. <div class="button-group">
  186. <button type="button" class="button disabled" href="#modal" data-remodal-target="modal">
  187. <i class="fa fa-plus"></i> {{ "PLUGIN_ADMIN.ADD"|tu }}
  188. </button>
  189. <button type="button" class="button dropdown-toggle" data-toggle="dropdown">
  190. <i class="fa fa-caret-down"></i>
  191. </button>
  192. <ul class="dropdown-menu">
  193. <li><a class="button" href="#modal" data-remodal-target="modal">{{ "PLUGIN_ADMIN.ADD_PAGE"|tu }}</a></li>
  194. <li><a class="button" href="#modal-folder" data-remodal-target="modal-folder">{{ "PLUGIN_ADMIN.ADD_FOLDER"|tu }}</a></li>
  195. {% if admin.modularTypes is not empty %}
  196. <li><a class="button" href="#modular" data-remodal-target="modular">{{ "PLUGIN_ADMIN.ADD_MODULAR"|tu }}</a></li>
  197. {% endif %}
  198. </ul>
  199. </div>
  200. <a class="button disable-after-click" href="{{ uri.addNonce(page_url ~ '/task' ~ config.system.param_sep ~ 'copy', 'admin-form', 'admin-nonce') }}" class="page-copy" ><i class="fa fa-copy"></i> {{ "PLUGIN_ADMIN.COPY"|tu }}</a>
  201. <a class="button" href="#" data-remodal-target="move"><i class="fa fa-arrows"></i> {{ "PLUGIN_ADMIN.MOVE"|tu }}</a>
  202. {% if config.plugins['admin-pro'].enabled %}
  203. <a class="button" href="#" data-remodal-target="revisions"><i class="fa fa-history"></i> {{ "PLUGIN_ADMIN_PRO.REVISIONS"|tu }}</a>
  204. {% endif %}
  205. {% if warn %}
  206. <a class="button" href="#delete" data-remodal-target="delete" data-delete-url="{{ uri.addNonce(page_url ~ '/task' ~ config.system.param_sep ~ 'delete', 'admin-form', 'admin-nonce') }}"><i class="fa fa-close"></i> {{ "PLUGIN_ADMIN.DELETE"|tu }}</a>
  207. {% else %}
  208. <a class="button disable-after-click" href="{{ uri.addNonce(uri.route(true) ~ '/task' ~ config.system.param_sep ~ 'delete', 'admin-form', 'admin-nonce') }}" class="page-delete" ><i class="fa fa-close"></i></a>
  209. {% endif %}
  210. {% endif %}
  211. <div class="button-group">
  212. <button class="button" name="task" value="save" form="blueprints" type="submit"><i class="fa fa-check"></i> {{ "PLUGIN_ADMIN.SAVE"|tu }}</button>
  213. {% if exists and admin.multilang %}
  214. {% if context.untranslatedLanguages %}
  215. <button type="button" class="button dropdown-toggle" data-toggle="dropdown">
  216. <i class="fa fa-caret-down"></i>
  217. </button>
  218. <ul class="dropdown-menu lang-switcher">
  219. {% for langCode in context.untranslatedLanguages %}
  220. {% set langName = admin.siteLanguages[langCode] %}
  221. {% if langCode != page_lang %}
  222. <li><button class="button task" name="task" value="saveas" lang="{{langCode}}" form="blueprints" type="submit">{{ "PLUGIN_ADMIN.SAVE_AS"|tu }} {{ langName[:1]|upper ~ langName[1:] }}</button>
  223. {% endif %}
  224. {% endfor %}
  225. </ul>
  226. {% endif %}
  227. {% endif %}
  228. </div>
  229. {% endif %}
  230. </div>
  231. {% if mode == 'new' %}
  232. <h1><i class="fa fa-fw fa-file-text-o"></i> {{ "PLUGIN_ADMIN.ADD_PAGE"|tu }}</h1>
  233. {% elseif mode == 'edit' %}
  234. <h1><i class="fa fa-fw fa-file-text-o"></i>
  235. {{ context.menu }}
  236. </h1>
  237. {% else %}
  238. <h1><i class="fa fa-fw fa-file-text-o"></i> {{ "PLUGIN_ADMIN.MANAGE_PAGES"|tu }}</h1>
  239. {% endif %}
  240. {% endblock %}
  241. {% block content %}
  242. <div class="clear admin-pages">
  243. {% if mode == 'new' %}
  244. {% include 'partials/blueprints-new.html.twig' with { blueprints: admin.blueprints('pages/page'), data: context } %}
  245. {% elseif mode == 'edit' %}
  246. <div class="admin-form-wrapper">
  247. <div id="admin-topbar">
  248. {% if admin.multilang and page_lang %}
  249. <div id="admin-lang-toggle" class="button-group">
  250. <button type="button" class="button disabled">
  251. {% if exists %}
  252. {{ page_lang }}
  253. {% else %}
  254. {{ admin_lang }}
  255. {% endif %}
  256. </button>
  257. {% if exists and context.translatedLanguages|length > 1 %}
  258. <button type="button" class="button dropdown-toggle" data-toggle="dropdown">
  259. <i class="fa fa-caret-down"></i>
  260. </button>
  261. <ul class="dropdown-menu language-switcher">
  262. {% for language, route in context.translatedLanguages %}
  263. {% if language != page_lang %}
  264. <li><button class="task" name="task" value="switchlanguage" lang="{{language}}" redirect="{{context.rawRoute|trim('/')}}" form="blueprints">{{ language }}</button>
  265. {% endif %}
  266. {% endfor %}
  267. </ul>
  268. {% endif %}
  269. </div>
  270. {% endif %}
  271. {% if context.blueprints.fields %}
  272. {% set normalText = "PLUGIN_ADMIN.NORMAL"|tu %}
  273. {% set expertText = "PLUGIN_ADMIN.EXPERT"|tu %}
  274. {% set maxLen = max([normalText|length, expertText|length]) %}
  275. {% set normalText = macro.spanToggle(normalText, maxLen) %}
  276. {% set expertText = macro.spanToggle(expertText, maxLen) %}
  277. <form id="admin-mode-toggle">
  278. <div class="switch-toggle switch-grav">
  279. <input type="radio" value="normal" data-leave-url="{{ base_url }}/pages/{{ admin.route|trim('/') }}/mode{{ config.system.param_sep }}normal" id="normal" name="mode-switch" class="highlight" {% if admin.session.expert == '0' %} checked="checked"{% endif %}>
  280. <label for="normal">{{ normalText|raw }}</label>
  281. <input type="radio" value="expert" data-leave-url="{{ base_url }}/pages/{{ admin.route|trim('/') }}/mode{{ config.system.param_sep }}expert" id="expert" name="mode-switch" class="highlight" {% if admin.session.expert == '1' %} checked="checked"{% endif %}>
  282. <label for="expert">{{ expertText|raw }}</label>
  283. <a></a>
  284. </div>
  285. </form>
  286. {% endif %}
  287. </div>
  288. {# Set current form data back into page content #}
  289. {% if current_form_data %}
  290. {% do context.header(current_form_data.header) %}
  291. {% do context.content(current_form_data.content) %}
  292. {% endif %}
  293. {% if context.blueprints.fields and admin.session.expert == '0' %}
  294. {% include 'partials/blueprints.html.twig' with { blueprints: context.blueprints, data: context } %}
  295. {% else %}
  296. {% include 'partials/blueprints-raw.html.twig' with { blueprints: admin.blueprints('admin/pages/'~modular~'raw'), data: context } %}
  297. {% endif %}
  298. </div>
  299. {% else %}
  300. <form id="page-filtering">
  301. <div class="page-filters">
  302. <input type="text" data-filter-labels="{{ [{'id': 'mode', 'name': 'PLUGIN_ADMIN.PAGE_MODES'|tu}, {'id': 'type', 'name': 'PLUGIN_ADMIN.PAGE_TYPES'|tu}, {'id': 'access', 'name': 'PLUGIN_ADMIN.ACCESS_LEVELS'|tu}] |json_encode|e('html_attr')}}" data-filter-types="{{ admin.types|merge(admin.modularTypes)|json_encode|e('html_attr') }}" data-filter-access-levels="{{ admin.accessLevels|json_encode|e('html_attr') }}" placeholder="{{ "PLUGIN_ADMIN.ADD_FILTERS"|tu }}" class="page-filter" name="page-filter" />
  303. </div>
  304. <div class="page-search">
  305. <input type="text" placeholder="{{ "PLUGIN_ADMIN.SEARCH_PAGES"|tu }}" name="page-search" />
  306. </div>
  307. <div class="page-shortcuts">
  308. <span class="button button-x-small" data-page-toggleall="expand"><i class="fa fa-fw fa-plus-circle"></i> {{ "PLUGIN_ADMIN.EXPAND_ALL"|tu }}</span>
  309. <span class="button button-x-small" data-page-toggleall="collapse"><i class="fa fa-fw fa-minus-circle"></i> {{ "PLUGIN_ADMIN.COLLAPSE_ALL"|tu }}</span>
  310. </div>
  311. </form>
  312. <div class="pages-list">
  313. <ul class="depth-0">
  314. {{ macro.loop(pages, 0, _context) }}
  315. </ul>
  316. {% include 'partials/page-legend.html.twig' %}
  317. </div>
  318. {% endif %}
  319. </div>
  320. {% if context %}
  321. {% set obj_data = clone(context) %}
  322. {% if mode == 'edit' %}
  323. {% do obj_data.folder('') %}
  324. {% endif %}
  325. {% endif %}
  326. {% if mode == 'list' or mode == 'edit' %}
  327. <div class="remodal" data-remodal-id="modal" data-remodal-options="hashTracking: false">
  328. {% include 'partials/blueprints-new.html.twig' with { blueprints: admin.blueprints('admin/pages/new'), data: obj_data, form_id:'new-page' } %}
  329. </div>
  330. <div class="remodal" data-remodal-id="modal-folder" data-remodal-options="hashTracking: false">
  331. {% include 'partials/blueprints-new-folder.html.twig' with { blueprints: admin.blueprints('admin/pages/new_folder'), data: obj_data, form_id:'new-folder' } %}
  332. </div>
  333. <div class="remodal" data-remodal-id="modular" data-remodal-options="hashTracking: false">
  334. {% include 'partials/blueprints-new.html.twig' with { blueprints: admin.blueprints('admin/pages/modular_new'), data: obj_data, form_id:'new-modular' } %}
  335. </div>
  336. {% for key, add_modal in config.plugins.admin.add_modals %}
  337. <div class="remodal {{ add_modal.modal_classes|defined('') }}" data-remodal-id="modal-add_modal-{{ key }}" data-remodal-options="hashTracking: false">
  338. {% include add_modal.template|defined('partials/blueprints-new.html.twig') with { blueprints: admin.blueprints(add_modal.blueprint), data: context, form_id:'add-modal' }|merge(add_modal.with|defined({})) %}
  339. </div>
  340. {% endfor %}
  341. {% endif %}
  342. {% if mode == 'edit' %}
  343. <div class="remodal" data-remodal-id="move" data-remodal-options="hashTracking: false">
  344. {% include 'partials/page-move.html.twig' with { blueprints: admin.blueprints('admin/pages/move'), data: context } %}
  345. </div>
  346. <div class="remodal" data-remodal-id="revisions" data-remodal-options="hashTracking: false">
  347. {% include ['partials/page-revisions.html.twig', 'empty.html.twig'] ignore missing with { data: context } %}
  348. </div>
  349. {% endif %}
  350. {% include 'partials/modal-changes-detected.html.twig' %}
  351. <div class="remodal" data-remodal-id="delete" data-remodal-options="hashTracking: false">
  352. <form>
  353. <h1>{{ "PLUGIN_ADMIN.MODAL_DELETE_PAGE_CONFIRMATION_REQUIRED_TITLE"|tu }}</h1>
  354. <p class="bigger">
  355. {% if context %}
  356. <strong>{{ "PLUGIN_ADMIN.PAGE"|tu }}: {{ context.title }}</strong>
  357. {% endif %}
  358. </p>
  359. <p class="bigger">
  360. {{ "PLUGIN_ADMIN.MODAL_DELETE_PAGE_CONFIRMATION_REQUIRED_DESC"|tu }}
  361. </p>
  362. <br>
  363. <div class="button-bar">
  364. <button data-remodal-action="cancel" class="button secondary remodal-cancel"><i class="fa fa-fw fa-close"></i> {{ "PLUGIN_ADMIN.CANCEL"|tu }}</button>
  365. <a class="button disable-after-click" data-delete-action href="#"><i class="fa fa-fw fa-check"></i> {{ "PLUGIN_ADMIN.CONTINUE"|tu }}</a>
  366. </div>
  367. </form>
  368. </div>
  369. {% include 'partials/admin-pro-pages-addons.html.twig' ignore missing %}
  370. {% endblock %}
  371. {% block bottom %}
  372. <script>
  373. {{ parent() }}
  374. $('.admin-pages .form-tabs .tabs-nav').css('margin-right', ($('#admin-topbar').width() + 20) + 'px');
  375. </script>
  376. {% endblock %}