Template:HubHeader: Difference between revisions
More actions
Add <templatedata> for Visual Editor Usage. |
Removed "Default License" |
||
| Line 1: | Line 1: | ||
<div class="hub-container" style="margin-bottom: 24px;"><div class="hub-header-minimal" style="background: var(--color-surface-1); border: 1px solid var(--border-color-base); border-radius: 4px 4px 0 0; padding: 24px; text-align: left; border-bottom: none;"><div style="display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 20px;"><div style="flex: 1; min-width: 300px;"><div style="font-size: 1.8em; font-weight: 800; color: var(--color-base); margin-bottom: 4px; letter-spacing: -0.01em;">{{{title|Title Text}}}</div><div style="font-size: 0.9em; color: var(--wiki-primary); font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 12px;">{{{subtitle|Subtitle Text}}}</div><div style="font-size: 1em; color: var(--color-base); line-height: 1.6; max-width: 850px; opacity: 0.9;">{{{description|}}}</div></div>{{#if:{{{category|}}}|<div style="background: var(--color-surface-2); border: 1px solid var(--border-color-base); padding: 16px 24px; border-radius: 4px; text-align: center; min-width: 140px; box-shadow: inset 0 1px 2px rgba(0,0,0,0.03); flex-shrink: 0;"><div style="font-size: 0.7em; text-transform: uppercase; font-weight: 800; color: var(--color-base--subtle); letter-spacing: 0.08em; margin-bottom: 4px;">{{{count_label|Projects}}}</div><div style="font-size: 2em; font-weight: 900; color: var(--color-base); line-height: 1;">{{PAGESINCATEGORY:{{{category}}}|pages}}</div></div>|}}</div></div><div class="hub-banner" style="background: var(--color-surface-1); border: 1px solid var(--border-color-base); border-radius: 0 0 4px 4px; padding: 0; overflow: hidden;"><div class="hub-toolbar" style="display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); width: 100%; border-top: 1px solid var(--border-color-base); box-sizing: border-box;">{{#if:{{{submit_form|}}}|[[Special:FormStart/{{{submit_form|}}}|<span style="display: flex; align-items: center; justify-content: center; height: 100%; background: var(--wiki-primary); color: #fff; padding: 12px 6px; font-size: 0.75em; font-weight: 700; text-align: center; text-transform: uppercase; border-right: 1px solid var(--border-color-base); letter-spacing: 0.05em; box-sizing: border-box;">+ Submit</span>]]|}} [[:Category:{{{category|{{PAGENAME}}}}}|<span style="display: flex; align-items: center; justify-content: center; height: 100%; background: var(--color-surface-2); color: var(--color-base); padding: 12px 6px; font-size: 0.75em; font-weight: 700; text-align: center; text-transform: uppercase; border-right: 1px solid var(--border-color-base); letter-spacing: 0.05em; box-sizing: border-box;">Full Index</span>]] [[Project:Submission Guidelines|<span style="display: flex; align-items: center; justify-content: center; height: 100%; background: var(--color-surface-2); color: var(--color-base); padding: 12px 6px; font-size: 0.75em; font-weight: 700; text-align: center; text-transform: uppercase; border-right: 1px solid var(--border-color-base); letter-spacing: 0.05em; box-sizing: border-box;">Submission Rules</span>]] [[Project:Licenses|<span style="display: flex; align-items: center; justify-content: center; height: 100%; background: var(--color-surface-2); color: var(--color-base); padding: 12px 6px; font-size: 0.75em; font-weight: 700; text-align: center; text-transform: uppercase; border-right: 1px solid var(--border-color-base); letter-spacing: 0.05em; box-sizing: border-box;">License Options</span>]] [[{{TALKPAGENAME}}|<span style="display: flex; align-items: center; justify-content: center; height: 100%; background: var(--color-surface-2); color: var(--color-base); padding: 12px 6px; font-size: 0.75em; font-weight: 700; text-align: center; text-transform: uppercase; border-right: 1px solid var(--border-color-base); letter-spacing: 0.05em; box-sizing: border-box;">Moderators</span>]] [[Special:PrefixIndex/Template:{{{hub_type|Project}}}|<span style="display: flex; align-items: center; justify-content: center; height: 100%; background: var(--color-surface-2); color: var(--color-base); padding: 12px 6px; font-size: 0.75em; font-weight: 700; text-align: center; text-transform: uppercase; border-right: 1px solid var(--border-color-base); letter-spacing: 0.05em; box-sizing: border-box;">Templates</span>]] [[Project:Community|<span style="display: flex; align-items: center; justify-content: center; height: 100%; background: var(--color-surface-2); color: var(--color-base); padding: 12px 6px; font-size: 0.75em; font-weight: 700; text-align: center; text-transform: uppercase; border: none; letter-spacing: 0.05em; box-sizing: border-box;">Community</span>]]</div><div class="hub-metadata" style="display: flex; flex-wrap: wrap; gap: 24px; font-size: 0.82em; align-items: center; border-top: 1px solid var(--border-color-base); padding: 14px 24px; background: var(--color-surface-1);" | <div class="hub-container" style="margin-bottom: 24px;"><div class="hub-header-minimal" style="background: var(--color-surface-1); border: 1px solid var(--border-color-base); border-radius: 4px 4px 0 0; padding: 24px; text-align: left; border-bottom: none;"><div style="display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 20px;"><div style="flex: 1; min-width: 300px;"><div style="font-size: 1.8em; font-weight: 800; color: var(--color-base); margin-bottom: 4px; letter-spacing: -0.01em;">{{{title|Title Text}}}</div><div style="font-size: 0.9em; color: var(--wiki-primary); font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 12px;">{{{subtitle|Subtitle Text}}}</div><div style="font-size: 1em; color: var(--color-base); line-height: 1.6; max-width: 850px; opacity: 0.9;">{{{description|}}}</div></div>{{#if:{{{category|}}}|<div style="background: var(--color-surface-2); border: 1px solid var(--border-color-base); padding: 16px 24px; border-radius: 4px; text-align: center; min-width: 140px; box-shadow: inset 0 1px 2px rgba(0,0,0,0.03); flex-shrink: 0;"><div style="font-size: 0.7em; text-transform: uppercase; font-weight: 800; color: var(--color-base--subtle); letter-spacing: 0.08em; margin-bottom: 4px;">{{{count_label|Projects}}}</div><div style="font-size: 2em; font-weight: 900; color: var(--color-base); line-height: 1;">{{PAGESINCATEGORY:{{{category}}}|pages}}</div></div>|}}</div></div><div class="hub-banner" style="background: var(--color-surface-1); border: 1px solid var(--border-color-base); border-radius: 0 0 4px 4px; padding: 0; overflow: hidden;"><div class="hub-toolbar" style="display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); width: 100%; border-top: 1px solid var(--border-color-base); box-sizing: border-box;">{{#if:{{{submit_form|}}}|[[Special:FormStart/{{{submit_form|}}}|<span style="display: flex; align-items: center; justify-content: center; height: 100%; background: var(--wiki-primary); color: #fff; padding: 12px 6px; font-size: 0.75em; font-weight: 700; text-align: center; text-transform: uppercase; border-right: 1px solid var(--border-color-base); letter-spacing: 0.05em; box-sizing: border-box;">+ Submit</span>]]|}} [[:Category:{{{category|{{PAGENAME}}}}}|<span style="display: flex; align-items: center; justify-content: center; height: 100%; background: var(--color-surface-2); color: var(--color-base); padding: 12px 6px; font-size: 0.75em; font-weight: 700; text-align: center; text-transform: uppercase; border-right: 1px solid var(--border-color-base); letter-spacing: 0.05em; box-sizing: border-box;">Full Index</span>]] [[Project:Submission Guidelines|<span style="display: flex; align-items: center; justify-content: center; height: 100%; background: var(--color-surface-2); color: var(--color-base); padding: 12px 6px; font-size: 0.75em; font-weight: 700; text-align: center; text-transform: uppercase; border-right: 1px solid var(--border-color-base); letter-spacing: 0.05em; box-sizing: border-box;">Submission Rules</span>]] [[Project:Licenses|<span style="display: flex; align-items: center; justify-content: center; height: 100%; background: var(--color-surface-2); color: var(--color-base); padding: 12px 6px; font-size: 0.75em; font-weight: 700; text-align: center; text-transform: uppercase; border-right: 1px solid var(--border-color-base); letter-spacing: 0.05em; box-sizing: border-box;">License Options</span>]] [[{{TALKPAGENAME}}|<span style="display: flex; align-items: center; justify-content: center; height: 100%; background: var(--color-surface-2); color: var(--color-base); padding: 12px 6px; font-size: 0.75em; font-weight: 700; text-align: center; text-transform: uppercase; border-right: 1px solid var(--border-color-base); letter-spacing: 0.05em; box-sizing: border-box;">Moderators</span>]] [[Special:PrefixIndex/Template:{{{hub_type|Project}}}|<span style="display: flex; align-items: center; justify-content: center; height: 100%; background: var(--color-surface-2); color: var(--color-base); padding: 12px 6px; font-size: 0.75em; font-weight: 700; text-align: center; text-transform: uppercase; border-right: 1px solid var(--border-color-base); letter-spacing: 0.05em; box-sizing: border-box;">Templates</span>]] [[Project:Community|<span style="display: flex; align-items: center; justify-content: center; height: 100%; background: var(--color-surface-2); color: var(--color-base); padding: 12px 6px; font-size: 0.75em; font-weight: 700; text-align: center; text-transform: uppercase; border: none; letter-spacing: 0.05em; box-sizing: border-box;">Community</span>]]</div><div class="hub-metadata" style="display: flex; flex-wrap: wrap; gap: 24px; font-size: 0.82em; align-items: center; border-top: 1px solid var(--border-color-base); padding: 14px 24px; background: var(--color-surface-1);"><div style="color: var(--color-base);"><span style="font-weight: 800; text-transform: uppercase; margin-right: 8px; letter-spacing: 0.05em; opacity: 0.7;">Last Submission</span><span id="hub-meta-last-submission" style="color: #007bff; font-weight: 700;">Loading...</span></div><div style="color: var(--color-base);"><span style="font-weight: 800; text-transform: uppercase; margin-right: 8px; letter-spacing: 0.05em; opacity: 0.7;">Activity</span><span id="hub-meta-last-edit" style="color: var(--wiki-primary); font-weight: 700;">Loading...</span></div></div></div></div><noinclude> | ||
== HubHeader == | == HubHeader == | ||
Displays the full header block for project and tutorial hub pages. Includes a title/subtitle/description area, optional live count badge, toolbar row with a Submit button and navigation links, and a metadata bar showing default license and live activity (populated by [[MediaWiki:Gadget-projects.js]] or [[MediaWiki:Gadget-tutorials.js]]). | Displays the full header block for project and tutorial hub pages. Includes a title/subtitle/description area, optional live count badge, toolbar row with a Submit button and navigation links, and a metadata bar showing default license and live activity (populated by [[MediaWiki:Gadget-projects.js]] or [[MediaWiki:Gadget-tutorials.js]]). | ||
| Line 104: | Line 104: | ||
"default": "Project", | "default": "Project", | ||
"suggestedvalues": ["ProjectCard", "TutorialCard"], | "suggestedvalues": ["ProjectCard", "TutorialCard"], | ||
"required": false | "required": false | ||
} | } | ||
Revision as of 02:39, 2 April 2026
HubHeader
Displays the full header block for project and tutorial hub pages. Includes a title/subtitle/description area, optional live count badge, toolbar row with a Submit button and navigation links, and a metadata bar showing default license and live activity (populated by MediaWiki:Gadget-projects.js or MediaWiki:Gadget-tutorials.js).
Usage — Projects hub
{{HubHeader
| title = Audio Projects
| subtitle = Music, sound design, and anything audio
| description = Any openly licensed audio project — sound FX, music, field recordings, podcasts, etc.
| category = Projects/Audio
| count_label = Audio Projects
| submit_form = Submit_Project
| hub_path = Projects/Audio
| hub_type = ProjectCard
| license = CC-BY-SA 4.0
}}
Usage — Tutorials hub
{{HubHeader
| title = Community Tutorials
| subtitle = Step-by-step guides written by the community
| description = Browse tutorials by topic below.
| category = Tutorials
| count_label = Tutorials
| submit_form = Submit_Tutorial
| hub_path = Tutorials
| hub_type = TutorialCard
| license = CC-BY-SA 4.0
}}
Parameters
title- Main heading. Defaults to "Title Text".
subtitle- Orange uppercase subtitle. Defaults to "Subtitle Text".
description- Optional body paragraph below the subtitle.
category- If provided, shows a live count badge using
PAGESINCATEGORY(e.g.Projects/Audio). count_label- Label above the count badge. Defaults to "Projects".
submit_form- If provided, adds an orange "+ Submit" button linking to
Special:FormStart/FormName. hub_path- Path for the "Full Index" button. Defaults to current page name.
hub_type- Template name for the "Templates" toolbar button. Defaults to "Project".
license- Default license shown in the metadata bar. Defaults to "CC-BY-SA 4.0".
Notes
- "Last Submission" and "Activity" in the metadata bar are populated by JavaScript gadgets.
- The toolbar links to Project:Submission Guidelines, Project:Licenses, the page's talk page, and Project:Community — create these pages to avoid red links.
Displays the full header block for a project or tutorial hub page, including title, count badge, toolbar, and a live metadata bar.
| Parameter | Description | Type | Status | |
|---|---|---|---|---|
| Title | title | Main heading for the hub page.
| String | optional |
| Subtitle | subtitle | Orange uppercase subtitle shown below the title.
| String | optional |
| Description | description | Optional body paragraph below the subtitle. Supports wikitext. | Content | optional |
| Category | category | Category name for the live count badge (e.g. Projects/Audio). | String | optional |
| Count label | count_label | Label shown above the count badge.
| String | optional |
| Submit form | submit_form | PageForms form name for the orange Submit button (e.g. Submit_Project or Submit_Tutorial).
| String | optional |
| Hub path | hub_path | Path used for the Full Index toolbar button. Defaults to the current page name. | Page name | optional |
| Hub type | hub_type | Template name linked in the Templates toolbar button.
| String | optional |