The beginning of transfer view

This commit is contained in:
Alexandre Iooss 2019-07-17 13:34:07 +02:00
parent 849bb71d5d
commit 7bafbeb93a
No known key found for this signature in database
GPG Key ID: 6C79278F3FCDCC02
7 changed files with 97 additions and 37 deletions

View File

@ -3,7 +3,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-07-17 11:51+0200\n"
"POT-Creation-Date: 2019-07-17 13:32+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -13,7 +13,16 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
#: apps.py:11 models/notes.py:41
#: admin.py:113 models/transactions.py:46
msgid "source"
msgstr "source"
#: admin.py:121 admin.py:139 models/transactions.py:25
#: models/transactions.py:52
msgid "destination"
msgstr "destination"
#: apps.py:11 models/notes.py:45
msgid "note"
msgstr "note"
@ -40,73 +49,72 @@ msgstr ""
msgid "display image"
msgstr "image affichée"
#: models/notes.py:42
#: models/notes.py:40 models/transactions.py:55
msgid "created at"
msgstr "créée le"
#: models/notes.py:46
msgid "notes"
msgstr "notes"
#: models/notes.py:53
msgid "user"
msgstr ""
#: models/notes.py:57
msgid "user"
msgstr "utilisateur"
#: models/notes.py:61
msgid "one's note"
msgstr "note d'un utilisateur"
#: models/notes.py:58
#: models/notes.py:62
msgid "users note"
msgstr "notes des utilisateurs"
#: models/notes.py:61
#: models/notes.py:65
#, python-format
msgid "%(user)s's note"
msgstr "Note de %(user)s"
#: models/notes.py:72
#: models/notes.py:76
msgid "club"
msgstr "club"
#: models/notes.py:76
#: models/notes.py:80
msgid "club note"
msgstr "note d'un club"
#: models/notes.py:77
#: models/notes.py:81
msgid "clubs notes"
msgstr "notes des clubs"
#: models/notes.py:80
#: models/notes.py:84
#, python-format
msgid "Note for %(club)s club"
msgstr "Note du club %(club)s"
#: models/notes.py:93 models/transactions.py:32 models/transactions.py:65
#: models/notes.py:97 models/transactions.py:32 models/transactions.py:65
msgid "type"
msgstr "type"
#: models/notes.py:99
#: models/notes.py:103
msgid "special note"
msgstr "note spéciale"
#: models/notes.py:100
#: models/notes.py:104
msgid "special notes"
msgstr "notes spéciales"
#: models/notes.py:111 models/transactions.py:18
#: models/notes.py:115 models/transactions.py:18
msgid "name"
msgstr "nom"
#: models/notes.py:121
#: models/notes.py:125
msgid "alias"
msgstr "alias"
#: models/notes.py:122
#: models/notes.py:126
msgid "aliases"
msgstr "alias"
#: models/transactions.py:25 models/transactions.py:52
#: models/transactions.py:55
msgid "destination"
msgstr "destination"
#: models/transactions.py:28 models/transactions.py:62
msgid "amount"
msgstr "montant"
@ -123,10 +131,6 @@ msgstr "modèle de transaction"
msgid "transaction templates"
msgstr "modèles de transaction"
#: models/transactions.py:46
msgid "source"
msgstr "source"
#: models/transactions.py:59
msgid "quantity"
msgstr "quantité"
@ -154,3 +158,11 @@ msgstr "transaction d'adhésion"
#: models/transactions.py:89
msgid "membership transactions"
msgstr "transactions d'adhésion"
#: templates/note/transfer.html:7
msgid "Home"
msgstr "Accueil"
#: views.py:21
msgid "Transfer money from your account to one or others"
msgstr "Transfert d'argent de ton compte vers un ou plusieurs autres"

View File

@ -0,0 +1,10 @@
{% extends "admin/base_site.html" %}
{% load i18n %}
{% block breadcrumbs %}
<div class="breadcrumbs">
<a href="{% url 'index' %}">{% trans 'Home' %}</a>
{% if title %} &rsaquo; {{ title }}{% endif %}
</div>
{% endblock %}

12
note/urls.py Normal file
View File

@ -0,0 +1,12 @@
# -*- mode: python; coding: utf-8 -*-
# Copyright (C) 2018-2019 by BDE ENS Paris-Saclay
# SPDX-License-Identifier: GPL-3.0-or-later
from django.urls import path
from . import views
app_name = 'note'
urlpatterns = [
path('transfer/', views.transfer, name='transfer'),
]

23
note/views.py Normal file
View File

@ -0,0 +1,23 @@
# -*- mode: python; coding: utf-8 -*-
# Copyright (C) 2018-2019 by BDE ENS Paris-Saclay
# SPDX-License-Identifier: GPL-3.0-or-later
from django.contrib.auth.decorators import login_required
from django.shortcuts import render
from django.utils.translation import gettext_lazy as _
@login_required
def transfer(request):
"""
Show transfer page
TODO: If user have sufficient rights, they can transfer from an other note
"""
return render(
request,
'note/transfer.html',
{
'title': _('Transfer money from your account to one or others')
}
)

View File

@ -7,8 +7,11 @@ from django.urls import path, include
from django.views.generic import RedirectView
urlpatterns = [
# No app, so redirect to admin
path('', RedirectView.as_view(pattern_name='admin:index'), name='index'),
# Dev so redirect to something random
path('', RedirectView.as_view(pattern_name='note:transfer'), name='index'),
# Include project routers
path('note/', include('note.urls')),
# Include Django Contrib and Core routers
# admin/login/ is redirected to the non-admin login page

View File

@ -3,7 +3,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-07-16 12:36+0200\n"
"POT-Creation-Date: 2019-07-17 13:33+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -18,8 +18,8 @@ msgid "Welcome,"
msgstr ""
#: templates/admin/base_site.html:27
msgid "View site"
msgstr "Retour au site"
msgid "Transfer"
msgstr "Virement"
#: templates/admin/base_site.html:32 templates/admin/base_site.html:51
msgid "View admin"

View File

@ -9,7 +9,7 @@ SPDX-License-Identifier: GPL-3.0-or-later
{% block branding %}
<strong id="site-name">
<a href="{{ site_url }}">
<a href="/">
{{ request.site.name }}
</a>
</strong>
@ -23,9 +23,9 @@ SPDX-License-Identifier: GPL-3.0-or-later
<strong>{% firstof user.get_short_name user.get_username %}</strong>.
{% endblock %}
{% block userlinks %}
{% if site_url %}
<a href="{{ site_url }}">{% trans 'View site' %}</a> /
{% endif %}
{# Link to our apps outside of admin #}
<a href="{% url 'note:transfer' %}">{% trans 'Transfer' %}</a> /
{% if available_apps %}
{# When in admin site, list all admin pages and documentation #}
<span class="dropdown">