From 0a01a2bdf0b4a643f2b86e823c5d2cec8d1431b9 Mon Sep 17 00:00:00 2001
From: FloatingGhost
Date: Mon, 28 Nov 2022 12:08:18 +0000
Subject: [PATCH] Add post expiry inputs
---
index.html | 1 +
src/components/settings_modal/tabs/profile_tab.js | 7 +++++--
.../settings_modal/tabs/profile_tab.scss | 4 ++++
src/components/settings_modal/tabs/profile_tab.vue | 14 ++++++++++++++
src/i18n/en.json | 2 ++
.../entity_normalizer/entity_normalizer.service.js | 1 +
6 files changed, 27 insertions(+), 2 deletions(-)
diff --git a/index.html b/index.html
index 5581c894..5f8735ea 100644
--- a/index.html
+++ b/index.html
@@ -11,6 +11,7 @@
+
diff --git a/src/components/settings_modal/tabs/profile_tab.js b/src/components/settings_modal/tabs/profile_tab.js
index b69cf2f1..c29e8d2a 100644
--- a/src/components/settings_modal/tabs/profile_tab.js
+++ b/src/components/settings_modal/tabs/profile_tab.js
@@ -43,7 +43,9 @@ const ProfileTab = {
bannerPreview: null,
background: null,
backgroundPreview: null,
- emailLanguage: this.$store.state.users.currentUser.language || ''
+ emailLanguage: this.$store.state.users.currentUser.language || '',
+ newPostTTLDays: this.$store.state.users.currentUser.status_ttl_days,
+ expirePosts: this.$store.state.users.currentUser.status_ttl_days !== null,
}
},
components: {
@@ -123,7 +125,8 @@ const ProfileTab = {
display_name: this.newName,
fields_attributes: this.newFields.filter(el => el != null),
bot: this.bot,
- show_role: this.showRole
+ show_role: this.showRole,
+ status_ttl_days: this.expirePosts ? this.newPostTTLDays : -1
/* eslint-enable camelcase */
}
diff --git a/src/components/settings_modal/tabs/profile_tab.scss b/src/components/settings_modal/tabs/profile_tab.scss
index 201f1a76..8b9a35e1 100644
--- a/src/components/settings_modal/tabs/profile_tab.scss
+++ b/src/components/settings_modal/tabs/profile_tab.scss
@@ -4,6 +4,10 @@
margin: 0;
}
+ .expire-posts-days {
+ margin-left: 1em;
+ }
+
.visibility-tray {
padding-top: 5px;
}
diff --git a/src/components/settings_modal/tabs/profile_tab.vue b/src/components/settings_modal/tabs/profile_tab.vue
index 642d54ca..8748b685 100644
--- a/src/components/settings_modal/tabs/profile_tab.vue
+++ b/src/components/settings_modal/tabs/profile_tab.vue
@@ -89,6 +89,20 @@
{{ $t('settings.bot') }}
+
+
+ {{ $t('settings.expire_posts_enabled') }}
+
+
+
{
output.bot = data.bot
if (data.akkoma) {
output.instance = data.akkoma.instance
+ output.status_ttl_days = data.akkoma.status_ttl_days
}
if (data.pleroma) {