summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--examples/index.js9
-rw-r--r--themes/okadmin/templates/partials/inputs.liquid6
2 files changed, 14 insertions, 1 deletions
diff --git a/examples/index.js b/examples/index.js
index 15de909..998aa1d 100644
--- a/examples/index.js
+++ b/examples/index.js
@@ -35,6 +35,15 @@ var app = okcms.createApp({
title: {type: 'string'},
description: {type: 'text'},
color: {type: 'enum', options: ["red","blue","green"]},
+ rating: {type: 'enum', options: {
+ "e": "Everyone",
+ "ec": "Early Childhood",
+ "e10": "Everyone 10+",
+ "t": "Teen",
+ "m": "Mature",
+ "ao": "Adults Only",
+ "rp": "Rating Pending",
+ }},
video: {type: 'video'},
images: {type: 'gallery'}
},
diff --git a/themes/okadmin/templates/partials/inputs.liquid b/themes/okadmin/templates/partials/inputs.liquid
index 55afb51..063f9b7 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' %}