Skip to content
This repository has been archived by the owner on Feb 8, 2018. It is now read-only.

Commit

Permalink
Stub out /on/npm/foo/
Browse files Browse the repository at this point in the history
  • Loading branch information
chadwhitacre committed Nov 30, 2016
1 parent 596944b commit 1aebd3a
Show file tree
Hide file tree
Showing 7 changed files with 250 additions and 0 deletions.
7 changes: 7 additions & 0 deletions scss/pages/on-npm-foo.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#on-npm-foo {
#content {
a {
font-family: $Mono;
}
}
}
5 changes: 5 additions & 0 deletions tests/py/test_pages.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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') \
Expand Down
1 change: 1 addition & 0 deletions www/assets/gratipay.css.spt
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Binary file added www/assets/npm-n.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
194 changes: 194 additions & 0 deletions www/assets/npm-wombat-typing.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions www/on/npm/%package/index.html.spt
Original file line number Diff line number Diff line change
@@ -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 %}
<a class="elsewhere" href="{{ url }}">
<div class="avatar">
<img src="{{ website.asset('npm-wombat-typing.svg') }}" class="avatar">
<img class="platform" src="{{ website.asset('npm-n.png') }}" />
</div>
{{ super () }}
</a>
{% endblock %}

{% block content %}
<p><i>{{ package.description }}</i></p>
<a href="{{ url }}">{{ url }}</a>


{% endblock %}
9 changes: 9 additions & 0 deletions www/on/npm/index.html.spt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[---]
title = "Search npm"
suppress_sidebar = True
website.redirect('/') # nothing here yet
[---]
{% extends "templates/base.html" %}
{% block content %}
<input type="text" name="q"> <button class="selected">Search</button>
{% endblock %}

0 comments on commit 1aebd3a

Please sign in to comment.