From 68d15f665e178ca37181b66beae5d833db08df52 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Tue, 28 Aug 2018 13:42:44 +0300 Subject: Show lock icon instead of hiding repeat button, tusky-style. Added hint explaining what's going on. Fixes favorite button jumping left and right depending on post visibility --- src/i18n/messages.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/i18n/messages.js') diff --git a/src/i18n/messages.js b/src/i18n/messages.js index 30055192..c9a4961c 100644 --- a/src/i18n/messages.js +++ b/src/i18n/messages.js @@ -273,7 +273,8 @@ const en = { load_older: 'Load older statuses', conversation: 'Conversation', collapse: 'Collapse', - repeated: 'repeated' + repeated: 'repeated', + no_retweet_hint: 'Post is marked as followers-only or direct and cannot be repeated' }, settings: { user_settings: 'User Settings', @@ -1620,7 +1621,8 @@ const ru = { load_older: 'Загрузить старые статусы', conversation: 'Разговор', collapse: 'Свернуть', - repeated: 'повторил(а)' + repeated: 'повторил(а)', + no_retweet_hint: 'Пост помечен как "только для подписчиков" или "личное" и поэтому не может быть повторён' }, settings: { user_settings: 'Настройки пользователя', -- cgit v1.2.3-70-g09d2 From b48a3210a3056385484e60551dd601177839b6cd Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Tue, 28 Aug 2018 14:28:05 +0300 Subject: tabs for settings --- src/components/settings/settings.js | 2 + src/components/settings/settings.vue | 169 +++++++++++++++++++---------------- src/i18n/messages.js | 2 + 3 files changed, 95 insertions(+), 78 deletions(-) (limited to 'src/i18n/messages.js') diff --git a/src/components/settings/settings.js b/src/components/settings/settings.js index f8eaad00..333633c9 100644 --- a/src/components/settings/settings.js +++ b/src/components/settings/settings.js @@ -1,4 +1,5 @@ /* eslint-env browser */ +import TabSwitcher from '../tab_switcher/tab_switcher.jsx' import StyleSwitcher from '../style_switcher/style_switcher.vue' import InterfaceLanguageSwitcher from '../interface_language_switcher/interface_language_switcher.vue' import { filter, trim } from 'lodash' @@ -29,6 +30,7 @@ const settings = { } }, components: { + TabSwitcher, StyleSwitcher, InterfaceLanguageSwitcher }, diff --git a/src/components/settings/settings.vue b/src/components/settings/settings.vue index f500a1b0..923c6970 100644 --- a/src/components/settings/settings.vue +++ b/src/components/settings/settings.vue @@ -4,90 +4,99 @@ {{$t('settings.settings')}}
-
-

{{$t('settings.theme')}}

- -
-
-

{{$t('settings.filtering')}}

-

{{$t('settings.filtering_explanation')}}

- -
-
-

{{$t('nav.timeline')}}

-
    -
  • - - -
  • -
  • - - -
      + +
      +
      +

      {{ $t('settings.interfaceLanguage') }}

      + +
      +
      +

      {{$t('nav.timeline')}}

      +
      • - - + + +
      • +
      • + + +
          +
        • + + +
        • +
        +
      • +
      • + + +
      • +
      • + + +
      • +
      • +
      - -
    • - - -
    • -
    • - - -
    • -
    • - -
    • -
    -
-
-

{{$t('settings.attachments')}}

-
    -
  • - - -
  • -
  • - - -
  • -
  • - - -
  • -
  • - - -
  • -
  • - - -
      +
+
+

{{$t('settings.attachments')}}

+
  • - - -
    - ! {{$t('settings.limited_availability')}} -
    + + +
  • +
  • + + +
  • +
  • + + +
  • +
  • + + +
  • +
  • + + +
      +
    • + + +
      + ! {{$t('settings.limited_availability')}} +
      +
    • +
- - -
-
-

{{ $t('settings.interfaceLanguage') }}

- -
+
+ + +
+
+ +
+
+ +
+
+

{{$t('settings.filtering_explanation')}}

+ +
+
+ + @@ -103,6 +112,10 @@ margin: 1em 1em 1.4em; padding-bottom: 1.4em; + &:last-child { + border-bottom: none; + } + textarea { width: 100%; diff --git a/src/i18n/messages.js b/src/i18n/messages.js index c9a4961c..cd8fa512 100644 --- a/src/i18n/messages.js +++ b/src/i18n/messages.js @@ -277,6 +277,7 @@ const en = { no_retweet_hint: 'Post is marked as followers-only or direct and cannot be repeated' }, settings: { + general: 'General', user_settings: 'User Settings', name_bio: 'Name & Bio', name: 'Name', @@ -1625,6 +1626,7 @@ const ru = { no_retweet_hint: 'Пост помечен как "только для подписчиков" или "личное" и поэтому не может быть повторён' }, settings: { + general: 'Общие', user_settings: 'Настройки пользователя', name_bio: 'Имя и описание', name: 'Имя', -- cgit v1.2.3-70-g09d2 From cff4177bf3a7622fa41542c380c462a70359b258 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Tue, 28 Aug 2018 15:38:07 +0300 Subject: settings page update --- src/components/settings/settings.vue | 12 +- src/components/style_switcher/style_switcher.vue | 230 ++++++++++++++--------- src/i18n/messages.js | 12 +- 3 files changed, 157 insertions(+), 97 deletions(-) (limited to 'src/i18n/messages.js') diff --git a/src/components/settings/settings.vue b/src/components/settings/settings.vue index 923c6970..240cd70a 100644 --- a/src/components/settings/settings.vue +++ b/src/components/settings/settings.vue @@ -114,6 +114,12 @@ &:last-child { border-bottom: none; + padding-bottom: 0; + margin-bottom: 1em; + } + + select { + min-width: 10em; } @@ -143,8 +149,12 @@ } .btn { - margin-top: 1em; min-height: 28px; + } + + .submit { + margin-top: 1em; + min-height: 30px; width: 10em; } } diff --git a/src/components/style_switcher/style_switcher.vue b/src/components/style_switcher/style_switcher.vue index 59bd2971..72a338bd 100644 --- a/src/components/style_switcher/style_switcher.vue +++ b/src/components/style_switcher/style_switcher.vue @@ -1,102 +1,30 @@ @@ -144,15 +159,19 @@ color: var(--cRed, $fallback--cRed); } +.apply-container, .radius-container, -.color-container { +.color-container, +.presets-container { display: flex; p { + flex: 2 0 100%; margin-top: 2em; margin-bottom: .5em; } } + .radius-container { flex-direction: column; } @@ -162,6 +181,36 @@ justify-content: space-between; } +.presets-container { + justify-content: center; + .import-export { + display: flex; + + .btn { + margin-left: .5em; + } + } +} + +.preview-container { + border-top: 1px dashed; + border-bottom: 1px dashed; + border-color: $fallback--border; + border-color: var(--border, $fallback--border); + margin: 1em -1em 0; + padding: 1em; + + .btn { + margin-top: 1em; + min-height: 30px; + width: 10em; + } +} + +.apply-container { + justify-content: center; +} + .radius-item, .color-item { min-width: 20em; @@ -229,6 +278,7 @@ flex: 0; min-width: 2em; cursor: pointer; + max-height: 29px; } .theme-preview-content { diff --git a/src/i18n/messages.js b/src/i18n/messages.js index cd8fa512..cccf48cc 100644 --- a/src/i18n/messages.js +++ b/src/i18n/messages.js @@ -48,8 +48,8 @@ const de = { settings: 'Einstellungen', theme: 'Farbschema', presets: 'Voreinstellungen', - export_theme: 'Aktuelles Theme exportieren', - import_theme: 'Gespeichertes Theme laden', + export_theme: 'Farbschema speichern', + import_theme: 'Farbschema laden', invalid_theme_imported: 'Die ausgewählte Datei ist kein unterstütztes Pleroma-Theme. Keine Änderungen wurden vorgenommen.', theme_help: 'Benutze HTML Farbcodes (#rrggbb) um dein Farbschema anzupassen', radii_help: 'Kantenrundung (in Pixel) der Oberfläche anpassen', @@ -293,8 +293,8 @@ const en = { settings: 'Settings', theme: 'Theme', presets: 'Presets', - export_theme: 'Export current theme', - import_theme: 'Load saved theme', + export_theme: 'Save preset', + import_theme: 'Load preset', theme_help: 'Use hex color codes (#rrggbb) to customize your color theme.', invalid_theme_imported: 'The selected file is not a supported Pleroma theme. No changes to your theme were made.', radii_help: 'Set up interface edge rounding (in pixels)', @@ -1641,8 +1641,8 @@ const ru = { set_new_profile_background: 'Загрузить новый фон профиля', settings: 'Настройки', theme: 'Тема', - export_theme: 'Экспортировать текущую тему', - import_theme: 'Загрузить сохранённую тему', + export_theme: 'Сохранить Тему', + import_theme: 'Загрузить Тему', presets: 'Пресеты', theme_help: 'Используйте шестнадцатеричные коды цветов (#rrggbb) для настройки темы.', radii_help: 'Округление краёв элементов интерфейса (в пикселях)', -- cgit v1.2.3-70-g09d2 From c3b27ab4c2d6ca03d8bea171735521b770172104 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Tue, 28 Aug 2018 15:47:42 +0300 Subject: moved replies filtering to "filter" category in settings, made it more consistent --- src/components/settings/settings.vue | 21 +++++++++++---------- src/i18n/messages.js | 5 +++++ 2 files changed, 16 insertions(+), 10 deletions(-) (limited to 'src/i18n/messages.js') diff --git a/src/components/settings/settings.vue b/src/components/settings/settings.vue index 240cd70a..2f70c209 100644 --- a/src/components/settings/settings.vue +++ b/src/components/settings/settings.vue @@ -35,16 +35,6 @@ -
  • - -
  • @@ -90,6 +80,17 @@
    +
    + {{$t('settings.replies_in_timeline')}} + +

    {{$t('settings.filtering_explanation')}}

    diff --git a/src/i18n/messages.js b/src/i18n/messages.js index cccf48cc..ebc96e81 100644 --- a/src/i18n/messages.js +++ b/src/i18n/messages.js @@ -327,6 +327,7 @@ const en = { loop_video: 'Loop videos', loop_video_silent_only: 'Loop only videos without sound (i.e. Mastodon\'s "gifs")', reply_link_preview: 'Enable reply-link preview on mouse hover', + replies_in_timeline: 'Replies in timeline', reply_visibility_all: 'Show all replies', reply_visibility_following: 'Only show replies directed at me or users I\'m following', reply_visibility_self: 'Only show replies directed at me', @@ -1674,6 +1675,10 @@ const ru = { loop_video: 'Зациливать видео', loop_video_silent_only: 'Зацикливать только беззвучные видео (т.е. "гифки" с Mastodon)', reply_link_preview: 'Включить предварительный просмотр ответа при наведении мыши', + replies_in_timeline: 'Ответы в ленте', + reply_visibility_all: 'Показывать все ответы', + reply_visibility_following: 'Показывать только ответы мне и тех на кого я подписан', + reply_visibility_self: 'Показывать только ответы мне', follow_import: 'Импортировать читаемых', import_followers_from_a_csv_file: 'Импортировать читаемых из файла .csv', follows_imported: 'Список читаемых импортирован. Обработка займёт некоторое время..', -- cgit v1.2.3-70-g09d2 From b0e0686c7f1084e7074feee509ad189c6010431b Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Tue, 28 Aug 2018 21:21:29 +0300 Subject: Added ability to hide certain types of notifications --- src/components/notifications/notifications.js | 12 ++++- src/components/settings/settings.js | 13 ++++++ src/components/settings/settings.vue | 67 +++++++++++++++++++++++---- src/i18n/messages.js | 10 ++++ src/main.js | 1 + src/modules/config.js | 6 +++ src/modules/statuses.js | 18 +++++-- 7 files changed, 110 insertions(+), 17 deletions(-) (limited to 'src/i18n/messages.js') diff --git a/src/components/notifications/notifications.js b/src/components/notifications/notifications.js index b24250b0..58956f98 100644 --- a/src/components/notifications/notifications.js +++ b/src/components/notifications/notifications.js @@ -11,6 +11,14 @@ const Notifications = { notificationsFetcher.startFetching({ store, credentials }) }, computed: { + visibleTypes () { + return [ + this.$store.state.config.notificationVisibility.likes && 'like', + this.$store.state.config.notificationVisibility.mentions && 'mention', + this.$store.state.config.notificationVisibility.repeats && 'repeat', + this.$store.state.config.notificationVisibility.follows && 'follow' + ].filter(_ => _) + }, notifications () { return this.$store.state.statuses.notifications.data }, @@ -18,13 +26,13 @@ const Notifications = { return this.$store.state.statuses.notifications.error }, unseenNotifications () { - return filter(this.notifications, ({seen}) => !seen) + return filter(this.visibleNotifications, ({seen}) => !seen) }, visibleNotifications () { // Don't know why, but sortBy([seen, -action.id]) doesn't work. let sortedNotifications = sortBy(this.notifications, ({action}) => -action.id) sortedNotifications = sortBy(sortedNotifications, 'seen') - return sortedNotifications + return sortedNotifications.filter((notification) => this.visibleTypes.includes(notification.type)) }, unseenCount () { return this.unseenNotifications.length diff --git a/src/components/settings/settings.js b/src/components/settings/settings.js index 333633c9..de12894b 100644 --- a/src/components/settings/settings.js +++ b/src/components/settings/settings.js @@ -10,6 +10,7 @@ const settings = { hideAttachmentsLocal: this.$store.state.config.hideAttachments, hideAttachmentsInConvLocal: this.$store.state.config.hideAttachmentsInConv, hideNsfwLocal: this.$store.state.config.hideNsfw, + notificationVisibilityLocal: this.$store.state.config.notificationVisibility, replyVisibilityLocal: this.$store.state.config.replyVisibility, loopVideoLocal: this.$store.state.config.loopVideo, loopVideoSilentOnlyLocal: this.$store.state.config.loopVideoSilentOnly, @@ -49,6 +50,18 @@ const settings = { hideNsfwLocal (value) { this.$store.dispatch('setOption', { name: 'hideNsfw', value }) }, + 'notificationVisibilityLocal.likes' (value) { + this.$store.dispatch('setOption', { name: 'notificationVisibility', value: this.$store.state.config.notificationVisibility }) + }, + 'notificationVisibilityLocal.follows' (value) { + this.$store.dispatch('setOption', { name: 'notificationVisibility', value: this.$store.state.config.notificationVisibility }) + }, + 'notificationVisibilityLocal.repeats' (value) { + this.$store.dispatch('setOption', { name: 'notificationVisibility', value: this.$store.state.config.notificationVisibility }) + }, + 'notificationVisibilityLocal.mentions' (value) { + this.$store.dispatch('setOption', { name: 'notificationVisibility', value: this.$store.state.config.notificationVisibility }) + }, replyVisibilityLocal (value) { this.$store.dispatch('setOption', { name: 'replyVisibility', value }) }, diff --git a/src/components/settings/settings.vue b/src/components/settings/settings.vue index c92602b7..dbc85f1f 100644 --- a/src/components/settings/settings.vue +++ b/src/components/settings/settings.vue @@ -81,15 +81,47 @@
    - {{$t('settings.replies_in_timeline')}} - +
    + {{$t('settings.notification_visibility')}} +
      +
    • + + +
    • +
    • + + +
    • +
    • + + +
    • +
    • + + +
    • +
    + +
    +
    + {{$t('settings.replies_in_timeline')}} + +

    {{$t('settings.filtering_explanation')}}

    @@ -113,6 +145,13 @@ margin: 1em 1em 1.4em; padding-bottom: 1.4em; + div { + margin-bottom: .5em; + &:last-child { + margin-bottom: 0; + } + } + &:last-child { border-bottom: none; padding-bottom: 0; @@ -159,7 +198,15 @@ width: 10em; } } -.setting-list { +.select-multiple { + display: flex; + .option-list { + margin: 0; + padding-left: .5em; + } +} +.setting-list, +.option-list{ list-style-type: none; padding-left: 2em; li { diff --git a/src/i18n/messages.js b/src/i18n/messages.js index ebc96e81..08d81841 100644 --- a/src/i18n/messages.js +++ b/src/i18n/messages.js @@ -331,6 +331,11 @@ const en = { reply_visibility_all: 'Show all replies', reply_visibility_following: 'Only show replies directed at me or users I\'m following', reply_visibility_self: 'Only show replies directed at me', + notification_visibility: 'Types of notifications to show', + notification_visibility_likes: 'Likes', + notification_visibility_mentions: 'Mentions', + notification_visibility_repeats: 'Repeats', + notification_visibility_follows: 'Follows', follow_import: 'Follow import', import_followers_from_a_csv_file: 'Import follows from a csv file', follows_imported: 'Follows imported! Processing them will take a while.', @@ -1679,6 +1684,11 @@ const ru = { reply_visibility_all: 'Показывать все ответы', reply_visibility_following: 'Показывать только ответы мне и тех на кого я подписан', reply_visibility_self: 'Показывать только ответы мне', + notification_visibility: 'Показывать уведомления', + notification_visibility_likes: 'Лайки', + notification_visibility_mentions: 'Упоминания', + notification_visibility_repeats: 'Повторы', + notification_visibility_follows: 'Подписки', follow_import: 'Импортировать читаемых', import_followers_from_a_csv_file: 'Импортировать читаемых из файла .csv', follows_imported: 'Список читаемых импортирован. Обработка займёт некоторое время..', diff --git a/src/main.js b/src/main.js index 5258fbd9..6c9bf36e 100644 --- a/src/main.js +++ b/src/main.js @@ -50,6 +50,7 @@ const persistedStateOptions = { 'config.hideAttachmentsInConv', 'config.hideNsfw', 'config.replyVisibility', + 'config.notificationVisibility', 'config.autoLoad', 'config.hoverPreview', 'config.streaming', diff --git a/src/modules/config.js b/src/modules/config.js index ac163316..60a34bc1 100644 --- a/src/modules/config.js +++ b/src/modules/config.js @@ -18,6 +18,12 @@ const defaultState = { pauseOnUnfocused: true, stopGifs: false, replyVisibility: 'all', + notificationVisibility: { + follows: true, + mentions: true, + likes: true, + repeats: true + }, muteWords: [], highlight: {}, interfaceLanguage: browserLocale diff --git a/src/modules/statuses.js b/src/modules/statuses.js index 0dd88266..c69c5be6 100644 --- a/src/modules/statuses.js +++ b/src/modules/statuses.js @@ -68,6 +68,15 @@ export const prepareStatus = (status) => { return status } +const visibleNotificationTypes = (rootState) => { + return [ + rootState.config.notificationVisibility.likes && 'like', + rootState.config.notificationVisibility.mentions && 'mention', + rootState.config.notificationVisibility.repeats && 'repeat', + rootState.config.notificationVisibility.follows && 'follow' + ].filter(_ => _) +} + export const statusType = (status) => { if (status.is_post_verb) { return 'status' @@ -86,8 +95,7 @@ export const statusType = (status) => { return 'deletion' } - // TODO change to status.activity_type === 'follow' when gs supports it - if (status.text.match(/started following/)) { + if (status.text.match(/started following/) || status.activity_type === 'follow') { return 'follow' } @@ -269,7 +277,7 @@ const addNewStatuses = (state, { statuses, showImmediately = false, timeline, us } } -const addNewNotifications = (state, { dispatch, notifications, older }) => { +const addNewNotifications = (state, { dispatch, notifications, older, visibleNotificationTypes }) => { const allStatuses = state.allStatuses const allStatusesObject = state.allStatusesObject each(notifications, (notification) => { @@ -318,7 +326,7 @@ const addNewNotifications = (state, { dispatch, notifications, older }) => { result.image = action.attachments[0].url } - if (fresh && !state.notifications.desktopNotificationSilence) { + if (fresh && !state.notifications.desktopNotificationSilence && visibleNotificationTypes.includes(notification.ntype)) { let notification = new window.Notification(title, result) // Chrome is known for not closing notifications automatically // according to MDN, anyway. @@ -405,7 +413,7 @@ const statuses = { commit('addNewStatuses', { statuses, showImmediately, timeline, noIdUpdate, user: rootState.users.currentUser }) }, addNewNotifications ({ rootState, commit, dispatch }, { notifications, older }) { - commit('addNewNotifications', { dispatch, notifications, older }) + commit('addNewNotifications', { visibleNotificationTypes: visibleNotificationTypes(rootState), dispatch, notifications, older }) }, setError ({ rootState, commit }, { value }) { commit('setError', { value }) -- cgit v1.2.3-70-g09d2 From 1461a52ade065eb3e4edc5b10fe12910344a0981 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Thu, 30 Aug 2018 20:43:24 +0300 Subject: vodka translations --- src/i18n/messages.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'src/i18n/messages.js') diff --git a/src/i18n/messages.js b/src/i18n/messages.js index 08d81841..766b61d0 100644 --- a/src/i18n/messages.js +++ b/src/i18n/messages.js @@ -1651,7 +1651,7 @@ const ru = { import_theme: 'Загрузить Тему', presets: 'Пресеты', theme_help: 'Используйте шестнадцатеричные коды цветов (#rrggbb) для настройки темы.', - radii_help: 'Округление краёв элементов интерфейса (в пикселях)', + radii_help: 'Скругление углов элементов интерфейса (в пикселях)', background: 'Фон', foreground: 'Передний план', text: 'Текст', @@ -1741,7 +1741,18 @@ const ru = { }, post_status: { posting: 'Отправляется', - default: 'Что нового?' + content_warning: 'Тема (не обязательно)', + default: 'Что нового?', + account_not_locked_warning: 'Ваш аккаунт не {0}. Кто угодно может зафоловить вас чтобы прочитать посты только для подписчиков', + account_not_locked_warning_link: 'залочен', + direct_warning: 'Этот пост будет видет только упомянутым пользователям', + attachments_sensitive: 'Вложения содержат чувствительный контент', + scope: { + public: 'Публичный - этот пост виден всем', + unlisted: 'Непубличный - этот пост не виден на публичных лентах', + private: 'Для подписчиков - этот пост видят только подписчики', + direct: 'Личное - этот пост видят только те кто в нём упомянут' + } }, finder: { find_user: 'Найти пользователя', -- cgit v1.2.3-70-g09d2 From 20a67e6809b573aa7ec687dabcfe2743c47705c7 Mon Sep 17 00:00:00 2001 From: William Pitcock Date: Fri, 31 Aug 2018 00:44:25 +0000 Subject: i18n: make "plain text" translatable --- src/components/post_status_form/post_status_form.vue | 2 +- src/i18n/messages.js | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'src/i18n/messages.js') diff --git a/src/components/post_status_form/post_status_form.vue b/src/components/post_status_form/post_status_form.vue index ac5da442..8b8eeae0 100644 --- a/src/components/post_status_form/post_status_form.vue +++ b/src/components/post_status_form/post_status_form.vue @@ -35,7 +35,7 @@
    diff --git a/src/i18n/messages.js b/src/i18n/messages.js index 30055192..bfe0d92b 100644 --- a/src/i18n/messages.js +++ b/src/i18n/messages.js @@ -392,6 +392,9 @@ const en = { unlisted: 'Unlisted - Do not post to public timelines', private: 'Followers-only - Post to followers only', direct: 'Direct - Post to mentioned users only' + }, + content_type: { + plain_text: 'Plain text' } }, finder: { -- cgit v1.2.3-70-g09d2