diff --git a/app/main/routes.py b/app/main/routes.py index 18281e5..93b7013 100644 --- a/app/main/routes.py +++ b/app/main/routes.py @@ -87,7 +87,17 @@ def periods(): @bp.route('/charge/add') @role_required('service') def charge_add(): - return render_template('charge.html', subtitle="Affecter un agent") + this_agents = Agent.query.order_by(Agent.firstname).all() + this_projects = Project.query.order_by(Project.name).all() + this_services = Service.query.order_by(Service.name).all() + this_periods = Period.query.order_by(Period.id).all() + this_capacities = Capacity.query.order_by(Capacity.name).all() + return render_template('charge.html', subtitle="Affecter un agent", + projects=this_projects, + services=this_services, + periods=this_periods, + capacities=this_capacities, + agents=this_agents) @bp.route('/project/') diff --git a/app/main/templates/charge.html b/app/main/templates/charge.html index c921bb0..323b560 100644 --- a/app/main/templates/charge.html +++ b/app/main/templates/charge.html @@ -1,1099 +1,60 @@ {% extends "base_page.html" %} {% block content %} - - - -
- - - - - - + + +
- -
- + + {% for a in agents %} + + {% endfor %} -
-
- -
- -
-
- -
- -
- -
+ +
-
- -
- -
+ +
-
- -
- -
+ +
-
- -
-
- -
%
-
-
+ +
-
-
- -
+ +
- -

* Ce champ est obligatoire.

- + +
{% endblock %} diff --git a/app/models.py b/app/models.py index eb26dbf..2231dbe 100644 --- a/app/models.py +++ b/app/models.py @@ -90,6 +90,10 @@ class Agent(db.Model): def fullname(self): return f"{self.secondname} {self.firstname}" + @property + def namefull(self): + return f"{self.firstname} {self.secondname}" + def to_struct(self): """ Export the orm object to a structure easily used in jinja -- libgit2 0.21.2