This repository has been archived on 2023-10-01. You can view files and clone it, but cannot push or open issues or pull requests.
PyNyaaTa/templates/admin/edit.html

102 lines
4.4 KiB
HTML
Raw Normal View History

2019-12-09 11:10:57 +00:00
{% extends "layout.html" %}
2019-12-12 13:38:48 +00:00
{% block title %}Admin Edit {{ link.name }}{% endblock %}
2019-12-09 11:10:57 +00:00
{% block body %}
2019-12-11 13:45:55 +00:00
<form method="post" action="{{ url_for('admin_save') }}">
2019-12-10 21:19:31 +00:00
{{ edit_form.csrf_token }}
{{ edit_form.id(value=link.id) }}
2019-12-09 11:10:57 +00:00
2019-12-10 21:19:31 +00:00
<div class="field is-horizontal">
<div class="field-body">
<div class="field column">
<div class="control is-expanded">
<div class="select is-fullwidth">
{{ edit_form.folder }}
</div>
</div>
</div>
<div class="field column is-6">
<div class="control is-expanded">
<div class="select is-fullwidth">
{{ edit_form.name(value=link.title.name, list='animes', class='input', placeholder='Name') }}
<datalist id="animes">
{% for title in titles %}
2019-12-11 20:03:25 +00:00
<option {{ 'selected' if title.id == link.title.id }}
data-folder-id="{{ title.folder.id }}" value="{{ title.name }}"
data-keyword="{{ title.keyword }}">
2019-12-10 21:19:31 +00:00
{% endfor %}
</datalist>
2019-12-11 20:03:25 +00:00
<script>
document.getElementById('name').oninput = function (choice) {
2019-12-11 20:04:20 +00:00
document.getElementById('animes').childNodes.forEach(function (option) {
2019-12-11 20:03:25 +00:00
if (option.value === choice.target.value) {
document.getElementById('folder').value = option.dataset.folderId;
document.getElementById('keyword').value = option.dataset.keyword;
}
});
};
</script>
2019-12-10 21:19:31 +00:00
</div>
</div>
</div>
</div>
</div>
<div class="field is-horizontal">
<div class="field-body">
<div class="field column is-4">
<div class="control is-expanded">
{{ edit_form.link(value=link.link, class='input', placeholder='Link') }}
</div>
</div>
<div class="field column">
<div class="control is-expanded">
{{ edit_form.season(value=link.season, class='input', placeholder='Season') }}
</div>
</div>
</div>
</div>
<div class="field is-horizontal">
<div class="field-body">
<div class="field column is-5">
<div class="control is-expanded">
2019-12-11 18:11:50 +00:00
{{ edit_form.comment(value=link.comment, class='input', placeholder='Comment') }}
2019-12-10 21:19:31 +00:00
</div>
</div>
<div class="field column">
<div class="control is-expanded">
2019-12-11 18:11:50 +00:00
<div class="select is-fullwidth">
{{ edit_form.keyword(value=link.title.keyword, list='keywords', class='input', placeholder='Keyword') }}
<datalist id="keywords">
{% for title in titles %}
2019-12-11 20:03:25 +00:00
<option {{ 'selected' if title.keyword == link.title.keyword }}
value="{{ title.keyword }}">
2019-12-11 18:11:50 +00:00
{% endfor %}
</datalist>
</div>
2019-12-10 21:19:31 +00:00
</div>
</div>
<label class="checkbox">
<b>{{ true|flagify }}</b>
{{ edit_form.is_vf(value=link.vf) }}
</label>
</div>
</div>
<div class="field is-horizontal">
<div class="field-body">
<div class="field column">
<div class="control is-expanded">
<input class="button is-info" type="submit" onclick="this.disabled=true;this.form.submit()">
</div>
</div>
</div>
</div>
</form>
2019-12-09 11:10:57 +00:00
{% endblock %}