Skip to content

Commit

Permalink
CSS for login
Browse files Browse the repository at this point in the history
  • Loading branch information
kaidux22 committed Nov 12, 2024
1 parent 9447953 commit ece0839
Show file tree
Hide file tree
Showing 6 changed files with 109 additions and 25 deletions.
11 changes: 11 additions & 0 deletions backend/app/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,17 @@ def createEntities():

@app.route('/db/<entity_type>', methods=['GET'])
def db_page(entity_type):
'''
Функция отвечает за получение данных, создание таблицы сущностей определённого типа и её визуализацию.
Ключевые переменные:
entity_type (str) : наименование сущности, которую надо добавить в БД
data (dict) : база данных с требуемыми запрошенными по entity_type сущностями
Возвращаемые данные:
render_template('data_bases.html', session = session, certain_page = False, entity_type = entity_type, lst = data) (string) : возвращаем шаблон страницы с таблицей и данными о пользователе
'''
response = requests.post("http://127.0.0.1:5000/entities", data={'entity_type': entity_type})
data = response.json()

Expand Down
7 changes: 5 additions & 2 deletions backend/app/static/styles/db.css
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,7 @@ h1{

#list{
width: 1337px;
height: 300px;
background: #21D9D9;
height: 100%;
color: #21D9D9;
border-radius: 10px 10px 0px 0px;

Expand All @@ -138,11 +137,15 @@ h1{
position: relative;
bottom: 117px;

max-width: 100%;
overflow-x: auto;

}

table{
background-color: #FFFFFF;
border: 1px solid #21D9D9;

}

th{
Expand Down
87 changes: 73 additions & 14 deletions backend/app/static/styles/header.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,87 @@ body{
padding: 0px;
}

#searching{
width: 290px;
button{
height: 50px;
border-radius: 25px;

padding: 0;
border: none;
background: #FFFFFF;
background: #FFFFFF;
color: #000000;

font-family: "Comfortaa", sans-serif;
font-size: 18px;

padding: 8px 8px 8px 8px;
font-weight: 400;
font-size: 18px;
line-height: 1.3;
text-align: right;
}

#searching{
width: 290px;


padding: 8px 8px 8px 8px;
font-weight: 400;
font-size: 18px;
line-height: 1.3;
text-align: right;

margin-left: 30px;
margin-top: 25px;
}
padding: 0;
border: none;
background: #FFFFFF;
color: #000000;

font-family: "Comfortaa", sans-serif;
font-size: 18px;

padding: 8px 8px 8px 8px;
font-weight: 400;
font-size: 18px;
line-height: 1.3;
text-align: right;

margin-left: 30px;
margin-top: 25px;
}

.enter{
float: right;
margin-right: 30px;

position: relative;
top: -265px;
}

.exit{
float: right;
position: relative;
top: -270px;
}

#name{
float: right;
position: relative;
top: -275px;
right: 10px;

height: 40px;
color: #FFFFFF;
font-weight: 400;
font-size: 22px;

}

#status{
float: right;
position: relative;
top: -245px;
left: 160px;

width: 173px;
height: 38px;
color: #1EB9B9;

font-weight: 400;
font-size: 18px;
text-align: left;
}

h1{
width: 270px;
Expand Down
11 changes: 11 additions & 0 deletions backend/app/static/styles/login.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#login {
background-color: white;
padding: 20px;
border-radius: 5px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
text-align: center;
}

#login h2 {
margin-top: 0;
}
12 changes: 6 additions & 6 deletions backend/app/templates/data_bases.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
</div>

<div id="left_panel">
{% if session["admin"] == "True"-%}
<button id="addItemBtn">{{session["admin"]}}</button>
{% if session.admin == "True" -%}
<button id="addItemBtn">Добавить элемент</button>
{% endif -%}
</div>
<div id="list">
Expand All @@ -38,7 +38,7 @@
<h2>Добавление заболевания</h2>
<form id="diseaseForm">
<label for="name">Наименование:</label><br>
<input type="text" id="name" name="name" required><br>
<input type="text" id="name_disease" name="name" required><br>
<label for="description">Описание:</label><br>
<textarea id="description" name="description" required></textarea><br>
<label for="recommendations">Рекомендации:</label><br>
Expand All @@ -64,7 +64,7 @@ <h2>Добавление обращения</h2>
<h2>Добавление симптома</h2>
<form id="symptomForm">
<label for="name">Наименование:</label><br>
<input type="text" id="name" name="name" required><br>
<input type="text" id="name_symptom" name="name" required><br>
<label for="description">Описание:</label><br>
<textarea id="description" name="description" required></textarea><br>

Expand Down Expand Up @@ -113,7 +113,7 @@ <h2>Добавление пациента</h2>
var formData = {
entity_type: 'Disease',
parametrs: {
name: $('#name').val(),
name: $('#name_disease').val(),
description: $('#description').val(),
recommendations: $('#recommendations').val(),
type: $('#type').val(),
Expand Down Expand Up @@ -168,7 +168,7 @@ <h2>Добавление пациента</h2>
var formData = {
entity_type: 'Symptom',
parametrs: {
name: $('#name').val(),
name: $('#name_symptom').val(),
description: $('#description').val()
}
};
Expand Down
6 changes: 3 additions & 3 deletions backend/app/templates/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@
<h1>На дому</h1>
<p id="title">Твой медицинский помощник</p>

{% if not session["loggedin"] -%} <a href="http://127.0.0.1:5000/login" class="button enter">Войти</a>
{% if not session["loggedin"] -%} <button onclick="location.href='http://127.0.0.1:5000/login';" class="button enter">Войти</button>
{% else -%}
<button onclick="location.href='http://127.0.0.1:5000/logout';" class="button exit">Выйти</button>
<p id="name"> {{session["full_name"]}} </p>
{% if session["admin"] -%} <p id="status">Администратор</p> {% endif -%}
<a href="http://127.0.0.1:5000/logout" class="button exit">Выйти</a>
{% if session.admin == "True" -%} <p id="status">Администратор</p> {% endif -%}
{% endif -%}
</div>
{%- endmacro %}

0 comments on commit ece0839

Please sign in to comment.