diff --git a/categories/views.py b/categories/views.py index 011870c..a9201f9 100644 --- a/categories/views.py +++ b/categories/views.py @@ -198,7 +198,7 @@ class UpdateCategory(LogMixin, UpdateView): context['settings_menu_active'] = "settings_menu_active" else: context['template_extends'] = 'subjects/list.html' - context['subjects_menu_active'] = 'subjects_menu_active'; + context['subjects_menu_active'] = 'subjects_menu_active' return context diff --git a/subjects/forms.py b/subjects/forms.py index a9dad87..efeab0a 100644 --- a/subjects/forms.py +++ b/subjects/forms.py @@ -16,7 +16,6 @@ class CreateSubjectForm(forms.ModelForm): } - class CreateTagForm(forms.ModelForm): class Meta: model = Tag diff --git a/subjects/templates/subjects/subject_card.html b/subjects/templates/subjects/subject_card.html index a340693..da880c1 100644 --- a/subjects/templates/subjects/subject_card.html +++ b/subjects/templates/subjects/subject_card.html @@ -20,7 +20,7 @@ {% endif %} @@ -81,7 +81,7 @@ {% endif %} diff --git a/subjects/templates/subjects/update.html b/subjects/templates/subjects/update.html new file mode 100644 index 0000000..1275bf1 --- /dev/null +++ b/subjects/templates/subjects/update.html @@ -0,0 +1,107 @@ +{% extends template_extends %} + +{% load static i18n %} +{% load widget_tweaks django_bootstrap_breadcrumbs %} + +{% block breadcrumbs %} + {{ block.super }} + {% with 'Update '|add:object.slug as bread_slug %} + {% breadcrumb bread_slug 'subjects:update' %} + {% endwith %} +{% endblock breadcrumbs %} + +{% block content %} +
+
+
+ {% csrf_token %} + {% for field in form %} + {% if field.auto_id == 'id_students' %} +
+
+ +
+

{% trans 'Attribute students to subject' %}:

+ {% render_field field class='form-control' %} +
+
+
+ {% elif field.auto_id == 'id_professor' %} +
+
+ +
+

{% trans 'Attribute professors to subject' %}:

+ {% render_field field class='form-control' %} +
+
+
+ {% elif field.auto_id == 'id_markers'%} + + {% render_field field class='form-control' data-role="tagsinput" %} + {% else %} +
+ {% if field.auto_id != 'id_visible' %} + + {% endif %} + {% if field.auto_id == 'id_visible' %} +
+ +
+ {% elif field.auto_id == 'id_description' or field.auto_id == 'id_description_brief' %} + {% render_field field class='form-control text_wysiwyg' %} + {% else %} + {% render_field field class='form-control' %} + {% endif %} + {{ field.help_text }} + {% if field.errors %} +
+
+ +
+ {% endif %} +
+ {% endif %} + + {% endfor %} +
+ +
+
+
+
+
+
+ +{% endblock %} \ No newline at end of file diff --git a/subjects/urls.py b/subjects/urls.py index af2611e..8abfc23 100644 --- a/subjects/urls.py +++ b/subjects/urls.py @@ -6,5 +6,6 @@ urlpatterns = [ url(r'^$', views.IndexView.as_view(), name='index'), url(r'^(?P