From 1aebd3a17d5b523ec094b03e373bae12af82d260 Mon Sep 17 00:00:00 2001 From: Chad Whitacre Date: Tue, 29 Nov 2016 19:31:14 -0500 Subject: [PATCH] Stub out /on/npm/foo/ --- scss/pages/on-npm-foo.scss | 7 ++ tests/py/test_pages.py | 5 + www/assets/gratipay.css.spt | 1 + www/assets/npm-n.png | Bin 0 -> 699 bytes www/assets/npm-wombat-typing.svg | 194 +++++++++++++++++++++++++++++ www/on/npm/%package/index.html.spt | 34 +++++ www/on/npm/index.html.spt | 9 ++ 7 files changed, 250 insertions(+) create mode 100644 scss/pages/on-npm-foo.scss create mode 100644 www/assets/npm-n.png create mode 100644 www/assets/npm-wombat-typing.svg create mode 100644 www/on/npm/%package/index.html.spt create mode 100644 www/on/npm/index.html.spt 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 0000000000000000000000000000000000000000..9e1525f05aae2a5658a70842ca99ca039a0834bc GIT binary patch literal 699 zcmeAS@N?(olHy`uVBq!ia0y~yU<5K585o&?RN5XZRUpNZ?&#~tz_78O`%fY(NVYi0 z-HBn{IhmJ0jzY3WkS_y6l^O#>Lkk1LFQ8Dv3kHT#0|tgy2@DKYGZ+}e3+C(!v;j)6 z1^9%xp0+Um|Np;Iw9{9h2xF4By9?ugCf$2L4rhT!WHAE+w=f7ZGR&GI0Ti_Gba4#H zxcBzdMotC?jsp(gNoI0pNu`cLVp4utswVqIk6S?9nlRnqfKE@$%}um5&@(YL zF*Q}t2nOnP2MNJ62?^;e2Wk?5X#z!?UQ%XBd`fCTNd|+3W@}vlP+k;8J~=-pzbL+> zvLKbgjLmDgHc){yih|6%lGLJ{#N^cY+|-hc{1gU*-`4CsKxHy0%E~iSN-}gZQZv&t zN*D~ybQBEDEUvQg0@Z22)PZBMBEBfK*w)Cx*i=WM5{X@!mswJ5YuKb&WQVK=oT5NZ n$SbimfcQBmH7_N#C^Iiz0V1yXNl*loWEebM{an^LB{Ts5qI1dt literal 0 HcmV?d00001 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 %}