Show navigation panel in multiple columns WebUI

This commit is contained in:
noellabo 2019-07-08 13:03:08 +09:00
parent 138d5972dd
commit c91937c9a1
11 changed files with 33 additions and 3 deletions

View file

@ -60,6 +60,7 @@ class Settings::PreferencesController < Settings::BaseController
:setting_show_subscribe_button_on_timeline,
:setting_show_followed_by,
:setting_follow_button_to_list_adder,
:setting_show_navigation_panel,
:setting_show_target,
notification_emails: %i(follow follow_request reblog favourite mention digest report pending_account trending_tag),
interactions: %i(must_be_follower must_be_following must_be_following_dm)

View file

@ -31,6 +31,7 @@ import {
import Icon from 'mastodon/components/icon';
import ComposePanel from './compose_panel';
import NavigationPanel from './navigation_panel';
import { show_navigation_panel } from 'mastodon/initial_state';
import { supportsPassiveEvents } from 'detect-passive-events';
import { scrollRight } from '../../../scroll';
@ -266,6 +267,11 @@ class ColumnsArea extends ImmutablePureComponent {
})}
{React.Children.map(children, child => React.cloneElement(child, { multiColumn: true }))}
{show_navigation_panel && <div className='columns-area__panels__pane columns-area__panels__pane--start columns-area__panels__pane--navigational'>
<div className='columns-area__panels__pane__inner'>
<NavigationPanel />
</div>
</div>}
</div>
);
}

View file

@ -32,6 +32,7 @@ export const show_follow_button_on_timeline = getMeta('show_follow_button_on_tim
export const show_subscribe_button_on_timeline = getMeta('show_subscribe_button_on_timeline');
export const show_followed_by = getMeta('show_followed_by');
export const follow_button_to_list_adder = getMeta('follow_button_to_list_adder');
export const show_navigation_panel = getMeta('show_navigation_panel');
export const show_target = getMeta('show_target');
export default initialState;

View file

@ -2061,6 +2061,14 @@ a.account__display-name {
vertical-align: middle;
}
.layout-multiple-columns .columns-area__panels__pane {
height: auto;
&__inner {
position: static;
}
}
.columns-area {
display: flex;
flex: 1 1 auto;
@ -2490,7 +2498,7 @@ a.account__display-name {
}
@media screen and (max-width: 600px + (285px * 2) + (10px * 2)) {
.columns-area__panels__pane--navigational {
.layout-single-column .columns-area__panels__pane--navigational {
display: none;
}
}

View file

@ -44,6 +44,7 @@ class UserSettingsDecorator
user.settings['show_subscribe_button_on_timeline'] = show_subscribe_button_on_timeline_preference if change?('setting_show_subscribe_button_on_timeline')
user.settings['show_followed_by'] = show_followed_by_preference if change?('setting_show_followed_by')
user.settings['follow_button_to_list_adder'] = follow_button_to_list_adder_preference if change?('setting_follow_button_to_list_adder')
user.settings['show_navigation_panel'] = show_navigation_panel_preference if change?('setting_show_navigation_panel')
user.settings['show_target'] = show_target_preference if change?('setting_show_target')
end
@ -163,6 +164,10 @@ class UserSettingsDecorator
boolean_cast_setting 'setting_follow_button_to_list_adder'
end
def show_navigation_panel_preference
boolean_cast_setting 'setting_show_navigation_panel'
end
def show_target_preference
boolean_cast_setting 'setting_show_target'
end

View file

@ -128,7 +128,7 @@ class User < ApplicationRecord
:disable_swiping,
:show_follow_button_on_timeline, :show_subscribe_button_on_timeline, :show_target,
:show_follow_button_on_timeline, :show_subscribe_button_on_timeline, :show_followed_by, :show_target,
:follow_button_to_list_adder,
:follow_button_to_list_adder, :show_navigation_panel,
to: :settings, prefix: :setting, allow_nil: false
attr_reader :invite_code, :sign_in_token_attempt

View file

@ -46,8 +46,9 @@ class InitialStateSerializer < ActiveModel::Serializer
store[:show_subscribe_button_on_timeline] = object.current_account.user.setting_show_subscribe_button_on_timeline
store[:show_followed_by] = object.current_account.user.setting_show_followed_by
store[:follow_button_to_list_adder] = object.current_account.user.setting_follow_button_to_list_adder
store[:show_navigation_panel] = object.current_account.user.setting_show_navigation_panel
store[:show_target] = object.current_account.user.setting_show_target
else
else
store[:auto_play_gif] = Setting.auto_play_gif
store[:display_media] = Setting.display_media
store[:reduce_motion] = Setting.reduce_motion

View file

@ -45,6 +45,9 @@
.fields-group
= f.input :setting_follow_button_to_list_adder, as: :boolean, wrapper: :with_label
.fields-group
= f.input :setting_show_navigation_panel, as: :boolean, wrapper: :with_label
-# .fields-group
-# = f.input :setting_show_target, as: :boolean, wrapper: :with_label

View file

@ -56,6 +56,7 @@ en:
setting_noindex: Affects your public profile and post pages
setting_show_application: The application you use to post will be displayed in the detailed view of your posts
setting_show_follow_button_on_timeline: You can easily check the follow status and build a follow list quickly
setting_show_navigation_panel: Show the navigation panel at the right end of the advanced UI
setting_show_subscribe_button_on_timeline: You can easily check the status of your subscriptions and quickly build a subscription list
setting_show_followed_by: "The color of the follow button changes according to the follow status (gray: no follow relationship, yellow: followed, blue: following, green: mutual follow)"
setting_show_target: Enable the function to switch between posting target and follow / subscribe target
@ -184,6 +185,7 @@ en:
setting_reduce_motion: Reduce motion in animations
setting_show_application: Disclose application used to send posts
setting_show_follow_button_on_timeline: Show follow button on timeline
setting_show_navigation_panel: Show the navigation panel
setting_show_subscribe_button_on_timeline: Show subscribe button on timeline
setting_show_followed_by: Reflect the following status on the follow button
setting_show_target: Enable targeting features

View file

@ -56,6 +56,7 @@ ja:
setting_noindex: 公開プロフィールおよび各投稿ページに影響します
setting_show_application: 投稿するのに使用したアプリが投稿の詳細ビューに表示されるようになります
setting_show_follow_button_on_timeline: フォロー状態を確認し易くなり、素早くフォローリストを構築できます
setting_show_navigation_panel: 上級者向け UI の右端にナビゲーションパネルを表示します
setting_show_subscribe_button_on_timeline: 購読状態を確認し易くなり、素早く購読リストを構築できます
setting_show_followed_by: フォロー状態に応じてフォローボタンの色が変わります(灰色:フォロー関係なし、黄色:フォローされている、青色:フォローしている、緑色:相互フォロー)
setting_show_target: 投稿対象と、フォロー・購読の対象を切り替える機能を有効にします
@ -184,6 +185,7 @@ ja:
setting_reduce_motion: アニメーションの動きを減らす
setting_show_application: 送信したアプリを開示する
setting_show_follow_button_on_timeline: タイムライン上にフォローボタンを表示する
setting_show_navigation_panel: ナビゲーションパネルを表示する
setting_show_subscribe_button_on_timeline: タイムライン上に購読ボタンを表示する
setting_show_followed_by: 被フォロー状態をフォローボタンに反映する
setting_show_target: ターゲット機能を有効にする

View file

@ -43,6 +43,7 @@ defaults: &defaults
show_subscribe_button_on_timeline: false
show_followed_by: false
follow_button_to_list_adder: false
show_navigation_panel: true
show_target: false
notification_emails:
follow: false