Add pending & draft courses to user profile page

remotes/origin/hasaccess
Ivlev Denis 8 years ago
parent 6c9b14ce79
commit d2a4513e01
  1. 21
      apps/user/templates/user/profile.html
  2. 6
      apps/user/views.py

@ -69,6 +69,13 @@
<button class="tabs__btn js-tabs-btn active">ОПУБЛИКОВАННЫЕ
<span class="mobile-hide">КУРСЫ</span>
</button>
<button class="tabs__btn js-tabs-btn">
<span class="mobile-hide">КУРСЫ</span>
НА МОДЕРАЦИИ
</button>
<button class="tabs__btn js-tabs-btn">ЧЕРНОВИК
<span class="mobile-hide">КУРСА</span>
</button>
</div>
<div class="tabs__container">
<div class="tabs__item js-tabs-item">
@ -85,6 +92,20 @@
</div>
</div>
</div>
<div class="tabs__item js-tabs-item">
<div class="courses courses_scroll">
<div class="courses__list">
{% include "course/course_items.html" with course_items=pending %}
</div>
</div>
</div>
<div class="tabs__item js-tabs-item">
<div class="courses courses_scroll">
<div class="courses__list">
{% include "course/course_items.html" with course_items=drafts %}
</div>
</div>
</div>
</div>
</div>
</div>

@ -27,6 +27,12 @@ class UserView(DetailView):
context['published'] = Course.objects.filter(
author=self.object, status=Course.PUBLISHED
)
context['pending'] = Course.objects.filter(
author=self.object, status=Course.PENDING
)
context['drafts'] = Course.objects.filter(
author=self.object, status=Course.DRAFT
)
context['paid'] = Course.objects.none()
return context

Loading…
Cancel
Save