Permalink
Browse files

dig that funky sound

  • Loading branch information...
1 parent d8174bd commit 3cf745b24731141129e16dca097835e80df00b6e @mjording committed May 27, 2010
Showing with 106 additions and 80 deletions.
  1. +3 −0 public/javascripts/blueplate.jquery.js
  2. +1 −1 public/stylesheets/application.css
  3. +10 −2 server.rb
  4. +39 −15 views/layout.erb
  5. +53 −62 views/profile.erb
@@ -1,5 +1,7 @@
(function($) {
+
+
$.fn.bp_task = function(task,settings) {
var config = {
id: 0,
@@ -137,6 +139,7 @@
return this;
}
+
})(jQuery);
@@ -5,7 +5,7 @@ body{font-family:arial;font-size:10pt;}
#page{width:960px;margin:0 auto;}
-#header{position:relative;border-bottom:3px double #ccc;padding:5px;margin:5px 0px 10px;}
+#header{position:relative;border-bottom:3px double #ccc;padding:20px;margin:5px 0px 10px;}
#logo{top:-12px;position:absolute;z-index:2;background:url(/images/blueplate.png) no-repeat;width:100px;height:100px;}
#header h1{float:left;margin:5px 0 0 120px;font-size:24pt;font-family:arial black;color:#2136b3;}
#user{}
View
@@ -10,6 +10,11 @@
class Server < Sinatra::Base
@@config = Configuration
+
+ dir = File.dirname(File.expand_path(__FILE__))
+
+ set :views, "#{dir}/views"
+ set :public, "#{dir}/public"
set :sessions, true
before do
@@ -46,7 +51,7 @@ class Server < Sinatra::Base
#update or record user in mongo
#no need to store key for mongo stored user as we should always have @client.info['screen_name']
- @user = Bluplate::User.find_by_email("#{@client.info[:user_id]}@twitter.com") ? Bluplate::User.find_by_email("#{@client.info[:user_id]}test@twitter.com") : Bluplate::User.create(:userid => "#{@client.info[:user_id]}@twitter.com")
+ @user = Bluplate::User.find_by_email("#{@client.info['user_id']}@twitter.com") ? Bluplate::User.find_by_email("#{@client.info['user_id']}@twitter.com") : Bluplate::User.create(:userid => "#{@client.info['user_id']}@twitter.com")
#@s = mongo["users"].find("name" => @client.info['screen_name']).first
#@account = s && s.class == OrderedHash ? Account.new(s) : Account.new(:name => @client.info['screen_name'])
#@account.last_login_at = Time.now
@@ -75,7 +80,10 @@ class Server < Sinatra::Base
end
get '/profile' do
@s = @client.all_friends
- #@account ||= Account.new mongo["users"].find("name" => @client.info['screen_name']).first
+ #@client_user_id = @client.info || "me"
+ @client_user_name = @client.info['name']
+ @client_user_profile_image = @client.info['profile_image_url']
+ @client_user_location = @client.info['location']
erb :profile
end
get '/ping' do
View
@@ -7,9 +7,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Today's Blue Plate Special</title>
- <meta name="generator" content="TextMate http://macromates.com/">
<meta name="author" content="Adam Singer">
- <!-- Date: 2010-05-22 -->
<link rel="stylesheet" href="stylesheets/application.css" type="text/css" media="screen" title="no title" charset="utf-8">
<link rel="stylesheet" href="stylesheets/jquery.tweet.css" type="text/css" media="screen" title="no title" charset="utf-8">
<link rel="stylesheet" href="stylesheets/facebox.css" type="text/css" media="screen" title="no title" charset="utf-8">
@@ -22,9 +20,29 @@
<!--<script src="javascripts/jquery.tweet.js" type="text/javascript" charset="utf-8"></script>-->
<script src="javascripts/facebox.js" type="text/javascript" charset="utf-8"></script>
- <script type="text/javascript" charset="utf-8">
-
- $(document).ready(function() {
+<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"> </script>
+ <script type="text/javascript" charset="utf-8">
+function getAddress(lat,lng){
+ var geocoder = new google.maps.Geocoder();
+
+ geocoder.geocode({'latLng': new google.maps.LatLng(lat,lng)}, function(results, status){
+ $("#user .location").html( results[1].formatted_address );
+ });
+
+};
+</script>
+
+</head>
+ <body>
+ <div id="page">
+
+
+ <%= yield %>
+ </div>
+ </body>
+ <script type="text/javascript" charset="utf-8">
+
+ // $(document).ready(function() {
var user = JSON.parse('{"email":"adam@artforge.com","name":"Adam Singer","location":"New York, NY"}')
var contacts = JSON.parse('[{"email":"adam@artforge.com","name":"Adam Singer","location":"New York, NY","tasks":0},{"email":"aminharis7@gmail.com","name":"Haris Amin","location":"Brooklyn, NY","tasks":0},{"email":"mjording@gmail.com","name":"Matt Jording","location":"Brooklyn, NY","tasks":0}]')
var tasks = JSON.parse('[{"id":"GUID1","description":"This is something I need to do!"},{"id":"GUID2","description":"This is another thing I need to do!"},{"id":"GUID1","description":"This is something I need to do!"},{"id":"GUID2","description":"This is another thing I need to do!"},{"id":"GUID1","description":"This is something I need to do!"},{"id":"GUID2","description":"This is another thing I need to do!"}]');
@@ -35,7 +53,7 @@
$("#contacts .contact").live("click",sendDirectMessage)
// twitterSearch("#hackdisrupt",8);
- });
+ // });
function sendDirectMessage(){
var user = $(this).data("user");
@@ -77,9 +95,14 @@
}
function loadUser(user){
- $("#avatar").attr("src",gravatar_url(user.email,50));
- $("#user .username").html(user.name);
- $("#user .location").html(user.location);
+ // $("#avatar").attr("src",gravatar_url(user.email,50));
+ // $("#user .username").html(user.name);
+ // $("#user .location").html(user.location);
+ var lal = $("#user .location").html().split(',');
+ var latlong = $.map( lal, function(a){
+ return a / 1;
+ });
+ getAddress(latlong[0],latlong[1]);
}
function twitterSearch(searchTerm, results){
@@ -118,12 +141,13 @@
}
}
-
- </script>
+
+
+
+
+
+
-</head>
- <body>
- <%= yield %>
- </body>
+ </script>
</html>
View
@@ -1,67 +1,58 @@
-<div id="pagehead">
-<%#= @account.name %>
-</div>
-<div class="action_header">
- <div id="inbox_action_header" class="container_column">
-
- <a href="#" id="add_item_form_trigger" class="active_action_trigger">Add Item</a>
+ <div id="header">
+ <div id="logo"></div>
+ <h1>Blue Plate</h1>
+ <div id="user" class="fr">
+
+ <img id="avatar" class="fl" src="<%= @client_user_profile_image %>" style="vertical-align:top;">
+ <div class="info fl">
+ Welcome <span class="username"><%= @client_user_name %></span><br/>
+ From <span class="location"><%= @client_user_location %></span><br/>
+ <a href="#">Logout</a>
+ </div>
+ <div class="clr"></div>
+ </div>
+ <div class="clr"></div>
+ </div>
-
- </div>
- <div id="workstream_action_header" class="container_column">
- <a href="#" id="s"></a>
- </div>
- <div id="contacts_action_header" class="container_column">
-
- <a href="#" id="add_contact_form_trigger" class="active_action_trigger">Add Contact</a>
-
-
- </div>
+<div id="inbox" class="fl list_module">
+ <h2>Inbox</h2>
+ <div class="items"></div>
</div>
- <div id="action_content">
- <div id="new_item_form_container">
- <form name="new_item_form" id="new_item">
- <textarea tabindex="1" autocomplete="off" accesskey="u" name="work_item" id="workitem" rows="3" cols="25"></textarea>
- <input type="hidden" value="<%#= @account.name %>" id="author">
-
- <input type="submit" value="Add">
-
- </form>
- </div>
-
-</div>
-<div class="active_mods">
- <div id="inbox_column" class="container_column list_container">
-
+ <div id="tickets" class="fl list_module">
+ <h2>On your plate</h2>
+ <div class="items"></div>
+ </div>
+
+ <div class="fr">
+ <div id="contacts" class="list_module last">
+ <h2>Contacts</h2>
+ <div class="items">
+ <%# @s.each_with_index do |item, ind|%>
+ <%# @account.inbox.each_with_index do |item, ind| %>
+ <%#= item["screen_name"] %>
- <h2 class="column_header">INBOX</h2>
- <ul id="inbox" class="ui-droppable">
- <%# @s.each_with_index do |item, ind|%>
- <%# @account.inbox.each_with_index do |item, ind| %>
- <li class="weight_one ui-draggable" dds="<%#=ind%>" style="cursor: pointer;"><%#= item["screen_name"] %></li>
-
- <%# end %>
- </ul>
- </div>
- <div id="workstream_column" class="container_column list_container">
- <h2 class="column_header">WORKSTREAM</h2>
- <ul id="workstream" class="ui-droppable">
-
- <%# @account.work_stream.each do |item| %>
- <li class="ui-draggable" dds="<%#=item.inbox_order_number%>" style="cursor: pointer;">><%#= ticket.subject %></li>
- <%# end %>
- </ul>
- </div>
- <div id="contacts_column" class="container_column list_container">
- <h2 class="column_header">CONTACTS</h2>
- <ul id="contacts">
- <% @s.each_with_index do |item, ind|%>
- <%# @account.inbox.each_with_index do |item, ind| %>
- <li class="weight_one ui-draggable" dds="<%=ind%>" style="cursor: pointer;"><%= item["screen_name"] %></li>
-
- <% end %>
- </ul>
- </div>
- </div>
+ <%# end %>
+
+
+ </div>
+ </div>
+ <div id="trash" class="list_module last">
+ <div id="trashbin" class="items"></div>
+ </div>
+ </div>
+
+ <!-- <div id="query" class="query list_module fl" style="width:400px;"></div> -->
+
+ <div id="hidden_templates" style="display:none;">
+ <div class="task corner-all-5">
+ <div class="source_icon"></div>
+ <div class="subject"></div>
+ </div>
+
+ <div class="contact">
+ <div class="task_indicator"><span>0</span></div>
+ <div class="image"></div>
+ </div>
+ </div>

0 comments on commit 3cf745b

Please sign in to comment.