diaspora/app/views/shared/_publisher.haml
2010-10-25 19:24:48 -07:00

62 lines
1.8 KiB
Text

-# Copyright (c) 2010, Diaspora Inc. This file is
-# licensed under the Affero General Public License version 3 or later. See
-# the COPYRIGHT file.
- content_for :head do
:javascript
$("div.public_toggle input").live("click", function(evt){
if($(this).attr('checked') == true){
$(".question_mark").click();
};
});
$("#publisher textarea, #publisher input").live("focus", function(evt){
$("#publisher .options_and_submit").fadeIn(50);
});
$("#publisher form").live("submit", function(evt){
$("#publisher .options_and_submit").hide();
});
#publisher
= owner_image_tag
- if( !defined?(type) || type == :status_message )
= form_for StatusMessage.new, :remote => true do |status|
= status.error_messages
%p
= status.label :message, "Post a message to #{aspect}"
= status.text_area :message, :rows => 2, :value => params[:prefill]
= status.hidden_field :to, :value => (aspect == :all ? aspect : aspect.id)
.options_and_submit
- if aspect == :all
.public_toggle
= status.check_box( :public, {}, true, false )
make public
= link_to '(?)', "#question_mark_pane", :class => 'question_mark'
.fancybox_content
#question_mark_pane
= render 'shared/public_explain'
- if aspect == :all
= status.submit t('.share'), :title => "Share with all aspects"
- else
= status.submit t('.share'), :title => "Share with #{aspect}"
- else
= form_for Album.new do |album|
= album.error_messages
%p
= album.label :name
= album.text_field :name
= album.hidden_field :to, :value => (aspect == :all ? aspect : aspect.id)
.options_and_submit
= album.submit "Create", :class => 'button'