diff options
author | Raimund Schlüßler <raimund.schluessler@mailbox.org> | 2021-10-02 12:50:40 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-02 12:50:40 +0300 |
commit | 1db9565e8184af080a1288a196dceb0d13f7fc6f (patch) | |
tree | e2bc544a6230f4ed8fe1ab5a3b5b6cc8da9048a6 /src | |
parent | 5d98dbc22022707c5d9f33007edbaf4253281584 (diff) | |
parent | f7b38bb8d6aa9c717af77ccc8dae06c9a3ee58a8 (diff) |
Merge pull request #1802 from Aeredren/enh/emptyTrash
Empty trash bin
Diffstat (limited to 'src')
-rw-r--r-- | src/components/AppNavigation/Trashbin.vue | 35 |
1 files changed, 30 insertions, 5 deletions
diff --git a/src/components/AppNavigation/Trashbin.vue b/src/components/AppNavigation/Trashbin.vue index 1acf4ba5..41d76bee 100644 --- a/src/components/AppNavigation/Trashbin.vue +++ b/src/components/AppNavigation/Trashbin.vue @@ -85,9 +85,14 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>. </div> </template> </div> - <p v-if="retentionDuration" class="footer"> - {{ n('calendar', 'Elements in the trash bin are deleted after {numDays} day', 'Elements in the trash bin are deleted after {numDays} days', retentionDuration, { numDays: retentionDuration }) }} - </p> + <div class="footer"> + <p v-if="retentionDuration"> + {{ n('calendar', 'Elements in the trash bin are deleted after {numDays} day', 'Elements in the trash bin are deleted after {numDays} days', retentionDuration, { numDays: retentionDuration }) }} + </p> + <button @click="onEmptyTrashBin()"> + {{ t('tasks','Empty trash bin') }} + </button> + </div> </template> </div> </Modal> @@ -225,9 +230,9 @@ export default { break } } catch (error) { - logger.error('could not restore ' + item.url, { error }) + logger.error('could not delete ' + item.url, { error }) - showError(t('tasks', 'Could not restore calendar or event')) + showError(t('tasks', 'Could not delete calendar or event')) } }, async restore(item) { @@ -254,6 +259,23 @@ export default { showError(t('tasks', 'Could not restore calendar or event')) } }, + onEmptyTrashBin() { + OC.dialogs.confirm( + t('tasks', 'Do you really want to empty the trash bin?'), + t('tasks', 'Empty trash bin'), + this.emptyTrashBin, + true + ) + }, + + emptyTrashBin(confirm) { + if (!confirm) { + return + } + this.items.forEach((item) => { + this.onDeletePermanently(item) + }) + }, }, } </script> @@ -318,6 +340,9 @@ export default { text-align: center; font-size: small; margin-top: 16px; + & > p { + margin-bottom: 12px; + } } .icon-bullet { |