Merge pull request 'Add post expiry inputs' (#239) from default-post-expiry into develop

Reviewed-on: AkkomaGang/pleroma-fe#239
This commit is contained in:
floatingghost 2022-11-28 13:35:08 +00:00
commit 0900a9d87b
6 changed files with 27 additions and 2 deletions

View file

@ -11,6 +11,7 @@
<link rel="stylesheet" href="/static/mfm.css"> <link rel="stylesheet" href="/static/mfm.css">
<!--server-generated-meta--> <!--server-generated-meta-->
<link rel="icon" type="image/png" href="/favicon.png"> <link rel="icon" type="image/png" href="/favicon.png">
<link rel="manifest" href="/manifest.json">
</head> </head>
<body class="hidden"> <body class="hidden">
<noscript>To use Akkoma, please enable JavaScript.</noscript> <noscript>To use Akkoma, please enable JavaScript.</noscript>

View file

@ -43,7 +43,9 @@ const ProfileTab = {
bannerPreview: null, bannerPreview: null,
background: null, background: null,
backgroundPreview: 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: { components: {
@ -123,7 +125,8 @@ const ProfileTab = {
display_name: this.newName, display_name: this.newName,
fields_attributes: this.newFields.filter(el => el != null), fields_attributes: this.newFields.filter(el => el != null),
bot: this.bot, bot: this.bot,
show_role: this.showRole show_role: this.showRole,
status_ttl_days: this.expirePosts ? this.newPostTTLDays : -1
/* eslint-enable camelcase */ /* eslint-enable camelcase */
} }

View file

@ -4,6 +4,10 @@
margin: 0; margin: 0;
} }
.expire-posts-days {
margin-left: 1em;
}
.visibility-tray { .visibility-tray {
padding-top: 5px; padding-top: 5px;
} }

View file

@ -89,6 +89,20 @@
{{ $t('settings.bot') }} {{ $t('settings.bot') }}
</Checkbox> </Checkbox>
</p> </p>
<p>
<Checkbox v-model="expirePosts">
{{ $t('settings.expire_posts_enabled') }}
</Checkbox>
<input
v-model="newPostTTLDays"
:disabled="!expirePosts"
type="number"
min="1"
max="730"
class="expire-posts-days"
:placeholder="$t('settings.expire_posts_input_placeholder')"
/>
</p>
<p> <p>
<interface-language-switcher <interface-language-switcher
:prompt-text="$t('settings.email_language')" :prompt-text="$t('settings.email_language')"

View file

@ -536,6 +536,8 @@
"enter_current_password_to_confirm": "Enter your current password to confirm your identity", "enter_current_password_to_confirm": "Enter your current password to confirm your identity",
"expert_mode": "Show advanced", "expert_mode": "Show advanced",
"export_theme": "Save preset", "export_theme": "Save preset",
"expire_posts_enabled": "Delete posts after a set amount of days",
"expire_posts_input_placeholder": "Number of days",
"file_export_import": { "file_export_import": {
"backup_restore": "Settings backup", "backup_restore": "Settings backup",
"backup_settings": "Backup settings to file", "backup_settings": "Backup settings to file",

View file

@ -90,6 +90,7 @@ export const parseUser = (data) => {
output.bot = data.bot output.bot = data.bot
if (data.akkoma) { if (data.akkoma) {
output.instance = data.akkoma.instance output.instance = data.akkoma.instance
output.status_ttl_days = data.akkoma.status_ttl_days
} }
if (data.pleroma) { if (data.pleroma) {