You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

102 lines
3.2 KiB

{% extends 'myadmin/base.html' %}
{% load static %}
{% load thumbnail %}
{% block content %}
<div class="ui grid">
<div class="row">
<h3>视频编辑</h3>
</div>
<div class="ui divider"></div>
<div class="row">
<div class="v-form-wrap">
<form class="ui form" novalidate method="post" action="{% url 'myadmin:video_edit' form.instance.pk %}"
enctype="multipart/form-data" role="form">
{% csrf_token %}
<input name="video_id" id="video_id" type="hidden">
<div class="field">
<label>视频标题</label>
{{ form.title }}
</div>
<div class="field">
<label>视频描述</label>
{{ form.desc }}
</div>
<div class="field">
<label>视频分类</label>
<div class="ui selection dropdown">
{{ form.classification }}
<i class="dropdown icon"></i>
<div class="default text">请选择</div>
<div class="menu">
{% for item in clf_list %}
<div class="item" data-value="{{item.id}}">{{item.title}}</div>
{% endfor %}
</div>
</div>
</div>
<div class="field">
<label>发布状态</label>
<div class="ui selection dropdown">
{{form.status}}
<i class="dropdown icon"></i>
<div class="default text">请选择</div>
<div class="menu">
<div class="item" data-value="0">发布</div>
<div class="item" data-value="1">取消发布</div>
</div>
</div>
</div>
<div class="field">
<label>视频封面</label>
{% thumbnail video.cover "300x200" crop="center" as im %}
<img class="ui small image" src="{{ im.url }}">
{% empty %}
{% endthumbnail %}
<div class="v-form-field">
<label class="ui large green label" for="id_cover">
<i class="upload icon"></i> 上传封面
{{form.cover}}
</label>
<span id="file_is_choose" class="n">文件已选择</span>
</div>
</div>
<button class="ui primary button" type="submit">保存</button>
{% include "base/form_errors.html" %}
{% include "base/form_messages.html" %}
</form>
</div>
</div>
</div>
{% endblock content %}
{% block modal %}
{% endblock modal %}
{% block javascript %}
<script>
$(function(){
$('.ui .dropdown').dropdown();
$("#id_cover").change(function(){
$("#file_is_choose").show()
});
});
</script>
{% endblock javascript %}