summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJules Laplace <jules@okfoc.us>2016-12-31 05:57:34 +0100
committerJules Laplace <jules@okfoc.us>2016-12-31 05:57:49 +0100
commit3319b60ca946a0fad11da52bb3fee4aa66afb62c (patch)
tree25ea604546324640388580f2ee269d244081f0e2
parentbdcc83dae3742bf1c88da43a23f7278127d6251c (diff)
image display type in backend
-rw-r--r--examples/index.js8
-rw-r--r--examples/lib/okpush/index.js5
-rw-r--r--themes/okadmin/templates/index.liquid6
3 files changed, 17 insertions, 2 deletions
diff --git a/examples/index.js b/examples/index.js
index 15de909..92db7c0 100644
--- a/examples/index.js
+++ b/examples/index.js
@@ -21,6 +21,14 @@ var app = okcms.createApp({
// }
// }
// },
+ dashboard: {
+ resources: {
+ flour: {
+ display: 'image',
+ field: 'image',
+ }
+ }
+ }
},
schemas: {
diff --git a/examples/lib/okpush/index.js b/examples/lib/okpush/index.js
index 6ef83c6..eb8e240 100644
--- a/examples/lib/okpush/index.js
+++ b/examples/lib/okpush/index.js
@@ -99,7 +99,10 @@ function OKPush (options) {
})
// should work without middleware
- router.post('/add', function (req, res) {
+ router.post('/subscribe', function (req, res) {
+ // add a key
+ })
+ router.post('/unsubscribe', function (req, res) {
// add a key
})
diff --git a/themes/okadmin/templates/index.liquid b/themes/okadmin/templates/index.liquid
index d2ae557..c5754dc 100644
--- a/themes/okadmin/templates/index.liquid
+++ b/themes/okadmin/templates/index.liquid
@@ -52,7 +52,11 @@
<ol class="resource-list">
{% for data in resource.data %}
<a href="{{resource.type}}/{{data.id}}/" {% if data.disabled %}class="disabled"{% endif %}>
- {{data.title}}
+ {% 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>