Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

add gravatar and logout

  • Loading branch information...
commit 5fb6431be34340ef1f4d77dff7527de2d5117d7c 1 parent 21290c8
Matthew Fong mfong authored
Showing with 22 additions and 3 deletions.
  1. +22 −3 webroot/index.php
25 webroot/index.php
View
@@ -22,7 +22,6 @@
// make the getUser call
$USER = $wq->getUser( $_SESSION['userId'] ); // ID of the user (Required)
-
}
@@ -45,6 +44,11 @@
.topbar .fill {
height: 40px;
+ color: #ddd;
+}
+
+.topbar input {
+ height: 27px; //hax
}
.hero-unit {
@@ -117,6 +121,13 @@
.answerExplanation {
margin-top: 35px;
}
+
+.gravatar {
+ width: 30px;
+ height: 30px;
+ margin-right: 10px;
+ vertical-align: top;
+}
</style>
<script src="static/js/jquery-1.7.1.min.js" type="text/javascript"></script>
@@ -246,10 +257,17 @@ function displayQuestion(data) {
<div class="topbar">
<div class="fill">
<div class="container">
- <form id="user" action="" class="pull-right">
+ <?if ($USER["userId"]) { ?>
+ <form id="userx" action="?logout=true" method="post" class="pull-right">
+ <img class="gravatar" src="http://www.gravatar.com/avatar/<?=$USER["gravatarHash"]?>" /> Hey <?=$USER["userId"]?>
+ <button class="btn" type="submit">Log Out</button>
+ </form>
+ <?} else {?>
+ <form id="userx" action="" method="post" class="pull-right">
<input id="userId" class="input-big" type="text" name="userId" placeholder="Email">
- <button class="btn" type="submit">Sign in</button>
+ <button class="btn" type="submit">Sign In</button>
</form>
+ <?}?>
</div>
</div>
</div>
@@ -268,6 +286,7 @@ function displayQuestion(data) {
<div class="lightbulbCont">
<div class="lightbulb"></div>
</div>
+ <h4>You have helped donate <span id="wattCount"><?=$USER["totalWatts"]?></span> watts!</h4>
</div>
</div>
<? } else { ?>
Please sign in to comment.
Something went wrong with that request. Please try again.