DEV: Convert experimental user page activity nav to horizontal nav (#18483)

As usual, design is still in flux so no tests for now.

Internal Ref: /t/67780/59
This commit is contained in:
Alan Guo Xiang Tan 2022-10-05 14:19:46 +08:00 committed by GitHub
parent 63b7f7c85c
commit 637b1211b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 46 additions and 42 deletions

View File

@ -9,44 +9,12 @@
</LinkTo> </LinkTo>
</li> </li>
<UserNav::DropdownList <li class="user-activity">
@icon="stream" <LinkTo @route="userActivity">
@text={{i18n "user.activity_stream"}} {{d-icon "stream"}}
@isActive={{eq @currentParentRoute "userActivity"}} {{i18n "user.activity_stream"}}
@class="user-activity" > </LinkTo>
</li>
<:submenu>
<DNavigationItem @route="userActivity.index">{{i18n "user.filters.all"}}</DNavigationItem>
<DNavigationItem @route="userActivity.topics">{{i18n "user_action_groups.4"}}</DNavigationItem>
<DNavigationItem @route="userActivity.replies">{{i18n "user_action_groups.5"}}</DNavigationItem>
{{#if @showRead}}
<DNavigationItem @route="userActivity.read" @title={{i18n "user.read_help"}}>
{{i18n "user.read"}}
</DNavigationItem>
{{/if}}
{{#if @showDrafts}}
<DNavigationItem @route="userActivity.drafts">
{{this.draftLabel}}
</DNavigationItem>
{{/if}}
{{#if (gt @user.pending_posts_count 0)}}
<DNavigationItem @route="userActivity.pending">
{{this.pendingLabel}}
</DNavigationItem>
{{/if}}
<DNavigationItem @route="userActivity.likesGiven">{{i18n "user_action_groups.1"}}</DNavigationItem>
{{#if @showBookmarks}}
<DNavigationItem @route="userActivity.bookmarks">{{i18n "user_action_groups.3"}}</DNavigationItem>
{{/if}}
<PluginOutlet @name="user-activity-bottom" @tagName="span" @connectorTagName="li" @args={{hash model=@user}} />
</:submenu>
</UserNav::DropdownList>
{{/unless}} {{/unless}}
{{#if @showNotificationsTab}} {{#if @showNotificationsTab}}

View File

@ -88,7 +88,7 @@
{{/if}} {{/if}}
{{/if}} {{/if}}
<PluginOutlet @name="user-messages-nav" @tagName="span" @connectorTagName="li" @args={{hash model=@user}} /> <PluginOutlet @name="user-messages-nav" @connectorTagName="li" @args={{hash model=@user}} />
</ul> </ul>
{{#if this.site.desktopView}} {{#if this.site.desktopView}}

View File

@ -1,4 +1,40 @@
{{#unless this.currentUser.redesigned_user_page_nav_enabled}} {{#if this.currentUser.redesigned_user_page_nav_enabled}}
<DSection @pageClass="user-activity" />
<div class="user-navigation-container">
<ul id="navigation-bar" class="nav-pills action-list">
<DNavigationItem @route="userActivity.index">{{i18n "user.filters.all"}}</DNavigationItem>
<DNavigationItem @route="userActivity.topics">{{i18n "user_action_groups.4"}}</DNavigationItem>
<DNavigationItem @route="userActivity.replies">{{i18n "user_action_groups.5"}}</DNavigationItem>
{{#if this.user.showRead}}
<DNavigationItem @route="userActivity.read" @title={{i18n "user.read_help"}}>
{{i18n "user.read"}}
</DNavigationItem>
{{/if}}
{{#if this.user.showDrafts}}
<DNavigationItem @route="userActivity.drafts">
{{this.draftLabel}}
</DNavigationItem>
{{/if}}
{{#if (gt this.model.pending_posts_count 0)}}
<DNavigationItem @route="userActivity.pending">
{{this.pendingLabel}}
</DNavigationItem>
{{/if}}
<DNavigationItem @route="userActivity.likesGiven">{{i18n "user_action_groups.1"}}</DNavigationItem>
{{#if this.user.showBookmarks}}
<DNavigationItem @route="userActivity.bookmarks">{{i18n "user_action_groups.3"}}</DNavigationItem>
{{/if}}
<PluginOutlet @name="user-activity-bottom" @connectorTagName="li" @args={{hash model=this.model}} />
</ul>
</div>
{{else}}
<DSection @pageClass="user-activity" @class="user-secondary-navigation" @scrollTop={{false}}> <DSection @pageClass="user-activity" @class="user-secondary-navigation" @scrollTop={{false}}>
<nav role="navigation"> <nav role="navigation">
<MobileNav @class="activity-nav" @desktopClass="action-list activity-list nav-stacked"> <MobileNav @class="activity-nav" @desktopClass="action-list activity-list nav-stacked">
@ -40,7 +76,7 @@
<DButton @action={{action "exportUserArchive"}} @class="btn-default" @label="user.download_archive.button_text" @icon="download" /> <DButton @action={{action "exportUserArchive"}} @class="btn-default" @label="user.download_archive.button_text" @icon="download" />
</section> </section>
{{/if}} {{/if}}
{{/unless}} {{/if}}
<section class="user-content"> <section class="user-content">
{{outlet}} {{outlet}}

View File

@ -35,7 +35,7 @@
</LinkTo> </LinkTo>
</li> </li>
<PluginOutlet @name="user-notifications-bottom" @tagName="span" @connectorTagName="li" @args={{hash model=this.model}} /> <PluginOutlet @name="user-notifications-bottom" @connectorTagName="li" @args={{hash model=this.model}} />
</ul> </ul>
{{#if this.model}} {{#if this.model}}