From 93c0dad4fdaf6e62e28c1dbb03e47e959998154f Mon Sep 17 00:00:00 2001
From: Chad Whitacre
Date: Sun, 29 Jul 2012 00:46:18 -0400
Subject: [PATCH] Add buttons to org pages
This was suggested in a comment on #27 as the lowest hanging fruit for
supporting tips to organizations as the sum of tips to people within
that organization.
---
www/github/%login/index.html | 59 +++++++++++++++++++++++++++---------
1 file changed, 44 insertions(+), 15 deletions(-)
diff --git a/www/github/%login/index.html b/www/github/%login/index.html
index 180b3d9dca..f62abb4d4c 100644
--- a/www/github/%login/index.html
+++ b/www/github/%login/index.html
@@ -45,12 +45,13 @@
resp = requests.get("https://api.github.com/orgs/%s/members" % username)
if resp.status_code == 200:
members = json.loads(resp.text)
- can_tip = False
+ can_tip = user.ANON
else:
can_tip = False
tip_or_pledge = "pledge"
nbackers = get_number_of_backers(username)
+members = [(member, get_tip(user.id, member['login'])) for member in members]
# ========================================================================== ^L
{% extends templates/participant.html %}
@@ -73,13 +74,13 @@ {{ username }} has opted out of Gittip.
-
+
{{ name }} has not joined Gittip.
{% if user.ANON %}
-
-
+
Are you {{ userinfo['login'] }} from GitHub?
Click here to opt in to Gittip.
@@ -87,7 +88,7 @@ {{ name }} has not joined Gittip.
{% else %}
-
-
+
Are you {{ userinfo['login'] }} from GitHub?
You’ll have to sign out and sign back in to claim this account.
@@ -116,7 +117,7 @@ There are {{ nbackers }} people ready to give.
your behalf until you ask us to.
Don’t like what you see?
-
+
If you are {{ username }} you can explicitly opt out of Gittip by
locking this account. We don’t allow new pledges to locked
accounts, and we’ll set aside your username on Gittip to prevent
@@ -128,11 +129,14 @@
Don’t like what you see?
{% end %}
{% end %}
{% elif usertype == "organization" %}
-
+
+
{{ name }} is an {{ usertype }} on GitHub.
-
-
+
Gittip is optimized for people at the moment, not organizations.
{% if len(members) == 0 %}
{{ name }} does not have any public members.
@@ -144,24 +148,49 @@ {{ name }} is an {{ usertype }} on GitHub.
+
{% else %}
-
+
Not sure what to do with {{ name }}.
-
-
+
I don’t recognize the “{{ usertype }}” type of user on GitHub.
Sorry. :-(
-
+
+
+ {% end %}
+ {% if user.ANON %}
{% end %}
{% end %}