52 lines
2.0 KiB
HTML
52 lines
2.0 KiB
HTML
{% extends "_base.html" %}
|
|
|
|
{% block title %}Edit command{% endblock %}
|
|
|
|
{% block body %}
|
|
<ul class="breadcrumbs">
|
|
<li><a href="/">Home</a></li>
|
|
<li><a href="/commands">Commands</a></li>
|
|
<li class="current"><a href="/commands/edit/{{ command.id.to_simple() }}">Edit</a></li>
|
|
</ul>
|
|
|
|
<form action="/commands/edit" method="post">
|
|
<input type="hidden" name="id" value="{{ command.id }}"/>
|
|
<input type="text" name="name" placeholder="Name" value="{{ command.name }}"/>
|
|
<textarea name="aliases" placeholder="Aliases separated by newlines">{{ command.aliases.join("\n") }}</textarea>
|
|
<div>
|
|
{% let user %}
|
|
{% match command.cooldowns.user %}
|
|
{% when Some with (cd) %}
|
|
{% let user = cd.seconds_f64().to_string() %}
|
|
{% else %}
|
|
{% let user = "".to_string() %}
|
|
{% endmatch %}
|
|
<input type="number" step="0.01" name="cooldown" placeholder="Cooldown (s)" min="0" value="{{ user }}"/>
|
|
|
|
{% let global %}
|
|
{% match command.cooldowns.global %}
|
|
{% when Some with (cd) %}
|
|
{% let global = cd.seconds_f64().to_string() %}
|
|
{% else %}
|
|
{% let global = "".to_string() %}
|
|
{% endmatch %}
|
|
<input type="number" step="0.01" name="gcd" placeholder="GCD (s)" min="0" value = "{{ global }}"/>
|
|
</div>
|
|
{% match command.executor %}
|
|
{% when CommandExecutor::Text with (text) %}
|
|
<select name="type">
|
|
<option selected>Text</option>
|
|
<option>Rhai</option>
|
|
</select>
|
|
<textarea name="executor_data" placeholder="Text/script">{{ text }}</textarea>
|
|
{% when CommandExecutor::Rhai with (rhai) %}
|
|
<select name="type">
|
|
<option>Text</option>
|
|
<option selected>Rhai</option>
|
|
</select>
|
|
<textarea name="executor_data" placeholder="Text/script">{{ rhai }}</textarea>
|
|
{% endmatch %}
|
|
<button type="submit">Edit</button>
|
|
</form>
|
|
{% endblock %}
|