dab20ec36a7b52270a47f67ec166359ea8e95b09fdc42c3096e7daf3e253b4c8.php 49 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811
  1. <?php
  2. /* forms/fields/list/list.html.twig */
  3. class __TwigTemplate_db22ce9b5ba3ab2df589fdb817d81d54b4af172265a6f1b8047236423c321f2d extends Twig_Template
  4. {
  5. public function __construct(Twig_Environment $env)
  6. {
  7. parent::__construct($env);
  8. // line 1
  9. $this->parent = $this->loadTemplate("forms/field.html.twig", "forms/fields/list/list.html.twig", 1);
  10. $this->blocks = array(
  11. 'contents' => array($this, 'block_contents'),
  12. 'global_attributes' => array($this, 'block_global_attributes'),
  13. '__internal_fa367a566ec58bda83f7abdb372be4a69271c84232c5182b50529b9a3a7d944c' => array($this, 'block___internal_fa367a566ec58bda83f7abdb372be4a69271c84232c5182b50529b9a3a7d944c'),
  14. );
  15. }
  16. protected function doGetParent(array $context)
  17. {
  18. return "forms/field.html.twig";
  19. }
  20. protected function doDisplay(array $context, array $blocks = array())
  21. {
  22. // line 3
  23. $context["value"] = (((null === ($context["value"] ?? null))) ? ($this->getAttribute(($context["field"] ?? null), "default", array())) : (($context["value"] ?? null)));
  24. // line 4
  25. $context["name"] = $this->getAttribute(($context["field"] ?? null), "name", array());
  26. // line 5
  27. $context["btnLabel"] = (($this->getAttribute(($context["field"] ?? null), "btnLabel", array(), "any", true, true)) ? ($this->getAttribute(($context["field"] ?? null), "btnLabel", array())) : ("PLUGIN_ADMIN.ADD_ITEM"));
  28. // line 6
  29. $context["btnSortLabel"] = (($this->getAttribute(($context["field"] ?? null), "btnSortLabel", array(), "any", true, true)) ? ($this->getAttribute(($context["field"] ?? null), "btnSortLabel", array())) : ("PLUGIN_ADMIN.SORT_BY"));
  30. // line 7
  31. $context["fieldControls"] = (($this->getAttribute(($context["field"] ?? null), "controls", array(), "any", true, true)) ? (_twig_default_filter($this->getAttribute(($context["field"] ?? null), "controls", array()), "bottom")) : ("bottom"));
  32. // line 1
  33. $this->parent->display($context, array_merge($this->blocks, $blocks));
  34. }
  35. // line 9
  36. public function block_contents($context, array $blocks = array())
  37. {
  38. // line 10
  39. echo " <div class=\"form-label";
  40. if ( !($context["vertical"] ?? null)) {
  41. echo " block size-1-3 pure-u-1-3";
  42. }
  43. echo "\">
  44. ";
  45. // line 11
  46. if ($this->getAttribute(($context["field"] ?? null), "toggleable", array())) {
  47. // line 12
  48. echo " <span class=\"checkboxes toggleable\" data-grav-field=\"toggleable\" data-grav-field-name=\"";
  49. 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);
  50. echo "\">
  51. <input type=\"checkbox\"
  52. id=\"toggleable_";
  53. // line 14
  54. echo twig_escape_filter($this->env, $this->getAttribute(($context["field"] ?? null), "name", array()), "html", null, true);
  55. echo "\"
  56. ";
  57. // line 15
  58. if (($context["toggleableChecked"] ?? null)) {
  59. echo "value=\"1\"";
  60. }
  61. // line 16
  62. echo " name=\"toggleable_";
  63. 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);
  64. echo "\"
  65. ";
  66. // line 17
  67. if (($context["toggleableChecked"] ?? null)) {
  68. echo "checked=\"checked\"";
  69. }
  70. // line 18
  71. echo " >
  72. <label for=\"toggleable_";
  73. // line 19
  74. echo twig_escape_filter($this->env, $this->getAttribute(($context["field"] ?? null), "name", array()), "html", null, true);
  75. echo "\"></label>
  76. </span>
  77. ";
  78. }
  79. // line 22
  80. echo " <label";
  81. echo (($this->getAttribute(($context["field"] ?? null), "toggleable", array())) ? (((" class=\"toggleable\" for=\"toggleable_" . $this->getAttribute(($context["field"] ?? null), "name", array())) . "\"")) : (""));
  82. echo ">
  83. ";
  84. // line 23
  85. if ($this->getAttribute(($context["field"] ?? null), "help", array())) {
  86. // line 24
  87. echo " <span class=\"hint--bottom\" data-hint=\"";
  88. 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);
  89. echo "\">";
  90. echo twig_escape_filter($this->env, $this->env->getExtension('Grav\Plugin\Admin\AdminTwigExtension')->tuFilter($this->getAttribute(($context["field"] ?? null), "label", array())), "html", null, true);
  91. echo "</span>
  92. ";
  93. } else {
  94. // line 26
  95. echo " ";
  96. echo twig_escape_filter($this->env, $this->env->getExtension('Grav\Plugin\Admin\AdminTwigExtension')->tuFilter($this->getAttribute(($context["field"] ?? null), "label", array())), "html", null, true);
  97. echo "
  98. ";
  99. }
  100. // line 28
  101. echo " ";
  102. 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>") : (""));
  103. echo "
  104. </label>
  105. </div>
  106. <div class=\"form-data";
  107. // line 31
  108. if ( !($context["vertical"] ?? null)) {
  109. echo " block size-2-3 pure-u-2-3";
  110. }
  111. echo "\"
  112. ";
  113. // line 32
  114. $this->displayBlock('global_attributes', $context, $blocks);
  115. // line 37
  116. echo " >
  117. <div class=\"form-list-wrapper ";
  118. // line 39
  119. echo twig_escape_filter($this->env, $this->getAttribute(($context["field"] ?? null), "size", array()), "html", null, true);
  120. echo "\" data-type=\"collection\"
  121. ";
  122. // line 40
  123. if ($this->getAttribute(($context["field"] ?? null), "selectunique", array())) {
  124. // line 41
  125. echo " data-select-unique=\"";
  126. echo twig_escape_filter($this->env, twig_jsonencode_filter($this->getAttribute(($context["field"] ?? null), "selectunique", array())), "html_attr");
  127. echo "\"
  128. data-max=\"";
  129. // line 42
  130. echo twig_escape_filter($this->env, twig_length_filter($this->env, $this->getAttribute(($context["field"] ?? null), "selectunique", array())), "html", null, true);
  131. echo "\"
  132. ";
  133. }
  134. // line 44
  135. echo " ";
  136. if ($this->getAttribute(($context["field"] ?? null), "min", array(), "any", true, true)) {
  137. echo "data-min=\"";
  138. echo twig_escape_filter($this->env, $this->getAttribute(($context["field"] ?? null), "min", array()), "html", null, true);
  139. echo "\"";
  140. }
  141. // line 45
  142. echo " ";
  143. if (($this->getAttribute(($context["field"] ?? null), "max", array(), "any", true, true) && !$this->getAttribute(($context["field"] ?? null), "selectunique", array()))) {
  144. echo "data-max=\"";
  145. echo twig_escape_filter($this->env, $this->getAttribute(($context["field"] ?? null), "max", array()), "html", null, true);
  146. echo "\"";
  147. }
  148. // line 46
  149. echo " >
  150. ";
  151. // line 47
  152. if (twig_in_filter(($context["fieldControls"] ?? null), array(0 => "top", 1 => "both"))) {
  153. // line 48
  154. echo " <div class=\"collection-actions";
  155. echo (( !twig_length_filter($this->env, ($context["value"] ?? null))) ? (" hidden") : (""));
  156. echo "\">
  157. <button class=\"button\" type=\"button\" data-action=\"expand_all\"
  158. ";
  159. // line 50
  160. if (($this->getAttribute(($context["field"] ?? null), "disabled", array()) || ($context["isDisabledToggleable"] ?? null))) {
  161. echo "disabled=\"disabled\"";
  162. }
  163. echo "><i class=\"fa fa-chevron-circle-down\"></i> ";
  164. echo twig_escape_filter($this->env, $this->env->getExtension('Grav\Plugin\Admin\AdminTwigExtension')->tuFilter(twig_escape_filter($this->env, "PLUGIN_ADMIN.EXPAND_ALL")), "html", null, true);
  165. echo "</button>
  166. <button class=\"button\" type=\"button\" data-action=\"collapse_all\"
  167. ";
  168. // line 52
  169. if (($this->getAttribute(($context["field"] ?? null), "disabled", array()) || ($context["isDisabledToggleable"] ?? null))) {
  170. echo "disabled=\"disabled\"";
  171. }
  172. echo "><i class=\"fa fa-chevron-circle-right\"></i> ";
  173. echo twig_escape_filter($this->env, $this->env->getExtension('Grav\Plugin\Admin\AdminTwigExtension')->tuFilter(twig_escape_filter($this->env, "PLUGIN_ADMIN.COLLAPSE_ALL")), "html", null, true);
  174. echo "</button>
  175. ";
  176. // line 53
  177. if ($this->getAttribute(($context["field"] ?? null), "sortby", array())) {
  178. // line 54
  179. echo " <button class=\"button";
  180. echo (( !twig_length_filter($this->env, ($context["value"] ?? null))) ? (" hidden") : (""));
  181. echo "\" type=\"button\" data-action=\"sort\" data-action-sort=\"";
  182. echo twig_escape_filter($this->env, $this->getAttribute(($context["field"] ?? null), "sortby", array()), "html", null, true);
  183. echo "\" data-action-sort-dir=\"";
  184. echo twig_escape_filter($this->env, (($this->getAttribute(($context["field"] ?? null), "sortby_dir", array(), "any", true, true)) ? (_twig_default_filter($this->getAttribute(($context["field"] ?? null), "sortby_dir", array()), "asc")) : ("asc")), "html", null, true);
  185. echo "\"
  186. ";
  187. // line 55
  188. if (($this->getAttribute(($context["field"] ?? null), "disabled", array()) || ($context["isDisabledToggleable"] ?? null))) {
  189. echo "disabled=\"disabled\"";
  190. }
  191. echo "><i class=\"fa fa-sort-amount-";
  192. echo twig_escape_filter($this->env, (($this->getAttribute(($context["field"] ?? null), "sortby_dir", array(), "any", true, true)) ? (_twig_default_filter($this->getAttribute(($context["field"] ?? null), "sortby_dir", array()), "asc")) : ("asc")), "html", null, true);
  193. echo "\"></i> ";
  194. echo twig_escape_filter($this->env, $this->env->getExtension('Grav\Plugin\Admin\AdminTwigExtension')->tuFilter(twig_escape_filter($this->env, ($context["btnSortLabel"] ?? null))), "html", null, true);
  195. echo " '";
  196. echo twig_escape_filter($this->env, $this->getAttribute(($context["field"] ?? null), "sortby", array()), "html", null, true);
  197. echo "'</button>
  198. ";
  199. }
  200. // line 57
  201. echo " <button class=\"button\" type=\"button\" data-action=\"add\" data-action-add=\"top\"
  202. ";
  203. // line 58
  204. if (($this->getAttribute(($context["field"] ?? null), "disabled", array()) || ($context["isDisabledToggleable"] ?? null))) {
  205. echo "disabled=\"disabled\"";
  206. }
  207. echo "><i class=\"fa fa-plus\"></i> ";
  208. echo twig_escape_filter($this->env, $this->env->getExtension('Grav\Plugin\Admin\AdminTwigExtension')->tuFilter(twig_escape_filter($this->env, ($context["btnLabel"] ?? null))), "html", null, true);
  209. echo "</button>
  210. </div>
  211. ";
  212. }
  213. // line 61
  214. echo " <ul ";
  215. if ($this->getAttribute(($context["field"] ?? null), "classes", array(), "any", true, true)) {
  216. echo "class=\"";
  217. echo twig_escape_filter($this->env, $this->getAttribute(($context["field"] ?? null), "classes", array()), "html", null, true);
  218. echo "\"";
  219. }
  220. echo " data-collection-holder=\"";
  221. echo twig_escape_filter($this->env, ($context["name"] ?? null), "html", null, true);
  222. echo "\"
  223. ";
  224. // line 62
  225. if (($this->getAttribute(($context["field"] ?? null), "sort", array()) === false)) {
  226. // line 63
  227. echo " data-collection-nosort
  228. ";
  229. }
  230. // line 64
  231. echo ">
  232. ";
  233. // line 65
  234. if ($this->getAttribute(($context["field"] ?? null), "fields", array())) {
  235. // line 66
  236. echo " ";
  237. $context['_parent'] = $context;
  238. $context['_seq'] = twig_ensure_traversable(($context["value"] ?? null));
  239. $context['loop'] = array(
  240. 'parent' => $context['_parent'],
  241. 'index0' => 0,
  242. 'index' => 1,
  243. 'first' => true,
  244. );
  245. if (is_array($context['_seq']) || (is_object($context['_seq']) && $context['_seq'] instanceof Countable)) {
  246. $length = count($context['_seq']);
  247. $context['loop']['revindex0'] = $length - 1;
  248. $context['loop']['revindex'] = $length;
  249. $context['loop']['length'] = $length;
  250. $context['loop']['last'] = 1 === $length;
  251. }
  252. foreach ($context['_seq'] as $context["key"] => $context["val"]) {
  253. // line 67
  254. echo " ";
  255. $context["itemName"] = ((($context["name"] ?? null)) ? (((($context["name"] ?? null) . ".") . $context["key"])) : ($context["key"]));
  256. // line 68
  257. echo " <li data-collection-item=\"";
  258. echo twig_escape_filter($this->env, ($context["itemName"] ?? null), "html", null, true);
  259. echo "\" data-collection-key=\"";
  260. echo twig_escape_filter($this->env, $context["key"], "html", null, true);
  261. echo "\" class=\"";
  262. echo (((( !$this->getAttribute(($context["field"] ?? null), "collapsible", array(), "any", true, true) || $this->getAttribute(($context["field"] ?? null), "collapsible", array())) && $this->getAttribute(($context["field"] ?? null), "collapsed", array()))) ? ("collection-collapsed") : (""));
  263. echo "\">
  264. <div class=\"collection-sort\"><i class=\"fa fa-fw fa-bars\"></i></div>
  265. ";
  266. // line 70
  267. $context['_parent'] = $context;
  268. $context['_seq'] = twig_ensure_traversable($this->getAttribute(($context["field"] ?? null), "fields", array()));
  269. $context['loop'] = array(
  270. 'parent' => $context['_parent'],
  271. 'index0' => 0,
  272. 'index' => 1,
  273. 'first' => true,
  274. );
  275. if (is_array($context['_seq']) || (is_object($context['_seq']) && $context['_seq'] instanceof Countable)) {
  276. $length = count($context['_seq']);
  277. $context['loop']['revindex0'] = $length - 1;
  278. $context['loop']['revindex'] = $length;
  279. $context['loop']['length'] = $length;
  280. $context['loop']['last'] = 1 === $length;
  281. }
  282. foreach ($context['_seq'] as $context["childName"] => $context["child"]) {
  283. // line 71
  284. echo " ";
  285. if ((is_string($__internal_004f109a1dedba3b99942a2e2f50dedbd8d4e54e41a52c0baf829c07b95da843 = $context["childName"]) && is_string($__internal_588207aa49ca2b7de9a005ace90cc6a700160f109d3bc705e814ac969e54bd49 = ".") && ('' === $__internal_588207aa49ca2b7de9a005ace90cc6a700160f109d3bc705e814ac969e54bd49 || 0 === strpos($__internal_004f109a1dedba3b99942a2e2f50dedbd8d4e54e41a52c0baf829c07b95da843, $__internal_588207aa49ca2b7de9a005ace90cc6a700160f109d3bc705e814ac969e54bd49)))) {
  286. // line 72
  287. echo " ";
  288. $context["childKey"] = twig_trim_filter($context["childName"], ".");
  289. // line 73
  290. echo " ";
  291. $context["childValue"] = $this->getAttribute($context["val"], twig_slice($this->env, $context["childName"], 1, null), array(), "array");
  292. // line 74
  293. echo " ";
  294. $context["childName"] = (($context["itemName"] ?? null) . $context["childName"]);
  295. // line 75
  296. echo " ";
  297. } else {
  298. // line 76
  299. echo " ";
  300. $context["childKey"] = $context["childName"];
  301. // line 77
  302. echo " ";
  303. $context["childValue"] = $this->getAttribute(($context["data"] ?? null), "value", array(0 => (($context["scope"] ?? null) . $context["childName"])), "method");
  304. // line 78
  305. echo " ";
  306. $context["childName"] = twig_replace_filter($context["childName"], array("*" => $context["key"]));
  307. // line 79
  308. echo " ";
  309. }
  310. // line 80
  311. echo " ";
  312. $context["child"] = twig_array_merge($context["child"], array("name" => $context["childName"]));
  313. // line 81
  314. echo "
  315. ";
  316. // line 82
  317. if (($this->getAttribute($context["child"], "type", array()) == "key")) {
  318. // line 83
  319. echo " ";
  320. // line 84
  321. $this->loadTemplate("forms/fields/key/key.html.twig", "forms/fields/list/list.html.twig", 84)->display(array_merge($context, array("field" => // line 85
  322. $context["child"], "value" => $context["key"])));
  323. // line 87
  324. echo " ";
  325. } elseif (($this->getAttribute($context["child"], "key", array()) == true)) {
  326. // line 88
  327. echo " ";
  328. $this->loadTemplate(array(0 => (((("forms/fields/" . $this->getAttribute( // line 89
  329. $context["child"], "type", array())) . "/") . $this->getAttribute($context["child"], "type", array())) . ".html.twig"), 1 => "forms/fields/key/key.html.twig"), "forms/fields/list/list.html.twig", 88)->display(array_merge($context, array("field" => // line 91
  330. $context["child"], "value" => $context["key"])));
  331. // line 93
  332. echo " ";
  333. } elseif ($this->getAttribute($context["child"], "type", array())) {
  334. // line 94
  335. echo " ";
  336. $context["originalValue"] = ($context["childValue"] ?? null);
  337. // line 95
  338. echo " ";
  339. // line 96
  340. $this->loadTemplate(array(0 => (((("forms/fields/" . $this->getAttribute( // line 97
  341. $context["child"], "type", array())) . "/") . $this->getAttribute($context["child"], "type", array())) . ".html.twig"), 1 => "forms/fields/text/text.html.twig"), "forms/fields/list/list.html.twig", 96)->display(array_merge($context, array("field" => // line 99
  342. $context["child"], "value" => ($context["childValue"] ?? null))));
  343. // line 101
  344. echo " ";
  345. }
  346. // line 102
  347. echo " ";
  348. ++$context['loop']['index0'];
  349. ++$context['loop']['index'];
  350. $context['loop']['first'] = false;
  351. if (isset($context['loop']['length'])) {
  352. --$context['loop']['revindex0'];
  353. --$context['loop']['revindex'];
  354. $context['loop']['last'] = 0 === $context['loop']['revindex0'];
  355. }
  356. }
  357. $_parent = $context['_parent'];
  358. unset($context['_seq'], $context['_iterated'], $context['childName'], $context['child'], $context['_parent'], $context['loop']);
  359. $context = array_intersect_key($context, $_parent) + $_parent;
  360. // line 103
  361. echo " <div class=\"item-actions\">
  362. ";
  363. // line 104
  364. if (( !$this->getAttribute(($context["field"] ?? null), "collapsible", array(), "any", true, true) || $this->getAttribute(($context["field"] ?? null), "collapsible", array()))) {
  365. // line 105
  366. echo " <i class=\"fa fa-chevron-circle-";
  367. echo (($this->getAttribute(($context["field"] ?? null), "collapsed", array())) ? ("right") : ("down"));
  368. echo "\" data-action=\"";
  369. echo (($this->getAttribute(($context["field"] ?? null), "collapsed", array())) ? ("expand") : ("collapse"));
  370. echo "\"></i>
  371. <br />
  372. ";
  373. }
  374. // line 108
  375. echo " <i class=\"fa fa-trash-o\" data-action=\"delete\"></i>
  376. </div>
  377. </li>
  378. ";
  379. ++$context['loop']['index0'];
  380. ++$context['loop']['index'];
  381. $context['loop']['first'] = false;
  382. if (isset($context['loop']['length'])) {
  383. --$context['loop']['revindex0'];
  384. --$context['loop']['revindex'];
  385. $context['loop']['last'] = 0 === $context['loop']['revindex0'];
  386. }
  387. }
  388. $_parent = $context['_parent'];
  389. unset($context['_seq'], $context['_iterated'], $context['key'], $context['val'], $context['_parent'], $context['loop']);
  390. $context = array_intersect_key($context, $_parent) + $_parent;
  391. // line 112
  392. echo " ";
  393. }
  394. // line 113
  395. echo " </ul>
  396. ";
  397. // line 114
  398. if (twig_in_filter(($context["fieldControls"] ?? null), array(0 => "bottom", 1 => "both"))) {
  399. // line 115
  400. echo " <div class=\"collection-actions\">
  401. ";
  402. // line 116
  403. if (( !$this->getAttribute(($context["field"] ?? null), "collapsible", array(), "any", true, true) || $this->getAttribute(($context["field"] ?? null), "collapsible", array()))) {
  404. // line 117
  405. echo " <button class=\"button\" type=\"button\" data-action=\"expand_all\"
  406. ";
  407. // line 118
  408. if (($this->getAttribute(($context["field"] ?? null), "disabled", array()) || ($context["isDisabledToggleable"] ?? null))) {
  409. echo "disabled=\"disabled\"";
  410. }
  411. echo "><i class=\"fa fa-chevron-circle-down\"></i> ";
  412. echo twig_escape_filter($this->env, $this->env->getExtension('Grav\Plugin\Admin\AdminTwigExtension')->tuFilter(twig_escape_filter($this->env, "PLUGIN_ADMIN.EXPAND_ALL")), "html", null, true);
  413. echo "</button>
  414. <button class=\"button\" type=\"button\" data-action=\"collapse_all\"
  415. ";
  416. // line 120
  417. if (($this->getAttribute(($context["field"] ?? null), "disabled", array()) || ($context["isDisabledToggleable"] ?? null))) {
  418. echo "disabled=\"disabled\"";
  419. }
  420. echo "><i class=\"fa fa-chevron-circle-right\"></i> ";
  421. echo twig_escape_filter($this->env, $this->env->getExtension('Grav\Plugin\Admin\AdminTwigExtension')->tuFilter(twig_escape_filter($this->env, "PLUGIN_ADMIN.COLLAPSE_ALL")), "html", null, true);
  422. echo "</button>
  423. ";
  424. }
  425. // line 122
  426. echo " ";
  427. if ($this->getAttribute(($context["field"] ?? null), "sortby", array())) {
  428. // line 123
  429. echo " <button class=\"button";
  430. echo (( !twig_length_filter($this->env, ($context["value"] ?? null))) ? (" hidden") : (""));
  431. echo "\" type=\"button\" data-action=\"sort\" data-action-sort=\"";
  432. echo twig_escape_filter($this->env, $this->getAttribute(($context["field"] ?? null), "sortby", array()), "html", null, true);
  433. echo "\" data-action-sort-dir=\"";
  434. echo twig_escape_filter($this->env, (($this->getAttribute(($context["field"] ?? null), "sortby_dir", array(), "any", true, true)) ? (_twig_default_filter($this->getAttribute(($context["field"] ?? null), "sortby_dir", array()), "asc")) : ("asc")), "html", null, true);
  435. echo "\"
  436. ";
  437. // line 124
  438. if (($this->getAttribute(($context["field"] ?? null), "disabled", array()) || ($context["isDisabledToggleable"] ?? null))) {
  439. echo "disabled=\"disabled\"";
  440. }
  441. echo "><i class=\"fa fa-sort-amount-";
  442. echo twig_escape_filter($this->env, (($this->getAttribute(($context["field"] ?? null), "sortby_dir", array(), "any", true, true)) ? (_twig_default_filter($this->getAttribute(($context["field"] ?? null), "sortby_dir", array()), "asc")) : ("asc")), "html", null, true);
  443. echo "\"></i> ";
  444. echo twig_escape_filter($this->env, $this->env->getExtension('Grav\Plugin\Admin\AdminTwigExtension')->tuFilter(twig_escape_filter($this->env, ($context["btnSortLabel"] ?? null))), "html", null, true);
  445. echo " '";
  446. echo twig_escape_filter($this->env, $this->getAttribute(($context["field"] ?? null), "sortby", array()), "html", null, true);
  447. echo "'</button>
  448. ";
  449. }
  450. // line 126
  451. echo " <button class=\"button\" type=\"button\" data-action=\"add\" data-action-add=\"bottom\"
  452. ";
  453. // line 127
  454. if (($this->getAttribute(($context["field"] ?? null), "disabled", array()) || ($context["isDisabledToggleable"] ?? null))) {
  455. echo "disabled=\"disabled\"";
  456. }
  457. echo "><i class=\"fa fa-plus\"></i> ";
  458. echo twig_escape_filter($this->env, $this->env->getExtension('Grav\Plugin\Admin\AdminTwigExtension')->tuFilter(twig_escape_filter($this->env, ($context["btnLabel"] ?? null))), "html", null, true);
  459. echo "</button>
  460. </div>
  461. ";
  462. }
  463. // line 131
  464. $context["itemName"] = ((($context["name"] ?? null)) ? ((($context["name"] ?? null) . ".*")) : ("*"));
  465. // line 132
  466. echo "<div style=\"display: none;\" data-collection-template=\"new\" data-collection-template-html=\"";
  467. echo twig_escape_filter($this->env, twig_replace_filter( $this->renderBlock("__internal_fa367a566ec58bda83f7abdb372be4a69271c84232c5182b50529b9a3a7d944c", $context, $blocks), array(" " => " ", "
  468. " => " ")), "html_attr");
  469. // line 178
  470. echo "\"></div>
  471. <div style=\"display: none;\" data-collection-config=\"";
  472. // line 180
  473. echo twig_escape_filter($this->env, ($context["name"] ?? null), "html", null, true);
  474. echo "\"></div>
  475. </div>
  476. </div>
  477. ";
  478. }
  479. // line 32
  480. public function block_global_attributes($context, array $blocks = array())
  481. {
  482. // line 33
  483. echo " data-grav-field=\"";
  484. echo twig_escape_filter($this->env, $this->getAttribute(($context["field"] ?? null), "type", array()), "html", null, true);
  485. echo "\"
  486. data-grav-disabled=\"";
  487. // line 34
  488. echo twig_escape_filter($this->env, ($context["toggleableChecked"] ?? null), "html", null, true);
  489. echo "\"
  490. data-grav-default=\"";
  491. // line 35
  492. echo twig_escape_filter($this->env, twig_jsonencode_filter($this->getAttribute(($context["field"] ?? null), "default", array())), "html_attr");
  493. echo "\"
  494. ";
  495. }
  496. // line 132
  497. public function block___internal_fa367a566ec58bda83f7abdb372be4a69271c84232c5182b50529b9a3a7d944c($context, array $blocks = array())
  498. {
  499. // line 133
  500. echo "<li data-collection-item=\"";
  501. echo twig_escape_filter($this->env, ($context["itemName"] ?? null), "html", null, true);
  502. echo "\">
  503. ";
  504. // line 134
  505. if ( !($this->getAttribute(($context["field"] ?? null), "sort", array()) === false)) {
  506. // line 135
  507. echo " <div class=\"collection-sort\"><i class=\"fa fa-fw fa-bars\"></i></div>
  508. ";
  509. }
  510. // line 137
  511. if ($this->getAttribute(($context["field"] ?? null), "fields", array())) {
  512. // line 138
  513. $context['_parent'] = $context;
  514. $context['_seq'] = twig_ensure_traversable($this->getAttribute(($context["field"] ?? null), "fields", array()));
  515. $context['loop'] = array(
  516. 'parent' => $context['_parent'],
  517. 'index0' => 0,
  518. 'index' => 1,
  519. 'first' => true,
  520. );
  521. if (is_array($context['_seq']) || (is_object($context['_seq']) && $context['_seq'] instanceof Countable)) {
  522. $length = count($context['_seq']);
  523. $context['loop']['revindex0'] = $length - 1;
  524. $context['loop']['revindex'] = $length;
  525. $context['loop']['length'] = $length;
  526. $context['loop']['last'] = 1 === $length;
  527. }
  528. foreach ($context['_seq'] as $context["childName"] => $context["child"]) {
  529. // line 139
  530. if ((is_string($__internal_852c17c1704693e7c6e9af566f2e623f6796c522f1770732de468704aafec224 = $context["childName"]) && is_string($__internal_1fd3117e41976d0a6cfeb2f5794dd66c10aba38cd2269d0a81184a3af2dfa5f6 = ".") && ('' === $__internal_1fd3117e41976d0a6cfeb2f5794dd66c10aba38cd2269d0a81184a3af2dfa5f6 || 0 === strpos($__internal_852c17c1704693e7c6e9af566f2e623f6796c522f1770732de468704aafec224, $__internal_1fd3117e41976d0a6cfeb2f5794dd66c10aba38cd2269d0a81184a3af2dfa5f6)))) {
  531. // line 140
  532. $context["childKey"] = twig_trim_filter($context["childName"], ".");
  533. // line 141
  534. $context["childName"] = (($context["itemName"] ?? null) . $context["childName"]);
  535. } else {
  536. // line 143
  537. $context["childKey"] = $context["childName"];
  538. // line 144
  539. $context["childName"] = twig_replace_filter($context["childName"], array("*" => ($context["key"] ?? null)));
  540. }
  541. // line 146
  542. $context["child"] = twig_array_merge($context["child"], array("name" => $context["childName"]));
  543. // line 148
  544. if (($this->getAttribute($context["child"], "type", array()) == "key")) {
  545. // line 150
  546. $this->loadTemplate("forms/fields/key/key.html.twig", "forms/fields/list/list.html.twig", 150)->display(array_merge($context, array("field" => // line 151
  547. $context["child"], "value" => null)));
  548. } elseif (($this->getAttribute( // line 153
  549. $context["child"], "key", array()) == true)) {
  550. // line 155
  551. $this->loadTemplate(array(0 => (((("forms/fields/" . $this->getAttribute( // line 156
  552. $context["child"], "type", array())) . "/") . $this->getAttribute($context["child"], "type", array())) . ".html.twig"), 1 => "forms/fields/key/key.html.twig"), "forms/fields/list/list.html.twig", 155)->display(array_merge($context, array("field" => // line 158
  553. $context["child"], "value" => null)));
  554. } elseif ($this->getAttribute( // line 160
  555. $context["child"], "type", array())) {
  556. // line 162
  557. $this->loadTemplate(array(0 => (((("forms/fields/" . $this->getAttribute( // line 163
  558. $context["child"], "type", array())) . "/") . $this->getAttribute($context["child"], "type", array())) . ".html.twig"), 1 => "forms/fields/text/text.html.twig"), "forms/fields/list/list.html.twig", 162)->display(array_merge($context, array("field" => // line 165
  559. $context["child"], "value" => null)));
  560. }
  561. ++$context['loop']['index0'];
  562. ++$context['loop']['index'];
  563. $context['loop']['first'] = false;
  564. if (isset($context['loop']['length'])) {
  565. --$context['loop']['revindex0'];
  566. --$context['loop']['revindex'];
  567. $context['loop']['last'] = 0 === $context['loop']['revindex0'];
  568. }
  569. }
  570. $_parent = $context['_parent'];
  571. unset($context['_seq'], $context['_iterated'], $context['childName'], $context['child'], $context['_parent'], $context['loop']);
  572. $context = array_intersect_key($context, $_parent) + $_parent;
  573. // line 169
  574. echo " <div class=\"item-actions\">
  575. ";
  576. // line 170
  577. if (( !$this->getAttribute(($context["field"] ?? null), "collapsible", array(), "any", true, true) || $this->getAttribute(($context["field"] ?? null), "collapsible", array()))) {
  578. // line 171
  579. echo " <i class=\"fa fa-chevron-circle-down\" data-action=\"collapse\"></i>
  580. <br />
  581. ";
  582. }
  583. // line 174
  584. echo " <i class=\"fa fa-trash-o\" data-action=\"delete\"></i>
  585. </div>";
  586. }
  587. // line 177
  588. echo "</li>";
  589. }
  590. public function getTemplateName()
  591. {
  592. return "forms/fields/list/list.html.twig";
  593. }
  594. public function isTraitable()
  595. {
  596. return false;
  597. }
  598. public function getDebugInfo()
  599. {
  600. return array ( 597 => 177, 593 => 174, 588 => 171, 586 => 170, 583 => 169, 568 => 165, 567 => 163, 566 => 162, 564 => 160, 562 => 158, 561 => 156, 560 => 155, 558 => 153, 556 => 151, 555 => 150, 553 => 148, 551 => 146, 548 => 144, 546 => 143, 543 => 141, 541 => 140, 539 => 139, 522 => 138, 520 => 137, 516 => 135, 514 => 134, 509 => 133, 506 => 132, 500 => 35, 496 => 34, 491 => 33, 488 => 32, 480 => 180, 476 => 178, 472 => 132, 470 => 131, 460 => 127, 457 => 126, 444 => 124, 435 => 123, 432 => 122, 423 => 120, 414 => 118, 411 => 117, 409 => 116, 406 => 115, 404 => 114, 401 => 113, 398 => 112, 381 => 108, 372 => 105, 370 => 104, 367 => 103, 353 => 102, 350 => 101, 348 => 99, 347 => 97, 346 => 96, 344 => 95, 341 => 94, 338 => 93, 336 => 91, 335 => 89, 333 => 88, 330 => 87, 328 => 85, 327 => 84, 325 => 83, 323 => 82, 320 => 81, 317 => 80, 314 => 79, 311 => 78, 308 => 77, 305 => 76, 302 => 75, 299 => 74, 296 => 73, 293 => 72, 290 => 71, 273 => 70, 263 => 68, 260 => 67, 242 => 66, 240 => 65, 237 => 64, 233 => 63, 231 => 62, 220 => 61, 210 => 58, 207 => 57, 194 => 55, 185 => 54, 183 => 53, 175 => 52, 166 => 50, 160 => 48, 158 => 47, 155 => 46, 148 => 45, 141 => 44, 136 => 42, 131 => 41, 129 => 40, 125 => 39, 121 => 37, 119 => 32, 113 => 31, 106 => 28, 100 => 26, 92 => 24, 90 => 23, 85 => 22, 79 => 19, 76 => 18, 72 => 17, 67 => 16, 63 => 15, 59 => 14, 53 => 12, 51 => 11, 44 => 10, 41 => 9, 37 => 1, 35 => 7, 33 => 6, 31 => 5, 29 => 4, 27 => 3, 11 => 1,);
  601. }
  602. /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */
  603. public function getSource()
  604. {
  605. @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED);
  606. return $this->getSourceContext()->getCode();
  607. }
  608. public function getSourceContext()
  609. {
  610. return new Twig_Source("{% extends \"forms/field.html.twig\" %}
  611. {% set value = (value is null ? field.default : value) %}
  612. {% set name = field.name %}
  613. {% set btnLabel = field.btnLabel is defined ? field.btnLabel : \"PLUGIN_ADMIN.ADD_ITEM\" %}
  614. {% set btnSortLabel = field.btnSortLabel is defined ? field.btnSortLabel : \"PLUGIN_ADMIN.SORT_BY\" %}
  615. {% set fieldControls = field.controls|default('bottom') %}
  616. {% block contents %}
  617. <div class=\"form-label{% if not vertical %} block size-1-3 pure-u-1-3{% endif %}\">
  618. {% if field.toggleable %}
  619. <span class=\"checkboxes toggleable\" data-grav-field=\"toggleable\" data-grav-field-name=\"{{ (scope ~ field.name)|fieldName }}\">
  620. <input type=\"checkbox\"
  621. id=\"toggleable_{{ field.name }}\"
  622. {% if toggleableChecked %}value=\"1\"{% endif %}
  623. name=\"toggleable_{{ (scope ~ field.name)|fieldName }}\"
  624. {% if toggleableChecked %}checked=\"checked\"{% endif %}
  625. >
  626. <label for=\"toggleable_{{ field.name }}\"></label>
  627. </span>
  628. {% endif %}
  629. <label{{ (field.toggleable ? ' class=\"toggleable\" for=\"toggleable_' ~ field.name ~ '\"')|raw }}>
  630. {% if field.help %}
  631. <span class=\"hint--bottom\" data-hint=\"{{ field.help|e|tu }}\">{{ field.label|tu }}</span>
  632. {% else %}
  633. {{ field.label|tu }}
  634. {% endif %}
  635. {{ field.validate.required in ['on', 'true', 1] ? '<span class=\"required\">*</span>' }}
  636. </label>
  637. </div>
  638. <div class=\"form-data{% if not vertical %} block size-2-3 pure-u-2-3{% endif %}\"
  639. {% block global_attributes %}
  640. data-grav-field=\"{{ field.type }}\"
  641. data-grav-disabled=\"{{ toggleableChecked }}\"
  642. data-grav-default=\"{{ field.default|json_encode|e('html_attr') }}\"
  643. {% endblock %}
  644. >
  645. <div class=\"form-list-wrapper {{ field.size }}\" data-type=\"collection\"
  646. {% if field.selectunique %}
  647. data-select-unique=\"{{ field.selectunique|json_encode|e('html_attr') }}\"
  648. data-max=\"{{ field.selectunique|length }}\"
  649. {% endif %}
  650. {% if field.min is defined %}data-min=\"{{ field.min }}\"{% endif %}
  651. {% if field.max is defined and not field.selectunique %}data-max=\"{{ field.max }}\"{% endif %}
  652. >
  653. {% if fieldControls in ['top', 'both'] %}
  654. <div class=\"collection-actions{{ not value|length ? ' hidden' : '' }}\">
  655. <button class=\"button\" type=\"button\" data-action=\"expand_all\"
  656. {% if field.disabled or isDisabledToggleable %}disabled=\"disabled\"{% endif %}><i class=\"fa fa-chevron-circle-down\"></i> {{ \"PLUGIN_ADMIN.EXPAND_ALL\"|e|tu }}</button>
  657. <button class=\"button\" type=\"button\" data-action=\"collapse_all\"
  658. {% if field.disabled or isDisabledToggleable %}disabled=\"disabled\"{% endif %}><i class=\"fa fa-chevron-circle-right\"></i> {{ \"PLUGIN_ADMIN.COLLAPSE_ALL\"|e|tu }}</button>
  659. {% if field.sortby %}
  660. <button class=\"button{{ not value|length ? ' hidden' : '' }}\" type=\"button\" data-action=\"sort\" data-action-sort=\"{{ field.sortby }}\" data-action-sort-dir=\"{{ field.sortby_dir|default('asc') }}\"
  661. {% if field.disabled or isDisabledToggleable %}disabled=\"disabled\"{% endif %}><i class=\"fa fa-sort-amount-{{ field.sortby_dir|default('asc') }}\"></i> {{ btnSortLabel|e|tu }} '{{ field.sortby }}'</button>
  662. {% endif %}
  663. <button class=\"button\" type=\"button\" data-action=\"add\" data-action-add=\"top\"
  664. {% if field.disabled or isDisabledToggleable %}disabled=\"disabled\"{% endif %}><i class=\"fa fa-plus\"></i> {{ btnLabel|e|tu }}</button>
  665. </div>
  666. {% endif %}
  667. <ul {% if field.classes is defined %}class=\"{{ field.classes }}\"{% endif %} data-collection-holder=\"{{ name }}\"
  668. {% if field.sort is same as(false) %}
  669. data-collection-nosort
  670. {% endif %}>
  671. {% if field.fields %}
  672. {% for key, val in value %}
  673. {% set itemName = name ? name ~ '.' ~ key : key %}
  674. <li data-collection-item=\"{{ itemName }}\" data-collection-key=\"{{ key }}\" class=\"{{ (field.collapsible is not defined or field.collapsible) and field.collapsed ? 'collection-collapsed' : '' }}\">
  675. <div class=\"collection-sort\"><i class=\"fa fa-fw fa-bars\"></i></div>
  676. {% for childName, child in field.fields %}
  677. {% if childName starts with '.' %}
  678. {% set childKey = childName|trim('.') %}
  679. {% set childValue = val[childName[1:]] %}
  680. {% set childName = itemName ~ childName %}
  681. {% else %}
  682. {% set childKey = childName %}
  683. {% set childValue = data.value(scope ~ childName) %}
  684. {% set childName = childName|replace({'*': key}) %}
  685. {% endif %}
  686. {% set child = child|merge({ name: childName }) %}
  687. {% if child.type == 'key' %}
  688. {%
  689. include 'forms/fields/key/key.html.twig'
  690. with { field: child, value: key }
  691. %}
  692. {% elseif child.key == true %}
  693. {% include [
  694. \"forms/fields/#{child.type}/#{child.type}.html.twig\",
  695. 'forms/fields/key/key.html.twig'
  696. ] with { field: child, value: key }
  697. %}
  698. {% elseif child.type %}
  699. {% set originalValue = childValue %}
  700. {%
  701. include [
  702. \"forms/fields/#{child.type}/#{child.type}.html.twig\",
  703. 'forms/fields/text/text.html.twig'
  704. ] with { field: child, value: childValue }
  705. %}
  706. {% endif %}
  707. {% endfor %}
  708. <div class=\"item-actions\">
  709. {% if field.collapsible is not defined or field.collapsible %}
  710. <i class=\"fa fa-chevron-circle-{{ field.collapsed ? 'right' : 'down' }}\" data-action=\"{{ field.collapsed ? 'expand' : 'collapse' }}\"></i>
  711. <br />
  712. {% endif %}
  713. <i class=\"fa fa-trash-o\" data-action=\"delete\"></i>
  714. </div>
  715. </li>
  716. {% endfor %}
  717. {% endif %}
  718. </ul>
  719. {% if fieldControls in ['bottom', 'both'] %}
  720. <div class=\"collection-actions\">
  721. {% if field.collapsible is not defined or field.collapsible %}
  722. <button class=\"button\" type=\"button\" data-action=\"expand_all\"
  723. {% if field.disabled or isDisabledToggleable %}disabled=\"disabled\"{% endif %}><i class=\"fa fa-chevron-circle-down\"></i> {{ \"PLUGIN_ADMIN.EXPAND_ALL\"|e|tu }}</button>
  724. <button class=\"button\" type=\"button\" data-action=\"collapse_all\"
  725. {% if field.disabled or isDisabledToggleable %}disabled=\"disabled\"{% endif %}><i class=\"fa fa-chevron-circle-right\"></i> {{ \"PLUGIN_ADMIN.COLLAPSE_ALL\"|e|tu }}</button>
  726. {% endif %}
  727. {% if field.sortby %}
  728. <button class=\"button{{ not value|length ? ' hidden' : '' }}\" type=\"button\" data-action=\"sort\" data-action-sort=\"{{ field.sortby }}\" data-action-sort-dir=\"{{ field.sortby_dir|default('asc') }}\"
  729. {% if field.disabled or isDisabledToggleable %}disabled=\"disabled\"{% endif %}><i class=\"fa fa-sort-amount-{{ field.sortby_dir|default('asc') }}\"></i> {{ btnSortLabel|e|tu }} '{{ field.sortby }}'</button>
  730. {% endif %}
  731. <button class=\"button\" type=\"button\" data-action=\"add\" data-action-add=\"bottom\"
  732. {% if field.disabled or isDisabledToggleable %}disabled=\"disabled\"{% endif %}><i class=\"fa fa-plus\"></i> {{ btnLabel|e|tu }}</button>
  733. </div>
  734. {% endif %}
  735. {%- set itemName = name ? name ~ '.*' : '*' -%}
  736. <div style=\"display: none;\" data-collection-template=\"new\" data-collection-template-html=\"{%- filter replace({' ': ' ', '\\n': ' '})|e('html_attr') -%}
  737. <li data-collection-item=\"{{ itemName }}\">
  738. {% if field.sort is not same as(false) %}
  739. <div class=\"collection-sort\"><i class=\"fa fa-fw fa-bars\"></i></div>
  740. {% endif %}
  741. {%- if field.fields -%}
  742. {%- for childName, child in field.fields -%}
  743. {%- if childName starts with '.' -%}
  744. {%- set childKey = childName|trim('.') -%}
  745. {%- set childName = itemName ~ childName -%}
  746. {%- else %}
  747. {%- set childKey = childName -%}
  748. {%- set childName = childName|replace({'*': key}) -%}
  749. {%- endif %}
  750. {%- set child = child|merge({ name: childName }) -%}
  751. {%- if child.type == 'key' -%}
  752. {%-
  753. include 'forms/fields/key/key.html.twig'
  754. with { field: child, value: null }
  755. -%}
  756. {%- elseif child.key == true -%}
  757. {%-
  758. include [
  759. \"forms/fields/#{child.type}/#{child.type}.html.twig\",
  760. 'forms/fields/key/key.html.twig'
  761. ] with { field: child, value: null }
  762. -%}
  763. {%- elseif child.type -%}
  764. {%-
  765. include [
  766. \"forms/fields/#{child.type}/#{child.type}.html.twig\",
  767. 'forms/fields/text/text.html.twig'
  768. ] with { field: child, value: null }
  769. -%}
  770. {%- endif -%}
  771. {%- endfor %}
  772. <div class=\"item-actions\">
  773. {% if field.collapsible is not defined or field.collapsible %}
  774. <i class=\"fa fa-chevron-circle-down\" data-action=\"collapse\"></i>
  775. <br />
  776. {% endif %}
  777. <i class=\"fa fa-trash-o\" data-action=\"delete\"></i>
  778. </div>
  779. {%- endif -%}
  780. </li>
  781. {%- endfilter -%}\"></div>
  782. <div style=\"display: none;\" data-collection-config=\"{{ name }}\"></div>
  783. </div>
  784. </div>
  785. {% endblock %}
  786. ", "forms/fields/list/list.html.twig", "/home/kevin/Sites/static-ethica.net/user/plugins/admin/themes/grav/templates/forms/fields/list/list.html.twig");
  787. }
  788. }