Merge branch 'master' of github.com:diaspora/diaspora_rails

This commit is contained in:
ilya 2010-06-25 23:23:44 -04:00
commit f5ecfebcb9
9 changed files with 56 additions and 7 deletions

View file

@ -1,5 +1,10 @@
class ApplicationController < ActionController::Base class ApplicationController < ActionController::Base
protect_from_forgery :except => :receive protect_from_forgery :except => :receive
layout 'application' layout 'application'
before_filter :set_friends
def set_friends
@friends = Friend.all
end
end end

View file

@ -2,7 +2,6 @@ class StatusMessagesController < ApplicationController
before_filter :authenticate_user! before_filter :authenticate_user!
def index def index
@status_message = StatusMessage.new
@status_messages = StatusMessage.sort(:created_at.desc).all @status_messages = StatusMessage.sort(:created_at.desc).all

View file

@ -1,4 +1,5 @@
%h1 your network stream %h1 your network stream
= render "status_messages/new_status_message"
%ul#stream %ul#stream
- for post in @posts - for post in @posts
= render type_partial(post), :post => post = render type_partial(post), :post => post

View file

@ -0,0 +1,8 @@
%h1 your friends
%ul#stream
- for friend in @friends
= link_to friend.real_name, friend_path(friend)
%br
%br
%hr
= link_to "add a new friend", new_friend_path

View file

@ -82,5 +82,8 @@
#content #content
= yield #main
= render "posts/debug" = yield
= render "posts/debug"
#friends_list
= render 'friends/sidebar'

View file

@ -1,4 +1,4 @@
= form_for status_message, :remote => true do |f| = form_for StatusMessage.new, :remote => true do |f|
= f.error_messages = f.error_messages
%p %p
/= f.label :message /= f.label :message

View file

@ -177,6 +177,18 @@ h3 {
width: 100%; width: 100%;
margin-bottom: 1em; } margin-bottom: 1em; }
#main {
width: 70%;
min-width: 400px;
max-width: 700px;
float: left; }
#friends_list {
float: right;
width: 20%;
min-width: 130px;
padding-left: 10%; }
form { form {
font-size: 130%; font-size: 130%;
margin: 1em; margin: 1em;

View file

@ -214,7 +214,19 @@ h3
:width 100% :width 100%
:margin :margin
:bottom 1em :bottom 1em
#main
:width 70%
:min-width 400px
:max-width 700px
:float left
#friends_list
:float right
:width 20%
:min-width 130px
:padding-left 10%
form form
:font :font
:size 130% :size 130%

View file

@ -3,10 +3,19 @@ require File.dirname(__FILE__) + '/../spec_helper'
describe DashboardController do describe DashboardController do
render_views render_views
it "index action should render index template" do before do
request.env['warden'] = mock_model(Warden, :authenticate? => @user, :authenticate! => @user) request.env['warden'] = mock_model(Warden, :authenticate? => @user, :authenticate! => @user)
end
it "index action should render index template" do
get :index get :index
response.should render_template(:index) response.should render_template(:index)
end end
it "on index sets a friends variable" do
Factory.create :friend
get :index
assigns[:friends].should == Friend.all
end
end end