Alter Database
Signed-off-by: Jonas Rittershofer <jotoeri@users.noreply.github.com>
This commit is contained in:
parent
d402107cbb
commit
03e9ff4a86
30 changed files with 1060 additions and 842 deletions
|
|
@ -26,8 +26,8 @@
|
|||
<span v-if="options.expired" class="expired">
|
||||
{{ t('forms', 'Expired') }}
|
||||
</span>
|
||||
<span v-if="options.expiration" class="open">
|
||||
{{ t('forms', 'Expires %n', 1, expirationdate) }}
|
||||
<span v-if="options.expires" class="open">
|
||||
{{ t('forms', 'Expires %n', 1, expirationDate) }}
|
||||
</span>
|
||||
<span v-else class="open">
|
||||
{{ t('forms', 'Expires never') }}
|
||||
|
|
@ -39,12 +39,6 @@
|
|||
<span v-if="options.isAnonymous" class="information">
|
||||
{{ t('forms', 'Anonymous form') }}
|
||||
</span>
|
||||
<span v-if="options.fullAnonymous" class="information">
|
||||
{{ t('forms', 'Usernames hidden to Owner') }}
|
||||
</span>
|
||||
<span v-if="options.isAnonymous & !options.fullAnonymous" class="information">
|
||||
{{ t('forms', 'Usernames visible to Owner') }}
|
||||
</span>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
|
@ -61,7 +55,7 @@ export default {
|
|||
},
|
||||
|
||||
computed: {
|
||||
expirationdate() {
|
||||
expirationDate() {
|
||||
const date = moment(this.options.expirationDate, moment.localeData().longDateFormat('L')).fromNow()
|
||||
return date
|
||||
},
|
||||
|
|
|
|||
|
|
@ -72,12 +72,12 @@
|
|||
<img class="icontwo">
|
||||
</div>
|
||||
<div class="symbol icon-voted" />
|
||||
<a :href="voteUrl" class="wrapper group-1-1">
|
||||
<a :href="submitUrl" class="wrapper group-1-1">
|
||||
<div class="name">
|
||||
{{ form.event.title }}
|
||||
{{ form.form.title }}
|
||||
</div>
|
||||
<div class="description">
|
||||
{{ form.event.description }}
|
||||
{{ form.form.description }}
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
|
|
@ -102,18 +102,18 @@
|
|||
</div>
|
||||
|
||||
<div class="wrapper group-2-1">
|
||||
<div v-tooltip="accessType" class="thumbnail access" :class="form.event.access">
|
||||
<div v-tooltip="accessType" class="thumbnail access" :class="form.form.access">
|
||||
{{ accessType }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="owner">
|
||||
<UserDiv :user-id="form.event.owner" :display-name="form.event.ownerDisplayName" />
|
||||
<UserDiv :user-id="form.form.ownerId" :display-name="form.form.ownerDisplayName" />
|
||||
</div>
|
||||
<div class="wrapper group-2-2">
|
||||
<div class="created ">
|
||||
{{ timeSpanCreated }}
|
||||
</div>
|
||||
<div class="expiry" :class="{ expired : form.event.expired }">
|
||||
<div class="expiry" :class="{ expired : form.form.expired }">
|
||||
{{ timeSpanExpiration }}
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -150,13 +150,13 @@ export default {
|
|||
|
||||
computed: {
|
||||
accessType() {
|
||||
if (this.form.event.access === 'public') {
|
||||
if (this.form.form.access === 'public') {
|
||||
return t('forms', 'Public access')
|
||||
} else if (this.form.event.access === 'select') {
|
||||
} else if (this.form.form.access === 'select') {
|
||||
return t('forms', 'Only shared')
|
||||
} else if (this.form.event.access === 'registered') {
|
||||
} else if (this.form.form.access === 'registered') {
|
||||
return t('forms', 'Registered users only')
|
||||
} else if (this.form.event.access === 'hidden') {
|
||||
} else if (this.form.form.access === 'hidden') {
|
||||
return t('forms', 'Hidden form')
|
||||
} else {
|
||||
return ''
|
||||
|
|
@ -164,12 +164,12 @@ export default {
|
|||
},
|
||||
|
||||
timeSpanCreated() {
|
||||
return moment(this.form.event.created, 'YYYY-MM-DD HH:mm')
|
||||
return moment(this.form.form.created, 'YYYY-MM-DD HH:mm')
|
||||
},
|
||||
|
||||
timeSpanExpiration() {
|
||||
if (this.form.event.expiration) {
|
||||
return moment(this.form.event.expirationDate)
|
||||
if (this.form.form.expires) {
|
||||
return moment(this.form.form.expirationDate)
|
||||
} else {
|
||||
return t('forms', 'never')
|
||||
}
|
||||
|
|
@ -179,8 +179,8 @@ export default {
|
|||
return this.form.shares.length
|
||||
},
|
||||
|
||||
voteUrl() {
|
||||
return OC.generateUrl('apps/forms/form/') + this.form.event.hash
|
||||
submitUrl() {
|
||||
return OC.generateUrl('apps/forms/form/') + this.form.form.hash
|
||||
},
|
||||
|
||||
},
|
||||
|
|
@ -196,7 +196,7 @@ export default {
|
|||
|
||||
copyLink() {
|
||||
// this.$emit('copyLink')
|
||||
this.$copyText(window.location.origin + this.voteUrl).then(
|
||||
this.$copyText(window.location.origin + this.submitUrl).then(
|
||||
function(e) {
|
||||
OC.Notification.showTemporary(t('forms', 'Link copied to clipboard'))
|
||||
},
|
||||
|
|
@ -217,6 +217,7 @@ export default {
|
|||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
$row-padding: 15px;
|
||||
$table-padding: 4px;
|
||||
|
|
@ -293,8 +294,6 @@ $mediabreak-3: $group-1-width + $owner-width + max($group-2-1-width, $group-2-2-
|
|||
align-items: center;
|
||||
position: relative;
|
||||
flex-grow: 0;
|
||||
div {
|
||||
}
|
||||
}
|
||||
|
||||
.name {
|
||||
|
|
|
|||
|
|
@ -24,21 +24,20 @@
|
|||
<div>{{ question.text }}</div>
|
||||
<div>
|
||||
<input v-show="(question.type != 'text') && (question.type != 'comment')"
|
||||
v-model="newQuizAnswer"
|
||||
v-model="newOption"
|
||||
style="height:30px;"
|
||||
:placeholder=" t('forms', 'Add Answer')"
|
||||
@keyup.enter="emitNewAnswer(question)">
|
||||
:placeholder=" t('forms', 'Add Option')"
|
||||
@keyup.enter="emitNewOption(question)">
|
||||
<transitionGroup
|
||||
id="form-list"
|
||||
name="list"
|
||||
tag="ul"
|
||||
class="form-table">
|
||||
<TextFormItem
|
||||
v-for="(answer, index) in answers"
|
||||
:key="answer.id"
|
||||
:option="answer"
|
||||
@remove="emitRemoveAnswer(question, answer, index)"
|
||||
@delete="question.answers.splice(index, 1)" />
|
||||
v-for="(opt, index) in options"
|
||||
:key="opt.id"
|
||||
:option="opt"
|
||||
@remove="emitRemoveOption(question, opt, index)" />
|
||||
</transitionGroup>
|
||||
</div>
|
||||
<div>
|
||||
|
|
@ -61,25 +60,25 @@ export default {
|
|||
},
|
||||
data() {
|
||||
return {
|
||||
nextQuizAnswerId: 1,
|
||||
newQuizAnswer: '',
|
||||
nextOptionId: 1,
|
||||
newOption: '',
|
||||
type: '',
|
||||
}
|
||||
},
|
||||
|
||||
computed: {
|
||||
answers() {
|
||||
return this.question.answers || []
|
||||
options() {
|
||||
return this.question.options || []
|
||||
},
|
||||
},
|
||||
|
||||
methods: {
|
||||
emitNewAnswer(question) {
|
||||
this.$emit('add-answer', this, question)
|
||||
emitNewOption(question) {
|
||||
this.$emit('addOption', this, question)
|
||||
},
|
||||
|
||||
emitRemoveAnswer(question, answer, index) {
|
||||
this.$emit('remove-answer', question, answer, index)
|
||||
emitRemoveOption(question, option, index) {
|
||||
this.$emit('deleteOption', question, option, index)
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@
|
|||
</div>
|
||||
<div class="wrapper group-2">
|
||||
<div class="ans">
|
||||
{{ answers }}
|
||||
{{ answerText }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -83,7 +83,7 @@ export default {
|
|||
type: Object,
|
||||
default: undefined,
|
||||
},
|
||||
vote: {
|
||||
answer: {
|
||||
type: Object,
|
||||
default: undefined,
|
||||
},
|
||||
|
|
@ -98,16 +98,16 @@ export default {
|
|||
|
||||
computed: {
|
||||
participants() {
|
||||
return this.vote.userId
|
||||
return this.answer.userId
|
||||
},
|
||||
questionText() {
|
||||
return this.vote.voteOptionText
|
||||
return this.answer.questionText
|
||||
},
|
||||
answers() {
|
||||
return this.vote.voteAnswer
|
||||
answerText() {
|
||||
return this.answer.text
|
||||
},
|
||||
questionNum() {
|
||||
return this.vote.voteOptionId
|
||||
return this.answer.questionId
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue