diff --git a/courses/models.py b/courses/models.py index e3658e3..ac70427 100644 --- a/courses/models.py +++ b/courses/models.py @@ -65,9 +65,11 @@ class Course(models.Model): def show_subscribe(self): today = datetime.date.today() - return today >= self.init_register_date and today <= self.end_register_date + def duration(self): + return self.end_date - self.init_date + class Subject(models.Model): name = models.CharField(_('Name'), max_length = 100) diff --git a/courses/static/js/course.js b/courses/static/js/course.js index 9fdee96..9a16d64 100644 --- a/courses/static/js/course.js +++ b/courses/static/js/course.js @@ -63,4 +63,18 @@ function delete_course(url, course, message, return_url) { } }); }); +} +/* +* +* Function to load create course's form +* +*/ +function replicate_course(url, course) { + $.ajax({ + url: url, + data: {'form': course}, + success: function(data) { + $(".course_replicate_form").html(data); + } + }); } \ No newline at end of file diff --git a/courses/templates/course/course_card.html b/courses/templates/course/course_card.html index 8007078..1fb31f1 100644 --- a/courses/templates/course/course_card.html +++ b/courses/templates/course/course_card.html @@ -18,7 +18,7 @@ @@ -47,7 +47,7 @@