summaryrefslogtreecommitdiff
path: root/themes/okadmin
diff options
context:
space:
mode:
authorSean Fridman <fridman@mail.sfsu.edu>2015-04-09 01:58:01 -0400
committerSean Fridman <fridman@mail.sfsu.edu>2015-04-09 01:58:01 -0400
commitc5e38d7f48e2b5d6ce5ea70f7337f983e55969d6 (patch)
tree4615fb1e73776647b08838d7b5b41cd445a57b1e /themes/okadmin
parent0f7c28fa2e1fec6b3ce006435cd4bd6c7725d4af (diff)
Add captioned-image-list type
Diffstat (limited to 'themes/okadmin')
-rw-r--r--themes/okadmin/public/css/main.css3
-rw-r--r--themes/okadmin/templates/partials/inputs.liquid16
2 files changed, 17 insertions, 2 deletions
diff --git a/themes/okadmin/public/css/main.css b/themes/okadmin/public/css/main.css
index c5694eb..d120b0a 100644
--- a/themes/okadmin/public/css/main.css
+++ b/themes/okadmin/public/css/main.css
@@ -135,7 +135,8 @@ label {
.main.resource form input,
.main.resource form textarea,
-.main.resource form select {
+.main.resource form select,
+.main.resource form img {
display: block;
float: left;
width: 20em;
diff --git a/themes/okadmin/templates/partials/inputs.liquid b/themes/okadmin/templates/partials/inputs.liquid
index 551a66c..8269d4e 100644
--- a/themes/okadmin/templates/partials/inputs.liquid
+++ b/themes/okadmin/templates/partials/inputs.liquid
@@ -3,7 +3,7 @@
{% assign spec = pair[1] %}
{% assign type = spec.type %}
- <div class="property">
+ <div class="property {{type}}">
<label for="{{name}}">{{name | capitalize}}</label>
{% if type == 'string' %}
@@ -28,6 +28,20 @@
<option value="{{option}}" {% if option == spec.value %}selected{% endif %}>{{option}}</option>
{% endfor %}
</select>
+ {% elsif type == 'captioned-image-list' %}
+ <ol>
+ {% for image in spec.value %}
+ <li class="image-element">
+ <img src="{{image.uri}}" alt="{{image.caption}}">
+ <input type="hidden" name="{{name}}[][uri]" value="{{image.uri}}">
+ <div class="clear"></div>
+ <input type="text" name="{{name}}[][caption]" value="{{image.caption}}">
+ <button class="remove-image">-</button>
+ </li>
+ {% endfor %}
+ </ol>
+ <input class="file-upload" style="display: none;" type="file" accept="image/*">
+ <button class="add-image">+</button>
{% else %}
<p><pre style="color: red">Admin template doesn't support '{{type}}' properties!</pre></p>
{% endif %}