29 </div> |
29 </div> |
30 <div class="collapse navbar-collapse"> |
30 <div class="collapse navbar-collapse"> |
31 <ul class="nav navbar-nav"> |
31 <ul class="nav navbar-nav"> |
32 <li><a href="{{ url_for('cat_index') }}">Page d'accueil</a></li> |
32 <li><a href="{{ url_for('cat_index') }}">Page d'accueil</a></li> |
33 {% if session.get("user_logged", None) %} |
33 {% if session.get("user_logged", None) %} |
34 <li><a href="{{ url_for('cat_recap') }}">Atelier</a></li> |
34 <li><a href="{{ url_for('cat_recap', repository=current_repository) }}">Atelier</a></li> |
35 {% endif %} |
35 {% endif %} |
|
36 <li class="active"><a>Editeur</a></li> |
36 </ul> |
37 </ul> |
37 <div class="navbar-text navbar-right"> |
38 <div class="navbar-text navbar-right"> |
38 {% if not session.get("user_logged", None)%} Non authentifié - <a href="{{ url_for('github_login') }}" class="navbar-link">S'authentifier</a> |
39 {% if not session.get("user_logged", None)%} Non authentifié - <a href="{{ url_for('github_login') }}" class="navbar-link">S'authentifier</a> |
39 {% else %} Authentifié: {{ session["user_login"] }} - <a href="{{ url_for('logout') }}" class="navbar-link">Quitter</a>{% endif %} |
40 {% else %} Authentifié: {{ session["user_login"] }} - <a href="{{ url_for('logout') }}" class="navbar-link">Quitter</a>{% endif %} |
40 </div> |
41 </div> |
|
42 {% if session["user_logged"] %} |
|
43 <form class="navbar-form navbar-right"> |
|
44 <select class="form-control select-repo" name="navrepo" onchange="window.location.href=this.form.navrepo.options[this.form.navrepo.selectedIndex].value"> |
|
45 {% for repo in config["REPOSITORY_LIST"] %} |
|
46 <option value="{{url_for('cat_recap', repository=repo)}}" {% if repo==current_repository %}selected="selected"{% endif %}>{{repo}}</option> |
|
47 {% endfor %} |
|
48 </select> |
|
49 </form> |
|
50 {% endif %} |
41 </div> |
51 </div> |
42 </div> |
52 </div> |
43 </div> |
53 </div> |
44 <div class="container"> |
54 <div class="container"> |
|
55 <h2> <b>CatEdit</b> - <small>{{current_repository}}</small></h2> |
45 {% if session["user_logged"] and not session["user_can_edit"] %} |
56 {% if session["user_logged"] and not session["user_can_edit"] %} |
46 <div class="alert alert-warning" role="alert"> |
57 <div class="alert alert-warning" role="alert"> |
47 <span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span> |
58 <span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span> |
48 <span class="sr-only">Attention:</span> |
59 <span class="sr-only">Attention:</span> |
49 Vous n'avez pas accès en écriture au repository contenant les catégories - Vous ne pourrez pas les modifier. |
60 Vous n'avez pas accès en écriture au repository contenant les catégories - Vous ne pourrez pas les modifier. |
62 Erreur: |
73 Erreur: |
63 </strong> |
74 </strong> |
64 Vous n'avez pas rempli certains champs obligatoires. |
75 Vous n'avez pas rempli certains champs obligatoires. |
65 </div> |
76 </div> |
66 {% endif %} |
77 {% endif %} |
67 <h2>{% if cat_id: %} Edition : <small>Catégorie existante</small>{% else %}Création : <small>Nouvelle catégorie</small>{% endif %}</h2> |
78 <h3>{% if cat_id: %} Edition : <small>Catégorie existante</small>{% else %}Création : <small>Nouvelle catégorie</small>{% endif %}</h3> |
68 {% if readonly %} <fieldset disabled> {% endif %} |
79 {% if readonly %} <fieldset disabled> {% endif %} |
69 <form method="POST" action="{% if cat_id %}{{ url_for('cat_editor', cat_id=cat_id) }}{% else %}{{ url_for('cat_editor') }}{% endif %}" id="cat_form" role="form"> |
80 <form method="POST" action="{% if cat_id %}{{ url_for('cat_editor', cat_id=cat_id, repository=current_repository) }}{% else %}{{ url_for('cat_editor', repository=current_repository) }}{% endif %}" id="cat_form" role="form"> |
70 {{ form.hidden_tag() }} |
81 {{ form.hidden_tag() }} |
71 {% if form.label.errors %} |
82 {% if form.label.errors %} |
72 {% set label_placeholder="Champ obligatoire" %} |
83 {% set label_placeholder="Champ obligatoire" %} |
73 {% endif %} |
84 {% endif %} |
74 {% if form.description.errors %} |
85 {% if form.description.errors %} |
149 </table> |
160 </table> |
150 </div> |
161 </div> |
151 </div> |
162 </div> |
152 </div><br> |
163 </div><br> |
153 <br><input type="submit" value="Sauvegarder" class="btn btn-default"> |
164 <br><input type="submit" value="Sauvegarder" class="btn btn-default"> |
154 <a href="{{ url_for('cat_recap')}}"class="btn btn-default">Annuler</a> |
165 <a href="{{ url_for('cat_recap', repository=current_repository)}}"class="btn btn-default">Annuler</a> |
155 </form> |
166 </form> |
156 {% if readonly %} </fieldset> {% endif %} |
167 {% if readonly %} </fieldset> {% endif %} |
157 <script src="{{ url_for('static', filename='js/property_functions.js') }}" language="Javascript" type="text/javascript"></script> |
168 <script src="{{ url_for('static', filename='js/property_functions.js') }}" language="Javascript" type="text/javascript"></script> |
158 {% if cat_id %} |
169 {% if cat_id %} |
159 <script type=text/javascript> |
170 <script type=text/javascript> |