diff --git a/amadeus/static/js/resources.js b/amadeus/static/js/resources.js index 253894e..575d58b 100644 --- a/amadeus/static/js/resources.js +++ b/amadeus/static/js/resources.js @@ -2,35 +2,35 @@ $('#id_groups').multiSelect({ selectableHeader: "", selectionHeader: "", afterInit: function(ms){ - var that = this, - $selectableSearch = that.$selectableUl.prev(), - $selectionSearch = that.$selectionUl.prev(), - selectableSearchString = '#'+that.$container.attr('id')+' .ms-elem-selectable:not(.ms-selected)', - selectionSearchString = '#'+that.$container.attr('id')+' .ms-elem-selection.ms-selected'; - - that.qs1 = $selectableSearch.quicksearch(selectableSearchString) - .on('keydown', function(e){ - if (e.which === 40){ - that.$selectableUl.focus(); - return false; - } - }); - - that.qs2 = $selectionSearch.quicksearch(selectionSearchString) - .on('keydown', function(e){ - if (e.which == 40){ - that.$selectionUl.focus(); - return false; - } - }); + var that = this, + $selectableSearch = that.$selectableUl.prev(), + $selectionSearch = that.$selectionUl.prev(), + selectableSearchString = '#'+that.$container.attr('id')+' .ms-elem-selectable:not(.ms-selected)', + selectionSearchString = '#'+that.$container.attr('id')+' .ms-elem-selection.ms-selected'; + + that.qs1 = $selectableSearch.quicksearch(selectableSearchString) + .on('keydown', function(e){ + if (e.which === 40){ + that.$selectableUl.focus(); + return false; + } + }); + + that.qs2 = $selectionSearch.quicksearch(selectionSearchString) + .on('keydown', function(e){ + if (e.which == 40){ + that.$selectionUl.focus(); + return false; + } + }); }, afterSelect: function(){ - this.qs1.cache(); - this.qs2.cache(); + this.qs1.cache(); + this.qs2.cache(); }, afterDeselect: function(){ - this.qs1.cache(); - this.qs2.cache(); + this.qs1.cache(); + this.qs2.cache(); } });// Used to create multi-select css style @@ -38,52 +38,52 @@ $('#id_students').multiSelect({ selectableHeader: "", selectionHeader: "", afterInit: function(ms){ - var that = this, - $selectableSearch = that.$selectableUl.prev(), - $selectionSearch = that.$selectionUl.prev(), - selectableSearchString = '#'+that.$container.attr('id')+' .ms-elem-selectable:not(.ms-selected)', - selectionSearchString = '#'+that.$container.attr('id')+' .ms-elem-selection.ms-selected'; - - that.qs1 = $selectableSearch.quicksearch(selectableSearchString) - .on('keydown', function(e){ - if (e.which === 40){ - that.$selectableUl.focus(); - return false; - } - }); - - that.qs2 = $selectionSearch.quicksearch(selectionSearchString) - .on('keydown', function(e){ - if (e.which == 40){ - that.$selectionUl.focus(); - return false; - } - }); + var that = this, + $selectableSearch = that.$selectableUl.prev(), + $selectionSearch = that.$selectionUl.prev(), + selectableSearchString = '#'+that.$container.attr('id')+' .ms-elem-selectable:not(.ms-selected)', + selectionSearchString = '#'+that.$container.attr('id')+' .ms-elem-selection.ms-selected'; + + that.qs1 = $selectableSearch.quicksearch(selectableSearchString) + .on('keydown', function(e){ + if (e.which === 40){ + that.$selectableUl.focus(); + return false; + } + }); + + that.qs2 = $selectionSearch.quicksearch(selectionSearchString) + .on('keydown', function(e){ + if (e.which == 40){ + that.$selectionUl.focus(); + return false; + } + }); }, afterSelect: function(){ - this.qs1.cache(); - this.qs2.cache(); + this.qs1.cache(); + this.qs2.cache(); }, afterDeselect: function(){ - this.qs1.cache(); - this.qs2.cache(); + this.qs1.cache(); + this.qs2.cache(); } });// Used to create multi-select css style $('.collapse').on('show.bs.collapse', function (e) { if($(this).is(e.target)){ - var btn = $(this).parent().find('.fa-angle-right'); + var btn = $(this).parent().find('.fa-angle-right'); - btn.switchClass("fa-angle-right", "fa-angle-down", 250, "easeInOutQuad"); - } + btn.switchClass("fa-angle-right", "fa-angle-down", 250, "easeInOutQuad"); + } }); $('.collapse').on('hide.bs.collapse', function (e) { if($(this).is(e.target)){ - var btn = $(this).parent().find('.fa-angle-down'); + var btn = $(this).parent().find('.fa-angle-down'); - btn.switchClass("fa-angle-down", "fa-angle-right", 250, "easeInOutQuad"); - } + btn.switchClass("fa-angle-down", "fa-angle-right", 250, "easeInOutQuad"); + } }); $('.begin_date_input').on('click', function () { diff --git a/pendencies/models.py b/pendencies/models.py index 396f79d..04e032a 100644 --- a/pendencies/models.py +++ b/pendencies/models.py @@ -5,7 +5,7 @@ from django.utils.translation import ugettext_lazy as _ from topics.models import Resource class Pendencies(models.Model): - action = models.CharField(_('Action'), max_length = 100, choices = (("view", _("Visualize")), ("create", _("Create")), ("answer", _("Answer")), ("access", _("Access"))), blank = True) + action = models.CharField(_('Action'), max_length = 100, choices = (("view", _("Visualize")), ("create", _("Create")), ("answer", _("Answer")), ("access", _("Access")), ("finish", _("Finish"))), blank = True) begin_date = models.DateTimeField(_('Begin Date'), null = True, blank = True) end_date = models.DateTimeField(_('End Date'), null = True, blank = True) limit_date = models.DateTimeField(_('Limit Date'), null = True, blank = True) diff --git a/youtube_video/forms.py b/youtube_video/forms.py index 4a8d253..3a123a5 100644 --- a/youtube_video/forms.py +++ b/youtube_video/forms.py @@ -12,6 +12,7 @@ from .models import YTVideo class YTVideoForm(forms.ModelForm): subject = None + control_subject = forms.CharField(widget = forms.HiddenInput()) def __init__(self, *args, **kwargs): super(YTVideoForm, self).__init__(*args, **kwargs) @@ -22,6 +23,8 @@ class YTVideoForm(forms.ModelForm): self.subject = self.instance.topic.subject self.initial['tags'] = ", ".join(self.instance.tags.all().values_list("name", flat = True)) + self.initial['control_subject'] = self.subject.id + self.fields['students'].queryset = self.subject.students.all() self.fields['groups'].queryset = self.subject.group_subject.all() diff --git a/youtube_video/models.py b/youtube_video/models.py index 1b939ec..bc10eed 100644 --- a/youtube_video/models.py +++ b/youtube_video/models.py @@ -20,7 +20,7 @@ class YTVideo(Resource): return 'webpages:view' def update_link(self): - return 'webpages:update' + return 'youtube:update' def delete_link(self): return 'webpages:delete' diff --git a/youtube_video/templates/youtube/_form.html b/youtube_video/templates/youtube/_form.html index 4615924..e0700a9 100644 --- a/youtube_video/templates/youtube/_form.html +++ b/youtube_video/templates/youtube/_form.html @@ -102,98 +102,104 @@
{% trans 'Wished period' %}:
-{% trans 'Wished period' %}:
+