Skip to content
Extraits de code Groupes Projets
Valider f5ecfebc rédigé par ilya's avatar ilya
Parcourir les fichiers

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

parents d4f528bb faa5d216
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
class ApplicationController < ActionController::Base
protect_from_forgery :except => :receive
layout 'application'
before_filter :set_friends
def set_friends
@friends = Friend.all
end
end
......@@ -2,7 +2,6 @@ class StatusMessagesController < ApplicationController
before_filter :authenticate_user!
def index
@status_message = StatusMessage.new
@status_messages = StatusMessage.sort(:created_at.desc).all
......
%h1 your network stream
= render "status_messages/new_status_message"
%ul#stream
- for post in @posts
= render type_partial(post), :post => post
%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
\ No newline at end of file
......@@ -82,5 +82,8 @@
#content
= yield
= render "posts/debug"
#main
= yield
= render "posts/debug"
#friends_list
= render 'friends/sidebar'
\ No newline at end of file
= form_for status_message, :remote => true do |f|
= form_for StatusMessage.new, :remote => true do |f|
= f.error_messages
%p
/= f.label :message
......
......@@ -177,6 +177,18 @@ h3 {
width: 100%;
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 {
font-size: 130%;
margin: 1em;
......
......@@ -214,7 +214,19 @@ h3
:width 100%
: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
:font
:size 130%
......
......@@ -3,10 +3,19 @@ require File.dirname(__FILE__) + '/../spec_helper'
describe DashboardController do
render_views
it "index action should render index template" do
before do
request.env['warden'] = mock_model(Warden, :authenticate? => @user, :authenticate! => @user)
end
it "index action should render index template" do
get :index
response.should render_template(:index)
end
it "on index sets a friends variable" do
Factory.create :friend
get :index
assigns[:friends].should == Friend.all
end
end
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter