diff --git a/README.rst b/README.rst index c2166955..f539c18c 100644 --- a/README.rst +++ b/README.rst @@ -4,6 +4,10 @@ I hate money .. image:: https://travis-ci.org/spiral-project/ihatemoney.svg?branch=master :target: https://travis-ci.org/spiral-project/ihatemoney :alt: Travis CI Build Status + +.. image:: https://img.shields.io/badge/maintainers-wanted-red.svg + :target: https://github.com/pickhardt/maintainers-wanted + :alt: Maintainers Wanted *I hate money* is a web application made to ease shared budget management. It keeps track of who bought what, when, and for whom; and helps to settle the diff --git a/ihatemoney/api.py b/ihatemoney/api.py index bb2ac9ba..67c6cc18 100644 --- a/ihatemoney/api.py +++ b/ihatemoney/api.py @@ -186,8 +186,20 @@ class BillHandler(Resource): return "OK", 200 +class TokenHandler(Resource): + method_decorators = [need_auth] + + def get(self, project): + if not project: + return "Not Found", 404 + + token = project.generate_token() + return {"token": token}, 200 + + restful_api.add_resource(ProjectsHandler, "/projects") restful_api.add_resource(ProjectHandler, "/projects/") +restful_api.add_resource(TokenHandler, "/projects//token") restful_api.add_resource(MembersHandler, "/projects//members") restful_api.add_resource( ProjectStatsHandler, "/projects//statistics" diff --git a/ihatemoney/templates/forms.html b/ihatemoney/templates/forms.html index 75dacab8..548fd516 100644 --- a/ihatemoney/templates/forms.html +++ b/ihatemoney/templates/forms.html @@ -133,7 +133,7 @@ {{ form.name(placeholder=_("Add participant"), class="form-control") }}
- +
{% endmacro %} diff --git a/ihatemoney/templates/list_bills.html b/ihatemoney/templates/list_bills.html index 597dc373..84f72994 100644 --- a/ihatemoney/templates/list_bills.html +++ b/ihatemoney/templates/list_bills.html @@ -78,7 +78,7 @@ {% block content %} - + {{ static_include("images/plus.svg") | safe }} {{ _("Add a new bill") }} diff --git a/ihatemoney/tests/tests.py b/ihatemoney/tests/tests.py index 7fe4adfb..7644490c 100644 --- a/ihatemoney/tests/tests.py +++ b/ihatemoney/tests/tests.py @@ -1357,6 +1357,42 @@ class APITestCase(IhatemoneyTestCase): ) self.assertEqual(401, resp.status_code) + def test_token_creation(self): + """Test that token of project is generated + """ + + # Create project + resp = self.api_create("raclette") + self.assertTrue(201, resp.status_code) + + # Get token + resp = self.client.get( + "/api/projects/raclette/token", headers=self.get_auth("raclette") + ) + + self.assertEqual(200, resp.status_code) + + decoded_resp = json.loads(resp.data.decode("utf-8")) + + # Access with token + resp = self.client.get( + "/api/projects/raclette/token", + headers={"Authorization": "Basic %s" % decoded_resp["token"]}, + ) + + self.assertEqual(200, resp.status_code) + + def test_token_login(self): + resp = self.api_create("raclette") + # Get token + resp = self.client.get( + "/api/projects/raclette/token", headers=self.get_auth("raclette") + ) + decoded_resp = json.loads(resp.data.decode("utf-8")) + resp = self.client.get("/authenticate?token={}".format(decoded_resp["token"])) + # Test that we are redirected. + self.assertEqual(302, resp.status_code) + def test_member(self): # create a project self.api_create("raclette") diff --git a/ihatemoney/translations/cs/LC_MESSAGES/messages.po b/ihatemoney/translations/cs/LC_MESSAGES/messages.po new file mode 100644 index 00000000..adc914fb --- /dev/null +++ b/ihatemoney/translations/cs/LC_MESSAGES/messages.po @@ -0,0 +1,516 @@ +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2019-10-24 18:27+0200\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: Automatically generated\n" +"Language-Team: none\n" +"Language: cs\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Translate Toolkit 2.4.0\n" + +msgid "" +"Not a valid amount or expression. Only numbers and + - * / operators are " +"accepted." +msgstr "" + +msgid "Project name" +msgstr "" + +msgid "Private code" +msgstr "" + +msgid "Email" +msgstr "" + +msgid "Project identifier" +msgstr "" + +msgid "Create the project" +msgstr "" + +#, python-format +msgid "" +"A project with this identifier (\"%(project)s\") already exists. Please " +"choose a new identifier" +msgstr "" + +msgid "Get in" +msgstr "" + +msgid "Admin password" +msgstr "" + +msgid "Send me the code by email" +msgstr "" + +msgid "This project does not exists" +msgstr "" + +msgid "Password mismatch" +msgstr "" + +msgid "Password" +msgstr "" + +msgid "Password confirmation" +msgstr "" + +msgid "Reset password" +msgstr "" + +msgid "Date" +msgstr "" + +msgid "What?" +msgstr "" + +msgid "Payer" +msgstr "" + +msgid "Amount paid" +msgstr "" + +msgid "External link" +msgstr "" + +msgid "A link to an external document, related to this bill" +msgstr "" + +msgid "For whom?" +msgstr "" + +msgid "Submit" +msgstr "" + +msgid "Submit and add a new one" +msgstr "" + +msgid "Bills can't be null" +msgstr "" + +msgid "Name" +msgstr "" + +msgid "Weights should be positive" +msgstr "" + +msgid "Weight" +msgstr "" + +msgid "Add" +msgstr "" + +msgid "User name incorrect" +msgstr "" + +msgid "This project already have this member" +msgstr "" + +msgid "People to notify" +msgstr "" + +msgid "Send invites" +msgstr "" + +#, python-format +msgid "The email %(email)s is not valid" +msgstr "" + +msgid "Too many failed login attempts, please retry later." +msgstr "" + +#, python-format +msgid "This admin password is not the right one. Only %(num)d attempts left." +msgstr "" + +msgid "You either provided a bad token or no project identifier." +msgstr "" + +msgid "This private code is not the right one" +msgstr "" + +#, python-format +msgid "You have just created '%(project)s' to share your expenses" +msgstr "" + +#, python-format +msgid "%(msg_compl)sThe project identifier is %(project)s" +msgstr "" + +msgid "No token provided" +msgstr "" + +msgid "Invalid token" +msgstr "" + +msgid "Unknown project" +msgstr "" + +msgid "Password successfully reset." +msgstr "" + +msgid "Project successfully deleted" +msgstr "" + +#, python-format +msgid "You have been invited to share your expenses for %(project)s" +msgstr "" + +msgid "Your invitations have been sent" +msgstr "" + +#, python-format +msgid "%(member)s had been added" +msgstr "" + +#, python-format +msgid "%(name)s is part of this project again" +msgstr "" + +#, python-format +msgid "" +"User '%(name)s' has been deactivated. It will still appear in the users " +"list until its balance becomes zero." +msgstr "" + +#, python-format +msgid "User '%(name)s' has been removed" +msgstr "" + +#, python-format +msgid "User '%(name)s' has been edited" +msgstr "" + +msgid "The bill has been added" +msgstr "" + +msgid "The bill has been deleted" +msgstr "" + +msgid "The bill has been modified" +msgstr "" + +msgid "Sorry, we were unable to find the page you've asked for." +msgstr "" + +msgid "The best thing to do is probably to get back to the main page." +msgstr "" + +msgid "Back to the list" +msgstr "" + +msgid "Administration tasks are currently disabled." +msgstr "" + +msgid "The project you are trying to access do not exist, do you want to" +msgstr "" + +msgid "create it" +msgstr "" + +msgid "?" +msgstr "" + +msgid "Create a new project" +msgstr "" + +msgid "Project" +msgstr "" + +msgid "Number of members" +msgstr "" + +msgid "Number of bills" +msgstr "" + +msgid "Newest bill" +msgstr "" + +msgid "Oldest bill" +msgstr "" + +msgid "Actions" +msgstr "" + +msgid "edit" +msgstr "" + +msgid "delete" +msgstr "" + +msgid "The Dashboard is currently deactivated." +msgstr "" + +msgid "you sure?" +msgstr "" + +msgid "Edit project" +msgstr "" + +msgid "Download project's data" +msgstr "" + +msgid "Bill items" +msgstr "" + +msgid "Download the list of bills with owner, amount, reason,... " +msgstr "" + +msgid "Settle plans" +msgstr "" + +msgid "Download the list of transactions needed to settle the current bills." +msgstr "" + +msgid "Can't remember the password?" +msgstr "" + +msgid "Cancel" +msgstr "" + +msgid "Edit the project" +msgstr "" + +msgid "Edit this bill" +msgstr "" + +msgid "Add a bill" +msgstr "" + +msgid "Select all" +msgstr "" + +msgid "Select none" +msgstr "" + +msgid "Add participant" +msgstr "" + +msgid "Edit this member" +msgstr "" + +msgid "john.doe@example.com, mary.moe@site.com" +msgstr "" + +msgid "Send the invitations" +msgstr "" + +msgid "Download" +msgstr "" + +msgid "Manage your shared
expenses, easily" +msgstr "" + +msgid "Try out the demo" +msgstr "" + +msgid "You're sharing a house?" +msgstr "" + +msgid "Going on holidays with friends?" +msgstr "" + +msgid "Simply sharing money with others?" +msgstr "" + +msgid "We can help!" +msgstr "" + +msgid "Log in to an existing project" +msgstr "" + +msgid "Log in" +msgstr "" + +msgid "can't remember your password?" +msgstr "" + +msgid "Create" +msgstr "" + +msgid "" +"This access code will be sent to your friends. It is stored as-is by the " +"server, so don\\'t reuse a personal password!" +msgstr "" + +msgid "Account manager" +msgstr "" + +msgid "Bills" +msgstr "" + +msgid "Settle" +msgstr "" + +msgid "Statistics" +msgstr "" + +msgid "Settings" +msgstr "" + +msgid "Languages" +msgstr "" + +msgid "Projects" +msgstr "" + +msgid "Start a new project" +msgstr "" + +msgid "Other projects :" +msgstr "" + +msgid "switch to" +msgstr "" + +msgid "Dashboard" +msgstr "" + +msgid "Logout" +msgstr "" + +msgid "Code" +msgstr "" + +msgid "Mobile Application" +msgstr "" + +msgid "Documentation" +msgstr "" + +msgid "Administation Dashboard" +msgstr "" + +msgid "\"I hate money\" is a free software" +msgstr "" + +msgid "you can contribute and improve it!" +msgstr "" + +msgid "deactivate" +msgstr "" + +msgid "reactivate" +msgstr "" + +msgid "Invite people" +msgstr "" + +msgid "You should start by adding participants" +msgstr "" + +msgid "Add a new bill" +msgstr "" + +msgid "When?" +msgstr "" + +msgid "Who paid?" +msgstr "" + +msgid "For what?" +msgstr "" + +msgid "How much?" +msgstr "" + +#, python-format +msgid "Added on %(date)s" +msgstr "" + +msgid "Everyone" +msgstr "" + +#, python-format +msgid "Everyone but %(excluded)s" +msgstr "" + +msgid "each" +msgstr "" + +msgid "see" +msgstr "" + +msgid "No bills" +msgstr "" + +msgid "Nothing to list yet." +msgstr "" + +msgid "You probably want to" +msgstr "" + +msgid "add a bill" +msgstr "" + +msgid "add participants" +msgstr "" + +msgid "Password reminder" +msgstr "" + +msgid "" +"A link to reset your password has been sent to you, please check your " +"emails." +msgstr "" + +msgid "Return to home page" +msgstr "" + +msgid "Your projects" +msgstr "" + +msgid "Reset your password" +msgstr "" + +msgid "Invite people to join this project" +msgstr "" + +msgid "Share Identifier & code" +msgstr "" + +msgid "" +"You can share the project identifier and the private code by any " +"communication means." +msgstr "" + +msgid "Identifier:" +msgstr "" + +msgid "Share the Link" +msgstr "" + +msgid "You can directly share the following link via your prefered medium" +msgstr "" + +msgid "Send via Emails" +msgstr "" + +msgid "" +"Specify a (comma separated) list of email adresses you want to notify " +"about the\n" +" creation of this budget management project and we will " +"send them an email for you." +msgstr "" + +msgid "Who pays?" +msgstr "" + +msgid "To whom?" +msgstr "" + +msgid "Who?" +msgstr "" + +msgid "Paid" +msgstr "" + +msgid "Spent" +msgstr "" + +msgid "Balance" +msgstr "" diff --git a/ihatemoney/translations/de/LC_MESSAGES/messages.po b/ihatemoney/translations/de/LC_MESSAGES/messages.po index f74619c8..8483a70e 100644 --- a/ihatemoney/translations/de/LC_MESSAGES/messages.po +++ b/ihatemoney/translations/de/LC_MESSAGES/messages.po @@ -3,14 +3,16 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2019-10-12 09:58+0200\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: Automatically generated\n" -"Language-Team: none\n" +"PO-Revision-Date: 2019-10-20 19:09+0000\n" +"Last-Translator: nautilusx \n" +"Language-Team: German \n" "Language: de\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Generator: Translate Toolkit 2.4.0\n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 3.9.1-dev\n" msgid "" "Not a valid amount or expression. Only numbers and + - * / operators are " @@ -70,7 +72,7 @@ msgid "Date" msgstr "Datum" msgid "What?" -msgstr "Was" +msgstr "Was?" msgid "Payer" msgstr "Von" @@ -79,7 +81,7 @@ msgid "Amount paid" msgstr "Betrag" msgid "For whom?" -msgstr "Für" +msgstr "Für wen?" msgid "Submit" msgstr "Hinzufügen" @@ -173,19 +175,19 @@ msgstr "%(member)s wurden hinzugefügt" msgid "%(name)s is part of this project again" msgstr "%(name)s ist wieder Teil von diesem Projekt" -#, fuzzy, python-format +#, python-format msgid "" "User '%(name)s' has been deactivated. It will still appear in the users " "list until its balance becomes zero." msgstr "" "Der Benutzer '%(name)s' wurde deaktiviert. Er wird weiterhin in der " -"Benutzerliste erscheinen solange seine Bilanz Null ist." +"Benutzerliste erscheinen, bis sein Saldo Null ist." -#, fuzzy, python-format +#, python-format msgid "User '%(name)s' has been removed" msgstr "Der Benutzer '%(name)s' wurde entfernt" -#, fuzzy, python-format +#, python-format msgid "User '%(name)s' has been edited" msgstr "Der Benutzer '%(name)s' wurde bearbeitet" @@ -262,7 +264,7 @@ msgid "Bill items" msgstr "Rechungsposition" msgid "Download the list of bills with owner, amount, reason,... " -msgstr "Liste herunterladen (Mit Ersteller, Betrag, Grund, ...)" +msgstr "Liste herunterladen mit Ersteller, Betrag, Grund, ... " msgid "Settle plans" msgstr "Bilanz" @@ -351,7 +353,7 @@ msgid "Bills" msgstr "Ausgaben" msgid "Settle" -msgstr " Bilanz" +msgstr "Bilanz" msgid "Statistics" msgstr "Statistik" diff --git a/ihatemoney/translations/es_419/LC_MESSAGES/messages.mo b/ihatemoney/translations/es_419/LC_MESSAGES/messages.mo index 882febfd..7f1de2cc 100644 Binary files a/ihatemoney/translations/es_419/LC_MESSAGES/messages.mo and b/ihatemoney/translations/es_419/LC_MESSAGES/messages.mo differ diff --git a/ihatemoney/translations/es_419/LC_MESSAGES/messages.po b/ihatemoney/translations/es_419/LC_MESSAGES/messages.po index e2e25ac2..1ce97596 100644 --- a/ihatemoney/translations/es_419/LC_MESSAGES/messages.po +++ b/ihatemoney/translations/es_419/LC_MESSAGES/messages.po @@ -3,7 +3,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-10-01 21:48+0200\n" +"POT-Creation-Date: 2019-10-20 11:52+0200\n" "PO-Revision-Date: 2019-09-25 22:28+0000\n" "Last-Translator: Diego Caraballo \n" "Language: es_419\n" @@ -82,10 +82,10 @@ msgid "Amount paid" msgstr "Cantidad pagada" msgid "External link" -msgstr "" +msgstr "Enlace externo" msgid "A link to an external document, related to this bill" -msgstr "" +msgstr "Un enlace a un documento externo relaccionado con esta factura" msgid "For whom?" msgstr "¿Para quién?" @@ -192,7 +192,7 @@ msgstr "" #, python-format msgid "User '%(name)s' has been removed" -msgstr "Se ha eliminado el usuario '%(name)s'" +msgstr "Se ha eliminado al usuario '%(name)s'" #, python-format msgid "User '%(name)s' has been edited" @@ -300,7 +300,7 @@ msgid "Select all" msgstr "Seleccionar todo" msgid "Select none" -msgstr "Seleccionar ninguno" +msgstr "No seleccionar a ninguno" msgid "Add participant" msgstr "Añadir participante" @@ -324,16 +324,16 @@ msgid "Try out the demo" msgstr "Prueba la demo" msgid "You're sharing a house?" -msgstr "Estás compartiendo una casa?" +msgstr "¿Estás compartiendo una casa?" msgid "Going on holidays with friends?" -msgstr "Te vas de vacaciones con amigos?" +msgstr "¿Te vas de vacaciones con amigos?" msgid "Simply sharing money with others?" -msgstr "Simplemente compartes dinero con otros?" +msgstr "¿Simplemente compartes dinero con otros?" msgid "We can help!" -msgstr "Nosotros podemos ayudarte!" +msgstr "¡Nosotros podemos ayudarte!" msgid "Log in to an existing project" msgstr "Iniciar sesión en un proyecto existente" @@ -440,17 +440,17 @@ msgid "Added on %(date)s" msgstr "Agregado el %(date)s" msgid "Everyone" -msgstr "" +msgstr "Todo el mundo" #, python-format msgid "Everyone but %(excluded)s" -msgstr "" +msgstr "Todo el mundo menos %(excluded)s" msgid "each" msgstr "Cada" msgid "see" -msgstr "" +msgstr "ver" msgid "No bills" msgstr "Sin facturas" @@ -537,7 +537,7 @@ msgid "Paid" msgstr "Pagado" msgid "Spent" -msgstr "gastado" +msgstr "Gastado" msgid "Balance" msgstr "Balance" diff --git a/ihatemoney/translations/nb_NO/LC_MESSAGES/messages.po b/ihatemoney/translations/nb_NO/LC_MESSAGES/messages.po index d5b81c2f..1a95c5e6 100644 --- a/ihatemoney/translations/nb_NO/LC_MESSAGES/messages.po +++ b/ihatemoney/translations/nb_NO/LC_MESSAGES/messages.po @@ -3,7 +3,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2019-09-30 23:53+0200\n" -"PO-Revision-Date: 2019-10-02 15:56+0000\n" +"PO-Revision-Date: 2019-11-12 09:04+0000\n" "Last-Translator: Allan Nordhøy \n" "Language-Team: Norwegian Bokmål \n" @@ -12,7 +12,7 @@ msgstr "" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 3.9-dev\n" +"X-Generator: Weblate 3.10-dev\n" "Generated-By: Babel 2.7.0\n" msgid "" @@ -83,10 +83,10 @@ msgid "Amount paid" msgstr "Beløp betalt" msgid "External link" -msgstr "" +msgstr "Ekstern lenke" msgid "A link to an external document, related to this bill" -msgstr "" +msgstr "En lenke til et eksternt dokument, i relasjon til denne regningen" msgid "For whom?" msgstr "For hvem?" @@ -462,8 +462,9 @@ msgstr "Alle, unntagen %(excluded)s" msgid "each" msgstr "hver" +#, fuzzy msgid "see" -msgstr "" +msgstr "se" msgid "No bills" msgstr "Ingen regninger"