diff --git a/templates/macros/nav.html b/templates/macros/nav.html index 6f29a713f4..bc10ef19c2 100644 --- a/templates/macros/nav.html +++ b/templates/macros/nav.html @@ -58,6 +58,7 @@ ('/payment-processors', _('Payment Processors')), ('/teams', _('Teams')), ('/stats', _('Stats')), + ('/alternatives', _('Alternatives')), ('/legal', _('Legal')), ('/privacy', _('Privacy')), ('/feeds', _('Follow Us')), diff --git a/tests/py/test_browsing.py b/tests/py/test_browsing.py index ef4049eee4..6feba1560f 100644 --- a/tests/py/test_browsing.py +++ b/tests/py/test_browsing.py @@ -30,6 +30,7 @@ def f(spt): .replace('/%username/news/%action', '/%username/news/subscribe') \ .replace('/for/%name/', '/for/wonderland/') \ .replace('/for/wonderland/%action', '/for/wonderland/leave') \ + .replace('/alternatives/%platform', '/alternatives') \ .replace('/%platform', '/github') \ .replace('/%user_name/', '/liberapay/') \ .replace('/%redirect_to', '/giving') \ diff --git a/www/about/alternatives/%platform.spt b/www/about/alternatives/%platform.spt new file mode 100644 index 0000000000..b4d71e38e5 --- /dev/null +++ b/www/about/alternatives/%platform.spt @@ -0,0 +1,60 @@ +from itertools import chain + +PLATFORM_NAMES = ['Ghost', 'Open Collective', 'Patreon', 'Tipeee'] +PLATFORM_SLUGS = {name.replace(' ', '').lower(): name for name in PLATFORM_NAMES} +NAV_ITEMS = [ + ('/' + slug, name) for slug, name in PLATFORM_SLUGS.items() +] + +[---] + +platform_slug = request.path['platform'] +platform_name = PLATFORM_SLUGS.get(platform_slug) +if platform_slug and not platform_name: + if platform_slug.lower() in PLATFORM_SLUGS: + raise response.redirect('/about/alternatives/' + platform_slug.lower()) + raise response.error(404) + +if platform_name: + title = platform_name + full_title = _("{platform1} versus {platform2} - A comparison", + platform1=platform_name, platform2='Liberapay') +else: + title = _("Alternatives") + +[---] text/html +% extends "templates/layouts/about.html" + +% from "templates/macros/nav.html" import nav with context + +% block content + + +
+ +% if not platform_slug + +

{{ _("TODO") }}

+ +% elif platform_slug == 'ghost' + +

{{ _("TODO") }}

+ +% elif platform_slug == 'opencollective' + +

{{ _("TODO") }}

+ +% elif platform_slug == 'patreon' + +

{{ _("TODO") }}

+ +% elif platform_slug == 'tipeee' + +

{{ _("TODO") }}

+ +% endif + +% endblock