diff --git a/scss/pages/on-npm-foo.scss b/scss/pages/on-npm-foo.scss new file mode 100644 index 0000000000..e6142d70aa --- /dev/null +++ b/scss/pages/on-npm-foo.scss @@ -0,0 +1,7 @@ +#on-npm-foo { + #content { + a { + font-family: $Mono; + } + } +} diff --git a/tests/py/test_pages.py b/tests/py/test_pages.py index dce97445ac..452a9eadd2 100644 --- a/tests/py/test_pages.py +++ b/tests/py/test_pages.py @@ -34,6 +34,10 @@ def browse(self, setup=None, **kw): address = result.payment_method.token exchange_id = self.make_exchange('braintree-cc', 19, 0, alice, address=address) + # for npm page + self.db.run("INSERT INTO packages (package_manager, name, description, emails) " + "VALUES ('npm', 'foo-package', 'A package', ARRAY[]::text[])") + if setup: setup(alice) i = len(self.client.www_root) @@ -44,6 +48,7 @@ def browse(self, setup=None, **kw): .replace('/~/%username/', '/~alice/') \ .replace('/for/%slug/', '/for/wonderland/') \ .replace('/%platform/', '/github/') \ + .replace('/%package/', '/foo-package/') \ .replace('/%user_name/', '/gratipay/') \ .replace('/%to', '/1') \ .replace('/%country', '/TT') \ diff --git a/www/assets/gratipay.css.spt b/www/assets/gratipay.css.spt index a782bb8ebc..d0d63664a2 100644 --- a/www/assets/gratipay.css.spt +++ b/www/assets/gratipay.css.spt @@ -67,5 +67,6 @@ @import "scss/pages/giving"; @import "scss/pages/settings"; @import "scss/pages/on-confirm"; +@import "scss/pages/on-npm-foo"; @import "scss/pages/search"; @import "scss/pages/hall-of-fame"; diff --git a/www/assets/npm-n.png b/www/assets/npm-n.png new file mode 100644 index 0000000000..9e1525f05a Binary files /dev/null and b/www/assets/npm-n.png differ diff --git a/www/assets/npm-wombat-typing.svg b/www/assets/npm-wombat-typing.svg new file mode 100644 index 0000000000..0695eee092 --- /dev/null +++ b/www/assets/npm-wombat-typing.svg @@ -0,0 +1,194 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/www/on/npm/%package/index.html.spt b/www/on/npm/%package/index.html.spt new file mode 100644 index 0000000000..57fd4819cc --- /dev/null +++ b/www/on/npm/%package/index.html.spt @@ -0,0 +1,34 @@ +import requests + +from aspen import Response +from gratipay.utils import markdown +[---] +package_name = request.path['package'] +package = website.db.one("select * from packages where package_manager='npm' " + "and name=%s", (package_name,)) +if package is None: + raise Response(404) +banner = 'npm' +title = package_name +page_id = "on-npm-foo" +suppress_sidebar = True +url = 'https://npmjs.com/package/' + package.name +[---] +{% extends "templates/base.html" %} + +{% block banner %} + +
+ + +
+ {{ super () }} +
+{% endblock %} + +{% block content %} +

{{ package.description }}

+{{ url }} + + +{% endblock %} diff --git a/www/on/npm/index.html.spt b/www/on/npm/index.html.spt new file mode 100644 index 0000000000..e751da7303 --- /dev/null +++ b/www/on/npm/index.html.spt @@ -0,0 +1,9 @@ +[---] +title = "Search npm" +suppress_sidebar = True +website.redirect('/') # nothing here yet +[---] +{% extends "templates/base.html" %} +{% block content %} + +{% endblock %}