--- a/src/catedit/templates/catrecap.html Fri Jan 02 16:46:56 2015 +0100
+++ b/src/catedit/templates/catrecap.html Sat Jan 03 00:15:51 2015 +0100
@@ -47,12 +47,21 @@
{% if not session.get("user_logged", None)%}Non authentifié - <a href="{{ url_for('github_login') }}" class="navbar-link">S'authentifier</a>
{% else %} Authentifié: {{ session["user_login"] }} - <a href="{{ url_for('logout') }}" class="navbar-link">Quitter</a>{% endif %}
</div>
+ {% if session["user_logged"] %}
+ <form class="navbar-form navbar-right">
+ <select class="form-control select-repo" name="navrepo" onchange="window.location.href=this.form.navrepo.options[this.form.navrepo.selectedIndex].value">
+ {% for repo in config["REPOSITORY_LIST"] %}
+ <option value="{{url_for('cat_recap', repository=repo)}}" {% if repo==current_repository %}selected="selected"{% endif %}>{{repo}}</option>
+ {% endfor %}
+ </select>
+ </form>
+ {% endif %}
</div>
</div>
</div>
<div class="container">
- <h2> <b>CatEdit</b> - <small>{{config.get("REPOSITORY_NAME", "Titre-Ensemble-Catégories")}} </small></h2>
- <h3> Créer une catégorie : <a href="{{url_for('cat_editor')}}" title="Créer catégorie" class="btn btn-default {% if readonly %}disabled{% endif %}"><span class="glyphicon glyphicon-plus"/></a></h3>
+ <h2> <b>CatEdit</b> - <small>{{current_repository}}</small></h2>
+ <h3> Créer une catégorie : <a href="{{url_for('cat_editor', repository=current_repository)}}" title="Créer catégorie" class="btn btn-default {% if readonly %}disabled{% endif %}"><span class="glyphicon glyphicon-plus"/></a></h3>
{% if session["user_logged"] and not session["user_can_edit"] %}
<div class="alert alert-warning" role="alert">
<span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span>
@@ -80,7 +89,7 @@
{% else %}
{% if cat_list|length == 0 %}
<tr>
- <td class="col-md-12" colspan="2">Aucune catégorie n'a été créée pour l'instant. {% if not readonly %}<a href="{{ url_for('cat_editor') }}">Créer une catégorie</a>{% endif %}</td>
+ <td class="col-md-12" colspan="2">Aucune catégorie n'a été créée pour l'instant. {% if not readonly %}<a href="{{ url_for('cat_editor', repository=current_repository) }}">Créer une catégorie</a>{% endif %}</td>
</tr>
{% else %}
{% for cat in cat_list %}
@@ -101,14 +110,14 @@
</td>
{% if (cat.state != "deleted") %}
<td class="col-md-1 text-center">
- <a href="{{ url_for('cat_editor', cat_id=cat.cat_id)}}" title="Editer catégorie" class="btn btn-default">
+ <a href="{{ url_for('cat_editor', cat_id=cat.cat_id, repository=current_repository)}}" title="Editer catégorie" class="btn btn-default">
<span class="glyphicon glyphicon glyphicon-pencil"/>
</a>
</td>
{% endif %}
{% if (cat.state == "untouched") %}
<td class="col-md-1 text-center">
- <form method="POST" action="{{url_for('cat_recap', deleted_cat_id=cat.cat_id)}}" class="form-inline">
+ <form method="POST" action="{{url_for('cat_recap', deleted_cat_id=cat.cat_id, repository=current_repository)}}" class="form-inline">
<a title="Supprimer catégorie">
<button class="btn btn-default" type="submit"><span class="glyphicon glyphicon-trash"/></button>
</a>
@@ -116,7 +125,7 @@
</td>
{% elif (cat.state == "created" or cat.state == "modified") %}
<td class="col-md-1 text-center">
- <form method="POST" action="{{url_for('cat_recap', deleted_modifs_id=cat.cat_id)}}" class="form-inline">
+ <form method="POST" action="{{url_for('cat_recap', deleted_modifs_id=cat.cat_id, repository=current_repository)}}" class="form-inline">
<a title="Supprimer changements">
<button class="btn btn-default"><span class="glyphicon glyphicon-remove-sign"/></button>
</a>
@@ -124,7 +133,7 @@
</td>
{% else %}
<td colspan="2">
- <form method="POST" action="{{url_for('cat_recap', deleted_cat_id=cat.cat_id)}}" class="form-inline">
+ <form method="POST" action="{{url_for('cat_recap', deleted_cat_id=cat.cat_id, repository=current_repository)}}" class="form-inline">
<a title="Restaurer catégorie">
<button class="btn btn-default" type="submit">Restaurer</button>
</a>
@@ -172,7 +181,7 @@
</tbody>
</table>
{% if session.get("user_logged") %}
- <form method="POST" action="{{url_for('cat_recap')}}" class="form-inline">
+ <form method="POST" action="{{url_for('cat_recap', repository=current_repository)}}" class="form-inline">
<h4> Annuler tous mes changements actuels :
<a title="Supprimer changements">
<button type="submit" class="btn btn-default" {% if readonly %}disabled{% endif %}>
@@ -181,7 +190,7 @@
</a>
</h4>
</form>
- <h4> Soumettre mes changements actuels : <a href="{{ url_for('cat_modifs')}}" title="Soumettre changements" class="btn btn-default" {% if readonly %}disabled{% endif %}><span class="glyphicon glyphicon-share"/></a>
+ <h4> Soumettre mes changements actuels : <a href="{{ url_for('cat_modifs', repository=current_repository)}}" title="Soumettre changements" class="btn btn-default" {% if readonly %}disabled{% endif %}><span class="glyphicon glyphicon-share"/></a>
</h4>
{% endif %}
<h3> Consulter l'historique des modifications : <a href="https://github.com/{{config['REPOSITORY_OWNER']}}/{{config['REPOSITORY_NAME']}}/commits/master" title="Aller à l'historique des modifications sur Github" class="btn btn-default"><span class="glyphicon glyphicon-list"/></a></h3>