Difference between revisions of "CreateTopicTemplate"
Jump to navigation
Jump to search
Tim Holzheim (talk | contribs) |
Tim Holzheim (talk | contribs) |
||
(20 intermediate revisions by the same user not shown) | |||
Line 7: | Line 7: | ||
|since=2021/02/14 | |since=2021/02/14 | ||
|text=<pre> | |text=<pre> | ||
− | {% set pagetitle = ""%} | + | {% set pagetitle = "" %} |
{% set pagetitle_prefix = "Template:"%} | {% set pagetitle_prefix = "Template:"%} | ||
− | + | {%- set property_properties = [] -%} | |
− | {% set property_properties = []%} | + | {% for p in smw.query("[[Concept:Property]][[Property topic::Concept:Property]]|?Property name = name").values() %} |
− | {% for p in smw.query("[[Property topic:: | + | {%- set dump = property_properties.append(p["name"]) -%} |
− | {% | + | {%- endfor %} |
− | {% endfor %} | + | {%- set topic_properties = [] -%} |
− | + | {% for p in smw.query("[[Property topic::" + row.Topic + "]]|?Property name = name").values() %} | |
− | {% set topic_properties = []%} | + | {%- set dump = topic_properties.append(p["name"]) -%} |
− | {% for p in smw.query("[[Property topic:: | + | {%- endfor %} |
− | {% | ||
− | {% endfor %} | ||
<noinclude> | <noinclude> | ||
Line 24: | Line 22: | ||
<includeonly> | <includeonly> | ||
{% raw %} | {% raw %} | ||
− | + | {{#switch:{{{storemode|}}} | |
{% endraw %} | {% endraw %} | ||
|none= | |none= | ||
Line 36: | Line 34: | ||
|#default= | |#default= | ||
− | {{#set: | + | {{ '{{' }}#set: |
|isA={{ row.name }} | |isA={{ row.name }} | ||
{% for p in topic_properties%} | {% for p in topic_properties%} | ||
Line 45: | Line 43: | ||
{% raw %} | {% raw %} | ||
− | + | {{#switch: {{{viewmode|}}} | |
{% endraw %} | {% endraw %} | ||
|hidden= | |hidden= | ||
|masterdetail= | |masterdetail= | ||
− | + | = properties = | |
− | {{#ask:[[Concept:Property]][[Property topic::{{ | + | {{ '{{' }}#ask:[[Concept:Property]][[Property topic::{{row.Topic}}]] |
{% for p in property_properties%} | {% for p in property_properties%} | ||
− | | ?Property {{ p | + | |?Property {{ p }} = {{ p }} |
− | {% endfor %} | + | {%- endfor %} |
|sort=Property name | |sort=Property name | ||
|order=ascending | |order=ascending | ||
− | }} | + | {{' }}' }} |
− | |tableheader={{{!}} class='wikitable' | + | |tableheader={{ '{{{!}}' }} class='wikitable' |
{% for p in topic_properties%} | {% for p in topic_properties%} | ||
− | !{{ p | + | !{{ p }}! |
− | {% endfor %} | + | {%- endfor %} |
− | {{!}}- | + | {{ '{{!}}-' }} |
|tablerow= | |tablerow= | ||
{% for p in topic_properties%} | {% for p in topic_properties%} | ||
− | {{ '{{!}}{{{' }}{{p | + | {{ '{{!}}{{{' }}{{p}}{{ '|}}}{{!}}' }} |
− | {% endfor %} | + | {%- endfor %} |
- | - | ||
− | |tablefooter={{!}}} | + | |tablefooter={{ '{{!}}}' }} |
|labelfield= | |labelfield= | ||
{% for p in topic_properties%} | {% for p in topic_properties%} | ||
− | {{ p | + | {{ p }}={{ '={{#if:{{{' }}{{ p }}{{ '|}}}|{{{' }}{{ p }}{{ '|}}}|}}<br>' }} |
− | {% endfor %} | + | {%- endfor %} |
|#default= | |#default= | ||
{{ '{{{!}} ' }}class='wikitable' | {{ '{{{!}} ' }}class='wikitable' | ||
− | ! colspan='2' { '{{!}}' }{row.name} | + | ! colspan='2' {{ '{{!}}' }}{{row.name}} |
− | { '{{!}}' }- | + | {{ '{{!}}' }}- |
− | {{#switch:{{{storemode|}}} | + | {{ '{{#switch:{{{storemode|}}}' }} |
|property= | |property= | ||
− | ! colspan='2' style='text-align:left' { '{{!}}' } {{ '{{' }}Icon|name=edit|size=24{{ '}}' }}{{ '{{' }}Link|target=Special:FormEdit/{{ row.name }}/{{ '{{FULLPAGENAME}}' }}|title=edit{{ '}}' }} | + | ! colspan='2' style='text-align:left' {{ '{{!}}' }} {{ '{{' }}Icon|name=edit|size=24{{ '}}' }}{{ '{{' }}Link|target=Special:FormEdit/{{ row.name }}/{{ '{{FULLPAGENAME}}' }}|title=edit{{ '}}' }} |
− | { '{{!}}' }- | + | {{ '{{!}}' }}- |
− | }} | + | {{ '}}' }} |
{% for p in topic_properties%} | {% for p in topic_properties%} | ||
− | !{{ p | + | !{{ p }} |
{{ '{{!}}' }} | {{ '{{!}}' }} | ||
− | {{ ' {{#if:{{{' }}{{ p | + | {{ ' {{#if:{{{' }}{{ p }}{{ '|}}}|{{{' }}{{ p }}{{ '|}}}|}}' }} |
{{ '{{!}}-' }} | {{ '{{!}}-' }} | ||
{% endfor %} | {% endfor %} | ||
{{ '{{!}}}' }} | {{ '{{!}}}' }} | ||
− | {{ '}} | + | {{ '}}' }} |
</includeonly> | </includeonly> |
Latest revision as of 17:21, 14 February 2021
Sourcecode
Sourcecode | |
---|---|
id | CreateTopicTemplate |
lang | jinja |
author | Tim Holzheim |
since | 2021/02/14 |
test | '"`UNIQ--pre-00000000-QINU`"'
|
url |