Skip to content

Commit

Permalink
Social frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
preddy5 committed Aug 30, 2014
1 parent 33d9e1e commit d6fd426
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
Binary file added bookie/static/images/twitter-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions bookie/templates/accounts/index.mako
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,25 @@ ${account_nav()}

${password_reset(user, reset=False)}

<div class="form">
<div class="heading">Social Profiles</div>
<table>
% if connections:
% for connection in connections:
% if connection.type == 'TwitterConnection':
<tr>
<td style="border: 0px; width: 120px"><img src="/static/images/twitter-icon.png" style="padding: 0 5px;">Twitter</td>
<td style="border: 0px;">Connected as:
<a href="http://twitter.com/${connection.twitter_username}"> @${connection.twitter_username}
</td>
</tr>
% endif
% endfor
% endif
</table>
<a href="/oauth/twitter_connect">Add Twitter Profile</a>
</div>

<div class="form">
<div class="heading"><img src="/static/images/logo.128.svg" style="height: 16px; padding: 0 5px;" alt="Bookie Extensions"/>Extensions</div>
<p>We have browser extensions that work with Bookie for:</p>
Expand Down
4 changes: 4 additions & 0 deletions bookie/views/accounts.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from pyramid.view import view_config

from bookie.lib.access import ReqAuthorize
from bookie.models.social import SocialMgr
from bookie.models.auth import UserMgr

LOG = logging.getLogger(__name__)
Expand All @@ -19,8 +20,11 @@ def account(request):
# if auth fails, it'll raise an HTTPForbidden exception
with ReqAuthorize(request):
user = UserMgr.get(username=request.user.username)
connections = SocialMgr.get_all_connections(
username=request.user.username).all()

return {
'user': user,
'username': user.username,
'connections': connections,
}

0 comments on commit d6fd426

Please sign in to comment.