changeset 41:064d90175c60

added to attendee list
author Atul Varma <avarma@mozilla.com>
date Sat, 26 Jun 2010 17:12:12 -0700
parents f0455bb10528
children 2c48330f60fe
files static-files/anonymous.png static-files/index.html static-files/index.js
diffstat 3 files changed, 129 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
Binary file static-files/anonymous.png has changed
--- a/static-files/index.html	Sat Jun 26 14:03:07 2010 -0700
+++ b/static-files/index.html	Sat Jun 26 17:12:12 2010 -0700
@@ -83,6 +83,68 @@
   .attendee .name {
     font-weight: bold;
   }
+
+  .attendee a {
+    text-decoration: none;
+    color: black;
+  }
+
+  .attendee a:hover {
+    text-decoration: underline;
+  }
+
+  .attendee {
+    position: relative;
+  }
+
+  .attendee .headshot {
+    position: absolute;
+    top: 0px;
+    left: 0px;
+  }
+
+  .attendee .headshot img {
+    width: 48px;
+    height: 48px;
+  }
+
+  .attendee .text-info {
+    position: absolute;
+    top: 0px;
+    left: 52px;
+  }
+
+  .attendee .name {
+    display: inline;
+  }
+
+  .attendee .twitter {
+    display: inline;
+  }
+
+  .attendee .twitter:before {
+    content: " / ";
+  }
+
+  .attendee .bugzilla {
+    padding-top: 0.25em;
+  }
+
+  .attendee .interests {
+    padding-top: 0.25em;
+  }
+
+  .attendee .interests ul {
+    list-style-type: none;
+    margin-left: -3.25em;
+    display: inline;
+  }
+
+  .attendee .interests li {
+    display: inline;
+    color: gray;
+    padding-right: 1em;
+  }
   </style>
 </head>
 <body>
@@ -515,7 +577,13 @@
 </div>
 <div id="templates">
   <div class="attendee">
-    <div class="name"></div>
+    <div class="headshot"><img src="anonymous.png"></div>
+    <div class="text-info">
+      <div class="name"></div>
+      <div class="twitter"></div>
+      <div class="bugzilla">Bugzilla dashboard</div>
+      <div class="interests">Interested in <ul></ul></div>
+    </div>
   </div>
 </div>
 <script src="jquery-1.4.2.min.js"></script>
--- a/static-files/index.js	Sat Jun 26 14:03:07 2010 -0700
+++ b/static-files/index.js	Sat Jun 26 17:12:12 2010 -0700
@@ -162,12 +162,18 @@
       }
     }
 
+    function normalizeUserInfo(userInfo) {
+      if (!(userInfo.interests && jQuery.isArray(userInfo.interests)))
+        userInfo.interests = [];
+    }
+
     function fillUserInfo() {
       var userInfo = Attendees.value[Config.value.userID];
       if (!userInfo)
         userInfo = {};
-      if (!(userInfo.interests && jQuery.isArray(userInfo.interests)))
-        userInfo.interests = [];
+      normalizeUserInfo(userInfo);
+
+      // Fill out the form.
       $(".usr").each(
         function() {
           var prop = this.id.match(/usr_(.+)/)[1];
@@ -179,12 +185,63 @@
           this.checked = (userInfo.interests.indexOf(label) != -1);
         });
 
+      // Build list of all attendees.
       var everyone = $("#everyone-info .attendees");
       everyone.empty();
       for (userID in Attendees.value) {
         var person = Attendees.value[userID];
+        normalizeUserInfo(person);
+
         var elem = $("#templates .attendee").clone();
-        elem.find(".name").text(person.name || "");
+        elem.find(".name").text(person.name || "Anonymous Human");
+        var profileImageURL = person.profileImageURL;
+        if (!profileImageURL && person.twitterScreenName)
+          profileImageURL = ("http://api.twitter.com/1/users/" +
+                             "profile_image/" +
+                             person.twitterScreenName +
+                             ".xml?size=normal");
+
+        if (profileImageURL)
+          elem.find(".headshot img").attr("src", profileImageURL);
+
+        if (person.websiteURL) {
+          var websiteLink = document.createElement("a");
+          websiteLink.href = person.websiteURL;
+          websiteLink.target = "_blank";
+          elem.find(".name").wrapInner(websiteLink);
+        }
+
+        if (person.twitterScreenName) {
+          var twitterLink = document.createElement("a");
+          twitterLink.href = "http://twitter.com/" + person.twitterScreenName;
+          twitterLink.target = "_blank";
+          twitterLink.textContent = "@" + person.twitterScreenName;
+          elem.find(".twitter").append(twitterLink);
+        } else
+          elem.find(".twitter").remove();
+
+        if (person.bugzillaEmail) {
+          var bugzillaLink = document.createElement("a");
+          bugzillaLink.href = ("https://hg.mozilla.org/users/" +
+                               "avarma_mozilla.com/" +
+                               "bugzilla-dashboard/raw-file/v2/" +
+                               "index.html#username=" +
+                               encodeURI(person.bugzillaEmail));
+          bugzillaLink.target = "_blank";
+          elem.find(".bugzilla").wrapInner(bugzillaLink);
+        } else
+          elem.find(".bugzilla").remove();
+
+        if (userInfo.interests.length > 0) {
+          var interests = elem.find(".interests ul");
+          userInfo.interests.forEach(
+            function(interest) {
+              var item = document.createElement("li");
+              item.textContent = interest;
+              interests.append(item);
+            });
+        } else
+          elem.find(".interests").remove();
         everyone.append(elem);
       }
     }