swirl/views/stack/archive/edit.jet

93 lines
3.2 KiB
Go
Raw Normal View History

2017-09-26 12:50:09 +00:00
{{ extends "../../_layouts/default" }}
{{ block style() }}
2017-11-08 10:36:13 +00:00
<link rel="stylesheet" href="/assets/codemirror/codemirror.css?v=5.30">
2017-09-26 12:50:09 +00:00
{{ end }}
{{ block script() }}
2017-11-08 10:36:13 +00:00
<script src="/assets/codemirror/codemirror.js?v=5.30"></script>
<script src="/assets/codemirror/mode/yaml.js?v=5.30"></script>
2017-09-26 12:50:09 +00:00
<script>var editor = CodeMirror.fromTextArea(document.getElementById("txt-content"), {lineNumbers: true});</script>
{{ end }}
{{ block body() }}
<section class="hero is-info">
<div class="hero-body">
<div class="container has-text-centered">
<h1 class="title is-2 is-uppercase">{{ i18n("stack.title") }}</h1>
<h2 class="subtitle is-5">{{ i18n("stack.description") }}</h2>
2017-09-26 12:50:09 +00:00
</div>
</div>
<div class="hero-foot">
<div class="container">
<nav class="tabs is-boxed">
<ul>
<li>
<a href="/stack/task/">{{ i18n("menu.stack.task") }}</a>
2017-09-26 12:50:09 +00:00
</li>
<li class="is-active">
<a href="/stack/archive/">{{ i18n("menu.stack.archive") }}</a>
2017-09-26 12:50:09 +00:00
</li>
</ul>
</nav>
</div>
</div>
</section>
<div class="container">
<nav class="breadcrumb has-succeeds-separator is-small is-marginless" aria-label="breadcrumbs">
<ul>
<li><a href="/">{{ i18n("menu.dashboard") }}</a></li>
<li><a href="/stack/archive/">{{ i18n("menu.stack.archive") }}</a></li>
<li class="is-active"><a>{{ i18n("menu.edit") }}</a></li>
2017-09-26 12:50:09 +00:00
</ul>
</nav>
</div>
<section class="hero is-small is-light">
<div class="hero-body">
<div class="container">
<h2 class="title is-2">
{{ .Archive.Name }}
</h2>
</div>
</div>
</section>
<nav class="navbar has-shadow">
<div class="container">
<div class="navbar-brand">
<a class="navbar-item is-tab" href="/stack/archive/{{.Archive.ID}}/detail">{{ i18n("menu.detail") }}</a>
<a class="navbar-item is-tab is-active" href="/stack/archive/{{.Archive.ID}}/edit">{{ i18n("menu.edit") }}</a>
2017-09-26 12:50:09 +00:00
</div>
</div>
</nav>
<section class="section">
<div class="container">
<form method="post" action="update" data-form="ajax-json" data-url="/stack/archive/">
<input name="id" value="{{ .Archive.ID }}" type="hidden">
<div class="field">
<label class="label">{{ i18n("field.name") }}</label>
2017-09-26 12:50:09 +00:00
<div class="control">
<input name="name" class="input" value="{{ .Archive.Name }}" type="text" placeholder="" data-v-rule="native;regex" data-v-arg-regex="^[a-z0-9_-]+$" data-v-msg-regex="Name can contain only letters, digits, '_' and '-'." required>
</div>
</div>
<div class="field">
<label class="label">Content</label>
<div class="control">
<textarea id="txt-content" name="content" class="textarea code" rows="20" placeholder="Compose file content" data-v-rule="native" required>{{ .Archive.Content }}</textarea>
</div>
</div>
<div class="field is-grouped">
<div class="control">
<button type="submit" class="button is-primary">{{ i18n("button.submit") }}</button>
2017-09-26 12:50:09 +00:00
</div>
<div class="control">
<a href="/stack/archive/" class="button is-link">{{ i18n("button.cancel") }}</a>
2017-09-26 12:50:09 +00:00
</div>
</div>
</form>
</div>
</section>
{{ end }}