Commit a61f25fb9d57057e247ea84620c5d03ed10d6361
Exists in
master
and in
5 other branches
Merge branch 'dev' of https://github.com/amadeusproject/amadeuslms into dev
Showing
3 changed files
with
10 additions
and
25 deletions
Show diff stats
courses/static/js/topic_editation_presentation.js
... | ... | @@ -6,7 +6,7 @@ $(document).ready(function(){ |
6 | 6 | function show_editation(id_topic){ |
7 | 7 | $(".presentation_"+ id_topic).hide(); |
8 | 8 | $(".editation_"+ id_topic).show(); |
9 | - $('#summernote').summernote({height: 300}); | |
9 | + $(".editation_"+ id_topic).find('#summernote').summernote({height: 300}); | |
10 | 10 | }; |
11 | 11 | |
12 | 12 | function show_presentation(id_topic){ | ... | ... |
courses/templates/subject/index.html
... | ... | @@ -9,7 +9,6 @@ |
9 | 9 | <script type="text/javascript" src="{% static 'js/modals_requisitions.js' %}"></script> |
10 | 10 | <script type = "text/javascript" src="{% static 'js/topic_editation_presentation.js' %}"></script> |
11 | 11 | <script type = "text/javascript" src="{% static 'js/links.js' %}"></script> |
12 | - <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script> | |
13 | 12 | <script src="{% static 'js/modal_poll.js' %}"></script> |
14 | 13 | {% endblock %} |
15 | 14 | ... | ... |
courses/views.py
... | ... | @@ -447,28 +447,11 @@ class IndexCatView(LoginRequiredMixin, generic.ListView): |
447 | 447 | |
448 | 448 | login_url = reverse_lazy("core:home") |
449 | 449 | redirect_field_name = 'next' |
450 | - queryset = CourseCategory.objects.all() | |
450 | + queryset = sorted(CourseCategory.objects.all(),key = lambda x:x.name) | |
451 | 451 | template_name = 'category/index.html' |
452 | 452 | context_object_name = 'categories' |
453 | 453 | paginate_by = 5 |
454 | - | |
455 | - def get_context_data(self, **kwargs): | |
456 | - context = super(IndexCatView, self).get_context_data(**kwargs) | |
457 | - list_cat = CourseCategory.objects.filter(course_category = True).order_by('name') | |
458 | - paginator = Paginator(list_cat, self.paginate_by) | |
459 | - page = self.request.GET.get('page') | |
460 | - | |
461 | - try: | |
462 | - list_cat = paginator.page(page) | |
463 | - except PageNotAnInteger: | |
464 | - list_cat = paginator.page(1) | |
465 | - except EmptyPage: | |
466 | - list_cat = paginator.page(paginator.num_pages) | |
467 | - | |
468 | - context['list_cat'] = list_cat | |
469 | - | |
470 | - return context | |
471 | - | |
454 | + | |
472 | 455 | class CreateCatView(LoginRequiredMixin, HasRoleMixin, generic.edit.CreateView): |
473 | 456 | |
474 | 457 | allowed_roles = ['professor', 'system_admin'] |
... | ... | @@ -479,7 +462,8 @@ class CreateCatView(LoginRequiredMixin, HasRoleMixin, generic.edit.CreateView): |
479 | 462 | success_url = reverse_lazy('course:manage_cat') |
480 | 463 | |
481 | 464 | def get_success_url(self): |
482 | - messages.success(self.request, _('Category created successfully!')) | |
465 | + objeto = self.object.name | |
466 | + messages.success(self.request, _('Category "%s" created successfully!')%(objeto)) | |
483 | 467 | return reverse_lazy('course:manage_cat') |
484 | 468 | |
485 | 469 | class UpdateCatView(LoginRequiredMixin, HasRoleMixin, generic.UpdateView): |
... | ... | @@ -490,11 +474,13 @@ class UpdateCatView(LoginRequiredMixin, HasRoleMixin, generic.UpdateView): |
490 | 474 | template_name = 'category/update.html' |
491 | 475 | model = CourseCategory |
492 | 476 | form_class = CategoryCourseForm |
477 | + success_url = reverse_lazy('course:manage_cat') | |
493 | 478 | |
494 | 479 | def get_success_url(self): |
495 | - messages.success(self.request, _('Category updated successfully!')) | |
496 | - return reverse_lazy('course:update_cat', kwargs={'slug' : self.object.slug}) | |
497 | - | |
480 | + objeto = self.object.name | |
481 | + messages.success(self.request, _('Category "%s" updated successfully!')%(objeto)) | |
482 | + #return reverse_lazy('course:update_cat', kwargs={'slug' : self.object.slug}) | |
483 | + return reverse_lazy('course:manage_cat') | |
498 | 484 | class DeleteCatView(LoginRequiredMixin, HasRoleMixin, generic.DeleteView): |
499 | 485 | |
500 | 486 | allowed_roles = ['professor', 'system_admin'] | ... | ... |