Passage des routes en français (#41)
This commit is contained in:
parent
11daef02a1
commit
19d09a71df
|
@ -12,83 +12,91 @@
|
|||
|
||||
# News
|
||||
|
||||
/news:
|
||||
/actus:
|
||||
name: Actualités
|
||||
prefix: news
|
||||
|
||||
/news/projects:
|
||||
/actus/projets:
|
||||
name: Actualités des projets
|
||||
prefix: projectnews
|
||||
descr: Nouveautés des projets de la communauté.
|
||||
|
||||
/news/calc:
|
||||
/actus/calc:
|
||||
name: Actualités des constructeurs de calculatrices
|
||||
prefix: calcnews
|
||||
descr: Nouveautés CASIO, nouveaux modèles de calculatrices, mises à jour du
|
||||
système ou nouveautés d'autres constructeurs.
|
||||
|
||||
/news/events:
|
||||
/actus/evenements:
|
||||
name: Événements organisés par Planète Casio
|
||||
prefix: eventnews
|
||||
descr: Tous les événements organisés par Planète Casio ou la communauté.
|
||||
|
||||
/news/other:
|
||||
/actus/autres:
|
||||
name: Autres nouveautés
|
||||
prefix: othernews
|
||||
descr: Actualités non catégorisées.
|
||||
|
||||
# Help
|
||||
|
||||
/help:
|
||||
/aide:
|
||||
name: Aide et questions
|
||||
prefix: help
|
||||
|
||||
/help/transfers:
|
||||
/aide/transferts:
|
||||
name: Questions sur les tranferts
|
||||
prefix: transferhelp
|
||||
descr: Questions sur le transfert de fichiers et l'installation de programmes
|
||||
sur la calculatrice.
|
||||
|
||||
/help/calc:
|
||||
/aide/calc:
|
||||
name: Question sur l'utilisation des calculatrices
|
||||
prefix: calchelp
|
||||
descr: Questions sur l'utilisation des applications de la calculatrice,
|
||||
paramètres, formats de fichiers...
|
||||
|
||||
/help/prog:
|
||||
/aide/prog:
|
||||
name: Questions de programmation
|
||||
prefix: proghelp
|
||||
descr: Questions sur le développement et le debuggage de programmes.
|
||||
|
||||
/help/other:
|
||||
/aide/autres:
|
||||
name: Autres questions
|
||||
prefix: otherhelp
|
||||
descr: Questions non catégorisées.
|
||||
|
||||
# Projects
|
||||
|
||||
/projects:
|
||||
/projets:
|
||||
name: Forum des projets
|
||||
prefix: projects
|
||||
|
||||
/projects/games:
|
||||
/projets/jeux:
|
||||
name: Projets de jeux
|
||||
prefix: gameprojects
|
||||
descr: Projets de jeux pour calculatrices, tous langages confondus et tous
|
||||
modèles de calculatrices confondus.
|
||||
|
||||
/projects/apps:
|
||||
/projets/applis:
|
||||
name: Projets d'applications, utilitaires, outils pour calculatrice
|
||||
prefix: appprojects
|
||||
descr: Projets d'applications (hors jeux) pour calculatrice, tous langages et
|
||||
modèles confondus.
|
||||
|
||||
/projects/tools:
|
||||
/projets/outils:
|
||||
name: Projets pour d'autres plateformes
|
||||
prefix: toolprojetcs
|
||||
descr: Tous les projets tournant sur ordinateur, téléphone, ou toute autre
|
||||
plateforme que la calculatrice.
|
||||
|
||||
# Community
|
||||
|
||||
/communaute:
|
||||
name: Vie communautaire
|
||||
prefix: community
|
||||
descr: Projets pour Planète Casio, remarques sur le fonctionnement du site et
|
||||
de sa communauté.
|
||||
|
||||
# Discussion
|
||||
|
||||
/discussion:
|
||||
|
|
|
@ -8,7 +8,7 @@ import app.utils.ldap as ldap
|
|||
from config import V5Config
|
||||
|
||||
|
||||
@app.route('/account', methods=['GET', 'POST'])
|
||||
@app.route('/compte', methods=['GET', 'POST'])
|
||||
@login_required
|
||||
def edit_account():
|
||||
form = UpdateAccountForm()
|
||||
|
@ -34,7 +34,7 @@ def edit_account():
|
|||
return render('account/account.html', form=form)
|
||||
|
||||
|
||||
@app.route('/account/delete', methods=['GET', 'POST'])
|
||||
@app.route('/compte/supprimer', methods=['GET', 'POST'])
|
||||
@login_required
|
||||
def delete_account():
|
||||
del_form = DeleteAccountForm()
|
||||
|
@ -51,7 +51,7 @@ def delete_account():
|
|||
return render('account/delete_account.html', del_form=del_form)
|
||||
|
||||
|
||||
@app.route('/register', methods=['GET', 'POST'])
|
||||
@app.route('/inscription', methods=['GET', 'POST'])
|
||||
def register():
|
||||
if current_user.is_authenticated:
|
||||
return redirect(url_for('index'))
|
||||
|
|
|
@ -9,7 +9,7 @@ from app.utils.render import render
|
|||
from config import V5Config
|
||||
|
||||
|
||||
@app.route('/login', methods=['GET', 'POST'])
|
||||
@app.route('/connexion', methods=['GET', 'POST'])
|
||||
def login():
|
||||
if current_user.is_authenticated:
|
||||
return redirect(url_for('index'))
|
||||
|
@ -58,7 +58,7 @@ def login():
|
|||
return render('account/login.html', form=form)
|
||||
|
||||
|
||||
@app.route('/logout')
|
||||
@app.route('/deconnexion')
|
||||
@login_required
|
||||
def logout():
|
||||
try:
|
||||
|
|
|
@ -12,8 +12,9 @@ def list_notifications():
|
|||
return render('account/notifications.html', notifications=notifications)
|
||||
|
||||
|
||||
@app.route('/notifications/delete/<id>', methods=['GET'])
|
||||
@app.route('/notifications/supprimer/<id>', methods=['GET'])
|
||||
@login_required
|
||||
# TODO: [SECURITY ISSUE] prevent CSRF
|
||||
def delete_notification(id=None):
|
||||
# Try to convert id to int
|
||||
try:
|
||||
|
|
|
@ -13,7 +13,7 @@ from app import app, db
|
|||
from config import V5Config
|
||||
|
||||
|
||||
@app.route('/admin/account/<user_id>/edit', methods=['GET', 'POST'])
|
||||
@app.route('/admin/compte/<user_id>/editer', methods=['GET', 'POST'])
|
||||
@priv_required('access-admin-panel', 'edit-account')
|
||||
def adm_edit_account(user_id):
|
||||
user = Member.query.filter_by(id=user_id).first_or_404()
|
||||
|
@ -113,7 +113,7 @@ def adm_edit_account(user_id):
|
|||
group_form=group_form, groups_owned=groups_owned)
|
||||
|
||||
|
||||
@app.route('/admin/account/<user_id>/delete', methods=['GET', 'POST'])
|
||||
@app.route('/admin/compte/<user_id>/supprimer', methods=['GET', 'POST'])
|
||||
@priv_required('access-admin-panel', 'delete-account')
|
||||
def adm_delete_account(user_id):
|
||||
user = Member.query.filter_by(id=user_id).first_or_404()
|
||||
|
|
|
@ -9,7 +9,7 @@ import yaml
|
|||
import os
|
||||
|
||||
|
||||
@app.route('/admin/groups', methods=['GET', 'POST'])
|
||||
@app.route('/admin/groupes', methods=['GET', 'POST'])
|
||||
@priv_required('access-admin-panel')
|
||||
def adm_groups():
|
||||
users = Member.query.all()
|
||||
|
|
|
@ -6,7 +6,7 @@ from app.utils.render import render
|
|||
from app import app, db
|
||||
|
||||
|
||||
@app.route('/admin/trophies', methods=['GET', 'POST'])
|
||||
@app.route('/admin/trophees', methods=['GET', 'POST'])
|
||||
@priv_required('access-admin-panel', 'edit-trophies')
|
||||
def adm_trophies():
|
||||
form = TrophyForm()
|
||||
|
@ -28,7 +28,7 @@ def adm_trophies():
|
|||
form=form)
|
||||
|
||||
|
||||
@app.route('/admin/trophies/<trophy_id>/edit', methods=['GET', 'POST'])
|
||||
@app.route('/admin/trophees/<trophy_id>/editer', methods=['GET', 'POST'])
|
||||
@priv_required('access-admin-panel', 'edit-trophies')
|
||||
def adm_edit_trophy(trophy_id):
|
||||
trophy = Trophy.query.filter_by(id=trophy_id).first_or_404()
|
||||
|
@ -52,7 +52,7 @@ def adm_edit_trophy(trophy_id):
|
|||
return render('admin/edit_trophy.html', trophy=trophy, form=form)
|
||||
|
||||
|
||||
@app.route('/admin/trophies/<trophy_id>/delete', methods=['GET', 'POST'])
|
||||
@app.route('/admin/trophees/<trophy_id>/supprimer', methods=['GET', 'POST'])
|
||||
@priv_required('access-admin-panel', 'edit-trophies')
|
||||
def adm_delete_trophy(trophy_id):
|
||||
trophy = Trophy.query.filter_by(id=trophy_id).first_or_404()
|
||||
|
|
|
@ -24,10 +24,10 @@ def forum_page(f):
|
|||
# User can write anywhere
|
||||
(current_user.is_authenticated and current_user.priv('write-anywhere'))
|
||||
# Forum is news forum TODO: add good condition to check if it's news
|
||||
or ("/news" in f.url and current_user.is_authenticated
|
||||
or ("/actus" in f.url and current_user.is_authenticated
|
||||
and current_user.priv('write-news'))
|
||||
# Forum is not news and is a leaf:
|
||||
or ("/news" not in f.url and not f.sub_forums)):
|
||||
or ("/actus" not in f.url and not f.sub_forums)):
|
||||
|
||||
# First create the thread, then the comment, then the topic
|
||||
th = Thread()
|
||||
|
|
|
@ -3,7 +3,7 @@ from app.forms.search import AdvancedSearchForm
|
|||
from app.utils.render import render
|
||||
|
||||
|
||||
@app.route('/search')
|
||||
@app.route('/rechercher')
|
||||
def search():
|
||||
form = AdvancedSearchForm()
|
||||
return render('search.html', form=form)
|
||||
|
|
|
@ -3,6 +3,6 @@ from app import app
|
|||
from app.utils.render import render
|
||||
|
||||
|
||||
@app.route('/tools')
|
||||
@app.route('/outils')
|
||||
def tools():
|
||||
return render('tools.html')
|
||||
|
|
|
@ -8,14 +8,14 @@ from app.utils.render import render
|
|||
from config import V5Config
|
||||
|
||||
|
||||
@app.route('/user/<username>')
|
||||
@app.route('/membre/<username>')
|
||||
def user(username):
|
||||
norm = unicode_names.normalize(username)
|
||||
member = Member.query.filter_by(norm=norm).first_or_404()
|
||||
return render('account/user.html', member=member)
|
||||
|
||||
|
||||
@app.route('/user/id/<int:user_id>')
|
||||
@app.route('/membre/id/<int:user_id>')
|
||||
def user_by_id(user_id):
|
||||
member = Member.query.filter_by(id=user_id).first_or_404()
|
||||
return redirect(url_for('user', username=member.name))
|
||||
|
|
|
@ -42,8 +42,8 @@
|
|||
{% endif %}
|
||||
|
||||
{% if (current_user.is_authenticated and current_user.priv('write-anywhere'))
|
||||
or ("/news" in f.url and current_user.is_authenticated and current_user.priv('write-news'))
|
||||
or ("/news" not in f.url and not f.sub_forums) %}
|
||||
or ("/actus" in f.url and current_user.is_authenticated and current_user.priv('write-news'))
|
||||
or ("/actus" not in f.url and not f.sub_forums) %}
|
||||
<div class=form>
|
||||
<h2>Créer un nouveau sujet</h2>
|
||||
<form action="" method="post" enctype="multipart/form-data">
|
||||
|
|
Loading…
Reference in New Issue