blob: 8255d99b6e379b233442ccfcd8a35381b167c4e1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
|
{% include 'partials/head' %}
{% include 'partials/flash' %}
<section class="index main">
{% for pair in resources %}
{% assign name = pair[0] %}
{% assign resource = pair[1] %}
<section class="resource-category root
{% if resource.groupBy %} grouped {% endif %}
{{name}}">
<form action="{{resource.type}}/__batch__/" method="POST">
<header>
<h2>{{name | capitalize}}</h2>
</header>
<input type="hidden" name="_method" value="PUT">
{% if resource.groupBy %}
{% assign i = 0 %}
{% for pair in resource.data[resource.groupBy] %}
{% assign group = pair[0] %}
{% assign members = pair[1] %}
<section class="resource-category {{group}}">
<header>
<h2>{{group | capitalize}}</h2>
</header>
<ol class="resource-list">
{% for data in members %}
<li>
{% if data.disabled %} <del> {% endif %}
<a href="{{resource.type}}/{{data.id}}/">{{data.title}}</a>
{% if data.disabled %} </del> {% endif %}
<input class="resource-input" type="hidden" name="{{resource.type}}[{{i}}]"
value='{{data | stringify | escape_once}}'>
</li>
{% assign i = i | plus: 1 %}
{% endfor %}
</ol>
<footer>
<nav>
<a class="btn cancel-btn" href="#">cancel</a>
<button type="submit"
class="btn save-btn" href="#">save</button>
<a class="btn edit-btn active" href="#">sort</a>
<a class="btn add-btn active" href="{{resource.type}}/__new__/">+</a>
</nav>
</footer>
</section>
{% endfor %}
{% else %}
<ol class="resource-list">
{% for data in resource.data %}
<li>
{% if data.disabled %} <del> {% endif %}
<a href="{{resource.type}}/{{data.id}}/">{{data.title}}</a>
{% if data.disabled %} </del> {% endif %}
<input class="resource-input" type="hidden" name="{{resource.type}}[{{forloop.index0}}]"
value='{{data | stringify | escape_once}}'>
</li>
{% endfor %}
</ol>
<footer>
<nav>
<a class="btn cancel-btn" href="#">cancel</a>
<button type="submit"
class="btn save-btn" href="#">save</button>
<a class="btn edit-btn active" href="#">sort</a>
<a class="btn add-btn active" href="{{resource.type}}/__new__/">+</a>
</nav>
</footer>
{% endif %}
</form>
</section>
{% endfor %}
</section>
{% include 'partials/tail' %}
|