update.html
1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
{% extends 'subject/index.html' %}
{% load static i18n permission_tags widget_tweaks django_bootstrap_breadcrumbs %}
{% block breadcrumbs %}
{{ block.super }}
{% breadcrumb 'Update subject' 'course:update_subject' %}
{% endblock breadcrumbs %}
{% block content %}
<div class="panel panel-default">
<div class="panel-body">
<form class="form-group " method="post" action="">
{% csrf_token %}
{% for field in form %}
<div class="form-group {% if field.errors %} has-error{% endif %}">
<label for="{{ field.auto_id }}" class="control-label label-static"> {{ field.label }}</label>
{% if field.auto_id == 'id_init_date' or field.auto_id == 'id_end_date'%}
<input type="text" class="form-control date-picker" name="{{field.name}}" value="{{field.value|date:'SHORT_DATE_FORMAT'}}" min="{{now|date:'SHORT_DATE_FORMAT'}}">
{% else %}
{% render_field field class='form-control' placeholder=field.label%}
{% endif %}
<span class="help-block">{{ field.help_text }}</span>
</div>
{% endfor %}
<div class="col-lg-offset-4 col-lg-4">
<button type="submite" class="btn btn-raised btn-primary btn-lg btn-block">{% trans 'Update' %}</button>
</div>
</form>
</div>
</div>
<script type="text/javascript">
var locale = navigator.language || navigator.userLanguage;
$('.date-picker').datepicker({
language: locale,
});
</script>
{% endblock content %}