summaryrefslogtreecommitdiff
path: root/themes/okadmin/templates/partials/inputs.liquid
blob: 2726473620c5dc2e69f3a060e5ee375d5b0bece5 (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
{% for pair in resource.spec %}
  {% assign name = pair[0] %}
  {% assign spec = pair[1] %}
  {% assign type = spec.type %}

  <div class="property">
    <label for="{{name}}">{{name | capitalize}}</label>
    {% if type == 'string' %}
      <input
        {% if spec.disabled %}
          disabled="true"
        {% endif %}
          name="{{name}}" type="text" value="{{spec.value}}">
    {% else if type == 'text' %}
      <textarea
        {% if spec.disabled %}
          disabled="true"
        {% endif %}
        name="{{name}}" rows="40" cols="80">{{spec.value}}</textarea>
    {% else %}
      <p><pre style="color: red">Admin template doesn't support '{{type}}' properties!</pre></p>
    {% endif %}
  </div>

{% endfor %}