diff --git a/app/controllers/status_messages_controller.rb b/app/controllers/status_messages_controller.rb index 23a2b342f..063a3ba79 100644 --- a/app/controllers/status_messages_controller.rb +++ b/app/controllers/status_messages_controller.rb @@ -4,6 +4,7 @@ class StatusMessagesController < ApplicationController def index @status_messages = StatusMessage.criteria.all.order_by( [:created_at, :desc] ) @friends = Friend.all + @posts = Post.stream respond_to do |format| format.html diff --git a/app/helpers/dashboard_helper.rb b/app/helpers/dashboard_helper.rb index d06bca135..3a3b0bfea 100644 --- a/app/helpers/dashboard_helper.rb +++ b/app/helpers/dashboard_helper.rb @@ -1,7 +1,8 @@ module DashboardHelper - - - + def type_partial(post) + class_name = post.class.name.to_s.underscore + "#{class_name.pluralize}/pane" + end end diff --git a/app/views/blogs/_pane.html.haml b/app/views/blogs/_pane.html.haml new file mode 100644 index 000000000..a5270a1b2 --- /dev/null +++ b/app/views/blogs/_pane.html.haml @@ -0,0 +1,11 @@ +%li.message + %span.from + = link_to post.owner, "#" + %b wrote a new blog post + %br + %b= post.title + %br + = post.body + %div.time + = "#{time_ago_in_words(post.updated_at)} ago" + diff --git a/app/views/blogs/index.html.haml b/app/views/blogs/index.html.haml index 40eccd014..655aa67eb 100644 --- a/app/views/blogs/index.html.haml +++ b/app/views/blogs/index.html.haml @@ -1,17 +1,5 @@ -- title "Blogs" +%h1= link_to "new blog", new_blog_path -%table - %tr - %th Title - %th Body - %th Owner +%ul#stream - for blog in @blogs - %tr - %td= blog.title - %td= blog.body - %td= blog.owner - %td= link_to 'Show', blog - %td= link_to 'Edit', edit_blog_path(blog) - %td= link_to 'Destroy', blog, :confirm => 'Are you sure?', :method => :delete - -%p= link_to "New Blog", new_blog_path + = render "pane", :post => blog diff --git a/app/views/bookmarks/_pane.html.haml b/app/views/bookmarks/_pane.html.haml new file mode 100644 index 000000000..8526bb91b --- /dev/null +++ b/app/views/bookmarks/_pane.html.haml @@ -0,0 +1,9 @@ +%li.message + %span.from + = link_to post.owner, "#" + %b shared a link + %br + = post.title + = link_to post.link + %div.time= "#{time_ago_in_words(post.updated_at)} ago" + diff --git a/app/views/bookmarks/index.html.haml b/app/views/bookmarks/index.html.haml index c4ac79f65..4380e370a 100644 --- a/app/views/bookmarks/index.html.haml +++ b/app/views/bookmarks/index.html.haml @@ -1,17 +1,5 @@ -- title "Bookmarks" +%h1= link_to "new bookmark", new_bookmark_path -%table - %tr - %th Title - %th Link - %th Owner +%ul#stream - for bookmark in @bookmarks - %tr - %td= bookmark.title - %td= link_to bookmark.link, bookmark.link - %td= bookmark.owner - %td= link_to 'Show', bookmark - %td= link_to 'Edit', edit_bookmark_path(bookmark) - %td= link_to 'Destroy', bookmark, :confirm => 'Are you sure?', :method => :delete - -%p= link_to "New Bookmark", new_bookmark_path + = render "pane", :post => bookmark diff --git a/app/views/dashboard/index.html.haml b/app/views/dashboard/index.html.haml index 1c60dc8e2..3a892c651 100644 --- a/app/views/dashboard/index.html.haml +++ b/app/views/dashboard/index.html.haml @@ -1,9 +1,4 @@ -- title "Dashboard" - - +%h1 your network stream %ul#stream - for post in @posts - %li - = render "shared/post", :post =>post - /= post.inspect - + = render type_partial(post), :post => post diff --git a/app/views/devise/sessions/new.html.haml b/app/views/devise/sessions/new.html.haml index 43cd65929..f560b84b6 100644 --- a/app/views/devise/sessions/new.html.haml +++ b/app/views/devise/sessions/new.html.haml @@ -1,16 +1,12 @@ -%h2 Sign in -= form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f| - %p - = f.label :email - %br/ +%div.centered + + = form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f| = f.text_field :email - %p - = f.label :password - %br/ + %br = f.password_field :password - - if devise_mapping.rememberable? %p - = f.check_box :remember_me - = f.label :remember_me - %p= f.submit "Sign in" -= render :partial => "devise/shared/links" + - if devise_mapping.rememberable? + = f.check_box :remember_me + = f.label :remember_me + = f.submit "Sign in" + = render :partial => "devise/shared/links" diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index c4f0a6866..856c72e99 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -14,33 +14,63 @@ = javascript_include_tag 'socket' = csrf_meta_tag = yield(:head) - + + :javascript + $(document).ready(function(){ + $('a').hover(function(){ + $(this).fadeTo(60, 0.5); + }, function(){ + $(this).fadeTo(80, 1); + }); + $('ul.nav li').hover(function(){ + $(this).fadeTo(60, 0.5); + }, function(){ + $(this).fadeTo(80, 1); + }); + }); + + %body - #header - .container - %a#diaspora_text{:href => root_path} - %img{:src => '/images/diaspora.png'} + %header + %a#diaspora_text{:href => root_path} + %img{:src => '/images/diaspora_white.png'} - #session_action - - if user_signed_in? - = link_to "log out", destroy_user_session_path - - else - = link_to "login", new_user_session_path - - %ul.nav - %li= link_to "Home", root_path - %li= link_to "Users", users_path - %li= link_to "Status Messages", status_messages_path - %li= link_to "Friends", friends_path - %li= link_to "Bookmarks", bookmarks_path - %li= link_to "Blogs", blogs_path + #session_action + - if user_signed_in? + =User.first.email + | + = link_to "logout", destroy_user_session_path + - else + = link_to "login", new_user_session_path + + #header_below + - if user_signed_in? + %h1#user_name + = link_to User.first.email, root_url + %span.description + - if StatusMessage.my_newest + = StatusMessage.my_newest.message - .container - - if show_title? - %h2= yield(:title) - - flash.each do |name, msg| - = content_tag :div, msg, :id => "flash_#{name}" + %nav + %ul.nav + %a{ :href => root_path, :title => "Your network stream."} + %li home + %a{ :href => users_path, :title => "Registered users on your seed."} + %li users + %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 + %a{ :href => friends_path, :title => "Your list of connections with other seeds."} + %li friends + + - flash.each do |name, msg| + = content_tag :div, msg, :id => "flash_#{name}" + + #content = yield #debug - .msg + .msg \ No newline at end of file diff --git a/app/views/status_messages/_pane.html.haml b/app/views/status_messages/_pane.html.haml new file mode 100644 index 000000000..f523dc703 --- /dev/null +++ b/app/views/status_messages/_pane.html.haml @@ -0,0 +1,7 @@ +%li.message + %span.from + = link_to post.owner, "#" + = post.message + %div.time + = "#{time_ago_in_words(post.updated_at)} ago" + diff --git a/app/views/status_messages/index.html.haml b/app/views/status_messages/index.html.haml index e9092b740..c6518c4d3 100644 --- a/app/views/status_messages/index.html.haml +++ b/app/views/status_messages/index.html.haml @@ -1,20 +1,5 @@ -- title "Home" - -%h3 Your latest message -%h2= my_latest_message - -%br -%br -%br - -%h3 Messages -%ul +%h1.big_text= link_to "new status message", new_status_message_path +%ul#stream - for status_message in @status_messages - %li - = "#{status_message.message} by #{status_message.owner} #{time_ago_in_words(status_message.created_at)} ago" - = link_to 'Show', status_message - | - =link_to 'Destroy', status_message, :confirm => 'Are you sure?', :method => :delete + = render "pane", :post => status_message - -%p= link_to "New Status Message", new_status_message_path diff --git a/public/images/diaspora_white.png b/public/images/diaspora_white.png new file mode 100644 index 000000000..2a7260ea4 Binary files /dev/null and b/public/images/diaspora_white.png differ diff --git a/public/images/mocks/bp.jpeg b/public/images/mocks/bp.jpeg new file mode 100644 index 000000000..33f75aa04 Binary files /dev/null and b/public/images/mocks/bp.jpeg differ diff --git a/public/images/mocks/user_pic.jpeg b/public/images/mocks/user_pic.jpeg new file mode 100644 index 000000000..4732d561e Binary files /dev/null and b/public/images/mocks/user_pic.jpeg differ diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index cafb31d14..c4d8f9a0a 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -1,13 +1,13 @@ -a { - color: #1981f7; - text-decoration: none; - border-bottom: dotted 1px #999999; } +body { + font-family: "helvetica", "arial", "sans-serif"; + padding: 2em; + margin: 0; } -h1, -h2, -h3, -h4 { - text-shadow: 1px 1px 1px #eaeaea; } +a { + color: #cc1e14; + text-decoration: none; } + a:hover { + color: #cc1e14; } #flash_notice, #flash_error, @@ -48,31 +48,138 @@ h4 { .error_messages ul { margin: 0; } -#header { - padding-top: 1em; - padding-bottom: 1em; - margin-bottom: 1em; } - #header #diaspora_text { - border: none; } - #header #session_action { - float: right; } - #header ul.nav { - padding: 0; - margin: 0; - display: block; } - #header ul.nav li { - display: inline; - margin-right: 1em; } +header { + z-index: 10; + position: fixed; + width: 100%; + margin-top: -2em; + margin-right: -2em; + margin-left: -2em; + height: 30px; + color: white; + background-color: #1a1a21; + border-bottom: 2px solid #f2f8fc; + padding-top: 5px; } + header #diaspora_text { + position: fixed; + border: none; + top: 8px; + left: 1em; } + header #session_action { + position: fixed; + right: 1em; + font-size: 120%; + top: 7px; } + header #session_action a { + color: #cccccc; + border: none; } + +ul.nav { + position: absolute; + padding: 0; + margin: 0; + width: 200px; + top: 100px; + font-size: 130%; } + ul.nav li { + display: block; + padding: 5px 10px; + background-color: #f2f8fc; + border: 1px solid white; } + ul.nav li:first-child { + border-top-right-radius: 5px; + border-top-left-radius: 5px; } + ul.nav li:last-child { + border-bottom-right-radius: 5px; + border-bottom-left-radius: 5px; } + ul.nav a { + color: #b1cfe3; } + +#header_below { + z-index: 5; + position: fixed; + height: 40px; + width: 100%; + padding: 1em; + padding-top: 40px; + top: 0; + background-color: rgba(255, 255, 255, 0.9); + margin-left: -2em; } + #header_below img { + position: absolute; + width: 200px; + border-radius: 5px; } + +#content { + position: absolute; + left: 250px; + top: 94px; + width: 60%; + min-width: 500px; + max-width: 700px; } ul#stream { margin: 0; padding: 0; - list-style: none; } - ul#stream li { - list-style: none; } + color: #666666; } ul#stream > li { - padding: 2em 0; - border-bottom: 1px solid #666666; } - ul#stream > li > ul { - padding: 0; - margin: 0; } + list-style: none; + padding: 1em; + border-bottom: 1px solid #f1f1f1; } + +li.message { + line-height: 140%; + font-size: 120%; + font-family: "Lucida Grande"; + color: #999999; } + li.message span.from { + color: black; + font-weight: bold; + margin-right: 0.2em; } + li.message div.time { + color: #bababa; + font-size: 70%; } + +h1 { + position: relative; + font-size: 24px; + font-weight: bold; + line-height: 36px; } + h1 p.description, h1 span.description { + font-weight: 200; + font-family: "helvetica neue", "lucida grande", "sans-serif"; + color: #999999; + padding: 0.1em; } + +.big_number { + font-weight: bold; + font-size: 500%; + line-height: 100%; } + +h3 { + position: relative; + font-size: 18px; + font-weight: bold; } + +#publish input#thought { + font-size: 30px; + padding: 7px; + border-radius: 5px; + width: 100%; + margin-bottom: 1em; } + +form { + font-size: 130%; + margin: 1em; + margin-left: 0em; } + form input { + font-size: 150%; + padding: 0.2em; + max-width: 100%; } + +#user_name { + background-color: rgba(255, 255, 255, 0.5); } + #user_name a { + color: black; } + #user_name a:hover { + color: #cc1e14; } diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass index bdac89c04..d4c837e00 100644 --- a/public/stylesheets/sass/application.sass +++ b/public/stylesheets/sass/application.sass @@ -1,16 +1,14 @@ +body + :font + :family 'helvetica', 'arial', 'sans-serif' + :padding 2em + :margin 0 a - :color #1981f7 + :color #CC1E14 :text :decoration none - :border - :bottom dotted 1px #999 - -h1, -h2, -h3, -h4 - :text-shadow 1px 1px 1px #eaeaea - + &:hover + :color #CC1E14 #flash_notice, #flash_error, @@ -53,44 +51,178 @@ h4 ul :margin 0 -#header - :padding - :top 1em - :bottom 1em +header + :z-index 10 + + :position fixed + :width 100% + :margin - :bottom 1em + :top -2em + :right -2em + :left -2em + + :height 30px + :color #fff + :background + :color #1A1A21 + :border + :bottom 2px solid #F2F8FC + :padding + :top 5px #diaspora_text + :position fixed :border none - + :top 8px + :left 1em #session_action - :float right + :position fixed + :right 1em + :font + :size 120% + :top 7px + a + :color #ccc + :border none - ul.nav - :padding 0 - :margin 0 + +ul.nav + :position absolute + :padding 0 + :margin 0 + :width 200px + :top 100px + :font + :size 130% + + li :display block + :padding 5px 10px + :background + :color #F2F8FC + :border 1px solid #fff + - li - :display inline - :margin - :right 1em + &:first-child + :border-top-right-radius 5px + :border-top-left-radius 5px + + &:last-child + :border-bottom-right-radius 5px + :border-bottom-left-radius 5px + + a + :color #B1CFE3 + +#header_below + :z-index 5 + :position fixed + :height 40px + :width 100% + :padding 1em + :top 40px + :top 0 + :background + :color rgba( 255, 255, 255, 0.9) + :margin + :left -2em + img + :position absolute + :width 200px + :border-radius 5px + +#content + :position absolute + :left 250px + :top 94px + :width 60% + :min-width 500px + :max-width 700px ul#stream :margin 0 :padding 0 - :list-style none - - li - :list-style none + :color #666 > li - :padding 2em 0 + :list-style none + :padding 1em :border - :bottom 1px solid #666 + :bottom 1px solid #f1f1f1 - > ul - :padding 0 - :margin 0 +li.message + :line-height 140% + :font + :size 120% + :family 'Lucida Grande' + :color #999 + span.from + :color #000 + :font + :weight bold + :margin + :right 0.2em + + div.time + :color #bababa + :font-size 70% + +h1 + :position relative + :font + :size 24px + :weight bold + :line-height 36px + + p.description, span.description + :font + :weight 200 + :family 'helvetica neue', 'lucida grande', 'sans-serif' + :color #999 + :padding 0.1em + +.big_number + :font + :weight bold + :size 500% + :line-height 100% + +h3 + :position relative + :font + :size 18px + :weight bold + +#publish + input#thought + :font + :size 30px + :padding 7px + :border-radius 5px + :width 100% + :margin + :bottom 1em + +form + :font + :size 130% + :margin 1em + :margin-left 0em + + input + :font + :size 150% + :padding 0.2em + :max-width 100% + +#user_name + a + :color #000 + &:hover + :color #CC1E14 + :background + :color rgba( 255, 255, 255, 0.5) + diff --git a/spec/models/bookmark_spec.rb b/spec/models/bookmark_spec.rb index f46b05dea..4c9ecd9c8 100644 --- a/spec/models/bookmark_spec.rb +++ b/spec/models/bookmark_spec.rb @@ -1,6 +1,6 @@ require File.dirname(__FILE__) + '/../spec_helper' -describe Bookmark do +describe Bookmark do it "should have a link" do bookmark = Factory.build(:bookmark, :link => nil) bookmark.valid?.should be false @@ -61,7 +61,7 @@ describe Bookmark do describe "XML" do it 'should serialize to XML' do Factory.create(:user) - message = Factory.create(:bookmark, :title => "Reddit", :link => "http://reddit.com") + message = Factory.create(:bookmark, :title => "Reddit", :link => "http://reddit.com/") message.to_xml.to_s.should include "Reddit" message.to_xml.to_s.should include "http://reddit.com/" end