Merge branch 'master' of github.com:diaspora/diaspora
This commit is contained in:
commit
35ebe38cac
13 changed files with 65 additions and 37 deletions
|
|
@ -122,7 +122,6 @@ GEM
|
|||
selenium-webdriver (>= 0.0.3)
|
||||
childprocess (0.0.7)
|
||||
ffi (~> 0.6.3)
|
||||
columnize (0.3.1)
|
||||
crack (0.1.8)
|
||||
cucumber (0.9.2)
|
||||
builder (~> 2.1.2)
|
||||
|
|
@ -163,7 +162,6 @@ GEM
|
|||
i18n (0.4.1)
|
||||
json (1.4.6)
|
||||
json_pure (1.4.6)
|
||||
linecache (0.43)
|
||||
mail (2.2.7)
|
||||
activesupport (>= 2.3.6)
|
||||
mime-types
|
||||
|
|
@ -225,11 +223,6 @@ GEM
|
|||
rspec-expectations (= 2.0.0)
|
||||
rspec-rails (2.0.0)
|
||||
rspec (= 2.0.0)
|
||||
ruby-debug (0.10.3)
|
||||
columnize (>= 0.1)
|
||||
ruby-debug-base (~> 0.10.3.0)
|
||||
ruby-debug-base (0.10.3)
|
||||
linecache (>= 0.3)
|
||||
rubyzip (0.9.4)
|
||||
selenium-webdriver (0.0.29)
|
||||
childprocess (>= 0.0.7)
|
||||
|
|
@ -287,7 +280,6 @@ DEPENDENCIES
|
|||
roxml!
|
||||
rspec (>= 2.0.0)
|
||||
rspec-rails (>= 2.0.0)
|
||||
ruby-debug
|
||||
sprinkle!
|
||||
thin
|
||||
webmock
|
||||
|
|
|
|||
|
|
@ -11,6 +11,9 @@ class AspectsController < ApplicationController
|
|||
def index
|
||||
@posts = current_user.visible_posts(:by_members_of => :all).paginate :page => params[:page], :per_page => 15, :order => 'created_at DESC'
|
||||
@aspect = :all
|
||||
|
||||
@fb_access_url = MiniFB.oauth_url(FB_APP_ID, APP_CONFIG[:pod_url] + "services/create",
|
||||
:scope=>MiniFB.scopes.join(","))
|
||||
end
|
||||
|
||||
def create
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ class InvitationsController < Devise::InvitationsController
|
|||
flash[:error] = I18n.t 'invitations.create.no_more'
|
||||
elsif e.message == "You already invited this person"
|
||||
flash[:error] = I18n.t 'invitations.create.already_sent'
|
||||
|
||||
else
|
||||
raise e
|
||||
end
|
||||
|
|
|
|||
|
|
@ -14,4 +14,12 @@ module AspectsHelper
|
|||
"<span class='grey' title=#{I18n.t('aspects.helper.aspect_not_empty')}>#{I18n.t('aspects.helper.remove')}</span>"
|
||||
end
|
||||
end
|
||||
|
||||
def aspect_id(aspect)
|
||||
if aspect.class == Aspect
|
||||
aspect.id
|
||||
else
|
||||
:all
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -25,12 +25,7 @@
|
|||
%ul.dropzone
|
||||
%li.grey Drag to ignore/remove
|
||||
|
||||
%h3= link_to "Invite a friend!", "#invite_user_pane", :id => "invite_user_button", :class => "invite_user_button", :title => "Invite a friend"
|
||||
%h3= "You have #{@invites} invites."
|
||||
|
||||
.yo{ :style => "display:none;"}
|
||||
#invite_user_pane
|
||||
= render "invitations/new"
|
||||
= render 'shared/invitations', :invites => @invites
|
||||
|
||||
- content_for :publish do
|
||||
= link_to(t('.add_a_new_aspect'), "#add_aspect_pane", :id => "add_aspect_button", :class => "new_aspect button", :title => t('.add_a_new_aspect'))
|
||||
|
|
|
|||
|
|
@ -1,9 +1,7 @@
|
|||
%h2 Send invitation
|
||||
= form_for User.new, :url => invitation_path(User) do |f|
|
||||
/= devise_error_messages!
|
||||
%p
|
||||
= f.label :email
|
||||
= f.text_field :email
|
||||
= f.hidden_field :aspect_id, :value => @aspect.id
|
||||
= f.hidden_field :aspect_id, :value => aspect_id(@aspect)
|
||||
%p= f.submit "Send an invitation"
|
||||
/= link_to "Home", after_sign_in_path_for(resource_name)
|
||||
|
|
|
|||
|
|
@ -32,11 +32,4 @@
|
|||
|
||||
%br
|
||||
|
||||
%h4 Invites
|
||||
= link_to "Invite a friend!", "#invite_user_pane", :class => "invite_user_button", :class => "invite_user_button", :title => "Invite a friend"
|
||||
%br
|
||||
= "You have #{@invites} invites."
|
||||
.yo{ :style => "display:none;"}
|
||||
#invite_user_pane
|
||||
= render "invitations/new"
|
||||
|
||||
= render "shared/invitations", :invites => @invites
|
||||
|
|
|
|||
8
app/views/shared/_invitations.haml
Normal file
8
app/views/shared/_invitations.haml
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
- unless @aspect == :all
|
||||
%h4 Invites
|
||||
= link_to "Invite a friend", "#invite_user_pane", :class => "invite_user_button", :title => "Invite a friend"
|
||||
= "(#{invites} left)"
|
||||
%br
|
||||
.yo{ :style => "display:none;"}
|
||||
#invite_user_pane
|
||||
= render "invitations/new"
|
||||
9
app/views/shared/_public_explain.haml
Normal file
9
app/views/shared/_public_explain.haml
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
%h1 you are about to post a public message!
|
||||
%p
|
||||
this message is going to be posted to your public feed,
|
||||
and to any services you may have connected to Diaspora.
|
||||
|
||||
- if @logged_in
|
||||
= connected_fb_as(@access_token)
|
||||
- else
|
||||
= link_to "Connect to Facebook", @fb_access_url
|
||||
|
|
@ -2,6 +2,18 @@
|
|||
-# licensed under the Affero General Public License version 3 or later. See
|
||||
-# the COPYRIGHT file.
|
||||
|
||||
:javascript
|
||||
|
||||
$("div.public_toggle input").live("click", function(evt){
|
||||
if("#{@logged_in}" == "false" && $(this).attr('checked') == true){
|
||||
if(confirm("You are currently not connected to facebook. Sign in to facebook?")){
|
||||
window.location = "#{@fb_access_url}";
|
||||
} else {
|
||||
$(this).attr('checked', false);
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
#publisher
|
||||
= owner_image_tag
|
||||
|
||||
|
|
@ -18,13 +30,18 @@
|
|||
= check_box_tag("aspect_ids[]", aspect.id, @aspect == :all || current_aspect?(aspect) )
|
||||
= aspect.name
|
||||
|
||||
= f.hidden_field( :public, :value => false )
|
||||
|
||||
- if @aspect == :all
|
||||
.public_toggle
|
||||
= f.check_box( :public, :value => false )
|
||||
share on facebook
|
||||
= link_to 'public info', "#question_mark_pane", :class => 'question_mark'
|
||||
.yo{:style => "display:none;"}
|
||||
#question_mark_pane
|
||||
= render 'shared/public_explain'
|
||||
.buttons
|
||||
- if @aspect == :all
|
||||
= f.submit t('.share'), :title => "Share with all aspects"
|
||||
- else
|
||||
= f.submit t('.share'), :title => "Share with #{@aspect.name}"
|
||||
- if defined? broadcast
|
||||
= f.submit "Broadcast", :class => "broadcast", :name => "broadcast", :title => "Publish to Diaspora and Facebook"
|
||||
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@
|
|||
|
||||
= link_to "Disconnect from Facebook", services_destroy_path
|
||||
- else
|
||||
= link_to "Connect to Facebook (DO NOT USE WITH A REAL ACCOUNT)", @fb_access_url
|
||||
= link_to "Connect to Facebook", @fb_access_url
|
||||
|
||||
#content_bottom
|
||||
.back
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ $(document).ready(function(){
|
|||
$(".add_request_button").fancybox({ 'titleShow': false });
|
||||
$(".invite_user_button").fancybox({ 'titleShow': false });
|
||||
$(".add_request_button").fancybox({ 'titleShow': false });
|
||||
$(".question_mark").fancybox({ 'titleShow': false });
|
||||
|
||||
$("input[type='submit']").addClass("button");
|
||||
|
||||
|
|
@ -47,7 +48,7 @@ $(document).ready(function(){
|
|||
);
|
||||
|
||||
$("#publisher textarea").keydown( function(e) {
|
||||
if (e.shiftKey && e.keyCode == 13) {
|
||||
if (e.keyCode == 13) {
|
||||
$("#publisher form").submit();
|
||||
}
|
||||
});
|
||||
|
|
@ -71,10 +72,3 @@ $.fn.clearForm = function() {
|
|||
});
|
||||
};
|
||||
|
||||
$("#publisher .broadcast").live("click", function(evt){
|
||||
evt.preventDefault();
|
||||
if( confirm("Publish to Diaspora and Facebook?") ) {
|
||||
$("#status_message_public").val("true");
|
||||
$(this).submit();
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -612,6 +612,16 @@ label
|
|||
.buttons
|
||||
:float right
|
||||
|
||||
.public_toggle
|
||||
:position absolute
|
||||
:top 53px
|
||||
:left 460px
|
||||
:width 300px
|
||||
:font
|
||||
:size smaller
|
||||
:style italic
|
||||
|
||||
|
||||
#image_picker
|
||||
.small_photo
|
||||
:height 100px
|
||||
|
|
|
|||
Loading…
Reference in a new issue