srd/views/tables.dot

254 lines
6.7 KiB
Plaintext

{{##def.weapons_table_entry:item:
<tr data-json='{{=JSON.stringify(item)}}'>
<td><a href="/gear/weapon/{{=item.name||''}}"</a>{{=item.name || ''}}</td>
<td>{{=item.description || ''}}</td>
<td>{{=item.attack || ''}}</td>
<td>
{{~item.damage :damage}}
{{=damage.type || 'unknown'}}
{{=damage.value || '0' }}
{{~}}
</td>
<td>{{=item.weapontype || ''}}</td>
<td>{{=item.range || ''}}</td>
<td>{{=item.radius || ''}}</td>
<td>{{=item.capacity || ''}}</td>
<td>{{=item.duration || ''}}</td>
<td>{{=item.properties || ''}}</td>
<td>{{=item.worth || ''}}</td>
</tr>
#}}
{{##def.weapons_table:it:
<table>
<thead>
<tr>
<th><a href="?sort-by=name">Name</a></th>
<th>Description</th>
<th><a href="?sort-by=attack">Attack</a></th>
<th><a href="?sort-by=damage">Damage</a></th>
<th><a href="?sort-by=weapontype">Type</a></th>
<th><a href="?sort-by=range">Range</a></th>
<th>Radius</th>
<th>Capacity</th>
<th>Duration</th>
<th>Properties</th>
<th><a href="?sort-by=worth">Worth</a></th>
</tr>
</thead>
<tbody>
{{~it :item:index}}
{{#def.weapons_table_entry:item || ''}}
{{~}}
</tbody>
</table>
#}}
{{##def.armor_table_entry:item:
<tr data-json='{{=JSON.stringify(item)}}'>
<td><a href="/gear/armor/{{=item.name||''}}"</a>{{=item.name || ''}}</td>
<td>{{=item.description || ''}}</td>
<td>
{{~item.defense :defense}}
{{=defense.type || 'unknown'}}
{{=defense.value || '0' }}
{{? defense.perfect }}+ {{?}}
{{~}}
</td>
<td>{{=item.properties || ''}}</td>
<td>{{=item.worth || ''}}</td>
</tr>
#}}
{{##def.armor_table:it:
<table>
<thead>
<tr>
<th><a href="?sort-by=name">Name</a></th>
<th>Description</th>
<th>Defense</th>
<th>Properties</th>
<th><a href="?sort-by=worth">Worth</a></th>
</tr>
</thead>
<tbody>
{{~it :item:index}}
{{#def.armor_table_entry:item || ''}}
{{~}}
</tbody>
</table>
#}}
{{##def.misc_table_entry:item:
<tr data-json='{{=JSON.stringify(item)}}'>
<td><a href="/gear/misc/{{=item.name||''}}"</a>{{=item.name || ''}}</td>
<td>{{=item.description || ''}}</td>
<td>{{=item.properties || ''}}</td>
<td>{{=item.worth || ''}}</td>
</tr>
#}}
{{##def.misc_table:it:
<table>
<thead>
<tr>
<th><a href="?sort-by=name">Name</a></th>
<th>Description</th>
<th>Properties</th>
<th><a href="?sort-by=worth">Worth</a></th>
</tr>
</thead>
<tbody>
{{~it :item:index}}
{{#def.misc_table_entry:item || ''}}
{{~}}
</tbody>
</table>
#}}
{{##def.consumables_table_entry:item:
<h3><a href="/db/consumables/{{=item.name || ''}}">{{=item.name || ''}}</a> <span data-json='{{=JSON.stringify(item)}}'></span> </h3>
<p>{{=item.description || ''}}</p>
{{?item.properties.length}}
{{~item.properties :property}}
<strong><em>{{=property.name}}</em></strong>:
{{=property.description}}
<br/>
{{~}}
{{?}}
{{?item.range}}
<strong>Range</strong> {{=item.range}};
{{?}}
{{?item.radius}}
<strong>Radius</strong> {{=item.radius}};
{{?}}
{{?item.duration}}
<strong>Duration</strong> {{=item.duration}};
{{?}}
{{?item.worth}}
<strong>Worth</strong> {{=item.worth}};
{{?}}
<br/>
{{?item.damage.length}}
<strong>Damage</strong>
{{~item.damage :damage}}
{{=damage.value || '0' }}({{=damage.type || 'unknown'}})
{{~}}
{{?}}
#}}
{{##def.consumables_table:it:
Sort: <a href="?sort-by=name">Name</a> <a href="?sort-by=worth">Worth</a>
{{~it :item:index}}
{{#def.consumables_table_entry:item || ''}}
{{~}}
#}}
{{##def.entry:it:
<h1>{{=it.name || ''}}</h1>
<dl>
{{~ ["attack", "damage", "damagetype", "range", "radius", "capacity", "duration", "properties"] :k}}
{{? it[k] }}
{{? k === 'damagetype' }}
<dt>damage type</dt>
{{?? true }}
<dt>{{=k || ''}}</dt>
{{?}}
<dd>{{=it[k] || ''}}</dd>
{{?}}
{{~}}
</dl>
#}}
{{##def.specimens_table_entry:item:
<h2><a href="/db/specimens/{{=item.type||''}}/{{=item.name || ''}}">{{=item.name || ''}}</a><span data-json='{{=JSON.stringify(item)}}'></span> </h2>
<p>{{=item.description || ''}}</p>
<strong>Move</strong> {{=item.move || ''}};
<strong>Attack</strong> {{=item.attack || ''}};
<strong>Health</strong> {{=item.health || ''}} (<a href="#" data-flip="+{{=item.health}}"></a>);
<strong>CV</strong> {{=item.combatvalue || ''}}
<h3>Attacks</h3>
{{~item.attacks :attack}}
<h4> {{=attack.name || 'unknown'}} ({{=attack.attacktype || 'melee' }}) </h4>
<strong>Attack</strong>: {{=attack.attack || '0' }};
<strong>Damage</strong>:
{{~attack.damage :damage}}
{{=damage.value || '0' }}({{=damage.type || 'unknown'}})
{{~}};
<strong>Range</strong>: {{=damage.range || '-' }};
<strong>Radius</strong>: {{=damage.radius || '-' }}
<br/>
{{~attack.properties :prop}}
<strong>{{=prop.name || ''}}</strong>
<br/>
<p>{{=prop.description || ''}}</p>
{{~}}
{{~}}
<h3>Specials</h3>
{{~item.specials :special}}
<h4> {{=special.name || 'unknown'}} </h4>
<p> {{=special.description || ''}} </p>
{{~}}
#}}
{{##def.specimens_table:it:
{{~it :item:index}}
{{#def.specimens_table_entry:item || ''}}
{{~}}
#}}
{{? it.results }}
{{#def.entry:it.results[0] || ''}}
{{? it.collection === "gear" }}
<h1><a href="/db/gear/">Gear</a></h1>
{{? it.type }}
{{? it.type === "weapon"}}
<h2>Weapons</h2>
{{#def.weapons_table:it.results || ''}}
{{?? it.type === "armor"}}
<h2>Armor</h2>
{{#def.armor_table:it.results || ''}}
{{?? it.type === "consumable"}}
<h2>Consumables</h2>
{{#def.consumables_table:it.results || ''}}
{{?? it.type === "misc"}}
<h2>Misc</h2>
{{#def.misc_table:it.results || ''}}
{{?}}
{{?? true }}
<h2><a href="armor/">Armor</a></h2>
<h2><a href="misc/">Misc</a></h2>
<h2><a href="weapon/">Weapons</a></h2>
<h2><a href="consumable/">Consumables</a></h2>
{{?}}
{{?? it.collection === "specimens" }}
{{? it.type }}
<h1>Specimens: Hord</h1>
{{#def.specimens_table:it.results || ''}}
{{?? true }}
<h1>Specimens</h1>
TODO: listing
{{?}}
{{?}}
{{?? !it.name }}
{{? it.type === "weapon"}}
<h1>Weapons</h1>
{{#def.weapons_table:it.results || ''}}
{{?? it.type === "consumable"}}
<h1>Consumables</h1>
{{#def.consumables_table:it.results || ''}}
{{?? true }}
Bad type
{{?}}
{{?? true }}
<h1>Gear</h1>
{{? it.db.weapons }}
<h2><a href="gear/weapons">Weapons</a></h2>
{{#def.weapons_table:it.db.weapons || ''}}
{{?}}
{{? it.db.consumables }}
<h2><a href="gear/consumables">Consumables</a></h2>
{{#def.consumables_table:it.db.consumables || ''}}
{{?}}
{{?}}