From 3b86226fdeeaa95a17b1b6e308a4ae8d2d7a3226 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 | 17 +++++++++++++++++ bookie/views/accounts.py | 5 ++++- 3 files changed, 21 insertions(+), 1 deletion(-) 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..be67f678 100644 --- a/bookie/templates/accounts/index.mako +++ b/bookie/templates/accounts/index.mako @@ -101,6 +101,23 @@ ${account_nav()} ${password_reset(user, reset=False)} +
+
Social Profiles
+ + % for connection in connections: + % if connection.type == 'TwitterConnection': + + + + + % endif + % endfor +
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..f6643cda 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,10 @@ 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, }