Commit 7049a800bc2308bbed701130bf44d264658cfe37
1 parent
7f8769d5
Exists in
master
and in
3 other branches
Adding topic goals initial form creation (Not working yet)
Showing
26 changed files
with
980 additions
and
9 deletions
Show diff stats
amadeus/settings.py
amadeus/static/css/.sass-cache/a7f87b90919294b62ab4f8079e31dcda8f485534/green.sassc
No preview for this file type
amadeus/static/css/base/amadeus.css
@@ -747,7 +747,7 @@ a:focus { | @@ -747,7 +747,7 @@ a:focus { | ||
747 | } | 747 | } |
748 | /* end jPages */ | 748 | /* end jPages */ |
749 | 749 | ||
750 | -.notifies { | 750 | +.notifies, .goalitems { |
751 | padding: 5px 20px; | 751 | padding: 5px 20px; |
752 | text-align: right; | 752 | text-align: right; |
753 | margin-bottom: 10px; | 753 | margin-bottom: 10px; |
@@ -761,7 +761,7 @@ a:focus { | @@ -761,7 +761,7 @@ a:focus { | ||
761 | font-weight: 700; | 761 | font-weight: 700; |
762 | } | 762 | } |
763 | 763 | ||
764 | -.notifies a.delete-row { | 764 | +.notifies a.delete-row, .goalitems a.delete-row { |
765 | padding: 5px 20px; | 765 | padding: 5px 20px; |
766 | font-size: 12px; | 766 | font-size: 12px; |
767 | border: none; | 767 | border: none; |
amadeus/static/css/themes/green.css
@@ -316,13 +316,13 @@ a, a:focus, a:hover { | @@ -316,13 +316,13 @@ a, a:focus, a:hover { | ||
316 | border-color: #039BE5; } | 316 | border-color: #039BE5; } |
317 | 317 | ||
318 | /* Pendencies Form */ | 318 | /* Pendencies Form */ |
319 | -.notifies { | 319 | +.notifies, .goalitems { |
320 | border: 1px solid #EEEEEE; } | 320 | border: 1px solid #EEEEEE; } |
321 | 321 | ||
322 | .bootstrap-datetimepicker-widget { | 322 | .bootstrap-datetimepicker-widget { |
323 | background-color: #fff; } | 323 | background-color: #fff; } |
324 | 324 | ||
325 | -.notifies a.delete-row { | 325 | +.notifies a.delete-row, .goalitems a.delete-row { |
326 | -webkit-box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 1px 5px 0 rgba(0, 0, 0, 0.12); | 326 | -webkit-box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 1px 5px 0 rgba(0, 0, 0, 0.12); |
327 | box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 1px 5px 0 rgba(0, 0, 0, 0.12); | 327 | box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 1px 5px 0 rgba(0, 0, 0, 0.12); |
328 | background-color: #EEE; | 328 | background-color: #EEE; |
amadeus/static/css/themes/green.css.map
1 | { | 1 | { |
2 | "version": 3, | 2 | "version": 3, |
3 | -"mappings": "AAOA,gJAAgJ;EAC5I,gBAAgB,EAAE,KAAK;;AAG3B,mBAAmB;EACf,KAAK,EAXO,OAAO;;AAcvB,gGAA4F;EACxF,gBAAgB,EAfJ,OAAO;;AAkBvB,kGAA8F;EAC1F,YAAY,EAnBA,OAAO;;AAsBvB,iMAAiM;EAC7L,KAAK,EAAE,IAAI;EACX,gBAAgB,EAxBJ,OAAO;EAyBnB,YAAY,EAzBA,OAAO;;AA4BvB,+BAA+B;EAC3B,gBAAgB,EA7BJ,OAAO;EA8BnB,KAAK,EAAE,yBAAqB;;AAGhC,aAAa;EACT,gBAAgB,EAAE,kBAAkB;;AAGxC,YAAY;EACR,UAAU,EAtCE,OAAO;;AAyCvB,iBAAiB;EACb,UAAU,EAzCI,OAAO;;;AA+CzB,+CAA+C;EAC3C,UAAU,EAAE,OAAO;EACnB,KAAK,EAlDO,OAAO;;AAqDvB,qDAAqD;EACjD,KAAK,EAtDO,OAAO;;;AA2DvB,mBAAmB;EACf,gBAAgB,EA5DJ,OAAO;EA6DnB,KAAK,EAAE,KAAK;;AAGhB,qBAAqB;EACjB,KAAK,EAAE,KAAK;;AAGhB,qCAAqC;E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B;EACzB,KAAK,EAAE,OAAO;;AAGlB,WAAW;EACP,KAAK,EAAE,OAAO;;AAGlB,mBAAmB;EACf,gBAAgB,EAAE,OAAO;EACzB,UAAU,EAAE,OAAO;;AAGvB,sCAAsC;EAClC,YAAY,EAAE,OAAO;EACrB,UAAU,EArkBN,OAAO;;AAwkBf,gBAAgB;EACZ,UAAU,EA1kBE,OAAO;EA2kBnB,gBAAgB,EAAE,OAAO;;AAG7B,mCAAmC;EAC/B,KAAK,EAAE,OAAO;;AAGlB,aAAa;EACT,KAAK,EAAE,OAAO;;AAGlB,UAAU;EACN,KAAK,EAAE,kBAAkB;;AAG7B,QAAQ;EACJ,KAAK,EAAE,kBAAkB;;AAG7B,YAAY;EACR,UAAU,EA/lBE,OAAO;;AAkmBvB,eAAe;EACX,KAAK,EAAE,OAAO;;AAId,kBAAK;EACD,KAAK,EAAE,OAAO;;AAIlB,cAAC;EACG,KAAK,EAAE,OAAO;;AAGtB,YAAY;EACR,UAAU,EAhnBN,OAAO;;AAmnBf,gBAAgB;EACZ,UAAU,EAAE,IAAI;;AAGpB,gNAAgN;EAC5M,gBAAgB,EAAE,OAAO;;;EAKzB,mDAAmD;IAC/C,KAAK,EAAE,kBAAkB;;EAE7B,yDAAyD;IACrD,KAAK,EAAE,kBAAyB", |
4 | "sources": ["green.sass"], | 4 | "sources": ["green.sass"], |
5 | "names": [], | 5 | "names": [], |
6 | "file": "green.css" | 6 | "file": "green.css" |
amadeus/static/css/themes/green.sass
@@ -437,7 +437,7 @@ a, a:focus, a:hover | @@ -437,7 +437,7 @@ a, a:focus, a:hover | ||
437 | /* Pendencies Form */ | 437 | /* Pendencies Form */ |
438 | 438 | ||
439 | 439 | ||
440 | -.notifies | 440 | +.notifies, .goalitems |
441 | border: 1px solid #EEEEEE | 441 | border: 1px solid #EEEEEE |
442 | 442 | ||
443 | 443 | ||
@@ -445,7 +445,7 @@ a, a:focus, a:hover | @@ -445,7 +445,7 @@ a, a:focus, a:hover | ||
445 | background-color: #fff | 445 | background-color: #fff |
446 | 446 | ||
447 | 447 | ||
448 | -.notifies a.delete-row | 448 | +.notifies a.delete-row, .goalitems a.delete-row |
449 | -webkit-box-shadow: 0 2px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.2),0 1px 5px 0 rgba(0,0,0,.12) | 449 | -webkit-box-shadow: 0 2px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.2),0 1px 5px 0 rgba(0,0,0,.12) |
450 | box-shadow: 0 2px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.2),0 1px 5px 0 rgba(0,0,0,.12) | 450 | box-shadow: 0 2px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.2),0 1px 5px 0 rgba(0,0,0,.12) |
451 | background-color: #EEE | 451 | background-color: #EEE |
amadeus/static/js/resources.js
@@ -98,6 +98,12 @@ $('.end_date_input').on('click', function () { | @@ -98,6 +98,12 @@ $('.end_date_input').on('click', function () { | ||
98 | $(checkbox).prop('checked', true); | 98 | $(checkbox).prop('checked', true); |
99 | }); | 99 | }); |
100 | 100 | ||
101 | +$('.limit_date_input').on('click', function () { | ||
102 | + var checkbox = $(this).parent().parent().find('.limit_date'); | ||
103 | + | ||
104 | + $(checkbox).prop('checked', true); | ||
105 | +}); | ||
106 | + | ||
101 | // check if browser supports drag n drop | 107 | // check if browser supports drag n drop |
102 | // call initialization file | 108 | // call initialization file |
103 | if (window.File && window.FileList && window.FileReader) { | 109 | if (window.File && window.FileList && window.FileReader) { |
amadeus/urls.py
@@ -34,6 +34,7 @@ urlpatterns = [ | @@ -34,6 +34,7 @@ urlpatterns = [ | ||
34 | url(r'^webpages/', include('webpage.urls', namespace = 'webpages')), | 34 | url(r'^webpages/', include('webpage.urls', namespace = 'webpages')), |
35 | url(r'^ytvideo/', include('youtube_video.urls', namespace = 'youtube')), | 35 | url(r'^ytvideo/', include('youtube_video.urls', namespace = 'youtube')), |
36 | url(r'^file_links/', include('file_link.urls', namespace = 'file_links')), | 36 | url(r'^file_links/', include('file_link.urls', namespace = 'file_links')), |
37 | + url(r'^goals/', include('goals.urls', namespace = 'goals')), | ||
37 | url(r'^mailsender/', include('mailsender.urls', namespace = 'mailsender')), | 38 | url(r'^mailsender/', include('mailsender.urls', namespace = 'mailsender')), |
38 | url(r'^security/', include('security.urls', namespace = 'security')), | 39 | url(r'^security/', include('security.urls', namespace = 'security')), |
39 | url(r'^themes/', include('themes.urls', namespace = 'themes')), | 40 | url(r'^themes/', include('themes.urls', namespace = 'themes')), |
@@ -0,0 +1,21 @@ | @@ -0,0 +1,21 @@ | ||
1 | +# -*- coding: utf-8 -*- | ||
2 | +# Generated by Django 1.10 on 2017-02-24 03:23 | ||
3 | +from __future__ import unicode_literals | ||
4 | + | ||
5 | +from django.conf import settings | ||
6 | +from django.db import migrations, models | ||
7 | + | ||
8 | + | ||
9 | +class Migration(migrations.Migration): | ||
10 | + | ||
11 | + dependencies = [ | ||
12 | + ('categories', '0013_auto_20170203_1618'), | ||
13 | + ] | ||
14 | + | ||
15 | + operations = [ | ||
16 | + migrations.AlterField( | ||
17 | + model_name='category', | ||
18 | + name='coordinators', | ||
19 | + field=models.ManyToManyField(blank=True, related_name='coordinators', to=settings.AUTH_USER_MODEL), | ||
20 | + ), | ||
21 | + ] |
@@ -0,0 +1,94 @@ | @@ -0,0 +1,94 @@ | ||
1 | +# coding=utf-8 | ||
2 | +from django import forms | ||
3 | +from django.conf import settings | ||
4 | +from django.utils.translation import ugettext_lazy as _ | ||
5 | +from django.forms.models import inlineformset_factory | ||
6 | + | ||
7 | +from subjects.models import Tag | ||
8 | + | ||
9 | +from pendencies.forms import PendenciesLimitedForm | ||
10 | +from pendencies.models import Pendencies | ||
11 | + | ||
12 | +from .models import Goals, GoalItem | ||
13 | + | ||
14 | +class GoalsForm(forms.ModelForm): | ||
15 | + subject = None | ||
16 | + control_subject = forms.CharField(widget = forms.HiddenInput()) | ||
17 | + | ||
18 | + def __init__(self, *args, **kwargs): | ||
19 | + super(GoalsForm, self).__init__(*args, **kwargs) | ||
20 | + | ||
21 | + self.subject = kwargs['initial'].get('subject', None) | ||
22 | + | ||
23 | + if self.instance.id: | ||
24 | + self.subject = self.instance.topic.subject | ||
25 | + self.initial['tags'] = ", ".join(self.instance.tags.all().values_list("name", flat = True)) | ||
26 | + | ||
27 | + self.initial['control_subject'] = self.subject.id | ||
28 | + | ||
29 | + tags = forms.CharField(label = _('Tags'), required = False) | ||
30 | + limit_submission_date = forms.DateTimeField(input_formats = settings.DATETIME_INPUT_FORMATS) | ||
31 | + | ||
32 | + class Meta: | ||
33 | + model = Goals | ||
34 | + fields = ['name', 'presentation', 'brief_description', 'show_window', 'visible'] | ||
35 | + labels = { | ||
36 | + 'name': _('Name'), | ||
37 | + } | ||
38 | + widgets = { | ||
39 | + 'presentation': forms.Textarea, | ||
40 | + 'brief_description': forms.Textarea, | ||
41 | + } | ||
42 | + | ||
43 | + def clean(self): | ||
44 | + cleaned_data = super(GoalsForm, self).clean() | ||
45 | + | ||
46 | + topic = cleaned_data.get('topic', None) | ||
47 | + | ||
48 | + if topic: | ||
49 | + if self.instance.id: | ||
50 | + exist = topic.resource_topic.filter(goals__isnull = False).exclude(id = self.instance.id).exists() | ||
51 | + else: | ||
52 | + exist = topic.resource_topic.filter(goals__isnull = False).exists() | ||
53 | + | ||
54 | + if exist: | ||
55 | + self.add_error('name', _('There already is another resource with the goals specification for the Topic %s')%(str(topic))) | ||
56 | + | ||
57 | + return cleaned_data | ||
58 | + | ||
59 | + def save(self, commit = True): | ||
60 | + super(GoalsForm, self).save(commit = True) | ||
61 | + | ||
62 | + self.instance.save() | ||
63 | + | ||
64 | + previous_tags = self.instance.tags.all() | ||
65 | + | ||
66 | + tags = self.cleaned_data['tags'].split(",") | ||
67 | + | ||
68 | + #Excluding unwanted tags | ||
69 | + for prev in previous_tags: | ||
70 | + if not prev.name in tags: | ||
71 | + self.instance.tags.remove(prev) | ||
72 | + | ||
73 | + for tag in tags: | ||
74 | + tag = tag.strip() | ||
75 | + | ||
76 | + exist = Tag.objects.filter(name = tag).exists() | ||
77 | + | ||
78 | + if exist: | ||
79 | + new_tag = Tag.objects.get(name = tag) | ||
80 | + else: | ||
81 | + new_tag = Tag.objects.create(name = tag) | ||
82 | + | ||
83 | + if not new_tag in self.instance.tags.all(): | ||
84 | + self.instance.tags.add(new_tag) | ||
85 | + | ||
86 | + return self.instance | ||
87 | + | ||
88 | +class GoalItemForm(forms.ModelForm): | ||
89 | + class Meta: | ||
90 | + model = GoalItem | ||
91 | + fields = ['description', 'ref_value'] | ||
92 | + | ||
93 | +InlinePendenciesFormset = inlineformset_factory(Goals, Pendencies, form = PendenciesLimitedForm, extra = 1, max_num = 3, validate_max = True, can_delete = True) | ||
94 | +InlineGoalItemFormset = inlineformset_factory(Goals, GoalItem, form = GoalItemForm, extra = 1, can_delete = True) | ||
0 | \ No newline at end of file | 95 | \ No newline at end of file |
@@ -0,0 +1,45 @@ | @@ -0,0 +1,45 @@ | ||
1 | +# -*- coding: utf-8 -*- | ||
2 | +# Generated by Django 1.10 on 2017-02-24 03:23 | ||
3 | +from __future__ import unicode_literals | ||
4 | + | ||
5 | +from django.db import migrations, models | ||
6 | +import django.db.models.deletion | ||
7 | + | ||
8 | + | ||
9 | +class Migration(migrations.Migration): | ||
10 | + | ||
11 | + initial = True | ||
12 | + | ||
13 | + dependencies = [ | ||
14 | + ('topics', '0007_auto_20170123_1911'), | ||
15 | + ] | ||
16 | + | ||
17 | + operations = [ | ||
18 | + migrations.CreateModel( | ||
19 | + name='GoalItem', | ||
20 | + fields=[ | ||
21 | + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
22 | + ('description', models.CharField(max_length=255, verbose_name='Description')), | ||
23 | + ('ref_value', models.IntegerField(verbose_name='Referential Value')), | ||
24 | + ('order', models.PositiveSmallIntegerField(null=True, verbose_name='Order')), | ||
25 | + ], | ||
26 | + ), | ||
27 | + migrations.CreateModel( | ||
28 | + name='Goals', | ||
29 | + fields=[ | ||
30 | + ('resource_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='topics.Resource')), | ||
31 | + ('presentation', models.TextField(blank=True, verbose_name='Presentation')), | ||
32 | + ('limit_submission_date', models.DateTimeField(verbose_name='Submission Limit Date')), | ||
33 | + ], | ||
34 | + options={ | ||
35 | + 'verbose_name_plural': 'Goals', | ||
36 | + 'verbose_name': 'Goal', | ||
37 | + }, | ||
38 | + bases=('topics.resource',), | ||
39 | + ), | ||
40 | + migrations.AddField( | ||
41 | + model_name='goalitem', | ||
42 | + name='goal', | ||
43 | + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='item_goal', to='goals.Goals', verbose_name='Goal'), | ||
44 | + ), | ||
45 | + ] |
@@ -0,0 +1,35 @@ | @@ -0,0 +1,35 @@ | ||
1 | +from django.db import models | ||
2 | +from django.core.exceptions import ValidationError | ||
3 | +from django.utils.translation import ugettext_lazy as _ | ||
4 | +from django.core.urlresolvers import reverse_lazy | ||
5 | + | ||
6 | +from topics.models import Resource | ||
7 | + | ||
8 | +class Goals(Resource): | ||
9 | + presentation = models.TextField(_('Presentation'), blank = True) | ||
10 | + limit_submission_date = models.DateTimeField(_('Submission Limit Date')) | ||
11 | + | ||
12 | + class Meta: | ||
13 | + verbose_name = _('Goal') | ||
14 | + verbose_name_plural = _('Goals') | ||
15 | + | ||
16 | + def __str__(self): | ||
17 | + return self.name | ||
18 | + | ||
19 | + def access_link(self): | ||
20 | + return reverse_lazy('file_links:download', args = (), kwargs = {'slug': self.slug}) | ||
21 | + | ||
22 | + def update_link(self): | ||
23 | + return 'file_links:update' | ||
24 | + | ||
25 | + def delete_link(self): | ||
26 | + return 'file_links:delete' | ||
27 | + | ||
28 | + def delete_message(self): | ||
29 | + return _('Are you sure you want delete the goals') | ||
30 | + | ||
31 | +class GoalItem(models.Model): | ||
32 | + description = models.CharField(_('Description'), max_length = 255) | ||
33 | + ref_value = models.IntegerField(_('Referential Value')) | ||
34 | + order = models.PositiveSmallIntegerField(_('Order'), null = True) | ||
35 | + goal = models.ForeignKey(Goals, verbose_name = _('Goal'), related_name = 'item_goal') | ||
0 | \ No newline at end of file | 36 | \ No newline at end of file |
@@ -0,0 +1,460 @@ | @@ -0,0 +1,460 @@ | ||
1 | +{% load static i18n %} | ||
2 | +{% load widget_tweaks %} | ||
3 | + | ||
4 | +<form method="post" action="" enctype="multipart/form-data"> | ||
5 | + {% csrf_token %} | ||
6 | + | ||
7 | + {% render_field form.control_subject %} | ||
8 | + | ||
9 | + <div class="form-group{% if form.has_error %} has-error {% endif %} is-fileinput"> | ||
10 | + <label for="{{ form.name.auto_id }}">{{ form.name.label }} <span>*</span></label> | ||
11 | + {% render_field form.name class='form-control' %} | ||
12 | + | ||
13 | + <span id="helpBlock" class="help-block">{{ form.name.help_text }}</span> | ||
14 | + | ||
15 | + {% if form.name.errors %} | ||
16 | + <div class="alert alert-danger alert-dismissible" role="alert"> | ||
17 | + <button type="button" class="close" data-dismiss="alert" aria-label="Close"> | ||
18 | + <span aria-hidden="true">×</span> | ||
19 | + </button> | ||
20 | + <ul> | ||
21 | + {% for error in form.name.errors %} | ||
22 | + <li>{{ error }}</li> | ||
23 | + {% endfor %} | ||
24 | + </ul> | ||
25 | + </div> | ||
26 | + {% endif %} | ||
27 | + </div> | ||
28 | + | ||
29 | + <div class="form-group{% if form.has_error %} has-error {% endif %} is-fileinput"> | ||
30 | + <label for="{{ form.presentation.auto_id }}">{{ form.presentation.label }} <span>*</span></label> | ||
31 | + {% render_field form.presentation class='form-control text_wysiwyg' %} | ||
32 | + | ||
33 | + <span id="helpBlock" class="help-block">{{ form.presentation.help_text }}</span> | ||
34 | + | ||
35 | + {% if form.presentation.errors %} | ||
36 | + <div class="alert alert-danger alert-dismissible" role="alert"> | ||
37 | + <button type="button" class="close" data-dismiss="alert" aria-label="Close"> | ||
38 | + <span aria-hidden="true">×</span> | ||
39 | + </button> | ||
40 | + <ul> | ||
41 | + {% for error in form.presentation.errors %} | ||
42 | + <li>{{ error }}</li> | ||
43 | + {% endfor %} | ||
44 | + </ul> | ||
45 | + </div> | ||
46 | + {% endif %} | ||
47 | + </div> | ||
48 | + | ||
49 | + <div class="panel-group" id="professors_accordion" role="tablist" aria-multiselectable="true"> | ||
50 | + <div class="panel panel-info"> | ||
51 | + <div class="panel-heading"> | ||
52 | + <div class="row"> | ||
53 | + <div class="col-md-12"> | ||
54 | + <a data-parent="#professors_accordion" data-toggle="collapse" href="#goal_items"> | ||
55 | + <h4 class="panel-title"> | ||
56 | + <button class="btn btn-default btn-xs text-center cat-selector"><i class="fa fa-angle-right fa-2x" aria-hidden="true"></i></button><label>{% trans 'Goals Specification' %}</label> | ||
57 | + </h4> | ||
58 | + </a> | ||
59 | + </div> | ||
60 | + </div> | ||
61 | + </div> | ||
62 | + <div id="goal_items" class="panel-collapse collapse"> | ||
63 | + {{ goalitems_form.management_form }} | ||
64 | + {{ goalitems_form.non_form_errors }} | ||
65 | + | ||
66 | + {% for item in goalitems_form %} | ||
67 | + <div class="goalitems"> | ||
68 | + <div style="text-align:left"> | ||
69 | + {% render_field item.id %} | ||
70 | + | ||
71 | + {% if item.instance.pk %}{{ item.DELETE }}{% endif %} | ||
72 | + | ||
73 | + <div class="form-group{% if item.has_error %} has-error {% endif %} row"> | ||
74 | + <label for="{{ item.description.auto_id }}" class="pull-left action_label contol-label"> | ||
75 | + {{ item.description.label }}<span>*</span>: | ||
76 | + </label> | ||
77 | + <div class="col-md-3"> | ||
78 | + {% render_field item.description class='form-control' %} | ||
79 | + </div> | ||
80 | + | ||
81 | + <br clear="all" /> | ||
82 | + | ||
83 | + <span id="helpBlock" class="help-block">{{ item.description.help_text }}</span> | ||
84 | + | ||
85 | + {% if item.description.errors %} | ||
86 | + <div class="alert alert-danger alert-dismissible" role="alert"> | ||
87 | + <button type="button" class="close" data-dismiss="alert" aria-label="Close"> | ||
88 | + <span aria-hidden="true">×</span> | ||
89 | + </button> | ||
90 | + <ul> | ||
91 | + {% for error in item.description.errors %} | ||
92 | + <li>{{ error }}</li> | ||
93 | + {% endfor %} | ||
94 | + </ul> | ||
95 | + </div> | ||
96 | + {% endif %} | ||
97 | + </div> | ||
98 | + <br clear="all" /> | ||
99 | + <div class="form-group{% if item.has_error %} has-error {% endif %} row"> | ||
100 | + <label for="{{ item.ref_value.auto_id }}" class="pull-left action_label contol-label"> | ||
101 | + {{ item.ref_value.label }}<span>*</span>: | ||
102 | + </label> | ||
103 | + <div class="col-md-3"> | ||
104 | + {% render_field item.ref_value class='form-control' %} | ||
105 | + </div> | ||
106 | + | ||
107 | + <br clear="all" /> | ||
108 | + | ||
109 | + <span id="helpBlock" class="help-block">{{ item.ref_value.help_text }}</span> | ||
110 | + | ||
111 | + {% if item.ref_value.errors %} | ||
112 | + <div class="alert alert-danger alert-dismissible" role="alert"> | ||
113 | + <button type="button" class="close" data-dismiss="alert" aria-label="Close"> | ||
114 | + <span aria-hidden="true">×</span> | ||
115 | + </button> | ||
116 | + <ul> | ||
117 | + {% for error in item.ref_value.errors %} | ||
118 | + <li>{{ error }}</li> | ||
119 | + {% endfor %} | ||
120 | + </ul> | ||
121 | + </div> | ||
122 | + {% endif %} | ||
123 | + </div> | ||
124 | + </div> | ||
125 | + </div> | ||
126 | + {% endfor %} | ||
127 | + </div> | ||
128 | + </div> | ||
129 | + | ||
130 | + <br clear="all" /> | ||
131 | + | ||
132 | + <div class="form-group{% if form.has_error %} has-error {% endif %} is-fileinput"> | ||
133 | + <label for="{{ form.limit_submission_date.auto_id }}">{{ form.limit_submission_date.label }} <span>*</span></label> | ||
134 | + {% render_field form.limit_submission_date class='form-control datetime-picker' %} | ||
135 | + | ||
136 | + <span id="helpBlock" class="help-block">{{ form.limit_submission_date.help_text }}</span> | ||
137 | + | ||
138 | + {% if form.limit_submission_date.errors %} | ||
139 | + <div class="alert alert-danger alert-dismissible" role="alert"> | ||
140 | + <button type="button" class="close" data-dismiss="alert" aria-label="Close"> | ||
141 | + <span aria-hidden="true">×</span> | ||
142 | + </button> | ||
143 | + <ul> | ||
144 | + {% for error in form.limit_submission_date.errors %} | ||
145 | + <li>{{ error }}</li> | ||
146 | + {% endfor %} | ||
147 | + </ul> | ||
148 | + </div> | ||
149 | + {% endif %} | ||
150 | + </div> | ||
151 | + | ||
152 | + <legend>{% trans 'Common resources settings' %}</legend> | ||
153 | + | ||
154 | + <div class="form-group{% if form.has_error %} has-error {% endif %} is-fileinput"> | ||
155 | + <label for="{{ form.brief_description.auto_id }}">{{ form.brief_description.label }}</label> | ||
156 | + {% render_field form.brief_description class='form-control text_wysiwyg' %} | ||
157 | + | ||
158 | + <span id="helpBlock" class="help-block">{{ form.brief_description.help_text }}</span> | ||
159 | + | ||
160 | + {% if form.brief_description.errors %} | ||
161 | + <div class="alert alert-danger alert-dismissible" role="alert"> | ||
162 | + <button type="button" class="close" data-dismiss="alert" aria-label="Close"> | ||
163 | + <span aria-hidden="true">×</span> | ||
164 | + </button> | ||
165 | + <ul> | ||
166 | + {% for error in form.brief_description.errors %} | ||
167 | + <li>{{ error }}</li> | ||
168 | + {% endfor %} | ||
169 | + </ul> | ||
170 | + </div> | ||
171 | + {% endif %} | ||
172 | + </div> | ||
173 | + | ||
174 | + <div class="form-group{% if form.has_error %} has-error {% endif %} is-fileinput"> | ||
175 | + <label for="{{ form.tags.auto_id }}">{{ form.tags.label }}</label> | ||
176 | + {% render_field form.tags class='form-control' data-role="tagsinput" %} | ||
177 | + | ||
178 | + <span id="helpBlock" class="help-block">{{ form.tags.help_text }}</span> | ||
179 | + | ||
180 | + {% if form.tags.errors %} | ||
181 | + <div class="alert alert-danger alert-dismissible" role="alert"> | ||
182 | + <button type="button" class="close" data-dismiss="alert" aria-label="Close"> | ||
183 | + <span aria-hidden="true">×</span> | ||
184 | + </button> | ||
185 | + <ul> | ||
186 | + {% for error in form.tags.errors %} | ||
187 | + <li>{{ error }}</li> | ||
188 | + {% endfor %} | ||
189 | + </ul> | ||
190 | + </div> | ||
191 | + {% endif %} | ||
192 | + </div> | ||
193 | + | ||
194 | + <div class="panel panel-info"> | ||
195 | + <div class="panel-heading"> | ||
196 | + <div class="row"> | ||
197 | + <div class="col-md-12"> | ||
198 | + <a data-parent="#professors_accordion" data-toggle="collapse" href="#notifications"> | ||
199 | + <h4 class="panel-title"> | ||
200 | + <button class="btn btn-default btn-xs text-center cat-selector"><i class="fa fa-angle-right fa-2x" aria-hidden="true"></i></button><label>{% trans 'Pendencies Notifications' %}</label> | ||
201 | + </h4> | ||
202 | + </a> | ||
203 | + </div> | ||
204 | + </div> | ||
205 | + </div> | ||
206 | + <div id="notifications" class="panel-collapse collapse"> | ||
207 | + {{ pendencies_form.management_form }} | ||
208 | + {{ pendencies_form.non_form_errors }} | ||
209 | + | ||
210 | + {% for notify in pendencies_form %} | ||
211 | + <div class="notifies"> | ||
212 | + <div style="text-align:left"> | ||
213 | + {% render_field notify.id %} | ||
214 | + {% render_field notify.resource %} | ||
215 | + {% render_field notify.subject class='pend_subj' %} | ||
216 | + | ||
217 | + {% if notify.instance.pk %}{{ notify.DELETE }}{% endif %} | ||
218 | + | ||
219 | + <div class="form-group{% if notify.has_error %} has-error {% endif %} row"> | ||
220 | + <label for="{{ notify.action.auto_id }}" class="pull-left action_label contol-label"> | ||
221 | + {% trans 'Action not performed by the user' %}: | ||
222 | + </label> | ||
223 | + <div class="col-md-3"> | ||
224 | + {% render_field notify.action class='form-control' %} | ||
225 | + </div> | ||
226 | + | ||
227 | + <br clear="all" /> | ||
228 | + | ||
229 | + <span id="helpBlock" class="help-block">{{ notify.action.help_text }}</span> | ||
230 | + | ||
231 | + {% if notify.action.errors %} | ||
232 | + <div class="alert alert-danger alert-dismissible" role="alert"> | ||
233 | + <button type="button" class="close" data-dismiss="alert" aria-label="Close"> | ||
234 | + <span aria-hidden="true">×</span> | ||
235 | + </button> | ||
236 | + <ul> | ||
237 | + {% for error in notify.action.errors %} | ||
238 | + <li>{{ error }}</li> | ||
239 | + {% endfor %} | ||
240 | + </ul> | ||
241 | + </div> | ||
242 | + {% endif %} | ||
243 | + </div> | ||
244 | + <br clear="all" /> | ||
245 | + <div class="row"> | ||
246 | + <div class="col-md-12"> | ||
247 | + <p>{% trans 'Wished period' %}: </p> | ||
248 | + </div> | ||
249 | + </div> | ||
250 | + <div class="form-group{% if notify.has_error %} has-error {% endif %} row"> | ||
251 | + <div class="col-lg-2 col-md-2 col-sm-2 col-xs-3 checkbox"> | ||
252 | + <label> | ||
253 | + {% render_field notify.begin_date_check class="begin_date" %} {{ notify.begin_date.label }} | ||
254 | + </label> | ||
255 | + </div> | ||
256 | + <div class="col-lg-4 col-md-4 col-sm-4 col-xs-4"> | ||
257 | + {% render_field notify.begin_date class='form-control datetime-picker begin_date_input' %} | ||
258 | + </div> | ||
259 | + </div> | ||
260 | + <div class="row"> | ||
261 | + <span id="helpBlock" class="help-block">{{ notify.begin_date.help_text }}</span> | ||
262 | + | ||
263 | + {% if notify.begin_date.errors %} | ||
264 | + <div class="alert alert-danger alert-dismissible" role="alert"> | ||
265 | + <button type="button" class="close" data-dismiss="alert" aria-label="Close"> | ||
266 | + <span aria-hidden="true">×</span> | ||
267 | + </button> | ||
268 | + <ul> | ||
269 | + {% for error in notify.begin_date.errors %} | ||
270 | + <li>{{ error }}</li> | ||
271 | + {% endfor %} | ||
272 | + </ul> | ||
273 | + </div> | ||
274 | + {% endif %} | ||
275 | + </div> | ||
276 | + <div class="form-group{% if notify.has_error %} has-error {% endif %} row"> | ||
277 | + <div class="col-lg-2 col-md-2 col-sm-2 col-xs-3 checkbox"> | ||
278 | + <label> | ||
279 | + {% render_field notify.end_date_check class="end_date" %} {{ notify.end_date.label }} | ||
280 | + </label> | ||
281 | + </div> | ||
282 | + <div class="col-lg-4 col-md-4 col-sm-4 col-xs-4"> | ||
283 | + {% render_field notify.end_date class='form-control datetime-picker end_date_input' %} | ||
284 | + </div> | ||
285 | + </div> | ||
286 | + <div class="row"> | ||
287 | + <span id="helpBlock" class="help-block">{{ notify.end_date.help_text }}</span> | ||
288 | + | ||
289 | + {% if notify.end_date.errors %} | ||
290 | + <div class="alert alert-danger alert-dismissible" role="alert"> | ||
291 | + <button type="button" class="close" data-dismiss="alert" aria-label="Close"> | ||
292 | + <span aria-hidden="true">×</span> | ||
293 | + </button> | ||
294 | + <ul> | ||
295 | + {% for error in notify.end_date.errors %} | ||
296 | + <li>{{ error }}</li> | ||
297 | + {% endfor %} | ||
298 | + </ul> | ||
299 | + </div> | ||
300 | + {% endif %} | ||
301 | + </div> | ||
302 | + <div class="form-group{% if notify.has_error %} has-error {% endif %} row"> | ||
303 | + <div class="col-lg-2 col-md-2 col-sm-2 col-xs-3 checkbox"> | ||
304 | + <label> | ||
305 | + {% render_field notify.limit_date_check class="limit_date" %} {{ notify.limit_date.label }} | ||
306 | + </label> | ||
307 | + </div> | ||
308 | + <div class="col-lg-4 col-md-4 col-sm-4 col-xs-4"> | ||
309 | + {% render_field notify.limit_date class='form-control datetime-picker limit_date_input' %} | ||
310 | + </div> | ||
311 | + </div> | ||
312 | + <div class="row"> | ||
313 | + <span id="helpBlock" class="help-block">{{ notify.limit_date.help_text }}</span> | ||
314 | + | ||
315 | + {% if notify.limit_date.errors %} | ||
316 | + <div class="alert alert-danger alert-dismissible" role="alert"> | ||
317 | + <button type="button" class="close" data-dismiss="alert" aria-label="Close"> | ||
318 | + <span aria-hidden="true">×</span> | ||
319 | + </button> | ||
320 | + <ul> | ||
321 | + {% for error in notify.limit_date.errors %} | ||
322 | + <li>{{ error }}</li> | ||
323 | + {% endfor %} | ||
324 | + </ul> | ||
325 | + </div> | ||
326 | + {% endif %} | ||
327 | + </div> | ||
328 | + </div> | ||
329 | + </div> | ||
330 | + {% endfor %} | ||
331 | + </div> | ||
332 | + </div> | ||
333 | + </div> | ||
334 | + | ||
335 | + <div class="form-group{% if form.has_error %} has-error {% endif %}"> | ||
336 | + <div class=" checkbox"> | ||
337 | + <label for="{{ form.show_window.auto_id }}"> | ||
338 | + {% render_field form.show_window %} {{ form.show_window.label }} | ||
339 | + </label> | ||
340 | + </div> | ||
341 | + | ||
342 | + <span id="helpBlock" class="help-block">{{ form.show_window.help_text }}</span> | ||
343 | + | ||
344 | + {% if form.show_window.errors %} | ||
345 | + <div class="alert alert-danger alert-dismissible" role="alert"> | ||
346 | + <button type="button" class="close" data-dismiss="alert" aria-label="Close"> | ||
347 | + <span aria-hidden="true">×</span> | ||
348 | + </button> | ||
349 | + <ul> | ||
350 | + {% for error in form.show_window.errors %} | ||
351 | + <li>{{ error }}</li> | ||
352 | + {% endfor %} | ||
353 | + </ul> | ||
354 | + </div> | ||
355 | + {% endif %} | ||
356 | + </div> | ||
357 | + | ||
358 | + <div class="form-group{% if form.has_error %} has-error {% endif %}"> | ||
359 | + <div class=" checkbox"> | ||
360 | + <label for="{{ form.visible.auto_id }}"> | ||
361 | + {% render_field form.visible %} {{ form.visible.label }} | ||
362 | + </label> | ||
363 | + </div> | ||
364 | + | ||
365 | + <span id="helpBlock" class="help-block">{{ form.visible.help_text }}</span> | ||
366 | + | ||
367 | + {% if form.visible.errors %} | ||
368 | + <div class="alert alert-danger alert-dismissible" role="alert"> | ||
369 | + <button type="button" class="close" data-dismiss="alert" aria-label="Close"> | ||
370 | + <span aria-hidden="true">×</span> | ||
371 | + </button> | ||
372 | + <ul> | ||
373 | + {% for error in form.visible.errors %} | ||
374 | + <li>{{ error }}</li> | ||
375 | + {% endfor %} | ||
376 | + </ul> | ||
377 | + </div> | ||
378 | + {% endif %} | ||
379 | + </div> | ||
380 | + | ||
381 | + <div class="col-md-12 col-lg-12 col-sm-12 col-xs-12"> | ||
382 | + <div class="text-center"> | ||
383 | + <input type="submit" value="{% trans 'Save' %}" class="btn btn-raised btn-success" /> | ||
384 | + </div> | ||
385 | + </div> | ||
386 | +</form> | ||
387 | +<script type="text/javascript"> | ||
388 | + $(function() { | ||
389 | + $('.goalitems').formset({ | ||
390 | + addText: '{% trans "Add new goal" %}', | ||
391 | + deleteText: '{% trans "Remove this goal" %}', | ||
392 | + prefix: '{{ goalitems_form.prefix }}', | ||
393 | + }); | ||
394 | + | ||
395 | + $('.notifies').formset({ | ||
396 | + addText: '{% trans "Add new notification" %}', | ||
397 | + deleteText: '{% trans "Remove this" %}', | ||
398 | + prefix: '{{ pendencies_form.prefix }}', | ||
399 | + added: function (row) { | ||
400 | + var locale = navigator.language || navigator.userLanguage; | ||
401 | + | ||
402 | + $(row).find('.datetime-picker').each(function () { | ||
403 | + $(this).datetimepicker({ | ||
404 | + locale: locale | ||
405 | + }); | ||
406 | + }); | ||
407 | + $('.begin_date_input').on('click', function () { | ||
408 | + var checkbox = $(this).parent().parent().find('.begin_date'); | ||
409 | + $(checkbox).prop('checked', true); | ||
410 | + }); | ||
411 | + $('.end_date_input').on('click', function () { | ||
412 | + var checkbox = $(this).parent().parent().find('.end_date'); | ||
413 | + $(checkbox).prop('checked', true); | ||
414 | + }); | ||
415 | + $('.limit_date_input').on('click', function () { | ||
416 | + var checkbox = $(this).parent().parent().find('.limit_date'); | ||
417 | + $(checkbox).prop('checked', true); | ||
418 | + }); | ||
419 | + | ||
420 | + var subject = $("#id_control_subject").val(); | ||
421 | + | ||
422 | + $(row).find('.pend_subj').val(subject); | ||
423 | + } | ||
424 | + }); | ||
425 | + | ||
426 | + $('.begin_date_input').each(function () { | ||
427 | + console.log($(this).val()); | ||
428 | + if ($(this).val() != '') { | ||
429 | + $(this).parent().parent().find('.begin_date').prop('checked', true); | ||
430 | + } else { | ||
431 | + $(this).parent().parent().find('.begin_date').prop('checked', false); | ||
432 | + } | ||
433 | + }); | ||
434 | + | ||
435 | + $('.end_date_input').each(function () { | ||
436 | + if ($(this).val() != '') { | ||
437 | + $(this).parent().parent().find('.end_date').prop('checked', true); | ||
438 | + } else { | ||
439 | + $(this).parent().parent().find('.end_date').prop('checked', false); | ||
440 | + } | ||
441 | + }); | ||
442 | + | ||
443 | + $('.limit_date_input').each(function () { | ||
444 | + if ($(this).val() != '') { | ||
445 | + $(this).parent().parent().find('.limit_date').prop('checked', true); | ||
446 | + } else { | ||
447 | + $(this).parent().parent().find('.limit_date').prop('checked', false); | ||
448 | + } | ||
449 | + }); | ||
450 | + | ||
451 | + var subject = $("#id_control_subject").val(); | ||
452 | + | ||
453 | + $('.pend_subj').val(subject); | ||
454 | + | ||
455 | + {% if not pendencies_form.is_valid and pendencies_form.is_bound %} | ||
456 | + $("#notifications").collapse('toggle'); | ||
457 | + {% endif %} | ||
458 | + }); | ||
459 | +</script> | ||
460 | +<script type="text/javascript" src="{% static 'js/resources.js' %}"></script> | ||
0 | \ No newline at end of file | 461 | \ No newline at end of file |
@@ -0,0 +1,35 @@ | @@ -0,0 +1,35 @@ | ||
1 | +{% extends 'subjects/view.html' %} | ||
2 | + | ||
3 | +{% load static i18n django_bootstrap_breadcrumbs %} | ||
4 | + | ||
5 | +{% block style %} | ||
6 | + {{block.super}} | ||
7 | + <link rel="stylesheet" type="text/css" href="{% static "css/bootstrap-tagsinput.css" %}"> | ||
8 | +{% endblock %} | ||
9 | + | ||
10 | +{% block javascript %} | ||
11 | + {{block.super}} | ||
12 | + <script type="text/javascript" src="{% static "js/bootstrap-tagsinput.js" %} "></script> | ||
13 | + <script type="text/javascript" src="{% static "js/jquery.formset.js" %} "></script> | ||
14 | +{% endblock %} | ||
15 | + | ||
16 | +{% block breadcrumbs %} | ||
17 | + {{ block.super }} | ||
18 | + | ||
19 | + {% breadcrumb topic 'subjects:topic_view' topic.subject.slug topic.slug %} | ||
20 | + | ||
21 | + {% trans 'Add Topic Goals' as bread %} | ||
22 | + {% breadcrumb bread 'goals:create' topic.slug %} | ||
23 | +{% endblock %} | ||
24 | + | ||
25 | +{% block content %} | ||
26 | + <div class="card"> | ||
27 | + <div class="card-content"> | ||
28 | + <div class="card-body"> | ||
29 | + {% include 'goals/_form.html' %} | ||
30 | + </div> | ||
31 | + </div> | ||
32 | + </div> | ||
33 | + <br clear="all" /> | ||
34 | + <br clear="all" /> | ||
35 | +{% endblock %} |
@@ -0,0 +1,134 @@ | @@ -0,0 +1,134 @@ | ||
1 | +from django.shortcuts import get_object_or_404, redirect, render | ||
2 | +from django.views import generic | ||
3 | +from django.contrib import messages | ||
4 | +from django.core.urlresolvers import reverse, reverse_lazy | ||
5 | +from django.utils.translation import ugettext_lazy as _ | ||
6 | +from django.contrib.auth.mixins import LoginRequiredMixin | ||
7 | + | ||
8 | +from amadeus.permissions import has_subject_permissions, has_resource_permissions | ||
9 | + | ||
10 | +from topics.models import Topic | ||
11 | + | ||
12 | +from .forms import GoalsForm, InlinePendenciesFormset, InlineGoalItemFormset | ||
13 | +from .models import Goals | ||
14 | + | ||
15 | +class CreateView(LoginRequiredMixin, generic.edit.CreateView): | ||
16 | + login_url = reverse_lazy("users:login") | ||
17 | + redirect_field_name = 'next' | ||
18 | + | ||
19 | + template_name = 'goals/create.html' | ||
20 | + form_class = GoalsForm | ||
21 | + | ||
22 | + def dispatch(self, request, *args, **kwargs): | ||
23 | + slug = self.kwargs.get('slug', '') | ||
24 | + topic = get_object_or_404(Topic, slug = slug) | ||
25 | + | ||
26 | + if not has_subject_permissions(request.user, topic.subject): | ||
27 | + return redirect(reverse_lazy('subjects:home')) | ||
28 | + | ||
29 | + return super(CreateView, self).dispatch(request, *args, **kwargs) | ||
30 | + | ||
31 | + def get(self, request, *args, **kwargs): | ||
32 | + self.object = None | ||
33 | + | ||
34 | + form_class = self.get_form_class() | ||
35 | + form = self.get_form(form_class) | ||
36 | + | ||
37 | + slug = self.kwargs.get('slug', '') | ||
38 | + topic = get_object_or_404(Topic, slug = slug) | ||
39 | + | ||
40 | + pendencies_form = InlinePendenciesFormset(initial = [{'subject': topic.subject.id, 'actions': [("", "-------"),("view", _("Visualize")), ("submit", _("Submit"))]}]) | ||
41 | + goalitems_form = InlineGoalItemFormset() | ||
42 | + | ||
43 | + return self.render_to_response(self.get_context_data(form = form, pendencies_form = pendencies_form, goalitems_form = goalitems_form)) | ||
44 | + | ||
45 | + def post(self, request, *args, **kwargs): | ||
46 | + self.object = None | ||
47 | + | ||
48 | + form_class = self.get_form_class() | ||
49 | + form = self.get_form(form_class) | ||
50 | + | ||
51 | + slug = self.kwargs.get('slug', '') | ||
52 | + topic = get_object_or_404(Topic, slug = slug) | ||
53 | + | ||
54 | + pendencies_form = InlinePendenciesFormset(self.request.POST, initial = [{'subject': topic.subject.id, 'actions': [("", "-------"),("view", _("Visualize")), ("submit", _("Submit"))]}]) | ||
55 | + goalitems_form = InlineGoalItemFormset(self.request.POST) | ||
56 | + | ||
57 | + if (form.is_valid() and pendencies_form.is_valid() and goalitems_form.is_valid()): | ||
58 | + return self.form_valid(form, pendencies_form, goalitems_form) | ||
59 | + else: | ||
60 | + return self.form_invalid(form, pendencies_form, goalitems_form) | ||
61 | + | ||
62 | + def get_initial(self): | ||
63 | + initial = super(CreateView, self).get_initial() | ||
64 | + | ||
65 | + slug = self.kwargs.get('slug', '') | ||
66 | + | ||
67 | + topic = get_object_or_404(Topic, slug = slug) | ||
68 | + initial['subject'] = topic.subject | ||
69 | + initial['topic'] = topic | ||
70 | + | ||
71 | + return initial | ||
72 | + | ||
73 | + def form_invalid(self, form, pendencies_form, goalitems_form): | ||
74 | + for p_form in pendencies_form.forms: | ||
75 | + p_form.fields['action'].choices = [("", "-------"),("view", _("Visualize")), ("submit", _("Submit"))] | ||
76 | + | ||
77 | + return self.render_to_response(self.get_context_data(form = form, pendencies_form = pendencies_form, goalitems_form = goalitems_form)) | ||
78 | + | ||
79 | + def form_valid(self, form, pendencies_form, goalitems_form): | ||
80 | + self.object = form.save(commit = False) | ||
81 | + | ||
82 | + slug = self.kwargs.get('slug', '') | ||
83 | + topic = get_object_or_404(Topic, slug = slug) | ||
84 | + | ||
85 | + self.object.topic = topic | ||
86 | + self.object.order = topic.resource_topic.count() + 1 | ||
87 | + | ||
88 | + self.object.all_students = True | ||
89 | + | ||
90 | + if not self.object.topic.visible and not self.object.topic.repository: | ||
91 | + self.object.visible = False | ||
92 | + | ||
93 | + self.object.save() | ||
94 | + | ||
95 | + pendencies_form.instance = self.object | ||
96 | + pendencies_form.save(commit = False) | ||
97 | + | ||
98 | + for pform in pendencies_form.forms: | ||
99 | + pend_form = pform.save(commit = False) | ||
100 | + | ||
101 | + if not pend_form.action == "": | ||
102 | + pend_form.save() | ||
103 | + | ||
104 | + goalitems_form.instance = self.object | ||
105 | + goalitems_form.save(commit = False) | ||
106 | + | ||
107 | + return redirect(self.get_success_url()) | ||
108 | + | ||
109 | + def get_context_data(self, **kwargs): | ||
110 | + context = super(CreateView, self).get_context_data(**kwargs) | ||
111 | + | ||
112 | + context['title'] = _('Create Topic Goals') | ||
113 | + | ||
114 | + slug = self.kwargs.get('slug', '') | ||
115 | + topic = get_object_or_404(Topic, slug = slug) | ||
116 | + | ||
117 | + context['topic'] = topic | ||
118 | + context['subject'] = topic.subject | ||
119 | + | ||
120 | + return context | ||
121 | + | ||
122 | + def get_success_url(self): | ||
123 | + messages.success(self.request, _('The topic "%s" Goals specification was realized successfully!')%(self.object.topic.name)) | ||
124 | + | ||
125 | + #success_url = reverse_lazy('youtube:view', kwargs = {'slug': self.object.slug}) | ||
126 | + | ||
127 | + #if self.object.show_window: | ||
128 | + # self.request.session['resources'] = {} | ||
129 | + # self.request.session['resources']['new_page'] = True | ||
130 | + # self.request.session['resources']['new_page_url'] = reverse('youtube:window_view', kwargs = {'slug': self.object.slug}) | ||
131 | + | ||
132 | + success_url = reverse_lazy('subjects:view', kwargs = {'slug': self.object.topic.subject.slug}) | ||
133 | + | ||
134 | + return success_url | ||
0 | \ No newline at end of file | 135 | \ No newline at end of file |
@@ -0,0 +1,26 @@ | @@ -0,0 +1,26 @@ | ||
1 | +# -*- coding: utf-8 -*- | ||
2 | +# Generated by Django 1.10 on 2017-02-24 03:23 | ||
3 | +from __future__ import unicode_literals | ||
4 | + | ||
5 | +from django.db import migrations, models | ||
6 | +import django.db.models.deletion | ||
7 | + | ||
8 | + | ||
9 | +class Migration(migrations.Migration): | ||
10 | + | ||
11 | + dependencies = [ | ||
12 | + ('mural', '0007_comment_edited'), | ||
13 | + ] | ||
14 | + | ||
15 | + operations = [ | ||
16 | + migrations.AlterField( | ||
17 | + model_name='categorypost', | ||
18 | + name='space', | ||
19 | + field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='post_category', to='categories.Category', verbose_name='Category'), | ||
20 | + ), | ||
21 | + migrations.AlterField( | ||
22 | + model_name='subjectpost', | ||
23 | + name='resource', | ||
24 | + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='post_resource', to='topics.Resource', verbose_name='Resource'), | ||
25 | + ), | ||
26 | + ] |
pendencies/forms.py
@@ -30,15 +30,88 @@ class PendenciesForm(forms.ModelForm): | @@ -30,15 +30,88 @@ class PendenciesForm(forms.ModelForm): | ||
30 | def clean(self): | 30 | def clean(self): |
31 | cleaned_data = super(PendenciesForm, self).clean() | 31 | cleaned_data = super(PendenciesForm, self).clean() |
32 | 32 | ||
33 | - print(cleaned_data) | 33 | + pend_id = cleaned_data.get('id', None) |
34 | + | ||
35 | + action = cleaned_data.get('action', None) | ||
36 | + begin_date = cleaned_data.get('begin_date', None) | ||
37 | + end_date = cleaned_data.get('end_date', None) | ||
38 | + begin_check = cleaned_data.get('begin_date_check', False) | ||
39 | + end_check = cleaned_data.get('end_date_check', False) | ||
40 | + subject_id = cleaned_data.get('subject', None) | ||
41 | + | ||
42 | + if begin_check or end_check: | ||
43 | + if not action: | ||
44 | + self.add_error('action', _('This field is required.')) | ||
45 | + | ||
46 | + if not begin_date and begin_check: | ||
47 | + self.add_error('begin_date', _('This field is required.')) | ||
48 | + | ||
49 | + if not end_date and end_check: | ||
50 | + self.add_error('end_date', _('This field is required.')) | ||
51 | + | ||
52 | + if begin_date and end_date: | ||
53 | + if not begin_date == ValueError and not end_date == ValueError: | ||
54 | + if begin_date > end_date: | ||
55 | + self.add_error('begin_date', _('This input should be filled with a date equal or before the End Date.')) | ||
56 | + self.add_error('end_date', _('This input should be filled with a date equal or after the Begin Date.')) | ||
57 | + | ||
58 | + if subject_id: | ||
59 | + subject = Subject.objects.get(id = subject_id) | ||
60 | + | ||
61 | + if not begin_date == ValueError and begin_date: | ||
62 | + if not self.instance.id and begin_date.date() < datetime.datetime.today().date(): | ||
63 | + self.add_error('begin_date', _("This input should be filled with a date equal or after today's date.")) | ||
64 | + | ||
65 | + if begin_date.date() < subject.init_date: | ||
66 | + self.add_error('begin_date', _('This input should be filled with a date equal or after the subject begin date.')) | ||
67 | + | ||
68 | + if begin_date.date() > subject.end_date: | ||
69 | + self.add_error('begin_date', _('This input should be filled with a date equal or after the subject end date.')) | ||
70 | + | ||
71 | + if not end_date == ValueError and end_date: | ||
72 | + if not self.instance.id and end_date.date() < datetime.datetime.today().date(): | ||
73 | + self.add_error('end_date', _("This input should be filled with a date equal or after today's date.")) | ||
74 | + | ||
75 | + if end_date.date() < subject.init_date: | ||
76 | + self.add_error('end_date', _('This input should be filled with a date equal or after the subject begin date.')) | ||
77 | + | ||
78 | + if end_date.date() > subject.end_date: | ||
79 | + self.add_error('end_date', _('This input should be filled with a date equal or before the subject end date.')) | ||
80 | + | ||
81 | + return cleaned_data | ||
82 | + | ||
83 | +class PendenciesLimitedForm(forms.ModelForm): | ||
84 | + subject = forms.CharField(widget = forms.HiddenInput()) | ||
85 | + | ||
86 | + def __init__(self, *args, **kwargs): | ||
87 | + super(PendenciesLimitedForm, self).__init__(*args, **kwargs) | ||
88 | + | ||
89 | + if kwargs.get('initial', None): | ||
90 | + self.fields['action'].choices = kwargs['initial'].get('actions', []) | ||
91 | + | ||
92 | + begin_date_check = forms.BooleanField(required = False) | ||
93 | + end_date_check = forms.BooleanField(required = False) | ||
94 | + limit_date_check = forms.BooleanField(required = False) | ||
95 | + begin_date = forms.DateTimeField(input_formats = settings.DATETIME_INPUT_FORMATS) | ||
96 | + end_date = forms.DateTimeField(input_formats = settings.DATETIME_INPUT_FORMATS) | ||
97 | + limit_date = forms.DateTimeField(input_formats = settings.DATETIME_INPUT_FORMATS) | ||
98 | + | ||
99 | + class Meta: | ||
100 | + model = Pendencies | ||
101 | + fields = ['action'] | ||
102 | + | ||
103 | + def clean(self): | ||
104 | + cleaned_data = super(PendenciesLimitedForm, self).clean() | ||
34 | 105 | ||
35 | pend_id = cleaned_data.get('id', None) | 106 | pend_id = cleaned_data.get('id', None) |
36 | 107 | ||
37 | action = cleaned_data.get('action', None) | 108 | action = cleaned_data.get('action', None) |
38 | begin_date = cleaned_data.get('begin_date', None) | 109 | begin_date = cleaned_data.get('begin_date', None) |
39 | end_date = cleaned_data.get('end_date', None) | 110 | end_date = cleaned_data.get('end_date', None) |
111 | + limit_date = cleaned_data.get('limit_date', None) | ||
40 | begin_check = cleaned_data.get('begin_date_check', False) | 112 | begin_check = cleaned_data.get('begin_date_check', False) |
41 | end_check = cleaned_data.get('end_date_check', False) | 113 | end_check = cleaned_data.get('end_date_check', False) |
114 | + limit_check = cleaned_data.get('limit_date_check', False) | ||
42 | subject_id = cleaned_data.get('subject', None) | 115 | subject_id = cleaned_data.get('subject', None) |
43 | 116 | ||
44 | if begin_check or end_check: | 117 | if begin_check or end_check: |
@@ -0,0 +1,20 @@ | @@ -0,0 +1,20 @@ | ||
1 | +# -*- coding: utf-8 -*- | ||
2 | +# Generated by Django 1.10 on 2017-02-24 03:23 | ||
3 | +from __future__ import unicode_literals | ||
4 | + | ||
5 | +from django.db import migrations, models | ||
6 | + | ||
7 | + | ||
8 | +class Migration(migrations.Migration): | ||
9 | + | ||
10 | + dependencies = [ | ||
11 | + ('pendencies', '0005_auto_20170201_2010'), | ||
12 | + ] | ||
13 | + | ||
14 | + operations = [ | ||
15 | + migrations.AlterField( | ||
16 | + model_name='pendencies', | ||
17 | + name='action', | ||
18 | + field=models.CharField(blank=True, choices=[('view', 'Visualize'), ('create', 'Create'), ('answer', 'Answer'), ('access', 'Access'), ('finish', 'Finish'), ('submit', 'Submit')], max_length=100, verbose_name='Action'), | ||
19 | + ), | ||
20 | + ] |
pendencies/models.py
@@ -5,7 +5,7 @@ from django.utils.translation import ugettext_lazy as _ | @@ -5,7 +5,7 @@ from django.utils.translation import ugettext_lazy as _ | ||
5 | from topics.models import Resource | 5 | from topics.models import Resource |
6 | 6 | ||
7 | class Pendencies(models.Model): | 7 | class Pendencies(models.Model): |
8 | - action = models.CharField(_('Action'), max_length = 100, choices = (("view", _("Visualize")), ("create", _("Create")), ("answer", _("Answer")), ("access", _("Access")), ("finish", _("Finish"))), blank = True) | 8 | + action = models.CharField(_('Action'), max_length = 100, choices = (("view", _("Visualize")), ("create", _("Create")), ("answer", _("Answer")), ("access", _("Access")), ("finish", _("Finish")), ("submit", _("Submit"))), blank = True) |
9 | begin_date = models.DateTimeField(_('Begin Date'), null = True, blank = True) | 9 | begin_date = models.DateTimeField(_('Begin Date'), null = True, blank = True) |
10 | end_date = models.DateTimeField(_('End Date'), null = True, blank = True) | 10 | end_date = models.DateTimeField(_('End Date'), null = True, blank = True) |
11 | limit_date = models.DateTimeField(_('Limit Date'), null = True, blank = True) | 11 | limit_date = models.DateTimeField(_('Limit Date'), null = True, blank = True) |
topics/templates/topics/list.html
@@ -58,6 +58,7 @@ | @@ -58,6 +58,7 @@ | ||
58 | <li><a href="{% url 'file_links:create' topic.slug %}"><i class="fa fa-file-archive-o"></i> {% trans 'File Link' %}</a></li> | 58 | <li><a href="{% url 'file_links:create' topic.slug %}"><i class="fa fa-file-archive-o"></i> {% trans 'File Link' %}</a></li> |
59 | <li><a href="{% url 'links:create' topic.slug %}" > <i class="fa fa-globe"></i> {% trans "Link to Website" %}</a> | 59 | <li><a href="{% url 'links:create' topic.slug %}" > <i class="fa fa-globe"></i> {% trans "Link to Website" %}</a> |
60 | <li><a href="{% url 'webpages:create' topic.slug %}"><i class="fa fa-file-code-o"></i> {% trans 'Webpage' %}</a></li> | 60 | <li><a href="{% url 'webpages:create' topic.slug %}"><i class="fa fa-file-code-o"></i> {% trans 'Webpage' %}</a></li> |
61 | + <li><a href="{% url 'goals:create' topic.slug %}"><i class="fa fa-line-chart"></i> {% trans 'Topic Goals' %}</a></li> | ||
61 | <li><a href="#"><i class="fa fa-question-circle-o"></i> {% trans 'Questionary' %}</a></li> | 62 | <li><a href="#"><i class="fa fa-question-circle-o"></i> {% trans 'Questionary' %}</a></li> |
62 | 63 | ||
63 | </ul> | 64 | </ul> |