Skip to content

Commit b8262fc

Browse files
committed
Make the final page more usable with a big button on the right hand side. Also add logout link.
1 parent 833313a commit b8262fc

4 files changed

Lines changed: 35 additions & 8 deletions

File tree

samples/appengine/app.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,9 @@ runtime: python
44
api_version: 1
55

66
handlers:
7+
- url: /static
8+
static_dir: static
9+
710
- url: .*
811
script: main.py
12+

samples/appengine/main.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020

2121
import httplib2
22+
import logging
2223
import os
2324

2425
from apiclient.discovery import build
@@ -33,7 +34,7 @@
3334
from google.appengine.ext.webapp import util
3435
from google.appengine.ext.webapp.util import login_required
3536

36-
STEP2_URI = 'http://m-buzz.appspot.com/auth_return'
37+
STEP2_URI = 'http://%s.appspot.com/auth_return' % os.environ['APPLICATION_ID']
3738

3839

3940
class Flow(db.Model):
@@ -57,9 +58,15 @@ def get(self):
5758
http = c.credentials.authorize(http)
5859
p = build("buzz", "v1", http=http)
5960
activities = p.activities()
60-
activitylist = activities.list(scope='@self', userId='@me')
61+
activitylist = activities.list(scope='@consumption', userId='@me')
62+
logging.info(activitylist)
6163
path = os.path.join(os.path.dirname(__file__), 'welcome.html')
62-
self.response.out.write(template.render(path, activitylist))
64+
logout = users.create_logout_url('/')
65+
self.response.out.write(
66+
template.render(
67+
path, {'activitylist': activitylist,
68+
'logout': logout
69+
}))
6370
else:
6471
flow = FlowThreeLegged(buzz_discovery,
6572
consumer_key='anonymous',

samples/appengine/static/go.png

1.11 KB
Loading

samples/appengine/welcome.html

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,29 @@
11
<html>
22
<head>
33
<title>Buzz Stuff</title>
4+
<style type=text/css>
5+
td { vertical-align: top; padding: 0.5em }
6+
img { border:0 }
7+
</style>
48
</head>
59
<body>
6-
7-
<ul>
8-
{% for item in items %}
9-
<li>{{ item.object.content }}</li>
10+
<p><a href="{{ logout }}">Logout</a></p>
11+
<table border=0>
12+
{% for item in activitylist.items %}
13+
<tr valign=top>
14+
<td>
15+
<a href="{{ item.actor.profileUrl }}"><img
16+
src="{{ item.actor.thumbnailUrl }}"></a><br>
17+
<a href="{{ item.actor.profileUrl }}">{{ item.actor.name }}</a></td>
18+
<td>
19+
{{ item.object.content }}
20+
</td>
21+
<td>
22+
<a href="{{ item.object.links.alternate.0.href }}"><img
23+
src="/static/go.png"></a>
24+
</td>
25+
</tr>
1026
{% endfor %}
11-
</ul>
27+
</table>
1228
</body>
1329
</html>

0 commit comments

Comments
 (0)