diff options
| author | Arne Schauf <git@asw.io> | 2018-03-04 01:48:51 +0100 |
|---|---|---|
| committer | Arne Schauf <git@asw.io> | 2018-03-04 01:48:51 +0100 |
| commit | 0b40910284d40409c8d70eafea717382ba8461f3 (patch) | |
| tree | fc22be0bcd308bbf6e4ab806bd3945920766b4c0 /src/pages/UploadList.vue | |
| parent | c018fd90ee1c3f307fa45c337375df5d9e659735 (diff) | |
| download | parry-ui-0b40910284d40409c8d70eafea717382ba8461f3.tar.gz parry-ui-0b40910284d40409c8d70eafea717382ba8461f3.zip | |
fix a few things
Diffstat (limited to 'src/pages/UploadList.vue')
| -rw-r--r-- | src/pages/UploadList.vue | 33 |
1 files changed, 13 insertions, 20 deletions
diff --git a/src/pages/UploadList.vue b/src/pages/UploadList.vue index ee1723b..a37d8a1 100644 --- a/src/pages/UploadList.vue +++ b/src/pages/UploadList.vue @@ -25,10 +25,10 @@ <q-btn color="negative" outline small - icon="fa-trash-o" + icon="fa-trash" label="Delete" - v-if="props.row.author.username === $store.state.user.decodedToken.username" - @click="deleteUpload(cell.row)" /> + v-if="$route.params.uploadId !== props.row._id && props.row.author.username === $store.state.user.decodedToken.username" + @click="deleteUpload(props.row)" /> </q-td> <q-td slot='body-cell-voting' slot-scope="props" :props='props'> {{ props.value.sum }} <i class="fa" :class="{'fa-caret-up text-positive': props.value.sum > 0, 'fa-caret-down text-negative': props.value.sum < 0, 'fa-sort text-dark': props.value.sum === 0}"></i> @@ -39,9 +39,6 @@ </template> <script> - import { - Dialog, - } from 'quasar' import moment from 'moment' export default { @@ -111,21 +108,17 @@ }, deleteUpload (upload) { let that = this - Dialog.create({ + this.$q.dialog({ title: 'Delete mod?', - message: `Do you really want to delete the mod ${upload.title}?<br>This cannot be undone!`, - buttons: [ - 'Cancel', - { - label: '<i class="fa fa-trash-o"></i> Yes, delete!', - color: 'negative', - outline: true, - handler () { - that.$http.delete(`/uploads/${upload._id}`).then(response => that.refresh()) - } - } - ] - }) + message: `Do you really want to delete the mod "${upload.title}"? This cannot be undone!`, + ok: { + label: 'Yes, delete!', + icon: 'fa-trash', + color: 'negative', + outline: true, + }, + cancel: 'Cancel', + }).then(() => that.$http.delete(`/uploads/${upload._id}`).then(response => that.refresh())) }, }, } |
