summaryrefslogtreecommitdiff
path: root/themes/okadmin/templates
diff options
context:
space:
mode:
authorJules Laplace <jules@okfoc.us>2016-12-31 05:58:49 +0100
committerJules Laplace <jules@okfoc.us>2016-12-31 05:58:49 +0100
commitfe31b3ad482c959deb5b4fa447e3d73c042e982c (patch)
treef8ddac33fd7890d599e1f75a00eb08217ecde84d /themes/okadmin/templates
parent3319b60ca946a0fad11da52bb3fee4aa66afb62c (diff)
parent073b2af3e21edccb35dad6b5bfdda2772f164abf (diff)
merge
Diffstat (limited to 'themes/okadmin/templates')
-rw-r--r--themes/okadmin/templates/index.liquid30
-rw-r--r--themes/okadmin/templates/partials/inputs.liquid16
2 files changed, 26 insertions, 20 deletions
diff --git a/themes/okadmin/templates/index.liquid b/themes/okadmin/templates/index.liquid
index c5754dc..d47eb2e 100644
--- a/themes/okadmin/templates/index.liquid
+++ b/themes/okadmin/templates/index.liquid
@@ -49,19 +49,23 @@
{% endfor %}
{% endfor %}
{% else %}
- <ol class="resource-list">
- {% for data in resource.data %}
- <a href="{{resource.type}}/{{data.id}}/" {% if data.disabled %}class="disabled"{% endif %}>
- {% if resource.display == 'image' %}
- <div class="image" style="background-image:url('{{data.title}}')"></div>
- {% else %}
- {{data.title}}
- {% endif %}
- <input class="resource-input" type="hidden" name="{{resource.type}}[{{forloop.index0}}]"
- value='{{data | stringify | escape_once}}'>
- </a>
- {% endfor %}
- </ol>
+ {% assign resourceJSON = resource.data[0] | stringify %}
+ {% if resourceJSON != "[]" %}
+ <ol class="resource-list">
+ {% for data in resource.data %}
+ <a href="{{resource.type}}/{{data.id}}/" {% if data.disabled %}class="disabled"{% endif %}>
+ {% if resource.display == 'image' %}
+ <div class="image" style="background-image:url('{{data.title}}')"></div>
+ {% else %}
+ {{data.title}}
+ {% endif %}
+ <input class="resource-input" type="hidden" name="{{resource.type}}[{{forloop.index0}}]"
+ value='{{data | stringify | escape_once}}'>
+ </a>
+ {% endfor %}
+ </ol>
+ {% endif %}
+ {% endif %}
<footer>
<nav>
<a class="btn cancel-btn" href="#">cancel</a>
diff --git a/themes/okadmin/templates/partials/inputs.liquid b/themes/okadmin/templates/partials/inputs.liquid
index 55afb51..60466de 100644
--- a/themes/okadmin/templates/partials/inputs.liquid
+++ b/themes/okadmin/templates/partials/inputs.liquid
@@ -21,7 +21,11 @@
<select
name="{{name}}">
{% for option in spec.options %}
- <option value="{{option}}" {% if option == spec.value %}selected{% endif %}>{{option | capitalize}}</option>
+ {% if option.length == 2 %}
+ <option value="{{option[0]}}" {% if option[0] == spec.value %}selected{% endif %}>{{option[1] | capitalize}}</option>
+ {% else %}
+ <option value="{{option}}" {% if option == spec.value %}selected{% endif %}>{{option | capitalize}}</option>
+ {% endif %}
{% endfor %}
</select>
{% elsif type == 'video' %}
@@ -94,13 +98,11 @@
name="{{name}}[{{forloop.index0}}][text]"
value="{{link.text | escape}}"
type="text"
- placeholder="Link text"
class="link-input link-text">
<input
name="{{name}}[{{forloop.index0}}][uri]"
value="{{link.uri | escape}}"
type="text"
- placeholder="URL"
class="link-input link-uri">
<button class="remove-link-btn btn">
-
@@ -112,10 +114,10 @@
<div class="handle"></div>
<input type="text"
class="link-input-new link-text"
- placeholder="Link text">
+ placeholder="{% if spec.textLabel %}{{ spec.textLabel }}{% else %}Link text{% endif %}">
<input type="text"
class="link-input-new link-uri"
- placeholder="http://www.example.com">
+ placeholder="{% if spec.linkLabel %}{{ spec.linkLabel }}{% else %}http://www.example.com{% endif %}">
<button class="add-link-btn btn">+</button>
<script type="text/html" class="link-template">
@@ -125,13 +127,13 @@
name="{{name}}[][text]"
value=""
type="text"
- placeholder="Link text"
+ placeholder="{% if spec.textLabel %}{{ spec.textLabel }}{% else %}Link text{% endif %}"
class="link-input link-text">
<input
name="{{name}}[][uri]"
value=""
type="text"
- placeholder="URL"
+ placeholder="{% if spec.linkLabel %}{{ spec.linkLabel }}{% else %}http://www.example.com{% endif %}"
class="link-input link-uri">
<button class="remove-link-btn btn">
-