diff --git a/app/commands/commands.py b/app/commands/commands.py index 67228dd..a305aa1 100644 --- a/app/commands/commands.py +++ b/app/commands/commands.py @@ -11,7 +11,7 @@ from sqlalchemy.exc import IntegrityError from sqlalchemy.sql import func from app.models import db, Agent, Service, Project, Capacity, Period, Charge, AgentStatus, Company, AgentBap, \ - AgentGrade, Category, Label, ProjectLabel, CategoryLabel, AgentHistory, AgentResponsability + AgentGrade, Category, Label, ProjectLabel, CategoryLabel, AgentHistory, AgentResponsability, AgentSkill # TODO: rename to methods and add get_roles() from app.auth.models import User, _nameToRole, _roleToName @@ -38,6 +38,21 @@ def feed_statical(): db.session.add(n_ar) db.session.commit() + skills = ["AIT", "AIT Optique", "Assistant Prévention & Sécurité", "Assistant Prévention & Sécurité", + "Assistant Prévention et Sécurité", "Assurance produit", "Automatismes", "C", "C++", "chef de service", + "Configuration FPGA", "cryogénie", "CSS", "détection fuite Hélium", "Electronique", + "Electronique AIT/AIV", "essais en environnement", "essais vide-thermique", "Excel", + "fabrication mécanique", "FPGA", "Gestion de projet", "graphisme", "Haskell", "HTML", "IDL", + "instrumentation spatiale", "Java", "Javascript", "LabView", "Latex", "logiciels embarqués", + "Machine Learning", "mécanique BE", "optique instrumentale", "optronique", "photographie", "Photoshop", + "PHP", "Powerpoint", "Pro du café", "processeurs LEON", "Python", "Qualité système", "Ruby", + "Ruby on Rails", "Scrum", "SpaceWire", "temps-réel", "Vide", "Word"] + + for s in skills: + n_as = AgentSkill(name=s) + db.session.add(n_as) + db.session.commit() + @bp.cli.command('feed_default') def feed_default(): diff --git a/app/main/routes.py b/app/main/routes.py index 1c0837e..56c0812 100644 --- a/app/main/routes.py +++ b/app/main/routes.py @@ -7,7 +7,7 @@ from flask_login import login_required, current_user from . import bp from app.models import Agent, Project, Service, Capacity, Period, db, Company, AgentGrade, AgentStatus, AgentBap, \ - Charge, Category, Label, AgentResponsability + Charge, Category, Label, AgentResponsability, AgentSkill from app import db_mgr from app.auth.routes import role_required @@ -93,6 +93,17 @@ def responsabilities(): responsabilities=all_resp) +@bp.route('/skills') +@login_required +def skills(): + # get skills list + all_skills = AgentSkill.query.order_by(AgentSkill.name).all() + num_skills = len(all_skills) + # pass to template + return render_template('skills.html', subtitle="Liste des fonctions ({})".format(num_skills), + skills=all_skills) + + @bp.route('/capacities') @login_required def capacities(): diff --git a/app/main/templates/skills.html b/app/main/templates/skills.html new file mode 100644 index 0000000..28a6f05 --- /dev/null +++ b/app/main/templates/skills.html @@ -0,0 +1,21 @@ +{% extends "base_page.html" %} +{% block content %} + + + + + + + + + + + + {% for s in skills %} + + + + {% endfor %} + +
Compétences
{{ s.name }}
+{% endblock %} diff --git a/app/models.py b/app/models.py index 9e0bdb2..787ac99 100644 --- a/app/models.py +++ b/app/models.py @@ -221,6 +221,12 @@ class AgentHistory(db.Model): # Agents # +class AgentSkill(db.Model): + id = db.Column(db.Integer, primary_key=True) + name = db.Column(db.String(100), unique=True) + abbr = db.Column(db.String(50), unique=True) + + class AgentResponsability(db.Model): id = db.Column(db.Integer, primary_key=True) name = db.Column(db.String(100), unique=True) diff --git a/app/templates/base_page.html b/app/templates/base_page.html index 9627390..92e077e 100644 --- a/app/templates/base_page.html +++ b/app/templates/base_page.html @@ -58,7 +58,8 @@ href="{{ url_for('main.capacities') }}">Liste des fonctions - + -- libgit2 0.21.2