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 + + +
+ +