start proj
This commit is contained in:
23
app.py
Normal file
23
app.py
Normal file
@@ -0,0 +1,23 @@
|
||||
from flask import Flask, render_template
|
||||
from models import db
|
||||
from models import *
|
||||
|
||||
|
||||
|
||||
app = Flask(__name__)
|
||||
|
||||
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///app.db'
|
||||
|
||||
db.init_app(app)
|
||||
|
||||
@app.route('/')
|
||||
def index():
|
||||
return render_template('index.html')
|
||||
|
||||
|
||||
@app.route('/admin')
|
||||
def admipage():
|
||||
return render_template('adminpage.html')
|
||||
|
||||
if __name__ == '__main__':
|
||||
app.run(host='0.0.0.0', port='3800', debug=True)
|
||||
9
models.py
Normal file
9
models.py
Normal file
@@ -0,0 +1,9 @@
|
||||
from flask_sqlalchemy import SQLAlchemy
|
||||
|
||||
db = SQLAlchemy()
|
||||
|
||||
class PrintedDetal(db.Model):
|
||||
id = db.Column(db.Integer, primary_key=True, autoincrement=True)
|
||||
imgpath = db.Column(db.String(3000))
|
||||
stlpath = db.Column(db.String(3000))
|
||||
isprinted = db.Column(db.Boolean())
|
||||
7
static/css/bootstrap.min.css
vendored
Normal file
7
static/css/bootstrap.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
1
static/css/bootstrap.min.css.map
Normal file
1
static/css/bootstrap.min.css.map
Normal file
File diff suppressed because one or more lines are too long
63
static/css/style.css
Normal file
63
static/css/style.css
Normal file
@@ -0,0 +1,63 @@
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
background-color: #f5f1d5
|
||||
}
|
||||
|
||||
header {
|
||||
box-shadow: 0px 5px 10px 2px rgba(34, 60, 80, 0.2);
|
||||
}
|
||||
|
||||
.h1header {
|
||||
margin: 0;
|
||||
background-color: #4a849f;
|
||||
height: 100px;
|
||||
line-height: 100px;
|
||||
text-align: center;
|
||||
color: black;
|
||||
|
||||
}
|
||||
|
||||
.h1 {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.tg {
|
||||
padding-top: 35px;
|
||||
border-collapse: collapse;
|
||||
border-spacing: 0;
|
||||
}
|
||||
|
||||
.tg td {
|
||||
border-color: black;
|
||||
border-style: solid;
|
||||
border-width: 1px;
|
||||
font-family: Arial, sans-serif;
|
||||
font-size: 14px;
|
||||
overflow: hidden;
|
||||
padding: 10px 5px;
|
||||
word-break: normal;
|
||||
}
|
||||
|
||||
.tg th {
|
||||
border-color: black;
|
||||
border-style: solid;
|
||||
border-width: 1px;
|
||||
font-family: Arial, sans-serif;
|
||||
font-size: 14px;
|
||||
font-weight: normal;
|
||||
overflow: hidden;
|
||||
padding: 10px 5px;
|
||||
word-break: normal;
|
||||
}
|
||||
|
||||
.tg .tg-0pky {
|
||||
border-color: inherit;
|
||||
text-align: left;
|
||||
vertical-align: top
|
||||
}
|
||||
|
||||
.card{
|
||||
margin-top: 40px;
|
||||
}
|
||||
63
templates/adminpage.html
Normal file
63
templates/adminpage.html
Normal file
@@ -0,0 +1,63 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='css/bootstrap.min.css')}}">
|
||||
<link rel="stylesheet" type='text/css' href="{{ url_for('static', filename='css/style.css')}} ">
|
||||
<title>Админка прогулов</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<header>
|
||||
<h1 class="h1header">
|
||||
Прогульная админка
|
||||
</h1>
|
||||
</header>
|
||||
|
||||
|
||||
|
||||
<div class="container card ">
|
||||
<h2>Добавить прогул</h2>
|
||||
<label> Выберите сотрудника из списка ниже </label>
|
||||
<select class="form-select" aria-label="Default select example">
|
||||
<option value="1">Сальный А.Г.</option>
|
||||
<option value="2">Талыкова К.Б.</option>
|
||||
<option value="3">Ким Н.А.</option>
|
||||
</select>
|
||||
<label for="startDate">Выберите дату прогула</label>
|
||||
<input id="startDate" class="form-control" type="date" />
|
||||
<button type="button" class="btn btn-primary">Добавить</button>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="container card">
|
||||
<h2>
|
||||
Добавить сотрудника
|
||||
|
||||
<form>
|
||||
<div class="mb-3">
|
||||
<label for="exampleInputEmail1" class="form-label">ФИО сотрудника</label>
|
||||
<input type="email" class="form-control" id="exampleInputEmail1" aria-describedby="emailHelp">
|
||||
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="exampleInputPassword1" class="form-label">Должность</label>
|
||||
<select class="form-select" aria-label="Default select example">
|
||||
<option value="laborant">Лаборант</option>
|
||||
<option value="ingener">Инженер</option>
|
||||
<option value="vedingener">Ведущий инженер</option>
|
||||
<option value="4">Сальный</option>
|
||||
</select>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary">Submit</button>
|
||||
</form>
|
||||
|
||||
</h2>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
39
templates/index.html
Normal file
39
templates/index.html
Normal file
@@ -0,0 +1,39 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='css/bootstrap.min.css')}}">
|
||||
<link rel="stylesheet" type='text/css' href="{{ url_for('static', filename='css/style.css')}} ">
|
||||
<title>PROGULASU</title>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<h1 class="h1header"> Пропущенные дежурства АСУ </h1>
|
||||
</header>
|
||||
<div class="container">
|
||||
<h1>Количество и даты пропущенных дежурств УВП кафедры АСУ </h1>
|
||||
</div>
|
||||
<div class="container">
|
||||
<table class="table ">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>ФИО</th>
|
||||
<th>Кол-во дежурств</th>
|
||||
<th>Даты</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Сальный А.Г.</td>
|
||||
<td>0</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user