Skip to content
Snippets Groups Projects
Commit ee64e79e authored by Антон Шалимов's avatar Антон Шалимов
Browse files

страница 'Студенты УКД' добавлена доп. кнопка 'Скрыть список'

parent 99cabf89
Branches
Tags
No related merge requests found
...@@ -6,6 +6,19 @@ ...@@ -6,6 +6,19 @@
{{ HTML.script('media/js/discipline/EditStudents.js')|raw }} {{ HTML.script('media/js/discipline/EditStudents.js')|raw }}
{% endblock %} {% endblock %}
{% macro outputStudent(Student, HTML) %}
<div id="{{ Student.ID }}" class="Student {% if Student.Type == 'detach' %}StatusUnbind{% else %}StatusBind{% endif %}">
<span class="Name">{{ Student.LastName }} {{ Student.FirstName }} {{ Student.SecondName }}</span>
{% if Student.Type == 'detach' %}
<button class="action Action_BindStudent">Прикрепить студента</button>
{% else %}
<button class="action Action_UnbindStudent">Отсоединить студента</button>
{% endif %}
</div>
{% endmacro %}
{% import 'teacher/discipline/EditStudents' as idx %}
{% block map_content %} {% block map_content %}
<div class="StudentsList"> <div class="StudentsList">
<input type="hidden" class="HiddenInputFacultyID" value="{{ Discipline.FacultyID }}"> <input type="hidden" class="HiddenInputFacultyID" value="{{ Discipline.FacultyID }}">
...@@ -13,28 +26,26 @@ ...@@ -13,28 +26,26 @@
<h2 class="BlueTitle">Прикрепленные студенты</h2> <h2 class="BlueTitle">Прикрепленные студенты</h2>
{% set NowGroupNum = -1 %} {% set NowGroupNum = -1 %}
{% for Student in Students %} {% for Student in Students %}
{% if NowGroupNum != Student.GroupNum %} {% if NowGroupNum != Student.GroupNum %}
{% if not loop.first %} {% if not loop.first %}
</div> </div>
{% endif %} {% endif %}
<div class="GradeAndGroupTitle ActionShowHideGroupContainer" id="{{ Student.GroupID }}"> <div class="GradeAndGroupTitle ActionShowHideGroupContainer" id="{{ Student.GroupID }}">
<span class="info">Курс {{ Student.GradeNum }}, Группа {{ Student.GroupNum }}</span> <span class="info">{{ Student.Degree ~ ', ' ~ Student.GradeNum }} Курс - Группа {{ Student.GroupNum }}</span>
<span class="Action">Открыть список ▼</span> <span class="Action">Открыть список ▼</span>
</div> </div>
<div class="GroupContainer GroupID_{{ Student.GroupID }}"> <div class="GroupContainer GroupID_{{ Student.GroupID }}">
<div class="hideListAction"></div>
{% set NowGroupNum = Student.GroupNum %} {% set NowGroupNum = Student.GroupNum %}
{% endif %} {% endif %}
<div id="{{ Student.ID }}" class="Student {% if Student.Type == 'detach' %}StatusUnbind{% else %}StatusBind{% endif %}">
<span class="Name">{{ Student.LastName }} {{ Student.FirstName }} {{ Student.SecondName }}</span> {{ idx.outputStudent(Student, HTML) }}
{% if Student.Type == 'detach' %}
<button class="action Action_BindStudent">Прикрепить студента</button>
{% else %}
<button class="action Action_UnbindStudent">Отсоединить студента</button>
{% endif %}
</div>
{% if loop.last %} {% if loop.last %}
</div> </div>
{% endif %} {% endif %}
{% endfor %} {% endfor %}
</div> </div>
<div class="SearchStudents"> <div class="SearchStudents">
......
...@@ -380,8 +380,20 @@ ...@@ -380,8 +380,20 @@
.StudentsList .GroupContainer { .StudentsList .GroupContainer {
display: none; display: none;
} }
.StudentsList .GroupContainer .hideListAction{
float: left;
background: url(icons/triangle_up.png) no-repeat center center #f9f9f9;
width: 40px;
height: 100%;
margin-top: 10px;
}
.StudentsList .GroupContainer .hideListAction:hover{
background-color: #e1e1e1;;
}
.StudentsList .Student { .StudentsList .Student {
margin: 10px 0; float: right;
width: 880px;
margin-top: 10px;
padding: 7px 10px; padding: 7px 10px;
} }
.StudentsList .Student .Name { .StudentsList .Student .Name {
......
~dev_rating/media/css/icons/triangle_up.png

198 B

...@@ -229,15 +229,30 @@ $('.StudentsList').on('click', 'button.Action_UnbindStudent', function(){ ...@@ -229,15 +229,30 @@ $('.StudentsList').on('click', 'button.Action_UnbindStudent', function(){
); );
}); });
// Показать/скрыть список студентов
$('.StudentsList').on('click', '.ActionShowHideGroupContainer', function(){ $('.StudentsList').on('click', '.ActionShowHideGroupContainer', function(){
if ($(this).next('.GroupContainer').css('display') == 'none') { var GroupContainer = $(this).next('.GroupContainer');
if (GroupContainer.css('display') == 'none') {
$(this).children('.Action').text('Скрыть список ▲'); $(this).children('.Action').text('Скрыть список ▲');
$(this).next('.GroupContainer').show(); GroupContainer.show();
GroupContainer.css('height', GroupContainer.height());
} }
else { else {
$(this).children('.Action').text('Открыть список ▼'); $(this).children('.Action').text('Открыть список ▼');
$(this).next('.GroupContainer').hide(); GroupContainer.hide('normal');
} }
}); });
$('.StudentsList').on('click', '.hideListAction', function(){
$(this).parent()
.hide('normal');
$(this).parent()
.prev()
.children('.Action')
.text('Открыть список ▼');
});
}); });
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment