Commit graph

573 commits

Author SHA1 Message Date
tacsipacsi aaf0159174 Don’t add any <h1> to main pages for anons
Main pages usually feature a welcome message on their own, and adding
the standard <h1> is redundant at best. (Or, if there’s no welcome
message, the lack of a page title also indicates that it’s the main
page.) Also, it has ever been the case since dd00aa5a601e that no page
title is visible on the main page (before 9a39d1e492, an empty <h1>
was present, now nothing will be added).

Bug: T296109
Change-Id: I1e79dc385c4dbe8413bcb32a52b8675aabf8eea0
2021-11-20 12:57:57 +01:00
jenkins-bot 88ff252e77 Merge "Fix banners to show CentralNotice" 2021-11-19 18:02:52 +00:00
Clare Ming dddde1c208 Fix banners to show CentralNotice
- Restore init of banner array to include needed selector.

Bug: T296077
Change-Id: Id1cec46eadcd057062c791a30db8ca40b35224b9
2021-11-19 10:17:12 -07:00
bwang ef4aa95ae2 Remove primary/secondary menu items, instead add a separate log out menu item
Bug: T293041
Change-Id: I9f73fdba1856dd9e0ea7120df0fb18061337961a
2021-11-18 19:51:33 +00:00
jdlrobson dd52f75a13 Remove SkinMinerva class properties
Follow up 7530f1c with some refactors
to remove the $pageActionsMenu and
$contentNavigationUrls properties by
calling once in getTemplateData

Bug: T293815
Change-Id: Ia7877abbecf41bbae7627ce7924d0f0871efa479
2021-11-12 22:34:20 +00:00
Clare Ming 7530f1c145 Remove MinervaTemplate class
- Update SkinMinerva class to output data previously handled by MinervaTemplate.
- Update relevant templates with updated data keys.

Bug: T293815
Change-Id: I33df396b07c4d2d9c1c5743d90dc54cdbd3345af
2021-11-12 11:39:58 -07:00
jenkins-bot 280b7b28f7 Merge "Fix empty title for logged-out users using Minerva skin" 2021-11-12 16:32:29 +00:00
jenkins-bot 3b53c0e129 Merge "Use the message "portal" as the label for the "portal-url" link" 2021-11-12 16:24:24 +00:00
jenkins-bot 5f42f3f76a Merge "Instrument mobile talk page clicks" 2021-11-08 19:20:56 +00:00
jdlrobson 1acb3542a5 Instrument mobile talk page clicks
This results in log events for clicking the following on a talk page:
* Read as wiki page
* Section headings
* the "add section" button

To test install WikimediaEvents and set
$wgWMEMobileWebUIActionsTracking = 1;

Bug: T294738
Change-Id: I8dbad7f4e72cfd081896480ba142b4e1e3029bcd
2021-11-08 09:17:29 -08:00
xiplus ef22a69a28 Use the message "portal" as the label for the "portal-url" link
At this time, the label is the same as "portal-url". It's not allow
to localize. Use "portal" as the label.
The code is copied from insertDisclaimersItem() in the same file.

Bug: T239022
Change-Id: I1d3bc04333aabcf8c704241ca882d6b863b98968
2021-11-08 14:53:50 +08:00
xiplus 9a39d1e492 Fix empty title for logged-out users using Minerva skin
Do not set page title to empty string if user is logged out

Bug: T265892
Change-Id: I38172860a6e4b58f772cc6713a0fd07f5d8524ea
2021-11-08 12:17:24 +08:00
Gagah Pangeran Rosfatiputra 00b06825c8
Add move, delete, and protect options on mobile AMC user page
Turns out user page is using UserNamespaceOverflowBuilder instead of
DefaultOverflowBuilder.

This change is added move, delete, and protect entries to
UserNamespaceOverflowBuilder::getGroup, so those options would appear in
overflow menu on user page.

Bug: T283549
Change-Id: I8a22b57aaa195773ae9e82bd1e01f323a2c0e6e1
2021-11-06 09:59:42 +07:00
jdlrobson 1f2b7dff15 Minerva uses desktop footer for license
After this change, in desktop Minerva the copyright
text in the footer should match desktop Minerva.

In mobile Minerva the copyright text in the footer
is shortened and doesn't contain terms of use.
It should match Vector mobile
?useskin=vector&useformat=mobile

Depends-On: I3473908e08f643b4c60aafc470dd124516955323
Change-Id: I2895975aaa1d09d228f80aff74381e88034a0137
Bug: T289401
2021-11-03 18:38:44 +00:00
Sai Suman Cherukuwada 3a9f60cbeb Removed calls to MinervaPreRender hook.
Bug: T289281
Change-Id: Ied0d2069dd8bb6bad67233272365674840743062
2021-11-03 16:45:23 +00:00
Clare Ming b308c91b50 Fix spacing between icon + text in main menu
Bug: T292452
Change-Id: Idc603ccaeeb42f60899059ebb51226e8a20a969d
2021-11-01 16:33:07 -06:00
Clare Ming 55189058be Move history link data into SkinMinerva::getTemplateData and relevant template
- Remove usage/references to MinervaTemplate::getHistoryLinkHtml, html-minerva-lastmodified
- Add data key for history.mustache template.
- Update footer template to use new data key.

Bug: T292554
Change-Id: Id5fbf61ba181a0088a25e77175b808362963c63b
2021-11-01 21:04:12 +00:00
bwang 50a5253684 Remove whitespace from anon talk message warning
Bug: T284642
Change-Id: I65d03ffa5b3e8a7a855ba5adb3cc90e74c83ad96
2021-10-28 18:11:26 +00:00
jenkins-bot b4f947a625 Merge "Update anon talk messages to show on non-main namespaces" 2021-10-27 23:52:19 +00:00
bwang a2d065c062 Update anon talk messages to show on non-main namespaces
- Loads messageBox styles on non-main namespaces
- Add messageBox styles to 'skins.minerva.scripts' module for MobileFrontend's edit overlay page
- Prevent warning box from showing with empty message

Bug: T284642
Change-Id: I70d0d86671384210cc3ab43cb1d350ff2a862fd9
2021-10-27 21:29:42 +00:00
jenkins-bot 2ee31b0096 Merge "Refactor SkinMinerva::getSecondaryActions to match getPageActions()" 2021-10-26 22:49:16 +00:00
bwang 2be42b314f Refactor SkinMinerva::getSecondaryActions to match getPageActions()
Change-Id: Ia87fb08204be56e665cd97c57e6ac7df4cb1a02d
2021-10-26 22:24:04 +00:00
jenkins-bot 36729aafd8 Merge "Add yellow talk page message warning to non-main namespace pages" 2021-10-26 16:39:38 +00:00
bwang b4fd1498bc Add yellow talk page message warning to non-main namespace pages
Bug: T284642
Change-Id: I2895975efe1d09d228f80aff74381e88034a0137
2021-10-26 10:44:28 -05:00
jdlrobson b41c7ca7be Inline PageActionsMenu template
Avoid usage of an additional TemplateParser

Bug: T293813
Change-Id: I1cef873d8a3226c9180a0731834f0ecf961f7ece
2021-10-25 16:02:08 -07:00
jenkins-bot 2a60efef79 Merge "Remove MinervaTemplate::getSecondaryActions" 2021-10-25 19:32:53 +00:00
bwang 95abf6b9af Remove MinervaTemplate::getSecondaryActions
Bug: T291875
Change-Id: Iefff2007c561adfd5886f9c0521341b3922e7653
2021-10-22 14:11:54 -05:00
jdlrobson 17968826fa Move components files up one level into Skins directory
Follow up to I4c2e115451c0a76c742734730712814c1f1d838d.
This will allow us to load the templates directly into skin.mustache
via {{>PartialName}}

Templates partials can only be resolved relative to the folder given
to the TemplateParser.

Change-Id: I5783d49c25d2efcf4781dd912500bf8b413b8cb6
2021-10-22 18:45:38 +00:00
jdlrobson c407d92d5d Remove getPageActionsHtml and related methods
Bug: T293813
Change-Id: I90e45cac13a13c2ce18af16274e327d951868433
2021-10-22 07:42:56 -07:00
jdlrobson 5a7a9c9c31 Drop wgMinervaPageActions
Remove code per spike outcome (T226490#7438685)

- This configuration option is never used in Wikimedia production
- isTalkAllowed content body is merged into isAllowed. Resulting code
is more readable.
- isAllowed('talk') still returns false on main page for anonymous users
which is the current behavior. Even on sv.m.wikipedia.org where talk pages
are shown to anonymous users, we do not show the talk page on the main page.
Add a comment pointing to the associated phabricator ticket

Bug: T226490
Change-Id: I9f34817c5ad654a6a66fe6156850a3e3fee881a7
2021-10-21 17:25:37 +00:00
jdlrobson 894364a3eb Restore title to mobile skin without logo
Bug: T290525
Change-Id: I6eb120a08d15b308d2a4df99900ab86042612b0c
2021-10-21 15:16:14 +00:00
bwang c1ea154af8 Generate Minerva search HTML with SkinMustache data
Bug: T290525
Change-Id: I68cde34a41a610872a585f5548dbaf66e3515443
2021-10-18 10:44:15 -05:00
jenkins-bot 04e5372713 Merge "Revert "Generate Minerva search HTML with SkinMustache data"" 2021-10-15 23:06:19 +00:00
Jdlrobson f9214f8ad5 Revert "Generate Minerva search HTML with SkinMustache data"
This reverts commit ecd35774b1.

Reason for revert: Logo has disappeared on beta cluster.
The Logo template was using data-logos, and
the addition of the data-search-box section broke this. Given its
a Friday, probably best to revert the patch and reapply again.

Change-Id: Id517d32b20b6512b9b2e1fffab012522dfd7b618
2021-10-15 22:43:07 +00:00
jdlrobson a7b66f6f63 Remove MinervaTemplate::getContentHtml
* Move method to SkinMinerva
* Turn preparePageContent into a getter that returns the subject
page
* Use getSubjectPage in template

For mobile special pages this now means the page has two .content elements
On those pages I've disabled the initial content element. It also means
various .content <heading> and .content ul  rules now apply that need to be
disabled.

While testing several other issues were taken care of - for example
the h2 in errors

Depends-On: I7761396d6a33830f279742be01240796573556a7
Bug: T291871
Change-Id: I13bc4b5dae7aed86eca31ef306212365e1759481
2021-10-15 20:49:23 +00:00
bwang ecd35774b1 Generate Minerva search HTML with SkinMustache data
Bug: T290525
Depends-on: I175ae29310a7432212a7b9c1c68dac9923665536
Change-Id: I53ea154b815a52e1e2e80a2e7b7114e310e74d47
2021-10-15 10:15:58 -05:00
bwang 9a4caa7631 Use skin.json to define messages instead of MinervaTemplate
Bug: T290343
Change-Id: I8daef594ac9efb80f07437c5d8ef5459c37e2ff3
2021-10-12 15:30:58 +00:00
jdlrobson aba173efc6 Remove non-standard components folder
For skins, all templates should be in the same folder. This
is for security reasons, to limit access of templates to files
that are not templates. This also adds consistency with other skins
where templates are all in the same subdirectory. It also allows
us to reduce the creation of TemplateParser instances.

Note: All styles and scripts should be in the resources folder but this
is not rectified by this patchset. Will be done in follow ups following
more discussion.

This begins this work in the least disruptive way possible and drops
the README note to avoid this pattern growing.

Bug: T292558
Change-Id: I4c2e115451c0a76c742734730712814c1f1d838d
2021-10-06 20:13:48 +00:00
Nicholas Ray 6067d2689b Change footer logo from a heading element to a div
Also, remove old CSS selector that was preserved for caching.

Bug: T288362
Change-Id: Iab3531229b64e0b9ee9268f6480a1417872d6107
2021-09-27 15:04:55 -06:00
jdlrobson f49eefbf84 Improve support in Minerva for addPortletLink
* Use skin registration and set skin options as and when needed
* Set link text-wrapper
* Simplify addPortletLink hook
* Update modifications to apply to items added prior to the hook

Bug: T240910
Change-Id: Ic806adf3de6490ba9da11e8968a61b3d0acd93bc
2021-09-23 22:05:36 +00:00
Nicholas Ray 6df49e3da4 Add alt attribute to logo
* Adds alt attribute with a value of the `mobile-frontend-sitename`
(previously called `mobile-frontend-footer-sitename`). The message was
changed because this affects both the footer and the header's logo.

* Adds a `minerva-footer-logo` class to the logo in footer.mustache in
preparation for changing that element from an h2 to a div. Given caching
issues (old CSS with new HTML; new CSS with old HTML are both
possibilities), we need to do this in two separate deploy cycles.

Bug: T288362
Change-Id: I3ecbf8fdcae72a0ded7f60c559259f312b8ef15d
2021-09-22 02:01:42 +00:00
jdlrobson 2794ea10dc Allow overriding of icon
For consistency with other methods, a mechanism for overriding
the home page icon is provided.

Bug: T291423
Change-Id: I7fb2e23cf10a75ed37e333f166f93111283f7f3e
2021-09-20 12:51:56 -07:00
jdlrobson 5263b09397 Standardize use of buttons and icons in Minerva
* Adds button hover/focus states to all Minerva button icons
* Removes the deprecated mw-ui-icon-before selector

Depends-On: I4eb28eae4c4e23d58f1f85bc41c0caf77197d8a1
Bug: T288678
Change-Id: I490534f9f704a733191b459c8ee071848c436001
2021-09-17 15:36:54 +00:00
jdlrobson 3564c70994 Logo scales with font size
Bug: T207789
Depends-On: Ie86a5b59fbf93a400796a4cac3724207830092b5
Change-Id: Ibbdf8b75246367e60532626879f33c0876118fe1
2021-09-08 22:32:39 +00:00
Ammarpad f9ab46b917 Remove unused template data
* internalBanner
* prebodyhtml

Bug: T290342
Change-Id: Ibd4d3f07e120874160274ce3295c788fdd33a7a5
2021-09-07 06:37:20 +00:00
jdlrobson e42bfd1e96 [refactor] Use core template variable for subtitle
Avoid indirection to QuickTemplate variable by using
SkinMinerva (SkinMustache) version.

To test:
* Create User:Admin/sandbox
* Create User:Admin
* Visit User:Admin/sandbox to see the breadcrumb "< User:Admin"

Change-Id: Icdd10bd1406ea047097309b6fcafba399170d019
2021-08-19 12:40:13 -07:00
Nicholas Ray 46ac6048d7 Use text-overflow: ellipsis on .mw-ui-icon-before span elements
Placing the text overflow on the span instead of the anchor element
prevents issues like T287522#7272991 from occurring.

Additionally:

* Uses the `text-overflow` mixin on every toggle list item label instead
of just the user link item as it simplifies the logic and presumably
we'd want any text that overflows the menu to be handled the same.

* Changes the anchor element to use flexbox/align-items to vertically
center instead of relying on `vertical-align` both the span and the
icon. Eventually, this should be put into core (see
I029f97ba9d5e7f46c8aa175d9a6bbb45ef9615df) but we have to remove all the
overrides that use vertical-align first.

Bug: T287522
Change-Id: Ie0fbff9dfaf8444c76125df52931a687730b4ad1
2021-08-12 14:04:46 -06:00
jenkins-bot 29fc9d18ad Merge "Avoid using User::getBoolOption()" 2021-08-04 21:52:33 +00:00
libraryupgrader 218151025e build: Updating dependencies
composer:
* mediawiki/mediawiki-codesniffer: 36.0.0 → 37.0.0

npm:
* svgo: 2.3.0 → 2.3.1
  * https://npmjs.com/advisories/1754 (CVE-2021-33587)
* postcss: 7.0.35 → 7.0.36
  * https://npmjs.com/advisories/1693 (CVE-2021-23368)
* ws: 7.4.5 → 7.5.3
  * https://npmjs.com/advisories/1748 (CVE-2021-32640)
* trim-newlines: 3.0.0 → 3.0.1
  * https://npmjs.com/advisories/1753 (CVE-2021-33623)
* normalize-url: 4.5.0 → 4.5.1
  * https://npmjs.com/advisories/1755 (CVE-2021-33502)
* prismjs: 1.23.0 → 1.24.1
  * https://npmjs.com/advisories/1762 (CVE-2021-32723)

Change-Id: Idfecb28ef49b193ba78b3f7b1335d4d5cb2862cd
2021-07-23 18:37:41 +00:00
jdlrobson ca18ad75d3 minerva-header class is now in cached HTML, remove old header class
This completes the migration from header to minerva-header

Bug: T172626
Change-Id: Ibb86359e683e08d86091f855e3813a99e0ad2cee
2021-07-20 18:36:39 +00:00