diff --git a/app/templates/results.html b/app/templates/results.html index 8f05f6f4..5c6be7d3 100644 --- a/app/templates/results.html +++ b/app/templates/results.html @@ -29,20 +29,20 @@

{% for item in columns %} - {{ item }} + {{ item }} {% endfor %} - - + + - {{ (stats[0] | string)[-5:] }} + {{ (stats[0] | string)[-5:] }} {% for item in stats[1:] %} - {{ item }} + {{ item }} {% endfor %} - - + + {% if not current_user.is_anonymous %} @@ -58,60 +58,58 @@

Cписок загрузок пользователя по критерию "{{current_user.criteria}}" {% endif %} - - {% if results.is_ended and not results.is_failed %} - - - - - - - - - - - {% for criterion_info in results.enabled_checks %} - - - - - {% set colors = {0.0: 'table-danger', 1.0: 'table-success'} %} - {% set result_labels = {0.0: 'Не пройдена', 1.0: 'Пройдена'} %} - - - - + + {% endfor %} + +
#ТестРезультат
- - {{ loop.index }}{{ criterion_info['name'] }} - {{ result_labels.get(criterion_info['score'], 'Частично пройдена') }} -
-
- {% for item in criterion_info.get('verdict', ["Пройдена!"] if criterion_info.get('score')==1.0 else + + {% if results.is_ended and not results.is_failed %} + + + + + + + + + + + {% for criterion_info in results.enabled_checks %} + + + + + {% set colors = {0.0: 'table-danger', 1.0: 'table-success'} %} + {% set result_labels = {0.0: 'Не пройдена', 1.0: 'Пройдена'} %} + + + + - - {% endfor %} - -
#ТестРезультат
{{ loop.index }}{{ criterion_info['name'] }} + {{ result_labels.get(criterion_info['score'], 'Частично пройдена') }} +
- {% endif %} + {{ item|safe }} + {% endfor %} - - {% if not current_user.is_anonymous and results.conv_pdf_fs_id %} -
-
- - - - Слайд из - -
- -
- {% endif %} +
+ {% endif %} + + {% if not current_user.is_anonymous and results.conv_pdf_fs_id %} +
+
+ + + + Слайд из + +
+
+ {% endif %} + + {% endblock %} diff --git a/assets/scripts/results.js b/assets/scripts/results.js index 3f43d45b..246c4dba 100644 --- a/assets/scripts/results.js +++ b/assets/scripts/results.js @@ -143,3 +143,36 @@ $(function(){ recheckStatus() } }); + +document.querySelectorAll('.toggleresult').forEach(item => { + item.addEventListener('click', event => { + const nextRow = item.parentNode.nextElementSibling; + if (nextRow.classList.contains('hidden')) { + nextRow.classList.remove('hidden'); + nextRow.classList.add('visible'); + } else { + nextRow.classList.add('hidden'); + nextRow.classList.remove('visible'); + } + }); +}); + +const toggleButtonResult = document.getElementById('toggleButtonResult'); +if (toggleButtonResult) { + toggleButtonResult.addEventListener('click', () => { + const button = document.getElementById('toggleButtonResult'); + if (button.innerHTML.trim() === '') { + button.innerHTML = ''; + document.querySelectorAll('.hidden').forEach(row => { + row.classList.remove('hidden'); + row.classList.add('visible'); + }); + } else { + button.innerHTML = ''; + document.querySelectorAll('.visible').forEach(row => { + row.classList.remove('visible'); + row.classList.add('hidden'); + }); + } + }); +} diff --git a/assets/styles/results.css b/assets/styles/results.css index 20c5d411..55b20b3c 100644 --- a/assets/styles/results.css +++ b/assets/styles/results.css @@ -34,3 +34,23 @@ .table { margin-bottom: 0 !important; } + +.hidden { + display: none; +} + +.visible { + display: table-row; +} + +.flat-button { + border: none; + background: none; + padding: 0; + margin: 0; + cursor: pointer; +} + +.raw-button { + cursor: pointer; +}