From: Guillaume Subiron Date: Tue, 29 May 2012 14:32:53 +0000 (+0200) Subject: Votes list X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/%40%20%27icone_supprimer_signature%27%20=%3E%20%27Delete%20this%20signature%27%2C%20%27icone_valider_signature%27%20=%3E%20%27Validate%20this%20signature%27%2C%20%27image_administrer_rubrique%27%20=%3E%20%27You%20can%20manage%20this%20section%27%2C-%27impossible_modifier_login_auteur%27%20=%3E%20%27Login%20cannot%20be%20changed.%27%2C-%27impossible_modifier_pass_auteur%27%20=%3E%20%27Password%20cannot%20be%20changed.%27%2C%20%27info_1_article%27%20=%3E%20%271%20article%27%2C-%27info_1_article_syndique%27%20=%3E%20%271%20syndicated%20article%27%2C%20%27info_1_auteur%27%20=%3E%20%271%20author%27%2C%20%27info_1_message%27%20=%3E%20%271%20message%27%2C%20%27info_1_mot_cle%27%20=%3E%20%271%20keyword%27%2C%20%27info_1_rubrique%27%20=%3E%20%271%20section%27%2C-%27info_1_site%27%20=%3E%20%271%20site%27%2C%20%27info_1_visiteur%27%20=%3E%20%271%20visitor%27%2C%20%27info_activer_cookie%27%20=%3E%20%27You%20can%20activate%20an%20%3Cb%3Eadministration%20cookie%3C/b%3E%2C%20which%20allows%20you%20%20to%20switch%20easily%20between%20the%20public%20site%20and%20the%20private%20area.%27%2C%20%27info_activer_menu_developpement%27%20=%3E%20%27Show%20the%20Development%20menu%27%2C%20%27info_admin_etre_webmestre%27%20=%3E%20%27Give%20me%20web%20administrator%20rights%27%2C-%27info_admin_gere_rubriques%27%20=%3E%20%27This%20administrator%20manages%20the%20following%20sections:%27%2C-%27info_admin_gere_toutes_rubriques%27%20=%3E%20%27This%20administrator%20manages%20%3Cb%3Eall%20the%20sections%3C/b%3E.%27%2C-%27info_admin_gere_toutes_rubriques_2%27%20=%3E%20%27I%20manage%20%3Cb%3Eall%20the%20sections%3C/b%3E%27%2C%20%27info_admin_je_suis_webmestre%27%20=%3E%20%27I%20am%20a%20%3Cb%3Ewebmaster%3C/b%3E%27%2C%20%27info_admin_statuer_webmestre%27%20=%3E%20%27Give%20webmaster%20rights%20to%20this%20administrator%20%27%2C%20%27info_admin_webmestre%27%20=%3E%20%27This%20administrator%20is%20%3Cb%3Ewebmaster%3C/%7B%7B%20url_for%28%27show_vote%27%2C%20idvote=vote.id%29%20%7D%7D?a=commitdiff_plain;h=0fb98decd67ec695937480b4d5448adbcd508565;p=cavote.git Votes list --- diff --git a/main.py b/main.py index 8c050b8..8a99adb 100755 --- a/main.py +++ b/main.py @@ -29,7 +29,7 @@ def teardown_request(exception): @app.route('/') def home(): - return render_template('index.html') + return render_template('index.html', active_button="home") def query_db(query, args=(), one=False): cur = g.db.execute(query, args) @@ -206,15 +206,17 @@ def del_role(idrole): @app.route('/votes/') def show_votes(votes): today = date.today() + active_button = votes + basequery = 'select *, roles.name as rolename from votes join roles on roles.id=votes.id_role' if votes == 'all': - votes = query_db('select * from votes order by id desc') + votes = query_db(basequery + ' order by id desc') elif votes == 'archive': - votes = query_db('select * from votes where date_end < (?) order by id desc', [today]) + votes = query_db(basequery + ' where date_end < (?) order by id desc', [today]) elif votes == 'current': - votes = query_db('select * from votes where date_end >= (?) order by id desc', [today]) + votes = query_db(basequery + ' where date_end >= (?) order by id desc', [today]) else: abort(404) - return render_template('show_votes.html', votes=votes) + return render_template('show_votes.html', votes=votes, active_button=active_button) #------ # Vote diff --git a/templates/layout.html b/templates/layout.html index 29f0045..66fd8e5 100644 --- a/templates/layout.html +++ b/templates/layout.html @@ -19,9 +19,9 @@
- Accueil - Votes en cours - Archives + Accueil + Votes en cours + Archives {% if session.user and session.user.is_admin %} Admin
-

Outil de vote du CA FFDN

+

Outil de vote du CA FFDN {% block subtitle %}{% endblock %}

{% with messages = get_flashed_messages(with_categories="true") %} {% if messages %} {% for category, message in messages %} @@ -62,7 +62,9 @@ {% endif %} {% endwith %} +
{% block body %}{% endblock %} +
diff --git a/templates/show_user.html b/templates/show_user.html index 9ed3f60..3ce7513 100644 --- a/templates/show_user.html +++ b/templates/show_user.html @@ -1,16 +1,16 @@ {% extends "layout.html" %} {% block body %} -

{{ session.username }}

+

{{ session.user.name }}

Email : -
{{ session.email }} +
{{ session.user.email }}
Association : -
{{ session.organization }} +
{{ session.user.organization }}
Groupes :
à venir
- Modifier + Modifier
{% endblock %} diff --git a/templates/show_votes.html b/templates/show_votes.html index 5d7442e..90fd1f8 100644 --- a/templates/show_votes.html +++ b/templates/show_votes.html @@ -1,26 +1,28 @@ {% extends "layout.html" %} +{% block subtitle %} +Liste des votes +{% endblock %} {% block body %} -

Liste des votes

{% for vote in votes %}
-
-

{{ vote.title }}

-
-
-
+
+
+

{{ vote.title }}

+
+
+
+
+

Deadline : {{ vote.date_end }}

-
-
-
-
-
-

Documents

+

Groupe : {{ vote.rolename }}

+

Categorie : {{ vote.category }}

+
+
+

Notes

+

+ {{ vote.description|safe }} +

-
-

Notes

- {{ vote.description|safe }} -
{% else %}
Il n'y a pas encore de votes. Désolé.
diff --git a/templates/user_settings.html b/templates/user_settings.html index 85da44c..a4d497a 100644 --- a/templates/user_settings.html +++ b/templates/user_settings.html @@ -3,25 +3,25 @@

{{ session.username }}

-
+
Mise à jour du profil utilisateur
Attention : À l'issue de ce formulaire, vous devrez vous reconnecter
- +
- +
- +