]> cat aescling's git repositories - mastodon.git/commitdiff
Merge branch 'master' into glitch-soc/merge-upstream
authorThibaut Girka <thib@sitedethib.com>
Sun, 9 Dec 2018 12:28:09 +0000 (13:28 +0100)
committerThibaut Girka <thib@sitedethib.com>
Sun, 9 Dec 2018 15:08:04 +0000 (16:08 +0100)
Conflicts:
- app/javascript/packs/public.js
- app/models/user.rb
- config/settings.yml
- db/schema.rb

Moved public.js changes to settings.js.

21 files changed:
1  2 
Gemfile.lock
app/controllers/settings/preferences_controller.rb
app/controllers/settings/profiles_controller.rb
app/javascript/core/settings.js
app/javascript/styles/mastodon/components.scss
app/lib/feed_manager.rb
app/lib/user_settings_decorator.rb
app/models/account.rb
app/models/concerns/account_associations.rb
app/models/user.rb
app/views/layouts/public.html.haml
app/views/settings/preferences/show.html.haml
app/views/settings/profiles/show.html.haml
config/locales/en.yml
config/locales/pl.yml
config/locales/simple_form.en.yml
config/locales/simple_form.pl.yml
config/navigation.rb
config/routes.rb
config/settings.yml
db/schema.rb

diff --cc Gemfile.lock
Simple merge
index 5c5f31d2bbf72497e6da6a279cb680cfea3e1438,70e71b4a2451b4648fefbb95315132865c22bd7d..b70844b65950f656b9e75365ce249ad61db79bd9
@@@ -42,7 -46,9 +42,8 @@@ class Settings::PreferencesController 
        :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)
      )
index 23a303747ffc9a946bc3f27bfd1ca145d2688de3,0000000000000000000000000000000000000000..af97fb25fb92c5f8e3e26b00f895cf53869b63f7
mode 100644,000000..100644
--- /dev/null
@@@ -1,62 -1,0 +1,66 @@@
 +//  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);
 +  }
 +});
index 0cdb178c1788f0fec76ba67d4d7e9909a84c79eb,f99df33e54f0d2d61104a8bbc1029008eb3f5b0d..a1b186f1cbbf35e5d059007dc0fae67dcd20ea8f
@@@ -42,11 -42,10 +42,11 @@@ class FeedManage
    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
index e5b1685027fd85416f4bb217d2cafd85ecfcbc12,19b8544103ed99836e870160a735f4bc18f7a0ba..559e00d2077c3fa23feacf0d6b823309b10ec60a
@@@ -30,9 -29,9 +30,10 @@@ class UserSettingsDecorato
      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
Simple merge
index 704523d341547994a936c107da5356be96762cde,f4130d7b1c53dbb6302831d59c04cc42bc12db4b..5a21419bf5d9fd8167c2f55b76b1dead3530ea95
@@@ -93,9 -93,9 +93,9 @@@ class User < ApplicationRecor
  
    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
  
Simple merge
index 45f9fd1787f4113f1f12fef674207b3852e070da,a2c61c9a6810c1a1c1a59225fb9957ca7d1c51b9..53390b6d1f280043d4aa10a2c136ca565ec1bd7b
    .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
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
index 446aad58b13091327c5296c0b96ea0f2de410167,2628684137129c43d8582b18a1ea36da90bc0cbc..6b33d8baf8abef35c6a6574eb4570b99db2b13d9
@@@ -80,9 -80,13 +80,14 @@@ Rails.application.routes.draw d
    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]
index 48639e9a8b7fd403083d70b0e2cf2a22526f535d,4036d419fe0a69522545916cb69680d0f86c37d9..bfccd2cc797373706e8098239920ef53fbc39c62
@@@ -33,8 -32,8 +33,9 @@@ defaults: &default
    reduce_motion: false
    system_font_ui: false
    noindex: false
 -  theme: 'default'
 +  flavour: 'glitch'
 +  skin: 'default'
+   aggregate_reblogs: true
    notification_emails:
      follow: false
      reblog: false
diff --cc db/schema.rb
Simple merge