From d6fd426cade942509f025148e0eb8bcb276bff5c Mon Sep 17 00:00:00 2001 From: pradyumna Date: Sat, 30 Aug 2014 20:01:50 +0530 Subject: [PATCH] Social frontend --- bookie/static/images/twitter-icon.png | Bin 0 -> 482 bytes bookie/templates/accounts/index.mako | 19 +++++++++++++++++++ bookie/views/accounts.py | 4 ++++ 3 files changed, 23 insertions(+) create mode 100644 bookie/static/images/twitter-icon.png diff --git a/bookie/static/images/twitter-icon.png b/bookie/static/images/twitter-icon.png new file mode 100644 index 0000000000000000000000000000000000000000..333cf3a5ed27716e56042549174e1ff048779f18 GIT binary patch literal 482 zcmV<80UiE{P)D))Nr8PdCLCExwp*E#z`=MF1_D^Jzc?0~6bs;e+YG z33L6?RCY{&6TV#P_|O_Pw*-9=fjFu;697o}`3Jhzh2uo)Ib-!y4x%vc)^O$%IJK`S z?Y0FL7T&G02nCh#KW6VTsVn(c$dAllubzj! YUmegFUf literal 0 HcmV?d00001 diff --git a/bookie/templates/accounts/index.mako b/bookie/templates/accounts/index.mako index d8ba87c2..3dd51a63 100644 --- a/bookie/templates/accounts/index.mako +++ b/bookie/templates/accounts/index.mako @@ -101,6 +101,25 @@ ${account_nav()} ${password_reset(user, reset=False)} +
+
Social Profiles
+ + % if connections: + % for connection in connections: + % if connection.type == 'TwitterConnection': + + + + + % endif + % endfor + % endif +
TwitterConnected as: + @${connection.twitter_username} +
+ Add Twitter Profile +
+
Bookie ExtensionsExtensions

We have browser extensions that work with Bookie for:

diff --git a/bookie/views/accounts.py b/bookie/views/accounts.py index caa2861b..694d54ed 100644 --- a/bookie/views/accounts.py +++ b/bookie/views/accounts.py @@ -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__) @@ -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, }