fixed merge with master
This commit is contained in:
commit
a0417d13af
17 changed files with 412 additions and 162 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
module DashboardHelper
|
||||
|
||||
|
||||
|
||||
|
||||
def type_partial(post)
|
||||
class_name = post.class.name.to_s.underscore
|
||||
"#{class_name.pluralize}/pane"
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
|||
11
app/views/blogs/_pane.html.haml
Normal file
11
app/views/blogs/_pane.html.haml
Normal 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"
|
||||
|
||||
|
|
@ -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
|
||||
|
|
|
|||
9
app/views/bookmarks/_pane.html.haml
Normal file
9
app/views/bookmarks/_pane.html.haml
Normal 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"
|
||||
|
||||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
- if devise_mapping.rememberable?
|
||||
= f.check_box :remember_me
|
||||
= f.label :remember_me
|
||||
%p= f.submit "Sign in"
|
||||
= render :partial => "devise/shared/links"
|
||||
= f.submit "Sign in"
|
||||
= render :partial => "devise/shared/links"
|
||||
|
|
|
|||
|
|
@ -15,31 +15,61 @@
|
|||
= 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
|
||||
%header
|
||||
%a#diaspora_text{:href => root_path}
|
||||
%img{:src => '/images/diaspora.png'}
|
||||
%img{:src => '/images/diaspora_white.png'}
|
||||
|
||||
#session_action
|
||||
- if user_signed_in?
|
||||
= link_to "log out", destroy_user_session_path
|
||||
=User.first.email
|
||||
|
|
||||
= link_to "logout", 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
|
||||
#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
|
||||
|
||||
%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
|
||||
|
||||
.container
|
||||
- if show_title?
|
||||
%h2= yield(:title)
|
||||
- flash.each do |name, msg|
|
||||
= content_tag :div, msg, :id => "flash_#{name}"
|
||||
|
||||
#content
|
||||
= yield
|
||||
|
||||
#debug
|
||||
|
|
|
|||
7
app/views/status_messages/_pane.html.haml
Normal file
7
app/views/status_messages/_pane.html.haml
Normal 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"
|
||||
|
||||
|
|
@ -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
|
||||
|
|
|
|||
BIN
public/images/diaspora_white.png
Normal file
BIN
public/images/diaspora_white.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.2 KiB |
BIN
public/images/mocks/bp.jpeg
Normal file
BIN
public/images/mocks/bp.jpeg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 261 KiB |
BIN
public/images/mocks/user_pic.jpeg
Normal file
BIN
public/images/mocks/user_pic.jpeg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 6.5 KiB |
|
|
@ -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 {
|
||||
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; }
|
||||
#header #session_action {
|
||||
float: right; }
|
||||
#header ul.nav {
|
||||
|
||||
ul.nav {
|
||||
position: absolute;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
display: block; }
|
||||
#header ul.nav li {
|
||||
display: inline;
|
||||
margin-right: 1em; }
|
||||
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; }
|
||||
|
|
|
|||
|
|
@ -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
|
||||
:position fixed
|
||||
:right 1em
|
||||
:font
|
||||
:size 120%
|
||||
:top 7px
|
||||
a
|
||||
:color #ccc
|
||||
:border none
|
||||
|
||||
|
||||
#session_action
|
||||
:float right
|
||||
|
||||
ul.nav
|
||||
ul.nav
|
||||
:position absolute
|
||||
:padding 0
|
||||
:margin 0
|
||||
:display block
|
||||
:width 200px
|
||||
:top 100px
|
||||
:font
|
||||
:size 130%
|
||||
|
||||
li
|
||||
:display inline
|
||||
:display block
|
||||
:padding 5px 10px
|
||||
:background
|
||||
:color #F2F8FC
|
||||
:border 1px solid #fff
|
||||
|
||||
|
||||
&: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
|
||||
:right 1em
|
||||
: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)
|
||||
|
||||
|
|
|
|||
|
|
@ -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 "<title>Reddit</title>"
|
||||
message.to_xml.to_s.should include "<link>http://reddit.com/</link>"
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in a new issue