diff --git a/resources/img/facebook_signin.png b/resources/img/facebook_signin.png new file mode 100644 index 0000000..ad13e79 Binary files /dev/null and b/resources/img/facebook_signin.png differ diff --git a/resources/style.css b/resources/style.css index 91c4a61..006f850 100644 --- a/resources/style.css +++ b/resources/style.css @@ -22,6 +22,9 @@ .search-pubDate { color: dimgrey; } +.userbox { + float: right; +} .username { color: lime; } diff --git a/src/facebook.opa b/src/facebook.opa index e6553f1..142b84c 100644 --- a/src/facebook.opa +++ b/src/facebook.opa @@ -65,14 +65,9 @@ Please re-run your application with: --fb-config option") xhtml = login_url = FBA.user_login_url([], redirect) - WBootstrap.Button.make( - { button: - Connect with Facebook - Facebook - , callback: function(_) { Client.goto(login_url) } - }, - [] - ) + + + function login(token) { match (FBA.get_token_raw(token, redirect)) { diff --git a/src/webshell.opa b/src/webshell.opa index d3db75a..f9159cd 100644 --- a/src/webshell.opa +++ b/src/webshell.opa @@ -60,9 +60,7 @@ function login_box() { function block(content) {

{content} } - login = - prompt = You can sign in with: - block(<>{prompt}{FacebookConnect.xhtml}) + login = <>{FacebookConnect.xhtml} logout = function do_logout(_) { Login.set_current_user({guest}) @@ -71,10 +69,12 @@ function login_box() { name = {Login.get_current_user_name()} button = WBootstrap.Button.make({ button: <>Logout, callback: do_logout}, []) block(<>{button}{name}) - match (Login.get_current_user()) { - case {guest}: login - default: logout - } + content = + match (Login.get_current_user()) { + case {guest}: login + default: logout + } + {content} } function page() {