From 3b2e11ab6369dfa853383840dc28915b60c2d062 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexis=20M=C3=A9taireau?= Date: Fri, 5 Jan 2018 22:06:11 +0100 Subject: Include all .j2 files in the packaged version. I've also renamed the templates to *.j2 in order to make things clearer to others. Having extensions with the name of the locale doesn't seem to be a good practice, and would need us to add the locales in the MANIFEST file each time we add one. Fix #305 --- MANIFEST.in | 2 +- ihatemoney/templates/invitation_mail.en | 12 ------------ ihatemoney/templates/invitation_mail.en.j2 | 12 ++++++++++++ ihatemoney/templates/invitation_mail.fr | 11 ----------- ihatemoney/templates/invitation_mail.fr.j2 | 11 +++++++++++ ihatemoney/templates/password_reminder.en | 8 -------- ihatemoney/templates/password_reminder.en.j2 | 8 ++++++++ ihatemoney/templates/password_reminder.fr | 7 ------- ihatemoney/templates/password_reminder.fr.j2 | 7 +++++++ ihatemoney/templates/reminder_mail.en | 10 ---------- ihatemoney/templates/reminder_mail.en.j2 | 10 ++++++++++ ihatemoney/templates/reminder_mail.fr | 9 --------- ihatemoney/templates/reminder_mail.fr.j2 | 9 +++++++++ ihatemoney/web.py | 6 +++--- 14 files changed, 61 insertions(+), 61 deletions(-) delete mode 100644 ihatemoney/templates/invitation_mail.en create mode 100644 ihatemoney/templates/invitation_mail.en.j2 delete mode 100644 ihatemoney/templates/invitation_mail.fr create mode 100644 ihatemoney/templates/invitation_mail.fr.j2 delete mode 100644 ihatemoney/templates/password_reminder.en create mode 100644 ihatemoney/templates/password_reminder.en.j2 delete mode 100644 ihatemoney/templates/password_reminder.fr create mode 100644 ihatemoney/templates/password_reminder.fr.j2 delete mode 100644 ihatemoney/templates/reminder_mail.en create mode 100644 ihatemoney/templates/reminder_mail.en.j2 delete mode 100644 ihatemoney/templates/reminder_mail.fr create mode 100644 ihatemoney/templates/reminder_mail.fr.j2 diff --git a/MANIFEST.in b/MANIFEST.in index 91d0edb..74ea23b 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,3 +1,3 @@ include *.rst -recursive-include ihatemoney *.rst *.py *.yaml *.po *.mo *.html *.css *.js *.eot *.svg *.woff *.txt *.png *.ini *.cfg +recursive-include ihatemoney *.rst *.py *.yaml *.po *.mo *.html *.css *.js *.eot *.svg *.woff *.txt *.png *.ini *.cfg *.j2 include LICENSE CONTRIBUTORS CHANGELOG.rst requirements.txt diff --git a/ihatemoney/templates/invitation_mail.en b/ihatemoney/templates/invitation_mail.en deleted file mode 100644 index eeaafdb..0000000 --- a/ihatemoney/templates/invitation_mail.en +++ /dev/null @@ -1,12 +0,0 @@ -Hi, - -Someone using the email address {{ g.project.contact_email }} invited you to share your expenses for "{{ g.project.name }}". - -It's as simple as saying what did you paid for, for who, and how much did it cost you, we are caring about the rest. - -You can log in using this link: {{ url_for(".authenticate", _external=True, token=g.project.generate_token()) }}. -Once logged in you can use the following link which is easier to remember: {{ url_for(".list_bills", _external=True) }} -If your cookie gets deleted or if you log out, you will need to log back in using the first link. - -Enjoy, -Some weird guys (with beards) diff --git a/ihatemoney/templates/invitation_mail.en.j2 b/ihatemoney/templates/invitation_mail.en.j2 new file mode 100644 index 0000000..42be0d2 --- /dev/null +++ b/ihatemoney/templates/invitation_mail.en.j2 @@ -0,0 +1,12 @@ +Hi, + +Someone using the email address {{ g.project.contact_email }} invited you to share your expenses for "{{ g.project.name }}". + +It's as simple as saying what did you pay for, for whom, and how much did it cost you, we are caring about the rest. + +You can log in using this link: {{ url_for(".authenticate", _external=True, token=g.project.generate_token()) }}. +Once logged-in, you can use the following link which is easier to remember: {{ url_for(".list_bills", _external=True) }} +If your cookie gets deleted or if you log out, you will need to log back in using the first link. + +Enjoy, +Some weird guys (with beards) diff --git a/ihatemoney/templates/invitation_mail.fr b/ihatemoney/templates/invitation_mail.fr deleted file mode 100644 index a95f9e9..0000000 --- a/ihatemoney/templates/invitation_mail.fr +++ /dev/null @@ -1,11 +0,0 @@ -Salut, - -Quelqu'un avec l'addresse email "{{ g.project.contact_email }}" vous à invité à partager vos dépenses pour "{{ g.project.name }}". - -C'est aussi simple que de dire qui à payé pour quoi, pour qui, et combien celà à coûté, on s'occuppe du reste. - -Vous pouvez vous authentifier avec le lien suivant: {{ url_for(".authenticate", _external=True, token=g.project.generate_token()) }}. -Une fois authentifié, vous pouvez utiliser le lien suivant qui est plus facile à mémoriser: {{ url_for(".list_bills", _external=True) }} -Si votre cookie est supprimé ou si vous vous déconnectez, voous devrez vous réauthentifier en utilisant le premier lien. - -Have fun, diff --git a/ihatemoney/templates/invitation_mail.fr.j2 b/ihatemoney/templates/invitation_mail.fr.j2 new file mode 100644 index 0000000..197edcc --- /dev/null +++ b/ihatemoney/templates/invitation_mail.fr.j2 @@ -0,0 +1,11 @@ +Salut, + +Quelqu'un avec l'adresse "{{ g.project.contact_email }}" vous à invité à partager vos dépenses pour "{{ g.project.name }}". + +C'est aussi simple que de dire qui à payé pour quoi, pour qui, et combien celà à coûté, on s’occupe du reste. + +Vous pouvez vous authentifier avec le lien suivant: {{ url_for(".authenticate", _external=True, token=g.project.generate_token()) }}. +Une fois authentifié, vous pouvez utiliser le lien suivant qui est plus facile à mémoriser: {{ url_for(".list_bills", _external=True) }} +Si votre cookie est supprimé ou si vous vous déconnectez, vous devrez vous authentifier à nouveau en utilisant le premier lien. + +Have fun, diff --git a/ihatemoney/templates/password_reminder.en b/ihatemoney/templates/password_reminder.en deleted file mode 100644 index bc7e609..0000000 --- a/ihatemoney/templates/password_reminder.en +++ /dev/null @@ -1,8 +0,0 @@ -Hi, - -You requested to reset the password of the following project: "{{ project.name }}". -You can reset it here: {{ url_for(".reset_password", _external=True, token=project.generate_token(expiration=3600)) }}. -This link is only valid for 1 hour. - -Hope this helps, -Some weird guys (with beards) diff --git a/ihatemoney/templates/password_reminder.en.j2 b/ihatemoney/templates/password_reminder.en.j2 new file mode 100644 index 0000000..c654354 --- /dev/null +++ b/ihatemoney/templates/password_reminder.en.j2 @@ -0,0 +1,8 @@ +Hi, + +You requested to reset the password of the following project: "{{ project.name }}". +You can reset it here: {{ url_for(".reset_password", _external=True, token=project.generate_token(expiration=3600)) }}. +This link is only valid for one hour. + +Hope this helps, +Some weird guys (with beards) diff --git a/ihatemoney/templates/password_reminder.fr b/ihatemoney/templates/password_reminder.fr deleted file mode 100644 index d4fbc2d..0000000 --- a/ihatemoney/templates/password_reminder.fr +++ /dev/null @@ -1,7 +0,0 @@ -Salut, - -Vous avez demandé à réinitialiser le mot de passe du projet suivant : "{{ project.name }}". -Vous pouvez le réinitialiser ici : {{ url_for(".reset_password", _external=True, token=project.generate_token(expiration=3600)) }}. -Ce lien est seulement valide pendant 1 heure. - -Faites en bon usage ! diff --git a/ihatemoney/templates/password_reminder.fr.j2 b/ihatemoney/templates/password_reminder.fr.j2 new file mode 100644 index 0000000..d4fbc2d --- /dev/null +++ b/ihatemoney/templates/password_reminder.fr.j2 @@ -0,0 +1,7 @@ +Salut, + +Vous avez demandé à réinitialiser le mot de passe du projet suivant : "{{ project.name }}". +Vous pouvez le réinitialiser ici : {{ url_for(".reset_password", _external=True, token=project.generate_token(expiration=3600)) }}. +Ce lien est seulement valide pendant 1 heure. + +Faites en bon usage ! diff --git a/ihatemoney/templates/reminder_mail.en b/ihatemoney/templates/reminder_mail.en deleted file mode 100644 index 8784d2a..0000000 --- a/ihatemoney/templates/reminder_mail.en +++ /dev/null @@ -1,10 +0,0 @@ -Hi, - -You have just (or someone else using your email address) created the project "{{ g.project.name }}" to share your expenses. - -You can access it here: {{ url_for(".list_bills", _external=True) }} (the identifier is {{ g.project.id }}). -If you want to share this project with your friends, you can share the identifier and the shared password with them or send them invitations with the following link: -{{ url_for(".invite", _external=True) }} - -Enjoy, -Some weird guys (with beards) diff --git a/ihatemoney/templates/reminder_mail.en.j2 b/ihatemoney/templates/reminder_mail.en.j2 new file mode 100644 index 0000000..8784d2a --- /dev/null +++ b/ihatemoney/templates/reminder_mail.en.j2 @@ -0,0 +1,10 @@ +Hi, + +You have just (or someone else using your email address) created the project "{{ g.project.name }}" to share your expenses. + +You can access it here: {{ url_for(".list_bills", _external=True) }} (the identifier is {{ g.project.id }}). +If you want to share this project with your friends, you can share the identifier and the shared password with them or send them invitations with the following link: +{{ url_for(".invite", _external=True) }} + +Enjoy, +Some weird guys (with beards) diff --git a/ihatemoney/templates/reminder_mail.fr b/ihatemoney/templates/reminder_mail.fr deleted file mode 100644 index e73938a..0000000 --- a/ihatemoney/templates/reminder_mail.fr +++ /dev/null @@ -1,9 +0,0 @@ -Hey, - -Vous venez de créer le projet "{{ g.project.name }}" pour partager vos dépenses. - -Vous pouvez y accéder ici: {{ url_for(".list_bills", _external=True) }} (l'identifieur est {{ g.project.id }}). -Si vous voulez partager ce projet avec vos amis, vous pouvez partager son identifiant et son code d'accès avec eux ou leur envoyer une invitation avec le lien suivant : -{{ url_for(".invite", _external=True) }} - -Faites en bon usage ! diff --git a/ihatemoney/templates/reminder_mail.fr.j2 b/ihatemoney/templates/reminder_mail.fr.j2 new file mode 100644 index 0000000..e73938a --- /dev/null +++ b/ihatemoney/templates/reminder_mail.fr.j2 @@ -0,0 +1,9 @@ +Hey, + +Vous venez de créer le projet "{{ g.project.name }}" pour partager vos dépenses. + +Vous pouvez y accéder ici: {{ url_for(".list_bills", _external=True) }} (l'identifieur est {{ g.project.id }}). +Si vous voulez partager ce projet avec vos amis, vous pouvez partager son identifiant et son code d'accès avec eux ou leur envoyer une invitation avec le lien suivant : +{{ url_for(".invite", _external=True) }} + +Faites en bon usage ! diff --git a/ihatemoney/web.py b/ihatemoney/web.py index e6df385..6b1b358 100644 --- a/ihatemoney/web.py +++ b/ihatemoney/web.py @@ -242,7 +242,7 @@ def create_project(): message_title = _("You have just created '%(project)s' " "to share your expenses", project=g.project.name) - message_body = render_template("reminder_mail.%s" % + message_body = render_template("reminder_mail.%s.j2" % get_locale().language) msg = Message(message_title, @@ -273,7 +273,7 @@ def remind_password(): project = Project.query.get(form.id.data) # send a link to reset the password - password_reminder = "password_reminder.%s" % get_locale().language + password_reminder = "password_reminder.%s.j2" % get_locale().language current_app.mail.send(Message( "password recovery", body=render_template(password_reminder, project=project), @@ -395,7 +395,7 @@ def invite(): if form.validate(): # send the email - message_body = render_template("invitation_mail.%s" % + message_body = render_template("invitation_mail.%s.j2" % get_locale().language) message_title = _("You have been invited to share your " -- cgit v1.1