Clean Expires

Signed-off-by: Jonas Rittershofer <jotoeri@users.noreply.github.com>
This commit is contained in:
Jonas Rittershofer 2020-04-20 13:51:48 +02:00
commit 2cd445d201
12 changed files with 106 additions and 121 deletions

View file

@ -36,14 +36,14 @@
<input v-if="edit"
:placeholder="t('forms', 'Enter a title for this question')"
:aria-label="t('forms', 'The title of the question number {index}', {index})"
:value="title"
:value="text"
class="question__header-title"
type="text"
minlength="1"
maxlength="256"
required
@input="onInput">
<h3 v-else class="question__header-title" v-text="title" />
<h3 v-else class="question__header-title" v-text="text" />
<Actions class="question__header-menu" :force-menu="true">
<ActionButton icon="icon-delete" @click="onDelete">
{{ t('forms', 'Delete question') }}
@ -82,7 +82,7 @@ export default {
type: Number,
required: true,
},
title: {
text: {
type: String,
required: true,
},
@ -94,7 +94,7 @@ export default {
methods: {
onInput({ target }) {
this.$emit('update:title', target.value)
this.$emit('update:text', target.value)
},
/**
@ -115,7 +115,7 @@ export default {
* Delete this question
*/
onDelete() {
this.$emit('delete', this.id)
this.$emit('delete')
},
},
}

View file

@ -23,13 +23,14 @@
<template>
<Question
v-bind.sync="$attrs"
:title="title"
:text="text"
:edit.sync="edit"
@update:title="onTitleChange">
@delete="onDelete"
@update:text="onTitleChange">
<div class="question__content">
<!-- TODO: properly choose max length -->
<textarea ref="textarea"
:aria-label="t('forms', 'A long answer for the question “{title}”', { title })"
:aria-label="t('forms', 'A long answer for the question “{text}”', { text })"
:placeholder="t('forms', 'Long answer text')"
:readonly="edit"
:value="values[0]"

View file

@ -23,9 +23,10 @@
<template>
<Question
v-bind.sync="$attrs"
:title="title"
:text="text"
:edit.sync="edit"
@update:title="onTitleChange">
@delete="onDelete"
@update:text="onTitleChange">
<ul class="question__content" :role="isUnique ? 'radiogroup' : ''">
<template v-for="(answer, index) in options">
<li :key="index" class="question__item">
@ -45,7 +46,7 @@
<label v-if="!edit"
ref="label"
:for="`${id}-answer-${index}`"
class="question__label">{{ answer }}</label>
class="question__label">{{ answer.text }}</label>
<!-- Answer text input edit -->
<!-- TODO: properly choose max length -->
@ -53,7 +54,7 @@
ref="input"
:aria-label="t('forms', 'An answer for the {index} option', { index: index + 1 })"
:placeholder="t('forms', 'Answer number {index}', { index: index + 1 })"
:value="answer"
:value="answer.text"
class="question__input"
maxlength="256"
minlength="1"

View file

@ -23,13 +23,14 @@
<template>
<Question
v-bind.sync="$attrs"
:title="title"
:text="text"
:edit.sync="edit"
@update:title="onTitleChange">
@delete="onDelete"
@update:text="onTitleChange">
<div class="question__content">
<!-- TODO: properly choose max length -->
<input ref="input"
:aria-label="t('forms', 'A short answer for the question “{title}”', { title })"
:aria-label="t('forms', 'A short answer for the question “{text}”', { text })"
:placeholder="t('forms', 'Short answer text')"
:readonly="edit"
:value="values[0]"