Skouter mortgage estimates. Web application with view written in PHP and Vue, but controller and models in Go.
25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 
 
 
 
 

470 satır
26 KiB

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