From 79d02bddbe2b77574844b8ade7a09043c31b1c6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?marcin=20miko=C5=82ajczak?= Date: Sun, 13 Feb 2022 19:07:49 +0100 Subject: [PATCH] Birthdays MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: marcin mikołajczak --- src/components/settings_modal/tabs/profile_tab.js | 6 +++++- .../settings_modal/tabs/profile_tab.scss | 5 +++++ src/components/settings_modal/tabs/profile_tab.vue | 12 ++++++++++++ src/components/user_profile/user_profile.js | 11 +++++++++-- src/components/user_profile/user_profile.vue | 14 ++++++++++++++ src/i18n/en.json | 5 +++++ src/i18n/pl.json | 9 +++++++-- .../entity_normalizer/entity_normalizer.service.js | 3 +++ 8 files changed, 60 insertions(+), 5 deletions(-) diff --git a/src/components/settings_modal/tabs/profile_tab.js b/src/components/settings_modal/tabs/profile_tab.js index 64079fcdd6..0ae95dbddb 100644 --- a/src/components/settings_modal/tabs/profile_tab.js +++ b/src/components/settings_modal/tabs/profile_tab.js @@ -29,6 +29,8 @@ const ProfileTab = { newLocked: this.$store.state.users.currentUser.locked, newNoRichText: this.$store.state.users.currentUser.no_rich_text, newDefaultScope: this.$store.state.users.currentUser.default_scope, + newBirthday: this.$store.state.users.currentUser.birthday, + showBirthday: this.$store.state.users.currentUser.show_birthday, newFields: this.$store.state.users.currentUser.fields.map(field => ({ name: field.name, value: field.value })), hideFollows: this.$store.state.users.currentUser.hide_follows, hideFollowers: this.$store.state.users.currentUser.hide_followers, @@ -132,7 +134,9 @@ const ProfileTab = { allow_following_move: this.allowFollowingMove, hide_follows_count: this.hideFollowsCount, hide_followers_count: this.hideFollowersCount, - show_role: this.showRole + show_role: this.showRole, + birthday: this.newBirthday || null, + show_birthday: this.showBirthday /* eslint-enable camelcase */ } }).then((user) => { this.newFields.splice(user.fields.length) diff --git a/src/components/settings_modal/tabs/profile_tab.scss b/src/components/settings_modal/tabs/profile_tab.scss index 111eaed38e..242875112f 100644 --- a/src/components/settings_modal/tabs/profile_tab.scss +++ b/src/components/settings_modal/tabs/profile_tab.scss @@ -124,4 +124,9 @@ padding: 0 0.5em; } } + + .birthday-input { + display: block; + margin-bottom: 1em; + } } diff --git a/src/components/settings_modal/tabs/profile_tab.vue b/src/components/settings_modal/tabs/profile_tab.vue index bb3c301d5c..9b92056dfc 100644 --- a/src/components/settings_modal/tabs/profile_tab.vue +++ b/src/components/settings_modal/tabs/profile_tab.vue @@ -95,6 +95,18 @@ {{ $t('settings.discoverable') }}

+
+

{{ $t('settings.birthday.label') }}

+ + + {{ $t('settings.birthday.show_birthday') }} + +

{{ $t('settings.profile_fields.label') }}

+ + + {{ $t('user_card.birthday', { birthday: formattedBirthday }) }} +