-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheditor.vue
63 lines (45 loc) · 1.81 KB
/
editor.vue
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<template lang="jade">
pre {{innovation | json}}
.hack(v-for='innovation in innovation')
.Editor
.Editor-view(v-on:click='showData')
section(v-for='module in innovation.modules' class='Module--{{module.type}}').Module
.Module-content
// render each content bit
div(v-for='(type, value) in module.content' class='{{type}}')
.Heading-wrap(v-if='type == "Heading"')
h1.Heading(v-medium='value')
input(v-model='value')
.Text-wrap(v-if='type == "Text"')
p.Text(v-medium='value')
.Image-wrap(v-if='type == "Image"')
img(v-bind:src='value').Image
.Table-wrap(v-if='type == "Table"')
| {{{value}}}
// render question
.Module-analytics(v-if='module.analytics.active')
.Question
.Question-text(v-medium='module.analytics.question.text')
.Question-explanation(v-medium='module.analytics.question.explanation')
// render input fields
template(v-for='input in module.analytics.inputs' )
div(v-if='input.type == "range"' class='Input--{{input.type}}')
.Input-labelLow(v-medium='input.label')
input(type='range').Input-element
.Input-labelHigh(v-medium='input.labelHigh')
div(v-if='input.type == "textarea"' class='Input--{{input.type}}')
.Input-label(v-medium='input.label')
textarea.Input-element
.Editor-toolbar
h1(v-medium='innovation.name' mode='inline')
</template>
<script lang="coffee">
db = require('../firebase.coffee')()
module.exports =
firebase: ->
data =
innovation:
source: db.innovation @$route.params.innovation_slug
directives:
medium: require '../directives/medium'
</script>