fixed merge with master

This commit is contained in:
maxwell 2010-06-21 14:38:38 -07:00
commit a0417d13af
17 changed files with 412 additions and 162 deletions

View file

@ -4,6 +4,7 @@ class StatusMessagesController < ApplicationController
def index def index
@status_messages = StatusMessage.criteria.all.order_by( [:created_at, :desc] ) @status_messages = StatusMessage.criteria.all.order_by( [:created_at, :desc] )
@friends = Friend.all @friends = Friend.all
@posts = Post.stream
respond_to do |format| respond_to do |format|
format.html format.html

View file

@ -1,7 +1,8 @@
module DashboardHelper module DashboardHelper
def type_partial(post)
class_name = post.class.name.to_s.underscore
"#{class_name.pluralize}/pane"
end
end end

View file

@ -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"

View file

@ -1,17 +1,5 @@
- title "Blogs" %h1= link_to "new blog", new_blog_path
%table %ul#stream
%tr
%th Title
%th Body
%th Owner
- for blog in @blogs - for blog in @blogs
%tr = render "pane", :post => blog
%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

View file

@ -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"

View file

@ -1,17 +1,5 @@
- title "Bookmarks" %h1= link_to "new bookmark", new_bookmark_path
%table %ul#stream
%tr
%th Title
%th Link
%th Owner
- for bookmark in @bookmarks - for bookmark in @bookmarks
%tr = render "pane", :post => bookmark
%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

View file

@ -1,9 +1,4 @@
- title "Dashboard" %h1 your network stream
%ul#stream %ul#stream
- for post in @posts - for post in @posts
%li = render type_partial(post), :post => post
= render "shared/post", :post =>post
/= post.inspect

View file

@ -1,16 +1,12 @@
%h2 Sign in %div.centered
= form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f|
%p = form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f|
= f.label :email
%br/
= f.text_field :email = f.text_field :email
%p %br
= f.label :password
%br/
= f.password_field :password = f.password_field :password
- if devise_mapping.rememberable?
%p %p
= f.check_box :remember_me - if devise_mapping.rememberable?
= f.label :remember_me = f.check_box :remember_me
%p= f.submit "Sign in" = f.label :remember_me
= render :partial => "devise/shared/links" = f.submit "Sign in"
= render :partial => "devise/shared/links"

View file

@ -14,33 +14,63 @@
= javascript_include_tag 'socket' = javascript_include_tag 'socket'
= csrf_meta_tag = csrf_meta_tag
= yield(:head) = 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 %body
#header %header
.container %a#diaspora_text{:href => root_path}
%a#diaspora_text{:href => root_path} %img{:src => '/images/diaspora_white.png'}
%img{:src => '/images/diaspora.png'}
#session_action #session_action
- if user_signed_in? - if user_signed_in?
= link_to "log out", destroy_user_session_path =User.first.email
- else |
= link_to "login", new_user_session_path = link_to "logout", destroy_user_session_path
- else
%ul.nav = link_to "login", new_user_session_path
%li= link_to "Home", root_path
%li= link_to "Users", users_path #header_below
%li= link_to "Status Messages", status_messages_path - if user_signed_in?
%li= link_to "Friends", friends_path %h1#user_name
%li= link_to "Bookmarks", bookmarks_path = link_to User.first.email, root_url
%li= link_to "Blogs", blogs_path %span.description
- if StatusMessage.my_newest
= StatusMessage.my_newest.message
.container %nav
- if show_title? %ul.nav
%h2= yield(:title) %a{ :href => root_path, :title => "Your network stream."}
- flash.each do |name, msg| %li home
= content_tag :div, msg, :id => "flash_#{name}" %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 = yield
#debug #debug
.msg .msg

View file

@ -0,0 +1,7 @@
%li.message
%span.from
= link_to post.owner, "#"
= post.message
%div.time
= "#{time_ago_in_words(post.updated_at)} ago"

View file

@ -1,20 +1,5 @@
- title "Home" %h1.big_text= link_to "new status message", new_status_message_path
%ul#stream
%h3 Your latest message
%h2= my_latest_message
%br
%br
%br
%h3 Messages
%ul
- for status_message in @status_messages - for status_message in @status_messages
%li = render "pane", :post => status_message
= "#{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
%p= link_to "New Status Message", new_status_message_path

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
public/images/mocks/bp.jpeg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 261 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

View file

@ -1,13 +1,13 @@
a { body {
color: #1981f7; font-family: "helvetica", "arial", "sans-serif";
text-decoration: none; padding: 2em;
border-bottom: dotted 1px #999999; } margin: 0; }
h1, a {
h2, color: #cc1e14;
h3, text-decoration: none; }
h4 { a:hover {
text-shadow: 1px 1px 1px #eaeaea; } color: #cc1e14; }
#flash_notice, #flash_notice,
#flash_error, #flash_error,
@ -48,31 +48,138 @@ h4 {
.error_messages ul { .error_messages ul {
margin: 0; } margin: 0; }
#header { header {
padding-top: 1em; z-index: 10;
padding-bottom: 1em; position: fixed;
margin-bottom: 1em; } width: 100%;
#header #diaspora_text { margin-top: -2em;
border: none; } margin-right: -2em;
#header #session_action { margin-left: -2em;
float: right; } height: 30px;
#header ul.nav { color: white;
padding: 0; background-color: #1a1a21;
margin: 0; border-bottom: 2px solid #f2f8fc;
display: block; } padding-top: 5px; }
#header ul.nav li { header #diaspora_text {
display: inline; position: fixed;
margin-right: 1em; } 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 { ul#stream {
margin: 0; margin: 0;
padding: 0; padding: 0;
list-style: none; } color: #666666; }
ul#stream li {
list-style: none; }
ul#stream > li { ul#stream > li {
padding: 2em 0; list-style: none;
border-bottom: 1px solid #666666; } padding: 1em;
ul#stream > li > ul { border-bottom: 1px solid #f1f1f1; }
padding: 0;
margin: 0; } 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; }

View file

@ -1,16 +1,14 @@
body
:font
:family 'helvetica', 'arial', 'sans-serif'
:padding 2em
:margin 0
a a
:color #1981f7 :color #CC1E14
:text :text
:decoration none :decoration none
:border &:hover
:bottom dotted 1px #999 :color #CC1E14
h1,
h2,
h3,
h4
:text-shadow 1px 1px 1px #eaeaea
#flash_notice, #flash_notice,
#flash_error, #flash_error,
@ -53,44 +51,178 @@ h4
ul ul
:margin 0 :margin 0
#header header
:padding :z-index 10
:top 1em
:bottom 1em :position fixed
:width 100%
:margin :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 #diaspora_text
:position fixed
:border none :border none
:top 8px
:left 1em
#session_action #session_action
:float right :position fixed
:right 1em
:font
:size 120%
:top 7px
a
:color #ccc
:border none
ul.nav
:padding 0 ul.nav
:margin 0 :position absolute
:padding 0
:margin 0
:width 200px
:top 100px
:font
:size 130%
li
:display block :display block
:padding 5px 10px
:background
:color #F2F8FC
:border 1px solid #fff
li &:first-child
:display inline :border-top-right-radius 5px
:margin :border-top-left-radius 5px
:right 1em
&: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 ul#stream
:margin 0 :margin 0
:padding 0 :padding 0
:list-style none :color #666
li
:list-style none
> li > li
:padding 2em 0 :list-style none
:padding 1em
:border :border
:bottom 1px solid #666 :bottom 1px solid #f1f1f1
> ul li.message
:padding 0 :line-height 140%
:margin 0 :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)

View file

@ -1,6 +1,6 @@
require File.dirname(__FILE__) + '/../spec_helper' require File.dirname(__FILE__) + '/../spec_helper'
describe Bookmark do describe Bookmark do
it "should have a link" do it "should have a link" do
bookmark = Factory.build(:bookmark, :link => nil) bookmark = Factory.build(:bookmark, :link => nil)
bookmark.valid?.should be false bookmark.valid?.should be false
@ -61,7 +61,7 @@ describe Bookmark do
describe "XML" do describe "XML" do
it 'should serialize to XML' do it 'should serialize to XML' do
Factory.create(:user) 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 "<title>Reddit</title>" message.to_xml.to_s.should include "<title>Reddit</title>"
message.to_xml.to_s.should include "<link>http://reddit.com/</link>" message.to_xml.to_s.should include "<link>http://reddit.com/</link>"
end end