diaspora/app/views/shared/_publisher.haml

80 lines
2.9 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
$(document).ready(function(){
$("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){
$("#photodropzone").find('li').remove();
$("#publisher .options_and_submit").hide();
});
$("#content_creation_button").bind("click", function(evt){
$("#publisher").removeClass("closed");
$("#publisher").find("textarea").focus();
});
});
#publisher{:class=>("closed" if aspect == :all)}
- if aspect == :all
#content_creation_button
= image_tag 'icons/monotone_chat_talk.png', :id => 'share_bubble'
%h4= t('.share_with_all')
.content_creation
= form_for(StatusMessage.new, :remote => true) do |status|
%ul#photodropzone
= status.error_messages
#file-upload.button
= t('.add_photos')
%p
%params
- unless aspect == :all
= status.label :message, t('.post_a_message_to', :aspect => (aspect == :all ? t('.all_contacts') : aspect))
= status.text_area :message, :rows => 2, :value => params[:prefill]
= status.hidden_field :aspect_ids, :value => (aspect == :all ? aspect : aspect.id)
.options_and_submit
.right
#fileInfo
= image_tag 'ajax-loader.gif', :class => 'hidden', :id => "publisher_spinner"
- if aspect == :all
= status.submit t('.share'), :title => t('.share_with_all'), :disable_with => t('.posting')
- else
= status.submit t('.share'), :title => t('.share_with', :aspect => aspect), :disable_with => t('.posting')
- if aspect == :all
.public_toggle
%p.checkbox_select
= status.check_box( :public, {}, true, false )
= status.label :public, t('.make_public')
= link_to (image_tag "social_media_logos/feed-16x16.png", :title => "RSS"), current_user.public_url
- if current_user.services
- for service in current_user.services
= image_tag "social_media_logos/#{service.provider}-16x16.png", :title => service.provider
= link_to '(?)', "#question_mark_pane", :class => 'question_mark', :style=>"display:none;"
.fancybox_content
#question_mark_pane
= render 'shared/public_explain'
#publisher_photo_upload
= render 'photos/new_photo', :aspect_id => (aspect == :all ? aspect : aspect.id)