diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 9c7d65c1e..a0e810109 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -37,4 +37,15 @@ module ApplicationHelper link_to person.real_name, person_url(person) end + def owner_picture + default = "#{root_url}images/user/default.jpg" + image = "#{root_url}images/user/#{User.first.profile.last_name.gsub(/ /,'').downcase}.jpg" + + if File.exist?("public/images/user/#{User.first.profile.last_name.gsub(/ /,'').downcase}.jpg") + image_tag image, :id => "user_picture" + else + image_tag default, :id => "user_picture" + end + end + end diff --git a/app/views/friends/_sidebar.html.haml b/app/views/friends/_sidebar.html.haml index 4e35b21b2..6ef5d9073 100644 --- a/app/views/friends/_sidebar.html.haml +++ b/app/views/friends/_sidebar.html.haml @@ -1,8 +1,5 @@ %h3 your friends -%ul#friend_stream +%ul#friend_stream.nav - for friend in @friends - = link_to friend.real_name, friend_path(friend) - %br - %br - %hr - = link_to "add a new friend", new_friend_path + %li= link_to friend.real_name, friend_path(friend) +/= link_to "add a new friend", new_friend_path diff --git a/app/views/js/_google_a_js.haml b/app/views/js/_google_a_js.haml deleted file mode 100644 index d160024f4..000000000 --- a/app/views/js/_google_a_js.haml +++ /dev/null @@ -1,11 +0,0 @@ -:javascript - var _gaq = _gaq || []; - _gaq.push(['_setAccount', 'UA-17207587-1']); - _gaq.push(['_setDomainName', '#{root_url}']); - _gaq.push(['_trackPageview']); - - (function() { - var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; - ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; - var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); - })(); \ No newline at end of file diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index 4a5dd69fa..9fb4674b4 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -5,14 +5,12 @@ = "diaspora " = "- #{User.first.real_name}" if User.first %meta{"http-equiv"=>"Content-Type", :content=>"text/html; charset=utf-8"}/ - %meta{"http-equiv"=> "X-UA-Compatible", :content =>"chrome=1" } = stylesheet_link_tag "blueprint/screen", :media => 'screen' = stylesheet_link_tag "application" /= javascript_include_tag "http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" - = javascript_include_tag 'jquery142', 'rails', 'view', 'publisher' + = javascript_include_tag 'jquery142', 'rails', 'view', 'publisher', 'google_a' = javascript_include_tag 'tiny_mce/tiny_mce', 'jquery.infieldlabel' - = render 'js/google_a_js' = render 'js/websocket_js' = csrf_meta_tag @@ -44,18 +42,16 @@ = link_to User.first.real_name, root_url %span.description = my_latest_message + #content.span-24.last .span-5.append-1.last - = link_to (image_tag "/images/user_picture.jpg", :id => "user_picture"), root_path - - %ul#stream_filters - %a{ :href => status_messages_path, :title => "Recent status messages."} - %li status messages - %a{ :href => bookmarks_path, :title => "Recently shared links."} - %li bookmarks - %a{ :href => blogs_path, :title => "Recent blog posts."} - %li blogs + = link_to owner_picture, root_path + %ul#stream_filters.nav + %li= link_to "status messages", status_messages_path + %li= link_to "bookmarks", bookmarks_path + %li= link_to "blogs", blogs_path = render 'friends/sidebar' if user_signed_in? + .span-18 = yield = render "posts/debug" diff --git a/app/views/shared/_publisher.haml b/app/views/shared/_publisher.haml index fd109b968..e6d41d824 100644 --- a/app/views/shared/_publisher.haml +++ b/app/views/shared/_publisher.haml @@ -32,20 +32,19 @@ .selected { -webkit-border-radius: 5px; + -moz-border-radius: 5px; border: 1px solid #ccc; border-top: 1px solid #333; - -webkit-box-shadow: 0 2px 1px #fff; background-color: rgba( 255, 255, 255, 0.5); + -webkit-box-shadow: 0 2px 1px #fff; + -moz-box-shadow: 0 2px 1px #fff; } #publisher %ul#publisher_content_pickers - %a{ :class => "status_message", :href => '#', :title => "new status message."} - %li{ :class => "selected" } status message - %a{ :class => "bookmark", :href => '#', :title => "new bookmark."} - %li bookmark - %a{ :class => "blog", :href => '#', :title => "new blog post."} - %li blog + %li{ :class => "status_message selected" }= link_to "status message", "#" + %li{ :class => "bookmark" }= link_to "bookmark", "#" + %li{ :class => "blog" }= link_to "blog", "#" #publisher_form = form_for StatusMessage.new, :remote => true do |f| diff --git a/config.ru b/config.ru index 10d1ee578..84859db97 100644 --- a/config.ru +++ b/config.ru @@ -2,4 +2,6 @@ require ::File.expand_path('../config/environment', __FILE__) #use Rack::FiberPool +require 'lib/chrome_frame' +use Rack::ChromeFrame run Diaspora::Application diff --git a/db/seeds/backer.rb b/db/seeds/backer.rb index 57717dffb..f6bbb7cf9 100644 --- a/db/seeds/backer.rb +++ b/db/seeds/backer.rb @@ -48,10 +48,46 @@ def create(backer_number, password) ["Lyndon B.", "Johnson"], ["Richard", "Nixon"] ] - + pin =[5072, + 3742, + 7782, + 2691, + 6133, + 7558, + 8670, + 1559, + 5404, + 6431, + 1957, + 5323, + 8784, + 4267, + 8891, + 2324, + 6948, + 8176, + 6928, + 5677, + 7966, + 2893, + 6828, + 2982, + 6756, + 6658, + 3551, + 3088, + 8379, + 7493, + 2759, + 1029, + 4013, + 8507, + 1508, + 5258] + # Create seed user email = names[backer_number][1].gsub(/ /,'').downcase - user = User.create( :email => "#{email}@joindiaspora.com", :password => "#{password}", :profile => Profile.create( :first_name => names[backer_number][0], :last_name => names[backer_number][1] )) + user = User.create( :email => "#{email}@joindiaspora.com", :password => "#{email+pin[backer_number].to_s}", :profile => Profile.create( :first_name => names[backer_number][0], :last_name => names[backer_number][1] )) # Make friends with Diaspora Tom Friend.create( :email => "tom@joindiaspora.com", :url => "http://tom.joindiaspora.com/", :profile => Profile.create(:first_name => "Diaspora", :last_name => "Tom")) diff --git a/lib/chrome_frame.rb b/lib/chrome_frame.rb new file mode 100644 index 000000000..eeba58312 --- /dev/null +++ b/lib/chrome_frame.rb @@ -0,0 +1,63 @@ +module Rack + class ChromeFrame + + def initialize(app, options={}) + @app = app + @options = options + end + + def call(env) + + if env['HTTP_USER_AGENT'] =~ /MSIE/ + if env['HTTP_USER_AGENT'] =~ /chromeframe/ + status, headers, response = @app.call(env) + new_body = insert_tag(build_response_body(response)) + new_headers = recalculate_body_length(headers, new_body) + return [status, new_headers, new_body] + elsif @options[:minimum].nil? or ie_version(env['HTTP_USER_AGENT']) < @options[:minimum] + html = <<-HTML + + + + + You need to use a real browser in order to use Diaspora! + + +
+ + + + + HTML + return [200, {'Content-Type' => 'text/html', 'Content-Length' => html.size.to_s}, Rack::Response.new([html])] + end + end + @app.call(env) + end + + def build_response_body(response) + response_body = "" + response.each { |part| response_body += part } + response_body + end + + def recalculate_body_length(headers, body) + new_headers = headers + new_headers["Content-Length"] = body.length.to_s + new_headers + end + + def insert_tag(body) + head = <<-HEAD + + HEAD + + body.gsub!('', "\n" + head ) + body + end + + def ie_version(ua_string) + ua_string.match(/MSIE (\S+)/)[1].to_f + end + end +end \ No newline at end of file diff --git a/public/images/black_dandy.jpeg b/public/images/black_dandy.jpeg deleted file mode 100644 index 3cd841378..000000000 Binary files a/public/images/black_dandy.jpeg and /dev/null differ diff --git a/public/images/user/adams.jpeg b/public/images/user/adams.jpeg new file mode 100644 index 000000000..77213feaa Binary files /dev/null and b/public/images/user/adams.jpeg differ diff --git a/public/images/user/buchanan.jpg b/public/images/user/buchanan.jpg new file mode 100644 index 000000000..ff1ebd5d4 Binary files /dev/null and b/public/images/user/buchanan.jpg differ diff --git a/public/images/user/buren.jpg b/public/images/user/buren.jpg new file mode 100644 index 000000000..377246b66 Binary files /dev/null and b/public/images/user/buren.jpg differ diff --git a/public/images/user/default.jpg b/public/images/user/default.jpg new file mode 100644 index 000000000..788fd4f1d Binary files /dev/null and b/public/images/user/default.jpg differ diff --git a/public/images/user/fillmore.jpg b/public/images/user/fillmore.jpg new file mode 100644 index 000000000..c6850dfd3 Binary files /dev/null and b/public/images/user/fillmore.jpg differ diff --git a/public/images/user/harrison.jpg b/public/images/user/harrison.jpg new file mode 100644 index 000000000..c0a328983 Binary files /dev/null and b/public/images/user/harrison.jpg differ diff --git a/public/images/user/jackson.jpg b/public/images/user/jackson.jpg new file mode 100644 index 000000000..0e7386cf5 Binary files /dev/null and b/public/images/user/jackson.jpg differ diff --git a/public/images/user/jefferson.jpg b/public/images/user/jefferson.jpg new file mode 100644 index 000000000..c36dfbc6a Binary files /dev/null and b/public/images/user/jefferson.jpg differ diff --git a/public/images/user/lincoln.jpg b/public/images/user/lincoln.jpg new file mode 100644 index 000000000..a79ea6028 Binary files /dev/null and b/public/images/user/lincoln.jpg differ diff --git a/public/images/user/madison.jpeg b/public/images/user/madison.jpeg new file mode 100644 index 000000000..5de9c288f Binary files /dev/null and b/public/images/user/madison.jpeg differ diff --git a/public/images/user/monroe.jpg b/public/images/user/monroe.jpg new file mode 100644 index 000000000..6169b4db8 Binary files /dev/null and b/public/images/user/monroe.jpg differ diff --git a/public/images/user/pierce.jpg b/public/images/user/pierce.jpg new file mode 100644 index 000000000..f86fdb048 Binary files /dev/null and b/public/images/user/pierce.jpg differ diff --git a/public/images/user/polk.jpg b/public/images/user/polk.jpg new file mode 100644 index 000000000..ca04d3c4d Binary files /dev/null and b/public/images/user/polk.jpg differ diff --git a/public/images/user/quincyadams.jpg b/public/images/user/quincyadams.jpg new file mode 100644 index 000000000..9aac84b25 Binary files /dev/null and b/public/images/user/quincyadams.jpg differ diff --git a/public/images/user/taylor.jpg b/public/images/user/taylor.jpg new file mode 100644 index 000000000..88ca01947 Binary files /dev/null and b/public/images/user/taylor.jpg differ diff --git a/public/images/user/tyler.jpeg b/public/images/user/tyler.jpeg new file mode 100644 index 000000000..2fc566e6b Binary files /dev/null and b/public/images/user/tyler.jpeg differ diff --git a/public/images/user/washington.jpeg b/public/images/user/washington.jpeg new file mode 100644 index 000000000..051615dba Binary files /dev/null and b/public/images/user/washington.jpeg differ diff --git a/public/images/user_picture.jpg b/public/images/user_picture.jpg deleted file mode 100644 index 3cecbc150..000000000 Binary files a/public/images/user_picture.jpg and /dev/null differ diff --git a/public/javascripts/google.js b/public/javascripts/google.js new file mode 100644 index 000000000..b544a8075 --- /dev/null +++ b/public/javascripts/google.js @@ -0,0 +1,10 @@ +var _gaq = _gaq || []; +_gaq.push(['_setAccount', 'UA-17207587-1']); +_gaq.push(['_setDomainName', '.joindiaspora.com']); +_gaq.push(['_trackPageview']); + +(function() { + var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; + ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; + var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); +})(); \ No newline at end of file diff --git a/public/javascripts/publisher.js b/public/javascripts/publisher.js index 144ef8c84..2238670e3 100644 --- a/public/javascripts/publisher.js +++ b/public/javascripts/publisher.js @@ -8,12 +8,12 @@ function selectPicker(event){ event.preventDefault(); - if( $("#new_" + this.className).css("display") == "none" ) { + if( $("#new_" + $(this)[0].classList[0]).css("display") == "none" ) { $("#publisher_content_pickers .selected").removeClass("selected"); $("#publisher_form form").fadeOut(50); - $(this).children("a > li").toggleClass("selected"); - $("#new_" + this.className).delay(50).fadeIn(200); + $(this).toggleClass("selected"); + $("#new_" + $(this)[0].classList[0]).delay(50).fadeIn(200); } } diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index 610c276ca..a374c9b41 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -229,3 +229,6 @@ label { position: absolute; top: 3px; left: 0.48em; } + +ul.nav li > a { + display: block; } diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass index 7a17d7d70..23679c9d8 100644 --- a/public/stylesheets/sass/application.sass +++ b/public/stylesheets/sass/application.sass @@ -271,3 +271,6 @@ label :position absolute :top 3px :left 0.48em + +ul.nav li > a + :display block