Merge branch 'master' of git://github.com/diaspora/diaspora
This commit is contained in:
commit
035b8893c9
25 changed files with 92 additions and 107 deletions
|
|
@ -9,6 +9,7 @@ before_script:
|
|||
- "rake db:create"
|
||||
- "rake db:schema:load"
|
||||
- "rspec spec --tag fixture"
|
||||
|
||||
script: "bundle exec rake travis"
|
||||
env: "TRAVIS=true"
|
||||
notifications:
|
||||
disable: true
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ class AspectsController < ApplicationController
|
|||
:type => ['StatusMessage','ActivityStreams::Photo'],
|
||||
:order => session[:sort_order] + ' DESC',
|
||||
:max_time => params[:max_time].to_i
|
||||
).includes(:comments, :mentions, :likes)
|
||||
).includes(:likes, {:comments => {:author => :profile}}, {:mentions => {:person => :profile}})
|
||||
|
||||
@posts = PostsFake.new(posts)
|
||||
if params[:only_posts]
|
||||
|
|
|
|||
|
|
@ -1,9 +1,4 @@
|
|||
class TokensController < ApplicationController
|
||||
def create
|
||||
current_user.reset_authentication_token!
|
||||
current_user.authentication_token
|
||||
redirect_to token_path, :notice => "Authentication token reset."
|
||||
end
|
||||
def show
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -60,6 +60,7 @@ HELP
|
|||
|
||||
normalize_pod_url
|
||||
normalize_admins
|
||||
normalize_pod_services
|
||||
end
|
||||
|
||||
def self.config_file_is_old_style?
|
||||
|
|
@ -92,6 +93,18 @@ HELP
|
|||
self[:admins].collect! { |username| username.downcase }
|
||||
end
|
||||
|
||||
def self.normalize_pod_services
|
||||
if defined?(SERVICES)
|
||||
connected_services = []
|
||||
SERVICES.keys.each do |service|
|
||||
unless SERVICES[service].keys.any?{|service_key| SERVICES[service][service_key].blank?}
|
||||
connected_services << service
|
||||
end
|
||||
end
|
||||
self['configured_services'] = connected_services
|
||||
end
|
||||
end
|
||||
|
||||
load!
|
||||
|
||||
def self.[] (key)
|
||||
|
|
|
|||
|
|
@ -54,6 +54,18 @@
|
|||
= t('.cubbies.explanation')
|
||||
= link_to t('.cubbies.learn_more'), token_path
|
||||
|
||||
.section
|
||||
.title
|
||||
= image_tag('/images/icons/monotone_wrench_settings.png')
|
||||
%h5
|
||||
= t('.services.heading')
|
||||
.content
|
||||
= t('.services.content')
|
||||
- AppConfig.configured_services.each do |service|
|
||||
- unless current_user.services.any?{|x| x.provider == service}
|
||||
%br= link_to service.titleize, "/auth/#{service}"
|
||||
|
||||
|
||||
- if @invites > 0
|
||||
.section
|
||||
.title
|
||||
|
|
|
|||
|
|
@ -12,13 +12,8 @@
|
|||
%b= service.nickname
|
||||
= link_to t('services.index.disconnect'), service_path(service), :confirm => t('services.index.really_disconnect', :service => service.provider), :method => :delete
|
||||
- else
|
||||
You haven't connected any services yet.
|
||||
= t('.no_services')
|
||||
|
||||
- unless @services.any?{|x| x.provider == 'twitter'}
|
||||
%h4= link_to t('services.index.connect_to_twitter'), "/auth/twitter" if SERVICES['twitter'] && SERVICES['twitter']['consumer_key']!= ""
|
||||
|
||||
- unless @services.any?{|x| x.provider == 'facebook'}
|
||||
%h4= link_to t('services.index.connect_to_facebook'), "/auth/facebook" if SERVICES['facebook'] && SERVICES['facebook']['app_id'] !=""
|
||||
|
||||
- unless @services.any?{|x| x.provider == 'tumblr'}
|
||||
%h4= link_to t('services.index.connect_to_tumblr'), "/auth/tumblr" if SERVICES['tumblr'] && SERVICES['tumblr']['consumer_key'] !=""
|
||||
- AppConfig.configured_services.each do |service|
|
||||
- unless @services.any?{|x| x.provider == service}
|
||||
%h4= link_to t("services.index.connect_to_#{service}"), "/auth/#{service}"
|
||||
|
|
|
|||
|
|
@ -13,55 +13,33 @@
|
|||
|
||||
%hr
|
||||
|
||||
.span-24{:style => "text-align:center;"}
|
||||
= image_tag '/images/cubbies_screenshot.png', :width => 600, :height => 452
|
||||
.cubbies_infographic.span-24{:style => "text-align:left;position:relative;"}
|
||||
= image_tag '/images/cubbies_screenshot2.png', :height => 452, :class => "cubbies_screenshot"
|
||||
= image_tag '/images/cubbies_collage.png', :class => "cubbies_collage"
|
||||
|
||||
.span-18.prepend-3.append-3.last{:style => "text-align:center;"}
|
||||
.span-24.last{:style => "text-align:right;"}
|
||||
%p.subtle
|
||||
!= t('.screenshot_explanation', :link1 => link_to(t('.typical_userpage'), "http://cubbi.es/daniel"), :link2 => link_to(t('.daniels_account'), "https://joindiaspora.com/people/29"))
|
||||
%br
|
||||
%hr
|
||||
|
||||
/%p.subtle
|
||||
/ Cubbi.es allows you to collect images from all across the internet and keep them in one place (your cubby) in a simple and intuative way. Hooking up your Diaspora account with Cubbi.es means the images you collect will automatically be shared on Diaspora.*
|
||||
|
||||
%br
|
||||
.span-24.last
|
||||
%h2
|
||||
= t('.making_the_connection')
|
||||
%br
|
||||
%br
|
||||
|
||||
.span-20.append-2.prepend-2.last
|
||||
.span-8
|
||||
= image_tag '/images/cubbies_settings.png', :width => 238, :height => 248, :class => "cubbies-settings-image"
|
||||
.span-24.last
|
||||
.span-10
|
||||
= image_tag '/images/connect_services.png', :class => "cubbies-settings-image"
|
||||
%div.subtle
|
||||
!= t('.via', :link => link_to('http://cubbi.es/users/edit', 'http://cubbi.es/users/edit'))
|
||||
|
||||
|
||||
.span-12.last
|
||||
%h3
|
||||
= t('.connecting_is_simple')
|
||||
!= t('.connecting_is_simple', :diaspora_id => current_user.diaspora_handle, :href_link => 'http://cubbi.es/users/edit')
|
||||
|
||||
%p.subtle
|
||||
= t('.were_working_hard')
|
||||
|
||||
%br
|
||||
|
||||
.span-11.cubbies-credentials
|
||||
.span-4
|
||||
%h5
|
||||
= t('.your_diaspora_handle')
|
||||
.span-6
|
||||
%h2
|
||||
= current_user.diaspora_handle
|
||||
.span-4
|
||||
%h5
|
||||
= t('.your_diaspora_token')
|
||||
|
||||
.span-6
|
||||
- if current_user.authentication_token
|
||||
%h2
|
||||
= current_user.authentication_token
|
||||
- else
|
||||
= form_tag(token_path) do
|
||||
= submit_tag t('.generate_a_token')
|
||||
= t('.log_in_with_diaspora_is_comming')
|
||||
|
||||
|
|
|
|||
|
|
@ -143,7 +143,7 @@ en:
|
|||
seed:
|
||||
family: "Family"
|
||||
work: "Work"
|
||||
index:
|
||||
index:
|
||||
your_aspects: "Your Aspects"
|
||||
handle_explanation: "This is your diaspora id. Like an email address, you can give this to people to reach you."
|
||||
no_contacts: "No contacts"
|
||||
|
|
@ -157,7 +157,9 @@ en:
|
|||
heading: "Diaspora ID"
|
||||
content_1: "Your Diaspora ID is:"
|
||||
content_2: "Give it to anyone and they'll be able to find you on Diaspora."
|
||||
|
||||
services:
|
||||
heading: "Connect Services"
|
||||
content: "You can connect the following services to Diaspora:"
|
||||
aspect_memberships:
|
||||
destroy:
|
||||
success: "Successfully removed person from aspect"
|
||||
|
|
@ -589,6 +591,7 @@ en:
|
|||
connect_to_facebook: "Connect to Facebook"
|
||||
connect_to_tumblr: "Connect to Tumblr"
|
||||
edit_services: "Edit services"
|
||||
no_services: 'You have not connected any services yet.'
|
||||
create:
|
||||
success: "Authentication successful."
|
||||
destroy:
|
||||
|
|
@ -701,11 +704,8 @@ en:
|
|||
typical_userpage: "A typical cubbi.es userpage"
|
||||
daniels_account: "Daniel's Diaspora account"
|
||||
making_the_connection: "Making the Connection"
|
||||
connecting_is_simple: "Connecting your Diaspora account is as simple as filling out two fields on your Cubbi.es account page."
|
||||
were_working_hard: "We're working hard on delivering easy connectivity between Diaspora pods and applications. In the meantime, connecting you Diaspora account with Cubbi.es means copying and pasting two fields."
|
||||
your_diaspora_handle: "Your Diaspora ID:"
|
||||
your_diaspora_token: "Your Diaspora Token:"
|
||||
generate_a_token: "Generate a token"
|
||||
connecting_is_simple: "Connecting your Diaspora account is simple! Just enter your Diaspora ID (<b>%{diaspora_id}</b>) from your cubbies <a href='%{href_link}'>settings page</a> and hit connect."
|
||||
log_in_with_diaspora_is_comming: "Pretty soon, you'll be able to connect to a new application without creating an account separate from your one on Diaspora."
|
||||
via: "(via %{link})"
|
||||
|
||||
authorizations:
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ Diaspora::Application.routes.draw do
|
|||
|
||||
|
||||
#Temporary token_authenticable route
|
||||
resource :token, :only => [:show, :create]
|
||||
resource :token, :only => :show
|
||||
|
||||
get 'login' => redirect('/users/sign_in')
|
||||
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ Feature: sending and receiving requests
|
|||
When I sign in as "alice@alice.alice"
|
||||
And I am on "bob@bob.bob"'s page
|
||||
|
||||
Then I should not see /^In \d aspects?$/
|
||||
Then I should see "Add to aspect"
|
||||
Then I should not see "Mention"
|
||||
Then I should not see "Message"
|
||||
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ Background:
|
|||
Then I should see "started sharing with you"
|
||||
|
||||
Scenario: notification popup
|
||||
#When I sign in as "alice@alice.alice"
|
||||
#And I click the notification badge
|
||||
#And I wait for the ajax to finish
|
||||
#Then the notification dropdown should be visible
|
||||
When I sign in as "alice@alice.alice"
|
||||
And I click the notification badge
|
||||
And I wait for the ajax to finish
|
||||
Then the notification dropdown should be visible
|
||||
|
|
|
|||
|
|
@ -151,14 +151,6 @@ When /^I search for "([^\"]*)"$/ do |search_term|
|
|||
JS
|
||||
end
|
||||
|
||||
Then /^I should( not)? see the contact dialog$/ do |not_see|
|
||||
if not_see
|
||||
wait_until { !page.find("#facebox").visible? }
|
||||
else
|
||||
wait_until { page.find("#facebox .share_with") && page.find("#facebox .share_with").visible? }
|
||||
end
|
||||
end
|
||||
|
||||
Then /^I should( not)? see an add contact button$/ do |not_see|
|
||||
expected_length = not_see ? 0 : 1
|
||||
evaluate_script("$('.add_contact a').length == #{expected_length};")
|
||||
|
|
@ -182,7 +174,7 @@ Then /^the "([^"]*)" field(?: within "([^"]*)")? should be filled with "([^"]*)"
|
|||
end
|
||||
|
||||
Then /^I should see (\d+) posts$/ do |n_posts|
|
||||
evaluate_script("$('#main_stream .stream_element').length").should == n_posts.to_i
|
||||
all("#main_stream .stream_element").length.should == n_posts.to_i
|
||||
end
|
||||
|
||||
And /^I scroll down$/ do
|
||||
|
|
@ -196,9 +188,9 @@ When /^I wait for (\d+) seconds$/ do |seconds|
|
|||
end
|
||||
|
||||
When /^I click the notification badge$/ do
|
||||
evaluate_script("$('#notification_badge a').click();");
|
||||
find(:css, "#notification_badge a").click
|
||||
end
|
||||
|
||||
Then /^the notification dropdown should be visible$/ do
|
||||
evaluate_script("$('#notification_dropdown').css('display') === 'block'")
|
||||
find(:css, "#notification_dropdown").should be_visible
|
||||
end
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ class Chubbies
|
|||
|
||||
def self.get_pid
|
||||
@pid ||= lambda {
|
||||
processes = `ps -ax -o pid,command | grep "rackup -p #{PORT}"`.split("\n")
|
||||
processes = `ps ax -o pid,command | grep "rackup -p #{PORT}"`.split("\n")
|
||||
processes = processes.select{|p| !p.include?("grep") }
|
||||
processes.first.split(" ").first
|
||||
}.call
|
||||
|
|
|
|||
|
|
@ -1,7 +1,3 @@
|
|||
When /^I click share across aspects$/ do
|
||||
find("#expand_publisher").click
|
||||
end
|
||||
|
||||
When /^I post a photo with a token$/ do
|
||||
json = JSON.parse <<JSON
|
||||
{"activity":{"actor":{"url":"http://cubbi.es/daniel","displayName":"daniel","objectType":"person"},"published":"2011-05-19T18:12:23Z","verb":"save","object":{"objectType":"photo","url":"http://i658.photobucket.com/albums/uu308/R3b3lAp3/Swagger_dog.jpg","image":{"url":"http://i658.photobucket.com/albums/uu308/R3b3lAp3/Swagger_dog.jpg","width":637,"height":469}},"provider":{"url":"http://cubbi.es/","displayName":"Cubbi.es"}}}
|
||||
|
|
@ -11,4 +7,4 @@ end
|
|||
|
||||
Then /^I should see an uploaded image within the photo drop zone$/ do
|
||||
find("#photodropzone img")["src"].should include("uploads/images")
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -70,12 +70,6 @@ Given /^I have one follower$/ do
|
|||
@me.reload
|
||||
end
|
||||
|
||||
Then /^aspect "([^"]*)" should (not )?be selected$/ do |aspect_name, not_selected|
|
||||
link_is_selected = evaluate_script("$('a:contains(\"#{aspect_name}\")').parent('li').hasClass('selected');")
|
||||
expected_value = !not_selected
|
||||
link_is_selected.should == expected_value
|
||||
end
|
||||
|
||||
Given /^a user with email "([^"]*)" is connected with "([^"]*)"$/ do |arg1, arg2|
|
||||
user1 = User.where(:email => arg1).first
|
||||
user2 = User.where(:email => arg2).first
|
||||
|
|
|
|||
|
|
@ -44,6 +44,8 @@ require File.join(File.dirname(__FILE__), "integration_sessions_controller")
|
|||
|
||||
require File.join(File.dirname(__FILE__), "..", "..", "spec", "support", "fake_redis")
|
||||
require File.join(File.dirname(__FILE__), "..", "..", "spec", "helper_methods")
|
||||
require File.join(File.dirname(__FILE__), "..", "..", "spec", "support","no_id_on_object")
|
||||
require File.join(File.dirname(__FILE__), "..", "..", "spec", "support","i18n_raise_errors")
|
||||
require File.join(File.dirname(__FILE__), "..", "..", "spec", "support","user_methods")
|
||||
include HelperMethods
|
||||
Before do
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
class IntegrationSessionsController < ApplicationController
|
||||
class IntegrationSessionsController < ActionController::Base
|
||||
def new
|
||||
@user_id = params[:user_id]
|
||||
render 'features/support/integration_sessions_form'
|
||||
render 'features/support/integration_sessions_form', :layout => false
|
||||
end
|
||||
def create
|
||||
sign_in_and_redirect User.find(params[:user_id])
|
||||
|
|
|
|||
|
|
@ -106,7 +106,8 @@ module ActiveRecord
|
|||
end
|
||||
|
||||
log_string = "event=sql name='#{payload[:name]}' ms=#{event.duration} query='#{sql}'"
|
||||
log_string << "caller_hash=#{caller.hash} binds='#{binds}' caller_with_diaspora='#{caller.grep(/diaspora\/(app|lib)/).join(';')}'"
|
||||
cleaned_trace = Rails.backtrace_cleaner.clean(caller)
|
||||
log_string << "backtrace_hash=#{cleaned_trace.hash} binds='#{binds}' application_backtrace='#{cleaned_trace.inspect}'"
|
||||
info log_string
|
||||
|
||||
end
|
||||
|
|
|
|||
|
|
@ -12,7 +12,11 @@ class Pubsubhubbub
|
|||
end
|
||||
|
||||
def publish(feed)
|
||||
response = RestClient.post(@hub, :headers => @headers, 'hub.url' => feed, 'hub.mode' => 'publish')
|
||||
response
|
||||
begin
|
||||
response = RestClient.post(@hub, :headers => @headers, 'hub.url' => feed, 'hub.mode' => 'publish')
|
||||
return response
|
||||
rescue RestClient::BadRequest=> e
|
||||
Rails.logger.warn "Public URL for your users are incorrect. this is ok if you are in development and localhost is your pod_url#{e.inspect}"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
BIN
public/images/connect_services.png
Normal file
BIN
public/images/connect_services.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 26 KiB |
BIN
public/images/cubbies_collage.png
Normal file
BIN
public/images/cubbies_collage.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 684 KiB |
BIN
public/images/cubbies_screenshot2.png
Normal file
BIN
public/images/cubbies_screenshot2.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2 MiB |
|
|
@ -2710,11 +2710,6 @@ h1.tag
|
|||
:bottom 12px
|
||||
:vertical-align top
|
||||
|
||||
.cubbies-credentials
|
||||
:background
|
||||
:color #eee
|
||||
:padding 15px
|
||||
|
||||
.cubbies-settings-image
|
||||
@include box-shadow(3px, 3px, 15px, #333)
|
||||
:margin
|
||||
|
|
@ -3047,3 +3042,19 @@ ul.left_nav
|
|||
:left 0px
|
||||
:padding
|
||||
:bottom 10px
|
||||
|
||||
.cubbies_collage
|
||||
:position absolute
|
||||
:right 50px
|
||||
:top -50px
|
||||
:z-index -1
|
||||
|
||||
.cubbies_screenshot
|
||||
:position absolute
|
||||
:right -20px
|
||||
:z-index 1
|
||||
|
||||
.cubbies_infographic
|
||||
:height 450px
|
||||
:margin
|
||||
:top 30px
|
||||
|
|
|
|||
|
|
@ -1,18 +1,9 @@
|
|||
describe TokensController do
|
||||
describe '#create' do
|
||||
it 'generates a new token for the current user' do
|
||||
sign_in bob
|
||||
lambda {
|
||||
get :create
|
||||
}.should change{ bob.reload.authentication_token }
|
||||
end
|
||||
end
|
||||
describe '#edit' do
|
||||
it 'displays a token' do
|
||||
describe '#show' do
|
||||
it 'succeeds' do
|
||||
sign_in eve
|
||||
get :create
|
||||
get :show
|
||||
response.body.should include(eve.reload.authentication_token)
|
||||
response.should be_success
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in a new issue