Compare commits
13 Commits
main
...
906d6df5ae
| Author | SHA1 | Date | |
|---|---|---|---|
| 906d6df5ae | |||
| ca0afdad2c | |||
| 0cf2044506 | |||
| 2a54b37ead | |||
| 9d9d68e8d4 | |||
| 207e22d4f6 | |||
| 6cad7d6ed6 | |||
| 347f467735 | |||
| de3e20e0cb | |||
| 60f746b2ee | |||
| 32061c6804 | |||
| de3d155249 | |||
| 6a01aefc7a |
15
Dockerfile
Normal file
@@ -0,0 +1,15 @@
|
||||
FROM python:3.11-slim-bullseye
|
||||
|
||||
WORKDIR /usr/src/app
|
||||
|
||||
ENV PYTHONDONTWRITEBYTECODE 1
|
||||
ENV PYTHONUNBUFFERED 1
|
||||
|
||||
RUN pip install --upgrade pip
|
||||
COPY ./requirements.txt /usr/src/app/requirements.txt
|
||||
RUN pip install -r requirements.txt
|
||||
|
||||
# copy project
|
||||
COPY . /usr/src/app/
|
||||
|
||||
CMD ["python","app.py"]
|
||||
178
app.py
@@ -1,73 +1,179 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from turtle import st
|
||||
from flask import Flask, render_template, request, flash, redirect, url_for
|
||||
from flask import Flask, render_template, request, flash, redirect, url_for, send_file
|
||||
from werkzeug.utils import secure_filename
|
||||
import os
|
||||
from models import db
|
||||
from models import PrintedDetal
|
||||
import secrets
|
||||
import logging
|
||||
from models import PrintedDetal
|
||||
from models import db, PrintedDetal
|
||||
from datetime import datetime
|
||||
|
||||
logging.basicConfig(filename='app.log', encoding='utf-8', level=logging.DEBUG)
|
||||
|
||||
|
||||
UPLOAD_IMG_FOLDER = os.path.join('static', 'img', 'uploads')
|
||||
UPLOAD_STL_FOLDER = os.path.join('static', 'stl')
|
||||
ALLOWED_EXTENSIONS = {'png', 'jpg', 'jpeg', 'stl'}
|
||||
|
||||
app = Flask(__name__)
|
||||
|
||||
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///app.db'
|
||||
app.config['UPLOAD_FOLDER'] = UPLOAD_IMG_FOLDER
|
||||
app.config['UPLOAD_FOLDER2'] = UPLOAD_STL_FOLDER
|
||||
app.config['UPLOAD_IMG_FOLDER'] = os.path.join('static', 'uploads', 'img')
|
||||
app.config['UPLOAD_STL_FOLDER'] = os.path.join('static', 'uploads', 'stl')
|
||||
app.config['UPLOAD_SRC_FOLDER'] = os.path.join('static', 'uploads', 'src')
|
||||
|
||||
db.init_app(app)
|
||||
|
||||
|
||||
def getlldb():
|
||||
|
||||
allDetals = {}
|
||||
|
||||
detalsQuery = PrintedDetal.query.all()
|
||||
|
||||
for detal in detalsQuery:
|
||||
detals = {}
|
||||
detals['id'] = detal.id
|
||||
detals['img'] = detal.img
|
||||
detals['stl'] = detal.stl
|
||||
detals['src'] = detal.src
|
||||
detals['isprinted'] = detal.isprinted
|
||||
detals['date'] = detal.dateadd
|
||||
|
||||
allDetals[detal.id] = detals
|
||||
|
||||
return allDetals
|
||||
|
||||
|
||||
@app.route("/")
|
||||
def index():
|
||||
detals = PrintedDetal.query.all()
|
||||
|
||||
return render_template("index.html", detals=detals)
|
||||
getall = getlldb()
|
||||
|
||||
return render_template("index.html", detals=getall)
|
||||
|
||||
|
||||
@app.route('/login')
|
||||
def login():
|
||||
pass
|
||||
|
||||
|
||||
@app.route('/logout')
|
||||
def logout():
|
||||
pass
|
||||
|
||||
|
||||
@app.route("/admin", methods=['GET', 'POST'])
|
||||
def admipage():
|
||||
logging.debug("adminpage loaded")
|
||||
return render_template("adminpage.html")
|
||||
|
||||
|
||||
@app.route('/uploader', methods=['GET', 'POST'])
|
||||
def upload_file():
|
||||
if request.method == 'POST':
|
||||
logging.debug("POST QUERY loaded")
|
||||
|
||||
|
||||
image_file = request.files['images']
|
||||
image_file = request.files['img']
|
||||
stl_file = request.files['stl']
|
||||
|
||||
logging.debug(image_file)
|
||||
logging.debug(stl_file)
|
||||
src_file = request.files['src']
|
||||
|
||||
image_file.save(os.path.join(app.config['UPLOAD_FOLDER'], image_file.filename))
|
||||
stl_file.save(os.path.join(app.config['UPLOAD_FOLDER2'], stl_file.filename))
|
||||
if len(image_file.filename) > 0:
|
||||
filename = image_file.filename.split('.')
|
||||
image_file.filename = secrets.token_hex(15) + '.' + filename[-1]
|
||||
image_file.save(os.path.join(
|
||||
app.config['UPLOAD_IMG_FOLDER'], image_file.filename))
|
||||
|
||||
if len(stl_file.filename) > 0:
|
||||
filename = stl_file.filename.split('.')
|
||||
stl_file.filename = secrets.token_hex(15) + '.' + filename[-1]
|
||||
stl_file.save(os.path.join(
|
||||
app.config['UPLOAD_STL_FOLDER'], stl_file.filename))
|
||||
|
||||
if len(src_file.filename) > 0:
|
||||
filename = src_file.filename.split('.')
|
||||
src_file.filename = secrets.token_hex(15) + '.' + filename[-1]
|
||||
src_file.save(os.path.join(
|
||||
app.config['UPLOAD_SRC_FOLDER'], src_file.filename))
|
||||
|
||||
if request.form.get('isprinted') == 'on':
|
||||
isprinered = True
|
||||
else:
|
||||
isprinered = False
|
||||
|
||||
detal = PrintedDetal(imgpath=image_file.filename,
|
||||
stlpath=stl_file.filename,
|
||||
isprinted=isprinered)
|
||||
detal = PrintedDetal(img=image_file.filename,
|
||||
stl=stl_file.filename,
|
||||
src=src_file.filename,
|
||||
isprinted=isprinered,
|
||||
datead=datetime.now().strftime('%d.%m.%Y'))
|
||||
db.session.add(detal)
|
||||
db.session.commit()
|
||||
|
||||
return render_template("adminpage.html")
|
||||
return redirect(url_for('admipage'))
|
||||
|
||||
|
||||
@app.route('/editcard')
|
||||
def editcadrd():
|
||||
allDetals = {}
|
||||
|
||||
detalsQuery = PrintedDetal.query.all()
|
||||
|
||||
for detal in detalsQuery:
|
||||
detals = {}
|
||||
detals['id'] = detal.id
|
||||
detals['img'] = detal.img
|
||||
detals['stl'] = detal.stl
|
||||
detals['src'] = detal.src
|
||||
detals['isprinted'] = detal.isprinted
|
||||
detals['date'] = detal.dateadd
|
||||
|
||||
allDetals[detal.id] = detals
|
||||
return render_template('editcard.html', detals=allDetals)
|
||||
|
||||
|
||||
@app.route('/editcard/<id>')
|
||||
def editcard2(id):
|
||||
data = PrintedDetal.query.get(id)
|
||||
print(data.id)
|
||||
return render_template('cardupdate.html', data=data.id)
|
||||
|
||||
|
||||
@app.route('/updater', methods=['POST'])
|
||||
def updater():
|
||||
|
||||
if request.method == 'POST':
|
||||
id = request.form.get('dataid')
|
||||
detal = PrintedDetal.query.get(id)
|
||||
|
||||
image_file = request.files['img']
|
||||
stl_file = request.files['stl']
|
||||
src_file = request.files['src']
|
||||
|
||||
if len(image_file.filename) > 0:
|
||||
filename = image_file.filename.split('.')
|
||||
image_file.filename = secrets.token_hex(15) + '.' + filename[-1]
|
||||
image_file.save(os.path.join(
|
||||
app.config['UPLOAD_IMG_FOLDER'], image_file.filename))
|
||||
detal.img = image_file.filename
|
||||
|
||||
if len(stl_file.filename) > 0:
|
||||
filename = stl_file.filename.split('.')
|
||||
stl_file.filename = secrets.token_hex(15) + '.' + filename[-1]
|
||||
stl_file.save(os.path.join(
|
||||
app.config['UPLOAD_STL_FOLDER'], stl_file.filename))
|
||||
detal.stl = stl_file.filename
|
||||
|
||||
if len(src_file.filename) > 0:
|
||||
filename = src_file.filename.split('.')
|
||||
src_file.filename = secrets.token_hex(15) + '.' + filename[-1]
|
||||
src_file.save(os.path.join(
|
||||
app.config['UPLOAD_SRC_FOLDER'], src_file.filename))
|
||||
detal.src = src_file.filename
|
||||
|
||||
if request.form.get('isprinted') == 'on':
|
||||
isprinered = True
|
||||
else:
|
||||
isprinered = False
|
||||
|
||||
detal.isprinted = isprinered
|
||||
db.session.commit()
|
||||
|
||||
return redirect(url_for('editcadrd'))
|
||||
|
||||
return "123"
|
||||
|
||||
else:
|
||||
return render_template("adminpage.html")
|
||||
|
||||
@app.route('/uploader', methods = ['GET', 'POST'])
|
||||
def upload_file():
|
||||
if request.method == 'POST':
|
||||
f = request.files['file']
|
||||
f.save(secure_filename(f.filename))
|
||||
return 'file uploaded successfully'
|
||||
if __name__ == "__main__":
|
||||
app.run(host="0.0.0.0", debug="True", port="3800")
|
||||
|
||||
@@ -6,6 +6,9 @@ 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())
|
||||
img = db.Column(db.String(3000))
|
||||
stl = db.Column(db.String(3000))
|
||||
src = db.Column(db.String(3000))
|
||||
isprinted = db.Column(db.Boolean())
|
||||
dateadd = db.Column(db.String(11))
|
||||
|
||||
BIN
requirements.txt
Normal file
@@ -1,56 +1,62 @@
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
background-color: #dcf3d0;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
background-color: #dcf3d0;
|
||||
|
||||
}
|
||||
|
||||
header{
|
||||
box-shadow: 0px 5px 10px 2px rgba(34, 60, 80, 0.2);
|
||||
}
|
||||
|
||||
.h1header {
|
||||
margin: 0;
|
||||
background-color: #b5e9e9;
|
||||
height: 100px;
|
||||
line-height: 100px;
|
||||
text-align: center;
|
||||
color: #034956;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
.uploadform{
|
||||
header {
|
||||
box-shadow: 0px 5px 10px 2px rgba(34, 60, 80, 0.2);
|
||||
}
|
||||
|
||||
.h1header {
|
||||
margin: 0;
|
||||
background-color: #b5e9e9;
|
||||
height: 100px;
|
||||
line-height: 100px;
|
||||
text-align: center;
|
||||
color: #034956;
|
||||
|
||||
}
|
||||
|
||||
.uploadform {
|
||||
margin: 30px;
|
||||
}
|
||||
|
||||
.formsrow{
|
||||
.formsrow {
|
||||
|
||||
border: #034956;
|
||||
|
||||
}
|
||||
|
||||
input[type="file"]::file-selector-button {
|
||||
background-color:#ffe1d0;
|
||||
background-color: #ffe1d0;
|
||||
padding: 0.5em;
|
||||
border: thin solid #f26722;
|
||||
border-radius: 2px;
|
||||
|
||||
}
|
||||
|
||||
input[type="file"]::form-file-button:hover {
|
||||
input[type="file"]::file-selector-button:hover {
|
||||
background-color: #fff1b5;
|
||||
color: #034956;
|
||||
border: 2px solid #034956;
|
||||
border: 1px solid #034956;
|
||||
cursor: pointer;
|
||||
|
||||
}
|
||||
|
||||
|
||||
.card {
|
||||
background-color: #fef6dd;
|
||||
border-radius: 12px;
|
||||
box-shadow: 0px 5px 10px 2px rgba(34, 60, 80, 0.2);
|
||||
}
|
||||
|
||||
.btn {
|
||||
margin-top: 15px;
|
||||
background-color: #ffe1d0;
|
||||
color: #034956;
|
||||
border: 2px solid #f26722;
|
||||
border-radius: 5px;
|
||||
width: 100%;
|
||||
|
||||
}
|
||||
@@ -60,4 +66,17 @@ input[type="file"]::form-file-button:hover {
|
||||
color: #034956;
|
||||
border: 2px solid #034956;
|
||||
|
||||
}
|
||||
|
||||
.formblock {
|
||||
width: 100%;
|
||||
border: 2px solid #034956;
|
||||
border-radius: 5px;
|
||||
|
||||
}
|
||||
|
||||
#printed {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
accent-color: #f26722;
|
||||
}
|
||||
@@ -4,7 +4,7 @@ body {
|
||||
background-color: #dcf3d0;
|
||||
}
|
||||
|
||||
header{
|
||||
header {
|
||||
box-shadow: 0px 5px 10px 2px rgba(34, 60, 80, 0.2);
|
||||
}
|
||||
|
||||
@@ -15,14 +15,14 @@ header{
|
||||
line-height: 100px;
|
||||
text-align: center;
|
||||
color: #034956;
|
||||
|
||||
|
||||
}
|
||||
|
||||
.row {
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
.col-md-4{
|
||||
.col-md-4 {
|
||||
margin-bottom: 25px;
|
||||
}
|
||||
|
||||
@@ -30,8 +30,17 @@ header{
|
||||
background-color: #fef6dd;
|
||||
border-radius: 12px;
|
||||
box-shadow: 0px 5px 10px 2px rgba(34, 60, 80, 0.2);
|
||||
height: 450px;
|
||||
}
|
||||
|
||||
.card-edit {
|
||||
height: 400px;
|
||||
}
|
||||
|
||||
.card-img-top{
|
||||
|
||||
height: 250px;
|
||||
}
|
||||
|
||||
.btn {
|
||||
|
||||
@@ -50,11 +59,18 @@ header{
|
||||
|
||||
}
|
||||
|
||||
.card-img-top{
|
||||
.card-img-top {
|
||||
padding: 10px;
|
||||
border-radius: 18px;
|
||||
}
|
||||
|
||||
h5{
|
||||
h5 {
|
||||
font-size: 17px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.mobile-margin {
|
||||
margin-bottom: 10px;
|
||||
padding: 10px;
|
||||
}
|
||||
BIN
static/img/Auth.jpg
Normal file
|
After Width: | Height: | Size: 14 MiB |
BIN
static/img/uploads/13c3a23110f9ae0a8c6c2eaf153ce3.jpg
Normal file
|
After Width: | Height: | Size: 26 KiB |
BIN
static/img/uploads/1a47072defc8d6e06c5432bfa94ff9.jpg
Normal file
|
After Width: | Height: | Size: 225 KiB |
BIN
static/img/uploads/1e6372b9451aa8d5325b295ac64d40.jpg
Normal file
|
After Width: | Height: | Size: 26 KiB |
BIN
static/img/uploads/280c7fe9388d4f445100acc1b7b1ac.jpg
Normal file
|
After Width: | Height: | Size: 26 KiB |
BIN
static/img/uploads/4fb140f1adecd3aae5e697ed2b3107.png
Normal file
|
After Width: | Height: | Size: 15 KiB |
BIN
static/img/uploads/73e726fde93f0c81141140007e2f6a.jpg
Normal file
|
After Width: | Height: | Size: 225 KiB |
BIN
static/img/uploads/8907a42ceb726bc28f1f254323d291.png
Normal file
|
After Width: | Height: | Size: 14 KiB |
BIN
static/img/uploads/a8839944bcde4fb39480a891338293.png
Normal file
|
After Width: | Height: | Size: 15 KiB |
BIN
static/img/uploads/b0ba34fd7f2cb29f16d22cdf64f3cd.png
Normal file
|
After Width: | Height: | Size: 15 KiB |
BIN
static/img/uploads/d85d9441ce77db404a7a3624c6a4c5.png
Normal file
|
After Width: | Height: | Size: 14 KiB |
BIN
static/img/uploads/de2b9c1eb3aa4b51d8b904c2eb9ebd.jpg
Normal file
|
After Width: | Height: | Size: 225 KiB |
BIN
static/img/uploads/f5daf4603ed462e2093415fce3c357.png
Normal file
|
After Width: | Height: | Size: 65 KiB |
|
Before Width: | Height: | Size: 1.7 MiB |
|
Before Width: | Height: | Size: 295 KiB |
|
Before Width: | Height: | Size: 482 KiB |
|
Before Width: | Height: | Size: 12 KiB |
0
static/src/c642733f147aec6642e3e2130f6f84.png
Normal file
|
After Width: | Height: | Size: 225 KiB |
|
After Width: | Height: | Size: 26 KiB |
|
After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 585 KiB |
BIN
static/uploads/img/39336ea1bd63cd729256a4840f58eb.jpg
Normal file
|
After Width: | Height: | Size: 26 KiB |
BIN
static/uploads/img/47f8eaffbd6afb256d0c30d4537755.jpg
Normal file
|
After Width: | Height: | Size: 225 KiB |
BIN
static/uploads/img/52d8fefb9d1ffed4b85b0a4dc09365.jpg
Normal file
|
After Width: | Height: | Size: 26 KiB |
BIN
static/uploads/img/5e616db251a1f79f500d9a88a6c524.jpg
Normal file
|
After Width: | Height: | Size: 225 KiB |
BIN
static/uploads/img/6adf0d6e7152f32e26cac5dc8d9bf1.png
Normal file
|
After Width: | Height: | Size: 65 KiB |
BIN
static/uploads/img/780bc1f4b169cb3cb4b0b5817152cb.png
Normal file
|
After Width: | Height: | Size: 15 KiB |
BIN
static/uploads/img/7f77be274a610e1110778492813e58.png
Normal file
|
After Width: | Height: | Size: 14 KiB |
BIN
static/uploads/img/a8972714142d6ce089a7748a52d176.jpg
Normal file
|
After Width: | Height: | Size: 26 KiB |
BIN
static/uploads/src/070105ef12aa09da5f8745b26c1b00.jpg
Normal file
|
After Width: | Height: | Size: 26 KiB |
BIN
static/uploads/src/366d577969a8f6c3d3dcde95b7c36e.png
Normal file
|
After Width: | Height: | Size: 65 KiB |
BIN
static/uploads/src/54a029e3d30e2d293935d561284604.png
Normal file
|
After Width: | Height: | Size: 14 KiB |
BIN
static/uploads/src/95442dae6cdf2be5c7bb883ec460ff.jpg
Normal file
|
After Width: | Height: | Size: 225 KiB |
BIN
static/uploads/src/a13c81558c5484445cf9dc33a0a4f3.jpg
Normal file
|
After Width: | Height: | Size: 26 KiB |
BIN
static/uploads/src/ad33b76d2e6d1ee725c95b4b8eba4d.png
Normal file
|
After Width: | Height: | Size: 15 KiB |
|
After Width: | Height: | Size: 26 KiB |
BIN
static/uploads/src/f5abf0156af9fafeb560caee9d8dd2.jpg
Normal file
|
After Width: | Height: | Size: 225 KiB |
BIN
static/uploads/stl/5043eb896ce1a9e7a1a12a1e1a9d63.jpg
Normal file
|
After Width: | Height: | Size: 26 KiB |
BIN
static/uploads/stl/8a9ac33bb865b3a4c5a9b2b538f01a.png
Normal file
|
After Width: | Height: | Size: 14 KiB |
BIN
static/uploads/stl/a483b6fdc21ef3796c843c137b561c.jpg
Normal file
|
After Width: | Height: | Size: 225 KiB |
BIN
static/uploads/stl/cbd9ac8333684dea75d102d5ae9a9e.png
Normal file
|
After Width: | Height: | Size: 15 KiB |
BIN
static/uploads/stl/cf89b089ff7ccd15a42086824df9ab.jpg
Normal file
|
After Width: | Height: | Size: 225 KiB |
BIN
static/uploads/stl/d38ff410af2bf8f2da14fbc8afc4c9.png
Normal file
|
After Width: | Height: | Size: 65 KiB |
56
templates/adduser.html
Normal file
@@ -0,0 +1,56 @@
|
||||
<!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 href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.2/dist/css/bootstrap.min.css" rel="stylesheet"
|
||||
integrity="sha384-Zenh87qX5JnK2Jl0vWa8Ck2rdkQ2Bzep5IDxbcnCeuOxjzrPF/et3URy9Bv1WTRi" crossorigin="anonymous">
|
||||
<link rel="stylesheet" href="{{ url_for('static',filename='css/style.css')}}">
|
||||
<title>3d Detals</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<header>
|
||||
<h1 class="h1header"> Каталог печатных 3д деталей </h1>
|
||||
</header>
|
||||
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-4 d-flex aligns-items-center mx-auto">
|
||||
<div class="card card-login mobile-margin">
|
||||
<img class="card-img-top" src="{{url_for('static', filename='img/Auth.jpg')}}">
|
||||
|
||||
|
||||
<form method="POST" action="/auth">
|
||||
<div class="col mb-3">
|
||||
<label for="exampleInputEmail1" class="form-label">Введите логин</label>
|
||||
<input type="text" class="form-control" name="login">
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col mb-3">
|
||||
<label>Введите пароль</label>
|
||||
<input type="password" class="form-control" name="passwd">
|
||||
</div>
|
||||
|
||||
<button type="submit" class="btn btn-primary">Авторизоваться</button>
|
||||
</form>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.2/dist/js/bootstrap.bundle.min.js"
|
||||
integrity="sha384-OERcA2EqjJCMA+/3y+gxIOqMEjwtxJY7qPCqsdltbNJuaOe923+mo//f6V8Qbsw3"
|
||||
crossorigin="anonymous"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
39
templates/adminpage.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 href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.2/dist/css/bootstrap.min.css" rel="stylesheet"
|
||||
integrity="sha384-Zenh87qX5JnK2Jl0vWa8Ck2rdkQ2Bzep5IDxbcnCeuOxjzrPF/et3URy9Bv1WTRi" crossorigin="anonymous">
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='css/adminpage.css')}}">
|
||||
<title>3d Detals adminka</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<header>
|
||||
<h1 class="h1header"> Административная панель </h1>
|
||||
</header>
|
||||
<div class="container">
|
||||
|
||||
<div class="row ">
|
||||
<form method="post" enctype=multipart/form-data action="/uploader">
|
||||
<label class=" d-block p-2">Выберите изображение </label>
|
||||
<input class=" formblock d-block p-2" type="file" name="img" />
|
||||
<label class=" d-block p-2">Выберите исходный file </label>
|
||||
<input class=" formblock d-block p-2" type="file" name="src" />
|
||||
<label class=" d-block p-2">Выберите stl file </label>
|
||||
<input class=" formblock d-block p-2" type="file" name="stl" />
|
||||
<label > Напечатано </label>
|
||||
<input type="checkbox" class="bxigchekcbox" id="printed" name="isprinted">
|
||||
<input class="btn d-block p-2" type="submit" value="Upload">
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.2/dist/js/bootstrap.bundle.min.js"
|
||||
integrity="sha384-OERcA2EqjJCMA+/3y+gxIOqMEjwtxJY7qPCqsdltbNJuaOe923+mo//f6V8Qbsw3"
|
||||
crossorigin="anonymous"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
40
templates/cardupdate.html
Normal file
@@ -0,0 +1,40 @@
|
||||
<!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 href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.2/dist/css/bootstrap.min.css" rel="stylesheet"
|
||||
integrity="sha384-Zenh87qX5JnK2Jl0vWa8Ck2rdkQ2Bzep5IDxbcnCeuOxjzrPF/et3URy9Bv1WTRi" crossorigin="anonymous">
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='css/adminpage.css')}}">
|
||||
<title>3d Detals adminka</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<header>
|
||||
<h1 class="h1header"> Обновление карточки {{data['id']}}</h1>
|
||||
</header>
|
||||
<div class="container">
|
||||
|
||||
<div class="row ">
|
||||
<form method="post" enctype=multipart/form-data action="/updater">
|
||||
<label class=" d-block p-2">Выберите изображение </label>
|
||||
<input class=" formblock d-block p-2" type="file" name="img" />
|
||||
<label class=" d-block p-2">Выберите исходный file </label>
|
||||
<input class=" formblock d-block p-2" type="file" name="src" />
|
||||
<label class=" d-block p-2">Выберите stl file </label>
|
||||
<input class=" formblock d-block p-2" type="file" name="stl" />
|
||||
<label > Напечатано </label>
|
||||
<input type="checkbox" class="bxigchekcbox" id="printed" name="isprinted">
|
||||
<input class="btn d-block p-2" type="submit" value="Обновить">
|
||||
<input name="dataid" type="hidden" value="{{data}}" >
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.2/dist/js/bootstrap.bundle.min.js"
|
||||
integrity="sha384-OERcA2EqjJCMA+/3y+gxIOqMEjwtxJY7qPCqsdltbNJuaOe923+mo//f6V8Qbsw3"
|
||||
crossorigin="anonymous"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
48
templates/editcard.html
Normal file
@@ -0,0 +1,48 @@
|
||||
<!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 href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.2/dist/css/bootstrap.min.css" rel="stylesheet"
|
||||
integrity="sha384-Zenh87qX5JnK2Jl0vWa8Ck2rdkQ2Bzep5IDxbcnCeuOxjzrPF/et3URy9Bv1WTRi" crossorigin="anonymous">
|
||||
<link rel="stylesheet" href="{{ url_for('static',filename='css/style.css')}}">
|
||||
<title>3d Detals</title>
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<h1 class="h1header"> Каталог печатных 3д деталей </h1>
|
||||
</header>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
|
||||
{% for key, value in detals.items() %}
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="card card-edit mobile-margin">
|
||||
<img class="card-img-top" src="{{url_for('static', filename='uploads/img/' + value['img'])}}">
|
||||
|
||||
<div class="card-body">
|
||||
<dv class="row">
|
||||
<div class="col">
|
||||
<a href="/editcard/{{value['id']}}" class="btn btn-block mobile-margin"> Изменить </a>
|
||||
</div>
|
||||
<div class="row">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{%endfor%}
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.2/dist/js/bootstrap.bundle.min.js"
|
||||
integrity="sha384-OERcA2EqjJCMA+/3y+gxIOqMEjwtxJY7qPCqsdltbNJuaOe923+mo//f6V8Qbsw3"
|
||||
crossorigin="anonymous"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -7,7 +7,7 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.2/dist/css/bootstrap.min.css" rel="stylesheet"
|
||||
integrity="sha384-Zenh87qX5JnK2Jl0vWa8Ck2rdkQ2Bzep5IDxbcnCeuOxjzrPF/et3URy9Bv1WTRi" crossorigin="anonymous">
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='css/style.css')}}">
|
||||
<link rel="stylesheet" href="{{ url_for('static',filename='css/style.css')}}">
|
||||
<title>3d Detals</title>
|
||||
</head>
|
||||
<body>
|
||||
@@ -16,41 +16,44 @@
|
||||
</header>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
|
||||
{% for i in range(10) %}
|
||||
|
||||
|
||||
|
||||
{% for key, value in detals.items() %}
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="card">
|
||||
<img class="card-img-top" src="{{ url_for('static', filename='img/{{i}}.jpg')}} " alt="1 image">
|
||||
<div class="card mobile-margin">
|
||||
<img class="card-img-top" src="{{url_for('static', filename='uploads/img/' + value['img'])}}">
|
||||
|
||||
<div class="card-body">
|
||||
<dv class="row">
|
||||
<div class="col">
|
||||
<button class="btn btn-block">Скачать исходник</button>
|
||||
<a href="{{url_for('static', filename='uploads/img/' + value['img'])}}" class="btn btn-block mobile-margin" download>Скачать изображение </a>
|
||||
</div>
|
||||
<div class="col">
|
||||
<button class="btn btn-block">Скачать stl </button>
|
||||
<a href="{{url_for('static', filename='uploads/src/' + value['src'])}}" class="btn btn-block mobile-margin" download >Скачать исходник</a>
|
||||
</div>
|
||||
<div class="col">
|
||||
<a href="{{url_for('static', filename='uploads/stl/' + value['stl'])}}" class="btn btn-block mobile-margin" download>Скачать stl </a>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col d-flex justify-content-center">
|
||||
<input class="form-check-input" type="checkbox" value="" id="flexCheckDefault">
|
||||
<label class="form-check-label" for="flexCheckDefault">
|
||||
Напечатано
|
||||
</label>
|
||||
<input class="form-check-input" type="checkbox" {{'checked="checked"' if value['isprinted']==1 else ""}} id="flexCheckDefault" disabled>
|
||||
<label> Напечатано </label>
|
||||
</div>
|
||||
<div class="col d-flex justify-content-center">
|
||||
<h5> {{ i }} </h5>
|
||||
<h5> {{value['dateadd']}}</h5>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
{%endfor%}
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.2/dist/js/bootstrap.bundle.min.js"
|
||||
integrity="sha384-OERcA2EqjJCMA+/3y+gxIOqMEjwtxJY7qPCqsdltbNJuaOe923+mo//f6V8Qbsw3"
|
||||
crossorigin="anonymous"></script>
|
||||
|
||||
55
templates/login.html
Normal file
@@ -0,0 +1,55 @@
|
||||
<!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 href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.2/dist/css/bootstrap.min.css" rel="stylesheet"
|
||||
integrity="sha384-Zenh87qX5JnK2Jl0vWa8Ck2rdkQ2Bzep5IDxbcnCeuOxjzrPF/et3URy9Bv1WTRi" crossorigin="anonymous">
|
||||
<link rel="stylesheet" href="{{ url_for('static',filename='css/style.css')}}">
|
||||
<title>3d Detals</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<header>
|
||||
<h1 class="h1header"> Каталог печатных 3д деталей </h1>
|
||||
</header>
|
||||
|
||||
<div class="container container-login d-flex h-100 ">
|
||||
<div class="row d-flex justify-content-center ">
|
||||
<div class="col-md-4">
|
||||
<div class="card align-middle mobile-margin">
|
||||
|
||||
<div class="card-body text-center">
|
||||
<dv class="row">
|
||||
<h2 class="fw-bold mb-2 text-uppercase">Авторизация</h2>
|
||||
<p class="mb-5">Введите логин и пароль</p>
|
||||
|
||||
|
||||
<div class="form-outline form-white mb-4">
|
||||
<input type="email" id="typeEmailX" class="form-control form-control-lg" />
|
||||
<label class="form-label" for="typeEmailX">Email</label>
|
||||
</div>
|
||||
|
||||
<div class="form-outline form-white mb-4">
|
||||
<input type="password" id="typePasswordX" class="form-control form-control-lg" />
|
||||
<label class="form-label" for="typePasswordX">Password</label>
|
||||
</div>
|
||||
|
||||
<div class="col">
|
||||
<a href="" class="btn btn-block mobile-margin" download>Авторизоваться </a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.2/dist/js/bootstrap.bundle.min.js"
|
||||
integrity="sha384-OERcA2EqjJCMA+/3y+gxIOqMEjwtxJY7qPCqsdltbNJuaOe923+mo//f6V8Qbsw3"
|
||||
crossorigin="anonymous"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||