:setting_reduce_motion,
:setting_system_font_ui,
: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)
)
--- /dev/null
-
+// This file will be loaded on settings pages, regardless of theme.
+
++import escapeTextContentForBrowser from 'escape-html';
+const { delegate } = require('rails-ujs');
+import emojify from '../mastodon/features/emoji/emoji';
+
+delegate(document, '#account_display_name', 'input', ({ target }) => {
+ const name = document.querySelector('.card .display-name strong');
- name.innerHTML = emojify(target.value);
+ if (name) {
++ if (target.value) {
++ name.innerHTML = emojify(escapeTextContentForBrowser(target.value));
++ } else {
++ name.textContent = document.querySelector('#default_account_display_name').textContent;
++ }
+ }
+});
+
+delegate(document, '#account_avatar', 'change', ({ target }) => {
+ const avatar = document.querySelector('.card .avatar img');
+ const [file] = target.files || [];
+ const url = file ? URL.createObjectURL(file) : avatar.dataset.originalSrc;
+
+ avatar.src = url;
+});
+
+delegate(document, '#account_header', 'change', ({ target }) => {
+ const header = document.querySelector('.card .card__img img');
+ const [file] = target.files || [];
+ const url = file ? URL.createObjectURL(file) : header.dataset.originalSrc;
+
+ header.src = url;
+});
+
+delegate(document, '#account_locked', 'change', ({ target }) => {
+ const lock = document.querySelector('.card .display-name i');
+
+ if (target.checked) {
+ lock.style.display = 'inline';
+ } else {
+ lock.style.display = 'none';
+ }
+});
+
+delegate(document, '.input-copy input', 'click', ({ target }) => {
+ target.select();
+});
+
+delegate(document, '.input-copy button', 'click', ({ target }) => {
+ const input = target.parentNode.querySelector('.input-copy__wrapper input');
+
+ input.focus();
+ input.select();
+
+ try {
+ if (document.execCommand('copy')) {
+ input.blur();
+ target.parentNode.classList.add('copied');
+
+ setTimeout(() => {
+ target.parentNode.classList.remove('copied');
+ }, 700);
+ }
+ } catch (err) {
+ console.error(err);
+ }
+});
def push_to_list(list, status)
if status.reply? && status.in_reply_to_account_id != status.account_id
should_filter = status.in_reply_to_account_id != list.account_id
- should_filter &&= !ListAccount.where(list_id: list.id, account_id: status.in_reply_to_account_id).exists?
+ should_filter &&= !list.show_all_replies?
+ should_filter &&= !(list.show_list_replies? && 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
user.settings['reduce_motion'] = reduce_motion_preference if change?('setting_reduce_motion')
user.settings['system_font_ui'] = system_font_ui_preference if change?('setting_system_font_ui')
user.settings['noindex'] = noindex_preference if change?('setting_noindex')
- user.settings['theme'] = theme_preference if change?('setting_theme')
+ user.settings['flavour'] = flavour_preference if change?('setting_flavour')
+ user.settings['skin'] = skin_preference if change?('setting_skin')
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
has_many :session_activations, dependent: :destroy
- delegate :auto_play_gif, :default_sensitive, :unfollow_modal, :boost_modal, :delete_modal,
- :reduce_motion, :system_font_ui, :noindex, :theme, :display_media, :hide_network,
+ delegate :auto_play_gif, :default_sensitive, :unfollow_modal, :boost_modal, :favourite_modal, :delete_modal,
+ :reduce_motion, :system_font_ui, :noindex, :flavour, :skin, :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
.fields-group
= f.input :setting_unfollow_modal, as: :boolean, wrapper: :with_label
= f.input :setting_boost_modal, as: :boolean, wrapper: :with_label
+ = f.input :setting_favourite_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_display_media, collection: ['default', 'show_all', 'hide_all'], wrapper: :with_label, include_blank: false, label_method: lambda { |item| safe_join([t("simple_form.labels.defaults.setting_display_media_#{item}"), content_tag(:span, t("simple_form.hints.defaults.setting_display_media_#{item}"), class: 'hint')]) }, required: false, as: :radio_buttons, collection_wrapper_tag: 'ul', item_wrapper_tag: 'li'
= f.input :setting_expand_spoilers, as: :boolean, wrapper: :with_label
= f.input :setting_reduce_motion, as: :boolean, wrapper: :with_label
= f.input :setting_system_font_ui, as: :boolean, wrapper: :with_label
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]
resource :notifications, only: [:show, :update]
resource :import, only: [:show, :create]
reduce_motion: false
system_font_ui: false
noindex: false
- theme: 'default'
+ flavour: 'glitch'
+ skin: 'default'
+ aggregate_reblogs: true
notification_emails:
follow: false
reblog: false