]> cat aescling's git repositories - mastodon.git/commitdiff
Merge branch 'master' into glitch-soc/merge-upstream
authorThibaut Girka <thib@sitedethib.com>
Fri, 26 Oct 2018 18:36:49 +0000 (20:36 +0200)
committerThibaut Girka <thib@sitedethib.com>
Fri, 26 Oct 2018 18:41:43 +0000 (20:41 +0200)
Conflicts:
- app/controllers/admin/base_controller.rb
- app/controllers/filters_controller.rb
- app/controllers/invites_controller.rb
- app/controllers/settings/deletes_controller.rb
- app/controllers/settings/exports_controller.rb
- app/controllers/settings/follower_domains_controller.rb
- app/controllers/settings/migrations_controller.rb
- app/controllers/settings/notifications_controller.rb
- app/controllers/settings/preferences_controller.rb
- app/controllers/settings/two_factor_authentication/recovery_codes_controller.rb
- app/javascript/packs/public.js
- app/views/settings/profiles/show.html.haml

Conflicts were mostly due to the addition of body classes to the settings page,
this was caused by rejecting upstream changes for most of those files and
modifying Settings::BaseController instead.

Another cause of conflicts was the deletion of client-side checking of
display name / bio length, this was modified in app/javascript/core/settings.js
instead.

24 files changed:
1  2 
.circleci/config.yml
Gemfile
Gemfile.lock
app/controllers/admin/base_controller.rb
app/controllers/filters_controller.rb
app/controllers/invites_controller.rb
app/controllers/settings/base_controller.rb
app/controllers/settings/follower_domains_controller.rb
app/controllers/settings/sessions_controller.rb
app/javascript/core/settings.js
app/javascript/mastodon/features/compose/components/compose_form.js
app/javascript/packs/public.js
app/views/layouts/admin.html.haml
app/views/settings/profiles/show.html.haml
app/views/stream_entries/_simple_status.html.haml
config/initializers/cors.rb
config/locales/ca.yml
config/locales/pl.yml
config/locales/simple_form.en.yml
config/locales/simple_form.ja.yml
config/locales/simple_form.pl.yml
config/locales/sk.yml
db/schema.rb
lib/mastodon/version.rb

Simple merge
diff --cc Gemfile
Simple merge
diff --cc Gemfile.lock
Simple merge
index fc299f74c5f0f8532157139bbaaa20100ef80b8b,8593b582a68e73c70d09d1562190898303a23ce1..f2190ddf9b74e980b4e6dd9f4789fb247c227ac9
@@@ -8,10 -8,12 +8,17 @@@ module Admi
      layout 'admin'
  
      before_action :require_staff!
 +    before_action :set_pack
+     before_action :set_body_classes
+     private
+     def set_body_classes
+       @body_classes = 'admin'
+     end
 +
 +    def set_pack
 +      use_pack 'admin'
 +    end
    end
  end
index 0d1200fcc8aaaf6522e79eec10324e3ed0255049,d2e0fb73907f243bbae10be4b3bd6e2ce20c74ec..f1e110d87ddb8a17fb9b07aba6f54d919d973c27
@@@ -7,7 -7,7 +7,8 @@@ class FiltersController < ApplicationCo
  
    before_action :set_filters, only: :index
    before_action :set_filter, only: [:edit, :update, :destroy]
 +  before_action :set_pack
+   before_action :set_body_classes
  
    def index
      @filters = current_account.custom_filters
index 3dc934761f0f11f32a11bdd68ae07bc810a85f7d,fdb3a0962a2ac4f53f7ec443be4ea60c3e33c771..52cddc404426ad8f5b6a92fce4ee89779201ccab
@@@ -6,7 -6,7 +6,8 @@@ class InvitesController < ApplicationCo
    layout 'admin'
  
    before_action :authenticate_user!
 +  before_action :set_pack
+   before_action :set_body_classes
  
    def index
      authorize :invite, :create?
index 7322d461be58c8133a07ba3cac156322c7662cc1,0000000000000000000000000000000000000000..34ef165689ea37ebc10f98dd092b2e83f2bcc1fb
mode 100644,000000..100644
--- /dev/null
@@@ -1,12 -1,0 +1,17 @@@
 +# frozen_string_literal: true
 +
 +class Settings::BaseController < ApplicationController
 +  layout 'admin'
 +
 +  before_action :authenticate_user!
 +  before_action :set_pack
++  before_action :set_body_classes
 +
 +  def set_pack
 +    use_pack 'settings'
 +  end
++
++  def set_body_classes
++    @body_classes = 'admin'
++  end
 +end
index 83945df520eb91a578e93ff1ef29c3750b7394ba,9c39e66bbb1c04e175eb356cce67b73fd0284325..8aae379aa1f72953a36a5b1901b55552d5120a36
@@@ -1,8 -1,11 +1,6 @@@
  # frozen_string_literal: true
  
- require 'sidekiq-bulk'
 -class Settings::FollowerDomainsController < ApplicationController
 -  layout 'admin'
 -
 -  before_action :authenticate_user!
 -  before_action :set_body_classes
--
 +class Settings::FollowerDomainsController < Settings::BaseController
    def show
      @account = current_account
      @domains = current_account.followers.reorder(Arel.sql('MIN(follows.id) DESC')).group('accounts.domain').select('accounts.domain, count(accounts.id) as accounts_from_domain').page(params[:page]).per(10)
index 780ea64b40f1970b50cfa9645670cef03d89b31a,74cebc07b6a6b0b2c6d27729a953dd3804a484fa..f235dd4773120b1517eda9b2ac21c38786d348f8
@@@ -1,8 -1,8 +1,9 @@@
  # frozen_string_literal: true
  
 +#  Intentionally does not inherit from BaseController
  class Settings::SessionsController < ApplicationController
    before_action :set_session, only: :destroy
+   before_action :set_body_classes
  
    def destroy
      @session.destroy!
index af97c84f938ad61fdb63b892343a816fcfc177d8,0000000000000000000000000000000000000000..23a303747ffc9a946bc3f27bfd1ca145d2688de3
mode 100644,000000..100644
--- /dev/null
@@@ -1,76 -1,0 +1,62 @@@
- const { length } = require('stringz');
 +//  This file will be loaded on settings pages, regardless of theme.
 +
-   const nameCounter = document.querySelector('.name-counter');
-   const name        = document.querySelector('.card .display-name strong');
-   if (nameCounter) {
-     nameCounter.textContent = 30 - length(target.value);
-   }
 +const { delegate } = require('rails-ujs');
 +import emojify from '../mastodon/features/emoji/emoji';
 +
 +delegate(document, '#account_display_name', 'input', ({ target }) => {
- delegate(document, '#account_note', 'input', ({ target }) => {
-   const noteCounter = document.querySelector('.note-counter');
-   if (noteCounter) {
-     noteCounter.textContent = 500 - length(target.value);
-   }
- });
++  const name = document.querySelector('.card .display-name strong');
 +
 +  if (name) {
 +    name.innerHTML = emojify(target.value);
 +  }
 +});
 +
 +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 a62974ec0c572a7db6830f441e0e241d13b1d6d1,3b02b7c39e2157ac359a9f3060087d6b1205fbed..9cf783c84341b727b8376986bb8f459a66909279
@@@ -4,8 -4,23 +4,7 @@@ import { start } from '../mastodon/comm
  
  start();
  
 -window.addEventListener('message', e => {
 -  const data = e.data || {};
 -
 -  if (!window.parent || data.type !== 'setHeight') {
 -    return;
 -  }
 -
 -  ready(() => {
 -    window.parent.postMessage({
 -      type: 'setHeight',
 -      id: data.id,
 -      height: document.getElementsByTagName('html')[0].scrollHeight,
 -    }, '*');
 -  });
 -});
 -
  function main() {
-   const { length } = require('stringz');
    const IntlMessageFormat = require('intl-messageformat').default;
    const { timeAgoString } = require('../mastodon/components/relative_timestamp');
    const { delegate } = require('rails-ujs');
Simple merge
index 6b61fa9c926ec5ed5c3a71bf7b0ce40065d85268,f5c50144bd9066f0708bd9d6bbd38e1f467749fb..516851b0418e44921a891087d0f4c20de3e5e6f5
@@@ -6,8 -6,8 +6,8 @@@
  
    .fields-row
      .fields-row__column.fields-group.fields-row__column-6
-       = f.input :display_name, wrapper: :with_label, hint: t('simple_form.hints.defaults.display_name', count: 30 - @account.display_name.size).html_safe
-       = f.input :note, wrapper: :with_label, hint: t('simple_form.hints.defaults.note', count: 500 - @account.note.size).html_safe
+       = f.input :display_name, wrapper: :with_label, input_html: { maxlength: 30 }, hint: false
 -      = f.input :note, wrapper: :with_label, input_html: { maxlength: 160 }, hint: false
++      = f.input :note, wrapper: :with_label, input_html: { maxlength: 500 }, hint: false
  
    .fields-row
      .fields-row__column.fields-row__column-6
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
diff --cc db/schema.rb
Simple merge
Simple merge
This page took 0.21227 seconds and 3 git commands to generate.