Difference between revisions of "Template:Resource info"

From SNIC Documentation
Jump to: navigation, search
(Created page with "<noinclude> This template creates a standard info blurb for a resource, and registers the relevant categories and properties. Will protest loudly in bold red if mandatory informa...")
 
 
(12 intermediate revisions by the same user not shown)
Line 2: Line 2:
 
This template creates a standard info blurb for a resource, and registers the relevant categories and properties. Will protest loudly in bold red if mandatory information is missing. If you do not wish to provide a certain piece of required information: do not use this template. Or else you will corrupt the database with incorrect information.
 
This template creates a standard info blurb for a resource, and registers the relevant categories and properties. Will protest loudly in bold red if mandatory information is missing. If you do not wish to provide a certain piece of required information: do not use this template. Or else you will corrupt the database with incorrect information.
  
Usage: <nowiki>{{</nowiki>resource info|''description''=|''centre''=|''name''=<nowiki>{{PAGENAME}}}}</nowiki>
+
Usage: <nowiki>{{</nowiki>resource info|''description''=|''centre''=|''name''=|''is active''=|''start date''=|''end date''=<nowiki>{{PAGENAME}}}}</nowiki>
 +
 
 +
All the parameters are named, and can be given in any order. ''description'' should be a shortest-possible style description of what the resource is, eg. it should fit into the second formatter of "%s is a %s." (note absence of capital first letter, leading word "a", and ending full stop character). ''commissioning date'' and ''decommissioning date'' specify when the resource opened and started accepting jobs from users, and when it will close (optional). ''active'' states whether or not the project is currently considered to be active, and is used both to simplify queries and to handle corner cases in an explicit manner. ''name'' defaults to <nowiki>{{PAGENAME}}</nowiki> and should in principle never have to be set to anything else.
  
All the parameters are named, and can be given in any order. The only readable text produced by this template is <nowiki>"{{{name}}} is {{{description}}}, and is located at {{{centre}}}."</nowiki>, and even this can be suppressed by setting ''quiet''=true. ''name'' defaults to <nowiki>{{PAGENAME}}</nowiki> and should in principle never have to be set to anything else.
 
  
 
Example:
 
Example:
Line 10: Line 11:
 
<pre>
 
<pre>
 
{{resource info
 
{{resource info
|description=a capability cluster resource of 250 Tflops with full bisection interconnect
+
|description=capability cluster resource of 60 Tflops with full bisection interconnect
 
|centre=NSC
 
|centre=NSC
|software=a comma separated list of pagenames for installed software
+
|is active=yes
 +
|start date=2007
 +
|end date=
 +
|software=Blast,HMMER,Gaussian
 
}}
 
}}
 
</pre>
 
</pre>
Line 18: Line 22:
 
</noinclude><includeonly>{{#ifeq: {{{quiet}}}|true|
 
</noinclude><includeonly>{{#ifeq: {{{quiet}}}|true|
 
{{#set: name={{{name|{{PAGENAME}}}}}|description={{{description}}}|centre={{{centre}}}}}{{#if: {{{description|}}}||<span style="font-weight: bold; color: red;">ERROR: No description.</span>}}{{#if: {{{centre|}}}||<span style="font-weight: bold; color: red;">ERROR: No centre.</span>}}|
 
{{#set: name={{{name|{{PAGENAME}}}}}|description={{{description}}}|centre={{{centre}}}}}{{#if: {{{description|}}}||<span style="font-weight: bold; color: red;">ERROR: No description.</span>}}{{#if: {{{centre|}}}||<span style="font-weight: bold; color: red;">ERROR: No centre.</span>}}|
[[name::{{{name|{{PAGENAME}}}}}]] is [[description::{{{description|<span style="font-weight: bold; color: red;">ERROR</span>}}}]], and is located at [[centre::{{{centre|<span style="font-weight: bold; color: red;">ERROR</span>}}}]].}}{{set list|software|{{{software|}}}|sep=,|quiet=true}}
+
{{resource info table|name={{{name|{{PAGENAME}}}}}|description={{{description|}}}|resource type={{{resource type|}}}|centre={{{centre|}}}|is active={{{is active|}}}|start date={{{start date|}}}|end date={{{end date|}}}}}
 +
}}{{set list|software|{{{software|}}}|sep=,|quiet=true}}
 
[[Category:Resource]]</includeonly>
 
[[Category:Resource]]</includeonly>

Latest revision as of 11:53, 18 September 2013

This template creates a standard info blurb for a resource, and registers the relevant categories and properties. Will protest loudly in bold red if mandatory information is missing. If you do not wish to provide a certain piece of required information: do not use this template. Or else you will corrupt the database with incorrect information.

Usage: {{resource info|description=|centre=|name=|is active=|start date=|end date={{PAGENAME}}}}

All the parameters are named, and can be given in any order. description should be a shortest-possible style description of what the resource is, eg. it should fit into the second formatter of "%s is a %s." (note absence of capital first letter, leading word "a", and ending full stop character). commissioning date and decommissioning date specify when the resource opened and started accepting jobs from users, and when it will close (optional). active states whether or not the project is currently considered to be active, and is used both to simplify queries and to handle corner cases in an explicit manner. name defaults to {{PAGENAME}} and should in principle never have to be set to anything else.


Example:

{{resource info
|description=capability cluster resource of 60 Tflops with full bisection interconnect
|centre=NSC
|is active=yes
|start date=2007
|end date=
|software=Blast,HMMER,Gaussian
}}