Merge branch 'master' of git://github.com/diaspora/diaspora into 332-quickfix
This commit is contained in:
commit
5e97fd3b52
19 changed files with 88 additions and 162 deletions
|
|
@ -9,15 +9,11 @@ class StatusMessagesController < ApplicationController
|
|||
respond_to :json, :only => :show
|
||||
|
||||
def create
|
||||
params[:status_message][:to] = params[:aspect_ids]
|
||||
|
||||
data = clean_hash params[:status_message]
|
||||
|
||||
|
||||
if logged_into_fb? && params[:status_message][:public] == '1'
|
||||
id = 'me'
|
||||
type = 'feed'
|
||||
|
||||
Rails.logger.info("Sending a message: #{params[:status_message][:message]} to Facebook")
|
||||
EventMachine::HttpRequest.new("https://graph.facebook.com/me/feed?message=#{params[:status_message][:message]}&access_token=#{@access_token}").post
|
||||
end
|
||||
|
|
|
|||
|
|
@ -2,19 +2,15 @@
|
|||
-# licensed under the Affero General Public License version 3 or later. See
|
||||
-# the COPYRIGHT file.
|
||||
|
||||
.back= link_to "⇧ #{@album.name}", @album
|
||||
%h1.big_text
|
||||
|
||||
= "#{t('.editing')} #{@album.name}"
|
||||
%h2= "#{t('.editing')} #{@album.name}"
|
||||
|
||||
.sub_header
|
||||
="#{t('.updated')} #{how_long_ago(@album)}"
|
||||
- form_for @album do |album|
|
||||
= album.error_messages
|
||||
|
||||
- form_for @album do |a|
|
||||
= a.error_messages
|
||||
%p
|
||||
%b album name:
|
||||
= a.text_field :name
|
||||
%h4
|
||||
Album name
|
||||
= album.text_field :name
|
||||
|
||||
- for photo in @album.photos
|
||||
.photo_edit_block= image_tag photo.url(:thumb_medium)
|
||||
|
|
@ -22,11 +18,8 @@
|
|||
.submit_block
|
||||
= link_to t('.cancel'), root_path
|
||||
or
|
||||
= a.submit
|
||||
= album.submit
|
||||
|
||||
.button.delete
|
||||
= link_to t('.delete_album'), @album, :confirm => t('.are_you_sure'), :method => :delete
|
||||
|
||||
#content_bottom
|
||||
.back
|
||||
= link_to "⇧ #{@album.name}", @album
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
.right
|
||||
= link_to t('.new_album'), '#new_album_pane', {:class => "button", :id => "add_album_button"}
|
||||
|
||||
.yo{:style => "display:none;" }
|
||||
.fancybox_content
|
||||
#new_album_pane
|
||||
= render "albums/new_album", :aspect => params[:aspect]
|
||||
|
||||
|
|
|
|||
|
|
@ -3,9 +3,9 @@
|
|||
-# the COPYRIGHT file.
|
||||
|
||||
%h1=t('.add_a_new_aspect')
|
||||
= form_for Aspect.new do |f|
|
||||
= f.error_messages
|
||||
= form_for Aspect.new do |aspect|
|
||||
= aspect.error_messages
|
||||
%p
|
||||
= f.label :name
|
||||
= f.text_field :name
|
||||
= f.submit t('.create'), :class => 'button'
|
||||
= aspect.label :name
|
||||
= aspect.text_field :name
|
||||
= aspect.submit t('.create'), :class => 'button'
|
||||
|
|
|
|||
|
|
@ -42,7 +42,6 @@
|
|||
|
||||
%ul.tools
|
||||
%li= link_to t('.add_a_new_friend'), "#add_request_pane_#{aspect.id}", :class => 'add_request_button'
|
||||
%li= link_to t('.show'), aspect_path(aspect)
|
||||
%li!= remove_link(aspect)
|
||||
|
||||
%ul.dropzone{:id => aspect.id}
|
||||
|
|
@ -57,8 +56,8 @@
|
|||
= person_image_tag(person)
|
||||
.name
|
||||
= link_to person.real_name, person
|
||||
.yo{:style => 'display:none'}
|
||||
|
||||
.fancybox_content
|
||||
%div{:id => "add_request_pane_#{aspect.id}"}
|
||||
= render "requests/new_request", :aspect => aspect
|
||||
|
||||
#content_bottom
|
||||
|
|
|
|||
|
|
@ -1,22 +0,0 @@
|
|||
-# 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 :page_title do
|
||||
= link_to "photos", albums_path(:aspect => @aspect)
|
||||
|
||||
- content_for :left_pane do
|
||||
= render "shared/aspect_friends"
|
||||
|
||||
- content_for :publish do
|
||||
- if
|
||||
= render "shared/publisher", :aspect_ids => :all
|
||||
|
||||
%ul#stream
|
||||
- for post in @posts
|
||||
= render type_partial(post), :post => post unless post.class == Album
|
||||
|
||||
#pagination
|
||||
= will_paginate @posts
|
||||
|
||||
|
|
@ -2,10 +2,12 @@
|
|||
-# licensed under the Affero General Public License version 3 or later. See
|
||||
-# the COPYRIGHT file.
|
||||
|
||||
= form_for Comment.new, :remote => true do |f|
|
||||
= form_for Comment.new, :remote => true do |comment|
|
||||
%p
|
||||
%label{:for => "comment_text_on_#{post.id}"} Comment
|
||||
= f.text_area :text, :rows => 1, :id => "comment_text_on_#{post.id}", :class => "comment_box"
|
||||
= f.hidden_field :post_id, :value => post.id
|
||||
= label_tag "comment_text_on_#{post.id}", "Comment"
|
||||
= comment.text_area :text, :rows => 1, :id => "comment_text_on_#{post.id}", :class => "comment_box"
|
||||
|
||||
= comment.hidden_field :post_id, :value => post.id
|
||||
|
||||
%p{:style => "text-align:right;"}
|
||||
= f.submit t('.comment'), :class => "comment_submit button"
|
||||
= comment.submit t('.comment'), :class => "comment_submit button"
|
||||
|
|
|
|||
|
|
@ -1,11 +1,13 @@
|
|||
%h2 Send invitation
|
||||
= form_for User.new, :url => invitation_path(User) do |f|
|
||||
= form_for User.new, :url => invitation_path(User) do |invite|
|
||||
%p
|
||||
= f.label :email
|
||||
= f.text_field :email
|
||||
To
|
||||
- if @aspect == :all
|
||||
= f.select(:aspects, @aspects_dropdown_array)
|
||||
- else
|
||||
= f.select(:aspects, @aspects_dropdown_array, :selected => [@aspect.to_s, @aspect_id])
|
||||
%p= f.submit "Send an invitation"
|
||||
= invite.label :email
|
||||
= invite.text_field :email
|
||||
To
|
||||
- if @aspect == :all
|
||||
= invite.select(:aspects, @aspects_dropdown_array)
|
||||
- else
|
||||
= invite.select(:aspects, @aspects_dropdown_array, :selected => @aspect.id)
|
||||
|
||||
%p= invite.submit "Send an invitation"
|
||||
|
||||
|
|
|
|||
|
|
@ -1,30 +0,0 @@
|
|||
-# Copyright (c) 2010, Diaspora Inc. This file is
|
||||
-# licensed under the Affero General Public License version 3 or later. See
|
||||
-# the COPYRIGHT file.
|
||||
|
||||
- title=t('.new_person')
|
||||
|
||||
= form_for @person do |f|
|
||||
= f.error_messages
|
||||
%p
|
||||
= f.label :diaspora_handle
|
||||
%br
|
||||
= f.text_field :diaspora_handle
|
||||
%p
|
||||
= f.label :url
|
||||
%br
|
||||
= f.text_field :url
|
||||
|
||||
=f.fields_for :profile do |p|
|
||||
%p
|
||||
= p.label :first_name
|
||||
%br
|
||||
= p.text_field :first_name
|
||||
|
||||
%p
|
||||
= p.label :last_name
|
||||
%br
|
||||
= p.text_field :last_name
|
||||
= f.submit
|
||||
|
||||
%p= link_to t('.back_to_list'), people_path
|
||||
|
|
@ -27,7 +27,6 @@
|
|||
= link_to t('.remove_friend'), @person, :confirm => t('.are_you_sure'), :method => :delete, :class => "button"
|
||||
|
||||
.span-20.last
|
||||
|
||||
.span-19.last
|
||||
- if @posts
|
||||
%ul#stream
|
||||
|
|
|
|||
|
|
@ -2,20 +2,16 @@
|
|||
-# licensed under the Affero General Public License version 3 or later. See
|
||||
-# the COPYRIGHT file.
|
||||
|
||||
%h1.big_text
|
||||
.back
|
||||
= link_to "⇧ #{@album.name}", album_path(@album)
|
||||
= "#{t('.editing')} #{@photo.image}"
|
||||
%h2= "#{t('.editing')} #{@photo.image}"
|
||||
|
||||
%div{:id => @photo.id}
|
||||
|
||||
#show_photo
|
||||
= linked_scaled_photo @photo, @album
|
||||
|
||||
= form_for @photo do |p|
|
||||
= p.label :caption
|
||||
= p.text_field :caption, :value => @photo.caption
|
||||
= p.submit
|
||||
= form_for @photo do |photo|
|
||||
= photo.label :caption
|
||||
= photo.text_field :caption, :value => @photo.caption
|
||||
= photo.submit
|
||||
%div{:class => 'clear'}
|
||||
|
||||
#content_bottom
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@
|
|||
//show form to add description
|
||||
$(".edit-desc").click(function(){
|
||||
$(".edit_photo").toggle();
|
||||
//$(".caption").toggle();
|
||||
});
|
||||
|
||||
//Add a description with ajax request
|
||||
|
|
@ -40,7 +39,6 @@
|
|||
var url = $(".edit_photo").attr("action");
|
||||
var data = $(".edit_photo").serialize();
|
||||
$(".description").text($("#photo_caption").val());
|
||||
//$(".caption").toggle();
|
||||
$(".edit_photo").toggle();
|
||||
|
||||
$.ajax({
|
||||
|
|
@ -66,11 +64,11 @@
|
|||
%h1
|
||||
= @photo.image
|
||||
|
||||
= link_to "<< #{t('.prev')}", url_to_prev(@photo, @album)
|
||||
= link_to "<< #{t('.prev')}", url_to_prev(@photo, @album), :rel => 'prefetch'
|
||||
|
|
||||
= link_to "#{t('.full_size')}", @photo.url
|
||||
|
|
||||
= link_to "#{t('.next')} >>", url_to_next(@photo, @album)
|
||||
= link_to "#{t('.next')} >>", url_to_next(@photo, @album), :rel => 'prefetch'
|
||||
|
||||
.right
|
||||
-if current_user.owns? @album
|
||||
|
|
@ -80,13 +78,13 @@
|
|||
#show_photo
|
||||
= linked_scaled_photo @photo, @album
|
||||
.caption
|
||||
-if current_user.owns? @album
|
||||
-if current_user.owns? @photo
|
||||
-if @photo.caption and @photo.caption != ""
|
||||
= link_to 'Edit','javascript:void(0)', :id => "edit-desc", :class => "edit-desc"
|
||||
.description
|
||||
= @photo.caption
|
||||
|
||||
-if current_user.owns? @album
|
||||
-if current_user.owns? @photo
|
||||
%div{:class => 'clear'}
|
||||
-if !@photo.caption or @photo.caption == ""
|
||||
= link_to 'Add a description','javascript:void(0)', :id => "add-description", :class => "edit-desc"
|
||||
|
|
|
|||
|
|
@ -6,16 +6,16 @@
|
|||
=t('.add_a_new_friend_to')
|
||||
%i= aspect.name
|
||||
|
||||
= form_for Request.new do |f|
|
||||
= f.error_messages
|
||||
= form_for Request.new do |fr_request|
|
||||
= fr_request.error_messages
|
||||
|
||||
=t('.enter_a_diaspora_username')
|
||||
%br
|
||||
%i= t '.your_diaspora_username_is', :diaspora_handle => current_user.diaspora_handle
|
||||
|
||||
%p
|
||||
= f.label :destination_url, t(".friends_username")
|
||||
= f.text_field :destination_url
|
||||
= f.hidden_field :aspect_id, :value => aspect.id
|
||||
= f.submit
|
||||
= fr_request.label :destination_url, t(".friends_username")
|
||||
= fr_request.text_field :destination_url
|
||||
= fr_request.hidden_field :aspect_id, :value => aspect.id
|
||||
= fr_request.submit
|
||||
|
||||
|
|
|
|||
|
|
@ -13,10 +13,10 @@
|
|||
- @fb_friends = MiniFB.get(@access_token, 'me', :type => "friends")
|
||||
- @fb_friends[:data].each do |friend|
|
||||
= image_tag( "http://graph.facebook.com/#{friend[:id]}/picture" )
|
||||
-unless (@aspect == :all) || (@aspect == :public)
|
||||
-unless (@aspect == :all)
|
||||
= link_to (image_tag('add_friend_button.png', :height => "50px", :width => "50px")), "#add_request_pane", :id => 'add_request_button'
|
||||
|
||||
.yo{:style => 'display:none'}
|
||||
.fancybox_content
|
||||
#add_request_pane
|
||||
= render "requests/new_request", :aspect => @aspect
|
||||
-else
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@
|
|||
-# the COPYRIGHT file.
|
||||
|
||||
:javascript
|
||||
|
||||
$("div.public_toggle input").live("click", function(evt){
|
||||
if("#{@logged_in}" == "false" && $(this).attr('checked') == true){
|
||||
$(".question_mark").click();
|
||||
|
|
@ -13,31 +12,26 @@
|
|||
#publisher
|
||||
= owner_image_tag
|
||||
|
||||
= form_for StatusMessage.new, :remote => true do |f|
|
||||
= f.error_messages
|
||||
= form_for StatusMessage.new, :remote => true do |status|
|
||||
= status.error_messages
|
||||
%p
|
||||
%label{:for => "status_message_message"} Message
|
||||
= f.text_area :message, :rows => 2, :value => params[:prefill]
|
||||
|
||||
%ul.aspect_selector{ :style => "display:none;"}
|
||||
going to...
|
||||
- for aspect in @aspects
|
||||
%li
|
||||
= check_box_tag("aspect_ids[]", aspect.id, @aspect == :all || current_aspect?(aspect) )
|
||||
= aspect.name
|
||||
= 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)
|
||||
|
||||
- if @aspect == :all
|
||||
.public_toggle
|
||||
= f.check_box( :public, :value => false )
|
||||
= status.check_box( :public, :value => false )
|
||||
make public
|
||||
= link_to '(?)', "#question_mark_pane", :class => 'question_mark'
|
||||
.yo{:style => "display:none;"}
|
||||
|
||||
.fancybox_content
|
||||
#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 @aspect == :all
|
||||
= status.submit t('.share'), :title => "Share with all aspects"
|
||||
- else
|
||||
= status.submit t('.share'), :title => "Share with #{@aspect}"
|
||||
|
||||
|
|
|
|||
|
|
@ -8,8 +8,6 @@
|
|||
%h2
|
||||
- if @aspect == :all
|
||||
= link_to "Everyone", root_path
|
||||
- elsif @aspect == :public
|
||||
= "Public"
|
||||
- elsif @aspect == :manage
|
||||
= link_to t('.manage_aspects'), root_path
|
||||
- else
|
||||
|
|
|
|||
|
|
@ -47,9 +47,9 @@ $(document).ready(function(){
|
|||
}
|
||||
);
|
||||
|
||||
$("#publisher textarea").keydown( function(e) {
|
||||
$("#publisher textarea, .comment textarea").keydown( function(e) {
|
||||
if (e.keyCode == 13) {
|
||||
$("#publisher form").submit();
|
||||
$(this).closest("form").submit();
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -115,7 +115,6 @@ header
|
|||
|
||||
a
|
||||
:color #CCC
|
||||
:text-shadow 0 1px 0 #444
|
||||
|
||||
&:hover
|
||||
:background none
|
||||
|
|
@ -130,6 +129,9 @@ header
|
|||
:color #fff
|
||||
|
||||
ul#user_menu
|
||||
a
|
||||
:text-shadow 0 1px 0 #444
|
||||
|
||||
:z-index 10
|
||||
:font
|
||||
:size 14px
|
||||
|
|
@ -246,7 +248,6 @@ li.message
|
|||
:background #eee
|
||||
|
||||
.content
|
||||
:max-width 610px
|
||||
:margin
|
||||
:top -4px
|
||||
:padding
|
||||
|
|
@ -448,16 +449,13 @@ ul.comment_set
|
|||
:top 1em
|
||||
:padding 0
|
||||
:list-style none
|
||||
:max-width 610px
|
||||
:background
|
||||
:color rgba(10,81,109,0.05)
|
||||
|
||||
textarea
|
||||
:width 100%
|
||||
|
||||
li.comment
|
||||
:margin
|
||||
:bottom 0.5em
|
||||
:background
|
||||
:color rgba(10,81,109,0.05)
|
||||
:padding 0.6em
|
||||
:border
|
||||
:bottom 1px solid #ddd
|
||||
|
|
@ -466,8 +464,10 @@ ul.comment_set
|
|||
:color #777
|
||||
:margin
|
||||
:top -2px
|
||||
:bottom -2px
|
||||
:padding
|
||||
:left 45px
|
||||
:right 20px
|
||||
.from
|
||||
a
|
||||
:color #444
|
||||
|
|
@ -475,7 +475,7 @@ ul.comment_set
|
|||
:size 12px
|
||||
|
||||
:line
|
||||
:height 18px
|
||||
:height 16px
|
||||
|
||||
div.time
|
||||
:color #bbb
|
||||
|
|
@ -629,20 +629,14 @@ label
|
|||
:display inline
|
||||
|
||||
input[type='submit']
|
||||
:display block
|
||||
:float right
|
||||
:margin
|
||||
:right 20px
|
||||
:width 100%
|
||||
|
||||
textarea
|
||||
:width 570px
|
||||
:height 42px
|
||||
:margin
|
||||
:top 0
|
||||
:bottom 0
|
||||
|
||||
.buttons
|
||||
:float right
|
||||
:margin 0
|
||||
|
||||
.public_toggle
|
||||
:position absolute
|
||||
|
|
@ -1057,3 +1051,9 @@ input[type="search"]
|
|||
header
|
||||
input[type="search"]
|
||||
:width 200px
|
||||
|
||||
.fancybox_content
|
||||
:display none
|
||||
|
||||
.edit_photo
|
||||
:display none
|
||||
|
|
|
|||
|
|
@ -5,16 +5,17 @@
|
|||
require 'spec_helper'
|
||||
|
||||
describe StatusMessagesController do
|
||||
render_views
|
||||
render_views
|
||||
|
||||
let!(:user) { Factory(:user) }
|
||||
let!(:aspect) { user.aspect(:name => "lame-os") }
|
||||
|
||||
before do
|
||||
@user = Factory.create(:user)
|
||||
@aspect = @user.aspect(:name => "lame-os")
|
||||
@album = @user.post :album, :to => @aspect.id, :name => 'things on fire'
|
||||
sign_in :user, @user
|
||||
sign_in :user, user
|
||||
end
|
||||
|
||||
describe '#create' do
|
||||
let(:status_message_hash) {{"aspect_ids" =>"#{@aspect.id.to_s}", "status_message"=>{"public"=>"1", "message"=>"facebook, is that you?"}}}
|
||||
let(:status_message_hash) {{"status_message"=>{"public"=>"1", "message"=>"facebook, is that you?", "to" =>"#{aspect.id}"}}}
|
||||
|
||||
before do
|
||||
@controller.stub!(:logged_into_fb?).and_return(true)
|
||||
|
|
|
|||
Loading…
Reference in a new issue