the public aspect is now set in application controller

This commit is contained in:
ilya 2010-09-23 19:33:33 -07:00
parent 796f198d8c
commit eaea26e58d
5 changed files with 9 additions and 5 deletions

View file

@ -23,7 +23,9 @@ class ApplicationController < ActionController::Base
def set_friends_and_status def set_friends_and_status
if current_user if current_user
if params[:aspect] == nil || params[:aspect] == 'all' if params[:action] == 'public'
@aspect = :public
elsif params[:aspect] == nil || params[:aspect] == 'all'
@aspect = :all @aspect = :all
else else
@aspect = current_user.aspect_by_id( params[:aspect]) @aspect = current_user.aspect_by_id( params[:aspect])

View file

@ -50,7 +50,6 @@ class AspectsController < ApplicationController
:scope=>MiniFB.scopes.join(",")) :scope=>MiniFB.scopes.join(","))
@posts = current_user.visible_posts(:by_members_of => :all).paginate :page => params[:page], :per_page => 15, :order => 'created_at DESC' @posts = current_user.visible_posts(:by_members_of => :all).paginate :page => params[:page], :per_page => 15, :order => 'created_at DESC'
@aspect = :all
respond_with @aspect respond_with @aspect
end end

View file

@ -8,7 +8,7 @@
- for friend in @friends - for friend in @friends
= person_image_link(friend) = person_image_link(friend)
-unless @aspect == :all -unless (@aspect == :all) || (@aspect == :public)
= link_to (image_tag('add_friend_button.png', :height => "50px", :width => "50px")), "#add_request_pane", :id => 'add_request_button' = link_to (image_tag('add_friend_button.png', :height => "50px", :width => "50px")), "#add_request_pane", :id => 'add_request_button'
.yo{:style => 'display:none'} .yo{:style => 'display:none'}

View file

@ -5,20 +5,21 @@
#publisher #publisher
= owner_image_tag = owner_image_tag
= @aspect
= form_for StatusMessage.new, :remote => true do |f| = form_for StatusMessage.new, :remote => true do |f|
= f.error_messages = f.error_messages
%p %p
%label{:for => "status_message_message"} Message %label{:for => "status_message_message"} Message
= f.text_area :message, :rows => 2, :value => params[:prefill] = f.text_area :message, :rows => 2, :value => params[:prefill]
= "going to Facebook as #{MiniFB.get(@access_token, 'me')[:name]}" if @logged_in && (params[:action] == 'public') = "going to Facebook as #{MiniFB.get(@access_token, 'me')[:name]}" if @logged_in && @aspect == :public
= f.hidden_field( :public, :value => (params[:action] == 'public') ) = f.hidden_field( :public, :value => (params[:action] == 'public') )
%ul.aspect_selector{ :style => "display:none;"} %ul.aspect_selector{ :style => "display:none;"}
going to... going to...
- for aspect in @aspects - for aspect in @aspects
%li %li
= check_box_tag("aspect_ids[]", aspect.id, (params[:action] == 'public') || @aspect == :all || current_aspect?(aspect) ) = check_box_tag("aspect_ids[]", aspect.id, @aspect == :public || @aspect == :all || current_aspect?(aspect) )
= aspect.name = aspect.name
= f.submit "Share" = f.submit "Share"

View file

@ -10,6 +10,8 @@
= link_to "All Aspects", root_path = link_to "All Aspects", root_path
- elsif @aspect == :manage - elsif @aspect == :manage
= "Manage Aspects" = "Manage Aspects"
- elsif @aspect == :public
= "Public"
- else - else
= link_to @aspect.name, @aspect = link_to @aspect.name, @aspect