ffb161266ef718b362f1a63059c92f28726484aba26b23c90d383419feaf962c.php 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272
  1. <?php
  2. /* forms/fields/order/order.html.twig */
  3. class __TwigTemplate_dd4348b2ff117d7be86395492ae48b7f08d25f10ebc9bbb6696bef8aaff994f4 extends Twig_Template
  4. {
  5. public function __construct(Twig_Environment $env)
  6. {
  7. parent::__construct($env);
  8. $this->parent = false;
  9. $this->blocks = array(
  10. );
  11. }
  12. protected function doDisplay(array $context, array $blocks = array())
  13. {
  14. // line 1
  15. $context["value"] = (((null === ($context["value"] ?? null))) ? ($this->getAttribute(($context["field"] ?? null), "default", array())) : (($context["value"] ?? null)));
  16. // line 2
  17. $context["siblings"] = $this->getAttribute($this->getAttribute(($context["data"] ?? null), "parent", array()), "children", array());
  18. // line 3
  19. $context["canOrder"] = $this->getAttribute(($context["data"] ?? null), "order", array());
  20. // line 4
  21. $context["vertical"] = ($this->getAttribute(($context["field"] ?? null), "style", array()) == "vertical");
  22. // line 5
  23. echo "
  24. <div class=\"form-field grid pure-g";
  25. // line 6
  26. if (($context["vertical"] ?? null)) {
  27. echo " vertical";
  28. }
  29. echo "\">
  30. <div class=\"form-label";
  31. // line 7
  32. if ( !($context["vertical"] ?? null)) {
  33. echo " block size-1-3 pure-u-1-3";
  34. }
  35. echo "\">
  36. <label>
  37. ";
  38. // line 9
  39. if ($this->getAttribute(($context["field"] ?? null), "help", array())) {
  40. // line 10
  41. echo " <span class=\"tooltip\" data-asTooltip-position=\"w\" title=\"";
  42. echo twig_escape_filter($this->env, $this->env->getExtension('Grav\Plugin\Admin\AdminTwigExtension')->tuFilter(twig_escape_filter($this->env, $this->getAttribute(($context["field"] ?? null), "help", array()))), "html", null, true);
  43. echo "\">";
  44. echo twig_escape_filter($this->env, $this->env->getExtension('Grav\Plugin\Admin\AdminTwigExtension')->tuFilter($this->getAttribute(($context["field"] ?? null), "label", array())), "html", null, true);
  45. echo "</span>
  46. ";
  47. } else {
  48. // line 12
  49. echo " ";
  50. echo twig_escape_filter($this->env, $this->env->getExtension('Grav\Plugin\Admin\AdminTwigExtension')->tuFilter($this->getAttribute(($context["field"] ?? null), "label", array())), "html", null, true);
  51. echo "
  52. ";
  53. }
  54. // line 14
  55. echo " ";
  56. echo ((twig_in_filter($this->getAttribute($this->getAttribute(($context["field"] ?? null), "validate", array()), "required", array()), array(0 => "on", 1 => "true", 2 => 1))) ? ("<span class=\"required\">*</span>") : (""));
  57. echo "
  58. </label>
  59. </div>
  60. <div class=\"form-data";
  61. // line 17
  62. if ( !($context["vertical"] ?? null)) {
  63. echo " block size-2-3 pure-u-2-3";
  64. }
  65. echo "\">
  66. <div class=\"form-order-wrapper ";
  67. // line 18
  68. echo twig_escape_filter($this->env, $this->getAttribute(($context["field"] ?? null), "size", array()), "html", null, true);
  69. echo "\">
  70. <input
  71. type=\"hidden\"
  72. data-order
  73. ";
  74. // line 23
  75. if (($this->getAttribute(($context["field"] ?? null), "disabled", array()) || ($context["isDisabledToggleable"] ?? null))) {
  76. echo "disabled=\"disabled\"";
  77. }
  78. // line 24
  79. echo " name=\"";
  80. echo twig_escape_filter($this->env, $this->env->getExtension('Grav\Common\Twig\TwigExtension')->fieldNameFilter((($context["scope"] ?? null) . $this->getAttribute(($context["field"] ?? null), "name", array()))), "html", null, true);
  81. echo "\"
  82. value=\"\" />
  83. ";
  84. // line 26
  85. if ( !($context["canOrder"] ?? null)) {
  86. // line 27
  87. echo " <div class=\"notice\">";
  88. echo $this->env->getExtension('Grav\Plugin\Admin\AdminTwigExtension')->tuFilter("PLUGIN_ADMIN.ORDERING_DISABLED_BECAUSE_PAGE_NO_PREFIX");
  89. echo "</div>
  90. ";
  91. }
  92. // line 29
  93. echo "
  94. ";
  95. // line 30
  96. if ((twig_length_filter($this->env, ($context["siblings"] ?? null)) < 200)) {
  97. // line 31
  98. echo " ";
  99. $context["sortable_count"] = 0;
  100. // line 32
  101. echo "\t\t\t\t<ul id=\"ordering\" class=\"orderable ";
  102. echo twig_escape_filter($this->env, $this->getAttribute(($context["field"] ?? null), "classes", array()), "html", null, true);
  103. echo "\">
  104. \t\t\t ";
  105. // line 33
  106. $context['_parent'] = $context;
  107. $context['_seq'] = twig_ensure_traversable(($context["siblings"] ?? null));
  108. $context['loop'] = array(
  109. 'parent' => $context['_parent'],
  110. 'index0' => 0,
  111. 'index' => 1,
  112. 'first' => true,
  113. );
  114. foreach ($context['_seq'] as $context["_key"] => $context["page"]) {
  115. if ($this->getAttribute($context["page"], "order", array())) {
  116. // line 34
  117. echo "\t\t\t\t\t<li class=\"drag-handle\" data-id=\"";
  118. echo twig_escape_filter($this->env, $this->getAttribute($context["page"], "slug", array()), "html", null, true);
  119. echo "\" ";
  120. echo ((($this->getAttribute($context["page"], "slug", array()) == $this->getAttribute(($context["data"] ?? null), "slug", array()))) ? ("data-active-id") : (""));
  121. echo "><span class=\"page-order\">";
  122. echo twig_escape_filter($this->env, $this->getAttribute($context["page"], "order", array()), "html", null, true);
  123. echo "</span> ";
  124. echo twig_escape_filter($this->env, $this->getAttribute($context["page"], "title", array()));
  125. echo " <a href=\"";
  126. echo twig_escape_filter($this->env, $this->env->getExtension('Grav\Plugin\Admin\AdminTwigExtension')->getPageUrl($context, $context["page"]), "html", null, true);
  127. echo "\"><i class=\"fa fa-external-link\"></i></a></li>
  128. ";
  129. // line 35
  130. $context["sortable_count"] = $this->getAttribute($context["loop"], "index", array());
  131. // line 36
  132. echo " ";
  133. ++$context['loop']['index0'];
  134. ++$context['loop']['index'];
  135. $context['loop']['first'] = false;
  136. }
  137. }
  138. $_parent = $context['_parent'];
  139. unset($context['_seq'], $context['_iterated'], $context['_key'], $context['page'], $context['_parent'], $context['loop']);
  140. $context = array_intersect_key($context, $_parent) + $_parent;
  141. // line 37
  142. echo "\t\t\t\t</ul>
  143. ";
  144. // line 38
  145. if ((($context["sortable_count"] ?? null) < twig_length_filter($this->env, ($context["siblings"] ?? null)))) {
  146. // line 39
  147. echo " <label>Unsortable Pages</label>
  148. <ul class=\"orderable disabled\">
  149. ";
  150. // line 41
  151. $context['_parent'] = $context;
  152. $context['_seq'] = twig_ensure_traversable(($context["siblings"] ?? null));
  153. foreach ($context['_seq'] as $context["_key"] => $context["page"]) {
  154. if ( !$this->getAttribute($context["page"], "order", array())) {
  155. // line 42
  156. echo " <li ";
  157. echo ((($this->getAttribute($context["page"], "slug", array()) == $this->getAttribute(($context["data"] ?? null), "slug", array()))) ? ("data-active-id") : (""));
  158. echo ">";
  159. echo twig_escape_filter($this->env, $this->getAttribute($context["page"], "title", array()));
  160. echo " <a href=\"";
  161. echo twig_escape_filter($this->env, $this->env->getExtension('Grav\Plugin\Admin\AdminTwigExtension')->getPageUrl($context, $context["page"]), "html", null, true);
  162. echo "\"><i class=\"fa fa-external-link\"></i></a></li>
  163. ";
  164. }
  165. }
  166. $_parent = $context['_parent'];
  167. unset($context['_seq'], $context['_iterated'], $context['_key'], $context['page'], $context['_parent'], $context['loop']);
  168. $context = array_intersect_key($context, $_parent) + $_parent;
  169. // line 44
  170. echo " </ul>
  171. ";
  172. }
  173. // line 46
  174. echo "\t\t\t";
  175. } else {
  176. // line 47
  177. echo " <div class=\"notice\">";
  178. echo twig_escape_filter($this->env, $this->env->getExtension('Grav\Plugin\Admin\AdminTwigExtension')->tuFilter("PLUGIN_ADMIN.ORDERING_DISABLED_BECAUSE_TOO_MANY_SIBLINGS"), "html", null, true);
  179. echo "</div>
  180. \t\t\t";
  181. }
  182. // line 49
  183. echo " </div>
  184. </div>
  185. </div>
  186. ";
  187. }
  188. public function getTemplateName()
  189. {
  190. return "forms/fields/order/order.html.twig";
  191. }
  192. public function isTraitable()
  193. {
  194. return false;
  195. }
  196. public function getDebugInfo()
  197. {
  198. return array ( 188 => 49, 182 => 47, 179 => 46, 175 => 44, 161 => 42, 156 => 41, 152 => 39, 150 => 38, 147 => 37, 137 => 36, 135 => 35, 122 => 34, 111 => 33, 106 => 32, 103 => 31, 101 => 30, 98 => 29, 92 => 27, 90 => 26, 84 => 24, 80 => 23, 72 => 18, 66 => 17, 59 => 14, 53 => 12, 45 => 10, 43 => 9, 36 => 7, 30 => 6, 27 => 5, 25 => 4, 23 => 3, 21 => 2, 19 => 1,);
  199. }
  200. /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */
  201. public function getSource()
  202. {
  203. @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED);
  204. return $this->getSourceContext()->getCode();
  205. }
  206. public function getSourceContext()
  207. {
  208. return new Twig_Source("{% set value = (value is null ? field.default : value) %}
  209. {% set siblings = data.parent.children %}
  210. {% set canOrder = data.order %}
  211. {% set vertical = field.style == 'vertical' %}
  212. <div class=\"form-field grid pure-g{% if vertical %} vertical{% endif %}\">
  213. <div class=\"form-label{% if not vertical %} block size-1-3 pure-u-1-3{% endif %}\">
  214. <label>
  215. {% if field.help %}
  216. <span class=\"tooltip\" data-asTooltip-position=\"w\" title=\"{{ field.help|e|tu }}\">{{ field.label|tu }}</span>
  217. {% else %}
  218. {{ field.label|tu }}
  219. {% endif %}
  220. {{ field.validate.required in ['on', 'true', 1] ? '<span class=\"required\">*</span>' }}
  221. </label>
  222. </div>
  223. <div class=\"form-data{% if not vertical %} block size-2-3 pure-u-2-3{% endif %}\">
  224. <div class=\"form-order-wrapper {{ field.size }}\">
  225. <input
  226. type=\"hidden\"
  227. data-order
  228. {% if field.disabled or isDisabledToggleable %}disabled=\"disabled\"{% endif %}
  229. name=\"{{ (scope ~ field.name)|fieldName }}\"
  230. value=\"\" />
  231. {% if not canOrder %}
  232. <div class=\"notice\">{{ \"PLUGIN_ADMIN.ORDERING_DISABLED_BECAUSE_PAGE_NO_PREFIX\"|tu|raw }}</div>
  233. {% endif %}
  234. {% if siblings|length < 200 %}
  235. {% set sortable_count = 0 %}
  236. \t\t\t\t<ul id=\"ordering\" class=\"orderable {{ field.classes }}\">
  237. \t\t\t {% for page in siblings if page.order %}
  238. \t\t\t\t\t<li class=\"drag-handle\" data-id=\"{{ page.slug }}\" {{ page.slug == data.slug ? 'data-active-id' : ''}}><span class=\"page-order\">{{ page.order }}</span> {{ page.title|e }} <a href=\"{{ getPageUrl(page) }}\"><i class=\"fa fa-external-link\"></i></a></li>
  239. {% set sortable_count = loop.index %}
  240. {% endfor %}
  241. \t\t\t\t</ul>
  242. {% if sortable_count < siblings|length %}
  243. <label>Unsortable Pages</label>
  244. <ul class=\"orderable disabled\">
  245. {% for page in siblings if not page.order %}
  246. <li {{ page.slug == data.slug ? 'data-active-id' : ''}}>{{ page.title|e }} <a href=\"{{ getPageUrl(page) }}\"><i class=\"fa fa-external-link\"></i></a></li>
  247. {% endfor %}
  248. </ul>
  249. {% endif %}
  250. \t\t\t{% else %}
  251. <div class=\"notice\">{{ \"PLUGIN_ADMIN.ORDERING_DISABLED_BECAUSE_TOO_MANY_SIBLINGS\"|tu }}</div>
  252. \t\t\t{% endif %}
  253. </div>
  254. </div>
  255. </div>
  256. ", "forms/fields/order/order.html.twig", "/mnt/data/Sites/static-ethica.net/user/plugins/admin/themes/grav/templates/forms/fields/order/order.html.twig");
  257. }
  258. }