Skip to content
This repository was archived by the owner on Jun 18, 2025. It is now read-only.

Commit 146a6f1

Browse files
committed
Полная пизда
Но за то теперь можно создавать тесты
1 parent 28e83a9 commit 146a6f1

9 files changed

Lines changed: 733 additions & 53 deletions

File tree

server.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,5 +58,9 @@ def test(id):
5858
def student():
5959
return render_template('profile-st.html')
6060

61+
@app.route('/teacher')
62+
def teacher():
63+
return render_template('teacher.html')
64+
6165
if __name__ == '__main__':
6266
app.run(debug=True)

static/css/desktop.css

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,3 @@
1-
.notification {
2-
visibility: hidden;
3-
min-width: 250px;
4-
background-color: var(--yellow);
5-
color: var(--text-color);
6-
text-align: center;
7-
border-radius: 4px;
8-
padding: 12px;
9-
position: fixed;
10-
z-index: 9999;
11-
left: 50%;
12-
top: 30px;
13-
transform: translateX(-50%);
14-
opacity: 0;
15-
transition: opacity 0.5s, visibility 0.5s;
16-
}
17-
18-
.notification.show {
19-
visibility: visible;
20-
opacity: 1;
21-
}
22-
23-
.spinner {
24-
display: inline-flex;
25-
align-items: center;
26-
justify-content: center;
27-
}
28-
29-
.spinner svg {
30-
animation: rotate 1s linear infinite;
31-
fill: currentColor;
32-
width: 1em;
33-
height: 1em;
34-
vertical-align: middle;
35-
}
36-
371
@keyframes rotate {
382
from {
393
transform: rotate(0deg);

static/css/styles.css

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,28 @@
44
@import url('card.css');
55
@import url('spacing.css');
66

7+
/*Удалить*/
8+
9+
.add-container{
10+
height: 100vh;
11+
margin-bottom: 0;
12+
}
13+
14+
.add-container>div{
15+
display: flex;
16+
flex-direction: column;
17+
align-items: center;
18+
justify-content: space-between;
19+
height: 100%;
20+
}
21+
22+
main{
23+
margin-bottom: 0;
24+
}
25+
26+
/**/
27+
28+
729
* {
830
margin: 0;
931
padding: 0;
@@ -468,4 +490,41 @@ input {
468490

469491
.back-to-top svg path {
470492
fill: white;
493+
}
494+
495+
496+
.notification {
497+
visibility: hidden;
498+
min-width: 250px;
499+
background-color: var(--yellow);
500+
color: var(--text-color);
501+
text-align: center;
502+
border-radius: 4px;
503+
padding: 12px;
504+
position: fixed;
505+
z-index: 9999;
506+
left: 50%;
507+
top: 30px;
508+
transform: translateX(-50%);
509+
opacity: 0;
510+
transition: opacity 0.5s, visibility 0.5s;
511+
}
512+
513+
.notification.show {
514+
visibility: visible;
515+
opacity: 1;
516+
}
517+
518+
.spinner {
519+
display: inline-flex;
520+
align-items: center;
521+
justify-content: center;
522+
}
523+
524+
.spinner svg {
525+
animation: rotate 1s linear infinite;
526+
fill: currentColor;
527+
width: 1em;
528+
height: 1em;
529+
vertical-align: middle;
471530
}

static/js/updateUser.js

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ function updateUserData() {
2121
})
2222
.then(response => {
2323
if (!response.ok) {
24-
return response.text().then(errorText => {
25-
console.log("Error text:", errorText);
26-
throw new Error(errorText); });
24+
return response.text().then(errorText => {
25+
console.log("Error text:", errorText);
26+
throw new Error(errorText); });
2727
}
2828
return response.json();
2929
})
@@ -40,6 +40,18 @@ function updateUserData() {
4040
fillElements('email', user.email || '');
4141
fillElements('phone', user.phone || '');
4242
fillElements('school', user.school || '');
43+
44+
45+
const adminElements = document.querySelectorAll(".admin");
46+
if (user.role === "admin") {
47+
adminElements.forEach(el => {
48+
el.style.display = 'flex';
49+
});
50+
} else {
51+
adminElements.forEach(el => {
52+
el.style.display = 'none';
53+
});
54+
}
4355
})
4456
.catch(error => {
4557
console.error('Ошибка:', error);

templates/base.html

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ <h2 id="custom-notification" class="notification h2"></h2>
3636
</div>
3737
<nav>
3838
<div class="desktop-nav">
39-
<a href="/olympiads" class="h6 bold">Олимпиады</a>
40-
<a href="/news" class="h6 bold">Новости</a>
41-
<a href="/library" class="h6 bold">Библиотека</a>
39+
<!-- <a href="/olympiads" class="h6 bold">Олимпиады</a> -->
40+
<!-- <a href="/news" class="h6 bold">Новости</a> -->
41+
<a href="/library" class="h6 bold">Олимпиады</a>
4242
</div>
4343
</nav>
4444
<nav class="mobile-menu">
@@ -49,16 +49,17 @@ <h2 id="custom-notification" class="notification h2"></h2>
4949
<path d="M6 6L18 18" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
5050
</svg>
5151
</button>
52-
<a href="/olympiads" class="h6 bold">Олимпиады</a>
53-
<a href="/news" class="h6 bold">Новости</a>
54-
<a href="/library" class="h6 bold">Библиотека</a>
55-
<a href="/favorites" class="h6 bold">Избранное</a>
52+
<!-- <a href="/olympiads" class="h6 bold">Олимпиады</a> -->
53+
<!-- <a href="/news" class="h6 bold">Новости</a> -->
54+
<a href="/library" class="h6 bold">Олимпиады</a>
55+
<!-- <a href="/favorites" class="h6 bold">Избранное</a> -->
5656
<a href="/login" class="h6 bold">Профиль</a>
5757
</div>
5858
</nav>
5959

6060
<div class="icons">
61-
<a href="/favorites" class="icon-link iconoir-favourite-book"></a>
61+
<!-- <a href="/favorites" class="icon-link iconoir-favourite-book"></a> -->
62+
<a href="/teacher" class="icon-link iconoir-learning admin" style="display: none;"></a>
6263
<a href="/login" class="icon-link iconoir-profile-circle"></a>
6364
</div>
6465
</header>

templates/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ <h3 class="h3">
1616
<a class="content-btn h5 bold" href="/login">Войти</a>
1717
</div>
1818
</section>
19-
<section class="first-container">
19+
<!-- <section class="first-container">
2020
<div>
2121
<h2 class="h2 line">Олимпиады</h2>
2222
<div class="add-olymp column">
@@ -109,7 +109,7 @@ <h5 class="h5 normal">
109109
<p id="timing" class="h5 bold orange">Скоро</p>
110110
</div>
111111
</div>
112-
</section>
112+
</section> -->
113113
{% endblock %}
114114
{% block scripts %}
115115
<script src="../static/js/script.js"></script>

templates/library.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
{% block title %}Библиотека материалов{% endblock %}
33
{% block content %}
44
<div class="column gap-10-20">
5-
<h2 class="h2 bold">Библиотека материалов</h2>
6-
<h3 class="h3 bold">Пробуй повторять темы с помощью тестов</h3>
5+
<!-- <h2 class="h2 bold">Библиотека материалов</h2>
6+
<h3 class="h3 bold">Пробуй повторять темы с помощью тестов</h3> -->
7+
<h2 class="h2 bold">Олимпиады для школьников</h2>
78
</div>
89
<section id="tests-container" class="lib-cards">
910

templates/profile-st.html

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ <h4 class="h4 bold school"></h4>
1414
<div>
1515
<h2 class="h2 bold">Участие в олимпиадах</h2>
1616
<div class="column good_olympiads">
17-
<h4 class="h4 normal">Математика для умных 2024</h4>
18-
<h4 class="h4 normal">Математика для умных 2024</h4>
1917
</div>
2018
</div>
2119
</div>

0 commit comments

Comments
 (0)