From 73be8f38c115c279e3d3961b98bd2b82b9706b05 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Thu, 6 Dec 2018 17:36:11 +0100 Subject: Add profile directory (#9427) Fix #5578 --- config/locales/en.yml | 19 +++++++++++++++++++ config/locales/simple_form.en.yml | 2 ++ config/navigation.rb | 1 + config/routes.rb | 12 ++++++++++++ 4 files changed, 34 insertions(+) (limited to 'config') diff --git a/config/locales/en.yml b/config/locales/en.yml index 2d27a4ac7..243b513fd 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -48,6 +48,7 @@ en: other: Followers following: Following joined: Joined %{date} + last_active: last active link_verified_on: Ownership of this link was checked on %{date} media: Media moved_html: "%{name} has moved to %{new_profile_link}:" @@ -114,6 +115,7 @@ en: media_attachments: Media attachments memorialize: Turn into memoriam moderation: + active: Active all: All silenced: Silenced suspended: Suspended @@ -439,6 +441,14 @@ en: proceed: Proceed title: Suspend %{acct} warning_html: 'Suspending this account will irreversibly delete data from this account, which includes:' + tags: + accounts: Accounts + hidden: Hidden + hide: Hide from directory + name: Hashtag + title: Hashtags + unhide: Show in directory + visible: Visible title: Administration admin_mailer: new_report: @@ -517,6 +527,15 @@ en: success_msg: Your account was successfully deleted warning_html: Only deletion of content from this particular instance is guaranteed. Content that has been widely shared is likely to leave traces. Offline servers and servers that have unsubscribed from your updates will not update their databases. warning_title: Disseminated content availability + directories: + directory: Profile directory + explanation: Discover users based on their interests + explore_mastodon: Explore %{title} + most_popular: Most popular + most_recently_active: Most recently active + people: + one: "%{count} person" + other: "%{count} people" errors: '403': You don't have permission to view this page. '404': The page you were looking for doesn't exist. diff --git a/config/locales/simple_form.en.yml b/config/locales/simple_form.en.yml index d34ec79cc..e24d8f4e6 100644 --- a/config/locales/simple_form.en.yml +++ b/config/locales/simple_form.en.yml @@ -8,6 +8,7 @@ en: bot: This account mainly performs automated actions and might not be monitored context: One or multiple contexts where the filter should apply digest: Only sent after a long period of inactivity and only if you have received any personal messages in your absence + discoverable_html: The directory lets people find accounts based on interests and activity. Requires at least %{min_followers} followers email: You will be sent a confirmation e-mail fields: You can have up to 4 items displayed as a table on your profile header: PNG, GIF or JPG. At most %{size}. Will be downscaled to %{dimensions}px @@ -48,6 +49,7 @@ en: context: Filter contexts current_password: Current password data: Data + discoverable: List this account on the directory display_name: Display name email: E-mail address expires_in: Expire after diff --git a/config/navigation.rb b/config/navigation.rb index 99d227f11..1b3c05ef7 100644 --- a/config/navigation.rb +++ b/config/navigation.rb @@ -28,6 +28,7 @@ SimpleNavigation::Configuration.run do |navigation| admin.item :reports, safe_join([fa_icon('flag fw'), t('admin.reports.title')]), admin_reports_url, highlights_on: %r{/admin/reports} admin.item :accounts, safe_join([fa_icon('users fw'), t('admin.accounts.title')]), admin_accounts_url, highlights_on: %r{/admin/accounts} admin.item :invites, safe_join([fa_icon('user-plus fw'), t('admin.invites.title')]), admin_invites_path + admin.item :tags, safe_join([fa_icon('tag fw'), t('admin.tags.title')]), admin_tags_path admin.item :instances, safe_join([fa_icon('cloud fw'), t('admin.instances.title')]), admin_instances_url, highlights_on: %r{/admin/instances}, if: -> { current_user.admin? } admin.item :domain_blocks, safe_join([fa_icon('lock fw'), t('admin.domain_blocks.title')]), admin_domain_blocks_url, highlights_on: %r{/admin/domain_blocks}, if: -> { current_user.admin? } admin.item :email_domain_blocks, safe_join([fa_icon('envelope fw'), t('admin.email_domain_blocks.title')]), admin_email_domain_blocks_url, highlights_on: %r{/admin/email_domain_blocks}, if: -> { current_user.admin? } diff --git a/config/routes.rb b/config/routes.rb index b203e1329..262868413 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -80,6 +80,11 @@ Rails.application.routes.draw do get '/interact/:id', to: 'remote_interaction#new', as: :remote_interaction post '/interact/:id', to: 'remote_interaction#create' + get '/explore', to: 'directories#index', as: :explore + get '/explore/popular', to: 'directories#index', as: :explore_popular + get '/explore/:id', to: 'directories#show', as: :explore_hashtag + get '/explore/:id/popular', to: 'directories#show', as: :explore_hashtag_popular + namespace :settings do resource :profile, only: [:show, :update] resource :preferences, only: [:show, :update] @@ -207,6 +212,13 @@ Rails.application.routes.draw do end resources :account_moderation_notes, only: [:create, :destroy] + + resources :tags, only: [:index] do + member do + post :hide + post :unhide + end + end end get '/admin', to: redirect('/admin/dashboard', status: 302) -- cgit From 6cf12aa74cf4bd50f14aaca78bd545bcb3d8155d Mon Sep 17 00:00:00 2001 From: Marcin Mikołajczak Date: Fri, 7 Dec 2018 21:08:29 +0100 Subject: i18n: Update Polish translation (#9459) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marcin Mikołajczak --- config/locales/pl.yml | 21 +++++++++++++++++++++ config/locales/simple_form.pl.yml | 2 ++ 2 files changed, 23 insertions(+) (limited to 'config') diff --git a/config/locales/pl.yml b/config/locales/pl.yml index 6b274227b..ef3b4b4d2 100644 --- a/config/locales/pl.yml +++ b/config/locales/pl.yml @@ -54,6 +54,7 @@ pl: other: Śledzących following: Śledzonych joined: Dołączył(a) %{date} + last_active: ostatnio aktywny(-a) link_verified_on: Własność tego odnośnika została sprawdzona %{date} media: Zawartość multimedialna moved_html: "%{name} korzysta teraz z konta %{new_profile_link}:" @@ -122,6 +123,7 @@ pl: media_attachments: Załączniki multimedialne memorialize: Przełącz na „In Memoriam” moderation: + active: Aktywne all: Wszystkie silenced: Wyciszone suspended: Zawieszone @@ -445,6 +447,14 @@ pl: proceed: Przejdź title: Zawieś %{acct} warning_html: 'Zawieszenie konta będzie skutkowało nieodwracalnym usunięciem danych z tego konta, wliczając:' + tags: + accounts: Konta + hidden: Ukryte + hide: Ukryj w katalogu + name: Hashtag + title: Hashtagi + unhide: Pokazuj w katalogu + visible: Widoczne title: Administracja admin_mailer: new_report: @@ -523,6 +533,17 @@ pl: success_msg: Twoje konto zostało pomyślnie usunięte warning_html: Możemy usunąć zawartość jedynie w obrębie tej instancji. Zawartość udostępniona publicznie pozostawia trwałe ślady. Serwery niepodłączone do sieci bądź nieśledzące Twoich aktualizacji mogą zachować Twoje dane. warning_title: Dostępność usuniętej zawartości + directories: + directory: Katalog profilów + explanation: Poznaj profile na podstawie zainteresowań + explore_mastodon: Odkrywaj %{title} + most_popular: Napopularniejsi + most_recently_active: Ostatnio aktywni + people: + few: "%{count} osoby" + many: "%{count} osób" + one: "%{count} osoba" + other: "%{count} osób" errors: '403': Nie masz uprawnień, aby wyświetlić tę stronę. '404': Strona, którą próbujesz odwiedzić, nie istnieje. diff --git a/config/locales/simple_form.pl.yml b/config/locales/simple_form.pl.yml index 8febad488..87b265e38 100644 --- a/config/locales/simple_form.pl.yml +++ b/config/locales/simple_form.pl.yml @@ -8,6 +8,7 @@ pl: bot: To konto wykonuje głównie zautomatyzowane działania i może nie być monitorowane context: Jedno lub wiele miejsc, w których filtr zostanie zastosowany digest: Wysyłane tylko po długiej nieaktywności, jeżeli w tym czasie otrzymaleś jakąś wiadomość bezpośrednią + discoverable_html: Katalog pozwala znaleźć konta na podstawie zainteresowań i aktywności. Profil musi śledzić przynajmniej %{min_followers} osób fields: Możesz ustawić maksymalnie 4 niestandardowe pola wyświetlane jako tabela na Twoim profilu header: PNG, GIF lub JPG. Maksymalnie %{size}. Zostanie zmniejszony do %{dimensions}px inbox_url: Skopiuj adres ze strony głównej przekaźnika, którego chcesz użyć @@ -42,6 +43,7 @@ pl: context: Filtruj zawartość current_password: Obecne hasło data: Dane + discoverable: Wyświetlaj ten profil w katalogu display_name: Widoczna nazwa email: Adres e-mail expires_in: Wygaśnie po -- cgit From 81bda7d67c984c9bfcb5bca94e50cec6405b492e Mon Sep 17 00:00:00 2001 From: ThibG Date: Sun, 9 Dec 2018 13:03:01 +0100 Subject: Add setting to not aggregate reblogs (#9248) * Add setting to not aggregate reblogs Fixes #9222 * Handle cases where user is nil in add_to_home and add_to_list * Add hint for setting_aggregate_reblogs option * Reword setting_aggregate_reblogs label --- app/controllers/settings/preferences_controller.rb | 1 + app/lib/feed_manager.rb | 12 ++++++------ app/lib/user_settings_decorator.rb | 5 +++++ app/models/user.rb | 6 +++++- app/views/settings/preferences/show.html.haml | 3 +++ config/locales/simple_form.en.yml | 2 ++ config/settings.yml | 1 + 7 files changed, 23 insertions(+), 7 deletions(-) (limited to 'config') diff --git a/app/controllers/settings/preferences_controller.rb b/app/controllers/settings/preferences_controller.rb index 7bb5fb112..70e71b4a2 100644 --- a/app/controllers/settings/preferences_controller.rb +++ b/app/controllers/settings/preferences_controller.rb @@ -48,6 +48,7 @@ class Settings::PreferencesController < ApplicationController :setting_noindex, :setting_theme, :setting_hide_network, + :setting_aggregate_reblogs, notification_emails: %i(follow follow_request reblog favourite mention digest report), interactions: %i(must_be_follower must_be_following) ) diff --git a/app/lib/feed_manager.rb b/app/lib/feed_manager.rb index 31ff53860..f99df33e5 100644 --- a/app/lib/feed_manager.rb +++ b/app/lib/feed_manager.rb @@ -27,7 +27,7 @@ class FeedManager end def push_to_home(account, status) - return false unless add_to_feed(:home, account.id, status) + return false unless add_to_feed(:home, account.id, status, account.user&.aggregates_reblogs?) trim(:home, account.id) PushUpdateWorker.perform_async(account.id, status.id, "timeline:#{account.id}") if push_update_required?("timeline:#{account.id}") true @@ -45,7 +45,7 @@ class FeedManager should_filter &&= !ListAccount.where(list_id: list.id, account_id: status.in_reply_to_account_id).exists? return false if should_filter end - return false unless add_to_feed(:list, list.id, status) + return false unless add_to_feed(:list, list.id, status, list.account.user&.aggregates_reblogs?) trim(:list, list.id) PushUpdateWorker.perform_async(list.account_id, status.id, "timeline:list:#{list.id}") if push_update_required?("timeline:list:#{list.id}") true @@ -93,7 +93,7 @@ class FeedManager query.each do |status| next if status.direct_visibility? || status.limited_visibility? || filter?(:home, status, into_account) - add_to_feed(:home, into_account.id, status) + add_to_feed(:home, into_account.id, status, into_account.user&.aggregates_reblogs?) end trim(:home, into_account.id) @@ -131,7 +131,7 @@ class FeedManager statuses.each do |status| next if filter_from_home?(status, account) - added += 1 if add_to_feed(:home, account.id, status) + added += 1 if add_to_feed(:home, account.id, status, account.user&.aggregates_reblogs?) end break unless added.zero? @@ -230,11 +230,11 @@ class FeedManager # added, and false if it was not added to the feed. Note that this is # an internal helper: callers must call trim or push updates if # either action is appropriate. - def add_to_feed(timeline_type, account_id, status) + def add_to_feed(timeline_type, account_id, status, aggregate_reblogs = true) timeline_key = key(timeline_type, account_id) reblog_key = key(timeline_type, account_id, 'reblogs') - if status.reblog? + if status.reblog? && (aggregate_reblogs.nil? || aggregate_reblogs) # If the original status or a reblog of it is within # REBLOG_FALLOFF statuses from the top, do not re-insert it into # the feed diff --git a/app/lib/user_settings_decorator.rb b/app/lib/user_settings_decorator.rb index 40973c707..19b854410 100644 --- a/app/lib/user_settings_decorator.rb +++ b/app/lib/user_settings_decorator.rb @@ -31,6 +31,7 @@ class UserSettingsDecorator user.settings['noindex'] = noindex_preference if change?('setting_noindex') user.settings['theme'] = theme_preference if change?('setting_theme') user.settings['hide_network'] = hide_network_preference if change?('setting_hide_network') + user.settings['aggregate_reblogs'] = aggregate_reblogs_preference if change?('setting_aggregate_reblogs') end def merged_notification_emails @@ -97,6 +98,10 @@ class UserSettingsDecorator settings['setting_default_language'] end + def aggregate_reblogs_preference + boolean_cast_setting 'setting_aggregate_reblogs' + end + def boolean_cast_setting(key) ActiveModel::Type::Boolean.new.cast(settings[key]) end diff --git a/app/models/user.rb b/app/models/user.rb index 453ffa8b0..f4130d7b1 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -95,7 +95,7 @@ class User < ApplicationRecord delegate :auto_play_gif, :default_sensitive, :unfollow_modal, :boost_modal, :delete_modal, :reduce_motion, :system_font_ui, :noindex, :theme, :display_media, :hide_network, - :expand_spoilers, :default_language, to: :settings, prefix: :setting, allow_nil: false + :expand_spoilers, :default_language, :aggregate_reblogs, to: :settings, prefix: :setting, allow_nil: false attr_reader :invite_code @@ -231,6 +231,10 @@ class User < ApplicationRecord @hides_network ||= settings.hide_network end + def aggregates_reblogs? + @aggregates_reblogs ||= settings.aggregate_reblogs + end + def token_for_app(a) return nil if a.nil? || a.owner != self Doorkeeper::AccessToken diff --git a/app/views/settings/preferences/show.html.haml b/app/views/settings/preferences/show.html.haml index ecb789f93..a2c61c9a6 100644 --- a/app/views/settings/preferences/show.html.haml +++ b/app/views/settings/preferences/show.html.haml @@ -47,6 +47,9 @@ = f.input :setting_boost_modal, as: :boolean, wrapper: :with_label = f.input :setting_delete_modal, as: :boolean, wrapper: :with_label + .fields-group + = f.input :setting_aggregate_reblogs, as: :boolean, wrapper: :with_label + .fields-group = f.input :setting_auto_play_gif, as: :boolean, wrapper: :with_label = f.input :setting_expand_spoilers, as: :boolean, wrapper: :with_label diff --git a/config/locales/simple_form.en.yml b/config/locales/simple_form.en.yml index e24d8f4e6..ce6a62e87 100644 --- a/config/locales/simple_form.en.yml +++ b/config/locales/simple_form.en.yml @@ -19,6 +19,7 @@ en: password: Use at least 8 characters phrase: Will be matched regardless of casing in text or content warning of a toot scopes: Which APIs the application will be allowed to access. If you select a top-level scope, you don't need to select individual ones. + setting_aggregate_reblogs: Do not show new boosts for toots that have been recently boosted (only affects newly-received boosts) setting_default_language: The language of your toots can be detected automatically, but it's not always accurate setting_display_media_default: Hide media marked as sensitive setting_display_media_hide_all: Always hide all media @@ -65,6 +66,7 @@ en: otp_attempt: Two-factor code password: Password phrase: Keyword or phrase + setting_aggregate_reblogs: Group boosts in timelines setting_auto_play_gif: Auto-play animated GIFs setting_boost_modal: Show confirmation dialog before boosting setting_default_language: Posting language diff --git a/config/settings.yml b/config/settings.yml index 2bc9fe289..4036d419f 100644 --- a/config/settings.yml +++ b/config/settings.yml @@ -33,6 +33,7 @@ defaults: &defaults system_font_ui: false noindex: false theme: 'default' + aggregate_reblogs: true notification_emails: follow: false reblog: false -- cgit