|
imported>Oetterer |
Zeile 1: |
Zeile 1: |
− | <includeonly><!-- this is an infobox commonly used on all service portal pages --><!-- | + | <includeonly><!-- this is an infobox commonly used on all service portal pages -->{{#invoke:Service portal|main}}</includeonly><noinclude> |
− | | |
− | 1. declaration of internal variables
| |
− | ------------------------------------
| |
− | -->{{#vardefine:service_description|{{{description|}}}}}{{#vardefine:label_defaulttargetgroup|Endbenutzer}}{{#vardefine:defaulttargetgroup|Angestellte, Gäste, Studierende}}{{#arraydefine:targetgroup_valid_values|{{#ask: [[Attribut:is written for target audience]] |?Allows value= |format=list |mainlabel=- }} }}{{#vardefine:servicename|{{BASEPAGENAME}}<!--end of vardefine-->}}<!--{{#vardefine:url2status|https://statusmeldungen.uni-paderborn.de/state.php?service{{=}}}}-->{{#vardefine:url2status|https://statusmeldungen.uni-paderborn.de/state/}}{{#vardefine:url2status_suffix|.png}}<!-- | |
− | | |
− | 2. parameter processing
| |
− | -----------------------
| |
− | -->{{#set:has short description={{#var:service_description|}}}}<!--
| |
− | | |
− | 2.1. image
| |
− | -->{{#vardefine:image|{{#if:{{{image|}}}|{{#ifeq:{{#sub:{{{image}}}|0|1}}|[|{{{image}}}|{{#if:{{#pos:{{{image}}}|.}}|[[Datei:{{{image}}}]]|{{#var:url2status}}{{{image}}}{{#var:url2status_suffix|}}<!-- end of if pos-->}}<!-- end of ifeq:sub -->}}|[[Datei:Logo_{{BASEPAGENAME}}.png]]<!-- end of #if:{{{image|}}} else -->}}<!-- end of vardefine -->}}<!--
| |
− | | |
− | 2.2. targetgroup
| |
− | -->{{#if:{{{targetgroup|}}} |{{#arraydefine:input_targetgroup |{{{targetgroup}}} |,|sort=asc,unique}} |{{#arraydefine:input_targetgroup|{{#var:defaulttargetgroup}}}} <!-- end of {{#if:{{{targetgroup|}}}-->}}<!-- plausibilty check, fills semantics and variable targetgroup, or var:error_targetgroup if user entered incorrect value -->{{#vardefine:targetgroup|{{#arrayprint:input_targetgroup ||@@@@ |{{#if:{{#arraysearch:targetgroup_valid_values|@@@@}} |{{#set:is written for target audience=@@@@}}@@@@,|{{#vardefine:error_targetgroup |{{#var:error_targetgroup|}}@@@@,<nowiki> </nowiki>}}}}}}<!-- end of vardefine:targetgroup -->}}<!--now check, whether targetgroup contains all three types of internal users (var:defaulttargetgroup). if so, replace them with #var:label_defaulttargetgroup -->{{#arraydefine:input_targetgroup|{{#sub:{{#var:targetgroup}}|0|-1}}}}{{#ifeq:{{#arrayprint:input_targetgroup||@@@|{{#if:{{#pos:{{#var:defaulttargetgroup}}|@@@}}|1}}}}|111|<!-- filter! -->{{#vardefine:targetgroup|{{#arrayprint:input_targetgroup||@@@|{{#if:{{#pos:{{#var:defaulttargetgroup}}|@@@}}||@@@,}}}}{{#var:label_defaulttargetgroup}}}}|<!-- end of ifeq-->}}{{#arraydefine:output_targetgroup|{{#var:targetgroup}}|,|sort=asc,unique}}<!--
| |
− | | |
− | 2.3. glossary
| |
− | -->{{#if:{{#var:service_description|}}|{{yesno|{{{glossary|no}}}|yes={{#set:Glossary-Term={{#var:servicename}}|Glossary-Definition={{#var:service_description}}}}<!-- end of template:yesno -->}}<!-- end of {{#if:{{#var:service_description|}} -->}}<!--
| |
− | | |
− | 3. call the infobox
| |
− | --------------------------------
| |
− | | |
− | -->{{Infobox
| |
− | | title = {{#var:servicename}}
| |
− | | image = {{#var:image|Logo_{{#var:servicename}}.png}}
| |
− | | subheader = Ein Dienst des IMT
| |
− | | caption = {{#var:servicename}}
| |
− | | header1 = Informationen
| |
− | | label1 = Verantwortliche/r
| |
− | | data1 = {{{responsible|}}}
| |
− | | label2 = Zielgruppe
| |
− | | data2 = {{#arrayprint:output_targetgroup|,<nowiki> </nowiki>}}<!--{{#if:{{#var:targetgroup}}|{{#var:targetgroup|}}<nowiki> </nowiki>}} do some error-output if applicable -->{{#if: {{#var:error_targetgroup|}} |{{errortext|UNKNOWN TARGET GROUP(S): {{#sub:{{#var:error_targetgroup|}}|0 |-2 }} }} }}
| |
− | | data3 = {{#var:service_description|}}
| |
− | <!-- end of {{Infobox -->}}[[Category:Dienstportalseiten]]<!--
| |
− | | |
− | 4. start putting out some errorboxes, if applicable
| |
− | ---------------------------------------------------
| |
− | | |
− | -->{{#if:{{#var:error_targetgroup|}}|{{Template warning|UNKNOWN TARGET GROUP(S): ''{{#sub:{{#var:error_targetgroup|}}|0 |-2 }}''|Infobox_service}} }}</includeonly><noinclude>
| |
| {{documentation}} | | {{documentation}} |
| <!-- Add categories to the /doc subpage, not here! --> | | <!-- Add categories to the /doc subpage, not here! --> |
| </noinclude> | | </noinclude> |