{% extends 'TopxiaWebBundle::bootstrap-modal-layout.html.twig' %}

{% block title %}{% if knowledge.id %}编辑知识点{% else %}添加知识点{% endif %}{% endblock %}

{% block body %}
<div id="knowledge-creater-widget">

	<form id="knowledge-form" class="form-horizontal" action="{% if knowledge.id %}{{ path('admin_knowledge_edit', {id:knowledge.id}) }}{% else %}{{ path('admin_knowledge_create') }}{% endif %}" method="post">
		<div class="form-group">
			<label class="col-md-3 control-label" for="knowledge-name-field">名称</label>
			<div class="col-md-8 controls">
				<input class="form-control" id="knowledge-name-field" type="text" name="name" value="{{ knowledge.name }}" tabindex="1">
			</div>
		</div>

		<div class="form-group">
			<label class="col-md-3 control-label" for="knowledge-description-field">知识点描述</label>
			<div class="col-md-8 controls">
				<textarea class="form-control" id="knowledge-description-field" style="height:100px;" name="description" tabindex="4">{{knowledge.description}}</textarea>
				<div class="help-block">非必填</div>
			</div>
		</div>

		<input type="hidden" name="id" value="{{ knowledge.id }}">
		<input type="hidden" name="tid" value="{{ knowledge.tid }}">
		<input type="hidden" name="sequence" value="{{ knowledge.sequence }}">
		<input type="hidden" name="subjectId" value="{{ knowledge.subjectId }}">
		<input type="hidden" name="materialId" value="{{ knowledge.materialId }}">
		<input type="hidden" name="gradeId" value="{{ knowledge.gradeId }}">
		<input type="hidden" name="term" value="{{ knowledge.term }}">
		<input type="hidden" name="parentId" value="{{ knowledge.parentId }}">
		<input type="hidden" name="_csrf_token" value="{{ csrf_token('site') }}">
	</form>
</div>
<script type="text/javascript"> app.load('knowledge/save-modal') </script>
{% endblock %}

{% block footer %}

  	<button type="button" class="btn btn-link" data-dismiss="modal" tabindex="6">取消</button>
	<button id="knowledge-create-btn" data-submiting-text="正在提交" type="submit" class="btn btn-primary" data-toggle="form-submit" data-target="#knowledge-form" tabindex="5">保存</button>
{% endblock %}