-
Notifications
You must be signed in to change notification settings - Fork 398
/
commands.html
95 lines (79 loc) · 3.73 KB
/
commands.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
---
layout: page
title: Commands
permalink: /commands
---
<script src="{{- 'assets/js/filter.js' | relative_url -}}"></script>
<link rel="stylesheet" href="{{- 'assets/css/core.css' | relative_url -}} "/>
<script src="https://www.kryogenix.org/code/browser/sorttable/sorttable.js"></script>
{%- assign showCommands = site.data.commands.size -%}
{%- assign buy = "" -%}
{%- assign commands_sorted = site.data.commands | sort: "name" -%}
{%- for command in commands_sorted -%}
{%- if command.name == "Buy" -%}
{%- capture buy -%}
{{- command.usage | split: " " | first -}}
{%- endcapture -%}
{%- break -%}
{%- endif -%}
{%- endfor -%}
<div id="commands">
{%- if showCommands > 0 -%}
{%- include search.html
id='commands'
type='Command'
placeholder=site.data.language.search_commands -%}
<table class="sortable" style="display: table">
<thead>
<tr>
<th style="width: 35%">{{- site.data.language.command_name_header -}}</th>
{%- if site.commands.userlevel -%}
<th style="width: 18%">{{- site.data.language.user_level_header -}}</th>
{%- endif -%}
<th>{{- site.data.language.description_header -}}</th>
</tr>
</thead>
<tbody>
{%- for command in commands_sorted -%}
<tr>
<td id="{{- command.name | slugify -}}">
<a href="#{{- command.name | slugify -}}">{{- command.name -}}</a>
{%- if site.commands.mod -%}
<br/>
<span class="metadata">
{{- site.data.language.from | replace: '%s', command.data.mod -}}
</span>
{%- endif -%}
{%- if site.commands.usage -%}
<br/>
<span class="metadata">
{% capture usage %}
{{ command.usage | prepend: " " | replace: "(", "<" | replace: ")", ">" }}
{% endcapture %}
{{- site.data.language.usage | replace: '%s', usage -}}
</span>
{%- endif -%}
</td>
{%- if site.commands.userlevel -%}
<td>{{- command.userLevel -}}</td>
{%- endif -%}
<td>
{{- command.description -}}
{%- if site.commands.shortcut and command.shortcut -%}
<br/>
<span class="metadata">
{% capture shortcut %}
{{ buy }} {{ command.usage | slice: 1, command.usage.size | replace: "(" , "<" | replace: ")", ">" }}
{% endcapture %}
{{- site.data.language.shortcut | replace: '%s', shortcut -}}
</span>
{%- endif -%}
</td>
</tr>
{%- endfor -%}
</tbody>
</table>
{%- else -%}
<p style="text-align: center;">{{- site.data.languages.no_commands -}}</p>
{%- endif -%}
</div>