parent
5d3b3b4a82
commit
1fd231a1a7
@ -0,0 +1,269 @@
|
|||||||
|
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.
@ -1,165 +1,414 @@
|
|||||||
from flask import render_template, url_for, flash, redirect, request, Blueprint
|
from flask import render_template, url_for, flash, redirect, request, Blueprint
|
||||||
from minibase import db
|
from minibase import db
|
||||||
from minibase.config import themeMinibase
|
from minibase.config import themeMinibase
|
||||||
from minibase.database.models import Company, Company_legal_entity, Company_relation
|
from minibase.database.models import Company, Company_legal_entity, Company_relation,Company_status
|
||||||
from minibase.database.models import Industry
|
from minibase.database.models import Industry, Note_status
|
||||||
from minibase.database.models import Person_role, Person_competence
|
from minibase.database.models import Person_role, Person_competence
|
||||||
from minibase.admin.forms import compLegalEntityForm, compRelationForm, compIndustryForm,personRoleForm, personCompetenceForm, statusRegisterForm
|
from minibase.database.models import Product_status, Product_physical, Product_packaging, Product_eligibility, Product_classification, Product_domain, Product_category, Product_sub_category
|
||||||
|
from minibase.admin.forms import compLegalEntityForm, compRelationForm, compStatusForm
|
||||||
|
from minibase.admin.forms import personRoleForm, personCompetenceForm
|
||||||
|
from minibase.admin.forms import industryRegisterForm, noteStatusForm
|
||||||
|
from minibase.admin.forms import projectStatusForm
|
||||||
|
from minibase.admin.forms import productStatusForm, productEligibilityForm, productDomainForm, productClassificationForm, productCategoryForm, productSubCategoryForm
|
||||||
# Declaring a blueprint
|
# Declaring a blueprint
|
||||||
admin = Blueprint('admin', __name__)
|
admin = Blueprint('admin', __name__)
|
||||||
|
|
||||||
|
|
||||||
@admin.route("/company_register_legal_entity", methods=['GET', 'POST'])
|
@admin.route("/company_register_legal_entity", methods=['GET', 'POST'])
|
||||||
def company_register_legal_entity():
|
def company_register_legal_entity():
|
||||||
|
toPrint = "Company Legal Entity"
|
||||||
form = compLegalEntityForm()
|
form = compLegalEntityForm()
|
||||||
legal_entities = Company_legal_entity.query.order_by(Company_legal_entity.name.asc())
|
query = Company_legal_entity.query.order_by(Company_legal_entity.name.asc())
|
||||||
if form.validate_on_submit():
|
if form.validate_on_submit():
|
||||||
companyLegal = Company_legal_entity(
|
dbRow = Company_legal_entity(
|
||||||
name=form.name.data,
|
name=form.name.data,
|
||||||
description=form.description.data)
|
description=form.description.data)
|
||||||
# Here we need to give the id of thr role as this is a foreign key
|
# Here we need to give the id of thr role as this is a foreign key
|
||||||
db.session.add(companyLegal)
|
db.session.add(dbRow)
|
||||||
db.session.commit()
|
db.session.commit()
|
||||||
|
|
||||||
flash(f'{"Company Legal Entity registered!"}', 'success')
|
flash(f' {toPrint} {" registered!"}', 'success')
|
||||||
return render_template('admin/company_register_legal_entity.html',
|
return render_template('admin/register_name_and_desc.html',
|
||||||
title='Register Company Legal Entity',
|
title='Register ' + toPrint,
|
||||||
legal_entities=legal_entities,
|
tableTitle='Existing ' + toPrint,
|
||||||
|
dbTable=query,
|
||||||
theme=themeMinibase,
|
theme=themeMinibase,
|
||||||
form=form)
|
form=form)
|
||||||
|
|
||||||
return render_template('admin/company_register_legal_entity.html',
|
return render_template('admin/register_name_and_desc.html',
|
||||||
title='Register Company Legal Entity',
|
title='Register ' + toPrint,
|
||||||
legal_entities=legal_entities,
|
tableTitle='Existing ' + toPrint,
|
||||||
|
dbTable=query,
|
||||||
theme=themeMinibase,
|
theme=themeMinibase,
|
||||||
form=form)
|
form=form)
|
||||||
|
|
||||||
|
|
||||||
@admin.route("/company_register_relation", methods=['GET', 'POST'])
|
@admin.route("/company_register_relation", methods=['GET', 'POST'])
|
||||||
def company_register_relation():
|
def company_register_relation():
|
||||||
|
toPrint = "Company Relation"
|
||||||
form = compRelationForm()
|
form = compRelationForm()
|
||||||
relations = Company_relation.query.order_by(Company_relation.name.asc())
|
query = Company_relation.query.order_by(Company_relation.name.asc())
|
||||||
if form.validate_on_submit():
|
if form.validate_on_submit():
|
||||||
companyRelation = Company_relation(
|
dbRow = Company_relation(
|
||||||
name=form.name.data,
|
name=form.name.data,
|
||||||
description=form.description.data)
|
description=form.description.data)
|
||||||
# Here we need to give the id of thr role as this is a foreign key
|
# Here we need to give the id of thr role as this is a foreign key
|
||||||
db.session.add(companyRelation)
|
db.session.add(dbRow)
|
||||||
db.session.commit()
|
db.session.commit()
|
||||||
|
|
||||||
flash(f'{"Company Relation registered!"}', 'success')
|
flash(f' {toPrint} {" registered!"}', 'success')
|
||||||
return render_template('admin/company_register_relation.html',
|
return render_template('admin/register_name_and_desc.html',
|
||||||
title='Register Company Relation',
|
title='Register ' + toPrint,
|
||||||
relations=relations,
|
tableTitle='Existing ' + toPrint,
|
||||||
|
dbTable=query,
|
||||||
theme=themeMinibase,
|
theme=themeMinibase,
|
||||||
form=form)
|
form=form)
|
||||||
|
|
||||||
return render_template('admin/company_register_relation.html',
|
return render_template('admin/register_name_and_desc.html',
|
||||||
title='Register Company Relation',
|
title='Register ' + toPrint,
|
||||||
|
tableTitle='Existing ' + toPrint,
|
||||||
|
dbTable=query,
|
||||||
theme=themeMinibase,
|
theme=themeMinibase,
|
||||||
relations=relations,
|
|
||||||
form=form)
|
form=form)
|
||||||
|
|
||||||
|
|
||||||
@admin.route("/company_register_industry", methods=['GET', 'POST'])
|
@admin.route("/company_register_status", methods=['GET', 'POST'])
|
||||||
def company_register_industry():
|
def company_register_status():
|
||||||
form = compIndustryForm()
|
toPrint = "Company Status"
|
||||||
industries = Industry.query.order_by(Industry.name.asc())
|
form = compStatusForm()
|
||||||
|
query = Company_status.query.order_by(Company_status.name.asc())
|
||||||
if form.validate_on_submit():
|
if form.validate_on_submit():
|
||||||
companyIndustry = Industry(
|
dbRow = Company_status(
|
||||||
name=form.name.data,
|
name=form.name.data,
|
||||||
description=form.description.data)
|
description=form.description.data)
|
||||||
# Here we need to give the id of thr role as this is a foreign key
|
# Here we need to give the id of thr role as this is a foreign key
|
||||||
db.session.add(companyIndustry)
|
db.session.add(dbRow)
|
||||||
db.session.commit()
|
db.session.commit()
|
||||||
|
|
||||||
flash(f'{"Company Idustry registered!"}', 'success')
|
flash(f' {toPrint} {" registered!"}', 'success')
|
||||||
return render_template('admin/company_register_industry.html',
|
return render_template('admin/register_name_and_desc.html',
|
||||||
title='Register Company Industry',
|
title='Register ' + toPrint,
|
||||||
industries=industries,
|
tableTitle='Existing ' + toPrint,
|
||||||
|
dbTable=query,
|
||||||
theme=themeMinibase,
|
theme=themeMinibase,
|
||||||
form=form)
|
form=form)
|
||||||
|
|
||||||
return render_template('admin/company_register_industry.html',
|
return render_template('admin/register_name_and_desc.html',
|
||||||
title='Register Company Industry',
|
title='Register ' + toPrint,
|
||||||
industries=industries,
|
tableTitle='Existing ' + toPrint,
|
||||||
|
dbTable=query,
|
||||||
|
theme=themeMinibase,
|
||||||
|
form=form)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@admin.route("/register_industry", methods=['GET', 'POST'])
|
||||||
|
def register_industry():
|
||||||
|
toPrint = "Company Industry"
|
||||||
|
form = industryRegisterForm()
|
||||||
|
query = Industry.query.order_by(Industry.name.asc())
|
||||||
|
if form.validate_on_submit():
|
||||||
|
dbRow = Industry(
|
||||||
|
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(dbRow)
|
||||||
|
db.session.commit()
|
||||||
|
|
||||||
|
flash(f' {toPrint} {" registered!"}', 'success')
|
||||||
|
return render_template('admin/register_name_and_desc.html',
|
||||||
|
title='Register ' + toPrint,
|
||||||
|
tableTitle='Existing ' + toPrint,
|
||||||
|
dbTable=query,
|
||||||
|
theme=themeMinibase,
|
||||||
|
form=form)
|
||||||
|
|
||||||
|
return render_template('admin/register_name_and_desc.html',
|
||||||
|
title='Register ' + toPrint,
|
||||||
|
tableTitle='Existing ' + toPrint,
|
||||||
|
dbTable=query,
|
||||||
theme=themeMinibase,
|
theme=themeMinibase,
|
||||||
form=form)
|
form=form)
|
||||||
|
|
||||||
|
|
||||||
@admin.route("/person_register_role", methods=['GET', 'POST'])
|
@admin.route("/person_register_role", methods=['GET', 'POST'])
|
||||||
def person_register_role():
|
def person_register_role():
|
||||||
|
toPrint = "Person Role"
|
||||||
form = personRoleForm()
|
form = personRoleForm()
|
||||||
roles = Person_role.query.order_by(Person_role.name.asc())
|
query = Person_role.query.order_by(Person_role.name.asc())
|
||||||
if form.validate_on_submit():
|
if form.validate_on_submit():
|
||||||
personRole = Person_role(
|
dbRow = Person_role(
|
||||||
name=form.name.data,
|
name=form.name.data,
|
||||||
description=form.description.data)
|
description=form.description.data)
|
||||||
# Here we need to give the id of thr role as this is a foreign key
|
# Here we need to give the id of thr role as this is a foreign key
|
||||||
db.session.add(personRole)
|
db.session.add(dbRow)
|
||||||
db.session.commit()
|
db.session.commit()
|
||||||
|
|
||||||
flash(f'{"Person Role registered!"}', 'success')
|
flash(f' {toPrint} {" registered!"}', 'success')
|
||||||
return render_template('admin/person_register_role.html',
|
return render_template('admin/register_name_and_desc.html',
|
||||||
title='Register Person_role',
|
title='Register ' + toPrint,
|
||||||
|
tableTitle='Existing ' + toPrint,
|
||||||
|
dbTable=query,
|
||||||
theme=themeMinibase,
|
theme=themeMinibase,
|
||||||
roles=roles,
|
|
||||||
form=form)
|
form=form)
|
||||||
|
|
||||||
return render_template('admin/person_register_role.html',
|
return render_template('admin/register_name_and_desc.html',
|
||||||
title='Register Person Role',
|
title='Register ' + toPrint,
|
||||||
|
tableTitle='Existing ' + toPrint,
|
||||||
|
dbTable=query,
|
||||||
theme=themeMinibase,
|
theme=themeMinibase,
|
||||||
roles=roles,
|
|
||||||
form=form)
|
form=form)
|
||||||
|
|
||||||
|
|
||||||
@admin.route("/person_register_competence", methods=['GET', 'POST'])
|
@admin.route("/person_register_competence", methods=['GET', 'POST'])
|
||||||
def person_register_competence():
|
def person_register_competence():
|
||||||
|
toPrint = "Person Competence"
|
||||||
form = personCompetenceForm()
|
form = personCompetenceForm()
|
||||||
competences = Person_competence.query.order_by(Person_competence.name.asc())
|
query = Person_competence.query.order_by(Person_competence.name.asc())
|
||||||
if form.validate_on_submit():
|
if form.validate_on_submit():
|
||||||
personCompetence = Person_competence(
|
dbRow = Person_competence(
|
||||||
name=form.name.data,
|
name=form.name.data,
|
||||||
description=form.description.data)
|
description=form.description.data)
|
||||||
# Here we need to give the id of thr role as this is a foreign key
|
# Here we need to give the id of thr role as this is a foreign key
|
||||||
db.session.add(personCompetence)
|
db.session.add(dbRow)
|
||||||
db.session.commit()
|
db.session.commit()
|
||||||
|
|
||||||
flash(f'{"Person Competence registered!"}', 'success')
|
flash(f' {toPrint} {" registered!"}', 'success')
|
||||||
return render_template('admin/person_register_competence.html',
|
return render_template('admin/register_name_and_desc.html',
|
||||||
title='Register Person Competence',
|
title='Register ' + toPrint,
|
||||||
competences=competences,
|
tableTitle='Existing ' + toPrint,
|
||||||
|
dbTable=query,
|
||||||
theme=themeMinibase,
|
theme=themeMinibase,
|
||||||
form=form)
|
form=form)
|
||||||
|
|
||||||
return render_template('admin/person_register_competence.html',
|
return render_template('admin/register_name_and_desc.html',
|
||||||
title='Register Person Competence',
|
title='Register ' + toPrint,
|
||||||
|
tableTitle='Existing ' + toPrint,
|
||||||
|
dbTable=query,
|
||||||
theme=themeMinibase,
|
theme=themeMinibase,
|
||||||
competences=competences,
|
|
||||||
form=form)
|
form=form)
|
||||||
|
|
||||||
@admin.route("/status_register", methods=['GET', 'POST'])
|
|
||||||
def status_register():
|
@admin.route("/note_register_status", methods=['GET', 'POST'])
|
||||||
form = statusRegisterForm()
|
def note_register_status():
|
||||||
statuses = Status.query.order_by(Status.name.asc())
|
toPrint = "Note Status"
|
||||||
|
form = noteStatusForm()
|
||||||
|
query = Note_status.query.order_by(Note_status.name.asc())
|
||||||
if form.validate_on_submit():
|
if form.validate_on_submit():
|
||||||
statusRegister = Status(
|
dbRow = Company_status(
|
||||||
name=form.name.data,
|
name=form.name.data,
|
||||||
description=form.description.data)
|
description=form.description.data)
|
||||||
# Here we need to give the id of thr role as this is a foreign key
|
# Here we need to give the id of thr role as this is a foreign key
|
||||||
db.session.add(statusRegister)
|
db.session.add(dbRow)
|
||||||
|
db.session.commit()
|
||||||
|
|
||||||
|
flash(f' {toPrint} {" registered!"}', 'success')
|
||||||
|
return render_template('admin/register_name_and_desc.html',
|
||||||
|
title='Register ' + toPrint,
|
||||||
|
tableTitle='Existing ' + toPrint,
|
||||||
|
dbTable=query,
|
||||||
|
theme=themeMinibase,
|
||||||
|
form=form)
|
||||||
|
|
||||||
|
return render_template('admin/register_name_and_desc.html',
|
||||||
|
title='Register ' + toPrint,
|
||||||
|
tableTitle='Existing ' + toPrint,
|
||||||
|
dbTable=query,
|
||||||
|
theme=themeMinibase,
|
||||||
|
form=form)
|
||||||
|
|
||||||
|
|
||||||
|
@admin.route("/project_register_status", methods=['GET', 'POST'])
|
||||||
|
def project_register_status():
|
||||||
|
toPrint = "Project Status"
|
||||||
|
form = projectStatusForm()
|
||||||
|
query = Project_status.query.order_by(Project_status.name.asc())
|
||||||
|
if form.validate_on_submit():
|
||||||
|
dbRow = Project_status(
|
||||||
|
name=form.name.data,
|
||||||
|
description=form.description.data)
|
||||||
|
db.session.add(dbRow)
|
||||||
|
db.session.commit()
|
||||||
|
|
||||||
|
flash(f' {toPrint} {" registered!"}', 'success')
|
||||||
|
return render_template('admin/register_name_and_desc.html',
|
||||||
|
title='Register ' + toPrint,
|
||||||
|
tableTitle='Existing ' + toPrint,
|
||||||
|
dbTable=query,
|
||||||
|
theme=themeMinibase,
|
||||||
|
form=form)
|
||||||
|
|
||||||
|
return render_template('admin/register_name_and_desc.html',
|
||||||
|
title='Register ' + toPrint,
|
||||||
|
tableTitle='Existing ' + toPrint,
|
||||||
|
dbTable=query,
|
||||||
|
theme=themeMinibase,
|
||||||
|
form=form)
|
||||||
|
|
||||||
|
|
||||||
|
@admin.route("/product_register_status", methods=['GET', 'POST'])
|
||||||
|
def product_register_status():
|
||||||
|
toPrint = "Product Status"
|
||||||
|
form = productStatusForm()
|
||||||
|
query = Product_status.query.order_by(Product_status.name.asc())
|
||||||
|
if form.validate_on_submit():
|
||||||
|
dbRow = Product_status(
|
||||||
|
name=form.name.data,
|
||||||
|
description=form.description.data)
|
||||||
|
db.session.add(dbRow)
|
||||||
|
db.session.commit()
|
||||||
|
|
||||||
|
flash(f' {toPrint} {" registered!"}', 'success')
|
||||||
|
return render_template('admin/register_name_and_desc.html',
|
||||||
|
title='Register ' + toPrint,
|
||||||
|
tableTitle='Existing ' + toPrint,
|
||||||
|
dbTable=query,
|
||||||
|
theme=themeMinibase,
|
||||||
|
form=form)
|
||||||
|
|
||||||
|
return render_template('admin/register_name_and_desc.html',
|
||||||
|
title='Register ' + toPrint,
|
||||||
|
tableTitle='Existing ' + toPrint,
|
||||||
|
dbTable=query,
|
||||||
|
theme=themeMinibase,
|
||||||
|
form=form)
|
||||||
|
|
||||||
|
|
||||||
|
@admin.route("/product_register_eligibility", methods=['GET', 'POST'])
|
||||||
|
def product_register_eligibility():
|
||||||
|
toPrint = "Product Eligibility"
|
||||||
|
form = productEligibilityForm()
|
||||||
|
query = Product_eligibility.query.order_by(Product_eligibility.name.asc())
|
||||||
|
if form.validate_on_submit():
|
||||||
|
dbRow = Product_eligibility(
|
||||||
|
name=form.name.data,
|
||||||
|
description=form.description.data)
|
||||||
|
db.session.add(dbRow)
|
||||||
|
db.session.commit()
|
||||||
|
|
||||||
|
flash(f' {toPrint} {" registered!"}', 'success')
|
||||||
|
return render_template('admin/register_name_and_desc.html',
|
||||||
|
title='Register ' + toPrint,
|
||||||
|
tableTitle='Existing ' + toPrint,
|
||||||
|
dbTable=query,
|
||||||
|
theme=themeMinibase,
|
||||||
|
form=form)
|
||||||
|
|
||||||
|
return render_template('admin/register_name_and_desc.html',
|
||||||
|
title='Register ' + toPrint,
|
||||||
|
tableTitle='Existing ' + toPrint,
|
||||||
|
dbTable=query,
|
||||||
|
theme=themeMinibase,
|
||||||
|
form=form)
|
||||||
|
|
||||||
|
|
||||||
|
@admin.route("/product_register_domain", methods=['GET', 'POST'])
|
||||||
|
def product_register_domain():
|
||||||
|
toPrint = "Product Domain"
|
||||||
|
form = productEligibilityForm()
|
||||||
|
query = Product_domain.query.order_by(Product_domain.name.asc())
|
||||||
|
if form.validate_on_submit():
|
||||||
|
dbRow = Product_domain(
|
||||||
|
name=form.name.data,
|
||||||
|
description=form.description.data)
|
||||||
|
db.session.add(dbRow)
|
||||||
|
db.session.commit()
|
||||||
|
|
||||||
|
flash(f' {toPrint} {" registered!"}', 'success')
|
||||||
|
return render_template('admin/register_name_and_desc.html',
|
||||||
|
title='Register ' + toPrint,
|
||||||
|
tableTitle='Existing ' + toPrint,
|
||||||
|
dbTable=query,
|
||||||
|
theme=themeMinibase,
|
||||||
|
form=form)
|
||||||
|
|
||||||
|
return render_template('admin/register_name_and_desc.html',
|
||||||
|
title='Register ' + toPrint,
|
||||||
|
tableTitle='Existing ' + toPrint,
|
||||||
|
dbTable=query,
|
||||||
|
theme=themeMinibase,
|
||||||
|
form=form)
|
||||||
|
|
||||||
|
|
||||||
|
@admin.route("/product_register_classification", methods=['GET', 'POST'])
|
||||||
|
def product_register_classification():
|
||||||
|
toPrint = "Product Classification"
|
||||||
|
form = productEligibilityForm()
|
||||||
|
query = Product_classification.query.order_by(Product_classification.name.asc())
|
||||||
|
if form.validate_on_submit():
|
||||||
|
dbRow = Product_classification(
|
||||||
|
name=form.name.data,
|
||||||
|
description=form.description.data)
|
||||||
|
db.session.add(dbRow)
|
||||||
|
db.session.commit()
|
||||||
|
|
||||||
|
flash(f' {toPrint} {" registered!"}', 'success')
|
||||||
|
return render_template('admin/register_name_and_desc.html',
|
||||||
|
title='Register ' + toPrint,
|
||||||
|
tableTitle='Existing ' + toPrint,
|
||||||
|
dbTable=query,
|
||||||
|
theme=themeMinibase,
|
||||||
|
form=form)
|
||||||
|
|
||||||
|
return render_template('admin/register_name_and_desc.html',
|
||||||
|
title='Register ' + toPrint,
|
||||||
|
tableTitle='Existing ' + toPrint,
|
||||||
|
dbTable=query,
|
||||||
|
theme=themeMinibase,
|
||||||
|
form=form)
|
||||||
|
|
||||||
|
|
||||||
|
@admin.route("/product_register_category", methods=['GET', 'POST'])
|
||||||
|
def product_register_category():
|
||||||
|
toPrint = "Product Category"
|
||||||
|
form = productEligibilityForm()
|
||||||
|
query = Product_category.query.order_by(Product_category.name.asc())
|
||||||
|
if form.validate_on_submit():
|
||||||
|
dbRow = Product_category(
|
||||||
|
name=form.name.data,
|
||||||
|
description=form.description.data)
|
||||||
|
db.session.add(dbRow)
|
||||||
|
db.session.commit()
|
||||||
|
|
||||||
|
flash(f' {toPrint} {" registered!"}', 'success')
|
||||||
|
return render_template('admin/register_name_and_desc.html',
|
||||||
|
title='Register ' + toPrint,
|
||||||
|
tableTitle='Existing ' + toPrint,
|
||||||
|
dbTable=query,
|
||||||
|
theme=themeMinibase,
|
||||||
|
form=form)
|
||||||
|
|
||||||
|
return render_template('admin/register_name_and_desc.html',
|
||||||
|
title='Register ' + toPrint,
|
||||||
|
tableTitle='Existing ' + toPrint,
|
||||||
|
dbTable=query,
|
||||||
|
theme=themeMinibase,
|
||||||
|
form=form)
|
||||||
|
|
||||||
|
|
||||||
|
@admin.route("/product_register_sub_category", methods=['GET', 'POST'])
|
||||||
|
def product_register_sub_category():
|
||||||
|
toPrint = "Product Sub Category"
|
||||||
|
form = productEligibilityForm()
|
||||||
|
query = Product_sub_category.query.order_by(Product_sub_category.name.asc())
|
||||||
|
if form.validate_on_submit():
|
||||||
|
dbRow = Product_sub_category(
|
||||||
|
name=form.name.data,
|
||||||
|
description=form.description.data)
|
||||||
|
db.session.add(dbRow)
|
||||||
db.session.commit()
|
db.session.commit()
|
||||||
|
|
||||||
flash(f'{"New Status registered!"}', 'success')
|
flash(f' {toPrint} {" registered!"}', 'success')
|
||||||
return render_template('admin/status_register.html',
|
return render_template('admin/register_name_and_desc.html',
|
||||||
title='Register Status',
|
title='Register ' + toPrint,
|
||||||
statuses=statuses,
|
tableTitle='Existing ' + toPrint,
|
||||||
|
dbTable=query,
|
||||||
theme=themeMinibase,
|
theme=themeMinibase,
|
||||||
form=form)
|
form=form)
|
||||||
|
|
||||||
return render_template('admin/status_register.html',
|
return render_template('admin/register_name_and_desc.html',
|
||||||
title='Register Status',
|
title='Register ' + toPrint,
|
||||||
statuses=statuses,
|
tableTitle='Existing ' + toPrint,
|
||||||
|
dbTable=query,
|
||||||
theme=themeMinibase,
|
theme=themeMinibase,
|
||||||
form=form)
|
form=form)
|
||||||
|
@ -1 +1,6 @@
|
|||||||
|
|
||||||
|
def doesNameExistsCi(table, name):
|
||||||
|
exists = table.query.filter(table.name.ilike(name.data)).first() # Database Querry ilike means case insessitive
|
||||||
|
if exists:
|
||||||
|
return 1
|
||||||
|
return 0
|
||||||
|
Binary file not shown.
Binary file not shown.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -0,0 +1 @@
|
|||||||
|
|
@ -0,0 +1,37 @@
|
|||||||
|
from flask import render_template, url_for, flash, redirect, request, Blueprint
|
||||||
|
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
|
||||||
|
# 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())
|
||||||
|
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()
|
||||||
|
|
||||||
|
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,
|
||||||
|
theme=themeMinibase,
|
||||||
|
form=form)
|
||||||
|
|
||||||
|
return render_template('admin/company_register_legal_entity.html',
|
||||||
|
title='Register Company Legal Entity',
|
||||||
|
legal_entities=legal_entities,
|
||||||
|
theme=themeMinibase,
|
||||||
|
form=form)
|
Binary file not shown.
After Width: | Height: | Size: 11 KiB |
@ -1,65 +0,0 @@
|
|||||||
{% extends "layout.html" %}
|
|
||||||
{% block content %}
|
|
||||||
<div class="{{ theme.userInputDivClass }}" style="{{ theme.userInputFormColor }}">
|
|
||||||
<form method="POST" action="">
|
|
||||||
{{ form.hidden_tag() }}
|
|
||||||
<fieldset class="form-group"></fieldset>
|
|
||||||
<legend class="border-bottom mb-4">Register Company Endustry</legend>
|
|
||||||
|
|
||||||
<!-- name of the company-->
|
|
||||||
<div class="form-group">
|
|
||||||
{{ form.name.label(class="form-control-label") }}
|
|
||||||
{% if form.name.errors %}
|
|
||||||
{{ form.name(class="form-control form-control-lg is-invalid") }}
|
|
||||||
<div class="invalid-feedback">
|
|
||||||
{% for error in form.name.errors %}
|
|
||||||
<span>{{ error }}</span>
|
|
||||||
{% endfor %}
|
|
||||||
</div>
|
|
||||||
{% else %}
|
|
||||||
{{ form.name(class="form-control form-control-lg") }}
|
|
||||||
{% endif %}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- description of the company-->
|
|
||||||
<div class="form-group">
|
|
||||||
{{ form.description.label(class="form-control-label") }}
|
|
||||||
{% if form.description.errors %}
|
|
||||||
{{ form.description(class="form-control form-control-lg is-invalid") }}
|
|
||||||
<div class="invalid-feedback">
|
|
||||||
{% for error in form.description.errors %}
|
|
||||||
<span>{{ error }}</span>
|
|
||||||
{% endfor %}
|
|
||||||
</div>
|
|
||||||
{% else %}
|
|
||||||
{{ form.description(class="form-control form-control-lg") }}
|
|
||||||
{% endif %}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Submit Button -->
|
|
||||||
<div class="form-group">
|
|
||||||
{{ form.submit(class="btn btn-outline-info") }}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
<div class="container-fluid pt-2">
|
|
||||||
<h3> <a href="#"> Existing Industries</a> </h3>
|
|
||||||
<table class="{{ theme.tableClass }}">
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th scope="col">Name</th>
|
|
||||||
<th scope="col">Description</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
{% for item in industries %}
|
|
||||||
<tr>
|
|
||||||
<th scope="row">{{ item.name }}</th>
|
|
||||||
<td>{{ item.description}}</td>
|
|
||||||
</tr>
|
|
||||||
{% endfor %}
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
{% endblock content %}
|
|
@ -1,65 +0,0 @@
|
|||||||
{% extends "layout.html" %}
|
|
||||||
{% block content %}
|
|
||||||
<div class="{{ theme.userInputDivClass }}" style="{{ theme.userInputFormColor }}">
|
|
||||||
<form method="POST" action="">
|
|
||||||
{{ form.hidden_tag() }}
|
|
||||||
<fieldset class="form-group"></fieldset>
|
|
||||||
<legend class="border-bottom mb-4">Register Company Legal Entity</legend>
|
|
||||||
|
|
||||||
<!-- name of the company-->
|
|
||||||
<div class="form-group">
|
|
||||||
{{ form.name.label(class="form-control-label") }}
|
|
||||||
{% if form.name.errors %}
|
|
||||||
{{ form.name(class="form-control form-control-lg is-invalid") }}
|
|
||||||
<div class="invalid-feedback">
|
|
||||||
{% for error in form.name.errors %}
|
|
||||||
<span>{{ error }}</span>
|
|
||||||
{% endfor %}
|
|
||||||
</div>
|
|
||||||
{% else %}
|
|
||||||
{{ form.name(class="form-control form-control-lg") }}
|
|
||||||
{% endif %}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- description of the company-->
|
|
||||||
<div class="form-group">
|
|
||||||
{{ form.description.label(class="form-control-label") }}
|
|
||||||
{% if form.description.errors %}
|
|
||||||
{{ form.description(class="form-control form-control-lg is-invalid") }}
|
|
||||||
<div class="invalid-feedback">
|
|
||||||
{% for error in form.description.errors %}
|
|
||||||
<span>{{ error }}</span>
|
|
||||||
{% endfor %}
|
|
||||||
</div>
|
|
||||||
{% else %}
|
|
||||||
{{ form.description(class="form-control form-control-lg") }}
|
|
||||||
{% endif %}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Submit Button -->
|
|
||||||
<div class="form-group">
|
|
||||||
{{ form.submit(class="btn btn-outline-info") }}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
<div class="container-fluid pt-2">
|
|
||||||
<h3> <a href="#"> Existing Legal Entities</a> </h3>
|
|
||||||
<table class="{{ theme.tableClass }}">
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th scope="col">Name</th>
|
|
||||||
<th scope="col">Description</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
{% for item in legal_entities %}
|
|
||||||
<tr>
|
|
||||||
<th scope="row">{{ item.name }}</th>
|
|
||||||
<td>{{ item.description}}</td>
|
|
||||||
</tr>
|
|
||||||
{% endfor %}
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
{% endblock content %}
|
|
@ -1,67 +0,0 @@
|
|||||||
{% extends "layout.html" %}
|
|
||||||
|
|
||||||
|
|
||||||
{% block content %}
|
|
||||||
<div class="{{ theme.userInputDivClass }}" style="{{ theme.userInputFormColor }}">
|
|
||||||
<form method="POST" action="">
|
|
||||||
{{ form.hidden_tag() }}
|
|
||||||
<fieldset class="form-group"></fieldset>
|
|
||||||
<legend class="border-bottom mb-4">Register Company Relation</legend>
|
|
||||||
|
|
||||||
<!-- name of the company-->
|
|
||||||
<div class="form-group">
|
|
||||||
{{ form.name.label(class="form-control-label") }}
|
|
||||||
{% if form.name.errors %}
|
|
||||||
{{ form.name(class="form-control form-control-lg is-invalid") }}
|
|
||||||
<div class="invalid-feedback">
|
|
||||||
{% for error in form.name.errors %}
|
|
||||||
<span>{{ error }}</span>
|
|
||||||
{% endfor %}
|
|
||||||
</div>
|
|
||||||
{% else %}
|
|
||||||
{{ form.name(class="form-control form-control-lg") }}
|
|
||||||
{% endif %}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- description of the company-->
|
|
||||||
<div class="form-group">
|
|
||||||
{{ form.description.label(class="form-control-label") }}
|
|
||||||
{% if form.description.errors %}
|
|
||||||
{{ form.description(class="form-control form-control-lg is-invalid") }}
|
|
||||||
<div class="invalid-feedback">
|
|
||||||
{% for error in form.description.errors %}
|
|
||||||
<span>{{ error }}</span>
|
|
||||||
{% endfor %}
|
|
||||||
</div>
|
|
||||||
{% else %}
|
|
||||||
{{ form.description(class="form-control form-control-lg") }}
|
|
||||||
{% endif %}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Submit Button -->
|
|
||||||
<div class="form-group">
|
|
||||||
{{ form.submit(class="btn btn-outline-info") }}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
<div class="container-fluid pt-2">
|
|
||||||
<h3> <a href="#"> Existing Relations</a> </h3>
|
|
||||||
<table class="{{ theme.tableClass }}">
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th scope="col">Name</th>
|
|
||||||
<th scope="col">Description</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
{% for item in relations %}
|
|
||||||
<tr>
|
|
||||||
<th scope="row">{{ item.name }}</th>
|
|
||||||
<td>{{ item.description}}</td>
|
|
||||||
</tr>
|
|
||||||
{% endfor %}
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
{% endblock content %}
|
|
@ -1,65 +0,0 @@
|
|||||||
{% extends "layout.html" %}
|
|
||||||
{% block content %}
|
|
||||||
<div class="{{ theme.userInputDivClass }}" style="{{ theme.userInputFormColor }}">
|
|
||||||
<form method="POST" action="">
|
|
||||||
{{ form.hidden_tag() }}
|
|
||||||
<fieldset class="form-group"></fieldset>
|
|
||||||
<legend class="border-bottom mb-4">Register Person Competence</legend>
|
|
||||||
|
|
||||||
<!-- name of the company-->
|
|
||||||
<div class="form-group">
|
|
||||||
{{ form.name.label(class="form-control-label") }}
|
|
||||||
{% if form.name.errors %}
|
|
||||||
{{ form.name(class="form-control form-control-lg is-invalid") }}
|
|
||||||
<div class="invalid-feedback">
|
|
||||||
{% for error in form.name.errors %}
|
|
||||||
<span>{{ error }}</span>
|
|
||||||
{% endfor %}
|
|
||||||
</div>
|
|
||||||
{% else %}
|
|
||||||
{{ form.name(class="form-control form-control-lg") }}
|
|
||||||
{% endif %}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- description of the company-->
|
|
||||||
<div class="form-group">
|
|
||||||
{{ form.description.label(class="form-control-label") }}
|
|
||||||
{% if form.description.errors %}
|
|
||||||
{{ form.description(class="form-control form-control-lg is-invalid") }}
|
|
||||||
<div class="invalid-feedback">
|
|
||||||
{% for error in form.description.errors %}
|
|
||||||
<span>{{ error }}</span>
|
|
||||||
{% endfor %}
|
|
||||||
</div>
|
|
||||||
{% else %}
|
|
||||||
{{ form.description(class="form-control form-control-lg") }}
|
|
||||||
{% endif %}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Submit Button -->
|
|
||||||
<div class="form-group">
|
|
||||||
{{ form.submit(class="btn btn-outline-info") }}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
<div class="container-fluid pt-2">
|
|
||||||
<h3> <a href="#"> Existing Competences</a> </h3>
|
|
||||||
<table class="{{ theme.tableClass }}">
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th scope="col">Name</th>
|
|
||||||
<th scope="col">Description</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
{% for item in competences %}
|
|
||||||
<tr>
|
|
||||||
<th scope="row">{{ item.name }}</th>
|
|
||||||
<td>{{ item.description}}</td>
|
|
||||||
</tr>
|
|
||||||
{% endfor %}
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
{% endblock content %}
|
|
@ -1,86 +0,0 @@
|
|||||||
{% extends "layout.html" %}
|
|
||||||
{% block content %}
|
|
||||||
<div class="{{ theme.userInputDivClass }}" style="{{ theme.userInputFormColor }}">
|
|
||||||
<form method="POST" action="">
|
|
||||||
{{ form.hidden_tag() }}
|
|
||||||
<fieldset class="form-group"></fieldset>
|
|
||||||
<legend class="border-bottom mb-4">Register Person Role</legend>
|
|
||||||
|
|
||||||
<!-- name of the company-->
|
|
||||||
<div class="form-group">
|
|
||||||
{{ form.name.label(class="form-control-label") }}
|
|
||||||
{% if form.name.errors %}
|
|
||||||
{{ form.name(class="form-control form-control-lg is-invalid") }}
|
|
||||||
<div class="invalid-feedback">
|
|
||||||
{% for error in form.name.errors %}
|
|
||||||
<span>{{ error }}</span>
|
|
||||||
{% endfor %}
|
|
||||||
</div>
|
|
||||||
{% else %}
|
|
||||||
{{ form.name(class="form-control form-control-lg") }}
|
|
||||||
{% endif %}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- description of the company-->
|
|
||||||
<div class="form-group">
|
|
||||||
{{ form.description.label(class="form-control-label") }}
|
|
||||||
{% if form.description.errors %}
|
|
||||||
{{ form.description(class="form-control form-control-lg is-invalid") }}
|
|
||||||
<div class="invalid-feedback">
|
|
||||||
{% for error in form.description.errors %}
|
|
||||||
<span>{{ error }}</span>
|
|
||||||
{% endfor %}
|
|
||||||
</div>
|
|
||||||
{% else %}
|
|
||||||
{{ form.description(class="form-control form-control-lg") }}
|
|
||||||
{% endif %}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Submit Button -->
|
|
||||||
<div class="form-group">
|
|
||||||
{{ form.submit(class="btn btn-outline-info") }}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="container-fluid pt-2">
|
|
||||||
<div class="container-fluid pt-2">
|
|
||||||
<h3> <a href="#"> Existing Roles</a> </h3>
|
|
||||||
<table class="{{ theme.tableClass }}">
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th scope="col">Name</th>
|
|
||||||
<th scope="col">Description</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
{% for item in roles %}
|
|
||||||
<tr>
|
|
||||||
<th scope="row">{{ item.name }}</th>
|
|
||||||
<td>{{ item.description}}</td>
|
|
||||||
</tr>
|
|
||||||
{% endfor %}
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
<h3> <a href="#"> Existing Roles</a> </h3>
|
|
||||||
<table class="{{ theme.tableClass }}">
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th scope="col">Name</th>
|
|
||||||
<th scope="col">Description</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
{% for item in roles %}
|
|
||||||
<tr>
|
|
||||||
<th scope="row">{{ item.name }}</th>
|
|
||||||
<td>{{ item.description}}</td>
|
|
||||||
</tr>
|
|
||||||
{% endfor %}
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{% endblock content %}
|
|
Loading…
Reference in new issue