|
|
@@ -0,0 +1,64 @@
|
|
|
+<template>
|
|
|
+ <div>
|
|
|
+ <h1>Create application</h1>
|
|
|
+ <div v-if="user">
|
|
|
+ <span>{{ instruction }}</span>
|
|
|
+ <div class="question_block" v-for="(element, index) in pattern" :key="index">
|
|
|
+ <span class="question">{{ element.text }}</span>
|
|
|
+ <span v-if="element.optional"> (Optional)</span>
|
|
|
+ <br>
|
|
|
+ <LimitedTextField class="textfield" :highlight="highlight"></LimitedTextField>
|
|
|
+ <span class="hint">{{ element.hint }}</span>
|
|
|
+ </div>
|
|
|
+ <button @click="update">Create/Update</button>
|
|
|
+ </div>
|
|
|
+ <span v-else>You are not logged in.</span>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+ import LimitedTextField from '../components/inputtypes/LimitedTextField.vue'
|
|
|
+
|
|
|
+ export default {
|
|
|
+ data () {
|
|
|
+ return {
|
|
|
+ instruction: '',
|
|
|
+ pattern: null,
|
|
|
+ highlight: false,
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created () {
|
|
|
+ this.core.get('/app-pattern').then((response) => {
|
|
|
+ this.instruction = response.data.instruction;
|
|
|
+ this.pattern = response.data.fields;
|
|
|
+ })
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ user() {
|
|
|
+ return this.$store.state.user
|
|
|
+ },
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ update() {
|
|
|
+ this.highlight = true
|
|
|
+ },
|
|
|
+ },
|
|
|
+ components: {
|
|
|
+ LimitedTextField,
|
|
|
+ },
|
|
|
+ }
|
|
|
+</script>
|
|
|
+
|
|
|
+<style scoped>
|
|
|
+ .question_block {
|
|
|
+ margin: 1em;
|
|
|
+ }
|
|
|
+
|
|
|
+ .question {
|
|
|
+ font-weight: bold;
|
|
|
+ }
|
|
|
+
|
|
|
+ .hint {
|
|
|
+ font-size: 0.7em;
|
|
|
+ }
|
|
|
+</style>
|