67 lines
2.8 KiB
HTML
Executable File
67 lines
2.8 KiB
HTML
Executable File
{% extends "base.html" %}
|
|
{% block content %}
|
|
<h1 class="page-title">{{ name }}</h1>
|
|
<div class="panel">
|
|
{% if !error.is_empty() %}<p class="err">{{ error }}</p>{% endif %}
|
|
<form method="post" action="/assets/{{ id }}">
|
|
<input type="hidden" name="_csrf" value="{{ ctx.csrf }}">
|
|
<div class="grid-2">
|
|
<div class="formrow"><label>Name</label><input name="name" value="{{ name }}" required></div>
|
|
<div class="formrow"><label>Typ</label>
|
|
<select name="ci_typ">
|
|
{% for o in typ_opts %}<option value="{{ o.value }}" {% if o.selected %}selected{% endif %}>{{ o.label }}</option>{% endfor %}
|
|
</select>
|
|
</div>
|
|
</div>
|
|
<div class="grid-2">
|
|
<div class="formrow"><label>Status</label>
|
|
<select name="status">
|
|
{% for o in status_opts %}<option value="{{ o.value }}" {% if o.selected %}selected{% endif %}>{{ o.label }}</option>{% endfor %}
|
|
</select>
|
|
</div>
|
|
<div class="formrow"></div>
|
|
</div>
|
|
<div class="formrow"><label>Beschreibung</label><textarea name="beschreibung">{{ beschreibung }}</textarea></div>
|
|
<div class="formrow"><label>Attribute (ein "Schluessel: Wert" je Zeile)</label>
|
|
<textarea name="attribute" style="min-height:100px">{{ attribute }}</textarea></div>
|
|
<button class="btn" type="submit">Speichern</button>
|
|
</form>
|
|
</div>
|
|
|
|
<h2 class="section-title">Beziehungen</h2>
|
|
<div class="panel">
|
|
<h3 style="margin-top:0">Ausgehend</h3>
|
|
{% for r in rel_out %}
|
|
<div class="tl-item">{{ r.typ }} <b>{{ r.name }}</b>
|
|
<form method="post" action="/assets/{{ id }}/relationships/{{ r.id }}/delete" class="inline-form">
|
|
<input type="hidden" name="_csrf" value="{{ ctx.csrf }}">
|
|
<button class="btn ghost mini" type="submit">x</button>
|
|
</form>
|
|
</div>
|
|
{% endfor %}
|
|
{% if rel_out.is_empty() %}<p class="sz">Keine ausgehenden Beziehungen.</p>{% endif %}
|
|
<h3>Eingehend</h3>
|
|
{% for r in rel_in %}
|
|
<div class="tl-item">{{ r.typ }} <b>{{ r.name }}</b> <span class="sz">(eingehend)</span></div>
|
|
{% endfor %}
|
|
{% if rel_in.is_empty() %}<p class="sz">Keine eingehenden Beziehungen.</p>{% endif %}
|
|
<h3>Neue Beziehung</h3>
|
|
<form method="post" action="/assets/{{ id }}/relationships">
|
|
<input type="hidden" name="_csrf" value="{{ ctx.csrf }}">
|
|
<div class="grid-2">
|
|
<div class="formrow"><label>Beziehungstyp</label>
|
|
<select name="beziehungs_typ">
|
|
{% for o in rel_typ_opts %}<option value="{{ o.value }}">{{ o.label }}</option>{% endfor %}
|
|
</select>
|
|
</div>
|
|
<div class="formrow"><label>Ziel-CI</label>
|
|
<select name="to_ci_id">
|
|
{% for o in other_cis %}<option value="{{ o.value }}">{{ o.label }}</option>{% endfor %}
|
|
</select>
|
|
</div>
|
|
</div>
|
|
<button class="btn ghost" type="submit">Hinzufuegen</button>
|
|
</form>
|
|
</div>
|
|
{% endblock %}
|