killed the public tab. made a broadcast button in everyone tab

This commit is contained in:
danielvincent 2010-10-08 14:06:49 -07:00
parent d13f8e12c8
commit 154ec95717
10 changed files with 42 additions and 31 deletions

View file

@ -26,6 +26,4 @@ class FbStatus
:updated_time => Time.parse(hash['updated_time'])
)
end
end

View file

@ -9,7 +9,7 @@
= render "shared/aspect_friends"
- content_for :publish do
= render "shared/publisher", :aspect_ids => :all
= render "shared/publisher", :aspect_ids => :all, :broadcast => true
%ul#stream
- for post in @posts

View file

@ -49,7 +49,7 @@
= text_field_tag 'q'
%li= link_to current_user.real_name, current_user.person
%li= link_to t('.edit_profile'), edit_user_path(current_user)
%li= link_to "settings", edit_user_path(current_user)
%li= link_to t('.logout.'), destroy_user_session_path
= render "shared/aspect_nav"

View file

@ -5,14 +5,12 @@
#aspect_nav
%ul
%li{:class => ("selected" if @aspect == :all)}
= link_to t('.all_aspects'), root_url
= link_to "Everyone", root_url
- for aspect in @aspects
%li{:class => ("selected" if current_aspect?(aspect))}
= link_for_aspect aspect
%ul{ :style => "position:absolute;right:0;bottom:0.01em;"}
%li{:class => ("selected" if @aspect == :public)}
= link_to "Public", aspects_public_path
%li{ :style => "margin-right:0;", :class => ("selected" if @aspect == :manage)}
= link_to ( (@request_count == 0)? t('.manage') : "#{t('.manage')} (#{@request_count})"), {:controller => :aspects, :action => :manage}, :class => "edit_aspect_button", :class => new_request(@request_count), :title => t('.manage_your_aspects')

View file

@ -10,8 +10,6 @@
%p
%label{:for => "status_message_message"} Message
= f.text_area :message, :rows => 2, :value => params[:prefill]
= connected_fb_as(@access_token) if @logged_in && @aspect == :public
= f.hidden_field( :public, :value => (params[:action] == 'public') )
%ul.aspect_selector{ :style => "display:none;"}
going to...
@ -19,4 +17,12 @@
%li
= check_box_tag("aspect_ids[]", aspect.id, @aspect == :public || @aspect == :all || current_aspect?(aspect) )
= aspect.name
= f.submit t('.share')
= connected_fb_as(@access_token) if @logged_in && @aspect == :public
= f.hidden_field( :public, :value => (params[:action] == 'public') )
.buttons
= f.submit t('.share'), :name => "share", :id => "fii"
- if broadcast
= f.submit "Broadcast", :class => "broadcast", :name => "broadcast"

View file

@ -7,7 +7,7 @@
- else
%h2
- if @aspect == :all
= link_to t('.all_aspects'), root_path
= link_to "Everyone", root_path
- elsif @aspect == :public
= "Public"
- elsif @aspect == :manage

View file

@ -66,3 +66,10 @@ $.fn.clearForm = function() {
});
};
$("#publisher .broadcast").live("click", function(evt){
evt.preventDefault();
if( confirm("Broadcast to the world?") ) {
$("#status_message_public").val("true");
$(this).submit();
}
});

View file

@ -418,16 +418,16 @@ label {
#publisher form {
display: inline; }
#publisher form input[type='submit'] {
float: right;
display: block;
margin-right: 20px;
margin-top: 26px; }
width: 100%; }
#publisher textarea {
width: 600px;
width: 570px;
height: 42px;
margin-top: 0;
margin-bottom: 0; }
#publisher .button {
margin-left: 100px; }
#publisher .buttons {
float: right; }
#image_picker .small_photo {
height: 100px;

View file

@ -563,20 +563,20 @@ label
:display inline
input[type='submit']
:float right
:display block
:margin
:right 20px
:top 26px
:width 100%
textarea
:width 600px
:width 570px
:height 42px
:margin
:top 0
:bottom 0
.button
:margin-left 100px
.buttons
:float right
#image_picker
.small_photo

View file

@ -5,25 +5,27 @@
require 'spec_helper'
describe Retraction do
before do
@user = Factory.create(:user)
@person = Factory.create(:person)
@aspect = @user.aspect(:name => "Bruisers")
@user.activate_friend(@person, @aspect)
@post = @user.post :status_message, :message => "Destroy!", :to => @aspect.id
end
let(:user) { Factory(:user) }
let(:person) { Factory(:person) }
let(:aspect) { user.aspect(:name => "Bruisers") }
let!(:activation) { user.activate_friend(person, aspect) }
let!(:post) { user.post :status_message, :message => "Destroy!", :to => aspect.id }
describe 'serialization' do
it 'should have a post id after serialization' do
retraction = Retraction.for(@post)
retraction = Retraction.for(post)
xml = retraction.to_xml.to_s
xml.include?(@post.id.to_s).should == true
xml.include?(post.id.to_s).should == true
end
end
describe 'dispatching' do
it 'should dispatch a message on delete' do
Factory.create(:person)
User::QUEUE.should_receive :add_post_request
@post.destroy
post.destroy
end
end
end