commit
1ae028cf15
9 changed files with 174 additions and 36 deletions
@ -0,0 +1,92 @@ |
|||||||
|
{% extends "templates/lilcity/index.html" %} {% load static %} {% block content %} |
||||||
|
<div class="section"> |
||||||
|
<div class="section__center center"> |
||||||
|
<div class="profile"> |
||||||
|
<a class="profile__btn profile__btn_edit btn" href="#">Редактировать</a> |
||||||
|
{% if user.photo %} |
||||||
|
<div class="profile__ava ava"> |
||||||
|
<img class="ava__pic" src="{{ user.photo.url }}"> |
||||||
|
</div> |
||||||
|
{% else %} |
||||||
|
<div class="profile__ava ava"> |
||||||
|
<img class="ava__pic" src="{% static 'img/user.jpg' %}"> |
||||||
|
</div> |
||||||
|
{% endif %} |
||||||
|
<div class="profile__wrap"> |
||||||
|
<div class="profile__name">{{ user.get_full_name }}</div> |
||||||
|
<div class="profile__share share share_sm"> |
||||||
|
<div class="share__list"> |
||||||
|
{% if user.facebook %} |
||||||
|
<a class="share__item" href="#"> |
||||||
|
<svg class="icon icon-share-facebook"> |
||||||
|
<use xlink:href="{% static 'img/sprite.svg' %}#icon-share-facebook"></use> |
||||||
|
</svg> |
||||||
|
</a> |
||||||
|
{% endif %} {% if user.instagram %} |
||||||
|
<a class="share__item" href="#"> |
||||||
|
<svg class="icon icon-share-instagram"> |
||||||
|
<use xlink:href="{% static 'img/sprite.svg' %}#icon-share-instagram"></use> |
||||||
|
</svg> |
||||||
|
</a> |
||||||
|
{% endif %} {% if user.twitter %} |
||||||
|
<a class="share__item" href="#"> |
||||||
|
<svg class="icon icon-share-twitter"> |
||||||
|
<use xlink:href="{% static 'img/sprite.svg' %}#icon-share-twitter"></use> |
||||||
|
</svg> |
||||||
|
</a> |
||||||
|
{% endif %} {% if user.google %} |
||||||
|
<a class="share__item" href="#"> |
||||||
|
<svg class="icon icon-share-google"> |
||||||
|
<use xlink:href="{% static 'img/sprite.svg' %}#icon-share-google"></use> |
||||||
|
</svg> |
||||||
|
</a> |
||||||
|
{% endif %} {% if user.pinterest %} |
||||||
|
<a class="share__item" href="#"> |
||||||
|
<svg class="icon icon-share-pinterest"> |
||||||
|
<use xlink:href="{% static 'img/sprite.svg' %}#icon-share-pinterest"></use> |
||||||
|
</svg> |
||||||
|
</a> |
||||||
|
{% endif %} |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<div class="profile__content"> |
||||||
|
{{ user.about }} |
||||||
|
</div> |
||||||
|
<div class="profile__foot"> |
||||||
|
<a class="profile__btn btn" href="#">Изменить</a> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<div class="section section_gray section_tabs"> |
||||||
|
<div class="section__center center"> |
||||||
|
<div class="tabs js-tabs"> |
||||||
|
<div class="tabs__nav"> |
||||||
|
<button class="tabs__btn js-tabs-btn">ПРИОБРЕТЕННЫЕ |
||||||
|
<span class="mobile-hide">КУРСЫ</span> |
||||||
|
</button> |
||||||
|
<button class="tabs__btn js-tabs-btn active">ОПУБЛИКОВАННЫЕ |
||||||
|
<span class="mobile-hide">КУРСЫ</span> |
||||||
|
</button> |
||||||
|
</div> |
||||||
|
<div class="tabs__container"> |
||||||
|
<div class="tabs__item js-tabs-item"> |
||||||
|
<div class="courses courses_scroll"> |
||||||
|
<div class="courses__list"> |
||||||
|
{% include "course/course_items.html" with course_items=paid %} |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<div class="tabs__item js-tabs-item" style="display: block;"> |
||||||
|
<div class="courses courses_scroll"> |
||||||
|
<div class="courses__list"> |
||||||
|
{% include "course/course_items.html" with course_items=published %} |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
{% endblock content %} |
||||||
@ -1,3 +1,18 @@ |
|||||||
from django.shortcuts import render |
from django.shortcuts import render |
||||||
|
from django.views.generic import DetailView |
||||||
|
from django.contrib.auth import get_user_model |
||||||
|
|
||||||
# Create your views here. |
from apps.course.models import Course |
||||||
|
|
||||||
|
User = get_user_model() |
||||||
|
|
||||||
|
|
||||||
|
class UserView(DetailView): |
||||||
|
model = User |
||||||
|
template_name = 'user/profile.html' |
||||||
|
|
||||||
|
def get_context_data(self, object): |
||||||
|
context = super().get_context_data() |
||||||
|
context['published'] = Course.objects.filter(author=self.object, status=Course.PUBLISHED) |
||||||
|
context['paid'] = Course.objects.none() |
||||||
|
return context |
||||||
|
|||||||
File diff suppressed because one or more lines are too long
Loading…
Reference in new issue