Commit 9b93cc2d23437d5f52c3912dadd3505ac424a9e5

Authored by hitier
1 parent ac2fa9fd

Add new create agent menu

app/main/templates/agent_edit.html
1 1 {% extends "base_page.html" %}
  2 +
2 3 {# Set the title that will be used in base_page #}
3 4 {% if agent['agent_id'] != '' %}
4 5 {% set subtitle = "Modifier l'agent "+ agent['fullname'] +":" %}
5 6 {% else %}
6 7 {% set subtitle = "Ajouter un nouvel agent:" %}
7 8 {% endif %}
  9 +
8 10 {% block content %}
  11 +
  12 + <!-- Invisible span to define wich ul and a in the navbar are actived -->
  13 + <span id="nav_actived" style="display: none">cds,agent/create</span>
  14 +
9 15 <form action="{{ url_for('main.agent_edit') }}" method="post">
10 16 {% if agent %}
11 17 <input class="form-control" id="agent_id" name="agent_id" type="hidden" value="{{ agent['agent_id'] }}">
... ...
app/templates/base_page.html
... ... @@ -2,28 +2,30 @@
2 2 <html lang="fr">
3 3 <head>
4 4 {% include 'heads.html' %}
5   - <link href="{{ url_for('static', filename='css/style.css', version=config.VERSION) }}" rel="stylesheet" type="text/css"/>
  5 + <link href="{{ url_for('static', filename='css/style.css', version=config.VERSION) }}" rel="stylesheet"
  6 + type="text/css"/>
6 7 {% block more_heads %}
7 8 {% endblock %}
8 9 </head>
9 10 <body>
10 11 <nav class="navbar navbar-dark sticky-top bg-dark navbar-expand-lg p-1">
11   - <a id="accueil" class="navbar-brand col-sm-3 col-md-2 " href="{{url_for('main.index')}}">
12   - <img class="m-0 mr-1 {{config.PDC_SITE_CLASS}}" src="{{ url_for('static', filename='img/pdc-ico.png', version=config.VERSION) }}" height="30" width="30"/>
  12 + <a id="accueil" class="navbar-brand col-sm-3 col-md-2 " href="{{ url_for('main.index') }}">
  13 + <img class="m-0 mr-1 {{ config.PDC_SITE_CLASS }}"
  14 + src="{{ url_for('static', filename='img/pdc-ico.png', version=config.VERSION) }}" height="30" width="30"/>
13 15  
14   - {{config.PDC_APP_NAME}} - {{config.PDC_SITE_NAME}}</a>
  16 + {{ config.PDC_APP_NAME }} - {{ config.PDC_SITE_NAME }}</a>
15 17 <ul class="navbar-nav flex-row ml-auto">
16 18 {% if not current_user.is_anonymous %}
17   - <li class="nav-item">
18   - <span class="navbar-brand">{{current_user.name}}</span>
19   - </li>
20   - <li class="nav-item text-nowrap">
21   - <a class="nav-link link_connect" href="{{ url_for('auth.logout') }}">Déconnexion</a>
22   - </li>
  19 + <li class="nav-item">
  20 + <span class="navbar-brand">{{ current_user.name }}</span>
  21 + </li>
  22 + <li class="nav-item text-nowrap">
  23 + <a class="nav-link link_connect" href="{{ url_for('auth.logout') }}">Déconnexion</a>
  24 + </li>
23 25 {% else %}
24   - <li class="nav-item text-nowrap">
25   - <a class="nav-link link_connect" href="{{ url_for('auth.login') }}">Connexion</a>
26   - </li>
  26 + <li class="nav-item text-nowrap">
  27 + <a class="nav-link link_connect" href="{{ url_for('auth.login') }}">Connexion</a>
  28 + </li>
27 29 {% endif %}
28 30 </ul>
29 31 </nav>
... ... @@ -31,22 +33,27 @@
31 33 <div class="container-fluid">
32 34 <div class="row">
33 35 <nav class="col-md-half col-lg-2 col-md-2 navbar-light bg-light navbar-expand-md sidebar mt-5">
34   - <button id="test" class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
35   - <span class="navbar-toggler-icon"></span>
36   - </button>
37   - <div class="sidebar-sticky collapse navbar-collapse" id="navbarSupportedContent">
  36 + <button id="test" class="navbar-toggler" type="button" data-toggle="collapse"
  37 + data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false"
  38 + aria-label="Toggle navigation">
  39 + <span class="navbar-toggler-icon"></span>
  40 + </button>
  41 + <div class="sidebar-sticky collapse navbar-collapse" id="navbarSupportedContent">
38 42 <ul class="nav flex-column" id="v_menu">
39 43 <li class="nav-item">
40   - <a aria-expanded="false" id="agents" class="main-nav nav-link" data-target="#agent" data-toggle="collapse" href="#">
  44 + <a aria-expanded="false" id="agents" class="main-nav nav-link" data-target="#agent" data-toggle="collapse"
  45 + href="#">
41 46 <span data-feather="user"></span>
42 47 Agent
43 48 </a>
44 49 <ul aria-expanded="false" class="collapse" class="nav" data-parent="#v_menu" id="agent">
45   - <li class="nav-item"><a class="sub_link nav-link " href="{{url_for('main.agents')}}">Liste des agents</a>
  50 + <li class="nav-item"><a class="sub_link nav-link " href="{{ url_for('main.agents') }}">Liste des
  51 + agents</a>
46 52 </li>
47 53 <li class="nav-item"><a class="sub_link nav-link disabled" href="#">Statistiques</a></li>
48 54 <li class="nav-item"><a class="sub_link nav-link disabled" href="#">Liste des responsabilités</a></li>
49   - <li class="nav-item"><a class="sub_link nav-link " href="{{url_for('main.capacities')}}">Liste des fonctions</a>
  55 + <li class="nav-item"><a class="sub_link nav-link " href="{{ url_for('main.capacities') }}">Liste des
  56 + fonctions</a>
50 57 </li>
51 58 <li class="nav-item"><a class="sub_link nav-link disabled" href="#">Liste des compétences</a></li>
52 59 <li class="nav-item"><a class="sub_link nav-link disabled" href="#">Liste des pôles</a></li>
... ... @@ -59,10 +66,12 @@
59 66 Projet
60 67 </a>
61 68 <ul aria-expanded="false" class="collapse" data-parent="#v_menu" id="projet">
62   - <li class="nav-item"><a class="sub_link nav-link " href="{{url_for('main.projects')}}">Liste des projets</a></li>
  69 + <li class="nav-item"><a class="sub_link nav-link " href="{{ url_for('main.projects') }}">Liste des
  70 + projets</a></li>
63 71 <li class="nav-item"><a class="sub_link nav-link disabled" href="#">Statistiques</a></li>
64 72 <li class="nav-item"><a class="sub_link nav-link disabled" href="#">Listes des domaines</a></li>
65   - <li class="nav-item"><a class="sub_link nav-link disabled" href="#">Listes des statuts de projets</a></li>
  73 + <li class="nav-item"><a class="sub_link nav-link disabled" href="#">Listes des statuts de projets</a>
  74 + </li>
66 75 </ul>
67 76 </li>
68 77 <li class="nav-item">
... ... @@ -71,7 +80,8 @@
71 80 Service
72 81 </a>
73 82 <ul aria-expanded="false" class="collapse" data-parent="#v_menu" id="service">
74   - <li class="nav-item"><a class="sub_link nav-link " href="{{url_for('main.services')}}">Liste des services</a>
  83 + <li class="nav-item"><a class="sub_link nav-link " href="{{ url_for('main.services') }}">Liste des
  84 + services</a>
75 85 </li>
76 86 <li class="nav-item"><a class="sub_link nav-link disabled" href="#">Statistiques</a></li>
77 87 </ul>
... ... @@ -82,9 +92,13 @@
82 92 Chef de service
83 93 </a>
84 94 <ul aria-expanded="false" class="collapse" data-parent="#v_menu" id="cds">
85   - <li class="nav-item"><a class="sub_link nav-link disabled" href="#">Renseigner le statut d'un agent pour un
  95 + <li class="nav-item"><a class="sub_link nav-link " href="{{ url_for('main.agent_edit') }}">Ajouter un
  96 + Agent</a></li>
  97 + <li class="nav-item"><a class="sub_link nav-link disabled" href="#">Renseigner le statut d'un agent pour
  98 + un
86 99 semestre</a></li>
87   - <li class="nav-item"><a class="sub_link nav-link " href="{{url_for('main.charge_add')}}">Affecter un agent à un
  100 + <li class="nav-item"><a class="sub_link nav-link " href="{{ url_for('main.charge_add') }}">Affecter un
  101 + agent à un
88 102 projet/service</a></li>
89 103 <li class="nav-item"><a class="sub_link nav-link disabled" href="#">Création agent virtuel</a></li>
90 104 <li class="nav-item"><a class="sub_link nav-link disabled" href="#">Charge totale des agents</a></li>
... ... @@ -105,9 +119,12 @@
105 119 <li class="nav-item"><a class="sub_link nav-link disabled" href="#">Nouvelle fonction</a></li>
106 120 <li class="nav-item"><a class="sub_link nav-link disabled" href="#">Nouveau domaine</a></li>
107 121 <li class="nav-item"><a class="sub_link nav-link disabled" href="#">Nouvelle responsabilité</a></li>
108   - <li class="nav-item"><a class="sub_link nav-link disabled" href="#">Affecter un responsable de projet</a></li>
109   - <li class="nav-item"><a class="sub_link nav-link disabled" href="#">Affecter un responsable de service</a></li>
110   - <li class="nav-item"><a class="sub_link nav-link " href="{{url_for('main.periods')}}">Liste des périodes</a></li>
  122 + <li class="nav-item"><a class="sub_link nav-link disabled" href="#">Affecter un responsable de
  123 + projet</a></li>
  124 + <li class="nav-item"><a class="sub_link nav-link disabled" href="#">Affecter un responsable de
  125 + service</a></li>
  126 + <li class="nav-item"><a class="sub_link nav-link " href="{{ url_for('main.periods') }}">Liste des
  127 + périodes</a></li>
111 128 <li class="nav-item"><a class="sub_link nav-link disabled" href="#">Nouveau semestre</a></li>
112 129  
113 130 </ul>
... ... @@ -120,7 +137,7 @@
120 137 </nav>
121 138  
122 139 <main id="main" class="ml-md-auto ml-sm-5 ml-xs-8 col-xs-4 col-sm-11 col-md-9 col-lg-10 pt-3 px-4" role="main">
123   - <h2 class="sub-header">{{subtitle}}</h2>
  140 + <h2 class="sub-header">{{ subtitle }}</h2>
124 141 {% include 'flash-messages.html' %}
125 142 {% block content %}
126 143 {% endblock %}
... ... @@ -134,10 +151,11 @@
134 151 <!-- Icons -->
135 152 <script src="https://unpkg.com/feather-icons/dist/feather.min.js"></script>
136 153 <script>
137   - feather.replace()
  154 + feather.replace()
138 155 </script>
139 156  
140   - <script type="text/javascript" src="{{ url_for('static', filename='js/navbar.js', version=config.VERSION) }}"></script>
  157 + <script type="text/javascript"
  158 + src="{{ url_for('static', filename='js/navbar.js', version=config.VERSION) }}"></script>
141 159  
142 160 {% block more_scripts %}
143 161 {% endblock %}
... ...