mediawiki-skins-MinervaNeue/includes/Skins/skin.mustache

106 lines
4.2 KiB
Plaintext
Raw Normal View History

<div id="mw-mf-viewport">
<div id="mw-mf-page-center">
<a class="mw-mf-page-center__mask" href="#"></a>
<header class="header-container header-chrome">
<form class="minerva-header" {{#data-search-box}}action="{{form-action}}"{{/data-search-box}} method="get">
<nav class="navigation-drawer toggle-list view-border-box">
<input type="checkbox" id="main-menu-input" class="toggle-list__checkbox" role="button" aria-labelledby="mw-mf-main-menu-button">
<label for="main-menu-input" id="mw-mf-main-menu-button"
class=" mw-ui-button mw-ui-quiet mw-ui-icon mw-ui-icon-element mw-ui-icon-wikimedia-menu-base20 mw-ui-icon-flush-left toggle-list__toggle"
title="{{msg-mobile-frontend-main-menu-button-tooltip}}" data-event-name="ui.mainmenu">{{msg-mobile-frontend-main-menu-button-tooltip}}</label>
{{#data-main-menu}}{{>menu}}{{/data-main-menu}}
<label class="main-menu-mask" for="main-menu-input"></label>
</nav>
<div class="branding-box">
<a href="{{link-mainpage}}">
{{#data-logos}}
<span>{{>Logo}}</span>
{{/data-logos}}
{{#isBeta}}<sup>&beta;</sup>{{/isBeta}}
</a>
</div>
{{#data-search-box}}
<div class="search-box">
<input type="hidden" name="title" value="{{page-title}}"/>
<input class="search mw-ui-background-icon-search skin-minerva-search-trigger" type="search" name="search" id="searchInput"
{{{html-input-attributes}}}">
</div>
{{/data-search-box}}
<nav class="minerva-user-navigation" aria-label="{{msg-minerva-user-navigation}}">
<div>
{{!
A button when clicked will submit the form
This is used so that on tablet devices with JS disabled the search button
passes the value of input to the search
We avoid using input[type=submit] as these cannot be easily styled as mediawiki ui icons
which is problematic in Opera Mini (see T140490)
}}
<button id="searchIcon" class="mw-ui-icon mw-ui-icon-element mw-ui-icon-wikimedia-search-base20 skin-minerva-search-trigger mw-ui-button mw-ui-quiet">{{msg-searchbutton}}</button>
</div>
[UI] [new] add user menu Add new user menu. The changes required include: - Break up AuthMenuEntry into reusable components. They're now simple, independent, static functions in AuthUtil that are easy to reason about and compose. There's lots of verbose code because of the builder and director patterns. That is, most of the code is for building the thing we actually want to build instead of just building it. It's easy to write but no fun to read--even simple configurations are extremely verbose expressions that must be threaded through the system. These builders are also single purpose and unlikely to be reusable unlike a URI builder, for example. As objects, they're not especially composable either. - Similarly, break up Menu/DefaultBuilder into BuilderUtil and ban inheritance. Inheritance has not worked well on the frontend of MobileFrontend. I don't think it's going to work well here. E.g., I could have made changes to the base class' getPersonalTools() method such that the client passes a parameter for the advanced config or maybe I just override it in the subclass. In either case, I think it makes the whole hierarchy nuanced and harder to reason about for something that should be simple. - Add ProfileMenuEntry and LogOutMenuEntry for the user menu. - Rename insertLogInOutMenuItem() to insertAuthMenuItem() which matches the entry name, AuthMenuEntry. - Extension:SandboxLink is needed to display the sandbox link in the user menu. - Performance note: the toolbar is now processed in MinervaTemplate, which corresponds to removing the buildPersonalUrls() override. - To mimic the design of main menu, the following steps would be necessary: 1. Create a user/Default and user/Advanced user menu builder and also a user/IBuilder interface. 2. Create a user/Director. 3. Create a service entry for Minerva.Menu.UserDirector in ServiceWiring. The Director is actually powerless and doesn't get to make any decisions--the appropriate builder is passed in from ServiceWiring which checks the mode. 4. Access the service in SkinMinerva to set a userMenuHTML data member on the Minerva QuickTemplate. 5. In MinervaTemplate, access the userMenuHTML QuickTemplate member and do the usual song and dance of inflating a Mustache template. This patch does everything except add a service, which was agreed to be unnecessary, so that logic is now in SkinMinerva. - Wrap the existing echo user notifications button and new user menu button in a nav element. This seems like a semantic improvement. - The existing styling and logic for the search bar and search overlay are pretty messy and delicate. Changes made to that LESS endeavored to be surgical. There's lots of room for improvement in the toolbar but it's out of scope. - Rename logout icon to logOut. Bug: T214540 Change-Id: Ib517864fcf4e4d611e05525a6358ee6662fe4e05
2019-06-25 20:12:58 +00:00
{{^isAnon}}
<div class="minerva-user-notifications" id="pt-notifications-alert">
{{{userNotificationsHTML}}}
[UI] [new] add user menu Add new user menu. The changes required include: - Break up AuthMenuEntry into reusable components. They're now simple, independent, static functions in AuthUtil that are easy to reason about and compose. There's lots of verbose code because of the builder and director patterns. That is, most of the code is for building the thing we actually want to build instead of just building it. It's easy to write but no fun to read--even simple configurations are extremely verbose expressions that must be threaded through the system. These builders are also single purpose and unlikely to be reusable unlike a URI builder, for example. As objects, they're not especially composable either. - Similarly, break up Menu/DefaultBuilder into BuilderUtil and ban inheritance. Inheritance has not worked well on the frontend of MobileFrontend. I don't think it's going to work well here. E.g., I could have made changes to the base class' getPersonalTools() method such that the client passes a parameter for the advanced config or maybe I just override it in the subclass. In either case, I think it makes the whole hierarchy nuanced and harder to reason about for something that should be simple. - Add ProfileMenuEntry and LogOutMenuEntry for the user menu. - Rename insertLogInOutMenuItem() to insertAuthMenuItem() which matches the entry name, AuthMenuEntry. - Extension:SandboxLink is needed to display the sandbox link in the user menu. - Performance note: the toolbar is now processed in MinervaTemplate, which corresponds to removing the buildPersonalUrls() override. - To mimic the design of main menu, the following steps would be necessary: 1. Create a user/Default and user/Advanced user menu builder and also a user/IBuilder interface. 2. Create a user/Director. 3. Create a service entry for Minerva.Menu.UserDirector in ServiceWiring. The Director is actually powerless and doesn't get to make any decisions--the appropriate builder is passed in from ServiceWiring which checks the mode. 4. Access the service in SkinMinerva to set a userMenuHTML data member on the Minerva QuickTemplate. 5. In MinervaTemplate, access the userMenuHTML QuickTemplate member and do the usual song and dance of inflating a Mustache template. This patch does everything except add a service, which was agreed to be unnecessary, so that logic is now in SkinMinerva. - Wrap the existing echo user notifications button and new user menu button in a nav element. This seems like a semantic improvement. - The existing styling and logic for the search bar and search overlay are pretty messy and delicate. Changes made to that LESS endeavored to be surgical. There's lots of room for improvement in the toolbar but it's out of scope. - Rename logout icon to logOut. Bug: T214540 Change-Id: Ib517864fcf4e4d611e05525a6358ee6662fe4e05
2019-06-25 20:12:58 +00:00
</div>
{{/isAnon}}
{{#userMenuHTML}}{{{userMenuHTML}}}{{/userMenuHTML}}
</nav>
</form>
</header>
<main id="content" class="mw-body">
<div class="banner-container">
{{>banners}}
</div>
{{#html-user-message}}
<div class="minerva-anon-talk-message warningbox">
<span class="mw-ui-icon mw-ui-icon-wikimedia-userTalk-warning"> </span>
{{{html-user-message}}}
</div>
{{/html-user-message}}
<div class="pre-content heading-holder">
<div class="page-heading">
{{{headinghtml}}}
{{{taglinehtml}}}
</div>
{{#data-minerva-tabs}}
<div class="minerva__tab-container">
{{#items}}
<a href="{{href}}" rel="{{rel}}" class="minerva__tab {{class}}" data-event-name="tabs.{{context}}">{{text}}</a>
{{/items}}
</div>
{{/data-minerva-tabs}}
{{#data-minerva-page-actions}}
{{>PageActionsMenu}}
{{/data-minerva-page-actions}}
{{{postheadinghtml}}}
<div class="minerva__subtitle">{{{html-subtitle}}}</div>
</div>
<div id="bodyContent" class="content">
{{{html-body-content}}}
{{! This shows "Return to page" on talk page when talk tab not shown at top.
To see set wgMinervaTalkAtTop to false and visit a talk page}}
{{{html-minerva-subject-link}}}
</div>
<div class="post-content" id="page-secondary-actions">
{{#data-minerva-secondary-actions}}
{{#talk}}
<a {{#attributes}} href="{{href}}" data-title="{{data-title}}" class="{{class}} mw-ui-button button"{{/attributes}}>
{{{label}}}
</a>
{{/talk}}
{{#language}}
<a {{#attributes}} href="{{href}}" data-title="{{data-title}}" class="{{class}} mw-ui-button button"{{/attributes}}>
{{{label}}}
</a>
{{/language}}
{{/data-minerva-secondary-actions}}
</div>
{{#html-categories}}
<div class="post-content">{{{.}}}</div>
{{/html-categories}}
</main>
{{>footer}}
</div>
</div>
<div class="mw-notification-area" data-mw="interface"></div>
<!-- v:8.3.1 -->