parent
1fd231a1a7
commit
3e4863d0c6
@ -1,269 +0,0 @@
|
||||
from minibase.database.models import Company, Company_relation, Company_legal_entity
|
||||
from minibase.database.models import Industry, Countries
|
||||
from minibase.database.models import Person, Person_role, Person_competence
|
||||
from minibase.database.models import Project, Project_element
|
||||
from minibase import db
|
||||
from numpy import genfromtxt
|
||||
|
||||
|
||||
# Gets the id of company from the formated output defined at models.py for the Company Model
|
||||
# The argument formatedCompanySelection is formated by SQLAlchemy in models.py files
|
||||
# Please look there before changing anything here.
|
||||
def getCompanyId(formatedCompanySelection):
|
||||
text = formatedCompanySelection.split(",")
|
||||
return text[2] # Corresponds to the ID of the Company
|
||||
|
||||
|
||||
# Gets the id of Person's role
|
||||
def getPersonRoleId(nameForId):
|
||||
selection = Person_role.query.filter_by(name=nameForId).first()
|
||||
return selection.id
|
||||
|
||||
|
||||
# Gets the id of Person's competence
|
||||
def getPersonCompetenceId(nameForId):
|
||||
selection = Person_competence.query.filter_by(name=nameForId).first()
|
||||
return selection.id
|
||||
|
||||
|
||||
# Gets the country of the company based on it's id
|
||||
def getCompanyCountry(companyId):
|
||||
selection = Company.query.filter_by(id=companyId).first()
|
||||
return selection.country_bill
|
||||
|
||||
|
||||
# Gets the state of the company based on it's id
|
||||
def getCompanyState(companyId):
|
||||
selection = Company.query.filter_by(id=companyId).first()
|
||||
return selection.street_bill
|
||||
|
||||
|
||||
# Gets the city of the company based on it's id
|
||||
def getCompanyCity(companyId):
|
||||
selection = Company.query.filter_by(id=companyId).first()
|
||||
return selection.city_bill
|
||||
|
||||
|
||||
# Gets the Postal Code of the company based on it's id
|
||||
def getCompanyPostCode(companyId):
|
||||
selection = Company.query.filter_by(id=companyId).first()
|
||||
return selection.post_code_bill
|
||||
|
||||
|
||||
# Gets the Name of the street of the company based on it's id
|
||||
def getCompanyStreetName(companyId):
|
||||
selection = Company.query.filter_by(id=companyId).first()
|
||||
return selection.street_bill
|
||||
|
||||
|
||||
# Gets the Number of the street of the company based on it's id
|
||||
def getCompanyStreetNo(companyId):
|
||||
selection = Company.query.filter_by(id=companyId).first()
|
||||
return selection.street_no_bill
|
||||
|
||||
|
||||
# Returns the query of all awailable companie names on the table named Company
|
||||
# Note that the formating is done during the SQLAlchemy Table declaration.
|
||||
def person_role_choices():
|
||||
choices = Person_role.query.all()
|
||||
return choices
|
||||
|
||||
|
||||
# Returns the query of all awailable companie names on the table named Company
|
||||
# Note that the formating is done during the SQLAlchemy Table declaration.
|
||||
def person_competence_choices():
|
||||
choices = Person_competence.query.all()
|
||||
return choices
|
||||
|
||||
|
||||
# Returns the query of all awailable companie names on the table named Company
|
||||
# Note that the formating is done during the SQLAlchemy Table declaration.
|
||||
def company_choices():
|
||||
choices = Company.query.all()
|
||||
return choices
|
||||
|
||||
|
||||
# Retunrs the qurry of all awailable industrie names on the table named Industry
|
||||
# Note that the formating is done during the SQLAlchemy Table declaration.
|
||||
def company_industry_choices():
|
||||
choices = Industry.query.all()
|
||||
return choices
|
||||
|
||||
|
||||
# Retunrs the query of all awailable legal entity names on the table named Company_legal_entity
|
||||
# Note that the formating is done during the SQLAlchemy Table declaration.
|
||||
def company_legal_entity_choices():
|
||||
choices = Company_legal_entity.query.all()
|
||||
return choices
|
||||
|
||||
|
||||
# Retunrs the query of all awailable Relation names on the table named Company_relation
|
||||
# Note that the formating is done during the SQLAlchemy Table declaration.
|
||||
def company_relation_choices():
|
||||
choices = Company_relation.query.all()
|
||||
return choices
|
||||
|
||||
|
||||
# The Company Model has Industry Column as a foreign key and it requires the Industry's ID
|
||||
# And not the name. so this function returns the right ID of the name shown at the
|
||||
# Register Company Form
|
||||
def getIndustryId(nameForId):
|
||||
selection = Industry.query.filter_by(name=nameForId).first() # Gets the id of Role
|
||||
return selection.id
|
||||
|
||||
|
||||
# The Company Model has Relation Column as a foreign key and it requires the Industry's ID
|
||||
# And not the name. so this function returns the right ID of the name shown at the
|
||||
# Register Company Form
|
||||
def getRelationId(nameForId):
|
||||
selection = Company_relation.query.filter_by(name=nameForId).first() # Gets the id of Role
|
||||
return selection.id
|
||||
|
||||
|
||||
# The Company Model has Legal Entity Column as a foreign key and it requires the Industry's ID
|
||||
# And not the name. so this function returns the right ID of the name shown at the
|
||||
# Register Company Form
|
||||
def getLegalEntityId(nameForId):
|
||||
selection = Company_legal_entity.query.filter_by(name=nameForId).first() # Gets the id of Role
|
||||
return selection.id
|
||||
|
||||
|
||||
# Retunrs the query of all awailable Country names on the table named Countries
|
||||
# Note that the formating is done during the SQLAlchemy Table declaration.
|
||||
# Important note This table is ImporteD externally from a modifier SQL version of
|
||||
# Github : https://github.com/dr5hn/countries-states-cities-database
|
||||
def country_choices():
|
||||
choices = Countries.query.all()
|
||||
return choices
|
||||
|
||||
###################################################################################################
|
||||
# CSV manipulation
|
||||
###################################################################################################
|
||||
|
||||
def openCsv(filename):
|
||||
data = genfromtxt(filename,
|
||||
delimiter=',',
|
||||
skip_header=1,
|
||||
dtype=None,
|
||||
encoding='UTF-8')
|
||||
return data.tolist()
|
||||
|
||||
|
||||
def db_add_name_and_description(csv, table):
|
||||
try:
|
||||
csv_list = openCsv(csv)
|
||||
for i in csv_list:
|
||||
record = table(**{
|
||||
'name': i[0],
|
||||
'description': i[1]})
|
||||
db.session.add(record) # Add all the records
|
||||
db.session.commit() # Attempt to commit all the records
|
||||
except:
|
||||
db.session.rollback() # Rollback the changes on error
|
||||
print("Error Ocured during <<NAME AND DESCRIPTION>> upload to DB")
|
||||
|
||||
|
||||
def db_add_company(csv):
|
||||
try:
|
||||
csv_list = openCsv(csv)
|
||||
for i in csv_list:
|
||||
record = Company(**{
|
||||
'name': i[0],
|
||||
'legal_entity_id': i[1],
|
||||
'relation_id': i[2],
|
||||
'industry_id': i[3],
|
||||
'status_id': i[4],
|
||||
'website': i[5],
|
||||
'street_bill': i[6],
|
||||
'street_no_bill': i[7],
|
||||
'city_bill': i[8],
|
||||
'post_code_bill': i[9],
|
||||
'state_bill': i[10],
|
||||
'country_bill': i[11],
|
||||
'street_ship': i[12],
|
||||
'street_no_ship': i[13],
|
||||
'city_ship': i[14],
|
||||
'post_code_ship': i[15],
|
||||
'state_ship': i[16],
|
||||
'country_ship': i[17]})
|
||||
db.session.add(record) # Add all the records
|
||||
db.session.commit() # Attempt to commit all the records
|
||||
except Exception as error:
|
||||
db.session.rollback() # Rollback the changes on error
|
||||
print("Error Ocured during <<COMPANY>> upload to DB")
|
||||
print(error)
|
||||
|
||||
|
||||
def db_add_person(csv):
|
||||
try:
|
||||
csv_list = openCsv(csv)
|
||||
print(csv_list)
|
||||
for i in csv_list:
|
||||
record = Person(**{
|
||||
'name': i[0],
|
||||
'last_name': i[1],
|
||||
'company_id': i[2],
|
||||
'role_id': i[3],
|
||||
'competence_id': i[4],
|
||||
'mail_prof': i[5],
|
||||
'mail_priv': i[6],
|
||||
'tel_prof_mobile': i[7],
|
||||
'street_name': i[8],
|
||||
'street_no': i[9],
|
||||
'city': i[10],
|
||||
'post_code': i[11],
|
||||
'state': i[12],
|
||||
'country': i[13]
|
||||
})
|
||||
db.session.add(record) # Add all the records
|
||||
db.session.commit() # Attempt to commit all the records
|
||||
except Exception as error:
|
||||
db.session.rollback() # Rollback the changes on error
|
||||
print("Error Ocured during <<PERSON>> upload to DB")
|
||||
print(error)
|
||||
|
||||
|
||||
def db_add_project(csv):
|
||||
try:
|
||||
csv_list = openCsv(csv)
|
||||
print(csv_list)
|
||||
for i in csv_list:
|
||||
record = Project(**{
|
||||
'name': i[0],
|
||||
'description': i[1],
|
||||
'company_id': i[2],
|
||||
'status_id': i[3],
|
||||
'industry_id': i[4],
|
||||
'owner_id': i[5],
|
||||
'qte_prototype': i[6],
|
||||
'qte_start': i[7],
|
||||
'qte_production': i[8],
|
||||
})
|
||||
db.session.add(record) # Add all the records
|
||||
db.session.commit() # Attempt to commit all the records
|
||||
except Exception as error:
|
||||
db.session.rollback() # Rollback the changes on error
|
||||
print(csv)
|
||||
print("Error Ocured during <<PROJECT>> upload to DB")
|
||||
print(error)
|
||||
|
||||
def db_add_project_element(csv):
|
||||
try:
|
||||
csv_list = openCsv(csv)
|
||||
print(csv_list)
|
||||
for i in csv_list:
|
||||
record = Project_element(**{
|
||||
'name': i[0],
|
||||
'description': i[1],
|
||||
'qte_per_project': i[2],
|
||||
'project_id': i[3],
|
||||
'owner_id': i[4],
|
||||
'status_id': i[5],
|
||||
})
|
||||
db.session.add(record) # Add all the records
|
||||
db.session.commit() # Attempt to commit all the records
|
||||
except Exception as error:
|
||||
db.session.rollback() # Rollback the changes on error
|
||||
print(csv)
|
||||
print("Error Ocured during <<PROJECT ELEMENT>> upload to DB")
|
||||
print(error)
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,6 +1,6 @@
|
||||
|
||||
def doesNameExistsCi(table, name):
|
||||
exists = table.query.filter(table.name.ilike(name.data)).first() # Database Querry ilike means case insessitive
|
||||
exists = table.query.filter(table.name.ilike(name)).first() # Database Querry ilike means case insessitive
|
||||
if exists:
|
||||
return 1
|
||||
return 0
|
||||
|
Binary file not shown.
@ -0,0 +1 @@
|
||||
,key,devbian,20.10.2023 11:27,file:///home/key/.config/libreoffice/4;
|
Binary file not shown.
Binary file not shown.
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,48 @@
|
||||
from flask_wtf import FlaskForm
|
||||
from wtforms import SubmitField, SelectField, DateField, IntegerField, StringField
|
||||
from wtforms.validators import DataRequired, Length, ValidationError
|
||||
from flask_wtf.file import FileField, FileAllowed
|
||||
import minibase.database.utils as dbUtils
|
||||
|
||||
|
||||
class getCompanyNameForm(FlaskForm): # Defines the form class to be used for the user registretion
|
||||
# Decalarion of the fields for the form and it's propereties
|
||||
company = SelectField('Company Name', choices=dbUtils.getCompanyNames, validators=[DataRequired()])
|
||||
submit = SubmitField('Show Projects')
|
||||
|
||||
|
||||
class getProjectNameForm(FlaskForm): # Defines the form class to be used for the user registretion
|
||||
# Decalarion of the fields for the form and it's propereties
|
||||
project = SelectField('Project Name', choices=dbUtils.getProjectOfSelectedCompany, validators=[DataRequired()])
|
||||
submit = SubmitField('Show Project details')
|
||||
|
||||
|
||||
class projectRegisterForm(FlaskForm):
|
||||
name = StringField('ProjectName', validators=[DataRequired(), Length(min=3, max=20)])
|
||||
description = StringField('ProjectName', validators=[DataRequired(), Length(min=3, max=300)])
|
||||
qtePrototype = IntegerField('Prototye Quantity', validators=[DataRequired()])
|
||||
datePrototye = DateField('Prototyping Date', validators=[DataRequired()])
|
||||
qteStart = IntegerField('Starting Quantity', validators=[DataRequired()])
|
||||
dateStart = DateField('Firts Starting Date', validators=[DataRequired()])
|
||||
qteStartProduction = IntegerField('Production Quantity', validators=[DataRequired()])
|
||||
dateProduction = DateField('Production Date', validators=[DataRequired()])
|
||||
company = SelectField('Company name', choices=dbUtils.getCompanyNames, validators=[DataRequired()])
|
||||
industry = SelectField('industry', choices=dbUtils.getIndustryNames, validators=[DataRequired()])
|
||||
picture = FileField('Update Profile Picture', validators=[FileAllowed(['jpg', 'png'])])
|
||||
submit = SubmitField('Register Project')
|
||||
|
||||
|
||||
class projectUpdateForm(FlaskForm):
|
||||
description = StringField('Description', validators=[DataRequired(), Length(min=3, max=300)])
|
||||
industry = SelectField('industry', validators=[DataRequired()])
|
||||
status = SelectField('Status', validators=[DataRequired()])
|
||||
responsible = SelectField('Repsonsible', validators=[DataRequired()])
|
||||
qtePrototype = IntegerField('Prototye Quantity', validators=[DataRequired()])
|
||||
datePrototype = DateField('Prototyping Date', validators=[DataRequired()])
|
||||
qteStart = IntegerField('Starting Quantity', validators=[DataRequired()])
|
||||
dateStart = DateField('Starting Date', validators=[DataRequired()])
|
||||
qteProduction = IntegerField('Production Quantity', validators=[DataRequired()])
|
||||
dateProduction = DateField('Production Date', validators=[DataRequired()])
|
||||
picture = FileField('Picture', validators=[FileAllowed(['jpg', 'png'])])
|
||||
submit = SubmitField('Update Project')
|
||||
|
@ -1,37 +1,97 @@
|
||||
from flask import render_template, url_for, flash, redirect, request, Blueprint
|
||||
from flask import render_template, url_for, flash, redirect, request, Blueprint, session
|
||||
from minibase import db
|
||||
from minibase.config import themeMinibase
|
||||
from minibase.database.models import Company, Company_legal_entity, Company_relation,Company_status
|
||||
from minibase.database.models import Industry, Note_status
|
||||
from minibase.database.models import Person_role, Person_competence
|
||||
from minibase.database.models import Project_status
|
||||
from minibase.admin.forms import compLegalEntityForm, compRelationForm, industryRegisterForm,personRoleForm, personCompetenceForm, compStatusForm, noteStatusForm
|
||||
from minibase.admin.forms import projectStatusForm
|
||||
from minibase.project.forms import getProjectNameForm, getCompanyNameForm, projectUpdateForm
|
||||
import minibase.database.utils as dbUtils
|
||||
from minibase.database.models import Project, Company
|
||||
|
||||
# Declaring a blueprint
|
||||
project = Blueprint('project', __name__)
|
||||
|
||||
|
||||
@admin.route("/register", methods=['GET', 'POST'])
|
||||
def register():
|
||||
form = register()
|
||||
legal_entities = Company_legal_entity.query.order_by(Company_legal_entity.name.asc())
|
||||
@project.route("/select_company", methods=['GET', 'POST'])
|
||||
def select_company():
|
||||
form = getCompanyNameForm()
|
||||
if form.validate_on_submit():
|
||||
companyLegal = Company_legal_entity(
|
||||
name=form.name.data,
|
||||
description=form.description.data)
|
||||
# Here we need to give the id of thr role as this is a foreign key
|
||||
db.session.add(companyLegal)
|
||||
db.session.commit()
|
||||
companyId = dbUtils.getCompanyId(form.company.data)
|
||||
dbUtils.setSelectedCompany(companyId)
|
||||
return redirect(url_for('project.select_project'))
|
||||
|
||||
return render_template('project/select_company.html',
|
||||
title='Select Company Name',
|
||||
theme=themeMinibase,
|
||||
form=form)
|
||||
|
||||
|
||||
@project.route("/select_project", methods=['GET', 'POST'])
|
||||
def select_project():
|
||||
if dbUtils.getSelectedCompany(): # If a company is lesected
|
||||
form = getProjectNameForm()
|
||||
companyId = dbUtils.getSelectedCompany()
|
||||
company_selected = dbUtils.getCompanyName(companyId)
|
||||
if form.validate_on_submit():
|
||||
flash(f'{"Project Loaded"}', 'success')
|
||||
projectId = dbUtils.getProjectId(companyId, form.project.data)
|
||||
dbUtils.setSelectedProject(projectId)
|
||||
return redirect(url_for('project.show_project'))
|
||||
|
||||
flash(f'{"Company Legal Entity registered!"}', 'success')
|
||||
return render_template('admin/company_register_legal_entity.html',
|
||||
title='Register Company Legal Entity',
|
||||
legal_entities=legal_entities,
|
||||
return render_template('project/select_project.html',
|
||||
title='Select Project Name for : ' + company_selected,
|
||||
theme=themeMinibase,
|
||||
form=form)
|
||||
else:
|
||||
return redirect(url_for('project.select_company'))
|
||||
|
||||
|
||||
|
||||
@project.route("/show_project", methods=['GET', 'POST'])
|
||||
def show_project():
|
||||
if dbUtils.getSelectedProject(): # If a project is lesected
|
||||
form = projectUpdateForm()
|
||||
projectId = dbUtils.getSelectedProject()
|
||||
project = dbUtils.getProject(projectId)
|
||||
image_file = url_for('static', filename='pics/' + project.image_file)
|
||||
notes = dbUtils.getSelectedProjectNotes()
|
||||
# To initiate choises as a list allow us to match it with the id's
|
||||
form.responsible.choices = [(row.id, row.name +' '+row.last_name) for row in dbUtils.getEmployeesOfSelectedCompany()]
|
||||
form.status.choices = [(row.id, row.name) for row in dbUtils.getProjectStatuses()]
|
||||
form.industry.choices = [(row.id, row.name) for row in dbUtils.getIndustryNames()]
|
||||
|
||||
if form.validate_on_submit():
|
||||
flash(f'{"Project Updated"}', 'success')
|
||||
project.owner_id = int(form.responsible.data)
|
||||
project.status_id = int(form.status.data)
|
||||
project.description = form.description.data
|
||||
project.qte_prototype = form.qtePrototype.data
|
||||
project.qte_start = form.qteStart.data
|
||||
project.qte_production = form.qteProduction.data
|
||||
project.date_prototype = form.datePrototype.data
|
||||
project.date_start = form.dateStart.data
|
||||
project.date_production = form.dateProduction.data
|
||||
db.session.add(project)
|
||||
db.session.commit()
|
||||
return redirect(url_for('project.show_project'))
|
||||
elif request.method == 'GET':
|
||||
form.responsible.data = str(project.owner_id)
|
||||
form.status.data = str(project.status.id)
|
||||
form.industry.data = str(project.industry_id)
|
||||
form.description.data = project.description
|
||||
form.qtePrototype.data = project.qte_prototype
|
||||
form.qteStart.data = project.qte_start
|
||||
form.qteProduction.data = project.qte_production
|
||||
form.datePrototype.data = project.date_prototype
|
||||
form.dateStart.data = project.date_start
|
||||
form.dateProduction.data = project.date_production
|
||||
|
||||
return render_template('admin/company_register_legal_entity.html',
|
||||
title='Register Company Legal Entity',
|
||||
legal_entities=legal_entities,
|
||||
return render_template('project/show_project.html',
|
||||
#title=project.belongs_to.name + ' : ' + project.name,
|
||||
title="kerem",
|
||||
companyName=project.belongs_to.name,
|
||||
projectName=project.name,
|
||||
projectId=project.id,
|
||||
notes=notes,
|
||||
image_file=image_file,
|
||||
theme=themeMinibase,
|
||||
form=form)
|
||||
else:
|
||||
return redirect(url_for('project.select_project'))
|
||||
|
Binary file not shown.
Binary file not shown.
After Width: | Height: | Size: 11 KiB |
@ -0,0 +1,30 @@
|
||||
{% extends "layout.html" %}
|
||||
{% block content %}
|
||||
<div class="{{ theme.userInputDivClass }}" style="{{ theme.userInputFormColor }}">
|
||||
<form method="POST" action="">
|
||||
{{ form.hidden_tag() }}
|
||||
<fieldset class="form-group">
|
||||
<legend class="border-bottom mb-4">{{ title }}</legend>
|
||||
<!-- Country of the company -->
|
||||
<div class="form-group">
|
||||
{{ form.company.label(class="form-control-label") }}
|
||||
{% if form.company.errors %}
|
||||
{{ form.company(class="form-control form-control-lg is-invalid") }}
|
||||
<div class="invalid-feedback">
|
||||
{% for error in form.company.errors %}
|
||||
<span>{{ error }}</span>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% else %}
|
||||
{{ form.company(class="form-control form-control-lg") }}
|
||||
{% endif %}
|
||||
</div>
|
||||
</fieldset>
|
||||
<!-- Submit Button -->
|
||||
<div class="form-group">
|
||||
{{ form.submit(class="btn btn-outline-info") }}
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
{% endblock content %}
|
||||
|
@ -0,0 +1,31 @@
|
||||
{% extends "layout.html" %}
|
||||
{% block content %}
|
||||
<div class="{{ theme.userInputDivClass }}" style="{{ theme.userInputFormColor }}">
|
||||
<form method="POST" action="">
|
||||
{{ form.hidden_tag() }}
|
||||
<fieldset class="form-group">
|
||||
<legend class="border-bottom mb-4">{{ title }}</legend>
|
||||
<!-- Country of the project -->
|
||||
<div class="form-group">
|
||||
{{ form.project.label(class="form-control-label") }}
|
||||
{% if form.project.errors %}
|
||||
{{ form.project(class="form-control form-control-lg is-invalid") }}
|
||||
<div class="invalid-feedback">
|
||||
{% for error in form.project.errors %}
|
||||
<span>{{ error }}</span>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% else %}
|
||||
{{ form.project(class="form-control form-control-lg") }}
|
||||
{% endif %}
|
||||
</div>
|
||||
</fieldset>
|
||||
<!-- Submit Button -->
|
||||
<div class="form-group">
|
||||
{{ form.submit(class="btn btn-outline-info") }}
|
||||
<a type="button" class="btn btn-secondary" href="{{ url_for('project.select_company') }}">Back to company selection</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
{% endblock content %}
|
||||
|
@ -0,0 +1,209 @@
|
||||
{% extends "layout.html" %}
|
||||
{% block content %}
|
||||
<div class="container-fluid" style="{{ theme.userInputFormColor }}">
|
||||
<div class="container py-2">
|
||||
<div class="row">
|
||||
<div class="col-lg-4">
|
||||
<div class="card mb-4">
|
||||
<div class="card-body text-center">
|
||||
<h4 class="card-title">{{ projectName }}</h4>
|
||||
<h6 class="card-subtitle mb-2 text-muted">ID: {{ projectId }}</h6>
|
||||
<img src={{ image_file }} alt="avatar" class="rounded-circle img-fluid" style="width: 150px;">
|
||||
</div>
|
||||
</div>
|
||||
<div class="card mb-4 mb-lg-0">
|
||||
<div class="card-body p-0">
|
||||
<ul class="list-group list-group-flush rounded-3">
|
||||
{% for note in notes %}
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title"> <a href="#">{{ note.title }} |{{ note.project_note_status }}| </a> </h5>
|
||||
<h6 class="card-subtitle mb-2 text-muted">Posted: {{ note.date_posted.strftime('%d-%m-%Y') }} | Due: {{ note.date_due.strftime('%d-%m-%Y')}}</h6>
|
||||
<p class="card-text">{{ note.content }}</p>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-8">
|
||||
<div class="card mb-4">
|
||||
<form class="card-body" method="POST" action="">
|
||||
{{ form.hidden_tag() }}
|
||||
<div class="form-goup row">
|
||||
<div class="col-sm-2">
|
||||
Name
|
||||
</div>
|
||||
<div class="col">
|
||||
{{ projectName }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-goup row">
|
||||
{{ form.description.label(class="col-sm-2 col-form-label") }}
|
||||
<div class="col-sm-10">
|
||||
{% if form.description.errors %}
|
||||
{{ form.description( class="form-control is-invalid") }}
|
||||
<div class="invalid-feedback">
|
||||
{% for error in form.description.errors %}
|
||||
<span>{{ error }}</span>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% else %}
|
||||
{{ form.description( class="form-control") }}
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-goup row">
|
||||
{{ form.industry.label(class="col-sm-2 col-form-label") }}
|
||||
<div class="col-sm-10">
|
||||
{% if form.industry.errors %}
|
||||
{{ form.industry( class="form-control is-invalid") }}
|
||||
<div class="invalid-feedback">
|
||||
{% for error in form.industry.errors %}
|
||||
<span>{{ error }}</span>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% else %}
|
||||
{{ form.industry( class="form-control") }}
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-goup row">
|
||||
{{ form.status.label(class="col-sm-2 col-form-label") }}
|
||||
<div class="col-sm-10">
|
||||
{% if form.status.errors %}
|
||||
{{ form.status( class="form-control is-invalid") }}
|
||||
<div class="invalid-feedback">
|
||||
{% for error in form.status.errors %}
|
||||
<span>{{ error }}</span>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% else %}
|
||||
{{ form.status( class="form-control") }}
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="form-goup row">
|
||||
{{ form.responsible.label(class="col-sm-2 col-form-label") }}
|
||||
<div class="col-sm-10">
|
||||
{% if form.responsible.errors %}
|
||||
{{ form.responsible( class="form-control is-invalid") }}
|
||||
<div class="invalid-feedback">
|
||||
{% for error in form.responsible.errors %}
|
||||
<span>{{ error }}</span>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% else %}
|
||||
{{ form.responsible( class="form-control") }}
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="form-goup row text-center">
|
||||
<div class="col">
|
||||
{{ form.qtePrototype.label(class="col-form-label") }}
|
||||
<div class="col">
|
||||
{% if form.qtePrototype.errors %}
|
||||
{{ form.qtePrototype( class="form-control is-invalid") }}
|
||||
<div class="invalid-feedback">
|
||||
{% for error in form.qtePrototype.errors %}
|
||||
<span>{{ error }}</span>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% else %}
|
||||
{{ form.qtePrototype( class="form-control") }}
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
{{ form.qteStart.label(class="col-form-label") }}
|
||||
<div class="col">
|
||||
{% if form.qteStart.errors %}
|
||||
{{ form.qteStart( class="form-control is-invalid") }}
|
||||
<div class="invalid-feedback">
|
||||
{% for error in form.qteStart.errors %}
|
||||
<span>{{ error }}</span>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% else %}
|
||||
{{ form.qteStart( class="form-control") }}
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
{{ form.qteProduction.label(class="col-form-label") }}
|
||||
<div class="col">
|
||||
{% if form.qteProduction.errors %}
|
||||
{{ form.qteProduction( class="form-control is-invalid") }}
|
||||
<div class="invalid-feedback">
|
||||
{% for error in form.qteProduction.errors %}
|
||||
<span>{{ error }}</span>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% else %}
|
||||
{{ form.qteProduction( class="form-control") }}
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-goup row text-center">
|
||||
<div class="col">
|
||||
{{ form.datePrototype.label(class="col-form-label") }}
|
||||
<div class="col">
|
||||
{% if form.datePrototype.errors %}
|
||||
{{ form.datePrototype( class="form-control is-invalid") }}
|
||||
<div class="invalid-feedback">
|
||||
{% for error in form.datePrototype.errors %}
|
||||
<span>{{ error }}</span>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% else %}
|
||||
{{ form.datePrototype( class="form-control") }}
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
{{ form.dateStart.label(class="col-form-label") }}
|
||||
<div class="col">
|
||||
{% if form.dateStart.errors %}
|
||||
{{ form.dateStart( class="form-control is-invalid") }}
|
||||
<div class="invalid-feedback">
|
||||
{% for error in form.dateStart.errors %}
|
||||
<span>{{ error }}</span>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% else %}
|
||||
{{ form.dateStart( class="form-control") }}
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
{{ form.dateProduction.label(class="col-form-label") }}
|
||||
<div class="col">
|
||||
{% if form.dateProduction.errors %}
|
||||
{{ form.dateProduction( class="form-control is-invalid") }}
|
||||
<div class="invalid-feedback">
|
||||
{% for error in form.dateProduction.errors %}
|
||||
<span>{{ error }}</span>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% else %}
|
||||
{{ form.dateProduction( class="form-control") }}
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="form-group">
|
||||
{{ form.submit(class="btn btn-outline-info") }}
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endblock content %}
|
@ -0,0 +1,20 @@
|
||||
bcrypt==4.0.1
|
||||
blinker==1.6.2
|
||||
click==8.1.7
|
||||
dnspython==2.4.2
|
||||
email-validator==2.0.0.post2
|
||||
Flask-Session==0.4.1
|
||||
Flask==2.2.5
|
||||
Flask-Bcrypt==1.0.1
|
||||
Flask-Login==0.6.2
|
||||
Flask-SQLAlchemy==3.1.1
|
||||
Flask-WTF==1.2.1
|
||||
greenlet==2.0.2
|
||||
idna==3.4
|
||||
itsdangerous==2.1.2
|
||||
Jinja2==3.1.2
|
||||
MarkupSafe==2.1.3
|
||||
SQLAlchemy==2.0.21
|
||||
typing_extensions==4.8.0
|
||||
Werkzeug==2.3.0
|
||||
WTForms==3.0.1
|
@ -0,0 +1,7 @@
|
||||
from minibase import db, create_minibase
|
||||
import minibase.database.utils as dbUtils
|
||||
import minibase.database.models as model
|
||||
|
||||
app = create_minibase()
|
||||
app.app_context().push()
|
||||
|
Loading…
Reference in new issue