You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

446 lines
30 KiB

{% extends 'base_index.html' %}
{% load static %}
{% block page_title %}Профиль{% endblock %}
{% block title %}{% if in_user %}{{ in_user.get_short_name }}{% else %}{{ request.user.get_short_name }}{% endif %}{% endblock %}
<meta name="description" content="{% block head_description1 %}{{ in_user.in_role }} - {{ in_user.get_full_name }}{% endblock %}" />
<meta property="og:title" content="{% block head_title %}{{ in_user.in_role }} - {{ in_user.get_full_name }}{% endblock %}" />
<meta property="og:description" content="{% block head_description2 %}{{ NAME }}{% endblock %}" />
<meta property="og:image" content="{% block head_image %}{{ in_user.get_image_url }}{% endblock %}" />
{% block head %}
<link rel="stylesheet" href="/static/css/pie_chart.css" type="text/css" />
{% endblock %}
{% block content %}
<!-- main -->
<div class="col">
<!-- main header -->
<div class="bg-light lter b-b wrapper-md m-b-md" style="padding-bottom: 5px; padding-top:5px;">
<div class="row">
{% for key, values in achievements.items %}
{% for i in values %}
<a type="button" style="border-bottom: 0;" onclick="show_achievement('{{ i.id }}', '{{ i.title }}', '{{ i.text }}', '{{ i.achievement.image.url }}', '{{ i.achievement.border }}', '{{ i.achievement.background }}')">
<img src="{{ i.achievement.image.url }}" alt="{{ i.achievement.title }}" title="{{ i.achievement.title }}" class="m-b-xs" style="background:{{ i.achievement.background }};padding: 5px; border-radius:3px;margin: 5px;height: 25px;">
</a>
{% endfor %}
<span style="border: 1px dotted #999;
position: relative;
top: 2px;"></span>
{% endfor %}
</div>
</div>
<!-- main header -->
<div class="col-sm-5">
<div class="panel b-a">
<div class="panel panel-default" style="margin-bottom: 0; background: #fff;">
<div class="panel-heading b-b b-light font-bold">
<small class="text-muted">{% if in_user %}{% if in_user.unique_role %}<i class="glyphicon glyphicon-star" style="color:#fcb813;"></i> {{ in_user.unique_role }}{% else %}<i class="glyphicon glyphicon-check" style=" margin-right: 5px;"></i> {{ in_user.get_in_role_display }}{% endif %}
{% else %}{% if request.user.unique_role %}<i class="glyphicon glyphicon-star" style="color:#fcb813;"></i> {{ request.user.unique_role }}{% else %}<i class="glyphicon glyphicon-check" style=" margin-right: 5px;"></i>{{ request.user.get_in_role_display }}{% endif %}{% endif %}</small>
<span style="float: right; color: #666;"> {% if in_user %}
<small class="text-muted" style="{% if in_user.status == 'ON' %}color:green;{% endif %}font-weight: bold;">
{% if in_user.status == 'ON' %}<i class="glyphicon glyphicon-ok-sign" title="{{ request.user.get_status_display }}" style=" margin-right: 2px;"></i> {% else %}<i class="glyphicon glyphicon-time" style=" margin-right: 2px;"></i>{% endif %}
<span class="hidden-xs">{{ in_user.get_status_display }}</span></small>
{% else %}
<small class="text-muted" style="{% if request.user.status == 'ON' %}color:green;{% endif %}font-weight: bold;">
{% if request.user.status == 'ON' %}<i title="{{ request.user.get_status_display }}" class="glyphicon glyphicon-ok-sign" style=" margin-right: 2px;"></i> {% else %}<i class="glyphicon glyphicon-time" style=" margin-right: 2px;"></i>{% endif %}
<span class="hidden-xs">{{ request.user.get_status_display }}</span></small>
{% endif %}</span>
</div>
<div class="panel-body" style=" background: url({% if in_user %}{{ in_user.get_image_url }}{% else %}{{ request.user.get_image_url }}{% endif %}) no-repeat center center; min-height: 300px;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;">
</div>
</div>
</div>
<div class="panel b-a">
<div class="panel panel-default" style="margin-bottom: 0;">
<div class="panel-heading font-bold">
Основная информация <i class="glyphicon glyphicon-user" style="float: right; color:#333;"></i>
</div>
<div class="panel-body">
<h3 style="font-weight: bold;margin-top:0;text-align: left; margin-bottom: 0;" reloader_name="fname">{% if in_user %}{{ in_user.fname }}{% else %}{{ request.user.fname }}{% endif %}</h3>
<h3 style="font-weight: bold;text-align: left;margin-top: 5px; margin-bottom: 0;" reloader_name="name">{% if in_user %}{{ in_user.name }}{% else %}{{ request.user.name }}{% endif %}</h3>
<h3 style="font-weight: bold;text-align: left;margin-top: 5px; margin-bottom: 0;" reloader_name="oname">{% if in_user %}{{ in_user.oname }}{% else %}{{ request.user.oname }}{% endif %}</h3>
<h3 reloader_name="city" style="text-align: left;margin-top: 5px; margin-bottom: 0;font-size: 18px;">{% if in_user %}{{ in_user.city }}{% else %}{{ request.user.city }}{% endif %}</h3>
{% if not in_user %}<p style="text-align: left;margin-top: 5px; margin-bottom: 0;"><a type="button" onclick="set_settings_data()" style="color: blue;border-bottom: 1px dotted;">Изменить данные</a></p>{% endif %}
<hr>
<span style="color: #666;"> {% if in_user %}
<small class="text-muted">Регистрации: {{ in_user.date_joined }}</small>
{% else %}
<small class="text-muted">Регистрации: {{ request.user.date_joined }}</small>
{% endif %}</span>
</div>
</div>
</div>
{% if not in_user %}
<div class="panel b-a">
<div class="panel panel-default" style="margin-bottom: 0;">
<div class="panel-heading font-bold">
Настройки приватности <i class="glyphicon glyphicon-lock" style="float: right; color: #666;"></i>
</div>
<div class="panel-body">
<p style=" float: left;
width: 100%;
border-bottom: 1px dotted #ccc;
padding-bottom: 10px;">
<i class="glyphicon glyphicon-link" style="margin-top: 7px;"></i> <input id="foo" style=" color: #0099CC;
width: 239px;
border: 0;" readonly value="{{ DOMAIN }}/{{ request.user.interactive_key }}">
<button id="copy_unique_user_id" class="btn" type="button" data-clipboard-action="copy" data-clipboard-target="#foo" style="float: right;" onclick="show_system_message('Ссылка скопирована')">
<i class="glyphicon glyphicon-duplicate"></i> <span class="hidden-xs hidden-sm">Скопировать</span>
</button>
</p>
<div class="col-sm-10">
<label class="i-switch bg-success m-t-xs m-r" onclick="change_private('A')">
<input type="radio" name="switch" {% if request.user.private == 'A' %}checked=""{% endif %}>
<i></i>
</label><b>Виден всем</b><br>
<label class="i-switch bg-info m-t-xs m-r" onclick="change_private('U')">
<input type="radio" name="switch" {% if request.user.private == 'U' %}checked=""{% endif %}>
<i></i>
</label><b>Только пользователям</b><br>
<label class="i-switch bg-primary m-t-xs m-r" onclick="change_private('L')">
<input type="radio" name="switch" {% if request.user.private == 'L' %}checked=""{% endif %}>
<i></i>
</label><b>По прямой ссылке</b><br>
<label class="i-switch bg-danger m-t-xs m-r" onclick="change_private('B')">
<input type="radio" name="switch" {% if request.user.private == 'B' %}checked=""{% endif %}>
<i></i>
</label><b>Только мне</b><br>
</div>
</div>
</div>
</div>
{% endif %}
<div class="panel b-a">
<div class="panel panel-default" style="margin-bottom: 0;">
<div class="panel-heading font-bold">
Ваши курсы <span style="float: right; color: #666;white-space:nowrap;"><i class="glyphicon glyphicon-education" style="margin-right:2px;"></i> <span class="hidden-sm hidden-xs">Всего:</span> {{ courses|length }} <span class="visible-xs" style="font-weight:bold;">/</span> <span style="color: green;"><span class="hidden-sm hidden-xs">Пройдено:</span> {{ completed_courses }}</span></span>
</div>
<div class="panel-body">
{% for i in courses %}
<div style=" width: 100%;
float: left;
border-bottom: 1px solid #f1f1f1;
margin-bottom: 10px;
background: #fff;
padding: 15px;clear: both;">
<div style="float: left;width: 49%;padding-right: 1%;">
<div style="font-weight: bold;
font-size: 16px;
color: #000;
margin-bottom: 10px;">{{ i.title }}</div>
<div style=" margin-bottom: 15px;width: 100%;">
<div class="progress progress-sm progress-striped m-t-xs m-b" style=" margin-bottom: 0;
border-radius: 10px;
height: 15px;
line-height: 36px;">
<div class="progress-bar {% if i.progress == 100 %}bg-success{% else %}bg-warning{% endif %} text-black" data-toggle="tooltip" data-original-title="{{ i.progress }}" style="width: {{ i.progress }}%; min-width: 2.5em; line-height: 14px;
color: #fff;
font-size: 14px;
font-weight: bold;">{{ i.progress }} %</div>
</div>
</div>
<div style="width: 100%;">
<div style="float: left;width: 100%;"><a href="/courses/{{ i.course_id }}" class="btn btn-default" target="_blank" style="border-radius: 3px;width: 100%;">Страница курса</a></div>
</div>
</div>
{% if i.teacher %}
<div style="float: right;width: 50%;margin-top: 10px;">
<div style="float: right;">
<div class="text-center clearfix " style="border-radius: 0 0 5px 5px;padding-bottom: 10px;">
<img src="{{ i.teacher.get_image_url }}" alt="..." class="img-circle" style="height: auto;width: 60px;">
</div>
</div>
<div style="text-align: right;float: right;">
<p style="color: #70aadd; margin: 7px 0 0;">Ваш преподаватель</p>
<div style="font-weight: bold;font-size: 15px;">
<span>{{ i.teacher.fname }} {{ i.teacher.name }}</span><br>
<span>{{ i.teacher.oname }}</span>
</div>
<p><a href="/{{ i.teacher.interactive_key }}" target="_blank" style="color: #999;border-bottom: 1px dotted;">Профиль</a></p>
</div>
</div>
{% endif %}
</div>
{% empty %}
<h3 style="font-weight: bold;text-align: center;margin: 10px 0;">На изучении курсов нет</h3>
{% endfor %}
</div>
<div class="panel-footer" style="text-align: right;background: #f1f1f1;">
<a href="/courses/" target="_blank" class="auto" style="color: #999;border: 0;">
<i class="glyphicon glyphicon-th" style="margin-right: 5px;"></i>
<span>Наши курсы</span>
</a>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading font-bold">Ваши очки навыков <span style="float: right; color: #666;"><i class="glyphicon glyphicon-ok-sign"></i> {{ skills_size }}</span></div>
<!-- <a href="" class="text-muted m-t-sm m-l inline" ng-click="data=[40, 40, 20]"><i class="icon-pie-chart"></i></a> -->
<div class="text-center wrapper m-b-sm" style="width: 100%">
{% if skills %}
<div id="pieChart" class="chart" style="width: 100%;height: 250px;"></div>
{% else %}
<h3 style="font-weight: bold;text-align: center;margin: 10px 0;">Навыков не получено</h3>
{% endif %}
</div>
<ul class="list-group no-radius">
{% for key, value in skills.items %}
<li class="list-group-item" name="skill_row" skill_title="{{ key }}" skill_color="{{ value.color }}" skill_value={{ value.size }}>
<span class="pull-right"><b>{{ value.size }}</b> очков</span>
<span class="label font-normal text-white" style="background: {{ value.color }};font-size: 14px;">{% if value.icon %}<img src="{{ value.icon.url }}" style="margin-top: -1px;width: 15px;
height: 15px;
margin-right: 5px;">{% endif %}{{ key }}</span>
</li>
{% endfor %}
<li class="list-group-item" style="font-weight:bold;">
<span class="pull-right"><b>{{ skills_size }}</b> очков</span>
<!-- <span class="label bg-danger">5</span> -->
Итого:
</li>
</ul>
</div>
{% if documents %}
<div class="panel panel-default">
<div class="panel-heading font-bold">Документы <span style="float: right; color: #666;"><i class="glyphicon glyphicon-book" style="float: right; color: #666;"></i> {{ documents|length }}</span></div>
<ul class="list-group no-radius">
{% for doc in documents %}
{% if doc.file %}<a href="{{ doc.file.url }}" target="_blank">{% endif %}<li class="list-group-item">
<span class="pull-right"><b>{{ doc.get_status_display }}</b> </span>
<span class="label font-normal text-white" style="font-size: 14px;color: #333;">
<i class="glyphicon glyphicon-file" style="margin-top: -1px;width: 15px;height: 15px;margin-right: 5px;"></i>{{ doc.title }}
</span>
</li>{% if doc.file %}</a>{% endif %}
{% endfor %}
</ul>
</div>
{% endif %}
{% if b_bills %}
<div class="panel panel-default">
<div class="panel-heading font-bold">Счета <span style="float: right; color: #666;"><i class="glyphicon glyphicon-credit-card"></i> {{ b_bills|length }}</span></div>
<ul class="list-group no-radius">
<style>
li.green:hover{
background: #dff0d8;
}
</style>
{% for b in b_bills %}
{% if b.file %}<a href="{{ b.file.url }}" target="_blank">{% endif %}<li class="list-group-item green" {% if b.status == 'W' or b.status == 'P' or b.status == 'C' %}onclick="accept_bill({{ b.id }})"{% endif %}>
<span class="pull-right"><b>{% if b.status == 'F' %}<i class="glyphicon glyphicon-saved" style="margin-right: 2px;
color: green;"></i>{% endif %}{{ b.get_status_display }}</b> </span>
<p class="label font-normal text-white" style="font-size: 14px;color: #333;white-space:normal;text-shadow: 0 0 0;">
<i class="{% if b.gift %}glyphicon glyphicon-gift{% else %}glyphicon glyphicon-barcode{% endif %}" style="margin-top: -1px;width: 15px;height: 15px;margin-right: 5px;"></i>{{ b.get_name }}
</p>
</li>{% if bill.file %}</a>{% endif %}
{% endfor %}
</ul>
</div>
{% endif %}
</div>
<div class="col-sm-7">
<div class="panel b-a panel-default">
<div class="panel-heading b-b b-light font-bold">
Ваши дипломы <span style="float: right; color: #666;"><i class="glyphicon glyphicon-briefcase"></i> {{ diploms|length }}</span>
</div>
<ul class="list-group list-group-lg no-bg auto">
{% for i in diploms %}
<li class="list-group-item clearfix">
<span class="pull-left avatar m-r">
<img src="{{ i.material.icon.url }}" class="no-radius" alt="..." style="max-width:150px;">
<i class="on b-white bottom"></i>
</span>
<span class="clear">
<span>Успешное прохождение курса: {{ i.material.course.get_title }}</span><br><br>
<small class="text-muted clear text-ellipsis">Выдан {{ i.date }}</small>
</span>
<div class="btn btn-default btn-xs btn-info fancy" href="#diplom" onclick="load_diplome_cart('{{ i.in_image.url }}', '{{ i.material.course.get_title }}', '{{ i.key }}', '{{ i.date }}')">Посмотреть диплом</div>
</li>
{% empty %}
<li class="list-group-item clearfix"><h3 style="font-weight: bold;text-align: center;margin: 10px 0;">Дипломов не получено</h3></li>
{% endfor %}
</ul>
</div>
<div class="panel b-a panel-default">
<div class="panel-heading b-b b-light font-bold">
Ваши достижения <span style="float: right; color: #666;"><i class="glyphicon glyphicon-star"></i> {{ got_achievements }}</span>
</div>
<div class="panel-body text-center p-t-none">
{% for key, values in achievements.items %}
<div class="panel b-none m-b-xs">
<div class="panel-heading p-none text-left no-bg">
{{ key }}
</div>
<div class="panel-body text-center p-l-none p-r-none">
{% for i in values %}
<a type="button" style="border-bottom: 0;" onclick="show_achievement('{{ i.id }}', '{{ i.title }}', '{{ i.text }}', '{{ i.achievement.image.url }}', '{{ i.achievement.border }}', '{{ i.achievement.background }}')">
<div class="m-b inline m-r-lg v-top">
<div class="thumb-xl">
<img src="{{ i.achievement.icon.url }}" alt="..." class="m-b-xs" style=" width: 125px;">
<small class="block"><span class="fa fa-check-circle text-success"></span> {{ i.achievement.title }}</small>
</div>
</div>
</a>
{% endfor %}
</div>
</div>
{% empty %}
<h3 style="text-align: center; font-weight: bold">Достижений еще нет</h3>
{% endfor %}
</div>
<div class="panel-footer" style="text-align: right;background: #f1f1f1;">
<a href="/courses/achievements/" target="_blank" class="auto" style="color: #999;border: 0;">
<i class="glyphicon glyphicon-th" style="margin-right: 5px;"></i>
<span>Доступные достижения</span>
</a>
</div>
</div>
<div class="panel b-a panel-default">
<div class="panel-heading b-b b-light font-bold">
Вопросы на <a href="/forum" target="_blank" style="color: #70aadd;padding-bottom: 5px;">форуме</a> <span style="float: right; color: #666;"><i class="glyphicon glyphicon-question-sign"></i> {{ forum_ask|length }}</span>
</div>
<div class="panel-body text-center p-t-none">
{% for key, values in forum_ask.items %}
<div class="panel b-none m-b-xs">
<div class="panel-heading p-none text-left no-bg">
{{ key }}
</div>
<div class="panel-body text-center p-l-none p-r-none">
{% for i in values %}
<a type="button" onclick="show_achievement('{{ i.id }}', '{{ i.title }}', '{{ i.text }}', '{{ i.achievement.image.url }}', '{{ i.achievement.border }}', '{{ i.achievement.background }}')">
<div class="m-b inline m-r-lg v-top">
<div class="thumb-xl">
<img src="{{ i.achievement.icon.url }}" alt="..." class="m-b-xs" style=" width: 125px;">
<small class="block"><span class="fa fa-check-circle text-success"></span> {{ i.achievement.title }}</small>
</div>
</div>
</a>
{% endfor %}
</div>
</div>
{% empty %}
<h3 style="text-align: center; font-weight: bold">Вопросов еще не было</h3>
{% endfor %}
</div>
<div class="panel-footer" style="text-align: right;background: #f1f1f1;">
<a href="/library/articles/" class="auto" style="color: #999;border: 0;">
<i class="glyphicon glyphicon-ok-circle" style="margin-right: 5px;"></i>
<span>Форум</span>
</a>
</div>
</div>
<div class="panel b-a panel-default">
<div class="panel-heading b-b b-light font-bold">
Ответы на <a href="/forum" target="_blank" style="color: #70aadd;padding-bottom: 5px;">форуме</a> <span style="float: right; color: #666;"><i class="glyphicon glyphicon-ok-circle" style="margin-right:2px;"></i> <span class="hidden-sm hidden-xs">Всего: </span>{{ forum_ans.all|length }} <span style="color: green;"><span class="hidden-sm hidden-xs">Лучшие:</span> {{ forum_ans.best }}</span></span>
</div>
<div class="panel-body text-center p-t-none">
{% for key, values in forum_ans.all.items %}
<div class="panel b-none m-b-xs">
<div class="panel-heading p-none text-left no-bg">
{{ key }}
</div>
<div class="panel-body text-center p-l-none p-r-none">
{% for i in values %}
<a type="button" onclick="show_achievement('{{ i.id }}', '{{ i.title }}', '{{ i.text }}', '{{ i.achievement.image.url }}', '{{ i.achievement.border }}', '{{ i.achievement.background }}')">
<div class="m-b inline m-r-lg v-top">
<div class="thumb-xl">
<img src="{{ i.achievement.icon.url }}" alt="..." class="m-b-xs" style=" width: 125px;">
<small class="block"><span class="fa fa-check-circle text-success"></span> {{ i.achievement.title }}</small>
</div>
</div>
</a>
{% endfor %}
</div>
</div>
{% empty %}
<h3 style="text-align: center; font-weight: bold">Ответов еще не было</h3>
{% endfor %}
</div>
<div class="panel-footer" style="text-align: right;background: #f1f1f1;">
<a href="/library/articles/" class="auto" style="color: #999;border: 0;">
<i class="glyphicon glyphicon-ok-circle" style="margin-right: 5px;"></i>
<span>Форум</span>
</a>
</div>
</div>
<div class="panel b-a panel-default">
<div class="panel-heading b-b b-light font-bold">
Прочитанные <a href="/library/articles/" target="_blank" style="color: #70aadd;padding-bottom: 5px;">статьи</a> <span style="float: right; color: #666;"><i class="glyphicon glyphicon-book"></i> {{ articles|length }}</span>
</div>
<div class="panel-body text-center p-t-none" style="max-height: 300px;overflow: hidden;
overflow-y: auto;padding-top: 10px !important;">
{% for article in articles %}
<div class="panel b-none m-b-xs" style=" background: #f1f1f1;
padding: 0 5px;
border-radius: 3px;">
<div class="panel-heading p-none text-left no-bg" style=" font-weight: bold;">
{{ article.title }}
</div>
</div>
{% empty %}
<h3 style="text-align: center; font-weight: bold">Нет прочитанного</h3>
{% endfor %}
</div>
<div class="panel-footer" style="text-align: right;background: #f1f1f1;">
<a href="/library/articles/" class="auto" style="color: #999;border: 0;">
<i class="glyphicon glyphicon-book" style="margin-right: 5px;"></i>
<span>База знаний</span>
</a>
</div>
</div>
<!-- -->
</div>
</div>
<!-- / main -->
<!-- right col -->
{% include 'right_site.html' %}
{% endblock %}
{% block js %}
<script src="/static/js/pie_chart.js"></script>
<script src="/static/js/profile.js"></script>
<script src="/static/js/clipboard.min.js"></script>
<script>
$(function(){
{% if skills %}
result = [];
var skills = $('li[name=skill_row]');
for(var i=0;i<skills.length;i++){result.push({'title': $(skills[i]).attr('skill_title'), 'value': parseInt($(skills[i]).attr('skill_value'), 10), 'color':$(skills[i]).attr('skill_color')})}
$("#pieChart").drawPieChart(result);
{% endif %}
new Clipboard('#copy_unique_user_id');
});
</script>
<script> $('.fancy').fancybox();</script>
<div class="popup col-sm-6" id="diplom">
<div class="h3">
<p class="main">Просмотр диплома</p>
<p> о успешном завершении курса<br>
<span name="diploma_course"></span></p>
<p>Диплом #<span name="diploma_id"></span> от <span name="diploma_f_date"></span></p>
</div>
<div>
<img src="/static/img/diplom_inner.png" alt="" class="inner" name="diploma_image" style="max-width: 500px; height: auto;">
<a type="button" class="btn m-b-xs btn-sm btn-default btn-addon" href="" name="diploma_link" target="_blank"><i class="fa fa-file-pdf-o"></i>Скачать диплом</a>
</div>
</div>
{% endblock %}