Difference between revisions of "Template:Managed"

From Dashboard samenwerking Wijchen
m (1 revision imported)
m
 
Line 1: Line 1:
<noinclude>
+
<noinclude>{{Managed
 +
|Version=1.8
 +
|Version notes=1.8 - Added checking for "Hide=Yes" to simple managed version
 +
1.7 - Moved to the basics module and made simplified version for when you don't have "Module management module"
 +
1.6 - Feature names in the form field for picking a feature now have format "<module name>: <feature name>"
 +
1.5 - Added option to show different initial tabs (button, view or form). This is for example used by [[Template:New]], so the managed form tab opens by default when you create a new managed item
 +
1.4 - Added Widget:Plain in the form for Short description and Version notes, so you can use links there
 +
1.3 - Plus module + Uses managed items
 +
1.2 - Added a WSForm form for modifying managed info on a managed page, including a select field for feature.
 +
1.1 - Set col parameters for the ''Form item responsive'' template to 2-10 (it has different default values on different wikis)
 +
1.0 - First managed managed template!
 +
|Short description=<div style="color:red;">{{fa|warning}} If you want to modify this template, please modify the version on
 +
[https://care.wikibase.nl/index.php/Template:Managed '''Care'''] and then copy from there.<br>
 +
{{fa|warning}} Do not edit the managed info of this template through the form!</div>
 +
Use this template to add management info to managed pages, such as version and version notes.
 +
|Uses managed items=Widget:Plain; Template:Managed/Alerts; Template:Managed/Info tab
 +
|Feature=Wiki:Feature/1530870851
 +
}}
 +
 
 +
This is the "Managed" template.
 +
It should be called in the following format:
 +
 
 +
<div class="mb-0">Minimum recommended parameters</div>
 
<pre>
 
<pre>
 
{{Managed
 
{{Managed
|Version=
+
|Version=  
|Version notes=
+
|Version notes=  
|Status=
 
 
|Short description=
 
|Short description=
 
}}
 
}}
 
</pre>
 
</pre>
  
</noinclude><includeonly>{{#set:
+
<div class="mb-0">All possible parameters</div>
| Class=Managed item
+
<pre>
| Name={{{Name|{{PAGENAME}} }}}
+
{{Managed
| Type of managed item={{NAMESPACE}}
+
|Name= Optional, name of managed item. Name property is set to pagename if name parameter is empty
| Version={{{Version|}}}
+
|Version= Version number
| Short description={{{Short description|}}}
+
|Version notes= Add version notes for each version. Begin each note on a new line (no bullets).
 +
|Short description= Short description of the managed item
 +
|Feature= Feature documentation page, you can add this through a form on your managed page
 +
|Uses managed items=e.g. Template:...; Widget:...; Module:...;
 +
|Status= Optional. Status property is set to 'Live' if this is empty. Status can be 'Testing'/'Live'/'Deprecated'. Only managed pages with status=Live should be shown in overviews (this might not be up to date everywhere yet)
 +
|Hide= <Yes / ...> If set to Yes, managed info is not shown on the page, only properties are set. By default, info is already hidden in Main and MediaWiki namespaces. This setting is only necessary in rare cases, such as the header page, to prevent header managed info from being shown when you are on a template page.
 
}}
 
}}
{| class="table"
+
</pre>
! Current version
+
 
| {{{Version|}}}
+
This template can also be used on pages in other namespaces than the "Template" namespace. In all cases the template sets the managed properties. Managed information is also shown on the page for most namespaces, except for the Main and MediaWiki namespaces.
|-
+
 
! Version notes
+
'''Vardefines in this template:'''<br>
| {{{Version notes|}}}
+
* @cols for managed
|-
+
* @initial managed tab
! Short description
+
** can have values Button, View or Form
| {{{Short description|}}}
+
 
|}
+
</noinclude><includeonly><!--
</includeonly>
+
 
 +
Check if "Module management module" page exists. If it doesn't, do simple version of managed
 +
-->{{#ifexist:Wiki:Module/00013
 +
|{{#set: Name={{#if:{{{Name|}}}|{{{Name|}}}|{{PAGENAME}} }}
 +
|Class=Managed item
 +
|Type of managed item={{#if:{{NAMESPACE}}|{{NAMESPACE}}|Main}}<!-- when in main namespace, {{NAMESPACE}} is empty -->
 +
|Version={{{Version|}}}
 +
|Version notes={{#vardefineecho:@notes|<ul>{{#arraymap:{{{Version notes|}}} |\n|@@@|<li>@@@</li>|}}</ul>}}
 +
|Short description={{{Short description|}}}
 +
|Status of managed item={{#if:{{{Status|}}}|{{{Status|}}}|Live}}
 +
|Belongs to feature={{{Feature|}}}
 +
|Uses managed items={{{Uses managed items|}}} |+sep=;
 +
}}<!--
 +
 
 +
-->{{#ifingroup:sysop|{{#ifeq:{{{Hide|}}}|Yes
 +
|
 +
|{{#vardefine:@initial managed tab|{{#switch:{{NAMESPACE}}
 +
|MediaWiki=<!-- do not display anything on the page when in the MediaWiki namespace -->
 +
|Wiki
 +
|=Button<!-- only show button in Wiki and main namespace -->
 +
|#default=View<!--
 +
-->}}<!-- end of #switch namespace
 +
-->}}<!-- end of #vardefine @initial managed tab
 +
 
 +
-->{{#ifeq:{{#urlget:tab}}|Form|{{#vardefine:@initial managed tab|Form}} }}<!--
 +
 
 +
--><!--{{Managed/Alerts}}--><!--
 +
 
 +
-->{{#vardefine:@cols for managed |2-10}}<!--
 +
 
 +
VIEW AND EDIT TABS FOR MANAGED INFO
 +
 
 +
TAB WITH LINK TO SHOW VIEW TAB (for pages where you want to hide managed info by default but still be able to access it)
 +
--><div class="tab-content mb-3"><!--
 +
--><div id="tab-managed-button" class="tab-pane fade {{#ifeq:{{#var:@initial managed tab}}|Button|in active}}"><!--
 +
-->{{#widget:Link|datatoggle=tab|type=a|href=#tab-display-managed|text={{Fa|eye}} Show managed info}}<!--
 +
--></div><!--
 +
 
 +
VIEW TAB
 +
--><div id="tab-display-managed" class="tab-pane fade {{#ifeq:{{#var:@initial managed tab}}|View|in active}}"><!--
 +
 
 +
-->{{Managed/Info tab
 +
|Status={{{Status|Live}}}
 +
|Version={{{Version|}}}
 +
|Short description={{{Short description|}}}
 +
|Feature={{{Feature|}}}
 +
|Uses managed items={{{Uses managed items|}}}
 +
}}<!--
 +
 
 +
--></div><!-- / #tab-display
 +
 
 +
EDIT TAB
 +
--><div id="tab-form-managed" class="tab-pane fade {{#ifeq:{{#var:@initial managed tab}}|Form|in active}}"><!--
 +
--><wsform id="managed-form" class="ws-test-form" action="addToWiki" mwreturn="{{fullurl:{{FULLPAGENAME}} }}" >
 +
<wsedit target={{PAGEID}} template="Managed" formfield="Version" />
 +
<wsedit target={{PAGEID}} template="Managed" formfield="Version notes" />
 +
<wsedit target={{PAGEID}} template="Managed" formfield="Short description" />
 +
<wsedit target={{PAGEID}} template="Managed" formfield="Feature" />
 +
<wsedit target={{PAGEID}} template="Managed" formfield="Status" />
 +
<wsedit target={{PAGEID}} template="Managed" formfield="Uses managed items" />
 +
 
 +
<div class="mb-3">{{Form item responsive |Cols={{#var:@cols for managed}}
 +
|1=Status
 +
|2={{#tag:wsselect |
 +
  {{#tag:wsfield| |type=option|value= }}
 +
  {{#arraymap: {{#show:Property:Status of managed item |?Allows value}} | , |@@Status@@ |
 +
  {{#tag:wsfield|@@Status@@|type=option|value=@@Status@@|selected={{#ifeq:{{{Status|Live}}}|@@Status@@|"selected"| }}<!--end ifeq-->}} }}
 +
  |name=Status
 +
  |class=form-control
 +
  }}
 +
}}</div>
 +
 
 +
<div class="mb-3">{{Form item responsive |Cols={{#var:@cols for managed}}
 +
|1=Current version
 +
|2={{#tag:wsfield| |type=text |name=Version |class=form-control |value={{{Version|}}} }}
 +
}}</div>
 +
 
 +
<div class="mb-3">{{Form item responsive |Cols={{#var:@cols for managed}}
 +
|1=Version notes
 +
|2={{#tag:wsfield |{{#widget:Plain|text={{{Version notes|}}} }} |type=textarea |rows=4 |name=Version notes |class=form-control}}
 +
}}</div>
 +
 
 +
<div class="mb-3">{{Form item responsive |Cols={{#var:@cols for managed}}
 +
|1=Short description
 +
|2={{#tag:wsfield |{{#widget:Plain|text={{{Short description|}}} }}|type=textarea |rows=4 |name=Short description |class=form-control}}
 +
}}</div>
 +
 
 +
<div class="mb-3">{{Form item responsive |Cols={{#var:@cols for managed}}
 +
|1=Feature
 +
|2={{#tag:wsselect |
 +
  {{#tag:wsfield| |type=option|value= }}
 +
  {{#arraymap: {{#ask:[[Class::Feature]]|sort=Is part of module,Name |link=none}} | , |@@Feature@@ |
 +
  {{#tag:wsfield|{{Map feature pagename to module and feature names|1=@@Feature@@}}|type=option|value=@@Feature@@|selected={{#ifeq:{{{Feature|}}}|@@Feature@@|"selected"| }}<!--end ifeq-->}} }}
 +
  |name=Feature
 +
  |class=form-control
 +
}}
 +
}}
 +
</div>
 +
 
 +
<div class="mb-3">{{Form item responsive |Cols={{#var:@cols for managed}}
 +
|1=Uses managed items
 +
|2=List managed items used by this managed item. Separate them by ";", for example: Template:New managed; Template:Property
 +
{{#tag:wsfield |{{{Uses managed items|}}} |type=textarea |rows=4 |name=Uses managed items |class=form-control}}
 +
}}</div>
 +
 
 +
{{#widget:Link|datatoggle=tab|type=a |href=#tab-display-managed|text=Back|class=btn btn-primary}}
 +
<wsfield type="submit" class="btn btn-warning" value="Save" />
 +
</wsform>
 +
</div><!-- / #tab-form -->
 +
</div><!-- / .tab-content
 +
 
 +
END OF VIEW AND EDIT TABS FOR MANAGED INFO
 +
 
 +
-->}}<!-- end of #ifeq Hide=Yes
 +
-->}}<!-- end of #ifingroup:sysop
 +
 
 +
If "Module management module" page does not exist, then simple managed:
 +
-->|{{#set:Class=Managed item
 +
|Version={{{Version|}}}
 +
|Version notes={{#vardefineecho:@notes|<ul>{{#arraymap:{{{Version notes|}}} |\n|@@@|<li>@@@</li>|}}</ul>}}
 +
|Short description={{{Short description|}}}
 +
}}<!--
 +
 
 +
-->{{#ifingroup:sysop|{{#ifeq:{{{Hide|}}} |Yes |<!-- if Yes, do nothing -->|<!-- else show managed info
 +
--><small class="text-uppercase">[[Wiki:Managed items|Managed item]]</small>
 +
{{Item responsive
 +
|1=Version
 +
|2={{{Version|}}}
 +
}}{{Item responsive
 +
|1=Version notes
 +
|2={{#var:@notes}}
 +
}}{{Item responsive
 +
|1=Short description
 +
|2={{{Short description|}}}
 +
}}
 +
}} }}<!-- end of #ifingroup:sysop
 +
 
 +
-->}}<!-- end of #ifexist:Wiki:Module/00013
 +
--></includeonly>

Latest revision as of 14:15, 18 December 2018


This is the "Managed" template. It should be called in the following format:

Minimum recommended parameters
{{Managed
|Version= 
|Version notes= 
|Short description=
}}
All possible parameters
{{Managed
|Name= Optional, name of managed item. Name property is set to pagename if name parameter is empty
|Version= Version number
|Version notes= Add version notes for each version. Begin each note on a new line (no bullets).
|Short description= Short description of the managed item
|Feature= Feature documentation page, you can add this through a form on your managed page
|Uses managed items=e.g. Template:...; Widget:...; Module:...;
|Status= Optional. Status property is set to 'Live' if this is empty. Status can be 'Testing'/'Live'/'Deprecated'. Only managed pages with status=Live should be shown in overviews (this might not be up to date everywhere yet)
|Hide= <Yes / ...> If set to Yes, managed info is not shown on the page, only properties are set. By default, info is already hidden in Main and MediaWiki namespaces. This setting is only necessary in rare cases, such as the header page, to prevent header managed info from being shown when you are on a template page. 
}}

This template can also be used on pages in other namespaces than the "Template" namespace. In all cases the template sets the managed properties. Managed information is also shown on the page for most namespaces, except for the Main and MediaWiki namespaces.

Vardefines in this template:

  • @cols for managed
  • @initial managed tab
    • can have values Button, View or Form