From c6f5b4ed161e5b6feb9acdc907dc287fc807f0cb Mon Sep 17 00:00:00 2001 From: Michael Fellinger Date: Thu, 16 Sep 2010 14:41:33 +0900 Subject: [PATCH 001/449] Basic 1.9.2 port --- Gemfile | 1 - app/models/profile.rb | 2 +- app/models/user.rb | 10 +++++----- config/application.rb | 2 +- config/environment.rb | 2 +- config/environments/development.rb | 2 +- config/initializers/socket.rb | 2 +- script/rails | 2 +- 8 files changed, 11 insertions(+), 12 deletions(-) diff --git a/Gemfile b/Gemfile index 77627808d..193cc0eb7 100644 --- a/Gemfile +++ b/Gemfile @@ -54,7 +54,6 @@ end group :development do gem 'nifty-generators' - gem 'ruby-debug' end group :deployment do diff --git a/app/models/profile.rb b/app/models/profile.rb index f03843226..23744711d 100644 --- a/app/models/profile.rb +++ b/app/models/profile.rb @@ -5,7 +5,7 @@ class Profile include MongoMapper::EmbeddedDocument - require 'lib/diaspora/webhooks' + require_relative '../../lib/diaspora/webhooks' include Diaspora::Webhooks include ROXML diff --git a/app/models/user.rb b/app/models/user.rb index d09f55ea2..d35dfb3df 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -3,9 +3,9 @@ # the COPYRIGHT file. -require 'lib/diaspora/user/friending.rb' -require 'lib/diaspora/user/querying.rb' -require 'lib/salmon/salmon' +require_relative '../../lib/diaspora/user/friending.rb' +require_relative '../../lib/diaspora/user/querying.rb' +require_relative '../../lib/salmon/salmon' class User include MongoMapper::Document @@ -295,11 +295,11 @@ class User aspect(:name => "Family") aspect(:name => "Work") end - + def self.create(opts ={}) puts opts.inspect end - + def terse_url terse = self.url.gsub(/(https?:|www\.)\/\//, '') terse = terse.chop! if terse[-1, 1] == '/' diff --git a/config/application.rb b/config/application.rb index ef8a567a5..441afd82d 100644 --- a/config/application.rb +++ b/config/application.rb @@ -13,7 +13,7 @@ require "active_resource/railtie" # you've limited to :test, :development, or :production. Bundler.require(:default, Rails.env) if defined?(Bundler) -require 'lib/mongo_mapper/bson_id' +require_relative '../lib/mongo_mapper/bson_id' module Diaspora class Application < Rails::Application # Settings in config/environments/* take precedence over those specified here. diff --git a/config/environment.rb b/config/environment.rb index dc11087dd..2548cdb9b 100644 --- a/config/environment.rb +++ b/config/environment.rb @@ -5,7 +5,7 @@ # Load the rails application -require File.expand_path('../application', __FILE__) +require_relative 'application' Haml::Template.options[:format] = :html5 # Initialize the rails application Diaspora::Application.initialize! diff --git a/config/environments/development.rb b/config/environments/development.rb index 66a0ef31a..e3987d6df 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -3,7 +3,7 @@ # the COPYRIGHT file. -require 'lib/mongo_mapper/clear_dev_memory' +require_relative '../../lib/mongo_mapper/clear_dev_memory' Diaspora::Application.configure do # Settings specified here will take precedence over those in config/environment.rb diff --git a/config/initializers/socket.rb b/config/initializers/socket.rb index 1fd09fd93..f4b6d2e4a 100644 --- a/config/initializers/socket.rb +++ b/config/initializers/socket.rb @@ -5,7 +5,7 @@ require 'em-websocket' require 'eventmachine' -require "lib/diaspora/websocket" +require_relative "../../lib/diaspora/websocket" EM.next_tick { Diaspora::WebSocket.initialize_channels diff --git a/script/rails b/script/rails index f138a34a4..f8da2cffd 100755 --- a/script/rails +++ b/script/rails @@ -1,4 +1,4 @@ -#!/usr/bin/env ruby1.8 +#!/usr/bin/env ruby # This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application. APP_PATH = File.expand_path('../../config/application', __FILE__) From ba058a39a8c857f9a7496cfc6fd6f17865e40e02 Mon Sep 17 00:00:00 2001 From: Michael Fellinger Date: Thu, 16 Sep 2010 14:50:30 +0900 Subject: [PATCH 002/449] Replace require_relative with compatible version --- Gemfile.lock | 8 -------- app/models/profile.rb | 2 +- app/models/user.rb | 6 +++--- config/application.rb | 2 +- config/environment.rb | 2 +- config/environments/development.rb | 2 +- config/initializers/socket.rb | 2 +- 7 files changed, 8 insertions(+), 16 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 007810850..4002245ca 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -107,7 +107,6 @@ GEM net-sftp (>= 2.0.0) net-ssh (>= 2.0.14) net-ssh-gateway (>= 1.0.0) - columnize (0.3.1) crack (0.1.8) daemons (1.1.0) database_cleaner (0.5.2) @@ -127,7 +126,6 @@ GEM highline (1.6.1) i18n (0.4.1) json (1.4.6) - linecache (0.43) lsof (0.3.0) mail (2.2.6.1) activesupport (>= 2.3.6) @@ -190,11 +188,6 @@ GEM rspec-rails (2.0.0.beta.17) rspec (>= 2.0.0.beta.14) webrat (>= 0.7.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) saucelabs-adapter (0.8.12) lsof (>= 0.3.0) net-ssh (>= 2.0.12) @@ -253,7 +246,6 @@ DEPENDENCIES roxml! rspec (>= 2.0.0.beta.17) rspec-rails (= 2.0.0.beta.17) - ruby-debug saucelabs-adapter (= 0.8.12) selenium-rc sprinkle! diff --git a/app/models/profile.rb b/app/models/profile.rb index 23744711d..2bb54028a 100644 --- a/app/models/profile.rb +++ b/app/models/profile.rb @@ -5,7 +5,7 @@ class Profile include MongoMapper::EmbeddedDocument - require_relative '../../lib/diaspora/webhooks' + require File.expand_path('../../../lib/diaspora/webhooks', __FILE__) include Diaspora::Webhooks include ROXML diff --git a/app/models/user.rb b/app/models/user.rb index d35dfb3df..8e7fb1373 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -3,9 +3,9 @@ # the COPYRIGHT file. -require_relative '../../lib/diaspora/user/friending.rb' -require_relative '../../lib/diaspora/user/querying.rb' -require_relative '../../lib/salmon/salmon' +require File.expand_path('../../../lib/diaspora/user/friending', __FILE__) +require File.expand_path('../../../lib/diaspora/user/querying', __FILE__) +require File.expand_path('../../../lib/salmon/salmon', __FILE__) class User include MongoMapper::Document diff --git a/config/application.rb b/config/application.rb index 441afd82d..7cfa694b2 100644 --- a/config/application.rb +++ b/config/application.rb @@ -13,7 +13,7 @@ require "active_resource/railtie" # you've limited to :test, :development, or :production. Bundler.require(:default, Rails.env) if defined?(Bundler) -require_relative '../lib/mongo_mapper/bson_id' +require File.expand_path('../../lib/mongo_mapper/bson_id', __FILE__) module Diaspora class Application < Rails::Application # Settings in config/environments/* take precedence over those specified here. diff --git a/config/environment.rb b/config/environment.rb index 2548cdb9b..dc11087dd 100644 --- a/config/environment.rb +++ b/config/environment.rb @@ -5,7 +5,7 @@ # Load the rails application -require_relative 'application' +require File.expand_path('../application', __FILE__) Haml::Template.options[:format] = :html5 # Initialize the rails application Diaspora::Application.initialize! diff --git a/config/environments/development.rb b/config/environments/development.rb index e3987d6df..713cba8c8 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -3,7 +3,7 @@ # the COPYRIGHT file. -require_relative '../../lib/mongo_mapper/clear_dev_memory' +require File.expand_path('../../../lib/mongo_mapper/clear_dev_memory', __FILE__) Diaspora::Application.configure do # Settings specified here will take precedence over those in config/environment.rb diff --git a/config/initializers/socket.rb b/config/initializers/socket.rb index f4b6d2e4a..bbeee1443 100644 --- a/config/initializers/socket.rb +++ b/config/initializers/socket.rb @@ -5,7 +5,7 @@ require 'em-websocket' require 'eventmachine' -require_relative "../../lib/diaspora/websocket" +require File.expand_path("../../../lib/diaspora/websocket", __FILE__) EM.next_tick { Diaspora::WebSocket.initialize_channels From 35c9922c612c03191b7906c5a06610faea88c3f9 Mon Sep 17 00:00:00 2001 From: Michael Fellinger Date: Thu, 16 Sep 2010 15:24:26 +0900 Subject: [PATCH 003/449] And fix some more requires --- app/controllers/publics_controller.rb | 2 +- app/models/person.rb | 2 +- app/models/post.rb | 2 +- app/models/request.rb | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/controllers/publics_controller.rb b/app/controllers/publics_controller.rb index 07cf63dc8..cd3812fe7 100644 --- a/app/controllers/publics_controller.rb +++ b/app/controllers/publics_controller.rb @@ -4,7 +4,7 @@ class PublicsController < ApplicationController - require 'lib/diaspora/parser' + require File.expand_path('../../../lib/diaspora/parser', __FILE__) include Diaspora::Parser layout false diff --git a/app/models/person.rb b/app/models/person.rb index 121fdde56..daf182832 100644 --- a/app/models/person.rb +++ b/app/models/person.rb @@ -3,7 +3,7 @@ # the COPYRIGHT file. -require 'lib/hcard' +require File.expand_path('../../../lib/hcard', __FILE__) class Person include MongoMapper::Document diff --git a/app/models/post.rb b/app/models/post.rb index e2dd53d3d..7e20354af 100644 --- a/app/models/post.rb +++ b/app/models/post.rb @@ -4,7 +4,7 @@ class Post - require 'lib/encryptable' + require File.expand_path('../../../lib/encryptable', __FILE__) include MongoMapper::Document include ApplicationHelper include ROXML diff --git a/app/models/request.rb b/app/models/request.rb index da62edd93..7082515cf 100644 --- a/app/models/request.rb +++ b/app/models/request.rb @@ -4,7 +4,7 @@ class Request - require 'lib/diaspora/webhooks' + require File.expand_path('../../../lib/diaspora/webhooks', __FILE__) include MongoMapper::Document include Diaspora::Webhooks include ROXML From ef2e393ac8a898610b80c0fba4842bc1f7bee5fc Mon Sep 17 00:00:00 2001 From: Michael Nutt Date: Thu, 16 Sep 2010 02:32:16 -0400 Subject: [PATCH 004/449] Add bin directory to gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 89b33da60..bf8a0e240 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,4 @@ gpg/diaspora-production/*.gpg gpg/*/random_seed public/uploads/* .rvmrc +/bin From 46a83324ab63b67fa3f85fcefa705aef9ab1b77b Mon Sep 17 00:00:00 2001 From: Michael Nutt Date: Thu, 16 Sep 2010 02:34:11 -0400 Subject: [PATCH 005/449] Warn if can't attach to websocket port --- config/initializers/socket.rb | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/config/initializers/socket.rb b/config/initializers/socket.rb index 1fd09fd93..a806e2553 100644 --- a/config/initializers/socket.rb +++ b/config/initializers/socket.rb @@ -9,18 +9,26 @@ require "lib/diaspora/websocket" EM.next_tick { Diaspora::WebSocket.initialize_channels - EventMachine::WebSocket.start( - :host => "0.0.0.0", - :port => APP_CONFIG[:socket_port], - :debug =>APP_CONFIG[:socket_debug]) do |ws| - ws.onopen { + begin + EventMachine::WebSocket.start( + :host => "0.0.0.0", + :port => APP_CONFIG[:socket_port], + :debug =>APP_CONFIG[:socket_debug]) do |ws| + ws.onopen { - sid = Diaspora::WebSocket.subscribe(ws.request['Path'].gsub('/',''), ws) + sid = Diaspora::WebSocket.subscribe(ws.request['Path'].gsub('/',''), ws) - ws.onmessage { |msg| SocketsController.new.incoming(msg) } + ws.onmessage { |msg| SocketsController.new.incoming(msg) } - ws.onclose { Diaspora::WebSocket.unsubscribe(ws.request['Path'].gsub('/',''), sid) } - } + ws.onclose { Diaspora::WebSocket.unsubscribe(ws.request['Path'].gsub('/',''), sid) } + } + end + rescue RuntimeError => e + if e.message =~ /no acceptor/ + raise RuntimeError, "Could not listen on port #{APP_CONFIG[:socket_port]}, perhaps another process is already using it?" + else + raise + end end } From aa6b2425638ccbf2884df53f2674b69833d73d0a Mon Sep 17 00:00:00 2001 From: Michael Nutt Date: Thu, 16 Sep 2010 03:07:39 -0400 Subject: [PATCH 006/449] websocket js should honor app socket port configuration --- app/views/js/_websocket_js.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/js/_websocket_js.haml b/app/views/js/_websocket_js.haml index 483621625..33af68cce 100644 --- a/app/views/js/_websocket_js.haml +++ b/app/views/js/_websocket_js.haml @@ -9,7 +9,7 @@ $(document).ready(function(){ function debug(str){ $("#debug").append("

" + str); }; - ws = new WebSocket("ws://#{request.host}:8080/#{CGI::escape(current_user.id.to_s)}"); + ws = new WebSocket("ws://#{request.host}:#{APP_CONFIG[:socket_port]}/#{CGI::escape(current_user.id.to_s)}"); //Attach onmessage to websocket ws.onmessage = function(evt) { From ab5e7319eef995619ef1b2896ab25bf0cd67cfca Mon Sep 17 00:00:00 2001 From: Ariel Zavala Date: Thu, 16 Sep 2010 11:46:34 -0400 Subject: [PATCH 007/449] Added I18n initializer --- config/initializers/locale.rb | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 config/initializers/locale.rb diff --git a/config/initializers/locale.rb b/config/initializers/locale.rb new file mode 100644 index 000000000..42f34a3a7 --- /dev/null +++ b/config/initializers/locale.rb @@ -0,0 +1,8 @@ +# Copyright (c) 2010, Diaspora Inc. This file is +# licensed under the Affero General Public License version 3. See +# the COPYRIGHT file. + + +# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded. +I18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s] +I18n.default_locale = :en \ No newline at end of file From 53b05e7fb3eb9735ba243bac1b6b550838fd00f7 Mon Sep 17 00:00:00 2001 From: Ariel Zavala Date: Thu, 16 Sep 2010 11:47:54 -0400 Subject: [PATCH 008/449] Added devise spanish locale --- config/locales/devise.es.yml | 42 ++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 config/locales/devise.es.yml diff --git a/config/locales/devise.es.yml b/config/locales/devise.es.yml new file mode 100644 index 000000000..70209ff79 --- /dev/null +++ b/config/locales/devise.es.yml @@ -0,0 +1,42 @@ +es: + errors: + messages: + not_found: 'no encontrado' + already_confirmed: 'ya ha sido confirmada' + not_locked: 'no está bloqueada' + + devise: + failure: + unauthenticated: 'Necesitas acceder a tu cuenta o registrarte antes de continuar.' + unconfirmed: 'Necesitas confirmar tu cuenta antes de continuar.' + locked: 'Tu cuenta esta bloqueada.' + invalid: 'Contraseña o Email incorrecto.' + invalid_token: 'Token de autenticación incorrecto.' + timeout: 'Tu sesión ha expirado, por favor accede de nuevo para continuar.' + inactive: 'Tu cuenta no ha sido activada.' + sessions: + signed_in: 'Has ingresado correctamente.' + signed_out: 'Has salido correctamente.' + passwords: + send_instructions: 'Recibirás un email con instrucciones para cambiar tu contraseña en poco minutos.' + updated: 'Tu contraseña ha sido modificada. Ya has accedido a tu cuenta.' + confirmations: + send_instructions: 'Recibirás un email con instrucciones para confirmar tu cuenta en poco minutos.' + confirmed: 'Tu cuenta ha sido confirmada. Ya has accedido a tu cuenta.' + registrations: + signed_up: 'Te has registrado correctamente. Si está disponible, te habremos enviado un email de confirmación.' + updated: 'Has actualizado tu cuenta correctamente.' + destroyed: '!Adiós! Tu cuenta ha sido cancelada. Esperamos verte pronto.' + unlocks: + send_instructions: 'Recibirás un email con instrucciones para desbloquear tu cuenta en pocos minutos.' + unlocked: 'Tu cuenta ha sido desbloqueada. Ya has accedido a tu cuenta.' + oauth_callbacks: + success: 'Has sido autorizado satisfactoriamente de la cuenta %{kind}.' + failure: 'No has sido autorizado en la cuenta %{kind} porque "%{reason}".' + mailer: + confirmation_instructions: + subject: 'Instrucciones de confirmación' + reset_password_instructions: + subject: 'Instrucciones para cambiar tu contraseña' + unlock_instructions: + subject: 'Instrucciones para desbloquear tu cuenta' \ No newline at end of file From c940955261b54d877ae8ec52dcba7e7dd54d944f Mon Sep 17 00:00:00 2001 From: Felix Gruber Date: Thu, 16 Sep 2010 19:03:08 +0200 Subject: [PATCH 009/449] initial german translation --- config/locales/devise.de.yml | 41 ++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 config/locales/devise.de.yml diff --git a/config/locales/devise.de.yml b/config/locales/devise.de.yml new file mode 100644 index 000000000..55ad12536 --- /dev/null +++ b/config/locales/devise.de.yml @@ -0,0 +1,41 @@ +# Copyright (c) 2010, Diaspora Inc. This file is +# licensed under the Affero General Public License version 3. See +# the COPYRIGHT file. + + +en: + errors: + messages: + not_found: "nicht gefunden" + already_confirmed: "wurde bereits bestätigt" + not_locked: "war nicht gesperrt" + + devise: + failure: + unauthenticated: 'Du musst dich anmelden oder registrieren um fortzufahren.' + unconfirmed: 'Du musst dein Konto bestätigen um fortzufahren.' + locked: 'Dein Konto ist gesperrt.' + invalid: 'Ungültige E-Mail-Adresse oder Passwort.' + invalid_token: 'Ungültiger Authentifizierungstoken.' + timeout: 'Deine Sitzung ist abgelaufen, bitte melde dich wieder an, um fortzufahren.' + inactive: 'Dein Konto wurde noch nicht aktiviert.' + sessions: + signed_in: 'Erfolgreich angemeldet.' + signed_out: 'Erfolgreich abgemeldet.' + passwords: + send_instructions: 'Du wirst in ein paar Minuten eine E-Mail erhalten, die beschreibt, wie du dein Passwort zurücksetzt.' + updated: 'Dein Passwort wurde erfolgreich geändert. Du bist nun angemeldet.' + confirmations: + send_instructions: 'Du wirst in ein paar Minuten eine E-Mail erhalten, die beschreibt, wie du dein Konto bestätigst.' + confirmed: 'Dein Konto wurde erfolgreich bestätigt. Du bist nun angemeldet.' + registrations: + signed_up: 'Du wurdest erfolgreich registriert. Falls aktiviert, wurde dir eine E-Mail zur Bestätigung geschickt.' + updated: 'Du hast erfolgreich dein Konto aktualisiert.' + destroyed: 'Tschüss! Dein Konto wurde erfolgreich abgemeldet. Wir hoffen dich bald wiederzusehen.' + unlocks: + send_instructions: 'Du wirst in ein paar Minuten eine E-Mail erhalten, die beschreibt, wie du dein Konto entsperren kannst.' + unlocked: 'Dein Konto wurde erfolgreich entsperrt. Du bist nun angemeldet.' + mailer: + confirmation_instructions: 'Instruktionen zur Bestätigung' + reset_password_instructions: 'Instruktionen zum Zurücksetzen des Passworts' + unlock_instructions: 'Instruktionen zum Entsperren' From 61ab7726b5c33c369c69bc36f19911511b7e4e2b Mon Sep 17 00:00:00 2001 From: Felix Gruber Date: Thu, 16 Sep 2010 19:15:36 +0200 Subject: [PATCH 010/449] change 'en' to 'de' in devise.de.yml --- config/locales/devise.de.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/locales/devise.de.yml b/config/locales/devise.de.yml index 55ad12536..516eebfed 100644 --- a/config/locales/devise.de.yml +++ b/config/locales/devise.de.yml @@ -3,7 +3,7 @@ # the COPYRIGHT file. -en: +de: errors: messages: not_found: "nicht gefunden" From 41f46c47b137f7fbc2392e3d1b45da6925471b12 Mon Sep 17 00:00:00 2001 From: ilya Date: Thu, 16 Sep 2010 11:27:05 -0700 Subject: [PATCH 011/449] removed the deploy key, not needed now that the repo is public, thx for the heads up Juha @ Enemy & Sons Ltd --- config/sprinkle/deploy_key/id_rsa | 27 -------------------------- config/sprinkle/deploy_key/id_rsa.pub | 1 - config/sprinkle/deploy_key/known_hosts | 2 -- 3 files changed, 30 deletions(-) delete mode 100644 config/sprinkle/deploy_key/id_rsa delete mode 100644 config/sprinkle/deploy_key/id_rsa.pub delete mode 100644 config/sprinkle/deploy_key/known_hosts diff --git a/config/sprinkle/deploy_key/id_rsa b/config/sprinkle/deploy_key/id_rsa deleted file mode 100644 index 133715158..000000000 --- a/config/sprinkle/deploy_key/id_rsa +++ /dev/null @@ -1,27 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIIEowIBAAKCAQEAvCyAkyAMbn+flqwLIEnPL08iY8dWpkel1wtXXjUtaINjuvZ7 -2XwK7ntnVHVRm49t+QFMWh8SpxDHnJDgb3X6uYem2DzB6L8HtuFVFN5lOUi+TeiI -LJsBmiGHc1tQwGB0jqmCG0J2QBDpDiw//ktOJNlZJfnPGY+4viSXwWpYhhh1v3ij -Inmp0+lw7z0+TyklNGVEsr6emwkgo5t20ClAQDmwy1BeYBcmtAehF55V3aSPQt1d -+hCmwl11PR6BLuGYgRirr4Xyc/GmyZVKkz8dLv40X+/Bk2D7owO+N5hf74EB1e3r -7Vu7LAfUOdtOFQJV5SWr3HTPo5vvU1oqR4VViQIBIwKCAQEApqsSy3QoRJzsb4Jw -QStuXRo0ZwEDmpc7HY2zyHg+KV5uRoKK89REMlALEEqnXeVwCG7dOeEB5G3yoJ2T -lewnNpy4WR/e8rfTofrHs2XkoHOhPbCzIDGFE3zIbXzD3ZdCqj5dS1gfl9R2picx -XZMn9MCCKPMzxi7W1ExL5dM4dsOuPRvie+nYGWvvv/LXvFTLFXDVwGXOhfDkLocv -r6STaUMj7RzLJneawOg1YS1Ivsj+Db4Q+abB4mRRhOe6igYu9Zd0ve8XAjJAHbx2 -Kzl5XKj8fhOSwXyLBh+enqHv0yLR7GaZn0odjNdUeWdD0kF9DnsL3VMa12wmNXtu -48bX3wKBgQDzPRDyYmBIKp/eStzAEmkVz98JmQQoX3tF0VrVdLK0j0nLB19jbHl8 -poHaPG8qIgGfFMwdhLOJmJ6CXa4eHffLJ0c32Ow+jQ+Is70Ssn6WSq0962WuuoWA -ARUwhyO9BaWvzTnMCYDI+dSydM26cvDmTTuvCJDbifmAkArgWGqM4wKBgQDGC9za -VTqnfBHGBXebLk/PRA8YOD9CvRrIrjylUxeSrbScK9i6v+1WK3dZCl8j7H3yYJ3B -8CT38FXxrHtGIn+5XU++fAeiLrnmNlYFCsn1nLt2SUqvODYYefxm/Vq1LQaWknHV -itnZF1CIltLLMI2w2iVCA0xRqots6gX+SMarowKBgQC7pCMEIAEhuntTthgB4lEQ -047M48Fg+TM13AQ+RBTUboliG6FbU64s9XodYdIZMC0i8slYmZHQi616gsgl3JqV -Z3F0OaBNgsLXK5HbOT0U2oWky4j0gUJqD3a/CSoyuzasMJpM8WNZNcFWd1zgSgpL -QuTmHI0BIUtxzjRGqptWvQKBgGAxpckiFSzHO9U12wI7ENJi4sKe+ie678CPJMVU -PqZUXwoGqxjg4P332uIa+wLR9AgDCsvpq45eyqiVmvYuA4XrfoEXq++wS6pU5/PS -ClK512VWzID+C6V9FDIGB3ySNmZkYy000DY+hjO2+KvVwSoDjnCFQlONWanuAuk5 -So3hAoGBALfkYFRtSilhvtjOnnil0hdyUbCcRmKeUYl2Yb/cb3JmUfi9xRur7K46 -Okwba+mnOJQT0kefFEUwsP9UPVLgppVh+llyAal1aJ5OnXn1o996TGTfNmy1aThr -aaGeAU2u8GFBiBrz9tRwzZo8ixUEZZrGFFN/n53bDHpBsbhRvHGX ------END RSA PRIVATE KEY----- diff --git a/config/sprinkle/deploy_key/id_rsa.pub b/config/sprinkle/deploy_key/id_rsa.pub deleted file mode 100644 index e0b8e3715..000000000 --- a/config/sprinkle/deploy_key/id_rsa.pub +++ /dev/null @@ -1 +0,0 @@ -ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAvCyAkyAMbn+flqwLIEnPL08iY8dWpkel1wtXXjUtaINjuvZ72XwK7ntnVHVRm49t+QFMWh8SpxDHnJDgb3X6uYem2DzB6L8HtuFVFN5lOUi+TeiILJsBmiGHc1tQwGB0jqmCG0J2QBDpDiw//ktOJNlZJfnPGY+4viSXwWpYhhh1v3ijInmp0+lw7z0+TyklNGVEsr6emwkgo5t20ClAQDmwy1BeYBcmtAehF55V3aSPQt1d+hCmwl11PR6BLuGYgRirr4Xyc/GmyZVKkz8dLv40X+/Bk2D7owO+N5hf74EB1e3r7Vu7LAfUOdtOFQJV5SWr3HTPo5vvU1oqR4VViQ== Diaspora deploy key diff --git a/config/sprinkle/deploy_key/known_hosts b/config/sprinkle/deploy_key/known_hosts deleted file mode 100644 index 6b07b19ca..000000000 --- a/config/sprinkle/deploy_key/known_hosts +++ /dev/null @@ -1,2 +0,0 @@ -|1|1DLdTjtEIabpLiLzhVOp7colQSQ=|/Nw4MuJAYIztcexQDWF3NQoEljs= ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ== -|1|j1rKwLcrA2MgHhcpdVf04ig02Hs=|Y4Jl+8HpsTyFlhSwoVxSVeRsf3k= ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ== From 443b5af4ce60b402c5cb9504137a5f7ac26a2ec6 Mon Sep 17 00:00:00 2001 From: Ariel Zavala Date: Thu, 16 Sep 2010 14:57:56 -0400 Subject: [PATCH 012/449] Added localization to aspect views --- app/views/aspects/_new_aspect.haml | 2 +- app/views/aspects/index.html.haml | 2 +- app/views/aspects/manage.html.haml | 8 ++-- app/views/aspects/show.html.haml | 2 +- config/locales/en.yml | 74 ++++++++++++++++++++++++++++++ 5 files changed, 81 insertions(+), 7 deletions(-) diff --git a/app/views/aspects/_new_aspect.haml b/app/views/aspects/_new_aspect.haml index b5bc7ace3..68ce56806 100644 --- a/app/views/aspects/_new_aspect.haml +++ b/app/views/aspects/_new_aspect.haml @@ -9,4 +9,4 @@ %p = f.label :name = f.text_field :name - = f.submit 'create', :class => 'button' + = f.submit t('.create'), :class => 'button' diff --git a/app/views/aspects/index.html.haml b/app/views/aspects/index.html.haml index 5ea9cadb3..47a68ffeb 100644 --- a/app/views/aspects/index.html.haml +++ b/app/views/aspects/index.html.haml @@ -4,7 +4,7 @@ - content_for :page_title do - = link_to "photos", albums_path(:aspect => @aspect) + = link_to t('.photos'), albums_path(:aspect => @aspect) - content_for :left_pane do diff --git a/app/views/aspects/manage.html.haml b/app/views/aspects/manage.html.haml index 8a6ed97ac..0e667a8e6 100644 --- a/app/views/aspects/manage.html.haml +++ b/app/views/aspects/manage.html.haml @@ -25,7 +25,7 @@ %ul - content_for :publish do - = link_to("add a new aspect", "#add_aspect_pane", :id => "add_aspect_button", :class => "new_aspect button", :title => "Add a new aspect") + = link_to(t('.add_a_new_aspect'), "#add_aspect_pane", :id => "add_aspect_button", :class => "new_aspect button", :title => t('.add_a_new_aspect')) @@ -37,9 +37,9 @@ %h1{:contenteditable => true}= aspect.name .tools - = link_to "add a new friend", "#add_request_pane_#{aspect.id}", :class => 'add_request_button' + = link_to t('.add_a_new_friend'), "#add_request_pane_#{aspect.id}", :class => 'add_request_button' | - = link_to "show", aspect_path(aspect) + = link_to t('.show'), aspect_path(aspect) %ul{:id => aspect.id} @@ -59,6 +59,6 @@ %p %br - = link_to 'Update Aspects', '#', :class => 'button', :id => "move_friends_link" + = link_to t('.update_aspects'), '#', :class => 'button', :id => "move_friends_link" #content_bottom diff --git a/app/views/aspects/show.html.haml b/app/views/aspects/show.html.haml index f10ccee74..d4262f838 100644 --- a/app/views/aspects/show.html.haml +++ b/app/views/aspects/show.html.haml @@ -4,7 +4,7 @@ - content_for :page_title do - = link_to "photos", albums_path(:aspect => @aspect) + = link_to t('.photos'), albums_path(:aspect => @aspect) - content_for :left_pane do = render "shared/aspect_friends" diff --git a/config/locales/en.yml b/config/locales/en.yml index 1de275cf9..975e40eef 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -8,3 +8,77 @@ en: hello: "Hello world" + layouts: + application: + edit_profile: "edit profile" + logout: "logout" + shared: + aspect_nav: + all_aspects: "All Aspects" + manage: "Manage" + manage_your_aspects: "Manage your Aspects" + sub_header: + all_aspects: "All Aspects" + manage_aspects: "Manage Aspects" + publisher: + share: "Share" + albums: + album: + you: "you" + new_album: + create: "create" + add_a_new_album: "Add a new album" + show: + edit_album: "Edit Album" + albums: "albums" + updated: "updated" + by: "by" + edit: + editing: "Editing" + updated: "updated" + are_you_sure: "Are you sure?" + delete_album: "Delete Album" + cancel: "Cancel" + index: + home: "home" + new_album: "New Album" + aspects: + index: + photos: "photos" + show: + photos: "photos" + manage: + add_a_new_aspect: "Add a new aspect" + add_a_new_friend: "Add a new friend" + show: "Show" + update_aspects: "Update Aspects" + new_aspect: + create: "Create" + users: + edit: + cancel: "Cancel" + update_profile: "Update Profile" + home: "Home" + diaspora_username: "DIASPORA USERNAME" + info: "Info" + picture: "Picture" + editing_profile: "Editing profile" + albums: "Albums" + comments: + comment: + ago: "ago" + new_comment: + comment: "Comment" + photos: + show: + prev: "prev" + full_size: "full size" + next: "next" + edit_photo: "Edit Photo" + delete_photo: "Delete Photo" + are_you_sure: "Are you sure?" + comments: "comments" + edit: + editing: "Editing" + + From 9bdd11b383bd50e4648d445cfd1e916c3a6288a6 Mon Sep 17 00:00:00 2001 From: Ariel Zavala Date: Thu, 16 Sep 2010 14:58:42 -0400 Subject: [PATCH 013/449] Added localization to album views --- app/views/albums/_album.html.haml | 2 +- app/views/albums/_new_album.haml | 4 ++-- app/views/albums/edit.html.haml | 8 ++++---- app/views/albums/index.html.haml | 6 +++--- app/views/albums/show.html.haml | 10 +++++----- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/app/views/albums/_album.html.haml b/app/views/albums/_album.html.haml index f4893ed8f..a2d2eb46b 100644 --- a/app/views/albums/_album.html.haml +++ b/app/views/albums/_album.html.haml @@ -8,7 +8,7 @@ %div.time by - = link_to ((current_user.person == post.person)? 'you' : post.person.real_name), person_path(post.person) + = link_to ((current_user.person == post.person)? t('.you') : post.person.real_name), person_path(post.person) %br = link_to(how_long_ago(post), object_path(post, :aspect => @aspect)) diff --git a/app/views/albums/_new_album.haml b/app/views/albums/_new_album.haml index 8a37cb2c0..daefe15f3 100644 --- a/app/views/albums/_new_album.haml +++ b/app/views/albums/_new_album.haml @@ -3,7 +3,7 @@ -# the COPYRIGHT file. -%h1 Add a new album +%h1=t('.add_a_new_album') = form_for Album.new do |f| = f.error_messages @@ -11,4 +11,4 @@ = f.label :name = f.text_field :name = f.hidden_field :to, :value => aspect - = f.submit 'create', :class => 'button' + = f.submit t('.create'), :class => 'button' diff --git a/app/views/albums/edit.html.haml b/app/views/albums/edit.html.haml index a4bf3aef6..4dfb2294c 100644 --- a/app/views/albums/edit.html.haml +++ b/app/views/albums/edit.html.haml @@ -6,10 +6,10 @@ .back= link_to "⇧ #{@album.name}", @album %h1.big_text - = "Editing #{@album.name}" + = "#{t('.editing')} #{@album.name}" .sub_header - ="updated #{how_long_ago(@album)}" + ="#{t('.updated')} #{how_long_ago(@album)}" - form_for @album do |a| = a.error_messages @@ -21,12 +21,12 @@ .photo_edit_block= image_tag photo.url(:thumb_medium) #submit_block - = link_to "Cancel", root_path + = link_to t('.cancel'), root_path or = a.submit .button.delete - = link_to 'Delete Album', @album, :confirm => 'Are you sure?', :method => :delete + = link_to t('.delete_album'), @album, :confirm => t('.are_you_sure'), :method => :delete #content_bottom .back diff --git a/app/views/albums/index.html.haml b/app/views/albums/index.html.haml index fa4098c18..af83b53eb 100644 --- a/app/views/albums/index.html.haml +++ b/app/views/albums/index.html.haml @@ -10,7 +10,7 @@ }); = content_for :page_title do - = link_to "◂ Home", aspects_path, :aspect => params[:aspect] + = link_to "◂ #{t('.home')}", aspects_path, :aspect => params[:aspect] - content_for :left_pane do = render "shared/aspect_friends" @@ -19,7 +19,7 @@ %h1 Albums .right - = link_to 'New Album', '#new_album_pane', {:class => "button", :id => "add_album_button"} + = link_to t('.new_album'), '#new_album_pane', {:class => "button", :id => "add_album_button"} .yo{:style => "display:none;" } #new_album_pane @@ -34,4 +34,4 @@ #content_bottom .back - = link_to "⇧ home", root_path + = link_to "⇧ #{t('.home')}", root_path diff --git a/app/views/albums/show.html.haml b/app/views/albums/show.html.haml index 843523223..56e5c617b 100644 --- a/app/views/albums/show.html.haml +++ b/app/views/albums/show.html.haml @@ -11,7 +11,7 @@ }); = content_for :page_title do - = link_to "◂ Albums", albums_path(:aspect => @aspect) + = link_to "◂ #{t('.albums')}", albums_path(:aspect => @aspect) - content_for :left_pane do = render "shared/aspect_friends" @@ -19,13 +19,13 @@ - content_for :publish do %h1 = @album.name - ="updated #{how_long_ago(@album)}" + ="#{t('.updated')} #{how_long_ago(@album)}" .album_id{:id => @album.id, :style => "display:hidden;"} -unless current_user.owns? @album - %h4= "by #{@album.person.real_name}" + %h4= "#{t('.by')} #{@album.person.real_name}" #thumbnails - for photo in @album_photos @@ -36,8 +36,8 @@ #content_bottom .back - = link_to "⇧ albums", albums_path + = link_to "⇧ #{t('.albums')}", albums_path -if current_user.owns? @album .right - = link_to 'Edit Album', edit_album_path(@album), :class => 'button' + = link_to t('.edit_album'), edit_album_path(@album), :class => 'button' From 5078830785926eaa8b368c10224a7b4fa68920ca Mon Sep 17 00:00:00 2001 From: Ariel Zavala Date: Thu, 16 Sep 2010 15:00:21 -0400 Subject: [PATCH 014/449] Added localization to comments views --- app/views/comments/_comment.html.haml | 2 +- app/views/comments/_new_comment.html.haml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/comments/_comment.html.haml b/app/views/comments/_comment.html.haml index 56252c83d..4252d9762 100644 --- a/app/views/comments/_comment.html.haml +++ b/app/views/comments/_comment.html.haml @@ -9,4 +9,4 @@ = link_to post.person.real_name, post.person = auto_link sanitize post.text %div.time - = "#{time_ago_in_words(post.updated_at)} ago" + = "#{time_ago_in_words(post.updated_at)} #{t('.ago')}" diff --git a/app/views/comments/_new_comment.html.haml b/app/views/comments/_new_comment.html.haml index e998d98b7..a4268082d 100644 --- a/app/views/comments/_new_comment.html.haml +++ b/app/views/comments/_new_comment.html.haml @@ -9,4 +9,4 @@ = f.text_area :text, :rows => 1, :id => "comment_text_on_#{post.id}", :class => "comment_box" = f.hidden_field :post_id, :value => post.id %p{:style => "text-align:right;"} - = f.submit "Comment", :class => "comment_submit button" + = f.submit t('.comment'), :class => "comment_submit button" From a673257eefda08d93d77c8c1e438376e8c0eaa83 Mon Sep 17 00:00:00 2001 From: Ariel Zavala Date: Thu, 16 Sep 2010 15:11:21 -0400 Subject: [PATCH 015/449] Added localization to photos views --- app/views/photos/_photo.haml | 2 +- app/views/photos/edit.html.haml | 4 ++-- app/views/photos/new.html.haml | 6 +++--- app/views/photos/show.html.haml | 12 ++++++------ config/locales/en.yml | 8 ++++++++ 5 files changed, 20 insertions(+), 12 deletions(-) diff --git a/app/views/photos/_photo.haml b/app/views/photos/_photo.haml index f0a3f2c83..47ddfef3e 100644 --- a/app/views/photos/_photo.haml +++ b/app/views/photos/_photo.haml @@ -21,5 +21,5 @@ .info = link_to(how_long_ago(post), photo_path(post)) \-- - = link_to "show comments (#{post.comments.count})", '#', :class => "show_post_comments" + = link_to "#{t('.show_comments')} (#{post.comments.count})", '#', :class => "show_post_comments" = render "comments/comments", :post => post diff --git a/app/views/photos/edit.html.haml b/app/views/photos/edit.html.haml index f695f850d..1f36ae99f 100644 --- a/app/views/photos/edit.html.haml +++ b/app/views/photos/edit.html.haml @@ -6,7 +6,7 @@ %h1.big_text .back = link_to "⇧ #{@album.name}", album_path(@album) - = "Editing #{@photo.image}" + = "#{t('.editing')} #{@photo.image}" %div{:id => @photo.id} @@ -22,5 +22,5 @@ = link_to "⇧ #{@album.name}", album_path(@album) -if current_user.owns? @album .button.right - = link_to 'Delete Photo', @photo, :confirm => 'Are you sure?', :method => :delete + = link_to t('.delete_photo'), @photo, :confirm => t('.are_you_sure'), :method => :delete diff --git a/app/views/photos/new.html.haml b/app/views/photos/new.html.haml index a8814d770..1fdf71a84 100644 --- a/app/views/photos/new.html.haml +++ b/app/views/photos/new.html.haml @@ -3,12 +3,12 @@ -# the COPYRIGHT file. -- title "New Photo" +- title t('.new_photo') = form_for( @photo, :html => {:multipart => true}) do |f| = f.error_messages %p = f.file_field :image - = f.submit 'post it!', :class => 'button' + = f.submit t('.post_it'), :class => 'button' -%p= link_to "Back to List", photos_path +%p= link_to t('.back_to_list'), photos_path diff --git a/app/views/photos/show.html.haml b/app/views/photos/show.html.haml index 654bea892..21ce72181 100644 --- a/app/views/photos/show.html.haml +++ b/app/views/photos/show.html.haml @@ -25,15 +25,15 @@ %h1 = @photo.image - = link_to "<< prev", url_to_prev(@photo, @album) + = link_to "<< #{t('.prev')}", url_to_prev(@photo, @album) | - = link_to "full size", @photo.url + = link_to "#{t('.full_size')}", @photo.url | - = link_to "next >>", url_to_next(@photo, @album) + = link_to "#{t('.next')} >>", url_to_next(@photo, @album) .right -if current_user.owns? @album - = link_to 'Edit Photo', edit_photo_path(@photo), :class => "button" + = link_to t('.edit_photo'), edit_photo_path(@photo), :class => "button" %div{:id => @photo.id} @@ -48,9 +48,9 @@ -if current_user.owns? @album .right - = link_to 'Delete Photo', @photo, :confirm => 'Are you sure?', :method => :delete, :class => 'button' + = link_to t('.delete_photo'), @photo, :confirm => t('.are_you_sure'), :method => :delete, :class => 'button' %h4{:class => "show_post_comments"} - = "comments (#{@photo.comments.count})" + = "#{t('.comments')} (#{@photo.comments.count})" = render "comments/comments", :post => @photo diff --git a/config/locales/en.yml b/config/locales/en.yml index 975e40eef..bfcf69939 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -80,5 +80,13 @@ en: comments: "comments" edit: editing: "Editing" + are_you_sure: "Are you sure?" + delete_photo: "Delete Photo" + photo: + show_comments: "show comments" + new: + new_photo: "New Photo" + back_to_list: "Back to List" + post_it: "post it!" From 51b6ce9dfbdd6017278704c14420dff657d2eb7b Mon Sep 17 00:00:00 2001 From: Ariel Zavala Date: Thu, 16 Sep 2010 15:11:58 -0400 Subject: [PATCH 016/449] Added localization to layouts and shared views --- app/views/layouts/application.html.haml | 4 ++-- app/views/shared/_aspect_nav.haml | 4 ++-- app/views/shared/_publisher.haml | 2 +- app/views/shared/_sub_header.haml | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index 4a3ec2dbb..7a48d7ed7 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -50,8 +50,8 @@ = text_field_tag 'q' %li= link_to current_user.real_name, current_user.person - %li= link_to "edit profile", edit_user_path(current_user) - %li= link_to "logout", destroy_user_session_path + %li= link_to t('.edit_profile'), edit_user_path(current_user) + %li= link_to t('.logout.'), destroy_user_session_path = render "shared/aspect_nav" = render "shared/sub_header" diff --git a/app/views/shared/_aspect_nav.haml b/app/views/shared/_aspect_nav.haml index b61def9f5..9ba5a5ee4 100644 --- a/app/views/shared/_aspect_nav.haml +++ b/app/views/shared/_aspect_nav.haml @@ -11,10 +11,10 @@ %ul{ :style => "position:absolute;right:0;bottom:0.01em;"} %li{:class => ("selected" if @aspect == :all)} - = link_to "All Aspects", root_url + = link_to t('.all_aspects'), root_url %li{ :style => "margin-right:0;", :class => ("selected" if @aspect == :manage)} - = link_to ( (@request_count == 0)? "manage" : "manage (#{@request_count})"), {:controller => :aspects, :action => :manage}, :class => "edit_aspect_button", :class => new_request(@request_count), :title => "Manage your Aspects" + = link_to ( (@request_count == 0)? t('.manage') : "#{t('.manage')} (#{@request_count})"), {:controller => :aspects, :action => :manage}, :class => "edit_aspect_button", :class => new_request(@request_count), :title => t('.manage_your_aspects') .yo{ :style => "display:none;"} #add_aspect_pane diff --git a/app/views/shared/_publisher.haml b/app/views/shared/_publisher.haml index 4645ec65c..9dadf4905 100644 --- a/app/views/shared/_publisher.haml +++ b/app/views/shared/_publisher.haml @@ -19,4 +19,4 @@ = check_box_tag("aspect_ids[]", aspect.id, @aspect == :all || current_aspect?(aspect) ) = aspect.name - = f.submit "Share" + = f.submit t('.share') diff --git a/app/views/shared/_sub_header.haml b/app/views/shared/_sub_header.haml index badf8783d..d8ad6c603 100644 --- a/app/views/shared/_sub_header.haml +++ b/app/views/shared/_sub_header.haml @@ -7,9 +7,9 @@ - else %h1 - if @aspect == :all - = link_to "All Aspects", root_path + = link_to t('.all_aspects'), root_path - elsif @aspect == :manage - = link_to "Manage Aspects", root_path + = link_to t('.manage_aspects'), root_path - else = link_to @aspect.name, @aspect From 9157f72e0139926d69ba261bb5faec7b693a5b3a Mon Sep 17 00:00:00 2001 From: Etienne Membrives Date: Thu, 16 Sep 2010 12:31:24 -0700 Subject: [PATCH 017/449] French localization --- config/locales/devise.fr.yml | 41 ++++++++++++++++++++++++++++++++++++ config/locales/fr.yml | 10 +++++++++ 2 files changed, 51 insertions(+) create mode 100644 config/locales/devise.fr.yml create mode 100644 config/locales/fr.yml diff --git a/config/locales/devise.fr.yml b/config/locales/devise.fr.yml new file mode 100644 index 000000000..cc8f470bd --- /dev/null +++ b/config/locales/devise.fr.yml @@ -0,0 +1,41 @@ +# Copyright (c) 2010, Diaspora Inc. This file is +# licensed under the Affero General Public License version 3. See +# the COPYRIGHT file. + + +fr: + errors: + messages: + not_found: "inconnu" + already_confirmed: "a déjà été confirmé" + not_locked: "n'est pas vérouillé" + + devise: + failure: + unauthenticated: 'Vous devez vous connecter ou vous enregistrer avant de vous connecter.' + unconfirmed: 'Vous devez vérifier votre compte avant de continuer.' + locked: 'Votre compte est vérouillé.' + invalid: 'Courriel ou mot de passe érronés.' + invalid_token: 'Jeton d'authentification non valide.' + timeout: 'Votre session a expiré, veuillez vous connecter avant de continuer.' + inactive: 'Votre compte n'a pas encore été activé.' + sessions: + signed_in: 'Connexion réussie.' + signed_out: 'Déconnexion réussie.' + passwords: + send_instructions: 'Vous allez recevoir un courriel dans quelques minutes avec les instructions pour changer votre mot de passe.' + updated: 'Votre mot de passe a été changé. Vous êtes maintenant connecté.' + confirmations: + send_instructions: 'Vous allez recevoir un courriel dans quelques minutes avec les instructions pour configurer votre compte.' + confirmed: 'Votre compte a été vérifié. Vous êtes maintenant connecté.' + registrations: + signed_up: 'Vous êtes maintenant enregistré. Si activé, un courriel de confirmation vient de vous être envoyé.' + updated: 'Votre compte a été mis à jour.' + destroyed: 'Au revoir ! Votre compte a été supprimé. Nous espérons vous revoir bientôt.' + unlocks: + send_instructions: 'Vous allez recevoir un courriel dans quelques minutes avec les instructions pour dévérouiller votre compte.' + unlocked: 'Votre compte a été dévérouillé. Vous êtes maintenant connecté.' + mailer: + confirmation_instructions: 'Comment vérifier votre compte ?' + reset_password_instructions: 'Comment changer votre mot de passe ?' + unlock_instructions: 'Comment dévérouiller votre compte ?' diff --git a/config/locales/fr.yml b/config/locales/fr.yml new file mode 100644 index 000000000..e47795485 --- /dev/null +++ b/config/locales/fr.yml @@ -0,0 +1,10 @@ +# Copyright (c) 2010, Diaspora Inc. This file is +# licensed under the Affero General Public License version 3. See +# the COPYRIGHT file. + + +# Sample localization file for English. Add more files in this directory for other locales. +# See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. + +fr: + hello: "Bonjour !" From 6a967e7fe9914dbc35ebc76c9350781187a63426 Mon Sep 17 00:00:00 2001 From: Ariel Zavala Date: Thu, 16 Sep 2010 15:47:12 -0400 Subject: [PATCH 018/449] Added localization to status message views --- app/views/status_messages/_new_status_message.haml | 4 ++-- app/views/status_messages/_status_message.html.haml | 4 ++-- app/views/status_messages/show.html.haml | 12 ++++++------ 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/app/views/status_messages/_new_status_message.haml b/app/views/status_messages/_new_status_message.haml index 329e72d66..b515dadff 100644 --- a/app/views/status_messages/_new_status_message.haml +++ b/app/views/status_messages/_new_status_message.haml @@ -6,5 +6,5 @@ = form_for StatusMessage.new, :remote => true do |f| = f.error_messages %p - = f.text_field :message, :value => "tell me something good" - = f.submit 'oh yeah!', :class => 'button' + = f.text_field :message, :value => t('.tell_me_something_good') + = f.submit t('.oh_yeah'), :class => 'button' diff --git a/app/views/status_messages/_status_message.html.haml b/app/views/status_messages/_status_message.html.haml index a22098afa..f6cac9155 100644 --- a/app/views/status_messages/_status_message.html.haml +++ b/app/views/status_messages/_status_message.html.haml @@ -15,11 +15,11 @@ .info = link_to(how_long_ago(post), object_path(post)) \-- - = link_to "show comments (#{post.comments.count})", '#', :class => "show_post_comments" + = link_to "#{t('.show_comments')} (#{post.comments.count})", '#', :class => "show_post_comments" = render "comments/comments", :post => post - if current_user.owns?(post) .destroy_link - = link_to 'Delete', status_message_path(post), :confirm => 'Are you sure?', :method => :delete, :remote => true, :class => "delete" + = link_to t('.delete'), status_message_path(post), :confirm => t('.are_you_sure'), :method => :delete, :remote => true, :class => "delete" diff --git a/app/views/status_messages/show.html.haml b/app/views/status_messages/show.html.haml index 358c2244b..b27208d2b 100644 --- a/app/views/status_messages/show.html.haml +++ b/app/views/status_messages/show.html.haml @@ -3,20 +3,20 @@ -# the COPYRIGHT file. -- title "Status Message" +- title t('.status_message') %p - %strong Message: + %strong="#{t('.message')}:" = @status_message.message %p - %strong Owner: + %strong="#{t('.owner')}:" = @status_message.person.real_name -%h4= "comments (#{@status_message.comments.count})" +%h4= "#{t('.comments')} (#{@status_message.comments.count})" = render "comments/comments", :post => @status_message %p - = link_to "Destroy", @status_message, :confirm => 'Are you sure?', :method => :delete + = link_to t('.destroy'), @status_message, :confirm => t('.are_you_sure'), :method => :delete | - = link_to "View All", status_messages_path + = link_to t('.view_all'), status_messages_path From be9ae343cc49e3124a6082c17fa8c95960607e37 Mon Sep 17 00:00:00 2001 From: Ariel Zavala Date: Thu, 16 Sep 2010 15:55:54 -0400 Subject: [PATCH 019/449] Added localizations that I had missed --- app/views/aspects/manage.html.haml | 6 ++---- app/views/registrations/new.html.haml | 2 +- app/views/shared/_aspect_friends.haml | 2 +- app/views/users/edit.html.haml | 17 ++++++++--------- config/locales/en.yml | 23 +++++++++++++++++++++++ 5 files changed, 35 insertions(+), 15 deletions(-) diff --git a/app/views/aspects/manage.html.haml b/app/views/aspects/manage.html.haml index 0e667a8e6..c8537d638 100644 --- a/app/views/aspects/manage.html.haml +++ b/app/views/aspects/manage.html.haml @@ -8,8 +8,7 @@ = javascript_include_tag 'aspect-edit.js' - content_for :left_pane do - %h1 - Requests + %h1=t('.requests') .requests %ul @@ -18,8 +17,7 @@ = person_image_tag(request.person) .name = request.person.real_name - %h1 - Ignore/Remove + %h1=t('.ignore_remove') %li.remove %ul diff --git a/app/views/registrations/new.html.haml b/app/views/registrations/new.html.haml index eefa94519..065a9aa49 100644 --- a/app/views/registrations/new.html.haml +++ b/app/views/registrations/new.html.haml @@ -27,5 +27,5 @@ = pr.label :last_name = pr.text_field :last_name - = f.submit "Sign up" + = f.submit t('.sign_up') = render :partial => "devise/shared/links" diff --git a/app/views/shared/_aspect_friends.haml b/app/views/shared/_aspect_friends.haml index 6ab286a81..5e1dfe213 100644 --- a/app/views/shared/_aspect_friends.haml +++ b/app/views/shared/_aspect_friends.haml @@ -16,5 +16,5 @@ = render "requests/new_request", :aspect => @aspect -else .clear - = link_to "add friends", aspects_manage_path + = link_to t('.add_friends'), aspects_manage_path diff --git a/app/views/users/edit.html.haml b/app/views/users/edit.html.haml index cddec8d77..406f95499 100644 --- a/app/views/users/edit.html.haml +++ b/app/views/users/edit.html.haml @@ -4,8 +4,7 @@ - content_for :publish do - %h1 - Editing profile + %h1="#{t('.editing_profile')}" - content_for :left_pane do \. @@ -15,7 +14,7 @@ = f.fields_for :profile do |p| - %h3 Picture + %h3="#{t('.picture')}" %div#image_picker = p.hidden_field :image_url, :value => (@profile.image_url.sub(@user.url,'/') if @profile.image_url), :id => 'image_url_field' @@ -32,18 +31,18 @@ - else You don't have any photos! Go to the - = link_to "albums", albums_path(:aspect => 'all') + = link_to t('.albums'), albums_path(:aspect => 'all') page to upload some. =will_paginate @photos %br - %h3 Info + %h3="#{t('.info')}" %p %b - DIASPORA USERNAME: + ="#{t('.diaspora_username')}:" = @user.diaspora_handle %p @@ -58,10 +57,10 @@ = f.text_field :email #submit_block - = link_to "Cancel", root_path + = link_to t('.cancel'), root_path or - = f.submit "Update Profile" + = f.submit t('.update_profile') #content_bottom .back - = link_to "⇧ home", root_path + = link_to "⇧ #{t('.home')}", root_path diff --git a/config/locales/en.yml b/config/locales/en.yml index bfcf69939..d9046c00b 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -22,6 +22,8 @@ en: manage_aspects: "Manage Aspects" publisher: share: "Share" + aspect_friends: + add_friends: "add friends" albums: album: you: "you" @@ -52,6 +54,8 @@ en: add_a_new_friend: "Add a new friend" show: "Show" update_aspects: "Update Aspects" + requests: "Requests" + ignore_remove: "Ignore/Remove" new_aspect: create: "Create" users: @@ -88,5 +92,24 @@ en: new_photo: "New Photo" back_to_list: "Back to List" post_it: "post it!" + registrations: + new: + sign_up: "Sign up" + status_messages: + new_status_message: + tell_me_something_good: "tell me something good" + oh_yeah: "oh yeah!" + status_message: + show_comments: "show comments" + delete: "Delete" + are_you_sure: "Are you sure?" + show: + status_message: "Status Message" + comments: "comments" + are_you_sure: "Are you sure?" + destroy: "Destroy" + view_all: "View All" + message: "Message" + owner: "Owner" From f4aeca66f8f5d2502899f1c225def64c69ad0dd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABl=20Soucaze?= Date: Thu, 16 Sep 2010 22:17:00 +0200 Subject: [PATCH 020/449] French localisation. --- config/locales/devise.fr.yml | 41 ++++++++++++++++++++++++++++++++++++ config/locales/fr.yml | 10 +++++++++ 2 files changed, 51 insertions(+) create mode 100644 config/locales/devise.fr.yml create mode 100644 config/locales/fr.yml diff --git a/config/locales/devise.fr.yml b/config/locales/devise.fr.yml new file mode 100644 index 000000000..8829de132 --- /dev/null +++ b/config/locales/devise.fr.yml @@ -0,0 +1,41 @@ +# Copyright (c) 2010, Diaspora Inc. This file is +# licensed under the Affero General Public License version 3. See +# the COPYRIGHT file. + + +en: + errors: + messages: + not_found: "introuvable" + already_confirmed: "a déjà été confirmé" + not_locked: "n’a pas été verrouillé" + + devise: + failure: + unauthenticated: 'Vous devez vous connecter ou vous inscrire avant de continuer.' + unconfirmed: 'Vous devez confirmer votre compte avant de continuer.' + locked: 'Votre compte est verrouillé.' + invalid: 'E-mail ou mot de passe invalide.' + invalid_token: 'Jeton d’authentification invalide.' + timeout: 'Votre session a expiré, veuillez vous connecter de nouveau afin de continuer.' + inactive: 'Votre compte n’a pas encore été activé.' + sessions: + signed_in: 'Connecté avec succès.' + signed_out: 'Déconnecté avec succès.' + passwords: + send_instructions: 'Vous allez recevoir dans quelques minutes un e-mail contenant des instructions vous expliquant comment réinitialiser votre mot de passe.' + updated: 'Votre mot de passe a été modifié avec succès. Vous êtes à présent connecté.' + confirmations: + send_instructions: 'Vous allez recevoir dans quelques minutes un e-mail contenant des instructions vous expliquant comment confirmer votre compte.' + confirmed: 'Votre compte a été confirmé avec succès. Vous êtes à présent connecté.' + registrations: + signed_up: 'Vous vous êtes inscrit avec succès. Si activée, une confirmation a été envoyée sur votre adresse e-mail.' + updated: 'Vous avez mis à jour votre compte avec succès.' + destroyed: 'Au revoir ! Votre compte a été résilié avec succès. Nous espérons vous revoir très bientôt.' + unlocks: + send_instructions: 'Vous allez recevoir dans quelques minutes un e-mail contenant des instructions vous expliquant comment déverrouiller votre compte.' + unlocked: 'Votre compte a été déverrouillé avec succès. Vous êtes à présent connecté.' + mailer: + confirmation_instructions: 'Instructions de confirmation' + reset_password_instructions: 'Réinitialiser les instructions du mot de passe' + unlock_instructions: 'Instructions de déverrouillage' diff --git a/config/locales/fr.yml b/config/locales/fr.yml new file mode 100644 index 000000000..641208b2a --- /dev/null +++ b/config/locales/fr.yml @@ -0,0 +1,10 @@ +# Copyright (c) 2010, Diaspora Inc. This file is +# licensed under the Affero General Public License version 3. See +# the COPYRIGHT file. + + +# Sample localization file for English. Add more files in this directory for other locales. +# See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. + +en: + hello: "Bonjour tout le monde" From 060ba12376c119134e9a33cbe4603541f1a76aeb Mon Sep 17 00:00:00 2001 From: Ariel Zavala Date: Thu, 16 Sep 2010 16:30:17 -0400 Subject: [PATCH 021/449] Started Spanish Locale --- config/locales/es.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 config/locales/es.yml diff --git a/config/locales/es.yml b/config/locales/es.yml new file mode 100644 index 000000000..11c2effdd --- /dev/null +++ b/config/locales/es.yml @@ -0,0 +1,10 @@ +# Copyright (c) 2010, Diaspora Inc. This file is +# licensed under the Affero General Public License version 3. See +# the COPYRIGHT file. + + +# Sample localization file for English. Add more files in this directory for other locales. +# See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. + +es: + hello: "Hello world" \ No newline at end of file From b7cfbd6fd709182222baff9bd4a390f9e1245811 Mon Sep 17 00:00:00 2001 From: Ariel Zavala Date: Thu, 16 Sep 2010 17:05:11 -0400 Subject: [PATCH 022/449] Moved diaspora specific locales to diaspora.en.yml and diaspora.es.yml --- config/locales/{en.yml => diaspora.en.yml} | 0 config/locales/diaspora.es.yml | 114 +++++++++ config/locales/es.yml | 268 ++++++++++++++++++++- 3 files changed, 375 insertions(+), 7 deletions(-) rename config/locales/{en.yml => diaspora.en.yml} (100%) create mode 100644 config/locales/diaspora.es.yml diff --git a/config/locales/en.yml b/config/locales/diaspora.en.yml similarity index 100% rename from config/locales/en.yml rename to config/locales/diaspora.en.yml diff --git a/config/locales/diaspora.es.yml b/config/locales/diaspora.es.yml new file mode 100644 index 000000000..f77e6f54a --- /dev/null +++ b/config/locales/diaspora.es.yml @@ -0,0 +1,114 @@ +# Copyright (c) 2010, Diaspora Inc. This file is +# licensed under the Affero General Public License version 3. See +# the COPYRIGHT file. + + +# Sample localization file for English. Add more files in this directory for other locales. +# See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. + + +es: + hello: "Hola Mundo" + layouts: + application: + edit_profile: "editar perfil" + logout: "desloguear" + shared: + aspect_nav: + all_aspects: "All Aspects" + manage: "Manejar" + manage_your_aspects: "Manage your Aspects" + sub_header: + all_aspects: "All Aspects" + manage_aspects: "Manage Aspects" + publisher: + share: "Compartir" + aspect_friends: + add_friends: "Añade amigos" + albums: + album: + you: "usted" + new_album: + create: "Crear" + add_a_new_album: "Añade un nuevo álbum" + show: + edit_album: "Editar Álbum" + albums: "álbumes" + updated: "actualizar" + by: "por" + edit: + editing: "Editando" + updated: "actualizado" + are_you_sure: "Esta seguro?" + delete_album: "Eliminar Album" + cancel: "Cancelar" + index: + home: "home" + new_album: "Nuevo Album" + aspects: + index: + photos: "fotos" + show: + photos: "fotos" + manage: + add_a_new_aspect: "Añadir nuevo aspecto" + add_a_new_friend: "Añadir nuevo amigo" + show: "Mostrar" + update_aspects: "Actualizar Aspectos" + requests: "Requests" + ignore_remove: "Ignorar/Remover" + new_aspect: + create: "Crear" + users: + edit: + cancel: "Cancelar" + update_profile: "Actualizar Perfil" + home: "Home" + diaspora_username: "USUARIO DE DIASPORA" + info: "Info" + picture: "Picture" + editing_profile: "Editando perfil" + albums: "Álbums" + comments: + comment: + ago: "atras" + new_comment: + comment: "Commentario" + photos: + show: + prev: "prev" + full_size: "tamaño actual" + next: "prox" + edit_photo: "Editar Foto" + delete_photo: "Eliminar Foto" + are_you_sure: "Esta seguro?" + comments: "comentarios" + edit: + editing: "Editando" + are_you_sure: "Esta seguro?" + delete_photo: "Eliminar Foto" + photo: + show_comments: "mostrar comentarios" + new: + new_photo: "Nueva Foto" + back_to_list: "Devuelta a la lista" + post_it: "post it!" + registrations: + new: + sign_up: "Registrar" + status_messages: + new_status_message: + tell_me_something_good: "dime algo bueno" + oh_yeah: "oh yeah!" + status_message: + show_comments: "mostrar comentarios" + delete: "Eliminar" + are_you_sure: "Esta seguro?" + show: + status_message: "Mensaje de status" + comments: "comentarios" + are_you_sure: "Esta seguro?" + destroy: "Destruir" + view_all: "Ver Todos" + message: "Mensaje" + owner: "Dueño" \ No newline at end of file diff --git a/config/locales/es.yml b/config/locales/es.yml index 11c2effdd..ad1db8794 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -1,10 +1,264 @@ -# Copyright (c) 2010, Diaspora Inc. This file is -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. +# Spanish translations for Rails +# by Francisco Fernando García Nieto (ffgarcianieto@gmail.com) +"es": + # Action View + number: + # Used in number_with_delimiter() + # These are also the defaults for 'currency', 'percentage', 'precision', and 'human' + format: + # Sets the separator between the units, for more precision (e.g. 1.0 / 2.0 == 0.5) + separator: "," + # Delimets thousands (e.g. 1,000,000 is a million) (always in groups of three) + delimiter: "." + # Number of decimals, behind the separator (1 with a precision of 2 gives: 1.00) + precision: 3 + # If set to true, precision will mean the number of significant digits instead + # of the number of decimal digits (1234 with precision 2 becomes 1200, 1.23543 becomes 1.2) + significant: false + # If set, the zeros after the decimal separator will always be stripped (eg.: 1.200 will be 1.2) + strip_insignificant_zeros: false -# Sample localization file for English. Add more files in this directory for other locales. -# See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. + # Used in number_to_currency() + currency: + format: + # Where is the currency sign? %u is the currency unit, %n the number (default: $5.00) + format: "%n %u" + unit: "€" + # These three are to override number.format and are optional + separator: "," + delimiter: "." + precision: 2 + significant: false + strip_insignificant_zeros: false -es: - hello: "Hello world" \ No newline at end of file + # Used in number_to_percentage() + percentage: + format: + # These three are to override number.format and are optional + # separator: + delimiter: "" + # precision: + + # Used in number_to_precision() + precision: + format: + # These three are to override number.format and are optional + # separator: + delimiter: "" + # precision: + # significant: false + # strip_insignificant_zeros: false + + # Used in number_to_human_size() + human: + format: + # These three are to override number.format and are optional + # separator: + delimiter: "" + precision: 1 + significant: true + strip_insignificant_zeros: true + # Used in number_to_human_size() + storage_units: + format: "%n %u" + units: + byte: + one: "Byte" + other: "Bytes" + kb: "KB" + mb: "MB" + gb: "GB" + tb: "TB" + # Used in number_to_human() + decimal_units: + format: "%n %u" + # Decimal units output formatting + # By default we will only quantify some of the exponents + # but the commented ones might be defined or overridden + # by the user. + units: + # femto: Quadrillionth + # pico: Trillionth + # nano: Billionth + # micro: Millionth + # mili: Thousandth + # centi: Hundredth + # deci: Tenth + unit: "" + # ten: + # one: Ten + # other: Tens + # hundred: Hundred + thousand: "Mil" + million: "Millón" + billion: "Mil millones" + trillion: "Trillón" + quadrillion: "Cuatrillón" + + # Used in distance_of_time_in_words(), distance_of_time_in_words_to_now(), time_ago_in_words() + datetime: + distance_in_words: + half_a_minute: "medio minuto" + less_than_x_seconds: + one: "menos de 1 segundo" + other: "menos de %{count} segundos" + x_seconds: + one: "1 segundo" + other: "%{count} segundos" + less_than_x_minutes: + one: "menos de 1 minuto" + other: "menos de %{count} minutos" + x_minutes: + one: "1 minuto" + other: "%{count} minutos" + about_x_hours: + one: "alrededor de 1 hora" + other: "alrededor de %{count} horas" + x_days: + one: "1 día" + other: "%{count} días" + about_x_months: + one: "alrededor de 1 mes" + other: "alrededor de %{count} meses" + x_months: + one: "1 mes" + other: "%{count} meses" + about_x_years: + one: "alrededor de 1 año" + other: "alrededor de %{count} años" + over_x_years: + one: "más de 1 año" + other: "más de %{count} años" + almost_x_years: + one: "casi 1 año" + other: "casi %{count} años" + prompts: + year: "Año" + month: "Mes" + day: "Día" + hour: "Hora" + minute: "Minutos" + second: "Segundos" + + helpers: + select: + # Default value for :prompt => true in FormOptionsHelper + prompt: "Por favor seleccione" + + # Default translation keys for submit FormHelper + submit: + create: 'Guardar %{model}' + update: 'Actualizar %{model}' + submit: 'Guardar %{model}' + + # Attributes names common to most models + #attributes: + #created_at: "Created at" + #updated_at: "Updated at" + + # Active Record models configuration + activerecord: + errors: + messages: + taken: "ya está en uso" + record_invalid: "La validación falló: %{errors}" + # Append your own errors here or at the model/attributes scope. + + # You can define own errors for models or model attributes. + # The values :model, :attribute and :value are always available for interpolation. + # + # For example, + # models: + # user: + # blank: "This is a custom blank message for %{model}: %{attribute}" + # attributes: + # login: + # blank: "This is a custom blank message for User login" + # Will define custom blank validation message for User model and + # custom blank validation message for login attribute of User model. + #models: + + # Translate model names. Used in Model.human_name(). + #models: + # For example, + # user: "Dude" + # will translate User model name to "Dude" + + # Translate model attribute names. Used in Model.human_attribute_name(attribute). + #attributes: + # For example, + # user: + # login: "Handle" + # will translate User attribute "login" as "Handle" + + # Active Model + errors: + # The default format to use in full error messages. + format: "%{attribute} %{message}" + + template: + header: + one: "No se pudo guardar este/a %{model} porque se encontró 1 error" + other: "No se pudo guardar este/a %{model} porque se encontraron %{count} errores" + # The variable :count is also available + body: "Se encontraron problemas con los siguientes campos:" + + # The values :model, :attribute and :value are always available for interpolation + # The value :count is available when applicable. Can be used for pluralization. + messages: + inclusion: "no está incluido en la lista" + exclusion: "está reservado" + invalid: "no es válido" + confirmation: "no coincide con la confirmación" + accepted: "debe ser aceptado" + empty: "no puede estar vacío" + blank: "no puede estar en blanco" + too_long: "es demasiado largo (%{count} caracteres máximo)" + too_short: "es demasiado corto (%{count} caracteres mínimo)" + wrong_length: "no tiene la longitud correcta (%{count} caracteres exactos)" + not_a_number: "no es un número" + greater_than: "debe ser mayor que %{count}" + greater_than_or_equal_to: "debe ser mayor que o igual a %{count}" + equal_to: "debe ser igual a %{count}" + less_than: "debe ser menor que %{count}" + less_than_or_equal_to: "debe ser menor que o igual a %{count}" + odd: "debe ser impar" + even: "debe ser par" + + # Active Support + date: + formats: + # Use the strftime parameters for formats. + # When no format has been given, it uses default. + # You can provide other formats here if you like! + default: "%e/%m/%Y" + short: "%e de %b" + long: "%e de %B de %Y" + + day_names: [Domingo, Lunes, Martes, Miércoles, Jueves, Viernes, Sábado] + abbr_day_names: [Dom, Lun, Mar, Mie, Jue, Vie, Sab] + + # Don't forget the nil at the beginning; there's no such thing as a 0th month + month_names: [~, Enero, Febrero, Marzo, Abril, Mayo, Junio, Julio, Agosto, Septiembre, Octubre, Noviembre, Diciembre] + abbr_month_names: [~, Ene, Feb, Mar, Abr, May, Jun, Jul, Ago, Sep, Oct, Nov, Dic] + # Used in date_select and datime_select. + order: + - :day + - :month + - :year + + time: + formats: + default: "%A, %e de %B de %Y %H:%M:%S %z" + short: "%e de %b %H:%M" + long: "%e de %B de %Y %H:%M" + am: "am" + pm: "pm" + + # Used in array.to_sentence. + support: + array: + words_connector: ", " + two_words_connector: " y " + last_word_connector: ", y " \ No newline at end of file From d7ca279fa9859bf384274a3a0bba51299e30498b Mon Sep 17 00:00:00 2001 From: Ariel Zavala Date: Thu, 16 Sep 2010 17:27:26 -0400 Subject: [PATCH 023/449] Revert "Moved diaspora specific locales to diaspora.en.yml and diaspora.es.yml" This reverts commit b7cfbd6fd709182222baff9bd4a390f9e1245811. --- config/locales/diaspora.es.yml | 114 --------- config/locales/{diaspora.en.yml => en.yml} | 0 config/locales/es.yml | 268 +-------------------- 3 files changed, 7 insertions(+), 375 deletions(-) delete mode 100644 config/locales/diaspora.es.yml rename config/locales/{diaspora.en.yml => en.yml} (100%) diff --git a/config/locales/diaspora.es.yml b/config/locales/diaspora.es.yml deleted file mode 100644 index f77e6f54a..000000000 --- a/config/locales/diaspora.es.yml +++ /dev/null @@ -1,114 +0,0 @@ -# Copyright (c) 2010, Diaspora Inc. This file is -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - - -# Sample localization file for English. Add more files in this directory for other locales. -# See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. - - -es: - hello: "Hola Mundo" - layouts: - application: - edit_profile: "editar perfil" - logout: "desloguear" - shared: - aspect_nav: - all_aspects: "All Aspects" - manage: "Manejar" - manage_your_aspects: "Manage your Aspects" - sub_header: - all_aspects: "All Aspects" - manage_aspects: "Manage Aspects" - publisher: - share: "Compartir" - aspect_friends: - add_friends: "Añade amigos" - albums: - album: - you: "usted" - new_album: - create: "Crear" - add_a_new_album: "Añade un nuevo álbum" - show: - edit_album: "Editar Álbum" - albums: "álbumes" - updated: "actualizar" - by: "por" - edit: - editing: "Editando" - updated: "actualizado" - are_you_sure: "Esta seguro?" - delete_album: "Eliminar Album" - cancel: "Cancelar" - index: - home: "home" - new_album: "Nuevo Album" - aspects: - index: - photos: "fotos" - show: - photos: "fotos" - manage: - add_a_new_aspect: "Añadir nuevo aspecto" - add_a_new_friend: "Añadir nuevo amigo" - show: "Mostrar" - update_aspects: "Actualizar Aspectos" - requests: "Requests" - ignore_remove: "Ignorar/Remover" - new_aspect: - create: "Crear" - users: - edit: - cancel: "Cancelar" - update_profile: "Actualizar Perfil" - home: "Home" - diaspora_username: "USUARIO DE DIASPORA" - info: "Info" - picture: "Picture" - editing_profile: "Editando perfil" - albums: "Álbums" - comments: - comment: - ago: "atras" - new_comment: - comment: "Commentario" - photos: - show: - prev: "prev" - full_size: "tamaño actual" - next: "prox" - edit_photo: "Editar Foto" - delete_photo: "Eliminar Foto" - are_you_sure: "Esta seguro?" - comments: "comentarios" - edit: - editing: "Editando" - are_you_sure: "Esta seguro?" - delete_photo: "Eliminar Foto" - photo: - show_comments: "mostrar comentarios" - new: - new_photo: "Nueva Foto" - back_to_list: "Devuelta a la lista" - post_it: "post it!" - registrations: - new: - sign_up: "Registrar" - status_messages: - new_status_message: - tell_me_something_good: "dime algo bueno" - oh_yeah: "oh yeah!" - status_message: - show_comments: "mostrar comentarios" - delete: "Eliminar" - are_you_sure: "Esta seguro?" - show: - status_message: "Mensaje de status" - comments: "comentarios" - are_you_sure: "Esta seguro?" - destroy: "Destruir" - view_all: "Ver Todos" - message: "Mensaje" - owner: "Dueño" \ No newline at end of file diff --git a/config/locales/diaspora.en.yml b/config/locales/en.yml similarity index 100% rename from config/locales/diaspora.en.yml rename to config/locales/en.yml diff --git a/config/locales/es.yml b/config/locales/es.yml index ad1db8794..11c2effdd 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -1,264 +1,10 @@ -# Spanish translations for Rails -# by Francisco Fernando García Nieto (ffgarcianieto@gmail.com) +# Copyright (c) 2010, Diaspora Inc. This file is +# licensed under the Affero General Public License version 3. See +# the COPYRIGHT file. -"es": - # Action View - number: - # Used in number_with_delimiter() - # These are also the defaults for 'currency', 'percentage', 'precision', and 'human' - format: - # Sets the separator between the units, for more precision (e.g. 1.0 / 2.0 == 0.5) - separator: "," - # Delimets thousands (e.g. 1,000,000 is a million) (always in groups of three) - delimiter: "." - # Number of decimals, behind the separator (1 with a precision of 2 gives: 1.00) - precision: 3 - # If set to true, precision will mean the number of significant digits instead - # of the number of decimal digits (1234 with precision 2 becomes 1200, 1.23543 becomes 1.2) - significant: false - # If set, the zeros after the decimal separator will always be stripped (eg.: 1.200 will be 1.2) - strip_insignificant_zeros: false - # Used in number_to_currency() - currency: - format: - # Where is the currency sign? %u is the currency unit, %n the number (default: $5.00) - format: "%n %u" - unit: "€" - # These three are to override number.format and are optional - separator: "," - delimiter: "." - precision: 2 - significant: false - strip_insignificant_zeros: false +# Sample localization file for English. Add more files in this directory for other locales. +# See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. - # Used in number_to_percentage() - percentage: - format: - # These three are to override number.format and are optional - # separator: - delimiter: "" - # precision: - - # Used in number_to_precision() - precision: - format: - # These three are to override number.format and are optional - # separator: - delimiter: "" - # precision: - # significant: false - # strip_insignificant_zeros: false - - # Used in number_to_human_size() - human: - format: - # These three are to override number.format and are optional - # separator: - delimiter: "" - precision: 1 - significant: true - strip_insignificant_zeros: true - # Used in number_to_human_size() - storage_units: - format: "%n %u" - units: - byte: - one: "Byte" - other: "Bytes" - kb: "KB" - mb: "MB" - gb: "GB" - tb: "TB" - # Used in number_to_human() - decimal_units: - format: "%n %u" - # Decimal units output formatting - # By default we will only quantify some of the exponents - # but the commented ones might be defined or overridden - # by the user. - units: - # femto: Quadrillionth - # pico: Trillionth - # nano: Billionth - # micro: Millionth - # mili: Thousandth - # centi: Hundredth - # deci: Tenth - unit: "" - # ten: - # one: Ten - # other: Tens - # hundred: Hundred - thousand: "Mil" - million: "Millón" - billion: "Mil millones" - trillion: "Trillón" - quadrillion: "Cuatrillón" - - # Used in distance_of_time_in_words(), distance_of_time_in_words_to_now(), time_ago_in_words() - datetime: - distance_in_words: - half_a_minute: "medio minuto" - less_than_x_seconds: - one: "menos de 1 segundo" - other: "menos de %{count} segundos" - x_seconds: - one: "1 segundo" - other: "%{count} segundos" - less_than_x_minutes: - one: "menos de 1 minuto" - other: "menos de %{count} minutos" - x_minutes: - one: "1 minuto" - other: "%{count} minutos" - about_x_hours: - one: "alrededor de 1 hora" - other: "alrededor de %{count} horas" - x_days: - one: "1 día" - other: "%{count} días" - about_x_months: - one: "alrededor de 1 mes" - other: "alrededor de %{count} meses" - x_months: - one: "1 mes" - other: "%{count} meses" - about_x_years: - one: "alrededor de 1 año" - other: "alrededor de %{count} años" - over_x_years: - one: "más de 1 año" - other: "más de %{count} años" - almost_x_years: - one: "casi 1 año" - other: "casi %{count} años" - prompts: - year: "Año" - month: "Mes" - day: "Día" - hour: "Hora" - minute: "Minutos" - second: "Segundos" - - helpers: - select: - # Default value for :prompt => true in FormOptionsHelper - prompt: "Por favor seleccione" - - # Default translation keys for submit FormHelper - submit: - create: 'Guardar %{model}' - update: 'Actualizar %{model}' - submit: 'Guardar %{model}' - - # Attributes names common to most models - #attributes: - #created_at: "Created at" - #updated_at: "Updated at" - - # Active Record models configuration - activerecord: - errors: - messages: - taken: "ya está en uso" - record_invalid: "La validación falló: %{errors}" - # Append your own errors here or at the model/attributes scope. - - # You can define own errors for models or model attributes. - # The values :model, :attribute and :value are always available for interpolation. - # - # For example, - # models: - # user: - # blank: "This is a custom blank message for %{model}: %{attribute}" - # attributes: - # login: - # blank: "This is a custom blank message for User login" - # Will define custom blank validation message for User model and - # custom blank validation message for login attribute of User model. - #models: - - # Translate model names. Used in Model.human_name(). - #models: - # For example, - # user: "Dude" - # will translate User model name to "Dude" - - # Translate model attribute names. Used in Model.human_attribute_name(attribute). - #attributes: - # For example, - # user: - # login: "Handle" - # will translate User attribute "login" as "Handle" - - # Active Model - errors: - # The default format to use in full error messages. - format: "%{attribute} %{message}" - - template: - header: - one: "No se pudo guardar este/a %{model} porque se encontró 1 error" - other: "No se pudo guardar este/a %{model} porque se encontraron %{count} errores" - # The variable :count is also available - body: "Se encontraron problemas con los siguientes campos:" - - # The values :model, :attribute and :value are always available for interpolation - # The value :count is available when applicable. Can be used for pluralization. - messages: - inclusion: "no está incluido en la lista" - exclusion: "está reservado" - invalid: "no es válido" - confirmation: "no coincide con la confirmación" - accepted: "debe ser aceptado" - empty: "no puede estar vacío" - blank: "no puede estar en blanco" - too_long: "es demasiado largo (%{count} caracteres máximo)" - too_short: "es demasiado corto (%{count} caracteres mínimo)" - wrong_length: "no tiene la longitud correcta (%{count} caracteres exactos)" - not_a_number: "no es un número" - greater_than: "debe ser mayor que %{count}" - greater_than_or_equal_to: "debe ser mayor que o igual a %{count}" - equal_to: "debe ser igual a %{count}" - less_than: "debe ser menor que %{count}" - less_than_or_equal_to: "debe ser menor que o igual a %{count}" - odd: "debe ser impar" - even: "debe ser par" - - # Active Support - date: - formats: - # Use the strftime parameters for formats. - # When no format has been given, it uses default. - # You can provide other formats here if you like! - default: "%e/%m/%Y" - short: "%e de %b" - long: "%e de %B de %Y" - - day_names: [Domingo, Lunes, Martes, Miércoles, Jueves, Viernes, Sábado] - abbr_day_names: [Dom, Lun, Mar, Mie, Jue, Vie, Sab] - - # Don't forget the nil at the beginning; there's no such thing as a 0th month - month_names: [~, Enero, Febrero, Marzo, Abril, Mayo, Junio, Julio, Agosto, Septiembre, Octubre, Noviembre, Diciembre] - abbr_month_names: [~, Ene, Feb, Mar, Abr, May, Jun, Jul, Ago, Sep, Oct, Nov, Dic] - # Used in date_select and datime_select. - order: - - :day - - :month - - :year - - time: - formats: - default: "%A, %e de %B de %Y %H:%M:%S %z" - short: "%e de %b %H:%M" - long: "%e de %B de %Y %H:%M" - am: "am" - pm: "pm" - - # Used in array.to_sentence. - support: - array: - words_connector: ", " - two_words_connector: " y " - last_word_connector: ", y " \ No newline at end of file +es: + hello: "Hello world" \ No newline at end of file From 8f56178bd2ac468a53561404c1138163c5336a92 Mon Sep 17 00:00:00 2001 From: Ariel Zavala Date: Thu, 16 Sep 2010 17:29:25 -0400 Subject: [PATCH 024/449] added diaspora site specific localization files --- config/locales/diaspora.en.yml | 115 ++++++++++++++ config/locales/diaspora.es.yml | 114 ++++++++++++++ config/locales/es.yml | 268 ++++++++++++++++++++++++++++++++- 3 files changed, 490 insertions(+), 7 deletions(-) create mode 100644 config/locales/diaspora.en.yml create mode 100644 config/locales/diaspora.es.yml diff --git a/config/locales/diaspora.en.yml b/config/locales/diaspora.en.yml new file mode 100644 index 000000000..d9046c00b --- /dev/null +++ b/config/locales/diaspora.en.yml @@ -0,0 +1,115 @@ +# Copyright (c) 2010, Diaspora Inc. This file is +# licensed under the Affero General Public License version 3. See +# the COPYRIGHT file. + + +# Sample localization file for English. Add more files in this directory for other locales. +# See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. + +en: + hello: "Hello world" + layouts: + application: + edit_profile: "edit profile" + logout: "logout" + shared: + aspect_nav: + all_aspects: "All Aspects" + manage: "Manage" + manage_your_aspects: "Manage your Aspects" + sub_header: + all_aspects: "All Aspects" + manage_aspects: "Manage Aspects" + publisher: + share: "Share" + aspect_friends: + add_friends: "add friends" + albums: + album: + you: "you" + new_album: + create: "create" + add_a_new_album: "Add a new album" + show: + edit_album: "Edit Album" + albums: "albums" + updated: "updated" + by: "by" + edit: + editing: "Editing" + updated: "updated" + are_you_sure: "Are you sure?" + delete_album: "Delete Album" + cancel: "Cancel" + index: + home: "home" + new_album: "New Album" + aspects: + index: + photos: "photos" + show: + photos: "photos" + manage: + add_a_new_aspect: "Add a new aspect" + add_a_new_friend: "Add a new friend" + show: "Show" + update_aspects: "Update Aspects" + requests: "Requests" + ignore_remove: "Ignore/Remove" + new_aspect: + create: "Create" + users: + edit: + cancel: "Cancel" + update_profile: "Update Profile" + home: "Home" + diaspora_username: "DIASPORA USERNAME" + info: "Info" + picture: "Picture" + editing_profile: "Editing profile" + albums: "Albums" + comments: + comment: + ago: "ago" + new_comment: + comment: "Comment" + photos: + show: + prev: "prev" + full_size: "full size" + next: "next" + edit_photo: "Edit Photo" + delete_photo: "Delete Photo" + are_you_sure: "Are you sure?" + comments: "comments" + edit: + editing: "Editing" + are_you_sure: "Are you sure?" + delete_photo: "Delete Photo" + photo: + show_comments: "show comments" + new: + new_photo: "New Photo" + back_to_list: "Back to List" + post_it: "post it!" + registrations: + new: + sign_up: "Sign up" + status_messages: + new_status_message: + tell_me_something_good: "tell me something good" + oh_yeah: "oh yeah!" + status_message: + show_comments: "show comments" + delete: "Delete" + are_you_sure: "Are you sure?" + show: + status_message: "Status Message" + comments: "comments" + are_you_sure: "Are you sure?" + destroy: "Destroy" + view_all: "View All" + message: "Message" + owner: "Owner" + + diff --git a/config/locales/diaspora.es.yml b/config/locales/diaspora.es.yml new file mode 100644 index 000000000..f77e6f54a --- /dev/null +++ b/config/locales/diaspora.es.yml @@ -0,0 +1,114 @@ +# Copyright (c) 2010, Diaspora Inc. This file is +# licensed under the Affero General Public License version 3. See +# the COPYRIGHT file. + + +# Sample localization file for English. Add more files in this directory for other locales. +# See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. + + +es: + hello: "Hola Mundo" + layouts: + application: + edit_profile: "editar perfil" + logout: "desloguear" + shared: + aspect_nav: + all_aspects: "All Aspects" + manage: "Manejar" + manage_your_aspects: "Manage your Aspects" + sub_header: + all_aspects: "All Aspects" + manage_aspects: "Manage Aspects" + publisher: + share: "Compartir" + aspect_friends: + add_friends: "Añade amigos" + albums: + album: + you: "usted" + new_album: + create: "Crear" + add_a_new_album: "Añade un nuevo álbum" + show: + edit_album: "Editar Álbum" + albums: "álbumes" + updated: "actualizar" + by: "por" + edit: + editing: "Editando" + updated: "actualizado" + are_you_sure: "Esta seguro?" + delete_album: "Eliminar Album" + cancel: "Cancelar" + index: + home: "home" + new_album: "Nuevo Album" + aspects: + index: + photos: "fotos" + show: + photos: "fotos" + manage: + add_a_new_aspect: "Añadir nuevo aspecto" + add_a_new_friend: "Añadir nuevo amigo" + show: "Mostrar" + update_aspects: "Actualizar Aspectos" + requests: "Requests" + ignore_remove: "Ignorar/Remover" + new_aspect: + create: "Crear" + users: + edit: + cancel: "Cancelar" + update_profile: "Actualizar Perfil" + home: "Home" + diaspora_username: "USUARIO DE DIASPORA" + info: "Info" + picture: "Picture" + editing_profile: "Editando perfil" + albums: "Álbums" + comments: + comment: + ago: "atras" + new_comment: + comment: "Commentario" + photos: + show: + prev: "prev" + full_size: "tamaño actual" + next: "prox" + edit_photo: "Editar Foto" + delete_photo: "Eliminar Foto" + are_you_sure: "Esta seguro?" + comments: "comentarios" + edit: + editing: "Editando" + are_you_sure: "Esta seguro?" + delete_photo: "Eliminar Foto" + photo: + show_comments: "mostrar comentarios" + new: + new_photo: "Nueva Foto" + back_to_list: "Devuelta a la lista" + post_it: "post it!" + registrations: + new: + sign_up: "Registrar" + status_messages: + new_status_message: + tell_me_something_good: "dime algo bueno" + oh_yeah: "oh yeah!" + status_message: + show_comments: "mostrar comentarios" + delete: "Eliminar" + are_you_sure: "Esta seguro?" + show: + status_message: "Mensaje de status" + comments: "comentarios" + are_you_sure: "Esta seguro?" + destroy: "Destruir" + view_all: "Ver Todos" + message: "Mensaje" + owner: "Dueño" \ No newline at end of file diff --git a/config/locales/es.yml b/config/locales/es.yml index 11c2effdd..ad1db8794 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -1,10 +1,264 @@ -# Copyright (c) 2010, Diaspora Inc. This file is -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. +# Spanish translations for Rails +# by Francisco Fernando García Nieto (ffgarcianieto@gmail.com) +"es": + # Action View + number: + # Used in number_with_delimiter() + # These are also the defaults for 'currency', 'percentage', 'precision', and 'human' + format: + # Sets the separator between the units, for more precision (e.g. 1.0 / 2.0 == 0.5) + separator: "," + # Delimets thousands (e.g. 1,000,000 is a million) (always in groups of three) + delimiter: "." + # Number of decimals, behind the separator (1 with a precision of 2 gives: 1.00) + precision: 3 + # If set to true, precision will mean the number of significant digits instead + # of the number of decimal digits (1234 with precision 2 becomes 1200, 1.23543 becomes 1.2) + significant: false + # If set, the zeros after the decimal separator will always be stripped (eg.: 1.200 will be 1.2) + strip_insignificant_zeros: false -# Sample localization file for English. Add more files in this directory for other locales. -# See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. + # Used in number_to_currency() + currency: + format: + # Where is the currency sign? %u is the currency unit, %n the number (default: $5.00) + format: "%n %u" + unit: "€" + # These three are to override number.format and are optional + separator: "," + delimiter: "." + precision: 2 + significant: false + strip_insignificant_zeros: false -es: - hello: "Hello world" \ No newline at end of file + # Used in number_to_percentage() + percentage: + format: + # These three are to override number.format and are optional + # separator: + delimiter: "" + # precision: + + # Used in number_to_precision() + precision: + format: + # These three are to override number.format and are optional + # separator: + delimiter: "" + # precision: + # significant: false + # strip_insignificant_zeros: false + + # Used in number_to_human_size() + human: + format: + # These three are to override number.format and are optional + # separator: + delimiter: "" + precision: 1 + significant: true + strip_insignificant_zeros: true + # Used in number_to_human_size() + storage_units: + format: "%n %u" + units: + byte: + one: "Byte" + other: "Bytes" + kb: "KB" + mb: "MB" + gb: "GB" + tb: "TB" + # Used in number_to_human() + decimal_units: + format: "%n %u" + # Decimal units output formatting + # By default we will only quantify some of the exponents + # but the commented ones might be defined or overridden + # by the user. + units: + # femto: Quadrillionth + # pico: Trillionth + # nano: Billionth + # micro: Millionth + # mili: Thousandth + # centi: Hundredth + # deci: Tenth + unit: "" + # ten: + # one: Ten + # other: Tens + # hundred: Hundred + thousand: "Mil" + million: "Millón" + billion: "Mil millones" + trillion: "Trillón" + quadrillion: "Cuatrillón" + + # Used in distance_of_time_in_words(), distance_of_time_in_words_to_now(), time_ago_in_words() + datetime: + distance_in_words: + half_a_minute: "medio minuto" + less_than_x_seconds: + one: "menos de 1 segundo" + other: "menos de %{count} segundos" + x_seconds: + one: "1 segundo" + other: "%{count} segundos" + less_than_x_minutes: + one: "menos de 1 minuto" + other: "menos de %{count} minutos" + x_minutes: + one: "1 minuto" + other: "%{count} minutos" + about_x_hours: + one: "alrededor de 1 hora" + other: "alrededor de %{count} horas" + x_days: + one: "1 día" + other: "%{count} días" + about_x_months: + one: "alrededor de 1 mes" + other: "alrededor de %{count} meses" + x_months: + one: "1 mes" + other: "%{count} meses" + about_x_years: + one: "alrededor de 1 año" + other: "alrededor de %{count} años" + over_x_years: + one: "más de 1 año" + other: "más de %{count} años" + almost_x_years: + one: "casi 1 año" + other: "casi %{count} años" + prompts: + year: "Año" + month: "Mes" + day: "Día" + hour: "Hora" + minute: "Minutos" + second: "Segundos" + + helpers: + select: + # Default value for :prompt => true in FormOptionsHelper + prompt: "Por favor seleccione" + + # Default translation keys for submit FormHelper + submit: + create: 'Guardar %{model}' + update: 'Actualizar %{model}' + submit: 'Guardar %{model}' + + # Attributes names common to most models + #attributes: + #created_at: "Created at" + #updated_at: "Updated at" + + # Active Record models configuration + activerecord: + errors: + messages: + taken: "ya está en uso" + record_invalid: "La validación falló: %{errors}" + # Append your own errors here or at the model/attributes scope. + + # You can define own errors for models or model attributes. + # The values :model, :attribute and :value are always available for interpolation. + # + # For example, + # models: + # user: + # blank: "This is a custom blank message for %{model}: %{attribute}" + # attributes: + # login: + # blank: "This is a custom blank message for User login" + # Will define custom blank validation message for User model and + # custom blank validation message for login attribute of User model. + #models: + + # Translate model names. Used in Model.human_name(). + #models: + # For example, + # user: "Dude" + # will translate User model name to "Dude" + + # Translate model attribute names. Used in Model.human_attribute_name(attribute). + #attributes: + # For example, + # user: + # login: "Handle" + # will translate User attribute "login" as "Handle" + + # Active Model + errors: + # The default format to use in full error messages. + format: "%{attribute} %{message}" + + template: + header: + one: "No se pudo guardar este/a %{model} porque se encontró 1 error" + other: "No se pudo guardar este/a %{model} porque se encontraron %{count} errores" + # The variable :count is also available + body: "Se encontraron problemas con los siguientes campos:" + + # The values :model, :attribute and :value are always available for interpolation + # The value :count is available when applicable. Can be used for pluralization. + messages: + inclusion: "no está incluido en la lista" + exclusion: "está reservado" + invalid: "no es válido" + confirmation: "no coincide con la confirmación" + accepted: "debe ser aceptado" + empty: "no puede estar vacío" + blank: "no puede estar en blanco" + too_long: "es demasiado largo (%{count} caracteres máximo)" + too_short: "es demasiado corto (%{count} caracteres mínimo)" + wrong_length: "no tiene la longitud correcta (%{count} caracteres exactos)" + not_a_number: "no es un número" + greater_than: "debe ser mayor que %{count}" + greater_than_or_equal_to: "debe ser mayor que o igual a %{count}" + equal_to: "debe ser igual a %{count}" + less_than: "debe ser menor que %{count}" + less_than_or_equal_to: "debe ser menor que o igual a %{count}" + odd: "debe ser impar" + even: "debe ser par" + + # Active Support + date: + formats: + # Use the strftime parameters for formats. + # When no format has been given, it uses default. + # You can provide other formats here if you like! + default: "%e/%m/%Y" + short: "%e de %b" + long: "%e de %B de %Y" + + day_names: [Domingo, Lunes, Martes, Miércoles, Jueves, Viernes, Sábado] + abbr_day_names: [Dom, Lun, Mar, Mie, Jue, Vie, Sab] + + # Don't forget the nil at the beginning; there's no such thing as a 0th month + month_names: [~, Enero, Febrero, Marzo, Abril, Mayo, Junio, Julio, Agosto, Septiembre, Octubre, Noviembre, Diciembre] + abbr_month_names: [~, Ene, Feb, Mar, Abr, May, Jun, Jul, Ago, Sep, Oct, Nov, Dic] + # Used in date_select and datime_select. + order: + - :day + - :month + - :year + + time: + formats: + default: "%A, %e de %B de %Y %H:%M:%S %z" + short: "%e de %b %H:%M" + long: "%e de %B de %Y %H:%M" + am: "am" + pm: "pm" + + # Used in array.to_sentence. + support: + array: + words_connector: ", " + two_words_connector: " y " + last_word_connector: ", y " \ No newline at end of file From 541eb5cb956c7ceb1c2270aca49d79390d98a101 Mon Sep 17 00:00:00 2001 From: Etienne Membrives Date: Thu, 16 Sep 2010 14:45:00 -0700 Subject: [PATCH 025/449] Beggining of French localization --- config/locales/fr.yml | 109 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 107 insertions(+), 2 deletions(-) diff --git a/config/locales/fr.yml b/config/locales/fr.yml index e47795485..bc13d341d 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -3,8 +3,113 @@ # the COPYRIGHT file. -# Sample localization file for English. Add more files in this directory for other locales. +# Localization file for French. Add more files in this directory for other locales. # See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. fr: - hello: "Bonjour !" + hello: "Bonjour tout le monde" + layouts: + application: + edit_profile: "Éditez votre profil" + logout: "Déconnexion" + shared: + aspect_nav: + all_aspects: "Tous les Aspects" + manage: "Gérez" + manage_your_aspects: "Gérez vos Aspects" + sub_header: + all_aspects: "Tous les Aspects" + manage_aspects: "Gérez vos Aspects" + publisher: + share: "Partager" + aspect_friends: + add_friends: "Ajouter des amis" + albums: + album: + you: "vous" + new_album: + create: "créer" + add_a_new_album: "Ajouter un nouvel album" + show: + edit_album: "Éditer l'album" + albums: "albums" + updated: "mis à jour" + by: "par" + edit: + editing: "Édition" + updated: "mis à jour" + are_you_sure: "Êtes-vous sûr?" + delete_album: "Supprimer l'album" + cancel: "Annuler" + index: + home: "accueil" + new_album: "Nouvel album" + aspects: + index: + photos: "photos" + show: + photos: "photos" + manage: + add_a_new_aspect: "Ajouter un nouvel aspect" + add_a_new_friend: "Ajouter un nouvel amis" + show: "Voir" + update_aspects: "Mettre à jour les aspects" + requests: "Requêtes" + ignore_remove: "Ignorer/Supprimer" + new_aspect: + create: "Créer" + users: + edit: + cancel: "Annuler"" + update_profile: "Mise à jour du profil" + home: "Accueil" + diaspora_username: "NOM D'UTILISATEUR DIASPORA" + info: "Info" + picture: "Photo" + editing_profile: "Édition du profil" + albums: "Albums" + comments: + comment: + ago: "plus tôt" + new_comment: + comment: "Commentaire" + photos: + show: + prev: "précédent + full_size: "taille réelle" + next: "suivant" + edit_photo: "Éditer la photo" + delete_photo: "Supprimer la photo" + are_you_sure: "Êtes-vous sûr?" + comments: "commentaires" + edit: + editing: "Édition" + are_you_sure: "Êtes-vous sûr?" + delete_photo: "Delete Photo" + photo: + show_comments: "show comments" + new: + new_photo: "New Photo" + back_to_list: "Back to List" + post_it: "post it!" + registrations: + new: + sign_up: "Sign up" + status_messages: + new_status_message: + tell_me_something_good: "tell me something good" + oh_yeah: "oh yeah!" + status_message: + show_comments: "show comments" + delete: "Delete" + are_you_sure: "Are you sure?" + show: + status_message: "Status Message" + comments: "comments" + are_you_sure: "Are you sure?" + destroy: "Destroy" + view_all: "View All" + message: "Message" + owner: "Owner" + + From aeedf2fc22058403176375237eb8fdca031b0825 Mon Sep 17 00:00:00 2001 From: Claudius Coenen Date: Thu, 16 Sep 2010 23:55:57 +0200 Subject: [PATCH 026/449] adding german translation --- config/locales/de.yml | 116 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 116 insertions(+) create mode 100644 config/locales/de.yml diff --git a/config/locales/de.yml b/config/locales/de.yml new file mode 100644 index 000000000..23617a3f3 --- /dev/null +++ b/config/locales/de.yml @@ -0,0 +1,116 @@ +# Copyright (c) 2010, Diaspora Inc. This file is +# licensed under the Affero General Public License version 3. See +# the COPYRIGHT file. + + +# Sample localization file for English. Add more files in this directory for other locales. +# See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. + +de: + hello: "Hallo Welt" + layouts: + application: + edit_profile: "Profil bearbeiten" + logout: "Ausloggen" + shared: + aspect_nav: + all_aspects: "Alle Aspekte" + manage: "Verwalten" + manage_your_aspects: "Aspekte verwalten" + sub_header: + all_aspects: "Alle Aspekte" + manage_aspects: "Aspekte verwalten" + publisher: + share: "Teilen" + aspect_friends: + add_friends: "Freunde hinzufügen" + albums: + album: + you: "dir" + new_album: + create: "erstellen" + add_a_new_album: "Album hinzufügen" + show: + edit_album: "Album bearbeiten" + albums: "Alben" + updated: "aktualisiert" + by: "von" + edit: + editing: "Bearbeite" + updated: "geändert" + are_you_sure: "Bist du sicher?" + delete_album: "Album löschen" + cancel: "Abbrechen" + index: + home: "Startseite" + new_album: "Neues Album" + aspects: + index: + photos: "Fotos" + show: + photos: "Fotos" + manage: + add_a_new_aspect: "Neuen Aspekt erstellen" + add_a_new_friend: "Freund hinzufügen" + show: "Anzeigen" + update_aspects: "Aspekte aktualisieren" + requests: "Anfragen" + ignore_remove: "Ignorieren/Entfernen" + new_aspect: + create: "Erstellen" + users: + edit: + cancel: "Abbrechen" + update_profile: "Profil aktualisieren" + home: "Startseite" + diaspora_username: "Diaspora Benutzername" + info: "Info" + picture: "Bild" + editing_profile: "Profil bearbeiten" + albums: "Alben" + comments: + comment: + # this won't work in german at all. Needs more thorough I18n + ago: "ago" + new_comment: + comment: "Kommentar" + photos: + show: + prev: "zurück" + full_size: "volle Größe" + next: "vor" + edit_photo: "Foto bearbeiten" + delete_photo: "Foto löschen" + are_you_sure: "Bist du sicher?" + comments: "Kommentare" + edit: + editing: "Bearbeite" + are_you_sure: "Bist du sicher?" + delete_photo: "Foto löschen" + photo: + show_comments: "Kommentare anzeigen" + new: + new_photo: "Foto erstellen" + back_to_list: "Zurück zur Liste" + post_it: "Hochladen" + registrations: + new: + sign_up: "Anmelden" + status_messages: + new_status_message: + tell_me_something_good: "Erzähl' mir was schönes!" + oh_yeah: "Hey, super!" + status_message: + show_comments: "Kommentare anzeigen" + delete: "Löschen" + are_you_sure: "Bist du sicher?" + show: + status_message: "Statusmeldung" + comments: "Kommentare" + are_you_sure: "Bist du sicher?" + destroy: "Löschen" + view_all: "Alle anzeigen" + message: "Nachricht" + owner: "Besitzer" + + From 4d8c83adaddea210483cbb6378af1c9386d09761 Mon Sep 17 00:00:00 2001 From: Guido Serra aka Zeph Date: Thu, 16 Sep 2010 23:56:47 +0200 Subject: [PATCH 027/449] issue #9 on github: missing OsX/MongoDB info --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 89ea0ae19..e25a764d1 100644 --- a/README.md +++ b/README.md @@ -184,6 +184,8 @@ If you installed the Ubuntu package, MongoDB should already be running (if not, If you installed the Fedora package, MongoDB will need to be started via `service mongodb start`. If you installed the binary manually, run `sudo mongod` from where mongo is installed to start mongo. +If you installed the OsX package through "brew", MongoDB will need to be started via `sudo launchctl load org.mongodb.mongod.plist`. (before you have to go to /Library/LaunchDaemons and add a symlink to /usr/local/Cellar/mongodb/1.6.2-x86_64/org.mongodb.mongod.plist) + Diaspora will not run unless mongo is running. Mongo will not run by default, and will need to be started every time you wish to use or run the test suite for Diaspora. ### Run the app server From ed54c50f486681b81eaa0aad7a6bd5ce3ec8c580 Mon Sep 17 00:00:00 2001 From: Etienne Membrives Date: Thu, 16 Sep 2010 15:14:05 -0700 Subject: [PATCH 028/449] French localization done --- config/locales/fr.yml | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/config/locales/fr.yml b/config/locales/fr.yml index bc13d341d..72f585409 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -85,31 +85,31 @@ fr: edit: editing: "Édition" are_you_sure: "Êtes-vous sûr?" - delete_photo: "Delete Photo" + delete_photo: "Supprimer la photo" photo: - show_comments: "show comments" + show_comments: "Montrer les commentaires" new: - new_photo: "New Photo" - back_to_list: "Back to List" - post_it: "post it!" + new_photo: "Nouvelle photo" + back_to_list: "Retour à la liste" + post_it: "postez le !" registrations: new: - sign_up: "Sign up" + sign_up: "Enregistrement" status_messages: new_status_message: - tell_me_something_good: "tell me something good" + tell_me_something_good: "Dites quelque-chose de bien" oh_yeah: "oh yeah!" status_message: - show_comments: "show comments" - delete: "Delete" - are_you_sure: "Are you sure?" + show_comments: "Montrer les commentaires" + delete: "Suppression" + are_you_sure: "Êtes-vous sûr ?" show: status_message: "Status Message" - comments: "comments" - are_you_sure: "Are you sure?" - destroy: "Destroy" - view_all: "View All" + comments: "commentaires" + are_you_sure: "Êtes-vous sûr ?" + destroy: "Destruction" + view_all: "Tout voir" message: "Message" - owner: "Owner" + owner: "Propriétaire" From 5197c1b3ec8ea0b9a96d4530a3a551174d158227 Mon Sep 17 00:00:00 2001 From: Claudius Coenen Date: Fri, 17 Sep 2010 00:23:35 +0200 Subject: [PATCH 029/449] adding localisation for controller's flash messages' --- app/controllers/albums_controller.rb | 8 ++++---- config/locales/de.yml | 7 +++++++ config/locales/en.yml | 9 ++++++++- 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/app/controllers/albums_controller.rb b/app/controllers/albums_controller.rb index 5a75616d1..1a577f645 100644 --- a/app/controllers/albums_controller.rb +++ b/app/controllers/albums_controller.rb @@ -17,7 +17,7 @@ class AlbumsController < ApplicationController def create aspect = params[:album][:to] @album = current_user.post(:album, params[:album]) - flash[:notice] = "You've created an album called #{@album.name}." + flash[:notice] = I18n.t('albums.create.success', :name => @album.name) redirect_to :action => :show, :id => @album.id, :aspect => aspect end @@ -28,7 +28,7 @@ class AlbumsController < ApplicationController def destroy @album = Album.find_by_id params[:id] @album.destroy - flash[:notice] = "Album #{@album.name} deleted." + flash[:notice] = I18n.t('albums.destroy.success', :name => @album.name) respond_with :location => albums_url end @@ -48,10 +48,10 @@ class AlbumsController < ApplicationController def update @album = Album.find_params_by_id params[:id] if @album.update_attributes params[:album] - flash[:notice] = "Album #{@album.name} successfully edited." + flash[:notice] = I18n.t('albums.update.success', :name => @album.name) respond_with @album else - flash[:error] = "Failed to edit album #{@album.name}." + flash[:error] = I18n.t('albums.update.failure', :name => @album.name) render :action => :edit end end diff --git a/config/locales/de.yml b/config/locales/de.yml index 23617a3f3..c67d87550 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -30,6 +30,8 @@ de: new_album: create: "erstellen" add_a_new_album: "Album hinzufügen" + create: + success: Du hast das Album %{name} erstellt. show: edit_album: "Album bearbeiten" albums: "Alben" @@ -41,9 +43,14 @@ de: are_you_sure: "Bist du sicher?" delete_album: "Album löschen" cancel: "Abbrechen" + update: + success: Album %{name} erfolgreich geändert. + failure: %{name} wurde nicht geändert. index: home: "Startseite" new_album: "Neues Album" + destroy: + success: Album %{name} gelöscht. aspects: index: photos: "Fotos" diff --git a/config/locales/en.yml b/config/locales/en.yml index d9046c00b..87a96b009 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -30,6 +30,8 @@ en: new_album: create: "create" add_a_new_album: "Add a new album" + create: + success: You've created an album called %{name}. show: edit_album: "Edit Album" albums: "albums" @@ -41,10 +43,15 @@ en: are_you_sure: "Are you sure?" delete_album: "Delete Album" cancel: "Cancel" + update: + success: Album %{name} successfully edited. + failure: Failed to edit album %{name}. index: home: "home" new_album: "New Album" - aspects: + destroy: + success: Album %{name} deleted. + aspects: index: photos: "photos" show: From 4ce2505a6578288b8d3d9b8f93eb7bf52c67b5a2 Mon Sep 17 00:00:00 2001 From: Guido Serra aka Zeph Date: Fri, 17 Sep 2010 00:24:30 +0200 Subject: [PATCH 030/449] wrong! fullpath required --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e25a764d1..c12f989bf 100644 --- a/README.md +++ b/README.md @@ -184,7 +184,7 @@ If you installed the Ubuntu package, MongoDB should already be running (if not, If you installed the Fedora package, MongoDB will need to be started via `service mongodb start`. If you installed the binary manually, run `sudo mongod` from where mongo is installed to start mongo. -If you installed the OsX package through "brew", MongoDB will need to be started via `sudo launchctl load org.mongodb.mongod.plist`. (before you have to go to /Library/LaunchDaemons and add a symlink to /usr/local/Cellar/mongodb/1.6.2-x86_64/org.mongodb.mongod.plist) +If you installed the OsX package through "brew", MongoDB will need to be started via `sudo launchctl load /Library/LaunchDaemons/org.mongodb.mongod.plist`. (before you have to go to /Library/LaunchDaemons and add a symlink to /usr/local/Cellar/mongodb/1.6.2-x86_64/org.mongodb.mongod.plist) Diaspora will not run unless mongo is running. Mongo will not run by default, and will need to be started every time you wish to use or run the test suite for Diaspora. From 07138041b03e3ab674556284e2fe886264ccfd4b Mon Sep 17 00:00:00 2001 From: Ariel Zavala Date: Thu, 16 Sep 2010 23:35:57 -0400 Subject: [PATCH 031/449] Fixed album controller errors --- app/controllers/albums_controller.rb | 8 +- app/views/users/edit.html.haml | 4 +- config/locales/de.yml | 14 +- config/locales/defaults/es.yml | 264 +++++++++++++++ config/locales/{ => devise}/devise.de.yml | 0 config/locales/{ => devise}/devise.en.yml | 0 config/locales/{ => devise}/devise.es.yml | 0 config/locales/{ => devise}/devise.fr.yml | 0 config/locales/diaspora.en.yml | 115 ------- config/locales/diaspora.es.yml | 114 ------- config/locales/en.yml | 16 +- config/locales/es.yml | 379 +++++++--------------- 12 files changed, 406 insertions(+), 508 deletions(-) create mode 100644 config/locales/defaults/es.yml rename config/locales/{ => devise}/devise.de.yml (100%) rename config/locales/{ => devise}/devise.en.yml (100%) rename config/locales/{ => devise}/devise.es.yml (100%) rename config/locales/{ => devise}/devise.fr.yml (100%) delete mode 100644 config/locales/diaspora.en.yml delete mode 100644 config/locales/diaspora.es.yml diff --git a/app/controllers/albums_controller.rb b/app/controllers/albums_controller.rb index a063c0372..117c76afa 100644 --- a/app/controllers/albums_controller.rb +++ b/app/controllers/albums_controller.rb @@ -17,7 +17,7 @@ class AlbumsController < ApplicationController def create aspect = params[:album][:to] @album = current_user.post(:album, params[:album]) - flash[:notice] = I18n.t('albums.create.success', :name => @album.name) + flash[:notice] = I18n.t 'albums.create.success', :name => @album.name redirect_to :action => :show, :id => @album.id, :aspect => aspect end @@ -28,7 +28,7 @@ class AlbumsController < ApplicationController def destroy @album = Album.find_by_id params[:id] @album.destroy - flash[:notice] = I18n.t('albums.destroy.success', :name => @album.name) + flash[:notice] = I18n.t 'albums.destroy.success', :name => @album.name respond_with :location => albums_url end @@ -48,10 +48,10 @@ class AlbumsController < ApplicationController def update @album = Album.find_by_id params[:id] if @album.update_attributes params[:album] - flash[:notice] = I18n.t('albums.update.success', :name => @album.name) + flash[:notice] = I18n.t 'albums.update.success', :name => @album.name respond_with @album else - flash[:error] = I18n.t('albums.update.failure', :name => @album.name) + flash[:error] = I18n.t 'albums.update.failure', :name => @album.name render :action => :edit end end diff --git a/app/views/users/edit.html.haml b/app/views/users/edit.html.haml index 406f95499..42263b230 100644 --- a/app/views/users/edit.html.haml +++ b/app/views/users/edit.html.haml @@ -30,9 +30,9 @@ = link_to image_tag(photo.url(:thumb_medium)), "#" - else - You don't have any photos! Go to the + =t('.you_dont_have_any_photos') = link_to t('.albums'), albums_path(:aspect => 'all') - page to upload some. + =t('.page_to_upload_some') =will_paginate @photos diff --git a/config/locales/de.yml b/config/locales/de.yml index c67d87550..5b78d0e68 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -30,8 +30,6 @@ de: new_album: create: "erstellen" add_a_new_album: "Album hinzufügen" - create: - success: Du hast das Album %{name} erstellt. show: edit_album: "Album bearbeiten" albums: "Alben" @@ -43,14 +41,16 @@ de: are_you_sure: "Bist du sicher?" delete_album: "Album löschen" cancel: "Abbrechen" - update: - success: Album %{name} erfolgreich geändert. - failure: %{name} wurde nicht geändert. index: home: "Startseite" new_album: "Neues Album" + create: + success: "Du hast das Album %{name} erstellt." + update: + success: "Album %{name} erfolgreich geändert." + failure: "%{name} wurde nicht geändert." destroy: - success: Album %{name} gelöscht. + success: "Album %{name} gelöscht." aspects: index: photos: "Fotos" @@ -75,6 +75,8 @@ de: picture: "Bild" editing_profile: "Profil bearbeiten" albums: "Alben" + you_dont_have_any_photos: "#TODO" + page_to_upload_some: "#TODO" comments: comment: # this won't work in german at all. Needs more thorough I18n diff --git a/config/locales/defaults/es.yml b/config/locales/defaults/es.yml new file mode 100644 index 000000000..ad1db8794 --- /dev/null +++ b/config/locales/defaults/es.yml @@ -0,0 +1,264 @@ +# Spanish translations for Rails +# by Francisco Fernando García Nieto (ffgarcianieto@gmail.com) + +"es": + # Action View + number: + # Used in number_with_delimiter() + # These are also the defaults for 'currency', 'percentage', 'precision', and 'human' + format: + # Sets the separator between the units, for more precision (e.g. 1.0 / 2.0 == 0.5) + separator: "," + # Delimets thousands (e.g. 1,000,000 is a million) (always in groups of three) + delimiter: "." + # Number of decimals, behind the separator (1 with a precision of 2 gives: 1.00) + precision: 3 + # If set to true, precision will mean the number of significant digits instead + # of the number of decimal digits (1234 with precision 2 becomes 1200, 1.23543 becomes 1.2) + significant: false + # If set, the zeros after the decimal separator will always be stripped (eg.: 1.200 will be 1.2) + strip_insignificant_zeros: false + + # Used in number_to_currency() + currency: + format: + # Where is the currency sign? %u is the currency unit, %n the number (default: $5.00) + format: "%n %u" + unit: "€" + # These three are to override number.format and are optional + separator: "," + delimiter: "." + precision: 2 + significant: false + strip_insignificant_zeros: false + + # Used in number_to_percentage() + percentage: + format: + # These three are to override number.format and are optional + # separator: + delimiter: "" + # precision: + + # Used in number_to_precision() + precision: + format: + # These three are to override number.format and are optional + # separator: + delimiter: "" + # precision: + # significant: false + # strip_insignificant_zeros: false + + # Used in number_to_human_size() + human: + format: + # These three are to override number.format and are optional + # separator: + delimiter: "" + precision: 1 + significant: true + strip_insignificant_zeros: true + # Used in number_to_human_size() + storage_units: + format: "%n %u" + units: + byte: + one: "Byte" + other: "Bytes" + kb: "KB" + mb: "MB" + gb: "GB" + tb: "TB" + # Used in number_to_human() + decimal_units: + format: "%n %u" + # Decimal units output formatting + # By default we will only quantify some of the exponents + # but the commented ones might be defined or overridden + # by the user. + units: + # femto: Quadrillionth + # pico: Trillionth + # nano: Billionth + # micro: Millionth + # mili: Thousandth + # centi: Hundredth + # deci: Tenth + unit: "" + # ten: + # one: Ten + # other: Tens + # hundred: Hundred + thousand: "Mil" + million: "Millón" + billion: "Mil millones" + trillion: "Trillón" + quadrillion: "Cuatrillón" + + # Used in distance_of_time_in_words(), distance_of_time_in_words_to_now(), time_ago_in_words() + datetime: + distance_in_words: + half_a_minute: "medio minuto" + less_than_x_seconds: + one: "menos de 1 segundo" + other: "menos de %{count} segundos" + x_seconds: + one: "1 segundo" + other: "%{count} segundos" + less_than_x_minutes: + one: "menos de 1 minuto" + other: "menos de %{count} minutos" + x_minutes: + one: "1 minuto" + other: "%{count} minutos" + about_x_hours: + one: "alrededor de 1 hora" + other: "alrededor de %{count} horas" + x_days: + one: "1 día" + other: "%{count} días" + about_x_months: + one: "alrededor de 1 mes" + other: "alrededor de %{count} meses" + x_months: + one: "1 mes" + other: "%{count} meses" + about_x_years: + one: "alrededor de 1 año" + other: "alrededor de %{count} años" + over_x_years: + one: "más de 1 año" + other: "más de %{count} años" + almost_x_years: + one: "casi 1 año" + other: "casi %{count} años" + prompts: + year: "Año" + month: "Mes" + day: "Día" + hour: "Hora" + minute: "Minutos" + second: "Segundos" + + helpers: + select: + # Default value for :prompt => true in FormOptionsHelper + prompt: "Por favor seleccione" + + # Default translation keys for submit FormHelper + submit: + create: 'Guardar %{model}' + update: 'Actualizar %{model}' + submit: 'Guardar %{model}' + + # Attributes names common to most models + #attributes: + #created_at: "Created at" + #updated_at: "Updated at" + + # Active Record models configuration + activerecord: + errors: + messages: + taken: "ya está en uso" + record_invalid: "La validación falló: %{errors}" + # Append your own errors here or at the model/attributes scope. + + # You can define own errors for models or model attributes. + # The values :model, :attribute and :value are always available for interpolation. + # + # For example, + # models: + # user: + # blank: "This is a custom blank message for %{model}: %{attribute}" + # attributes: + # login: + # blank: "This is a custom blank message for User login" + # Will define custom blank validation message for User model and + # custom blank validation message for login attribute of User model. + #models: + + # Translate model names. Used in Model.human_name(). + #models: + # For example, + # user: "Dude" + # will translate User model name to "Dude" + + # Translate model attribute names. Used in Model.human_attribute_name(attribute). + #attributes: + # For example, + # user: + # login: "Handle" + # will translate User attribute "login" as "Handle" + + # Active Model + errors: + # The default format to use in full error messages. + format: "%{attribute} %{message}" + + template: + header: + one: "No se pudo guardar este/a %{model} porque se encontró 1 error" + other: "No se pudo guardar este/a %{model} porque se encontraron %{count} errores" + # The variable :count is also available + body: "Se encontraron problemas con los siguientes campos:" + + # The values :model, :attribute and :value are always available for interpolation + # The value :count is available when applicable. Can be used for pluralization. + messages: + inclusion: "no está incluido en la lista" + exclusion: "está reservado" + invalid: "no es válido" + confirmation: "no coincide con la confirmación" + accepted: "debe ser aceptado" + empty: "no puede estar vacío" + blank: "no puede estar en blanco" + too_long: "es demasiado largo (%{count} caracteres máximo)" + too_short: "es demasiado corto (%{count} caracteres mínimo)" + wrong_length: "no tiene la longitud correcta (%{count} caracteres exactos)" + not_a_number: "no es un número" + greater_than: "debe ser mayor que %{count}" + greater_than_or_equal_to: "debe ser mayor que o igual a %{count}" + equal_to: "debe ser igual a %{count}" + less_than: "debe ser menor que %{count}" + less_than_or_equal_to: "debe ser menor que o igual a %{count}" + odd: "debe ser impar" + even: "debe ser par" + + # Active Support + date: + formats: + # Use the strftime parameters for formats. + # When no format has been given, it uses default. + # You can provide other formats here if you like! + default: "%e/%m/%Y" + short: "%e de %b" + long: "%e de %B de %Y" + + day_names: [Domingo, Lunes, Martes, Miércoles, Jueves, Viernes, Sábado] + abbr_day_names: [Dom, Lun, Mar, Mie, Jue, Vie, Sab] + + # Don't forget the nil at the beginning; there's no such thing as a 0th month + month_names: [~, Enero, Febrero, Marzo, Abril, Mayo, Junio, Julio, Agosto, Septiembre, Octubre, Noviembre, Diciembre] + abbr_month_names: [~, Ene, Feb, Mar, Abr, May, Jun, Jul, Ago, Sep, Oct, Nov, Dic] + # Used in date_select and datime_select. + order: + - :day + - :month + - :year + + time: + formats: + default: "%A, %e de %B de %Y %H:%M:%S %z" + short: "%e de %b %H:%M" + long: "%e de %B de %Y %H:%M" + am: "am" + pm: "pm" + + # Used in array.to_sentence. + support: + array: + words_connector: ", " + two_words_connector: " y " + last_word_connector: ", y " \ No newline at end of file diff --git a/config/locales/devise.de.yml b/config/locales/devise/devise.de.yml similarity index 100% rename from config/locales/devise.de.yml rename to config/locales/devise/devise.de.yml diff --git a/config/locales/devise.en.yml b/config/locales/devise/devise.en.yml similarity index 100% rename from config/locales/devise.en.yml rename to config/locales/devise/devise.en.yml diff --git a/config/locales/devise.es.yml b/config/locales/devise/devise.es.yml similarity index 100% rename from config/locales/devise.es.yml rename to config/locales/devise/devise.es.yml diff --git a/config/locales/devise.fr.yml b/config/locales/devise/devise.fr.yml similarity index 100% rename from config/locales/devise.fr.yml rename to config/locales/devise/devise.fr.yml diff --git a/config/locales/diaspora.en.yml b/config/locales/diaspora.en.yml deleted file mode 100644 index d9046c00b..000000000 --- a/config/locales/diaspora.en.yml +++ /dev/null @@ -1,115 +0,0 @@ -# Copyright (c) 2010, Diaspora Inc. This file is -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - - -# Sample localization file for English. Add more files in this directory for other locales. -# See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. - -en: - hello: "Hello world" - layouts: - application: - edit_profile: "edit profile" - logout: "logout" - shared: - aspect_nav: - all_aspects: "All Aspects" - manage: "Manage" - manage_your_aspects: "Manage your Aspects" - sub_header: - all_aspects: "All Aspects" - manage_aspects: "Manage Aspects" - publisher: - share: "Share" - aspect_friends: - add_friends: "add friends" - albums: - album: - you: "you" - new_album: - create: "create" - add_a_new_album: "Add a new album" - show: - edit_album: "Edit Album" - albums: "albums" - updated: "updated" - by: "by" - edit: - editing: "Editing" - updated: "updated" - are_you_sure: "Are you sure?" - delete_album: "Delete Album" - cancel: "Cancel" - index: - home: "home" - new_album: "New Album" - aspects: - index: - photos: "photos" - show: - photos: "photos" - manage: - add_a_new_aspect: "Add a new aspect" - add_a_new_friend: "Add a new friend" - show: "Show" - update_aspects: "Update Aspects" - requests: "Requests" - ignore_remove: "Ignore/Remove" - new_aspect: - create: "Create" - users: - edit: - cancel: "Cancel" - update_profile: "Update Profile" - home: "Home" - diaspora_username: "DIASPORA USERNAME" - info: "Info" - picture: "Picture" - editing_profile: "Editing profile" - albums: "Albums" - comments: - comment: - ago: "ago" - new_comment: - comment: "Comment" - photos: - show: - prev: "prev" - full_size: "full size" - next: "next" - edit_photo: "Edit Photo" - delete_photo: "Delete Photo" - are_you_sure: "Are you sure?" - comments: "comments" - edit: - editing: "Editing" - are_you_sure: "Are you sure?" - delete_photo: "Delete Photo" - photo: - show_comments: "show comments" - new: - new_photo: "New Photo" - back_to_list: "Back to List" - post_it: "post it!" - registrations: - new: - sign_up: "Sign up" - status_messages: - new_status_message: - tell_me_something_good: "tell me something good" - oh_yeah: "oh yeah!" - status_message: - show_comments: "show comments" - delete: "Delete" - are_you_sure: "Are you sure?" - show: - status_message: "Status Message" - comments: "comments" - are_you_sure: "Are you sure?" - destroy: "Destroy" - view_all: "View All" - message: "Message" - owner: "Owner" - - diff --git a/config/locales/diaspora.es.yml b/config/locales/diaspora.es.yml deleted file mode 100644 index f77e6f54a..000000000 --- a/config/locales/diaspora.es.yml +++ /dev/null @@ -1,114 +0,0 @@ -# Copyright (c) 2010, Diaspora Inc. This file is -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - - -# Sample localization file for English. Add more files in this directory for other locales. -# See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. - - -es: - hello: "Hola Mundo" - layouts: - application: - edit_profile: "editar perfil" - logout: "desloguear" - shared: - aspect_nav: - all_aspects: "All Aspects" - manage: "Manejar" - manage_your_aspects: "Manage your Aspects" - sub_header: - all_aspects: "All Aspects" - manage_aspects: "Manage Aspects" - publisher: - share: "Compartir" - aspect_friends: - add_friends: "Añade amigos" - albums: - album: - you: "usted" - new_album: - create: "Crear" - add_a_new_album: "Añade un nuevo álbum" - show: - edit_album: "Editar Álbum" - albums: "álbumes" - updated: "actualizar" - by: "por" - edit: - editing: "Editando" - updated: "actualizado" - are_you_sure: "Esta seguro?" - delete_album: "Eliminar Album" - cancel: "Cancelar" - index: - home: "home" - new_album: "Nuevo Album" - aspects: - index: - photos: "fotos" - show: - photos: "fotos" - manage: - add_a_new_aspect: "Añadir nuevo aspecto" - add_a_new_friend: "Añadir nuevo amigo" - show: "Mostrar" - update_aspects: "Actualizar Aspectos" - requests: "Requests" - ignore_remove: "Ignorar/Remover" - new_aspect: - create: "Crear" - users: - edit: - cancel: "Cancelar" - update_profile: "Actualizar Perfil" - home: "Home" - diaspora_username: "USUARIO DE DIASPORA" - info: "Info" - picture: "Picture" - editing_profile: "Editando perfil" - albums: "Álbums" - comments: - comment: - ago: "atras" - new_comment: - comment: "Commentario" - photos: - show: - prev: "prev" - full_size: "tamaño actual" - next: "prox" - edit_photo: "Editar Foto" - delete_photo: "Eliminar Foto" - are_you_sure: "Esta seguro?" - comments: "comentarios" - edit: - editing: "Editando" - are_you_sure: "Esta seguro?" - delete_photo: "Eliminar Foto" - photo: - show_comments: "mostrar comentarios" - new: - new_photo: "Nueva Foto" - back_to_list: "Devuelta a la lista" - post_it: "post it!" - registrations: - new: - sign_up: "Registrar" - status_messages: - new_status_message: - tell_me_something_good: "dime algo bueno" - oh_yeah: "oh yeah!" - status_message: - show_comments: "mostrar comentarios" - delete: "Eliminar" - are_you_sure: "Esta seguro?" - show: - status_message: "Mensaje de status" - comments: "comentarios" - are_you_sure: "Esta seguro?" - destroy: "Destruir" - view_all: "Ver Todos" - message: "Mensaje" - owner: "Dueño" \ No newline at end of file diff --git a/config/locales/en.yml b/config/locales/en.yml index 87a96b009..ff512afc7 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -30,8 +30,6 @@ en: new_album: create: "create" add_a_new_album: "Add a new album" - create: - success: You've created an album called %{name}. show: edit_album: "Edit Album" albums: "albums" @@ -43,15 +41,17 @@ en: are_you_sure: "Are you sure?" delete_album: "Delete Album" cancel: "Cancel" - update: - success: Album %{name} successfully edited. - failure: Failed to edit album %{name}. index: home: "home" new_album: "New Album" + create: + success: "You've created an album called %{name}." + update: + success: "Album %{name} successfully edited." + failure: "Failed to edit album %{name}." destroy: - success: Album %{name} deleted. - aspects: + success: "Album %{name} deleted." + aspects: index: photos: "photos" show: @@ -75,6 +75,8 @@ en: picture: "Picture" editing_profile: "Editing profile" albums: "Albums" + you_dont_have_any_photos: "You don't have any photos! Go to the" + page_to_upload_some: "page to upload some." comments: comment: ago: "ago" diff --git a/config/locales/es.yml b/config/locales/es.yml index ad1db8794..b56353981 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -1,264 +1,123 @@ -# Spanish translations for Rails -# by Francisco Fernando García Nieto (ffgarcianieto@gmail.com) +# Copyright (c) 2010, Diaspora Inc. This file is +# licensed under the Affero General Public License version 3. See +# the COPYRIGHT file. -"es": - # Action View - number: - # Used in number_with_delimiter() - # These are also the defaults for 'currency', 'percentage', 'precision', and 'human' - format: - # Sets the separator between the units, for more precision (e.g. 1.0 / 2.0 == 0.5) - separator: "," - # Delimets thousands (e.g. 1,000,000 is a million) (always in groups of three) - delimiter: "." - # Number of decimals, behind the separator (1 with a precision of 2 gives: 1.00) - precision: 3 - # If set to true, precision will mean the number of significant digits instead - # of the number of decimal digits (1234 with precision 2 becomes 1200, 1.23543 becomes 1.2) - significant: false - # If set, the zeros after the decimal separator will always be stripped (eg.: 1.200 will be 1.2) - strip_insignificant_zeros: false - # Used in number_to_currency() - currency: - format: - # Where is the currency sign? %u is the currency unit, %n the number (default: $5.00) - format: "%n %u" - unit: "€" - # These three are to override number.format and are optional - separator: "," - delimiter: "." - precision: 2 - significant: false - strip_insignificant_zeros: false +# Sample localization file for English. Add more files in this directory for other locales. +# See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. - # Used in number_to_percentage() - percentage: - format: - # These three are to override number.format and are optional - # separator: - delimiter: "" - # precision: - # Used in number_to_precision() - precision: - format: - # These three are to override number.format and are optional - # separator: - delimiter: "" - # precision: - # significant: false - # strip_insignificant_zeros: false - - # Used in number_to_human_size() - human: - format: - # These three are to override number.format and are optional - # separator: - delimiter: "" - precision: 1 - significant: true - strip_insignificant_zeros: true - # Used in number_to_human_size() - storage_units: - format: "%n %u" - units: - byte: - one: "Byte" - other: "Bytes" - kb: "KB" - mb: "MB" - gb: "GB" - tb: "TB" - # Used in number_to_human() - decimal_units: - format: "%n %u" - # Decimal units output formatting - # By default we will only quantify some of the exponents - # but the commented ones might be defined or overridden - # by the user. - units: - # femto: Quadrillionth - # pico: Trillionth - # nano: Billionth - # micro: Millionth - # mili: Thousandth - # centi: Hundredth - # deci: Tenth - unit: "" - # ten: - # one: Ten - # other: Tens - # hundred: Hundred - thousand: "Mil" - million: "Millón" - billion: "Mil millones" - trillion: "Trillón" - quadrillion: "Cuatrillón" - - # Used in distance_of_time_in_words(), distance_of_time_in_words_to_now(), time_ago_in_words() - datetime: - distance_in_words: - half_a_minute: "medio minuto" - less_than_x_seconds: - one: "menos de 1 segundo" - other: "menos de %{count} segundos" - x_seconds: - one: "1 segundo" - other: "%{count} segundos" - less_than_x_minutes: - one: "menos de 1 minuto" - other: "menos de %{count} minutos" - x_minutes: - one: "1 minuto" - other: "%{count} minutos" - about_x_hours: - one: "alrededor de 1 hora" - other: "alrededor de %{count} horas" - x_days: - one: "1 día" - other: "%{count} días" - about_x_months: - one: "alrededor de 1 mes" - other: "alrededor de %{count} meses" - x_months: - one: "1 mes" - other: "%{count} meses" - about_x_years: - one: "alrededor de 1 año" - other: "alrededor de %{count} años" - over_x_years: - one: "más de 1 año" - other: "más de %{count} años" - almost_x_years: - one: "casi 1 año" - other: "casi %{count} años" - prompts: - year: "Año" - month: "Mes" - day: "Día" - hour: "Hora" - minute: "Minutos" - second: "Segundos" - - helpers: - select: - # Default value for :prompt => true in FormOptionsHelper - prompt: "Por favor seleccione" - - # Default translation keys for submit FormHelper - submit: - create: 'Guardar %{model}' - update: 'Actualizar %{model}' - submit: 'Guardar %{model}' - - # Attributes names common to most models - #attributes: - #created_at: "Created at" - #updated_at: "Updated at" - - # Active Record models configuration - activerecord: - errors: - messages: - taken: "ya está en uso" - record_invalid: "La validación falló: %{errors}" - # Append your own errors here or at the model/attributes scope. - - # You can define own errors for models or model attributes. - # The values :model, :attribute and :value are always available for interpolation. - # - # For example, - # models: - # user: - # blank: "This is a custom blank message for %{model}: %{attribute}" - # attributes: - # login: - # blank: "This is a custom blank message for User login" - # Will define custom blank validation message for User model and - # custom blank validation message for login attribute of User model. - #models: - - # Translate model names. Used in Model.human_name(). - #models: - # For example, - # user: "Dude" - # will translate User model name to "Dude" - - # Translate model attribute names. Used in Model.human_attribute_name(attribute). - #attributes: - # For example, - # user: - # login: "Handle" - # will translate User attribute "login" as "Handle" - - # Active Model - errors: - # The default format to use in full error messages. - format: "%{attribute} %{message}" - - template: - header: - one: "No se pudo guardar este/a %{model} porque se encontró 1 error" - other: "No se pudo guardar este/a %{model} porque se encontraron %{count} errores" - # The variable :count is also available - body: "Se encontraron problemas con los siguientes campos:" - - # The values :model, :attribute and :value are always available for interpolation - # The value :count is available when applicable. Can be used for pluralization. - messages: - inclusion: "no está incluido en la lista" - exclusion: "está reservado" - invalid: "no es válido" - confirmation: "no coincide con la confirmación" - accepted: "debe ser aceptado" - empty: "no puede estar vacío" - blank: "no puede estar en blanco" - too_long: "es demasiado largo (%{count} caracteres máximo)" - too_short: "es demasiado corto (%{count} caracteres mínimo)" - wrong_length: "no tiene la longitud correcta (%{count} caracteres exactos)" - not_a_number: "no es un número" - greater_than: "debe ser mayor que %{count}" - greater_than_or_equal_to: "debe ser mayor que o igual a %{count}" - equal_to: "debe ser igual a %{count}" - less_than: "debe ser menor que %{count}" - less_than_or_equal_to: "debe ser menor que o igual a %{count}" - odd: "debe ser impar" - even: "debe ser par" - - # Active Support - date: - formats: - # Use the strftime parameters for formats. - # When no format has been given, it uses default. - # You can provide other formats here if you like! - default: "%e/%m/%Y" - short: "%e de %b" - long: "%e de %B de %Y" - - day_names: [Domingo, Lunes, Martes, Miércoles, Jueves, Viernes, Sábado] - abbr_day_names: [Dom, Lun, Mar, Mie, Jue, Vie, Sab] - - # Don't forget the nil at the beginning; there's no such thing as a 0th month - month_names: [~, Enero, Febrero, Marzo, Abril, Mayo, Junio, Julio, Agosto, Septiembre, Octubre, Noviembre, Diciembre] - abbr_month_names: [~, Ene, Feb, Mar, Abr, May, Jun, Jul, Ago, Sep, Oct, Nov, Dic] - # Used in date_select and datime_select. - order: - - :day - - :month - - :year - - time: - formats: - default: "%A, %e de %B de %Y %H:%M:%S %z" - short: "%e de %b %H:%M" - long: "%e de %B de %Y %H:%M" - am: "am" - pm: "pm" - - # Used in array.to_sentence. - support: - array: - words_connector: ", " - two_words_connector: " y " - last_word_connector: ", y " \ No newline at end of file +es: + hello: "Hola Mundo" + layouts: + application: + edit_profile: "editar perfil" + logout: "desloguear" + shared: + aspect_nav: + all_aspects: "Todo los Aspectos" + manage: "Manejar" + manage_your_aspects: "Maneja tus Aspectos" + sub_header: + all_aspects: "Todo los Aspectos" + manage_aspects: "Manejar Aspectos" + publisher: + share: "Compartir" + aspect_friends: + add_friends: "Añade amigos" + albums: + album: + you: "usted" + new_album: + create: "Crear" + add_a_new_album: "Añade un nuevo álbum" + show: + edit_album: "Editar Álbum" + albums: "álbumes" + updated: "actualizar" + by: "por" + edit: + editing: "Editando" + updated: "actualizado" + are_you_sure: "Esta seguro?" + delete_album: "Eliminar Album" + cancel: "Cancelar" + index: + home: "home" + new_album: "Nuevo Album" + create: + success: "Creo el album llamado %{name}." + update: + success: "Album %{name} fue exitosamente editado." + failure: "Fallo el editar el album %{name}." + destroy: + success: "Album %{name} fue eliminado." + aspects: + index: + photos: "fotos" + show: + photos: "fotos" + manage: + add_a_new_aspect: "Añadir nuevo aspecto" + add_a_new_friend: "Añadir nuevo amigo" + show: "Mostrar" + update_aspects: "Actualizar Aspectos" + requests: "Requests" + ignore_remove: "Ignorar/Remover" + new_aspect: + create: "Crear" + users: + edit: + cancel: "Cancelar" + update_profile: "Actualizar Perfil" + home: "Home" + diaspora_username: "USUARIO DE DIASPORA" + info: "Info" + picture: "Picture" + editing_profile: "Editando perfil" + albums: "Álbums" + you_dont_have_any_photos: "No tienes ninguna foto! ve a la pagina" + page_to_upload_some: "para subir algunas" + comments: + comment: + ago: "atras" + new_comment: + comment: "Commentario" + photos: + show: + prev: "prev" + full_size: "tamaño actual" + next: "prox" + edit_photo: "Editar Foto" + delete_photo: "Eliminar Foto" + are_you_sure: "Esta seguro?" + comments: "comentarios" + edit: + editing: "Editando" + are_you_sure: "Esta seguro?" + delete_photo: "Eliminar Foto" + photo: + show_comments: "mostrar comentarios" + new: + new_photo: "Nueva Foto" + back_to_list: "Devuelta a la lista" + post_it: "post it!" + registrations: + new: + sign_up: "Registrate" + status_messages: + new_status_message: + tell_me_something_good: "dime algo bueno" + oh_yeah: "oh yeah!" + status_message: + show_comments: "mostrar comentarios" + delete: "Eliminar" + are_you_sure: "Esta seguro?" + show: + status_message: "Mensaje de status" + comments: "comentarios" + are_you_sure: "Esta seguro?" + destroy: "Destruir" + view_all: "Ver Todos" + message: "Mensaje" + owner: "Dueño" \ No newline at end of file From c6cdf65fc8879022e7d0e70f39e1790bc4f84911 Mon Sep 17 00:00:00 2001 From: Ariel Zavala Date: Fri, 17 Sep 2010 10:26:57 -0400 Subject: [PATCH 032/449] updated local configuration --- config/initializers/locale.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/initializers/locale.rb b/config/initializers/locale.rb index 42f34a3a7..dd607a273 100644 --- a/config/initializers/locale.rb +++ b/config/initializers/locale.rb @@ -4,5 +4,5 @@ # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded. -I18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s] +I18n.load_path += Dir[Rails.root.join('config', 'locales', '**', '*.{rb,yml}')] I18n.default_locale = :en \ No newline at end of file From 375f4f680802240c22e8c884234b10d8f41cf0e0 Mon Sep 17 00:00:00 2001 From: Ariel Zavala Date: Fri, 17 Sep 2010 10:43:59 -0400 Subject: [PATCH 033/449] added more translations missing on views --- app/controllers/aspects_controller.rb | 2 +- app/views/aspects/_new_aspect.haml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/aspects_controller.rb b/app/controllers/aspects_controller.rb index ab144ad12..82c35b36c 100644 --- a/app/controllers/aspects_controller.rb +++ b/app/controllers/aspects_controller.rb @@ -16,7 +16,7 @@ class AspectsController < ApplicationController def create @aspect = current_user.aspect params[:aspect] - flash[:notice] = "Click on the plus on the left side to tell Diaspora who can see your new aspect." + flash[:notice] = I18n.t('aspects.create.success') respond_with :location => aspects_manage_path end diff --git a/app/views/aspects/_new_aspect.haml b/app/views/aspects/_new_aspect.haml index 68ce56806..9f0b662dd 100644 --- a/app/views/aspects/_new_aspect.haml +++ b/app/views/aspects/_new_aspect.haml @@ -3,7 +3,7 @@ -# the COPYRIGHT file. -%h1 Add a new aspect +%h1=t('.add_a_new_aspect') = form_for Aspect.new do |f| = f.error_messages %p From 1384b65565a6461b8329ba114926469ed1cf0258 Mon Sep 17 00:00:00 2001 From: Ariel Zavala Date: Fri, 17 Sep 2010 10:46:03 -0400 Subject: [PATCH 034/449] added more translations missing on views --- config/locales/de.yml | 1 + config/locales/en.yml | 3 +++ config/locales/es.yml | 5 ++++- config/locales/fr.yml | 1 + 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/config/locales/de.yml b/config/locales/de.yml index 5b78d0e68..f7a4f0535 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -64,6 +64,7 @@ de: requests: "Anfragen" ignore_remove: "Ignorieren/Entfernen" new_aspect: + add_a_new_aspect: "Neuen Aspekt erstellen" create: "Erstellen" users: edit: diff --git a/config/locales/en.yml b/config/locales/en.yml index ff512afc7..b1b7e98a7 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -64,7 +64,10 @@ en: requests: "Requests" ignore_remove: "Ignore/Remove" new_aspect: + add_a_new_aspect: "Add a new aspect" create: "Create" + create: + success:"Click on the plus on the left side to tell Diaspora who can see your new aspect." users: edit: cancel: "Cancel" diff --git a/config/locales/es.yml b/config/locales/es.yml index b56353981..03fefdca4 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -48,7 +48,7 @@ es: create: success: "Creo el album llamado %{name}." update: - success: "Album %{name} fue exitosamente editado." + success: "Album %{name} fue editado exitosamente." failure: "Fallo el editar el album %{name}." destroy: success: "Album %{name} fue eliminado." @@ -65,7 +65,10 @@ es: requests: "Requests" ignore_remove: "Ignorar/Remover" new_aspect: + add_a_new_aspect: "Añadir nuevo aspecto" create: "Crear" + create: + success:"Pulsa en el signo de mas a la izquierda para escojer quien puede ver su nuevo aspecto." users: edit: cancel: "Cancelar" diff --git a/config/locales/fr.yml b/config/locales/fr.yml index 0054c6a33..052819b65 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -58,6 +58,7 @@ fr: requests: "Requêtes" ignore_remove: "Ignorer/Supprimer" new_aspect: + add_a_new_aspect: "Ajouter un nouvel aspect" create: "Créer" users: edit: From c6b34be63deb801fbdd4967b4eb07143070d6d8a Mon Sep 17 00:00:00 2001 From: Ariel Zavala Date: Fri, 17 Sep 2010 11:27:08 -0400 Subject: [PATCH 035/449] Added people views translations --- app/views/people/index.html.haml | 12 ++++++------ app/views/people/new.html.haml | 4 ++-- app/views/people/show.html.haml | 10 +++++----- config/locales/de.yml | 19 +++++++++++++++++-- config/locales/en.yml | 19 +++++++++++++++++-- config/locales/es.yml | 16 +++++++++++++++- config/locales/fr.yml | 17 +++++++++++++++++ 7 files changed, 79 insertions(+), 18 deletions(-) diff --git a/app/views/people/index.html.haml b/app/views/people/index.html.haml index c18ec5d0a..57e46d6df 100644 --- a/app/views/people/index.html.haml +++ b/app/views/people/index.html.haml @@ -17,8 +17,8 @@ = (@people.count).to_s + search_or_index %table %tr - %th real name - %th diaspora handle + %th=t('.real_name') + %th=t('.diaspora_handle') %th url - for person in @people %tr @@ -34,18 +34,18 @@ - elsif person.id == current_user.person.id %td - %td that's you! + %td=t('.thats_you') -elsif current_user.pending_requests.find_by_person_id(person.id) %td - %td ^-you have a friend request from this person + %td="^-#{t('.you_have_a_friend_request_from_this_person')}" -elsif current_user.pending_requests.find_by_url(person.receive_url) %td - %td friend request pending + %td=t('.friend_request_pending') -else %td %td = form_for Request.new do |f| = f.select(:aspect_id, @aspects_dropdown_array) = f.hidden_field :destination_url, :value => person.diaspora_handle - = f.submit "add friend" + = f.submit t('.add_friend') = will_paginate @people diff --git a/app/views/people/new.html.haml b/app/views/people/new.html.haml index b2203eb3f..25821ed37 100644 --- a/app/views/people/new.html.haml +++ b/app/views/people/new.html.haml @@ -3,7 +3,7 @@ -# the COPYRIGHT file. -- title "New Person" +- title=t('.new_person') = form_for @person do |f| = f.error_messages @@ -29,4 +29,4 @@ = f.submit -%p= link_to "Back to List", people_path +%p= link_to t('.back_to_list'), people_path diff --git a/app/views/people/show.html.haml b/app/views/people/show.html.haml index 4f76f18cf..93705f15c 100644 --- a/app/views/people/show.html.haml +++ b/app/views/people/show.html.haml @@ -13,19 +13,19 @@ %ul -unless @posts.first.nil? %li - %i= "last seen: #{how_long_ago(@posts.first)}" + %i= t(".last_seen",:how_long_ago => how_long_ago(@posts.first)) - if @person != current_user.person && current_user.friends.include?(@person) %li - %i= "friends since: #{how_long_ago(@person)}" + %i= t(".friends_since",:how_long_ago => how_long_ago(@person)) %li = form_tag move_friend_path = select :to, :to, @aspects_dropdown_array, :selected => @aspects_with_person.first.id = hidden_field_tag :from, :from, :value => @aspects_with_person.first.id = hidden_field_tag :friend_id, :friend_id, :value => @person.id - = submit_tag "save" + = submit_tag t('.save') - if @person != current_user.person && current_user.friends.include?(@person) - = link_to 'remove friend', @person, :confirm => 'Are you sure?', :method => :delete, :class => "button" + = link_to t('.remove_friend'), @person, :confirm => t('.are_you_sure'), :method => :delete, :class => "button" .span-20.last @@ -36,4 +36,4 @@ = render type_partial(post), :post => post unless post.class == Album = will_paginate @posts - else - %h3 no posts to display! + %h3=t('no posts to display!') diff --git a/config/locales/de.yml b/config/locales/de.yml index f7a4f0535..e44d4b788 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -122,5 +122,20 @@ de: view_all: "Alle anzeigen" message: "Nachricht" owner: "Besitzer" - - + people: + index: + add_friend: "add friend" + real_name: "real name" + diaspora_handle: "diaspora handle" + thats_you: "that's you!" + friend_request_pending: "friend request pending" + you_have_a_friend_request_from_this_person: "you have a friend request from this person" + new: + new_person: "New Person" + back_to_list: "Back to List" + show: + last_seen: "last seen: %{how_long_ago}" + friends_since: "friends since: %{how_long_ago}" + save: "save" + are_you_sure: "Are you sure?" + remove_friend: "remove friend" \ No newline at end of file diff --git a/config/locales/en.yml b/config/locales/en.yml index b1b7e98a7..e68a27763 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -123,5 +123,20 @@ en: view_all: "View All" message: "Message" owner: "Owner" - - + people: + index: + add_friend: "add friend" + real_name: "real name" + diaspora_handle: "diaspora handle" + thats_you: "that's you!" + friend_request_pending: "friend request pending" + you_have_a_friend_request_from_this_person: "you have a friend request from this person" + new: + new_person: "New Person" + back_to_list: "Back to List" + show: + last_seen: "last seen: %{how_long_ago}" + friends_since: "friends since: %{how_long_ago}" + save: "save" + are_you_sure: "Are you sure?" + remove_friend: "remove friend" \ No newline at end of file diff --git a/config/locales/es.yml b/config/locales/es.yml index 03fefdca4..cb8bef6cd 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -123,4 +123,18 @@ es: destroy: "Destruir" view_all: "Ver Todos" message: "Mensaje" - owner: "Dueño" \ No newline at end of file + owner: "Dueño" + people: + index: + add_friend: "añadir amigo" + real_name: "nombre real" + diaspora_handle: "usuario en diaspora" + thats_you: "ese eres tu!" + friend_request_pending: "friend request pending" + you_have_a_friend_request_from_this_person: "you have a friend request from this person" + show: + last_seen: "ultima vez visto: %{how_long_ago}" + friends_since: "amigos desde: %{how_long_ago}" + save: "guardar" + are_you_sure: "Esta seguro?" + remove_friend: "remover amigo" \ No newline at end of file diff --git a/config/locales/fr.yml b/config/locales/fr.yml index 052819b65..760993177 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -113,3 +113,20 @@ fr: view_all: "Tout voir" message: "Message" owner: "Propriétaire" + people: + index: + add_friend: "add friend" + real_name: "real name" + diaspora_handle: "diaspora handle" + thats_you: "that's you!" + friend_request_pending: "friend request pending" + you_have_a_friend_request_from_this_person: "you have a friend request from this person" + new: + new_person: "New Person" + back_to_list: "Back to List" + show: + last_seen: "last seen: %{how_long_ago}" + friends_since: "friends since: %{how_long_ago}" + save: "save" + are_you_sure: "Are you sure?" + remove_friend: "remove friend" \ No newline at end of file From 271925a7f61e742f686274bf60028df83fe8f742 Mon Sep 17 00:00:00 2001 From: Ariel Zavala Date: Fri, 17 Sep 2010 11:34:45 -0400 Subject: [PATCH 036/449] added photo view translations --- app/views/photos/_photo.haml | 2 +- config/locales/de.yml | 1 + config/locales/en.yml | 1 + config/locales/es.yml | 1 + config/locales/fr.yml | 1 + 5 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/views/photos/_photo.haml b/app/views/photos/_photo.haml index 47ddfef3e..ae8829c61 100644 --- a/app/views/photos/_photo.haml +++ b/app/views/photos/_photo.haml @@ -11,7 +11,7 @@ %span.from = link_to post.person.real_name, post.person %b - posted a new photo to + =t('.posted_a_new_photo_to') = link_to post.album.name, object_path(post.album) %br diff --git a/config/locales/de.yml b/config/locales/de.yml index e44d4b788..76f0e7e04 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -99,6 +99,7 @@ de: delete_photo: "Foto löschen" photo: show_comments: "Kommentare anzeigen" + posted_a_new_photo_to: "posted a new photo to" new: new_photo: "Foto erstellen" back_to_list: "Zurück zur Liste" diff --git a/config/locales/en.yml b/config/locales/en.yml index e68a27763..867b120e0 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -100,6 +100,7 @@ en: delete_photo: "Delete Photo" photo: show_comments: "show comments" + posted_a_new_photo_to: "posted a new photo to" new: new_photo: "New Photo" back_to_list: "Back to List" diff --git a/config/locales/es.yml b/config/locales/es.yml index cb8bef6cd..09eba0837 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -101,6 +101,7 @@ es: delete_photo: "Eliminar Foto" photo: show_comments: "mostrar comentarios" + posted_a_new_photo_to: "a puesto una nueva foto en" new: new_photo: "Nueva Foto" back_to_list: "Devuelta a la lista" diff --git a/config/locales/fr.yml b/config/locales/fr.yml index 760993177..75be18e23 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -90,6 +90,7 @@ fr: delete_photo: "Supprimer la photo" photo: show_comments: "Montrer les commentaires" + posted_a_new_photo_to: "posted a new photo to" new: new_photo: "Nouvelle photo" back_to_list: "Retour à la liste" From 001402487084e7c164a400f3c50841d799272019 Mon Sep 17 00:00:00 2001 From: Ariel Zavala Date: Fri, 17 Sep 2010 15:26:31 -0400 Subject: [PATCH 037/449] Added I18n translations to helpers --- app/helpers/albums_helper.rb | 8 +++--- app/helpers/application_helper.rb | 4 +-- app/helpers/aspects_helper.rb | 4 +-- app/helpers/dashboards_helper.rb | 2 +- app/helpers/error_messages_helper.rb | 4 +-- app/helpers/people_helper.rb | 4 +-- app/helpers/status_messages_helper.rb | 2 +- config/locales/de.yml | 25 ++++++++++++++++-- config/locales/en.yml | 25 ++++++++++++++++-- config/locales/es.yml | 37 ++++++++++++++++++++++----- config/locales/fr.yml | 23 +++++++++++++++++ 11 files changed, 113 insertions(+), 25 deletions(-) diff --git a/app/helpers/albums_helper.rb b/app/helpers/albums_helper.rb index 50b7fbaf7..9a1e78fd1 100644 --- a/app/helpers/albums_helper.rb +++ b/app/helpers/albums_helper.rb @@ -6,17 +6,17 @@ module AlbumsHelper def friends_albums_link if params[:friends] - "Friends Albums" + I18n.t('albums.helper.friends_albums') else - link_to 'Friends Albums', albums_path({:friends => true}) + link_to I18n.t('albums.helper.friends_albums'), albums_path({:friends => true}) end end def your_albums_link if params[:friends] - link_to 'Your Albums', albums_path + link_to I18n.t('albums.helper.your_albums'), albums_path else - 'Your Albums' + I18n.t('albums.helper.your_albums') end end end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index f2a0a95fd..018d1da7f 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -38,7 +38,7 @@ module ApplicationHelper when "Person" person_path(person) else - "unknown person" + I18n.t('application.helper.unknown_person') end end @@ -62,7 +62,7 @@ module ApplicationHelper end def new_request(request_count) - "new_requests" if request_count > 0 + I18n.t('application.helper.new_requests') if request_count > 0 end def post_yield_tag(post) diff --git a/app/helpers/aspects_helper.rb b/app/helpers/aspects_helper.rb index 1c8f69b8a..536bb8b0b 100644 --- a/app/helpers/aspects_helper.rb +++ b/app/helpers/aspects_helper.rb @@ -10,9 +10,9 @@ module AspectsHelper def remove_link( aspect ) if aspect.people.size == 0 - link_to "remove", aspect, :method => :delete + link_to I18n.t('aspects.helper.remove'), aspect, :method => :delete else - "remove" + "#{I18n.t('aspects.helper.remove')}" end end end diff --git a/app/helpers/dashboards_helper.rb b/app/helpers/dashboards_helper.rb index 542d938ee..5f6abe8e9 100644 --- a/app/helpers/dashboards_helper.rb +++ b/app/helpers/dashboards_helper.rb @@ -6,6 +6,6 @@ module DashboardsHelper def title_for_page - 'home' + I18n.t('dashboards.helper.home') end end diff --git a/app/helpers/error_messages_helper.rb b/app/helpers/error_messages_helper.rb index 699070b70..274d60edf 100644 --- a/app/helpers/error_messages_helper.rb +++ b/app/helpers/error_messages_helper.rb @@ -7,8 +7,8 @@ module ErrorMessagesHelper # Render error messages for the given objects. The :message and :header_message options are allowed. def error_messages_for(*objects) options = objects.extract_options! - options[:header_message] ||= "Invalid Fields" - options[:message] ||= "Correct the following errors and try again." + options[:header_message] ||= I18n.t('error_messages.helper.invalid_fields') + options[:message] ||= I18n.t('error_messages.helper.correct_the_following_errors_and_try_again') messages = objects.compact.map { |o| o.errors.full_messages }.flatten unless messages.empty? content_tag(:div, :class => "error_messages") do diff --git a/app/helpers/people_helper.rb b/app/helpers/people_helper.rb index 37d18d20f..90ffb517d 100644 --- a/app/helpers/people_helper.rb +++ b/app/helpers/people_helper.rb @@ -7,9 +7,9 @@ module PeopleHelper def search_or_index if params[:q] - " results for #{params[:q]}" + I18n.t 'people.helper.results_for',:params => params[:q] else - " people on pod is aware of" + I18n.t "people.helper.people_on_pod_are_aware_of" end end diff --git a/app/helpers/status_messages_helper.rb b/app/helpers/status_messages_helper.rb index ff6c2674a..7c1322762 100644 --- a/app/helpers/status_messages_helper.rb +++ b/app/helpers/status_messages_helper.rb @@ -8,7 +8,7 @@ module StatusMessagesHelper unless @latest_status_message.nil? return @latest_status_message.message else - return "No message to display." + return I18n.t('status_messages.helper.no_message_to_display') end end end diff --git a/config/locales/de.yml b/config/locales/de.yml index f7a4f0535..f5aa4d55c 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -8,6 +8,21 @@ de: hello: "Hallo Welt" + application: + helper: + unknown_person: "unknown person" + new_requests: "new requests" + dashboards: + helper: + home: "home" + error_messages: + helper: + invalid_fields: "Invalid Fields" + correct_the_following_errors_and_try_again: "Correct the following errors and try again." + people: + helper: + results_for: " resultados para %{params}" + people_on_pod_are_aware_of: " gente en pod estan al tanto de " layouts: application: edit_profile: "Profil bearbeiten" @@ -51,6 +66,9 @@ de: failure: "%{name} wurde nicht geändert." destroy: success: "Album %{name} gelöscht." + helper: + friends_albums: "Friends Albums" + your_albums: "Your Albums" aspects: index: photos: "Fotos" @@ -66,6 +84,9 @@ de: new_aspect: add_a_new_aspect: "Neuen Aspekt erstellen" create: "Erstellen" + helper: + remove: "remove" + aspect_not_empty: "Aspect not empty" users: edit: cancel: "Abbrechen" @@ -122,5 +143,5 @@ de: view_all: "Alle anzeigen" message: "Nachricht" owner: "Besitzer" - - + helper: + no_message_to_display: "No message to display." \ No newline at end of file diff --git a/config/locales/en.yml b/config/locales/en.yml index b1b7e98a7..9c6fd7f09 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -8,6 +8,21 @@ en: hello: "Hello world" + application: + helper: + unknown_person: "unknown person" + new_requests: "new requests" + dashboards: + helper: + home: "home" + error_messages: + helper: + invalid_fields: "Invalid Fields" + correct_the_following_errors_and_try_again: "Correct the following errors and try again." + people: + helper: + results_for: " results for %{params}" + people_on_pod_are_aware_of: " people on pod are aware of" layouts: application: edit_profile: "edit profile" @@ -51,6 +66,9 @@ en: failure: "Failed to edit album %{name}." destroy: success: "Album %{name} deleted." + helper: + friends_albums: "Friends Albums" + your_albums: "Your Albums" aspects: index: photos: "photos" @@ -68,6 +86,9 @@ en: create: "Create" create: success:"Click on the plus on the left side to tell Diaspora who can see your new aspect." + helper: + remove: "remove" + aspect_not_empty: "Aspect not empty" users: edit: cancel: "Cancel" @@ -123,5 +144,5 @@ en: view_all: "View All" message: "Message" owner: "Owner" - - + helper: + no_message_to_display: "No message to display." \ No newline at end of file diff --git a/config/locales/es.yml b/config/locales/es.yml index 03fefdca4..cad5c187e 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -9,6 +9,21 @@ es: hello: "Hola Mundo" + application: + helper: + unknown_person: "persona desconocida" + new_requests: "nuevas peticiones" + dashboards: + helper: + home: "home" + error_messages: + helper: + invalid_fields: "Campos Invalidos" + correct_the_following_errors_and_try_again: "Corrija los siguentes errores y trate de nuevo." + people: + helper: + results_for: " resultados para %{params}" + people_on_pod_are_aware_of: " gente en pod estan al tanto de " layouts: application: edit_profile: "editar perfil" @@ -40,18 +55,21 @@ es: editing: "Editando" updated: "actualizado" are_you_sure: "Esta seguro?" - delete_album: "Eliminar Album" + delete_album: "Eliminar Álbum" cancel: "Cancelar" index: home: "home" - new_album: "Nuevo Album" + new_album: "Nuevo Álbum" create: - success: "Creo el album llamado %{name}." + success: "Creo el álbum llamado %{name}." update: - success: "Album %{name} fue editado exitosamente." - failure: "Fallo el editar el album %{name}." + success: "Álbum %{name} fue editado exitosamente." + failure: "Fallo el editar el álbum %{name}." destroy: - success: "Album %{name} fue eliminado." + success: "Álbum %{name} fue eliminado." + helper: + friends_albums: "Álbumes de amigos" + your_albums: "Tus Álbumes" aspects: index: photos: "fotos" @@ -69,6 +87,9 @@ es: create: "Crear" create: success:"Pulsa en el signo de mas a la izquierda para escojer quien puede ver su nuevo aspecto." + helper: + remove: "remover" + aspect_not_empty: "Aspecto no esta vacio" users: edit: cancel: "Cancelar" @@ -123,4 +144,6 @@ es: destroy: "Destruir" view_all: "Ver Todos" message: "Mensaje" - owner: "Dueño" \ No newline at end of file + owner: "Dueño" + helper: + no_message_to_display: "No hay mensajes que mostrar." \ No newline at end of file diff --git a/config/locales/fr.yml b/config/locales/fr.yml index 052819b65..600b3f038 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -9,6 +9,21 @@ fr: hello: "Bonjour tout le monde" + application: + helper: + unknown_person: "unknown person" + new_requests: "new requests" + dashboards: + helper: + home: "home" + error_messages: + helper: + invalid_fields: "Invalid Fields" + correct_the_following_errors_and_try_again: "Correct the following errors and try again." + people: + helper: + results_for: " resultados para %{params}" + people_on_pod_are_aware_of: " gente en pod estan al tanto de " layouts: application: edit_profile: "Éditez votre profil" @@ -45,6 +60,9 @@ fr: index: home: "accueil" new_album: "Nouvel album" + helper: + friends_albums: "Friends Albums" + your_albums: "Your Albums" aspects: index: photos: "photos" @@ -60,6 +78,9 @@ fr: new_aspect: add_a_new_aspect: "Ajouter un nouvel aspect" create: "Créer" + helper: + remove: "remove" + aspect_not_empty: "Aspect not empty" users: edit: cancel: "Annuler" @@ -113,3 +134,5 @@ fr: view_all: "Tout voir" message: "Message" owner: "Propriétaire" + helper: + no_message_to_display: "No message to display." \ No newline at end of file From f95cebcb8bbfa3aba5ad4957de166fa94f081486 Mon Sep 17 00:00:00 2001 From: Ariel Zavala Date: Fri, 17 Sep 2010 16:38:50 -0400 Subject: [PATCH 038/449] Added translations to new requests view and aspects controller --- app/controllers/aspects_controller.rb | 14 +++++++------- app/views/requests/_new_request.haml | 8 ++++---- config/locales/de.yml | 12 ++++++++++++ config/locales/en.yml | 18 +++++++++++++++++- config/locales/es.yml | 16 ++++++++++++++++ config/locales/fr.yml | 12 ++++++++++++ 6 files changed, 68 insertions(+), 12 deletions(-) diff --git a/app/controllers/aspects_controller.rb b/app/controllers/aspects_controller.rb index 82c35b36c..5d572742a 100644 --- a/app/controllers/aspects_controller.rb +++ b/app/controllers/aspects_controller.rb @@ -29,7 +29,7 @@ class AspectsController < ApplicationController begin current_user.drop_aspect @aspect - flash[:notice] = "#{@aspect.name} was successfully removed." + flash[:notice] = i18n.t 'aspects.destroy.success',:name => @aspect.name rescue RuntimeError => e flash[:error] = e.message end @@ -53,7 +53,7 @@ class AspectsController < ApplicationController def update @aspect = Aspect.find_by_id(params[:id]) @aspect.update_attributes(params[:aspect]) - flash[:notice] = "Your aspect, #{@aspect.name}, has been successfully edited." + flash[:notice] = i18n.t 'aspects.update.success',:name => @aspect.name respond_with @aspect end @@ -61,25 +61,25 @@ class AspectsController < ApplicationController params[:moves].each{ |move| move = move[1] unless current_user.move_friend(move) - flash[:error] = "Aspect editing failed for friend #{Person.find_by_id( move[:friend_id] ).real_name}." + flash[:error] = i18n.t 'aspects.move_friends.failure', :real_name => Person.find_by_id( move[:friend_id] ).real_name redirect_to Aspect.first, :action => "edit" return end } - flash[:notice] = "Aspects edited successfully." + flash[:notice] = i18n.t 'aspects.move_friends.success' redirect_to Aspect.first, :action => "edit" end def move_friend unless current_user.move_friend( :friend_id => params[:friend_id], :from => params[:from], :to => params[:to][:to]) - flash[:error] = "didn't work #{params.inspect}" + flash[:error] = I18n.t 'aspects.move_friend.error',:inspect => params.inspect end if aspect = Aspect.first(:id => params[:to][:to]) - flash[:notice] = "You are now showing your friend a different aspect of yourself." + flash[:notice] = I18n.t 'aspects.move_friend.notice' respond_with aspect else - flash[:notice] = "You are now showing your friend a different aspect of yourself." + flash[:notice] = I18n.t 'aspects.move_friend.notice' respond_with Person.first(:id => params[:friend_id]) end end diff --git a/app/views/requests/_new_request.haml b/app/views/requests/_new_request.haml index b7e5819f6..70c204e7c 100644 --- a/app/views/requests/_new_request.haml +++ b/app/views/requests/_new_request.haml @@ -4,18 +4,18 @@ %h1 - Add a new friend to + =t('.add_a_new_friend_to') %i= aspect.name = form_for Request.new do |f| = f.error_messages - Enter a Diaspora username: + =t('.enter_a_diaspora_username') %br - %i= "Your Diaspora username is: #{current_user.diaspora_handle}" + %i= t '.your_diaspora_username_is', :diaspora_handle => current_user.diaspora_handle %p - = f.label :destination_url, "Friend's username" + = f.label :destination_url, t(".friends_username") = f.text_field :destination_url = f.hidden_field :aspect_id, :value => aspect.id = f.submit diff --git a/config/locales/de.yml b/config/locales/de.yml index 06fb5e6cb..07ff690d7 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -84,6 +84,18 @@ de: new_aspect: add_a_new_aspect: "Neuen Aspekt erstellen" create: "Erstellen" + create: + success: "Click on the plus on the left side to tell Diaspora who can see your new aspect." + destroy: + success: "%{name} was successfully removed." + update: + success: "Your aspect, %{name}, has been successfully edited." + move_friends: + failure: "Aspect editing failed for friend %{real_name}." + success: "Aspects edited successfully." + move_friend: + error: "didn't work %{inspect}" + notice: "You are now showing your friend a different aspect of yourself." helper: remove: "remove" aspect_not_empty: "Aspect not empty" diff --git a/config/locales/en.yml b/config/locales/en.yml index f4dc9d076..cd8055775 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -85,7 +85,17 @@ en: add_a_new_aspect: "Add a new aspect" create: "Create" create: - success:"Click on the plus on the left side to tell Diaspora who can see your new aspect." + success: "Click on the plus on the left side to tell Diaspora who can see your new aspect." + destroy: + success: "%{name} was successfully removed." + update: + success: "Your aspect, %{name}, has been successfully edited." + move_friends: + failure: "Aspect editing failed for friend %{real_name}." + success: "Aspects edited successfully." + move_friend: + error: "didn't work %{inspect}" + notice: "You are now showing your friend a different aspect of yourself." helper: remove: "remove" aspect_not_empty: "Aspect not empty" @@ -164,3 +174,9 @@ en: save: "save" are_you_sure: "Are you sure?" remove_friend: "remove friend" + requests: + new_request: + add_a_new_friend_to: "Add a new friend to" + enter_a_diaspora_username: "Enter a Diaspora username:" + your_diaspora_username_is: "Your Diaspora username is: %{diaspora_handle}" + friends_username: "Friend's username" diff --git a/config/locales/es.yml b/config/locales/es.yml index 7243c73a5..b9c11e4a6 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -87,6 +87,16 @@ es: create: "Crear" create: success:"Pulsa en el signo de mas a la izquierda para escojer quien puede ver su nuevo aspecto." + destroy: + success: "%{name} fue removido exitosamente." + update: + success: "Su aspecto, %{name}, fue editado exitosamente." + move_friends: + failure: "Fallo el editar aspecto para el amigo %{real_name}." + success: "Los aspectos fueron editados exitosamente." + move_friend: + error: "no funciono %{inspect}" + notice: "Ahora estas mostrando a tu amigo un aspecto diferente de ti." helper: remove: "remover" aspect_not_empty: "Aspecto no esta vacio" @@ -162,3 +172,9 @@ es: save: "guardar" are_you_sure: "Esta seguro?" remove_friend: "remover amigo" + requests: + new_request: + add_a_new_friend_to: "Añade un nuevo amigo a " + enter_a_diaspora_username: "Escribe el usuario de Diaspora:" + your_diaspora_username_is: "Tu usuario de Diaspora es: %{diaspora_handle}" + friends_username: "Usuario de amigo" diff --git a/config/locales/fr.yml b/config/locales/fr.yml index 0384d4577..7d58cd4aa 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -78,6 +78,18 @@ fr: new_aspect: add_a_new_aspect: "Ajouter un nouvel aspect" create: "Créer" + create: + success: "Click on the plus on the left side to tell Diaspora who can see your new aspect." + destroy: + success: "%{name} was successfully removed." + update: + success: "Your aspect, %{name}, has been successfully edited." + move_friends: + failure: "Aspect editing failed for friend %{real_name}." + success: "Aspects edited successfully." + move_friend: + error: "didn't work %{inspect}" + notice: "You are now showing your friend a different aspect of yourself." helper: remove: "remove" aspect_not_empty: "Aspect not empty" From c1c20e14f7573fc72917570862161b98995c39d4 Mon Sep 17 00:00:00 2001 From: Ariel Zavala Date: Fri, 17 Sep 2010 17:05:54 -0400 Subject: [PATCH 039/449] Added translations to requests controller --- app/controllers/requests_controller.rb | 14 +++++++------- config/locales/de.yml | 9 +++++++++ config/locales/en.yml | 9 +++++++++ config/locales/es.yml | 13 +++++++++++-- config/locales/fr.yml | 10 ++++++++++ 5 files changed, 46 insertions(+), 9 deletions(-) diff --git a/app/controllers/requests_controller.rb b/app/controllers/requests_controller.rb index 6087ebe85..2586592c2 100644 --- a/app/controllers/requests_controller.rb +++ b/app/controllers/requests_controller.rb @@ -13,15 +13,15 @@ class RequestsController < ApplicationController if params[:accept] if params[:aspect_id] @friend = current_user.accept_and_respond( params[:id], params[:aspect_id]) - flash[:notice] = "You are now friends." + flash[:notice] = I18n.t 'requests.destroy.success' respond_with :location => current_user.aspect_by_id(params[:aspect_id]) else - flash[:error] = "Please select an aspect!" + flash[:error] = I18n.t 'requests.destroy.error' respond_with :location => requests_url end else current_user.ignore_friend_request params[:id] - flash[:notice] = "Ignored friend request." + flash[:notice] = I18n.t 'requests.destroy.ignore' respond_with :location => requests_url end end @@ -37,7 +37,7 @@ class RequestsController < ApplicationController rel_hash = relationship_flow(params[:request][:destination_url]) rescue Exception => e raise e unless e.message.include? "not found" - flash[:error] = "No diaspora seed found with this email!" + flash[:error] = I18n.t 'requests.create.error' respond_with :location => aspect return end @@ -48,16 +48,16 @@ class RequestsController < ApplicationController @request = current_user.send_friend_request_to(rel_hash[:friend], aspect) rescue Exception => e raise e unless e.message.include? "already friends" - flash[:notice] = "You are already friends with #{params[:request][:destination_url]}!" + flash[:notice] = I18n.t 'requests.create.already_friends', :destination_url => params[:request][:destination_url] respond_with :location => aspect return end if @request - flash[:notice] = "A friend request was sent to #{@request.destination_url}." + flash[:notice] = I18n.t 'requests.create.success',:destination_url => @request.destination_url respond_with :location => aspect else - flash[:error] = "Something went horribly wrong." + flash[:error] = I18n.t 'requests.create.horribly_wrong' respond_with :location => aspect end end diff --git a/config/locales/de.yml b/config/locales/de.yml index 07ff690d7..d34e29fe5 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -175,3 +175,12 @@ de: save: "save" are_you_sure: "Are you sure?" remove_friend: "remove friend" + destroy: + success: "You are now friends." + error: "Please select an aspect!" + ignore: "Ignored friend request." + create: + error: "No diaspora seed found with this email!" + already_friends: "You are already friends with %{destination_url}!" + success: "A friend request was sent to %{destination_url}." + horribly_wrong: "Something went horribly wrong." diff --git a/config/locales/en.yml b/config/locales/en.yml index cd8055775..5c9e797ad 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -180,3 +180,12 @@ en: enter_a_diaspora_username: "Enter a Diaspora username:" your_diaspora_username_is: "Your Diaspora username is: %{diaspora_handle}" friends_username: "Friend's username" + destroy: + success: "You are now friends." + error: "Please select an aspect!" + ignore: "Ignored friend request." + create: + error: "No diaspora seed found with this email!" + already_friends: "You are already friends with %{destination_url}!" + success: "A friend request was sent to %{destination_url}." + horribly_wrong: "Something went horribly wrong." diff --git a/config/locales/es.yml b/config/locales/es.yml index b9c11e4a6..524633310 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -30,11 +30,11 @@ es: logout: "desloguear" shared: aspect_nav: - all_aspects: "Todo los Aspectos" + all_aspects: "Todos los Aspectos" manage: "Manejar" manage_your_aspects: "Maneja tus Aspectos" sub_header: - all_aspects: "Todo los Aspectos" + all_aspects: "Todos los Aspectos" manage_aspects: "Manejar Aspectos" publisher: share: "Compartir" @@ -178,3 +178,12 @@ es: enter_a_diaspora_username: "Escribe el usuario de Diaspora:" your_diaspora_username_is: "Tu usuario de Diaspora es: %{diaspora_handle}" friends_username: "Usuario de amigo" + destroy: + success: "Ahora son amigos." + error: "Seleccione un aspecto!" + ignore: "Ignorar peticion de amistad" + create: + error: "No diaspora seed found with this email!" + already_friends: "Ya eres amigo de %{destination_url}!" + success: "Una peticion de amistad se envio a %{destination_url}." + horribly_wrong: "Algo horriblemente mal sucedio" diff --git a/config/locales/fr.yml b/config/locales/fr.yml index 7d58cd4aa..383e136e5 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -166,3 +166,13 @@ fr: save: "save" are_you_sure: "Are you sure?" remove_friend: "remove friend" + destroy: + success: "You are now friends." + error: "Please select an aspect!" + ignore: "Ignored friend request." + create: + error: "No diaspora seed found with this email!" + already_friends: "You are already friends with %{destination_url}!" + success: "A friend request was sent to %{destination_url}." + horribly_wrong: "Something went horribly wrong." + From 4558f9901efe2408e49c8e8ae667b2b715da6dff Mon Sep 17 00:00:00 2001 From: Ariel Zavala Date: Fri, 17 Sep 2010 18:25:36 -0400 Subject: [PATCH 040/449] Added translations to photos and registrations controllers --- app/controllers/photos_controller.rb | 12 ++++++------ app/controllers/registrations_controller.rb | 2 +- config/locales/de.yml | 11 +++++++++++ config/locales/en.yml | 11 +++++++++++ config/locales/es.yml | 11 +++++++++++ config/locales/fr.yml | 11 +++++++++++ 6 files changed, 51 insertions(+), 7 deletions(-) diff --git a/app/controllers/photos_controller.rb b/app/controllers/photos_controller.rb index cefc8f5d6..203a748f6 100644 --- a/app/controllers/photos_controller.rb +++ b/app/controllers/photos_controller.rb @@ -40,15 +40,15 @@ class PhotosController < ApplicationController end rescue TypeError - message = "Photo upload failed. Are you sure an image was added?" + message = I18n.t 'photos.create.type_error' respond_with :location => album, :error => message rescue CarrierWave::IntegrityError - message = "Photo upload failed. Are you sure that was an image?" + message = I18n.t 'photos.create.integrity_error' respond_with :location => album, :error => message rescue RuntimeError => e - message = "Photo upload failed. Are you sure that your seatbelt is fastened?" + message = I18n.t 'photos.create.runtime_error' respond_with :location => album, :error => message raise e end @@ -63,7 +63,7 @@ class PhotosController < ApplicationController def destroy @photo = Photo.find_by_id params[:id] @photo.destroy - flash[:notice] = "Photo deleted." + flash[:notice] = I18n.t 'photos.destroy.notice' respond_with :location => @photo.album end @@ -84,10 +84,10 @@ class PhotosController < ApplicationController def update @photo = Photo.find_by_id params[:id] if @photo.update_attributes params[:photo] - flash[:notice] = "Photo successfully updated." + flash[:notice] = I18n.t 'photos.update.notice' respond_with @photo else - flash[:error] = "Failed to edit photo." + flash[:error] = I18n.t 'photos.update.error' render :action => :edit end end diff --git a/app/controllers/registrations_controller.rb b/app/controllers/registrations_controller.rb index 8241aa294..854f19e1a 100644 --- a/app/controllers/registrations_controller.rb +++ b/app/controllers/registrations_controller.rb @@ -16,7 +16,7 @@ class RegistrationsController < Devise::RegistrationsController end if user #set_flash_message :notice, :signed_up - flash[:notice] = "You've joined Diaspora!" + flash[:notice] = I18n.t 'registrations.create.success' #redirect_to root_url sign_in_and_redirect(:user, user) else diff --git a/config/locales/de.yml b/config/locales/de.yml index d34e29fe5..aabe057cd 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -137,9 +137,20 @@ de: new_photo: "Foto erstellen" back_to_list: "Zurück zur Liste" post_it: "Hochladen" + create: + runtime_error: "Photo upload failed. Are you sure that your seatbelt is fastened?" + integrity_error: "Photo upload failed. Are you sure that was an image?" + type_error: "Photo upload failed. Are you sure an image was added?" + update: + notice: "Photo successfully updated." + error: "Failed to edit photo." + destroy: + notice: "Photo deleted." registrations: new: sign_up: "Anmelden" + create: + success: "You've joined Diaspora!" status_messages: new_status_message: tell_me_something_good: "Erzähl' mir was schönes!" diff --git a/config/locales/en.yml b/config/locales/en.yml index 5c9e797ad..3a416b54f 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -136,9 +136,20 @@ en: new_photo: "New Photo" back_to_list: "Back to List" post_it: "post it!" + create: + runtime_error: "Photo upload failed. Are you sure that your seatbelt is fastened?" + integrity_error: "Photo upload failed. Are you sure that was an image?" + type_error: "Photo upload failed. Are you sure an image was added?" + update: + notice: "Photo successfully updated." + error: "Failed to edit photo." + destroy: + notice: "Photo deleted." registrations: new: sign_up: "Sign up" + create: + success: "You've joined Diaspora!" status_messages: new_status_message: tell_me_something_good: "tell me something good" diff --git a/config/locales/es.yml b/config/locales/es.yml index 524633310..de2617886 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -137,9 +137,20 @@ es: new_photo: "Nueva Foto" back_to_list: "Devuelta a la lista" post_it: "post it!" + create: + runtime_error: "Photo upload failed. Are you sure that your seatbelt is fastened?" + integrity_error: "Photo upload failed. Are you sure that was an image?" + type_error: "Photo upload failed. Are you sure an image was added?" + update: + notice: "Photo successfully updated." + error: "Failed to edit photo." + destroy: + notice: "Photo deleted." registrations: new: sign_up: "Registrate" + create: + success: "Esta registrado en Diaspora!" status_messages: new_status_message: tell_me_something_good: "dime algo bueno" diff --git a/config/locales/fr.yml b/config/locales/fr.yml index 383e136e5..9a0ac8d22 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -128,9 +128,20 @@ fr: new_photo: "Nouvelle photo" back_to_list: "Retour à la liste" post_it: "postez le !" + create: + runtime_error: "Photo upload failed. Are you sure that your seatbelt is fastened?" + integrity_error: "Photo upload failed. Are you sure that was an image?" + type_error: "Photo upload failed. Are you sure an image was added?" + update: + notice: "Photo successfully updated." + error: "Failed to edit photo." + destroy: + notice: "Photo deleted." registrations: new: sign_up: "Enregistrement" + create: + success: "You've joined Diaspora!" status_messages: new_status_message: tell_me_something_good: "Dites quelque-chose de bien" From 08bdaf7340875cc0539d677da32c0a401672926b Mon Sep 17 00:00:00 2001 From: Mikhail Zubrov Date: Sat, 18 Sep 2010 09:58:29 +0400 Subject: [PATCH 041/449] add a Russian translation --- config/locales/devise.ru.yml | 41 ++++++++++++++++++++++++++++++++++++ config/locales/ru.yml | 10 +++++++++ 2 files changed, 51 insertions(+) create mode 100644 config/locales/devise.ru.yml create mode 100644 config/locales/ru.yml diff --git a/config/locales/devise.ru.yml b/config/locales/devise.ru.yml new file mode 100644 index 000000000..0e9b7b92f --- /dev/null +++ b/config/locales/devise.ru.yml @@ -0,0 +1,41 @@ +# Copyright (c) 2010, Diaspora Inc. This file is +# licensed under the Affero General Public License version 3. See +# the COPYRIGHT file. + + +en: + errors: + messages: + not_found: "не найден(о)" + already_confirmed: "уже подтвержден(о)" + not_locked: "не заблокирован(о)" + + devise: + failure: + unauthenticated: 'Вам нужно войти либо зарегистрироваться, чтобы продолжить.' + unconfirmed: 'Вам нужно подтвердить вашу учётную запись, чтобы продолжить.' + locked: 'Ваша учётная запись заблокирована.' + invalid: 'Неверный e-mail или пароль.' + invalid_token: 'Неверный ключ аутентификации.' + timeout: 'Срок вашего сеанса истёк, пожалуйста, войдите в систему снова.' + inactive: 'Ваша учётная запись ещё не активирована.' + sessions: + signed_in: 'Вход в систему выполнен успешно.' + signed_out: 'Выход из системы выполнен успешно.' + passwords: + send_instructions: 'Вы получите e-mail с указаниями по сбросу пароля в течение нескольких минут.' + updated: 'Ваш пароль был изменён. Вы вошли в систему.' + confirmations: + send_instructions: 'Вы получите e-mail с указаниями по подтверждению учётной записи в течение нескольких минут.' + confirmed: 'Ваша учётная запись была подтверждена. Вы вошли в систему.' + registrations: + signed_up: 'Регистрация выполнена успешно. В зависимости от настроек, вам может прийти e-mail с подтверждением.' + updated: 'Обновление вашей учётной записи выполнено успешно.' + destroyed: 'До свидания! Ваша учётная запись была удалена. Надеемся, что вскоре вас увидим снова.' + unlocks: + send_instructions: 'Вы получите e-mail с указаниями по разблокированию учётной записи в течение нескольких минут.' + unlocked: 'Ваша учётная запись была разблокирована. Вы вошли в систему.' + mailer: + confirmation_instructions: 'Подтверждение учётной записи' + reset_password_instructions: 'Сброс пароля' + unlock_instructions: 'Разблокирование учётной записи' diff --git a/config/locales/ru.yml b/config/locales/ru.yml new file mode 100644 index 000000000..1a8e7fc4e --- /dev/null +++ b/config/locales/ru.yml @@ -0,0 +1,10 @@ +# Copyright (c) 2010, Diaspora Inc. This file is +# licensed under the Affero General Public License version 3. See +# the COPYRIGHT file. + + +# Sample localization file for English. Add more files in this directory for other locales. +# See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. + +en: + hello: "Привет, мир" From 7e20f4242220f25ab987b751334531bd918d22d8 Mon Sep 17 00:00:00 2001 From: MrBison Date: Sat, 18 Sep 2010 02:18:07 -0700 Subject: [PATCH 042/449] oops, a stupid error. --- config/locales/devise.ru.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/locales/devise.ru.yml b/config/locales/devise.ru.yml index 0e9b7b92f..670d57026 100644 --- a/config/locales/devise.ru.yml +++ b/config/locales/devise.ru.yml @@ -3,7 +3,7 @@ # the COPYRIGHT file. -en: +ru: errors: messages: not_found: "не найден(о)" From a049cabc2d15ab853cfb533bfd1b8dc37ad82316 Mon Sep 17 00:00:00 2001 From: MrBison Date: Sat, 18 Sep 2010 02:18:35 -0700 Subject: [PATCH 043/449] oops, a stupid error fixed --- config/locales/ru.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/locales/ru.yml b/config/locales/ru.yml index 1a8e7fc4e..fe944aa59 100644 --- a/config/locales/ru.yml +++ b/config/locales/ru.yml @@ -6,5 +6,5 @@ # Sample localization file for English. Add more files in this directory for other locales. # See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. -en: +ru: hello: "Привет, мир" From 32957658ba6c3dc443492923c08509cf2e2e846e Mon Sep 17 00:00:00 2001 From: Darkmagister Date: Sat, 18 Sep 2010 12:04:35 +0200 Subject: [PATCH 044/449] adding Italian locale --- config/locales/devise.it.yml | 41 ++++++++++++++++++++++++++++++++++++ config/locales/it.yml | 10 +++++++++ 2 files changed, 51 insertions(+) create mode 100644 config/locales/devise.it.yml create mode 100644 config/locales/it.yml diff --git a/config/locales/devise.it.yml b/config/locales/devise.it.yml new file mode 100644 index 000000000..9b0fb0957 --- /dev/null +++ b/config/locales/devise.it.yml @@ -0,0 +1,41 @@ +# Copyright (c) 2010, Diaspora Inc. This file is +# licensed under the Affero General Public License version 3. See +# the COPYRIGHT file. + + +it: + errors: + messages: + not_found: "non trovato" + already_confirmed: "già confermato" + not_locked: "non bloccato" + + devise: + failure: + unauthenticated: 'È necessario che tu acceda o ti registri prima di continuare.' + unconfirmed: 'Devi confermare il tuo account prima di continuare.' + locked: 'Il tuo account è bloccato.' + invalid: 'Email o password invalida.' + invalid_token: 'Invalido token di autenticazione.' + timeout: 'La tua sessione è scaduta, per favore accedi nuovamente per continuare.' + inactive: 'Il tuo account non è ancora stato attivato.' + sessions: + signed_in: 'Collegamento avvenuto con successo.' + signed_out: 'Uscita avvenuta con successo.' + passwords: + send_instructions: 'Tra quale minuto riceverai una email con le istruzioni per ripristinare la password.' + updated: 'La tua password è stata cambiata con successo. Ora sei collegato.' + confirmations: + send_instructions: 'Tra qualche minuti riceverai una email con le istruzioni per confermare il tuo account.' + confirmed: 'Il tuo account è stato confermato con successo. Ora sei collegato.' + registrations: + signed_up: 'Ti sei registrato con successo. Se abilitato, ti verrà inviata una email di conferma.' + updated: 'Hai aggiornato il tuo account.' + destroyed: 'Addio! Il tuo account è stato cancellato. Speriamo di rivederti presto.' + unlocks: + send_instructions: 'Tra qualche minuti riceverai una email con le istruzioni per sbloccare il tuo account.' + unlocked: 'Il tuo account è stato sbloccato. Ora sei collegato.' + mailer: + confirmation_instructions: 'Istruzioni per la conferma' + reset_password_instructions: 'Istruzioni per il reset della password' + unlock_instructions: 'Istruzioni per lo sblocco' diff --git a/config/locales/it.yml b/config/locales/it.yml new file mode 100644 index 000000000..4cce93d73 --- /dev/null +++ b/config/locales/it.yml @@ -0,0 +1,10 @@ +# Copyright (c) 2010, Diaspora Inc. This file is +# licensed under the Affero General Public License version 3. See +# the COPYRIGHT file. + + +# Sample localization file for Italian. Add more files in this directory for other locales. +# See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. + +it: + hello: "Ciao Mondo" From 99651408740fdffe3952552d00fac8ec915f90ac Mon Sep 17 00:00:00 2001 From: Marcin Karpezo Date: Sat, 18 Sep 2010 13:32:17 +0200 Subject: [PATCH 045/449] Translated devise.en.yml --- config/locales/devise.pl.yml | 41 ++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 config/locales/devise.pl.yml diff --git a/config/locales/devise.pl.yml b/config/locales/devise.pl.yml new file mode 100644 index 000000000..ec9f44220 --- /dev/null +++ b/config/locales/devise.pl.yml @@ -0,0 +1,41 @@ +# Copyright (c) 2010, Diaspora Inc. This file is +# licensed under the Affero General Public License version 3. See +# the COPYRIGHT file. + + +en: + errors: + messages: + not_found: "nie znaleziono" + already_confirmed: "potwierdzono wcześniej" + not_locked: "nie był zablokowany" + + devise: + failure: + unauthenticated: 'By kontynuować musisz się zalogować lub zarejestrować.' + unconfirmed: 'Musisz aktywować swoje konto.' + locked: 'Twoje konto jest zablokowane.' + invalid: 'Nieprawidłowy adres email lub hasło.' + invalid_token: 'Nieprawidłowy kod identyfikacyjny.' + timeout: 'Twoja sesja wygasła, zaloguj się ponownie by kontynuować.' + inactive: 'Twoje konto nie zostało jeszcze aktywowane.' + sessions: + signed_in: 'Zalogowano pomyślnie.' + signed_out: 'Wylogowano.' + passwords: + send_instructions: 'W ciągu kilku minut otrzymasz maila zawierającego instrukcjie dotyczące zresetowania hasła.' + updated: 'Twoje hasło zostało zmienione, zostałeś zalogowany.' + confirmations: + send_instructions: 'W ciągu kilku minut otrzymasz maila zawierającego instrukcje dotyczące aktywacji konta.' + confirmed: 'Twoje konto zostało aktywowane, zostałeś zalogowany.' + registrations: + signed_up: 'Zostałeś zarejestrowany. Jeśli aktywowano odpowiednią opcję, wyślemy do Ciebie email potwierdzający rejestrację.' + updated: 'Pomyślnie zaktualizowano informacje o Twoim koncie.' + destroyed: 'Żegnaj! Twoje konto zostało usunięte.' + unlocks: + send_instructions: 'W ciągu kilku minut otrzymasz email z instrukcjami odblokowania konta.' + unlocked: 'Twoje konto zostało odblokowane, jesteś zalogowany.' + mailer: + confirmation_instructions: 'Instrukcje aktywacji' + reset_password_instructions: 'Instrukcje zmiany hasła' + unlock_instructions: 'Instrukcje odblokowania' From 0ce90b4b714fa836936bf60b705f1d2c364390c7 Mon Sep 17 00:00:00 2001 From: Marcin Karpezo Date: Sat, 18 Sep 2010 13:34:02 +0200 Subject: [PATCH 046/449] Translated en.yml --- config/locales/pl.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 config/locales/pl.yml diff --git a/config/locales/pl.yml b/config/locales/pl.yml new file mode 100644 index 000000000..e31046c29 --- /dev/null +++ b/config/locales/pl.yml @@ -0,0 +1,10 @@ +# Copyright (c) 2010, Diaspora Inc. This file is +# licensed under the Affero General Public License version 3. See +# the COPYRIGHT file. + + +# Sample localization file for English. Add more files in this directory for other locales. +# See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. + +en: + hello: "Witaj świecie" From ecadeac86c77ea662c63dcdffba686ba6b5e22dc Mon Sep 17 00:00:00 2001 From: Marcin Karpezo Date: Sat, 18 Sep 2010 14:27:52 +0200 Subject: [PATCH 047/449] fixed translation --- config/locales/devise.pl.yml | 2 +- config/locales/pl.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config/locales/devise.pl.yml b/config/locales/devise.pl.yml index ec9f44220..a490a1a39 100644 --- a/config/locales/devise.pl.yml +++ b/config/locales/devise.pl.yml @@ -3,7 +3,7 @@ # the COPYRIGHT file. -en: +pl: errors: messages: not_found: "nie znaleziono" diff --git a/config/locales/pl.yml b/config/locales/pl.yml index e31046c29..2052779bd 100644 --- a/config/locales/pl.yml +++ b/config/locales/pl.yml @@ -6,5 +6,5 @@ # Sample localization file for English. Add more files in this directory for other locales. # See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. -en: +pl: hello: "Witaj świecie" From bf98ec38d0271775e5e7aad9e8a6199289e9d82c Mon Sep 17 00:00:00 2001 From: Ariel Zavala Date: Sat, 18 Sep 2010 11:09:21 -0400 Subject: [PATCH 048/449] Moved devise.pl to devise locale folder --- config/locales/{ => devise}/devise.pl.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename config/locales/{ => devise}/devise.pl.yml (100%) diff --git a/config/locales/devise.pl.yml b/config/locales/devise/devise.pl.yml similarity index 100% rename from config/locales/devise.pl.yml rename to config/locales/devise/devise.pl.yml From 216cf8ccd77b4d6d4f90c2849bd3df5956d010a0 Mon Sep 17 00:00:00 2001 From: Ariel Zavala Date: Sat, 18 Sep 2010 11:14:39 -0400 Subject: [PATCH 049/449] Moved devise.ru to devise locale folder --- config/locales/{ => devise}/devise.ru.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename config/locales/{ => devise}/devise.ru.yml (100%) diff --git a/config/locales/devise.ru.yml b/config/locales/devise/devise.ru.yml similarity index 100% rename from config/locales/devise.ru.yml rename to config/locales/devise/devise.ru.yml From f48b8a4748565a8333725069661e7de02ca042d7 Mon Sep 17 00:00:00 2001 From: Ariel Zavala Date: Sat, 18 Sep 2010 11:20:57 -0400 Subject: [PATCH 050/449] Moved devise.it to devise locale folder --- config/locales/{ => devise}/devise.it.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename config/locales/{ => devise}/devise.it.yml (100%) diff --git a/config/locales/devise.it.yml b/config/locales/devise/devise.it.yml similarity index 100% rename from config/locales/devise.it.yml rename to config/locales/devise/devise.it.yml From 34c0c3c89f3aeda6c142f34f63262cdb11edfabc Mon Sep 17 00:00:00 2001 From: Otacon Date: Sat, 18 Sep 2010 18:30:00 +0800 Subject: [PATCH 051/449] Added italian translation (it) --- config/locales/devise.it.yml | 41 ++++++++++++++++++++++++++++++++++++ config/locales/it.yml | 10 +++++++++ 2 files changed, 51 insertions(+) create mode 100644 config/locales/devise.it.yml create mode 100644 config/locales/it.yml diff --git a/config/locales/devise.it.yml b/config/locales/devise.it.yml new file mode 100644 index 000000000..08b255546 --- /dev/null +++ b/config/locales/devise.it.yml @@ -0,0 +1,41 @@ +# Copyright (c) 2010, Diaspora Inc. This file is +# licensed under the Affero General Public License version 3. See +# the COPYRIGHT file. + + +it: + errors: + messages: + not_found: "non trovato" + already_confirmed: "è già stato confermato" + not_locked: "non era bloccato" + + devise: + failure: + unauthenticated: 'Devi effettuare l'accesso o registrarci prima di continuare.' + unconfirmed: 'Devi confermare il tuo account prima di continuare.' + locked: 'Il tuo account è bloccato.' + invalid: 'Email o password errati.' + invalid_token: 'Token di autenticazione errato.' + timeout: 'La tua sessione è scaduta, effettua di nuovo l'accesso per continuare.' + inactive: 'Il tuo account non è ancora stato attivato.' + sessions: + signed_in: 'Accesso effettuato con successo.' + signed_out: 'Disconnessione effettuata con successo.' + passwords: + send_instructions: 'Tra pochi minuti riceverai una email con le istruzioni su come cambiare la tua password.' + updated: 'La tua password è stata modificata. Hai appena effettuato l'accesso.' + confirmations: + send_instructions: 'Tra pochi minuti riceverai una email per confermare il tuo account.' + confirmed: 'Il tuo account è stato confermato con successo. Hai appena effettuato l'accesso.' + registrations: + signed_up: 'Ti sei iscritto. Se il servizio è disponibile, riceverai una conferma via email.' + updated: 'Hai aggiornato il tuo account.' + destroyed: 'Ciao!Il tuo account è stato rimosso. Speriamo che tu torni a trovarci presto.' + unlocks: + send_instructions: 'Tra pochi minuti riceverai una mail con le istruzioni su come sbloccare il tuo account.' + unlocked: 'Il tuo account è stato sbloccato. Hai appena effettuato l'accesso.' + mailer: + confirmation_instructions: 'Istruzioni sulla conferma' + reset_password_instructions: 'Istruzioni su come cambiare la password' + unlock_instructions: 'Istruzione su come sbloccare l'accont' diff --git a/config/locales/it.yml b/config/locales/it.yml new file mode 100644 index 000000000..1da349bf9 --- /dev/null +++ b/config/locales/it.yml @@ -0,0 +1,10 @@ +# Copyright (c) 2010, Diaspora Inc. This file is +# licensed under the Affero General Public License version 3. See +# the COPYRIGHT file. + + +# Sample localization file for Italian. Add more files in this directory for other locales. +# See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. + +it: + hello: "Ciao mondo!" From 45b6ff53f176f46f8d768773cbe93fc2f6c93dca Mon Sep 17 00:00:00 2001 From: Aria Stewart Date: Sat, 18 Sep 2010 16:35:48 -0600 Subject: [PATCH 052/449] Ruby 1.9 fixes --- app/controllers/photos_controller.rb | 4 ++-- app/models/photo.rb | 2 +- config.ru | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/controllers/photos_controller.rb b/app/controllers/photos_controller.rb index cefc8f5d6..4065ff34c 100644 --- a/app/controllers/photos_controller.rb +++ b/app/controllers/photos_controller.rb @@ -21,9 +21,9 @@ class PhotosController < ApplicationController # get file content type att_content_type = (request.content_type.to_s == "") ? "application/octet-stream" : request.content_type.to_s # create temporal file - file = Tempfile.new(file_name) + file = Tempfile.new(file_name, {encoding: 'BINARY'}) # put data into this file from raw post request - file.print request.raw_post + file.print request.raw_post.force_encoding('BINARY') # create several required methods for this temporal file Tempfile.send(:define_method, "content_type") {return att_content_type} diff --git a/app/models/photo.rb b/app/models/photo.rb index 8792911f3..92b02d36d 100644 --- a/app/models/photo.rb +++ b/app/models/photo.rb @@ -22,7 +22,7 @@ class Photo < Post timestamps! validates_presence_of :album - validates_true_for :album_id, :logic => lambda {self.validate_album_person} + validates_true_for(:album_id, :logic => Proc.new { self.validate_album_person }) before_destroy :ensure_user_picture diff --git a/config.ru b/config.ru index cb12bcfa2..ed9da1085 100644 --- a/config.ru +++ b/config.ru @@ -6,6 +6,7 @@ # This file is used by Rack-based servers to start the application. +$LOAD_PATH << '.' require ::File.expand_path('../config/environment', __FILE__) #use Rack::FiberPool #require 'lib/chrome_frame' From f034b180c2247ded4171eb81896b4fa001b409ff Mon Sep 17 00:00:00 2001 From: danielvincent Date: Sat, 18 Sep 2010 15:36:42 -0700 Subject: [PATCH 053/449] quotation fix in italian locale --- config/locales/devise.it.yml | 42 ++++++++++++++++++------------------ 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/config/locales/devise.it.yml b/config/locales/devise.it.yml index 08b255546..75b90affc 100644 --- a/config/locales/devise.it.yml +++ b/config/locales/devise.it.yml @@ -12,30 +12,30 @@ it: devise: failure: - unauthenticated: 'Devi effettuare l'accesso o registrarci prima di continuare.' - unconfirmed: 'Devi confermare il tuo account prima di continuare.' - locked: 'Il tuo account è bloccato.' - invalid: 'Email o password errati.' - invalid_token: 'Token di autenticazione errato.' - timeout: 'La tua sessione è scaduta, effettua di nuovo l'accesso per continuare.' - inactive: 'Il tuo account non è ancora stato attivato.' + unauthenticated: "Devi effettuare l'accesso o registrarci prima di continuare." + unconfirmed: "Devi confermare il tuo account prima di continuare." + locked: "Il tuo account è bloccato." + invalid: "Email o password errati." + invalid_token: "Token di autenticazione errato." + timeout: "La tua sessione è scaduta, effettua di nuovo l'accesso per continuare." + inactive: "Il tuo account non è ancora stato attivato." sessions: - signed_in: 'Accesso effettuato con successo.' - signed_out: 'Disconnessione effettuata con successo.' + signed_in: "Accesso effettuato con successo." + signed_out: "Disconnessione effettuata con successo." passwords: - send_instructions: 'Tra pochi minuti riceverai una email con le istruzioni su come cambiare la tua password.' - updated: 'La tua password è stata modificata. Hai appena effettuato l'accesso.' + send_instructions: "Tra pochi minuti riceverai una email con le istruzioni su come cambiare la tua password." + updated: "La tua password è stata modificata. Hai appena effettuato l'accesso." confirmations: - send_instructions: 'Tra pochi minuti riceverai una email per confermare il tuo account.' - confirmed: 'Il tuo account è stato confermato con successo. Hai appena effettuato l'accesso.' + send_instructions: "Tra pochi minuti riceverai una email per confermare il tuo account." + confirmed: "Il tuo account è stato confermato con successo. Hai appena effettuato l'accesso." registrations: - signed_up: 'Ti sei iscritto. Se il servizio è disponibile, riceverai una conferma via email.' - updated: 'Hai aggiornato il tuo account.' - destroyed: 'Ciao!Il tuo account è stato rimosso. Speriamo che tu torni a trovarci presto.' + signed_up: "Ti sei iscritto. Se il servizio è disponibile, riceverai una conferma via email." + updated: "Hai aggiornato il tuo account." + destroyed: "Ciao!Il tuo account è stato rimosso. Speriamo che tu torni a trovarci presto." unlocks: - send_instructions: 'Tra pochi minuti riceverai una mail con le istruzioni su come sbloccare il tuo account.' - unlocked: 'Il tuo account è stato sbloccato. Hai appena effettuato l'accesso.' + send_instructions: "Tra pochi minuti riceverai una mail con le istruzioni su come sbloccare il tuo account." + unlocked: "Il tuo account è stato sbloccato. Hai appena effettuato l'accesso." mailer: - confirmation_instructions: 'Istruzioni sulla conferma' - reset_password_instructions: 'Istruzioni su come cambiare la password' - unlock_instructions: 'Istruzione su come sbloccare l'accont' + confirmation_instructions: "Istruzioni sulla conferma" + reset_password_instructions: "Istruzioni su come cambiare la password" + unlock_instructions: "Istruzione su come sbloccare l'account" From 6cf5f6c8c7f1d46197e89f4dd79b3f51db9eed40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=99Jarkko?= <’jm60697@gmail.com’> Date: Sat, 18 Sep 2010 19:37:09 +0800 Subject: [PATCH 054/449] Finnish locales --- config/locales/devise.fi.yml | 41 ++++++++++++++++++++++++++++++++++++ config/locales/fi.yml | 10 +++++++++ 2 files changed, 51 insertions(+) create mode 100644 config/locales/devise.fi.yml create mode 100644 config/locales/fi.yml diff --git a/config/locales/devise.fi.yml b/config/locales/devise.fi.yml new file mode 100644 index 000000000..591341501 --- /dev/null +++ b/config/locales/devise.fi.yml @@ -0,0 +1,41 @@ +# Copyright (c) 2010, Diaspora Inc. This file is +# licensed under the Affero General Public License version 3. See +# the COPYRIGHT file. +# Translator: jarkko moilanen, jm60697@gmail.com + +fi: + errors: + messages: + not_found: "ei löytynyt" + already_confirmed: "oli jo varmistettu" + not_locked: "ei ollut lukittu" + + devise: + failure: + unauthenticated: 'Kirjaudu tai rekisteröidy ennen kuin voit jatkaa.' + unconfirmed: 'Sinun pitää vahvistaa käyttäjätilisi ennen kuin voit jatkaa' + locked: 'Käyttäjätilisi on lukittu.' + invalid: 'Väärä sähköpostiosoite tai salasana.' + invalid_token: 'Viallinen todennus.' + timeout: 'Istunto on vanhentunut, kirjaudu uudelleen.' + inactive: 'Käyttätiliäsi ei ole vielä vahvistettu.' + sessions: + signed_in: 'Sisäänkirjautuminen onnistui.' + signed_out: 'Uoskirjautuminen onnistui.' + passwords: + send_instructions: 'Saat hetken päästä sähköpostiisi ohjeet siitä miten asetat salasanasi uudelleen. + updated: 'Salasanasi on vaihdettu. Olet nyt kirjautunut sisään.' + confirmations: + send_instructions: 'Saat hetken päästä sähköpostiisi ohjeet siitä miten vahvistat käyttäjätilisi luonnin.' + confirmed: 'Käyttäjätilisi luonti on vahvistettu. Olet nyt kirjautunut sisään.' + registrations: + signed_up: 'Käyttäjätilin luominen onnistui. Mahdollinen vahvistuspyyntö on lähetetty sähköpostiisi.' + updated: 'Käyttäjätilisi on päivitetty.' + destroyed: 'Näkemiin! Käyttäjätilisi on poistettu. Toivottavasti näemme sinut pian uudelleen.' + unlocks: + send_instructions: 'Saat muutaman minuutin kuluttua sähköpostiisi ohjeet siitä miten avaat lukituksen.' + unlocked: 'Käyttäjätilisi lukitus on avattu. Olet nyt kirjautunut sisään.' + mailer: + confirmation_instructions: 'Ohjeet vahvistamiseen/todentamiseen' + reset_password_instructions: 'Ohjeet salananan uudelleenasettamiseksi' + unlock_instructions: 'Ohjeet lukituksen poistamiseksi' diff --git a/config/locales/fi.yml b/config/locales/fi.yml new file mode 100644 index 000000000..5e1a6da32 --- /dev/null +++ b/config/locales/fi.yml @@ -0,0 +1,10 @@ +# Copyright (c) 2010, Diaspora Inc. This file is +# licensed under the Affero General Public License version 3. See +# the COPYRIGHT file. +# Translator jarkko moilanen, jm60697@gmail.com + +# Sample localization file for English. Add more files in this directory for other locales. +# See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. + +fi: + hello: "Terve, maailma" From ac09f48cf86cd2bb3ab07f1e4f24b56b3ce112d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danillo=20C=C3=A9sar?= Date: Sun, 19 Sep 2010 00:53:39 +0800 Subject: [PATCH 055/449] Added locales files for portuguese brazilian. --- config/locales/devise.pt-BR.yml | 41 +++++++++++++++++++++++++++++++++ config/locales/pt-BR.yml | 10 ++++++++ 2 files changed, 51 insertions(+) create mode 100644 config/locales/devise.pt-BR.yml create mode 100644 config/locales/pt-BR.yml diff --git a/config/locales/devise.pt-BR.yml b/config/locales/devise.pt-BR.yml new file mode 100644 index 000000000..ba2b3b5de --- /dev/null +++ b/config/locales/devise.pt-BR.yml @@ -0,0 +1,41 @@ +# Copyright (c) 2010, Diaspora Inc. This file is +# licensed under the Affero General Public License version 3. See +# the COPYRIGHT file. + + +pt-BR: + errors: + messages: + not_found: "não encontrado" + already_confirmed: "já foi confirmado" + not_locked: "não foi bloqueado" + + devise: + failure: + unauthenticated: 'Você precisa fazer login ou se cadastrar antes de continuar.' + unconfirmed: 'Você tem que confirmar a sua conta antes de continuar.' + locked: 'Sua conta está bloqueada.' + invalid: 'E-mail ou senha inválida.' + invalid_token: 'Token de autenticação inválida.' + timeout: 'Sua sessão expirou, por favor logue-se novamente para continuar.' + inactive: 'Sua conta ainda não foi ativada.' + sessions: + signed_in: 'Você entrou com sucesso.' + signed_out: 'Você saiu com sucesso.' + passwords: + send_instructions: 'Você receberá um email com instruções sobre como redefinir sua senha em alguns minutos.' + updated: 'Sua senha foi alterada com sucesso.' + confirmations: + send_instructions: 'Você receberá um email em alguns minutos com as instruções sobre como confirmar a sua conta.' + confirmed: 'Sua conta foi confirmada com sucesso. Você já pode continuar navegando.' + registrations: + signed_up: 'Você se inscreveu com êxito. Se habilitado, a confirmação foi enviada para seu e-mail.' + updated: 'Você atualizou a sua conta com sucesso.' + destroyed: 'Sua conta foi cancelada com sucesso. Esperamos vê-lo novamente em breve.' + unlocks: + send_instructions: 'Você receberá um email em alguns minutos com as instruções sobre como desbloquear a sua conta.' + unlocked: 'Sua conta foi desbloqueada com sucesso. Você já pode continuar navegando.' + mailer: + confirmation_instructions: 'Instruções para confirmarção' + reset_password_instructions: 'Instruções para redefinir a senha' + unlock_instructions: 'Instruções para o desbloqueio' diff --git a/config/locales/pt-BR.yml b/config/locales/pt-BR.yml new file mode 100644 index 000000000..67c077090 --- /dev/null +++ b/config/locales/pt-BR.yml @@ -0,0 +1,10 @@ +# Copyright (c) 2010, Diaspora Inc. This file is +# licensed under the Affero General Public License version 3. See +# the COPYRIGHT file. + + +# Sample localization file for Portuguese Brazilian. Add more files in this directory for other locales. +# See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. + +pt-BR: + hello: "Olá Mundo" From 2efde8a841c65ae26559047525a31b8449221a3f Mon Sep 17 00:00:00 2001 From: danielvincent Date: Sat, 18 Sep 2010 15:50:35 -0700 Subject: [PATCH 056/449] added missing quote in finnish locale --- config/locales/devise.fi.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/locales/devise.fi.yml b/config/locales/devise.fi.yml index 591341501..4ee6761f8 100644 --- a/config/locales/devise.fi.yml +++ b/config/locales/devise.fi.yml @@ -23,7 +23,7 @@ fi: signed_in: 'Sisäänkirjautuminen onnistui.' signed_out: 'Uoskirjautuminen onnistui.' passwords: - send_instructions: 'Saat hetken päästä sähköpostiisi ohjeet siitä miten asetat salasanasi uudelleen. + send_instructions: 'Saat hetken päästä sähköpostiisi ohjeet siitä miten asetat salasanasi uudelleen.' updated: 'Salasanasi on vaihdettu. Olet nyt kirjautunut sisään.' confirmations: send_instructions: 'Saat hetken päästä sähköpostiisi ohjeet siitä miten vahvistat käyttäjätilisi luonnin.' From e9a3f46fbda8fcb749535103a07da0c63ba46221 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Sat, 18 Sep 2010 16:42:07 -0700 Subject: [PATCH 057/449] fixed query function to go through mongomapper instead of custom --- app/models/person.rb | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/app/models/person.rb b/app/models/person.rb index 1e2a7b18d..aac7b23ae 100644 --- a/app/models/person.rb +++ b/app/models/person.rb @@ -34,11 +34,8 @@ class Person validates_format_of :url, :with => /^(https?):\/\/[a-z0-9]+([\-\.]{1}[a-z0-9]+)*(\.[a-z]{2,5})?(:[0-9]{1,5})?(\/.*)?$/ix - def self.search(query) - Person.all('$where' => "function() { return this.diaspora_handle.match(/^#{query}/i) || - this.profile.first_name.match(/^#{query}/i) || - this.profile.last_name.match(/^#{query}/i); }") + Person.all('profile.first_name' => /^#{query}/) | Person.all('profile.last_name' => /^#{query}/) end def real_name From 08f833ba7a5c276668ac5f44ffe3db536bb3ce78 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Sat, 18 Sep 2010 17:21:18 -0700 Subject: [PATCH 058/449] case insensitivity on search --- app/models/person.rb | 2 +- spec/models/person_spec.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/models/person.rb b/app/models/person.rb index aac7b23ae..b1e7e3745 100644 --- a/app/models/person.rb +++ b/app/models/person.rb @@ -35,7 +35,7 @@ class Person /^(https?):\/\/[a-z0-9]+([\-\.]{1}[a-z0-9]+)*(\.[a-z]{2,5})?(:[0-9]{1,5})?(\/.*)?$/ix def self.search(query) - Person.all('profile.first_name' => /^#{query}/) | Person.all('profile.last_name' => /^#{query}/) + Person.all('profile.first_name' => /^#{query}/i) | Person.all('profile.last_name' => /^#{query}/i) end def real_name diff --git a/spec/models/person_spec.rb b/spec/models/person_spec.rb index bffe37f85..4f236b733 100644 --- a/spec/models/person_spec.rb +++ b/spec/models/person_spec.rb @@ -134,13 +134,13 @@ describe Person do people.include?(@friend_three).should == false people.include?(@friend_four).should == false - people = Person.search("Wei") + people = Person.search("wEi") people.include?(@friend_two).should == true people.include?(@friend_one).should == false people.include?(@friend_three).should == false people.include?(@friend_four).should == false - people = Person.search("Gri") + people = Person.search("gri") people.include?(@friend_one).should == true people.include?(@friend_four).should == true people.include?(@friend_two).should == false From b5a29713027a1810234a0df4b1440baa618af64b Mon Sep 17 00:00:00 2001 From: danielvincent Date: Sat, 18 Sep 2010 17:49:52 -0700 Subject: [PATCH 059/449] search results for people now look like the stream --- app/views/people/_person.html.haml | 26 +++++++++++++++ app/views/people/index.html.haml | 42 +++++------------------- public/stylesheets/application.css | 2 ++ public/stylesheets/sass/application.sass | 3 ++ 4 files changed, 39 insertions(+), 34 deletions(-) create mode 100644 app/views/people/_person.html.haml diff --git a/app/views/people/_person.html.haml b/app/views/people/_person.html.haml new file mode 100644 index 000000000..ef1c69d28 --- /dev/null +++ b/app/views/people/_person.html.haml @@ -0,0 +1,26 @@ +-# Copyright (c) 2010, Diaspora Inc. This file is +-# licensed under the Affero General Public License version 3. See +-# the COPYRIGHT file. + + +%li.message{:id => person.id} + + = person_image_link(person) + + .content + %span.from + = link_to person.real_name, person + + .info + = person.diaspora_handle + + .right{ :style => "display:inline;top:0;" } + - if person.id == current_user.person.id + thats you! + - elsif current_user.pending_requests.find_by_person_id(person.id) + = link_to "pending request", aspects_manage_path + - else + = form_for Request.new do |f| + = f.select(:aspect_id, @aspects_dropdown_array) + = f.hidden_field :destination_url, :value => person.diaspora_handle + = f.submit "add friend" diff --git a/app/views/people/index.html.haml b/app/views/people/index.html.haml index c18ec5d0a..f80a80f3e 100644 --- a/app/views/people/index.html.haml +++ b/app/views/people/index.html.haml @@ -14,38 +14,12 @@ - content_for :left_pane do \. -= (@people.count).to_s + search_or_index -%table - %tr - %th real name - %th diaspora handle - %th url - - for person in @people - %tr - - if current_user.friends.include? person - %td= link_to person.real_name, person - - else - %td= person.real_name +%h1 + search results for + %u= params[:q] - %td= person.diaspora_handle - %td= person.url - - -if current_user.friends.include? person - - - elsif person.id == current_user.person.id - %td - %td that's you! - -elsif current_user.pending_requests.find_by_person_id(person.id) - %td - %td ^-you have a friend request from this person - -elsif current_user.pending_requests.find_by_url(person.receive_url) - %td - %td friend request pending - -else - %td - %td - = form_for Request.new do |f| - = f.select(:aspect_id, @aspects_dropdown_array) - = f.hidden_field :destination_url, :value => person.diaspora_handle - = f.submit "add friend" - = will_paginate @people +%ul#stream + - for person in @people + = render 'people/person', :person => person + += will_paginate @people diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index c6282b1b8..3fb38e98c 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -145,6 +145,8 @@ ul#stream { border-bottom: 1px solid #eeeeee; } ul#stream > li:first-child { padding-top: 0; } + ul#stream .right { + top: 0; } li.message { position: relative; diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass index 206c122bd..9f9158741 100644 --- a/public/stylesheets/sass/application.sass +++ b/public/stylesheets/sass/application.sass @@ -186,6 +186,9 @@ ul#stream :padding :top 0 + .right + :top 0 + li.message :position relative :line-height 140% From cc4e9f8d3939ff427752074c481024c4cb4bd28c Mon Sep 17 00:00:00 2001 From: danielvincent Date: Sat, 18 Sep 2010 17:56:26 -0700 Subject: [PATCH 060/449] description text for all boxes in manage page. search box text defaults to query on people#index. --- app/views/aspects/manage.html.haml | 14 +++++++++----- app/views/people/index.html.haml | 2 +- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/app/views/aspects/manage.html.haml b/app/views/aspects/manage.html.haml index 667196b85..c579671e1 100644 --- a/app/views/aspects/manage.html.haml +++ b/app/views/aspects/manage.html.haml @@ -13,16 +13,20 @@ .requests %ul.dropzone - - for request in @remote_requests - %li.requested_person{:id => request.person.id, :request_id => request.id} - = person_image_tag(request.person) - .name - = request.person.real_name + - if @remote_requests.size < 1 + %li.grey No new requests + - else + - for request in @remote_requests + %li.requested_person{:id => request.person.id, :request_id => request.id} + = person_image_tag(request.person) + .name + = request.person.real_name %h1 Ignore/Remove %li.remove %ul.dropzone + %li.grey Drag to ignore/remove - content_for :publish do = link_to("add a new aspect", "#add_aspect_pane", :id => "add_aspect_button", :class => "new_aspect button", :title => "Add a new aspect") diff --git a/app/views/people/index.html.haml b/app/views/people/index.html.haml index f80a80f3e..2cd1dc4a7 100644 --- a/app/views/people/index.html.haml +++ b/app/views/people/index.html.haml @@ -8,7 +8,7 @@ Search =form_tag '/people', :method => "get" do - = text_field_tag :q + = text_field_tag :q, params[:q] = submit_tag "search" - content_for :left_pane do From 5740c72804cb57879436bdf5c2917a5df12f660a Mon Sep 17 00:00:00 2001 From: MrZYX Date: Sat, 18 Sep 2010 17:27:13 +0800 Subject: [PATCH 061/449] made websocket server host configurable --- config/app_config.yml | 3 +++ script/websocket_server.rb | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/config/app_config.yml b/config/app_config.yml index a138424ee..354dc75b2 100644 --- a/config/app_config.yml +++ b/config/app_config.yml @@ -7,6 +7,7 @@ development: debug: false socket_debug : false + socket_host: 0.0.0.0 socket_port: 8080 socket_collection_name: 'websocket' pubsub_server: 'https://pubsubhubbub.appspot.com/' @@ -14,11 +15,13 @@ development: test: debug: false socket_debug : false + socket_host: 0.0.0.0 socket_port: 8081 pubsub_server: 'https://pubsubhubbub.appspot.com/' production: debug: false socket_debug : false + socket_host: 0.0.0.0 socket_port: 8080 pubsub_server: 'https://pubsubhubbub.appspot.com/' diff --git a/script/websocket_server.rb b/script/websocket_server.rb index 2fbc1370a..dae054f15 100644 --- a/script/websocket_server.rb +++ b/script/websocket_server.rb @@ -24,7 +24,7 @@ begin Diaspora::WebSocket.initialize_channels EventMachine::WebSocket.start( - :host => "0.0.0.0", + :host => APP_CONFIG[:socket_host], :port => APP_CONFIG[:socket_port], :debug =>APP_CONFIG[:socket_debug]) do |ws| ws.onopen { From 7c62a5adf777361ddf4bfde47d5dfa5dad6de2f7 Mon Sep 17 00:00:00 2001 From: MrZYX Date: Sun, 19 Sep 2010 00:29:56 +0800 Subject: [PATCH 062/449] fixed drag & drop on aspect manage page --- public/javascripts/aspect-edit.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/public/javascripts/aspect-edit.js b/public/javascripts/aspect-edit.js index c7061797d..e07877cb7 100644 --- a/public/javascripts/aspect-edit.js +++ b/public/javascripts/aspect-edit.js @@ -42,14 +42,14 @@ $(function() { }); - $("ul .person .requested_person").draggable({ + // Multiple classes here won't work + $("ul .person").draggable({ revert: true }); - // Moved class to logic above - unnec duplicate logic - //$("ul .requested_person").draggable({ - // revert: true - //}); + $("ul .requested_person").draggable({ + revert: true + }); $(".aspect ul").droppable({ hoverClass: 'active', From c34e4caafa27ffc724499363bc17ca31ab551cee Mon Sep 17 00:00:00 2001 From: kook Date: Sat, 18 Sep 2010 23:52:49 +0800 Subject: [PATCH 063/449] czech translation --- config/locales/cs.yml | 10 +++++++++ config/locales/devise.cs.yml | 41 ++++++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 config/locales/cs.yml create mode 100644 config/locales/devise.cs.yml diff --git a/config/locales/cs.yml b/config/locales/cs.yml new file mode 100644 index 000000000..91c904dc1 --- /dev/null +++ b/config/locales/cs.yml @@ -0,0 +1,10 @@ +# Copyright (c) 2010, Diaspora Inc. This file is +# licensed under the Affero General Public License version 3. See +# the COPYRIGHT file. + + +# Sample localization file for Lithuanian. Add more files in this directory for other locales. +# See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. + +cs: + hello: "Dobrý Den" diff --git a/config/locales/devise.cs.yml b/config/locales/devise.cs.yml new file mode 100644 index 000000000..a8ca9ae84 --- /dev/null +++ b/config/locales/devise.cs.yml @@ -0,0 +1,41 @@ +# Copyright (c) 2010, Diaspora Inc. This file is +# licensed under the Affero General Public License version 3. See +# the COPYRIGHT file. + + +en: + errors: + messages: + not_found: "nenalezeno" + already_confirmed: "již bylo potvrzeno" + not_locked: "nebylo zamčeno" + + devise: + failure: + unauthenticated: 'Pro pokračování se musíte přihlásit nebo si vytvořit účet.' + unconfirmed: 'Před pokračováním musíte potvrdit svůj účet.' + locked: 'Váš účet je uzamčen.' + invalid: 'Neplatný email nebo heslo.' + invalid_token: 'Neplatný autentizační token.' + timeout: 'Vaše sezení vypršelo, pro pokračování se prosím přihlašte znovu.' + inactive: 'Váš účet ještě nebyl aktivován.' + sessions: + signed_in: 'Přihlášení proběhlo úspěšně.' + signed_out: 'Odhlášení proběhlo úspěšně.' + passwords: + send_instructions: 'Běhěm několika minut obdržíte email s instrukcemi k resetnutí hesla.' + updated: 'Vaše heslo bylo úspěšně změněno. Nyní jste přihlášeni' + confirmations: + send_instructions: 'Během několika minut obdržíte email s instrukcemi k potvrzení vašeho účtu.' + confirmed: 'Váš účet byl uspěšně potvrzen. Nyní jste přihlášeni.' + registrations: + signed_up: 'Úspěšně jste vytvořili účet. Pokud je tak server nastaven, byl vám zaslán potvrzovací email.' + updated: 'Úspěšně jste upravili svůj účet.' + destroyed: 'Sbohem! Váš účet byl úspěšně zrušen. Brzy naviděnou.' + unlocks: + send_instructions: 'Během několika minut obdržíte email s instrukcemi k odemknutí vašeho účtu.' + unlocked: 'Váš účet byl úspěšně odemknut. Nyní jste přihlášeni.' + mailer: + confirmation_instructions: 'Instrukce k potvrzení' + reset_password_instructions: 'Instrukce k resetnutí hesla' + unlock_instructions: 'Instrukce k odemčení' From 6c6c7be1e50aedf3aa1e2a24082d994bf9e61566 Mon Sep 17 00:00:00 2001 From: kook Date: Sat, 18 Sep 2010 23:54:25 +0800 Subject: [PATCH 064/449] oopsie --- config/locales/devise.cs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/locales/devise.cs.yml b/config/locales/devise.cs.yml index a8ca9ae84..34d9eb7c1 100644 --- a/config/locales/devise.cs.yml +++ b/config/locales/devise.cs.yml @@ -3,7 +3,7 @@ # the COPYRIGHT file. -en: +cs: errors: messages: not_found: "nenalezeno" From c4f420ec594304391f9ea5fa0bfc0afeea30a7ca Mon Sep 17 00:00:00 2001 From: Felix Gruber Date: Sun, 19 Sep 2010 18:15:36 +0200 Subject: [PATCH 065/449] some corrections from sennewood --- config/locales/devise.de.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/locales/devise.de.yml b/config/locales/devise.de.yml index 516eebfed..9fe2e5a32 100644 --- a/config/locales/devise.de.yml +++ b/config/locales/devise.de.yml @@ -17,7 +17,7 @@ de: locked: 'Dein Konto ist gesperrt.' invalid: 'Ungültige E-Mail-Adresse oder Passwort.' invalid_token: 'Ungültiger Authentifizierungstoken.' - timeout: 'Deine Sitzung ist abgelaufen, bitte melde dich wieder an, um fortzufahren.' + timeout: 'Deine Sitzung ist abgelaufen, bitte melde dich wieder an um fortzufahren.' inactive: 'Dein Konto wurde noch nicht aktiviert.' sessions: signed_in: 'Erfolgreich angemeldet.' @@ -30,7 +30,7 @@ de: confirmed: 'Dein Konto wurde erfolgreich bestätigt. Du bist nun angemeldet.' registrations: signed_up: 'Du wurdest erfolgreich registriert. Falls aktiviert, wurde dir eine E-Mail zur Bestätigung geschickt.' - updated: 'Du hast erfolgreich dein Konto aktualisiert.' + updated: 'Dein Konto wurde aktualisiert.' destroyed: 'Tschüss! Dein Konto wurde erfolgreich abgemeldet. Wir hoffen dich bald wiederzusehen.' unlocks: send_instructions: 'Du wirst in ein paar Minuten eine E-Mail erhalten, die beschreibt, wie du dein Konto entsperren kannst.' From 230865aaa29c1ed08a43c676ac790f9be9ff7bec Mon Sep 17 00:00:00 2001 From: Pedro Silva Date: Sun, 19 Sep 2010 11:05:31 +0800 Subject: [PATCH 066/449] Added Portuguese Portugal locale --- config/locales/devise.pt-PT.yml | 41 +++++++++++++++++++++++++++++++++ config/locales/pt-PT.yml | 10 ++++++++ 2 files changed, 51 insertions(+) create mode 100644 config/locales/devise.pt-PT.yml create mode 100644 config/locales/pt-PT.yml diff --git a/config/locales/devise.pt-PT.yml b/config/locales/devise.pt-PT.yml new file mode 100644 index 000000000..cf16fd20d --- /dev/null +++ b/config/locales/devise.pt-PT.yml @@ -0,0 +1,41 @@ +# Copyright (c) 2010, Diaspora Inc. This file is +# licensed under the Affero General Public License version 3. See +# the COPYRIGHT file. + + +pt-PT: + errors: + messages: + not_found: "não foi encontrado" + already_confirmed: "já foi confirmado" + not_locked: "não foi bloqueado" + + devise: + failure: + unauthenticated: 'Faça login ou registre-se antes de continuar.' + unconfirmed: 'Confirme a sua conta antes de continuar.' + locked: 'A sua conta foi bloqueada.' + invalid: 'Endereço de correio ou senha inválida.' + invalid_token: 'Token de autenticação inválido.' + timeout: 'A sua sessão expirou, por favor faça login novamente para continuar.' + inactive: 'A sua conta ainda não foi activada.' + sessions: + signed_in: 'Login com sucesso.' + signed_out: 'Logout com sucesso.' + passwords: + send_instructions: 'Vai receber um email com instruções sobre como alterar a sua senha dentro de alguns minutos.' + updated: 'A sua senha foi alterada com sucesso. Está on-line.' + confirmations: + send_instructions: 'Vai receber um email com instruções sobre como confirmar a sua conta dentro de alguns minutos.' + confirmed: 'A sua conta foi confirmada com sucesso. Está on-line.' + registrations: + signed_up: 'Registou-se com sucesso. Se ligado, a confirmação foi enviada para o seu email.' + updated: 'Actualizou a sua conta com sucesso.' + destroyed: 'Adeus! A sua conta foi cancelada com sucesso. Esperamos vê-lo de novo brevemente.' + unlocks: + send_instructions: 'Vai receber uma mensagem sobre como desbloquear a sua conta dentro de alguns minutos.' + unlocked: 'A sua conta foi desbloqueada com sucesso. Está on-line.' + mailer: + confirmation_instructions: 'Instruções de confirmação' + reset_password_instructions: 'Instruções para alterar a sua senha' + unlock_instructions: 'Instruções para desbloquear' diff --git a/config/locales/pt-PT.yml b/config/locales/pt-PT.yml new file mode 100644 index 000000000..ce3d9abbc --- /dev/null +++ b/config/locales/pt-PT.yml @@ -0,0 +1,10 @@ +# Copyright (c) 2010, Diaspora Inc. This file is +# licensed under the Affero General Public License version 3. See +# the COPYRIGHT file. + + +# Sample localization file for Portuguese Portugal. Add more files in this directory for other locales. +# See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. + +pt-PT: + hello: "Olá mundo" From b40b81e447d13166c5e2ed79c6ac5435300f255b Mon Sep 17 00:00:00 2001 From: danielvincent Date: Sun, 19 Sep 2010 10:11:41 -0700 Subject: [PATCH 067/449] aspect manage tab now reads 'manage aspects' --- app/views/shared/_aspect_nav.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/shared/_aspect_nav.haml b/app/views/shared/_aspect_nav.haml index b61def9f5..ed3fe6f8f 100644 --- a/app/views/shared/_aspect_nav.haml +++ b/app/views/shared/_aspect_nav.haml @@ -14,7 +14,7 @@ = link_to "All Aspects", root_url %li{ :style => "margin-right:0;", :class => ("selected" if @aspect == :manage)} - = link_to ( (@request_count == 0)? "manage" : "manage (#{@request_count})"), {:controller => :aspects, :action => :manage}, :class => "edit_aspect_button", :class => new_request(@request_count), :title => "Manage your Aspects" + = link_to ( (@request_count == 0)? "Manage Aspects" : "Manage Aspects (#{@request_count})"), {:controller => :aspects, :action => :manage}, :class => "edit_aspect_button", :class => new_request(@request_count), :title => "Manage your Aspects" .yo{ :style => "display:none;"} #add_aspect_pane From cc982b4841372175b262537fb73929ea78e0e6a6 Mon Sep 17 00:00:00 2001 From: Guido Serra aka Zeph Date: Sun, 19 Sep 2010 19:58:36 +0200 Subject: [PATCH 068/449] draft of italian localization --- config/locales/devise.it.yml | 43 ++++++++++++++++++++++++++++++++++++ config/locales/it.yml | 14 ++++++++++++ 2 files changed, 57 insertions(+) create mode 100644 config/locales/devise.it.yml create mode 100644 config/locales/it.yml diff --git a/config/locales/devise.it.yml b/config/locales/devise.it.yml new file mode 100644 index 000000000..d1105b15a --- /dev/null +++ b/config/locales/devise.it.yml @@ -0,0 +1,43 @@ +# Copyright (c) 2010, Diaspora Inc. This file is +# licensed under the Affero General Public License version 3. See +# the COPYRIGHT file. +# +# 1st DRAFT of the italian translation +# 09/2010 Guido Serra aka Zeph + +it: + errors: + messages: + not_found: "non trovato" + already_confirmed: "era già stato confermato" + not_locked: "non era protetto" + + devise: + failure: + unauthenticated: 'Devi identificarti o registrarti prima di poter continuare.' + unconfirmed: 'Devi confermare il tuo account prima di continuare.' + locked: 'Il tuo account è protetto.' + invalid: 'Email o password errata.' + invalid_token: 'Token identificativo non valido.' + timeout: 'Sessione scaduta, riautenticati per poter continuare.' + inactive: 'Il tuo account non è stato ancora attivato.' + sessions: + signed_in: 'Autenticato correttamente.' + signed_out: 'Uscito correttamente.' + passwords: + send_instructions: 'Riceverai, a breve, una mail con le istruzioni per proseguire.' + updated: 'La tua parola chiave è stata cambiata correttamente, sei autenticato.' + confirmations: + send_instructions: 'Riceverai una email con le istruzioni, per confermare la tua utenza, in pochi minuti.' + confirmed: 'Accesso confermato correttamente, sei ora collegato.' + registrations: + signed_up: 'Registrazione andata a buon fine. Se abilitata, riceverai un email di conferma.' + updated: 'Dati aggiornati correttamente.' + destroyed: 'Utenza rimossa, speriamo di rivederti presto.' + unlocks: + send_instructions: 'Riceverai una email con le istruzioni per sbloccare la tua utenza.' + unlocked: 'Utenza sbloccata, sei collegato.' + mailer: + confirmation_instructions: 'Istruzioni di conferma di un utenza' + reset_password_instructions: 'Istruzioni per reinizializzare la parola chiave' + unlock_instructions: 'Istruzioni per sbloccare un utenza' diff --git a/config/locales/it.yml b/config/locales/it.yml new file mode 100644 index 000000000..cf5f023d2 --- /dev/null +++ b/config/locales/it.yml @@ -0,0 +1,14 @@ +# Copyright (c) 2010, Diaspora Inc. This file is +# licensed under the Affero General Public License version 3. See +# the COPYRIGHT file. + + +# Sample localization file for English. Add more files in this directory for other locales. +# See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. + +# +# 1st DRAFT of the italian translation +# 09/2010 Guido Serra aka Zeph + +it: + hello: "Ciao Mondo!" From 3599161a4a3881b150160a9167ce4590f15ac2de Mon Sep 17 00:00:00 2001 From: Guido Serra aka Zeph Date: Sun, 19 Sep 2010 22:33:02 +0200 Subject: [PATCH 069/449] osx files --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 89b33da60..bbd4cefb8 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,4 @@ gpg/diaspora-production/*.gpg gpg/*/random_seed public/uploads/* .rvmrc +.DS_Store From 14ad24ba7e57a3742e73f98a65cb334ec76ae4f1 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Sun, 19 Sep 2010 14:27:20 -0700 Subject: [PATCH 070/449] visual tweaks on header. moved upload a file button to header on album#show --- app/helpers/application_helper.rb | 2 +- app/views/albums/show.html.haml | 10 +++---- .../status_messages/_status_message.html.haml | 3 +- public/javascripts/stream.js | 8 ----- public/stylesheets/application.css | 20 +++++++++---- public/stylesheets/sass/application.sass | 29 ++++++++++++++----- 6 files changed, 43 insertions(+), 29 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index f2a0a95fd..75a13dc6b 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -28,7 +28,7 @@ module ApplicationHelper end def how_long_ago(obj) - "#{time_ago_in_words(obj.created_at)} ago." + "#{time_ago_in_words(obj.created_at)} ago" end def person_url(person) diff --git a/app/views/albums/show.html.haml b/app/views/albums/show.html.haml index 843523223..3c71cede1 100644 --- a/app/views/albums/show.html.haml +++ b/app/views/albums/show.html.haml @@ -17,11 +17,16 @@ = render "shared/aspect_friends" - content_for :publish do + -if current_user.owns? @album + .right + =render 'photos/new_photo' + = link_to 'Edit Album', edit_album_path(@album), :class => 'button' %h1 = @album.name ="updated #{how_long_ago(@album)}" + .album_id{:id => @album.id, :style => "display:hidden;"} -unless current_user.owns? @album @@ -31,13 +36,8 @@ - for photo in @album_photos .image_thumb = link_to (image_tag photo.url(:thumb_medium)), object_path(photo) - -if current_user.owns? @album - =render 'photos/new_photo' #content_bottom .back = link_to "⇧ albums", albums_path - -if current_user.owns? @album - .right - = link_to 'Edit Album', edit_album_path(@album), :class => 'button' diff --git a/app/views/status_messages/_status_message.html.haml b/app/views/status_messages/_status_message.html.haml index a22098afa..396f143a7 100644 --- a/app/views/status_messages/_status_message.html.haml +++ b/app/views/status_messages/_status_message.html.haml @@ -13,13 +13,12 @@ = auto_link sanitize post.message .info - = link_to(how_long_ago(post), object_path(post)) + %span.time= link_to(how_long_ago(post), object_path(post)) \-- = link_to "show comments (#{post.comments.count})", '#', :class => "show_post_comments" = render "comments/comments", :post => post - - if current_user.owns?(post) .destroy_link = link_to 'Delete', status_message_path(post), :confirm => 'Are you sure?', :method => :delete, :remote => true, :class => "delete" diff --git a/public/javascripts/stream.js b/public/javascripts/stream.js index cf0856754..e8db10abd 100644 --- a/public/javascripts/stream.js +++ b/public/javascripts/stream.js @@ -14,14 +14,6 @@ $(document).ready(function(){ }); });//end document ready -$("#stream li").live('mouseover',function() { - $(this).children(".destroy_link").fadeIn(0); -}); - -$("#stream li").live('mouseout',function() { - $(this).children(".destroy_link").fadeOut(0); -}); - $(".show_post_comments").live('click', function(event) { event.preventDefault(); diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index 3fb38e98c..9a06eab4c 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -118,7 +118,6 @@ header { header #session_action ul li:last-child { margin-right: 0; } header #aspect_header { - z-index: 5; background-color: #eeeeee; border-top: 1px solid white; padding: 20px 0; } @@ -129,7 +128,7 @@ header { color: #111111; } header #aspect_header a:hover { background: none; - color: #333333; } + color: #999999; } header #aspect_header .page_title { text-transform: uppercase; text-shadow: 0 2px 0 white; @@ -143,8 +142,10 @@ ul#stream { list-style: none; padding: 12px 0; border-bottom: 1px solid #eeeeee; } - ul#stream > li:first-child { - padding-top: 0; } + ul#stream > li:hover { + background-color: #fafafa; } + ul#stream > li:hover .destroy_link { + display: inline; } ul#stream .right { top: 0; } @@ -167,6 +168,8 @@ li.message { li.message .content div.info { color: #bababa; font-size: 70%; } + li.message .content div.info .time a { + color: #666666; } form { position: relative; @@ -262,7 +265,7 @@ ul.comment_set { .destroy_link, .request_button { position: absolute; - right: 0; + right: 2em; bottom: 15px; } .destroy_link a, .request_button a { color: #999999; @@ -458,7 +461,7 @@ h1.big_text { #aspect_nav ul > li { padding: 0; display: inline; - margin-right: 0.5em; } + margin-right: 0.2em; } #aspect_nav ul > li a { line-height: 22px; background-color: #444444; @@ -470,12 +473,17 @@ h1.big_text { background-color: #4e4e4e; color: #cccccc; } #aspect_nav ul > li.selected a { + z-index: 50; + -webkit-box-shadow: 0px -4px 6px -2px #777777; + -moz-box-shadow: 0px -4px 6px -2px #777777; text-shadow: 0 2px 0 white; padding-top: 4px; padding-bottom: 5px; line-height: 18px; font-weight: bold; background-color: #eeeeee; + background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(white), to(#eeeeee)); + background: -moz-linear-gradient(19% 75% 90deg, #eeeeee, white); border: 1px solid white; border-bottom: 1px solid #eeeeee; color: black; } diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass index 9f9158741..e5a16e6f2 100644 --- a/public/stylesheets/sass/application.sass +++ b/public/stylesheets/sass/application.sass @@ -146,7 +146,6 @@ header :right 0 #aspect_header - :z-index 5 :background :color #eee :border @@ -162,7 +161,7 @@ header :color #111 &:hover :background none - :color #333 + :color #999 .page_title :text @@ -182,9 +181,12 @@ ul#stream :border :bottom 1px solid #eee - > li:first-child - :padding - :top 0 + &:hover + :background + :color #fafafa + + .destroy_link + :display inline .right :top 0 @@ -219,6 +221,10 @@ li.message :color #bababa :font-size 70% + .time + a + :color #666 + form :position relative @@ -348,7 +354,7 @@ ul.comment_set .destroy_link, .request_button :position absolute - :right 0 + :right 2em :bottom 15px a :color #999 @@ -604,13 +610,14 @@ h1.big_text :padding 0 :display inline :margin - :right 0.5em + :right 0.2em a :line :height 22px :background :color #444 + :border 1px solid #555 :padding 3px 8px @@ -623,6 +630,10 @@ h1.big_text :color #ccc &.selected a + :z-index 50 + :-webkit-box-shadow 0px -4px 6px -2px #777 + :-moz-box-shadow 0px -4px 6px -2px #777 + :text-shadow 0 2px 0 #fff :padding :top 4px @@ -633,6 +644,10 @@ h1.big_text :weight bold :background :color #eee + + :background -webkit-gradient(linear, 0% 0%, 0% 100%, from(#fff), to(#eee)) + :background -moz-linear-gradient(19% 75% 90deg, #eee, #fff) + :border 1px solid #fff :bottom 1px solid #eee :color #000 From 60e29f6572120384e821fc3fd409b47c9b12a469 Mon Sep 17 00:00:00 2001 From: Raphael Date: Sun, 19 Sep 2010 16:37:34 -0700 Subject: [PATCH 071/449] Magent should use the same settings as mongomapper, app config should load first, websocket spec is a little better. --- config/app_config.yml | 6 ++++++ .../{load_app_config.rb => _load_app_config.rb} | 0 config/initializers/_mongo.rb | 3 ++- spec/lib/websocket_spec.rb | 8 ++++---- 4 files changed, 12 insertions(+), 5 deletions(-) rename config/initializers/{load_app_config.rb => _load_app_config.rb} (100%) diff --git a/config/app_config.yml b/config/app_config.yml index 354dc75b2..b4fd6f0ab 100644 --- a/config/app_config.yml +++ b/config/app_config.yml @@ -11,6 +11,8 @@ development: socket_port: 8080 socket_collection_name: 'websocket' pubsub_server: 'https://pubsubhubbub.appspot.com/' + mongo_host: 'localhost' + mongo_post: 27017 test: debug: false @@ -18,6 +20,8 @@ test: socket_host: 0.0.0.0 socket_port: 8081 pubsub_server: 'https://pubsubhubbub.appspot.com/' + mongo_host: 'localhost' + mongo_post: 27017 production: debug: false @@ -25,3 +29,5 @@ production: socket_host: 0.0.0.0 socket_port: 8080 pubsub_server: 'https://pubsubhubbub.appspot.com/' + mongo_host: 'localhost' + mongo_post: 27017 diff --git a/config/initializers/load_app_config.rb b/config/initializers/_load_app_config.rb similarity index 100% rename from config/initializers/load_app_config.rb rename to config/initializers/_load_app_config.rb diff --git a/config/initializers/_mongo.rb b/config/initializers/_mongo.rb index 0409d6d71..8948a0c59 100644 --- a/config/initializers/_mongo.rb +++ b/config/initializers/_mongo.rb @@ -5,7 +5,7 @@ if ENV['MONGOHQ_URL'] MongoMapper.config = {RAILS_ENV => {'uri' => ENV['MONGOHQ_URL']}} else - MongoMapper.connection = Mongo::Connection.new('localhost', 27017) + MongoMapper.connection = Mongo::Connection.new(APP_CONFIG['mongo_host'], APP_CONFIG['mongo_port']) end MongoMapper.database = "diaspora-#{Rails.env}" @@ -16,3 +16,4 @@ if defined?(PhusionPassenger) end end +Magent.connection = Mongo::Connection.new(APP_CONFIG['mongo_host'], APP_CONFIG['mongo_port']) diff --git a/spec/lib/websocket_spec.rb b/spec/lib/websocket_spec.rb index 018f5020d..edac7051a 100644 --- a/spec/lib/websocket_spec.rb +++ b/spec/lib/websocket_spec.rb @@ -19,18 +19,18 @@ describe Diaspora::WebSocket do describe 'queuing and dequeuing ' do before do - @post.socket_to_uid(@user.id, :aspect_ids => @aspect.id) @channel = Magent::GenericChannel.new('websocket') + @messages = @channel.message_count + @post.socket_to_uid(@user.id, :aspect_ids => @aspect.id) end it 'should send the queued job to Magent' do - @channel.message_count.should == 1 + @channel.message_count.should == @messages + 1 end it 'should dequeue the job successfully' do - messages = @channel.message_count @channel.dequeue - @channel.message_count.should == messages -1 + @channel.message_count.should == @messages end end From 27c00bae90e136b1d2f7b7348ef21e4c3731327a Mon Sep 17 00:00:00 2001 From: Michael Sofaer Date: Sun, 19 Sep 2010 18:12:42 -0700 Subject: [PATCH 072/449] MJS RJS Fix initialization of album test --- spec/controllers/albums_controller_spec.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spec/controllers/albums_controller_spec.rb b/spec/controllers/albums_controller_spec.rb index ce2bd305d..67b7d9a78 100644 --- a/spec/controllers/albums_controller_spec.rb +++ b/spec/controllers/albums_controller_spec.rb @@ -9,14 +9,14 @@ describe AlbumsController do render_views before do @user = Factory.create(:user) - @user.aspect(:name => "lame-os") - @album = Factory.create(:album) + @aspect = @user.aspect(:name => "lame-os") + @album = @user.post :album, :to => @aspect.id, :name => 'things on fire' sign_in :user, @user end it "should update the name of an album" do sign_in :user, @user - put :update, :id => @album._id, :album => { :name => "new_name"} + put :update, :id => @album.id, :album => { :name => "new_name"} @album.reload.name.should eql("new_name") end From 07d2de66461ab79cfd90a38c2843cde4e6390046 Mon Sep 17 00:00:00 2001 From: maxwell Date: Sun, 19 Sep 2010 20:36:39 -0700 Subject: [PATCH 073/449] removed an annoying log of encrypted salmon. --- app/models/person.rb | 1 + app/models/user.rb | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/person.rb b/app/models/person.rb index b1e7e3745..079275997 100644 --- a/app/models/person.rb +++ b/app/models/person.rb @@ -76,6 +76,7 @@ class Person end def self.by_webfinger( identifier, opts = {}) + #need to check if this is a valid email structure, maybe should do in JS local_person = Person.first(:diaspora_handle => identifier.gsub('acct:', '')) if local_person diff --git a/app/models/user.rb b/app/models/user.rb index 4ec528e70..f0481341a 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -220,7 +220,6 @@ class User ###### Receiving ####### def receive_salmon ciphertext cleartext = decrypt( ciphertext) - Rails.logger.info("Received a salmon: #{cleartext}") salmon = Salmon::SalmonSlap.parse cleartext if salmon.verified_for_key?(salmon.author.public_key) Rails.logger.info("data in salmon: #{salmon.data}") From 5bf6d358a4289ffec2bee618fd4b542f431fc2b4 Mon Sep 17 00:00:00 2001 From: maxwell Date: Sun, 19 Sep 2010 20:40:03 -0700 Subject: [PATCH 074/449] MS added small log for when user is found from webfinger --- app/models/person.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/models/person.rb b/app/models/person.rb index 079275997..6a328dff8 100644 --- a/app/models/person.rb +++ b/app/models/person.rb @@ -78,8 +78,9 @@ class Person def self.by_webfinger( identifier, opts = {}) #need to check if this is a valid email structure, maybe should do in JS local_person = Person.first(:diaspora_handle => identifier.gsub('acct:', '')) - + if local_person + Rails.logger.info("Do not need to webfinger, found a local person #{local_person.real_name}") local_person elsif !identifier.include?("localhost") && !opts[:local] begin From 5a9b0fbd03149f21542614a87c3644ee8d1528ed Mon Sep 17 00:00:00 2001 From: danielvincent Date: Sun, 19 Sep 2010 22:16:58 -0700 Subject: [PATCH 075/449] tabs rounded --- public/stylesheets/application.css | 5 +++-- public/stylesheets/sass/application.sass | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index 9a06eab4c..98893cabb 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -461,8 +461,10 @@ h1.big_text { #aspect_nav ul > li { padding: 0; display: inline; - margin-right: 0.2em; } + margin-right: 2px; } #aspect_nav ul > li a { + -webkit-border-radius: 3px 3px 0 0; + -moz-border-radius: 3px 3px 0 0; line-height: 22px; background-color: #444444; border: 1px solid #555555; @@ -473,7 +475,6 @@ h1.big_text { background-color: #4e4e4e; color: #cccccc; } #aspect_nav ul > li.selected a { - z-index: 50; -webkit-box-shadow: 0px -4px 6px -2px #777777; -moz-box-shadow: 0px -4px 6px -2px #777777; text-shadow: 0 2px 0 white; diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass index e5a16e6f2..5edc89135 100644 --- a/public/stylesheets/sass/application.sass +++ b/public/stylesheets/sass/application.sass @@ -610,9 +610,11 @@ h1.big_text :padding 0 :display inline :margin - :right 0.2em + :right 2px a + :-webkit-border-radius 3px 3px 0 0 + :-moz-border-radius 3px 3px 0 0 :line :height 22px :background @@ -630,7 +632,6 @@ h1.big_text :color #ccc &.selected a - :z-index 50 :-webkit-box-shadow 0px -4px 6px -2px #777 :-moz-box-shadow 0px -4px 6px -2px #777 From 0203b9317b22fa4499b8d7afe35be7876b83e7fe Mon Sep 17 00:00:00 2001 From: Felix Gruber Date: Mon, 20 Sep 2010 14:04:09 +0200 Subject: [PATCH 076/449] better translation from sennewood --- config/locales/devise.de.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/locales/devise.de.yml b/config/locales/devise.de.yml index 9fe2e5a32..34947cbc2 100644 --- a/config/locales/devise.de.yml +++ b/config/locales/devise.de.yml @@ -29,7 +29,7 @@ de: send_instructions: 'Du wirst in ein paar Minuten eine E-Mail erhalten, die beschreibt, wie du dein Konto bestätigst.' confirmed: 'Dein Konto wurde erfolgreich bestätigt. Du bist nun angemeldet.' registrations: - signed_up: 'Du wurdest erfolgreich registriert. Falls aktiviert, wurde dir eine E-Mail zur Bestätigung geschickt.' + signed_up: 'Du hast dich erfolgreich registriert. Sofern aktiviert, wurde dir eine Bestätigung per E-Mail gesendet.' updated: 'Dein Konto wurde aktualisiert.' destroyed: 'Tschüss! Dein Konto wurde erfolgreich abgemeldet. Wir hoffen dich bald wiederzusehen.' unlocks: From 5b75c1634d99207bf02f3082af6c94300b34f1f2 Mon Sep 17 00:00:00 2001 From: Daniele Di Sarli Date: Mon, 20 Sep 2010 23:03:12 +0800 Subject: [PATCH 077/449] corrected some Italian phrases --- config/locales/devise.it.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/config/locales/devise.it.yml b/config/locales/devise.it.yml index 75b90affc..76f761e37 100644 --- a/config/locales/devise.it.yml +++ b/config/locales/devise.it.yml @@ -12,7 +12,7 @@ it: devise: failure: - unauthenticated: "Devi effettuare l'accesso o registrarci prima di continuare." + unauthenticated: "Devi effettuare l'accesso o registrarti prima di continuare." unconfirmed: "Devi confermare il tuo account prima di continuare." locked: "Il tuo account è bloccato." invalid: "Email o password errati." @@ -31,11 +31,11 @@ it: registrations: signed_up: "Ti sei iscritto. Se il servizio è disponibile, riceverai una conferma via email." updated: "Hai aggiornato il tuo account." - destroyed: "Ciao!Il tuo account è stato rimosso. Speriamo che tu torni a trovarci presto." + destroyed: "Ciao! Il tuo account è stato rimosso. Speriamo che tu torni a trovarci presto." unlocks: send_instructions: "Tra pochi minuti riceverai una mail con le istruzioni su come sbloccare il tuo account." unlocked: "Il tuo account è stato sbloccato. Hai appena effettuato l'accesso." mailer: confirmation_instructions: "Istruzioni sulla conferma" reset_password_instructions: "Istruzioni su come cambiare la password" - unlock_instructions: "Istruzione su come sbloccare l'account" + unlock_instructions: "Istruzioni su come sbloccare l'account" From 850961f22ed78e143cd7b202a7dd91e699000d51 Mon Sep 17 00:00:00 2001 From: moziz Date: Sun, 19 Sep 2010 09:21:53 +0800 Subject: [PATCH 078/449] Corrected a typo and switched a few words so that the it sounds more 'official' and not slang. --- config/locales/devise.fi.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/config/locales/devise.fi.yml b/config/locales/devise.fi.yml index 4ee6761f8..9109b40a8 100644 --- a/config/locales/devise.fi.yml +++ b/config/locales/devise.fi.yml @@ -13,7 +13,7 @@ fi: devise: failure: unauthenticated: 'Kirjaudu tai rekisteröidy ennen kuin voit jatkaa.' - unconfirmed: 'Sinun pitää vahvistaa käyttäjätilisi ennen kuin voit jatkaa' + unconfirmed: 'Sinun täytyy vahvistaa käyttäjätilisi ennen kuin voit jatkaa' locked: 'Käyttäjätilisi on lukittu.' invalid: 'Väärä sähköpostiosoite tai salasana.' invalid_token: 'Viallinen todennus.' @@ -21,9 +21,9 @@ fi: inactive: 'Käyttätiliäsi ei ole vielä vahvistettu.' sessions: signed_in: 'Sisäänkirjautuminen onnistui.' - signed_out: 'Uoskirjautuminen onnistui.' + signed_out: 'Uloskirjautuminen onnistui.' passwords: - send_instructions: 'Saat hetken päästä sähköpostiisi ohjeet siitä miten asetat salasanasi uudelleen.' + send_instructions: 'Saat hetken päästä sähköpostiisi ohjeet siitä miten määrität salasanasi uudelleen.' updated: 'Salasanasi on vaihdettu. Olet nyt kirjautunut sisään.' confirmations: send_instructions: 'Saat hetken päästä sähköpostiisi ohjeet siitä miten vahvistat käyttäjätilisi luonnin.' @@ -37,5 +37,5 @@ fi: unlocked: 'Käyttäjätilisi lukitus on avattu. Olet nyt kirjautunut sisään.' mailer: confirmation_instructions: 'Ohjeet vahvistamiseen/todentamiseen' - reset_password_instructions: 'Ohjeet salananan uudelleenasettamiseksi' + reset_password_instructions: 'Ohjeet salananan uudelleenmäärittämiseksi' unlock_instructions: 'Ohjeet lukituksen poistamiseksi' From 445c6784eb474d46ad84e346513149ea1ff72422 Mon Sep 17 00:00:00 2001 From: Marcin Karpezo Date: Sat, 18 Sep 2010 19:32:17 +0800 Subject: [PATCH 079/449] Translated devise.en.yml --- config/locales/devise.pl.yml | 41 ++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 config/locales/devise.pl.yml diff --git a/config/locales/devise.pl.yml b/config/locales/devise.pl.yml new file mode 100644 index 000000000..ec9f44220 --- /dev/null +++ b/config/locales/devise.pl.yml @@ -0,0 +1,41 @@ +# Copyright (c) 2010, Diaspora Inc. This file is +# licensed under the Affero General Public License version 3. See +# the COPYRIGHT file. + + +en: + errors: + messages: + not_found: "nie znaleziono" + already_confirmed: "potwierdzono wcześniej" + not_locked: "nie był zablokowany" + + devise: + failure: + unauthenticated: 'By kontynuować musisz się zalogować lub zarejestrować.' + unconfirmed: 'Musisz aktywować swoje konto.' + locked: 'Twoje konto jest zablokowane.' + invalid: 'Nieprawidłowy adres email lub hasło.' + invalid_token: 'Nieprawidłowy kod identyfikacyjny.' + timeout: 'Twoja sesja wygasła, zaloguj się ponownie by kontynuować.' + inactive: 'Twoje konto nie zostało jeszcze aktywowane.' + sessions: + signed_in: 'Zalogowano pomyślnie.' + signed_out: 'Wylogowano.' + passwords: + send_instructions: 'W ciągu kilku minut otrzymasz maila zawierającego instrukcjie dotyczące zresetowania hasła.' + updated: 'Twoje hasło zostało zmienione, zostałeś zalogowany.' + confirmations: + send_instructions: 'W ciągu kilku minut otrzymasz maila zawierającego instrukcje dotyczące aktywacji konta.' + confirmed: 'Twoje konto zostało aktywowane, zostałeś zalogowany.' + registrations: + signed_up: 'Zostałeś zarejestrowany. Jeśli aktywowano odpowiednią opcję, wyślemy do Ciebie email potwierdzający rejestrację.' + updated: 'Pomyślnie zaktualizowano informacje o Twoim koncie.' + destroyed: 'Żegnaj! Twoje konto zostało usunięte.' + unlocks: + send_instructions: 'W ciągu kilku minut otrzymasz email z instrukcjami odblokowania konta.' + unlocked: 'Twoje konto zostało odblokowane, jesteś zalogowany.' + mailer: + confirmation_instructions: 'Instrukcje aktywacji' + reset_password_instructions: 'Instrukcje zmiany hasła' + unlock_instructions: 'Instrukcje odblokowania' From 9130c857185a27363ba25c4c0ed3341b89ce42ab Mon Sep 17 00:00:00 2001 From: Marcin Karpezo Date: Sat, 18 Sep 2010 19:34:02 +0800 Subject: [PATCH 080/449] Translated en.yml --- config/locales/pl.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 config/locales/pl.yml diff --git a/config/locales/pl.yml b/config/locales/pl.yml new file mode 100644 index 000000000..e31046c29 --- /dev/null +++ b/config/locales/pl.yml @@ -0,0 +1,10 @@ +# Copyright (c) 2010, Diaspora Inc. This file is +# licensed under the Affero General Public License version 3. See +# the COPYRIGHT file. + + +# Sample localization file for English. Add more files in this directory for other locales. +# See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. + +en: + hello: "Witaj świecie" From a0a7d28e6d5d5f64a7eb14f7252323c729c36bb2 Mon Sep 17 00:00:00 2001 From: Marcin Karpezo Date: Sat, 18 Sep 2010 20:27:52 +0800 Subject: [PATCH 081/449] fixed translation --- config/locales/devise.pl.yml | 2 +- config/locales/pl.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config/locales/devise.pl.yml b/config/locales/devise.pl.yml index ec9f44220..a490a1a39 100644 --- a/config/locales/devise.pl.yml +++ b/config/locales/devise.pl.yml @@ -3,7 +3,7 @@ # the COPYRIGHT file. -en: +pl: errors: messages: not_found: "nie znaleziono" diff --git a/config/locales/pl.yml b/config/locales/pl.yml index e31046c29..2052779bd 100644 --- a/config/locales/pl.yml +++ b/config/locales/pl.yml @@ -6,5 +6,5 @@ # Sample localization file for English. Add more files in this directory for other locales. # See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. -en: +pl: hello: "Witaj świecie" From e6c8cf20d34d5594af5770656db0e79a02f2689d Mon Sep 17 00:00:00 2001 From: TJ Peden Date: Sat, 18 Sep 2010 14:30:17 +0800 Subject: [PATCH 082/449] Fixed receive_url problem --- app/models/request.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/request.rb b/app/models/request.rb index da62edd93..739500e4e 100644 --- a/app/models/request.rb +++ b/app/models/request.rb @@ -26,8 +26,8 @@ class Request validates_presence_of :destination_url, :callback_url before_validation :clean_link - scope :for_user, lambda{ |user| where(:destination_url => user.receive_url) } - scope :from_user, lambda{ |user| where(:destination_url.ne => user.receive_url) } + scope :for_user, lambda{ |user| where(:destination_url => user.person.receive_url) } + scope :from_user, lambda{ |user| where(:destination_url.ne => user.person.receive_url) } def self.instantiate(options = {}) person = options[:from] From aff4d783a642d0da4d8977cb9949f731d9638813 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABl=20Soucaze?= Date: Fri, 17 Sep 2010 04:17:00 +0800 Subject: [PATCH 083/449] French localisation. --- config/locales/devise.fr.yml | 41 ++++++++++++++++++++++++++++++++++++ config/locales/fr.yml | 10 +++++++++ 2 files changed, 51 insertions(+) create mode 100644 config/locales/devise.fr.yml create mode 100644 config/locales/fr.yml diff --git a/config/locales/devise.fr.yml b/config/locales/devise.fr.yml new file mode 100644 index 000000000..8829de132 --- /dev/null +++ b/config/locales/devise.fr.yml @@ -0,0 +1,41 @@ +# Copyright (c) 2010, Diaspora Inc. This file is +# licensed under the Affero General Public License version 3. See +# the COPYRIGHT file. + + +en: + errors: + messages: + not_found: "introuvable" + already_confirmed: "a déjà été confirmé" + not_locked: "n’a pas été verrouillé" + + devise: + failure: + unauthenticated: 'Vous devez vous connecter ou vous inscrire avant de continuer.' + unconfirmed: 'Vous devez confirmer votre compte avant de continuer.' + locked: 'Votre compte est verrouillé.' + invalid: 'E-mail ou mot de passe invalide.' + invalid_token: 'Jeton d’authentification invalide.' + timeout: 'Votre session a expiré, veuillez vous connecter de nouveau afin de continuer.' + inactive: 'Votre compte n’a pas encore été activé.' + sessions: + signed_in: 'Connecté avec succès.' + signed_out: 'Déconnecté avec succès.' + passwords: + send_instructions: 'Vous allez recevoir dans quelques minutes un e-mail contenant des instructions vous expliquant comment réinitialiser votre mot de passe.' + updated: 'Votre mot de passe a été modifié avec succès. Vous êtes à présent connecté.' + confirmations: + send_instructions: 'Vous allez recevoir dans quelques minutes un e-mail contenant des instructions vous expliquant comment confirmer votre compte.' + confirmed: 'Votre compte a été confirmé avec succès. Vous êtes à présent connecté.' + registrations: + signed_up: 'Vous vous êtes inscrit avec succès. Si activée, une confirmation a été envoyée sur votre adresse e-mail.' + updated: 'Vous avez mis à jour votre compte avec succès.' + destroyed: 'Au revoir ! Votre compte a été résilié avec succès. Nous espérons vous revoir très bientôt.' + unlocks: + send_instructions: 'Vous allez recevoir dans quelques minutes un e-mail contenant des instructions vous expliquant comment déverrouiller votre compte.' + unlocked: 'Votre compte a été déverrouillé avec succès. Vous êtes à présent connecté.' + mailer: + confirmation_instructions: 'Instructions de confirmation' + reset_password_instructions: 'Réinitialiser les instructions du mot de passe' + unlock_instructions: 'Instructions de déverrouillage' diff --git a/config/locales/fr.yml b/config/locales/fr.yml new file mode 100644 index 000000000..641208b2a --- /dev/null +++ b/config/locales/fr.yml @@ -0,0 +1,10 @@ +# Copyright (c) 2010, Diaspora Inc. This file is +# licensed under the Affero General Public License version 3. See +# the COPYRIGHT file. + + +# Sample localization file for English. Add more files in this directory for other locales. +# See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. + +en: + hello: "Bonjour tout le monde" From 77acb6268ebc0a2051583c286b6a628ccf122861 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABl=20Soucaze?= Date: Sat, 18 Sep 2010 04:06:18 +0800 Subject: [PATCH 084/449] English localization updated with arielo's changes. --- config/locales/en.yml | 133 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 133 insertions(+) diff --git a/config/locales/en.yml b/config/locales/en.yml index 1de275cf9..867b120e0 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -8,3 +8,136 @@ en: hello: "Hello world" + layouts: + application: + edit_profile: "edit profile" + logout: "logout" + shared: + aspect_nav: + all_aspects: "All Aspects" + manage: "Manage" + manage_your_aspects: "Manage your Aspects" + sub_header: + all_aspects: "All Aspects" + manage_aspects: "Manage Aspects" + publisher: + share: "Share" + aspect_friends: + add_friends: "add friends" + albums: + album: + you: "you" + new_album: + create: "create" + add_a_new_album: "Add a new album" + show: + edit_album: "Edit Album" + albums: "albums" + updated: "updated" + by: "by" + edit: + editing: "Editing" + updated: "updated" + are_you_sure: "Are you sure?" + delete_album: "Delete Album" + cancel: "Cancel" + index: + home: "home" + new_album: "New Album" + create: + success: "You've created an album called %{name}." + update: + success: "Album %{name} successfully edited." + failure: "Failed to edit album %{name}." + destroy: + success: "Album %{name} deleted." + aspects: + index: + photos: "photos" + show: + photos: "photos" + manage: + add_a_new_aspect: "Add a new aspect" + add_a_new_friend: "Add a new friend" + show: "Show" + update_aspects: "Update Aspects" + requests: "Requests" + ignore_remove: "Ignore/Remove" + new_aspect: + add_a_new_aspect: "Add a new aspect" + create: "Create" + create: + success:"Click on the plus on the left side to tell Diaspora who can see your new aspect." + users: + edit: + cancel: "Cancel" + update_profile: "Update Profile" + home: "Home" + diaspora_username: "DIASPORA USERNAME" + info: "Info" + picture: "Picture" + editing_profile: "Editing profile" + albums: "Albums" + you_dont_have_any_photos: "You don't have any photos! Go to the" + page_to_upload_some: "page to upload some." + comments: + comment: + ago: "ago" + new_comment: + comment: "Comment" + photos: + show: + prev: "prev" + full_size: "full size" + next: "next" + edit_photo: "Edit Photo" + delete_photo: "Delete Photo" + are_you_sure: "Are you sure?" + comments: "comments" + edit: + editing: "Editing" + are_you_sure: "Are you sure?" + delete_photo: "Delete Photo" + photo: + show_comments: "show comments" + posted_a_new_photo_to: "posted a new photo to" + new: + new_photo: "New Photo" + back_to_list: "Back to List" + post_it: "post it!" + registrations: + new: + sign_up: "Sign up" + status_messages: + new_status_message: + tell_me_something_good: "tell me something good" + oh_yeah: "oh yeah!" + status_message: + show_comments: "show comments" + delete: "Delete" + are_you_sure: "Are you sure?" + show: + status_message: "Status Message" + comments: "comments" + are_you_sure: "Are you sure?" + destroy: "Destroy" + view_all: "View All" + message: "Message" + owner: "Owner" + people: + index: + add_friend: "add friend" + real_name: "real name" + diaspora_handle: "diaspora handle" + thats_you: "that's you!" + friend_request_pending: "friend request pending" + you_have_a_friend_request_from_this_person: "you have a friend request from this person" + new: + new_person: "New Person" + back_to_list: "Back to List" + show: + last_seen: "last seen: %{how_long_ago}" + friends_since: "friends since: %{how_long_ago}" + save: "save" + are_you_sure: "Are you sure?" + remove_friend: "remove friend" \ No newline at end of file From c884a25da6fa90cd1049723ec104df6bfe2638d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABl=20Soucaze?= Date: Sat, 18 Sep 2010 04:07:02 +0800 Subject: [PATCH 085/449] French localization updated with arielo's changes. --- config/locales/devise.fr.yml | 2 +- config/locales/fr.yml | 137 ++++++++++++++++++++++++++++++++++- 2 files changed, 136 insertions(+), 3 deletions(-) diff --git a/config/locales/devise.fr.yml b/config/locales/devise.fr.yml index 8829de132..b8691eb3a 100644 --- a/config/locales/devise.fr.yml +++ b/config/locales/devise.fr.yml @@ -3,7 +3,7 @@ # the COPYRIGHT file. -en: +fr: errors: messages: not_found: "introuvable" diff --git a/config/locales/fr.yml b/config/locales/fr.yml index 641208b2a..9c05ff973 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -3,8 +3,141 @@ # the COPYRIGHT file. -# Sample localization file for English. Add more files in this directory for other locales. +# Localization file for French. Add more files in this directory for other locales. # See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. -en: +fr: hello: "Bonjour tout le monde" + layouts: + application: + edit_profile: "éditer le profil" + logout: "déconnexion" + shared: + aspect_nav: + all_aspects: "Tous les aspects" + manage: "Gérer" + manage_your_aspects: "Gérer vos aspects" + sub_header: + all_aspects: "Tous les aspects" + manage_aspects: "Gérer les aspects" + publisher: + share: "Partager" + aspect_friends: + add_friends: "ajouter des amis" + albums: + album: + you: "vous" + new_album: + create: "créer" + add_a_new_album: "Ajouter un nouvel album" + show: + edit_album: "Éditer l’album" + albums: "albums" + updated: "mis à jour" + by: "par" + edit: + editing: "Édition" + updated: "mis à jour" + are_you_sure: "Êtes-vous sûr ?" + delete_album: "Supprimer l’album" + cancel: "Annuler" + index: + home: "accueil" + new_album: "Nouvel album" + create: + success: "Tu as créé un album nommé %{name}." + update: + success: "L’album %{name} a été édité avec succès." + failure: "L’édition de l’album %{name} a échoué." + destroy: + success: "L’album %{name} a été supprimé." + aspects: + index: + photos: "photos" + show: + photos: "photos" + manage: + add_a_new_aspect: "Ajouter un nouvel aspect" + add_a_new_friend: "Ajouter un nouvel ami" + show: "Afficher" + update_aspects: "Metre à jour les aspects" + requests: "Requêtes" + ignore_remove: "Ignorer/Supprimer" + new_aspect: + add_a_new_aspect: "Ajouter un nouvel aspect" + create: "Créer" + create: + success:"Cliquez sur plus situé sur le côté gauche afin d’en informer Diaspora qui peut voir votre nouvel aspect." + users: + edit: + cancel: "Annuler" + update_profile: "Mettre à jour le profil" + home: "Accueil" + diaspora_username: "NOM D’UTILISATEUR DIASPORA" + info: "Information" + picture: "Image" + editing_profile: "Édition du profil" + albums: "Albums" + you_dont_have_any_photos: "Vous n’avez aucune photo ! Rendez-vous sur la page" + page_to_upload_some: "afin d’en transférer quelques-unes." + comments: + comment: + ago: "il y a" + new_comment: + comment: "Commentaire" + photos: + show: + prev: "précédent" + full_size: "taille réelle" + next: "suivant" + edit_photo: "Éditer la photo" + delete_photo: "Supprimer la photo" + are_you_sure: "Êtes-vous sûr ?" + comments: "commentaires" + edit: + editing: "Édition" + are_you_sure: "Êtes-vous sûr ?" + delete_photo: "Supprimer la photo" + photo: + show_comments: "afficher les commentaires" + posted_a_new_photo_to: "a publié une nouvelle photo sur" + new: + new_photo: "Nouvelle photo" + back_to_list: "Retourner à la liste" + post_it: "publiez-la !" + registrations: + new: + sign_up: "Inscription" + status_messages: + new_status_message: + tell_me_something_good: "dites-moi quelque chose de bien" + oh_yeah: "oh ouais !" + status_message: + show_comments: "afficher les commentaires" + delete: "Supprimer" + are_you_sure: "Êtes-vous sûr ?" + show: + status_message: "Message d’état" + comments: "commentaires" + are_you_sure: "Êtes-vous sûr ?" + destroy: "Détruire" + view_all: "Tout voir" + message: "Message" + owner: "Propriétaire" + people: + index: + add_friend: "ajouter un ami" + real_name: "nom réel" + diaspora_handle: "maniement de diaspora" + thats_you: "c’est vous !" + friend_request_pending: "Requête d’ami en attente" + you_have_a_friend_request_from_this_person: "vous avez une requête d’ami de la part de cette personne" + new: + new_person: "Nouvelle personne" + back_to_list: "Retourner à la liste" + show: + last_seen: "dernière connexion : %{how_long_ago}" + friends_since: "amis depuis : %{how_long_ago}" + save: "sauvegarder" + are_you_sure: "Êtes-vous sûr ?" + remove_friend: "supprimer un ami" \ No newline at end of file From c8d3ceae612685675cb4ea0ee5a57f255b74567d Mon Sep 17 00:00:00 2001 From: Michael Kaeufl Date: Mon, 20 Sep 2010 19:40:37 +0200 Subject: [PATCH 086/449] de translation: wieder -> erneut --- config/locales/devise.de.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/locales/devise.de.yml b/config/locales/devise.de.yml index 34947cbc2..0119a9214 100644 --- a/config/locales/devise.de.yml +++ b/config/locales/devise.de.yml @@ -17,7 +17,7 @@ de: locked: 'Dein Konto ist gesperrt.' invalid: 'Ungültige E-Mail-Adresse oder Passwort.' invalid_token: 'Ungültiger Authentifizierungstoken.' - timeout: 'Deine Sitzung ist abgelaufen, bitte melde dich wieder an um fortzufahren.' + timeout: 'Deine Sitzung ist abgelaufen, bitte melde dich erneut an um fortzufahren.' inactive: 'Dein Konto wurde noch nicht aktiviert.' sessions: signed_in: 'Erfolgreich angemeldet.' From 718b0715b3e1918b50e43b7e2acb099052a5d71b Mon Sep 17 00:00:00 2001 From: Mikhail Zubrov Date: Sat, 18 Sep 2010 13:58:29 +0800 Subject: [PATCH 087/449] add a Russian translation --- config/locales/devise.ru.yml | 41 ++++++++++++++++++++++++++++++++++++ config/locales/ru.yml | 10 +++++++++ 2 files changed, 51 insertions(+) create mode 100644 config/locales/devise.ru.yml create mode 100644 config/locales/ru.yml diff --git a/config/locales/devise.ru.yml b/config/locales/devise.ru.yml new file mode 100644 index 000000000..0e9b7b92f --- /dev/null +++ b/config/locales/devise.ru.yml @@ -0,0 +1,41 @@ +# Copyright (c) 2010, Diaspora Inc. This file is +# licensed under the Affero General Public License version 3. See +# the COPYRIGHT file. + + +en: + errors: + messages: + not_found: "не найден(о)" + already_confirmed: "уже подтвержден(о)" + not_locked: "не заблокирован(о)" + + devise: + failure: + unauthenticated: 'Вам нужно войти либо зарегистрироваться, чтобы продолжить.' + unconfirmed: 'Вам нужно подтвердить вашу учётную запись, чтобы продолжить.' + locked: 'Ваша учётная запись заблокирована.' + invalid: 'Неверный e-mail или пароль.' + invalid_token: 'Неверный ключ аутентификации.' + timeout: 'Срок вашего сеанса истёк, пожалуйста, войдите в систему снова.' + inactive: 'Ваша учётная запись ещё не активирована.' + sessions: + signed_in: 'Вход в систему выполнен успешно.' + signed_out: 'Выход из системы выполнен успешно.' + passwords: + send_instructions: 'Вы получите e-mail с указаниями по сбросу пароля в течение нескольких минут.' + updated: 'Ваш пароль был изменён. Вы вошли в систему.' + confirmations: + send_instructions: 'Вы получите e-mail с указаниями по подтверждению учётной записи в течение нескольких минут.' + confirmed: 'Ваша учётная запись была подтверждена. Вы вошли в систему.' + registrations: + signed_up: 'Регистрация выполнена успешно. В зависимости от настроек, вам может прийти e-mail с подтверждением.' + updated: 'Обновление вашей учётной записи выполнено успешно.' + destroyed: 'До свидания! Ваша учётная запись была удалена. Надеемся, что вскоре вас увидим снова.' + unlocks: + send_instructions: 'Вы получите e-mail с указаниями по разблокированию учётной записи в течение нескольких минут.' + unlocked: 'Ваша учётная запись была разблокирована. Вы вошли в систему.' + mailer: + confirmation_instructions: 'Подтверждение учётной записи' + reset_password_instructions: 'Сброс пароля' + unlock_instructions: 'Разблокирование учётной записи' diff --git a/config/locales/ru.yml b/config/locales/ru.yml new file mode 100644 index 000000000..1a8e7fc4e --- /dev/null +++ b/config/locales/ru.yml @@ -0,0 +1,10 @@ +# Copyright (c) 2010, Diaspora Inc. This file is +# licensed under the Affero General Public License version 3. See +# the COPYRIGHT file. + + +# Sample localization file for English. Add more files in this directory for other locales. +# See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. + +en: + hello: "Привет, мир" From 5533f308406edf1e366027b17dd44cefd301c475 Mon Sep 17 00:00:00 2001 From: Michael Kaeufl Date: Mon, 20 Sep 2010 19:41:14 +0200 Subject: [PATCH 088/449] =?UTF-8?q?de=20translation:=20abgemeldet=20->=20g?= =?UTF-8?q?ek=C3=BCndigt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/locales/devise.de.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/locales/devise.de.yml b/config/locales/devise.de.yml index 0119a9214..7c0e0e758 100644 --- a/config/locales/devise.de.yml +++ b/config/locales/devise.de.yml @@ -31,7 +31,7 @@ de: registrations: signed_up: 'Du hast dich erfolgreich registriert. Sofern aktiviert, wurde dir eine Bestätigung per E-Mail gesendet.' updated: 'Dein Konto wurde aktualisiert.' - destroyed: 'Tschüss! Dein Konto wurde erfolgreich abgemeldet. Wir hoffen dich bald wiederzusehen.' + destroyed: 'Tschüss! Dein Konto wurde erfolgreich gekündigt. Wir hoffen dich bald wiederzusehen.' unlocks: send_instructions: 'Du wirst in ein paar Minuten eine E-Mail erhalten, die beschreibt, wie du dein Konto entsperren kannst.' unlocked: 'Dein Konto wurde erfolgreich entsperrt. Du bist nun angemeldet.' From b8dc20e4bbb04fa2531ba867efed15169ed87124 Mon Sep 17 00:00:00 2001 From: Claudius Coenen Date: Fri, 17 Sep 2010 05:55:57 +0800 Subject: [PATCH 089/449] adding german translation --- config/locales/de.yml | 116 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 116 insertions(+) create mode 100644 config/locales/de.yml diff --git a/config/locales/de.yml b/config/locales/de.yml new file mode 100644 index 000000000..23617a3f3 --- /dev/null +++ b/config/locales/de.yml @@ -0,0 +1,116 @@ +# Copyright (c) 2010, Diaspora Inc. This file is +# licensed under the Affero General Public License version 3. See +# the COPYRIGHT file. + + +# Sample localization file for English. Add more files in this directory for other locales. +# See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. + +de: + hello: "Hallo Welt" + layouts: + application: + edit_profile: "Profil bearbeiten" + logout: "Ausloggen" + shared: + aspect_nav: + all_aspects: "Alle Aspekte" + manage: "Verwalten" + manage_your_aspects: "Aspekte verwalten" + sub_header: + all_aspects: "Alle Aspekte" + manage_aspects: "Aspekte verwalten" + publisher: + share: "Teilen" + aspect_friends: + add_friends: "Freunde hinzufügen" + albums: + album: + you: "dir" + new_album: + create: "erstellen" + add_a_new_album: "Album hinzufügen" + show: + edit_album: "Album bearbeiten" + albums: "Alben" + updated: "aktualisiert" + by: "von" + edit: + editing: "Bearbeite" + updated: "geändert" + are_you_sure: "Bist du sicher?" + delete_album: "Album löschen" + cancel: "Abbrechen" + index: + home: "Startseite" + new_album: "Neues Album" + aspects: + index: + photos: "Fotos" + show: + photos: "Fotos" + manage: + add_a_new_aspect: "Neuen Aspekt erstellen" + add_a_new_friend: "Freund hinzufügen" + show: "Anzeigen" + update_aspects: "Aspekte aktualisieren" + requests: "Anfragen" + ignore_remove: "Ignorieren/Entfernen" + new_aspect: + create: "Erstellen" + users: + edit: + cancel: "Abbrechen" + update_profile: "Profil aktualisieren" + home: "Startseite" + diaspora_username: "Diaspora Benutzername" + info: "Info" + picture: "Bild" + editing_profile: "Profil bearbeiten" + albums: "Alben" + comments: + comment: + # this won't work in german at all. Needs more thorough I18n + ago: "ago" + new_comment: + comment: "Kommentar" + photos: + show: + prev: "zurück" + full_size: "volle Größe" + next: "vor" + edit_photo: "Foto bearbeiten" + delete_photo: "Foto löschen" + are_you_sure: "Bist du sicher?" + comments: "Kommentare" + edit: + editing: "Bearbeite" + are_you_sure: "Bist du sicher?" + delete_photo: "Foto löschen" + photo: + show_comments: "Kommentare anzeigen" + new: + new_photo: "Foto erstellen" + back_to_list: "Zurück zur Liste" + post_it: "Hochladen" + registrations: + new: + sign_up: "Anmelden" + status_messages: + new_status_message: + tell_me_something_good: "Erzähl' mir was schönes!" + oh_yeah: "Hey, super!" + status_message: + show_comments: "Kommentare anzeigen" + delete: "Löschen" + are_you_sure: "Bist du sicher?" + show: + status_message: "Statusmeldung" + comments: "Kommentare" + are_you_sure: "Bist du sicher?" + destroy: "Löschen" + view_all: "Alle anzeigen" + message: "Nachricht" + owner: "Besitzer" + + From 6501974f3077f17a8025645d229a452c1d8ad545 Mon Sep 17 00:00:00 2001 From: Ariel Zavala Date: Fri, 17 Sep 2010 22:43:59 +0800 Subject: [PATCH 090/449] added more translations missing on views --- app/controllers/aspects_controller.rb | 2 +- app/views/aspects/_new_aspect.haml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/aspects_controller.rb b/app/controllers/aspects_controller.rb index ab144ad12..82c35b36c 100644 --- a/app/controllers/aspects_controller.rb +++ b/app/controllers/aspects_controller.rb @@ -16,7 +16,7 @@ class AspectsController < ApplicationController def create @aspect = current_user.aspect params[:aspect] - flash[:notice] = "Click on the plus on the left side to tell Diaspora who can see your new aspect." + flash[:notice] = I18n.t('aspects.create.success') respond_with :location => aspects_manage_path end diff --git a/app/views/aspects/_new_aspect.haml b/app/views/aspects/_new_aspect.haml index b5bc7ace3..3ca07ac17 100644 --- a/app/views/aspects/_new_aspect.haml +++ b/app/views/aspects/_new_aspect.haml @@ -3,7 +3,7 @@ -# the COPYRIGHT file. -%h1 Add a new aspect +%h1=t('.add_a_new_aspect') = form_for Aspect.new do |f| = f.error_messages %p From 4c9ac0e5f6fbb931ed8220e238d26fe70a8e0adb Mon Sep 17 00:00:00 2001 From: Felix Gruber Date: Fri, 17 Sep 2010 01:03:08 +0800 Subject: [PATCH 091/449] initial german translation --- config/locales/devise.de.yml | 41 ++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 config/locales/devise.de.yml diff --git a/config/locales/devise.de.yml b/config/locales/devise.de.yml new file mode 100644 index 000000000..55ad12536 --- /dev/null +++ b/config/locales/devise.de.yml @@ -0,0 +1,41 @@ +# Copyright (c) 2010, Diaspora Inc. This file is +# licensed under the Affero General Public License version 3. See +# the COPYRIGHT file. + + +en: + errors: + messages: + not_found: "nicht gefunden" + already_confirmed: "wurde bereits bestätigt" + not_locked: "war nicht gesperrt" + + devise: + failure: + unauthenticated: 'Du musst dich anmelden oder registrieren um fortzufahren.' + unconfirmed: 'Du musst dein Konto bestätigen um fortzufahren.' + locked: 'Dein Konto ist gesperrt.' + invalid: 'Ungültige E-Mail-Adresse oder Passwort.' + invalid_token: 'Ungültiger Authentifizierungstoken.' + timeout: 'Deine Sitzung ist abgelaufen, bitte melde dich wieder an, um fortzufahren.' + inactive: 'Dein Konto wurde noch nicht aktiviert.' + sessions: + signed_in: 'Erfolgreich angemeldet.' + signed_out: 'Erfolgreich abgemeldet.' + passwords: + send_instructions: 'Du wirst in ein paar Minuten eine E-Mail erhalten, die beschreibt, wie du dein Passwort zurücksetzt.' + updated: 'Dein Passwort wurde erfolgreich geändert. Du bist nun angemeldet.' + confirmations: + send_instructions: 'Du wirst in ein paar Minuten eine E-Mail erhalten, die beschreibt, wie du dein Konto bestätigst.' + confirmed: 'Dein Konto wurde erfolgreich bestätigt. Du bist nun angemeldet.' + registrations: + signed_up: 'Du wurdest erfolgreich registriert. Falls aktiviert, wurde dir eine E-Mail zur Bestätigung geschickt.' + updated: 'Du hast erfolgreich dein Konto aktualisiert.' + destroyed: 'Tschüss! Dein Konto wurde erfolgreich abgemeldet. Wir hoffen dich bald wiederzusehen.' + unlocks: + send_instructions: 'Du wirst in ein paar Minuten eine E-Mail erhalten, die beschreibt, wie du dein Konto entsperren kannst.' + unlocked: 'Dein Konto wurde erfolgreich entsperrt. Du bist nun angemeldet.' + mailer: + confirmation_instructions: 'Instruktionen zur Bestätigung' + reset_password_instructions: 'Instruktionen zum Zurücksetzen des Passworts' + unlock_instructions: 'Instruktionen zum Entsperren' From cc7c82ab5e3c0d9ec4eb6fc3f025abfe07d5d152 Mon Sep 17 00:00:00 2001 From: maxwell Date: Mon, 20 Sep 2010 10:46:46 -0700 Subject: [PATCH 092/449] MS added openssl copywright exception --- COPYRIGHT | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/COPYRIGHT b/COPYRIGHT index c1e5ed876..af330bbc2 100644 --- a/COPYRIGHT +++ b/COPYRIGHT @@ -1 +1,14 @@ Diaspora is copyright Diaspora Inc., 2010, and files herein are licensed under the Affero General Public License version 3, the text of which can be found in GNU-AGPL-3.0, unless otherwise noted. Components of Diaspora, including Rails, JQuery, and Devise, are licensed under the MIT/X11 license. Blueprint-CSS is licensed under a modified version of the MIT/X11 license. All unmodified files from these and other sources retain their original copyright and license notices: see the relevant individual files. Attribution information for Diaspora is contained in the AUTHORS file. + +* In addition, as a special exception, the copyright holders give +* permission to link the code of portions of this program with the +* OpenSSL library under certain conditions as described in each +* individual source file, and distribute linked combinations +* including the two. +* You must obey the GNU General Public License in all respects +* for all of the code used other than OpenSSL. If you modify +* file(s) with this exception, you may extend this exception to your +* version of the file(s), but you are not obligated to do so. If you +* do not wish to do so, delete this exception statement from your +* version. If you delete this exception statement from all source +* files in the program, then also delete it here. \ No newline at end of file From 852022ca79c12ecc03c7da51c07cfc6467eebcef Mon Sep 17 00:00:00 2001 From: Felix Gruber Date: Fri, 17 Sep 2010 01:15:36 +0800 Subject: [PATCH 093/449] change 'en' to 'de' in devise.de.yml --- config/locales/devise.de.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/locales/devise.de.yml b/config/locales/devise.de.yml index 55ad12536..516eebfed 100644 --- a/config/locales/devise.de.yml +++ b/config/locales/devise.de.yml @@ -3,7 +3,7 @@ # the COPYRIGHT file. -en: +de: errors: messages: not_found: "nicht gefunden" From 83520f593c0984d7b3781936509eab4119cae347 Mon Sep 17 00:00:00 2001 From: Felix Gruber Date: Mon, 20 Sep 2010 00:15:36 +0800 Subject: [PATCH 094/449] some corrections from sennewood --- config/locales/devise.de.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/locales/devise.de.yml b/config/locales/devise.de.yml index 516eebfed..9fe2e5a32 100644 --- a/config/locales/devise.de.yml +++ b/config/locales/devise.de.yml @@ -17,7 +17,7 @@ de: locked: 'Dein Konto ist gesperrt.' invalid: 'Ungültige E-Mail-Adresse oder Passwort.' invalid_token: 'Ungültiger Authentifizierungstoken.' - timeout: 'Deine Sitzung ist abgelaufen, bitte melde dich wieder an, um fortzufahren.' + timeout: 'Deine Sitzung ist abgelaufen, bitte melde dich wieder an um fortzufahren.' inactive: 'Dein Konto wurde noch nicht aktiviert.' sessions: signed_in: 'Erfolgreich angemeldet.' @@ -30,7 +30,7 @@ de: confirmed: 'Dein Konto wurde erfolgreich bestätigt. Du bist nun angemeldet.' registrations: signed_up: 'Du wurdest erfolgreich registriert. Falls aktiviert, wurde dir eine E-Mail zur Bestätigung geschickt.' - updated: 'Du hast erfolgreich dein Konto aktualisiert.' + updated: 'Dein Konto wurde aktualisiert.' destroyed: 'Tschüss! Dein Konto wurde erfolgreich abgemeldet. Wir hoffen dich bald wiederzusehen.' unlocks: send_instructions: 'Du wirst in ein paar Minuten eine E-Mail erhalten, die beschreibt, wie du dein Konto entsperren kannst.' From 88bb50660a241e314922a6d8c62495f8f779d8a9 Mon Sep 17 00:00:00 2001 From: Felix Gruber Date: Mon, 20 Sep 2010 20:04:09 +0800 Subject: [PATCH 095/449] better translation from sennewood --- config/locales/devise.de.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/locales/devise.de.yml b/config/locales/devise.de.yml index 9fe2e5a32..34947cbc2 100644 --- a/config/locales/devise.de.yml +++ b/config/locales/devise.de.yml @@ -29,7 +29,7 @@ de: send_instructions: 'Du wirst in ein paar Minuten eine E-Mail erhalten, die beschreibt, wie du dein Konto bestätigst.' confirmed: 'Dein Konto wurde erfolgreich bestätigt. Du bist nun angemeldet.' registrations: - signed_up: 'Du wurdest erfolgreich registriert. Falls aktiviert, wurde dir eine E-Mail zur Bestätigung geschickt.' + signed_up: 'Du hast dich erfolgreich registriert. Sofern aktiviert, wurde dir eine Bestätigung per E-Mail gesendet.' updated: 'Dein Konto wurde aktualisiert.' destroyed: 'Tschüss! Dein Konto wurde erfolgreich abgemeldet. Wir hoffen dich bald wiederzusehen.' unlocks: From 6294cf502d4c9a86175c581fb434361a7ac2ffc3 Mon Sep 17 00:00:00 2001 From: MrBison Date: Sat, 18 Sep 2010 17:18:07 +0800 Subject: [PATCH 096/449] oops, a stupid error. --- config/locales/devise.ru.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/locales/devise.ru.yml b/config/locales/devise.ru.yml index 0e9b7b92f..670d57026 100644 --- a/config/locales/devise.ru.yml +++ b/config/locales/devise.ru.yml @@ -3,7 +3,7 @@ # the COPYRIGHT file. -en: +ru: errors: messages: not_found: "не найден(о)" From 1e5fc556a3dc914833b642648b7365bbd023c3ab Mon Sep 17 00:00:00 2001 From: MrBison Date: Sat, 18 Sep 2010 17:18:35 +0800 Subject: [PATCH 097/449] oops, a stupid error fixed --- config/locales/ru.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/locales/ru.yml b/config/locales/ru.yml index 1a8e7fc4e..fe944aa59 100644 --- a/config/locales/ru.yml +++ b/config/locales/ru.yml @@ -6,5 +6,5 @@ # Sample localization file for English. Add more files in this directory for other locales. # See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. -en: +ru: hello: "Привет, мир" From 1f78c3400b10e871409301b65f4d2b97220c078f Mon Sep 17 00:00:00 2001 From: Ariel Zavala Date: Fri, 17 Sep 2010 04:30:17 +0800 Subject: [PATCH 098/449] Started Spanish Locale --- config/locales/es.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 config/locales/es.yml diff --git a/config/locales/es.yml b/config/locales/es.yml new file mode 100644 index 000000000..11c2effdd --- /dev/null +++ b/config/locales/es.yml @@ -0,0 +1,10 @@ +# Copyright (c) 2010, Diaspora Inc. This file is +# licensed under the Affero General Public License version 3. See +# the COPYRIGHT file. + + +# Sample localization file for English. Add more files in this directory for other locales. +# See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. + +es: + hello: "Hello world" \ No newline at end of file From d1822d3dc874b47713718b1e28c570fde20f8ed1 Mon Sep 17 00:00:00 2001 From: Alec Leamas Date: Mon, 20 Sep 2010 18:23:39 +0800 Subject: [PATCH 099/449] Swedish translation --- config/locales/devise.sv.yml | 40 ++++++++++++++++++++++++++++++++++++ config/locales/sv.yml | 10 +++++++++ 2 files changed, 50 insertions(+) create mode 100644 config/locales/devise.sv.yml create mode 100644 config/locales/sv.yml diff --git a/config/locales/devise.sv.yml b/config/locales/devise.sv.yml new file mode 100644 index 000000000..814383a79 --- /dev/null +++ b/config/locales/devise.sv.yml @@ -0,0 +1,40 @@ +# Copyright (c) 2010, Diaspora Inc. This file is +# licensed under the Affero General Public License version 3. See +# the COPYRIGHT file. + + +sv: + errors: + messages: + not_found: "kan ej hitta" + not_locked: "var ej låst" + + devise: + failure: + unauthenticated: 'Du måste logga in innan du kan fortsätta.' + unconfirmed: 'Du måste verifiera ditt konto innan du kan fortsätta.' + locked: 'Ditt konto är låst.' + invalid: 'Felaktig användare eller lösenord.' + invalid_token: 'Ogiltig identifiering.' + timeout: 'Din session är avslutad, var vänlig logga in igen.' + inactive: 'Ditt konto är inte aktiverat.' + sessions: + signed_in: 'Inloggning ok.' + signed_out: 'Utloggning ok.' + passwords: + send_instructions: 'Du kommer att få ett ebrev med instruktioner för att återställa lösenordet inom några minuter.' + updated: 'Ditt lösenord har ändrats och du är inloggad.' + confirmations: + send_instructions: 'Du kommer att få ett ebrev med instruktioner för att verifiera ditt konto inom några minuter.' + confirmed: 'Ditt konto har verifierats och du är inloggad.' + registrations: + signed_up: 'Du har skapat ett konto. Beroende på inställningar kan ett ebrev ha skickats till dig.' + updated: 'Ditt konto har uppdateras.' + destroyed: 'Ditt konto är avslutat. Välkommen åter!' + unlocks: + send_instructions: 'Du kommer att få ett ebrev med instruktioner för att låsa upp ditt konto inom några minuter.' + unlocked: 'Ditt konto har är nu upplåst och du är inloggad' + mailer: + confirmation_instructions: 'Instruktioner för att verifiera ditt konto.' + reset_password_instructions: 'Instruktioner för att terställa ditt lösenord.' + unlock_instructions: 'Instruktioner för att låsa upp ditt konto.' diff --git a/config/locales/sv.yml b/config/locales/sv.yml new file mode 100644 index 000000000..1caf878b8 --- /dev/null +++ b/config/locales/sv.yml @@ -0,0 +1,10 @@ +# Copyright (c) 2010, Diaspora Inc. This file is +# licensed under the Affero General Public License version 3. See +# the COPYRIGHT file. + + +# Swedish localization file. +# See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. + +sv: + hello: "Hej" From 5e69292954f56d9482aac03ce60532550b086a18 Mon Sep 17 00:00:00 2001 From: Alec Leamas Date: Tue, 21 Sep 2010 01:32:20 +0800 Subject: [PATCH 100/449] Typo fix --- config/locales/devise.sv.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/locales/devise.sv.yml b/config/locales/devise.sv.yml index 814383a79..b434666ce 100644 --- a/config/locales/devise.sv.yml +++ b/config/locales/devise.sv.yml @@ -26,7 +26,7 @@ sv: updated: 'Ditt lösenord har ändrats och du är inloggad.' confirmations: send_instructions: 'Du kommer att få ett ebrev med instruktioner för att verifiera ditt konto inom några minuter.' - confirmed: 'Ditt konto har verifierats och du är inloggad.' + confirmed: 'Ditt konto har verifierats och du är inloggad.' registrations: signed_up: 'Du har skapat ett konto. Beroende på inställningar kan ett ebrev ha skickats till dig.' updated: 'Ditt konto har uppdateras.' From 813dfae0599202c02a5fc83922056cb8788f819f Mon Sep 17 00:00:00 2001 From: gattytto Date: Mon, 20 Sep 2010 04:21:33 +0800 Subject: [PATCH 101/449] just a few 's' missing. :) --- config/locales/devise.es.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/locales/devise.es.yml b/config/locales/devise.es.yml index 70209ff79..06002aa63 100644 --- a/config/locales/devise.es.yml +++ b/config/locales/devise.es.yml @@ -18,10 +18,10 @@ es: signed_in: 'Has ingresado correctamente.' signed_out: 'Has salido correctamente.' passwords: - send_instructions: 'Recibirás un email con instrucciones para cambiar tu contraseña en poco minutos.' + send_instructions: 'Recibirás un email con instrucciones para cambiar tu contraseña en pocos minutos.' updated: 'Tu contraseña ha sido modificada. Ya has accedido a tu cuenta.' confirmations: - send_instructions: 'Recibirás un email con instrucciones para confirmar tu cuenta en poco minutos.' + send_instructions: 'Recibirás un email con instrucciones para confirmar tu cuenta en pocos minutos.' confirmed: 'Tu cuenta ha sido confirmada. Ya has accedido a tu cuenta.' registrations: signed_up: 'Te has registrado correctamente. Si está disponible, te habremos enviado un email de confirmación.' From db7ad1650380639c94e67765ec445637308d8b15 Mon Sep 17 00:00:00 2001 From: Ariel Zavala Date: Fri, 17 Sep 2010 03:00:21 +0800 Subject: [PATCH 102/449] Added localization to comments views --- app/views/comments/_comment.html.haml | 2 +- app/views/comments/_new_comment.html.haml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/comments/_comment.html.haml b/app/views/comments/_comment.html.haml index 56252c83d..4252d9762 100644 --- a/app/views/comments/_comment.html.haml +++ b/app/views/comments/_comment.html.haml @@ -9,4 +9,4 @@ = link_to post.person.real_name, post.person = auto_link sanitize post.text %div.time - = "#{time_ago_in_words(post.updated_at)} ago" + = "#{time_ago_in_words(post.updated_at)} #{t('.ago')}" diff --git a/app/views/comments/_new_comment.html.haml b/app/views/comments/_new_comment.html.haml index e998d98b7..a4268082d 100644 --- a/app/views/comments/_new_comment.html.haml +++ b/app/views/comments/_new_comment.html.haml @@ -9,4 +9,4 @@ = f.text_area :text, :rows => 1, :id => "comment_text_on_#{post.id}", :class => "comment_box" = f.hidden_field :post_id, :value => post.id %p{:style => "text-align:right;"} - = f.submit "Comment", :class => "comment_submit button" + = f.submit t('.comment'), :class => "comment_submit button" From 64d371d9d60e13c932b6090e06cbc86cc624fbc2 Mon Sep 17 00:00:00 2001 From: maxwell Date: Mon, 20 Sep 2010 11:30:08 -0700 Subject: [PATCH 103/449] MS added a warning for account --- app/views/devise/sessions/new.html.haml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/views/devise/sessions/new.html.haml b/app/views/devise/sessions/new.html.haml index 1840d7acc..7ce75f5f3 100644 --- a/app/views/devise/sessions/new.html.haml +++ b/app/views/devise/sessions/new.html.haml @@ -1,3 +1,9 @@ +%h1 + This is a technology preview, do not provide any private information. +%h3 + your account may be deleted until we move into a more stable development period. +%h3 + USE AT YOUR OWN RISK!! = form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f| #user %p.username @@ -14,6 +20,7 @@ / = f.check_box :remember_me / = f.label :remember_me = f.submit "Sign in" + = link_to "Have a problem? Find an answer here", 'http://diaspora.shapado.com/' %p = render :partial => "devise/shared/links" From fe306b37ab71c25f21b8d22ed27316f419f3aaf0 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Mon, 20 Sep 2010 11:30:27 -0700 Subject: [PATCH 104/449] DG IZ; mass-assignment quick-fix in controllers --- app/controllers/albums_controller.rb | 17 +++++++++++-- app/controllers/aspects_controller.rb | 12 +++++++++- app/controllers/dev_utilities_controller.rb | 18 -------------- app/controllers/photos_controller.rb | 24 +++++++++++++++++-- app/controllers/registrations_controller.rb | 2 -- app/controllers/status_messages_controller.rb | 13 +++++++++- app/controllers/users_controller.rb | 19 ++++++++++++--- app/models/aspect.rb | 1 + app/views/users/edit.html.haml | 4 ---- 9 files changed, 77 insertions(+), 33 deletions(-) diff --git a/app/controllers/albums_controller.rb b/app/controllers/albums_controller.rb index dbd59c64e..281c83b5c 100644 --- a/app/controllers/albums_controller.rb +++ b/app/controllers/albums_controller.rb @@ -16,7 +16,10 @@ class AlbumsController < ApplicationController def create aspect = params[:album][:to] - @album = current_user.post(:album, params[:album]) + + data = clean_hash(params[:album]) + + @album = current_user.post(:album, data) flash[:notice] = "You've created an album called #{@album.name}." redirect_to :action => :show, :id => @album.id, :aspect => aspect end @@ -47,7 +50,10 @@ class AlbumsController < ApplicationController def update @album = current_user.album_by_id params[:id] - if @album.update_attributes params[:album] + + data = clean_hash(params[:album]) + + if @album.update_attributes data flash[:notice] = "Album #{@album.name} successfully edited." respond_with @album else @@ -56,4 +62,11 @@ class AlbumsController < ApplicationController end end + private + def clean_hash(params) + return { + :name => params[:name], + :to => params[:to] + } + end end diff --git a/app/controllers/aspects_controller.rb b/app/controllers/aspects_controller.rb index ab144ad12..afd6b016f 100644 --- a/app/controllers/aspects_controller.rb +++ b/app/controllers/aspects_controller.rb @@ -52,7 +52,9 @@ class AspectsController < ApplicationController def update @aspect = Aspect.find_by_id(params[:id]) - @aspect.update_attributes(params[:aspect]) + + data = clean_hash(params[:aspect]) + @aspect.update_attributes( data ) flash[:notice] = "Your aspect, #{@aspect.name}, has been successfully edited." respond_with @aspect end @@ -83,4 +85,12 @@ class AspectsController < ApplicationController respond_with Person.first(:id => params[:friend_id]) end end + + private + def clean_hash(params) + return { + :name => params[:name] + } + end + end diff --git a/app/controllers/dev_utilities_controller.rb b/app/controllers/dev_utilities_controller.rb index bcb0dd4f7..30d1a1799 100644 --- a/app/controllers/dev_utilities_controller.rb +++ b/app/controllers/dev_utilities_controller.rb @@ -7,24 +7,6 @@ class DevUtilitiesController < ApplicationController before_filter :authenticate_user!, :except => [:set_backer_number] include ApplicationHelper include RequestsHelper -def warzombie - render :nothing => true - if current_user.email == "tom@tom.joindiaspora.com" && StatusMessage.where(:message => "There's a bomb in the lasagna!?").first == nil - current_user.post(:status_message, :message => "There's a bomb in the lasagna!?") - current_user.post(:status_message, :message => "xkcd \nhttp://xkcd.com/743/" ) - current_user.post(:status_message, :message => "I switched to Motoroi today, a Motorola Android-based phone, in Korea. Now, I am using Android phones in both the U.S. and Korea", :created_at => Time.now-930) - current_user.post(:status_message, :message => "I had 5 hours to study for it :-( GREs on Thursday. Wunderbar.", :created_at => Time.now-43990) - current_user.post(:status_message, :message => "Spotted in toy story 3: google maps, OSX, and windows XP. Two out of three isn't bad.", :created_at => Time.now-4390) - current_user.post(:status_message, :message => "Reddit\nhttp://reddit.com", :created_at => Time.now-54390) - current_user.post(:status_message, :message => "Commercials for IE make me SO MAD and my friends just don't get why.", :created_at => Time.now-30900) - current_user.post(:status_message, :message => "Zombo.com\nhttp://zombo.com", :created_at => Time.now-9090) - current_user.post(:status_message, :message => "Why do I have \"No More Heroes\" by Westlife on repeat all day?", :created_at => Time.now-590000) - current_user.post(:status_message, :message => "Mmm. Friday night. Acknowledged.", :created_at => Time.now-503900) - current_user.post(:status_message, :message => "Getting a universal remote is the epitome of laziness, I do declare.", :created_at => Time.now-4400) - current_user.post(:status_message, :message => "Does anyone know how to merge two Skype contact entries of the same person? (i.e. one Skype ID and one mobile number)", :created_at => Time.now-400239) - current_user.post(:status_message, :message => "A cool, cool morning for once.", :created_at => Time.now-150000) - end - end def zombiefriends render :nothing => true diff --git a/app/controllers/photos_controller.rb b/app/controllers/photos_controller.rb index cefc8f5d6..b77341820 100644 --- a/app/controllers/photos_controller.rb +++ b/app/controllers/photos_controller.rb @@ -33,7 +33,11 @@ class PhotosController < ApplicationController params[:user_file] = file - @photo = current_user.post(:photo, params) + + data = clean_hash(params) + + + @photo = current_user.post(:photo, data) respond_to do |format| format.json{render(:layout => false , :json => {"success" => true, "data" => @photo}.to_json )} @@ -83,7 +87,10 @@ class PhotosController < ApplicationController def update @photo = Photo.find_by_id params[:id] - if @photo.update_attributes params[:photo] + + data = clean_hash(params) + + if @photo.update_attributes data[:photo] flash[:notice] = "Photo successfully updated." respond_with @photo else @@ -91,4 +98,17 @@ class PhotosController < ApplicationController render :action => :edit end end + + + private + def clean_hash(params) + return { + :photo => { + :caption => params[:photo][:caption], + }, + :album_id => params[:album_id], + :user_file => params[:user_file] + } + end + end diff --git a/app/controllers/registrations_controller.rb b/app/controllers/registrations_controller.rb index 8241aa294..d1f0718bc 100644 --- a/app/controllers/registrations_controller.rb +++ b/app/controllers/registrations_controller.rb @@ -15,9 +15,7 @@ class RegistrationsController < Devise::RegistrationsController flash[:error] = e.message end if user - #set_flash_message :notice, :signed_up flash[:notice] = "You've joined Diaspora!" - #redirect_to root_url sign_in_and_redirect(:user, user) else redirect_to new_user_registration_path diff --git a/app/controllers/status_messages_controller.rb b/app/controllers/status_messages_controller.rb index 5a588fb99..305194a8f 100644 --- a/app/controllers/status_messages_controller.rb +++ b/app/controllers/status_messages_controller.rb @@ -11,7 +11,10 @@ class StatusMessagesController < ApplicationController def create params[:status_message][:to] = params[:aspect_ids] - @status_message = current_user.post(:status_message, params[:status_message]) + + data = clean_hash params[:status_message] + + @status_message = current_user.post(:status_message, data) respond_with @status_message end @@ -25,4 +28,12 @@ class StatusMessagesController < ApplicationController @status_message = StatusMessage.find_by_id params[:id] respond_with @status_message end + + private + def clean_hash(params) + return { + :message => params[:message], + :to => params[:to] + } + end end diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 72666bc30..dbb69d1a2 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -17,14 +17,15 @@ class UsersController < ApplicationController def update @user = current_user - prep_image_url(params[:user]) - @user.update_profile params[:user] + data = clean_hash params[:user] + prep_image_url(data) + + @user.update_profile data respond_with(@user, :location => root_url) end private - def prep_image_url(params) if params[:profile][:image_url].empty? params[:profile].delete(:image_url) @@ -32,4 +33,16 @@ class UsersController < ApplicationController params[:profile][:image_url] = "http://" + request.host + ":" + request.port.to_s + params[:profile][:image_url] end end + + def clean_hash(params) + return { + :profile => + { + :first_name => params[:profile][:first_name], + :last_name => params[:profile][:last_name], + :image_url => params[:profile][:image_url] + } + } + end + end diff --git a/app/models/aspect.rb b/app/models/aspect.rb index 96f94e8fe..b60142671 100644 --- a/app/models/aspect.rb +++ b/app/models/aspect.rb @@ -39,5 +39,6 @@ class Aspect } } end + end diff --git a/app/views/users/edit.html.haml b/app/views/users/edit.html.haml index cddec8d77..fd94b2a42 100644 --- a/app/views/users/edit.html.haml +++ b/app/views/users/edit.html.haml @@ -53,10 +53,6 @@ = p.label :last_name = p.text_field :last_name, :value => @profile.last_name - %p - = f.label :email - = f.text_field :email - #submit_block = link_to "Cancel", root_path or From 5d1fdcaf3af6e2c7514096dabf089f9fc6476b4c Mon Sep 17 00:00:00 2001 From: maxwell Date: Mon, 20 Sep 2010 11:38:24 -0700 Subject: [PATCH 105/449] MS fixing bug #67. stripping whitespace from search --- app/models/person.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/models/person.rb b/app/models/person.rb index 6a328dff8..72f4c46b9 100644 --- a/app/models/person.rb +++ b/app/models/person.rb @@ -35,6 +35,7 @@ class Person /^(https?):\/\/[a-z0-9]+([\-\.]{1}[a-z0-9]+)*(\.[a-z]{2,5})?(:[0-9]{1,5})?(\/.*)?$/ix def self.search(query) + query = query.to_s.strip Person.all('profile.first_name' => /^#{query}/i) | Person.all('profile.last_name' => /^#{query}/i) end From eeb132d82553408998585641f4d585d4f9444b4f Mon Sep 17 00:00:00 2001 From: Arnaud Delcasse Date: Mon, 20 Sep 2010 03:26:19 +0800 Subject: [PATCH 106/449] Writing "Already friends" instead of proposing to add people that we already added successfully or accepted in the search results. --- app/views/people/_person.html.haml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/views/people/_person.html.haml b/app/views/people/_person.html.haml index ef1c69d28..646d0b333 100644 --- a/app/views/people/_person.html.haml +++ b/app/views/people/_person.html.haml @@ -2,7 +2,6 @@ -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - %li.message{:id => person.id} = person_image_link(person) @@ -17,6 +16,8 @@ .right{ :style => "display:inline;top:0;" } - if person.id == current_user.person.id thats you! + - elsif current_user.friends.include?(person) + Already friends - elsif current_user.pending_requests.find_by_person_id(person.id) = link_to "pending request", aspects_manage_path - else From 1c79677c7c2dacda94b6c807188063408d4cb094 Mon Sep 17 00:00:00 2001 From: Michael Kaeufl Date: Mon, 20 Sep 2010 21:38:13 +0200 Subject: [PATCH 107/449] some more german translations --- config/locales/de.yml | 58 +++++++++++++++++++++---------------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/config/locales/de.yml b/config/locales/de.yml index aabe057cd..e052637d8 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -10,15 +10,15 @@ de: hello: "Hallo Welt" application: helper: - unknown_person: "unknown person" - new_requests: "new requests" + unknown_person: "unbekannte Person" + new_requests: "neue Anfrage" dashboards: helper: home: "home" error_messages: helper: - invalid_fields: "Invalid Fields" - correct_the_following_errors_and_try_again: "Correct the following errors and try again." + invalid_fields: "Ungültige Felder" + correct_the_following_errors_and_try_again: "Korrigiere die folgenden Fehler und probier es erneut." people: helper: results_for: " resultados para %{params}" @@ -67,8 +67,8 @@ de: destroy: success: "Album %{name} gelöscht." helper: - friends_albums: "Friends Albums" - your_albums: "Your Albums" + friends_albums: "Alben von Freunden" + your_albums: "Deine Alben" aspects: index: photos: "Fotos" @@ -85,20 +85,20 @@ de: add_a_new_aspect: "Neuen Aspekt erstellen" create: "Erstellen" create: - success: "Click on the plus on the left side to tell Diaspora who can see your new aspect." + success: "Klicke auf das Plus auf der rechten Seite um Diaspora mitzuteilen wer deinen neuen Aspekt sehen kann." destroy: - success: "%{name} was successfully removed." + success: "%{name} wurde erfolgreich gelöscht." update: - success: "Your aspect, %{name}, has been successfully edited." + success: "Dein Aspekt, %{name}, wurde erfolgreich geändert." move_friends: failure: "Aspect editing failed for friend %{real_name}." - success: "Aspects edited successfully." + success: "Aspekt erfolgreich geändert." move_friend: error: "didn't work %{inspect}" notice: "You are now showing your friend a different aspect of yourself." helper: remove: "remove" - aspect_not_empty: "Aspect not empty" + aspect_not_empty: "Aspekt ist nicht leer" users: edit: cancel: "Abbrechen" @@ -142,15 +142,15 @@ de: integrity_error: "Photo upload failed. Are you sure that was an image?" type_error: "Photo upload failed. Are you sure an image was added?" update: - notice: "Photo successfully updated." + notice: "Foto erfolgreich aktualisiert." error: "Failed to edit photo." destroy: - notice: "Photo deleted." + notice: "Foto gelöscht." registrations: new: sign_up: "Anmelden" create: - success: "You've joined Diaspora!" + success: "Du bist Diaspora beigetreten!" status_messages: new_status_message: tell_me_something_good: "Erzähl' mir was schönes!" @@ -171,27 +171,27 @@ de: no_message_to_display: "No message to display." people: index: - add_friend: "add friend" + add_friend: "Freund hinzufügen" real_name: "real name" diaspora_handle: "diaspora handle" - thats_you: "that's you!" - friend_request_pending: "friend request pending" - you_have_a_friend_request_from_this_person: "you have a friend request from this person" + thats_you: "das bist du!" + friend_request_pending: "Freundschaftsanfrage ausstehend" + you_have_a_friend_request_from_this_person: "du hast eine Freundschaftsanfrage von dieser Person" new: - new_person: "New Person" - back_to_list: "Back to List" + new_person: "Neue Person" + back_to_list: "Zurück zur Liste" show: - last_seen: "last seen: %{how_long_ago}" - friends_since: "friends since: %{how_long_ago}" + last_seen: "zuletzt gesehen: %{how_long_ago}" + friends_since: "Freunde seit: %{how_long_ago}" save: "save" - are_you_sure: "Are you sure?" + are_you_sure: "Bist du sicher?" remove_friend: "remove friend" destroy: - success: "You are now friends." - error: "Please select an aspect!" - ignore: "Ignored friend request." + success: "Ihr seid jetzt Freunde." + error: "Bitte wähle einen Aspekt aus!" + ignore: "Freundschaftsanfrage ignorieren." create: error: "No diaspora seed found with this email!" - already_friends: "You are already friends with %{destination_url}!" - success: "A friend request was sent to %{destination_url}." - horribly_wrong: "Something went horribly wrong." + already_friends: "Du bist bereits mit %{destination_url} befreundet!" + success: "Eine Freundschaftsanfrage wurde an %{destination_url} gesendet." + horribly_wrong: "Etwas ging tierisch schief." From ac667e6ec9db87fa37d047290981cbcc44da1c2e Mon Sep 17 00:00:00 2001 From: Michael Kaeufl Date: Mon, 20 Sep 2010 21:39:56 +0200 Subject: [PATCH 108/449] de: Ausloggen -> Abmelden --- config/locales/de.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/locales/de.yml b/config/locales/de.yml index e052637d8..20b75e90c 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -26,7 +26,7 @@ de: layouts: application: edit_profile: "Profil bearbeiten" - logout: "Ausloggen" + logout: "Abmelden" shared: aspect_nav: all_aspects: "Alle Aspekte" From 0869ea6a6a9c24c728ecf7e247586afb5fe6089c Mon Sep 17 00:00:00 2001 From: Raphael Date: Mon, 20 Sep 2010 12:51:33 -0700 Subject: [PATCH 109/449] Adjust readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 066e4171c..c9fc4c6c8 100644 --- a/README.md +++ b/README.md @@ -208,7 +208,7 @@ Once mongo is running and bundler has finished, run `bundle exec thin start` fro ### Run the websocket server run `bundle exec ruby ./script/websocket_server` to start the websocket server on port 8080. Change the port in config/app_config.yml. -### Logging in +### Logging in with a sample user Run `rake db:seed:tom`, then login with user `tom` and password `evankorth`. More details in db/seeds/tom.rb. From 747f7d11a052ae02ed02b42b3bd68b03d65ff965 Mon Sep 17 00:00:00 2001 From: Raphael Date: Mon, 20 Sep 2010 12:51:47 -0700 Subject: [PATCH 110/449] Move thin yml back to development mode --- config/thin.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/thin.yml b/config/thin.yml index b0a3abf8d..ad91436c1 100644 --- a/config/thin.yml +++ b/config/thin.yml @@ -13,7 +13,7 @@ max_conns: 1024 require: [] max_persistent_conns: 512 -environment: production +environment: development servers: 1 daemonize: true #chdir: /usr/applications/localhash/current From 5b6215db77eac18053206843f7c742d84f9da662 Mon Sep 17 00:00:00 2001 From: Raphael Date: Mon, 20 Sep 2010 12:59:01 -0700 Subject: [PATCH 111/449] Replicating a bunch of Pistos' commits, because the HEADs diverged --- README.md | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index c9fc4c6c8..14a380586 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ We need you to fill out a [contributor agreement form](https://spreadsheets.goog All commits must be tested, and after each commit, all tests should be green before a pull request is sent. Please write your tests in Rspec. -GEMS: We would like to keep external dependencies unduplicated. We're using Nokogiri, and Mongomapper, and EM::HttpRequest as much as possible. We have a few gems in the project we'd rather not use, but if you can, use dependencies we already have. +GEMS: We would like to keep external dependencies unduplicated. We're using Nokogiri, Mongomapper, and EM::HttpRequest as much as possible. We have a few gems in the project we'd rather not use, but if you can, use dependencies we already have. # Diaspora @@ -69,22 +69,28 @@ If you're on **Mac OS X**, you already have Ruby on your system. Yay! ### MongoDB -To install MongoDB on **Ubuntu**, add the official MongoDB repository from this link: - -http://www.mongodb.org/display/DOCS/Ubuntu+and+Debian+packages +To install MongoDB on **Ubuntu**, add the official MongoDB repository [here](http://www.mongodb.org/display/DOCS/Ubuntu+and+Debian+packages). For Lucid, add the following line to your /etc/apt/sources.list (for other distros, see http://www.mongodb.org/display/DOCS/Ubuntu+and+Debian+packages): deb http://downloads.mongodb.org/distros/ubuntu 10.4 10gen -And then run: +Then run: sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10 sudo apt-get update sudo apt-get install mongodb-stable You can also run the binary directly by doing the following: -If you're running a 32-bit system, run `wget http://fastdl.mongodb.org/linux/mongodb-linux-i686-1.6.2.tgz`. If you're running a 64-bit system, run `wget http://fastdl.mongodb.org/linux/mongodb-linux-x86_64-1.6.2.tgz`. +If you're running a 32-bit system, run: + + wget http://fastdl.mongodb.org/linux/mongodb-linux-i686-1.6.2.tgz + +If you're running a 64-bit system, run: + + wget http://fastdl.mongodb.org/linux/mongodb-linux-x86_64-1.6.2.tgz + +Then run: # extract tar xzf mongodb-linux-i686-1.4.0.tgz @@ -193,11 +199,11 @@ To start the app server for the first time, you need to use Bundler to install D ### Start Mongo If you installed the Ubuntu package, MongoDB should already be running (if not, run `service mongodb start`). If you installed the binary manually, run `sudo mongod` from where mongo is installed to start mongo. -If you installed the Fedora package, MongoDB will need to be started via `service mongodb start`. If you installed the binary manually, run `sudo mongod` from where mongo is installed to start mongo. +If you installed the Fedora package, MongoDB will need to be started via `service mongodb start`. If you installed the binary manually, run `sudo mongod` from where Mongo is installed to start Mongo. If you installed the OsX package through "brew", MongoDB will need to be started via `sudo launchctl load /Library/LaunchDaemons/org.mongodb.mongod.plist`. (before you have to go to /Library/LaunchDaemons and add a symlink to /usr/local/Cellar/mongodb/1.6.2-x86_64/org.mongodb.mongod.plist) -Diaspora will not run unless mongo is running. Mongo will not run by default, and will need to be started every time you wish to use or run the test suite for Diaspora. +Diaspora will not run unless Mongo is running. Mongo will not run by default, and will need to be started every time you wish to use or run the test suite for Diaspora. ### Run the server `./script/server` will start both thin and the websocket server. If you want to run a different app server, you will have to run them separately. See below for instructions. @@ -223,9 +229,10 @@ Ongoing discussion: - [Diaspora Developer Google Group](http://groups.google.com/group/diaspora-dev) - [Diaspora Discussion Google Group](http://groups.google.com/group/diaspora-discuss) - [Diaspora Q&A site](http://diaspora.shapado.com/) -- [#diaspora-dev](irc://irc.freenode.net/#diaspora-dev) +- [#diaspora-dev IRC channel](irc://irc.freenode.net/#diaspora-dev) + ([join via the web client](http://webchat.freenode.net?channels=diaspora-dev)) -More general info and updates about the project can be found on our [blog](http://joindiaspora.com), [twitter](http://twitter.com/joindiaspora). Also, be sure to join the official [mailing list](http://http://eepurl.com/Vebk). +More general info and updates about the project can be found on our [blog](http://joindiaspora.com), [and on Twitter](http://twitter.com/joindiaspora). Also, be sure to join the official [mailing list](http://http://eepurl.com/Vebk). If you wish to contact us privately about any exploits in Diaspora you may find, you can email [exploits@joindiaspora.com](mailto:exploits@joindiaspora.com). From cbbf3337a38ea88795522353490fcd9cfef85a9a Mon Sep 17 00:00:00 2001 From: Raphael Date: Mon, 20 Sep 2010 13:00:19 -0700 Subject: [PATCH 112/449] Readme style conformance --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 14a380586..0bc06f27f 100644 --- a/README.md +++ b/README.md @@ -84,11 +84,11 @@ You can also run the binary directly by doing the following: If you're running a 32-bit system, run: - wget http://fastdl.mongodb.org/linux/mongodb-linux-i686-1.6.2.tgz + wget http://fastdl.mongodb.org/linux/mongodb-linux-i686-1.6.2.tgz If you're running a 64-bit system, run: - wget http://fastdl.mongodb.org/linux/mongodb-linux-x86_64-1.6.2.tgz + wget http://fastdl.mongodb.org/linux/mongodb-linux-x86_64-1.6.2.tgz Then run: From f28a96e356073ad18b8fed45e497fdba8a8d3fcd Mon Sep 17 00:00:00 2001 From: Michael Kaeufl Date: Mon, 20 Sep 2010 22:00:44 +0200 Subject: [PATCH 113/449] fix in header --- config/locales/de.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/locales/de.yml b/config/locales/de.yml index 20b75e90c..1c4dfb4ad 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -3,7 +3,7 @@ # the COPYRIGHT file. -# Sample localization file for English. Add more files in this directory for other locales. +# Localization file for German. Add more files in this directory for other locales. # See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. de: From 782373cc510bdfde1bc71171821cc5bfe9d5115c Mon Sep 17 00:00:00 2001 From: Michael Kaeufl Date: Tue, 21 Sep 2010 01:40:37 +0800 Subject: [PATCH 114/449] de translation: wieder -> erneut --- config/locales/devise.de.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/locales/devise.de.yml b/config/locales/devise.de.yml index 34947cbc2..0119a9214 100644 --- a/config/locales/devise.de.yml +++ b/config/locales/devise.de.yml @@ -17,7 +17,7 @@ de: locked: 'Dein Konto ist gesperrt.' invalid: 'Ungültige E-Mail-Adresse oder Passwort.' invalid_token: 'Ungültiger Authentifizierungstoken.' - timeout: 'Deine Sitzung ist abgelaufen, bitte melde dich wieder an um fortzufahren.' + timeout: 'Deine Sitzung ist abgelaufen, bitte melde dich erneut an um fortzufahren.' inactive: 'Dein Konto wurde noch nicht aktiviert.' sessions: signed_in: 'Erfolgreich angemeldet.' From 3f12b8b675fcbf3038dd7d958d7fe4530d85321a Mon Sep 17 00:00:00 2001 From: Michael Kaeufl Date: Tue, 21 Sep 2010 01:41:14 +0800 Subject: [PATCH 115/449] =?UTF-8?q?de=20translation:=20abgemeldet=20->=20g?= =?UTF-8?q?ek=C3=BCndigt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/locales/devise.de.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/locales/devise.de.yml b/config/locales/devise.de.yml index 0119a9214..7c0e0e758 100644 --- a/config/locales/devise.de.yml +++ b/config/locales/devise.de.yml @@ -31,7 +31,7 @@ de: registrations: signed_up: 'Du hast dich erfolgreich registriert. Sofern aktiviert, wurde dir eine Bestätigung per E-Mail gesendet.' updated: 'Dein Konto wurde aktualisiert.' - destroyed: 'Tschüss! Dein Konto wurde erfolgreich abgemeldet. Wir hoffen dich bald wiederzusehen.' + destroyed: 'Tschüss! Dein Konto wurde erfolgreich gekündigt. Wir hoffen dich bald wiederzusehen.' unlocks: send_instructions: 'Du wirst in ein paar Minuten eine E-Mail erhalten, die beschreibt, wie du dein Konto entsperren kannst.' unlocked: 'Dein Konto wurde erfolgreich entsperrt. Du bist nun angemeldet.' From 12f667e1b6a6a6e956bc728c7192d84a4951c2a6 Mon Sep 17 00:00:00 2001 From: Michael Kaeufl Date: Tue, 21 Sep 2010 03:39:56 +0800 Subject: [PATCH 116/449] de: Ausloggen -> Abmelden --- config/locales/de.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/locales/de.yml b/config/locales/de.yml index 23617a3f3..da4882148 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -11,7 +11,7 @@ de: layouts: application: edit_profile: "Profil bearbeiten" - logout: "Ausloggen" + logout: "Abmelden" shared: aspect_nav: all_aspects: "Alle Aspekte" From 3b59175f43c5dfa9ba6d17d9bb39226b2b5f51d1 Mon Sep 17 00:00:00 2001 From: Michael Kaeufl Date: Tue, 21 Sep 2010 04:00:44 +0800 Subject: [PATCH 117/449] fix in header --- config/locales/de.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/locales/de.yml b/config/locales/de.yml index da4882148..093df3466 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -3,7 +3,7 @@ # the COPYRIGHT file. -# Sample localization file for English. Add more files in this directory for other locales. +# Localization file for German. Add more files in this directory for other locales. # See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. de: From af9cda52afea5e96c2210f7185f15a9d5eba5d87 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Mon, 20 Sep 2010 13:18:11 -0700 Subject: [PATCH 118/449] DG IZ; always query through the current_user in the controllers. --- app/controllers/albums_controller.rb | 11 +++++------ app/controllers/aspects_controller.rb | 16 ++++++++-------- app/controllers/comments_controller.rb | 5 ----- app/controllers/people_controller.rb | 2 +- app/controllers/photos_controller.rb | 10 +++++----- app/controllers/status_messages_controller.rb | 4 ++-- lib/diaspora/user/querying.rb | 13 +++++-------- spec/models/user/visible_posts_spec.rb | 13 +++++++++++++ 8 files changed, 39 insertions(+), 35 deletions(-) diff --git a/app/controllers/albums_controller.rb b/app/controllers/albums_controller.rb index 281c83b5c..c6cf7a829 100644 --- a/app/controllers/albums_controller.rb +++ b/app/controllers/albums_controller.rb @@ -15,7 +15,7 @@ class AlbumsController < ApplicationController end def create - aspect = params[:album][:to] + aspect = params[:album][:to] data = clean_hash(params[:album]) @@ -29,7 +29,7 @@ class AlbumsController < ApplicationController end def destroy - @album = current_user.album_by_id params[:id] + @album = current_user.find_visible_post_by_id params[:id] @album.destroy flash[:notice] = "Album #{@album.name} deleted." respond_with :location => albums_url @@ -37,19 +37,18 @@ class AlbumsController < ApplicationController def show @photo = Photo.new - @album = Album.find_by_id params[:id] + @album = current_user.find_visible_post_by_id( params[:id] ) @album_photos = @album.photos - respond_with @album end def edit - @album = current_user.album_by_id params[:id] + @album = current_user.find_visible_post_by_id params[:id] redirect_to @album unless current_user.owns? @album end def update - @album = current_user.album_by_id params[:id] + @album = current_user.find_visible_post_by_id params[:id] data = clean_hash(params[:album]) diff --git a/app/controllers/aspects_controller.rb b/app/controllers/aspects_controller.rb index 14aa9e7b8..520485d33 100644 --- a/app/controllers/aspects_controller.rb +++ b/app/controllers/aspects_controller.rb @@ -25,7 +25,7 @@ class AspectsController < ApplicationController end def destroy - @aspect = Aspect.find_by_id params[:id] + @aspect = current_user.aspect_by_id params[:id] begin current_user.drop_aspect @aspect @@ -38,7 +38,7 @@ class AspectsController < ApplicationController end def show - @aspect = Aspect.find_by_id params[:id] + @aspect = current_user.aspect_by_id params[:id] @friends = @aspect.people @posts = current_user.visible_posts( :by_members_of => @aspect ).paginate :per_page => 15, :order => 'created_at DESC' @@ -51,7 +51,7 @@ class AspectsController < ApplicationController end def update - @aspect = Aspect.find_by_id(params[:id]) + @aspect = current_user.aspect_by_id(params[:id]) data = clean_hash(params[:aspect]) @aspect.update_attributes( data ) @@ -63,26 +63,26 @@ class AspectsController < ApplicationController params[:moves].each{ |move| move = move[1] unless current_user.move_friend(move) - flash[:error] = "Aspect editing failed for friend #{Person.find_by_id( move[:friend_id] ).real_name}." - redirect_to Aspect.first, :action => "edit" + flash[:error] = "Aspect editing failed for friend #{current_user.visible_person_by_id( move[:friend_id] ).real_name}." + redirect_to aspects_manage_path return end } flash[:notice] = "Aspects edited successfully." - redirect_to Aspect.first, :action => "edit" + redirect_to aspects_manage_path end def move_friend unless current_user.move_friend( :friend_id => params[:friend_id], :from => params[:from], :to => params[:to][:to]) flash[:error] = "didn't work #{params.inspect}" end - if aspect = Aspect.first(:id => params[:to][:to]) + if aspect = current_user.aspect_by_id(params[:to][:to]) flash[:notice] = "You are now showing your friend a different aspect of yourself." respond_with aspect else flash[:notice] = "You are now showing your friend a different aspect of yourself." - respond_with Person.first(:id => params[:friend_id]) + respond_with current_user.visible_person_by_id(params[:friend_id]) end end diff --git a/app/controllers/comments_controller.rb b/app/controllers/comments_controller.rb index dc115ab5b..4caeb1414 100644 --- a/app/controllers/comments_controller.rb +++ b/app/controllers/comments_controller.rb @@ -17,9 +17,4 @@ class CommentsController < ApplicationController render :nothing => true end - def show - @comment = Comment.find_by_id params[:id] - respond_with @comment - end - end diff --git a/app/controllers/people_controller.rb b/app/controllers/people_controller.rb index d85c67691..08acdd424 100644 --- a/app/controllers/people_controller.rb +++ b/app/controllers/people_controller.rb @@ -22,7 +22,7 @@ class PeopleController < ApplicationController @profile = @person.profile @aspects_with_person = current_user.aspects_with_person(@person) @aspects_dropdown_array = current_user.aspects.collect{|x| [x.to_s, x.id]} - @posts = current_user.visible_posts_from_others(:from => @person).paginate :page => params[:page], :order => 'created_at DESC' + @posts = current_user.visible_posts(:from => @person).paginate :page => params[:page], :order => 'created_at DESC' @latest_status_message = current_user.raw_visible_posts.find_all_by__type_and_person_id("StatusMessage", params[:id]).last @post_count = @posts.count respond_with @person diff --git a/app/controllers/photos_controller.rb b/app/controllers/photos_controller.rb index b77341820..8fa7a3bdf 100644 --- a/app/controllers/photos_controller.rb +++ b/app/controllers/photos_controller.rb @@ -65,28 +65,28 @@ class PhotosController < ApplicationController end def destroy - @photo = Photo.find_by_id params[:id] + @photo = current_user.find_visible_post_by_id params[:id] + @photo.destroy flash[:notice] = "Photo deleted." respond_with :location => @photo.album end def show - @photo = Photo.find_by_id params[:id] + @photo = current_user.find_visible_post_by_id params[:id] @album = @photo.album - respond_with @photo, @album end def edit - @photo = Photo.find_by_id params[:id] + @photo = current_user.find_visible_post_by_id params[:id] @album = @photo.album redirect_to @photo unless current_user.owns? @album end def update - @photo = Photo.find_by_id params[:id] + @photo = current_user.find_visible_post_by_id params[:id] data = clean_hash(params) diff --git a/app/controllers/status_messages_controller.rb b/app/controllers/status_messages_controller.rb index 305194a8f..5a8efbe06 100644 --- a/app/controllers/status_messages_controller.rb +++ b/app/controllers/status_messages_controller.rb @@ -19,13 +19,13 @@ class StatusMessagesController < ApplicationController end def destroy - @status_message = StatusMessage.find_by_id params[:id] + @status_message = current_user.find_visible_post_by_id params[:id] @status_message.destroy respond_with :location => root_url end def show - @status_message = StatusMessage.find_by_id params[:id] + @status_message = current_user.find_visible_post_by_id params[:id] respond_with @status_message end diff --git a/lib/diaspora/user/querying.rb b/lib/diaspora/user/querying.rb index ad023f2fb..00ae27735 100644 --- a/lib/diaspora/user/querying.rb +++ b/lib/diaspora/user/querying.rb @@ -7,14 +7,9 @@ module Diaspora module UserModules module Querying - def visible_posts_from_others(opts ={}) - if opts[:from].class == Person - Post.where(:person_id => opts[:from].id, :_id.in => self.visible_post_ids) - elsif opts[:from].class == Aspect - Post.where(:_id.in => opts[:from].post_ids) unless opts[:from].user != self - else - Post.where(:_id.in => self.visible_post_ids) - end + + def find_visible_post_by_id( id ) + self.raw_visible_posts.find id end def visible_posts( opts = {} ) @@ -22,6 +17,8 @@ module Diaspora return raw_visible_posts if opts[:by_members_of] == :all aspect = self.aspects.find_by_id( opts[:by_members_of].id ) aspect.posts + elsif opts[:from] + self.raw_visible_posts.find_all_by_person_id(opts[:from].id, :order => 'created_at DESC') end end diff --git a/spec/models/user/visible_posts_spec.rb b/spec/models/user/visible_posts_spec.rb index ffb220531..5c44a2ce8 100644 --- a/spec/models/user/visible_posts_spec.rb +++ b/spec/models/user/visible_posts_spec.rb @@ -45,6 +45,19 @@ describe User do @user.visible_posts(:by_members_of => @aspect2).include?(status_message3).should be true end + describe 'querying' do + + it 'should find a visible post by id' do + status_message1 = @user.post :status_message, :message => "hi", :to => @aspect.id + status_message2 = @user2.post :status_message, :message => "heyyyy", :to => @user2_aspect.id + status_message3 = @user3.post :status_message, :message => "yooo", :to => @user3_aspect.id + + @user.find_visible_post_by_id(status_message1.id).should == status_message1 + @user2.find_visible_post_by_id(status_message1.id).should == nil + end + + end + describe 'albums' do before do @album = @user.post :album, :name => "Georges", :to => @aspect.id From 4fe4326ed1b7b8e58f340eadf316204d30122ec0 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Mon, 20 Sep 2010 15:00:02 -0700 Subject: [PATCH 119/449] DG IZ photo uploading now works --- app/controllers/photos_controller.rb | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/app/controllers/photos_controller.rb b/app/controllers/photos_controller.rb index 8fa7a3bdf..42b00007c 100644 --- a/app/controllers/photos_controller.rb +++ b/app/controllers/photos_controller.rb @@ -12,6 +12,7 @@ class PhotosController < ApplicationController def create album = Album.find_by_id params[:album_id] + puts params begin @@ -102,13 +103,18 @@ class PhotosController < ApplicationController private def clean_hash(params) - return { - :photo => { - :caption => params[:photo][:caption], - }, - :album_id => params[:album_id], - :user_file => params[:user_file] - } + if params[:photo] + return { + :photo => { + :caption => params[:photo][:caption], + } + } + else + return{ + :album_id => params[:album_id], + :user_file => params[:user_file] + } + end end end From 5e2fdedf8bb9ef0749dc79cda3ba558e55af5658 Mon Sep 17 00:00:00 2001 From: maxwell Date: Mon, 20 Sep 2010 15:07:30 -0700 Subject: [PATCH 120/449] MS removed another logging of encrypted data.... --- app/controllers/publics_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/publics_controller.rb b/app/controllers/publics_controller.rb index 6f2b09c43..72f8a0dfc 100644 --- a/app/controllers/publics_controller.rb +++ b/app/controllers/publics_controller.rb @@ -35,7 +35,7 @@ class PublicsController < ApplicationController begin @user = Person.first(:id => params[:id]).owner rescue NoMethodError => e - Rails.logger.error("Received post #{params[:xml]} for nonexistent person #{params[:id]}") + Rails.logger.error("Received post for nonexistent person #{params[:id]}") return end @user.receive_salmon params[:xml] From 5bb4ee5d3660977ac35e79ffa9aee4f45737c82c Mon Sep 17 00:00:00 2001 From: danielvincent Date: Mon, 20 Sep 2010 15:15:37 -0700 Subject: [PATCH 121/449] DG IZ; posting now ensures aspect ownership. --- app/models/user.rb | 3 +++ spec/models/user/posting_spec.rb | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/app/models/user.rb b/app/models/user.rb index f0481341a..e02c58534 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -105,7 +105,10 @@ class User end aspect_ids = [aspect_ids.to_s] if aspect_ids.is_a? BSON::ObjectId + raise ArgumentError.new("You must post to someone.") if aspect_ids.nil? || aspect_ids.empty? + aspect_ids.each{ |aspect_id| + raise ArgumentError.new("Cannot post to an aspect you do not own.") unless self.aspects.find(aspect_id) } post = build_post(class_name, options) diff --git a/spec/models/user/posting_spec.rb b/spec/models/user/posting_spec.rb index b1f6f71a8..d00747a2d 100644 --- a/spec/models/user/posting_spec.rb +++ b/spec/models/user/posting_spec.rb @@ -30,6 +30,10 @@ describe User do proc {@user.post(:status_message, :message => "heyheyhey")}.should raise_error /You must post to someone/ end + it 'should not be able to post to someone elses aspect' do + proc {@user.post(:status_message, :message => "heyheyhey", :to => @aspect2.id)}.should raise_error /Cannot post to an aspect you do not own./ + end + it 'should put the post in the aspect post array' do post = @user.post(:status_message, :message => "hey", :to => @aspect.id) @aspect.reload From fb2f027b24d64ffe38700d4f80ab19dd11fbfa15 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Mon, 20 Sep 2010 15:25:19 -0700 Subject: [PATCH 122/449] DG IZ; escape regex characters in Person.search --- app/models/person.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/person.rb b/app/models/person.rb index 72f4c46b9..74079ff93 100644 --- a/app/models/person.rb +++ b/app/models/person.rb @@ -35,7 +35,7 @@ class Person /^(https?):\/\/[a-z0-9]+([\-\.]{1}[a-z0-9]+)*(\.[a-z]{2,5})?(:[0-9]{1,5})?(\/.*)?$/ix def self.search(query) - query = query.to_s.strip + query = Regexp.escape( query.to_s.strip ) Person.all('profile.first_name' => /^#{query}/i) | Person.all('profile.last_name' => /^#{query}/i) end From cb0f0b72eb0e3fc0e65d234c6b0d20a2a76f06b7 Mon Sep 17 00:00:00 2001 From: maxwell Date: Mon, 20 Sep 2010 15:32:18 -0700 Subject: [PATCH 123/449] MS removed a log and trying to be slightly more pedantic --- app/controllers/publics_controller.rb | 4 +++- app/helpers/requests_helper.rb | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/controllers/publics_controller.rb b/app/controllers/publics_controller.rb index 72f8a0dfc..b6c03ff62 100644 --- a/app/controllers/publics_controller.rb +++ b/app/controllers/publics_controller.rb @@ -33,7 +33,9 @@ class PublicsController < ApplicationController render :nothing => true return unless params[:xml] begin - @user = Person.first(:id => params[:id]).owner + person = Person.first(:id => params[:id]) + puts person.real_name + @user = person.owner rescue NoMethodError => e Rails.logger.error("Received post for nonexistent person #{params[:id]}") return diff --git a/app/helpers/requests_helper.rb b/app/helpers/requests_helper.rb index 32ce79fd9..52955fc94 100644 --- a/app/helpers/requests_helper.rb +++ b/app/helpers/requests_helper.rb @@ -33,6 +33,7 @@ module RequestsHelper def relationship_flow(identifier) action = :none person = nil + puts identifier person = Person.by_webfinger identifier if person action = (person == current_user.person ? :none : :friend) From fc9cddc7b834228ddeac1f4106bb220e9d1c3582 Mon Sep 17 00:00:00 2001 From: maxwell Date: Mon, 20 Sep 2010 15:40:43 -0700 Subject: [PATCH 124/449] make the remote tom work --- db/seeds/tom.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/seeds/tom.rb b/db/seeds/tom.rb index 2e06913f2..61b2ad44f 100644 --- a/db/seeds/tom.rb +++ b/db/seeds/tom.rb @@ -7,7 +7,7 @@ require 'config/environment' remote_url = "http://tom.joindiaspora.com/" -remote_url = "http://localhost:3000/" +#remote_url = "http://localhost:3000/" # Create seed user user = User.instantiate!( :email => "tom@tom.joindiaspora.com", :username => "tom", From 40c96fc6194b265647d927a1e58e071ae79237f8 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Mon, 20 Sep 2010 15:53:56 -0700 Subject: [PATCH 125/449] DG IZ; click to edit rollover text on aspect manage page --- app/views/aspects/manage.html.haml | 6 ++++-- app/views/shared/_sub_header.haml | 2 +- public/stylesheets/application.css | 10 ++++++++++ public/stylesheets/sass/application.sass | 13 +++++++++++++ 4 files changed, 28 insertions(+), 3 deletions(-) diff --git a/app/views/aspects/manage.html.haml b/app/views/aspects/manage.html.haml index c579671e1..656f0cb96 100644 --- a/app/views/aspects/manage.html.haml +++ b/app/views/aspects/manage.html.haml @@ -38,7 +38,9 @@ %li.aspect .aspect_name - %h1{:contenteditable => true}= aspect.name + %span.edit_name_field + %h1{:contenteditable => true}= aspect.name + %span.tip click to edit %ul.tools %li= link_to "add a new friend", "#add_request_pane_#{aspect.id}", :class => 'add_request_button' @@ -56,7 +58,7 @@ %li.person{:id => person.id, :from_aspect_id => aspect.id} = person_image_tag(person) .name - = person.real_name + = link_to person.real_name, person .yo{:style => 'display:none'} %div{:id => "add_request_pane_#{aspect.id}"} = render "requests/new_request", :aspect => aspect diff --git a/app/views/shared/_sub_header.haml b/app/views/shared/_sub_header.haml index badf8783d..4e0e2aca4 100644 --- a/app/views/shared/_sub_header.haml +++ b/app/views/shared/_sub_header.haml @@ -9,7 +9,7 @@ - if @aspect == :all = link_to "All Aspects", root_path - elsif @aspect == :manage - = link_to "Manage Aspects", root_path + = "Manage Aspects" - else = link_to @aspect.name, @aspect diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index 98893cabb..60b50a9f4 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -520,6 +520,16 @@ h1.big_text { .requests h1, .remove h1 { display: inline-block; } + .aspect .tip, + .requests .tip, + .remove .tip { + display: none; + color: #999999; + margin-left: 0.5em; } + .aspect .edit_name_field:hover .tip, + .requests .edit_name_field:hover .tip, + .remove .edit_name_field:hover .tip { + display: inline; } .aspect .aspect_name, .requests .aspect_name, .remove .aspect_name { diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass index 5edc89135..80debac15 100644 --- a/public/stylesheets/sass/application.sass +++ b/public/stylesheets/sass/application.sass @@ -694,6 +694,19 @@ h1.big_text h1 :display inline-block + .tip + :display none + :color #999 + :margin + :left 0.5em + + .edit_name_field:hover + .tip + :display inline + + + + .aspect_name :position relative From 9f63dd9b69229a5c08b1b10e7a489c21d22ebbef Mon Sep 17 00:00:00 2001 From: maxwell Date: Mon, 20 Sep 2010 15:55:11 -0700 Subject: [PATCH 126/449] MS added another message in the readme about not using mod_rails, as mod_rails does not work with EventMachine --- README.md | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 0bc06f27f..9bff999fb 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,10 @@ The privacy aware, personally controlled, do-it-all, open source social network. Also, we really want to continue to focus on features and improving the code base. When we think it is ready for general use, we will post more detailed instructions. +## Notice +We currently run Diaspora with the [thin](http://code.macournoyer.com/thin/) as our webserver, behind [nginx](http://wiki.nginx.org/Main). Diaspora uses the asynchronous feature of [EventMachine](http://rubyeventmachine.com/) +Because our websocket server and message queue both work using the power of the [Reactor](http://en.wikipedia.org/wiki/Reactor_pattern) pattern. If you use mod_rails, mongrel, or another non-eventmachine based application server, federation and/or websockets may not work. +We will try and fully support more webservers later, but that is what works for now. These instructions are for machines running [Ubuntu](http://www.ubuntu.com/), [Fedora](http://www.fedoraproject.org) or Mac OS X. We are developing Diaspora for the latest and greatest browsers, so please update your Firefox, Chrome or Safari to the latest and greatest. @@ -235,14 +239,3 @@ Ongoing discussion: More general info and updates about the project can be found on our [blog](http://joindiaspora.com), [and on Twitter](http://twitter.com/joindiaspora). Also, be sure to join the official [mailing list](http://http://eepurl.com/Vebk). If you wish to contact us privately about any exploits in Diaspora you may find, you can email [exploits@joindiaspora.com](mailto:exploits@joindiaspora.com). - - -## License -Copyright 2010 Diaspora Inc. - -Diaspora is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - -Diaspora is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License along with Diaspora. If not, see . - From 788ed3aac25aff4af417a0122ac9361a6f2a92f7 Mon Sep 17 00:00:00 2001 From: maxwell Date: Mon, 20 Sep 2010 15:58:09 -0700 Subject: [PATCH 127/449] small typo in readme --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9bff999fb..2c75561c1 100644 --- a/README.md +++ b/README.md @@ -18,8 +18,10 @@ Also, we really want to continue to focus on features and improving the code bas ready for general use, we will post more detailed instructions. ## Notice -We currently run Diaspora with the [thin](http://code.macournoyer.com/thin/) as our webserver, behind [nginx](http://wiki.nginx.org/Main). Diaspora uses the asynchronous feature of [EventMachine](http://rubyeventmachine.com/) -Because our websocket server and message queue both work using the power of the [Reactor](http://en.wikipedia.org/wiki/Reactor_pattern) pattern. If you use mod_rails, mongrel, or another non-eventmachine based application server, federation and/or websockets may not work. +We currently run Diaspora with the [thin](http://code.macournoyer.com/thin/) as our webserver, behind [nginx](http://wiki.nginx.org/Main). Diaspora uses the asynchronous feature of [EventMachine](http://rubyeventmachine.com/) to send messages between seeds. +using the power of the [Reactor](http://en.wikipedia.org/wiki/Reactor_pattern) pattern. If you use mod_rails, mongrel, or another non-eventmachine based application server, federation and/or websockets may not work. + +If you don't like thin, you can always try [Rainbows!](http://rainbows.rubyforge.org/) We will try and fully support more webservers later, but that is what works for now. From 2b31c09ab387911f7297852e694cb2f837aa99c6 Mon Sep 17 00:00:00 2001 From: maxwell Date: Mon, 20 Sep 2010 15:58:09 -0700 Subject: [PATCH 128/449] small typo in readme --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9bff999fb..d7960a634 100644 --- a/README.md +++ b/README.md @@ -18,8 +18,10 @@ Also, we really want to continue to focus on features and improving the code bas ready for general use, we will post more detailed instructions. ## Notice -We currently run Diaspora with the [thin](http://code.macournoyer.com/thin/) as our webserver, behind [nginx](http://wiki.nginx.org/Main). Diaspora uses the asynchronous feature of [EventMachine](http://rubyeventmachine.com/) -Because our websocket server and message queue both work using the power of the [Reactor](http://en.wikipedia.org/wiki/Reactor_pattern) pattern. If you use mod_rails, mongrel, or another non-eventmachine based application server, federation and/or websockets may not work. +We currently run Diaspora with the [thin](http://code.macournoyer.com/thin/) as our webserver, behind [nginx](http://wiki.nginx.org/Main). Diaspora uses the asynchronous feature of [EventMachine](http://rubyeventmachine.com/) to send messages between seeds, +using the power of the [Reactor](http://en.wikipedia.org/wiki/Reactor_pattern) pattern. If you use mod_rails, mongrel, or another non-eventmachine based application server, federation and/or websockets may not work. + +If you don't like thin, you can always try [Rainbows!](http://rainbows.rubyforge.org/) We will try and fully support more webservers later, but that is what works for now. From 0bbbded89537c4478c45581e9960f4582cd1d162 Mon Sep 17 00:00:00 2001 From: Raphael Date: Mon, 20 Sep 2010 16:02:10 -0700 Subject: [PATCH 129/449] or any later version of the AGPL --- COPYRIGHT | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/COPYRIGHT b/COPYRIGHT index af330bbc2..8a380cc7e 100644 --- a/COPYRIGHT +++ b/COPYRIGHT @@ -1,4 +1,4 @@ -Diaspora is copyright Diaspora Inc., 2010, and files herein are licensed under the Affero General Public License version 3, the text of which can be found in GNU-AGPL-3.0, unless otherwise noted. Components of Diaspora, including Rails, JQuery, and Devise, are licensed under the MIT/X11 license. Blueprint-CSS is licensed under a modified version of the MIT/X11 license. All unmodified files from these and other sources retain their original copyright and license notices: see the relevant individual files. Attribution information for Diaspora is contained in the AUTHORS file. +Diaspora is copyright Diaspora Inc., 2010, and files herein are licensed under the Affero General Public License version 3, the text of which can be found in GNU-AGPL-3.0, or any later version of the AGPL, unless otherwise noted. Components of Diaspora, including Rails, JQuery, and Devise, are licensed under the MIT/X11 license. Blueprint-CSS is licensed under a modified version of the MIT/X11 license. All unmodified files from these and other sources retain their original copyright and license notices: see the relevant individual files. Attribution information for Diaspora is contained in the AUTHORS file. * In addition, as a special exception, the copyright holders give * permission to link the code of portions of this program with the @@ -11,4 +11,4 @@ Diaspora is copyright Diaspora Inc., 2010, and files herein are licensed under t * version of the file(s), but you are not obligated to do so. If you * do not wish to do so, delete this exception statement from your * version. If you delete this exception statement from all source -* files in the program, then also delete it here. \ No newline at end of file +* files in the program, then also delete it here. From 8dd11c0c95eaf2a0da1f183db78658f24070f500 Mon Sep 17 00:00:00 2001 From: Raphael Date: Mon, 20 Sep 2010 16:41:03 -0700 Subject: [PATCH 130/449] Add a couple specs to friending --- lib/diaspora/user/friending.rb | 3 ++- spec/models/user/user_friending_spec.rb | 31 +++++++++++++++++++------ 2 files changed, 26 insertions(+), 8 deletions(-) diff --git a/lib/diaspora/user/friending.rb b/lib/diaspora/user/friending.rb index e79608381..a4dcdd38d 100644 --- a/lib/diaspora/user/friending.rb +++ b/lib/diaspora/user/friending.rb @@ -86,7 +86,8 @@ module Diaspora def remove_friend(bad_friend) raise "Friend not deleted" unless self.friend_ids.delete( bad_friend.id ) - aspects.each{|g| g.person_ids.delete( bad_friend.id )} + aspects.each{|aspect| + aspect.person_ids.delete( bad_friend.id )} self.save self.raw_visible_posts.find_all_by_person_id( bad_friend.id ).each{|post| diff --git a/spec/models/user/user_friending_spec.rb b/spec/models/user/user_friending_spec.rb index bef8fa416..67ed9f799 100644 --- a/spec/models/user/user_friending_spec.rb +++ b/spec/models/user/user_friending_spec.rb @@ -189,16 +189,14 @@ describe User do @user2 = Factory.create :user @aspect2 = @user2.aspect(:name => "Gross people") - request = @user.send_friend_request_to( @user2, @aspect) - request.reverse_for @user2 - @user2.activate_friend(@user.person, @aspect2) - @user.receive request.to_diaspora_xml + friend_users(@user, @aspect, @user2, @aspect2) + @user.reload + @user2.reload + @aspect.reload + @aspect2.reload end it 'should unfriend the other user on the same seed' do - @user.reload - @user2.reload - @user.friends.count.should == 1 @user2.friends.count.should == 1 @@ -212,6 +210,25 @@ describe User do @aspect.people.count.should == 0 @aspect2.people.count.should == 0 end + context 'with a post' do + before do + @message = @user.post(:status_message, :message => "hi", :to => @aspect.id) + @user2.receive @message.to_diaspora_xml.to_s + @user2.unfriend @user.person + @user.unfriended_by @user2.person + @aspect.reload + @aspect2.reload + @user.reload + @user2.reload + end + it "deletes the unfriended user's posts from visible_posts" do + @user.raw_visible_posts.include?(@message.id).should be_false + end + it "deletes the unfriended user's posts from the aspect's posts" do + pending "We need to implement this" + @aspect2.posts.include?(@message).should be_false + end + end end From e2fc48c9ff8ec83eebbf9a6258d1082eec83c516 Mon Sep 17 00:00:00 2001 From: maxwell Date: Mon, 20 Sep 2010 16:44:35 -0700 Subject: [PATCH 131/449] MS being slightly more proper with application helper, and fixing the person search page --- app/helpers/application_helper.rb | 4 ++-- app/views/people/_person.html.haml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 75a13dc6b..65f1c8679 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -43,11 +43,11 @@ module ApplicationHelper end def owner_image_tag - person_image_tag(current_user) + person_image_tag(current_user.person) end def owner_image_link - person_image_link(current_user) + person_image_link(current_user.person) end def person_image_tag(person) diff --git a/app/views/people/_person.html.haml b/app/views/people/_person.html.haml index 646d0b333..e0c77d990 100644 --- a/app/views/people/_person.html.haml +++ b/app/views/people/_person.html.haml @@ -8,7 +8,7 @@ .content %span.from - = link_to person.real_name, person + = link_to person.real_name, person_path(person) .info = person.diaspora_handle From 2be0cca2cd3f99c53c0220ef6082b6cc00ad5632 Mon Sep 17 00:00:00 2001 From: maxwell Date: Mon, 20 Sep 2010 16:51:02 -0700 Subject: [PATCH 132/449] MS adding downcase to webfinger lookup --- app/models/person.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/person.rb b/app/models/person.rb index 74079ff93..970a90a0b 100644 --- a/app/models/person.rb +++ b/app/models/person.rb @@ -78,7 +78,7 @@ class Person def self.by_webfinger( identifier, opts = {}) #need to check if this is a valid email structure, maybe should do in JS - local_person = Person.first(:diaspora_handle => identifier.gsub('acct:', '')) + local_person = Person.first(:diaspora_handle => identifier.gsub('acct:', '').to_s.downcase) if local_person Rails.logger.info("Do not need to webfinger, found a local person #{local_person.real_name}") From 24ca139241e70444e696ed2cdb2f135083896499 Mon Sep 17 00:00:00 2001 From: maxwell Date: Mon, 20 Sep 2010 17:11:07 -0700 Subject: [PATCH 133/449] MS remove some stray puts --- app/controllers/publics_controller.rb | 2 -- app/views/people/show.html.haml | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/app/controllers/publics_controller.rb b/app/controllers/publics_controller.rb index b6c03ff62..d7f4825de 100644 --- a/app/controllers/publics_controller.rb +++ b/app/controllers/publics_controller.rb @@ -10,7 +10,6 @@ class PublicsController < ApplicationController def hcard @person = Person.find_by_id params[:id] - puts @person unless @person.nil? || @person.owner.nil? render 'hcard' end @@ -34,7 +33,6 @@ class PublicsController < ApplicationController return unless params[:xml] begin person = Person.first(:id => params[:id]) - puts person.real_name @user = person.owner rescue NoMethodError => e Rails.logger.error("Received post for nonexistent person #{params[:id]}") diff --git a/app/views/people/show.html.haml b/app/views/people/show.html.haml index 4f76f18cf..0939bd376 100644 --- a/app/views/people/show.html.haml +++ b/app/views/people/show.html.haml @@ -4,7 +4,7 @@ - content_for :page_title do - = @person.real_name + profile - content_for :left_pane do #profile From e588d7ab6af5755cd91f9702a1b0513e5b9b7fca Mon Sep 17 00:00:00 2001 From: danielvincent Date: Mon, 20 Sep 2010 17:26:20 -0700 Subject: [PATCH 134/449] DG IZ moving friends is now ajaxy --- app/controllers/aspects_controller.rb | 6 ++-- app/views/aspects/manage.html.haml | 4 --- app/views/shared/_aspect_nav.haml | 2 +- config/routes.rb | 5 +-- lib/diaspora/user/querying.rb | 3 +- public/javascripts/aspect-edit.js | 51 ++++++++------------------- 6 files changed, 22 insertions(+), 49 deletions(-) diff --git a/app/controllers/aspects_controller.rb b/app/controllers/aspects_controller.rb index 520485d33..779ce0f6f 100644 --- a/app/controllers/aspects_controller.rb +++ b/app/controllers/aspects_controller.rb @@ -79,10 +79,10 @@ class AspectsController < ApplicationController end if aspect = current_user.aspect_by_id(params[:to][:to]) flash[:notice] = "You are now showing your friend a different aspect of yourself." - respond_with aspect + render :nothing => true else - flash[:notice] = "You are now showing your friend a different aspect of yourself." - respond_with current_user.visible_person_by_id(params[:friend_id]) + flash[:error] = "Invalid aspect id!" + render aspects_manage_path end end diff --git a/app/views/aspects/manage.html.haml b/app/views/aspects/manage.html.haml index 656f0cb96..3903039ea 100644 --- a/app/views/aspects/manage.html.haml +++ b/app/views/aspects/manage.html.haml @@ -63,8 +63,4 @@ %div{:id => "add_request_pane_#{aspect.id}"} = render "requests/new_request", :aspect => aspect -%p - %br - = link_to 'Update Aspects', '#', :class => 'button', :id => "move_friends_link" - #content_bottom diff --git a/app/views/shared/_aspect_nav.haml b/app/views/shared/_aspect_nav.haml index ed3fe6f8f..dbca3bbef 100644 --- a/app/views/shared/_aspect_nav.haml +++ b/app/views/shared/_aspect_nav.haml @@ -6,7 +6,7 @@ #aspect_nav %ul - for aspect in @aspects - %li{:id => aspect.id, :class => ("selected" if current_aspect?(aspect))} + %li{:class => ("selected" if current_aspect?(aspect))} = link_for_aspect aspect %ul{ :style => "position:absolute;right:0;bottom:0.01em;"} diff --git a/config/routes.rb b/config/routes.rb index 188c4b137..ae757499c 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -13,10 +13,11 @@ Diaspora::Application.routes.draw do resources :photos, :except => [:index] resources :albums - match 'aspects/manage', :to => 'aspects#manage' - resources :aspects, :except => [:edit] match 'aspects/move_friends', :to => 'aspects#move_friends', :as => 'move_friends' match 'aspects/move_friend', :to => 'aspects#move_friend', :as => 'move_friend' + match 'aspects/manage', :to => 'aspects#manage' + resources :aspects, :except => [:edit] + match 'warzombie', :to => "dev_utilities#warzombie" match 'zombiefriends', :to => "dev_utilities#zombiefriends" diff --git a/lib/diaspora/user/querying.rb b/lib/diaspora/user/querying.rb index 00ae27735..1079949b0 100644 --- a/lib/diaspora/user/querying.rb +++ b/lib/diaspora/user/querying.rb @@ -31,8 +31,7 @@ module Diaspora end def aspect_by_id( id ) - id = id.to_id - aspects.detect{|x| x.id == id } + self.aspects.find( id ) end def album_by_id( id ) diff --git a/public/javascripts/aspect-edit.js b/public/javascripts/aspect-edit.js index e07877cb7..39eee791a 100644 --- a/public/javascripts/aspect-edit.js +++ b/public/javascripts/aspect-edit.js @@ -20,28 +20,6 @@ function decrementRequestsCounter() { } $(function() { - - - $('#move_friends_link').live( 'click', function(){ - $.post( - '/aspects/move_friends', - { 'moves' : $('#aspect_list').data() }, - function() { - $('#aspect_title').html("Groups edited successfully!"); - } - ); - - // should the following logic be moved into the $.post() callback? - $("#aspect_list").removeData(); - - $(".person") - .css('background-color','none') - .attr('from_aspect_id', function() { - return $(this).parent().attr('id') - }); - - }); - // Multiple classes here won't work $("ul .person").draggable({ revert: true @@ -65,24 +43,23 @@ $(function() { } }); - } else { - var $aspect_list = $('#aspect_list'), - move = {}; - - // This is poor implementation - move[ 'friend_id' ] = ui.draggable[0].id; // ui.draggable.attr('id') - move[ 'to' ] = $(this)[0].id;// $(this).attr('id'); - move[ 'from' ] = ui.draggable[0].getAttribute('from_aspect_id'); // ui.draggable.attr('from_aspect_id') - - // if created custom attr's - should be using `data-foo` - - - if (move['to'] == move['from']){ - $aspect_list.data( ui.draggable[0].id, []); + }; + var dropzone = $(this)[0]; + + if ($(this)[0].id == ui.draggable[0].getAttribute('from_aspect_id')){ ui.draggable.css('background-color','#eee'); } else { - $aspect_list.data( ui.draggable[0].id, move); ui.draggable.css('background-color','orange'); + $.ajax({ + url: "/aspects/move_friend/", + data: {"friend_id" : ui.draggable[0].id, + "from" : ui.draggable[0].getAttribute('from_aspect_id'), + "to" : { "to" : dropzone.id }}, + success: function(data){ + ui.draggable.attr('from_aspect_id', dropzone.id); + ui.draggable.css('background','none'); + }}); + } } $(this).closest("ul").append(ui.draggable); From 441f75203a49ea2e1b0bcecc9294617e855c6dc4 Mon Sep 17 00:00:00 2001 From: Raphael Date: Mon, 20 Sep 2010 17:33:05 -0700 Subject: [PATCH 135/449] Add autolink and sanitize to show page --- app/views/status_messages/show.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/status_messages/show.html.haml b/app/views/status_messages/show.html.haml index 358c2244b..26777408d 100644 --- a/app/views/status_messages/show.html.haml +++ b/app/views/status_messages/show.html.haml @@ -7,7 +7,7 @@ %p %strong Message: - = @status_message.message + = auto_link sanitize @status_message.message %p %strong Owner: From ca97d792af238b59b885c4e7f61345469ff8d945 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Mon, 20 Sep 2010 18:08:59 -0700 Subject: [PATCH 136/449] DG IZ; fixing querying bug in aspect_by_id --- lib/diaspora/user/querying.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/diaspora/user/querying.rb b/lib/diaspora/user/querying.rb index 1079949b0..00ae27735 100644 --- a/lib/diaspora/user/querying.rb +++ b/lib/diaspora/user/querying.rb @@ -31,7 +31,8 @@ module Diaspora end def aspect_by_id( id ) - self.aspects.find( id ) + id = id.to_id + aspects.detect{|x| x.id == id } end def album_by_id( id ) From f50b70da9e2ed919c0202b2e5c6737a079276a73 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Mon, 20 Sep 2010 18:14:12 -0700 Subject: [PATCH 137/449] DG IZ; removed stray mustache --- public/javascripts/aspect-edit.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/public/javascripts/aspect-edit.js b/public/javascripts/aspect-edit.js index 39eee791a..9f9e5803e 100644 --- a/public/javascripts/aspect-edit.js +++ b/public/javascripts/aspect-edit.js @@ -47,7 +47,7 @@ $(function() { var dropzone = $(this)[0]; if ($(this)[0].id == ui.draggable[0].getAttribute('from_aspect_id')){ - ui.draggable.css('background-color','#eee'); + ui.draggable.css('background','none'); } else { ui.draggable.css('background-color','orange'); $.ajax({ @@ -61,7 +61,6 @@ $(function() { }}); } - } $(this).closest("ul").append(ui.draggable); } }); From 2d7b72e51878cdfc9a126d1b4cb397bfa1c963a9 Mon Sep 17 00:00:00 2001 From: Pistos Date: Mon, 20 Sep 2010 21:18:37 -0400 Subject: [PATCH 138/449] Added a newline after headings where it was missing. --- README.md | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 0ae9faff1..3eade7240 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,8 @@ ## Commit Guidlines + You are welcome to contribute, add and extend Diaspora however you see fit. We will do our best to incorporate everything that meets our guidelines. -We need you to fill out a [contributor agreement form](https://spreadsheets.google.com/a/joindiaspora.com/viewform?formkey=dGI2cHA3ZnNHLTJvbm10LUhXRTJjR0E6MQ&theme=0AX42CRMsmRFbUy1iOGYwN2U2Mi1hNWU0LTRlNjEtYWMyOC1lZmU4ODg1ODc1ODI&ifq) before we can accept your patches. The agreement gives Diaspora joint ownership of the patch so the copyright isn't scattered. You can find it [here](https://spreadsheets.google.com/a/joindiaspora.com/viewform?formkey=dGI2cHA3ZnNHLTJvbm10LUhXRTJjR0E6MQ&theme=0AX42CRMsmRFbUy1iOGYwN2U2Mi1hNWU0LTRlNjEtYWMyOC1lZmU4ODg1ODc1ODI&ifq). +We need you to fill out a [contributor agreement form](https://spreadsheets.google.com/a/joindiaspora.com/viewform?formkey=dGI2cHA3ZnNHLTJvbm10LUhXRTJjR0E6MQ&theme=0AX42CRMsmRFbUy1iOGYwN2U2Mi1hNWU0LTRlNjEtYWMyOC1lZmU4ODg1ODc1ODI&ifq) before we can accept your patches. The agreement gives Diaspora joint ownership of the patch so the copyright isn't scattered. You can find it [here](https://spreadsheets.google.com/a/joindiaspora.com/viewform?formkey=dGI2cHA3ZnNHLTJvbm10LUhXRTJjR0E6MQ&theme=0AX42CRMsmRFbUy1iOGYwN2U2Mi1hNWU0LTRlNjEtYWMyOC1lZmU4ODg1ODc1ODI&ifq). All commits must be tested, and after each commit, all tests should be green before a pull request is sent. Please write your tests in Rspec. @@ -14,7 +15,7 @@ The privacy aware, personally controlled, do-it-all, open source social network. **DISCLAIMER: THIS IS PRE-ALPHA SOFTWARE AND SHOULD BE TREATED ACCORDINGLY.** **PLEASE, DO NOT RUN IN PRODUCTION. IT IS FUN TO GET RUNNING, BUT EXPECT THINGS TO BE BROKEN** -Also, we really want to continue to focus on features and improving the code base. When we think it is +Also, we really want to continue to focus on features and improving the code base. When we think it is ready for general use, we will post more detailed instructions. ## Notice @@ -30,6 +31,7 @@ We will try and fully support more webservers later, but that is what works for These instructions are for machines running [Ubuntu](http://www.ubuntu.com/), [Fedora](http://www.fedoraproject.org) or Mac OS X. We are developing Diaspora for the latest and greatest browsers, so please update your Firefox, Chrome or Safari to the latest and greatest. ## Preparing your system + In order to run Diaspora, you will need to download the following dependencies (specific instructions follow): - Build Tools - Packages needed to compile the components that follow. @@ -64,7 +66,7 @@ To install Ruby 1.8.7 on **Ubuntu**, run the following command: sudo apt-get install ruby-full -Please note that you need to have Universe enabled in your /etc/apt/sources.list file to install ruby using apt-get. +Please note that you need to have Universe enabled in your /etc/apt/sources.list file to install ruby using apt-get. At this time Fedora does not have Ruby 1.8.7. As a workaround it is possible to use [rvm](http://rvm.beginrescueend.com/) with a locally compiled Ruby installation. A semi automated method for doing this is available. It is highly recommended that you review the script before running it so you understand what will occur. The script can be executed by running the following command: @@ -90,11 +92,11 @@ Then run: You can also run the binary directly by doing the following: -If you're running a 32-bit system, run: +If you're running a 32-bit system, run: wget http://fastdl.mongodb.org/linux/mongodb-linux-i686-1.6.2.tgz - -If you're running a 64-bit system, run: + +If you're running a 64-bit system, run: wget http://fastdl.mongodb.org/linux/mongodb-linux-x86_64-1.6.2.tgz @@ -202,9 +204,11 @@ If you have never used github before, their [help desk](http://help.github.com/) ## Running Diaspora ### Install required gems + To start the app server for the first time, you need to use Bundler to install Diaspora's gem depencencies. Run `bundle install` from Diaspora's root directory. Bundler will also warn you if there is a new dependency and you need to bundle install again. ### Start Mongo + If you installed the Ubuntu package, MongoDB should already be running (if not, run `service mongodb start`). If you installed the binary manually, run `sudo mongod` from where mongo is installed to start mongo. If you installed the Fedora package, MongoDB will need to be started via `service mongodb start`. If you installed the binary manually, run `sudo mongod` from where Mongo is installed to start Mongo. @@ -214,19 +218,24 @@ If you installed the OsX package through "brew", MongoDB will need to be started Diaspora will not run unless Mongo is running. Mongo will not run by default, and will need to be started every time you wish to use or run the test suite for Diaspora. ### Run the server + `./script/server` will start both thin and the websocket server. If you want to run a different app server, you will have to run them separately. See below for instructions. ### Run the app server + Once mongo is running and bundler has finished, run `bundle exec thin start` from the root Diaspora directory. This will start the app server in development mode[.](http://bit.ly/9mwtUw) ### Run the websocket server + run `bundle exec ruby ./script/websocket_server` to start the websocket server on port 8080. Change the port in config/app_config.yml. ### Logging in with a sample user + Run `rake db:seed:tom`, then login with user `tom` and password `evankorth`. More details in db/seeds/tom.rb. ### Testing + Diaspora's test suite uses [rspec](http://rspec.info/), a behavior driven testing framework. In order to run the tests, run `bundle exec rspec spec`. ## Resources From fa1e09cadbfb5a1b505398e299e7777d40bf3ff2 Mon Sep 17 00:00:00 2001 From: Pistos Date: Mon, 20 Sep 2010 21:23:20 -0400 Subject: [PATCH 139/449] Hard-wrapped README text to confirm to an 80-character screen width. --- README.md | 185 +++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 133 insertions(+), 52 deletions(-) diff --git a/README.md b/README.md index 3eade7240..e7c118631 100644 --- a/README.md +++ b/README.md @@ -1,56 +1,87 @@ ## Commit Guidlines -You are welcome to contribute, add and extend Diaspora however you see fit. We will do our best to incorporate everything that meets our guidelines. +You are welcome to contribute, add and extend Diaspora however you see fit. We +will do our best to incorporate everything that meets our guidelines. -We need you to fill out a [contributor agreement form](https://spreadsheets.google.com/a/joindiaspora.com/viewform?formkey=dGI2cHA3ZnNHLTJvbm10LUhXRTJjR0E6MQ&theme=0AX42CRMsmRFbUy1iOGYwN2U2Mi1hNWU0LTRlNjEtYWMyOC1lZmU4ODg1ODc1ODI&ifq) before we can accept your patches. The agreement gives Diaspora joint ownership of the patch so the copyright isn't scattered. You can find it [here](https://spreadsheets.google.com/a/joindiaspora.com/viewform?formkey=dGI2cHA3ZnNHLTJvbm10LUhXRTJjR0E6MQ&theme=0AX42CRMsmRFbUy1iOGYwN2U2Mi1hNWU0LTRlNjEtYWMyOC1lZmU4ODg1ODc1ODI&ifq). +We need you to fill out a +[contributor agreement form](https://spreadsheets.google.com/a/joindiaspora.com/viewform?formkey=dGI2cHA3ZnNHLTJvbm10LUhXRTJjR0E6MQ&theme=0AX42CRMsmRFbUy1iOGYwN2U2Mi1hNWU0LTRlNjEtYWMyOC1lZmU4ODg1ODc1ODI&ifq) +before we can accept your patches. The agreement gives Diaspora joint +ownership of the patch so the copyright isn't scattered. You can find it +[here](https://spreadsheets.google.com/a/joindiaspora.com/viewform?formkey=dGI2cHA3ZnNHLTJvbm10LUhXRTJjR0E6MQ&theme=0AX42CRMsmRFbUy1iOGYwN2U2Mi1hNWU0LTRlNjEtYWMyOC1lZmU4ODg1ODc1ODI&ifq). -All commits must be tested, and after each commit, all tests should be green before a pull request is sent. Please write your tests in Rspec. +All commits must be tested, and after each commit, all tests should be green +before a pull request is sent. Please write your tests in Rspec. -GEMS: We would like to keep external dependencies unduplicated. We're using Nokogiri, Mongomapper, and EM::HttpRequest as much as possible. We have a few gems in the project we'd rather not use, but if you can, use dependencies we already have. +GEMS: We would like to keep external dependencies unduplicated. We're using +Nokogiri, Mongomapper, and EM::HttpRequest as much as possible. We have a few +gems in the project we'd rather not use, but if you can, use dependencies we +already have. # Diaspora -The privacy aware, personally controlled, do-it-all, open source social network. +The privacy aware, personally controlled, do-it-all, open source social +network. **DISCLAIMER: THIS IS PRE-ALPHA SOFTWARE AND SHOULD BE TREATED ACCORDINGLY.** -**PLEASE, DO NOT RUN IN PRODUCTION. IT IS FUN TO GET RUNNING, BUT EXPECT THINGS TO BE BROKEN** +**PLEASE, DO NOT RUN IN PRODUCTION. IT IS FUN TO GET RUNNING, BUT EXPECT THINGS +TO BE BROKEN** -Also, we really want to continue to focus on features and improving the code base. When we think it is -ready for general use, we will post more detailed instructions. +Also, we really want to continue to focus on features and improving the code +base. When we think it is ready for general use, we will post more detailed +instructions. ## Notice -We currently run Diaspora with the [thin](http://code.macournoyer.com/thin/) as our webserver, behind [nginx](http://wiki.nginx.org/Main). Diaspora uses the asynchronous feature of [EventMachine](http://rubyeventmachine.com/) to send messages between seeds, +We currently run Diaspora with the [thin](http://code.macournoyer.com/thin/) as +our webserver, behind [nginx](http://wiki.nginx.org/Main). Diaspora uses the +asynchronous feature of [EventMachine](http://rubyeventmachine.com/) to send +messages between seeds, using the power of the +[Reactor](http://en.wikipedia.org/wiki/Reactor_pattern) pattern. If you use +mod_rails, mongrel, or another non-eventmachine based application server, +federation and/or websockets may not work. -using the power of the [Reactor](http://en.wikipedia.org/wiki/Reactor_pattern) pattern. If you use mod_rails, mongrel, or another non-eventmachine based application server, federation and/or websockets may not work. +If you don't like thin, you can always try +[Rainbows!](http://rainbows.rubyforge.org/) We will try and fully support more +webservers later, but that is what works for now. -If you don't like thin, you can always try [Rainbows!](http://rainbows.rubyforge.org/) -We will try and fully support more webservers later, but that is what works for now. - - -These instructions are for machines running [Ubuntu](http://www.ubuntu.com/), [Fedora](http://www.fedoraproject.org) or Mac OS X. We are developing Diaspora for the latest and greatest browsers, so please update your Firefox, Chrome or Safari to the latest and greatest. +These instructions are for machines running [Ubuntu](http://www.ubuntu.com/), +[Fedora](http://www.fedoraproject.org) or Mac OS X. We are developing Diaspora +for the latest and greatest browsers, so please update your Firefox, Chrome or +Safari to the latest and greatest. ## Preparing your system -In order to run Diaspora, you will need to download the following dependencies (specific instructions follow): +In order to run Diaspora, you will need to download the following dependencies +(specific instructions follow): - Build Tools - Packages needed to compile the components that follow. -- [Ruby](http://www.ruby-lang.org) - The Ruby programming language. (We're using **1.8.7**. It comes preinstalled on Mac OS X.) +- [Ruby](http://www.ruby-lang.org) - The Ruby programming language. + (We're using **1.8.7**. It comes preinstalled on Mac OS X.) - [MongoDB](http://www.mongodb.org) - A snappy noSQL database. -- [OpenSSL](http://www.openssl.org/) - An encryption library. (It comes preinstalled on Mac OS X and Ubuntu.) -- [ImageMagick](http://www.imagemagick.org/) - An Image processing library used to resize uploaded photos. +- [OpenSSL](http://www.openssl.org/) - An encryption library. + (It comes preinstalled on Mac OS X and Ubuntu.) +- [ImageMagick](http://www.imagemagick.org/) - An Image processing library used + to resize uploaded photos. - [Git](http://git-scm.com/) - The fast version control system. -After you have Ruby installed on your system, you will need to get RubyGems, then install Bundler: +After you have Ruby installed on your system, you will need to get RubyGems, +then install Bundler: - [RubyGems](http://rubygems.org/) - Source for Ruby gems. - [Bundler](http://gembundler.com/) - Gem management tool for Ruby projects. -**We suggest using a package management system to download these dependencies. Trust us, it's going to make your life a lot easier. If you're using Mac OS X, you can use [homebrew](http://mxcl.github.com/homebrew/); if you're using Ubuntu, just use [Synaptic](http://www.nongnu.org/synaptic/) (it comes pre-installed); if you're using Fedora simply use [yum](http://yum.baseurl.org/). The instructions below assume you have these installed.** +**We suggest using a package management system to download these dependencies. +Trust us, it's going to make your life a lot easier. If you're using Mac OS X, +you can use [homebrew](http://mxcl.github.com/homebrew/); if you're using +Ubuntu, just use [Synaptic](http://www.nongnu.org/synaptic/) (it comes +pre-installed); if you're using Fedora simply use +[yum](http://yum.baseurl.org/). The instructions below assume you have these +installed.** ### Build Tools -To install build tools on **Ubuntu**, run the following (includes the gcc and xml parsing dependencies): +To install build tools on **Ubuntu**, run the following (includes the gcc and +xml parsing dependencies): sudo apt-get install build-essential libxslt1.1 libxslt1-dev libxml2 @@ -58,7 +89,8 @@ To install build tools on **Fedora**, run the following: sudo yum install libxslt libxslt-devel libxml2 libxml2-devel -To install build tools on **Mac OS X**, you need to download and install [Xcode](http://developer.apple.com/technologies/tools/xcode.html). +To install build tools on **Mac OS X**, you need to download and install +[Xcode](http://developer.apple.com/technologies/tools/xcode.html). ### Ruby @@ -66,22 +98,30 @@ To install Ruby 1.8.7 on **Ubuntu**, run the following command: sudo apt-get install ruby-full -Please note that you need to have Universe enabled in your /etc/apt/sources.list file to install ruby using apt-get. +Please note that you need to have Universe enabled in your +/etc/apt/sources.list file to install ruby using apt-get. -At this time Fedora does not have Ruby 1.8.7. As a workaround it is possible to use [rvm](http://rvm.beginrescueend.com/) with a locally compiled Ruby installation. A semi automated method for doing this is available. It is highly recommended that you review the script before running it so you understand what will occur. The script can be executed by running the following command: +At this time Fedora does not have Ruby 1.8.7. As a workaround it is possible to +use [rvm](http://rvm.beginrescueend.com/) with a locally compiled Ruby +installation. A semi automated method for doing this is available. It is +highly recommended that you review the script before running it so you +understand what will occur. The script can be executed by running the +following command: ./script/bootstrap-fedora-diaspora.sh -After reviewing and executing the above script you will need to follow the "MongoDB" section and then you should skip all the way down to "Start Mongo". - +After reviewing and executing the above script you will need to follow the +"MongoDB" section and then you should skip all the way down to "Start Mongo". If you're on **Mac OS X**, you already have Ruby on your system. Yay! ### MongoDB -To install MongoDB on **Ubuntu**, add the official MongoDB repository [here](http://www.mongodb.org/display/DOCS/Ubuntu+and+Debian+packages). +To install MongoDB on **Ubuntu**, add the official MongoDB repository +[here](http://www.mongodb.org/display/DOCS/Ubuntu+and+Debian+packages). -For Lucid, add the following line to your /etc/apt/sources.list (for other distros, see http://www.mongodb.org/display/DOCS/Ubuntu+and+Debian+packages): +For Lucid, add the following line to your /etc/apt/sources.list (for other +distros, see http://www.mongodb.org/display/DOCS/Ubuntu+and+Debian+packages): deb http://downloads.mongodb.org/distros/ubuntu 10.4 10gen @@ -109,7 +149,10 @@ Then run: sudo chmod -Rv 777 /data/ -To install MongoDB on a x86_64 **Fedora** system, add the official MongoDB repository from MongoDB (http://www.mongodb.org/display/DOCS/CentOS+and+Fedora+Packages) into /etc/yum.repos.d/10gen.repo: +To install MongoDB on a x86_64 **Fedora** system, add the official MongoDB +repository from MongoDB +(http://www.mongodb.org/display/DOCS/CentOS+and+Fedora+Packages) into +/etc/yum.repos.d/10gen.repo: [10gen] name=10gen Repository @@ -117,13 +160,14 @@ To install MongoDB on a x86_64 **Fedora** system, add the official MongoDB repos gpgcheck=0 enabled=1 - Then use yum to install the packages: sudo yum install mongo-stable mongo-stable-server - -If you're running a 32-bit system, run `wget http://fastdl.mongodb.org/linux/mongodb-linux-i686-1.6.2.tgz`. If you're running a 64-bit system, run `wget http://fastdl.mongodb.org/linux/mongodb-linux-x86_64-1.6.2.tgz`. +If you're running a 32-bit system, run `wget +http://fastdl.mongodb.org/linux/mongodb-linux-i686-1.6.2.tgz`. If you're +running a 64-bit system, run `wget +http://fastdl.mongodb.org/linux/mongodb-linux-x86_64-1.6.2.tgz`. # extract tar xzf mongodb-linux-i686-1.4.0.tgz @@ -131,7 +175,6 @@ If you're running a 32-bit system, run `wget http://fastdl.mongodb.org/linux/mon sudo mkdir -p /data/db sudo chmod -Rv 777 /data/ - To install MongoDB on **Mac OS X**, run the following: brew install mongo @@ -140,7 +183,8 @@ To install MongoDB on **Mac OS X**, run the following: ### OpenSSL -If you're running either **Ubuntu**, **Fedora** or **Mac OS X** you already have OpenSSL installed! +If you're running either **Ubuntu**, **Fedora** or **Mac OS X** you already +have OpenSSL installed! ### ImageMagick @@ -180,67 +224,99 @@ On **Ubuntu** 10.04, run the following: sudo apt-get update sudo apt-get install rubygems -This PPA is maintained by an Ubuntu Developer. For Ubuntu 10.10, this version of rubygems is in the repositories. +This PPA is maintained by an Ubuntu Developer. For Ubuntu 10.10, this version +of rubygems is in the repositories. On **Fedora**, run the following: sudo yum install rubygems -On **Mac OS X**, RubyGems comes preinstalled; however, you might need to update it for use with the latest Bundler. To update RubyGems, run `sudo gem update --system`. +On **Mac OS X**, RubyGems comes preinstalled; however, you might need to update +it for use with the latest Bundler. To update RubyGems, run `sudo gem update +--system`. ### Bundler -After RubyGems is updated, simply run `sudo gem install bundler` to get Bundler. If you're using Ubuntu repository .debs, bundler is found at /var/lib/gems/1.8/bin/bundle +After RubyGems is updated, simply run `sudo gem install bundler` to get +Bundler. If you're using Ubuntu repository .debs, bundler is found at +/var/lib/gems/1.8/bin/bundle ## Getting Diaspora git clone http://github.com/diaspora/diaspora.git -If you have never used github before, their [help desk](http://help.github.com/) has a pretty awesome guide on getting setup. +If you have never used github before, their +[help desk](http://help.github.com/) has a pretty awesome guide on getting +setup. ## Running Diaspora ### Install required gems -To start the app server for the first time, you need to use Bundler to install Diaspora's gem depencencies. Run `bundle install` from Diaspora's root directory. Bundler will also warn you if there is a new dependency and you need to bundle install again. +To start the app server for the first time, you need to use Bundler to install +Diaspora's gem depencencies. Run `bundle install` from Diaspora's root +directory. Bundler will also warn you if there is a new dependency and you +need to bundle install again. ### Start Mongo -If you installed the Ubuntu package, MongoDB should already be running (if not, run `service mongodb start`). If you installed the binary manually, run `sudo mongod` from where mongo is installed to start mongo. +If you installed the Ubuntu package, MongoDB should already be running (if not, +run `service mongodb start`). If you installed the binary manually, run `sudo +mongod` from where mongo is installed to start mongo. -If you installed the Fedora package, MongoDB will need to be started via `service mongodb start`. If you installed the binary manually, run `sudo mongod` from where Mongo is installed to start Mongo. +If you installed the Fedora package, MongoDB will need to be started via +`service mongodb start`. If you installed the binary manually, run `sudo +mongod` from where Mongo is installed to start Mongo. -If you installed the OsX package through "brew", MongoDB will need to be started via `sudo launchctl load /Library/LaunchDaemons/org.mongodb.mongod.plist`. (before you have to go to /Library/LaunchDaemons and add a symlink to /usr/local/Cellar/mongodb/1.6.2-x86_64/org.mongodb.mongod.plist) +If you installed the OsX package through "brew", MongoDB will need to be +started via `sudo launchctl load +/Library/LaunchDaemons/org.mongodb.mongod.plist`. (before you have to go to +/Library/LaunchDaemons and add a symlink to +/usr/local/Cellar/mongodb/1.6.2-x86_64/org.mongodb.mongod.plist) -Diaspora will not run unless Mongo is running. Mongo will not run by default, and will need to be started every time you wish to use or run the test suite for Diaspora. +Diaspora will not run unless Mongo is running. Mongo will not run by default, +and will need to be started every time you wish to use or run the test suite +for Diaspora. ### Run the server -`./script/server` will start both thin and the websocket server. If you want to run a different app server, you will have to run them separately. See below for instructions. +`./script/server` will start both thin and the websocket server. If you want +to run a different app server, you will have to run them separately. See below +for instructions. ### Run the app server -Once mongo is running and bundler has finished, run `bundle exec thin start` from the root Diaspora directory. This will start the app server in development mode[.](http://bit.ly/9mwtUw) +Once mongo is running and bundler has finished, run `bundle exec thin start` +from the root Diaspora directory. This will start the app server in +development mode[.](http://bit.ly/9mwtUw) ### Run the websocket server -run `bundle exec ruby ./script/websocket_server` to start the websocket server on port 8080. Change the port in config/app_config.yml. +run `bundle exec ruby ./script/websocket_server` to start the websocket server +on port 8080. Change the port in config/app_config.yml. ### Logging in with a sample user -Run `rake db:seed:tom`, then login with user `tom` and password `evankorth`. More details in db/seeds/tom.rb. +Run `rake db:seed:tom`, then login with user `tom` and password `evankorth`. +More details in db/seeds/tom.rb. ### Testing -Diaspora's test suite uses [rspec](http://rspec.info/), a behavior driven testing framework. In order to run the tests, run `bundle exec rspec spec`. +Diaspora's test suite uses [rspec](http://rspec.info/), a behavior driven +testing framework. In order to run the tests, run `bundle exec rspec spec`. ## Resources -We are maintaining a [public tracker project](http://www.pivotaltracker.com/projects/61641) and a [roadmap](https://github.com/diaspora/diaspora/wiki/Roadmap). Also, you can file [bug reports](https://github.com/diaspora/diaspora/issues) right here on github. +We are maintaining a +[public tracker project](http://www.pivotaltracker.com/projects/61641) +and a +[roadmap](https://github.com/diaspora/diaspora/wiki/Roadmap). Also, you can +file [bug reports](https://github.com/diaspora/diaspora/issues) right here on +github. Ongoing discussion: - [Diaspora Developer Google Group](http://groups.google.com/group/diaspora-dev) @@ -249,6 +325,11 @@ Ongoing discussion: - [#diaspora-dev IRC channel](irc://irc.freenode.net/#diaspora-dev) ([join via the web client](http://webchat.freenode.net?channels=diaspora-dev)) -More general info and updates about the project can be found on our [blog](http://joindiaspora.com), [and on Twitter](http://twitter.com/joindiaspora). Also, be sure to join the official [mailing list](http://http://eepurl.com/Vebk). +More general info and updates about the project can be found on our +[blog](http://joindiaspora.com), +[and on Twitter](http://twitter.com/joindiaspora). Also, be sure to join the +official [mailing list](http://http://eepurl.com/Vebk). -If you wish to contact us privately about any exploits in Diaspora you may find, you can email [exploits@joindiaspora.com](mailto:exploits@joindiaspora.com). +If you wish to contact us privately about any exploits in Diaspora you may +find, you can email +[exploits@joindiaspora.com](mailto:exploits@joindiaspora.com). From bdd752f07b43dd316b9c87d7d454538ebe69ea00 Mon Sep 17 00:00:00 2001 From: Thomas Krehbiel Date: Mon, 20 Sep 2010 21:49:14 -0400 Subject: [PATCH 140/449] Fix for 'Local variable hides method' --- app/models/person.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/person.rb b/app/models/person.rb index 72f4c46b9..8a6b85175 100644 --- a/app/models/person.rb +++ b/app/models/person.rb @@ -104,8 +104,8 @@ class Person return nil unless public_key_entry - public_key = public_key_entry.first.href - new_person.exported_key = Base64.decode64 public_key + pubkey = public_key_entry.first.href + new_person.exported_key = Base64.decode64 pubkey guid = profile.links.select{|x| x.rel == 'http://joindiaspora.com/guid'}.first.href new_person.id = guid From 4d200fea87719398f16c29d16684533e8aba954b Mon Sep 17 00:00:00 2001 From: danielvincent Date: Mon, 20 Sep 2010 20:17:18 -0700 Subject: [PATCH 141/449] removed view all link from status_message#show --- app/views/status_messages/show.html.haml | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/app/views/status_messages/show.html.haml b/app/views/status_messages/show.html.haml index 26777408d..251c92a0e 100644 --- a/app/views/status_messages/show.html.haml +++ b/app/views/status_messages/show.html.haml @@ -3,20 +3,14 @@ -# the COPYRIGHT file. -- title "Status Message" - -%p - %strong Message: +%h1 + = link_to @status_message.person.real_name, @status_message.person = auto_link sanitize @status_message.message -%p - %strong Owner: - = @status_message.person.real_name %h4= "comments (#{@status_message.comments.count})" = render "comments/comments", :post => @status_message %p - = link_to "Destroy", @status_message, :confirm => 'Are you sure?', :method => :delete - | - = link_to "View All", status_messages_path + - if current_user.owns? @status_message + = link_to "Destroy", @status_message, :confirm => 'Are you sure?', :method => :delete From b019ade588948065fe958a9caa9dddf0c05c0c03 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Mon, 20 Sep 2010 21:50:06 -0700 Subject: [PATCH 142/449] minor changes from production --- public/stylesheets/application.css | 14 +++++++++++--- public/stylesheets/fileuploader.css | 8 ++++---- public/stylesheets/sass/application.sass | 16 ++++++++++++---- 3 files changed, 27 insertions(+), 11 deletions(-) diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index 60b50a9f4..9e8561cc2 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -346,12 +346,18 @@ label { margin-top: 26px; } #publisher textarea { width: 600px; - height: 40px; + height: 42px; margin-top: 0; margin-bottom: 0; - -webkit-box-shadow: 0 1px 0 white; } + box-shadow: 0 1px white; + -moz-box-shadow: 0 1px white; + -webkit-box-shadow: 0 1px white; } #publisher .button { margin-left: 100px; } + #publisher img { + -webkit-box-shadow: 0 1px 0 white; + border: 1px solid #bbbbbb; + border-top: 1px solid #666666; } #image_picker .small_photo { height: 100px; @@ -463,6 +469,7 @@ h1.big_text { display: inline; margin-right: 2px; } #aspect_nav ul > li a { + text-shadow: 0 2px 0 #444444; -webkit-border-radius: 3px 3px 0 0; -moz-border-radius: 3px 3px 0 0; line-height: 22px; @@ -557,7 +564,8 @@ h1.big_text { .requests .grey, .remove .grey { color: #999999; - cursor: default; } + cursor: default; + text-shadow: 0 2px white; } .aspect ul.dropzone, .requests ul.dropzone, .remove ul.dropzone { diff --git a/public/stylesheets/fileuploader.css b/public/stylesheets/fileuploader.css index 0e3f111a9..823c1b346 100755 --- a/public/stylesheets/fileuploader.css +++ b/public/stylesheets/fileuploader.css @@ -3,14 +3,14 @@ .qq-upload-button { display:block; /* or inline-block */ width: 105px; padding: 7px 0; text-align:center; - background:#880000; border-bottom:1px solid #ddd;color:#fff; + background:#333; border-bottom:1px solid #999;color:#fff; } -.qq-upload-button-hover {background:#cc0000;} +.qq-upload-button-hover {background:#666;} .qq-upload-button-focus {outline:1px dotted black;} .qq-upload-drop-area { position:absolute; top:0; left:0; width:100%; height:100%; min-height: 70px; z-index:2; - background:#FF9797; text-align:center; + background:#ccc; text-align:center; } .qq-upload-drop-area span { display:block; position:absolute; top: 50%; width:100%; margin-top:-8px; font-size:16px; @@ -28,4 +28,4 @@ .qq-upload-size,.qq-upload-cancel {font-size:11px;} .qq-upload-failed-text {display:none;} -.qq-upload-fail .qq-upload-failed-text {display:inline;} \ No newline at end of file +.qq-upload-fail .qq-upload-failed-text {display:inline;} diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass index 80debac15..88145b6df 100644 --- a/public/stylesheets/sass/application.sass +++ b/public/stylesheets/sass/application.sass @@ -453,16 +453,24 @@ label textarea :width 600px - :height 40px + :height 42px :margin :top 0 :bottom 0 - :-webkit-box-shadow 0 1px 0 #fff + :box-shadow 0 1px #fff + :-moz-box-shadow 0 1px #fff + :-webkit-box-shadow 0 1px #fff .button :margin-left 100px + img + :-webkit-box-shadow 0 1px 0 #fff + :border 1px solid #bbb + :top 1px solid #666 + + #image_picker .small_photo @@ -613,6 +621,7 @@ h1.big_text :right 2px a + :text-shadow 0 2px 0 #444 :-webkit-border-radius 3px 3px 0 0 :-moz-border-radius 3px 3px 0 0 :line @@ -705,8 +714,6 @@ h1.big_text :display inline - - .aspect_name :position relative @@ -731,6 +738,7 @@ h1.big_text .grey :color #999 :cursor default + :text-shadow 0 2px #fff ul.dropzone :min-height 20px From 50414fef40392605e50da4598c52cd638201db86 Mon Sep 17 00:00:00 2001 From: Raphael Date: Tue, 21 Sep 2010 11:03:21 -0700 Subject: [PATCH 143/449] Remove unused method from message handler --- lib/message_handler.rb | 6 +----- spec/lib/message_handler_spec.rb | 1 - 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/lib/message_handler.rb b/lib/message_handler.rb index 7149ee65e..0b55ee0f7 100644 --- a/lib/message_handler.rb +++ b/lib/message_handler.rb @@ -31,7 +31,7 @@ class MessageHandler http.callback { process; process} when :get http = EventMachine::HttpRequest.new(query.destination).get :timeout => TIMEOUT - http.callback {send_to_seed(query, http.response); process} + http.callback {process} else raise "message is not a type I know!" end @@ -47,10 +47,6 @@ class MessageHandler } unless @queue.size == 0 end - def send_to_seed(message, http_response) - #DO SOMETHING! - end - def size @queue.size end diff --git a/spec/lib/message_handler_spec.rb b/spec/lib/message_handler_spec.rb index 00db2a1b8..e6cd668e2 100644 --- a/spec/lib/message_handler_spec.rb +++ b/spec/lib/message_handler_spec.rb @@ -123,7 +123,6 @@ describe MessageHandler do request = FakeHttpRequest.new(:success) request.should_receive(:get).exactly(1).times.and_return(request) request.should_receive(:post).exactly(1).times.and_return(request) - @handler.should_receive(:send_to_seed).once EventMachine::HttpRequest.stub!(:new).and_return(request) From 003a8b454f446ae4cf6b16cb41bcf0ef8629fe93 Mon Sep 17 00:00:00 2001 From: Dorian Date: Mon, 20 Sep 2010 05:29:06 +0800 Subject: [PATCH 144/449] Some refactoring again (define code rules would be good) --- app/helpers/application_helper.rb | 2 -- app/helpers/dashboards_helper.rb | 3 +-- app/helpers/photos_helper.rb | 1 - app/helpers/publics_helper.rb | 1 - app/helpers/requests_helper.rb | 2 -- app/helpers/sockets_helper.rb | 3 --- 6 files changed, 1 insertion(+), 11 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 65f1c8679..2c110f422 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -4,7 +4,6 @@ module ApplicationHelper - def current_aspect?(aspect) !@aspect.is_a?(Symbol) && @aspect.id == aspect.id end @@ -68,5 +67,4 @@ module ApplicationHelper def post_yield_tag(post) (':' + post.id.to_s).to_sym end - end diff --git a/app/helpers/dashboards_helper.rb b/app/helpers/dashboards_helper.rb index 542d938ee..ee83d72eb 100644 --- a/app/helpers/dashboards_helper.rb +++ b/app/helpers/dashboards_helper.rb @@ -4,8 +4,7 @@ module DashboardsHelper - def title_for_page - 'home' + 'home' end end diff --git a/app/helpers/photos_helper.rb b/app/helpers/photos_helper.rb index 2d0ddad6e..2737d3a2d 100644 --- a/app/helpers/photos_helper.rb +++ b/app/helpers/photos_helper.rb @@ -4,7 +4,6 @@ module PhotosHelper - def linked_scaled_photo(photo, album) link_to (image_tag photo.url(:scaled_full)), photo_path(album.next_photo(photo)), :rel => "prefetch" end diff --git a/app/helpers/publics_helper.rb b/app/helpers/publics_helper.rb index 9e76f59f7..46e778e2b 100644 --- a/app/helpers/publics_helper.rb +++ b/app/helpers/publics_helper.rb @@ -9,7 +9,6 @@ module PublicsHelper subscriber ||= Subscriber.new(:url => opts[:callback], :topic => opts[:topic]) if subscriber.save - if opts[:verify] == 'sync' 204 elsif opts[:verify] == 'async' diff --git a/app/helpers/requests_helper.rb b/app/helpers/requests_helper.rb index 52955fc94..faefe1f6e 100644 --- a/app/helpers/requests_helper.rb +++ b/app/helpers/requests_helper.rb @@ -4,7 +4,6 @@ module RequestsHelper - def subscription_mode(profile) if diaspora?(profile) :friend @@ -40,5 +39,4 @@ module RequestsHelper end { action => person } end - end diff --git a/app/helpers/sockets_helper.rb b/app/helpers/sockets_helper.rb index cbe465e7b..69135092a 100644 --- a/app/helpers/sockets_helper.rb +++ b/app/helpers/sockets_helper.rb @@ -33,7 +33,4 @@ module SocketsHelper action_hash.to_json end - - - end From 1882509a0beea16031928c569890b73c2d98dafe Mon Sep 17 00:00:00 2001 From: ilya Date: Tue, 21 Sep 2010 11:59:04 -0700 Subject: [PATCH 145/449] removed the auto_link seems to fix HTML injection, no more autolinking --- app/views/comments/_comment.html.haml | 2 +- app/views/status_messages/_status_message.html.haml | 2 +- app/views/status_messages/show.html.haml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/views/comments/_comment.html.haml b/app/views/comments/_comment.html.haml index 4252d9762..4fd46eb56 100644 --- a/app/views/comments/_comment.html.haml +++ b/app/views/comments/_comment.html.haml @@ -7,6 +7,6 @@ = person_image_tag(post.person) %span.from = link_to post.person.real_name, post.person - = auto_link sanitize post.text + = post.text %div.time = "#{time_ago_in_words(post.updated_at)} #{t('.ago')}" diff --git a/app/views/status_messages/_status_message.html.haml b/app/views/status_messages/_status_message.html.haml index 396f143a7..dcee761d1 100644 --- a/app/views/status_messages/_status_message.html.haml +++ b/app/views/status_messages/_status_message.html.haml @@ -10,7 +10,7 @@ .content %span.from = link_to post.person.real_name, post.person - = auto_link sanitize post.message + = post.message .info %span.time= link_to(how_long_ago(post), object_path(post)) diff --git a/app/views/status_messages/show.html.haml b/app/views/status_messages/show.html.haml index 251c92a0e..4a701d6a6 100644 --- a/app/views/status_messages/show.html.haml +++ b/app/views/status_messages/show.html.haml @@ -5,7 +5,7 @@ %h1 = link_to @status_message.person.real_name, @status_message.person - = auto_link sanitize @status_message.message + = @status_message.message %h4= "comments (#{@status_message.comments.count})" From 9571ade89c652e4b5357d3a0ef01fb9a2ac7ac52 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Tue, 21 Sep 2010 12:29:39 -0700 Subject: [PATCH 146/449] basic setup --- Gemfile | 1 + Gemfile.lock | 4 ++++ app/controllers/services_controller.rb | 25 +++++++++++++++++++++ app/controllers/users_controller.rb | 3 +++ app/views/users/edit.html.haml | 8 +++++++ config/environment.rb | 9 +++++++- config/fb_config.yml | 4 ++++ config/routes.rb | 31 +++++++++++++------------- 8 files changed, 69 insertions(+), 16 deletions(-) create mode 100644 app/controllers/services_controller.rb create mode 100644 config/fb_config.yml diff --git a/Gemfile b/Gemfile index cc92bec3d..18cfef692 100644 --- a/Gemfile +++ b/Gemfile @@ -21,6 +21,7 @@ gem 'will_paginate', '3.0.pre2' gem 'roxml', :git => 'git://github.com/Empact/roxml.git' gem 'addressable', :require => 'addressable/uri' gem 'json' +gem 'mini_fb' #Standards gem 'pubsubhubbub' diff --git a/Gemfile.lock b/Gemfile.lock index dd181b320..68cf44272 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -142,6 +142,9 @@ GEM mime-types treetop (>= 1.4.5) mime-types (1.16) + mini_fb (1.1.3) + hashie + rest-client mini_magick (2.1) subexec (~> 0.0.4) mocha (0.9.8) @@ -252,6 +255,7 @@ DEPENDENCIES jnunemaker-validatable (= 1.8.4)! json magent! + mini_fb mini_magick mocha mongo_mapper (= 0.8.4)! diff --git a/app/controllers/services_controller.rb b/app/controllers/services_controller.rb new file mode 100644 index 000000000..567a1d144 --- /dev/null +++ b/app/controllers/services_controller.rb @@ -0,0 +1,25 @@ +# Copyright (c) 2010, Diaspora Inc. This file is +# licensed under the Affero General Public License version 3. See +# the COPYRIGHT file. + + +class ServicesController < ApplicationController + + def create + puts 'services/create' + p params + + code = params['code'] # Facebooks verification string + if code + access_token_hash = MiniFB.oauth_access_token(FB_APP_ID, HOST + "services/create", FB_SECRET, code) + p access_token_hash + @access_token = access_token_hash["access_token"] + + # TODO: This is where you'd want to store the token in your database + # but for now, we'll just keep it in the cookie so we don't need a database + cookies[:access_token] = @access_token + flash[:success] = "Authentication successful." + end + redirect_to edit_user_url current_user + end +end diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index dbb69d1a2..76ed944dd 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -13,6 +13,9 @@ class UsersController < ApplicationController @person = @user.person @profile = @user.profile @photos = Photo.find_all_by_person_id(@person.id).paginate :page => params[:page], :order => 'created_at DESC' + + @fb_access_url = MiniFB.oauth_url(FB_APP_ID, HOST + "services/create", + :scope=>MiniFB.scopes.join(",")) end def update diff --git a/app/views/users/edit.html.haml b/app/views/users/edit.html.haml index fd94b2a42..330ad7f48 100644 --- a/app/views/users/edit.html.haml +++ b/app/views/users/edit.html.haml @@ -53,6 +53,14 @@ = p.label :last_name = p.text_field :last_name, :value => @profile.last_name + %br + %br + + %h3 Connect with Facebook + + %p + = link_to "Login to Facebook", @fb_access_url + #submit_block = link_to "Cancel", root_path or diff --git a/config/environment.rb b/config/environment.rb index 385a96651..7bf59851a 100644 --- a/config/environment.rb +++ b/config/environment.rb @@ -8,7 +8,14 @@ require File.expand_path('../application', __FILE__) Haml::Template.options[:format] = :html5 Haml::Template.options[:escape_html] = true + +# Load facebook connection application credentials +fb_config = YAML::load(File.open(File.expand_path("./config/fb_config.yml"))) +FB_API_KEY = fb_config['fb_api_key'] +FB_SECRET = fb_config['fb_secret'] +FB_APP_ID = fb_config['fb_app_id'] +HOST = fb_config['host'] + # Initialize the rails application Diaspora::Application.initialize! - diff --git a/config/fb_config.yml b/config/fb_config.yml new file mode 100644 index 000000000..7b69791e5 --- /dev/null +++ b/config/fb_config.yml @@ -0,0 +1,4 @@ +fb_api_key: {dcf4e90df086cf6d3e531b31e043ff32} +fb_secret: {36917c2878d658b8c575952b6a78e3c3} +fb_app_id: {120373411325347} +host: http://localhost:3000/ diff --git a/config/routes.rb b/config/routes.rb index ae757499c..016a89bcb 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -5,32 +5,33 @@ Diaspora::Application.routes.draw do - resources :people, :only => [:index, :show, :destroy] - resources :users, :except => [:create, :new, :show] - resources :status_messages, :only => [:create, :destroy, :show] - resources :comments, :except => [:index] - resources :requests, :except => [:edit, :update] - resources :photos, :except => [:index] + resources :people, :only => [:index, :show, :destroy] + resources :users, :except => [:create, :new, :show] + resources :status_messages, :only => [:create, :destroy, :show] + resources :comments, :except => [:index] + resources :requests, :except => [:edit, :update] + resources :photos, :except => [:index] resources :albums match 'aspects/move_friends', :to => 'aspects#move_friends', :as => 'move_friends' - match 'aspects/move_friend', :to => 'aspects#move_friend', :as => 'move_friend' - match 'aspects/manage', :to => 'aspects#manage' - resources :aspects, :except => [:edit] + match 'aspects/move_friend', :to => 'aspects#move_friend', :as => 'move_friend' + match 'aspects/manage', :to => 'aspects#manage' + resources :aspects, :except => [:edit] + match 'services/create', :to => "services#create" - match 'warzombie', :to => "dev_utilities#warzombie" - match 'zombiefriends', :to => "dev_utilities#zombiefriends" - match 'zombiefriendaccept', :to => "dev_utilities#zombiefriendaccept" - match 'set_backer_number', :to => "dev_utilities#set_backer_number" - match 'set_profile_photo', :to => "dev_utilities#set_profile_photo" + match 'warzombie', :to => "dev_utilities#warzombie" + match 'zombiefriends', :to => "dev_utilities#zombiefriends" + match 'zombiefriendaccept', :to => "dev_utilities#zombiefriendaccept" + match 'set_backer_number', :to => "dev_utilities#set_backer_number" + match 'set_profile_photo', :to => "dev_utilities#set_profile_photo" #routes for devise, not really sure you will need to mess with this in the future, lets put default, #non mutable stuff in anohter file devise_for :users, :controllers => {:registrations => "registrations"} match 'login', :to => 'devise/sessions#new', :as => "new_user_session" match 'logout', :to => 'devise/sessions#destroy', :as => "destroy_user_session" - match 'signup', :to => 'registrations#new', :as => "new_user_registration" + match 'signup', :to => 'registrations#new', :as => "new_user_registration" match 'get_to_the_choppa', :to => redirect("/signup") #public routes From 4d00a0e99eef36f2aace91053f72fc006a007dfb Mon Sep 17 00:00:00 2001 From: ilya Date: Tue, 21 Sep 2010 12:35:48 -0700 Subject: [PATCH 147/449] IZ posting to all albums should now work, needed to check for all in user.post --- app/models/user.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/models/user.rb b/app/models/user.rb index e02c58534..e86a98cfb 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -96,6 +96,7 @@ class User ######## Posting ######## def post(class_name, options = {}) + puts options.inspect if class_name == :photo raise ArgumentError.new("No album_id given") unless options[:album_id] aspect_ids = aspects_with_post( options[:album_id] ) @@ -108,7 +109,7 @@ class User raise ArgumentError.new("You must post to someone.") if aspect_ids.nil? || aspect_ids.empty? aspect_ids.each{ |aspect_id| - raise ArgumentError.new("Cannot post to an aspect you do not own.") unless self.aspects.find(aspect_id) } + raise ArgumentError.new("Cannot post to an aspect you do not own.") unless aspect_id == "all" || self.aspects.find(aspect_id) } post = build_post(class_name, options) From 11d31901e4647f15e02af3fb4d9a5f76a369ac47 Mon Sep 17 00:00:00 2001 From: Raphael Date: Tue, 21 Sep 2010 13:59:52 -0700 Subject: [PATCH 148/449] IZ, RS, Pulled receiving out of user file, refactored receive method to be clearer --- app/models/user.rb | 75 +-------------------------- lib/diaspora/user/receiving.rb | 93 ++++++++++++++++++++++++++++++++++ 2 files changed, 95 insertions(+), 73 deletions(-) create mode 100644 lib/diaspora/user/receiving.rb diff --git a/app/models/user.rb b/app/models/user.rb index e02c58534..7c9bfdc1b 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -5,12 +5,14 @@ require 'lib/diaspora/user/friending.rb' require 'lib/diaspora/user/querying.rb' +require 'lib/diaspora/user/receiving.rb' require 'lib/salmon/salmon' class User include MongoMapper::Document include Diaspora::UserModules::Friending include Diaspora::UserModules::Querying + include Diaspora::UserModules::Receiving include Encryptor::Private QUEUE = MessageHandler.new @@ -220,79 +222,6 @@ class User end end - ###### Receiving ####### - def receive_salmon ciphertext - cleartext = decrypt( ciphertext) - salmon = Salmon::SalmonSlap.parse cleartext - if salmon.verified_for_key?(salmon.author.public_key) - Rails.logger.info("data in salmon: #{salmon.data}") - self.receive(salmon.data) - end - end - - def receive xml - object = Diaspora::Parser.from_xml(xml) - Rails.logger.debug("Receiving object for #{self.real_name}:\n#{object.inspect}") - Rails.logger.debug("From: #{object.person.inspect}") if object.person - - if object.is_a? Retraction - if object.type == 'Person' - - Rails.logger.info( "the person id is #{object.post_id} the friend found is #{visible_person_by_id(object.post_id).inspect}") - unfriended_by visible_person_by_id(object.post_id) -else - object.perform self.id - aspects = self.aspects_with_person(object.person) - aspects.each{ |aspect| aspect.post_ids.delete(object.post_id.to_id) - aspect.save - } - end - elsif object.is_a? Request - person = Diaspora::Parser.parse_or_find_person_from_xml( xml ) - person.serialized_key ||= object.exported_key - object.person = person - object.person.save - old_request = Request.first(:id => object.id) - object.aspect_id = old_request.aspect_id if old_request - object.save - receive_friend_request(object) - elsif object.is_a? Profile - person = Diaspora::Parser.owner_id_from_xml xml - person.profile = object - person.save - - elsif object.is_a?(Comment) - object.person = Diaspora::Parser.parse_or_find_person_from_xml( xml ).save if object.person.nil? - self.visible_people = self.visible_people | [object.person] - self.save - Rails.logger.debug("The person parsed from comment xml is #{object.person.inspect}") unless object.person.nil? - object.person.save - Rails.logger.debug("From: #{object.person.inspect}") if object.person - raise "In receive for #{self.real_name}, signature was not valid on: #{object.inspect}" unless object.post.person == self.person || object.verify_post_creator_signature - object.save - unless owns?(object) - dispatch_comment object - end - object.socket_to_uid(id) if (object.respond_to?(:socket_to_uid) && !self.owns?(object)) - else - Rails.logger.debug("Saving object: #{object}") - object.user_refs += 1 - object.save - - self.raw_visible_posts << object - self.save - - aspects = self.aspects_with_person(object.person) - aspects.each{ |aspect| - aspect.posts << object - aspect.save - object.socket_to_uid(id, :aspect_ids => [aspect.id]) if (object.respond_to?(:socket_to_uid) && !self.owns?(object)) - } - - end - - end - ###Helpers############ def self.instantiate!( opts = {} ) hostname = opts[:url].gsub(/(https?:|www\.)\/\//, '') diff --git a/lib/diaspora/user/receiving.rb b/lib/diaspora/user/receiving.rb new file mode 100644 index 000000000..39b1af5d2 --- /dev/null +++ b/lib/diaspora/user/receiving.rb @@ -0,0 +1,93 @@ +module Diaspora + module UserModules + module Receiving + def receive_salmon ciphertext + cleartext = decrypt( ciphertext) + salmon = Salmon::SalmonSlap.parse cleartext + if salmon.verified_for_key?(salmon.author.public_key) + Rails.logger.info("data in salmon: #{salmon.data}") + self.receive(salmon.data) + end + end + + def receive xml + object = Diaspora::Parser.from_xml(xml) + Rails.logger.debug("Receiving object for #{self.real_name}:\n#{object.inspect}") + Rails.logger.debug("From: #{object.person.inspect}") if object.person + + if object.is_a? Retraction + receive_retraction object, xml + elsif object.is_a? Request + receive_request object, xml + elsif object.is_a? Profile + receive_profile object, xml + elsif object.is_a?(Comment) + receive_comment object, xml + else + receive_post object, xml + end + end + + def receive_retraction retraction, xml + if retraction.type == 'Person' + Rails.logger.info( "the person id is #{retraction.post_id} the friend found is #{visible_person_by_id(retraction.post_id).inspect}") + unfriended_by visible_person_by_id(retraction.post_id) + else + retraction.perform self.id + aspects = self.aspects_with_person(retraction.person) + aspects.each{ |aspect| aspect.post_ids.delete(retraction.post_id.to_id) + aspect.save + } + end + end + + def receive_request request, xml + person = Diaspora::Parser.parse_or_find_person_from_xml( xml ) + person.serialized_key ||= request.exported_key + request.person = person + request.person.save + old_request = Request.first(:id => request.id) + request.aspect_id = old_request.aspect_id if old_request + request.save + receive_friend_request(request) + end + + def receive_profile profile, xml + person = Diaspora::Parser.owner_id_from_xml xml + person.profile = profile + person.save + end + + def receive_comment comment, xml + comment.person = Diaspora::Parser.parse_or_find_person_from_xml( xml ).save if comment.person.nil? + self.visible_people = self.visible_people | [comment.person] + self.save + Rails.logger.debug("The person parsed from comment xml is #{comment.person.inspect}") unless comment.person.nil? + comment.person.save + Rails.logger.debug("From: #{comment.person.inspect}") if comment.person + raise "In receive for #{self.real_name}, signature was not valid on: #{comment.inspect}" unless comment.post.person == self.person || comment.verify_post_creator_signature + comment.save + unless owns?(comment) + dispatch_comment comment + end + comment.socket_to_uid(id) if (comment.respond_to?(:socket_to_uid) && !self.owns?(comment)) + end + + def receive_post post, xml + Rails.logger.debug("Saving post: #{post}") + post.user_refs += 1 + post.save + + self.raw_visible_posts << post + self.save + + aspects = self.aspects_with_person(post.person) + aspects.each{ |aspect| + aspect.posts << post + aspect.save + post.socket_to_uid(id, :aspect_ids => [aspect.id]) if (post.respond_to?(:socket_to_uid) && !self.owns?(post)) + } + end + end + end +end From 4e951d8abf8b773e548d4a77d3d857184c04e580 Mon Sep 17 00:00:00 2001 From: Raphael Date: Tue, 21 Sep 2010 14:08:18 -0700 Subject: [PATCH 149/449] Fixing COPYRIGHT file --- COPYRIGHT | 35 ++++++++++++++++++++++------------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/COPYRIGHT b/COPYRIGHT index 8a380cc7e..f1bed1a6b 100644 --- a/COPYRIGHT +++ b/COPYRIGHT @@ -1,14 +1,23 @@ -Diaspora is copyright Diaspora Inc., 2010, and files herein are licensed under the Affero General Public License version 3, the text of which can be found in GNU-AGPL-3.0, or any later version of the AGPL, unless otherwise noted. Components of Diaspora, including Rails, JQuery, and Devise, are licensed under the MIT/X11 license. Blueprint-CSS is licensed under a modified version of the MIT/X11 license. All unmodified files from these and other sources retain their original copyright and license notices: see the relevant individual files. Attribution information for Diaspora is contained in the AUTHORS file. +Diaspora is copyright Diaspora Inc., 2010, and files herein are licensed +under the Affero General Public License version 3, the text of which can +be found in GNU-AGPL-3.0, or any later version of the AGPL, unless otherwise +noted. Components of Diaspora, including Rails, JQuery, and Devise, are +licensed under the MIT/X11 license. Blueprint-CSS is licensed under a +modified version of the MIT/X11 license. All unmodified files from these +and other sources retain their original copyright and license notices: see +the relevant individual files. Attribution information for Diaspora is +contained in the AUTHORS file. -* In addition, as a special exception, the copyright holders give -* permission to link the code of portions of this program with the -* OpenSSL library under certain conditions as described in each -* individual source file, and distribute linked combinations -* including the two. -* You must obey the GNU General Public License in all respects -* for all of the code used other than OpenSSL. If you modify -* file(s) with this exception, you may extend this exception to your -* version of the file(s), but you are not obligated to do so. If you -* do not wish to do so, delete this exception statement from your -* version. If you delete this exception statement from all source -* files in the program, then also delete it here. +In addition, as a special exception, the copyright holders give +permission to link the code of portions of this program with the +OpenSSL library under certain conditions as described in each +individual source file, and distribute linked combinations +including the two. + +You must obey the GNU Affero General Public License V3 or later in all respects +for all of the code used other than OpenSSL or the components mentioned +above. If you modify file(s) with this exception, you may extend this +exception to your version of the file(s), but you are not obligated to +do so. If you do not wish to do so, delete this exception statement from your +version. If you delete this exception statement from all source files in the +program, then also delete it here. From 9db4fea9ac4d2d14a7a24314b8e517c6861ac09c Mon Sep 17 00:00:00 2001 From: Raphael Sofaer Date: Tue, 21 Sep 2010 14:44:36 -0700 Subject: [PATCH 150/449] Correct mailing list link --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0ae9faff1..6e9c40aa0 100644 --- a/README.md +++ b/README.md @@ -240,6 +240,6 @@ Ongoing discussion: - [#diaspora-dev IRC channel](irc://irc.freenode.net/#diaspora-dev) ([join via the web client](http://webchat.freenode.net?channels=diaspora-dev)) -More general info and updates about the project can be found on our [blog](http://joindiaspora.com), [and on Twitter](http://twitter.com/joindiaspora). Also, be sure to join the official [mailing list](http://http://eepurl.com/Vebk). +More general info and updates about the project can be found on our [blog](http://joindiaspora.com), [and on Twitter](http://twitter.com/joindiaspora). Also, be sure to join the official [mailing list](http://eepurl.com/Vebk). If you wish to contact us privately about any exploits in Diaspora you may find, you can email [exploits@joindiaspora.com](mailto:exploits@joindiaspora.com). From 44db21ffd4fc27656da7ef68e8344eb194ac5311 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Tue, 21 Sep 2010 15:12:47 -0700 Subject: [PATCH 151/449] DG MS; cleaned up spec --- app/models/user.rb | 1 - spec/models/user/posting_spec.rb | 101 ++++++++++++++++--------------- spec/models/user_spec.rb | 9 +-- 3 files changed, 53 insertions(+), 58 deletions(-) diff --git a/app/models/user.rb b/app/models/user.rb index 86b818bb0..4e2e642e3 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -98,7 +98,6 @@ class User ######## Posting ######## def post(class_name, options = {}) - puts options.inspect if class_name == :photo raise ArgumentError.new("No album_id given") unless options[:album_id] aspect_ids = aspects_with_post( options[:album_id] ) diff --git a/spec/models/user/posting_spec.rb b/spec/models/user/posting_spec.rb index d00747a2d..1f24f3fed 100644 --- a/spec/models/user/posting_spec.rb +++ b/spec/models/user/posting_spec.rb @@ -7,65 +7,68 @@ require File.dirname(__FILE__) + '/../../spec_helper' describe User do - before do - @user = Factory.create :user - @aspect = @user.aspect(:name => 'heroes') - @aspect1 = @user.aspect(:name => 'heroes') - @user2 = Factory.create(:user) - @aspect2 = @user2.aspect(:name => 'losers') + let(:user) { Factory(:user) } + let(:user2) { Factory(:user) } + let(:user3) { Factory(:user) } + let(:user4) { Factory(:user) } - @user3 = Factory.create(:user) - @aspect3 = @user3.aspect(:name => 'heroes') + let(:aspect) {user.aspect(:name => 'heroes')} + let!(:aspect1) {user.aspect(:name => 'heroes')} + let!(:aspect2) {user2.aspect(:name => 'losers')} + let!(:aspect3) {user3.aspect(:name => 'heroes')} + let!(:aspect4) {user4.aspect(:name => 'heroes')} - @user4 = Factory.create(:user) - @aspect4 = @user4.aspect(:name => 'heroes') - - friend_users(@user, @aspect, @user2, @aspect2) - friend_users(@user, @aspect, @user3, @aspect3) - friend_users(@user, @aspect1, @user4, @aspect4) - end - - it 'should not be able to post without a aspect' do - proc {@user.post(:status_message, :message => "heyheyhey")}.should raise_error /You must post to someone/ + before do + friend_users(user, aspect, user2, aspect2) + friend_users(user, aspect, user3, aspect3) + friend_users(user, aspect1, user4, aspect4) end - it 'should not be able to post to someone elses aspect' do - proc {@user.post(:status_message, :message => "heyheyhey", :to => @aspect2.id)}.should raise_error /Cannot post to an aspect you do not own./ - end - - it 'should put the post in the aspect post array' do - post = @user.post(:status_message, :message => "hey", :to => @aspect.id) - @aspect.reload - @aspect.post_ids.include?(post.id).should be true + context 'posting' do + describe '#post' do + it 'should not be able to post without a aspect' do + proc {user.post(:status_message, :message => "heyheyhey")}.should raise_error /You must post to someone/ + end + + it 'should not be able to post to someone elses aspect' do + proc {user.post(:status_message, :message => "heyheyhey", :to => aspect2.id)}.should raise_error /Cannot post to an aspect you do not own./ + end + + it 'should put the post in the aspect post array' do + post = user.post(:status_message, :message => "hey", :to => aspect.id) + aspect.reload + aspect.posts.should include post + end + + it 'should put an album in the aspect post array' do + album = user.post :album, :name => "Georges", :to => aspect.id + aspect.reload + aspect.posts.should include album + end + end end - it 'should put an album in the aspect post array' do - album = @user.post :album, :name => "Georges", :to => @aspect.id - @aspect.reload - @aspect.post_ids.include?(album.id).should be true - @aspect.posts.include?(album).should be true - end + context 'dispatching' do + let!(:post) { user.build_post :status_message, :message => "hey" } - describe 'dispatching' do - before do - @post = @user.build_post :status_message, :message => "hey" - end - it 'should push a post to a aspect' do - @user.should_receive(:salmon).twice - @user.push_to_aspects(@post, @aspect.id) + describe '#push_to_aspects' do + it 'should push a post to a aspect' do + user.should_receive(:salmon).twice + user.push_to_aspects(post, aspect.id) + end + + it 'should push a post to all aspects' do + user.should_receive(:salmon).exactly(3).times + user.push_to_aspects(post, :all) + end end - it 'should push a post to all aspects' do - @user.should_receive(:salmon).exactly(3).times - @user.push_to_aspects(@post, :all) + describe '#push_to_people' do + it 'should push to people' do + user.should_receive(:salmon).twice + user.push_to_people(post, [user2.person, user3.person]) + end end - - it 'should push to people' do - @user.should_receive(:salmon).twice - @user.push_to_people(@post, [@user2.person, @user3.person]) - end - - end end diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index 223881671..ef9a08cc5 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -12,14 +12,6 @@ describe User do @aspect = @user.aspect(:name => 'heroes') end - it 'should create with pivotal or allowed emails' do - user1 = Factory.create(:user, :email => "kimfuh@yahoo.com") - user2 = Factory.create(:user, :email => "awesome@sofaer.net") - user3 = Factory.create(:user, :email => "steveellis@pivotallabs.com") - user1.created_at.nil?.should be false - user2.created_at.nil?.should be false - user3.created_at.nil?.should be false - end describe 'profiles' do it 'should be able to update their profile and send it to their friends' do @@ -58,4 +50,5 @@ describe User do @user.aspects.include?(@aspect).should == true end end + end From efd901dcd9c71cd9e671973b8bd3d0ea834ff338 Mon Sep 17 00:00:00 2001 From: ilya Date: Tue, 21 Sep 2010 15:46:57 -0700 Subject: [PATCH 152/449] RS, IZ; Pod url moved to app_config.yml, app_config.yml refactored, diaspora_handle now set based on APP_CONFIG --- app/controllers/photos_controller.rb | 3 --- app/helpers/requests_helper.rb | 1 - app/models/user.rb | 10 ++-------- config/app_config.yml | 20 +++++--------------- config/initializers/_load_app_config.rb | 10 ++++++++-- spec/factories.rb | 5 ++++- spec/models/person_spec.rb | 16 ++++++++++++++-- spec/models/user_spec.rb | 20 +++++++++++++------- 8 files changed, 46 insertions(+), 39 deletions(-) diff --git a/app/controllers/photos_controller.rb b/app/controllers/photos_controller.rb index 42b00007c..afc193413 100644 --- a/app/controllers/photos_controller.rb +++ b/app/controllers/photos_controller.rb @@ -10,10 +10,7 @@ class PhotosController < ApplicationController respond_to :json, :only => :show def create - album = Album.find_by_id params[:album_id] - puts params - begin ######################## dealing with local files ############# diff --git a/app/helpers/requests_helper.rb b/app/helpers/requests_helper.rb index faefe1f6e..fec093aac 100644 --- a/app/helpers/requests_helper.rb +++ b/app/helpers/requests_helper.rb @@ -32,7 +32,6 @@ module RequestsHelper def relationship_flow(identifier) action = :none person = nil - puts identifier person = Person.by_webfinger identifier if person action = (person == current_user.person ? :none : :friend) diff --git a/app/models/user.rb b/app/models/user.rb index 86b818bb0..d129db2ce 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -97,8 +97,6 @@ class User ######## Posting ######## def post(class_name, options = {}) - - puts options.inspect if class_name == :photo raise ArgumentError.new("No album_id given") unless options[:album_id] aspect_ids = aspects_with_post( options[:album_id] ) @@ -225,11 +223,7 @@ class User ###Helpers############ def self.instantiate!( opts = {} ) - hostname = opts[:url].gsub(/(https?:|www\.)\/\//, '') - hostname.chop! if hostname[-1, 1] == '/' - - opts[:person][:diaspora_handle] = "#{opts[:username]}@#{hostname}" - puts opts[:person][:diaspora_handle] + opts[:person][:diaspora_handle] = "#{opts[:username]}@#{terse_url}" opts[:person][:serialized_key] = generate_key User.create(opts) end @@ -240,7 +234,7 @@ class User end def terse_url - terse = self.url.gsub(/(https?:|www\.)\/\//, '') + terse = APP_CONFIG[:pod_url].gsub(/(https?:|www\.)\/\//, '') terse = terse.chop! if terse[-1, 1] == '/' terse end diff --git a/config/app_config.yml b/config/app_config.yml index b4fd6f0ab..5ee07c405 100644 --- a/config/app_config.yml +++ b/config/app_config.yml @@ -3,8 +3,8 @@ # the COPYRIGHT file. - -development: +default: + pod_url: "http://example.org/" debug: false socket_debug : false socket_host: 0.0.0.0 @@ -13,21 +13,11 @@ development: pubsub_server: 'https://pubsubhubbub.appspot.com/' mongo_host: 'localhost' mongo_post: 27017 + +development: test: - debug: false - socket_debug : false - socket_host: 0.0.0.0 + pod_url: "http://example.org/" socket_port: 8081 - pubsub_server: 'https://pubsubhubbub.appspot.com/' - mongo_host: 'localhost' - mongo_post: 27017 production: - debug: false - socket_debug : false - socket_host: 0.0.0.0 - socket_port: 8080 - pubsub_server: 'https://pubsubhubbub.appspot.com/' - mongo_host: 'localhost' - mongo_post: 27017 diff --git a/config/initializers/_load_app_config.rb b/config/initializers/_load_app_config.rb index 1a5094d9b..ac14c97d8 100644 --- a/config/initializers/_load_app_config.rb +++ b/config/initializers/_load_app_config.rb @@ -2,6 +2,12 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - raw_config = File.read("#{Rails.root}/config/app_config.yml") -APP_CONFIG = YAML.load(raw_config)[Rails.env].symbolize_keys +all_envs = YAML.load(raw_config) +if all_envs[Rails.env] + APP_CONFIG = all_envs['default'].merge(all_envs[Rails.env]).symbolize_keys +else + APP_CONFIG = all_envs['default'].symbolize_keys +end + +puts "WARNING: Please modify your app_config.yml to have a proper pod_url!" if APP_CONFIG[:pod_url] == "http://example.org/" && Rails.env != :test diff --git a/spec/factories.rb b/spec/factories.rb index c1dfcd50a..21a7ad110 100644 --- a/spec/factories.rb +++ b/spec/factories.rb @@ -39,7 +39,10 @@ Factory.define :user do |u| u.sequence(:email) {|n| "bob#{n}@pivotallabs.com"} u.password "bluepin7" u.password_confirmation "bluepin7" - u.person { |a| Factory.create(:person_with_user, :owner_id => a._id)} + u.person { |a| Factory.create(:person_with_user, + :owner_id => a._id, + :diaspora_handle => "#{a.username}@#{APP_CONFIG[:pod_url].gsub(/(https?:|www\.)\/\//, '').chop!}") + } end Factory.define :status_message do |m| diff --git a/spec/models/person_spec.rb b/spec/models/person_spec.rb index 4f236b733..3275d9245 100644 --- a/spec/models/person_spec.rb +++ b/spec/models/person_spec.rb @@ -15,6 +15,20 @@ describe Person do @aspect2 = @user2.aspect(:name => "Abscence of Babes") end + describe '#diaspora_handle' do + context 'local people' do + it 'uses the pod config url to set the diaspora_handle' do + @user.person.diaspora_handle.should == @user.username + "@example.org" + end + end + + context 'remote people' do + it 'stores the diaspora_handle in the database' do + @person.diaspora_handle.include?(@user.terse_url).should be false + end + end + end + it 'should not allow two people with the same diaspora_handle' do person_two = Factory.build(:person, :url => @person.diaspora_handle) person_two.valid?.should == false @@ -148,13 +162,11 @@ describe Person do end it 'should search by diaspora_handle exactly' do - stub_success("tom@tom.joindiaspora.com") Person.by_webfinger(@friend_one.diaspora_handle).should == @friend_one end it 'should create a stub for a remote user' do - stub_success("tom@tom.joindiaspora.com") tom = Person.by_webfinger('tom@tom.joindiaspora.com') tom.real_name.include?("Hamiltom").should be true diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index 223881671..63639bc73 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -7,11 +7,17 @@ require File.dirname(__FILE__) + '/../spec_helper' describe User do - before do - @user = Factory.create(:user) - @aspect = @user.aspect(:name => 'heroes') - end - + before do + @user = Factory.create(:user) + @aspect = @user.aspect(:name => 'heroes') + end + + describe '#diaspora_handle' do + it 'uses the pod config url to set the diaspora_handle' do + @user.diaspora_handle.should == @user.username + "@example.org" + end + end + it 'should create with pivotal or allowed emails' do user1 = Factory.create(:user, :email => "kimfuh@yahoo.com") user2 = Factory.create(:user, :email => "awesome@sofaer.net") @@ -49,12 +55,12 @@ describe User do friend_users(@user, Aspect.find_by_id(@aspect.id), user2, Aspect.find_by_id(aspect2.id)) @aspect.reload - + @user.aspects.include?(@aspect).should == true proc{@user.drop_aspect(@aspect)}.should raise_error /Aspect not empty/ - @user.reload + @user.reload @user.aspects.include?(@aspect).should == true end end From d26e7850ac72fd02d152bf6775f7592aa48bd468 Mon Sep 17 00:00:00 2001 From: ilya Date: Tue, 21 Sep 2010 15:52:26 -0700 Subject: [PATCH 153/449] RS, IZ; removed url from user and views --- app/models/user.rb | 3 +-- app/views/devise/sessions/new.html.haml | 2 +- app/views/registrations/new.html.haml | 3 --- app/views/users/edit.html.haml | 4 ++-- 4 files changed, 4 insertions(+), 8 deletions(-) diff --git a/app/models/user.rb b/app/models/user.rb index d129db2ce..4e9e968ca 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -25,8 +25,6 @@ class User key :visible_post_ids, Array key :visible_person_ids, Array - key :url, String - one :person, :class_name => 'Person', :foreign_key => :owner_id many :friends, :in => :friend_ids, :class_name => 'Person' @@ -224,6 +222,7 @@ class User ###Helpers############ def self.instantiate!( opts = {} ) opts[:person][:diaspora_handle] = "#{opts[:username]}@#{terse_url}" + opts[:person][:url] = APP_CONFIG[:pod_url] opts[:person][:serialized_key] = generate_key User.create(opts) end diff --git a/app/views/devise/sessions/new.html.haml b/app/views/devise/sessions/new.html.haml index 7ce75f5f3..15880df0b 100644 --- a/app/views/devise/sessions/new.html.haml +++ b/app/views/devise/sessions/new.html.haml @@ -10,7 +10,7 @@ = f.label :username = f.text_field :username %p.user_network - ="@#{request.host}" + ="@#{APP_CONFIG[:pod_url]}" %p = f.label :password diff --git a/app/views/registrations/new.html.haml b/app/views/registrations/new.html.haml index eefa94519..3e1dc0830 100644 --- a/app/views/registrations/new.html.haml +++ b/app/views/registrations/new.html.haml @@ -2,7 +2,6 @@ = form_for(resource, :as => resource_name, :url => registration_path(resource_name)) do |f| - = f.hidden_field :url, :value => request.host %p = f.label :username = f.text_field :username @@ -17,8 +16,6 @@ = f.password_field :password_confirmation = f.fields_for :person do |p| - = p.hidden_field :url, :value => request.host - = p.fields_for :profile do |pr| %p = pr.label :first_name diff --git a/app/views/users/edit.html.haml b/app/views/users/edit.html.haml index fd94b2a42..880d25ef4 100644 --- a/app/views/users/edit.html.haml +++ b/app/views/users/edit.html.haml @@ -17,11 +17,11 @@ %h3 Picture %div#image_picker - = p.hidden_field :image_url, :value => (@profile.image_url.sub(@user.url,'/') if @profile.image_url), :id => 'image_url_field' + = p.hidden_field :image_url, :value => (@profile.image_url.sub(APP_CONFIG[:pod_url],'/') if @profile.image_url), :id => 'image_url_field' - unless @photos.nil? || @photos.empty? - for photo in @photos - - if @profile.image_url && (photo.url(:thumb_medium) == @profile.image_url.sub(@user.url,'/')) + - if @profile.image_url && (photo.url(:thumb_medium) == @profile.image_url.sub(APP_CONFIG[:pod_url],'/')) %div.small_photo{:id => photo.url(:thumb_medium), :class=>'selected'} = check_box_tag 'checked_photo', true, true = link_to image_tag(photo.url(:thumb_medium)), "#" From d3b0b9c07e4bf61e1bb0964de47713ffafd3d20c Mon Sep 17 00:00:00 2001 From: ilya Date: Tue, 21 Sep 2010 16:13:21 -0700 Subject: [PATCH 154/449] Make db seed set app_config[:pod_url] --- db/seeds/backer.rb | 23 ++++++++++++++++++----- db/seeds/dev.rb | 12 ++---------- db/seeds/tom.rb | 27 +++++++++++++++++---------- 3 files changed, 37 insertions(+), 25 deletions(-) diff --git a/db/seeds/backer.rb b/db/seeds/backer.rb index b32b62377..d39ce490c 100644 --- a/db/seeds/backer.rb +++ b/db/seeds/backer.rb @@ -15,25 +15,38 @@ require 'config/environment' def create + + config = YAML.load_file(File.dirname(__FILE__) + '/../../config/deploy_config.yml') backer_info = config['servers']['backer'] backer_number = YAML.load_file(Rails.root.join('config','backer_number.yml'))[:seed_number].to_i - # Create seed user + + #set pod url username = backer_info[backer_number]['username'].gsub(/ /,'').downcase + set_app_config username + require 'config/initializers/_load_app_config.rb' + + # Create seed user user = User.instantiate!(:email => "#{username}@#{username}.joindiaspora.com", :username => username, :password => "#{username+backer_info[backer_number]['pin'].to_s}", :password_confirmation => "#{username+backer_info[backer_number]['pin'].to_s}", - :url=> "http://#{username}.joindiaspora.com/", :person => Person.new( - :diaspora_handle => "#{username}@#{username}.joindiaspora.com", :profile => Profile.new( :first_name => backer_info[backer_number]['given_name'], :last_name => backer_info[backer_number]['family_name'], - :image_url => "http://#{username}.joindiaspora.com/images/user/#{username}.jpg"), - :url=> "http://#{username}.joindiaspora.com/") + :image_url => "http://#{username}.joindiaspora.com/images/user/#{username}.jpg") ) user.person.save! user.aspect(:name => "Presidents") end +def set_app_config username + current_config = YAML.load(Rails.root.join('config', 'app_config.yml')) + current_config[Rails.env] ||= {} + current_config[Rails.env][:pod_url] = "#{username}.joindiaspora.com" + current_config[:default][:pod_url] = "#{username}.joindiaspora.com" + file = File.new(Rails.root.join('config','app_config.yml'),'w') + file.write(current_config.to_yaml) + file.close +end diff --git a/db/seeds/dev.rb b/db/seeds/dev.rb index 12c728ddf..ef9dddecf 100644 --- a/db/seeds/dev.rb +++ b/db/seeds/dev.rb @@ -6,31 +6,23 @@ require 'config/environment' -host = "localhost:3000" -url = "http://#{host}/" username = "tom" # Create seed user user = User.instantiate!( :email => "tom@tom.joindiaspora.com", :username => "tom", :password => "evankorth", :password_confirmation => "evankorth", - :url=> "http://#{username}.joindiaspora.com/" :person => Person.new( - :diaspora_handle => "tom@tom.joindiaspora.com", - :url => url, :profile => Profile.new( :first_name => "Alexander", :last_name => "Hamiltom" )) ) user.person.save! user2 = User.instantiate!( :email => "korth@tom.joindiaspora.com", :username => "korth", - :url=> "http://#{username}.joindiaspora.com/" :password => "evankorth", :password_confirmation => "evankorth", - :person => Person.new( :diaspora_handle => "korth@tom.joindiaspora.com", - :url => url, - :profile => Profile.new( :first_name => "Evan", - :last_name => "Korth"))) + :person => Person.new( + :profile => Profile.new( :first_name => "Evan", :last_name => "Korth"))) user2.person.save! diff --git a/db/seeds/tom.rb b/db/seeds/tom.rb index 61b2ad44f..b81d10827 100644 --- a/db/seeds/tom.rb +++ b/db/seeds/tom.rb @@ -6,17 +6,26 @@ require 'config/environment' -remote_url = "http://tom.joindiaspora.com/" -#remote_url = "http://localhost:3000/" +def set_app_config username + current_config = YAML.load(Rails.root.join('config', 'app_config.yml')) + current_config[Rails.env] ||= {} + current_config[Rails.env][:pod_url] = "#{username}.joindiaspora.com" + current_config[:default][:pod_url] = "#{username}.joindiaspora.com" + file = File.new(Rails.root.join('config','app_config.yml'),'w') + file.write(current_config.to_yaml) + file.close +end + +set_app_config "tom" +require 'config/initializers/_load_app_config.rb' + + # Create seed user user = User.instantiate!( :email => "tom@tom.joindiaspora.com", :username => "tom", :password => "evankorth", :password_confirmation => "evankorth", - :url => remote_url, :person => { - :diaspora_handle => "tom@tom.joindiaspora.com", - :url => remote_url, :profile => { :first_name => "Alexander", :last_name => "Hamiltom", :image_url => "http://tom.joindiaspora.com/images/user/tom.jpg"}} ) @@ -26,11 +35,7 @@ user2 = User.instantiate!( :email => "korth@tom.joindiaspora.com", :password => "evankorth", :password_confirmation => "evankorth", :username => "korth", - :url => remote_url, - :person => { :diaspora_handle => "korth@tom.joindiaspora.com", - :url => remote_url, - :profile => { :first_name => "Evan", - :last_name => "Korth", + :person => {:profile => { :first_name => "Evan", :last_name => "Korth", :image_url => "http://tom.joindiaspora.com/images/user/korth.jpg"}}) user2.person.save! @@ -41,3 +46,5 @@ request = user.send_friend_request_to(user2, aspect) reversed_request = user2.accept_friend_request( request.id, user2.aspect(:name => "presidents").id ) user.receive reversed_request.to_diaspora_xml user.aspect(:name => "Presidents") + + From dc0a08172d8daee7e487e51c62580258092deb39 Mon Sep 17 00:00:00 2001 From: ilya Date: Tue, 21 Sep 2010 16:23:42 -0700 Subject: [PATCH 155/449] syntax error in seed script --- db/seeds/backer.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/seeds/backer.rb b/db/seeds/backer.rb index d39ce490c..277615323 100644 --- a/db/seeds/backer.rb +++ b/db/seeds/backer.rb @@ -35,7 +35,7 @@ def create :person => Person.new( :profile => Profile.new( :first_name => backer_info[backer_number]['given_name'], :last_name => backer_info[backer_number]['family_name'], :image_url => "http://#{username}.joindiaspora.com/images/user/#{username}.jpg") - ) + )) user.person.save! user.aspect(:name => "Presidents") From c8e52526d9c8b4af5b29a36056e70c6ce990563d Mon Sep 17 00:00:00 2001 From: ilya Date: Tue, 21 Sep 2010 16:31:27 -0700 Subject: [PATCH 156/449] another silly mistake, need to symbolize keys in deploy scripts --- db/seeds/backer.rb | 2 +- db/seeds/tom.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/db/seeds/backer.rb b/db/seeds/backer.rb index 277615323..9ebe1248f 100644 --- a/db/seeds/backer.rb +++ b/db/seeds/backer.rb @@ -42,7 +42,7 @@ def create end def set_app_config username - current_config = YAML.load(Rails.root.join('config', 'app_config.yml')) + current_config = YAML.load(Rails.root.join('config', 'app_config.yml')).symbolize_keys current_config[Rails.env] ||= {} current_config[Rails.env][:pod_url] = "#{username}.joindiaspora.com" current_config[:default][:pod_url] = "#{username}.joindiaspora.com" diff --git a/db/seeds/tom.rb b/db/seeds/tom.rb index b81d10827..c35058bf7 100644 --- a/db/seeds/tom.rb +++ b/db/seeds/tom.rb @@ -7,7 +7,7 @@ require 'config/environment' def set_app_config username - current_config = YAML.load(Rails.root.join('config', 'app_config.yml')) + current_config = YAML.load(Rails.root.join('config', 'app_config.yml')).symbolize_keys current_config[Rails.env] ||= {} current_config[Rails.env][:pod_url] = "#{username}.joindiaspora.com" current_config[:default][:pod_url] = "#{username}.joindiaspora.com" From 107c05ef6f89c99d41fa65a0703b7d63cdc96618 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Tue, 21 Sep 2010 16:35:18 -0700 Subject: [PATCH 157/449] DG MS; validate_aspect_permissions broken out of post method --- app/models/user.rb | 28 +++++++++++++++++++++++----- spec/models/user/posting_spec.rb | 25 +++++++++++++++++++++---- 2 files changed, 44 insertions(+), 9 deletions(-) diff --git a/app/models/user.rb b/app/models/user.rb index 4e2e642e3..91d84340d 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -106,11 +106,7 @@ class User aspect_ids = options.delete(:to) end - aspect_ids = [aspect_ids.to_s] if aspect_ids.is_a? BSON::ObjectId - - raise ArgumentError.new("You must post to someone.") if aspect_ids.nil? || aspect_ids.empty? - aspect_ids.each{ |aspect_id| - raise ArgumentError.new("Cannot post to an aspect you do not own.") unless aspect_id == "all" || self.aspects.find(aspect_id) } + aspect_ids = validate_aspect_permissions(aspect_ids) post = build_post(class_name, options) @@ -120,6 +116,28 @@ class User post end + def repost( post, options = {} ) + aspect_ids = validate_aspect_permissions(options[:to]) + push_to_aspects(post, aspect_ids) + post + end + + def validate_aspect_permissions(aspect_ids) + aspect_ids = [aspect_ids.to_s] if aspect_ids.is_a? BSON::ObjectId + + if aspect_ids.nil? || aspect_ids.empty? + raise ArgumentError.new("You must post to someone.") + end + + aspect_ids.each do |aspect_id| + unless aspect_id == "all" || self.aspects.find(aspect_id) + raise ArgumentError.new("Cannot post to an aspect you do not own.") + end + end + + aspect_ids + end + def build_post( class_name, options = {}) options[:person] = self.person model_class = class_name.to_s.camelize.constantize diff --git a/spec/models/user/posting_spec.rb b/spec/models/user/posting_spec.rb index 1f24f3fed..da52ed849 100644 --- a/spec/models/user/posting_spec.rb +++ b/spec/models/user/posting_spec.rb @@ -26,15 +26,22 @@ describe User do end context 'posting' do - describe '#post' do + + describe '#validate_aspect_permissions' do it 'should not be able to post without a aspect' do - proc {user.post(:status_message, :message => "heyheyhey")}.should raise_error /You must post to someone/ + proc { + user.validate_aspect_permissions([]) + }.should raise_error /You must post to someone/ end it 'should not be able to post to someone elses aspect' do - proc {user.post(:status_message, :message => "heyheyhey", :to => aspect2.id)}.should raise_error /Cannot post to an aspect you do not own./ + proc { + user.validate_aspect_permissions(aspect2.id) + }.should raise_error /Cannot post to an aspect you do not own./ end - + end + + describe '#post' do it 'should put the post in the aspect post array' do post = user.post(:status_message, :message => "hey", :to => aspect.id) aspect.reload @@ -47,6 +54,16 @@ describe User do aspect.posts.should include album end end + + describe '#repost' do + let!(:status_message) { user.post(:status_message, :message => "hello", :to => aspect.id) } + + it 'should make the post visible in another aspect' do + user.repost( status_message, :to => aspect1.id ) + aspect1.reload + aspect1.posts.count.should be 1 + end + end end context 'dispatching' do From 020ff603bdbbea476483a70c0aad764de646893a Mon Sep 17 00:00:00 2001 From: ilya Date: Tue, 21 Sep 2010 16:59:06 -0700 Subject: [PATCH 158/449] terse_url in user, db seeds are fixed, config/app_config.yml is now in gitignore, copy over config/app_config_example.yml. --- .gitignore | 1 + app/models/user.rb | 3 +++ config/app_config.yml | 34 ++++++++++++++-------------------- config/app_config_example.yml | 23 +++++++++++++++++++++++ db/seeds/backer.rb | 8 ++++---- db/seeds/dev.rb | 12 ++++++++++++ db/seeds/tom.rb | 8 ++++---- 7 files changed, 61 insertions(+), 28 deletions(-) create mode 100644 config/app_config_example.yml diff --git a/.gitignore b/.gitignore index 89b33da60..0025a86f5 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,4 @@ gpg/diaspora-production/*.gpg gpg/*/random_seed public/uploads/* .rvmrc +config/app_config.yml diff --git a/app/models/user.rb b/app/models/user.rb index 4e9e968ca..a98217b4e 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -221,6 +221,9 @@ class User ###Helpers############ def self.instantiate!( opts = {} ) + terse_url = APP_CONFIG[:pod_url].gsub(/(https?:|www\.)\/\//, '') + terse_url.chop! if terse_url[-1, 1] == '/' + opts[:person][:diaspora_handle] = "#{opts[:username]}@#{terse_url}" opts[:person][:url] = APP_CONFIG[:pod_url] opts[:person][:serialized_key] = generate_key diff --git a/config/app_config.yml b/config/app_config.yml index 5ee07c405..bd306725e 100644 --- a/config/app_config.yml +++ b/config/app_config.yml @@ -1,23 +1,17 @@ -# Copyright (c) 2010, Diaspora Inc. This file is -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - - -default: - pod_url: "http://example.org/" - debug: false - socket_debug : false +--- +default: socket_host: 0.0.0.0 - socket_port: 8080 - socket_collection_name: 'websocket' - pubsub_server: 'https://pubsubhubbub.appspot.com/' - mongo_host: 'localhost' + socket_debug: false + pod_url: tom.joindiaspora.com mongo_post: 27017 - -development: - -test: - pod_url: "http://example.org/" + socket_collection_name: websocket + socket_port: 8080 + pubsub_server: https://pubsubhubbub.appspot.com/ + mongo_host: localhost + debug: false +production: +development: + pod_url: tom.joindiaspora.com +test: + pod_url: http://example.org/ socket_port: 8081 - -production: diff --git a/config/app_config_example.yml b/config/app_config_example.yml new file mode 100644 index 000000000..5ee07c405 --- /dev/null +++ b/config/app_config_example.yml @@ -0,0 +1,23 @@ +# Copyright (c) 2010, Diaspora Inc. This file is +# licensed under the Affero General Public License version 3. See +# the COPYRIGHT file. + + +default: + pod_url: "http://example.org/" + debug: false + socket_debug : false + socket_host: 0.0.0.0 + socket_port: 8080 + socket_collection_name: 'websocket' + pubsub_server: 'https://pubsubhubbub.appspot.com/' + mongo_host: 'localhost' + mongo_post: 27017 + +development: + +test: + pod_url: "http://example.org/" + socket_port: 8081 + +production: diff --git a/db/seeds/backer.rb b/db/seeds/backer.rb index 9ebe1248f..700839f62 100644 --- a/db/seeds/backer.rb +++ b/db/seeds/backer.rb @@ -42,10 +42,10 @@ def create end def set_app_config username - current_config = YAML.load(Rails.root.join('config', 'app_config.yml')).symbolize_keys - current_config[Rails.env] ||= {} - current_config[Rails.env][:pod_url] = "#{username}.joindiaspora.com" - current_config[:default][:pod_url] = "#{username}.joindiaspora.com" + current_config = YAML.load(File.read(Rails.root.join('config', 'app_config_example.yml'))) + current_config[Rails.env.to_s] ||= {} + current_config[Rails.env.to_s]['pod_url'] = "#{username}.joindiaspora.com" + current_config['default']['pod_url'] = "#{username}.joindiaspora.com" file = File.new(Rails.root.join('config','app_config.yml'),'w') file.write(current_config.to_yaml) file.close diff --git a/db/seeds/dev.rb b/db/seeds/dev.rb index ef9dddecf..4ffa947e7 100644 --- a/db/seeds/dev.rb +++ b/db/seeds/dev.rb @@ -6,7 +6,19 @@ require 'config/environment' +def set_app_config username + current_config = YAML.load(File.read(Rails.root.join('config', 'app_config_example.yml'))) + current_config[Rails.env.to_s] ||= {} + current_config[Rails.env.to_s]['pod_url'] = "#{username}.joindiaspora.com" + current_config['default']['pod_url'] = "#{username}.joindiaspora.com" + file = File.new(Rails.root.join('config','app_config.yml'),'w') + file.write(current_config.to_yaml) + file.close +end + username = "tom" +set_app_config username + # Create seed user user = User.instantiate!( :email => "tom@tom.joindiaspora.com", :username => "tom", diff --git a/db/seeds/tom.rb b/db/seeds/tom.rb index c35058bf7..cf6a1ed0c 100644 --- a/db/seeds/tom.rb +++ b/db/seeds/tom.rb @@ -7,10 +7,10 @@ require 'config/environment' def set_app_config username - current_config = YAML.load(Rails.root.join('config', 'app_config.yml')).symbolize_keys - current_config[Rails.env] ||= {} - current_config[Rails.env][:pod_url] = "#{username}.joindiaspora.com" - current_config[:default][:pod_url] = "#{username}.joindiaspora.com" + current_config = YAML.load(File.read(Rails.root.join('config', 'app_config_example.yml'))) + current_config[Rails.env.to_s] ||= {} + current_config[Rails.env.to_s]['pod_url'] = "#{username}.joindiaspora.com" + current_config['default']['pod_url'] = "#{username}.joindiaspora.com" file = File.new(Rails.root.join('config','app_config.yml'),'w') file.write(current_config.to_yaml) file.close From e3d52bb467bd8f45d380a8715c80799065ccb036 Mon Sep 17 00:00:00 2001 From: ilya Date: Tue, 21 Sep 2010 17:39:44 -0700 Subject: [PATCH 159/449] putting the config file in a shared directory for in the deploy scripts --- config/deploy.rb | 7 ++++++- db/seeds/backer.rb | 2 +- db/seeds/tom.rb | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/config/deploy.rb b/config/deploy.rb index c84d25556..478736392 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -53,6 +53,11 @@ namespace :deploy do run "ln -s -f #{shared_path}/bundle #{current_path}/vendor/bundle" end + task :symlink_config do + run "touch #{shared_path}/app_config.yml" + run "ln -s -f #{shared_path}/app_config.yml #{current_path}/config/app_config.yml" + end + task :start do start_mongo start_thin @@ -150,4 +155,4 @@ namespace :db do end -after "deploy:symlink", "deploy:symlink_images", "deploy:symlink_bundle" +after "deploy:symlink", "deploy:symlink_images", "deploy:symlink_bundle", 'deploy:symlink_config" diff --git a/db/seeds/backer.rb b/db/seeds/backer.rb index 700839f62..1730ee202 100644 --- a/db/seeds/backer.rb +++ b/db/seeds/backer.rb @@ -46,7 +46,7 @@ def set_app_config username current_config[Rails.env.to_s] ||= {} current_config[Rails.env.to_s]['pod_url'] = "#{username}.joindiaspora.com" current_config['default']['pod_url'] = "#{username}.joindiaspora.com" - file = File.new(Rails.root.join('config','app_config.yml'),'w') + file = File.new(Rails.root.join('..','shared','app_config.yml'),'w') file.write(current_config.to_yaml) file.close end diff --git a/db/seeds/tom.rb b/db/seeds/tom.rb index cf6a1ed0c..d8152a33b 100644 --- a/db/seeds/tom.rb +++ b/db/seeds/tom.rb @@ -11,7 +11,7 @@ def set_app_config username current_config[Rails.env.to_s] ||= {} current_config[Rails.env.to_s]['pod_url'] = "#{username}.joindiaspora.com" current_config['default']['pod_url'] = "#{username}.joindiaspora.com" - file = File.new(Rails.root.join('config','app_config.yml'),'w') + file = File.new(Rails.root.join('..','shared','app_config.yml'),'w') file.write(current_config.to_yaml) file.close end From 74a92a26374cebd9adbf236c47f148d85dd307ce Mon Sep 17 00:00:00 2001 From: ilya Date: Tue, 21 Sep 2010 17:40:43 -0700 Subject: [PATCH 160/449] tiny typo --- config/deploy.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/deploy.rb b/config/deploy.rb index 478736392..2f8065134 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -155,4 +155,4 @@ namespace :db do end -after "deploy:symlink", "deploy:symlink_images", "deploy:symlink_bundle", 'deploy:symlink_config" +after "deploy:symlink", "deploy:symlink_images", "deploy:symlink_bundle", 'deploy:symlink_config' From 4a3bfea1ba1f13d8f03fe1c478cd50d6ba433b66 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Tue, 21 Sep 2010 17:43:46 -0700 Subject: [PATCH 161/449] DG MS; cleaned spec --- lib/diaspora/user/querying.rb | 5 - spec/models/user/visible_posts_spec.rb | 131 ++++++++++++------------- 2 files changed, 64 insertions(+), 72 deletions(-) diff --git a/lib/diaspora/user/querying.rb b/lib/diaspora/user/querying.rb index 00ae27735..bd4174c76 100644 --- a/lib/diaspora/user/querying.rb +++ b/lib/diaspora/user/querying.rb @@ -35,11 +35,6 @@ module Diaspora aspects.detect{|x| x.id == id } end - def album_by_id( id ) - id = id.to_id - albums.detect{|x| x.id == id } - end - def aspects_with_post( id ) self.aspects.find_all_by_post_ids( id.to_id ) end diff --git a/spec/models/user/visible_posts_spec.rb b/spec/models/user/visible_posts_spec.rb index 5c44a2ce8..bcab473bc 100644 --- a/spec/models/user/visible_posts_spec.rb +++ b/spec/models/user/visible_posts_spec.rb @@ -7,83 +7,80 @@ require File.dirname(__FILE__) + '/../../spec_helper' describe User do - before do - @user = Factory.create(:user) - @aspect = @user.aspect(:name => 'heroes') - @aspect2 = @user.aspect(:name => 'losers') + let(:user) { Factory(:user) } - @user2 = Factory.create :user - @user2_aspect = @user2.aspect(:name => 'dudes') + let(:user2) { Factory(:user) } + let(:user3) { Factory(:user) } + let(:user4) { Factory(:user) } - friend_users(@user, @aspect, @user2, @user2_aspect) + let!(:aspect) { user.aspect(:name => 'heroes') } + let!(:aspect2) { user.aspect(:name => 'losers') } - @user3 = Factory.create :user - @user3_aspect = @user3.aspect(:name => 'dudes') - friend_users(@user, @aspect2, @user3, @user3_aspect) + let!(:user2_aspect) { user2.aspect(:name => 'dudes') } + let!(:user3_aspect) { user3.aspect(:name => 'dudes') } + let!(:user4_aspect) { user4.aspect(:name => 'dudes') } - @user4 = Factory.create :user - @user4_aspect = @user4.aspect(:name => 'dudes') - friend_users(@user, @aspect2, @user4, @user4_aspect) - end + let(:status_message1) { user2.post :status_message, :message => "hi", :to => user2_aspect.id } + let(:status_message2) { user3.post :status_message, :message => "heyyyy", :to => user3_aspect.id } + let(:status_message3) { user4.post :status_message, :message => "yooo", :to => user4_aspect.id } - it 'should generate a valid stream for a aspect of people' do - status_message1 = @user2.post :status_message, :message => "hi", :to => @user2_aspect.id - status_message2 = @user3.post :status_message, :message => "heyyyy", :to => @user3_aspect.id - status_message3 = @user4.post :status_message, :message => "yooo", :to => @user4_aspect.id + before do + friend_users(user, aspect, user2, user2_aspect) + friend_users(user, aspect2, user3, user3_aspect) + friend_users(user, aspect2, user4, user4_aspect) + end - @user.receive status_message1.to_diaspora_xml - @user.receive status_message2.to_diaspora_xml - @user.receive status_message3.to_diaspora_xml - @user.reload + it 'should generate a valid stream for a aspect of people' do + (1..3).each{ |n| + eval("user.receive status_message#{n}.to_diaspora_xml") + } - @user.visible_posts(:by_members_of => @aspect).include?(status_message1).should be true - @user.visible_posts(:by_members_of => @aspect).include?(status_message2).should be false - @user.visible_posts(:by_members_of => @aspect).include?(status_message3).should be false + user.visible_posts(:by_members_of => aspect).should include status_message1 + user.visible_posts(:by_members_of => aspect).should_not include status_message2 + user.visible_posts(:by_members_of => aspect).should_not include status_message3 - @user.visible_posts(:by_members_of => @aspect2).include?(status_message1).should be false - @user.visible_posts(:by_members_of => @aspect2).include?(status_message2).should be true - @user.visible_posts(:by_members_of => @aspect2).include?(status_message3).should be true - end + user.visible_posts(:by_members_of => aspect2).should_not include status_message1 + user.visible_posts(:by_members_of => aspect2).should include status_message2 + user.visible_posts(:by_members_of => aspect2).should include status_message3 + end - describe 'querying' do - - it 'should find a visible post by id' do - status_message1 = @user.post :status_message, :message => "hi", :to => @aspect.id - status_message2 = @user2.post :status_message, :message => "heyyyy", :to => @user2_aspect.id - status_message3 = @user3.post :status_message, :message => "yooo", :to => @user3_aspect.id - - @user.find_visible_post_by_id(status_message1.id).should == status_message1 - @user2.find_visible_post_by_id(status_message1.id).should == nil - end - - end - - describe 'albums' do - before do - @album = @user.post :album, :name => "Georges", :to => @aspect.id - @aspect.reload - @aspect2.reload - @user.reload - - @album2 = @user.post :album, :name => "Borges", :to => @aspect.id - @aspect.reload - @aspect2.reload - @user.reload - - @user.post :album, :name => "Luises", :to => @aspect2.id - @aspect.reload - @aspect2.reload - @user.reload - end - - it 'should find all albums if passed :all' do - @user.albums_by_aspect(:all).size.should == 3 - end - - it 'should return the right number of albums' do - @user.albums_by_aspect(@aspect).size.should == 2 - @user.albums_by_aspect(@aspect2).size.should == 1 + context 'querying' do + describe '#find_visible_post_by_id' do + it 'should query' do + user2.find_visible_post_by_id(status_message1.id).should == status_message1 + user.find_visible_post_by_id(status_message1.id).should == nil end end + end + + context 'albums' do + + + before do + @album = user.post :album, :name => "Georges", :to => aspect.id + aspect.reload + aspect2.reload + user.reload + + @album2 = user.post :album, :name => "Borges", :to => aspect.id + aspect.reload + aspect2.reload + user.reload + + user.post :album, :name => "Luises", :to => aspect2.id + aspect.reload + aspect2.reload + user.reload + end + + it 'should find all albums if passed :all' do + user.albums_by_aspect(:all).should have(3).albums + end + + it 'should return the right number of albums' do + user.albums_by_aspect(aspect).should have(2).albums + user.albums_by_aspect(aspect2).should have(1).album + end + end end From b01928af4bdfb43201ec8abda59b4f4eb92869b7 Mon Sep 17 00:00:00 2001 From: ilya Date: Tue, 21 Sep 2010 17:52:11 -0700 Subject: [PATCH 162/449] RS IZ if yaml fails to load (empty config) file load the example --- config/initializers/_load_app_config.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/config/initializers/_load_app_config.rb b/config/initializers/_load_app_config.rb index ac14c97d8..034a62f24 100644 --- a/config/initializers/_load_app_config.rb +++ b/config/initializers/_load_app_config.rb @@ -4,6 +4,12 @@ raw_config = File.read("#{Rails.root}/config/app_config.yml") all_envs = YAML.load(raw_config) + +unless all_envs + raw_config = File.read("#{Rails.root}/config/app_config_example.yml") + all_envs = YAML.load(raw_config) +end + if all_envs[Rails.env] APP_CONFIG = all_envs['default'].merge(all_envs[Rails.env]).symbolize_keys else From 96aaf3093cb99d383fbdbfb6ebfa778207f20ee7 Mon Sep 17 00:00:00 2001 From: ilya Date: Tue, 21 Sep 2010 18:04:36 -0700 Subject: [PATCH 163/449] Make load_app_config more robust, point to the right folder in db seed --- config/initializers/_load_app_config.rb | 20 ++++++++++++-------- db/seeds/backer.rb | 2 +- db/seeds/tom.rb | 2 +- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/config/initializers/_load_app_config.rb b/config/initializers/_load_app_config.rb index 034a62f24..33f7b183b 100644 --- a/config/initializers/_load_app_config.rb +++ b/config/initializers/_load_app_config.rb @@ -2,16 +2,20 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. -raw_config = File.read("#{Rails.root}/config/app_config.yml") -all_envs = YAML.load(raw_config) - -unless all_envs - raw_config = File.read("#{Rails.root}/config/app_config_example.yml") - all_envs = YAML.load(raw_config) +def load_config_yaml filename + YAML.load(File.read(filename)) end -if all_envs[Rails.env] - APP_CONFIG = all_envs['default'].merge(all_envs[Rails.env]).symbolize_keys +if File.exist? "#{Rails.root}/config/app_config.yml" + all_envs = load_config_yaml "#{Rails.root}/config/app_config.yml" + all_envs = load_config_yaml "#{Rails.root}/config/app_config_example.yml" unless all_envs +else + puts "WARNING: No config/app_config.yml found! Look at config/app_config_example.yml for help." + all_envs = load_config_yaml "#{Rails.root}/config/app_config_example.yml" +end + +if all_envs[Rails.env.to_s] + APP_CONFIG = all_envs['default'].merge(all_envs[Rails.env.to_s]).symbolize_keys else APP_CONFIG = all_envs['default'].symbolize_keys end diff --git a/db/seeds/backer.rb b/db/seeds/backer.rb index 1730ee202..8fa72f23d 100644 --- a/db/seeds/backer.rb +++ b/db/seeds/backer.rb @@ -46,7 +46,7 @@ def set_app_config username current_config[Rails.env.to_s] ||= {} current_config[Rails.env.to_s]['pod_url'] = "#{username}.joindiaspora.com" current_config['default']['pod_url'] = "#{username}.joindiaspora.com" - file = File.new(Rails.root.join('..','shared','app_config.yml'),'w') + file = File.new(Rails.root.join('..','..','shared','app_config.yml'),'w') file.write(current_config.to_yaml) file.close end diff --git a/db/seeds/tom.rb b/db/seeds/tom.rb index d8152a33b..50d41eb91 100644 --- a/db/seeds/tom.rb +++ b/db/seeds/tom.rb @@ -11,7 +11,7 @@ def set_app_config username current_config[Rails.env.to_s] ||= {} current_config[Rails.env.to_s]['pod_url'] = "#{username}.joindiaspora.com" current_config['default']['pod_url'] = "#{username}.joindiaspora.com" - file = File.new(Rails.root.join('..','shared','app_config.yml'),'w') + file = File.new(Rails.root.join('..','..','shared','app_config.yml'),'w') file.write(current_config.to_yaml) file.close end From d60dc03d35e6b918b069d1447f5b1dcd8ec42740 Mon Sep 17 00:00:00 2001 From: ilya Date: Tue, 21 Sep 2010 18:10:26 -0700 Subject: [PATCH 164/449] removed app_config from repo --- config/app_config.yml | 17 ----------------- 1 file changed, 17 deletions(-) delete mode 100644 config/app_config.yml diff --git a/config/app_config.yml b/config/app_config.yml deleted file mode 100644 index bd306725e..000000000 --- a/config/app_config.yml +++ /dev/null @@ -1,17 +0,0 @@ ---- -default: - socket_host: 0.0.0.0 - socket_debug: false - pod_url: tom.joindiaspora.com - mongo_post: 27017 - socket_collection_name: websocket - socket_port: 8080 - pubsub_server: https://pubsubhubbub.appspot.com/ - mongo_host: localhost - debug: false -production: -development: - pod_url: tom.joindiaspora.com -test: - pod_url: http://example.org/ - socket_port: 8081 From df5b7d6d848bbcad04ecb9b58fb23a8c4d8be38e Mon Sep 17 00:00:00 2001 From: danielvincent Date: Tue, 21 Sep 2010 18:14:46 -0700 Subject: [PATCH 165/449] DG MS; new function in post --- app/models/user.rb | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/app/models/user.rb b/app/models/user.rb index 928a02173..2277f1583 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -105,12 +105,15 @@ class User aspect_ids = validate_aspect_permissions(aspect_ids) - post = build_post(class_name, options) + intitial_post(class_name, aspect_ids, options) + end + + def intitial_post(class_name, aspect_ids, options = {}) + post = build_post(class_name, options) post.socket_to_uid(id, :aspect_ids => aspect_ids) if post.respond_to?(:socket_to_uid) push_to_aspects(post, aspect_ids) - - post + post end def repost( post, options = {} ) From 6d6ca3d8bca9707b302e051b3bd936e29b524cc2 Mon Sep 17 00:00:00 2001 From: ilya Date: Tue, 21 Sep 2010 20:01:56 -0700 Subject: [PATCH 166/449] added terse_pod_url to the APP_CONFIG hash --- app/models/user.rb | 7 ++----- config/initializers/_load_app_config.rb | 5 ++++- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/models/user.rb b/app/models/user.rb index 928a02173..c68cbb6dc 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -239,11 +239,8 @@ class User ###Helpers############ def self.instantiate!( opts = {} ) - terse_url = APP_CONFIG[:pod_url].gsub(/(https?:|www\.)\/\//, '') - terse_url.chop! if terse_url[-1, 1] == '/' - - opts[:person][:diaspora_handle] = "#{opts[:username]}@#{terse_url}" - opts[:person][:url] = APP_CONFIG[:pod_url] + opts[:person][:diaspora_handle] = "#{opts[:username]}@#{APP_CONFIG[:terse_pod_url]}" + pts[:person][:url] = APP_CONFIG[:pod_url] opts[:person][:serialized_key] = generate_key User.create(opts) end diff --git a/config/initializers/_load_app_config.rb b/config/initializers/_load_app_config.rb index 33f7b183b..521f9f0a0 100644 --- a/config/initializers/_load_app_config.rb +++ b/config/initializers/_load_app_config.rb @@ -20,4 +20,7 @@ else APP_CONFIG = all_envs['default'].symbolize_keys end -puts "WARNING: Please modify your app_config.yml to have a proper pod_url!" if APP_CONFIG[:pod_url] == "http://example.org/" && Rails.env != :test +APP_CONFIG[:terse_pod_url] = APP_CONFIG[:pod_url].gsub(/(https?:|www\.)\/\//, '') +APP_CONFIG[:terse_pod_url].chop! if APP_CONFIG[:terse_pod_url][-1, 1] == '/' + +puts "WARNING: Please modify your app_config.yml to have a proper pod_url!" if APP_CONFIG[:terse_pod_url] == "example.org" && Rails.env != :test From 4c0dc584583d862172e460e036830407ab40fb5e Mon Sep 17 00:00:00 2001 From: danielvincent Date: Tue, 21 Sep 2010 20:02:37 -0700 Subject: [PATCH 167/449] spec cleanup --- spec/models/user_spec.rb | 53 +++++++++++++++------------------------- 1 file changed, 20 insertions(+), 33 deletions(-) diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index 2249ae0b1..1608bbe58 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -7,54 +7,41 @@ require File.dirname(__FILE__) + '/../spec_helper' describe User do - before do - @user = Factory.create(:user) - @aspect = @user.aspect(:name => 'heroes') - end + let(:user) { Factory(:user) } + let(:aspect) { user.aspect(:name => 'heroes') } describe '#diaspora_handle' do it 'uses the pod config url to set the diaspora_handle' do - @user.diaspora_handle.should == @user.username + "@example.org" + user.diaspora_handle.should == user.username + "@example.org" end end - - - describe 'profiles' do + context 'profiles' do it 'should be able to update their profile and send it to their friends' do - Factory.create(:person) + updated_profile = { :profile => { + :first_name => 'bob', + :last_name => 'billytown', + :image_url => "http://clown.com"} } - updated_profile = {:profile => {:first_name => 'bob', :last_name => 'billytown', :image_url => "http://clown.com"}} - - @user.update_profile(updated_profile).should == true - @user.profile.image_url.should == "http://clown.com" + user.update_profile(updated_profile).should be true + user.profile.image_url.should == "http://clown.com" end end - describe 'aspects' do - it 'should delete an empty aspect' do - @user.aspects.include?(@aspect).should == true - @user.drop_aspect(@aspect) - @user.reload + context 'aspects' do + let(:user2) { Factory(:user) } + let(:aspect2) { user2.aspect(:name => 'stuff') } - @user.aspects.include?(@aspect).should == false + it 'should delete an empty aspect' do + user.drop_aspect(aspect) + user.aspects.include?(aspect).should == false end it 'should not delete an aspect with friends' do - user2 = Factory.create(:user) - aspect2 = user2.aspect(:name => 'stuff') - user2.reload - aspect2.reload - - friend_users(@user, Aspect.find_by_id(@aspect.id), user2, Aspect.find_by_id(aspect2.id)) - @aspect.reload - - @user.aspects.include?(@aspect).should == true - - proc{@user.drop_aspect(@aspect)}.should raise_error /Aspect not empty/ - - @user.reload - @user.aspects.include?(@aspect).should == true + friend_users(user, Aspect.find_by_id(aspect.id), user2, Aspect.find_by_id(aspect2.id)) + aspect.reload + proc{user.drop_aspect(aspect)}.should raise_error /Aspect not empty/ + user.aspects.include?(aspect).should == true end end From 63ed6a3a9505850affef46544fd5cf3fbae5bb37 Mon Sep 17 00:00:00 2001 From: maxwell Date: Tue, 21 Sep 2010 21:31:53 -0700 Subject: [PATCH 168/449] MS DG made async webfingering controller. need to call it from javascript to prevent seeds from blocking. remember to update your gems --- Gemfile | 4 ++++ Gemfile.lock | 6 ++++++ app/controllers/requests_controller.rb | 3 +++ config/routes.rb | 1 + 4 files changed, 14 insertions(+) diff --git a/Gemfile b/Gemfile index cc92bec3d..adc4431aa 100644 --- a/Gemfile +++ b/Gemfile @@ -38,6 +38,10 @@ gem 'magent', :git => 'http://github.com/dcu/magent.git' gem 'carrierwave', :git => 'git://github.com/rsofaer/carrierwave.git' , :branch => 'master' #Untested mongomapper branch gem 'mini_magick' +#sinatra +gem 'sinatra', '1.0' +gem 'async_sinatra' + group :test, :development do gem 'factory_girl_rails' end diff --git a/Gemfile.lock b/Gemfile.lock index dd181b320..abad54828 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -104,6 +104,8 @@ GEM addressable (2.2.1) arel (1.0.1) activesupport (~> 3.0.0) + async_sinatra (0.2.3) + sinatra (>= 1.0) autotest (4.3.2) bcrypt-ruby (2.1.2) bson (1.0.7) @@ -212,6 +214,8 @@ GEM selenium-client (1.2.18) selenium-rc (2.2.4) selenium-client (>= 1.2.18) + sinatra (1.0) + rack (>= 1.0) subexec (0.0.4) thin (1.2.7) daemons (>= 1.0.9) @@ -238,6 +242,7 @@ PLATFORMS DEPENDENCIES addressable + async_sinatra autotest bson (= 1.0.7) bson_ext (= 1.0.7) @@ -266,6 +271,7 @@ DEPENDENCIES ruby-debug saucelabs-adapter (= 0.8.12) selenium-rc + sinatra (= 1.0) sprinkle! thin webmock diff --git a/app/controllers/requests_controller.rb b/app/controllers/requests_controller.rb index 6087ebe85..fd6e10e7b 100644 --- a/app/controllers/requests_controller.rb +++ b/app/controllers/requests_controller.rb @@ -42,6 +42,9 @@ class RequestsController < ApplicationController return end + + + # rel_hash = {:friend => params[:friend_handle]} Rails.logger.debug("Sending request: #{rel_hash}") begin diff --git a/config/routes.rb b/config/routes.rb index ae757499c..5b7ddba4f 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -33,6 +33,7 @@ Diaspora::Application.routes.draw do match 'signup', :to => 'registrations#new', :as => "new_user_registration" match 'get_to_the_choppa', :to => redirect("/signup") + match "/finger", :to => AsyncController #public routes # match 'webfinger', :to => 'publics#webfinger' From 6bd22034b7978b090cdf9bbc9cf3d4824f2f189a Mon Sep 17 00:00:00 2001 From: ilya Date: Tue, 21 Sep 2010 21:45:29 -0700 Subject: [PATCH 169/449] typo in user --- app/models/user.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/user.rb b/app/models/user.rb index 99230b8f6..06652a494 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -243,7 +243,7 @@ class User ###Helpers############ def self.instantiate!( opts = {} ) opts[:person][:diaspora_handle] = "#{opts[:username]}@#{APP_CONFIG[:terse_pod_url]}" - pts[:person][:url] = APP_CONFIG[:pod_url] + opts[:person][:url] = APP_CONFIG[:pod_url] opts[:person][:serialized_key] = generate_key User.create(opts) end From c87ad060abc0ae4919fa41761f0ee7ed590a1413 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Di=C3=B3genes?= Date: Wed, 22 Sep 2010 20:34:43 +0800 Subject: [PATCH 170/449] Add translation (from English locale) to Brazilian Portuguese --- config/locales/pt-BR.yml | 135 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 134 insertions(+), 1 deletion(-) diff --git a/config/locales/pt-BR.yml b/config/locales/pt-BR.yml index 67c077090..10425864b 100644 --- a/config/locales/pt-BR.yml +++ b/config/locales/pt-BR.yml @@ -7,4 +7,137 @@ # See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. pt-BR: - hello: "Olá Mundo" + hello: "Olá mundo" + layouts: + application: + edit_profile: "editar perfil" + logout: "sair" + shared: + aspect_nav: + all_aspects: "Todos Aspectos" + manage: "Gerenciar" + manage_your_aspects: "Gerencie seus Aspectos" + sub_header: + all_aspects: "Todos Aspectos" + manage_aspects: "Gerenciar Aspectos" + publisher: + share: "Compartilhar" + aspect_friends: + add_friends: "adicionar amigos" + albums: + album: + you: "você" + new_album: + create: "criar" + add_a_new_album: "Adicionar novo álbum" + show: + edit_album: "Editar Álbum" + albums: "álbuns" + updated: "atualizado" + by: "por" + edit: + editing: "Editando" + updated: "atualizado" + are_you_sure: "Tem certeza?" + delete_album: "Excluir Álbum" + cancel: "Cancelar" + index: + home: "home" + new_album: "Novo Álbum" + create: + success: "Você criou com sucesso um álbum chamado %{name}." + update: + success: "O álbum %{name} foi editado com sucesso." + failure: "Erro ao editar o álbum %{name}." + destroy: + success: "O álbum %{name} foi excluído com sucesso." + aspects: + index: + photos: "photos" + show: + photos: "photos" + manage: + add_a_new_aspect: "Adicionar um novo aspecto" + add_a_new_friend: "Adicionar um novo amigo" + show: "Exibir" + update_aspects: "Atualizar Aspectos" + requests: "Solicitações" + ignore_remove: "Ignorar/Excluir" + new_aspect: + add_a_new_aspect: "Adicionar um novo aspecto" + create: "Criar" + create: + success:"Clique no mais(+) do lado esquerdo para dizer ao Diaspora quem pode ver seu novo aspecto." + users: + edit: + cancel: "Cancelar" + update_profile: "Atualizar Perfil" + home: "Home" + diaspora_username: "USUÁRIO DIASPORA" + info: "Informações" + picture: "Imagem" + editing_profile: "Editando perfil" + albums: "Álbuns" + you_dont_have_any_photos: "Você não possui nenhuma photo! Vá para" + page_to_upload_some: "para fazer o upload de alguma." + comments: + comment: + ago: "atrás" + new_comment: + comment: "Comentário" + photos: + show: + prev: "anterior" + full_size: "tamanho máximo" + next: "próxima" + edit_photo: "Editar Foto" + delete_photo: "Excluir Foto" + are_you_sure: "Tem certeza?" + comments: "comentários" + edit: + editing: "Editando" + are_you_sure: "Tem certeza?" + delete_photo: "Excluir Foto" + photo: + show_comments: "exibir comentários" + posted_a_new_photo_to: "enviada um nova foto para" + new: + new_photo: "Nova Foto" + back_to_list: "Voltar para a Lista" + post_it: "enviar!" + registrations: + new: + sign_up: "Cadastro" + status_messages: + new_status_message: + tell_me_something_good: "diga-me qualquer coisa legal" + oh_yeah: "É isso aí!" + status_message: + show_comments: "exibir comentários" + delete: "Excluir" + are_you_sure: "Tem certeza?" + show: + status_message: "Mensagem de Status" + comments: "comentários" + are_you_sure: "Tem certeza?" + destroy: "Excluir" + view_all: "Exibir Todas" + message: "Mensagem" + owner: "Pertence a" + people: + index: + add_friend: "adicionar amigo(a)" + real_name: "nome real" + diaspora_handle: "diaspora handle" + thats_you: "esse é você!" + friend_request_pending: "pedido de amizade pendente" + you_have_a_friend_request_from_this_person: "você possui um pedido de amizade dessa pessoa" + new: + new_person: "Nova Pessoa" + back_to_list: "Voltar para a Lista" + show: + last_seen: "visto pela última vez a: %{how_long_ago}" + friends_since: "amigos desde: %{how_long_ago}" + save: "salvar" + are_you_sure: "Tem certeza?" + remove_friend: "excluir amigo" From 7049cb3ca49f1f1a2208eaf616120c633272f0c1 Mon Sep 17 00:00:00 2001 From: Raphael Date: Wed, 22 Sep 2010 10:31:40 -0700 Subject: [PATCH 171/449] A less efficient, but simpler way of checking whether the photo is the profile photo --- app/views/users/edit.html.haml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/users/edit.html.haml b/app/views/users/edit.html.haml index 880d25ef4..cb578c590 100644 --- a/app/views/users/edit.html.haml +++ b/app/views/users/edit.html.haml @@ -17,11 +17,11 @@ %h3 Picture %div#image_picker - = p.hidden_field :image_url, :value => (@profile.image_url.sub(APP_CONFIG[:pod_url],'/') if @profile.image_url), :id => 'image_url_field' + = p.hidden_field :image_url, :value => (@profile.image_url if @profile.image_url), :id => 'image_url_field' - unless @photos.nil? || @photos.empty? - for photo in @photos - - if @profile.image_url && (photo.url(:thumb_medium) == @profile.image_url.sub(APP_CONFIG[:pod_url],'/')) + - if @profile.image_url && @profile.image_url.include?(photo.url(:thumb_medium)) %div.small_photo{:id => photo.url(:thumb_medium), :class=>'selected'} = check_box_tag 'checked_photo', true, true = link_to image_tag(photo.url(:thumb_medium)), "#" From 6dd7911c8c3a07d2757c946dfa39241733a984c7 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Wed, 22 Sep 2010 10:52:29 -0700 Subject: [PATCH 172/449] DG IZ; update_or_repost --- app/controllers/albums_controller.rb | 2 +- app/controllers/photos_controller.rb | 2 +- app/models/user.rb | 10 ++++++++++ spec/models/user/posting_spec.rb | 23 +++++++++++++++++++++++ 4 files changed, 35 insertions(+), 2 deletions(-) diff --git a/app/controllers/albums_controller.rb b/app/controllers/albums_controller.rb index c6cf7a829..14adcebe1 100644 --- a/app/controllers/albums_controller.rb +++ b/app/controllers/albums_controller.rb @@ -52,7 +52,7 @@ class AlbumsController < ApplicationController data = clean_hash(params[:album]) - if @album.update_attributes data + if current_user.update_or_repost( @album, data ) flash[:notice] = "Album #{@album.name} successfully edited." respond_with @album else diff --git a/app/controllers/photos_controller.rb b/app/controllers/photos_controller.rb index afc193413..8d383f53a 100644 --- a/app/controllers/photos_controller.rb +++ b/app/controllers/photos_controller.rb @@ -88,7 +88,7 @@ class PhotosController < ApplicationController data = clean_hash(params) - if @photo.update_attributes data[:photo] + if current_user.update_or_repost( @photo, data[:photo] ) flash[:notice] = "Photo successfully updated." respond_with @photo else diff --git a/app/models/user.rb b/app/models/user.rb index 06652a494..45f947807 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -122,6 +122,16 @@ class User post end + def update_or_repost( post, post_hash = {} ) + if self.owns? post + if post_hash[:aspect_ids] + repost(post, post_hash[:aspect_ids]) if validate_aspect_permissions post_hash[:aspect_ids] + else + post.update_attributes!(post_hash) + end + end + end + def validate_aspect_permissions(aspect_ids) aspect_ids = [aspect_ids.to_s] if aspect_ids.is_a? BSON::ObjectId diff --git a/spec/models/user/posting_spec.rb b/spec/models/user/posting_spec.rb index da52ed849..6b939b573 100644 --- a/spec/models/user/posting_spec.rb +++ b/spec/models/user/posting_spec.rb @@ -64,6 +64,29 @@ describe User do aspect1.posts.count.should be 1 end end + + describe '#update_or_repost' do + let!(:album) { user.post(:album, :name => "Profile Photos", :to => aspect.id) } + + it 'should repost' do + update_hash = { :aspect_ids => aspect1.id } + user.should_receive(:repost).with(album, update_hash[:aspect_ids]).and_return album + user.update_or_repost( album, update_hash ) + end + + it 'should update fields' do + update_hash = { :name => "Other Photos" } + user.update_or_repost( album, update_hash ) + album.name.should == "Other Photos" + end + + it 'should reject posting to an external aspect' do + update_hash = { :aspect_ids => [aspect3.id] } + proc{ + user.update_or_repost( album, update_hash ) + }.should raise_error /Cannot post to an aspect you do not own./ + end + end end context 'dispatching' do From 894197522443eaa5b2989f1e2dbddb5ade9ba630 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Wed, 22 Sep 2010 10:59:23 -0700 Subject: [PATCH 173/449] DG IZ; example extension convention for app_config --- config/{app_config_example.yml => app_config.yml.example} | 0 config/initializers/_load_app_config.rb | 6 +++--- db/seeds/backer.rb | 2 +- db/seeds/dev.rb | 2 +- db/seeds/tom.rb | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) rename config/{app_config_example.yml => app_config.yml.example} (100%) diff --git a/config/app_config_example.yml b/config/app_config.yml.example similarity index 100% rename from config/app_config_example.yml rename to config/app_config.yml.example diff --git a/config/initializers/_load_app_config.rb b/config/initializers/_load_app_config.rb index 521f9f0a0..e739941e9 100644 --- a/config/initializers/_load_app_config.rb +++ b/config/initializers/_load_app_config.rb @@ -8,10 +8,10 @@ end if File.exist? "#{Rails.root}/config/app_config.yml" all_envs = load_config_yaml "#{Rails.root}/config/app_config.yml" - all_envs = load_config_yaml "#{Rails.root}/config/app_config_example.yml" unless all_envs + all_envs = load_config_yaml "#{Rails.root}/config/app_config.yml.example" unless all_envs else - puts "WARNING: No config/app_config.yml found! Look at config/app_config_example.yml for help." - all_envs = load_config_yaml "#{Rails.root}/config/app_config_example.yml" + puts "WARNING: No config/app_config.yml found! Look at config/app_config.yml.example for help." + all_envs = load_config_yaml "#{Rails.root}/config/app_config.yml.example" end if all_envs[Rails.env.to_s] diff --git a/db/seeds/backer.rb b/db/seeds/backer.rb index 8fa72f23d..20fe90fdf 100644 --- a/db/seeds/backer.rb +++ b/db/seeds/backer.rb @@ -42,7 +42,7 @@ def create end def set_app_config username - current_config = YAML.load(File.read(Rails.root.join('config', 'app_config_example.yml'))) + current_config = YAML.load(File.read(Rails.root.join('config', 'app_config.yml.example'))) current_config[Rails.env.to_s] ||= {} current_config[Rails.env.to_s]['pod_url'] = "#{username}.joindiaspora.com" current_config['default']['pod_url'] = "#{username}.joindiaspora.com" diff --git a/db/seeds/dev.rb b/db/seeds/dev.rb index 4ffa947e7..e2d8a5495 100644 --- a/db/seeds/dev.rb +++ b/db/seeds/dev.rb @@ -7,7 +7,7 @@ require 'config/environment' def set_app_config username - current_config = YAML.load(File.read(Rails.root.join('config', 'app_config_example.yml'))) + current_config = YAML.load(File.read(Rails.root.join('config', 'app_config.yml.example'))) current_config[Rails.env.to_s] ||= {} current_config[Rails.env.to_s]['pod_url'] = "#{username}.joindiaspora.com" current_config['default']['pod_url'] = "#{username}.joindiaspora.com" diff --git a/db/seeds/tom.rb b/db/seeds/tom.rb index 50d41eb91..cc3000d0b 100644 --- a/db/seeds/tom.rb +++ b/db/seeds/tom.rb @@ -7,7 +7,7 @@ require 'config/environment' def set_app_config username - current_config = YAML.load(File.read(Rails.root.join('config', 'app_config_example.yml'))) + current_config = YAML.load(File.read(Rails.root.join('config', 'app_config.yml.example'))) current_config[Rails.env.to_s] ||= {} current_config[Rails.env.to_s]['pod_url'] = "#{username}.joindiaspora.com" current_config['default']['pod_url'] = "#{username}.joindiaspora.com" From 5ef32b7d55947f745256d98658f717da3f91297c Mon Sep 17 00:00:00 2001 From: danielvincent Date: Wed, 22 Sep 2010 12:03:25 -0700 Subject: [PATCH 174/449] DG IZ; a user can repost. aspects are not sent through the websocket. post does not show where it curently is going in its partial --- app/controllers/application_controller.rb | 9 +++++++++ app/views/status_messages/_status_message.html.haml | 6 ++++++ config/routes.rb | 4 +++- 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index f0ca5bfc8..ac0d11b1c 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -37,4 +37,13 @@ class ApplicationController < ActionController::Base @request_count = Request.for_user(current_user).size if current_user end + def repost + @post = current_user.find_visible_post_by_id params[:id] + if current_user.repost( @post, :to => params[:aspect_ids] ) + flash[:notice] = "Item re-shared." + else + flash[:error] = "Failed to re-share." + end + end + end diff --git a/app/views/status_messages/_status_message.html.haml b/app/views/status_messages/_status_message.html.haml index dcee761d1..ee484f47b 100644 --- a/app/views/status_messages/_status_message.html.haml +++ b/app/views/status_messages/_status_message.html.haml @@ -22,3 +22,9 @@ - if current_user.owns?(post) .destroy_link = link_to 'Delete', status_message_path(post), :confirm => 'Are you sure?', :method => :delete, :remote => true, :class => "delete" + + %b reshare: + -if @aspects + - for aspect in @aspects + = link_to aspect, repost_path( :id => post.id, :aspect_ids => aspect.id ) + diff --git a/config/routes.rb b/config/routes.rb index ae757499c..1a7a53925 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -7,12 +7,14 @@ Diaspora::Application.routes.draw do resources :people, :only => [:index, :show, :destroy] resources :users, :except => [:create, :new, :show] - resources :status_messages, :only => [:create, :destroy, :show] + resources :status_messages resources :comments, :except => [:index] resources :requests, :except => [:edit, :update] resources :photos, :except => [:index] resources :albums + match 'repost', :to => 'application#repost', :as => 'repost' + match 'aspects/move_friends', :to => 'aspects#move_friends', :as => 'move_friends' match 'aspects/move_friend', :to => 'aspects#move_friend', :as => 'move_friend' match 'aspects/manage', :to => 'aspects#manage' From de9092363115adca04879f06961d9bd5d7fd8d63 Mon Sep 17 00:00:00 2001 From: Thomas Krehbiel Date: Wed, 22 Sep 2010 18:05:11 -0400 Subject: [PATCH 175/449] Fix for sending unlimited duplicate friend requests --- lib/diaspora/user/friending.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/diaspora/user/friending.rb b/lib/diaspora/user/friending.rb index a4dcdd38d..f3b30f9b3 100644 --- a/lib/diaspora/user/friending.rb +++ b/lib/diaspora/user/friending.rb @@ -8,6 +8,9 @@ module Diaspora module UserModules module Friending def send_friend_request_to(desired_friend, aspect) + # should have different exception types for these? + raise "You have already sent a friend request to that person!" if self.pending_requests.detect{ + |x| x.destination_url == desired_friend.receive_url } raise "You are already friends with that person!" if self.friends.detect{ |x| x.receive_url == desired_friend.receive_url} request = Request.instantiate( From 474cf7770815bb1cf87c277cc9727be9e8d627bc Mon Sep 17 00:00:00 2001 From: danielvincent Date: Wed, 22 Sep 2010 15:05:51 -0700 Subject: [PATCH 176/449] DG IZ; reposting now works. redirects to a template missing page, though. --- app/views/shared/_reshare.haml | 27 +++++++++ .../status_messages/_status_message.html.haml | 8 +-- public/stylesheets/application.css | 37 ++++++++++++ public/stylesheets/sass/application.sass | 56 +++++++++++++++++++ 4 files changed, 122 insertions(+), 6 deletions(-) create mode 100644 app/views/shared/_reshare.haml diff --git a/app/views/shared/_reshare.haml b/app/views/shared/_reshare.haml new file mode 100644 index 000000000..61f48e73b --- /dev/null +++ b/app/views/shared/_reshare.haml @@ -0,0 +1,27 @@ +-# Copyright (c) 2010, Diaspora Inc. This file is +-# licensed under the Affero General Public License version 3. See +-# the COPYRIGHT file. + + + +:javascript + $(".reshare_button").toggle(function(e){ + e.preventDefault(); + $(this).parent(".reshare_pane").children(".reshare_box").fadeIn(200); + }, function(e) { + e.preventDefault(); + $(this).parent(".reshare_pane").children(".reshare_box").fadeOut(200); + }); + +.reshare_pane + %span.reshare_button + = link_to "Reshare", "#" + + %ul.reshare_box + - for aspect in current_user.aspects_with_post( post.id ) + %li.currently_sharing= aspect.name + + - for aspect in current_user.aspects + - unless aspect.posts.include? post + %li.aspect_to_share= link_to aspect, repost_path( :id => post.id, :aspect_ids => aspect.id ) + diff --git a/app/views/status_messages/_status_message.html.haml b/app/views/status_messages/_status_message.html.haml index ee484f47b..33764453f 100644 --- a/app/views/status_messages/_status_message.html.haml +++ b/app/views/status_messages/_status_message.html.haml @@ -17,14 +17,10 @@ \-- = link_to "show comments (#{post.comments.count})", '#', :class => "show_post_comments" - = render "comments/comments", :post => post + = render "comments/comments", :post => post - if current_user.owns?(post) .destroy_link = link_to 'Delete', status_message_path(post), :confirm => 'Are you sure?', :method => :delete, :remote => true, :class => "delete" - - %b reshare: - -if @aspects - - for aspect in @aspects - = link_to aspect, repost_path( :id => post.id, :aspect_ids => aspect.id ) + = render "shared/reshare", :post => post, :current_user => current_user diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index 9e8561cc2..e95107081 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -171,6 +171,40 @@ li.message { li.message .content div.info .time a { color: #666666; } +.reshare_pane { + margin-left: 5px; + margin-right: 5px; + display: inline; + position: relative; } + .reshare_pane ul.reshare_box { + display: none; + z-index: 10; + position: absolute; + margin-top: 5px; + padding: 0; + background-color: #fafafa; + list-style: none; + border: 5px solid #666666; + -webkit-box-shadow: 0 0 5px #666666; + -moz-box-shadow: 0 0 5px #666666; + text-shadow: 0 2px white; + color: black; } + .reshare_pane ul.reshare_box > li { + font-weight: bold; + padding: 8px; + padding-right: 15px; + border-top: 1px solid white; + border-bottom: 1px solid #cccccc; } + .reshare_pane ul.reshare_box > li:first-child { + border-top: none; } + .reshare_pane ul.reshare_box > li:last-child { + border-bottom: none; } + .reshare_pane ul.reshare_box > li a { + display: block; + height: 100%; } + .reshare_pane ul.reshare_box > li a:hover { + background-color: #eeeeee; } + form { position: relative; font-size: 120%; @@ -270,6 +304,9 @@ ul.comment_set { .destroy_link a, .request_button a { color: #999999; font-weight: normal; } + .destroy_link a:hover, .request_button a:hover { + text-decoration: underline; + background: none; } .destroy_link { display: none; diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass index 88145b6df..30f03f8c0 100644 --- a/public/stylesheets/sass/application.sass +++ b/public/stylesheets/sass/application.sass @@ -225,6 +225,58 @@ li.message a :color #666 +.reshare_pane + :margin + :left 5px + :right 5px + :display inline + :position relative + + ul.reshare_box + :display none + :z-index 10 + :position absolute + :margin + :top 5px + :padding 0 + + :background + :color #fafafa + + :list + :style none + + :border 5px solid #666 + :-webkit-box-shadow 0 0 5px #666 + :-moz-box-shadow 0 0 5px #666 + + :text-shadow 0 2px #fff + :color #000 + + > li + :font + :weight bold + + :padding 8px + :right 15px + :border + :top 1px solid #fff + :bottom 1px solid #ccc + + &:first-child + :border + :top none + &:last-child + :border + :bottom none + a + :display block + :height 100% + + &:hover + :background + :color #eee + form :position relative @@ -360,6 +412,10 @@ ul.comment_set :color #999 :font :weight normal + &:hover + :text + :decoration underline + :background none .destroy_link :display none From 10e6ff9df8e3168545d4ba8d074d22e78132d37e Mon Sep 17 00:00:00 2001 From: Thomas Krehbiel Date: Wed, 22 Sep 2010 18:05:11 -0400 Subject: [PATCH 177/449] Fix for sending unlimited duplicate friend requests --- app/controllers/requests_controller.rb | 4 ++-- lib/diaspora/user/friending.rb | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/controllers/requests_controller.rb b/app/controllers/requests_controller.rb index 6087ebe85..2a8090c9e 100644 --- a/app/controllers/requests_controller.rb +++ b/app/controllers/requests_controller.rb @@ -47,8 +47,8 @@ class RequestsController < ApplicationController begin @request = current_user.send_friend_request_to(rel_hash[:friend], aspect) rescue Exception => e - raise e unless e.message.include? "already friends" - flash[:notice] = "You are already friends with #{params[:request][:destination_url]}!" + raise e unless e.message.include? "already" + flash[:notice] = "#{e.message} #{params[:request][:destination_url]}" respond_with :location => aspect return end diff --git a/lib/diaspora/user/friending.rb b/lib/diaspora/user/friending.rb index a4dcdd38d..f3b30f9b3 100644 --- a/lib/diaspora/user/friending.rb +++ b/lib/diaspora/user/friending.rb @@ -8,6 +8,9 @@ module Diaspora module UserModules module Friending def send_friend_request_to(desired_friend, aspect) + # should have different exception types for these? + raise "You have already sent a friend request to that person!" if self.pending_requests.detect{ + |x| x.destination_url == desired_friend.receive_url } raise "You are already friends with that person!" if self.friends.detect{ |x| x.receive_url == desired_friend.receive_url} request = Request.instantiate( From 695e5fe396457b1b894c2ad378f4470574d3e80a Mon Sep 17 00:00:00 2001 From: Raphael Date: Wed, 22 Sep 2010 15:19:26 -0700 Subject: [PATCH 178/449] Don't log huge encrypted params --- config/application.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/config/application.rb b/config/application.rb index b409f91d3..bf3b5699a 100644 --- a/config/application.rb +++ b/config/application.rb @@ -51,5 +51,6 @@ module Diaspora # Configure sensitive parameters which will be filtered from the log file. config.filter_parameters += [:password] + config.filter_parameters += [:xml] end end From b9be543ef6695ee6737b40f9600815247ce7f5dc Mon Sep 17 00:00:00 2001 From: danielvincent Date: Wed, 22 Sep 2010 15:32:11 -0700 Subject: [PATCH 179/449] DG IZ; reshare redirects to specific page --- app/views/shared/_publisher.haml | 2 +- app/views/shared/_reshare.haml | 4 ++-- public/stylesheets/application.css | 1 + public/stylesheets/sass/application.sass | 1 + 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/app/views/shared/_publisher.haml b/app/views/shared/_publisher.haml index 4645ec65c..130f136a9 100644 --- a/app/views/shared/_publisher.haml +++ b/app/views/shared/_publisher.haml @@ -10,7 +10,7 @@ = f.error_messages %p %label{:for => "status_message_message"} Message - = f.text_area :message, :rows => 2 + = f.text_area :message, :rows => 2, :value => params[:prefill] %ul.aspect_selector{ :style => "display:none;"} going to... diff --git a/app/views/shared/_reshare.haml b/app/views/shared/_reshare.haml index 61f48e73b..0b4120d52 100644 --- a/app/views/shared/_reshare.haml +++ b/app/views/shared/_reshare.haml @@ -19,9 +19,9 @@ %ul.reshare_box - for aspect in current_user.aspects_with_post( post.id ) + %li.currently_sharing= aspect.name - for aspect in current_user.aspects - unless aspect.posts.include? post - %li.aspect_to_share= link_to aspect, repost_path( :id => post.id, :aspect_ids => aspect.id ) - + %li.aspect_to_share= link_to aspect, :controller => "aspects", :action => "show", :id => aspect.id, :prefill => post.message diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index e95107081..82bbd8b6d 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -177,6 +177,7 @@ li.message { display: inline; position: relative; } .reshare_pane ul.reshare_box { + width: 150px; display: none; z-index: 10; position: absolute; diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass index 30f03f8c0..7c77a0b79 100644 --- a/public/stylesheets/sass/application.sass +++ b/public/stylesheets/sass/application.sass @@ -233,6 +233,7 @@ li.message :position relative ul.reshare_box + :width 150px :display none :z-index 10 :position absolute From 955d9130a24fdb700b60cb5c241ebde707f5206f Mon Sep 17 00:00:00 2001 From: danielvincent Date: Wed, 22 Sep 2010 15:35:23 -0700 Subject: [PATCH 180/449] DG IZ; shift+enter in publisher box submits contents --- public/javascripts/view.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/public/javascripts/view.js b/public/javascripts/view.js index 4713c7164..092d69f16 100644 --- a/public/javascripts/view.js +++ b/public/javascripts/view.js @@ -41,6 +41,12 @@ $(document).ready(function(){ } ); + $("#publisher textarea").keydown( function(e) { + if (e.shiftKey && e.keyCode == 13) { + $("#publisher form").submit(); + } + }); + });//end document ready From d0dbcd47fc7f76b4faab3e9cbf8166fa1390c666 Mon Sep 17 00:00:00 2001 From: Pistos Date: Tue, 21 Sep 2010 09:18:37 +0800 Subject: [PATCH 181/449] Added a newline after headings where it was missing. --- README.md | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 6e9c40aa0..d20252583 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,8 @@ ## Commit Guidlines + You are welcome to contribute, add and extend Diaspora however you see fit. We will do our best to incorporate everything that meets our guidelines. -We need you to fill out a [contributor agreement form](https://spreadsheets.google.com/a/joindiaspora.com/viewform?formkey=dGI2cHA3ZnNHLTJvbm10LUhXRTJjR0E6MQ&theme=0AX42CRMsmRFbUy1iOGYwN2U2Mi1hNWU0LTRlNjEtYWMyOC1lZmU4ODg1ODc1ODI&ifq) before we can accept your patches. The agreement gives Diaspora joint ownership of the patch so the copyright isn't scattered. You can find it [here](https://spreadsheets.google.com/a/joindiaspora.com/viewform?formkey=dGI2cHA3ZnNHLTJvbm10LUhXRTJjR0E6MQ&theme=0AX42CRMsmRFbUy1iOGYwN2U2Mi1hNWU0LTRlNjEtYWMyOC1lZmU4ODg1ODc1ODI&ifq). +We need you to fill out a [contributor agreement form](https://spreadsheets.google.com/a/joindiaspora.com/viewform?formkey=dGI2cHA3ZnNHLTJvbm10LUhXRTJjR0E6MQ&theme=0AX42CRMsmRFbUy1iOGYwN2U2Mi1hNWU0LTRlNjEtYWMyOC1lZmU4ODg1ODc1ODI&ifq) before we can accept your patches. The agreement gives Diaspora joint ownership of the patch so the copyright isn't scattered. You can find it [here](https://spreadsheets.google.com/a/joindiaspora.com/viewform?formkey=dGI2cHA3ZnNHLTJvbm10LUhXRTJjR0E6MQ&theme=0AX42CRMsmRFbUy1iOGYwN2U2Mi1hNWU0LTRlNjEtYWMyOC1lZmU4ODg1ODc1ODI&ifq). All commits must be tested, and after each commit, all tests should be green before a pull request is sent. Please write your tests in Rspec. @@ -14,7 +15,7 @@ The privacy aware, personally controlled, do-it-all, open source social network. **DISCLAIMER: THIS IS PRE-ALPHA SOFTWARE AND SHOULD BE TREATED ACCORDINGLY.** **PLEASE, DO NOT RUN IN PRODUCTION. IT IS FUN TO GET RUNNING, BUT EXPECT THINGS TO BE BROKEN** -Also, we really want to continue to focus on features and improving the code base. When we think it is +Also, we really want to continue to focus on features and improving the code base. When we think it is ready for general use, we will post more detailed instructions. ## Notice @@ -30,6 +31,7 @@ We will try and fully support more webservers later, but that is what works for These instructions are for machines running [Ubuntu](http://www.ubuntu.com/), [Fedora](http://www.fedoraproject.org) or Mac OS X. We are developing Diaspora for the latest and greatest browsers, so please update your Firefox, Chrome or Safari to the latest and greatest. ## Preparing your system + In order to run Diaspora, you will need to download the following dependencies (specific instructions follow): - Build Tools - Packages needed to compile the components that follow. @@ -64,7 +66,7 @@ To install Ruby 1.8.7 on **Ubuntu**, run the following command: sudo apt-get install ruby-full -Please note that you need to have Universe enabled in your /etc/apt/sources.list file to install ruby using apt-get. +Please note that you need to have Universe enabled in your /etc/apt/sources.list file to install ruby using apt-get. At this time Fedora does not have Ruby 1.8.7. As a workaround it is possible to use [rvm](http://rvm.beginrescueend.com/) with a locally compiled Ruby installation. A semi automated method for doing this is available. It is highly recommended that you review the script before running it so you understand what will occur. The script can be executed by running the following command: @@ -90,11 +92,11 @@ Then run: You can also run the binary directly by doing the following: -If you're running a 32-bit system, run: +If you're running a 32-bit system, run: wget http://fastdl.mongodb.org/linux/mongodb-linux-i686-1.6.2.tgz - -If you're running a 64-bit system, run: + +If you're running a 64-bit system, run: wget http://fastdl.mongodb.org/linux/mongodb-linux-x86_64-1.6.2.tgz @@ -202,9 +204,11 @@ If you have never used github before, their [help desk](http://help.github.com/) ## Running Diaspora ### Install required gems + To start the app server for the first time, you need to use Bundler to install Diaspora's gem depencencies. Run `bundle install` from Diaspora's root directory. Bundler will also warn you if there is a new dependency and you need to bundle install again. ### Start Mongo + If you installed the Ubuntu package, MongoDB should already be running (if not, run `service mongodb start`). If you installed the binary manually, run `sudo mongod` from where mongo is installed to start mongo. If you installed the Fedora package, MongoDB will need to be started via `service mongodb start`. If you installed the binary manually, run `sudo mongod` from where Mongo is installed to start Mongo. @@ -214,19 +218,24 @@ If you installed the OsX package through "brew", MongoDB will need to be started Diaspora will not run unless Mongo is running. Mongo will not run by default, and will need to be started every time you wish to use or run the test suite for Diaspora. ### Run the server + `./script/server` will start both thin and the websocket server. If you want to run a different app server, you will have to run them separately. See below for instructions. ### Run the app server + Once mongo is running and bundler has finished, run `bundle exec thin start` from the root Diaspora directory. This will start the app server in development mode[.](http://bit.ly/9mwtUw) ### Run the websocket server + run `bundle exec ruby ./script/websocket_server` to start the websocket server on port 8080. Change the port in config/app_config.yml. ### Logging in with a sample user + Run `rake db:seed:tom`, then login with user `tom` and password `evankorth`. More details in db/seeds/tom.rb. ### Testing + Diaspora's test suite uses [rspec](http://rspec.info/), a behavior driven testing framework. In order to run the tests, run `bundle exec rspec spec`. ## Resources From e9d16cc09b5c6dd2ae256658e0ec8b30fb56f882 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Wed, 22 Sep 2010 15:48:50 -0700 Subject: [PATCH 182/449] DG IZ; cleanup --- app/controllers/albums_controller.rb | 2 +- app/controllers/application_controller.rb | 9 --------- app/controllers/photos_controller.rb | 2 +- app/models/user.rb | 8 ++------ config/routes.rb | 2 -- spec/models/user/posting_spec.rb | 17 ++--------------- 6 files changed, 6 insertions(+), 34 deletions(-) diff --git a/app/controllers/albums_controller.rb b/app/controllers/albums_controller.rb index 14adcebe1..d3cad54e2 100644 --- a/app/controllers/albums_controller.rb +++ b/app/controllers/albums_controller.rb @@ -52,7 +52,7 @@ class AlbumsController < ApplicationController data = clean_hash(params[:album]) - if current_user.update_or_repost( @album, data ) + if current_user.update_post( @album, data ) flash[:notice] = "Album #{@album.name} successfully edited." respond_with @album else diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index ac0d11b1c..f0ca5bfc8 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -37,13 +37,4 @@ class ApplicationController < ActionController::Base @request_count = Request.for_user(current_user).size if current_user end - def repost - @post = current_user.find_visible_post_by_id params[:id] - if current_user.repost( @post, :to => params[:aspect_ids] ) - flash[:notice] = "Item re-shared." - else - flash[:error] = "Failed to re-share." - end - end - end diff --git a/app/controllers/photos_controller.rb b/app/controllers/photos_controller.rb index 8d383f53a..d0cb1871e 100644 --- a/app/controllers/photos_controller.rb +++ b/app/controllers/photos_controller.rb @@ -88,7 +88,7 @@ class PhotosController < ApplicationController data = clean_hash(params) - if current_user.update_or_repost( @photo, data[:photo] ) + if current_user.update_post( @photo, data[:photo] ) flash[:notice] = "Photo successfully updated." respond_with @photo else diff --git a/app/models/user.rb b/app/models/user.rb index 45f947807..8f74e2233 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -122,13 +122,9 @@ class User post end - def update_or_repost( post, post_hash = {} ) + def update_post( post, post_hash = {} ) if self.owns? post - if post_hash[:aspect_ids] - repost(post, post_hash[:aspect_ids]) if validate_aspect_permissions post_hash[:aspect_ids] - else - post.update_attributes!(post_hash) - end + post.update_attributes(post_hash) end end diff --git a/config/routes.rb b/config/routes.rb index 1a7a53925..0ac115b76 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -13,8 +13,6 @@ Diaspora::Application.routes.draw do resources :photos, :except => [:index] resources :albums - match 'repost', :to => 'application#repost', :as => 'repost' - match 'aspects/move_friends', :to => 'aspects#move_friends', :as => 'move_friends' match 'aspects/move_friend', :to => 'aspects#move_friend', :as => 'move_friend' match 'aspects/manage', :to => 'aspects#manage' diff --git a/spec/models/user/posting_spec.rb b/spec/models/user/posting_spec.rb index 6b939b573..d307e7a43 100644 --- a/spec/models/user/posting_spec.rb +++ b/spec/models/user/posting_spec.rb @@ -65,27 +65,14 @@ describe User do end end - describe '#update_or_repost' do + describe '#update_post' do let!(:album) { user.post(:album, :name => "Profile Photos", :to => aspect.id) } - it 'should repost' do - update_hash = { :aspect_ids => aspect1.id } - user.should_receive(:repost).with(album, update_hash[:aspect_ids]).and_return album - user.update_or_repost( album, update_hash ) - end - it 'should update fields' do update_hash = { :name => "Other Photos" } - user.update_or_repost( album, update_hash ) + user.update_post( album, update_hash ) album.name.should == "Other Photos" end - - it 'should reject posting to an external aspect' do - update_hash = { :aspect_ids => [aspect3.id] } - proc{ - user.update_or_repost( album, update_hash ) - }.should raise_error /Cannot post to an aspect you do not own./ - end end end From 5fad23c63245301d3bbc71274d9788f6077b6c67 Mon Sep 17 00:00:00 2001 From: Raphael Date: Wed, 22 Sep 2010 15:53:40 -0700 Subject: [PATCH 183/449] Adjust readme wording --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2aeba0670..4e5152fbf 100644 --- a/README.md +++ b/README.md @@ -26,8 +26,8 @@ network. **PLEASE, DO NOT RUN IN PRODUCTION. IT IS FUN TO GET RUNNING, BUT EXPECT THINGS TO BE BROKEN** -Also, we really want to continue to focus on features and improving the code -base. When we think it is ready for general use, we will post more detailed +We are continuing to build features and improve the code base. +When we think it is ready for general use, we will post more detailed instructions. ## Notice From fcc681df71f7876a609b105e06fa72d173e5999b Mon Sep 17 00:00:00 2001 From: danielvincent Date: Wed, 22 Sep 2010 16:32:52 -0700 Subject: [PATCH 184/449] DG IZ moved to be APP_CONFIG for host --- app/controllers/services_controller.rb | 2 +- app/controllers/users_controller.rb | 2 +- app/views/shared/_aspect_nav.haml | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/controllers/services_controller.rb b/app/controllers/services_controller.rb index 567a1d144..b254b0a63 100644 --- a/app/controllers/services_controller.rb +++ b/app/controllers/services_controller.rb @@ -11,7 +11,7 @@ class ServicesController < ApplicationController code = params['code'] # Facebooks verification string if code - access_token_hash = MiniFB.oauth_access_token(FB_APP_ID, HOST + "services/create", FB_SECRET, code) + access_token_hash = MiniFB.oauth_access_token(FB_APP_ID, APP_CONFIG[:pod_url] + "services/create", FB_SECRET, code) p access_token_hash @access_token = access_token_hash["access_token"] diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 76ed944dd..c425729b2 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -14,7 +14,7 @@ class UsersController < ApplicationController @profile = @user.profile @photos = Photo.find_all_by_person_id(@person.id).paginate :page => params[:page], :order => 'created_at DESC' - @fb_access_url = MiniFB.oauth_url(FB_APP_ID, HOST + "services/create", + @fb_access_url = MiniFB.oauth_url(FB_APP_ID, APP_CONFIG[:pod_url] + "services/create", :scope=>MiniFB.scopes.join(",")) end diff --git a/app/views/shared/_aspect_nav.haml b/app/views/shared/_aspect_nav.haml index dbca3bbef..55da1bcdf 100644 --- a/app/views/shared/_aspect_nav.haml +++ b/app/views/shared/_aspect_nav.haml @@ -8,11 +8,11 @@ - for aspect in @aspects %li{:class => ("selected" if current_aspect?(aspect))} = link_for_aspect aspect - - %ul{ :style => "position:absolute;right:0;bottom:0.01em;"} %li{:class => ("selected" if @aspect == :all)} = link_to "All Aspects", root_url + %ul{ :style => "position:absolute;right:0;bottom:0.01em;"} + %li{ :style => "margin-right:0;", :class => ("selected" if @aspect == :manage)} = link_to ( (@request_count == 0)? "Manage Aspects" : "Manage Aspects (#{@request_count})"), {:controller => :aspects, :action => :manage}, :class => "edit_aspect_button", :class => new_request(@request_count), :title => "Manage your Aspects" From 53c0aff23db50d39cd814704a2eabfc64f5592fe Mon Sep 17 00:00:00 2001 From: danielvincent Date: Wed, 22 Sep 2010 16:34:42 -0700 Subject: [PATCH 185/449] deploy from the right branch --- config/deploy_config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/deploy_config.yml b/config/deploy_config.yml index c653b6565..f724ec383 100644 --- a/config/deploy_config.yml +++ b/config/deploy_config.yml @@ -8,7 +8,7 @@ cross_server: deploy_to: '/usr/local/app/diaspora' user: 'root' repo: 'git@github.com:diaspora/diaspora.git' - branch: 'master' + branch: 'fb' default_env: 'development' servers: tom: From 159d72c04c1d1f3c1cc6fc69f2e32b1c3eb5080d Mon Sep 17 00:00:00 2001 From: danielvincent Date: Wed, 22 Sep 2010 16:56:39 -0700 Subject: [PATCH 186/449] DG IZ; logged in as? --- app/controllers/application_controller.rb | 6 ++++++ app/views/users/edit.html.haml | 14 +++++++++++--- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index f0ca5bfc8..0060a8989 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -9,6 +9,7 @@ class ApplicationController < ActionController::Base before_filter :set_friends_and_status, :except => [:create, :update] before_filter :count_requests + before_filter :fb_user_info layout :layout_by_resource @@ -37,4 +38,9 @@ class ApplicationController < ActionController::Base @request_count = Request.for_user(current_user).size if current_user end + def fb_user_info + @access_token = cookies[:access_token] + @logged_in = @access_token.present? + end + end diff --git a/app/views/users/edit.html.haml b/app/views/users/edit.html.haml index ddbc9c10a..bfb4e92e1 100644 --- a/app/views/users/edit.html.haml +++ b/app/views/users/edit.html.haml @@ -56,10 +56,18 @@ %br %br - %h3 Connect with Facebook - %p - = link_to "Login to Facebook", @fb_access_url + %h2 Services + + %h3 Facebook + + - if @logged_in + Logged in to facebook as + - @response_hash = MiniFB.get(@access_token, @id, :type => "user") + = @response_hash[:user][:name] + %p + = link_to "Login to Facebook", @fb_access_url + #submit_block = link_to "Cancel", root_path From 26478403e2efeb2906510ea74509e2870cc3e06e Mon Sep 17 00:00:00 2001 From: danielvincent Date: Wed, 22 Sep 2010 17:14:58 -0700 Subject: [PATCH 187/449] DG IZ; connecting/disconnecting from fb --- app/controllers/application_controller.rb | 2 +- app/controllers/services_controller.rb | 11 +++++++++-- app/views/users/edit.html.haml | 15 ++++++++------- config/routes.rb | 1 + 4 files changed, 19 insertions(+), 10 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 0060a8989..2fecb4f90 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -39,7 +39,7 @@ class ApplicationController < ActionController::Base end def fb_user_info - @access_token = cookies[:access_token] + @access_token = session[:access_token] @logged_in = @access_token.present? end diff --git a/app/controllers/services_controller.rb b/app/controllers/services_controller.rb index b254b0a63..ab654e739 100644 --- a/app/controllers/services_controller.rb +++ b/app/controllers/services_controller.rb @@ -16,10 +16,17 @@ class ServicesController < ApplicationController @access_token = access_token_hash["access_token"] # TODO: This is where you'd want to store the token in your database - # but for now, we'll just keep it in the cookie so we don't need a database - cookies[:access_token] = @access_token + # but for now, we'll just keep it in the session so we don't need a database + session[:access_token] = @access_token flash[:success] = "Authentication successful." end redirect_to edit_user_url current_user end + + def destroy + session[:access_token] = nil + session[:user_id] = nil + redirect_to edit_user_url current_url + end + end diff --git a/app/views/users/edit.html.haml b/app/views/users/edit.html.haml index bfb4e92e1..924b0f72f 100644 --- a/app/views/users/edit.html.haml +++ b/app/views/users/edit.html.haml @@ -60,13 +60,14 @@ %h2 Services %h3 Facebook - - - if @logged_in - Logged in to facebook as - - @response_hash = MiniFB.get(@access_token, @id, :type => "user") - = @response_hash[:user][:name] - %p - = link_to "Login to Facebook", @fb_access_url + %p + - if @logged_in + Connected to facebook as + - @response_hash = MiniFB.get(@access_token, 'me') + = @response_hash[:name] + = link_to "Disconnect from Facebook", services_destroy_path + - else + = link_to "Connect to Facebook", @fb_access_url #submit_block diff --git a/config/routes.rb b/config/routes.rb index 016a89bcb..57e58e9aa 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -19,6 +19,7 @@ Diaspora::Application.routes.draw do resources :aspects, :except => [:edit] match 'services/create', :to => "services#create" + match 'services/destroy', :to => "services#destroy" match 'warzombie', :to => "dev_utilities#warzombie" match 'zombiefriends', :to => "dev_utilities#zombiefriends" From aef3c8d7bbeea1980845ad61a091b73cb2992e8f Mon Sep 17 00:00:00 2001 From: danielvincent Date: Wed, 22 Sep 2010 17:16:16 -0700 Subject: [PATCH 188/449] indent, whoops --- app/views/users/edit.html.haml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/app/views/users/edit.html.haml b/app/views/users/edit.html.haml index 924b0f72f..1973d9a25 100644 --- a/app/views/users/edit.html.haml +++ b/app/views/users/edit.html.haml @@ -59,15 +59,15 @@ %h2 Services - %h3 Facebook - %p - - if @logged_in - Connected to facebook as - - @response_hash = MiniFB.get(@access_token, 'me') - = @response_hash[:name] - = link_to "Disconnect from Facebook", services_destroy_path - - else - = link_to "Connect to Facebook", @fb_access_url + %h3 Facebook + %p + - if @logged_in + Connected to facebook as + - @response_hash = MiniFB.get(@access_token, 'me') + = @response_hash[:name] + = link_to "Disconnect from Facebook", services_destroy_path + - else + = link_to "Connect to Facebook", @fb_access_url #submit_block From ddbde60e8cf715ca25071bc2e3ad06d20686b363 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Wed, 22 Sep 2010 17:17:24 -0700 Subject: [PATCH 189/449] another indent... --- app/views/users/edit.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/users/edit.html.haml b/app/views/users/edit.html.haml index 1973d9a25..56a537c98 100644 --- a/app/views/users/edit.html.haml +++ b/app/views/users/edit.html.haml @@ -60,7 +60,7 @@ %h2 Services %h3 Facebook - %p + %p - if @logged_in Connected to facebook as - @response_hash = MiniFB.get(@access_token, 'me') From ae58120deb8071092994a048c3e010a31014cd34 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Wed, 22 Sep 2010 17:18:46 -0700 Subject: [PATCH 190/449] another typo... --- app/controllers/services_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/services_controller.rb b/app/controllers/services_controller.rb index ab654e739..e13820b5a 100644 --- a/app/controllers/services_controller.rb +++ b/app/controllers/services_controller.rb @@ -26,7 +26,7 @@ class ServicesController < ApplicationController def destroy session[:access_token] = nil session[:user_id] = nil - redirect_to edit_user_url current_url + redirect_to edit_user_url current_user end end From bc70ebdb950836d0e1d1bd661516ac749d2243a1 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Wed, 22 Sep 2010 17:33:57 -0700 Subject: [PATCH 191/449] DG IZ; quick form in user edit --- app/controllers/services_controller.rb | 8 ++++++++ app/views/users/edit.html.haml | 6 ++++++ 2 files changed, 14 insertions(+) diff --git a/app/controllers/services_controller.rb b/app/controllers/services_controller.rb index e13820b5a..d6a7db8a7 100644 --- a/app/controllers/services_controller.rb +++ b/app/controllers/services_controller.rb @@ -29,4 +29,12 @@ class ServicesController < ApplicationController redirect_to edit_user_url current_user end + def fb_post + id = 'me' + type = 'feed' + + @res = MiniFB.post(@access_token, id, :type=>type, :metadata=>true, :params=>params) + redirect_to user_edit_url current_user + end + end diff --git a/app/views/users/edit.html.haml b/app/views/users/edit.html.haml index 56a537c98..5f8e1e4f6 100644 --- a/app/views/users/edit.html.haml +++ b/app/views/users/edit.html.haml @@ -65,6 +65,12 @@ Connected to facebook as - @response_hash = MiniFB.get(@access_token, 'me') = @response_hash[:name] + + + - form_tag :controller => "services", :action => "fb_post" + = text_area_tag "message" + = submit_tag "send it off" + = link_to "Disconnect from Facebook", services_destroy_path - else = link_to "Connect to Facebook", @fb_access_url From 0c2480c9be3b4369ab30df8c16cbcf225ccb94fc Mon Sep 17 00:00:00 2001 From: danielvincent Date: Wed, 22 Sep 2010 17:34:57 -0700 Subject: [PATCH 192/449] DG IZ; quick form in user edit --- config/routes.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/config/routes.rb b/config/routes.rb index 57e58e9aa..269622156 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -20,6 +20,7 @@ Diaspora::Application.routes.draw do match 'services/create', :to => "services#create" match 'services/destroy', :to => "services#destroy" + match 'services/fb_post', :to => "services#fb_post" match 'warzombie', :to => "dev_utilities#warzombie" match 'zombiefriends', :to => "dev_utilities#zombiefriends" From fc0350e4e13e8934a987b4310a1b489babe836b4 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Wed, 22 Sep 2010 17:49:11 -0700 Subject: [PATCH 193/449] DG IZ; user can post a status update from user edit page to facebook. --- app/controllers/services_controller.rb | 2 +- app/views/users/edit.html.haml | 38 ++++++++++++++------------ 2 files changed, 22 insertions(+), 18 deletions(-) diff --git a/app/controllers/services_controller.rb b/app/controllers/services_controller.rb index d6a7db8a7..373eb100e 100644 --- a/app/controllers/services_controller.rb +++ b/app/controllers/services_controller.rb @@ -34,7 +34,7 @@ class ServicesController < ApplicationController type = 'feed' @res = MiniFB.post(@access_token, id, :type=>type, :metadata=>true, :params=>params) - redirect_to user_edit_url current_user + redirect_to edit_user_url current_user end end diff --git a/app/views/users/edit.html.haml b/app/views/users/edit.html.haml index 5f8e1e4f6..1c345559e 100644 --- a/app/views/users/edit.html.haml +++ b/app/views/users/edit.html.haml @@ -57,29 +57,33 @@ %br - %h2 Services - - %h3 Facebook - %p - - if @logged_in - Connected to facebook as - - @response_hash = MiniFB.get(@access_token, 'me') - = @response_hash[:name] - - - - form_tag :controller => "services", :action => "fb_post" - = text_area_tag "message" - = submit_tag "send it off" - - = link_to "Disconnect from Facebook", services_destroy_path - - else - = link_to "Connect to Facebook", @fb_access_url #submit_block = link_to "Cancel", root_path or = f.submit "Update Profile" + + + +%h2 Services + +%h3 Facebook +%p + - if @logged_in + Connected to facebook as + - @response_hash = MiniFB.get(@access_token, 'me') + = @response_hash[:name] + + + - form_tag :controller => "services", :action => "fb_post" do + = text_area_tag "message" + = submit_tag "send it off" + + = link_to "Disconnect from Facebook", services_destroy_path + - else + = link_to "Connect to Facebook", @fb_access_url + - end #content_bottom .back From 7303212784c865cf1aaea8257c13cdd1bf30e239 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Wed, 22 Sep 2010 17:50:47 -0700 Subject: [PATCH 194/449] DG IZ; haml typo --- app/views/users/edit.html.haml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/views/users/edit.html.haml b/app/views/users/edit.html.haml index 1c345559e..fb9de28be 100644 --- a/app/views/users/edit.html.haml +++ b/app/views/users/edit.html.haml @@ -75,15 +75,13 @@ - @response_hash = MiniFB.get(@access_token, 'me') = @response_hash[:name] - - - form_tag :controller => "services", :action => "fb_post" do + - form_tag "/services/fb_post" do = text_area_tag "message" = submit_tag "send it off" = link_to "Disconnect from Facebook", services_destroy_path - else = link_to "Connect to Facebook", @fb_access_url - - end #content_bottom .back From bfd39b01b6549deb8e7ecee1207c82d713453eaf Mon Sep 17 00:00:00 2001 From: Raphael Date: Wed, 22 Sep 2010 20:50:01 -0700 Subject: [PATCH 195/449] Readme wording adjustment --- README.md | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 4e5152fbf..c02b369e7 100644 --- a/README.md +++ b/README.md @@ -33,15 +33,13 @@ instructions. ## Notice We currently run Diaspora with the [thin](http://code.macournoyer.com/thin/) as -our webserver, behind [nginx](http://wiki.nginx.org/Main). Diaspora uses the -asynchronous feature of [EventMachine](http://rubyeventmachine.com/) to send -messages between seeds, using the power of the -[Reactor](http://en.wikipedia.org/wiki/Reactor_pattern) pattern. If you use -mod_rails, mongrel, or another non-eventmachine based application server, -federation and/or websockets may not work. +our webserver, behind [nginx](http://wiki.nginx.org/Main). Diaspora uses an +asynchronous [EventMachine](http://rubyeventmachine.com/) queue inside the appserver +to send messages between seeds. If you use mod_rails, mongrel, or another +non-eventmachine based application server, federation may not work. If you don't like thin, you can always try -[Rainbows!](http://rainbows.rubyforge.org/) We will try and fully support more +[Rainbows!](http://rainbows.rubyforge.org/) We will try to fully support more webservers later, but that is what works for now. These instructions are for machines running [Ubuntu](http://www.ubuntu.com/), From e179ae5b55aa181d5e7cfdcd23cbc58f8474adfc Mon Sep 17 00:00:00 2001 From: Raphael Date: Wed, 22 Sep 2010 20:52:44 -0700 Subject: [PATCH 196/449] Add mention of app_config.yml to readme --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index c02b369e7..0d5cee400 100644 --- a/README.md +++ b/README.md @@ -279,6 +279,12 @@ Diaspora will not run unless Mongo is running. Mongo will not run by default, and will need to be started every time you wish to use or run the test suite for Diaspora. +### Configure Diaspora + +Diaspora needs to know where on the internet it is. Copy config/app_config_example.yml +to config/app_config.yml, put your url into the url field, and make any other +needed configuration changes. + ### Run the server `./script/server` will start both thin and the websocket server. If you want From cc3819c256a0db250fe70e832d17f64e5e9b4fce Mon Sep 17 00:00:00 2001 From: Raphael Date: Wed, 22 Sep 2010 21:39:22 -0700 Subject: [PATCH 197/449] Forgot a merge conflict --- app/views/aspects/manage.html.haml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/app/views/aspects/manage.html.haml b/app/views/aspects/manage.html.haml index 251a8d9a6..af64fcc23 100644 --- a/app/views/aspects/manage.html.haml +++ b/app/views/aspects/manage.html.haml @@ -61,11 +61,4 @@ %div{:id => "add_request_pane_#{aspect.id}"} = render "requests/new_request", :aspect => aspect -<<<<<<< HEAD -%p - %br - = link_to t('.update_aspects'), '#', :class => 'button', :id => "move_friends_link" - -======= ->>>>>>> master #content_bottom From 1964bd5ecfc6fa26995067ea4f04b2e4ba44b105 Mon Sep 17 00:00:00 2001 From: Raphael Date: Wed, 22 Sep 2010 21:57:00 -0700 Subject: [PATCH 198/449] Hit the right thing in aspects move friend --- config/locales/en.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/locales/en.yml b/config/locales/en.yml index d25c04591..8e6542639 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -94,8 +94,8 @@ en: failure: "Aspect editing failed for friend %{real_name}." success: "Aspects edited successfully." move_friend: - error: "didn't work %{inspect}" - notice: "You are now showing your friend a different aspect of yourself." + failure: "didn't work %{inspect}" + success: "You are now showing your friend a different aspect of yourself." helper: remove: "remove" aspect_not_empty: "Aspect not empty" From 5edd054ac78a00057d74d61ffb8d8bf8c19a358a Mon Sep 17 00:00:00 2001 From: Steve Conover Date: Wed, 22 Sep 2010 22:22:18 -0700 Subject: [PATCH 199/449] MS Use class_eval because of some sort of load ordering issue --- spec/controllers/sockets_controller_spec.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/controllers/sockets_controller_spec.rb b/spec/controllers/sockets_controller_spec.rb index 4104d0d51..799d37500 100644 --- a/spec/controllers/sockets_controller_spec.rb +++ b/spec/controllers/sockets_controller_spec.rb @@ -6,11 +6,11 @@ require File.dirname(__FILE__) + '/../spec_helper' -class SocketsController +SocketsController.class_eval <<-EOT def url_options {:host => ""} end -end +EOT describe SocketsController do render_views From 494f765066204e92c685f990a41f988bc1b53ab0 Mon Sep 17 00:00:00 2001 From: Raphael Date: Wed, 22 Sep 2010 22:57:53 -0700 Subject: [PATCH 200/449] fix_diaspora_handle rake task --- lib/tasks/db.rake | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/lib/tasks/db.rake b/lib/tasks/db.rake index 80e3bafe5..32aabc0db 100644 --- a/lib/tasks/db.rake +++ b/lib/tasks/db.rake @@ -58,19 +58,12 @@ namespace :db do task :fix_diaspora_handle do puts "fixing the people in this seed" require 'config/environment' - - people = Person.all( '$where' => "function(){ - return this.diaspora_handle.charAt(this.diaspora_handle.length-1) == '@' - }") - - puts "Found #{people.count} people with broken diaspora_handle fields" - people.each do |person| + Person.where(:url => 'example.org').all.each{|person| if person.owner - puts "Resetting diaspora handle for #{person.owner.username}" + person.url = APP_CONFIG[:pod_url] person.diaspora_handle = person.owner.diaspora_handle - person.save end - end + } puts "everything should be peachy" end end From f11a481ed7f3c57f6fc73525e8892ed1828264c0 Mon Sep 17 00:00:00 2001 From: Raphael Date: Wed, 22 Sep 2010 22:59:17 -0700 Subject: [PATCH 201/449] Actually do something --- lib/tasks/db.rake | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/tasks/db.rake b/lib/tasks/db.rake index 32aabc0db..c0d289cda 100644 --- a/lib/tasks/db.rake +++ b/lib/tasks/db.rake @@ -62,6 +62,7 @@ namespace :db do if person.owner person.url = APP_CONFIG[:pod_url] person.diaspora_handle = person.owner.diaspora_handle + person.save end } puts "everything should be peachy" From c711e85c89a887bec7d8cbd7e2f8298dcc2359be Mon Sep 17 00:00:00 2001 From: uiri Date: Wed, 22 Sep 2010 09:33:37 +0800 Subject: [PATCH 202/449] adding gif support --- app/views/photos/_new_photo.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/photos/_new_photo.haml b/app/views/photos/_new_photo.haml index 0f1e423fb..abb8cf528 100644 --- a/app/views/photos/_new_photo.haml +++ b/app/views/photos/_new_photo.haml @@ -8,7 +8,7 @@ var uploader = new qq.FileUploader({ element: document.getElementById('file-upload'), params: {'album_id' : "#{@album.id}"}, - allowedExtensions: ['jpg', 'jpeg', 'png'], + allowedExtensions: ['jpg', 'jpeg', 'png', 'gif'], action: "#{photos_path}" }); } From 1625f6b1314dc5bd3d0dc12ad1cfb7484896b563 Mon Sep 17 00:00:00 2001 From: mousey Date: Tue, 21 Sep 2010 07:02:12 +0800 Subject: [PATCH 203/449] Welsh Language Localization. --- config/locales/devise.cy.yml | 42 ++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 config/locales/devise.cy.yml diff --git a/config/locales/devise.cy.yml b/config/locales/devise.cy.yml new file mode 100644 index 000000000..4f89f9b34 --- /dev/null +++ b/config/locales/devise.cy.yml @@ -0,0 +1,42 @@ +# Copyright (c) 2010, Diaspora Inc. This file is +# licensed under the Affero General Public License version 3. See +# the COPYRIGHT file. + + +cy: + errors: + messages: + not_found: "ni chanfuwyd" + already_confirmed: "cadarnhawyd eisioes" + not_locked: "heb ei gloi" + + devise: + failure: + unauthenticated: 'Mae angen i chi arwyddo i mewn neu ymuno cyn parhau.' + unconfirmed: 'Rhaid i chi gadarnhau eich cyfrif cyn parhau.' + locked: 'Mae eich cyfrif wedi'i gloi.' + invalid: 'E-bost neu gyfrinair annilys.' + invalid_token: 'Tocyn dilysu annilys.' + timeout: 'Mae eich sesiwn wedi dod i ben, arwyddwch i mewn eto i barhau.' + inactive: 'Nid yw eich cyfrif wedi'i actifadu.' + sessions: + signed_in: 'Arwyddwyd i fewn yn llwyddiannus.' + signed_out: 'Arwyddwyd allan yn llwyddiannus.' + passwords: + send_instructions: 'Byddwch yn derbyn e-bost â chyfarwyddiadau ar sut i gadarnhau eich cyfrif mewn ychydig funudau.' + updated: 'Newidiwyd eich cyfrinair yn llwyddiannus. Rydych chi wedi arwyddo i fewn.' + confirmations: + send_instructions: 'Byddwch yn derbyn e-bost â chyfarwyddiadau ar sut i gadarnhau eich cyfrif mewn ychydig funudau.' + confirmed: 'Cadarnhawyd eich cyfrif yn llwyddiannus. Rydych chi wedi arwyddo i fewn.' + registrations: + signed_up: 'Rydych chi wedi arwyddo i fyny yn llwyddiannus. Anfonwyd cadarnhad at eich e-bost os yw wedi'i alluogi.' + updated: 'Diweddarwyd eich cyfrif yn llwyddiannus.' + destroyed: 'Hwyl fawr! Canslwyd eich cyfrif yn llwyddiannus. Rydym yn gobeithio gweld chi eto yn fuan.' + unlocks: + send_instructions: 'Byddwch yn derbyn e-bost gyda cyfarwyddiadau ar sut i agor eich cyfrif mewn ychydig funudau.' + unlocked: 'Datglowyd eich cyfrif yn llwyddiannus. Rydych chi wedi arwyddo i fewn.' + mailer: + confirmation_instructions: 'Cyfarwyddiadau cadarnhad.' + reset_password_instructions: 'Ailosod cyfarwyddiadau cyfrinair' + unlock_instructions: 'Cyfarwyddiadau Datgloi' + \ No newline at end of file From b1dd054fdb4454d4d5cb1b313619ee5876b3d0f6 Mon Sep 17 00:00:00 2001 From: mousey Date: Wed, 22 Sep 2010 01:25:15 +0800 Subject: [PATCH 204/449] More Welsh Localization --- config/locales/cy.yml | 143 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 143 insertions(+) create mode 100644 config/locales/cy.yml diff --git a/config/locales/cy.yml b/config/locales/cy.yml new file mode 100644 index 000000000..b7d9c9af4 --- /dev/null +++ b/config/locales/cy.yml @@ -0,0 +1,143 @@ +# Copyright (c) 2010, Diaspora Inc. This file is +# licensed under the Affero General Public License version 3. See +# the COPYRIGHT file. + + +# Sample localization file for English. Add more files in this directory for other locales. +# See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. + +cy: + hello: "Helo byd" + layouts: + application: + edit_profile: "golygu proffil" + logout: "arwyddo allan" + shared: + aspect_nav: + all_aspects: "Pob agwedd" + manage: "Rheoli" + manage_your_aspects: "Rheoli eich agweddau" + sub_header: + all_aspects: "Pob agwedd" + manage_aspects: "Rheloi agweddau" + publisher: + share: "Rhannu" + aspect_friends: + add_friends: "ychwanegu ffrindiau" + albums: + album: + you: "chi" + new_album: + create: "creu" + add_a_new_album: "Ychwanegu albwm newydd" + show: + edit_album: "Golygu Albwm" + albums: "albymau" + updated: "diweddarwyd" + by: "gan" + edit: + editing: "Wrthi'n golygu" + updated: "diweddarwyd" + are_you_sure: "Ydych chi'n sicr?" + delete_album: "Dileu Albwm" + cancel: "Cancel" + index: + home: "adref" + new_album: "Albwm Newydd" + create: + success: "Chi wedi creu albwm a'i enwi'n %{name}." + update: + success: "Mae albwm %{name} wedi'i olygu yn llwyddiannus." + failure: "Wedi methu golygu albwm %{name}." + destroy: + success: "Wedi dileu albwm %{name}." + aspects: + index: + photos: "lluniau" + show: + photos: "lluniau" + manage: + add_a_new_aspect: "Ychwanegwch agwedd" + add_a_new_friend: "Ychwanegwch ffrind newydd" + show: "Dangos" + update_aspects: "Diweddaru Agweddau" + requests: "Ceisiadau" + ignore_remove: "Anwybyddu/Tynnu" + new_aspect: + add_a_new_aspect: "Ychwanegwch agwedd newydd" + create: "Creu" + create: + success:"Cliciwch ar y plus ar y chwith i ddweud wrth Diaspora pwy all weld eich agwedd newydd." + users: + edit: + cancel: "Cancel" + update_profile: "Diweddaru Proffil" + home: "Adref" + diaspora_username: "FFUGENW DIASPORA" + info: "Gwybodaeth" + picture: "Llun" + editing_profile: "Golygu proffil" + albums: "Albymau" + you_dont_have_any_photos: "Does gennych chi ddim lluniau! Ewch i'r" + page_to_upload_some: "dudalen i uwchlwytho rhai." + comments: + comment: + ago: "yn ol" + new_comment: + comment: "Sylw" + photos: + show: + prev: "blaenorol" + full_size: "maint llawn" + next: "neasf" + edit_photo: "Golygu Llun" + delete_photo: "Dileu Llun" + are_you_sure: "Ydych chi'n sicr?" + comments: "sylwadau" + edit: + editing: "Golygu" + are_you_sure: "Ydych chi'n sicr?" + delete_photo: "Dileu Llun" + photo: + show_comments: "dangos sylwadau" + posted_a_new_photo_to: "postiwyd llun newydd i" + new: + new_photo: "Llun Newydd" + back_to_list: "Nol i'r Rhestr" + post_it: "postiwch e!" + registrations: + new: + sign_up: "Cofrestrwch" + status_messages: + new_status_message: + tell_me_something_good: "Dwi eisiau clywed rhwbeth da" + oh_yeah: "oh yeah!" + status_message: + show_comments: "dangos sylwadau" + delete: "Dileu" + are_you_sure: "Ydych chi'n sicr?" + show: + status_message: "Neges Statws" + comments: "sylwadau" + are_you_sure: "Ydych chi'n sicr?" + destroy: "Dinistrio" + view_all: "Gweld Pob Un" + message: "Neges" + owner: "Perchennog" + people: + index: + add_friend: "ychwanegu ffrind" + real_name: "enw llawn" + diaspora_handle: "bachyn diaspora" + thats_you: "dyna chi!" + friend_request_pending: "cais ffrind dan ystyriaeth" + you_have_a_friend_request_from_this_person: "mae'r person yma eisiau bod yn ffrind i chi" + new: + new_person: "Person Newydd" + back_to_list: "Nol i'r Rhestr" + show: + last_seen: "gwelwyd diwethaf: %{how_long_ago}" + friends_since: "yn ffrindiau ers: %{how_long_ago}" + save: "arbed" + are_you_sure: "Ydych chi'n sicr?" + remove_friend: "dileu ffrind" \ No newline at end of file From d55c0ae5511d5839fe1abb27dc470370f87c4d4c Mon Sep 17 00:00:00 2001 From: Alec Leamas Date: Thu, 23 Sep 2010 22:50:28 +0800 Subject: [PATCH 205/449] mongodb now in Fedora repos. --- README.md | 36 +++++++++--------------------------- 1 file changed, 9 insertions(+), 27 deletions(-) diff --git a/README.md b/README.md index 0d5cee400..d215f5e98 100644 --- a/README.md +++ b/README.md @@ -115,6 +115,14 @@ If you're on **Mac OS X**, you already have Ruby on your system. Yay! ### MongoDB +To install MongoDB on **Fedora**, use the official repositories + + sudo yum install mongodb-server + +Ensure that the server is started at system reboot: + + sudo chkconfig mongod on + To install MongoDB on **Ubuntu**, add the official MongoDB repository [here](http://www.mongodb.org/display/DOCS/Ubuntu+and+Debian+packages). @@ -147,32 +155,6 @@ Then run: sudo chmod -Rv 777 /data/ -To install MongoDB on a x86_64 **Fedora** system, add the official MongoDB -repository from MongoDB -(http://www.mongodb.org/display/DOCS/CentOS+and+Fedora+Packages) into -/etc/yum.repos.d/10gen.repo: - - [10gen] - name=10gen Repository - baseurl=http://downloads.mongodb.org/distros/fedora/13/os/x86_64/ - gpgcheck=0 - enabled=1 - -Then use yum to install the packages: - - sudo yum install mongo-stable mongo-stable-server - -If you're running a 32-bit system, run `wget -http://fastdl.mongodb.org/linux/mongodb-linux-i686-1.6.2.tgz`. If you're -running a 64-bit system, run `wget -http://fastdl.mongodb.org/linux/mongodb-linux-x86_64-1.6.2.tgz`. - - # extract - tar xzf mongodb-linux-i686-1.4.0.tgz - # create the required data directory - sudo mkdir -p /data/db - sudo chmod -Rv 777 /data/ - To install MongoDB on **Mac OS X**, run the following: brew install mongo @@ -266,7 +248,7 @@ run `service mongodb start`). If you installed the binary manually, run `sudo mongod` from where mongo is installed to start mongo. If you installed the Fedora package, MongoDB will need to be started via -`service mongodb start`. If you installed the binary manually, run `sudo +`service mongod start`. If you installed the binary manually, run `sudo mongod` from where Mongo is installed to start Mongo. If you installed the OsX package through "brew", MongoDB will need to be From c1242a0984da81e707872504590c861ef93f3e61 Mon Sep 17 00:00:00 2001 From: Alec Leamas Date: Thu, 23 Sep 2010 23:00:35 +0800 Subject: [PATCH 206/449] typo fix --- config/app_config.yml.example | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/app_config.yml.example b/config/app_config.yml.example index 5ee07c405..75568dd11 100644 --- a/config/app_config.yml.example +++ b/config/app_config.yml.example @@ -12,7 +12,7 @@ default: socket_collection_name: 'websocket' pubsub_server: 'https://pubsubhubbub.appspot.com/' mongo_host: 'localhost' - mongo_post: 27017 + mongo_port: 27017 development: From c000b31ffb365241d3128800aacece7d8475f357 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Thu, 23 Sep 2010 10:17:13 -0700 Subject: [PATCH 207/449] query for post through user --- app/controllers/comments_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/comments_controller.rb b/app/controllers/comments_controller.rb index 4caeb1414..fe11cb8ae 100644 --- a/app/controllers/comments_controller.rb +++ b/app/controllers/comments_controller.rb @@ -10,7 +10,7 @@ class CommentsController < ApplicationController respond_to :json, :only => :show def create - target = Post.find_by_id params[:comment][:post_id] + target = current_user.find_visible_post_by_id params[:comment][:post_id] text = params[:comment][:text] @comment = current_user.comment text, :on => target From ed6df7d1bf9fbf04e720fb1dd2ba30ff7fa03723 Mon Sep 17 00:00:00 2001 From: Raphael Date: Thu, 23 Sep 2010 10:24:10 -0700 Subject: [PATCH 208/449] Delete user.terse_url --- app/models/user.rb | 7 +------ spec/models/person_spec.rb | 2 +- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/app/models/user.rb b/app/models/user.rb index 8f74e2233..2b74f437b 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -259,14 +259,9 @@ class User aspect(:name => "Work") end - def terse_url - terse = APP_CONFIG[:pod_url].gsub(/(https?:|www\.)\/\//, '') - terse = terse.chop! if terse[-1, 1] == '/' - terse - end def diaspora_handle - "#{self.username}@#{self.terse_url}" + "#{self.username}@#{APP_CONFIG[:terse_pod_url]}" end def downcase_username diff --git a/spec/models/person_spec.rb b/spec/models/person_spec.rb index 3275d9245..721310409 100644 --- a/spec/models/person_spec.rb +++ b/spec/models/person_spec.rb @@ -24,7 +24,7 @@ describe Person do context 'remote people' do it 'stores the diaspora_handle in the database' do - @person.diaspora_handle.include?(@user.terse_url).should be false + @person.diaspora_handle.include?(APP_CONFIG[:terse_pod_url]).should be false end end end From 3d1ca6adc84d1b60bf8aa58421cc3e021af400db Mon Sep 17 00:00:00 2001 From: Dan Cirnat Date: Thu, 23 Sep 2010 00:35:46 +0800 Subject: [PATCH 209/449] Romanian locale added --- config/locales/devise.ro.yml | 41 ++++++++++ config/locales/ro.yml | 143 +++++++++++++++++++++++++++++++++++ 2 files changed, 184 insertions(+) create mode 100644 config/locales/devise.ro.yml create mode 100644 config/locales/ro.yml diff --git a/config/locales/devise.ro.yml b/config/locales/devise.ro.yml new file mode 100644 index 000000000..63501ea7b --- /dev/null +++ b/config/locales/devise.ro.yml @@ -0,0 +1,41 @@ +# Copyright (c) 2010, Diaspora Inc. This file is +# licensed under the Affero General Public License version 3. See +# the COPYRIGHT file. + + +ro: + errors: + messages: + not_found: "inexistent" + already_confirmed: "a fost deja confirmat" + not_locked: "nu a fost blocat" + + devise: + failure: + unauthenticated: 'Pentru a continuna, înregistrați-vă.' + unconfirmed: 'Pentru a continua, confirmați contul dvs.' + locked: 'Contul dvs. este blocat.' + invalid: 'Email sau parolă incorectă.' + invalid_token: 'Cheie de autentificare invalidă.' + timeout: 'Sesiunea dvs. a expirat, autentificați-vă din nou pentru a continua.' + inactive: 'Contul dvs. încă nu a fost activat.' + sessions: + signed_in: 'Autentificare cu succes.' + signed_out: 'Deconectare cu succes.' + passwords: + send_instructions: 'În scurt timp veți primi un email cu instrucțiuni pentru resetarea parolei.' + updated: 'Parolă schimbată cu success. Sunteți acum autentificat(ă).' + confirmations: + send_instructions: 'În scurt timp veți primi un email cu instrucțiuni pentru confirmarea contului.' + confirmed: 'Contul dvs. a fost confirmat cu succes. Sunteți acum autentificat(ă).' + registrations: + signed_up: 'Sunteți autentificat(ă). Dacă este cazul, un mesaj de confirmare a fost trimis pe email-ul dvs.' + updated: 'Cont actualizat cu succes.' + destroyed: 'Pa! Contul dvs. a fost dezactivat cu succes. Sperăm să vă revedem în curând.' + unlocks: + send_instructions: 'În scurt timp veți primi un email cu instrucțiuni pentru deblocarea contului.' + unlocked: 'Cont deblocat cu succes. Sunteți acum autentificat(ă).' + mailer: + confirmation_instructions: 'Instrucțiuni pentru confirmarea contului.' + reset_password_instructions: 'Instrucțiuni pentru resetarea parolei.' + unlock_instructions: 'Instrucțiuni pentru deblocare contului.' diff --git a/config/locales/ro.yml b/config/locales/ro.yml new file mode 100644 index 000000000..8878a8fc7 --- /dev/null +++ b/config/locales/ro.yml @@ -0,0 +1,143 @@ +# Copyright (c) 2010, Diaspora Inc. This file is +# licensed under the Affero General Public License version 3. See +# the COPYRIGHT file. + + +# Sample localization file for English. Add more files in this directory for other locales. +# See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. + +ro: + hello: "Bună, lume!" + layouts: + application: + edit_profile: "editare profil" + logout: "deconectare" + shared: + aspect_nav: + all_aspects: "Toate Aspectele" + manage: "Administrare" + manage_your_aspects: "Administrare Aspecte" + sub_header: + all_aspects: "Toate Aspectele" + manage_aspects: "Administrare Aspecte" + publisher: + share: "Distribuie" + aspect_friends: + add_friends: "adăugare prieteni" + albums: + album: + you: "tu" + new_album: + create: "crează" + add_a_new_album: "Album nou" + show: + edit_album: "Editare Album" + albums: "albume" + updated: "actualizat" + by: "de" + edit: + editing: "Editare" + updated: "actualizat" + are_you_sure: "Sunteți sigur(ă)?" + delete_album: "Șterge Album" + cancel: "Renuță" + index: + home: "acasă" + new_album: "Album Nou" + create: + success: "Ați creat un album numit %{name}." + update: + success: "Albumul %{name} a fost modificat cu succes." + failure: "Eroare la editarea albumului %{name}." + destroy: + success: "Albumul %{name} a fost șters." + aspects: + index: + photos: "poze" + show: + photos: "poze" + manage: + add_a_new_aspect: "Adaugă aspect" + add_a_new_friend: "Adadugă prieten" + show: "Arată" + update_aspects: "Actualizează Aspecte" + requests: "Cereri" + ignore_remove: "Ignoră/Șterge" + new_aspect: + add_a_new_aspect: "Adaugă aspect" + create: "Crează" + create: + success:"Click pe semnul plus în partea stângă pentru a indica cine poate accesa noul aspect." + users: + edit: + cancel: "Renunță" + update_profile: "Actualizează Profil" + home: "Home" + diaspora_username: "DIASPORA USERNAME" + info: "Info" + picture: "Poză" + editing_profile: "Editare profil" + albums: "Albume" + you_dont_have_any_photos: "Nu ai nici o fotografie! Mergi la" + page_to_upload_some: "pentru a încărca câteva." + comments: + comment: + ago: "în urmă" + new_comment: + comment: "Comentariu" + photos: + show: + prev: "precedent" + full_size: "mărime deplină" + next: "următor" + edit_photo: "Modifică Poză" + delete_photo: "Șterge Poză" + are_you_sure: "Sunteți sigur(ă)?" + comments: "comments" + edit: + editing: "Modificare" + are_you_sure: "Sunteți sigur(ă)?" + delete_photo: "Șterge poză" + photo: + show_comments: "arată comentarii" + posted_a_new_photo_to: "a postat o nouă poză în" + new: + new_photo: "Poză nouă" + back_to_list: "Înapoi la Listă" + post_it: "postează!" + registrations: + new: + sign_up: "Înregistrare" + status_messages: + new_status_message: + tell_me_something_good: "spune-mi ceva bun" + oh_yeah: "o, da!" + status_message: + show_comments: "arată comentarii" + delete: "Șterge" + are_you_sure: "Sunteți sigur(ă)?" + show: + status_message: "Mesaj Stare" + comments: "comentarii" + are_you_sure: "Sunteți sigur(ă)?" + destroy: "Distruge" + view_all: "Vezi Toate" + message: "Mesaj" + owner: "Proprietar" + people: + index: + add_friend: "adaugă prieten" + real_name: "nume real" + diaspora_handle: "diaspora id" + thats_you: "acesta ești tu!" + friend_request_pending: "cerere de prietenie nerezolvată" + you_have_a_friend_request_from_this_person: "aveți o cerere de prietenie din partea acestei persoane" + new: + new_person: "Persoană Nouă" + back_to_list: "Înapoi la Listă" + show: + last_seen: "văzut: %{how_long_ago}" + friends_since: "prieteni: %{how_long_ago}" + save: "salvează" + are_you_sure: "Sunteți sigur(ă)?" + remove_friend: "șterge prieten" From 4be2fdef8f95a1ef1b4af1d452305f7801041163 Mon Sep 17 00:00:00 2001 From: Dan Cirnat Date: Thu, 23 Sep 2010 01:03:25 +0800 Subject: [PATCH 210/449] Removed "sample" message from Romanian locale --- config/locales/ro.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/config/locales/ro.yml b/config/locales/ro.yml index 8878a8fc7..c99bd2a85 100644 --- a/config/locales/ro.yml +++ b/config/locales/ro.yml @@ -2,10 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - -# Sample localization file for English. Add more files in this directory for other locales. -# See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. - ro: hello: "Bună, lume!" layouts: From e6d1b8b8089f1387e91605f6037bc2e6f27f72e5 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Thu, 23 Sep 2010 10:29:36 -0700 Subject: [PATCH 211/449] fixed syntax in welsch translation --- config/locales/devise.cy.yml | 44 ++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/config/locales/devise.cy.yml b/config/locales/devise.cy.yml index 4f89f9b34..5d6d6049a 100644 --- a/config/locales/devise.cy.yml +++ b/config/locales/devise.cy.yml @@ -12,31 +12,31 @@ cy: devise: failure: - unauthenticated: 'Mae angen i chi arwyddo i mewn neu ymuno cyn parhau.' - unconfirmed: 'Rhaid i chi gadarnhau eich cyfrif cyn parhau.' - locked: 'Mae eich cyfrif wedi'i gloi.' - invalid: 'E-bost neu gyfrinair annilys.' - invalid_token: 'Tocyn dilysu annilys.' - timeout: 'Mae eich sesiwn wedi dod i ben, arwyddwch i mewn eto i barhau.' - inactive: 'Nid yw eich cyfrif wedi'i actifadu.' + unauthenticated: "Mae angen i chi arwyddo i mewn neu ymuno cyn parhau." + unconfirmed: "Rhaid i chi gadarnhau eich cyfrif cyn parhau." + locked: "Mae eich cyfrif wedi'i gloi." + invalid: "E-bost neu gyfrinair annilys." + invalid_token: "Tocyn dilysu annilys." + timeout: "Mae eich sesiwn wedi dod i ben, arwyddwch i mewn eto i barhau." + inactive: "Nid yw eich cyfrif wedi'i actifadu." sessions: - signed_in: 'Arwyddwyd i fewn yn llwyddiannus.' - signed_out: 'Arwyddwyd allan yn llwyddiannus.' + signed_in: "Arwyddwyd i fewn yn llwyddiannus." + signed_out: "Arwyddwyd allan yn llwyddiannus." passwords: - send_instructions: 'Byddwch yn derbyn e-bost â chyfarwyddiadau ar sut i gadarnhau eich cyfrif mewn ychydig funudau.' - updated: 'Newidiwyd eich cyfrinair yn llwyddiannus. Rydych chi wedi arwyddo i fewn.' + send_instructions: "Byddwch yn derbyn e-bost â chyfarwyddiadau ar sut i gadarnhau eich cyfrif mewn ychydig funudau." + updated: "Newidiwyd eich cyfrinair yn llwyddiannus. Rydych chi wedi arwyddo i fewn." confirmations: - send_instructions: 'Byddwch yn derbyn e-bost â chyfarwyddiadau ar sut i gadarnhau eich cyfrif mewn ychydig funudau.' - confirmed: 'Cadarnhawyd eich cyfrif yn llwyddiannus. Rydych chi wedi arwyddo i fewn.' + send_instructions: "Byddwch yn derbyn e-bost â chyfarwyddiadau ar sut i gadarnhau eich cyfrif mewn ychydig funudau." + confirmed: "Cadarnhawyd eich cyfrif yn llwyddiannus. Rydych chi wedi arwyddo i fewn." registrations: - signed_up: 'Rydych chi wedi arwyddo i fyny yn llwyddiannus. Anfonwyd cadarnhad at eich e-bost os yw wedi'i alluogi.' - updated: 'Diweddarwyd eich cyfrif yn llwyddiannus.' - destroyed: 'Hwyl fawr! Canslwyd eich cyfrif yn llwyddiannus. Rydym yn gobeithio gweld chi eto yn fuan.' + signed_up: "Rydych chi wedi arwyddo i fyny yn llwyddiannus. Anfonwyd cadarnhad at eich e-bost os yw wedi'i alluogi." + updated: "Diweddarwyd eich cyfrif yn llwyddiannus." + destroyed: "Hwyl fawr! Canslwyd eich cyfrif yn llwyddiannus. Rydym yn gobeithio gweld chi eto yn fuan." unlocks: - send_instructions: 'Byddwch yn derbyn e-bost gyda cyfarwyddiadau ar sut i agor eich cyfrif mewn ychydig funudau.' - unlocked: 'Datglowyd eich cyfrif yn llwyddiannus. Rydych chi wedi arwyddo i fewn.' + send_instructions: "Byddwch yn derbyn e-bost gyda cyfarwyddiadau ar sut i agor eich cyfrif mewn ychydig funudau." + unlocked: "Datglowyd eich cyfrif yn llwyddiannus. Rydych chi wedi arwyddo i fewn." mailer: - confirmation_instructions: 'Cyfarwyddiadau cadarnhad.' - reset_password_instructions: 'Ailosod cyfarwyddiadau cyfrinair' - unlock_instructions: 'Cyfarwyddiadau Datgloi' - \ No newline at end of file + confirmation_instructions: "Cyfarwyddiadau cadarnhad." + reset_password_instructions: "Ailosod cyfarwyddiadau cyfrinair" + unlock_instructions: "Cyfarwyddiadau Datgloi" + From 40d736d233098d6a1d2962a4f4ca20675fefa2be Mon Sep 17 00:00:00 2001 From: maxwell Date: Thu, 23 Sep 2010 10:39:47 -0700 Subject: [PATCH 212/449] MS changed the session page to show APP_CONFIG[:terse_pod_url] --- app/views/devise/sessions/new.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/devise/sessions/new.html.haml b/app/views/devise/sessions/new.html.haml index 15880df0b..a2de719b5 100644 --- a/app/views/devise/sessions/new.html.haml +++ b/app/views/devise/sessions/new.html.haml @@ -10,7 +10,7 @@ = f.label :username = f.text_field :username %p.user_network - ="@#{APP_CONFIG[:pod_url]}" + ="@#{APP_CONFIG[:terse_pod_url]}" %p = f.label :password From 8c0bc4b9e60e0e94fd515ba7f595e6d08fba34af Mon Sep 17 00:00:00 2001 From: danielvincent Date: Thu, 23 Sep 2010 10:49:35 -0700 Subject: [PATCH 213/449] fix in person partial --- app/helpers/application_helper.rb | 6 +++++- app/views/people/_person.html.haml | 5 ++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 89df26155..b6e4c4389 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -57,7 +57,11 @@ module ApplicationHelper end def person_image_link(person) - link_to person_image_tag(person), object_path(person) + if current_user.friends.include?(person) || current_user.person == person + link_to person_image_tag(person), object_path(person) + else + person_image_tag person + end end def new_request(request_count) diff --git a/app/views/people/_person.html.haml b/app/views/people/_person.html.haml index 7e22a5570..185695db1 100644 --- a/app/views/people/_person.html.haml +++ b/app/views/people/_person.html.haml @@ -8,7 +8,10 @@ .content %span.from - = link_to person.real_name, person_path(person) + - if current_user.friends.include?(person) || person.id == current_user.person.id + = link_to person.real_name, person_path(person) + - else + = person.real_name .info = person.diaspora_handle From c889fcb5926fcf00d28db78595603681570ac8a0 Mon Sep 17 00:00:00 2001 From: Guido Serra aka Zeph Date: Thu, 23 Sep 2010 20:55:57 +0200 Subject: [PATCH 214/449] merge a culo --- config/locales/it.yml | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/config/locales/it.yml b/config/locales/it.yml index 44f8a8033..4cce93d73 100644 --- a/config/locales/it.yml +++ b/config/locales/it.yml @@ -3,20 +3,8 @@ # the COPYRIGHT file. -<<<<<<< HEAD -# Sample localization file for English. Add more files in this directory for other locales. -# See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. - -# -# 1st DRAFT of the italian translation -# 09/2010 Guido Serra aka Zeph - -it: - hello: "Ciao Mondo!" -======= # Sample localization file for Italian. Add more files in this directory for other locales. # See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. it: hello: "Ciao Mondo" ->>>>>>> af91eb51b4ff8d001bbdceba4b4e9e45db498190 From 48c212c1ab8e1e46a026bf07cbb102203ff32020 Mon Sep 17 00:00:00 2001 From: ilya Date: Thu, 23 Sep 2010 12:18:26 -0700 Subject: [PATCH 215/449] made a public view, copied the fb publisher there --- app/controllers/aspects_controller.rb | 10 ++++++++++ app/views/shared/_aspect_nav.haml | 2 ++ config/fb_config.yml | 2 +- config/routes.rb | 1 + 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/app/controllers/aspects_controller.rb b/app/controllers/aspects_controller.rb index 779ce0f6f..9112792c1 100644 --- a/app/controllers/aspects_controller.rb +++ b/app/controllers/aspects_controller.rb @@ -45,6 +45,16 @@ class AspectsController < ApplicationController respond_with @aspect end + def public + @fb_access_url = MiniFB.oauth_url(FB_APP_ID, APP_CONFIG[:pod_url] + "services/create", + :scope=>MiniFB.scopes.join(",")) + + @posts = current_user.visible_posts(:by_members_of => :all).paginate :page => params[:page], :per_page => 15, :order => 'created_at DESC' + @aspect = :all + + respond_with @aspect + end + def manage @aspect = :manage @remote_requests = Request.for_user(current_user).all diff --git a/app/views/shared/_aspect_nav.haml b/app/views/shared/_aspect_nav.haml index 55da1bcdf..ebfd2b57d 100644 --- a/app/views/shared/_aspect_nav.haml +++ b/app/views/shared/_aspect_nav.haml @@ -12,6 +12,8 @@ = link_to "All Aspects", root_url %ul{ :style => "position:absolute;right:0;bottom:0.01em;"} + %li{:class => ("selected" if @aspect == :all)} + = link_to "Public", aspects_public_path %li{ :style => "margin-right:0;", :class => ("selected" if @aspect == :manage)} = link_to ( (@request_count == 0)? "Manage Aspects" : "Manage Aspects (#{@request_count})"), {:controller => :aspects, :action => :manage}, :class => "edit_aspect_button", :class => new_request(@request_count), :title => "Manage your Aspects" diff --git a/config/fb_config.yml b/config/fb_config.yml index 7b69791e5..4c3309fac 100644 --- a/config/fb_config.yml +++ b/config/fb_config.yml @@ -1,4 +1,4 @@ fb_api_key: {dcf4e90df086cf6d3e531b31e043ff32} -fb_secret: {36917c2878d658b8c575952b6a78e3c3} +fb_secret: {7fe864834726f8a5e65bc93928b99a53} fb_app_id: {120373411325347} host: http://localhost:3000/ diff --git a/config/routes.rb b/config/routes.rb index 269622156..112ff5768 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -16,6 +16,7 @@ Diaspora::Application.routes.draw do match 'aspects/move_friends', :to => 'aspects#move_friends', :as => 'move_friends' match 'aspects/move_friend', :to => 'aspects#move_friend', :as => 'move_friend' match 'aspects/manage', :to => 'aspects#manage' + match 'aspects/public', :to => 'aspects#public' resources :aspects, :except => [:edit] match 'services/create', :to => "services#create" From cfe019d7a9b4069c1f472b89fc2b291d7c26074f Mon Sep 17 00:00:00 2001 From: Raphael Date: Thu, 23 Sep 2010 12:19:28 -0700 Subject: [PATCH 216/449] Take out async controller until we actually put it in the app --- config/routes.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/config/routes.rb b/config/routes.rb index f4f49b01d..0ac115b76 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -33,7 +33,6 @@ Diaspora::Application.routes.draw do match 'signup', :to => 'registrations#new', :as => "new_user_registration" match 'get_to_the_choppa', :to => redirect("/signup") - match "/finger", :to => AsyncController #public routes # match 'webfinger', :to => 'publics#webfinger' From 3381c46050c228ca90b90f9a129a8a8d9239158e Mon Sep 17 00:00:00 2001 From: Raphael Date: Thu, 23 Sep 2010 12:21:05 -0700 Subject: [PATCH 217/449] Revert "mongodb now in Fedora repos." This reverts commit d55c0ae5511d5839fe1abb27dc470370f87c4d4c. --- README.md | 36 +++++++++++++++++++++++++++--------- 1 file changed, 27 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index d215f5e98..0d5cee400 100644 --- a/README.md +++ b/README.md @@ -115,14 +115,6 @@ If you're on **Mac OS X**, you already have Ruby on your system. Yay! ### MongoDB -To install MongoDB on **Fedora**, use the official repositories - - sudo yum install mongodb-server - -Ensure that the server is started at system reboot: - - sudo chkconfig mongod on - To install MongoDB on **Ubuntu**, add the official MongoDB repository [here](http://www.mongodb.org/display/DOCS/Ubuntu+and+Debian+packages). @@ -155,6 +147,32 @@ Then run: sudo chmod -Rv 777 /data/ +To install MongoDB on a x86_64 **Fedora** system, add the official MongoDB +repository from MongoDB +(http://www.mongodb.org/display/DOCS/CentOS+and+Fedora+Packages) into +/etc/yum.repos.d/10gen.repo: + + [10gen] + name=10gen Repository + baseurl=http://downloads.mongodb.org/distros/fedora/13/os/x86_64/ + gpgcheck=0 + enabled=1 + +Then use yum to install the packages: + + sudo yum install mongo-stable mongo-stable-server + +If you're running a 32-bit system, run `wget +http://fastdl.mongodb.org/linux/mongodb-linux-i686-1.6.2.tgz`. If you're +running a 64-bit system, run `wget +http://fastdl.mongodb.org/linux/mongodb-linux-x86_64-1.6.2.tgz`. + + # extract + tar xzf mongodb-linux-i686-1.4.0.tgz + # create the required data directory + sudo mkdir -p /data/db + sudo chmod -Rv 777 /data/ + To install MongoDB on **Mac OS X**, run the following: brew install mongo @@ -248,7 +266,7 @@ run `service mongodb start`). If you installed the binary manually, run `sudo mongod` from where mongo is installed to start mongo. If you installed the Fedora package, MongoDB will need to be started via -`service mongod start`. If you installed the binary manually, run `sudo +`service mongodb start`. If you installed the binary manually, run `sudo mongod` from where Mongo is installed to start Mongo. If you installed the OsX package through "brew", MongoDB will need to be From 5857838a0a6ece7f42da2df6264c4d334e8e5c6a Mon Sep 17 00:00:00 2001 From: ilya Date: Thu, 23 Sep 2010 12:29:00 -0700 Subject: [PATCH 218/449] adding the new files --- app/views/aspects/public.html.haml | 35 ++++++++++++++++++++++++++++++ config/deploy_config.yml | 2 +- 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 app/views/aspects/public.html.haml diff --git a/app/views/aspects/public.html.haml b/app/views/aspects/public.html.haml new file mode 100644 index 000000000..add02f490 --- /dev/null +++ b/app/views/aspects/public.html.haml @@ -0,0 +1,35 @@ +-# Copyright (c) 2010, Diaspora Inc. This file is +-# licensed under the Affero General Public License version 3. 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 + = render "shared/publisher", :aspect_ids => :public + +%h3 Facebook +%p + - if @logged_in + Connected to facebook as + - @response_hash = MiniFB.get(@access_token, 'me') + = @response_hash[:name] + + - form_tag "/services/fb_post" do + = text_area_tag "message" + = submit_tag "send it off" + + = link_to "Disconnect from Facebook", services_destroy_path + - else + = link_to "Connect to Facebook", @fb_access_url + +%ul#stream + - for post in @posts + = render type_partial(post), :post => post unless post.class == Album +#pagination + = will_paginate @posts + diff --git a/config/deploy_config.yml b/config/deploy_config.yml index f724ec383..fcecaa6b1 100644 --- a/config/deploy_config.yml +++ b/config/deploy_config.yml @@ -7,7 +7,7 @@ cross_server: deploy_to: '/usr/local/app/diaspora' user: 'root' - repo: 'git@github.com:diaspora/diaspora.git' + repo: 'git://github.com/diaspora/diaspora.git' branch: 'fb' default_env: 'development' servers: From 04e670f0d0a3788dd77f7b8ef448d2a672649ea9 Mon Sep 17 00:00:00 2001 From: ilya Date: Thu, 23 Sep 2010 12:31:19 -0700 Subject: [PATCH 219/449] deploy script now uses public url --- config/deploy_config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/deploy_config.yml b/config/deploy_config.yml index c653b6565..9bd7a6b96 100644 --- a/config/deploy_config.yml +++ b/config/deploy_config.yml @@ -7,7 +7,7 @@ cross_server: deploy_to: '/usr/local/app/diaspora' user: 'root' - repo: 'git@github.com:diaspora/diaspora.git' + repo: 'git://github.com/diaspora/diaspora.git' branch: 'master' default_env: 'development' servers: From cadcb81583ed68545b6e5de1cf8bb1924e329ad4 Mon Sep 17 00:00:00 2001 From: Raphael Date: Thu, 23 Sep 2010 12:33:27 -0700 Subject: [PATCH 220/449] Gems we don't actually need... --- Gemfile | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Gemfile b/Gemfile index adc4431aa..cc92bec3d 100644 --- a/Gemfile +++ b/Gemfile @@ -38,10 +38,6 @@ gem 'magent', :git => 'http://github.com/dcu/magent.git' gem 'carrierwave', :git => 'git://github.com/rsofaer/carrierwave.git' , :branch => 'master' #Untested mongomapper branch gem 'mini_magick' -#sinatra -gem 'sinatra', '1.0' -gem 'async_sinatra' - group :test, :development do gem 'factory_girl_rails' end From c243304c97c4e97529ad7a2a7127067084698b5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABl=20Soucaze?= Date: Wed, 22 Sep 2010 03:46:20 +0800 Subject: [PATCH 221/449] Welcome to the French Casual Honorifics localization thanks to the brainchild of michael-k! --- config/locales/devise.fr_tu.yml | 41 +++++++ config/locales/fr_tu.yml | 205 ++++++++++++++++++++++++++++++++ 2 files changed, 246 insertions(+) create mode 100644 config/locales/devise.fr_tu.yml create mode 100644 config/locales/fr_tu.yml diff --git a/config/locales/devise.fr_tu.yml b/config/locales/devise.fr_tu.yml new file mode 100644 index 000000000..911c282c5 --- /dev/null +++ b/config/locales/devise.fr_tu.yml @@ -0,0 +1,41 @@ +# Copyright (c) 2010, Diaspora Inc. This file is +# licensed under the Affero General Public License version 3. See +# the COPYRIGHT file. + + +fr_tu: + errors: + messages: + not_found: "introuvable" + already_confirmed: "a déjà été confirmé" + not_locked: "n’a pas été verrouillé" + + devise: + failure: + unauthenticated: 'Tu dois te connecter ou t’inscrire avant de continuer.' + unconfirmed: 'Tu dois confirmer ton compte avant de continuer.' + locked: 'Ton compte est verrouillé.' + invalid: 'Adresse e-mail ou mot de passe invalide.' + invalid_token: 'Jeton d’authentification invalide.' + timeout: 'Ta session a expiré, merci de te connecter de nouveau afin de continuer.' + inactive: 'Ton compte n’a pas encore été activé.' + sessions: + signed_in: 'Connecté avec succès.' + signed_out: 'Déconnecté avec succès.' + passwords: + send_instructions: 'Tu vas recevoir dans quelques minutes un e-mail contenant des instructions t’expliquant comment réinitialiser ton mot de passe.' + updated: 'Ton mot de passe a été modifié avec succès. Tu es à présent connecté.' + confirmations: + send_instructions: 'Tu vas recevoir dans quelques minutes un e-mail contenant des instructions t’expliquant comment confirmer ton compte.' + confirmed: 'Ton compte a été confirmé avec succès. Tu es à présent connecté.' + registrations: + signed_up: 'Tu t’es inscrit avec succès. Si activée, une confirmation a été envoyée sur ton adresse e-mail.' + updated: 'Tu as mis à jour ton compte avec succès.' + destroyed: 'Au revoir ! Ton compte a été résilié avec succès. Nous espérons te revoir très bientôt.' + unlocks: + send_instructions: 'Tu vas recevoir dans quelques minutes un e-mail contenant des instructions t’expliquant comment déverrouiller ton compte.' + unlocked: 'Ton compte a été déverrouillé avec succès. Tu es à présent connecté.' + mailer: + confirmation_instructions: 'Instructions de confirmation' + reset_password_instructions: 'Réinitialiser les instructions du mot de passe' + unlock_instructions: 'Instructions de déverrouillage' diff --git a/config/locales/fr_tu.yml b/config/locales/fr_tu.yml new file mode 100644 index 000000000..535e1daa9 --- /dev/null +++ b/config/locales/fr_tu.yml @@ -0,0 +1,205 @@ +# Copyright (c) 2010, Diaspora Inc. This file is +# licensed under the Affero General Public License version 3. See +# the COPYRIGHT file. + + +# Localization file for French (Casual Honorifics). Add more files in this directory for other locales. +# See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. + +fr_tu: + hello: "Bonjour tout le monde" + application: + helper: + unknown_person: "personne inconnue" + new_requests: "nouvelles requêtes" + dashboards: + helper: + home: "accueil" + error_messages: + helper: + invalid_fields: "Champs invalides" + correct_the_following_errors_and_try_again: "Corrige les erreurs suivantes, puis réessaie." + people: + helper: + results_for: " résultats concernant %{params}" + people_on_pod_are_aware_of: " personnes agissant comme des automates sont conscients de" + layouts: + application: + edit_profile: "éditer le profil" + logout: "déconnexion" + shared: + aspect_nav: + all_aspects: "Tous les aspects" + manage: "Gérer" + manage_your_aspects: "Gérer tes aspects" + sub_header: + all_aspects: "Tous les aspects" + manage_aspects: "Gérer les aspects" + publisher: + share: "Partager" + aspect_friends: + add_friends: "ajouter des amis" + albums: + album: + you: "toi" + new_album: + create: "créer" + add_a_new_album: "Ajouter un nouvel album" + show: + edit_album: "Éditer l’album" + albums: "albums" + updated: "mis à jour" + by: "par" + edit: + editing: "Édition" + updated: "mis à jour" + are_you_sure: "Es-tu sûr(e) ?" + delete_album: "Supprimer l’album" + cancel: "Annuler" + index: + home: "accueil" + new_album: "Nouvel album" + create: + success: "Tu as créé un album nommé %{name}." + update: + success: "L’album %{name} a été édité avec succès." + failure: "L’édition de l’album %{name} a échoué." + destroy: + success: "L’album %{name} a été supprimé." + helper: + friends_albums: "Albums d’amis" + your_albums: "Tes albums" + aspects: + index: + photos: "photos" + show: + photos: "photos" + manage: + add_a_new_aspect: "Ajouter un nouvel aspect" + add_a_new_friend: "Ajouter un nouvel ami" + show: "Afficher" + update_aspects: "Mettre à jour les aspects" + requests: "Requêtes" + ignore_remove: "Ignorer/Supprimer" + new_aspect: + add_a_new_aspect: "Ajouter un nouvel aspect" + create: "Créer" + create: + success:"Clique sur le symbole plus situé sur le côté gauche afin que Diaspora détermine qui peut voir ton nouvel aspect." + destroy: + success: "%{name} a été supprimé avec succès." + update: + success: "Ton aspect, %{name}, a été édité avec succès." + move_friends: + failure: "L’édition de l’aspect concernant l’ami %{real_name} a échoué." + success: "Les aspects ont été édités avec succès." + move_friend: + error: "ne fonctionne pas %{inspect}" + notice: "Tu montres à présent à ton ami un aspect différent au tien." + helper: + remove: "supprimer" + aspect_not_empty: "L’aspect n’est pas vide" + users: + edit: + cancel: "Annuler" + update_profile: "Mettre à jour le profil" + home: "Accueil" + diaspora_username: "NOM D’UTILISATEUR DIASPORA" + info: "Information" + picture: "Image" + editing_profile: "Édition du profil" + albums: "Albums" + you_dont_have_any_photos: "Tu n’as aucune photo ! Rends-toi sur la page" + page_to_upload_some: "afin d’en transférer quelques-unes." + comments: + comment: + ago: "il y a" + new_comment: + comment: "Commentaire" + photos: + show: + prev: "précédent" + full_size: "taille réelle" + next: "suivant" + edit_photo: "Éditer la photo" + delete_photo: "Supprimer la photo" + are_you_sure: "Es-tu sûr(e) ?" + comments: "commentaires" + edit: + editing: "Édition" + are_you_sure: "Es-tu sûr(e) ?" + delete_photo: "Supprimer la photo" + photo: + show_comments: "afficher les commentaires" + posted_a_new_photo_to: "a publié une nouvelle photo sur" + new: + new_photo: "Nouvelle photo" + back_to_list: "Retourner à la liste" + post_it: "publie-la !" + create: + runtime_error: "Le transfert de la photo a échoué. Es-tu sûr(e) que ta ceinture de sécurité est bien attachée ?" + integrity_error: "Le transfert de la photo a échoué. Es-tu sûr(e) que c’était bien une image ?" + type_error: "Le transfert de la photo a échoué. Es-tu sûr(e) que l’image était bien ajoutée ?" + update: + notice: "La photo a été mise à jour avec succès." + error: "Échec de l’édition de la photo." + destroy: + notice: "Photo supprimée." + registrations: + new: + sign_up: "Inscription" + create: + success: "Tu as rejoint Diaspora !" + status_messages: + new_status_message: + tell_me_something_good: "dis-moi quelque chose de bien" + oh_yeah: "oh ouais !" + status_message: + show_comments: "afficher les commentaires" + delete: "Supprimer" + are_you_sure: "Es-tu sûr(e) ?" + show: + status_message: "Message d’état" + comments: "commentaires" + are_you_sure: "Es-tu sûr(e) ?" + destroy: "Détruire" + view_all: "Tout voir" + message: "Message" + owner: "Propriétaire" + helper: + no_message_to_display: "Aucun message à afficher." + people: + person: + add_friend: "ajouter un ami" + pending_request: "requête en attente" + index: + add_friend: "ajouter un ami" + real_name: "nom réel" + diaspora_handle: "maniement de diaspora" + thats_you: "c’est toi !" + friend_request_pending: "Requête d’ami en attente" + you_have_a_friend_request_from_this_person: "tu as une requête d’ami de la part de cette personne" + new: + new_person: "Nouvelle personne" + back_to_list: "Retourner à la liste" + show: + last_seen: "dernière connexion : %{how_long_ago}" + friends_since: "amis depuis : %{how_long_ago}" + save: "sauvegarder" + are_you_sure: "Es-tu sûr(e) ?" + remove_friend: "supprimer un ami" + requests: + new_request: + add_a_new_friend_to: "Ajouter un ami à" + enter_a_diaspora_username: "Saisi un nom d’utilisateur Diaspora :" + your_diaspora_username_is: "Ton nom d’utilisateur Diaspora est : %{diaspora_handle}" + friends_username: "Nom d’utilisateur de l’ami" + destroy: + success: "Vous êtes à présent amis." + error: "Merci de sélectionner un aspect !" + ignore: "Requête d’ami ignorée." + create: + error: "Aucun résultat Diaspora n’a été trouvé avec cette adresse e-mail !" + already_friends: "Tu es déjà ami avec %{destination_url}!" + success: "Une requête d’ami a été envoyée à %{destination_url}." + horribly_wrong: "Quelque chose d’horrible s’est produit." \ No newline at end of file From d7eb8280648f613509c0698cb2d625d1d6ba560d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABl=20Soucaze?= Date: Wed, 22 Sep 2010 04:01:09 +0800 Subject: [PATCH 222/449] Language fix. --- config/locales/fr.yml | 2 +- config/locales/fr_tu.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config/locales/fr.yml b/config/locales/fr.yml index 9754f52a0..6d77dcf00 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -145,7 +145,7 @@ fr: index: add_friend: "ajouter un ami" real_name: "nom réel" - diaspora_handle: "maniement de diaspora" + diaspora_handle: "maniement de Diaspora" thats_you: "c’est vous !" friend_request_pending: "Requête d’ami en attente" you_have_a_friend_request_from_this_person: "vous avez une requête d’ami de la part de cette personne" diff --git a/config/locales/fr_tu.yml b/config/locales/fr_tu.yml index 535e1daa9..739f6d055 100644 --- a/config/locales/fr_tu.yml +++ b/config/locales/fr_tu.yml @@ -175,7 +175,7 @@ fr_tu: index: add_friend: "ajouter un ami" real_name: "nom réel" - diaspora_handle: "maniement de diaspora" + diaspora_handle: "maniement de Diaspora" thats_you: "c’est toi !" friend_request_pending: "Requête d’ami en attente" you_have_a_friend_request_from_this_person: "tu as une requête d’ami de la part de cette personne" From 4cd83f9ae9b3ebdbbb2c2db62cd86323409072bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABl=20Soucaze?= Date: Wed, 22 Sep 2010 10:59:56 +0800 Subject: [PATCH 223/449] Change the file organization, and Casual Honorifics is now Informal Honorifics. --- config/locales/{devise.fr_tu.yml => devise.fr_informal.yml} | 2 +- config/locales/{fr_tu.yml => fr_informal.yml} | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) rename config/locales/{devise.fr_tu.yml => devise.fr_informal.yml} (99%) rename config/locales/{fr_tu.yml => fr_informal.yml} (98%) diff --git a/config/locales/devise.fr_tu.yml b/config/locales/devise.fr_informal.yml similarity index 99% rename from config/locales/devise.fr_tu.yml rename to config/locales/devise.fr_informal.yml index 911c282c5..f167d4706 100644 --- a/config/locales/devise.fr_tu.yml +++ b/config/locales/devise.fr_informal.yml @@ -3,7 +3,7 @@ # the COPYRIGHT file. -fr_tu: +fr_informal: errors: messages: not_found: "introuvable" diff --git a/config/locales/fr_tu.yml b/config/locales/fr_informal.yml similarity index 98% rename from config/locales/fr_tu.yml rename to config/locales/fr_informal.yml index 739f6d055..60240fe04 100644 --- a/config/locales/fr_tu.yml +++ b/config/locales/fr_informal.yml @@ -3,10 +3,10 @@ # the COPYRIGHT file. -# Localization file for French (Casual Honorifics). Add more files in this directory for other locales. +# Localization file for French (Informal Honorifics). Add more files in this directory for other locales. # See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. -fr_tu: +fr_informal: hello: "Bonjour tout le monde" application: helper: From 49162a6ead6b3758c0518621b285a4433e0b0029 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABl=20Soucaze?= Date: Wed, 22 Sep 2010 11:23:41 +0800 Subject: [PATCH 224/449] The underscore (fr_informal) is replaced by the hyphen (fr-informal). --- .../locales/{devise.fr_informal.yml => devise.fr-informal.yml} | 2 +- config/locales/{fr_informal.yml => fr-informal.yml} | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename config/locales/{devise.fr_informal.yml => devise.fr-informal.yml} (99%) rename config/locales/{fr_informal.yml => fr-informal.yml} (99%) diff --git a/config/locales/devise.fr_informal.yml b/config/locales/devise.fr-informal.yml similarity index 99% rename from config/locales/devise.fr_informal.yml rename to config/locales/devise.fr-informal.yml index f167d4706..9578af9d9 100644 --- a/config/locales/devise.fr_informal.yml +++ b/config/locales/devise.fr-informal.yml @@ -3,7 +3,7 @@ # the COPYRIGHT file. -fr_informal: +fr-informal: errors: messages: not_found: "introuvable" diff --git a/config/locales/fr_informal.yml b/config/locales/fr-informal.yml similarity index 99% rename from config/locales/fr_informal.yml rename to config/locales/fr-informal.yml index 60240fe04..627674ca5 100644 --- a/config/locales/fr_informal.yml +++ b/config/locales/fr-informal.yml @@ -6,7 +6,7 @@ # Localization file for French (Informal Honorifics). Add more files in this directory for other locales. # See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. -fr_informal: +fr-informal: hello: "Bonjour tout le monde" application: helper: From 7a9e347b28794988a0753bc47d27ee8e958b9020 Mon Sep 17 00:00:00 2001 From: UserAd Date: Wed, 22 Sep 2010 02:33:16 +0800 Subject: [PATCH 225/449] Improved russian locale --- config/locales/ru.yml | 137 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 135 insertions(+), 2 deletions(-) diff --git a/config/locales/ru.yml b/config/locales/ru.yml index fe944aa59..b4d19cbed 100644 --- a/config/locales/ru.yml +++ b/config/locales/ru.yml @@ -3,8 +3,141 @@ # the COPYRIGHT file. -# Sample localization file for English. Add more files in this directory for other locales. +# Sample localization file for Russian. Add more files in this directory for other locales. # See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. -ru: +en: hello: "Привет, мир" + layouts: + application: + edit_profile: "редактировать профиль" + logout: "выйти" + shared: + aspect_nav: + all_aspects: "Все аспекты" + manage: "Управление" + manage_your_aspects: "Управление вашими аспектами" + sub_header: + all_aspects: "Все аспекты" + manage_aspects: "Управление аспектами" + publisher: + share: "Опубликовать" + aspect_friends: + add_friends: "добавить друзей" + albums: + album: + you: "Вы" + new_album: + create: "создать" + add_a_new_album: "Добавить новый альбом" + show: + edit_album: "Редактировать альбом" + albums: "альбомы" + updated: "обновленные" + by: "по" + edit: + editing: "Редактирование" + updated: "обновлено" + are_you_sure: "Вы уверены?" + delete_album: "Удалить альбом" + cancel: "Отмена" + index: + home: "домой" + new_album: "Новый альбом" + create: + success: "Вы создали новый альбом %{name}." + update: + success: "Альбом %{name} успешно редактирован." + failure: "Невозможно редактировать альбом %{name}." + destroy: + success: "Альбом %{name} удален." + aspects: + index: + photos: "фотографии" + show: + photos: "фотографии" + manage: + add_a_new_aspect: "Добавить аспект" + add_a_new_friend: "Добавить друга" + show: "Показать" + update_aspects: "Обновить аспекты" + requests: "Запросы" + ignore_remove: "Игнорировать/Удалить" + new_aspect: + add_a_new_aspect: "Добавить аспект" + create: "Создать" + create: + success:"Нажмите на плюс слева, для того, что-бы указать Diaspora тех, кто может видеть ваш новый аспект." + users: + edit: + cancel: "Отмена" + update_profile: "Обновить профиль" + home: "Домой" + diaspora_username: "Имя пользователя DIASPORA" + info: "Информация" + picture: "Аватар" + editing_profile: "Редактирование профиля" + albums: "Альбомы" + you_dont_have_any_photos: "У вас нет ни одной фотографии! Перейдите на " + page_to_upload_some: "страницу для загрузки." + comments: + comment: + ago: "ранее" + new_comment: + comment: "Комментарий" + photos: + show: + prev: "предыдущая" + full_size: "полный размер" + next: "следующая" + edit_photo: "Редактировать" + delete_photo: "Удалить" + are_you_sure: "Вы уверены?" + comments: "комментарии" + edit: + editing: "Редактирование" + are_you_sure: "Вы уверены?" + delete_photo: "Удалить фотографию" + photo: + show_comments: "показать комментарии" + posted_a_new_photo_to: "опубликовано в" + new: + new_photo: "Новая фотография" + back_to_list: "Вернуться к списку" + post_it: "опубликовать!" + registrations: + new: + sign_up: "Выйти" + status_messages: + new_status_message: + tell_me_something_good: "скажи мне что-нибудь хорошее" + oh_yeah: "о да!" + status_message: + show_comments: "показать комментарии" + delete: "Удалить" + are_you_sure: "Вы уверены?" + show: + status_message: "Сообщение о статусе" + comments: "комментарии" + are_you_sure: "Вы уверены?" + destroy: "Уничтожить" + view_all: "Показать все" + message: "Сообщение" + owner: "Владелец" + people: + index: + add_friend: "добавить друга" + real_name: "настоящее имя" + diaspora_handle: "идентификатор diaspora" + thats_you: "это Вы!" + friend_request_pending: "запрос на дружбу в ожидании" + you_have_a_friend_request_from_this_person: "у вас есть запрос на дружбу от этого человека" + new: + new_person: "Новая персона" + back_to_list: "Обратно к списку" + show: + last_seen: "последний раз был %{how_long_ago}" + friends_since: "друзья с %{how_long_ago}" + save: "сохранить" + are_you_sure: "Вы уверены?" + remove_friend: "удалить друга" \ No newline at end of file From cfd3523030788624c8ceaae0425e492414ea0995 Mon Sep 17 00:00:00 2001 From: UserAd Date: Wed, 22 Sep 2010 14:56:37 +0800 Subject: [PATCH 226/449] Stupid error fix --- config/locales/ru.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/locales/ru.yml b/config/locales/ru.yml index b4d19cbed..d0d9e8039 100644 --- a/config/locales/ru.yml +++ b/config/locales/ru.yml @@ -6,7 +6,7 @@ # Sample localization file for Russian. Add more files in this directory for other locales. # See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. -en: +ru: hello: "Привет, мир" layouts: application: @@ -140,4 +140,4 @@ en: friends_since: "друзья с %{how_long_ago}" save: "сохранить" are_you_sure: "Вы уверены?" - remove_friend: "удалить друга" \ No newline at end of file + remove_friend: "удалить друга" From e3c6926cf72b20e78201fc3cf910e1038df8fe4a Mon Sep 17 00:00:00 2001 From: Raphael Date: Thu, 23 Sep 2010 14:26:23 -0700 Subject: [PATCH 227/449] Moving installation instructions to a wiki page --- README.md | 284 +----------------------------------------------------- 1 file changed, 3 insertions(+), 281 deletions(-) diff --git a/README.md b/README.md index 0d5cee400..47748ea49 100644 --- a/README.md +++ b/README.md @@ -26,291 +26,13 @@ network. **PLEASE, DO NOT RUN IN PRODUCTION. IT IS FUN TO GET RUNNING, BUT EXPECT THINGS TO BE BROKEN** +Some initial installation instructions are [here](http://github.com/diaspora/diaspora/wiki/Installing-and-Running-Diaspora) + We are continuing to build features and improve the code base. -When we think it is ready for general use, we will post more detailed +When we think it is ready for general use, we will post more final instructions. -## Notice -We currently run Diaspora with the [thin](http://code.macournoyer.com/thin/) as -our webserver, behind [nginx](http://wiki.nginx.org/Main). Diaspora uses an -asynchronous [EventMachine](http://rubyeventmachine.com/) queue inside the appserver -to send messages between seeds. If you use mod_rails, mongrel, or another -non-eventmachine based application server, federation may not work. - -If you don't like thin, you can always try -[Rainbows!](http://rainbows.rubyforge.org/) We will try to fully support more -webservers later, but that is what works for now. - -These instructions are for machines running [Ubuntu](http://www.ubuntu.com/), -[Fedora](http://www.fedoraproject.org) or Mac OS X. We are developing Diaspora -for the latest and greatest browsers, so please update your Firefox, Chrome or -Safari to the latest and greatest. - -## Preparing your system - -In order to run Diaspora, you will need to download the following dependencies -(specific instructions follow): - -- Build Tools - Packages needed to compile the components that follow. -- [Ruby](http://www.ruby-lang.org) - The Ruby programming language. - (We're using **1.8.7**. It comes preinstalled on Mac OS X.) -- [MongoDB](http://www.mongodb.org) - A snappy noSQL database. -- [OpenSSL](http://www.openssl.org/) - An encryption library. - (It comes preinstalled on Mac OS X and Ubuntu.) -- [ImageMagick](http://www.imagemagick.org/) - An Image processing library used - to resize uploaded photos. -- [Git](http://git-scm.com/) - The fast version control system. - -After you have Ruby installed on your system, you will need to get RubyGems, -then install Bundler: - -- [RubyGems](http://rubygems.org/) - Source for Ruby gems. -- [Bundler](http://gembundler.com/) - Gem management tool for Ruby projects. - -**We suggest using a package management system to download these dependencies. -Trust us, it's going to make your life a lot easier. If you're using Mac OS X, -you can use [homebrew](http://mxcl.github.com/homebrew/); if you're using -Ubuntu, just use [Synaptic](http://www.nongnu.org/synaptic/) (it comes -pre-installed); if you're using Fedora simply use -[yum](http://yum.baseurl.org/). The instructions below assume you have these -installed.** - -### Build Tools - -To install build tools on **Ubuntu**, run the following (includes the gcc and -xml parsing dependencies): - - sudo apt-get install build-essential libxslt1.1 libxslt1-dev libxml2 - -To install build tools on **Fedora**, run the following: - - sudo yum install libxslt libxslt-devel libxml2 libxml2-devel - -To install build tools on **Mac OS X**, you need to download and install -[Xcode](http://developer.apple.com/technologies/tools/xcode.html). - -### Ruby - -To install Ruby 1.8.7 on **Ubuntu**, run the following command: - - sudo apt-get install ruby-full - -Please note that you need to have Universe enabled in your -/etc/apt/sources.list file to install ruby using apt-get. - -At this time Fedora does not have Ruby 1.8.7. As a workaround it is possible to -use [rvm](http://rvm.beginrescueend.com/) with a locally compiled Ruby -installation. A semi automated method for doing this is available. It is -highly recommended that you review the script before running it so you -understand what will occur. The script can be executed by running the -following command: - - ./script/bootstrap-fedora-diaspora.sh - -After reviewing and executing the above script you will need to follow the -"MongoDB" section and then you should skip all the way down to "Start Mongo". - -If you're on **Mac OS X**, you already have Ruby on your system. Yay! - -### MongoDB - -To install MongoDB on **Ubuntu**, add the official MongoDB repository -[here](http://www.mongodb.org/display/DOCS/Ubuntu+and+Debian+packages). - -For Lucid, add the following line to your /etc/apt/sources.list (for other -distros, see http://www.mongodb.org/display/DOCS/Ubuntu+and+Debian+packages): - - deb http://downloads.mongodb.org/distros/ubuntu 10.4 10gen - -Then run: - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10 - sudo apt-get update - sudo apt-get install mongodb-stable - -You can also run the binary directly by doing the following: - -If you're running a 32-bit system, run: - - wget http://fastdl.mongodb.org/linux/mongodb-linux-i686-1.6.2.tgz - -If you're running a 64-bit system, run: - - wget http://fastdl.mongodb.org/linux/mongodb-linux-x86_64-1.6.2.tgz - -Then run: - - # extract - tar xzf mongodb-linux-i686-1.4.0.tgz - # create the required data directory - sudo mkdir -p /data/db - sudo chmod -Rv 777 /data/ - - -To install MongoDB on a x86_64 **Fedora** system, add the official MongoDB -repository from MongoDB -(http://www.mongodb.org/display/DOCS/CentOS+and+Fedora+Packages) into -/etc/yum.repos.d/10gen.repo: - - [10gen] - name=10gen Repository - baseurl=http://downloads.mongodb.org/distros/fedora/13/os/x86_64/ - gpgcheck=0 - enabled=1 - -Then use yum to install the packages: - - sudo yum install mongo-stable mongo-stable-server - -If you're running a 32-bit system, run `wget -http://fastdl.mongodb.org/linux/mongodb-linux-i686-1.6.2.tgz`. If you're -running a 64-bit system, run `wget -http://fastdl.mongodb.org/linux/mongodb-linux-x86_64-1.6.2.tgz`. - - # extract - tar xzf mongodb-linux-i686-1.4.0.tgz - # create the required data directory - sudo mkdir -p /data/db - sudo chmod -Rv 777 /data/ - -To install MongoDB on **Mac OS X**, run the following: - - brew install mongo - sudo mkdir -p /data/db - sudo chmod -Rv 777 /data/ - -### OpenSSL - -If you're running either **Ubuntu**, **Fedora** or **Mac OS X** you already -have OpenSSL installed! - -### ImageMagick - -To install ImageMagick on **Ubuntu**, run the following: - - sudo apt-get install imagemagick libmagick9-dev - -To install ImageMagick on **Fedora**, run the following: - - sudo yum install ImageMagick - -To install ImageMagick on **Mac OS X**, run the following: - - brew install imagemagick - -### Git - -To install Git on **Ubuntu**, run the following: - - sudo apt-get install git-core - -To install Git on **Fedora**, run the following: - - sudo yum install git - - -To install Git on **Mac OS X**, run the following: - - brew install git - - -### Rubygems - -On **Ubuntu** 10.04, run the following: - - sudo add-apt-repository ppa:maco.m/ruby - sudo apt-get update - sudo apt-get install rubygems - -This PPA is maintained by an Ubuntu Developer. For Ubuntu 10.10, this version -of rubygems is in the repositories. - -On **Fedora**, run the following: - - sudo yum install rubygems - -On **Mac OS X**, RubyGems comes preinstalled; however, you might need to update -it for use with the latest Bundler. To update RubyGems, run `sudo gem update ---system`. - - -### Bundler - -After RubyGems is updated, simply run `sudo gem install bundler` to get -Bundler. If you're using Ubuntu repository .debs, bundler is found at -/var/lib/gems/1.8/bin/bundle - - -## Getting Diaspora - - git clone http://github.com/diaspora/diaspora.git - -If you have never used github before, their -[help desk](http://help.github.com/) has a pretty awesome guide on getting -setup. - - -## Running Diaspora - -### Install required gems - -To start the app server for the first time, you need to use Bundler to install -Diaspora's gem depencencies. Run `bundle install` from Diaspora's root -directory. Bundler will also warn you if there is a new dependency and you -need to bundle install again. - -### Start Mongo - -If you installed the Ubuntu package, MongoDB should already be running (if not, -run `service mongodb start`). If you installed the binary manually, run `sudo -mongod` from where mongo is installed to start mongo. - -If you installed the Fedora package, MongoDB will need to be started via -`service mongodb start`. If you installed the binary manually, run `sudo -mongod` from where Mongo is installed to start Mongo. - -If you installed the OsX package through "brew", MongoDB will need to be -started via `sudo launchctl load -/Library/LaunchDaemons/org.mongodb.mongod.plist`. (before you have to go to -/Library/LaunchDaemons and add a symlink to -/usr/local/Cellar/mongodb/1.6.2-x86_64/org.mongodb.mongod.plist) - -Diaspora will not run unless Mongo is running. Mongo will not run by default, -and will need to be started every time you wish to use or run the test suite -for Diaspora. - -### Configure Diaspora - -Diaspora needs to know where on the internet it is. Copy config/app_config_example.yml -to config/app_config.yml, put your url into the url field, and make any other -needed configuration changes. - -### Run the server - -`./script/server` will start both thin and the websocket server. If you want -to run a different app server, you will have to run them separately. See below -for instructions. - -### Run the app server - -Once mongo is running and bundler has finished, run `bundle exec thin start` -from the root Diaspora directory. This will start the app server in -development mode[.](http://bit.ly/9mwtUw) - -### Run the websocket server - -run `bundle exec ruby ./script/websocket_server` to start the websocket server -on port 8080. Change the port in config/app_config.yml. - -### Logging in with a sample user - -Run `rake db:seed:tom`, then login with user `tom` and password `evankorth`. -More details in db/seeds/tom.rb. - -### Testing - -Diaspora's test suite uses [rspec](http://rspec.info/), a behavior driven -testing framework. In order to run the tests, run `bundle exec rspec spec`. ## Resources From efedac7e32be31fb5e91efb28a71d7ab79166a60 Mon Sep 17 00:00:00 2001 From: Raphael Date: Thu, 23 Sep 2010 14:27:23 -0700 Subject: [PATCH 228/449] Punctuate --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 47748ea49..ded281e4a 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ network. **PLEASE, DO NOT RUN IN PRODUCTION. IT IS FUN TO GET RUNNING, BUT EXPECT THINGS TO BE BROKEN** -Some initial installation instructions are [here](http://github.com/diaspora/diaspora/wiki/Installing-and-Running-Diaspora) +Some initial installation instructions are [here](http://github.com/diaspora/diaspora/wiki/Installing-and-Running-Diaspora). We are continuing to build features and improve the code base. When we think it is ready for general use, we will post more final From f0999628ae651309c2d4b9a6b0b895fd7e7e9c09 Mon Sep 17 00:00:00 2001 From: ilya Date: Thu, 23 Sep 2010 14:43:08 -0700 Subject: [PATCH 229/449] trying to get friends from fb --- app/views/users/edit.html.haml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/views/users/edit.html.haml b/app/views/users/edit.html.haml index fb9de28be..bbd84ec92 100644 --- a/app/views/users/edit.html.haml +++ b/app/views/users/edit.html.haml @@ -75,10 +75,12 @@ - @response_hash = MiniFB.get(@access_token, 'me') = @response_hash[:name] + - @fb_friends = MiniFB.get(@access_token, 'me', :type => "friends") + = @fb_friends.inspect + - form_tag "/services/fb_post" do = text_area_tag "message" = submit_tag "send it off" - = link_to "Disconnect from Facebook", services_destroy_path - else = link_to "Connect to Facebook", @fb_access_url From 82bc5b097deef50c05e12f26484753713d8553fb Mon Sep 17 00:00:00 2001 From: Raphael Date: Thu, 23 Sep 2010 14:43:38 -0700 Subject: [PATCH 230/449] Use double quotes in locale files --- config/locales/devise/devise.en.yml | 42 ++++++++++++++--------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/config/locales/devise/devise.en.yml b/config/locales/devise/devise.en.yml index 09d3ac62c..8876bc5bf 100644 --- a/config/locales/devise/devise.en.yml +++ b/config/locales/devise/devise.en.yml @@ -12,30 +12,30 @@ en: devise: failure: - unauthenticated: 'You need to sign in or sign up before continuing.' - unconfirmed: 'You have to confirm your account before continuing.' - locked: 'Your account is locked.' - invalid: 'Invalid email or password.' - invalid_token: 'Invalid authentication token.' - timeout: 'Your session expired, please sign in again to continue.' - inactive: 'Your account was not activated yet.' + unauthenticated: "You need to sign in or sign up before continuing." + unconfirmed: "You have to confirm your account before continuing." + locked: "Your account is locked." + invalid: "Invalid email or password." + invalid_token: "Invalid authentication token." + timeout: "Your session expired, please sign in again to continue." + inactive: "Your account was not activated yet." sessions: - signed_in: 'Signed in successfully.' - signed_out: 'Signed out successfully.' + signed_in: "Signed in successfully." + signed_out: "Signed out successfully." passwords: - send_instructions: 'You will receive an email with instructions about how to reset your password in a few minutes.' - updated: 'Your password was changed successfully. You are now signed in.' + send_instructions: "You will receive an email with instructions about how to reset your password in a few minutes." + updated: "Your password was changed successfully. You are now signed in." confirmations: - send_instructions: 'You will receive an email with instructions about how to confirm your account in a few minutes.' - confirmed: 'Your account was successfully confirmed. You are now signed in.' + send_instructions: "You will receive an email with instructions about how to confirm your account in a few minutes." + confirmed: "Your account was successfully confirmed. You are now signed in." registrations: - signed_up: 'You have signed up successfully. If enabled, a confirmation was sent to your e-mail.' - updated: 'You updated your account successfully.' - destroyed: 'Bye! Your account was successfully cancelled. We hope to see you again soon.' + signed_up: "You have signed up successfully. If enabled, a confirmation was sent to your e-mail." + updated: "You updated your account successfully." + destroyed: "Bye! Your account was successfully cancelled. We hope to see you again soon." unlocks: - send_instructions: 'You will receive an email with instructions about how to unlock your account in a few minutes.' - unlocked: 'Your account was successfully unlocked. You are now signed in.' + send_instructions: "You will receive an email with instructions about how to unlock your account in a few minutes." + unlocked: "Your account was successfully unlocked. You are now signed in." mailer: - confirmation_instructions: 'Confirmation instructions' - reset_password_instructions: 'Reset password instructions' - unlock_instructions: 'Unlock Instructions' + confirmation_instructions: "Confirmation instructions" + reset_password_instructions: "Reset password instructions" + unlock_instructions: "Unlock Instructions" From 972cb54828386980f81d252f5f9a65a57557c81d Mon Sep 17 00:00:00 2001 From: Raphael Date: Thu, 23 Sep 2010 14:52:06 -0700 Subject: [PATCH 231/449] Move locale files, fix syntax error in fr-informal --- Gemfile.lock | 6 - config/locales/{ => defaults}/cs.yml | 0 config/locales/{ => defaults}/cy.yml | 0 config/locales/{ => defaults}/de.yml | 0 config/locales/{ => defaults}/en.yml | 0 config/locales/defaults/es.yml | 460 ++++++++---------- config/locales/{ => defaults}/fi.yml | 0 config/locales/{ => defaults}/fr-informal.yml | 6 +- config/locales/{ => defaults}/fr.yml | 0 config/locales/{ => defaults}/it.yml | 0 config/locales/{ => defaults}/lt.yml | 0 config/locales/{ => defaults}/pl.yml | 0 config/locales/{ => defaults}/pt-BR.yml | 0 config/locales/{ => defaults}/pt-PT.yml | 0 config/locales/{ => defaults}/ro.yml | 0 config/locales/{ => defaults}/ru.yml | 0 config/locales/{ => defaults}/sv.yml | 0 config/locales/devise.de.yml | 41 -- config/locales/devise.es.yml | 42 -- config/locales/devise.fr.yml | 41 -- config/locales/devise.it.yml | 41 -- config/locales/devise.pl.yml | 41 -- config/locales/devise.ru.yml | 41 -- config/locales/{ => devise}/devise.cs.yml | 0 config/locales/{ => devise}/devise.cy.yml | 0 config/locales/devise/devise.es.yml | 4 +- config/locales/{ => devise}/devise.fi.yml | 0 .../{ => devise}/devise.fr-informal.yml | 0 config/locales/devise/devise.it.yml | 46 +- config/locales/{ => devise}/devise.lt.yml | 0 config/locales/{ => devise}/devise.pt-BR.yml | 0 config/locales/{ => devise}/devise.pt-PT.yml | 0 config/locales/{ => devise}/devise.ro.yml | 0 config/locales/{ => devise}/devise.sv.yml | 0 config/locales/es.yml | 202 -------- 35 files changed, 227 insertions(+), 744 deletions(-) rename config/locales/{ => defaults}/cs.yml (100%) rename config/locales/{ => defaults}/cy.yml (100%) rename config/locales/{ => defaults}/de.yml (100%) rename config/locales/{ => defaults}/en.yml (100%) rename config/locales/{ => defaults}/fi.yml (100%) rename config/locales/{ => defaults}/fr-informal.yml (99%) rename config/locales/{ => defaults}/fr.yml (100%) rename config/locales/{ => defaults}/it.yml (100%) rename config/locales/{ => defaults}/lt.yml (100%) rename config/locales/{ => defaults}/pl.yml (100%) rename config/locales/{ => defaults}/pt-BR.yml (100%) rename config/locales/{ => defaults}/pt-PT.yml (100%) rename config/locales/{ => defaults}/ro.yml (100%) rename config/locales/{ => defaults}/ru.yml (100%) rename config/locales/{ => defaults}/sv.yml (100%) delete mode 100644 config/locales/devise.de.yml delete mode 100644 config/locales/devise.es.yml delete mode 100644 config/locales/devise.fr.yml delete mode 100644 config/locales/devise.it.yml delete mode 100644 config/locales/devise.pl.yml delete mode 100644 config/locales/devise.ru.yml rename config/locales/{ => devise}/devise.cs.yml (100%) rename config/locales/{ => devise}/devise.cy.yml (100%) rename config/locales/{ => devise}/devise.fi.yml (100%) rename config/locales/{ => devise}/devise.fr-informal.yml (100%) rename config/locales/{ => devise}/devise.lt.yml (100%) rename config/locales/{ => devise}/devise.pt-BR.yml (100%) rename config/locales/{ => devise}/devise.pt-PT.yml (100%) rename config/locales/{ => devise}/devise.ro.yml (100%) rename config/locales/{ => devise}/devise.sv.yml (100%) delete mode 100644 config/locales/es.yml diff --git a/Gemfile.lock b/Gemfile.lock index abad54828..dd181b320 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -104,8 +104,6 @@ GEM addressable (2.2.1) arel (1.0.1) activesupport (~> 3.0.0) - async_sinatra (0.2.3) - sinatra (>= 1.0) autotest (4.3.2) bcrypt-ruby (2.1.2) bson (1.0.7) @@ -214,8 +212,6 @@ GEM selenium-client (1.2.18) selenium-rc (2.2.4) selenium-client (>= 1.2.18) - sinatra (1.0) - rack (>= 1.0) subexec (0.0.4) thin (1.2.7) daemons (>= 1.0.9) @@ -242,7 +238,6 @@ PLATFORMS DEPENDENCIES addressable - async_sinatra autotest bson (= 1.0.7) bson_ext (= 1.0.7) @@ -271,7 +266,6 @@ DEPENDENCIES ruby-debug saucelabs-adapter (= 0.8.12) selenium-rc - sinatra (= 1.0) sprinkle! thin webmock diff --git a/config/locales/cs.yml b/config/locales/defaults/cs.yml similarity index 100% rename from config/locales/cs.yml rename to config/locales/defaults/cs.yml diff --git a/config/locales/cy.yml b/config/locales/defaults/cy.yml similarity index 100% rename from config/locales/cy.yml rename to config/locales/defaults/cy.yml diff --git a/config/locales/de.yml b/config/locales/defaults/de.yml similarity index 100% rename from config/locales/de.yml rename to config/locales/defaults/de.yml diff --git a/config/locales/en.yml b/config/locales/defaults/en.yml similarity index 100% rename from config/locales/en.yml rename to config/locales/defaults/en.yml diff --git a/config/locales/defaults/es.yml b/config/locales/defaults/es.yml index ad1db8794..5af6c70aa 100644 --- a/config/locales/defaults/es.yml +++ b/config/locales/defaults/es.yml @@ -1,264 +1,202 @@ -# Spanish translations for Rails -# by Francisco Fernando García Nieto (ffgarcianieto@gmail.com) +# Copyright (c) 2010, Diaspora Inc. This file is +# licensed under the Affero General Public License version 3. See +# the COPYRIGHT file. -"es": - # Action View - number: - # Used in number_with_delimiter() - # These are also the defaults for 'currency', 'percentage', 'precision', and 'human' - format: - # Sets the separator between the units, for more precision (e.g. 1.0 / 2.0 == 0.5) - separator: "," - # Delimets thousands (e.g. 1,000,000 is a million) (always in groups of three) - delimiter: "." - # Number of decimals, behind the separator (1 with a precision of 2 gives: 1.00) - precision: 3 - # If set to true, precision will mean the number of significant digits instead - # of the number of decimal digits (1234 with precision 2 becomes 1200, 1.23543 becomes 1.2) - significant: false - # If set, the zeros after the decimal separator will always be stripped (eg.: 1.200 will be 1.2) - strip_insignificant_zeros: false - # Used in number_to_currency() - currency: - format: - # Where is the currency sign? %u is the currency unit, %n the number (default: $5.00) - format: "%n %u" - unit: "€" - # These three are to override number.format and are optional - separator: "," - delimiter: "." - precision: 2 - significant: false - strip_insignificant_zeros: false +# Sample localization file for English. Add more files in this directory for other locales. +# See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. - # Used in number_to_percentage() - percentage: - format: - # These three are to override number.format and are optional - # separator: - delimiter: "" - # precision: - - # Used in number_to_precision() - precision: - format: - # These three are to override number.format and are optional - # separator: - delimiter: "" - # precision: - # significant: false - # strip_insignificant_zeros: false - - # Used in number_to_human_size() - human: - format: - # These three are to override number.format and are optional - # separator: - delimiter: "" - precision: 1 - significant: true - strip_insignificant_zeros: true - # Used in number_to_human_size() - storage_units: - format: "%n %u" - units: - byte: - one: "Byte" - other: "Bytes" - kb: "KB" - mb: "MB" - gb: "GB" - tb: "TB" - # Used in number_to_human() - decimal_units: - format: "%n %u" - # Decimal units output formatting - # By default we will only quantify some of the exponents - # but the commented ones might be defined or overridden - # by the user. - units: - # femto: Quadrillionth - # pico: Trillionth - # nano: Billionth - # micro: Millionth - # mili: Thousandth - # centi: Hundredth - # deci: Tenth - unit: "" - # ten: - # one: Ten - # other: Tens - # hundred: Hundred - thousand: "Mil" - million: "Millón" - billion: "Mil millones" - trillion: "Trillón" - quadrillion: "Cuatrillón" - - # Used in distance_of_time_in_words(), distance_of_time_in_words_to_now(), time_ago_in_words() - datetime: - distance_in_words: - half_a_minute: "medio minuto" - less_than_x_seconds: - one: "menos de 1 segundo" - other: "menos de %{count} segundos" - x_seconds: - one: "1 segundo" - other: "%{count} segundos" - less_than_x_minutes: - one: "menos de 1 minuto" - other: "menos de %{count} minutos" - x_minutes: - one: "1 minuto" - other: "%{count} minutos" - about_x_hours: - one: "alrededor de 1 hora" - other: "alrededor de %{count} horas" - x_days: - one: "1 día" - other: "%{count} días" - about_x_months: - one: "alrededor de 1 mes" - other: "alrededor de %{count} meses" - x_months: - one: "1 mes" - other: "%{count} meses" - about_x_years: - one: "alrededor de 1 año" - other: "alrededor de %{count} años" - over_x_years: - one: "más de 1 año" - other: "más de %{count} años" - almost_x_years: - one: "casi 1 año" - other: "casi %{count} años" - prompts: - year: "Año" - month: "Mes" - day: "Día" - hour: "Hora" - minute: "Minutos" - second: "Segundos" - - helpers: - select: - # Default value for :prompt => true in FormOptionsHelper - prompt: "Por favor seleccione" - - # Default translation keys for submit FormHelper - submit: - create: 'Guardar %{model}' - update: 'Actualizar %{model}' - submit: 'Guardar %{model}' - - # Attributes names common to most models - #attributes: - #created_at: "Created at" - #updated_at: "Updated at" - - # Active Record models configuration - activerecord: - errors: - messages: - taken: "ya está en uso" - record_invalid: "La validación falló: %{errors}" - # Append your own errors here or at the model/attributes scope. - - # You can define own errors for models or model attributes. - # The values :model, :attribute and :value are always available for interpolation. - # - # For example, - # models: - # user: - # blank: "This is a custom blank message for %{model}: %{attribute}" - # attributes: - # login: - # blank: "This is a custom blank message for User login" - # Will define custom blank validation message for User model and - # custom blank validation message for login attribute of User model. - #models: - - # Translate model names. Used in Model.human_name(). - #models: - # For example, - # user: "Dude" - # will translate User model name to "Dude" - - # Translate model attribute names. Used in Model.human_attribute_name(attribute). - #attributes: - # For example, - # user: - # login: "Handle" - # will translate User attribute "login" as "Handle" - - # Active Model - errors: - # The default format to use in full error messages. - format: "%{attribute} %{message}" - - template: - header: - one: "No se pudo guardar este/a %{model} porque se encontró 1 error" - other: "No se pudo guardar este/a %{model} porque se encontraron %{count} errores" - # The variable :count is also available - body: "Se encontraron problemas con los siguientes campos:" - - # The values :model, :attribute and :value are always available for interpolation - # The value :count is available when applicable. Can be used for pluralization. - messages: - inclusion: "no está incluido en la lista" - exclusion: "está reservado" - invalid: "no es válido" - confirmation: "no coincide con la confirmación" - accepted: "debe ser aceptado" - empty: "no puede estar vacío" - blank: "no puede estar en blanco" - too_long: "es demasiado largo (%{count} caracteres máximo)" - too_short: "es demasiado corto (%{count} caracteres mínimo)" - wrong_length: "no tiene la longitud correcta (%{count} caracteres exactos)" - not_a_number: "no es un número" - greater_than: "debe ser mayor que %{count}" - greater_than_or_equal_to: "debe ser mayor que o igual a %{count}" - equal_to: "debe ser igual a %{count}" - less_than: "debe ser menor que %{count}" - less_than_or_equal_to: "debe ser menor que o igual a %{count}" - odd: "debe ser impar" - even: "debe ser par" - - # Active Support - date: - formats: - # Use the strftime parameters for formats. - # When no format has been given, it uses default. - # You can provide other formats here if you like! - default: "%e/%m/%Y" - short: "%e de %b" - long: "%e de %B de %Y" - - day_names: [Domingo, Lunes, Martes, Miércoles, Jueves, Viernes, Sábado] - abbr_day_names: [Dom, Lun, Mar, Mie, Jue, Vie, Sab] - - # Don't forget the nil at the beginning; there's no such thing as a 0th month - month_names: [~, Enero, Febrero, Marzo, Abril, Mayo, Junio, Julio, Agosto, Septiembre, Octubre, Noviembre, Diciembre] - abbr_month_names: [~, Ene, Feb, Mar, Abr, May, Jun, Jul, Ago, Sep, Oct, Nov, Dic] - # Used in date_select and datime_select. - order: - - :day - - :month - - :year - - time: - formats: - default: "%A, %e de %B de %Y %H:%M:%S %z" - short: "%e de %b %H:%M" - long: "%e de %B de %Y %H:%M" - am: "am" - pm: "pm" - - # Used in array.to_sentence. - support: - array: - words_connector: ", " - two_words_connector: " y " - last_word_connector: ", y " \ No newline at end of file +es: + hello: "Hola Mundo" + application: + helper: + unknown_person: "persona desconocida" + new_requests: "nuevas peticiones" + dashboards: + helper: + home: "home" + error_messages: + helper: + invalid_fields: "Campos Invalidos" + correct_the_following_errors_and_try_again: "Corrija los siguentes errores y trate de nuevo." + people: + helper: + results_for: " resultados para %{params}" + people_on_pod_are_aware_of: " gente en pod estan al tanto de " + layouts: + application: + edit_profile: "editar perfil" + logout: "desloguear" + shared: + aspect_nav: + all_aspects: "Todos los Aspectos" + manage: "Manejar" + manage_your_aspects: "Maneja tus Aspectos" + sub_header: + all_aspects: "Todos los Aspectos" + manage_aspects: "Manejar Aspectos" + publisher: + share: "Compartir" + aspect_friends: + add_friends: "Añade amigos" + albums: + album: + you: "usted" + new_album: + create: "Crear" + add_a_new_album: "Añade un nuevo álbum" + show: + edit_album: "Editar Álbum" + albums: "álbumes" + updated: "actualizar" + by: "por" + edit: + editing: "Editando" + updated: "actualizado" + are_you_sure: "Esta seguro?" + delete_album: "Eliminar Álbum" + cancel: "Cancelar" + index: + home: "home" + new_album: "Nuevo Álbum" + create: + success: "Creo el álbum llamado %{name}." + update: + success: "Álbum %{name} fue editado exitosamente." + failure: "Fallo el editar el álbum %{name}." + destroy: + success: "Álbum %{name} fue eliminado." + helper: + friends_albums: "Álbumes de amigos" + your_albums: "Tus Álbumes" + aspects: + index: + photos: "fotos" + show: + photos: "fotos" + manage: + add_a_new_aspect: "Añadir nuevo aspecto" + add_a_new_friend: "Añadir nuevo amigo" + show: "Mostrar" + update_aspects: "Actualizar Aspectos" + requests: "Requests" + ignore_remove: "Ignorar/Remover" + new_aspect: + add_a_new_aspect: "Añadir nuevo aspecto" + create: "Crear" + create: + success:"Pulsa en el signo de mas a la izquierda para escojer quien puede ver su nuevo aspecto." + destroy: + success: "%{name} fue removido exitosamente." + update: + success: "Su aspecto, %{name}, fue editado exitosamente." + move_friends: + failure: "Fallo el editar aspecto para el amigo %{real_name}." + success: "Los aspectos fueron editados exitosamente." + move_friend: + error: "no funciono %{inspect}" + notice: "Ahora estas mostrando a tu amigo un aspecto diferente de ti." + helper: + remove: "remover" + aspect_not_empty: "Aspecto no esta vacio" + users: + edit: + cancel: "Cancelar" + update_profile: "Actualizar Perfil" + home: "Home" + diaspora_username: "USUARIO DE DIASPORA" + info: "Info" + picture: "Picture" + editing_profile: "Editando perfil" + albums: "Álbums" + you_dont_have_any_photos: "No tienes ninguna foto! ve a la pagina" + page_to_upload_some: "para subir algunas" + comments: + comment: + ago: "atras" + new_comment: + comment: "Commentario" + photos: + show: + prev: "prev" + full_size: "tamaño actual" + next: "prox" + edit_photo: "Editar Foto" + delete_photo: "Eliminar Foto" + are_you_sure: "Esta seguro?" + comments: "comentarios" + edit: + editing: "Editando" + are_you_sure: "Esta seguro?" + delete_photo: "Eliminar Foto" + photo: + show_comments: "mostrar comentarios" + posted_a_new_photo_to: "a puesto una nueva foto en" + new: + new_photo: "Nueva Foto" + back_to_list: "Devuelta a la lista" + post_it: "post it!" + create: + runtime_error: "Photo upload failed. Are you sure that your seatbelt is fastened?" + integrity_error: "Photo upload failed. Are you sure that was an image?" + type_error: "Photo upload failed. Are you sure an image was added?" + update: + notice: "Photo successfully updated." + error: "Failed to edit photo." + destroy: + notice: "Photo deleted." + registrations: + new: + sign_up: "Registrate" + create: + success: "Esta registrado en Diaspora!" + status_messages: + new_status_message: + tell_me_something_good: "dime algo bueno" + oh_yeah: "oh yeah!" + status_message: + show_comments: "mostrar comentarios" + delete: "Eliminar" + are_you_sure: "Esta seguro?" + show: + status_message: "Mensaje de status" + comments: "comentarios" + are_you_sure: "Esta seguro?" + destroy: "Destruir" + view_all: "Ver Todos" + message: "Mensaje" + owner: "Dueño" + helper: + no_message_to_display: "No hay mensajes que mostrar." + people: + person: + add_friend: "añadir amigo" + pending_request: "petición pendiente" + index: + add_friend: "añadir amigo" + real_name: "nombre real" + diaspora_handle: "usuario en diaspora" + thats_you: "ese eres tu!" + friend_request_pending: "friend request pending" + you_have_a_friend_request_from_this_person: "you have a friend request from this person" + show: + last_seen: "ultima vez visto: %{how_long_ago}" + friends_since: "amigos desde: %{how_long_ago}" + save: "guardar" + are_you_sure: "Esta seguro?" + remove_friend: "remover amigo" + requests: + new_request: + add_a_new_friend_to: "Añade un nuevo amigo a " + enter_a_diaspora_username: "Escribe el usuario de Diaspora:" + your_diaspora_username_is: "Tu usuario de Diaspora es: %{diaspora_handle}" + friends_username: "Usuario de amigo" + destroy: + success: "Ahora son amigos." + error: "Seleccione un aspecto!" + ignore: "Ignorar peticion de amistad" + create: + error: "No diaspora seed found with this email!" + already_friends: "Ya eres amigo de %{destination_url}!" + success: "Una peticion de amistad se envio a %{destination_url}." + horribly_wrong: "Algo horriblemente mal sucedio" diff --git a/config/locales/fi.yml b/config/locales/defaults/fi.yml similarity index 100% rename from config/locales/fi.yml rename to config/locales/defaults/fi.yml diff --git a/config/locales/fr-informal.yml b/config/locales/defaults/fr-informal.yml similarity index 99% rename from config/locales/fr-informal.yml rename to config/locales/defaults/fr-informal.yml index 627674ca5..f70812fdf 100644 --- a/config/locales/fr-informal.yml +++ b/config/locales/defaults/fr-informal.yml @@ -53,7 +53,7 @@ fr-informal: edit: editing: "Édition" updated: "mis à jour" - are_you_sure: "Es-tu sûr(e) ?" + are_you_sure: "Es-tu sûr(e)?" delete_album: "Supprimer l’album" cancel: "Annuler" index: @@ -66,7 +66,7 @@ fr-informal: failure: "L’édition de l’album %{name} a échoué." destroy: success: "L’album %{name} a été supprimé." - helper: + helper: friends_albums: "Albums d’amis" your_albums: "Tes albums" aspects: @@ -202,4 +202,4 @@ fr-informal: error: "Aucun résultat Diaspora n’a été trouvé avec cette adresse e-mail !" already_friends: "Tu es déjà ami avec %{destination_url}!" success: "Une requête d’ami a été envoyée à %{destination_url}." - horribly_wrong: "Quelque chose d’horrible s’est produit." \ No newline at end of file + horribly_wrong: "Quelque chose d’horrible s’est produit." diff --git a/config/locales/fr.yml b/config/locales/defaults/fr.yml similarity index 100% rename from config/locales/fr.yml rename to config/locales/defaults/fr.yml diff --git a/config/locales/it.yml b/config/locales/defaults/it.yml similarity index 100% rename from config/locales/it.yml rename to config/locales/defaults/it.yml diff --git a/config/locales/lt.yml b/config/locales/defaults/lt.yml similarity index 100% rename from config/locales/lt.yml rename to config/locales/defaults/lt.yml diff --git a/config/locales/pl.yml b/config/locales/defaults/pl.yml similarity index 100% rename from config/locales/pl.yml rename to config/locales/defaults/pl.yml diff --git a/config/locales/pt-BR.yml b/config/locales/defaults/pt-BR.yml similarity index 100% rename from config/locales/pt-BR.yml rename to config/locales/defaults/pt-BR.yml diff --git a/config/locales/pt-PT.yml b/config/locales/defaults/pt-PT.yml similarity index 100% rename from config/locales/pt-PT.yml rename to config/locales/defaults/pt-PT.yml diff --git a/config/locales/ro.yml b/config/locales/defaults/ro.yml similarity index 100% rename from config/locales/ro.yml rename to config/locales/defaults/ro.yml diff --git a/config/locales/ru.yml b/config/locales/defaults/ru.yml similarity index 100% rename from config/locales/ru.yml rename to config/locales/defaults/ru.yml diff --git a/config/locales/sv.yml b/config/locales/defaults/sv.yml similarity index 100% rename from config/locales/sv.yml rename to config/locales/defaults/sv.yml diff --git a/config/locales/devise.de.yml b/config/locales/devise.de.yml deleted file mode 100644 index 7c0e0e758..000000000 --- a/config/locales/devise.de.yml +++ /dev/null @@ -1,41 +0,0 @@ -# Copyright (c) 2010, Diaspora Inc. This file is -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - - -de: - errors: - messages: - not_found: "nicht gefunden" - already_confirmed: "wurde bereits bestätigt" - not_locked: "war nicht gesperrt" - - devise: - failure: - unauthenticated: 'Du musst dich anmelden oder registrieren um fortzufahren.' - unconfirmed: 'Du musst dein Konto bestätigen um fortzufahren.' - locked: 'Dein Konto ist gesperrt.' - invalid: 'Ungültige E-Mail-Adresse oder Passwort.' - invalid_token: 'Ungültiger Authentifizierungstoken.' - timeout: 'Deine Sitzung ist abgelaufen, bitte melde dich erneut an um fortzufahren.' - inactive: 'Dein Konto wurde noch nicht aktiviert.' - sessions: - signed_in: 'Erfolgreich angemeldet.' - signed_out: 'Erfolgreich abgemeldet.' - passwords: - send_instructions: 'Du wirst in ein paar Minuten eine E-Mail erhalten, die beschreibt, wie du dein Passwort zurücksetzt.' - updated: 'Dein Passwort wurde erfolgreich geändert. Du bist nun angemeldet.' - confirmations: - send_instructions: 'Du wirst in ein paar Minuten eine E-Mail erhalten, die beschreibt, wie du dein Konto bestätigst.' - confirmed: 'Dein Konto wurde erfolgreich bestätigt. Du bist nun angemeldet.' - registrations: - signed_up: 'Du hast dich erfolgreich registriert. Sofern aktiviert, wurde dir eine Bestätigung per E-Mail gesendet.' - updated: 'Dein Konto wurde aktualisiert.' - destroyed: 'Tschüss! Dein Konto wurde erfolgreich gekündigt. Wir hoffen dich bald wiederzusehen.' - unlocks: - send_instructions: 'Du wirst in ein paar Minuten eine E-Mail erhalten, die beschreibt, wie du dein Konto entsperren kannst.' - unlocked: 'Dein Konto wurde erfolgreich entsperrt. Du bist nun angemeldet.' - mailer: - confirmation_instructions: 'Instruktionen zur Bestätigung' - reset_password_instructions: 'Instruktionen zum Zurücksetzen des Passworts' - unlock_instructions: 'Instruktionen zum Entsperren' diff --git a/config/locales/devise.es.yml b/config/locales/devise.es.yml deleted file mode 100644 index 06002aa63..000000000 --- a/config/locales/devise.es.yml +++ /dev/null @@ -1,42 +0,0 @@ -es: - errors: - messages: - not_found: 'no encontrado' - already_confirmed: 'ya ha sido confirmada' - not_locked: 'no está bloqueada' - - devise: - failure: - unauthenticated: 'Necesitas acceder a tu cuenta o registrarte antes de continuar.' - unconfirmed: 'Necesitas confirmar tu cuenta antes de continuar.' - locked: 'Tu cuenta esta bloqueada.' - invalid: 'Contraseña o Email incorrecto.' - invalid_token: 'Token de autenticación incorrecto.' - timeout: 'Tu sesión ha expirado, por favor accede de nuevo para continuar.' - inactive: 'Tu cuenta no ha sido activada.' - sessions: - signed_in: 'Has ingresado correctamente.' - signed_out: 'Has salido correctamente.' - passwords: - send_instructions: 'Recibirás un email con instrucciones para cambiar tu contraseña en pocos minutos.' - updated: 'Tu contraseña ha sido modificada. Ya has accedido a tu cuenta.' - confirmations: - send_instructions: 'Recibirás un email con instrucciones para confirmar tu cuenta en pocos minutos.' - confirmed: 'Tu cuenta ha sido confirmada. Ya has accedido a tu cuenta.' - registrations: - signed_up: 'Te has registrado correctamente. Si está disponible, te habremos enviado un email de confirmación.' - updated: 'Has actualizado tu cuenta correctamente.' - destroyed: '!Adiós! Tu cuenta ha sido cancelada. Esperamos verte pronto.' - unlocks: - send_instructions: 'Recibirás un email con instrucciones para desbloquear tu cuenta en pocos minutos.' - unlocked: 'Tu cuenta ha sido desbloqueada. Ya has accedido a tu cuenta.' - oauth_callbacks: - success: 'Has sido autorizado satisfactoriamente de la cuenta %{kind}.' - failure: 'No has sido autorizado en la cuenta %{kind} porque "%{reason}".' - mailer: - confirmation_instructions: - subject: 'Instrucciones de confirmación' - reset_password_instructions: - subject: 'Instrucciones para cambiar tu contraseña' - unlock_instructions: - subject: 'Instrucciones para desbloquear tu cuenta' \ No newline at end of file diff --git a/config/locales/devise.fr.yml b/config/locales/devise.fr.yml deleted file mode 100644 index b8691eb3a..000000000 --- a/config/locales/devise.fr.yml +++ /dev/null @@ -1,41 +0,0 @@ -# Copyright (c) 2010, Diaspora Inc. This file is -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - - -fr: - errors: - messages: - not_found: "introuvable" - already_confirmed: "a déjà été confirmé" - not_locked: "n’a pas été verrouillé" - - devise: - failure: - unauthenticated: 'Vous devez vous connecter ou vous inscrire avant de continuer.' - unconfirmed: 'Vous devez confirmer votre compte avant de continuer.' - locked: 'Votre compte est verrouillé.' - invalid: 'E-mail ou mot de passe invalide.' - invalid_token: 'Jeton d’authentification invalide.' - timeout: 'Votre session a expiré, veuillez vous connecter de nouveau afin de continuer.' - inactive: 'Votre compte n’a pas encore été activé.' - sessions: - signed_in: 'Connecté avec succès.' - signed_out: 'Déconnecté avec succès.' - passwords: - send_instructions: 'Vous allez recevoir dans quelques minutes un e-mail contenant des instructions vous expliquant comment réinitialiser votre mot de passe.' - updated: 'Votre mot de passe a été modifié avec succès. Vous êtes à présent connecté.' - confirmations: - send_instructions: 'Vous allez recevoir dans quelques minutes un e-mail contenant des instructions vous expliquant comment confirmer votre compte.' - confirmed: 'Votre compte a été confirmé avec succès. Vous êtes à présent connecté.' - registrations: - signed_up: 'Vous vous êtes inscrit avec succès. Si activée, une confirmation a été envoyée sur votre adresse e-mail.' - updated: 'Vous avez mis à jour votre compte avec succès.' - destroyed: 'Au revoir ! Votre compte a été résilié avec succès. Nous espérons vous revoir très bientôt.' - unlocks: - send_instructions: 'Vous allez recevoir dans quelques minutes un e-mail contenant des instructions vous expliquant comment déverrouiller votre compte.' - unlocked: 'Votre compte a été déverrouillé avec succès. Vous êtes à présent connecté.' - mailer: - confirmation_instructions: 'Instructions de confirmation' - reset_password_instructions: 'Réinitialiser les instructions du mot de passe' - unlock_instructions: 'Instructions de déverrouillage' diff --git a/config/locales/devise.it.yml b/config/locales/devise.it.yml deleted file mode 100644 index 76f761e37..000000000 --- a/config/locales/devise.it.yml +++ /dev/null @@ -1,41 +0,0 @@ -# Copyright (c) 2010, Diaspora Inc. This file is -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - - -it: - errors: - messages: - not_found: "non trovato" - already_confirmed: "è già stato confermato" - not_locked: "non era bloccato" - - devise: - failure: - unauthenticated: "Devi effettuare l'accesso o registrarti prima di continuare." - unconfirmed: "Devi confermare il tuo account prima di continuare." - locked: "Il tuo account è bloccato." - invalid: "Email o password errati." - invalid_token: "Token di autenticazione errato." - timeout: "La tua sessione è scaduta, effettua di nuovo l'accesso per continuare." - inactive: "Il tuo account non è ancora stato attivato." - sessions: - signed_in: "Accesso effettuato con successo." - signed_out: "Disconnessione effettuata con successo." - passwords: - send_instructions: "Tra pochi minuti riceverai una email con le istruzioni su come cambiare la tua password." - updated: "La tua password è stata modificata. Hai appena effettuato l'accesso." - confirmations: - send_instructions: "Tra pochi minuti riceverai una email per confermare il tuo account." - confirmed: "Il tuo account è stato confermato con successo. Hai appena effettuato l'accesso." - registrations: - signed_up: "Ti sei iscritto. Se il servizio è disponibile, riceverai una conferma via email." - updated: "Hai aggiornato il tuo account." - destroyed: "Ciao! Il tuo account è stato rimosso. Speriamo che tu torni a trovarci presto." - unlocks: - send_instructions: "Tra pochi minuti riceverai una mail con le istruzioni su come sbloccare il tuo account." - unlocked: "Il tuo account è stato sbloccato. Hai appena effettuato l'accesso." - mailer: - confirmation_instructions: "Istruzioni sulla conferma" - reset_password_instructions: "Istruzioni su come cambiare la password" - unlock_instructions: "Istruzioni su come sbloccare l'account" diff --git a/config/locales/devise.pl.yml b/config/locales/devise.pl.yml deleted file mode 100644 index a490a1a39..000000000 --- a/config/locales/devise.pl.yml +++ /dev/null @@ -1,41 +0,0 @@ -# Copyright (c) 2010, Diaspora Inc. This file is -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - - -pl: - errors: - messages: - not_found: "nie znaleziono" - already_confirmed: "potwierdzono wcześniej" - not_locked: "nie był zablokowany" - - devise: - failure: - unauthenticated: 'By kontynuować musisz się zalogować lub zarejestrować.' - unconfirmed: 'Musisz aktywować swoje konto.' - locked: 'Twoje konto jest zablokowane.' - invalid: 'Nieprawidłowy adres email lub hasło.' - invalid_token: 'Nieprawidłowy kod identyfikacyjny.' - timeout: 'Twoja sesja wygasła, zaloguj się ponownie by kontynuować.' - inactive: 'Twoje konto nie zostało jeszcze aktywowane.' - sessions: - signed_in: 'Zalogowano pomyślnie.' - signed_out: 'Wylogowano.' - passwords: - send_instructions: 'W ciągu kilku minut otrzymasz maila zawierającego instrukcjie dotyczące zresetowania hasła.' - updated: 'Twoje hasło zostało zmienione, zostałeś zalogowany.' - confirmations: - send_instructions: 'W ciągu kilku minut otrzymasz maila zawierającego instrukcje dotyczące aktywacji konta.' - confirmed: 'Twoje konto zostało aktywowane, zostałeś zalogowany.' - registrations: - signed_up: 'Zostałeś zarejestrowany. Jeśli aktywowano odpowiednią opcję, wyślemy do Ciebie email potwierdzający rejestrację.' - updated: 'Pomyślnie zaktualizowano informacje o Twoim koncie.' - destroyed: 'Żegnaj! Twoje konto zostało usunięte.' - unlocks: - send_instructions: 'W ciągu kilku minut otrzymasz email z instrukcjami odblokowania konta.' - unlocked: 'Twoje konto zostało odblokowane, jesteś zalogowany.' - mailer: - confirmation_instructions: 'Instrukcje aktywacji' - reset_password_instructions: 'Instrukcje zmiany hasła' - unlock_instructions: 'Instrukcje odblokowania' diff --git a/config/locales/devise.ru.yml b/config/locales/devise.ru.yml deleted file mode 100644 index 670d57026..000000000 --- a/config/locales/devise.ru.yml +++ /dev/null @@ -1,41 +0,0 @@ -# Copyright (c) 2010, Diaspora Inc. This file is -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - - -ru: - errors: - messages: - not_found: "не найден(о)" - already_confirmed: "уже подтвержден(о)" - not_locked: "не заблокирован(о)" - - devise: - failure: - unauthenticated: 'Вам нужно войти либо зарегистрироваться, чтобы продолжить.' - unconfirmed: 'Вам нужно подтвердить вашу учётную запись, чтобы продолжить.' - locked: 'Ваша учётная запись заблокирована.' - invalid: 'Неверный e-mail или пароль.' - invalid_token: 'Неверный ключ аутентификации.' - timeout: 'Срок вашего сеанса истёк, пожалуйста, войдите в систему снова.' - inactive: 'Ваша учётная запись ещё не активирована.' - sessions: - signed_in: 'Вход в систему выполнен успешно.' - signed_out: 'Выход из системы выполнен успешно.' - passwords: - send_instructions: 'Вы получите e-mail с указаниями по сбросу пароля в течение нескольких минут.' - updated: 'Ваш пароль был изменён. Вы вошли в систему.' - confirmations: - send_instructions: 'Вы получите e-mail с указаниями по подтверждению учётной записи в течение нескольких минут.' - confirmed: 'Ваша учётная запись была подтверждена. Вы вошли в систему.' - registrations: - signed_up: 'Регистрация выполнена успешно. В зависимости от настроек, вам может прийти e-mail с подтверждением.' - updated: 'Обновление вашей учётной записи выполнено успешно.' - destroyed: 'До свидания! Ваша учётная запись была удалена. Надеемся, что вскоре вас увидим снова.' - unlocks: - send_instructions: 'Вы получите e-mail с указаниями по разблокированию учётной записи в течение нескольких минут.' - unlocked: 'Ваша учётная запись была разблокирована. Вы вошли в систему.' - mailer: - confirmation_instructions: 'Подтверждение учётной записи' - reset_password_instructions: 'Сброс пароля' - unlock_instructions: 'Разблокирование учётной записи' diff --git a/config/locales/devise.cs.yml b/config/locales/devise/devise.cs.yml similarity index 100% rename from config/locales/devise.cs.yml rename to config/locales/devise/devise.cs.yml diff --git a/config/locales/devise.cy.yml b/config/locales/devise/devise.cy.yml similarity index 100% rename from config/locales/devise.cy.yml rename to config/locales/devise/devise.cy.yml diff --git a/config/locales/devise/devise.es.yml b/config/locales/devise/devise.es.yml index 70209ff79..06002aa63 100644 --- a/config/locales/devise/devise.es.yml +++ b/config/locales/devise/devise.es.yml @@ -18,10 +18,10 @@ es: signed_in: 'Has ingresado correctamente.' signed_out: 'Has salido correctamente.' passwords: - send_instructions: 'Recibirás un email con instrucciones para cambiar tu contraseña en poco minutos.' + send_instructions: 'Recibirás un email con instrucciones para cambiar tu contraseña en pocos minutos.' updated: 'Tu contraseña ha sido modificada. Ya has accedido a tu cuenta.' confirmations: - send_instructions: 'Recibirás un email con instrucciones para confirmar tu cuenta en poco minutos.' + send_instructions: 'Recibirás un email con instrucciones para confirmar tu cuenta en pocos minutos.' confirmed: 'Tu cuenta ha sido confirmada. Ya has accedido a tu cuenta.' registrations: signed_up: 'Te has registrado correctamente. Si está disponible, te habremos enviado un email de confirmación.' diff --git a/config/locales/devise.fi.yml b/config/locales/devise/devise.fi.yml similarity index 100% rename from config/locales/devise.fi.yml rename to config/locales/devise/devise.fi.yml diff --git a/config/locales/devise.fr-informal.yml b/config/locales/devise/devise.fr-informal.yml similarity index 100% rename from config/locales/devise.fr-informal.yml rename to config/locales/devise/devise.fr-informal.yml diff --git a/config/locales/devise/devise.it.yml b/config/locales/devise/devise.it.yml index 9b0fb0957..76f761e37 100644 --- a/config/locales/devise/devise.it.yml +++ b/config/locales/devise/devise.it.yml @@ -7,35 +7,35 @@ it: errors: messages: not_found: "non trovato" - already_confirmed: "già confermato" - not_locked: "non bloccato" + already_confirmed: "è già stato confermato" + not_locked: "non era bloccato" devise: failure: - unauthenticated: 'È necessario che tu acceda o ti registri prima di continuare.' - unconfirmed: 'Devi confermare il tuo account prima di continuare.' - locked: 'Il tuo account è bloccato.' - invalid: 'Email o password invalida.' - invalid_token: 'Invalido token di autenticazione.' - timeout: 'La tua sessione è scaduta, per favore accedi nuovamente per continuare.' - inactive: 'Il tuo account non è ancora stato attivato.' + unauthenticated: "Devi effettuare l'accesso o registrarti prima di continuare." + unconfirmed: "Devi confermare il tuo account prima di continuare." + locked: "Il tuo account è bloccato." + invalid: "Email o password errati." + invalid_token: "Token di autenticazione errato." + timeout: "La tua sessione è scaduta, effettua di nuovo l'accesso per continuare." + inactive: "Il tuo account non è ancora stato attivato." sessions: - signed_in: 'Collegamento avvenuto con successo.' - signed_out: 'Uscita avvenuta con successo.' + signed_in: "Accesso effettuato con successo." + signed_out: "Disconnessione effettuata con successo." passwords: - send_instructions: 'Tra quale minuto riceverai una email con le istruzioni per ripristinare la password.' - updated: 'La tua password è stata cambiata con successo. Ora sei collegato.' + send_instructions: "Tra pochi minuti riceverai una email con le istruzioni su come cambiare la tua password." + updated: "La tua password è stata modificata. Hai appena effettuato l'accesso." confirmations: - send_instructions: 'Tra qualche minuti riceverai una email con le istruzioni per confermare il tuo account.' - confirmed: 'Il tuo account è stato confermato con successo. Ora sei collegato.' + send_instructions: "Tra pochi minuti riceverai una email per confermare il tuo account." + confirmed: "Il tuo account è stato confermato con successo. Hai appena effettuato l'accesso." registrations: - signed_up: 'Ti sei registrato con successo. Se abilitato, ti verrà inviata una email di conferma.' - updated: 'Hai aggiornato il tuo account.' - destroyed: 'Addio! Il tuo account è stato cancellato. Speriamo di rivederti presto.' + signed_up: "Ti sei iscritto. Se il servizio è disponibile, riceverai una conferma via email." + updated: "Hai aggiornato il tuo account." + destroyed: "Ciao! Il tuo account è stato rimosso. Speriamo che tu torni a trovarci presto." unlocks: - send_instructions: 'Tra qualche minuti riceverai una email con le istruzioni per sbloccare il tuo account.' - unlocked: 'Il tuo account è stato sbloccato. Ora sei collegato.' + send_instructions: "Tra pochi minuti riceverai una mail con le istruzioni su come sbloccare il tuo account." + unlocked: "Il tuo account è stato sbloccato. Hai appena effettuato l'accesso." mailer: - confirmation_instructions: 'Istruzioni per la conferma' - reset_password_instructions: 'Istruzioni per il reset della password' - unlock_instructions: 'Istruzioni per lo sblocco' + confirmation_instructions: "Istruzioni sulla conferma" + reset_password_instructions: "Istruzioni su come cambiare la password" + unlock_instructions: "Istruzioni su come sbloccare l'account" diff --git a/config/locales/devise.lt.yml b/config/locales/devise/devise.lt.yml similarity index 100% rename from config/locales/devise.lt.yml rename to config/locales/devise/devise.lt.yml diff --git a/config/locales/devise.pt-BR.yml b/config/locales/devise/devise.pt-BR.yml similarity index 100% rename from config/locales/devise.pt-BR.yml rename to config/locales/devise/devise.pt-BR.yml diff --git a/config/locales/devise.pt-PT.yml b/config/locales/devise/devise.pt-PT.yml similarity index 100% rename from config/locales/devise.pt-PT.yml rename to config/locales/devise/devise.pt-PT.yml diff --git a/config/locales/devise.ro.yml b/config/locales/devise/devise.ro.yml similarity index 100% rename from config/locales/devise.ro.yml rename to config/locales/devise/devise.ro.yml diff --git a/config/locales/devise.sv.yml b/config/locales/devise/devise.sv.yml similarity index 100% rename from config/locales/devise.sv.yml rename to config/locales/devise/devise.sv.yml diff --git a/config/locales/es.yml b/config/locales/es.yml deleted file mode 100644 index 5af6c70aa..000000000 --- a/config/locales/es.yml +++ /dev/null @@ -1,202 +0,0 @@ -# Copyright (c) 2010, Diaspora Inc. This file is -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - - -# Sample localization file for English. Add more files in this directory for other locales. -# See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. - -es: - hello: "Hola Mundo" - application: - helper: - unknown_person: "persona desconocida" - new_requests: "nuevas peticiones" - dashboards: - helper: - home: "home" - error_messages: - helper: - invalid_fields: "Campos Invalidos" - correct_the_following_errors_and_try_again: "Corrija los siguentes errores y trate de nuevo." - people: - helper: - results_for: " resultados para %{params}" - people_on_pod_are_aware_of: " gente en pod estan al tanto de " - layouts: - application: - edit_profile: "editar perfil" - logout: "desloguear" - shared: - aspect_nav: - all_aspects: "Todos los Aspectos" - manage: "Manejar" - manage_your_aspects: "Maneja tus Aspectos" - sub_header: - all_aspects: "Todos los Aspectos" - manage_aspects: "Manejar Aspectos" - publisher: - share: "Compartir" - aspect_friends: - add_friends: "Añade amigos" - albums: - album: - you: "usted" - new_album: - create: "Crear" - add_a_new_album: "Añade un nuevo álbum" - show: - edit_album: "Editar Álbum" - albums: "álbumes" - updated: "actualizar" - by: "por" - edit: - editing: "Editando" - updated: "actualizado" - are_you_sure: "Esta seguro?" - delete_album: "Eliminar Álbum" - cancel: "Cancelar" - index: - home: "home" - new_album: "Nuevo Álbum" - create: - success: "Creo el álbum llamado %{name}." - update: - success: "Álbum %{name} fue editado exitosamente." - failure: "Fallo el editar el álbum %{name}." - destroy: - success: "Álbum %{name} fue eliminado." - helper: - friends_albums: "Álbumes de amigos" - your_albums: "Tus Álbumes" - aspects: - index: - photos: "fotos" - show: - photos: "fotos" - manage: - add_a_new_aspect: "Añadir nuevo aspecto" - add_a_new_friend: "Añadir nuevo amigo" - show: "Mostrar" - update_aspects: "Actualizar Aspectos" - requests: "Requests" - ignore_remove: "Ignorar/Remover" - new_aspect: - add_a_new_aspect: "Añadir nuevo aspecto" - create: "Crear" - create: - success:"Pulsa en el signo de mas a la izquierda para escojer quien puede ver su nuevo aspecto." - destroy: - success: "%{name} fue removido exitosamente." - update: - success: "Su aspecto, %{name}, fue editado exitosamente." - move_friends: - failure: "Fallo el editar aspecto para el amigo %{real_name}." - success: "Los aspectos fueron editados exitosamente." - move_friend: - error: "no funciono %{inspect}" - notice: "Ahora estas mostrando a tu amigo un aspecto diferente de ti." - helper: - remove: "remover" - aspect_not_empty: "Aspecto no esta vacio" - users: - edit: - cancel: "Cancelar" - update_profile: "Actualizar Perfil" - home: "Home" - diaspora_username: "USUARIO DE DIASPORA" - info: "Info" - picture: "Picture" - editing_profile: "Editando perfil" - albums: "Álbums" - you_dont_have_any_photos: "No tienes ninguna foto! ve a la pagina" - page_to_upload_some: "para subir algunas" - comments: - comment: - ago: "atras" - new_comment: - comment: "Commentario" - photos: - show: - prev: "prev" - full_size: "tamaño actual" - next: "prox" - edit_photo: "Editar Foto" - delete_photo: "Eliminar Foto" - are_you_sure: "Esta seguro?" - comments: "comentarios" - edit: - editing: "Editando" - are_you_sure: "Esta seguro?" - delete_photo: "Eliminar Foto" - photo: - show_comments: "mostrar comentarios" - posted_a_new_photo_to: "a puesto una nueva foto en" - new: - new_photo: "Nueva Foto" - back_to_list: "Devuelta a la lista" - post_it: "post it!" - create: - runtime_error: "Photo upload failed. Are you sure that your seatbelt is fastened?" - integrity_error: "Photo upload failed. Are you sure that was an image?" - type_error: "Photo upload failed. Are you sure an image was added?" - update: - notice: "Photo successfully updated." - error: "Failed to edit photo." - destroy: - notice: "Photo deleted." - registrations: - new: - sign_up: "Registrate" - create: - success: "Esta registrado en Diaspora!" - status_messages: - new_status_message: - tell_me_something_good: "dime algo bueno" - oh_yeah: "oh yeah!" - status_message: - show_comments: "mostrar comentarios" - delete: "Eliminar" - are_you_sure: "Esta seguro?" - show: - status_message: "Mensaje de status" - comments: "comentarios" - are_you_sure: "Esta seguro?" - destroy: "Destruir" - view_all: "Ver Todos" - message: "Mensaje" - owner: "Dueño" - helper: - no_message_to_display: "No hay mensajes que mostrar." - people: - person: - add_friend: "añadir amigo" - pending_request: "petición pendiente" - index: - add_friend: "añadir amigo" - real_name: "nombre real" - diaspora_handle: "usuario en diaspora" - thats_you: "ese eres tu!" - friend_request_pending: "friend request pending" - you_have_a_friend_request_from_this_person: "you have a friend request from this person" - show: - last_seen: "ultima vez visto: %{how_long_ago}" - friends_since: "amigos desde: %{how_long_ago}" - save: "guardar" - are_you_sure: "Esta seguro?" - remove_friend: "remover amigo" - requests: - new_request: - add_a_new_friend_to: "Añade un nuevo amigo a " - enter_a_diaspora_username: "Escribe el usuario de Diaspora:" - your_diaspora_username_is: "Tu usuario de Diaspora es: %{diaspora_handle}" - friends_username: "Usuario de amigo" - destroy: - success: "Ahora son amigos." - error: "Seleccione un aspecto!" - ignore: "Ignorar peticion de amistad" - create: - error: "No diaspora seed found with this email!" - already_friends: "Ya eres amigo de %{destination_url}!" - success: "Una peticion de amistad se envio a %{destination_url}." - horribly_wrong: "Algo horriblemente mal sucedio" From 86909675093b42230526b6959b6fc6c7e6000646 Mon Sep 17 00:00:00 2001 From: Raphael Date: Thu, 23 Sep 2010 14:58:17 -0700 Subject: [PATCH 232/449] defaults doesn't really make sense when there's nothing else --- config/locales/{defaults => diaspora}/cs.yml | 0 config/locales/{defaults => diaspora}/cy.yml | 0 config/locales/{defaults => diaspora}/de.yml | 0 config/locales/{defaults => diaspora}/en.yml | 0 config/locales/{defaults => diaspora}/es.yml | 0 config/locales/{defaults => diaspora}/fi.yml | 0 config/locales/{defaults => diaspora}/fr-informal.yml | 0 config/locales/{defaults => diaspora}/fr.yml | 0 config/locales/{defaults => diaspora}/it.yml | 0 config/locales/{defaults => diaspora}/lt.yml | 0 config/locales/{defaults => diaspora}/pl.yml | 0 config/locales/{defaults => diaspora}/pt-BR.yml | 0 config/locales/{defaults => diaspora}/pt-PT.yml | 0 config/locales/{defaults => diaspora}/ro.yml | 0 config/locales/{defaults => diaspora}/ru.yml | 0 config/locales/{defaults => diaspora}/sv.yml | 0 16 files changed, 0 insertions(+), 0 deletions(-) rename config/locales/{defaults => diaspora}/cs.yml (100%) rename config/locales/{defaults => diaspora}/cy.yml (100%) rename config/locales/{defaults => diaspora}/de.yml (100%) rename config/locales/{defaults => diaspora}/en.yml (100%) rename config/locales/{defaults => diaspora}/es.yml (100%) rename config/locales/{defaults => diaspora}/fi.yml (100%) rename config/locales/{defaults => diaspora}/fr-informal.yml (100%) rename config/locales/{defaults => diaspora}/fr.yml (100%) rename config/locales/{defaults => diaspora}/it.yml (100%) rename config/locales/{defaults => diaspora}/lt.yml (100%) rename config/locales/{defaults => diaspora}/pl.yml (100%) rename config/locales/{defaults => diaspora}/pt-BR.yml (100%) rename config/locales/{defaults => diaspora}/pt-PT.yml (100%) rename config/locales/{defaults => diaspora}/ro.yml (100%) rename config/locales/{defaults => diaspora}/ru.yml (100%) rename config/locales/{defaults => diaspora}/sv.yml (100%) diff --git a/config/locales/defaults/cs.yml b/config/locales/diaspora/cs.yml similarity index 100% rename from config/locales/defaults/cs.yml rename to config/locales/diaspora/cs.yml diff --git a/config/locales/defaults/cy.yml b/config/locales/diaspora/cy.yml similarity index 100% rename from config/locales/defaults/cy.yml rename to config/locales/diaspora/cy.yml diff --git a/config/locales/defaults/de.yml b/config/locales/diaspora/de.yml similarity index 100% rename from config/locales/defaults/de.yml rename to config/locales/diaspora/de.yml diff --git a/config/locales/defaults/en.yml b/config/locales/diaspora/en.yml similarity index 100% rename from config/locales/defaults/en.yml rename to config/locales/diaspora/en.yml diff --git a/config/locales/defaults/es.yml b/config/locales/diaspora/es.yml similarity index 100% rename from config/locales/defaults/es.yml rename to config/locales/diaspora/es.yml diff --git a/config/locales/defaults/fi.yml b/config/locales/diaspora/fi.yml similarity index 100% rename from config/locales/defaults/fi.yml rename to config/locales/diaspora/fi.yml diff --git a/config/locales/defaults/fr-informal.yml b/config/locales/diaspora/fr-informal.yml similarity index 100% rename from config/locales/defaults/fr-informal.yml rename to config/locales/diaspora/fr-informal.yml diff --git a/config/locales/defaults/fr.yml b/config/locales/diaspora/fr.yml similarity index 100% rename from config/locales/defaults/fr.yml rename to config/locales/diaspora/fr.yml diff --git a/config/locales/defaults/it.yml b/config/locales/diaspora/it.yml similarity index 100% rename from config/locales/defaults/it.yml rename to config/locales/diaspora/it.yml diff --git a/config/locales/defaults/lt.yml b/config/locales/diaspora/lt.yml similarity index 100% rename from config/locales/defaults/lt.yml rename to config/locales/diaspora/lt.yml diff --git a/config/locales/defaults/pl.yml b/config/locales/diaspora/pl.yml similarity index 100% rename from config/locales/defaults/pl.yml rename to config/locales/diaspora/pl.yml diff --git a/config/locales/defaults/pt-BR.yml b/config/locales/diaspora/pt-BR.yml similarity index 100% rename from config/locales/defaults/pt-BR.yml rename to config/locales/diaspora/pt-BR.yml diff --git a/config/locales/defaults/pt-PT.yml b/config/locales/diaspora/pt-PT.yml similarity index 100% rename from config/locales/defaults/pt-PT.yml rename to config/locales/diaspora/pt-PT.yml diff --git a/config/locales/defaults/ro.yml b/config/locales/diaspora/ro.yml similarity index 100% rename from config/locales/defaults/ro.yml rename to config/locales/diaspora/ro.yml diff --git a/config/locales/defaults/ru.yml b/config/locales/diaspora/ru.yml similarity index 100% rename from config/locales/defaults/ru.yml rename to config/locales/diaspora/ru.yml diff --git a/config/locales/defaults/sv.yml b/config/locales/diaspora/sv.yml similarity index 100% rename from config/locales/defaults/sv.yml rename to config/locales/diaspora/sv.yml From 19c3a5ce4b32b9183d593ea92a25a536a9cdd2e2 Mon Sep 17 00:00:00 2001 From: ilya Date: Thu, 23 Sep 2010 15:07:07 -0700 Subject: [PATCH 233/449] fetching friend data --- app/views/users/edit.html.haml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/views/users/edit.html.haml b/app/views/users/edit.html.haml index bbd84ec92..3045a2ad2 100644 --- a/app/views/users/edit.html.haml +++ b/app/views/users/edit.html.haml @@ -76,7 +76,8 @@ = @response_hash[:name] - @fb_friends = MiniFB.get(@access_token, 'me', :type => "friends") - = @fb_friends.inspect + - @fb_friends[:data] do |friend| + = MiniFB.get(@access_token, friend[:id]).inspect - form_tag "/services/fb_post" do = text_area_tag "message" From c6c361b5e6ce26e3383ddbdc5fd1ee85ccbdd0b6 Mon Sep 17 00:00:00 2001 From: Raphael Date: Thu, 23 Sep 2010 15:14:44 -0700 Subject: [PATCH 234/449] Add lucida sans, thanks danieleds --- public/stylesheets/sass/application.sass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass index 7c77a0b79..1291313de 100644 --- a/public/stylesheets/sass/application.sass +++ b/public/stylesheets/sass/application.sass @@ -458,7 +458,7 @@ ul.comment_set input[type='text'], textarea :font - :family 'lucida grande', 'sans-serif' + :family 'lucida grande', 'lucida sans', 'sans-serif' :size 14px :padding 0.3em :display block From 264555e63bd905ad2bd04a88e278aa445e12046e Mon Sep 17 00:00:00 2001 From: Raphael Date: Thu, 23 Sep 2010 15:15:19 -0700 Subject: [PATCH 235/449] Update css --- public/stylesheets/application.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index 82bbd8b6d..1ef65078a 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -342,7 +342,7 @@ ul.comment_set { color: #cccccc; } input[type='text'], textarea { - font-family: "lucida grande", "sans-serif"; + font-family: "lucida grande", "lucida sans", "sans-serif"; font-size: 14px; padding: 0.3em; display: block; From 1fdbc637d173a5a473339686dbd79008874d5044 Mon Sep 17 00:00:00 2001 From: ilya Date: Thu, 23 Sep 2010 15:18:29 -0700 Subject: [PATCH 236/449] trying profile pictures on remote --- app/views/users/edit.html.haml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/users/edit.html.haml b/app/views/users/edit.html.haml index 3045a2ad2..7d6d0d552 100644 --- a/app/views/users/edit.html.haml +++ b/app/views/users/edit.html.haml @@ -76,8 +76,8 @@ = @response_hash[:name] - @fb_friends = MiniFB.get(@access_token, 'me', :type => "friends") - - @fb_friends[:data] do |friend| - = MiniFB.get(@access_token, friend[:id]).inspect + - @fb_friends[:data].each do |friend| + = image_tag( "http://graph.facebook.com/#{friend[:id]}/picture" - form_tag "/services/fb_post" do = text_area_tag "message" From fc2cf4fde64a39694bd7b8d3c1a23ed6ba4b2d28 Mon Sep 17 00:00:00 2001 From: ilya Date: Thu, 23 Sep 2010 15:21:15 -0700 Subject: [PATCH 237/449] typo --- app/views/users/edit.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/users/edit.html.haml b/app/views/users/edit.html.haml index 7d6d0d552..e4789e361 100644 --- a/app/views/users/edit.html.haml +++ b/app/views/users/edit.html.haml @@ -77,7 +77,7 @@ - @fb_friends = MiniFB.get(@access_token, 'me', :type => "friends") - @fb_friends[:data].each do |friend| - = image_tag( "http://graph.facebook.com/#{friend[:id]}/picture" + = image_tag( "http://graph.facebook.com/#{friend[:id]}/picture" ) - form_tag "/services/fb_post" do = text_area_tag "message" From be10681945160fb60d4ab644d5fc7f8503d174f5 Mon Sep 17 00:00:00 2001 From: ilya Date: Thu, 23 Sep 2010 16:06:55 -0700 Subject: [PATCH 238/449] IZ tying the publisher to fb in public aspect --- app/controllers/status_messages_controller.rb | 10 ++++++++++ app/views/aspects/public.html.haml | 5 ++++- app/views/shared/_aspect_nav.haml | 2 +- app/views/shared/_publisher.haml | 8 +++++++- 4 files changed, 22 insertions(+), 3 deletions(-) diff --git a/app/controllers/status_messages_controller.rb b/app/controllers/status_messages_controller.rb index 5a8efbe06..5dc1cbce0 100644 --- a/app/controllers/status_messages_controller.rb +++ b/app/controllers/status_messages_controller.rb @@ -13,6 +13,16 @@ class StatusMessagesController < ApplicationController params[:status_message][:to] = params[:aspect_ids] data = clean_hash params[:status_message] + + if @logged_in && params[:status_message][:to] == :public + id = 'me' + type = 'feed' + + @res = MiniFB.post(@access_token, id, :type=>type, + :metadata=>true, :params=>{:message => params[:status_message][:message]}) + + params[:status_message][:to] == :all + end @status_message = current_user.post(:status_message, data) respond_with @status_message diff --git a/app/views/aspects/public.html.haml b/app/views/aspects/public.html.haml index add02f490..e8872cfb7 100644 --- a/app/views/aspects/public.html.haml +++ b/app/views/aspects/public.html.haml @@ -10,7 +10,10 @@ = render "shared/aspect_friends" - content_for :publish do - = render "shared/publisher", :aspect_ids => :public + - if @logged_in + = render "shared/publisher", :aspect_ids => :public + - else + = render "shared/publisher", :aspect_ids => :all %h3 Facebook %p diff --git a/app/views/shared/_aspect_nav.haml b/app/views/shared/_aspect_nav.haml index ebfd2b57d..1d49ef049 100644 --- a/app/views/shared/_aspect_nav.haml +++ b/app/views/shared/_aspect_nav.haml @@ -12,7 +12,7 @@ = link_to "All Aspects", root_url %ul{ :style => "position:absolute;right:0;bottom:0.01em;"} - %li{:class => ("selected" if @aspect == :all)} + %li{:class => ("selected" if @aspect == :public)} = link_to "Public", aspects_public_path %li{ :style => "margin-right:0;", :class => ("selected" if @aspect == :manage)} diff --git a/app/views/shared/_publisher.haml b/app/views/shared/_publisher.haml index 130f136a9..a84b39052 100644 --- a/app/views/shared/_publisher.haml +++ b/app/views/shared/_publisher.haml @@ -16,7 +16,13 @@ going to... - for aspect in @aspects %li - = check_box_tag("aspect_ids[]", aspect.id, @aspect == :all || current_aspect?(aspect) ) + = check_box_tag("aspect_ids[]", aspect.id, @aspect == :public || @aspect == :all || current_aspect?(aspect) ) = aspect.name = f.submit "Share" + + - if @logged_in + - @response_hash = MiniFB.get(@access_token, 'me') + = "going to Facebook as #{@response_hash[:name]}" + + From d748d456b5fc0a885fe93a45fa761f845767ab23 Mon Sep 17 00:00:00 2001 From: Raphael Date: Thu, 23 Sep 2010 16:21:08 -0700 Subject: [PATCH 239/449] Revert "fix in person partial" This reverts commit 8c0bc4b9e60e0e94fd515ba7f595e6d08fba34af. --- app/helpers/application_helper.rb | 6 +----- app/views/people/_person.html.haml | 5 +---- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index b6e4c4389..89df26155 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -57,11 +57,7 @@ module ApplicationHelper end def person_image_link(person) - if current_user.friends.include?(person) || current_user.person == person - link_to person_image_tag(person), object_path(person) - else - person_image_tag person - end + link_to person_image_tag(person), object_path(person) end def new_request(request_count) diff --git a/app/views/people/_person.html.haml b/app/views/people/_person.html.haml index 185695db1..7e22a5570 100644 --- a/app/views/people/_person.html.haml +++ b/app/views/people/_person.html.haml @@ -8,10 +8,7 @@ .content %span.from - - if current_user.friends.include?(person) || person.id == current_user.person.id - = link_to person.real_name, person_path(person) - - else - = person.real_name + = link_to person.real_name, person_path(person) .info = person.diaspora_handle From 4d2bd52310f1dbd49a47f7f5906ae16f3cdfb905 Mon Sep 17 00:00:00 2001 From: ilya Date: Thu, 23 Sep 2010 16:41:05 -0700 Subject: [PATCH 240/449] public aspect param on statusMessage create and in the partial --- app/controllers/status_messages_controller.rb | 5 ++--- app/views/shared/_publisher.haml | 3 ++- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/controllers/status_messages_controller.rb b/app/controllers/status_messages_controller.rb index 5dc1cbce0..e970fb2bb 100644 --- a/app/controllers/status_messages_controller.rb +++ b/app/controllers/status_messages_controller.rb @@ -14,14 +14,12 @@ class StatusMessagesController < ApplicationController data = clean_hash params[:status_message] - if @logged_in && params[:status_message][:to] == :public + if @logged_in && params[:status_message][:public] == true id = 'me' type = 'feed' @res = MiniFB.post(@access_token, id, :type=>type, :metadata=>true, :params=>{:message => params[:status_message][:message]}) - - params[:status_message][:to] == :all end @status_message = current_user.post(:status_message, data) @@ -44,6 +42,7 @@ class StatusMessagesController < ApplicationController return { :message => params[:message], :to => params[:to] + :public => params[:public] } end end diff --git a/app/views/shared/_publisher.haml b/app/views/shared/_publisher.haml index a84b39052..ae61300f3 100644 --- a/app/views/shared/_publisher.haml +++ b/app/views/shared/_publisher.haml @@ -11,12 +11,13 @@ %p %label{:for => "status_message_message"} Message = f.text_area :message, :rows => 2, :value => params[:prefill] + = f.hidden_field( :public, :value => (params[:action] == 'public') ) %ul.aspect_selector{ :style => "display:none;"} going to... - for aspect in @aspects %li - = check_box_tag("aspect_ids[]", aspect.id, @aspect == :public || @aspect == :all || current_aspect?(aspect) ) + = check_box_tag("aspect_ids[]", aspect.id, (params[:action] == 'public') || @aspect == :all || current_aspect?(aspect) ) = aspect.name = f.submit "Share" From d7833c66b24ea5a157ab3331acb8995fb2621f30 Mon Sep 17 00:00:00 2001 From: ilya Date: Thu, 23 Sep 2010 16:48:58 -0700 Subject: [PATCH 241/449] typo --- app/controllers/status_messages_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/status_messages_controller.rb b/app/controllers/status_messages_controller.rb index e970fb2bb..8611b3804 100644 --- a/app/controllers/status_messages_controller.rb +++ b/app/controllers/status_messages_controller.rb @@ -41,7 +41,7 @@ class StatusMessagesController < ApplicationController def clean_hash(params) return { :message => params[:message], - :to => params[:to] + :to => params[:to], :public => params[:public] } end From 107fb58917979d76f29fd7b7e2e29258b5831ed0 Mon Sep 17 00:00:00 2001 From: ilya Date: Thu, 23 Sep 2010 17:04:27 -0700 Subject: [PATCH 242/449] added a logger statement --- app/controllers/status_messages_controller.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/controllers/status_messages_controller.rb b/app/controllers/status_messages_controller.rb index 8611b3804..28ce83ecd 100644 --- a/app/controllers/status_messages_controller.rb +++ b/app/controllers/status_messages_controller.rb @@ -17,7 +17,8 @@ class StatusMessagesController < ApplicationController if @logged_in && params[:status_message][:public] == true id = 'me' type = 'feed' - + + Rails.logger.info("Sending a message: #{params[:status_message][:message]} to Facebook") @res = MiniFB.post(@access_token, id, :type=>type, :metadata=>true, :params=>{:message => params[:status_message][:message]}) end From 0d71a1896c8b41a8ff76d632b2e225be27f09ae7 Mon Sep 17 00:00:00 2001 From: ilya Date: Thu, 23 Sep 2010 17:11:42 -0700 Subject: [PATCH 243/449] posting to FB from public now works --- app/controllers/status_messages_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/status_messages_controller.rb b/app/controllers/status_messages_controller.rb index 28ce83ecd..98ae19b82 100644 --- a/app/controllers/status_messages_controller.rb +++ b/app/controllers/status_messages_controller.rb @@ -14,7 +14,7 @@ class StatusMessagesController < ApplicationController data = clean_hash params[:status_message] - if @logged_in && params[:status_message][:public] == true + if @logged_in && params[:status_message][:public] == 'true' id = 'me' type = 'feed' From 75e1ddf9d28ec19d41b03dce3e844bafc776ff6b Mon Sep 17 00:00:00 2001 From: ilya Date: Thu, 23 Sep 2010 17:17:18 -0700 Subject: [PATCH 244/449] saying going to FB in public aspect --- app/views/shared/_publisher.haml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/app/views/shared/_publisher.haml b/app/views/shared/_publisher.haml index ae61300f3..fdacfccb4 100644 --- a/app/views/shared/_publisher.haml +++ b/app/views/shared/_publisher.haml @@ -11,6 +11,7 @@ %p %label{:for => "status_message_message"} Message = f.text_area :message, :rows => 2, :value => params[:prefill] + = "going to Facebook as #{MiniFB.get(@access_token, 'me')[:name]}" if @logged_in = f.hidden_field( :public, :value => (params[:action] == 'public') ) %ul.aspect_selector{ :style => "display:none;"} @@ -22,8 +23,3 @@ = f.submit "Share" - - if @logged_in - - @response_hash = MiniFB.get(@access_token, 'me') - = "going to Facebook as #{@response_hash[:name]}" - - From 16b6fc6cdc613de614ed6fc8fe1a284abf1b3d1d Mon Sep 17 00:00:00 2001 From: Raphael Date: Thu, 23 Sep 2010 17:18:34 -0700 Subject: [PATCH 245/449] Don't give exception on webfinger with no query --- app/controllers/publics_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/publics_controller.rb b/app/controllers/publics_controller.rb index d7f4825de..5046aa900 100644 --- a/app/controllers/publics_controller.rb +++ b/app/controllers/publics_controller.rb @@ -20,7 +20,7 @@ class PublicsController < ApplicationController end def webfinger - @person = Person.by_webfinger(params[:q], :local => true) + @person = Person.by_webfinger(params[:q], :local => true) if params[:q] unless @person.nil? || @person.owner.nil? render 'webfinger', :content_type => 'application/xrd+xml' else From 11dc2253111af29ae6644a54e1c7aec7ec53a5c7 Mon Sep 17 00:00:00 2001 From: ilya Date: Thu, 23 Sep 2010 17:19:43 -0700 Subject: [PATCH 246/449] removed the old publish box --- app/views/aspects/public.html.haml | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/app/views/aspects/public.html.haml b/app/views/aspects/public.html.haml index e8872cfb7..def45bc7c 100644 --- a/app/views/aspects/public.html.haml +++ b/app/views/aspects/public.html.haml @@ -15,21 +15,6 @@ - else = render "shared/publisher", :aspect_ids => :all -%h3 Facebook -%p - - if @logged_in - Connected to facebook as - - @response_hash = MiniFB.get(@access_token, 'me') - = @response_hash[:name] - - - form_tag "/services/fb_post" do - = text_area_tag "message" - = submit_tag "send it off" - - = link_to "Disconnect from Facebook", services_destroy_path - - else - = link_to "Connect to Facebook", @fb_access_url - %ul#stream - for post in @posts = render type_partial(post), :post => post unless post.class == Album From 796f198d8c717d5211708a13a8e304e45000942e Mon Sep 17 00:00:00 2001 From: ilya Date: Thu, 23 Sep 2010 17:20:55 -0700 Subject: [PATCH 247/449] notification only on user page --- app/views/shared/_publisher.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/shared/_publisher.haml b/app/views/shared/_publisher.haml index fdacfccb4..4714b1f1f 100644 --- a/app/views/shared/_publisher.haml +++ b/app/views/shared/_publisher.haml @@ -11,7 +11,7 @@ %p %label{:for => "status_message_message"} Message = f.text_area :message, :rows => 2, :value => params[:prefill] - = "going to Facebook as #{MiniFB.get(@access_token, 'me')[:name]}" if @logged_in + = "going to Facebook as #{MiniFB.get(@access_token, 'me')[:name]}" if @logged_in && (params[:action] == 'public') = f.hidden_field( :public, :value => (params[:action] == 'public') ) %ul.aspect_selector{ :style => "display:none;"} From eaea26e58d7781c79d7ea962b491cfd4aeb06445 Mon Sep 17 00:00:00 2001 From: ilya Date: Thu, 23 Sep 2010 19:33:33 -0700 Subject: [PATCH 248/449] the public aspect is now set in application controller --- app/controllers/application_controller.rb | 4 +++- app/controllers/aspects_controller.rb | 1 - app/views/shared/_aspect_friends.haml | 2 +- app/views/shared/_publisher.haml | 5 +++-- app/views/shared/_sub_header.haml | 2 ++ 5 files changed, 9 insertions(+), 5 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 2fecb4f90..1cbdc7c39 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -23,7 +23,9 @@ class ApplicationController < ActionController::Base def set_friends_and_status if current_user - if params[:aspect] == nil || params[:aspect] == 'all' + if params[:action] == 'public' + @aspect = :public + elsif params[:aspect] == nil || params[:aspect] == 'all' @aspect = :all else @aspect = current_user.aspect_by_id( params[:aspect]) diff --git a/app/controllers/aspects_controller.rb b/app/controllers/aspects_controller.rb index 9112792c1..f05edfe6e 100644 --- a/app/controllers/aspects_controller.rb +++ b/app/controllers/aspects_controller.rb @@ -50,7 +50,6 @@ class AspectsController < ApplicationController :scope=>MiniFB.scopes.join(",")) @posts = current_user.visible_posts(:by_members_of => :all).paginate :page => params[:page], :per_page => 15, :order => 'created_at DESC' - @aspect = :all respond_with @aspect end diff --git a/app/views/shared/_aspect_friends.haml b/app/views/shared/_aspect_friends.haml index 6ab286a81..f4aa811b1 100644 --- a/app/views/shared/_aspect_friends.haml +++ b/app/views/shared/_aspect_friends.haml @@ -8,7 +8,7 @@ - for friend in @friends = person_image_link(friend) - -unless @aspect == :all + -unless (@aspect == :all) || (@aspect == :public) = link_to (image_tag('add_friend_button.png', :height => "50px", :width => "50px")), "#add_request_pane", :id => 'add_request_button' .yo{:style => 'display:none'} diff --git a/app/views/shared/_publisher.haml b/app/views/shared/_publisher.haml index 4714b1f1f..54f14c27a 100644 --- a/app/views/shared/_publisher.haml +++ b/app/views/shared/_publisher.haml @@ -5,20 +5,21 @@ #publisher = owner_image_tag + = @aspect = form_for StatusMessage.new, :remote => true do |f| = f.error_messages %p %label{:for => "status_message_message"} Message = f.text_area :message, :rows => 2, :value => params[:prefill] - = "going to Facebook as #{MiniFB.get(@access_token, 'me')[:name]}" if @logged_in && (params[:action] == 'public') + = "going to Facebook as #{MiniFB.get(@access_token, 'me')[:name]}" if @logged_in && @aspect == :public = f.hidden_field( :public, :value => (params[:action] == 'public') ) %ul.aspect_selector{ :style => "display:none;"} going to... - for aspect in @aspects %li - = check_box_tag("aspect_ids[]", aspect.id, (params[:action] == 'public') || @aspect == :all || current_aspect?(aspect) ) + = check_box_tag("aspect_ids[]", aspect.id, @aspect == :public || @aspect == :all || current_aspect?(aspect) ) = aspect.name = f.submit "Share" diff --git a/app/views/shared/_sub_header.haml b/app/views/shared/_sub_header.haml index 4e0e2aca4..c8b2bd5e9 100644 --- a/app/views/shared/_sub_header.haml +++ b/app/views/shared/_sub_header.haml @@ -10,6 +10,8 @@ = link_to "All Aspects", root_path - elsif @aspect == :manage = "Manage Aspects" + - elsif @aspect == :public + = "Public" - else = link_to @aspect.name, @aspect From 265753b5fecedd83c8432b952169024cebe7d501 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Thu, 23 Sep 2010 20:13:07 -0700 Subject: [PATCH 249/449] user edit is now divided into real sections --- app/views/layouts/application.html.haml | 2 +- app/views/users/_profile.haml | 59 ++++++++++++++ app/views/users/_services.haml | 28 +++++++ app/views/users/edit.html.haml | 98 +++++------------------- public/stylesheets/application.css | 22 +++--- public/stylesheets/sass/application.sass | 31 +++++--- 6 files changed, 140 insertions(+), 100 deletions(-) create mode 100644 app/views/users/_profile.haml create mode 100644 app/views/users/_services.haml diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index 4a3ec2dbb..4226ef139 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -50,7 +50,7 @@ = text_field_tag 'q' %li= link_to current_user.real_name, current_user.person - %li= link_to "edit profile", edit_user_path(current_user) + %li= link_to "settings", edit_user_path(current_user) %li= link_to "logout", destroy_user_session_path = render "shared/aspect_nav" diff --git a/app/views/users/_profile.haml b/app/views/users/_profile.haml new file mode 100644 index 000000000..e1da95649 --- /dev/null +++ b/app/views/users/_profile.haml @@ -0,0 +1,59 @@ +-# Copyright (c) 2010, Diaspora Inc. This file is +-# licensed under the Affero General Public License version 3. See +-# the COPYRIGHT file. + + +%h2 Profile + += form_for @user do |f| + = f.error_messages + + = f.fields_for :profile do |p| + + %h3 Picture + %div#image_picker + = p.hidden_field :image_url, :value => (@profile.image_url if @profile.image_url), :id => 'image_url_field' + + - unless @photos.nil? || @photos.empty? + - for photo in @photos + - if @profile.image_url && @profile.image_url.include?(photo.url(:thumb_medium)) + %div.small_photo{:id => photo.url(:thumb_medium), :class=>'selected'} + = check_box_tag 'checked_photo', true, true + = link_to image_tag(photo.url(:thumb_medium)), "#" + - else + %div.small_photo{:id => photo.url(:thumb_medium)} + = check_box_tag 'checked_photo' + = link_to image_tag(photo.url(:thumb_medium)), "#" + + - else + You don't have any photos! Go to the + = link_to "albums", albums_path(:aspect => 'all') + page to upload some. + + =will_paginate @photos + + %br + + %h3 Info + + %p + %b + DIASPORA USERNAME: + = @user.diaspora_handle + + %p + = p.label :first_name + = p.text_field :first_name, :value => @profile.first_name + %p + = p.label :last_name + = p.text_field :last_name, :value => @profile.last_name + + #submit_block + = link_to "Cancel", root_path + or + = f.submit "Update Profile" + +#content_bottom + .back + = link_to "⇧ home", root_path + diff --git a/app/views/users/_services.haml b/app/views/users/_services.haml new file mode 100644 index 000000000..c6e31939a --- /dev/null +++ b/app/views/users/_services.haml @@ -0,0 +1,28 @@ +-# Copyright (c) 2010, Diaspora Inc. This file is +-# licensed under the Affero General Public License version 3. See +-# the COPYRIGHT file. + + +%h2 Services + +%h3 Facebook +%p + - if @logged_in + Connected to facebook as + - @response_hash = MiniFB.get(@access_token, 'me') + = @response_hash[:name] + + - @fb_friends = MiniFB.get(@access_token, 'me', :type => "friends") + - @fb_friends[:data].each do |friend| + = image_tag( "http://graph.facebook.com/#{friend[:id]}/picture" ) + + - form_tag "/services/fb_post" do + = text_area_tag "message" + = submit_tag "send it off" + = link_to "Disconnect from Facebook", services_destroy_path + - else + = link_to "Connect to Facebook", @fb_access_url + + #content_bottom + .back + = link_to "⇧ home", root_path diff --git a/app/views/users/edit.html.haml b/app/views/users/edit.html.haml index e4789e361..b4ef0226c 100644 --- a/app/views/users/edit.html.haml +++ b/app/views/users/edit.html.haml @@ -3,89 +3,29 @@ -# the COPYRIGHT file. +:javascript + $("#settings_nav li > a").click( function() { + var target = "#"+$(this).attr('class'); + if( !$(target).is(":visible") ) { + $(".settings_pane").fadeOut(200, function() { + $(target).delay(200).fadeIn(200); + }); + } + }); + + - content_for :publish do %h1 - Editing profile + Settings - content_for :left_pane do - \. - -= form_for @user do |f| - = f.error_messages - - = f.fields_for :profile do |p| - - %h3 Picture - %div#image_picker - = p.hidden_field :image_url, :value => (@profile.image_url if @profile.image_url), :id => 'image_url_field' - - - unless @photos.nil? || @photos.empty? - - for photo in @photos - - if @profile.image_url && @profile.image_url.include?(photo.url(:thumb_medium)) - %div.small_photo{:id => photo.url(:thumb_medium), :class=>'selected'} - = check_box_tag 'checked_photo', true, true - = link_to image_tag(photo.url(:thumb_medium)), "#" - - else - %div.small_photo{:id => photo.url(:thumb_medium)} - = check_box_tag 'checked_photo' - = link_to image_tag(photo.url(:thumb_medium)), "#" - - - else - You don't have any photos! Go to the - = link_to "albums", albums_path(:aspect => 'all') - page to upload some. - - =will_paginate @photos - - %br - - %h3 Info - - %p - %b - DIASPORA USERNAME: - = @user.diaspora_handle - - %p - = p.label :first_name - = p.text_field :first_name, :value => @profile.first_name - %p - = p.label :last_name - = p.text_field :last_name, :value => @profile.last_name - - %br - %br + %ul#settings_nav + %li=link_to 'Profile', '#', :class => 'profile' + %li=link_to 'Services', '#', :class => 'services' +#profile.settings_pane{:style=>"display:block;"} + = render 'users/profile' +#services.settings_pane + = render 'users/services' - - #submit_block - = link_to "Cancel", root_path - or - = f.submit "Update Profile" - - - -%h2 Services - -%h3 Facebook -%p - - if @logged_in - Connected to facebook as - - @response_hash = MiniFB.get(@access_token, 'me') - = @response_hash[:name] - - - @fb_friends = MiniFB.get(@access_token, 'me', :type => "friends") - - @fb_friends[:data].each do |friend| - = image_tag( "http://graph.facebook.com/#{friend[:id]}/picture" ) - - - form_tag "/services/fb_post" do - = text_area_tag "message" - = submit_tag "send it off" - = link_to "Disconnect from Facebook", services_destroy_path - - else - = link_to "Connect to Facebook", @fb_access_url - -#content_bottom - .back - = link_to "⇧ home", root_path diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index 82bbd8b6d..4c83aa0c2 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -659,15 +659,19 @@ h1.big_text { -moz-box-shadow: 0 2px 4px #333333; opacity: 0.9; } -#notification_badge { - position: fixed; - bottom: 0; - margin-left: 854px; } - #notification_badge a { - background-color: #eeeeee; - border: 1px solid #cccccc; - border-bottom: none; - padding: 3px 10px; } +ul#settings_nav { + list-style: none; + padding: 0; + marign: 0; + font-size: larger; } + ul#settings_nav > li a { + display: block; + height: 100%; + border-bottom: 1px solid #eeeeee; + padding: 5px 0; } + +.settings_pane { + display: none; } #fancybox-close:hover { background-color: transparent; } diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass index 7c77a0b79..890ef7708 100644 --- a/public/stylesheets/sass/application.sass +++ b/public/stylesheets/sass/application.sass @@ -839,21 +839,30 @@ h1.big_text :-moz-box-shadow 0 2px 4px #333 :opacity 0.9 -#notification_badge - :position fixed - :bottom 0 - :margin - :left 854px +ul#settings_nav + :list + :style none + :padding 0 + :marign 0 - a - :background - :color #eee + :font + :size larger - :border 1px solid #ccc - :bottom none + > li + + a + :display block + :height 100% + :border + :bottom 1px solid #eee + :padding 5px 0 + + +.settings_pane + :display none - :padding 3px 10px #fancybox-close:hover :background :color transparent + From a594c9a34f16173468c815537d0fe96e915af6c7 Mon Sep 17 00:00:00 2001 From: ilya Date: Thu, 23 Sep 2010 20:19:02 -0700 Subject: [PATCH 250/449] friends in the public bucket --- app/views/shared/_aspect_friends.haml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/views/shared/_aspect_friends.haml b/app/views/shared/_aspect_friends.haml index f4aa811b1..10a0da317 100644 --- a/app/views/shared/_aspect_friends.haml +++ b/app/views/shared/_aspect_friends.haml @@ -7,7 +7,11 @@ = owner_image_link - for friend in @friends = person_image_link(friend) - + - if @logged_in && (@aspect == :public) + Facebook Friends + - @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) = link_to (image_tag('add_friend_button.png', :height => "50px", :width => "50px")), "#add_request_pane", :id => 'add_request_button' From a6c1ff8ce236ac03581169483c73eec21370e017 Mon Sep 17 00:00:00 2001 From: ilya Date: Thu, 23 Sep 2010 20:21:17 -0700 Subject: [PATCH 251/449] fixed the deploy scripts --- db/seeds/backer.rb | 4 ++-- db/seeds/tom.rb | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/db/seeds/backer.rb b/db/seeds/backer.rb index 20fe90fdf..12e6236f8 100644 --- a/db/seeds/backer.rb +++ b/db/seeds/backer.rb @@ -44,8 +44,8 @@ end def set_app_config username current_config = YAML.load(File.read(Rails.root.join('config', 'app_config.yml.example'))) current_config[Rails.env.to_s] ||= {} - current_config[Rails.env.to_s]['pod_url'] = "#{username}.joindiaspora.com" - current_config['default']['pod_url'] = "#{username}.joindiaspora.com" + current_config[Rails.env.to_s]['pod_url'] = "http://#{username}.joindiaspora.com/" + current_config['default']['pod_url'] = "http://#{username}.joindiaspora.com/" file = File.new(Rails.root.join('..','..','shared','app_config.yml'),'w') file.write(current_config.to_yaml) file.close diff --git a/db/seeds/tom.rb b/db/seeds/tom.rb index cc3000d0b..1eaa5b236 100644 --- a/db/seeds/tom.rb +++ b/db/seeds/tom.rb @@ -9,8 +9,8 @@ require 'config/environment' def set_app_config username current_config = YAML.load(File.read(Rails.root.join('config', 'app_config.yml.example'))) current_config[Rails.env.to_s] ||= {} - current_config[Rails.env.to_s]['pod_url'] = "#{username}.joindiaspora.com" - current_config['default']['pod_url'] = "#{username}.joindiaspora.com" + current_config[Rails.env.to_s]['pod_url'] = "http://#{username}.joindiaspora.com/" + current_config['default']['pod_url'] = "http://#{username}.joindiaspora.com/" file = File.new(Rails.root.join('..','..','shared','app_config.yml'),'w') file.write(current_config.to_yaml) file.close From 4f17eb4e02c13783de1efc8ac99bd57957c9de4e Mon Sep 17 00:00:00 2001 From: danielvincent Date: Thu, 23 Sep 2010 20:33:34 -0700 Subject: [PATCH 252/449] stray aspect name removed from publisher --- app/views/shared/_publisher.haml | 1 - 1 file changed, 1 deletion(-) diff --git a/app/views/shared/_publisher.haml b/app/views/shared/_publisher.haml index 54f14c27a..a137ccdeb 100644 --- a/app/views/shared/_publisher.haml +++ b/app/views/shared/_publisher.haml @@ -5,7 +5,6 @@ #publisher = owner_image_tag - = @aspect = form_for StatusMessage.new, :remote => true do |f| = f.error_messages From deea03bf82e14fe8e4d01f9ca5bc81ae50f3a6b3 Mon Sep 17 00:00:00 2001 From: ilya Date: Thu, 23 Sep 2010 20:38:39 -0700 Subject: [PATCH 253/449] deploy restart after db:reset since we need the new app_config.yml --- config/deploy.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/config/deploy.rb b/config/deploy.rb index 2f8065134..869328533 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -150,6 +150,7 @@ namespace :db do purge backer_seed tom_seed + deploy::restart end From 86f462cc42d3f49273cd9773aa76837fa95f0492 Mon Sep 17 00:00:00 2001 From: Pistos Date: Fri, 24 Sep 2010 11:23:54 +0800 Subject: [PATCH 254/449] Strip trailing whitespace. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ded281e4a..fb988df1c 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,7 @@ Ongoing discussion: More general info and updates about the project can be found on: [Our blog](http://joindiaspora.com), -[and on Twitter](http://twitter.com/joindiaspora). +[and on Twitter](http://twitter.com/joindiaspora). Also, be sure to join the official [mailing list](http://http://eepurl.com/Vebk). If you wish to contact us privately about any exploits in Diaspora you may From 7dc813a15aa711811e4e0fadc5f0e7524b8223de Mon Sep 17 00:00:00 2001 From: Pistos Date: Fri, 24 Sep 2010 11:24:01 +0800 Subject: [PATCH 255/449] Added a newline before a list, so that the list can be properly interpreted as a list (Markdown syntax). --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index fb988df1c..97ec66834 100644 --- a/README.md +++ b/README.md @@ -44,6 +44,7 @@ file [bug reports](https://github.com/diaspora/diaspora/issues) right here on github. Ongoing discussion: + - [Diaspora Developer Google Group](http://groups.google.com/group/diaspora-dev) - [Diaspora Discussion Google Group](http://groups.google.com/group/diaspora-discuss) - [Diaspora Q&A site](http://diaspora.shapado.com/) From b9bff760542328dc0fd3dfb9ebee529abfdcbb53 Mon Sep 17 00:00:00 2001 From: Raphael Date: Fri, 24 Sep 2010 09:49:42 -0700 Subject: [PATCH 256/449] Initial 1.9.2, specs fail (possibly validatable), need to pull in aredridel photo fixes --- Gemfile | 1 - Gemfile.lock | 2 -- app/models/user.rb | 15 --------------- 3 files changed, 18 deletions(-) diff --git a/Gemfile b/Gemfile index 2b3cd008c..2155262cb 100644 --- a/Gemfile +++ b/Gemfile @@ -47,7 +47,6 @@ group :test do gem 'rspec-rails', '2.0.0.beta.17' gem 'mocha' gem 'webrat', '0.7.2.beta.1' - gem 'redgreen' gem 'autotest' gem 'database_cleaner' gem 'saucelabs-adapter', '= 0.8.12' diff --git a/Gemfile.lock b/Gemfile.lock index ecee78c77..4a0be2e30 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -180,7 +180,6 @@ GEM rake (>= 0.8.4) thor (~> 0.14.0) rake (0.8.7) - redgreen (1.2.2) rest-client (1.6.1) mime-types (>= 1.16) rspec (2.0.0.beta.22) @@ -252,7 +251,6 @@ DEPENDENCIES pubsubhubbub rails (= 3.0.0) redfinger! - redgreen roxml! rspec (>= 2.0.0.beta.17) rspec-rails (= 2.0.0.beta.17) diff --git a/app/models/user.rb b/app/models/user.rb index c1aebfd53..c6957ff6d 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - require File.expand_path('../../../lib/diaspora/user/friending', __FILE__) require File.expand_path('../../../lib/diaspora/user/querying', __FILE__) require File.expand_path('../../../lib/diaspora/user/receiving', __FILE__) @@ -258,20 +257,6 @@ class User aspect(:name => "Family") aspect(:name => "Work") end -<<<<<<< HEAD - - def self.create(opts ={}) - puts opts.inspect - end - - def terse_url - terse = self.url.gsub(/(https?:|www\.)\/\//, '') - terse = terse.chop! if terse[-1, 1] == '/' - terse - end -======= - ->>>>>>> master def diaspora_handle "#{self.username}@#{APP_CONFIG[:terse_pod_url]}" From 82b99decbbed20896b9d049cf96fa378c76699fe Mon Sep 17 00:00:00 2001 From: ilya Date: Fri, 24 Sep 2010 10:45:27 -0700 Subject: [PATCH 257/449] putting the token in the warden session --- app/controllers/application_controller.rb | 2 +- app/controllers/services_controller.rb | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 1cbdc7c39..2bf2bf174 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -41,7 +41,7 @@ class ApplicationController < ActionController::Base end def fb_user_info - @access_token = session[:access_token] + @access_token = env['warden'].session[:access_token] @logged_in = @access_token.present? end diff --git a/app/controllers/services_controller.rb b/app/controllers/services_controller.rb index 373eb100e..b39538d96 100644 --- a/app/controllers/services_controller.rb +++ b/app/controllers/services_controller.rb @@ -17,15 +17,15 @@ class ServicesController < ApplicationController # TODO: This is where you'd want to store the token in your database # but for now, we'll just keep it in the session so we don't need a database - session[:access_token] = @access_token + env['warden'].session[:access_token] = @access_token flash[:success] = "Authentication successful." end redirect_to edit_user_url current_user end def destroy - session[:access_token] = nil - session[:user_id] = nil + env['warden'].session[:access_token] = nil + env['warden'].session[:user_id] = nil redirect_to edit_user_url current_user end From 40120bb441a733d566e83fb35d5bc76a61e25c6d Mon Sep 17 00:00:00 2001 From: Raphael Date: Fri, 24 Sep 2010 11:15:39 -0700 Subject: [PATCH 258/449] Moving to activemodel validations --- Gemfile | 3 +-- Gemfile.lock | 17 +++++------------ app/models/photo.rb | 16 ++++++++++------ 3 files changed, 16 insertions(+), 20 deletions(-) diff --git a/Gemfile b/Gemfile index 2155262cb..cf863eb43 100644 --- a/Gemfile +++ b/Gemfile @@ -8,8 +8,7 @@ gem 'bundler', '1.0.0' gem 'devise', :git => 'http://github.com/BadMinus/devise.git' #Mongo -gem 'mongo_mapper', '0.8.4', :git => 'http://github.com/jnunemaker/mongomapper.git' -gem 'jnunemaker-validatable', '1.8.4', :git => 'http://github.com/jnunemaker/validatable.git' +gem 'mongo_mapper', :branch => 'rails3', :git => 'http://github.com/jnunemaker/mongomapper.git' gem 'bson_ext', '1.0.7' gem 'bson', '1.0.7' diff --git a/Gemfile.lock b/Gemfile.lock index 4a0be2e30..ac66e59c1 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -57,20 +57,14 @@ GIT GIT remote: http://github.com/jnunemaker/mongomapper.git - revision: 931dab779011aa7acf60c1a4c7ad19e1ba838345 + revision: b0eac421ef5b3bee782e15d391eca372a189d414 + branch: rails3 specs: mongo_mapper (0.8.4) - activesupport (>= 2.3.4) - jnunemaker-validatable (~> 1.8.4) + activemodel (~> 3.0.0) + activesupport (~> 3.0.0) plucky (~> 0.3.5) -GIT - remote: http://github.com/jnunemaker/validatable.git - revision: 8d7c3ce14133760e748a0e34b99dfe6ec4d69153 - specs: - jnunemaker-validatable (1.8.4) - activesupport (>= 2.3.4) - GEM remote: http://rubygems.org/ specs: @@ -241,12 +235,11 @@ DEPENDENCIES em-websocket factory_girl_rails haml - jnunemaker-validatable (= 1.8.4)! json magent! mini_magick mocha - mongo_mapper (= 0.8.4)! + mongo_mapper! nifty-generators pubsubhubbub rails (= 3.0.0) diff --git a/app/models/photo.rb b/app/models/photo.rb index 8792911f3..fbab51ea5 100644 --- a/app/models/photo.rb +++ b/app/models/photo.rb @@ -2,7 +2,13 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - +class PhotoAlbumValidator < ActiveModel::Validator + def validate(document) + unless document.album.person_id == document.person_id + document.errors[:base] << "You post photos to that album" + end + end +end class Photo < Post require 'carrierwave/orm/mongomapper' include MongoMapper::Document @@ -22,7 +28,7 @@ class Photo < Post timestamps! validates_presence_of :album - validates_true_for :album_id, :logic => lambda {self.validate_album_person} + validates_with PhotoAlbumValidator before_destroy :ensure_user_picture @@ -36,10 +42,6 @@ class Photo < Post photo end - def validate_album_person - album.person_id == person_id - end - def remote_photo image.url.nil? ? (remote_photo_path + '/' + remote_photo_name) : image.url end @@ -70,3 +72,5 @@ class Photo < Post {:thumb_url => url(:thumb_medium), :id => id, :album_id => album_id} end end + + From 19199dabfe2a21a5f4e8a6a02624febd02d74d8c Mon Sep 17 00:00:00 2001 From: Raphael Date: Fri, 24 Sep 2010 11:49:30 -0700 Subject: [PATCH 259/449] fix spec_helper for 1.9.2 --- spec/lib/diaspora_parser_spec.rb | 3 ++- spec/misc_spec.rb | 21 +++++++++++++++++++++ spec/models/aspect_spec.rb | 10 +++++----- spec/spec_helper.rb | 5 +++++ 4 files changed, 33 insertions(+), 6 deletions(-) diff --git a/spec/lib/diaspora_parser_spec.rb b/spec/lib/diaspora_parser_spec.rb index cdd1063ab..3f4e20b1e 100644 --- a/spec/lib/diaspora_parser_spec.rb +++ b/spec/lib/diaspora_parser_spec.rb @@ -103,7 +103,7 @@ describe Diaspora::Parser do it "should activate the Person if I initiated a request to that url" do request = @user.send_friend_request_to( @user2.person, @aspect) - + @user.reload request.reverse_for @user2 xml = request.to_diaspora_xml @@ -125,6 +125,7 @@ describe Diaspora::Parser do it 'should process retraction for a person' do person_count = Person.all.count request = @user.send_friend_request_to( @user2.person, @aspect) + @user.reload request.reverse_for @user2 xml = request.to_diaspora_xml diff --git a/spec/misc_spec.rb b/spec/misc_spec.rb index 14f1d4c3e..d03300211 100644 --- a/spec/misc_spec.rb +++ b/spec/misc_spec.rb @@ -34,4 +34,25 @@ describe 'making sure the spec runner works' do end end + describe '#friend_users' do + before do + @user1 = Factory.create(:user) + @aspect1 = @user1.aspect(:name => "losers") + @user2 = Factory.create(:user) + @aspect2 = @user2.aspect(:name => "bruisers") + friend_users(@user1, @aspect1, @user2, @aspect2) + @user1.reload + @aspect1.reload + @user2.reload + @aspect2.reload + end + + it 'makes the first user friends with the second' do + @aspect1.people.include?(@user2.person).should be_true + end + + it 'makes the second user friends with the first' do + @aspect2.people.include?(@user1.person).should be_true + end + end end diff --git a/spec/models/aspect_spec.rb b/spec/models/aspect_spec.rb index 5931970cf..ea5afc7cf 100644 --- a/spec/models/aspect_spec.rb +++ b/spec/models/aspect_spec.rb @@ -20,7 +20,7 @@ describe Aspect do aspect.name.should == "losers" end - it 'should be able to have people' do + it 'should be creatable with people' do aspect = @user.aspect(:name => 'losers', :people => [@friend, @friend_2]) aspect.people.size.should == 2 end @@ -156,16 +156,16 @@ describe Aspect do @user.receive message.to_diaspora_xml @aspect.reload - @aspect.posts.count.should be 1 - @aspect3.posts.count.should be 0 + @aspect.posts.count.should == 1 + @aspect3.posts.count.should == 0 @user.reload @user.move_friend(:friend_id => @user2.person.id, :from => @aspect.id, :to => @aspect3.id) @aspect.reload @aspect3.reload - @aspect3.posts.count.should be 1 - @aspect.posts.count.should be 0 + @aspect3.posts.count.should == 1 + @aspect.posts.count.should == 0 end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 3fdac9810..ef5db93c2 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -82,7 +82,12 @@ end def friend_users(user1, aspect1, user2, aspect2) request = user1.send_friend_request_to(user2.person, aspect1) reversed_request = user2.accept_friend_request( request.id, aspect2.id) + user1.reload user1.receive reversed_request.to_diaspora_xml + user1.reload + aspect1.reload + user2.reload + aspect2.reload end def stub_success(address = 'abc@example.com') From 5c32cbaee8583ae9d651c7c72c58d4c426bac44e Mon Sep 17 00:00:00 2001 From: Raphael Date: Fri, 24 Sep 2010 14:40:30 -0700 Subject: [PATCH 260/449] Fix requires in rake task --- lib/tasks/db.rake | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/tasks/db.rake b/lib/tasks/db.rake index c0d289cda..9c438ddb1 100644 --- a/lib/tasks/db.rake +++ b/lib/tasks/db.rake @@ -9,17 +9,17 @@ namespace :db do namespace :seed do task :tom do puts "Seeding the database for #{Rails.env}..." - require 'db/seeds/tom' + require File.dirname(__FILE__) + '/../../db/seeds/tom' end task :dev do puts "Seeding the database for #{Rails.env}..." - require 'db/seeds/dev' + require File.dirname(__FILE__) + '/../../db/seeds/dev' end task :backer do puts "Seeding the database for #{Rails.env}..." - require 'db/seeds/backer' + require File.dirname(__FILE__) + '/../../db/seeds/backer' create end @@ -27,7 +27,7 @@ namespace :db do desc 'Delete the collections in the current RAILS_ENV database' task :purge do - require 'config/environment' + require File.dirname(__FILE__) + '/../../config/environment' puts "Purging the database for #{Rails.env}..." @@ -57,7 +57,7 @@ namespace :db do task :fix_diaspora_handle do puts "fixing the people in this seed" - require 'config/environment' + require File.dirname(__FILE__) + '/../../config/environment' Person.where(:url => 'example.org').all.each{|person| if person.owner person.url = APP_CONFIG[:pod_url] From bb5867855695a8ad9dd69c6856f721129a00cbc9 Mon Sep 17 00:00:00 2001 From: ilya Date: Fri, 24 Sep 2010 14:41:31 -0700 Subject: [PATCH 261/449] added a fb_status model & parser method --- app/models/fb_status.rb | 30 +++++++++++++ spec/factories.rb | 8 ++++ spec/fixtures/fb_status | 79 +++++++++++++++++++++++++++++++++++ spec/models/fb_status_spec.rb | 44 +++++++++++++++++++ 4 files changed, 161 insertions(+) create mode 100644 app/models/fb_status.rb create mode 100644 spec/fixtures/fb_status create mode 100644 spec/models/fb_status_spec.rb diff --git a/app/models/fb_status.rb b/app/models/fb_status.rb new file mode 100644 index 000000000..d1a57ef9a --- /dev/null +++ b/app/models/fb_status.rb @@ -0,0 +1,30 @@ +# Copyright (c) 2010, Diaspora Inc. This file is +# licensed under the Affero General Public License version 3. See +# the COPYRIGHT file. + + +class FbStatus + include MongoMapper::Document + + key :graph_id, String + key :author_id, String + key :author_name, String + key :message, String + key :updated_time, DateTime + + timestamps! + + validates_presence_of :graph_id,:author_id,:author_name,:message,:updated_time + + def self.from_api(json) + hash = JSON.parse(json) + self.create( + :graph_id => hash['id'], + :author_id => hash['from']['id'] + :author_name => hash['from']['name'], + :message => hash['message'] + :updated_time => Time.parse(hash['updated_time'] + end + +end + diff --git a/spec/factories.rb b/spec/factories.rb index 21a7ad110..0b00ed3d5 100644 --- a/spec/factories.rb +++ b/spec/factories.rb @@ -69,3 +69,11 @@ Factory.define :photo do |p| end Factory.define(:comment) {} + +Factory.define :fb_status do |s| + s.graph_id "367501354973" + s.author_name "Bret Taylor" + s.author_id "220439" + s.message "Pigs run from our house in fear. Tonight, I am wrapping the pork tenderloin in bacon and putting pancetta in the corn." + s.updated_time Time.parse "2010-03-06T02:57:48+0000" +end diff --git a/spec/fixtures/fb_status b/spec/fixtures/fb_status new file mode 100644 index 000000000..5602e8343 --- /dev/null +++ b/spec/fixtures/fb_status @@ -0,0 +1,79 @@ +{ + "id": "367501354973", + "from": { + "name": "Bret Taylor", + "id": "220439" + }, + "message": "Pigs run from our house in fear. Tonight, I am wrapping the pork tenderloin in bacon and putting pancetta in the corn.", + "updated_time": "2010-03-06T02:57:48+0000", + "likes": { + "data": [ + { + "id": "29906278", + "name": "Ross Miller" + } + ] + }, + "comments": { + "data": [ + { + "id": "367501354973_12216733", + "from": { + "name": "Doug Edwards", + "id": "628675309" + }, + "message": "Make sure you don't, as they say, go whole hog...\nhttp://www.youtube.com/watch?v=U4wTFuaV8VQ", + "created_time": "2010-03-06T03:24:46+0000" + }, + { + "id": "367501354973_12249673", + "from": { + "name": "Tom Taylor", + "id": "1249191863" + }, + "message": "Are you and Karen gonna, as they say, pig out?", + "created_time": "2010-03-06T21:05:21+0000" + }, + { + "id": "367501354973_12249857", + "from": { + "name": "Sheila Taylor", + "id": "1315606682" + }, + "message": "how did it turn out? Sounds nummy!\n", + "created_time": "2010-03-06T21:10:30+0000" + }, + { + "id": "367501354973_12250973", + "from": { + "name": "Bret Taylor", + "id": "220439" + }, + "message": "Mom: turned out well. Sauce was good as well: pan sauce with mustard, balsamic, onion, and maple syrup. Surprisingly good in the end, and not too sweet, which was my concern. ", + "created_time": "2010-03-06T21:44:53+0000" + }, + { + "id": "367501354973_12251276", + "from": { + "name": "Sheila Taylor", + "id": "1315606682" + }, + "message": "Sounds delicious! I probably would have skipped the maple syrup, but I am not married to a Canadian :)\n\nSheila Taylor\n(925) 818-7795\nP.O. Box 938\nGlen Ellen, CA 95442\nwww.winecountrytrekking.com", + "created_time": "2010-03-06T21:55:12+0000" + }, + { + "id": "367501354973_12264435", + "from": { + "name": "Amelia Ann Arapoff", + "id": "1580390378" + }, + "message": "Bacon is always in our refrigerator, in case of need, somehow there is always need.", + "created_time": "2010-03-07T05:11:52+0000" + } + ], + "paging": { + "previous": "https://graph.facebook.com/367501354973/comments?access_token=2227470867%7C2.wNlupL2HPsOtrlYFBF56NA__.3600.1285354800-100001548997697%7C8lZ_pdgNDvSHYS4o1OkqhdQu6mA&limit=25&since=2010-03-07T05%3A11%3A52%2B0000", + "next": "https://graph.facebook.com/367501354973/comments?access_token=2227470867%7C2.wNlupL2HPsOtrlYFBF56NA__.3600.1285354800-100001548997697%7C8lZ_pdgNDvSHYS4o1OkqhdQu6mA&limit=25&until=2010-03-06T03%3A24%3A45%2B0000" + } + } +} \ No newline at end of file diff --git a/spec/models/fb_status_spec.rb b/spec/models/fb_status_spec.rb new file mode 100644 index 000000000..a74506512 --- /dev/null +++ b/spec/models/fb_status_spec.rb @@ -0,0 +1,44 @@ +# Copyright (c) 2010, Diaspora Inc. This file is +# licensed under the Affero General Public License version 3. See +# the COPYRIGHT file. + + + +require File.dirname(__FILE__) + '/../spec_helper' +require 'json' + +describe FbStatus do + + let(:fb_status) { Factory.create :fb_status } + + it 'is valid' do + fb_status.should be_valid + end + + describe '#from_api' do + let(:json_string) {File.open(File.dirname(__FILE__) + '/../fixtures/fb_status').read} + let!(:json_object) { JSON.parse(json_string) } + let!(:status_from_json) {FbStatus.from_api(json_string)} + + it 'has graph_id' do + status_from_json.graph_id.should == json_object['id'] + end + + it 'has author_id' do + status_from_json.graph_id.should == json_object['from']['id'] + end + + it 'has author_name' do + status_from_json.graph_id.should == json_object['from']['name'] + end + + it 'has message' do + status_from_json.message.should == json_object['message'] + end + + it 'has author_name' do + status_from_json.updated_time.should == Time.parse(json_object['updated_time']) + end + end + +end From 1f62f910e34b5a9e0e036ba13213c5dae39724b6 Mon Sep 17 00:00:00 2001 From: Raphael Date: Fri, 24 Sep 2010 14:43:23 -0700 Subject: [PATCH 262/449] fix requires in db seeds --- db/seeds.rb | 2 +- db/seeds/backer.rb | 4 ++-- db/seeds/dev.rb | 2 +- db/seeds/tom.rb | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/db/seeds.rb b/db/seeds.rb index 29a5191f4..a21966266 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -12,5 +12,5 @@ # cities = City.create([{ :name => 'Chicago' }, { :name => 'Copenhagen' }]) # Mayor.create(:name => 'Daley', :city => citie -require 'config/environment' +require File.dirname(__FILE__) + '/../../config/environment' diff --git a/db/seeds/backer.rb b/db/seeds/backer.rb index 20fe90fdf..b80fd794b 100644 --- a/db/seeds/backer.rb +++ b/db/seeds/backer.rb @@ -12,7 +12,7 @@ # cities = City.create([{ :name => 'Chicago' }, { :name => 'Copenhagen' }]) # Mayor.create(:name => 'Daley', :city => citie -require 'config/environment' +require File.dirname(__FILE__) + '/../../config/environment' def create @@ -25,7 +25,7 @@ def create #set pod url username = backer_info[backer_number]['username'].gsub(/ /,'').downcase set_app_config username - require 'config/initializers/_load_app_config.rb' + require File.dirname(__FILE__) + '/../../config/initializers/_load_app_config.rb' # Create seed user user = User.instantiate!(:email => "#{username}@#{username}.joindiaspora.com", diff --git a/db/seeds/dev.rb b/db/seeds/dev.rb index e2d8a5495..dcbca72aa 100644 --- a/db/seeds/dev.rb +++ b/db/seeds/dev.rb @@ -4,7 +4,7 @@ -require 'config/environment' +require File.dirname(__FILE__) + '/../../config/environment' def set_app_config username current_config = YAML.load(File.read(Rails.root.join('config', 'app_config.yml.example'))) diff --git a/db/seeds/tom.rb b/db/seeds/tom.rb index cc3000d0b..468667485 100644 --- a/db/seeds/tom.rb +++ b/db/seeds/tom.rb @@ -4,7 +4,7 @@ -require 'config/environment' +require File.dirname(__FILE__) + '/../../config/environment' def set_app_config username current_config = YAML.load(File.read(Rails.root.join('config', 'app_config.yml.example'))) From ae7c869bc35893e60bbb236442343252dde70173 Mon Sep 17 00:00:00 2001 From: Raphael Date: Fri, 24 Sep 2010 15:01:36 -0700 Subject: [PATCH 263/449] Add specs for album controller failure --- spec/controllers/albums_controller_spec.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/spec/controllers/albums_controller_spec.rb b/spec/controllers/albums_controller_spec.rb index 67b7d9a78..e8ea44479 100644 --- a/spec/controllers/albums_controller_spec.rb +++ b/spec/controllers/albums_controller_spec.rb @@ -20,4 +20,14 @@ describe AlbumsController do @album.reload.name.should eql("new_name") end + describe '#create' do + it 'all aspects' do + params = {"album" => {"name" => "Sunsets","to" => "all"}} + post :create, params + end + it 'one aspect' do + params = {"album" => {"name" => "Sunsets","to" => @aspect.id.to_s}} + post :create, params + end + end end From ac9854596f4c3fdaa286391612464e0585ea612c Mon Sep 17 00:00:00 2001 From: ilya Date: Fri, 24 Sep 2010 15:04:31 -0700 Subject: [PATCH 264/449] fb_status partial rendered in public --- app/models/fb_status.rb | 3 ++- app/views/aspects/public.html.haml | 5 +++++ app/views/fb_status/_fb_status.html.haml | 13 +++++++++++++ 3 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 app/views/fb_status/_fb_status.html.haml diff --git a/app/models/fb_status.rb b/app/models/fb_status.rb index d1a57ef9a..367549c1b 100644 --- a/app/models/fb_status.rb +++ b/app/models/fb_status.rb @@ -18,7 +18,8 @@ class FbStatus def self.from_api(json) hash = JSON.parse(json) - self.create( + #just keeping them in memory for now + self.new( :graph_id => hash['id'], :author_id => hash['from']['id'] :author_name => hash['from']['name'], diff --git a/app/views/aspects/public.html.haml b/app/views/aspects/public.html.haml index def45bc7c..b760c9215 100644 --- a/app/views/aspects/public.html.haml +++ b/app/views/aspects/public.html.haml @@ -18,6 +18,11 @@ %ul#stream - for post in @posts = render type_partial(post), :post => post unless post.class == Album + - if @logged_in + - MiniFB.get(@access_token, 'me', :type => "feed").each do |item| + - if item['type'] == 'status' + = render "fb_status", :post => FbStatus.from_api() + #pagination = will_paginate @posts diff --git a/app/views/fb_status/_fb_status.html.haml b/app/views/fb_status/_fb_status.html.haml new file mode 100644 index 000000000..30ec62652 --- /dev/null +++ b/app/views/fb_status/_fb_status.html.haml @@ -0,0 +1,13 @@ +-# Copyright (c) 2010, Diaspora Inc. This file is +-# licensed under the Affero General Public License version 3. See +-# the COPYRIGHT file. + + +%li.message{:id => post.id, :class => ("mine" if current_user.owns?(post))} + + = image_tag( "http://graph.facebook.com/#{post.author_id}/picture" ) + + .content + %span.from + = post.author_name + = post.message From c7757a302cf30395b200ca979f3bedf6094dd9b5 Mon Sep 17 00:00:00 2001 From: ilya Date: Fri, 24 Sep 2010 15:06:48 -0700 Subject: [PATCH 265/449] typo --- app/views/aspects/public.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/aspects/public.html.haml b/app/views/aspects/public.html.haml index b760c9215..e6500e648 100644 --- a/app/views/aspects/public.html.haml +++ b/app/views/aspects/public.html.haml @@ -21,7 +21,7 @@ - if @logged_in - MiniFB.get(@access_token, 'me', :type => "feed").each do |item| - if item['type'] == 'status' - = render "fb_status", :post => FbStatus.from_api() + = render "fb_status", :post => FbStatus.from_api(item) #pagination = will_paginate @posts From 004e659ee1d9a814ffeb5f05186da2592e4189ea Mon Sep 17 00:00:00 2001 From: Raphael Date: Fri, 24 Sep 2010 15:10:49 -0700 Subject: [PATCH 266/449] fix album posting --- app/models/user.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/models/user.rb b/app/models/user.rb index c6957ff6d..272f404bc 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -128,14 +128,18 @@ class User end def validate_aspect_permissions(aspect_ids) - aspect_ids = [aspect_ids.to_s] if aspect_ids.is_a? BSON::ObjectId + if aspect_ids == "all" + return aspect_ids + end + + aspect_ids = [aspect_ids.to_s] unless aspect_ids.is_a? Array if aspect_ids.nil? || aspect_ids.empty? raise ArgumentError.new("You must post to someone.") end aspect_ids.each do |aspect_id| - unless aspect_id == "all" || self.aspects.find(aspect_id) + unless self.aspects.find(aspect_id) raise ArgumentError.new("Cannot post to an aspect you do not own.") end end From 999d2292257e323aa478be78a2bdd57c5d8d9f75 Mon Sep 17 00:00:00 2001 From: Raphael Date: Fri, 24 Sep 2010 15:18:30 -0700 Subject: [PATCH 267/449] Post photos in either 1.8.7 or 1.9.2 --- app/controllers/photos_controller.rb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app/controllers/photos_controller.rb b/app/controllers/photos_controller.rb index d66706626..0866751d0 100644 --- a/app/controllers/photos_controller.rb +++ b/app/controllers/photos_controller.rb @@ -19,9 +19,15 @@ class PhotosController < ApplicationController # get file content type att_content_type = (request.content_type.to_s == "") ? "application/octet-stream" : request.content_type.to_s # create temporal file - file = Tempfile.new(file_name, {:encoding => 'BINARY'}) + begin + file = Tempfile.new(file_name, {:encoding => 'BINARY'}) + file.print request.raw_post.force_encoding('BINARY') + rescue RuntimeError => e + raise e unless e.message.include?('cannot generate tempfile') + file = Tempfile.new(file_name) # Ruby 1.8 compatibility + file.print request.raw_post + end # put data into this file from raw post request - file.print request.raw_post.force_encoding('BINARY') # create several required methods for this temporal file Tempfile.send(:define_method, "content_type") {return att_content_type} From 8323e7dcb21189ad5aa010dea2c28df141110e58 Mon Sep 17 00:00:00 2001 From: Daniele Di Sarli Date: Sat, 25 Sep 2010 01:21:52 +0800 Subject: [PATCH 268/449] Added Italian translation --- config/locales/diaspora/it.yml | 197 ++++++++++++++++++++++++++++++++- 1 file changed, 196 insertions(+), 1 deletion(-) diff --git a/config/locales/diaspora/it.yml b/config/locales/diaspora/it.yml index 4cce93d73..9ef8c0f7c 100644 --- a/config/locales/diaspora/it.yml +++ b/config/locales/diaspora/it.yml @@ -7,4 +7,199 @@ # See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. it: - hello: "Ciao Mondo" + hello: "Ciao mondo" + application: + helper: + unknown_person: "persona sconosciuta" + new_requests: "nuove richieste" + dashboards: + helper: + home: "home" + error_messages: + helper: + invalid_fields: "Campi non validi" + correct_the_following_errors_and_try_again: "Correggi i seguenti errori e riprova." + people: + helper: + results_for: " risultati per %{params}" + people_on_pod_are_aware_of: " people on pod are aware of" + layouts: + application: + edit_profile: "modifica profilo" + logout: "disconnetti" + shared: + aspect_nav: + all_aspects: "Tutti gli Aspetti" + manage: "Gestisci" + manage_your_aspects: "Gestisci i tuoi Aspetti" + sub_header: + all_aspects: "Tutti gli Aspetti" + manage_aspects: "Gestisci Aspetti" + publisher: + share: "Condividi" + aspect_friends: + add_friends: "aggiungi amici" + albums: + album: + you: "tu" + new_album: + create: "crea" + add_a_new_album: "Aggiungi un nuovo album" + show: + edit_album: "Modifica album" + albums: "album" + updated: "aggiornato" + by: "da" + edit: + editing: "Modifica" + updated: "aggiornato" + are_you_sure: "Sei sicuro?" + delete_album: "Elimina album" + cancel: "Annulla" + index: + home: "home" + new_album: "Nuovo album" + create: + success: "Hai creato un album chiamato %{name}." + update: + success: "L'album %{name} è stato modificato." + failure: "Modifica dell'album %{name} fallita." + destroy: + success: "L'album %{name} è stato eliminato." + helper: + friends_albums: "Album degli amici" + your_albums: "I tuoi album" + aspects: + index: + photos: "foto" + show: + photos: "foto" + manage: + add_a_new_aspect: "Aggiungi un nuovo aspetto" + add_a_new_friend: "Aggiungi un nuovo amico" + show: "Mostra" + update_aspects: "Aggiorna Aspetti" + requests: "Richieste" + ignore_remove: "Ignora/Rimuovi" + new_aspect: + add_a_new_aspect: "Aggiungi un nuovo aspetto" + create: "Crea" + create: + success: "Clicca sul segno "più" nella parte sinistra per dire a Diaspora chi può vedere il tuo nuovo aspetto." + destroy: + success: "%{name} è stato rimosso con successo." + update: + success: "Il tuo aspetto, %{name}, è stato modificato con successo." + move_friends: + failure: "Modifica dell'aspetto fallita per l'amico %{real_name}." + success: "Aspetti modificati con successo." + move_friend: + failure: "non ha funzionato %{inspect}" + success: "Adesso stai mostrando al tuo amico un aspetto differente di te stesso." + helper: + remove: "rimuovi" + aspect_not_empty: "Aspetto non vuoto" + users: + edit: + cancel: "Annulla" + update_profile: "Aggiorna profilo" + home: "Home" + diaspora_username: "NOME UTENTE DIASPORA" + info: "Info" + picture: "Immagine" + editing_profile: "Modifica del profilo" + albums: "Album" + you_dont_have_any_photos: "Non hai nessuna foto! Vai alla pagina" + page_to_upload_some: "per caricarne qualcuna." + comments: + comment: + ago: "fa" + new_comment: + comment: "Commento" + photos: + show: + prev: "indietro" + full_size: "dimensione intera" + next: "avanti" + edit_photo: "Modifica foto" + delete_photo: "Elimina foto" + are_you_sure: "Sei sicuro?" + comments: "commenti" + edit: + editing: "Modifica" + are_you_sure: "Sei sicuro?" + delete_photo: "Elimina foto" + photo: + show_comments: "mostra commenti" + posted_a_new_photo_to: "ha caricato una nuova foto in" + new: + new_photo: "Nuova foto" + back_to_list: "Torna all'elenco" + post_it: "inseriscila!" + create: + runtime_error: "Caricamento della foto fallito. Sei sicuro che la tua cintura di sicurezza è allacciata?" + integrity_error: "Caricamento della foto fallito. Sei sicuro che era un'immagine?" + type_error: "Caricamento della foto fallito. Sei sicuro di aver aggiunto un'immagine?" + update: + notice: "Foto aggiornata con successo." + error: "Modifica della foto fallita." + destroy: + notice: "Foto eliminata." + registrations: + new: + sign_up: "Iscriviti" + create: + success: "Ti sei unito a Diaspora!" + status_messages: + new_status_message: + tell_me_something_good: "dimmi qualcosa di buono" + oh_yeah: "oh si!" + status_message: + show_comments: "mostra commenti" + delete: "Elimina" + are_you_sure: "Sei sicuro?" + show: + status_message: "Messaggio di stato" + comments: "commenti" + are_you_sure: "Sei sicuro?" + destroy: "Distruggi" + view_all: "Vedi tutto" + message: "Messaggio" + owner: "Proprietario" + helper: + no_message_to_display: "Nessun messaggio da visualizzare." + people: + person: + add_friend: "aggiungi amico" + pending_request: "richiesta in sospeso" + index: + add_friend: "aggiungi amico" + real_name: "nome reale" + diaspora_handle: "diaspora handle" + thats_you: "sei tu!" + friend_request_pending: "richiesta d'amicizia in sospeso" + you_have_a_friend_request_from_this_person: "hai una richiesta d'amicizia da questa persona" + new: + new_person: "Nuova persona" + back_to_list: "Torna all'elenco" + show: + last_seen: "ultima visualizzazione: %{how_long_ago}" + friends_since: "amici da: %{how_long_ago}" + save: "salva" + are_you_sure: "Sei sicuro?" + remove_friend: "rimuovi amico" + requests: + new_request: + add_a_new_friend_to: "Aggiungi un amico a" + enter_a_diaspora_username: "Inserisci un nome utente Diaspora:" + your_diaspora_username_is: "Il tuo nome utente Diaspora è: %{diaspora_handle}" + friends_username: "nome utente dell'amico" + destroy: + success: "Adesso siete amici." + error: "Seleziona un aspetto!" + ignore: "Ignora richiesta di amicizia." + create: + error: "Nessun seed Diaspora trovato con questa email!" + already_friends: "Sei già amico con %{destination_url}!" + success: "Una richiesta di amicizia è stata inviata a %{destination_url}." + horribly_wrong: "Qualcosa è andato orribilmente storto." From d66eedaf0046eff40603c696d6af13977117a5b5 Mon Sep 17 00:00:00 2001 From: hemanth Date: Fri, 17 Sep 2010 21:57:02 +0800 Subject: [PATCH 269/449] Fixed a major issue with sudo user check\! --- ubuntu-setup.bash | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ubuntu-setup.bash b/ubuntu-setup.bash index 67b602abe..24f4af871 100644 --- a/ubuntu-setup.bash +++ b/ubuntu-setup.bash @@ -8,7 +8,8 @@ shopt -s extglob # Check if the user has sudo privileges. -[[ $( id -u) ]] && echo "$(whoami) has no sudo permissions on this machine" && exit 1 +sudo -v >/dev/null 2>&1 || { echo $(whoami) has no sudo privileges ; exit 1; } + # Install build tools echo "Installing build tools.." From 1add029421f701f2704525c20d726f72347f5d09 Mon Sep 17 00:00:00 2001 From: hemanth Date: Fri, 17 Sep 2010 23:48:06 +0800 Subject: [PATCH 270/449] Check for wget added --- ubuntu-setup.bash | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ubuntu-setup.bash b/ubuntu-setup.bash index 24f4af871..f9e7d9ff8 100644 --- a/ubuntu-setup.bash +++ b/ubuntu-setup.bash @@ -11,6 +11,9 @@ shopt -s extglob sudo -v >/dev/null 2>&1 || { echo $(whoami) has no sudo privileges ; exit 1; } +# Check if wget is installed +test wget || echo "Installing wget.." && sudo apt-get install wget && echo "Installed wget.." + # Install build tools echo "Installing build tools.." sudo apt-get -y --no-install-recommends install build-essential libxslt1.1 libxslt1-dev libxml2 From d4ad943699e76489f7efd8059c2d8e5b80cad95a Mon Sep 17 00:00:00 2001 From: hemanth Date: Sat, 18 Sep 2010 01:43:15 +0800 Subject: [PATCH 271/449] Check on universe repository, if enabled or not. --- ubuntu-setup.bash | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ubuntu-setup.bash b/ubuntu-setup.bash index f9e7d9ff8..50a2f4ff7 100644 --- a/ubuntu-setup.bash +++ b/ubuntu-setup.bash @@ -10,6 +10,8 @@ shopt -s extglob # Check if the user has sudo privileges. sudo -v >/dev/null 2>&1 || { echo $(whoami) has no sudo privileges ; exit 1; } +# Check if universal repository is enabled +grep -i universe /etc/apt/sources.list >> /dev/null || echo "Please enable universe repository" && exit 1 # Check if wget is installed test wget || echo "Installing wget.." && sudo apt-get install wget && echo "Installed wget.." From 5682cf59ab71ac215062f8f38f092dd10495b922 Mon Sep 17 00:00:00 2001 From: hemanth Date: Sat, 18 Sep 2010 02:28:13 +0800 Subject: [PATCH 272/449] Added a check on if the user has already cloned and also a set -e to exit immediately if a command exits with a non-zero status. --- ubuntu-setup.bash | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/ubuntu-setup.bash b/ubuntu-setup.bash index 50a2f4ff7..bb62088a9 100644 --- a/ubuntu-setup.bash +++ b/ubuntu-setup.bash @@ -2,7 +2,9 @@ # Author : hemanth.hm@gmail.com # Site : www.h3manth.com # This script helps to setup diaspora. -# + +# Exit immediately if a command exits with a non-zero status. +set -e # Set extented globbing shopt -s extglob @@ -82,9 +84,11 @@ echo "Installed blunder.." # Take a clone of Diaspora ( -echo "Clone diaspora source.." -git clone http://github.com/diaspora/diaspora.git + +# Check if the user is already in a cloned source if not clone the source +[[ $( basename $PWD ) == "diaspora" ]] && echo "Already in diaspora directory" || git clone http://github.com/diaspora/diaspora.git ; cd diaspora echo "Cloned the source.." + # Install extra gems cd diaspora echo "Installing more gems.." From dc0fc1f4451c9a7472df5b32b6086fd86b56e8ec Mon Sep 17 00:00:00 2001 From: hemanth Date: Sat, 18 Sep 2010 02:38:13 +0800 Subject: [PATCH 273/449] set -e removed as the rules change from one Bash version to another, as Bash attempts to track the extremely slippery POSIX definition of this "feature". When a SubShell is involved, it gets worse still -- the behavior changes depending on whether Bash is invoked in POSIX mode. --- ubuntu-setup.bash | 3 --- 1 file changed, 3 deletions(-) diff --git a/ubuntu-setup.bash b/ubuntu-setup.bash index bb62088a9..65231d9d0 100644 --- a/ubuntu-setup.bash +++ b/ubuntu-setup.bash @@ -3,9 +3,6 @@ # Site : www.h3manth.com # This script helps to setup diaspora. -# Exit immediately if a command exits with a non-zero status. -set -e - # Set extented globbing shopt -s extglob From 585cc7a480ef4327afc500c1883554f7f6356add Mon Sep 17 00:00:00 2001 From: hemanth Date: Sat, 18 Sep 2010 04:49:08 +0800 Subject: [PATCH 274/449] Check if universal repository is enabled or not. --- ubuntu-setup.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ubuntu-setup.bash b/ubuntu-setup.bash index 65231d9d0..a969d0fe3 100644 --- a/ubuntu-setup.bash +++ b/ubuntu-setup.bash @@ -10,7 +10,7 @@ shopt -s extglob sudo -v >/dev/null 2>&1 || { echo $(whoami) has no sudo privileges ; exit 1; } # Check if universal repository is enabled -grep -i universe /etc/apt/sources.list >> /dev/null || echo "Please enable universe repository" && exit 1 +grep -i universe /etc/apt/sources.list > /dev/null || { echo "Please enable universe repository" ; exit 1 ; } # Check if wget is installed test wget || echo "Installing wget.." && sudo apt-get install wget && echo "Installed wget.." From 043dadf0ea53208b7d32fabfaa8a4e61b8680c6c Mon Sep 17 00:00:00 2001 From: Daniel Thomas Date: Mon, 20 Sep 2010 04:10:29 +0800 Subject: [PATCH 275/449] Update copyright information on ubuntu-setup.bash Adding Diaspora Inc. copyright and reference to the AGPL and noting that Mackenzie Morgan (maco) and I have made contributions to the file. Signed-off-by: Daniel Thomas --- ubuntu-setup.bash | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ubuntu-setup.bash b/ubuntu-setup.bash index a969d0fe3..f9d4ff9fb 100644 --- a/ubuntu-setup.bash +++ b/ubuntu-setup.bash @@ -1,7 +1,13 @@ #!/bin/bash # Author : hemanth.hm@gmail.com # Site : www.h3manth.com +# Contributions from: Mackenzie Morgan (maco) and Daniel Thomas (drt24) # This script helps to setup diaspora. +# +# Copyright (c) 2010, Diaspora Inc. This file is +# licensed under the Affero General Public License version 3. See +# the COPYRIGHT file. + # Set extented globbing shopt -s extglob From 8a30a287afa9bbe81a41ee488c1957f8b8d8ae87 Mon Sep 17 00:00:00 2001 From: Daniel Thomas Date: Mon, 20 Sep 2010 04:30:31 +0800 Subject: [PATCH 276/449] Make ubuntu-setup.bash executable So that it can run directly when checked out without needing to have chmod +x ubuntu-setup.bash run first. Signed-off-by: Daniel Thomas --- ubuntu-setup.bash | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 ubuntu-setup.bash diff --git a/ubuntu-setup.bash b/ubuntu-setup.bash old mode 100644 new mode 100755 From c5aa22fd284fb8639f952969e4522c1a7709fa95 Mon Sep 17 00:00:00 2001 From: maco Date: Sat, 18 Sep 2010 04:40:33 +0800 Subject: [PATCH 277/449] ubuntu-setup.bash: for rubygems, use maverick's repo or if lucid use ppa or if old use tarball. create /var/lib/gems/1.8/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games-friendly symlink if using debs --- ubuntu-setup.bash | 38 ++++++++++++++++++++++++++------------ 1 file changed, 26 insertions(+), 12 deletions(-) diff --git a/ubuntu-setup.bash b/ubuntu-setup.bash index f9d4ff9fb..533524235 100755 --- a/ubuntu-setup.bash +++ b/ubuntu-setup.bash @@ -65,18 +65,32 @@ echo "Installed git-core.." # Setting up ruby gems echo "Fetching and installing ruby gems.." ( - echo "." - cd /tmp - wget http://production.cf.rubygems.org/rubygems/rubygems-1.3.7.tgz - echo "." - tar -xf rubygems-1.3.7.tgz - echo "." - cd rubygems-1.3.7 - echo "." - sudo ruby setup.rb - echo "." - sudo ln -s /usr/bin/gem1.8 /usr/bin/gem - echo "." + RELEASE=$(lsb_release -c | cut -f2) + if [ RELEASE == "maverick" ] + then + sudo apt-get install --no-install-recommends -y rubygems + sudo ln -s /var/lib/gems/1.8/bin/bundle /usr/local/bin/bundle #for PATH + elsif [ RELEASE == "lucid" ] + then + sudo add-apt-repository ppa:maco.m/ruby + sudo apt-get update + sudo apt-get install --no-install-recommends -y rubygems + sudo ln -s /var/lib/gems/1.8/bin/bundle /usr/local/bin/bundle #for PATH + else + # Old version + echo "." + cd /tmp + wget http://production.cf.rubygems.org/rubygems/rubygems-1.3.7.tgz + echo "." + tar -xf rubygems-1.3.7.tgz + echo "." + cd rubygems-1.3.7 + echo "." + sudo ruby setup.rb + echo "." + sudo ln -s /usr/bin/gem1.8 /usr/bin/gem + echo "." + fi ) echo "Done installing the gems.." From ea2739e89225daf2ef32b384c6f8ac8e41b6ce10 Mon Sep 17 00:00:00 2001 From: maco Date: Sun, 19 Sep 2010 06:10:19 +0800 Subject: [PATCH 278/449] ubuntu-setup.bash: fix s/blunder/bundler/ and s/elsif/elif/ --- ubuntu-setup.bash | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ubuntu-setup.bash b/ubuntu-setup.bash index 533524235..08c839f33 100755 --- a/ubuntu-setup.bash +++ b/ubuntu-setup.bash @@ -70,7 +70,7 @@ echo "Fetching and installing ruby gems.." then sudo apt-get install --no-install-recommends -y rubygems sudo ln -s /var/lib/gems/1.8/bin/bundle /usr/local/bin/bundle #for PATH - elsif [ RELEASE == "lucid" ] + elif [ RELEASE == "lucid" ] then sudo add-apt-repository ppa:maco.m/ruby sudo apt-get update @@ -94,10 +94,10 @@ echo "Fetching and installing ruby gems.." ) echo "Done installing the gems.." -# Install blunder -echo "Installing blunder.." +# Install bundler +echo "Installing bundler.." sudo gem install bundler -echo "Installed blunder.." +echo "Installed bundler.." # Take a clone of Diaspora ( From e2db21d7b06f147a14fd51ab5b332bc5eacbbe8a Mon Sep 17 00:00:00 2001 From: sennewood Date: Fri, 24 Sep 2010 14:25:04 +0800 Subject: [PATCH 279/449] Use double quotes in locale files --- config/locales/devise/devise.de.yml | 42 ++++++++++++++--------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/config/locales/devise/devise.de.yml b/config/locales/devise/devise.de.yml index 7c0e0e758..82b658e99 100644 --- a/config/locales/devise/devise.de.yml +++ b/config/locales/devise/devise.de.yml @@ -12,30 +12,30 @@ de: devise: failure: - unauthenticated: 'Du musst dich anmelden oder registrieren um fortzufahren.' - unconfirmed: 'Du musst dein Konto bestätigen um fortzufahren.' - locked: 'Dein Konto ist gesperrt.' - invalid: 'Ungültige E-Mail-Adresse oder Passwort.' - invalid_token: 'Ungültiger Authentifizierungstoken.' - timeout: 'Deine Sitzung ist abgelaufen, bitte melde dich erneut an um fortzufahren.' - inactive: 'Dein Konto wurde noch nicht aktiviert.' + unauthenticated: "Du musst dich anmelden oder registrieren um fortzufahren." + unconfirmed: "Du musst dein Konto bestätigen um fortzufahren." + locked: "Dein Konto ist gesperrt." + invalid: "Ungültige E-Mail-Adresse oder Passwort." + invalid_token: "Ungültiger Authentifizierungstoken." + timeout: "Deine Sitzung ist abgelaufen, bitte melde dich erneut an um fortzufahren." + inactive: "Dein Konto wurde noch nicht aktiviert." sessions: - signed_in: 'Erfolgreich angemeldet.' - signed_out: 'Erfolgreich abgemeldet.' + signed_in: "Erfolgreich angemeldet." + signed_out: "Erfolgreich abgemeldet." passwords: - send_instructions: 'Du wirst in ein paar Minuten eine E-Mail erhalten, die beschreibt, wie du dein Passwort zurücksetzt.' - updated: 'Dein Passwort wurde erfolgreich geändert. Du bist nun angemeldet.' + send_instructions: "Du wirst in ein paar Minuten eine E-Mail erhalten, die beschreibt, wie du dein Passwort zurücksetzt." + updated: "Dein Passwort wurde erfolgreich geändert. Du bist nun angemeldet." confirmations: - send_instructions: 'Du wirst in ein paar Minuten eine E-Mail erhalten, die beschreibt, wie du dein Konto bestätigst.' - confirmed: 'Dein Konto wurde erfolgreich bestätigt. Du bist nun angemeldet.' + send_instructions: "Du wirst in ein paar Minuten eine E-Mail erhalten, die beschreibt, wie du dein Konto bestätigst." + confirmed: "Dein Konto wurde erfolgreich bestätigt. Du bist nun angemeldet." registrations: - signed_up: 'Du hast dich erfolgreich registriert. Sofern aktiviert, wurde dir eine Bestätigung per E-Mail gesendet.' - updated: 'Dein Konto wurde aktualisiert.' - destroyed: 'Tschüss! Dein Konto wurde erfolgreich gekündigt. Wir hoffen dich bald wiederzusehen.' + signed_up: "Du hast dich erfolgreich registriert. Sofern aktiviert, wurde dir eine Bestätigung per E-Mail gesendet." + updated: "Dein Konto wurde aktualisiert." + destroyed: "Tschüss! Dein Konto wurde erfolgreich gekündigt. Wir hoffen dich bald wiederzusehen." unlocks: - send_instructions: 'Du wirst in ein paar Minuten eine E-Mail erhalten, die beschreibt, wie du dein Konto entsperren kannst.' - unlocked: 'Dein Konto wurde erfolgreich entsperrt. Du bist nun angemeldet.' + send_instructions: "Du wirst in ein paar Minuten eine E-Mail erhalten, die beschreibt, wie du dein Konto entsperren kannst." + unlocked: "Dein Konto wurde erfolgreich entsperrt. Du bist nun angemeldet." mailer: - confirmation_instructions: 'Instruktionen zur Bestätigung' - reset_password_instructions: 'Instruktionen zum Zurücksetzen des Passworts' - unlock_instructions: 'Instruktionen zum Entsperren' + confirmation_instructions: "Instruktionen zur Bestätigung" + reset_password_instructions: "Instruktionen zum Zurücksetzen des Passworts" + unlock_instructions: "Instruktionen zum Entsperren" From 16e5f972d12f01eb4b788205f2796e92a04aff41 Mon Sep 17 00:00:00 2001 From: sennewood Date: Fri, 24 Sep 2010 14:44:14 +0800 Subject: [PATCH 280/449] Translation correction --- config/locales/diaspora/de.yml | 44 +++++++++++++++++----------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/config/locales/diaspora/de.yml b/config/locales/diaspora/de.yml index 1c4dfb4ad..831b92c52 100644 --- a/config/locales/diaspora/de.yml +++ b/config/locales/diaspora/de.yml @@ -14,15 +14,15 @@ de: new_requests: "neue Anfrage" dashboards: helper: - home: "home" + home: "Startseite" error_messages: helper: invalid_fields: "Ungültige Felder" - correct_the_following_errors_and_try_again: "Korrigiere die folgenden Fehler und probier es erneut." + correct_the_following_errors_and_try_again: "Korrigiere die folgenden Fehler und probiere es erneut." people: helper: - results_for: " resultados para %{params}" - people_on_pod_are_aware_of: " gente en pod estan al tanto de " + results_for: " Resultate für %{params}" + people_on_pod_are_aware_of: " people on pod are aware of" layouts: application: edit_profile: "Profil bearbeiten" @@ -85,19 +85,19 @@ de: add_a_new_aspect: "Neuen Aspekt erstellen" create: "Erstellen" create: - success: "Klicke auf das Plus auf der rechten Seite um Diaspora mitzuteilen wer deinen neuen Aspekt sehen kann." + success: "Klicke auf das Plus auf der linken Seite um Diaspora mitzuteilen wer deinen neuen Aspekt sehen kann." destroy: success: "%{name} wurde erfolgreich gelöscht." update: success: "Dein Aspekt, %{name}, wurde erfolgreich geändert." move_friends: - failure: "Aspect editing failed for friend %{real_name}." + failure: "Ändern des Aspekts für deinen Freund %{real_name} schlug fehl." success: "Aspekt erfolgreich geändert." move_friend: error: "didn't work %{inspect}" - notice: "You are now showing your friend a different aspect of yourself." + notice: "Du zeigst deinem Freund jetzt einen anderen Aspekt von dir." helper: - remove: "remove" + remove: "entfernen" aspect_not_empty: "Aspekt ist nicht leer" users: edit: @@ -109,8 +109,8 @@ de: picture: "Bild" editing_profile: "Profil bearbeiten" albums: "Alben" - you_dont_have_any_photos: "#TODO" - page_to_upload_some: "#TODO" + you_dont_have_any_photos: "Du hast keine Fotos! Gehe auf die" + page_to_upload_some: "Seite um welche hochzuladen." comments: comment: # this won't work in german at all. Needs more thorough I18n @@ -132,18 +132,18 @@ de: delete_photo: "Foto löschen" photo: show_comments: "Kommentare anzeigen" - posted_a_new_photo_to: "posted a new photo to" + posted_a_new_photo_to: "neues Fotos veröffentlicht bei" new: new_photo: "Foto erstellen" back_to_list: "Zurück zur Liste" post_it: "Hochladen" create: - runtime_error: "Photo upload failed. Are you sure that your seatbelt is fastened?" - integrity_error: "Photo upload failed. Are you sure that was an image?" - type_error: "Photo upload failed. Are you sure an image was added?" + runtime_error: "Hochladen eines Fotos fehlgeschlagen. Bist du sicher, dass dein Sicherheitsgurt befestigt ist?" + integrity_error: "Hochladen eines Fotos fehlgeschlagen. Bist du sicher, dass das ein Bild war?" + type_error: "Hochladen eines Fotos fehlgeschlagen. Bist du sicher, dass ein Bild hinzugefügt wurde?" update: notice: "Foto erfolgreich aktualisiert." - error: "Failed to edit photo." + error: "Ändern des Fotos fehlgeschlagen." destroy: notice: "Foto gelöscht." registrations: @@ -154,7 +154,7 @@ de: status_messages: new_status_message: tell_me_something_good: "Erzähl' mir was schönes!" - oh_yeah: "Hey, super!" + oh_yeah: "Oh, super!" status_message: show_comments: "Kommentare anzeigen" delete: "Löschen" @@ -166,13 +166,13 @@ de: destroy: "Löschen" view_all: "Alle anzeigen" message: "Nachricht" - owner: "Besitzer" + owner: "Eigentümer" helper: - no_message_to_display: "No message to display." + no_message_to_display: "Keine Nachricht zum anzeigen." people: index: add_friend: "Freund hinzufügen" - real_name: "real name" + real_name: "Echter Name" diaspora_handle: "diaspora handle" thats_you: "das bist du!" friend_request_pending: "Freundschaftsanfrage ausstehend" @@ -183,15 +183,15 @@ de: show: last_seen: "zuletzt gesehen: %{how_long_ago}" friends_since: "Freunde seit: %{how_long_ago}" - save: "save" + save: "speichern" are_you_sure: "Bist du sicher?" - remove_friend: "remove friend" + remove_friend: "Freund entfernen" destroy: success: "Ihr seid jetzt Freunde." error: "Bitte wähle einen Aspekt aus!" ignore: "Freundschaftsanfrage ignorieren." create: - error: "No diaspora seed found with this email!" + error: "Kein Diaspora-Seed in dieser E-Mail gefunden!" already_friends: "Du bist bereits mit %{destination_url} befreundet!" success: "Eine Freundschaftsanfrage wurde an %{destination_url} gesendet." horribly_wrong: "Etwas ging tierisch schief." From dcedc5d505f615b554d63fb9f011c17586774f83 Mon Sep 17 00:00:00 2001 From: sennewood Date: Fri, 24 Sep 2010 14:56:45 +0800 Subject: [PATCH 281/449] Added the missing lines of code and translated them. --- config/locales/diaspora/de.yml | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/config/locales/diaspora/de.yml b/config/locales/diaspora/de.yml index 831b92c52..ae8fb13e3 100644 --- a/config/locales/diaspora/de.yml +++ b/config/locales/diaspora/de.yml @@ -91,7 +91,7 @@ de: update: success: "Dein Aspekt, %{name}, wurde erfolgreich geändert." move_friends: - failure: "Ändern des Aspekts für deinen Freund %{real_name} schlug fehl." + failure: "Ändern des Aspekts für deinen Freund %{real_name} fehlgeschlagen." success: "Aspekt erfolgreich geändert." move_friend: error: "didn't work %{inspect}" @@ -132,13 +132,13 @@ de: delete_photo: "Foto löschen" photo: show_comments: "Kommentare anzeigen" - posted_a_new_photo_to: "neues Fotos veröffentlicht bei" + posted_a_new_photo_to: "neues Foto veröffentlicht bei" new: new_photo: "Foto erstellen" back_to_list: "Zurück zur Liste" post_it: "Hochladen" create: - runtime_error: "Hochladen eines Fotos fehlgeschlagen. Bist du sicher, dass dein Sicherheitsgurt befestigt ist?" + runtime_error: "Hochladen eines Fotos fehlgeschlagen. Bist du sicher, dass dein Sicherheitsgurt befestigt ist?" integrity_error: "Hochladen eines Fotos fehlgeschlagen. Bist du sicher, dass das ein Bild war?" type_error: "Hochladen eines Fotos fehlgeschlagen. Bist du sicher, dass ein Bild hinzugefügt wurde?" update: @@ -170,13 +170,16 @@ de: helper: no_message_to_display: "Keine Nachricht zum anzeigen." people: + person: + add_friend: "Freund hinzufügen" + pending_request: "Anfrage ausstehend" index: add_friend: "Freund hinzufügen" real_name: "Echter Name" diaspora_handle: "diaspora handle" thats_you: "das bist du!" - friend_request_pending: "Freundschaftsanfrage ausstehend" - you_have_a_friend_request_from_this_person: "du hast eine Freundschaftsanfrage von dieser Person" + friend_request_pending: "Ausstehende Freundschaftsanfrage" + you_have_a_friend_request_from_this_person: "Du hast eine Freundschaftsanfrage von dieser Person" new: new_person: "Neue Person" back_to_list: "Zurück zur Liste" @@ -186,6 +189,12 @@ de: save: "speichern" are_you_sure: "Bist du sicher?" remove_friend: "Freund entfernen" + requests: + new_request: + add_a_new_friend_to: "Add a new friend to" + enter_a_diaspora_username: "Gebe einen Diaspora Benutzernamen ein:" + your_diaspora_username_is: "Dein Diaspora Benutzername ist: %{diaspora_handle}" + friends_username: "Freundes Benutzername" destroy: success: "Ihr seid jetzt Freunde." error: "Bitte wähle einen Aspekt aus!" From e414558f7903d3f01c46d360bef39dcc3889133f Mon Sep 17 00:00:00 2001 From: ilya Date: Fri, 24 Sep 2010 15:52:29 -0700 Subject: [PATCH 282/449] passing the right things to the partial --- app/models/fb_status.rb | 12 ++++++------ app/views/aspects/public.html.haml | 6 +++--- app/views/fb_status/_fb_status.html.haml | 2 +- spec/models/fb_status_spec.rb | 9 ++++----- 4 files changed, 14 insertions(+), 15 deletions(-) diff --git a/app/models/fb_status.rb b/app/models/fb_status.rb index 367549c1b..fd190c2c7 100644 --- a/app/models/fb_status.rb +++ b/app/models/fb_status.rb @@ -10,21 +10,21 @@ class FbStatus key :author_id, String key :author_name, String key :message, String - key :updated_time, DateTime + key :updated_time, Time timestamps! validates_presence_of :graph_id,:author_id,:author_name,:message,:updated_time - def self.from_api(json) - hash = JSON.parse(json) + def self.from_api(hash) #just keeping them in memory for now self.new( :graph_id => hash['id'], - :author_id => hash['from']['id'] + :author_id => hash['from']['id'], :author_name => hash['from']['name'], - :message => hash['message'] - :updated_time => Time.parse(hash['updated_time'] + :message => hash['message'], + :updated_time => Time.parse(hash['updated_time']) + ) end end diff --git a/app/views/aspects/public.html.haml b/app/views/aspects/public.html.haml index e6500e648..4399034f7 100644 --- a/app/views/aspects/public.html.haml +++ b/app/views/aspects/public.html.haml @@ -19,9 +19,9 @@ - for post in @posts = render type_partial(post), :post => post unless post.class == Album - if @logged_in - - MiniFB.get(@access_token, 'me', :type => "feed").each do |item| - - if item['type'] == 'status' - = render "fb_status", :post => FbStatus.from_api(item) + - MiniFB.get(@access_token, 'me', :type => "feed")[:data].each do |item| + - if item[:type] == 'status' + = render "fb_status/fb_status", :post => FbStatus.from_api(item) #pagination = will_paginate @posts diff --git a/app/views/fb_status/_fb_status.html.haml b/app/views/fb_status/_fb_status.html.haml index 30ec62652..d5a57bd22 100644 --- a/app/views/fb_status/_fb_status.html.haml +++ b/app/views/fb_status/_fb_status.html.haml @@ -3,7 +3,7 @@ -# the COPYRIGHT file. -%li.message{:id => post.id, :class => ("mine" if current_user.owns?(post))} +%li.message{:id => post.id} = image_tag( "http://graph.facebook.com/#{post.author_id}/picture" ) diff --git a/spec/models/fb_status_spec.rb b/spec/models/fb_status_spec.rb index a74506512..368f8bd16 100644 --- a/spec/models/fb_status_spec.rb +++ b/spec/models/fb_status_spec.rb @@ -5,7 +5,6 @@ require File.dirname(__FILE__) + '/../spec_helper' -require 'json' describe FbStatus do @@ -16,20 +15,20 @@ describe FbStatus do end describe '#from_api' do - let(:json_string) {File.open(File.dirname(__FILE__) + '/../fixtures/fb_status').read} + let!(:json_string) {File.open(File.dirname(__FILE__) + '/../fixtures/fb_status').read} let!(:json_object) { JSON.parse(json_string) } - let!(:status_from_json) {FbStatus.from_api(json_string)} + let!(:status_from_json) {FbStatus.from_api(json_object)} it 'has graph_id' do status_from_json.graph_id.should == json_object['id'] end it 'has author_id' do - status_from_json.graph_id.should == json_object['from']['id'] + status_from_json.author_id.should == json_object['from']['id'] end it 'has author_name' do - status_from_json.graph_id.should == json_object['from']['name'] + status_from_json.author_name.should == json_object['from']['name'] end it 'has message' do From f38bcc9eb34b02de5e057ea0ead0a678cf1e80ec Mon Sep 17 00:00:00 2001 From: ilya Date: Fri, 24 Sep 2010 15:54:53 -0700 Subject: [PATCH 283/449] tiny change in view --- app/views/shared/_aspect_friends.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/shared/_aspect_friends.haml b/app/views/shared/_aspect_friends.haml index 10a0da317..0a28a9676 100644 --- a/app/views/shared/_aspect_friends.haml +++ b/app/views/shared/_aspect_friends.haml @@ -8,7 +8,7 @@ - for friend in @friends = person_image_link(friend) - if @logged_in && (@aspect == :public) - Facebook Friends + %h3 Facebook Friends - @fb_friends = MiniFB.get(@access_token, 'me', :type => "friends") - @fb_friends[:data].each do |friend| = image_tag( "http://graph.facebook.com/#{friend[:id]}/picture" ) From d59330264de412227fe02f4f88fa7c9663b2fa41 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Fri, 24 Sep 2010 16:18:41 -0700 Subject: [PATCH 284/449] fixed syntax error in italian locale --- config/locales/diaspora/it.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/locales/diaspora/it.yml b/config/locales/diaspora/it.yml index 9ef8c0f7c..418733b40 100644 --- a/config/locales/diaspora/it.yml +++ b/config/locales/diaspora/it.yml @@ -85,7 +85,7 @@ it: add_a_new_aspect: "Aggiungi un nuovo aspetto" create: "Crea" create: - success: "Clicca sul segno "più" nella parte sinistra per dire a Diaspora chi può vedere il tuo nuovo aspetto." + success: "Clicca sul segno più nella parte sinistra per dire a Diaspora chi può vedere il tuo nuovo aspetto." destroy: success: "%{name} è stato rimosso con successo." update: From f4d18ce9bc265ff7df3207ce4649d4366b721218 Mon Sep 17 00:00:00 2001 From: Raphael Date: Fri, 24 Sep 2010 17:12:18 -0700 Subject: [PATCH 285/449] don't use request.host as data --- app/controllers/users_controller.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index dbb69d1a2..819a88d28 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -30,7 +30,8 @@ class UsersController < ApplicationController if params[:profile][:image_url].empty? params[:profile].delete(:image_url) else - params[:profile][:image_url] = "http://" + request.host + ":" + request.port.to_s + params[:profile][:image_url] + url = APP_CONFIG[:pod_url].chop if APP_CONFIG[:pod_url][-1,1] == '/' + params[:profile][:image_url] = url + params[:profile][:image_url] end end From f74b0a6f2c3e3a4286de56f5c8052c424b645c0a Mon Sep 17 00:00:00 2001 From: Chiggins Date: Tue, 21 Sep 2010 00:09:16 +0800 Subject: [PATCH 286/449] Added "shadow text" to caption text field while editing a photo, since about every other text field has "shadow text". --- app/views/photos/edit.html.haml | 1 + 1 file changed, 1 insertion(+) diff --git a/app/views/photos/edit.html.haml b/app/views/photos/edit.html.haml index 1f36ae99f..bbaee2ef8 100644 --- a/app/views/photos/edit.html.haml +++ b/app/views/photos/edit.html.haml @@ -14,6 +14,7 @@ = linked_scaled_photo @photo, @album = form_for @photo do |p| + = p.label :caption = p.text_field :caption, :value => @photo.caption = p.submit From beda67aca699460e487d9388e793b7e77f163233 Mon Sep 17 00:00:00 2001 From: Raphael Date: Fri, 24 Sep 2010 17:51:51 -0700 Subject: [PATCH 287/449] Shorten git show stuff --- config/initializers/git_info.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/initializers/git_info.rb b/config/initializers/git_info.rb index a6d767aa4..ac2e4ba27 100644 --- a/config/initializers/git_info.rb +++ b/config/initializers/git_info.rb @@ -3,4 +3,4 @@ # the COPYRIGHT file. -GIT_INFO = `git show` +GIT_INFO = `git show --name-only` From e3ec00595d49c68268807a5bf218f08419e640ed Mon Sep 17 00:00:00 2001 From: Sarah Mei Date: Sat, 25 Sep 2010 04:34:48 -0700 Subject: [PATCH 288/449] Cleaned up file path joining in some of the dev utilties. Backfilled tests where necessary to make sure changes didn't break existing code. --- app/controllers/dev_utilities_controller.rb | 17 ++++---- db/seeds.rb | 2 +- db/seeds/backer.rb | 6 +-- db/seeds/dev.rb | 2 +- db/seeds/tom.rb | 3 +- .../dev_utilities_controller_spec.rb | 42 +++++++++++++++++++ 6 files changed, 57 insertions(+), 15 deletions(-) create mode 100644 spec/controllers/dev_utilities_controller_spec.rb diff --git a/app/controllers/dev_utilities_controller.rb b/app/controllers/dev_utilities_controller.rb index 30d1a1799..77867af81 100644 --- a/app/controllers/dev_utilities_controller.rb +++ b/app/controllers/dev_utilities_controller.rb @@ -16,7 +16,7 @@ class DevUtilitiesController < ApplicationController bkr_info.each do |backer| backer_email = "#{backer['username']}@#{backer['username']}.joindiaspora.com" rel_hash = relationship_flow(backer_email) - logger.info "Zombefriending #{backer['given_name']} #{backer['family_name']}" + logger.info "Zombiefriending #{backer['given_name']} #{backer['family_name']}" logger.info "Calling send_friend_request with #{rel_hash[:friend]} and #{current_user.aspects.first}" current_user.send_friend_request_to(rel_hash[:friend], current_user.aspects.first) end @@ -30,11 +30,6 @@ class DevUtilitiesController < ApplicationController } end - def backer_info - config = YAML.load_file(File.dirname(__FILE__) + '/../../config/deploy_config.yml') - config['servers']['backer'] - end - def set_backer_number render :nothing => true seed_num_hash = {:seed_number => params[:number]} @@ -44,7 +39,6 @@ class DevUtilitiesController < ApplicationController end def set_profile_photo - render :nothing => true album = Album.create(:person => current_user.person, :name => "Profile Photos") current_user.raw_visible_posts << album @@ -53,7 +47,7 @@ class DevUtilitiesController < ApplicationController backer_number = YAML.load_file(Rails.root.join('config','backer_number.yml'))[:seed_number].to_i username = backer_info[backer_number]['username'].gsub(/ /,'').downcase - @fixture_name = File.dirname(__FILE__) + "/../../public/images/user/#{username}.jpg" + @fixture_name = File.join(File.dirname(__FILE__), "..", "..", "public", "images", "user", "#{username}.jpg") photo = Photo.new(:person => current_user.person, :album => album) photo.image.store! File.open(@fixture_name) @@ -73,4 +67,11 @@ class DevUtilitiesController < ApplicationController render "shared/log" end + + protected + + def backer_info + config = YAML.load_file(File.join(File.dirname(__FILE__), "..", "..", "config", "deploy_config.yml")) + config['servers']['backer'] + end end diff --git a/db/seeds.rb b/db/seeds.rb index a21966266..5b87469ca 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -12,5 +12,5 @@ # cities = City.create([{ :name => 'Chicago' }, { :name => 'Copenhagen' }]) # Mayor.create(:name => 'Daley', :city => citie -require File.dirname(__FILE__) + '/../../config/environment' +require File.join(File.dirname(__FILE__), "..", "..", "config", "environment") diff --git a/db/seeds/backer.rb b/db/seeds/backer.rb index b80fd794b..22c81778d 100644 --- a/db/seeds/backer.rb +++ b/db/seeds/backer.rb @@ -12,12 +12,12 @@ # cities = City.create([{ :name => 'Chicago' }, { :name => 'Copenhagen' }]) # Mayor.create(:name => 'Daley', :city => citie -require File.dirname(__FILE__) + '/../../config/environment' +require File.join(File.dirname(__FILE__), "..", "..", "config", "environment") def create - config = YAML.load_file(File.dirname(__FILE__) + '/../../config/deploy_config.yml') + config = YAML.load_file(File.join(File.dirname(__FILE__), "..", "..", "config", "deploy_config.yml")) backer_info = config['servers']['backer'] backer_number = YAML.load_file(Rails.root.join('config','backer_number.yml'))[:seed_number].to_i @@ -25,7 +25,7 @@ def create #set pod url username = backer_info[backer_number]['username'].gsub(/ /,'').downcase set_app_config username - require File.dirname(__FILE__) + '/../../config/initializers/_load_app_config.rb' + require File.join(File.dirname(__FILE__), "..", "..", "config", "initializers", "_load_app_config.rb") # Create seed user user = User.instantiate!(:email => "#{username}@#{username}.joindiaspora.com", diff --git a/db/seeds/dev.rb b/db/seeds/dev.rb index dcbca72aa..375f5221f 100644 --- a/db/seeds/dev.rb +++ b/db/seeds/dev.rb @@ -4,7 +4,7 @@ -require File.dirname(__FILE__) + '/../../config/environment' +require File.join(File.dirname(__FILE__), "..", "..", "config", "environment") def set_app_config username current_config = YAML.load(File.read(Rails.root.join('config', 'app_config.yml.example'))) diff --git a/db/seeds/tom.rb b/db/seeds/tom.rb index 468667485..b54fedcc0 100644 --- a/db/seeds/tom.rb +++ b/db/seeds/tom.rb @@ -3,8 +3,7 @@ # the COPYRIGHT file. - -require File.dirname(__FILE__) + '/../../config/environment' +require File.join(File.dirname(__FILE__), "..", "..", "config", "environment") def set_app_config username current_config = YAML.load(File.read(Rails.root.join('config', 'app_config.yml.example'))) diff --git a/spec/controllers/dev_utilities_controller_spec.rb b/spec/controllers/dev_utilities_controller_spec.rb new file mode 100644 index 000000000..66c07350f --- /dev/null +++ b/spec/controllers/dev_utilities_controller_spec.rb @@ -0,0 +1,42 @@ +# Copyright (c) 2010, Diaspora Inc. This file is +# licensed under the Affero General Public License version 3. See +# the COPYRIGHT file. + +require File.join(File.dirname(__FILE__), "..", "spec_helper") + +describe DevUtilitiesController do + render_views + + before do + @tom = Factory.create(:user, :email => "tom@tom.joindiaspora.org") + sign_in :user, @tom + end + + describe "#zombiefriends" do + it "succeeds" do + get :zombiefriends + response.should be_success + end + end + + describe "#set_profile_photo" do + # In case anyone wants their config/backer_number.yml to still exist after running specs + before do + @backer_number_file = File.join(File.dirname(__FILE__), "..", "..", "config", "backer_number.yml") + @temp_file = File.join(File.dirname(__FILE__), "..", "..", "config", "backer_number.yml-tmp") + FileUtils.mv(@backer_number_file, @temp_file, :force => true) + end + after do + if File.exists?(@temp_file) + FileUtils.mv(@temp_file, @backer_number_file, :force => true) + else + FileUtils.rm_rf(@backer_number_file) + end + end + it "succeeds" do + get :set_backer_number, 'number' => '3' + get :set_profile_photo + response.should be_success + end + end +end From 356a1e46b26aa64cf1667d392f8ac573eccfd9e8 Mon Sep 17 00:00:00 2001 From: Uiri Date: Sat, 25 Sep 2010 09:50:29 -0400 Subject: [PATCH 289/449] it is fixed, I think --- script/server | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/server b/script/server index 3804ccad9..f1e5b7ec5 100755 --- a/script/server +++ b/script/server @@ -8,6 +8,6 @@ then else mkdir -p -v log/thin/ bundle exec ruby ./script/websocket_server.rb& - bundle exec thin start $@ + bundle exec thin -p 80 -a 192.168.0.191 start $@ fi From 5a4f40591dc26b4336ebce8d3ed705a3bc06a6c7 Mon Sep 17 00:00:00 2001 From: Tiago Bastos Date: Sat, 25 Sep 2010 11:25:45 -0300 Subject: [PATCH 290/449] Added missing translations. --- config/locales/diaspora/pt-BR.yml | 64 ++++++++++++++++++++++++++++++- 1 file changed, 63 insertions(+), 1 deletion(-) diff --git a/config/locales/diaspora/pt-BR.yml b/config/locales/diaspora/pt-BR.yml index 10425864b..f7f16366e 100644 --- a/config/locales/diaspora/pt-BR.yml +++ b/config/locales/diaspora/pt-BR.yml @@ -8,6 +8,21 @@ pt-BR: hello: "Olá mundo" + application: + helper: + unknown_person: "pessoa desconhecida" + new_requests: "nova requisição" + dashboards: + helper: + home: "casa" + error_messages: + helper: + invalid_fields: "Campos inválidos" + correct_the_following_errors_and_try_again: "Corrija os erros a seguir e tente novamente." + people: + helper: + results_for: " resultados para %{params}" + people_on_pod_are_aware_of: " pessoas no pod estão conscientes de" layouts: application: edit_profile: "editar perfil" @@ -51,6 +66,9 @@ pt-BR: failure: "Erro ao editar o álbum %{name}." destroy: success: "O álbum %{name} foi excluído com sucesso." + helper: + friends_albums: "Álbum de amigos" + your_albums: "Seus álbuns" aspects: index: photos: "photos" @@ -68,12 +86,25 @@ pt-BR: create: "Criar" create: success:"Clique no mais(+) do lado esquerdo para dizer ao Diaspora quem pode ver seu novo aspecto." + destroy: + success: "%{name} foi removido com sucesso." + update: + success: "Seu aspecto, %{name}, foi editado com sucesso." + move_friends: + failure: "Falha ao editar aspecto para o amigo(a) %{real_name}." + success: "Aspectos editados com sucesso." + move_friend: + failure: "não funcionou %{inspect}" + success: "Você está agora mostrando um diferente aspecto seu a um amigo(a)." + helper: + remove: "remover" + aspect_not_empty: "Aspecto não está vazio" users: edit: cancel: "Cancelar" update_profile: "Atualizar Perfil" home: "Home" - diaspora_username: "USUÁRIO DIASPORA" + diaspora_username: "NOME DE USUÁRIO DIASPORA" info: "Informações" picture: "Imagem" editing_profile: "Editando perfil" @@ -105,9 +136,20 @@ pt-BR: new_photo: "Nova Foto" back_to_list: "Voltar para a Lista" post_it: "enviar!" + create: + runtime_error: "Envio de foto falhou. Você tem tem certeza que seu sinto de segurança está preso?" + integrity_error: "Envio de foto falhou. Você tem certeza que é uma imagem?" + type_error: "Envio de foto falhou. Você tem certeza que adicionou uma imagem?" + update: + notice: "Foto enviada com sucesso." + error: "Falha ao editar foto." + destroy: + notice: "Foto removida." registrations: new: sign_up: "Cadastro" + create: + success: "Vocé entrou na Diaspora!" status_messages: new_status_message: tell_me_something_good: "diga-me qualquer coisa legal" @@ -124,7 +166,12 @@ pt-BR: view_all: "Exibir Todas" message: "Mensagem" owner: "Pertence a" + helper: + no_message_to_display: "Nenhuma mensagem para ser mostrada." people: + person: + add_friend: "adicionar amigo(a)" + pending_request: "requisições pendentes" index: add_friend: "adicionar amigo(a)" real_name: "nome real" @@ -141,3 +188,18 @@ pt-BR: save: "salvar" are_you_sure: "Tem certeza?" remove_friend: "excluir amigo" + requests: + new_request: + add_a_new_friend_to: "Adicionar novo amigo(a) em" + enter_a_diaspora_username: "Digite seu nome de usuário Diaspora:" + your_diaspora_username_is: "Seu nome de usuário Diaspora é: %{diaspora_handle}" + friends_username: "Nome de usuário do Amigo(a)" + destroy: + success: "Vocês agora são amigos." + error: "Favor selecionar um aspecto!" + ignore: "Requisições de amigos ignoradas." + create: + error: "Nenhum semente Diaspora encontrado com esse email." + already_friends: "Você já é amigo(a) de %{destination_url}!" + success: "Uma requisição de amizade foi enviada para %{destination_url}." + horribly_wrong: "Algo horrível aconteceu." From 4cfc7e2f89733d8010b04c526bf2eb7dc0752c79 Mon Sep 17 00:00:00 2001 From: Stephen Caudill Date: Sat, 25 Sep 2010 11:03:12 -0400 Subject: [PATCH 291/449] Add description for retab task --- lib/tasks/whitespace.rake | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/tasks/whitespace.rake b/lib/tasks/whitespace.rake index 397674ae5..e3d26c3ab 100644 --- a/lib/tasks/whitespace.rake +++ b/lib/tasks/whitespace.rake @@ -3,6 +3,7 @@ namespace :whitespace do task :cleanup do sh %{find . -name '*.rb' -exec sed -i '' 's/ *$//g' {} \\;} end + desc 'Converts hard-tabs into two-space soft-tabs' task :retab do sh %{find . -name '*.rb' -exec sed -i '' 's/\t/ /g' {} \\;} end From 821643deb9f5c648f2d33d9a3c3ff5613bcd9320 Mon Sep 17 00:00:00 2001 From: Stephen Caudill Date: Sat, 25 Sep 2010 11:27:59 -0400 Subject: [PATCH 292/449] Use the new style of spec_helper require --- spec/controllers/albums_controller_spec.rb | 2 +- spec/controllers/aspects_controller_spec.rb | 2 +- spec/controllers/people_controller_spec.rb | 2 +- spec/controllers/publics_controller_spec.rb | 2 +- spec/controllers/requests_controller_spec.rb | 2 +- spec/controllers/sockets_controller_spec.rb | 2 +- spec/helpers/application_helper_spec.rb | 2 +- spec/helpers/publics_helper_spec.rb | 2 +- spec/helpers/requests_helper_spec.rb | 2 +- spec/lib/diaspora_parser_spec.rb | 2 +- spec/lib/hcard_spec.rb | 2 +- spec/lib/message_handler_spec.rb | 2 +- spec/lib/salmon_salmon_spec.rb | 2 +- spec/lib/web_hooks_spec.rb | 2 +- spec/lib/websocket_spec.rb | 2 +- spec/misc_spec.rb | 2 +- spec/models/aspect_spec.rb | 2 +- spec/models/comments_spec.rb | 2 +- spec/models/person_spec.rb | 2 +- spec/models/photo_spec.rb | 2 +- spec/models/post_spec.rb | 2 +- spec/models/profile_spec.rb | 2 +- spec/models/request_spec.rb | 2 +- spec/models/retraction_spec.rb | 2 +- spec/models/status_message_spec.rb | 2 +- spec/models/user/posting_spec.rb | 2 +- spec/models/user/receive_spec.rb | 2 +- spec/models/user/user_friending_spec.rb | 2 +- spec/models/user/visible_posts_spec.rb | 2 +- spec/models/user_spec.rb | 2 +- spec/user_encryption_spec.rb | 2 +- 31 files changed, 31 insertions(+), 31 deletions(-) diff --git a/spec/controllers/albums_controller_spec.rb b/spec/controllers/albums_controller_spec.rb index e8ea44479..815a0663f 100644 --- a/spec/controllers/albums_controller_spec.rb +++ b/spec/controllers/albums_controller_spec.rb @@ -3,7 +3,7 @@ # the COPYRIGHT file. -require File.dirname(__FILE__) + '/../spec_helper' +require 'spec_helper' include ApplicationHelper describe AlbumsController do render_views diff --git a/spec/controllers/aspects_controller_spec.rb b/spec/controllers/aspects_controller_spec.rb index a186e8b7c..5ce04c56c 100644 --- a/spec/controllers/aspects_controller_spec.rb +++ b/spec/controllers/aspects_controller_spec.rb @@ -4,7 +4,7 @@ -require File.dirname(__FILE__) + '/../spec_helper' +require 'spec_helper' include ApplicationHelper describe AspectsController do render_views diff --git a/spec/controllers/people_controller_spec.rb b/spec/controllers/people_controller_spec.rb index badfdf496..50ee13bb4 100644 --- a/spec/controllers/people_controller_spec.rb +++ b/spec/controllers/people_controller_spec.rb @@ -4,7 +4,7 @@ -require File.dirname(__FILE__) + '/../spec_helper' +require 'spec_helper' describe PeopleController do render_views diff --git a/spec/controllers/publics_controller_spec.rb b/spec/controllers/publics_controller_spec.rb index bea772e20..3e1071f16 100644 --- a/spec/controllers/publics_controller_spec.rb +++ b/spec/controllers/publics_controller_spec.rb @@ -4,7 +4,7 @@ -require File.dirname(__FILE__) + '/../spec_helper' +require 'spec_helper' describe PublicsController do render_views diff --git a/spec/controllers/requests_controller_spec.rb b/spec/controllers/requests_controller_spec.rb index f0864abe1..ebde75a97 100644 --- a/spec/controllers/requests_controller_spec.rb +++ b/spec/controllers/requests_controller_spec.rb @@ -4,7 +4,7 @@ -require File.dirname(__FILE__) + '/../spec_helper' +require 'spec_helper' include ApplicationHelper include RequestsHelper describe RequestsController do diff --git a/spec/controllers/sockets_controller_spec.rb b/spec/controllers/sockets_controller_spec.rb index 799d37500..d83547e98 100644 --- a/spec/controllers/sockets_controller_spec.rb +++ b/spec/controllers/sockets_controller_spec.rb @@ -4,7 +4,7 @@ -require File.dirname(__FILE__) + '/../spec_helper' +require 'spec_helper' SocketsController.class_eval <<-EOT def url_options diff --git a/spec/helpers/application_helper_spec.rb b/spec/helpers/application_helper_spec.rb index 4b89c7b31..4be43a0cb 100644 --- a/spec/helpers/application_helper_spec.rb +++ b/spec/helpers/application_helper_spec.rb @@ -4,7 +4,7 @@ -require File.dirname(__FILE__) + '/../spec_helper' +require 'spec_helper' include ApplicationHelper describe ApplicationHelper do diff --git a/spec/helpers/publics_helper_spec.rb b/spec/helpers/publics_helper_spec.rb index 70e9d4606..ec00f671a 100644 --- a/spec/helpers/publics_helper_spec.rb +++ b/spec/helpers/publics_helper_spec.rb @@ -4,7 +4,7 @@ -require File.dirname(__FILE__) + '/../spec_helper' +require 'spec_helper' include PublicsHelper describe PublicsHelper do diff --git a/spec/helpers/requests_helper_spec.rb b/spec/helpers/requests_helper_spec.rb index 2d2be1acb..50cf148cb 100644 --- a/spec/helpers/requests_helper_spec.rb +++ b/spec/helpers/requests_helper_spec.rb @@ -4,7 +4,7 @@ -require File.dirname(__FILE__) + '/../spec_helper' +require 'spec_helper' include RequestsHelper diff --git a/spec/lib/diaspora_parser_spec.rb b/spec/lib/diaspora_parser_spec.rb index 3f4e20b1e..5c9a17fd5 100644 --- a/spec/lib/diaspora_parser_spec.rb +++ b/spec/lib/diaspora_parser_spec.rb @@ -4,7 +4,7 @@ -require File.dirname(__FILE__) + '/../spec_helper' +require 'spec_helper' include ApplicationHelper include Diaspora::Parser diff --git a/spec/lib/hcard_spec.rb b/spec/lib/hcard_spec.rb index 89ad49924..4836c5468 100644 --- a/spec/lib/hcard_spec.rb +++ b/spec/lib/hcard_spec.rb @@ -4,7 +4,7 @@ -require File.dirname(__FILE__) + '/../spec_helper' +require 'spec_helper' require File.dirname(__FILE__) + '/../../lib/hcard' describe HCard do diff --git a/spec/lib/message_handler_spec.rb b/spec/lib/message_handler_spec.rb index e6cd668e2..d60009fd9 100644 --- a/spec/lib/message_handler_spec.rb +++ b/spec/lib/message_handler_spec.rb @@ -4,7 +4,7 @@ -require File.dirname(__FILE__) + '/../spec_helper' +require 'spec_helper' describe MessageHandler do before do diff --git a/spec/lib/salmon_salmon_spec.rb b/spec/lib/salmon_salmon_spec.rb index a14ef8f77..eb7a55027 100644 --- a/spec/lib/salmon_salmon_spec.rb +++ b/spec/lib/salmon_salmon_spec.rb @@ -4,7 +4,7 @@ -require File.dirname(__FILE__) + '/../spec_helper' +require 'spec_helper' describe Salmon do before do diff --git a/spec/lib/web_hooks_spec.rb b/spec/lib/web_hooks_spec.rb index d3486f1b5..3b0eb26df 100644 --- a/spec/lib/web_hooks_spec.rb +++ b/spec/lib/web_hooks_spec.rb @@ -4,7 +4,7 @@ -require File.dirname(__FILE__) + '/../spec_helper' +require 'spec_helper' include Diaspora diff --git a/spec/lib/websocket_spec.rb b/spec/lib/websocket_spec.rb index edac7051a..0b76e0f52 100644 --- a/spec/lib/websocket_spec.rb +++ b/spec/lib/websocket_spec.rb @@ -2,7 +2,7 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. -require File.dirname(__FILE__) + '/../spec_helper' +require 'spec_helper' describe Diaspora::WebSocket do before do diff --git a/spec/misc_spec.rb b/spec/misc_spec.rb index d03300211..528782f07 100644 --- a/spec/misc_spec.rb +++ b/spec/misc_spec.rb @@ -4,7 +4,7 @@ -require File.dirname(__FILE__) + '/spec_helper' +require 'spec_helper' describe 'making sure the spec runner works' do diff --git a/spec/models/aspect_spec.rb b/spec/models/aspect_spec.rb index ea5afc7cf..356e8b26c 100644 --- a/spec/models/aspect_spec.rb +++ b/spec/models/aspect_spec.rb @@ -4,7 +4,7 @@ -require File.dirname(__FILE__) + '/../spec_helper' +require 'spec_helper' describe Aspect do before do diff --git a/spec/models/comments_spec.rb b/spec/models/comments_spec.rb index 1c20354cf..9d8c7314d 100644 --- a/spec/models/comments_spec.rb +++ b/spec/models/comments_spec.rb @@ -4,7 +4,7 @@ -require File.dirname(__FILE__) + '/../spec_helper' +require 'spec_helper' describe Comment do describe "user" do diff --git a/spec/models/person_spec.rb b/spec/models/person_spec.rb index 721310409..f1654b25c 100644 --- a/spec/models/person_spec.rb +++ b/spec/models/person_spec.rb @@ -4,7 +4,7 @@ -require File.dirname(__FILE__) + '/../spec_helper' +require 'spec_helper' describe Person do before do diff --git a/spec/models/photo_spec.rb b/spec/models/photo_spec.rb index 3e0b68520..179ed1ccd 100644 --- a/spec/models/photo_spec.rb +++ b/spec/models/photo_spec.rb @@ -4,7 +4,7 @@ -require File.dirname(__FILE__) + '/../spec_helper' +require 'spec_helper' describe Photo do before do diff --git a/spec/models/post_spec.rb b/spec/models/post_spec.rb index dc9d4a9b8..c9a114b32 100644 --- a/spec/models/post_spec.rb +++ b/spec/models/post_spec.rb @@ -4,7 +4,7 @@ -require File.dirname(__FILE__) + '/../spec_helper' +require 'spec_helper' describe Post do before do diff --git a/spec/models/profile_spec.rb b/spec/models/profile_spec.rb index b5bd8f9a5..0681e1e22 100644 --- a/spec/models/profile_spec.rb +++ b/spec/models/profile_spec.rb @@ -4,7 +4,7 @@ -require File.dirname(__FILE__) + '/../spec_helper' +require 'spec_helper' describe Profile do before do diff --git a/spec/models/request_spec.rb b/spec/models/request_spec.rb index 5899cb7fb..e71dc1175 100644 --- a/spec/models/request_spec.rb +++ b/spec/models/request_spec.rb @@ -4,7 +4,7 @@ -require File.dirname(__FILE__) + '/../spec_helper' +require 'spec_helper' describe Request do before do diff --git a/spec/models/retraction_spec.rb b/spec/models/retraction_spec.rb index 9aa2b8a76..ca93c7c0e 100644 --- a/spec/models/retraction_spec.rb +++ b/spec/models/retraction_spec.rb @@ -4,7 +4,7 @@ -require File.dirname(__FILE__) + '/../spec_helper' +require 'spec_helper' describe Retraction do before do diff --git a/spec/models/status_message_spec.rb b/spec/models/status_message_spec.rb index 005038bf1..59cb70ec6 100644 --- a/spec/models/status_message_spec.rb +++ b/spec/models/status_message_spec.rb @@ -4,7 +4,7 @@ -require File.dirname(__FILE__) + '/../spec_helper' +require 'spec_helper' describe StatusMessage do before do diff --git a/spec/models/user/posting_spec.rb b/spec/models/user/posting_spec.rb index d307e7a43..73672e2ec 100644 --- a/spec/models/user/posting_spec.rb +++ b/spec/models/user/posting_spec.rb @@ -4,7 +4,7 @@ -require File.dirname(__FILE__) + '/../../spec_helper' +require 'spec_helper' describe User do diff --git a/spec/models/user/receive_spec.rb b/spec/models/user/receive_spec.rb index 37648a98c..97bf41197 100644 --- a/spec/models/user/receive_spec.rb +++ b/spec/models/user/receive_spec.rb @@ -4,7 +4,7 @@ -require File.dirname(__FILE__) + '/../../spec_helper' +require 'spec_helper' describe User do diff --git a/spec/models/user/user_friending_spec.rb b/spec/models/user/user_friending_spec.rb index 67ed9f799..1c0f59465 100644 --- a/spec/models/user/user_friending_spec.rb +++ b/spec/models/user/user_friending_spec.rb @@ -4,7 +4,7 @@ -require File.dirname(__FILE__) + '/../../spec_helper' +require 'spec_helper' describe User do before do diff --git a/spec/models/user/visible_posts_spec.rb b/spec/models/user/visible_posts_spec.rb index bcab473bc..0a2a53d84 100644 --- a/spec/models/user/visible_posts_spec.rb +++ b/spec/models/user/visible_posts_spec.rb @@ -4,7 +4,7 @@ -require File.dirname(__FILE__) + '/../../spec_helper' +require 'spec_helper' describe User do let(:user) { Factory(:user) } diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index 1608bbe58..5478d69fe 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -4,7 +4,7 @@ -require File.dirname(__FILE__) + '/../spec_helper' +require 'spec_helper' describe User do let(:user) { Factory(:user) } diff --git a/spec/user_encryption_spec.rb b/spec/user_encryption_spec.rb index 33b86d52c..4c829bcd0 100644 --- a/spec/user_encryption_spec.rb +++ b/spec/user_encryption_spec.rb @@ -4,7 +4,7 @@ -require File.dirname(__FILE__) + '/spec_helper' +require 'spec_helper' include ApplicationHelper include Diaspora::Parser From 536cea5e44ccafffc06d9cf887ac703f49db15f3 Mon Sep 17 00:00:00 2001 From: Stephen Caudill Date: Sat, 25 Sep 2010 12:06:39 -0400 Subject: [PATCH 293/449] Remove consecutive empty lines --- app/controllers/application_controller.rb | 1 - app/controllers/aspects_controller.rb | 1 - app/controllers/comments_controller.rb | 1 - app/controllers/dev_utilities_controller.rb | 2 -- app/controllers/people_controller.rb | 1 - app/controllers/photos_controller.rb | 4 ---- app/controllers/publics_controller.rb | 1 - app/controllers/requests_controller.rb | 3 --- app/controllers/sockets_controller.rb | 1 - app/controllers/status_messages_controller.rb | 1 - app/controllers/users_controller.rb | 1 - app/helpers/albums_helper.rb | 1 - app/helpers/application_helper.rb | 1 - app/helpers/aspects_helper.rb | 1 - app/helpers/dashboards_helper.rb | 1 - app/helpers/error_messages_helper.rb | 1 - app/helpers/layout_helper.rb | 1 - app/helpers/people_helper.rb | 1 - app/helpers/photos_helper.rb | 1 - app/helpers/publics_helper.rb | 1 - app/helpers/requests_helper.rb | 1 - app/helpers/sockets_helper.rb | 1 - app/helpers/status_messages_helper.rb | 1 - app/models/album.rb | 2 -- app/models/aspect.rb | 1 - app/models/comment.rb | 2 -- app/models/person.rb | 1 - app/models/photo.rb | 1 - app/models/post.rb | 2 -- app/models/profile.rb | 1 - app/models/request.rb | 1 - app/models/retraction.rb | 1 - app/models/status_message.rb | 2 -- app/models/user.rb | 3 --- app/uploaders/image_uploader.rb | 1 - autotest/discover.rb | 1 - config/application.rb | 2 -- config/boot.rb | 2 -- config/deploy.rb | 4 ---- config/environment.rb | 3 --- config/environments/development.rb | 1 - config/environments/production.rb | 1 - config/environments/test.rb | 3 --- config/initializers/backtrace_silencers.rb | 1 - config/initializers/carrierwave.rb | 1 - config/initializers/devise.rb | 1 - config/initializers/git_info.rb | 1 - config/initializers/inflections.rb | 1 - config/initializers/locale.rb | 3 +-- config/initializers/logging.rb | 1 - config/initializers/mime_types.rb | 1 - config/initializers/rspec_generator.rb | 1 - config/initializers/secret_token.rb | 1 - config/initializers/session_store.rb | 1 - config/routes.rb | 3 --- config/sprinkle/packages/database.rb | 2 -- config/sprinkle/packages/essential.rb | 2 -- config/sprinkle/packages/ruby.rb | 2 -- config/sprinkle/packages/scm.rb | 2 -- config/sprinkle/packages/server.rb | 2 -- config/sprinkle/packages/unfortunately_essential.rb | 2 -- config/sprinkle/provision.rb | 5 ----- db/schema.rb | 2 -- db/seeds.rb | 2 -- db/seeds/backer.rb | 3 --- db/seeds/dev.rb | 2 -- db/seeds/tom.rb | 4 ---- lib/chrome_frame.rb | 2 -- lib/diaspora.rb | 2 -- lib/diaspora/parser.rb | 2 -- lib/diaspora/user/friending.rb | 3 --- lib/diaspora/user/querying.rb | 2 -- lib/diaspora/webhooks.rb | 2 -- lib/diaspora/websocket.rb | 2 -- lib/encryptable.rb | 2 -- lib/encryptor.rb | 3 --- lib/hcard.rb | 2 -- lib/message_handler.rb | 3 --- lib/mongo_mapper/bson_id.rb | 2 -- lib/mongo_mapper/clear_dev_memory.rb | 2 -- lib/salmon/salmon.rb | 9 --------- spec/controllers/albums_controller_spec.rb | 1 - spec/controllers/aspects_controller_spec.rb | 2 -- spec/controllers/people_controller_spec.rb | 2 -- spec/controllers/publics_controller_spec.rb | 2 -- spec/controllers/requests_controller_spec.rb | 2 -- spec/controllers/sockets_controller_spec.rb | 2 -- spec/factories.rb | 3 --- spec/helpers/application_helper_spec.rb | 3 --- spec/helpers/publics_helper_spec.rb | 2 -- spec/helpers/requests_helper_spec.rb | 2 -- spec/lib/diaspora_parser_spec.rb | 7 ------- spec/lib/hcard_spec.rb | 2 -- spec/lib/message_handler_spec.rb | 4 ---- spec/lib/salmon_salmon_spec.rb | 3 --- spec/lib/web_hooks_spec.rb | 2 -- spec/misc_spec.rb | 2 -- spec/models/aspect_spec.rb | 2 -- spec/models/comments_spec.rb | 2 -- spec/models/person_spec.rb | 4 +--- spec/models/photo_spec.rb | 3 --- spec/models/post_spec.rb | 2 -- spec/models/profile_spec.rb | 3 --- spec/models/request_spec.rb | 2 -- spec/models/retraction_spec.rb | 2 -- spec/models/status_message_spec.rb | 3 --- spec/models/user/posting_spec.rb | 2 -- spec/models/user/receive_spec.rb | 2 -- spec/models/user/user_friending_spec.rb | 8 -------- spec/models/user/visible_posts_spec.rb | 3 --- spec/models/user_spec.rb | 2 -- spec/spec_helper.rb | 4 ---- spec/user_encryption_spec.rb | 2 -- test/performance/browsing_test.rb | 2 -- test/selenium/login_test.rb | 2 -- test/selenium/selenium_suite.rb | 2 -- test/test_helper.rb | 2 -- 117 files changed, 2 insertions(+), 241 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index f0ca5bfc8..a39d827e4 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - class ApplicationController < ActionController::Base protect_from_forgery :except => :receive diff --git a/app/controllers/aspects_controller.rb b/app/controllers/aspects_controller.rb index 2bf1edb76..ba9d3ffd9 100644 --- a/app/controllers/aspects_controller.rb +++ b/app/controllers/aspects_controller.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - class AspectsController < ApplicationController before_filter :authenticate_user! diff --git a/app/controllers/comments_controller.rb b/app/controllers/comments_controller.rb index fe11cb8ae..d1efc3e10 100644 --- a/app/controllers/comments_controller.rb +++ b/app/controllers/comments_controller.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - class CommentsController < ApplicationController before_filter :authenticate_user! diff --git a/app/controllers/dev_utilities_controller.rb b/app/controllers/dev_utilities_controller.rb index 30d1a1799..b2ce5e813 100644 --- a/app/controllers/dev_utilities_controller.rb +++ b/app/controllers/dev_utilities_controller.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - class DevUtilitiesController < ApplicationController before_filter :authenticate_user!, :except => [:set_backer_number] include ApplicationHelper @@ -63,7 +62,6 @@ class DevUtilitiesController < ApplicationController current_user.raw_visible_posts << photo current_user.save - current_user.update_profile(:image_url => photo.url(:thumb_medium)) current_user.save end diff --git a/app/controllers/people_controller.rb b/app/controllers/people_controller.rb index 08acdd424..a8b8fffc0 100644 --- a/app/controllers/people_controller.rb +++ b/app/controllers/people_controller.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - class PeopleController < ApplicationController before_filter :authenticate_user! diff --git a/app/controllers/photos_controller.rb b/app/controllers/photos_controller.rb index 0866751d0..4d865573c 100644 --- a/app/controllers/photos_controller.rb +++ b/app/controllers/photos_controller.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - class PhotosController < ApplicationController before_filter :authenticate_user! @@ -35,12 +34,10 @@ class PhotosController < ApplicationController ############## - params[:user_file] = file data = clean_hash(params) - @photo = current_user.post(:photo, data) respond_to do |format| @@ -103,7 +100,6 @@ class PhotosController < ApplicationController end end - private def clean_hash(params) if params[:photo] diff --git a/app/controllers/publics_controller.rb b/app/controllers/publics_controller.rb index 6be195e30..fcfdb0db6 100644 --- a/app/controllers/publics_controller.rb +++ b/app/controllers/publics_controller.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - class PublicsController < ApplicationController require File.expand_path('../../../lib/diaspora/parser', __FILE__) include Diaspora::Parser diff --git a/app/controllers/requests_controller.rb b/app/controllers/requests_controller.rb index 44e1a8016..31c6e6efd 100644 --- a/app/controllers/requests_controller.rb +++ b/app/controllers/requests_controller.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - class RequestsController < ApplicationController before_filter :authenticate_user! include RequestsHelper @@ -42,8 +41,6 @@ class RequestsController < ApplicationController return end - - # rel_hash = {:friend => params[:friend_handle]} Rails.logger.debug("Sending request: #{rel_hash}") diff --git a/app/controllers/sockets_controller.rb b/app/controllers/sockets_controller.rb index 9b90ea831..88d8e6b40 100644 --- a/app/controllers/sockets_controller.rb +++ b/app/controllers/sockets_controller.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - class SocketsController < ApplicationController include ApplicationHelper include SocketsHelper diff --git a/app/controllers/status_messages_controller.rb b/app/controllers/status_messages_controller.rb index 5a8efbe06..ef519a1a4 100644 --- a/app/controllers/status_messages_controller.rb +++ b/app/controllers/status_messages_controller.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - class StatusMessagesController < ApplicationController before_filter :authenticate_user! diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 819a88d28..260b5b7fa 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - class UsersController < ApplicationController before_filter :authenticate_user!, :except => [:new, :create] diff --git a/app/helpers/albums_helper.rb b/app/helpers/albums_helper.rb index 9a1e78fd1..6d85c747c 100644 --- a/app/helpers/albums_helper.rb +++ b/app/helpers/albums_helper.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - module AlbumsHelper def friends_albums_link if params[:friends] diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 89df26155..688ddb10b 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - module ApplicationHelper def current_aspect?(aspect) !@aspect.is_a?(Symbol) && @aspect.id == aspect.id diff --git a/app/helpers/aspects_helper.rb b/app/helpers/aspects_helper.rb index 536bb8b0b..66baffca2 100644 --- a/app/helpers/aspects_helper.rb +++ b/app/helpers/aspects_helper.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - module AspectsHelper def link_for_aspect( aspect ) link_to aspect.name, aspect diff --git a/app/helpers/dashboards_helper.rb b/app/helpers/dashboards_helper.rb index 271b68253..e8a9d8f71 100644 --- a/app/helpers/dashboards_helper.rb +++ b/app/helpers/dashboards_helper.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - module DashboardsHelper def title_for_page I18n.t('dashboards.helper.home') diff --git a/app/helpers/error_messages_helper.rb b/app/helpers/error_messages_helper.rb index 274d60edf..9a64dca36 100644 --- a/app/helpers/error_messages_helper.rb +++ b/app/helpers/error_messages_helper.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - module ErrorMessagesHelper # Render error messages for the given objects. The :message and :header_message options are allowed. def error_messages_for(*objects) diff --git a/app/helpers/layout_helper.rb b/app/helpers/layout_helper.rb index 2398771a3..e33556c35 100644 --- a/app/helpers/layout_helper.rb +++ b/app/helpers/layout_helper.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - # These helper methods can be called in your template to set variables to be used in the layout # This module should be included in all views globally, # to do so you may need to add this line to your ApplicationController diff --git a/app/helpers/people_helper.rb b/app/helpers/people_helper.rb index 90ffb517d..f1fa6487f 100644 --- a/app/helpers/people_helper.rb +++ b/app/helpers/people_helper.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - module PeopleHelper def search_or_index diff --git a/app/helpers/photos_helper.rb b/app/helpers/photos_helper.rb index 2737d3a2d..1f52daa0c 100644 --- a/app/helpers/photos_helper.rb +++ b/app/helpers/photos_helper.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - module PhotosHelper def linked_scaled_photo(photo, album) link_to (image_tag photo.url(:scaled_full)), photo_path(album.next_photo(photo)), :rel => "prefetch" diff --git a/app/helpers/publics_helper.rb b/app/helpers/publics_helper.rb index 46e778e2b..f14fad7a6 100644 --- a/app/helpers/publics_helper.rb +++ b/app/helpers/publics_helper.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - module PublicsHelper def subscribe(opts = {}) subscriber = Subscriber.first(:url => opts[:callback], :topic => opts[:topic]) diff --git a/app/helpers/requests_helper.rb b/app/helpers/requests_helper.rb index fec093aac..98ccc8f75 100644 --- a/app/helpers/requests_helper.rb +++ b/app/helpers/requests_helper.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - module RequestsHelper def subscription_mode(profile) if diaspora?(profile) diff --git a/app/helpers/sockets_helper.rb b/app/helpers/sockets_helper.rb index 69135092a..892e15f59 100644 --- a/app/helpers/sockets_helper.rb +++ b/app/helpers/sockets_helper.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - module SocketsHelper include ApplicationHelper diff --git a/app/helpers/status_messages_helper.rb b/app/helpers/status_messages_helper.rb index 7c1322762..08461b635 100644 --- a/app/helpers/status_messages_helper.rb +++ b/app/helpers/status_messages_helper.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - module StatusMessagesHelper def my_latest_message unless @latest_status_message.nil? diff --git a/app/models/album.rb b/app/models/album.rb index 10737bdfa..f62cbdb79 100644 --- a/app/models/album.rb +++ b/app/models/album.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - class Album < Post xml_reader :name @@ -17,7 +16,6 @@ class Album < Post before_destroy :destroy_photos - def self.mine_or_friends(friend_param, current_user) friend_param ? Album.find_all_by_person_id(current_user.friend_ids) : current_user.person.albums end diff --git a/app/models/aspect.rb b/app/models/aspect.rb index b60142671..10f7aba14 100644 --- a/app/models/aspect.rb +++ b/app/models/aspect.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - class Aspect include MongoMapper::Document diff --git a/app/models/comment.rb b/app/models/comment.rb index 3fa986503..4bf0dbd5e 100644 --- a/app/models/comment.rb +++ b/app/models/comment.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - class Comment include MongoMapper::Document include ROXML @@ -19,7 +18,6 @@ class Comment key :post_id, ObjectId key :person_id, ObjectId - belongs_to :post, :class_name => "Post" belongs_to :person, :class_name => "Person" diff --git a/app/models/person.rb b/app/models/person.rb index a94f4106c..38a55db2b 100644 --- a/app/models/person.rb +++ b/app/models/person.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - require File.expand_path('../../../lib/hcard', __FILE__) class Person diff --git a/app/models/photo.rb b/app/models/photo.rb index fbab51ea5..15d105739 100644 --- a/app/models/photo.rb +++ b/app/models/photo.rb @@ -73,4 +73,3 @@ class Photo < Post end end - diff --git a/app/models/post.rb b/app/models/post.rb index 431d1c7e0..983d0e68f 100644 --- a/app/models/post.rb +++ b/app/models/post.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - class Post require File.expand_path('../../../lib/encryptable', __FILE__) require File.expand_path('../../../lib/diaspora/websocket', __FILE__) @@ -33,7 +32,6 @@ class Post self.create params.to_hash end - def as_json(opts={}) { :post => { diff --git a/app/models/profile.rb b/app/models/profile.rb index 2bb54028a..2b8303bd1 100644 --- a/app/models/profile.rb +++ b/app/models/profile.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - class Profile include MongoMapper::EmbeddedDocument require File.expand_path('../../../lib/diaspora/webhooks', __FILE__) diff --git a/app/models/request.rb b/app/models/request.rb index bf9dd8721..5ba4769a2 100644 --- a/app/models/request.rb +++ b/app/models/request.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - class Request require File.expand_path('../../../lib/diaspora/webhooks', __FILE__) include MongoMapper::Document diff --git a/app/models/retraction.rb b/app/models/retraction.rb index 9c1f13f45..20f74bf29 100644 --- a/app/models/retraction.rb +++ b/app/models/retraction.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - class Retraction include ROXML include Diaspora::Webhooks diff --git a/app/models/status_message.rb b/app/models/status_message.rb index f75536205..c616efc5e 100644 --- a/app/models/status_message.rb +++ b/app/models/status_message.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - class StatusMessage < Post xml_name :status_message @@ -11,7 +10,6 @@ class StatusMessage < Post key :message, String validates_presence_of :message - def to_activity <<-XML diff --git a/app/models/user.rb b/app/models/user.rb index 272f404bc..ade7b7a2a 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -71,7 +71,6 @@ class User end end - def move_friend( opts = {}) return true if opts[:to] == opts[:from] friend = Person.first(:_id => opts[:friend_id]) @@ -107,7 +106,6 @@ class User intitial_post(class_name, aspect_ids, options) end - def intitial_post(class_name, aspect_ids, options = {}) post = build_post(class_name, options) post.socket_to_uid(id, :aspect_ids => aspect_ids) if post.respond_to?(:socket_to_uid) @@ -270,7 +268,6 @@ class User username.downcase! if username end - def as_json(opts={}) { :user => { diff --git a/app/uploaders/image_uploader.rb b/app/uploaders/image_uploader.rb index 6e5312341..58399c90d 100644 --- a/app/uploaders/image_uploader.rb +++ b/app/uploaders/image_uploader.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - class ImageUploader < CarrierWave::Uploader::Base include CarrierWave::MiniMagick diff --git a/autotest/discover.rb b/autotest/discover.rb index 99ab1f6e4..76b9d2044 100644 --- a/autotest/discover.rb +++ b/autotest/discover.rb @@ -2,6 +2,5 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - Autotest.add_discovery { "rails" } Autotest.add_discovery { "rspec2" } diff --git a/config/application.rb b/config/application.rb index 79302a289..59b82e216 100644 --- a/config/application.rb +++ b/config/application.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - require File.expand_path('../boot', __FILE__) require 'action_controller/railtie' diff --git a/config/boot.rb b/config/boot.rb index faeac6742..0d0c42268 100644 --- a/config/boot.rb +++ b/config/boot.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - require 'rubygems' # Set up gems listed in the Gemfile. diff --git a/config/deploy.rb b/config/deploy.rb index 2f8065134..ab240e18c 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - config = YAML.load_file(File.dirname(__FILE__) + '/deploy_config.yml') all = config['cross_server'] @@ -108,7 +106,6 @@ namespace :deploy do run 'gem install bundler' end - task :migrate do end end @@ -152,7 +149,6 @@ namespace :db do tom_seed end - end after "deploy:symlink", "deploy:symlink_images", "deploy:symlink_bundle", 'deploy:symlink_config' diff --git a/config/environment.rb b/config/environment.rb index 385a96651..5bde8792b 100644 --- a/config/environment.rb +++ b/config/environment.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - # Load the rails application require File.expand_path('../application', __FILE__) Haml::Template.options[:format] = :html5 @@ -11,4 +9,3 @@ Haml::Template.options[:escape_html] = true # Initialize the rails application Diaspora::Application.initialize! - diff --git a/config/environments/development.rb b/config/environments/development.rb index 44ba8e55e..15d1fc2bb 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - require File.expand_path('../../../lib/mongo_mapper/clear_dev_memory', __FILE__) Diaspora::Application.configure do # Settings specified here will take precedence over those in config/environment.rb diff --git a/config/environments/production.rb b/config/environments/production.rb index 3207c627d..358e6e092 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - Diaspora::Application.configure do # Settings specified here will take precedence over those in config/environment.rb diff --git a/config/environments/test.rb b/config/environments/test.rb index 4e17d81e8..46b44db55 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - Diaspora::Application.configure do # Settings specified here will take precedence over those in config/environment.rb @@ -32,13 +31,11 @@ Diaspora::Application.configure do config.active_support.deprecation = :stderr config.threadsafe! - # Use SQL instead of Active Record's schema dumper when creating the test database. # This is necessary if your schema can't be completely dumped by the schema dumper, # like if you have constraints or database-specific column types # config.active_record.schema_format = :sql - begin require 'database_cleaner' DatabaseCleaner.strategy = :truncation diff --git a/config/initializers/backtrace_silencers.rb b/config/initializers/backtrace_silencers.rb index d456f8c8b..1efed86e9 100644 --- a/config/initializers/backtrace_silencers.rb +++ b/config/initializers/backtrace_silencers.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - # Be sure to restart your server when you modify this file. # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces. diff --git a/config/initializers/carrierwave.rb b/config/initializers/carrierwave.rb index 6dea937e9..b28f1be66 100644 --- a/config/initializers/carrierwave.rb +++ b/config/initializers/carrierwave.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - CarrierWave.configure do |config| config.storage = :file end diff --git a/config/initializers/devise.rb b/config/initializers/devise.rb index 9f483a8bf..a02045546 100644 --- a/config/initializers/devise.rb +++ b/config/initializers/devise.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - # Use this hook to configure devise mailer, warden hooks and so forth. The first # four configuration values can also be set straight in your models. Devise.setup do |config| diff --git a/config/initializers/git_info.rb b/config/initializers/git_info.rb index ac2e4ba27..82fc99143 100644 --- a/config/initializers/git_info.rb +++ b/config/initializers/git_info.rb @@ -2,5 +2,4 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - GIT_INFO = `git show --name-only` diff --git a/config/initializers/inflections.rb b/config/initializers/inflections.rb index 3171994ee..0e4097c04 100644 --- a/config/initializers/inflections.rb +++ b/config/initializers/inflections.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - # Be sure to restart your server when you modify this file. # Add new inflection rules using the following format diff --git a/config/initializers/locale.rb b/config/initializers/locale.rb index dd607a273..823179842 100644 --- a/config/initializers/locale.rb +++ b/config/initializers/locale.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded. I18n.load_path += Dir[Rails.root.join('config', 'locales', '**', '*.{rb,yml}')] -I18n.default_locale = :en \ No newline at end of file +I18n.default_locale = :en diff --git a/config/initializers/logging.rb b/config/initializers/logging.rb index 86abdbea3..48cc2fa30 100644 --- a/config/initializers/logging.rb +++ b/config/initializers/logging.rb @@ -2,6 +2,5 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - Rails.logger = Logger.new( Rails.root.join("log",Rails.env + ".log"),3,5*1024*1024) diff --git a/config/initializers/mime_types.rb b/config/initializers/mime_types.rb index a5a89433a..77424db27 100644 --- a/config/initializers/mime_types.rb +++ b/config/initializers/mime_types.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - # Be sure to restart your server when you modify this file. # Add new mime types for use in respond_to blocks: diff --git a/config/initializers/rspec_generator.rb b/config/initializers/rspec_generator.rb index caf2be23a..bdec44a03 100644 --- a/config/initializers/rspec_generator.rb +++ b/config/initializers/rspec_generator.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - Diaspora::Application.configure do config.generators do |g| g.integration_tool :rspec diff --git a/config/initializers/secret_token.rb b/config/initializers/secret_token.rb index c61c96d33..20f6087bf 100644 --- a/config/initializers/secret_token.rb +++ b/config/initializers/secret_token.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - # Be sure to restart your server when you modify this file. # Your secret key for verifying the integrity of signed cookies. diff --git a/config/initializers/session_store.rb b/config/initializers/session_store.rb index de79a36eb..f4e36ea89 100644 --- a/config/initializers/session_store.rb +++ b/config/initializers/session_store.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - # Be sure to restart your server when you modify this file. Rails.application.config.session_store :cookie_store, :key => '_diaspora_session' diff --git a/config/routes.rb b/config/routes.rb index 0ac115b76..7f60bd63b 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - Diaspora::Application.routes.draw do resources :people, :only => [:index, :show, :destroy] resources :users, :except => [:create, :new, :show] @@ -18,7 +16,6 @@ Diaspora::Application.routes.draw do match 'aspects/manage', :to => 'aspects#manage' resources :aspects, :except => [:edit] - match 'warzombie', :to => "dev_utilities#warzombie" match 'zombiefriends', :to => "dev_utilities#zombiefriends" match 'zombiefriendaccept', :to => "dev_utilities#zombiefriendaccept" diff --git a/config/sprinkle/packages/database.rb b/config/sprinkle/packages/database.rb index 2463007ff..0c1b1ca50 100644 --- a/config/sprinkle/packages/database.rb +++ b/config/sprinkle/packages/database.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - #package :mongo, :provides => :database do # description 'Mongodb' # version '1.4.3' diff --git a/config/sprinkle/packages/essential.rb b/config/sprinkle/packages/essential.rb index fba076e27..8b4349d06 100644 --- a/config/sprinkle/packages/essential.rb +++ b/config/sprinkle/packages/essential.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - ## Special package, anything that defines a 'source' package means build-essential should be installed for Ubuntu package :build_essential do diff --git a/config/sprinkle/packages/ruby.rb b/config/sprinkle/packages/ruby.rb index 708ab0eeb..261cf3ffe 100644 --- a/config/sprinkle/packages/ruby.rb +++ b/config/sprinkle/packages/ruby.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - ## Defines available packages package :ruby do diff --git a/config/sprinkle/packages/scm.rb b/config/sprinkle/packages/scm.rb index 22ece7d98..981214a60 100644 --- a/config/sprinkle/packages/scm.rb +++ b/config/sprinkle/packages/scm.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - package :git, :provides => :scm do description 'Git Distributed Version Control' apt %w( git-core ) diff --git a/config/sprinkle/packages/server.rb b/config/sprinkle/packages/server.rb index 68e1a12aa..004883dad 100644 --- a/config/sprinkle/packages/server.rb +++ b/config/sprinkle/packages/server.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - package :nginx, :provides=> :webserver do description 'Nginx HTTP server' version '0.7.67' diff --git a/config/sprinkle/packages/unfortunately_essential.rb b/config/sprinkle/packages/unfortunately_essential.rb index d1504bc43..23975f870 100644 --- a/config/sprinkle/packages/unfortunately_essential.rb +++ b/config/sprinkle/packages/unfortunately_essential.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - #Fix dreamhost # diff --git a/config/sprinkle/provision.rb b/config/sprinkle/provision.rb index fc81b1ca3..3e30c26f4 100644 --- a/config/sprinkle/provision.rb +++ b/config/sprinkle/provision.rb @@ -3,10 +3,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - - - require '#{File.dirname(__FILE__)}/packages/essential' require '#{File.dirname(__FILE__)}/packages/database' require '#{File.dirname(__FILE__)}/packages/server' @@ -26,7 +22,6 @@ policy :diaspora, :roles => [:pivots] do requires :nginx_conf end - deployment do # mechanism for deployment diff --git a/db/schema.rb b/db/schema.rb index a4f92eb4b..19e6df260 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - # This file is auto-generated from the current state of the database. Instead of editing this file, # please use the migrations feature of Active Record to incrementally modify your database, and # then regenerate this schema definition. diff --git a/db/seeds.rb b/db/seeds.rb index a21966266..de3015479 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - # This file should contain all the record creation needed to seed the database with its default values. # The data can then be loaded with the rake db:seed (or created alongside the db with db:setup). # diff --git a/db/seeds/backer.rb b/db/seeds/backer.rb index b80fd794b..0851e7894 100644 --- a/db/seeds/backer.rb +++ b/db/seeds/backer.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - # This file should contain all the record creation needed to seed the database with its default values. # The data can then be loaded with the rake db:seed (or created alongside the db with db:setup). # @@ -16,7 +14,6 @@ require File.dirname(__FILE__) + '/../../config/environment' def create - config = YAML.load_file(File.dirname(__FILE__) + '/../../config/deploy_config.yml') backer_info = config['servers']['backer'] diff --git a/db/seeds/dev.rb b/db/seeds/dev.rb index dcbca72aa..8a6cf271f 100644 --- a/db/seeds/dev.rb +++ b/db/seeds/dev.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - require File.dirname(__FILE__) + '/../../config/environment' def set_app_config username diff --git a/db/seeds/tom.rb b/db/seeds/tom.rb index 468667485..1c7f63027 100644 --- a/db/seeds/tom.rb +++ b/db/seeds/tom.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - require File.dirname(__FILE__) + '/../../config/environment' def set_app_config username @@ -19,7 +17,6 @@ end set_app_config "tom" require 'config/initializers/_load_app_config.rb' - # Create seed user user = User.instantiate!( :email => "tom@tom.joindiaspora.com", :username => "tom", @@ -47,4 +44,3 @@ reversed_request = user2.accept_friend_request( request.id, user2.aspect(:name = user.receive reversed_request.to_diaspora_xml user.aspect(:name => "Presidents") - diff --git a/lib/chrome_frame.rb b/lib/chrome_frame.rb index 10ef3dea3..52a4eb459 100644 --- a/lib/chrome_frame.rb +++ b/lib/chrome_frame.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - module Rack class ChromeFrame diff --git a/lib/diaspora.rb b/lib/diaspora.rb index 959d0bb92..e8508b38b 100644 --- a/lib/diaspora.rb +++ b/lib/diaspora.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - module Diaspora autoload :Parser diff --git a/lib/diaspora/parser.rb b/lib/diaspora/parser.rb index 6bc5d4eab..e8e7e8a2b 100644 --- a/lib/diaspora/parser.rb +++ b/lib/diaspora/parser.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - module Diaspora module Parser def self.owner_id_from_xml(xml) diff --git a/lib/diaspora/user/friending.rb b/lib/diaspora/user/friending.rb index f3b30f9b3..35695c546 100644 --- a/lib/diaspora/user/friending.rb +++ b/lib/diaspora/user/friending.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - module Diaspora module UserModules module Friending @@ -29,7 +27,6 @@ module Diaspora request end - def accept_friend_request(friend_request_id, aspect_id) request = Request.find_by_id(friend_request_id) pending_requests.delete(request) diff --git a/lib/diaspora/user/querying.rb b/lib/diaspora/user/querying.rb index bd4174c76..29f119238 100644 --- a/lib/diaspora/user/querying.rb +++ b/lib/diaspora/user/querying.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - module Diaspora module UserModules module Querying diff --git a/lib/diaspora/webhooks.rb b/lib/diaspora/webhooks.rb index 81f7bcfaf..2be45d76a 100644 --- a/lib/diaspora/webhooks.rb +++ b/lib/diaspora/webhooks.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - module Diaspora module Webhooks def self.included(klass) diff --git a/lib/diaspora/websocket.rb b/lib/diaspora/websocket.rb index 687bd2b7c..10e8bc9c8 100644 --- a/lib/diaspora/websocket.rb +++ b/lib/diaspora/websocket.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - module Diaspora module WebSocket def self.queue_to_user(uid, data) diff --git a/lib/encryptable.rb b/lib/encryptable.rb index ba36d6ec3..5b00ca9ea 100644 --- a/lib/encryptable.rb +++ b/lib/encryptable.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - module Encryptable def signable_string raise NotImplementedException("Override this in your encryptable class") diff --git a/lib/encryptor.rb b/lib/encryptor.rb index ed9fbedb1..d90e8bdfe 100644 --- a/lib/encryptor.rb +++ b/lib/encryptor.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - module Encryptor module Public def encrypt cleartext @@ -60,6 +58,5 @@ module Encryptor txt end - end end diff --git a/lib/hcard.rb b/lib/hcard.rb index 7658c5a1d..5640e711b 100644 --- a/lib/hcard.rb +++ b/lib/hcard.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - module HCard def self.find url doc = Nokogiri::HTML(Net::HTTP.get URI.parse(url)) diff --git a/lib/message_handler.rb b/lib/message_handler.rb index 0b55ee0f7..e6ce75ffc 100644 --- a/lib/message_handler.rb +++ b/lib/message_handler.rb @@ -2,11 +2,8 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - class MessageHandler - NUM_TRIES = 3 TIMEOUT = 5 #seconds diff --git a/lib/mongo_mapper/bson_id.rb b/lib/mongo_mapper/bson_id.rb index 4de833a66..328c69a03 100644 --- a/lib/mongo_mapper/bson_id.rb +++ b/lib/mongo_mapper/bson_id.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - class String def to_id BSON::ObjectId self diff --git a/lib/mongo_mapper/clear_dev_memory.rb b/lib/mongo_mapper/clear_dev_memory.rb index 88c7facce..d63084765 100644 --- a/lib/mongo_mapper/clear_dev_memory.rb +++ b/lib/mongo_mapper/clear_dev_memory.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - module MongoMapper class ClearDevMemory def initialize(app) diff --git a/lib/salmon/salmon.rb b/lib/salmon/salmon.rb index 931598691..5d2857196 100644 --- a/lib/salmon/salmon.rb +++ b/lib/salmon/salmon.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - # Add URL safe Base64 support module Base64 module_function @@ -51,8 +49,6 @@ module Salmon sig_doc = doc.search('entry') slap.magic_sig = MagicSigEnvelope.parse sig_doc - - if 'base64url' == slap.magic_sig.encoding slap.data = decode64url(slap.magic_sig.data) slap.sig = slap.magic_sig.sig @@ -98,9 +94,6 @@ ENTRY end end - - - # Decode URL-safe-Base64. This implements def self.decode64url(str) # remove whitespace @@ -128,7 +121,6 @@ ENTRY signature = Base64.urlsafe_decode64(self.magic_sig.sig) signed_data = self.magic_sig.signable_string# Base64.urlsafe_decode64(self.magic_sig.signable_string) - public_key.verify(OpenSSL::Digest::SHA256.new, signature, signed_data ) end @@ -194,7 +186,6 @@ ENTRY env.encoding = env.get_encoding env.alg = env.get_alg - env.sig = Base64.urlsafe_encode64( user.encryption_key.sign OpenSSL::Digest::SHA256.new, env.signable_string ) diff --git a/spec/controllers/albums_controller_spec.rb b/spec/controllers/albums_controller_spec.rb index 815a0663f..b0f939548 100644 --- a/spec/controllers/albums_controller_spec.rb +++ b/spec/controllers/albums_controller_spec.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - require 'spec_helper' include ApplicationHelper describe AlbumsController do diff --git a/spec/controllers/aspects_controller_spec.rb b/spec/controllers/aspects_controller_spec.rb index 5ce04c56c..fdfaa7e45 100644 --- a/spec/controllers/aspects_controller_spec.rb +++ b/spec/controllers/aspects_controller_spec.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - require 'spec_helper' include ApplicationHelper describe AspectsController do diff --git a/spec/controllers/people_controller_spec.rb b/spec/controllers/people_controller_spec.rb index 50ee13bb4..4ce6e3e69 100644 --- a/spec/controllers/people_controller_spec.rb +++ b/spec/controllers/people_controller_spec.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - require 'spec_helper' describe PeopleController do diff --git a/spec/controllers/publics_controller_spec.rb b/spec/controllers/publics_controller_spec.rb index 3e1071f16..70d851a3e 100644 --- a/spec/controllers/publics_controller_spec.rb +++ b/spec/controllers/publics_controller_spec.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - require 'spec_helper' describe PublicsController do diff --git a/spec/controllers/requests_controller_spec.rb b/spec/controllers/requests_controller_spec.rb index ebde75a97..23e0fdea9 100644 --- a/spec/controllers/requests_controller_spec.rb +++ b/spec/controllers/requests_controller_spec.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - require 'spec_helper' include ApplicationHelper include RequestsHelper diff --git a/spec/controllers/sockets_controller_spec.rb b/spec/controllers/sockets_controller_spec.rb index d83547e98..905b1611e 100644 --- a/spec/controllers/sockets_controller_spec.rb +++ b/spec/controllers/sockets_controller_spec.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - require 'spec_helper' SocketsController.class_eval <<-EOT diff --git a/spec/factories.rb b/spec/factories.rb index 21a7ad110..834304e33 100644 --- a/spec/factories.rb +++ b/spec/factories.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - #For Guidance #http://github.com/thoughtbot/factory_girl # http://railscasts.com/episodes/158-factories-not-fixtures @@ -55,7 +53,6 @@ Factory.define :blog do |b| b.sequence(:body) {|n| "jimmy's huge #{n} whales"} end - Factory.define :bookmark do |b| b.link "http://www.yahooligans.com/" end diff --git a/spec/helpers/application_helper_spec.rb b/spec/helpers/application_helper_spec.rb index 4be43a0cb..d894d147e 100644 --- a/spec/helpers/application_helper_spec.rb +++ b/spec/helpers/application_helper_spec.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - require 'spec_helper' include ApplicationHelper @@ -13,7 +11,6 @@ describe ApplicationHelper do @person = Factory.create(:person) end - it "should provide a correct show path for a given person" do person_url(@person).should == "/people/#{@person.id}" end diff --git a/spec/helpers/publics_helper_spec.rb b/spec/helpers/publics_helper_spec.rb index ec00f671a..c58247321 100644 --- a/spec/helpers/publics_helper_spec.rb +++ b/spec/helpers/publics_helper_spec.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - require 'spec_helper' include PublicsHelper diff --git a/spec/helpers/requests_helper_spec.rb b/spec/helpers/requests_helper_spec.rb index 50cf148cb..984a56ea4 100644 --- a/spec/helpers/requests_helper_spec.rb +++ b/spec/helpers/requests_helper_spec.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - require 'spec_helper' include RequestsHelper diff --git a/spec/lib/diaspora_parser_spec.rb b/spec/lib/diaspora_parser_spec.rb index 5c9a17fd5..2fbd3e2d6 100644 --- a/spec/lib/diaspora_parser_spec.rb +++ b/spec/lib/diaspora_parser_spec.rb @@ -2,15 +2,11 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - require 'spec_helper' include ApplicationHelper include Diaspora::Parser - - describe Diaspora::Parser do before do @user = Factory.create(:user, :email => "bob@aol.com") @@ -88,7 +84,6 @@ describe Diaspora::Parser do original_person_id = @user2.person.id xml = request.to_diaspora_xml - Person.all.count.should be person_count @user.receive xml Person.all.count.should be person_count @@ -121,7 +116,6 @@ describe Diaspora::Parser do @user.friends.include?(new_person).should be true end - it 'should process retraction for a person' do person_count = Person.all.count request = @user.send_friend_request_to( @user2.person, @aspect) @@ -140,7 +134,6 @@ describe Diaspora::Parser do aspect_people_count = @aspect.people.size #They are now friends - Person.count.should == person_count @user.receive retraction_xml diff --git a/spec/lib/hcard_spec.rb b/spec/lib/hcard_spec.rb index 4836c5468..45d7157b9 100644 --- a/spec/lib/hcard_spec.rb +++ b/spec/lib/hcard_spec.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - require 'spec_helper' require File.dirname(__FILE__) + '/../../lib/hcard' diff --git a/spec/lib/message_handler_spec.rb b/spec/lib/message_handler_spec.rb index d60009fd9..adb375c17 100644 --- a/spec/lib/message_handler_spec.rb +++ b/spec/lib/message_handler_spec.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - require 'spec_helper' describe MessageHandler do @@ -41,7 +39,6 @@ describe MessageHandler do } end - it 'should only retry a bad request three times ' do request = FakeHttpRequest.new(:failure) request.should_receive(:get).exactly(MessageHandler::NUM_TRIES).times.and_return(request) @@ -61,7 +58,6 @@ describe MessageHandler do describe 'POST messages' do - it 'should be able to add a post message to the queue' do EventMachine.run { @handler.size.should ==0 diff --git a/spec/lib/salmon_salmon_spec.rb b/spec/lib/salmon_salmon_spec.rb index eb7a55027..6d467d4ea 100644 --- a/spec/lib/salmon_salmon_spec.rb +++ b/spec/lib/salmon_salmon_spec.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - require 'spec_helper' describe Salmon do @@ -23,7 +21,6 @@ describe Salmon do @sent_salmon.magic_sig.sig.should == @parsed_salmon.magic_sig.sig @sent_salmon.magic_sig.signable_string.should == @parsed_salmon.magic_sig.signable_string - @parsed_salmon.verified_for_key?(OpenSSL::PKey::RSA.new(@user.exported_key)).should be true @sent_salmon.verified_for_key?(OpenSSL::PKey::RSA.new(@user.exported_key)).should be true end diff --git a/spec/lib/web_hooks_spec.rb b/spec/lib/web_hooks_spec.rb index 3b0eb26df..cb81f4ce7 100644 --- a/spec/lib/web_hooks_spec.rb +++ b/spec/lib/web_hooks_spec.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - require 'spec_helper' include Diaspora diff --git a/spec/misc_spec.rb b/spec/misc_spec.rb index 528782f07..65cb9da60 100644 --- a/spec/misc_spec.rb +++ b/spec/misc_spec.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - require 'spec_helper' describe 'making sure the spec runner works' do diff --git a/spec/models/aspect_spec.rb b/spec/models/aspect_spec.rb index 356e8b26c..23453eee9 100644 --- a/spec/models/aspect_spec.rb +++ b/spec/models/aspect_spec.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - require 'spec_helper' describe Aspect do diff --git a/spec/models/comments_spec.rb b/spec/models/comments_spec.rb index 9d8c7314d..732c4349b 100644 --- a/spec/models/comments_spec.rb +++ b/spec/models/comments_spec.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - require 'spec_helper' describe Comment do diff --git a/spec/models/person_spec.rb b/spec/models/person_spec.rb index f1654b25c..c11d03455 100644 --- a/spec/models/person_spec.rb +++ b/spec/models/person_spec.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - require 'spec_helper' describe Person do @@ -21,7 +19,7 @@ describe Person do @user.person.diaspora_handle.should == @user.username + "@example.org" end end - + context 'remote people' do it 'stores the diaspora_handle in the database' do @person.diaspora_handle.include?(APP_CONFIG[:terse_pod_url]).should be false diff --git a/spec/models/photo_spec.rb b/spec/models/photo_spec.rb index 179ed1ccd..f3f77f3db 100644 --- a/spec/models/photo_spec.rb +++ b/spec/models/photo_spec.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - require 'spec_helper' describe Photo do @@ -16,7 +14,6 @@ describe Photo do @fixture_name = File.dirname(__FILE__) + '/../fixtures/button.png' @fail_fixture_name = File.dirname(__FILE__) + '/../fixtures/msg.xml' - @photo = Photo.new(:person => @user.person, :album => @album) end diff --git a/spec/models/post_spec.rb b/spec/models/post_spec.rb index c9a114b32..b0ed59b7d 100644 --- a/spec/models/post_spec.rb +++ b/spec/models/post_spec.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - require 'spec_helper' describe Post do diff --git a/spec/models/profile_spec.rb b/spec/models/profile_spec.rb index 0681e1e22..2e38c20ae 100644 --- a/spec/models/profile_spec.rb +++ b/spec/models/profile_spec.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - require 'spec_helper' describe Profile do @@ -29,4 +27,3 @@ describe Profile do end end - diff --git a/spec/models/request_spec.rb b/spec/models/request_spec.rb index e71dc1175..4e1380df1 100644 --- a/spec/models/request_spec.rb +++ b/spec/models/request_spec.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - require 'spec_helper' describe Request do diff --git a/spec/models/retraction_spec.rb b/spec/models/retraction_spec.rb index ca93c7c0e..777855234 100644 --- a/spec/models/retraction_spec.rb +++ b/spec/models/retraction_spec.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - require 'spec_helper' describe Retraction do diff --git a/spec/models/status_message_spec.rb b/spec/models/status_message_spec.rb index 59cb70ec6..d7dbf19e4 100644 --- a/spec/models/status_message_spec.rb +++ b/spec/models/status_message_spec.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - require 'spec_helper' describe StatusMessage do @@ -37,6 +35,5 @@ describe StatusMessage do end end - end diff --git a/spec/models/user/posting_spec.rb b/spec/models/user/posting_spec.rb index 73672e2ec..2f86ac549 100644 --- a/spec/models/user/posting_spec.rb +++ b/spec/models/user/posting_spec.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - require 'spec_helper' describe User do diff --git a/spec/models/user/receive_spec.rb b/spec/models/user/receive_spec.rb index 97bf41197..5bdddce67 100644 --- a/spec/models/user/receive_spec.rb +++ b/spec/models/user/receive_spec.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - require 'spec_helper' describe User do diff --git a/spec/models/user/user_friending_spec.rb b/spec/models/user/user_friending_spec.rb index 1c0f59465..4ea51ad19 100644 --- a/spec/models/user/user_friending_spec.rb +++ b/spec/models/user/user_friending_spec.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - require 'spec_helper' describe User do @@ -24,7 +22,6 @@ describe User do aspect.requests.size.should == 1 end - it "should be able to accept a pending friend request" do friend = Factory.create(:person) r = Request.instantiate(:to => @user.receive_url, :from => friend) @@ -53,12 +50,9 @@ describe User do @user.friends << friend @user.save - proc {@user.send_friend_request_to( friend, @aspect)}.should raise_error end - - describe 'multiple users accepting/rejecting the same person' do before do @person_one = Factory.create :person @@ -144,7 +138,6 @@ describe User do Person.all.count.should be 3 end - end describe 'a user accepting rejecting multiple people' do @@ -231,6 +224,5 @@ describe User do end end - end end diff --git a/spec/models/user/visible_posts_spec.rb b/spec/models/user/visible_posts_spec.rb index 0a2a53d84..8d20bcb96 100644 --- a/spec/models/user/visible_posts_spec.rb +++ b/spec/models/user/visible_posts_spec.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - require 'spec_helper' describe User do @@ -55,7 +53,6 @@ describe User do context 'albums' do - before do @album = user.post :album, :name => "Georges", :to => aspect.id aspect.reload diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index 5478d69fe..ad7070eaa 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - require 'spec_helper' describe User do diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index ef5db93c2..fad7dfc5a 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - # This file is copied to ~/spec when you run 'ruby script/generate rspec' # from the project root directory. @@ -16,8 +14,6 @@ require 'webmock/rspec' include Devise::TestHelpers include WebMock - - # Requires supporting files with custom matchers and macros, etc, # in ./support/ and its subdirectories. Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f} diff --git a/spec/user_encryption_spec.rb b/spec/user_encryption_spec.rb index 4c829bcd0..788d99419 100644 --- a/spec/user_encryption_spec.rb +++ b/spec/user_encryption_spec.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - require 'spec_helper' include ApplicationHelper include Diaspora::Parser diff --git a/test/performance/browsing_test.rb b/test/performance/browsing_test.rb index 74e8c9421..9cc248c9f 100644 --- a/test/performance/browsing_test.rb +++ b/test/performance/browsing_test.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - require 'test_helper' require 'rails/performance_test_help' diff --git a/test/selenium/login_test.rb b/test/selenium/login_test.rb index 321d46e1d..b60d2db8c 100644 --- a/test/selenium/login_test.rb +++ b/test/selenium/login_test.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - class SampleWebratTest < ActionController::IntegrationTest def test_widget diff --git a/test/selenium/selenium_suite.rb b/test/selenium/selenium_suite.rb index d5362b1d7..7f4df5e4c 100644 --- a/test/selenium/selenium_suite.rb +++ b/test/selenium/selenium_suite.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - require File.expand_path(File.join(File.dirname(__FILE__), '..', 'test_helper')) require 'test/unit/ui/console/testrunner' require 'webrat' diff --git a/test/test_helper.rb b/test/test_helper.rb index d9742c116..e46a0a70c 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - ENV["RAILS_ENV"] = "test" require File.expand_path('../../config/environment', __FILE__) require 'rails/test_help' From ebf49990541607ef6b79d19280dc200319048caa Mon Sep 17 00:00:00 2001 From: Stephen Caudill Date: Sat, 25 Sep 2010 12:11:04 -0400 Subject: [PATCH 294/449] Task to remove consecutive blank lines --- lib/tasks/whitespace.rake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/tasks/whitespace.rake b/lib/tasks/whitespace.rake index e3d26c3ab..c5b9d4c6e 100644 --- a/lib/tasks/whitespace.rake +++ b/lib/tasks/whitespace.rake @@ -7,5 +7,9 @@ namespace :whitespace do task :retab do sh %{find . -name '*.rb' -exec sed -i '' 's/\t/ /g' {} \\;} end + desc 'Remove consecutive blank lines' + task :scrub_gratuitous_newlines do + sh %{find . -name '*.rb' -exec sed -i '' '/./,/^$/!d' {} \\;} + end end From 8c6dff35c0d9475b09cac1781a710c42c501639b Mon Sep 17 00:00:00 2001 From: Stephen Caudill Date: Sat, 25 Sep 2010 12:26:29 -0400 Subject: [PATCH 295/449] Remove unnecessary includes --- spec/controllers/albums_controller_spec.rb | 2 +- spec/controllers/aspects_controller_spec.rb | 2 +- spec/controllers/requests_controller_spec.rb | 6 ++-- spec/helpers/application_helper_spec.rb | 1 - spec/helpers/publics_helper_spec.rb | 1 - spec/helpers/requests_helper_spec.rb | 2 -- spec/lib/diaspora_parser_spec.rb | 3 -- spec/lib/web_hooks_spec.rb | 31 ++++++++------------ spec/user_encryption_spec.rb | 2 -- 9 files changed, 18 insertions(+), 32 deletions(-) diff --git a/spec/controllers/albums_controller_spec.rb b/spec/controllers/albums_controller_spec.rb index b0f939548..a8f5f8506 100644 --- a/spec/controllers/albums_controller_spec.rb +++ b/spec/controllers/albums_controller_spec.rb @@ -3,7 +3,7 @@ # the COPYRIGHT file. require 'spec_helper' -include ApplicationHelper + describe AlbumsController do render_views before do diff --git a/spec/controllers/aspects_controller_spec.rb b/spec/controllers/aspects_controller_spec.rb index fdfaa7e45..2e05b850c 100644 --- a/spec/controllers/aspects_controller_spec.rb +++ b/spec/controllers/aspects_controller_spec.rb @@ -3,7 +3,7 @@ # the COPYRIGHT file. require 'spec_helper' -include ApplicationHelper + describe AspectsController do render_views before do diff --git a/spec/controllers/requests_controller_spec.rb b/spec/controllers/requests_controller_spec.rb index 23e0fdea9..0556ffe5c 100644 --- a/spec/controllers/requests_controller_spec.rb +++ b/spec/controllers/requests_controller_spec.rb @@ -3,10 +3,10 @@ # the COPYRIGHT file. require 'spec_helper' -include ApplicationHelper -include RequestsHelper + describe RequestsController do - render_views + include RequestsHelper + render_views before do @user = Factory.create :user stub_success("tom@tom.joindiaspora.com") diff --git a/spec/helpers/application_helper_spec.rb b/spec/helpers/application_helper_spec.rb index d894d147e..459563cff 100644 --- a/spec/helpers/application_helper_spec.rb +++ b/spec/helpers/application_helper_spec.rb @@ -4,7 +4,6 @@ require 'spec_helper' -include ApplicationHelper describe ApplicationHelper do before do @user = Factory.create(:user) diff --git a/spec/helpers/publics_helper_spec.rb b/spec/helpers/publics_helper_spec.rb index c58247321..bc6a5021b 100644 --- a/spec/helpers/publics_helper_spec.rb +++ b/spec/helpers/publics_helper_spec.rb @@ -4,7 +4,6 @@ require 'spec_helper' -include PublicsHelper describe PublicsHelper do before do @user = Factory.create(:user) diff --git a/spec/helpers/requests_helper_spec.rb b/spec/helpers/requests_helper_spec.rb index 984a56ea4..0cd1dbf88 100644 --- a/spec/helpers/requests_helper_spec.rb +++ b/spec/helpers/requests_helper_spec.rb @@ -4,8 +4,6 @@ require 'spec_helper' -include RequestsHelper - describe RequestsHelper do before do diff --git a/spec/lib/diaspora_parser_spec.rb b/spec/lib/diaspora_parser_spec.rb index 2fbd3e2d6..e37cf0116 100644 --- a/spec/lib/diaspora_parser_spec.rb +++ b/spec/lib/diaspora_parser_spec.rb @@ -4,9 +4,6 @@ require 'spec_helper' -include ApplicationHelper -include Diaspora::Parser - describe Diaspora::Parser do before do @user = Factory.create(:user, :email => "bob@aol.com") diff --git a/spec/lib/web_hooks_spec.rb b/spec/lib/web_hooks_spec.rb index cb81f4ce7..e316817d4 100644 --- a/spec/lib/web_hooks_spec.rb +++ b/spec/lib/web_hooks_spec.rb @@ -4,28 +4,23 @@ require 'spec_helper' -include Diaspora +describe Diaspora::Webhooks do + before do + @user = Factory.create(:user) + @aspect = @user.aspect(:name => "losers") + @user2 = Factory.create(:user) + @aspect2 = @user2.aspect(:name => "losers") + friend_users(@user, @aspect, @user2, @aspect2) + end -describe Diaspora do - - describe Webhooks do + describe "body" do before do - @user = Factory.create(:user) - @aspect = @user.aspect(:name => "losers") - @user2 = Factory.create(:user) - @aspect2 = @user2.aspect(:name => "losers") - friend_users(@user, @aspect, @user2, @aspect2) + @post = Factory.build(:status_message, :person => @user.person) end - describe "body" do - before do - @post = Factory.build(:status_message, :person => @user.person) - end - - it "should add the following methods to Post on inclusion" do - @post.respond_to?(:to_diaspora_xml).should be true - end - + it "should add the following methods to Post on inclusion" do + @post.respond_to?(:to_diaspora_xml).should be true end + end end diff --git a/spec/user_encryption_spec.rb b/spec/user_encryption_spec.rb index 788d99419..b74006e3d 100644 --- a/spec/user_encryption_spec.rb +++ b/spec/user_encryption_spec.rb @@ -3,8 +3,6 @@ # the COPYRIGHT file. require 'spec_helper' -include ApplicationHelper -include Diaspora::Parser describe 'user encryption' do before do From 72cefc62652c510bd9a9c6466711ad20ddb63ea7 Mon Sep 17 00:00:00 2001 From: Stephen Caudill Date: Sat, 25 Sep 2010 13:04:20 -0400 Subject: [PATCH 296/449] Move relationship_flow spec to its helper spec --- spec/controllers/requests_controller_spec.rb | 21 -------------------- spec/helpers/requests_helper_spec.rb | 13 +++++++++++- 2 files changed, 12 insertions(+), 22 deletions(-) delete mode 100644 spec/controllers/requests_controller_spec.rb diff --git a/spec/controllers/requests_controller_spec.rb b/spec/controllers/requests_controller_spec.rb deleted file mode 100644 index 0556ffe5c..000000000 --- a/spec/controllers/requests_controller_spec.rb +++ /dev/null @@ -1,21 +0,0 @@ -# Copyright (c) 2010, Diaspora Inc. This file is -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - -require 'spec_helper' - -describe RequestsController do - include RequestsHelper - render_views - before do - @user = Factory.create :user - stub_success("tom@tom.joindiaspora.com") - - @tom = Redfinger.finger('tom@tom.joindiaspora.com') - sign_in :user, @user - stub!(:current_user).and_return @user - end - it 'should return the correct tag and url for a given address' do - relationship_flow('tom@tom.joindiaspora.com')[:friend].receive_url.include?("receive/user").should == true - end -end diff --git a/spec/helpers/requests_helper_spec.rb b/spec/helpers/requests_helper_spec.rb index 0cd1dbf88..bf99f89d1 100644 --- a/spec/helpers/requests_helper_spec.rb +++ b/spec/helpers/requests_helper_spec.rb @@ -7,7 +7,6 @@ require 'spec_helper' describe RequestsHelper do before do - stub_success("tom@tom.joindiaspora.com") stub_success("evan@status.net") @tom = Redfinger.finger('tom@tom.joindiaspora.com') @@ -20,4 +19,16 @@ describe RequestsHelper do subscription_mode(@evan).should == :none end end + + describe "#relationship_flow" do + let(:tom){ Factory(:user, :email => 'tom@tom.joindiaspora.com') } + + before do + stub!(:current_user).and_return(tom) + end + + it 'should return the correct tag and url for a given address' do + relationship_flow('tom@tom.joindiaspora.com')[:friend].receive_url.should include("receive/user") + end + end end From f2ddb8a39cec9da8e46ff2b230ce3e524902c6e0 Mon Sep 17 00:00:00 2001 From: Yuval Adam Date: Sun, 26 Sep 2010 02:54:24 +0800 Subject: [PATCH 297/449] added Hebrew (he) locale files --- config/locales/devise/devise.he.yml | 41 ++++++ config/locales/diaspora/he.yml | 201 ++++++++++++++++++++++++++++ 2 files changed, 242 insertions(+) create mode 100644 config/locales/devise/devise.he.yml create mode 100644 config/locales/diaspora/he.yml diff --git a/config/locales/devise/devise.he.yml b/config/locales/devise/devise.he.yml new file mode 100644 index 000000000..851a90789 --- /dev/null +++ b/config/locales/devise/devise.he.yml @@ -0,0 +1,41 @@ +# Copyright (c) 2010, Diaspora Inc. This file is +# licensed under the Affero General Public License version 3. See +# the COPYRIGHT file. + + +en: + errors: + messages: + not_found: "לא נמצא" + already_confirmed: "כבר אושר" + not_locked: "לא ננעל" + + devise: + failure: + unauthenticated: "צריך להתחבר או להירשם לפני שאפשר להמשיך." + unconfirmed: "צריך לאשר את החשבון לפני שאפשר להמשיך." + locked: "החשבון שלך נעול." + invalid: "אימייל או סיסמה לא נכונים." + invalid_token: "מספר אימות לא נכון." + timeout: "פג תוקפו של החיבור. נא להתחבר מחדש על מנת להמשיך." + inactive: "החשבון לא אומת עדיין." + sessions: + signed_in: "התחברות עברה בהצלחה." + signed_out: "התנתקות עברה בהצלחה." + passwords: + send_instructions: "אימייל עם הוראות עיצד לאפס סיסמה יתקבל בקרוב." + updated: "סיסמה הוחלפה בהצלחה, את/ה כעת מחובר/ת." + confirmations: + send_instructions: "אימייל עם הוראות כיצד לאמת את החשבון יתקבל בקרוב." + confirmed: "חשבון אומת בהצלחה. את/ה כעת מחובר/ת." + registrations: + signed_up: "התחברת בהצלחה, אם הדבר מאופשר, יתקבל אימייל אישור בקרוב.." + updated: "חשבונך עודכן בהצלחה." + destroyed: "להתראות! חשבונך נמחק בהצלחה. מקווים לראותך שוב בקרוב!" + unlocks: + send_instructions: "אימייל עם הוראות כיצד להסיר את הנעילה מחשבונך יתקבל בקרוב." + unlocked: "חשבונך נפתח בהצלחה. את/ה כעת מחובר/ת." + mailer: + confirmation_instructions: "הוראות אישור" + reset_password_instructions: "הוראות איפוס סיסמה" + unlock_instructions: "הוראות הסרת נעילה" diff --git a/config/locales/diaspora/he.yml b/config/locales/diaspora/he.yml new file mode 100644 index 000000000..90ced9435 --- /dev/null +++ b/config/locales/diaspora/he.yml @@ -0,0 +1,201 @@ +# Copyright (c) 2010, Diaspora Inc. This file is +# licensed under the Affero General Public License version 3. See +# the COPYRIGHT file. + +he: + hello: "שלום עולם" + application: + helper: + unknown_person: "אדם לא מוכר" + new_requests: "בקשות חדשות" + dashboards: + helper: + home: "בית" + error_messages: + helper: + invalid_fields: "שדות לא חוקיים" + correct_the_following_errors_and_try_again: "נא לתקן את השגיאות הבאות ולנסות שוב." + people: + helper: + results_for: " תוצאות עבור %{params}" + people_on_pod_are_aware_of: " אנשים בפוד מכירים את" + layouts: + application: + edit_profile: "ערוך פרופיל" + logout: "התנתק" + shared: + aspect_nav: + all_aspects: "כל האספקטים" + manage: "נהל" + manage_your_aspects: "נהל אספקטים" + sub_header: + all_aspects: "כל האספקטים" + manage_aspects: "נהל אספקטים" + publisher: + share: "שתף" + aspect_friends: + add_friends: "הוסף חברים" + albums: + album: + you: "אתה" + new_album: + create: "צור" + add_a_new_album: "הוסף אלבום חדש" + show: + edit_album: "ערוך אלבום" + albums: "אלבומים" + updated: "עדכן" + by: "על ידי" + edit: + editing: "עריכה" + updated: "עודכן" + are_you_sure: "האם את/ה בטוח/ה?" + delete_album: "מחק אלבום" + cancel: "בטל" + index: + home: "בית" + new_album: "אלבום חדש" + create: + success: "יצרת אלבום בשם %{name}." + update: + success: "אלבום %{name} עודכן בהצלחה." + failure: "עריכת אלבום %{name} נכשלה." + destroy: + success: "אלבום %{name} נמחק." + helper: + friends_albums: "אלבומים של חברים" + your_albums: "האלבומים שלך" + aspects: + index: + photos: "תמונות" + show: + photos: "תמונות" + manage: + add_a_new_aspect: "הוסף אספקט" + add_a_new_friend: "הוסף חבר" + show: "הצג" + update_aspects: "עדכן אספקטים" + requests: "בקשות" + ignore_remove: "התעלם/מחק" + new_aspect: + add_a_new_aspect: "הוסף אספקט" + create: "צור" + create: + success: "לחץ על הפלוס בצד ימין על מנת לקבוע מי רשאי לצפות באספקט." + destroy: + success: "%{name} הוסר בהצלחה." + update: + success: "האספקט שלך, %{name}, נערך בהצלחה." + move_friends: + failure: "עריכת אספקט נכשלה עבור %{real_name}." + success: "אספקטים נערכו בהצלחה." + move_friend: + failure: "לא עבד %{inspect}" + success: "אתה כעת מציג לחברך אספקט שונה שלך." + helper: + remove: "מחק" + aspect_not_empty: "אספקט לא ריק" + users: + edit: + cancel: "בטל" + update_profile: "עדכן פרופיל" + home: "בית" + diaspora_username: "שם משתמש בדיאספורה" + info: "מידע" + picture: "תמונה" + editing_profile: "עורך פרופיל" + albums: "אלבומים" + you_dont_have_any_photos: "אין לך תמונות! עבור ל-" + page_to_upload_some: "דף להעלאה." + comments: + comment: + ago: "לפני" + new_comment: + comment: "הערה" + photos: + show: + prev: "קודם" + full_size: "גודל מלא" + next: "הבא" + edit_photo: "ערוך תמונה" + delete_photo: "מחק תמונה" + are_you_sure: "האם אתה בטוח?" + comments: "הערות" + edit: + editing: "עריכה" + are_you_sure: "האם אתה בטוח?" + delete_photo: "מחק תמונה" + photo: + show_comments: "הצג הערות" + posted_a_new_photo_to: "הועלתה תמונה חדשה ל-" + new: + new_photo: "תמונה חדשה" + back_to_list: "חרה לרשימה" + post_it: "שתף!" + create: + runtime_error: "העלאת תמונה נכשלה. האם אתה חוגר חגורת בטיחות?" + integrity_error: "העלאת תמונה נכשלה. האם זו אכן הייתה תמונה?" + type_error: "העלאת תמונה נכשלה. האם אכן נוספה תמונה?" + update: + notice: "תמונה עודכנה בהצלחה." + error: "עריכת תמונה נכשלה." + destroy: + notice: "תמונה נמחקה." + registrations: + new: + sign_up: "הצטרפות" + create: + success: "הצטרפת לדיאספורה!" + status_messages: + new_status_message: + tell_me_something_good: "ספר לי משהו נחמד" + oh_yeah: "אחלה!" + status_message: + show_comments: "הצג תגובות" + delete: "מחק" + are_you_sure: "האם אתה בטוח?" + show: + status_message: "הודעת סטטוס" + comments: "הערות" + are_you_sure: "האם אתה בטוח?" + destroy: "השמד" + view_all: "הצג הכל" + message: "הודעה" + owner: "בעלים" + helper: + no_message_to_display: "אין הודעה להציג." + people: + person: + add_friend: "הוסף חבר" + pending_request: "בקשה על תנאי" + index: + add_friend: "הוסף חבר" + real_name: "שם אמיתי" + diaspora_handle: "כינוי בדיאספורה" + thats_you: "זה אתה!" + friend_request_pending: "בקשת חברות ממתינה" + you_have_a_friend_request_from_this_person: "יש לך בקשת חברות מאדם זה" + new: + new_person: "אדם חדש" + back_to_list: "חזרה לרשימה" + show: + last_seen: "נראה לאחרונה: %{how_long_ago}" + friends_since: "חברים מאז: %{how_long_ago}" + save: "שמור" + are_you_sure: "האם אתה בטוח?" + remove_friend: "מחק חבר" + requests: + new_request: + add_a_new_friend_to: "הוסף חבר חדש ל-" + enter_a_diaspora_username: "הכנס שם משתמש בדיאספורה:" + your_diaspora_username_is: "שם המשתמש שלך בדיאספורה: %{diaspora_handle}" + friends_username: "שם המשתמש של חבר" + destroy: + success: "אתם כעת חברים." + error: "נא לבחור אספקט!" + ignore: "התעלמת מבקשת חברות." + create: + error: "לא נמצא זרע דיאספורה עם אימייל זה!" + already_friends: "את/ה כבר חבר של %{destination_url}!" + success: "בקשת חברות נשלחה ל%{destination_url}." + horribly_wrong: "משהו רע מאוד קרה." From 0b19b77b5fe692b978f0fffbc3e886caea82645e Mon Sep 17 00:00:00 2001 From: Uiri Date: Sat, 25 Sep 2010 17:34:13 -0400 Subject: [PATCH 298/449] A fix for the image breaking if you don't change anything on the edit profile page but hit update profile instead of cancel --- app/controllers/users_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 819a88d28..30555d20a 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -31,7 +31,7 @@ class UsersController < ApplicationController params[:profile].delete(:image_url) else url = APP_CONFIG[:pod_url].chop if APP_CONFIG[:pod_url][-1,1] == '/' - params[:profile][:image_url] = url + params[:profile][:image_url] + params[:profile][:image_url] = params[:profile][:image_url] end end From ceb4f71714091ddfd31db4c7b79dd4285c1bb401 Mon Sep 17 00:00:00 2001 From: Uiri Date: Sat, 25 Sep 2010 18:35:28 -0400 Subject: [PATCH 299/449] Don't want my personal changes to be pulled into the master with my pull request --- script/server | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/server b/script/server index f1e5b7ec5..3804ccad9 100755 --- a/script/server +++ b/script/server @@ -8,6 +8,6 @@ then else mkdir -p -v log/thin/ bundle exec ruby ./script/websocket_server.rb& - bundle exec thin -p 80 -a 192.168.0.191 start $@ + bundle exec thin start $@ fi From 28e925e40a310d89af6934002669fe663100714c Mon Sep 17 00:00:00 2001 From: koo5 Date: Sat, 25 Sep 2010 07:44:05 +0200 Subject: [PATCH 300/449] More czech translation goodness. I've added distance_in_words translations, feel free to delete it if it belongs somewhere/sometime else. --- config/locales/diaspora/cs.yml | 208 +++++++++++++++++++++++++++++++++ 1 file changed, 208 insertions(+) diff --git a/config/locales/diaspora/cs.yml b/config/locales/diaspora/cs.yml index 91c904dc1..e943eab16 100644 --- a/config/locales/diaspora/cs.yml +++ b/config/locales/diaspora/cs.yml @@ -8,3 +8,211 @@ cs: hello: "Dobrý Den" + application: + helper: + unknown_person: "neznámá osoba" + new_requests: "nové žádosti" + dashboards: + helper: + home: "domů" + datetime: + distance_in_words: + less_than_x_seconds: "méně než %{count} sekund" + half_a_minute: "půl minuty" + less_than_x_minutes: "méně než %{count} minut" + x_minutes: "%{count} minuty" + about_x_hours: "zhruba %{count} hodin" + x_days: "%{count} dní" + about_x_months: "zhruba %{count} měsíců" + x_months: "%{count} měsíců" + about_x_years: "zhruba %{count} let" + over_x_years: "přez %{count} let" + almost_x_years: "skoro %{count} let" + error_messages: + helper: + invalid_fields: "Neplatná pole" + correct_the_following_errors_and_try_again: "Opravte následující chyby a zkuste to znovu." + people: + helper: + results_for: " vysledky vyhledávání %{params}" + people_on_pod_are_aware_of: " people on pod are aware of" + layouts: + application: + edit_profile: "upravit profil" + logout: "odhlásit se" + shared: + aspect_nav: + all_aspects: "Všechny aspekty" + manage: "Spravovat" + manage_your_aspects: "Spravovat vaše aspekty" + sub_header: + all_aspects: "Všechny aspekty" + manage_aspects: "Spravovat aspekty" + publisher: + share: "Sdělit" + aspect_friends: + add_friends: "přidat přátele" + albums: + album: + you: "vy" + new_album: + create: "vytvořit" + add_a_new_album: "Přidat nové album" + show: + edit_album: "Upravit album" + albums: "alba" + updated: "aktualizované" + by: "uživatelem" + edit: + editing: "Upravuje se" + updated: "aktualizováno" + are_you_sure: "Jste si jisti?" + delete_album: "Smazat Album" + cancel: "Zrušit" + index: + home: "doma" + new_album: "Nové Album" + create: + success: "Vytvořili jste nové album nazvané %{name}." + update: + success: "Album %{name} úspěšně upraveno." + failure: "Nepodařilo se upravit album %{name}." + destroy: + success: "Album %{name} smazáno." + helper: + friends_albums: "Alba přátel" + your_albums: "Vaše Alba" + aspects: + index: + photos: "fotografie" + show: + photos: "fotografie" + manage: + add_a_new_aspect: "Přidat aspekt" + add_a_new_friend: "Přidat nového přítele" + show: "Show" + update_aspects: "Aktualizovat aspekty" + requests: "Žádosti" + ignore_remove: "Ignorovat/Odebrat" + new_aspect: + add_a_new_aspect: "Přidat nový aspekt" + create: "Vytvořit" + create: + success: "Řekněte Diaspoře kdo může vidět váš nový aspekt kliknutím na plus na levé straně." + destroy: + success: "%{name} byl úspěšně odebrán." + update: + success: "Váš aspekt, %{name}, byl úspěšně upraven." + move_friends: + failure: "Úprava aspektu přítelem %{real_name} selhala." + success: "Aspekty úspěšně upraveny." + move_friend: + failure: "nepodařilo se %{inspect}" + success: "Nyní svému příteli ukazujete jiný ze svých aspektů." + helper: + remove: "odebrat" + aspect_not_empty: "Aspekt není prázdný" + users: + edit: + cancel: "Zrušit" + update_profile: "Aktualizovat profil" + home: "Domů" + diaspora_username: "UŽIVATELSKÉ JMÉNO V DIASPOŘE" + info: "Info" + picture: "Obrázek" + editing_profile: "Upravit profil" + albums: "Alba" + you_dont_have_any_photos: "Nemáte žádné fotky. Jděte na stránku" + page_to_upload_some: "a nějaké nahrajte." + comments: + comment: + ago: "nazpět" + new_comment: + comment: "Komentář" + photos: + show: + prev: "předchozí" + full_size: "plná velkost" + next: "další" + edit_photo: "Upravit fotku" + delete_photo: "Smazat fotku" + are_you_sure: "Jste si jisti?" + comments: "komentáře" + edit: + editing: "Uprait" + are_you_sure: "Jste si jisti?" + delete_photo: "Smazat fotku" + photo: + show_comments: "zobrazit komentáře" + posted_a_new_photo_to: "poslal novou fotku do" + new: + new_photo: "Nová fotka" + back_to_list: "Zpět na seznam" + post_it: "poslat!" + create: + runtime_error: "Poslání fotky selhalo. Jste si jisti, že máte zapnuté pásy?" + integrity_error: "Poslání fotky selhalo. Jste si jisti že to byl obrázek?" + type_error: "Poslání fotky selhalo. Jste si jisti zě byl přidán obrázek?" + update: + notice: "Fotka úspěšně aktualizována." + error: "Nepodařilo se upravit fotku." + destroy: + notice: "Fotka smazána." + registrations: + new: + sign_up: "Zapsat se" + create: + success: "Připojili jste se k Diaspoře!" + status_messages: + new_status_message: + tell_me_something_good: "pověz mi něco dobrého" + oh_yeah: "ó ano!" + status_message: + show_comments: "zobrazit komentáře" + delete: "Smazat" + are_you_sure: "Jste si jisti?" + show: + status_message: "Zpráva o stavu" + comments: "komentáře" + are_you_sure: "Jste si jisti?" + destroy: "Zničit" + view_all: "Zobrazit Vše" + message: "Zpráva" + owner: "Vlastník" + helper: + no_message_to_display: "Není k zobrazení žádná zpráva." + people: + person: + add_friend: "přidat přítele" + pending_request: "nevyřízené žádosti" + index: + add_friend: "přidat přítele" + real_name: "pravé jméno" + diaspora_handle: "adresa v diaspoře" + thats_you: "to jste vy!" + friend_request_pending: "nevyřízená žádost o přátelství" + you_have_a_friend_request_from_this_person: "od této osoby máte žádost o přátelství" + new: + new_person: "Nová Osoba" + back_to_list: "Zpět na Seznam" + show: + last_seen: "naposledy viděni: %{how_long_ago}" + friends_since: "přáteli od: %{how_long_ago}" + save: "save" + are_you_sure: "Jste si jisti?" + remove_friend: "odebrat přítele" + requests: + new_request: + add_a_new_friend_to: "Pridat nového přítele do" + enter_a_diaspora_username: "Vložte uživatelské jméno v diaspoře:" + your_diaspora_username_is: "Vaše uživatelské jméno v diaspoře je: %{diaspora_handle}" + friends_username: "Uživatelské jméno přítele" + destroy: + success: "Nyní jste přáteli." + error: "Prosím vyberte aspekt!" + ignore: "Ignorovat žádost o přátelství." + create: + error: "Semínko diaspory s touto adresou nenalezeno!" + already_friends: "S %{destination_url} už jste přáteli!" + success: "byla poslána žádost o přátelství na %{destination_url}" + horribly_wrong: "Něco se ošklivě pokazilo." From 64e1912c37b955a2d72955e16881dc21ceb9fcaf Mon Sep 17 00:00:00 2001 From: Sarah Mei Date: Sun, 26 Sep 2010 00:40:40 -0700 Subject: [PATCH 301/449] Disabled image resizing in specs => 15% faster test suite. FTW --- spec/spec_helper.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index fad7dfc5a..4149200d8 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -41,6 +41,9 @@ RSpec.configure do |config| DatabaseCleaner.clean end end + +ImageUploader.enable_processing = false + def stub_sockets Diaspora::WebSocket.stub!(:queue_to_user).and_return(true) Diaspora::WebSocket.stub!(:subscribe).and_return(true) From 294da214f73ccd6aa211f58a2df553cc7c4107a3 Mon Sep 17 00:00:00 2001 From: Stephen Caudill Date: Sat, 25 Sep 2010 13:26:26 -0400 Subject: [PATCH 302/449] Make ruby-debug available in test env --- Gemfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Gemfile b/Gemfile index cf863eb43..1525b735a 100644 --- a/Gemfile +++ b/Gemfile @@ -39,11 +39,12 @@ gem 'mini_magick' group :test, :development do gem 'factory_girl_rails' + gem 'ruby-debug' end group :test do - gem 'rspec', '>= 2.0.0.beta.17' - gem 'rspec-rails', '2.0.0.beta.17' + gem 'rspec', '>= 2.0.0.beta.17' + gem 'rspec-rails', '2.0.0.beta.17' gem 'mocha' gem 'webrat', '0.7.2.beta.1' gem 'autotest' From af938fe74fa4175ba65b27c7f9dc8d9b90bad99a Mon Sep 17 00:00:00 2001 From: Stephen Caudill Date: Sat, 25 Sep 2010 13:29:08 -0400 Subject: [PATCH 303/449] Remove unused/broken Selenium tests --- Gemfile | 4 +-- Gemfile.lock | 20 ++++------- lib/tasks/saucelabs_adapter.rake | 59 ------------------------------- test/performance/browsing_test.rb | 13 ------- test/selenium/login_test.rb | 11 ------ test/selenium/selenium_suite.rb | 15 -------- test/test_helper.rb | 17 --------- 7 files changed, 8 insertions(+), 131 deletions(-) delete mode 100644 lib/tasks/saucelabs_adapter.rake delete mode 100644 test/performance/browsing_test.rb delete mode 100644 test/selenium/login_test.rb delete mode 100644 test/selenium/selenium_suite.rb delete mode 100644 test/test_helper.rb diff --git a/Gemfile b/Gemfile index 1525b735a..d58183d77 100644 --- a/Gemfile +++ b/Gemfile @@ -46,11 +46,9 @@ group :test do gem 'rspec', '>= 2.0.0.beta.17' gem 'rspec-rails', '2.0.0.beta.17' gem 'mocha' - gem 'webrat', '0.7.2.beta.1' + gem 'redgreen' gem 'autotest' gem 'database_cleaner' - gem 'saucelabs-adapter', '= 0.8.12' - gem 'selenium-rc' gem 'webmock' end diff --git a/Gemfile.lock b/Gemfile.lock index ac66e59c1..6aed3dd32 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -128,7 +128,7 @@ GEM highline (1.6.1) i18n (0.4.1) json (1.4.6) - lsof (0.3.0) + linecache (0.43) mail (2.2.6.1) activesupport (>= 2.3.6) mime-types @@ -189,15 +189,11 @@ GEM rspec-rails (2.0.0.beta.17) rspec (>= 2.0.0.beta.14) webrat (>= 0.7.0) - saucelabs-adapter (0.8.12) - lsof (>= 0.3.0) - net-ssh (>= 2.0.12) - net-ssh-gateway (>= 1.0.1) - rest-client (>= 1.2.0) - selenium-client (>= 1.2.17) - selenium-client (1.2.18) - selenium-rc (2.2.4) - selenium-client (>= 1.2.18) + ruby-debug (0.10.3) + columnize (>= 0.1) + ruby-debug-base (~> 0.10.3.0) + ruby-debug-base (0.10.3) + linecache (>= 0.3) subexec (0.0.4) thin (1.2.7) daemons (>= 1.0.9) @@ -247,10 +243,8 @@ DEPENDENCIES roxml! rspec (>= 2.0.0.beta.17) rspec-rails (= 2.0.0.beta.17) - saucelabs-adapter (= 0.8.12) - selenium-rc + ruby-debug sprinkle! thin webmock - webrat (= 0.7.2.beta.1) will_paginate (= 3.0.pre2) diff --git a/lib/tasks/saucelabs_adapter.rake b/lib/tasks/saucelabs_adapter.rake deleted file mode 100644 index 76f6cbbc4..000000000 --- a/lib/tasks/saucelabs_adapter.rake +++ /dev/null @@ -1,59 +0,0 @@ -# Copyright (c) 2010, Diaspora Inc. This file is -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - - - -require 'saucelabs_adapter/run_utils' - -class Rake::Task - def self.exists?(name) - tasks.any? { |t| t.name == name } - end -end - -namespace :selenium do - - # Rake tasks are cumulative, and some old plugins are still defining selenium:server, so clear it. - Rake::Task[:'selenium:server'].clear_actions if Rake::Task.exists?('selenium:server') - - desc "Run the selenium remote-control server" - task :server do - system('bundle exec selenium-rc') - end - - desc "Run the selenium remote-control server in the background" - task :server_bg do - system('nohup selenium-rc 2&>1 &') - end - - desc "Runs Selenium tests locally (selenium server must already be started)" - task :local => [:local_env, :suite] - - desc "Run Selenium tests at saucelabs.com (using configuration 'saucelabs' in config/selenium.yml)" - task :sauce => [:sauce_env, :suite] - - desc "Run Selenium tests using configuration SELENIUM_ENV (from config/selenium.yml)" - task :custom => [:check_selenium_env_is_set, :suite] - - task :local_env do - ENV['SELENIUM_ENV'] = 'local' - end - - task :sauce_env do - ENV['SELENIUM_ENV'] = 'saucelabs' - end - - task :check_selenium_env_is_set do - raise "SELENIUM_ENV must be set" unless ENV['SELENIUM_ENV'] - end - - task :suite do - if (File.exists?("test/selenium/selenium_suite.rb")) - RunUtils.run "ruby test/selenium/selenium_suite.rb" - else - puts "test/selenium/selenium_suite.rb not found, bailing.\nPlease create a script that will run your selenium tests." - exit 1 - end - end -end diff --git a/test/performance/browsing_test.rb b/test/performance/browsing_test.rb deleted file mode 100644 index 9cc248c9f..000000000 --- a/test/performance/browsing_test.rb +++ /dev/null @@ -1,13 +0,0 @@ -# Copyright (c) 2010, Diaspora Inc. This file is -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - -require 'test_helper' -require 'rails/performance_test_help' - -# Profiling results for each test method are written to tmp/performance. -class BrowsingTest < ActionDispatch::PerformanceTest - def test_homepage - get '/' - end -end diff --git a/test/selenium/login_test.rb b/test/selenium/login_test.rb deleted file mode 100644 index b60d2db8c..000000000 --- a/test/selenium/login_test.rb +++ /dev/null @@ -1,11 +0,0 @@ -# Copyright (c) 2010, Diaspora Inc. This file is -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - -class SampleWebratTest < ActionController::IntegrationTest - - def test_widget - visit "/" - assert_contain "sign in" - end -end diff --git a/test/selenium/selenium_suite.rb b/test/selenium/selenium_suite.rb deleted file mode 100644 index 7f4df5e4c..000000000 --- a/test/selenium/selenium_suite.rb +++ /dev/null @@ -1,15 +0,0 @@ -# Copyright (c) 2010, Diaspora Inc. This file is -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - -require File.expand_path(File.join(File.dirname(__FILE__), '..', 'test_helper')) -require 'test/unit/ui/console/testrunner' -require 'webrat' -require 'saucelabs_adapter' - -Webrat.configure do |config| - config.mode = :selenium - config.application_framework = :rack -end - -require File.join(File.dirname(__FILE__), 'sample_webrat_test') diff --git a/test/test_helper.rb b/test/test_helper.rb deleted file mode 100644 index e46a0a70c..000000000 --- a/test/test_helper.rb +++ /dev/null @@ -1,17 +0,0 @@ -# Copyright (c) 2010, Diaspora Inc. This file is -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - -ENV["RAILS_ENV"] = "test" -require File.expand_path('../../config/environment', __FILE__) -require 'rails/test_help' - -class ActiveSupport::TestCase - # Setup all fixtures in test/fixtures/*.(yml|csv) for all tests in alphabetical order. - # - # Note: You'll currently still have to declare fixtures explicitly in integration tests - # -- they do not yet inherit this setting - #fixtures :all - - # Add more helper methods to be used by all tests here... -end From 05c2da81e5785703dfb2609c8d914726ef205857 Mon Sep 17 00:00:00 2001 From: Stephen Caudill Date: Sat, 25 Sep 2010 13:44:20 -0400 Subject: [PATCH 304/449] Add cucumber and run the generator --- Gemfile | 2 + Gemfile.lock | 35 ++++ config/cucumber.yml | 8 + features/step_definitions/web_steps.rb | 219 +++++++++++++++++++++++++ features/support/env.rb | 44 +++++ features/support/paths.rb | 33 ++++ lib/tasks/cucumber.rake | 53 ++++++ script/cucumber | 10 ++ 8 files changed, 404 insertions(+) create mode 100644 config/cucumber.yml create mode 100644 features/step_definitions/web_steps.rb create mode 100644 features/support/env.rb create mode 100644 features/support/paths.rb create mode 100644 lib/tasks/cucumber.rake create mode 100755 script/cucumber diff --git a/Gemfile b/Gemfile index d58183d77..419f75094 100644 --- a/Gemfile +++ b/Gemfile @@ -43,6 +43,8 @@ group :test, :development do end group :test do + gem 'capybara', '~> 0.3.9' + gem 'cucumber-rails', '0.3.2' gem 'rspec', '>= 2.0.0.beta.17' gem 'rspec-rails', '2.0.0.beta.17' gem 'mocha' diff --git a/Gemfile.lock b/Gemfile.lock index 6aed3dd32..a56760270 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -109,7 +109,24 @@ GEM net-sftp (>= 2.0.0) net-ssh (>= 2.0.14) net-ssh-gateway (>= 1.0.0) + capybara (0.3.9) + culerity (>= 0.2.4) + mime-types (>= 1.16) + nokogiri (>= 1.3.3) + rack (>= 1.0.0) + rack-test (>= 0.5.4) + selenium-webdriver (>= 0.0.3) + columnize (0.3.1) crack (0.1.8) + cucumber (0.9.0) + builder (~> 2.1.2) + diff-lcs (~> 1.1.2) + gherkin (~> 2.2.2) + json (~> 1.4.6) + term-ansicolor (~> 1.0.5) + cucumber-rails (0.3.2) + cucumber (>= 0.8.0) + culerity (0.2.12) daemons (1.1.0) database_cleaner (0.5.2) diff-lcs (1.1.2) @@ -123,11 +140,18 @@ GEM factory_girl_rails (1.0) factory_girl (~> 1.3) rails (>= 3.0.0.beta4) + ffi (0.6.3) + rake (>= 0.8.7) + gherkin (2.2.4) + json (~> 1.4.6) + term-ansicolor (~> 1.0.5) + trollop (~> 1.16.2) haml (3.0.18) hashie (0.4.0) highline (1.6.1) i18n (0.4.1) json (1.4.6) + json_pure (1.4.6) linecache (0.43) mail (2.2.6.1) activesupport (>= 2.3.6) @@ -174,6 +198,7 @@ GEM rake (>= 0.8.4) thor (~> 0.14.0) rake (0.8.7) + redgreen (1.2.2) rest-client (1.6.1) mime-types (>= 1.16) rspec (2.0.0.beta.22) @@ -194,7 +219,13 @@ GEM ruby-debug-base (~> 0.10.3.0) ruby-debug-base (0.10.3) linecache (>= 0.3) + rubyzip (0.9.4) + selenium-webdriver (0.0.28) + ffi (>= 0.6.1) + json_pure + rubyzip subexec (0.0.4) + term-ansicolor (1.0.5) thin (1.2.7) daemons (>= 1.0.9) eventmachine (>= 0.12.6) @@ -202,6 +233,7 @@ GEM thor (0.14.0) treetop (1.4.8) polyglot (>= 0.3.1) + trollop (1.16.2) tzinfo (0.3.23) uuidtools (2.1.1) warden (0.10.7) @@ -224,7 +256,9 @@ DEPENDENCIES bson (= 1.0.7) bson_ext (= 1.0.7) bundler (= 1.0.0) + capybara (~> 0.3.9) carrierwave! + cucumber-rails (= 0.3.2) database_cleaner devise! em-http-request! @@ -240,6 +274,7 @@ DEPENDENCIES pubsubhubbub rails (= 3.0.0) redfinger! + redgreen roxml! rspec (>= 2.0.0.beta.17) rspec-rails (= 2.0.0.beta.17) diff --git a/config/cucumber.yml b/config/cucumber.yml new file mode 100644 index 000000000..621a14cea --- /dev/null +++ b/config/cucumber.yml @@ -0,0 +1,8 @@ +<% +rerun = File.file?('rerun.txt') ? IO.read('rerun.txt') : "" +rerun_opts = rerun.to_s.strip.empty? ? "--format #{ENV['CUCUMBER_FORMAT'] || 'progress'} features" : "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} #{rerun}" +std_opts = "--format #{ENV['CUCUMBER_FORMAT'] || 'progress'} --strict --tags ~@wip" +%> +default: <%= std_opts %> features +wip: --tags @wip:3 --wip features +rerun: <%= rerun_opts %> --format rerun --out rerun.txt --strict --tags ~@wip diff --git a/features/step_definitions/web_steps.rb b/features/step_definitions/web_steps.rb new file mode 100644 index 000000000..0f0af8aa2 --- /dev/null +++ b/features/step_definitions/web_steps.rb @@ -0,0 +1,219 @@ +# IMPORTANT: This file is generated by cucumber-rails - edit at your own peril. +# It is recommended to regenerate this file in the future when you upgrade to a +# newer version of cucumber-rails. Consider adding your own code to a new file +# instead of editing this one. Cucumber will automatically load all features/**/*.rb +# files. + + +require 'uri' +require 'cgi' +require File.expand_path(File.join(File.dirname(__FILE__), "..", "support", "paths")) + +module WithinHelpers + def with_scope(locator) + locator ? within(locator) { yield } : yield + end +end +World(WithinHelpers) + +Given /^(?:|I )am on (.+)$/ do |page_name| + visit path_to(page_name) +end + +When /^(?:|I )go to (.+)$/ do |page_name| + visit path_to(page_name) +end + +When /^(?:|I )press "([^"]*)"(?: within "([^"]*)")?$/ do |button, selector| + with_scope(selector) do + click_button(button) + end +end + +When /^(?:|I )follow "([^"]*)"(?: within "([^"]*)")?$/ do |link, selector| + with_scope(selector) do + click_link(link) + end +end + +When /^(?:|I )fill in "([^"]*)" with "([^"]*)"(?: within "([^"]*)")?$/ do |field, value, selector| + with_scope(selector) do + fill_in(field, :with => value) + end +end + +When /^(?:|I )fill in "([^"]*)" for "([^"]*)"(?: within "([^"]*)")?$/ do |value, field, selector| + with_scope(selector) do + fill_in(field, :with => value) + end +end + +# Use this to fill in an entire form with data from a table. Example: +# +# When I fill in the following: +# | Account Number | 5002 | +# | Expiry date | 2009-11-01 | +# | Note | Nice guy | +# | Wants Email? | | +# +# TODO: Add support for checkbox, select og option +# based on naming conventions. +# +When /^(?:|I )fill in the following(?: within "([^"]*)")?:$/ do |selector, fields| + with_scope(selector) do + fields.rows_hash.each do |name, value| + When %{I fill in "#{name}" with "#{value}"} + end + end +end + +When /^(?:|I )select "([^"]*)" from "([^"]*)"(?: within "([^"]*)")?$/ do |value, field, selector| + with_scope(selector) do + select(value, :from => field) + end +end + +When /^(?:|I )check "([^"]*)"(?: within "([^"]*)")?$/ do |field, selector| + with_scope(selector) do + check(field) + end +end + +When /^(?:|I )uncheck "([^"]*)"(?: within "([^"]*)")?$/ do |field, selector| + with_scope(selector) do + uncheck(field) + end +end + +When /^(?:|I )choose "([^"]*)"(?: within "([^"]*)")?$/ do |field, selector| + with_scope(selector) do + choose(field) + end +end + +When /^(?:|I )attach the file "([^"]*)" to "([^"]*)"(?: within "([^"]*)")?$/ do |path, field, selector| + with_scope(selector) do + attach_file(field, path) + end +end + +Then /^(?:|I )should see JSON:$/ do |expected_json| + require 'json' + expected = JSON.pretty_generate(JSON.parse(expected_json)) + actual = JSON.pretty_generate(JSON.parse(response.body)) + expected.should == actual +end + +Then /^(?:|I )should see "([^"]*)"(?: within "([^"]*)")?$/ do |text, selector| + with_scope(selector) do + if page.respond_to? :should + page.should have_content(text) + else + assert page.has_content?(text) + end + end +end + +Then /^(?:|I )should see \/([^\/]*)\/(?: within "([^"]*)")?$/ do |regexp, selector| + regexp = Regexp.new(regexp) + with_scope(selector) do + if page.respond_to? :should + page.should have_xpath('//*', :text => regexp) + else + assert page.has_xpath?('//*', :text => regexp) + end + end +end + +Then /^(?:|I )should not see "([^"]*)"(?: within "([^"]*)")?$/ do |text, selector| + with_scope(selector) do + if page.respond_to? :should + page.should have_no_content(text) + else + assert page.has_no_content?(text) + end + end +end + +Then /^(?:|I )should not see \/([^\/]*)\/(?: within "([^"]*)")?$/ do |regexp, selector| + regexp = Regexp.new(regexp) + with_scope(selector) do + if page.respond_to? :should + page.should have_no_xpath('//*', :text => regexp) + else + assert page.has_no_xpath?('//*', :text => regexp) + end + end +end + +Then /^the "([^"]*)" field(?: within "([^"]*)")? should contain "([^"]*)"$/ do |field, selector, value| + with_scope(selector) do + field = find_field(field) + field_value = (field.tag_name == 'textarea') ? field.text : field.value + if field_value.respond_to? :should + field_value.should =~ /#{value}/ + else + assert_match(/#{value}/, field_value) + end + end +end + +Then /^the "([^"]*)" field(?: within "([^"]*)")? should not contain "([^"]*)"$/ do |field, selector, value| + with_scope(selector) do + field = find_field(field) + field_value = (field.tag_name == 'textarea') ? field.text : field.value + if field_value.respond_to? :should_not + field_value.should_not =~ /#{value}/ + else + assert_no_match(/#{value}/, field_value) + end + end +end + +Then /^the "([^"]*)" checkbox(?: within "([^"]*)")? should be checked$/ do |label, selector| + with_scope(selector) do + field_checked = find_field(label)['checked'] + if field_checked.respond_to? :should + field_checked.should be_true + else + assert field_checked + end + end +end + +Then /^the "([^"]*)" checkbox(?: within "([^"]*)")? should not be checked$/ do |label, selector| + with_scope(selector) do + field_checked = find_field(label)['checked'] + if field_checked.respond_to? :should + field_checked.should be_false + else + assert !field_checked + end + end +end + +Then /^(?:|I )should be on (.+)$/ do |page_name| + current_path = URI.parse(current_url).path + if current_path.respond_to? :should + current_path.should == path_to(page_name) + else + assert_equal path_to(page_name), current_path + end +end + +Then /^(?:|I )should have the following query string:$/ do |expected_pairs| + query = URI.parse(current_url).query + actual_params = query ? CGI.parse(query) : {} + expected_params = {} + expected_pairs.rows_hash.each_pair{|k,v| expected_params[k] = v.split(',')} + + if actual_params.respond_to? :should + actual_params.should == expected_params + else + assert_equal expected_params, actual_params + end +end + +Then /^show me the page$/ do + save_and_open_page +end diff --git a/features/support/env.rb b/features/support/env.rb new file mode 100644 index 000000000..fa71d7577 --- /dev/null +++ b/features/support/env.rb @@ -0,0 +1,44 @@ +# IMPORTANT: This file is generated by cucumber-rails - edit at your own peril. +# It is recommended to regenerate this file in the future when you upgrade to a +# newer version of cucumber-rails. Consider adding your own code to a new file +# instead of editing this one. Cucumber will automatically load all features/**/*.rb +# files. + +ENV["RAILS_ENV"] ||= "test" +require File.expand_path(File.dirname(__FILE__) + '/../../config/environment') + +require 'cucumber/formatter/unicode' # Remove this line if you don't want Cucumber Unicode support +require 'cucumber/rails/rspec' +require 'cucumber/rails/world' +require 'cucumber/web/tableish' + +require 'capybara/rails' +require 'capybara/cucumber' +require 'capybara/session' +require 'cucumber/rails/capybara_javascript_emulation' # Lets you click links with onclick javascript handlers without using @culerity or @javascript +# Capybara defaults to XPath selectors rather than Webrat's default of CSS3. In +# order to ease the transition to Capybara we set the default here. If you'd +# prefer to use XPath just remove this line and adjust any selectors in your +# steps to use the XPath syntax. +Capybara.default_selector = :css + +# If you set this to false, any error raised from within your app will bubble +# up to your step definition and out to cucumber unless you catch it somewhere +# on the way. You can make Rails rescue errors and render error pages on a +# per-scenario basis by tagging a scenario or feature with the @allow-rescue tag. +# +# If you set this to true, Rails will rescue all errors and render error +# pages, more or less in the same way your application would behave in the +# default production environment. It's not recommended to do this for all +# of your scenarios, as this makes it hard to discover errors in your application. +ActionController::Base.allow_rescue = false + +# How to clean your database when transactions are turned off. See +# http://github.com/bmabey/database_cleaner for more info. +if defined?(ActiveRecord::Base) + begin + require 'database_cleaner' + DatabaseCleaner.strategy = :truncation + rescue LoadError => ignore_if_database_cleaner_not_present + end +end diff --git a/features/support/paths.rb b/features/support/paths.rb new file mode 100644 index 000000000..06b3efb0b --- /dev/null +++ b/features/support/paths.rb @@ -0,0 +1,33 @@ +module NavigationHelpers + # Maps a name to a path. Used by the + # + # When /^I go to (.+)$/ do |page_name| + # + # step definition in web_steps.rb + # + def path_to(page_name) + case page_name + + when /the home\s?page/ + '/' + + # Add more mappings here. + # Here is an example that pulls values out of the Regexp: + # + # when /^(.*)'s profile page$/i + # user_profile_path(User.find_by_login($1)) + + else + begin + page_name =~ /the (.*) page/ + path_components = $1.split(/\s+/) + self.send(path_components.push('path').join('_').to_sym) + rescue Object => e + raise "Can't find mapping from \"#{page_name}\" to a path.\n" + + "Now, go and add a mapping in #{__FILE__}" + end + end + end +end + +World(NavigationHelpers) diff --git a/lib/tasks/cucumber.rake b/lib/tasks/cucumber.rake new file mode 100644 index 000000000..7db1a5570 --- /dev/null +++ b/lib/tasks/cucumber.rake @@ -0,0 +1,53 @@ +# IMPORTANT: This file is generated by cucumber-rails - edit at your own peril. +# It is recommended to regenerate this file in the future when you upgrade to a +# newer version of cucumber-rails. Consider adding your own code to a new file +# instead of editing this one. Cucumber will automatically load all features/**/*.rb +# files. + + +unless ARGV.any? {|a| a =~ /^gems/} # Don't load anything when running the gems:* tasks + +vendored_cucumber_bin = Dir["#{Rails.root}/vendor/{gems,plugins}/cucumber*/bin/cucumber"].first +$LOAD_PATH.unshift(File.dirname(vendored_cucumber_bin) + '/../lib') unless vendored_cucumber_bin.nil? + +begin + require 'cucumber/rake/task' + + namespace :cucumber do + Cucumber::Rake::Task.new({:ok => 'db:test:prepare'}, 'Run features that should pass') do |t| + t.binary = vendored_cucumber_bin # If nil, the gem's binary is used. + t.fork = true # You may get faster startup if you set this to false + t.profile = 'default' + end + + Cucumber::Rake::Task.new({:wip => 'db:test:prepare'}, 'Run features that are being worked on') do |t| + t.binary = vendored_cucumber_bin + t.fork = true # You may get faster startup if you set this to false + t.profile = 'wip' + end + + Cucumber::Rake::Task.new({:rerun => 'db:test:prepare'}, 'Record failing features and run only them if any exist') do |t| + t.binary = vendored_cucumber_bin + t.fork = true # You may get faster startup if you set this to false + t.profile = 'rerun' + end + + desc 'Run all features' + task :all => [:ok, :wip] + end + desc 'Alias for cucumber:ok' + task :cucumber => 'cucumber:ok' + + task :default => :cucumber + + task :features => :cucumber do + STDERR.puts "*** The 'features' task is deprecated. See rake -T cucumber ***" + end +rescue LoadError + desc 'cucumber rake task not available (cucumber not installed)' + task :cucumber do + abort 'Cucumber rake task is not available. Be sure to install cucumber as a gem or plugin' + end +end + +end diff --git a/script/cucumber b/script/cucumber new file mode 100755 index 000000000..7fa5c9208 --- /dev/null +++ b/script/cucumber @@ -0,0 +1,10 @@ +#!/usr/bin/env ruby + +vendored_cucumber_bin = Dir["#{File.dirname(__FILE__)}/../vendor/{gems,plugins}/cucumber*/bin/cucumber"].first +if vendored_cucumber_bin + load File.expand_path(vendored_cucumber_bin) +else + require 'rubygems' unless ENV['NO_RUBYGEMS'] + require 'cucumber' + load Cucumber::BINARY +end From 8a93c67166bd30bcab61349b748a9c83b81a6ff6 Mon Sep 17 00:00:00 2001 From: Stephen Caudill Date: Sat, 25 Sep 2010 15:20:08 -0400 Subject: [PATCH 305/449] Add the Hashrocket default step definitions Tweaked for mongomapper and diaspora --- features/step_definitions/debug_steps.rb | 4 ++ features/step_definitions/factory_steps.rb | 68 ++++++++++++++++++++++ features/step_definitions/scope_steps.rb | 30 ++++++++++ features/step_definitions/session_steps.rb | 26 +++++++++ features/support/paths.rb | 31 +++------- 5 files changed, 135 insertions(+), 24 deletions(-) create mode 100644 features/step_definitions/debug_steps.rb create mode 100644 features/step_definitions/factory_steps.rb create mode 100644 features/step_definitions/scope_steps.rb create mode 100644 features/step_definitions/session_steps.rb diff --git a/features/step_definitions/debug_steps.rb b/features/step_definitions/debug_steps.rb new file mode 100644 index 000000000..c56973edf --- /dev/null +++ b/features/step_definitions/debug_steps.rb @@ -0,0 +1,4 @@ +When 'I debug' do + debugger + true +end diff --git a/features/step_definitions/factory_steps.rb b/features/step_definitions/factory_steps.rb new file mode 100644 index 000000000..cf1495e99 --- /dev/null +++ b/features/step_definitions/factory_steps.rb @@ -0,0 +1,68 @@ +module FactoryMethods + def create_from_table(model_name, table, extra = {}) + factory_name = model_name.gsub(/\W+/, '_').downcase.singularize.to_sym + is_singular = model_name.to_s.singularize == model_name.to_s + hashes = if is_singular + if table.kind_of?(Hash) + [table] + else + [table.rows_hash] + end + else + table.hashes + end + klass = Factory.factories[factory_name].class_name.to_s.classify.constantize + @they = hashes.map do |hash| + hash = hash.merge(extra).inject({}) do |h,(k,v)| + k = k.gsub(/\W+/,'_') + v = v.split(/\s*,\s*/) if klass.serialized_attributes[k] == Array + h.update(k.to_sym => v) + end + object = Factory.build(factory_name, hash) + yield object if block_given? + object.save! + object + end + if is_singular + @it = @they.last + instance_variable_set("@#{factory_name}", @it) + end + end +end + +World(FactoryMethods) + +Given %r{^I have a (.+)$} do |model_name| + create_from_table(model_name, {}, 'user' => @me) +end + +Given %r{^I have the following (.+):$} do |child, table| + Given "that me has the following #{child}:", table +end + +Given %r{^the following (.+):$} do |model_name, table| + create_from_table(model_name, table) +end + +Given %r{^that (.+) has the following (.+):$} do |parent, child, table| + child= child.gsub(/\W+/,'_') + parent = parent.gsub(/\W+/,'_').downcase.sub(/^_/, '') + parent_instance = instance_variable_get("@#{parent}") + parent_class = parent_instance.class + if assoc = parent_class.reflect_on_association(child.to_sym) || parent_class.reflect_on_association(child.pluralize.to_sym) + parent = (assoc.options[:as] || parent).to_s + child = (assoc.options[:class_name] || child).to_s + end + if child.classify.constantize.method_defined?(parent.pluralize) + create_from_table(child, table, parent.pluralize => [parent_instance]) + elsif child.classify.constantize.method_defined?(parent) + create_from_table(child, table, parent => parent_instance) + else + create_from_table(child, table) + if assoc.macro == :has_many + parent_instance.send("#{assoc.name}=", @they) + else + parent_instance.send("#{assoc.name}=", @they.first) + end + end +end diff --git a/features/step_definitions/scope_steps.rb b/features/step_definitions/scope_steps.rb new file mode 100644 index 000000000..cb39d33ad --- /dev/null +++ b/features/step_definitions/scope_steps.rb @@ -0,0 +1,30 @@ +module SectionLocator + + def within_parent(content, elements = ['*'], &block) + expr = %(//*[(#{elements.join('|')})/descendant-or-self::*[contains(., "#{content}")]]) + within(expr, &block) + end + +end + +World(SectionLocator) + +sections = %w(h1 h2 h3 h4 h5 h6 legend caption dt strong) + +When /^(.*) in the "([^\"]*)" section$/ do |action, title| + within_parent(title, sections) do + When action + end +end + +When /^(.*) in the "([^\"]*)" section:$/ do |action, title, table| + within_parent(title, sections) do + When "#{action}:", table + end +end + +When /^(.*) in the "([^\"]*)" row$/ do |action, title| + within_parent(title, %w(th td)) do + When action + end +end diff --git a/features/step_definitions/session_steps.rb b/features/step_definitions/session_steps.rb new file mode 100644 index 000000000..abc9e87df --- /dev/null +++ b/features/step_definitions/session_steps.rb @@ -0,0 +1,26 @@ +Given /^I am signed in as the following (\w+):$/ do |role, table| + Given %(the following #{role}:), table + @me = @it + Given 'I am signed in' +end + +Given /^I (?:am signed|sign) in as an? (\w+)$/ do |role| + @me = Factory(role.to_sym) + Given 'I am signed in' +end + + +Given 'I am signed in' do + @me ||= Factory(:user) + When %(I go to the new user session page) + When %(I fill in "Username" with "#{@me.username}") + When %(I fill in "Password" with "#{@me.password}") + When %(I press "Sign in") +end + + +When /^I sign in as "([^"]*)"$/ do |email| + @me = User.find_by_email(email) + @me.password ||= 'password' + Given 'I am signed in' +end diff --git a/features/support/paths.rb b/features/support/paths.rb index 06b3efb0b..3d3f64724 100644 --- a/features/support/paths.rb +++ b/features/support/paths.rb @@ -1,31 +1,14 @@ module NavigationHelpers - # Maps a name to a path. Used by the - # - # When /^I go to (.+)$/ do |page_name| - # - # step definition in web_steps.rb - # def path_to(page_name) case page_name - - when /the home\s?page/ - '/' - - # Add more mappings here. - # Here is an example that pulls values out of the Regexp: - # - # when /^(.*)'s profile page$/i - # user_profile_path(User.find_by_login($1)) - + when /^its ([\w ]+) page$/ + send("#{$1.gsub(/\W+/, '_')}_path", @it) + when /^the ([\w ]+) page$/ + send("#{$1.gsub(/\W+/, '_')}_path") + when /^"(\/.*)"/ + $1 else - begin - page_name =~ /the (.*) page/ - path_components = $1.split(/\s+/) - self.send(path_components.push('path').join('_').to_sym) - rescue Object => e - raise "Can't find mapping from \"#{page_name}\" to a path.\n" + - "Now, go and add a mapping in #{__FILE__}" - end + raise "Can't find mapping from \"#{page_name}\" to a path." end end end From 9038d6b0ed6e05c48cb5b2af876dc6eda77c24aa Mon Sep 17 00:00:00 2001 From: Stephen Caudill Date: Sat, 25 Sep 2010 15:21:19 -0400 Subject: [PATCH 306/449] Allow connections to be passed through to Selenium --- features/support/env.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/features/support/env.rb b/features/support/env.rb index fa71d7577..4774a3d27 100644 --- a/features/support/env.rb +++ b/features/support/env.rb @@ -22,6 +22,8 @@ require 'cucumber/rails/capybara_javascript_emulation' # Lets you click links wi # steps to use the XPath syntax. Capybara.default_selector = :css +WebMock.disable_net_connect!(:allow_localhost => true) + # If you set this to false, any error raised from within your app will bubble # up to your step definition and out to cucumber unless you catch it somewhere # on the way. You can make Rails rescue errors and render error pages on a From 5f2d4ba07318866c6d95a2ad0cf69f030a0836e7 Mon Sep 17 00:00:00 2001 From: Stephen Caudill Date: Sat, 25 Sep 2010 15:22:10 -0400 Subject: [PATCH 307/449] Use the mongo_mapper and cucumber Cleaner strategy --- features/support/env.rb | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/features/support/env.rb b/features/support/env.rb index 4774a3d27..bcb1fdd00 100644 --- a/features/support/env.rb +++ b/features/support/env.rb @@ -37,10 +37,9 @@ ActionController::Base.allow_rescue = false # How to clean your database when transactions are turned off. See # http://github.com/bmabey/database_cleaner for more info. -if defined?(ActiveRecord::Base) - begin - require 'database_cleaner' - DatabaseCleaner.strategy = :truncation - rescue LoadError => ignore_if_database_cleaner_not_present - end +begin + require 'database_cleaner' + require 'database_cleaner/cucumber' + DatabaseCleaner.strategy = :truncation + DatabaseCleaner.orm = "mongo_mapper" end From 3e499c0f1b8a5fd97f607e7850223befb69d342c Mon Sep 17 00:00:00 2001 From: Stephen Caudill Date: Sat, 25 Sep 2010 21:29:42 -0400 Subject: [PATCH 308/449] Hack the rake tasks to run cucumber + rspec --- Rakefile | 1 + lib/tasks/cucumber.rake | 10 ++++++---- lib/tasks/rspec.rake | 3 --- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Rakefile b/Rakefile index c9b50786e..f00478e2e 100644 --- a/Rakefile +++ b/Rakefile @@ -10,4 +10,5 @@ require File.expand_path('../config/application', __FILE__) require 'rake' ENV['GNUPGHOME'] = File.expand_path("../../gpg/diaspora-#{Rails.env}/", __FILE__) + Diaspora::Application.load_tasks diff --git a/lib/tasks/cucumber.rake b/lib/tasks/cucumber.rake index 7db1a5570..15d405ad4 100644 --- a/lib/tasks/cucumber.rake +++ b/lib/tasks/cucumber.rake @@ -14,19 +14,19 @@ begin require 'cucumber/rake/task' namespace :cucumber do - Cucumber::Rake::Task.new({:ok => 'db:test:prepare'}, 'Run features that should pass') do |t| + Cucumber::Rake::Task.new(:ok, 'Run features that should pass') do |t| t.binary = vendored_cucumber_bin # If nil, the gem's binary is used. t.fork = true # You may get faster startup if you set this to false t.profile = 'default' end - Cucumber::Rake::Task.new({:wip => 'db:test:prepare'}, 'Run features that are being worked on') do |t| + Cucumber::Rake::Task.new(:wip, 'Run features that are being worked on') do |t| t.binary = vendored_cucumber_bin t.fork = true # You may get faster startup if you set this to false t.profile = 'wip' end - Cucumber::Rake::Task.new({:rerun => 'db:test:prepare'}, 'Record failing features and run only them if any exist') do |t| + Cucumber::Rake::Task.new(:rerun, 'Record failing features and run only them if any exist') do |t| t.binary = vendored_cucumber_bin t.fork = true # You may get faster startup if you set this to false t.profile = 'rerun' @@ -38,7 +38,9 @@ begin desc 'Alias for cucumber:ok' task :cucumber => 'cucumber:ok' - task :default => :cucumber + Rake.application.instance_variable_get('@tasks').delete('default') + + task :default => [:cucumber, :spec] task :features => :cucumber do STDERR.puts "*** The 'features' task is deprecated. See rake -T cucumber ***" diff --git a/lib/tasks/rspec.rake b/lib/tasks/rspec.rake index 85ae513f6..35f0b8a98 100644 --- a/lib/tasks/rspec.rake +++ b/lib/tasks/rspec.rake @@ -32,13 +32,10 @@ MSG end end -Rake.application.instance_variable_get('@tasks').delete('default') - spec_prereq = Rails.root.join('config', 'database.yml').exist? ? "db:test:prepare" : :noop task :noop do end -task :default => :spec task :stats => "spec:statsetup" desc "Run all specs in spec directory (excluding plugin specs)" From 151a57cc93f02e06b6d2b5f55e4acbd79ad69069 Mon Sep 17 00:00:00 2001 From: Uiri Date: Sun, 26 Sep 2010 11:47:34 -0400 Subject: [PATCH 309/449] well, that explains why it was adding the url variable. Fixed so that now new pictures work too. --- app/controllers/users_controller.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 7041066bd..13d97479c 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -26,11 +26,15 @@ class UsersController < ApplicationController private def prep_image_url(params) + url = APP_CONFIG[:pod_url].chop if APP_CONFIG[:pod_url][-1,1] == '/' if params[:profile][:image_url].empty? params[:profile].delete(:image_url) else - url = APP_CONFIG[:pod_url].chop if APP_CONFIG[:pod_url][-1,1] == '/' - params[:profile][:image_url] = params[:profile][:image_url] + if /^http:\/\// =~ params[:profile][:image_url] + params[:profile][:image_url] = params[:profile][:image_url] + else + params[:profile][:image_url] = url + params[:profile][:image_url] + end end end From fd69f0201f2c16bcd5aef212efc75ee5d61c1c04 Mon Sep 17 00:00:00 2001 From: Stephen Caudill Date: Sat, 25 Sep 2010 21:05:01 -0400 Subject: [PATCH 310/449] User creates an aspect --- app/controllers/aspects_controller.rb | 8 +++++-- config/locales/diaspora/en.yml | 1 + features/step_definitions/custom_web_steps.rb | 17 ++++++++++++++ features/step_definitions/scope_steps.rb | 2 +- features/user_creates_an_aspect.feature | 23 +++++++++++++++++++ 5 files changed, 48 insertions(+), 3 deletions(-) create mode 100644 features/step_definitions/custom_web_steps.rb create mode 100644 features/user_creates_an_aspect.feature diff --git a/app/controllers/aspects_controller.rb b/app/controllers/aspects_controller.rb index ba9d3ffd9..9b0b5faa3 100644 --- a/app/controllers/aspects_controller.rb +++ b/app/controllers/aspects_controller.rb @@ -14,8 +14,12 @@ class AspectsController < ApplicationController end def create - @aspect = current_user.aspect params[:aspect] - flash[:notice] = I18n.t('aspects.create.success') + @aspect = current_user.aspect(params[:aspect]) + if @aspect.valid? + flash[:notice] = I18n.t('aspects.create.success') + else + flash[:notice] = I18n.t('aspects.create.failure') + end respond_with :location => aspects_manage_path end diff --git a/config/locales/diaspora/en.yml b/config/locales/diaspora/en.yml index 8e6542639..a6a98c7cd 100644 --- a/config/locales/diaspora/en.yml +++ b/config/locales/diaspora/en.yml @@ -86,6 +86,7 @@ en: create: "Create" create: success: "Click on the plus on the left side to tell Diaspora who can see your new aspect." + failure: "Aspect creation failed." destroy: success: "%{name} was successfully removed." update: diff --git a/features/step_definitions/custom_web_steps.rb b/features/step_definitions/custom_web_steps.rb new file mode 100644 index 000000000..e3f8bc373 --- /dev/null +++ b/features/step_definitions/custom_web_steps.rb @@ -0,0 +1,17 @@ +When /^(.*) in the header$/ do |action| + within('header') do + When action + end +end + +When /^(.*) in the modal window$/ do |action| + within('#fancybox-wrap') do + When action + end +end + +When /^(.*) in the aspect list$/ do |action| + within('#aspect_list') do + When action + end +end diff --git a/features/step_definitions/scope_steps.rb b/features/step_definitions/scope_steps.rb index cb39d33ad..43fe2f48a 100644 --- a/features/step_definitions/scope_steps.rb +++ b/features/step_definitions/scope_steps.rb @@ -9,7 +9,7 @@ end World(SectionLocator) -sections = %w(h1 h2 h3 h4 h5 h6 legend caption dt strong) +sections = %w(h1 h2 h3 h4 h5 h6 legend caption dt strong header) When /^(.*) in the "([^\"]*)" section$/ do |action, title| within_parent(title, sections) do diff --git a/features/user_creates_an_aspect.feature b/features/user_creates_an_aspect.feature new file mode 100644 index 000000000..27cb6f2f3 --- /dev/null +++ b/features/user_creates_an_aspect.feature @@ -0,0 +1,23 @@ +@aspects @javascript +Feature: User creates an aspect + In order to share with a limited group + As a User + I want to create a new aspect + + Scenario: success + Given I am signed in + And I follow "Manage" in the header + And I follow "Add a new aspect" + When I fill in "Name" with "Dorm Mates" in the modal window + And I press "Create" in the modal window + Then I should see "Manage Aspects" + And I should see "Dorm Mates" in the header + And I should see "Dorm Mates" in the aspect list + + Scenario: I omit the name + Given I am signed in + And I follow "Manage" in the header + And I follow "Add a new aspect" + When I press "Create" in the modal window + Then I should see "Manage Aspects" + And I should see "Aspect creation failed." From 6ffc03a4c92fed1d533921269ab503d2d10ab45f Mon Sep 17 00:00:00 2001 From: Dorian Date: Sat, 25 Sep 2010 12:35:20 +0200 Subject: [PATCH 311/449] Big clean up: delete trailing whitespace --- COPYRIGHT | 6 +- app/controllers/aspects_controller.rb | 2 +- app/models/person.rb | 6 +- app/models/user.rb | 10 +-- app/views/albums/_album.html.haml | 2 +- app/views/aspects/index.html.haml | 2 +- app/views/aspects/manage.html.haml | 8 +- app/views/comments/_comment.html.haml | 2 +- app/views/comments/_comments.html.haml | 2 +- app/views/devise/sessions/new.html.haml | 4 +- app/views/js/_websocket_js.haml | 20 ++--- app/views/layouts/application.html.haml | 10 +-- app/views/layouts/session_wall.html.haml | 10 +-- app/views/people/index.html.haml | 2 +- app/views/people/new.html.haml | 4 +- app/views/people/show.html.haml | 2 +- app/views/photos/_new_photo.haml | 6 +- app/views/photos/_photo.haml | 4 +- app/views/photos/show.html.haml | 2 +- app/views/posts/_post.html.haml | 4 +- app/views/publics/hcard.erb | 80 +++++++++---------- app/views/publics/host_meta.erb | 4 +- app/views/requests/_new_request.haml | 2 +- app/views/shared/_aspect_friends.haml | 6 +- app/views/shared/_publisher.haml | 2 +- app/views/shared/_reshare.haml | 2 +- .../status_messages/_status_message.html.haml | 8 +- app/views/status_messages/index.html.haml | 2 +- app/views/users/edit.html.haml | 2 +- config/app_config.yml.example | 2 +- config/environments/production.rb | 2 +- config/initializers/_load_app_config.rb | 2 +- config/locales/devise/devise.cy.yml | 72 ++++++++--------- config/locales/devise/devise.fi.yml | 2 +- config/locales/devise/devise.sv.yml | 2 +- config/locales/diaspora/cy.yml | 2 +- config/locales/diaspora/de.yml | 6 +- config/locales/diaspora/en.yml | 2 +- config/locales/diaspora/es.yml | 6 +- config/locales/diaspora/fr-informal.yml | 2 +- config/locales/diaspora/fr.yml | 2 +- config/locales/diaspora/it.yml | 2 +- config/locales/diaspora/ro.yml | 2 +- config/locales/diaspora/ru.yml | 2 +- config/locales/diaspora/sv.yml | 2 +- config/routes.rb | 2 +- config/sprinkle/packages/ruby.rb | 2 +- lib/diaspora/user/friending.rb | 4 +- lib/tasks/db.rake | 10 +-- public/javascripts/aspect-edit.js | 20 ++--- public/javascripts/view.js | 8 +- public/stylesheets/sass/application.sass | 44 +++++----- public/stylesheets/sass/sessions.sass | 4 +- spec/fixtures/evan_hcard | 2 +- spec/fixtures/hcard_response | 80 +++++++++---------- spec/fixtures/host_xrd | 2 +- spec/misc_spec.rb | 2 +- spec/models/request_spec.rb | 2 +- spec/models/user_spec.rb | 2 +- ubuntu-setup.bash | 36 ++++----- 60 files changed, 273 insertions(+), 273 deletions(-) diff --git a/COPYRIGHT b/COPYRIGHT index f1bed1a6b..b150ae948 100644 --- a/COPYRIGHT +++ b/COPYRIGHT @@ -16,8 +16,8 @@ including the two. You must obey the GNU Affero General Public License V3 or later in all respects for all of the code used other than OpenSSL or the components mentioned -above. If you modify file(s) with this exception, you may extend this -exception to your version of the file(s), but you are not obligated to +above. If you modify file(s) with this exception, you may extend this +exception to your version of the file(s), but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your -version. If you delete this exception statement from all source files in the +version. If you delete this exception statement from all source files in the program, then also delete it here. diff --git a/app/controllers/aspects_controller.rb b/app/controllers/aspects_controller.rb index 9b0b5faa3..80e4c7d0d 100644 --- a/app/controllers/aspects_controller.rb +++ b/app/controllers/aspects_controller.rb @@ -33,7 +33,7 @@ class AspectsController < ApplicationController begin current_user.drop_aspect @aspect flash[:notice] = i18n.t 'aspects.destroy.success',:name => @aspect.name - rescue RuntimeError => e + rescue RuntimeError => e flash[:error] = e.message end diff --git a/app/models/person.rb b/app/models/person.rb index 38a55db2b..9527a7bb7 100644 --- a/app/models/person.rb +++ b/app/models/person.rb @@ -78,7 +78,7 @@ class Person def self.by_webfinger( identifier, opts = {}) #need to check if this is a valid email structure, maybe should do in JS local_person = Person.first(:diaspora_handle => identifier.gsub('acct:', '').to_s.downcase) - + if local_person Rails.logger.info("Do not need to webfinger, found a local person #{local_person.real_name}") local_person @@ -100,9 +100,9 @@ class Person new_person = Person.new public_key_entry = profile.links.select{|x| x.rel == 'diaspora-public-key'} - + return nil unless public_key_entry - + pubkey = public_key_entry.first.href new_person.exported_key = Base64.decode64 pubkey diff --git a/app/models/user.rb b/app/models/user.rb index ade7b7a2a..6f74fa8de 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -66,7 +66,7 @@ class User def drop_aspect( aspect ) if aspect.people.size == 0 aspect.destroy - else + else raise "Aspect not empty" end end @@ -106,11 +106,11 @@ class User intitial_post(class_name, aspect_ids, options) end - def intitial_post(class_name, aspect_ids, options = {}) + def intitial_post(class_name, aspect_ids, options = {}) post = build_post(class_name, options) post.socket_to_uid(id, :aspect_ids => aspect_ids) if post.respond_to?(:socket_to_uid) push_to_aspects(post, aspect_ids) - post + post end def repost( post, options = {} ) @@ -137,9 +137,9 @@ class User end aspect_ids.each do |aspect_id| - unless self.aspects.find(aspect_id) + unless self.aspects.find(aspect_id) raise ArgumentError.new("Cannot post to an aspect you do not own.") - end + end end aspect_ids diff --git a/app/views/albums/_album.html.haml b/app/views/albums/_album.html.haml index a2d2eb46b..4f41e5cfb 100644 --- a/app/views/albums/_album.html.haml +++ b/app/views/albums/_album.html.haml @@ -15,4 +15,4 @@ %div.image_cycle - for photo in post.photos[0..3] = link_to (image_tag photo.url(:thumb_large)), album_path(post, :aspect => @aspect) - + diff --git a/app/views/aspects/index.html.haml b/app/views/aspects/index.html.haml index 47a68ffeb..11275b6b4 100644 --- a/app/views/aspects/index.html.haml +++ b/app/views/aspects/index.html.haml @@ -5,7 +5,7 @@ - content_for :page_title do = link_to t('.photos'), albums_path(:aspect => @aspect) - + - content_for :left_pane do = render "shared/aspect_friends" diff --git a/app/views/aspects/manage.html.haml b/app/views/aspects/manage.html.haml index af64fcc23..043ce3308 100644 --- a/app/views/aspects/manage.html.haml +++ b/app/views/aspects/manage.html.haml @@ -3,7 +3,7 @@ -# the COPYRIGHT file. -- content_for :head do +- content_for :head do = javascript_include_tag 'jquery-ui-1.8.4.custom.min.js' = javascript_include_tag 'aspect-edit.js' @@ -34,7 +34,7 @@ %ul#aspect_list - for aspect in @aspects %li.aspect - + .aspect_name %span.edit_name_field %h1{:contenteditable => true}= aspect.name @@ -44,9 +44,9 @@ %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} - + -if aspect.people.size < 1 %li.grey Drag to add people diff --git a/app/views/comments/_comment.html.haml b/app/views/comments/_comment.html.haml index 4fd46eb56..2c233f1dc 100644 --- a/app/views/comments/_comment.html.haml +++ b/app/views/comments/_comment.html.haml @@ -3,7 +3,7 @@ -# the COPYRIGHT file. -%li.comment{:id => post.id} +%li.comment{:id => post.id} = person_image_tag(post.person) %span.from = link_to post.person.real_name, post.person diff --git a/app/views/comments/_comments.html.haml b/app/views/comments/_comments.html.haml index fc5c64da7..87e1c1db1 100644 --- a/app/views/comments/_comments.html.haml +++ b/app/views/comments/_comments.html.haml @@ -9,4 +9,4 @@ = render 'comments/comment', :post => comment %li.comment.show = render 'comments/new_comment', :post => post - + diff --git a/app/views/devise/sessions/new.html.haml b/app/views/devise/sessions/new.html.haml index a2de719b5..5803415b4 100644 --- a/app/views/devise/sessions/new.html.haml +++ b/app/views/devise/sessions/new.html.haml @@ -1,7 +1,7 @@ %h1 This is a technology preview, do not provide any private information. -%h3 - your account may be deleted until we move into a more stable development period. +%h3 + your account may be deleted until we move into a more stable development period. %h3 USE AT YOUR OWN RISK!! = form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f| diff --git a/app/views/js/_websocket_js.haml b/app/views/js/_websocket_js.haml index 33af68cce..45a358652 100644 --- a/app/views/js/_websocket_js.haml +++ b/app/views/js/_websocket_js.haml @@ -19,18 +19,18 @@ if (obj['class']=="retractions"){ processRetraction(obj['post_id']); - + }else if (obj['class']=="comments"){ - processComment(obj['post_id'], obj['html']) - + processComment(obj['post_id'], obj['html']) + }else if (obj['class']=='photos' && onPageForClass('albums')){ processPhotoInAlbum(obj['photo_hash']) }else{ processPost(obj['class'], obj['html'], obj['aspect_ids']) } - - }; + + }; ws.onclose = function() { debug("socket closed"); }; ws.onopen = function() { ws.send(location.pathname); @@ -66,7 +66,7 @@ $(html).fadeIn("fast", function(){ $("#stream label:first").inFieldLabels(); }) - ); + ); } } @@ -77,13 +77,13 @@ html = "

" + " $("#thumbnails").append( $(html) ) $("#"+ photoHash['id'] + " img").load( function() { $(this).fadeIn("slow"); }); } - + function onPageForClass(className){ return (location.href.indexOf(className) != -1 ); } @@ -100,9 +100,9 @@ } function onPageForAspect(aspectId){ - return (location.href.indexOf(aspectId) != -1 ) + return (location.href.indexOf(aspectId) != -1 ) } - + function onPageOne() { var c = document.location.search.charAt(document.location.search.length-1); return ((c =='') || (c== '1')); diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index 7a48d7ed7..71976017c 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -10,24 +10,24 @@ = "#{current_user.real_name} | diaspora" if current_user %meta{"http-equiv"=>"Content-Type", :content=>"text/html; charset=utf-8"}/ - + = stylesheet_link_tag "blueprint/screen", :media => 'screen' = stylesheet_link_tag "application", "ui" - = stylesheet_link_tag "/../javascripts/fancybox/jquery.fancybox-1.3.1" - = stylesheet_link_tag "fileuploader" + = stylesheet_link_tag "/../javascripts/fancybox/jquery.fancybox-1.3.1" + = stylesheet_link_tag "fileuploader" /= javascript_include_tag "http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" = javascript_include_tag 'jquery-1.4.2.min', 'rails' = javascript_include_tag 'jquery.infieldlabel', 'jquery.cycle/jquery.cycle.min.js' - + = javascript_include_tag 'fancybox/jquery.fancybox-1.3.1.pack' = javascript_include_tag 'fileuploader' = javascript_include_tag 'view', 'image_picker', 'stream' = render 'js/websocket_js' - + = csrf_meta_tag = yield(:head) diff --git a/app/views/layouts/session_wall.html.haml b/app/views/layouts/session_wall.html.haml index 351daee0e..5611fd479 100644 --- a/app/views/layouts/session_wall.html.haml +++ b/app/views/layouts/session_wall.html.haml @@ -10,7 +10,7 @@ DIASPORA | login %meta{"http-equiv"=>"Content-Type", :content=>"text/html; charset=utf-8"}/ %meta{"http-equiv"=> "X-UA-Compatible", :content =>"chrome=1" } - + = stylesheet_link_tag "sessions" /= javascript_include_tag"http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" = javascript_include_tag 'jquery142' @@ -18,10 +18,10 @@ :javascript $(document).ready(function(){ - $("#user_username").focus(); + $("#user_username").focus(); $("label").inFieldLabels(); }); - + = csrf_meta_tag = yield(:head) @@ -44,11 +44,11 @@ - + - flash.each do |name, msg| = content_tag :div, msg, :id => "flash_#{name}" %div#huge_text DIASPORA* = yield - + /= link_to "signup", "/signup" diff --git a/app/views/people/index.html.haml b/app/views/people/index.html.haml index 2cd1dc4a7..c8425551d 100644 --- a/app/views/people/index.html.haml +++ b/app/views/people/index.html.haml @@ -21,5 +21,5 @@ %ul#stream - for person in @people = render 'people/person', :person => person - + = will_paginate @people diff --git a/app/views/people/new.html.haml b/app/views/people/new.html.haml index 25821ed37..2b635e997 100644 --- a/app/views/people/new.html.haml +++ b/app/views/people/new.html.haml @@ -15,13 +15,13 @@ = 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 diff --git a/app/views/people/show.html.haml b/app/views/people/show.html.haml index 23e6ea64d..3fc80cfd7 100644 --- a/app/views/people/show.html.haml +++ b/app/views/people/show.html.haml @@ -28,7 +28,7 @@ = 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 diff --git a/app/views/photos/_new_photo.haml b/app/views/photos/_new_photo.haml index abb8cf528..7c3e7e76e 100644 --- a/app/views/photos/_new_photo.haml +++ b/app/views/photos/_new_photo.haml @@ -4,14 +4,14 @@ :javascript - function createUploader(){ + function createUploader(){ var uploader = new qq.FileUploader({ element: document.getElementById('file-upload'), params: {'album_id' : "#{@album.id}"}, allowedExtensions: ['jpg', 'jpeg', 'png', 'gif'], action: "#{photos_path}" - }); + }); } - window.onload = createUploader; + window.onload = createUploader; #file-upload diff --git a/app/views/photos/_photo.haml b/app/views/photos/_photo.haml index ae8829c61..9fadad187 100644 --- a/app/views/photos/_photo.haml +++ b/app/views/photos/_photo.haml @@ -17,9 +17,9 @@ %br = render "albums/album", :post => post.album, :current_user => current_user = link_to (image_tag post.url(:thumb_medium)), object_path(post) - + .info = link_to(how_long_ago(post), photo_path(post)) \-- = link_to "#{t('.show_comments')} (#{post.comments.count})", '#', :class => "show_post_comments" - = render "comments/comments", :post => post + = render "comments/comments", :post => post diff --git a/app/views/photos/show.html.haml b/app/views/photos/show.html.haml index 21ce72181..08eba0c29 100644 --- a/app/views/photos/show.html.haml +++ b/app/views/photos/show.html.haml @@ -53,4 +53,4 @@ %h4{:class => "show_post_comments"} = "#{t('.comments')} (#{@photo.comments.count})" = render "comments/comments", :post => @photo - + diff --git a/app/views/posts/_post.html.haml b/app/views/posts/_post.html.haml index 217441465..5b4493286 100644 --- a/app/views/posts/_post.html.haml +++ b/app/views/posts/_post.html.haml @@ -4,6 +4,6 @@ %ul - %h3= link_to post.class, object_path(post) + %h3= link_to post.class, object_path(post) - for field in object_fields(post) - %li= "#{field}: #{post.attributes[field]}" + %li= "#{field}: #{post.attributes[field]}" diff --git a/app/views/publics/hcard.erb b/app/views/publics/hcard.erb index f8a3fef91..9e3f27796 100644 --- a/app/views/publics/hcard.erb +++ b/app/views/publics/hcard.erb @@ -1,42 +1,42 @@ -
-

<%=@person.real_name%>

-
-
-

User profile

-
-
Nickname
-
- <%= @person.real_name%> -
-
-
-
Full name
-
- <%= @person.profile.first_name %> -
+
+

<%=@person.real_name%>

+
+
+

User profile

+
+
Nickname
+
+ <%= @person.real_name%> +
+
+
+
Full name
+
+ <%= @person.profile.first_name %> +
-
-
Full name
-
- <%= @person.profile.last_name %> -
+
+
Full name
+
+ <%= @person.profile.last_name %> +
-
-
Full name
-
- <%= @person.real_name %> -
-
-
-
URL
-
- <%= @person.url%> -
-
-
-
Note
-
Diaspora is awesome! vi is better than emacs!
-
-
-
-
+
+
Full name
+
+ <%= @person.real_name %> +
+
+
+
URL
+
+ <%= @person.url%> +
+
+
+
Note
+
Diaspora is awesome! vi is better than emacs!
+
+
+
+
diff --git a/app/views/publics/host_meta.erb b/app/views/publics/host_meta.erb index e28fb6211..ff24552b9 100644 --- a/app/views/publics/host_meta.erb +++ b/app/views/publics/host_meta.erb @@ -1,8 +1,8 @@ - <%= terse_url(root_url) %> - Resource Descriptor diff --git a/app/views/requests/_new_request.haml b/app/views/requests/_new_request.haml index 70c204e7c..f47e47371 100644 --- a/app/views/requests/_new_request.haml +++ b/app/views/requests/_new_request.haml @@ -10,7 +10,7 @@ = form_for Request.new do |f| = f.error_messages - =t('.enter_a_diaspora_username') + =t('.enter_a_diaspora_username') %br %i= t '.your_diaspora_username_is', :diaspora_handle => current_user.diaspora_handle diff --git a/app/views/shared/_aspect_friends.haml b/app/views/shared/_aspect_friends.haml index 5e1dfe213..e27bb3fdb 100644 --- a/app/views/shared/_aspect_friends.haml +++ b/app/views/shared/_aspect_friends.haml @@ -10,11 +10,11 @@ -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'} #add_request_pane - = render "requests/new_request", :aspect => @aspect + = render "requests/new_request", :aspect => @aspect -else .clear - = link_to t('.add_friends'), aspects_manage_path + = link_to t('.add_friends'), aspects_manage_path diff --git a/app/views/shared/_publisher.haml b/app/views/shared/_publisher.haml index 040d3e3c2..e163a3ba0 100644 --- a/app/views/shared/_publisher.haml +++ b/app/views/shared/_publisher.haml @@ -18,5 +18,5 @@ %li = check_box_tag("aspect_ids[]", aspect.id, @aspect == :all || current_aspect?(aspect) ) = aspect.name - + = f.submit t('.share') diff --git a/app/views/shared/_reshare.haml b/app/views/shared/_reshare.haml index 0b4120d52..1861c7d27 100644 --- a/app/views/shared/_reshare.haml +++ b/app/views/shared/_reshare.haml @@ -19,7 +19,7 @@ %ul.reshare_box - for aspect in current_user.aspects_with_post( post.id ) - + %li.currently_sharing= aspect.name - for aspect in current_user.aspects diff --git a/app/views/status_messages/_status_message.html.haml b/app/views/status_messages/_status_message.html.haml index 4d73f4251..f136a4c33 100644 --- a/app/views/status_messages/_status_message.html.haml +++ b/app/views/status_messages/_status_message.html.haml @@ -9,17 +9,17 @@ .content %span.from - = link_to post.person.real_name, post.person + = link_to post.person.real_name, post.person = post.message - + .info %span.time= link_to(how_long_ago(post), object_path(post)) \-- = link_to "#{t('.show_comments')} (#{post.comments.count})", '#', :class => "show_post_comments" - = render "comments/comments", :post => post + = render "comments/comments", :post => post - if current_user.owns?(post) .destroy_link = link_to t('.delete'), status_message_path(post), :confirm => t('.are_you_sure'), :method => :delete, :remote => true, :class => "delete" - = render "shared/reshare", :post => post, :current_user => current_user + = render "shared/reshare", :post => post, :current_user => current_user diff --git a/app/views/status_messages/index.html.haml b/app/views/status_messages/index.html.haml index c2a579d87..42ed5fc09 100644 --- a/app/views/status_messages/index.html.haml +++ b/app/views/status_messages/index.html.haml @@ -6,7 +6,7 @@ %h1.big_text status messages = render "status_messages/new_status_message", :status_message => @status_message %ul#stream - + - for status_message in @status_messages = render "status_message", :post => status_message #pagination diff --git a/app/views/users/edit.html.haml b/app/views/users/edit.html.haml index 25668776f..46e966f54 100644 --- a/app/views/users/edit.html.haml +++ b/app/views/users/edit.html.haml @@ -49,7 +49,7 @@ = p.label :first_name = p.text_field :first_name, :value => @profile.first_name %p - = p.label :last_name + = p.label :last_name = p.text_field :last_name, :value => @profile.last_name #submit_block diff --git a/config/app_config.yml.example b/config/app_config.yml.example index 75568dd11..b2251fefc 100644 --- a/config/app_config.yml.example +++ b/config/app_config.yml.example @@ -13,7 +13,7 @@ default: pubsub_server: 'https://pubsubhubbub.appspot.com/' mongo_host: 'localhost' mongo_port: 27017 - + development: test: diff --git a/config/environments/production.rb b/config/environments/production.rb index 358e6e092..cb13c1d1c 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -15,7 +15,7 @@ Diaspora::Application.configure do # Specifies the header that your server uses for sending files #config.action_dispatch.x_sendfile_header = "X-Sendfile" - + config.active_support.deprecation = :notify # For nginx: diff --git a/config/initializers/_load_app_config.rb b/config/initializers/_load_app_config.rb index e739941e9..22bf14ead 100644 --- a/config/initializers/_load_app_config.rb +++ b/config/initializers/_load_app_config.rb @@ -20,7 +20,7 @@ else APP_CONFIG = all_envs['default'].symbolize_keys end -APP_CONFIG[:terse_pod_url] = APP_CONFIG[:pod_url].gsub(/(https?:|www\.)\/\//, '') +APP_CONFIG[:terse_pod_url] = APP_CONFIG[:pod_url].gsub(/(https?:|www\.)\/\//, '') APP_CONFIG[:terse_pod_url].chop! if APP_CONFIG[:terse_pod_url][-1, 1] == '/' puts "WARNING: Please modify your app_config.yml to have a proper pod_url!" if APP_CONFIG[:terse_pod_url] == "example.org" && Rails.env != :test diff --git a/config/locales/devise/devise.cy.yml b/config/locales/devise/devise.cy.yml index 5d6d6049a..2d09ac956 100644 --- a/config/locales/devise/devise.cy.yml +++ b/config/locales/devise/devise.cy.yml @@ -1,42 +1,42 @@ # Copyright (c) 2010, Diaspora Inc. This file is # licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - +# the COPYRIGHT file. -cy: - errors: - messages: - not_found: "ni chanfuwyd" - already_confirmed: "cadarnhawyd eisioes" - not_locked: "heb ei gloi" - - devise: - failure: + +cy: + errors: + messages: + not_found: "ni chanfuwyd" + already_confirmed: "cadarnhawyd eisioes" + not_locked: "heb ei gloi" + + devise: + failure: unauthenticated: "Mae angen i chi arwyddo i mewn neu ymuno cyn parhau." unconfirmed: "Rhaid i chi gadarnhau eich cyfrif cyn parhau." locked: "Mae eich cyfrif wedi'i gloi." - invalid: "E-bost neu gyfrinair annilys." - invalid_token: "Tocyn dilysu annilys." - timeout: "Mae eich sesiwn wedi dod i ben, arwyddwch i mewn eto i barhau." - inactive: "Nid yw eich cyfrif wedi'i actifadu." - sessions: - signed_in: "Arwyddwyd i fewn yn llwyddiannus." - signed_out: "Arwyddwyd allan yn llwyddiannus." - passwords: - send_instructions: "Byddwch yn derbyn e-bost â chyfarwyddiadau ar sut i gadarnhau eich cyfrif mewn ychydig funudau." - updated: "Newidiwyd eich cyfrinair yn llwyddiannus. Rydych chi wedi arwyddo i fewn." - confirmations: - send_instructions: "Byddwch yn derbyn e-bost â chyfarwyddiadau ar sut i gadarnhau eich cyfrif mewn ychydig funudau." - confirmed: "Cadarnhawyd eich cyfrif yn llwyddiannus. Rydych chi wedi arwyddo i fewn." - registrations: - signed_up: "Rydych chi wedi arwyddo i fyny yn llwyddiannus. Anfonwyd cadarnhad at eich e-bost os yw wedi'i alluogi." - updated: "Diweddarwyd eich cyfrif yn llwyddiannus." - destroyed: "Hwyl fawr! Canslwyd eich cyfrif yn llwyddiannus. Rydym yn gobeithio gweld chi eto yn fuan." - unlocks: - send_instructions: "Byddwch yn derbyn e-bost gyda cyfarwyddiadau ar sut i agor eich cyfrif mewn ychydig funudau." - unlocked: "Datglowyd eich cyfrif yn llwyddiannus. Rydych chi wedi arwyddo i fewn." - mailer: - confirmation_instructions: "Cyfarwyddiadau cadarnhad." - reset_password_instructions: "Ailosod cyfarwyddiadau cyfrinair" - unlock_instructions: "Cyfarwyddiadau Datgloi" - + invalid: "E-bost neu gyfrinair annilys." + invalid_token: "Tocyn dilysu annilys." + timeout: "Mae eich sesiwn wedi dod i ben, arwyddwch i mewn eto i barhau." + inactive: "Nid yw eich cyfrif wedi'i actifadu." + sessions: + signed_in: "Arwyddwyd i fewn yn llwyddiannus." + signed_out: "Arwyddwyd allan yn llwyddiannus." + passwords: + send_instructions: "Byddwch yn derbyn e-bost â chyfarwyddiadau ar sut i gadarnhau eich cyfrif mewn ychydig funudau." + updated: "Newidiwyd eich cyfrinair yn llwyddiannus. Rydych chi wedi arwyddo i fewn." + confirmations: + send_instructions: "Byddwch yn derbyn e-bost â chyfarwyddiadau ar sut i gadarnhau eich cyfrif mewn ychydig funudau." + confirmed: "Cadarnhawyd eich cyfrif yn llwyddiannus. Rydych chi wedi arwyddo i fewn." + registrations: + signed_up: "Rydych chi wedi arwyddo i fyny yn llwyddiannus. Anfonwyd cadarnhad at eich e-bost os yw wedi'i alluogi." + updated: "Diweddarwyd eich cyfrif yn llwyddiannus." + destroyed: "Hwyl fawr! Canslwyd eich cyfrif yn llwyddiannus. Rydym yn gobeithio gweld chi eto yn fuan." + unlocks: + send_instructions: "Byddwch yn derbyn e-bost gyda cyfarwyddiadau ar sut i agor eich cyfrif mewn ychydig funudau." + unlocked: "Datglowyd eich cyfrif yn llwyddiannus. Rydych chi wedi arwyddo i fewn." + mailer: + confirmation_instructions: "Cyfarwyddiadau cadarnhad." + reset_password_instructions: "Ailosod cyfarwyddiadau cyfrinair" + unlock_instructions: "Cyfarwyddiadau Datgloi" + diff --git a/config/locales/devise/devise.fi.yml b/config/locales/devise/devise.fi.yml index 9109b40a8..c77ead4b2 100644 --- a/config/locales/devise/devise.fi.yml +++ b/config/locales/devise/devise.fi.yml @@ -1,7 +1,7 @@ # Copyright (c) 2010, Diaspora Inc. This file is # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. -# Translator: jarkko moilanen, jm60697@gmail.com +# Translator: jarkko moilanen, jm60697@gmail.com fi: errors: diff --git a/config/locales/devise/devise.sv.yml b/config/locales/devise/devise.sv.yml index b434666ce..3c41ea81b 100644 --- a/config/locales/devise/devise.sv.yml +++ b/config/locales/devise/devise.sv.yml @@ -1,7 +1,7 @@ # Copyright (c) 2010, Diaspora Inc. This file is # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - + sv: errors: diff --git a/config/locales/diaspora/cy.yml b/config/locales/diaspora/cy.yml index b7d9c9af4..e0198b1b6 100644 --- a/config/locales/diaspora/cy.yml +++ b/config/locales/diaspora/cy.yml @@ -30,7 +30,7 @@ cy: new_album: create: "creu" add_a_new_album: "Ychwanegu albwm newydd" - show: + show: edit_album: "Golygu Albwm" albums: "albymau" updated: "diweddarwyd" diff --git a/config/locales/diaspora/de.yml b/config/locales/diaspora/de.yml index ae8fb13e3..9c7d67f4d 100644 --- a/config/locales/diaspora/de.yml +++ b/config/locales/diaspora/de.yml @@ -45,7 +45,7 @@ de: new_album: create: "erstellen" add_a_new_album: "Album hinzufügen" - show: + show: edit_album: "Album bearbeiten" albums: "Alben" updated: "aktualisiert" @@ -98,7 +98,7 @@ de: notice: "Du zeigst deinem Freund jetzt einen anderen Aspekt von dir." helper: remove: "entfernen" - aspect_not_empty: "Aspekt ist nicht leer" + aspect_not_empty: "Aspekt ist nicht leer" users: edit: cancel: "Abbrechen" @@ -132,7 +132,7 @@ de: delete_photo: "Foto löschen" photo: show_comments: "Kommentare anzeigen" - posted_a_new_photo_to: "neues Foto veröffentlicht bei" + posted_a_new_photo_to: "neues Foto veröffentlicht bei" new: new_photo: "Foto erstellen" back_to_list: "Zurück zur Liste" diff --git a/config/locales/diaspora/en.yml b/config/locales/diaspora/en.yml index a6a98c7cd..9db808746 100644 --- a/config/locales/diaspora/en.yml +++ b/config/locales/diaspora/en.yml @@ -45,7 +45,7 @@ en: new_album: create: "create" add_a_new_album: "Add a new album" - show: + show: edit_album: "Edit Album" albums: "albums" updated: "updated" diff --git a/config/locales/diaspora/es.yml b/config/locales/diaspora/es.yml index 5af6c70aa..1f6b6b2e7 100644 --- a/config/locales/diaspora/es.yml +++ b/config/locales/diaspora/es.yml @@ -45,7 +45,7 @@ es: new_album: create: "Crear" add_a_new_album: "Añade un nuevo álbum" - show: + show: edit_album: "Editar Álbum" albums: "álbumes" updated: "actualizar" @@ -167,7 +167,7 @@ es: message: "Mensaje" owner: "Dueño" helper: - no_message_to_display: "No hay mensajes que mostrar." + no_message_to_display: "No hay mensajes que mostrar." people: person: add_friend: "añadir amigo" @@ -178,7 +178,7 @@ es: diaspora_handle: "usuario en diaspora" thats_you: "ese eres tu!" friend_request_pending: "friend request pending" - you_have_a_friend_request_from_this_person: "you have a friend request from this person" + you_have_a_friend_request_from_this_person: "you have a friend request from this person" show: last_seen: "ultima vez visto: %{how_long_ago}" friends_since: "amigos desde: %{how_long_ago}" diff --git a/config/locales/diaspora/fr-informal.yml b/config/locales/diaspora/fr-informal.yml index f70812fdf..2342ff1ce 100644 --- a/config/locales/diaspora/fr-informal.yml +++ b/config/locales/diaspora/fr-informal.yml @@ -45,7 +45,7 @@ fr-informal: new_album: create: "créer" add_a_new_album: "Ajouter un nouvel album" - show: + show: edit_album: "Éditer l’album" albums: "albums" updated: "mis à jour" diff --git a/config/locales/diaspora/fr.yml b/config/locales/diaspora/fr.yml index 6d77dcf00..8a44e6dac 100644 --- a/config/locales/diaspora/fr.yml +++ b/config/locales/diaspora/fr.yml @@ -44,7 +44,7 @@ fr: new_album: create: "créer" add_a_new_album: "Ajouter un nouvel album" - show: + show: edit_album: "Éditer l’album" albums: "albums" updated: "mis à jour" diff --git a/config/locales/diaspora/it.yml b/config/locales/diaspora/it.yml index 418733b40..bb44c6f27 100644 --- a/config/locales/diaspora/it.yml +++ b/config/locales/diaspora/it.yml @@ -45,7 +45,7 @@ it: new_album: create: "crea" add_a_new_album: "Aggiungi un nuovo album" - show: + show: edit_album: "Modifica album" albums: "album" updated: "aggiornato" diff --git a/config/locales/diaspora/ro.yml b/config/locales/diaspora/ro.yml index c99bd2a85..5800f4a30 100644 --- a/config/locales/diaspora/ro.yml +++ b/config/locales/diaspora/ro.yml @@ -26,7 +26,7 @@ ro: new_album: create: "crează" add_a_new_album: "Album nou" - show: + show: edit_album: "Editare Album" albums: "albume" updated: "actualizat" diff --git a/config/locales/diaspora/ru.yml b/config/locales/diaspora/ru.yml index d0d9e8039..1b5d3b958 100644 --- a/config/locales/diaspora/ru.yml +++ b/config/locales/diaspora/ru.yml @@ -30,7 +30,7 @@ ru: new_album: create: "создать" add_a_new_album: "Добавить новый альбом" - show: + show: edit_album: "Редактировать альбом" albums: "альбомы" updated: "обновленные" diff --git a/config/locales/diaspora/sv.yml b/config/locales/diaspora/sv.yml index 1caf878b8..dfb8deb7f 100644 --- a/config/locales/diaspora/sv.yml +++ b/config/locales/diaspora/sv.yml @@ -3,7 +3,7 @@ # the COPYRIGHT file. -# Swedish localization file. +# Swedish localization file. # See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. sv: diff --git a/config/routes.rb b/config/routes.rb index 7f60bd63b..c2a38dbc6 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -29,7 +29,7 @@ Diaspora::Application.routes.draw do match 'logout', :to => 'devise/sessions#destroy', :as => "destroy_user_session" match 'signup', :to => 'registrations#new', :as => "new_user_registration" - match 'get_to_the_choppa', :to => redirect("/signup") + match 'get_to_the_choppa', :to => redirect("/signup") #public routes # match 'webfinger', :to => 'publics#webfinger' diff --git a/config/sprinkle/packages/ruby.rb b/config/sprinkle/packages/ruby.rb index 261cf3ffe..947732a79 100644 --- a/config/sprinkle/packages/ruby.rb +++ b/config/sprinkle/packages/ruby.rb @@ -41,7 +41,7 @@ package :diaspora_dependencies do end #package :diaspora do # description 'Diaspora' - + =begin package :rails do description 'Ruby on Rails' diff --git a/lib/diaspora/user/friending.rb b/lib/diaspora/user/friending.rb index 35695c546..0f6cc6c5c 100644 --- a/lib/diaspora/user/friending.rb +++ b/lib/diaspora/user/friending.rb @@ -7,7 +7,7 @@ module Diaspora module Friending def send_friend_request_to(desired_friend, aspect) # should have different exception types for these? - raise "You have already sent a friend request to that person!" if self.pending_requests.detect{ + raise "You have already sent a friend request to that person!" if self.pending_requests.detect{ |x| x.destination_url == desired_friend.receive_url } raise "You are already friends with that person!" if self.friends.detect{ |x| x.receive_url == desired_friend.receive_url} @@ -86,7 +86,7 @@ module Diaspora def remove_friend(bad_friend) raise "Friend not deleted" unless self.friend_ids.delete( bad_friend.id ) - aspects.each{|aspect| + aspects.each{|aspect| aspect.person_ids.delete( bad_friend.id )} self.save diff --git a/lib/tasks/db.rake b/lib/tasks/db.rake index 9c438ddb1..4b6202f29 100644 --- a/lib/tasks/db.rake +++ b/lib/tasks/db.rake @@ -22,7 +22,7 @@ namespace :db do require File.dirname(__FILE__) + '/../../db/seeds/backer' create end - + end desc 'Delete the collections in the current RAILS_ENV database' @@ -33,7 +33,7 @@ namespace :db do # Specifiy what models to remove # No! Drop the fucking database. - MongoMapper::connection.drop_database(MongoMapper::database.name) + MongoMapper::connection.drop_database(MongoMapper::database.name) puts 'Deleting tmp folder...' `rm -rf #{File.dirname(__FILE__)}/../../public/uploads/*` @@ -41,7 +41,7 @@ namespace :db do desc 'Purge and seed the current RAILS_ENV database using information from db/seeds.rb' task :reset do - + puts "Resetting the database for #{Rails.env}".upcase Rake::Task['db:purge'].invoke Rake::Task['db:seed:tom'].invoke @@ -54,7 +54,7 @@ namespace :db do Rake::Task['db:seed:dev'].invoke puts "you did it!" end - + task :fix_diaspora_handle do puts "fixing the people in this seed" require File.dirname(__FILE__) + '/../../config/environment' @@ -62,7 +62,7 @@ namespace :db do if person.owner person.url = APP_CONFIG[:pod_url] person.diaspora_handle = person.owner.diaspora_handle - person.save + person.save end } puts "everything should be peachy" diff --git a/public/javascripts/aspect-edit.js b/public/javascripts/aspect-edit.js index 9f9e5803e..cb36d394e 100644 --- a/public/javascripts/aspect-edit.js +++ b/public/javascripts/aspect-edit.js @@ -5,7 +5,7 @@ function decrementRequestsCounter() { var $new_requests = $(".new_requests"), - request_html = $new_requests.html(), + request_html = $new_requests.html(), old_request_count = request_html.match(/\d+/); if( old_request_count == 1 ) { @@ -24,11 +24,11 @@ $(function() { $("ul .person").draggable({ revert: true }); - + $("ul .requested_person").draggable({ revert: true }); - + $(".aspect ul").droppable({ hoverClass: 'active', drop: function(event, ui) { @@ -72,32 +72,32 @@ $(function() { if ($(ui.draggable[0]).hasClass('requested_person')){ $.ajax({ type: "DELETE", - url: "/requests/" + ui.draggable.attr('request_id'), + url: "/requests/" + ui.draggable.attr('request_id'), success: function () { decrementRequestsCounter(); } }); - + } else { $.ajax({ type: "DELETE", - url: "/people/" + ui.draggable.attr('id'), + url: "/people/" + ui.draggable.attr('id'), success: function () { alert("Removed Friend, proably want an undo countdown.") } }); - + } - $(ui.draggable[0]).fadeOut('slow'); // ui.draggable.fadeOut('slow') + $(ui.draggable[0]).fadeOut('slow'); // ui.draggable.fadeOut('slow') } }); $(".aspect h1").live( 'focus', function() { - var $this = $(this), - id = $this.closest("li").children("ul").attr("id"), + var $this = $(this), + id = $this.closest("li").children("ul").attr("id"), link = "/aspects/"+ id; $this.keypress(function(e) { diff --git a/public/javascripts/view.js b/public/javascripts/view.js index 092d69f16..1509145da 100644 --- a/public/javascripts/view.js +++ b/public/javascripts/view.js @@ -5,15 +5,15 @@ $(document).ready(function(){ - + $('#debug_info').click(function() { $('#debug_more').toggle('fast'); }); - + $("label").inFieldLabels(); - + $('#flash_notice, #flash_error, #flash_alert').delay(2500).slideUp(130); - + $("div.image_cycle").cycle({ fx: 'fade', random: 1, diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass index 1291313de..e9f9b2188 100644 --- a/public/stylesheets/sass/application.sass +++ b/public/stylesheets/sass/application.sass @@ -35,7 +35,7 @@ h1 h3 :font - :size 18px + :size 18px :weight bold .avatar @@ -54,7 +54,7 @@ h3 :left 50% :text :align center - :font + :font :size 14px :padding 3px 0 @@ -205,7 +205,7 @@ li.message .delete:hover :background #eee - + .content :padding :left 65px @@ -240,7 +240,7 @@ li.message :margin :top 5px :padding 0 - + :background :color #fafafa @@ -254,7 +254,7 @@ li.message :text-shadow 0 2px #fff :color #000 - > li + > li :font :weight bold @@ -285,11 +285,11 @@ form :size 120% :margin 1em :left 0em - + #user_name :margin :bottom 20px - + img :margin :right 10px @@ -305,7 +305,7 @@ form :color #000 span - :size small + :size small :font :weight normal :color #999 @@ -321,7 +321,7 @@ form :display inline :margin :right 1em - + #stream div.comments :display none @@ -336,7 +336,7 @@ input.comment_submit :display none :margin :right -10px - + ul.comment_set :margin 0 @@ -360,7 +360,7 @@ ul.comment_set .from :font :size 1em - + div.time :color #666 :font-size 70% @@ -385,7 +385,7 @@ ul.comment_set :list-style-type none :margin 0 :padding 0 - + #stream, #profile, .comments @@ -399,12 +399,12 @@ ul.comment_set :float left :margin :right 10px - + .pagination a :padding 3px - + .destroy_link, .request_button :position absolute :right 2em @@ -496,9 +496,9 @@ label p :position absolute - :left 0 + :left 0 :top 0 - + form :display inline @@ -526,7 +526,7 @@ label :-webkit-box-shadow 0 1px 0 #fff :border 1px solid #bbb :top 1px solid #666 - + #image_picker @@ -563,13 +563,13 @@ label .name :position absolute - :z-index 6 + :z-index 6 :padding 1em :background rgba(0,0,0,0.8) :bottom 20px :font :size 18px - + :text-shadow 0 2px 0 #000 .time @@ -586,7 +586,7 @@ label .field_with_submit input[type='text'] :width 82% - :display inline + :display inline h1.big_text :position relative @@ -615,7 +615,7 @@ h1.big_text :margin 0 :top 25px - :bottom 25px + :bottom 25px :min-height 36px @@ -815,7 +815,7 @@ h1.big_text .person, .requested_person :display inline-block - :padding 5px + :padding 5px :cursor move :margin 5px :z-index 10 diff --git a/public/stylesheets/sass/sessions.sass b/public/stylesheets/sass/sessions.sass index 326d46b0f..d7cf4644e 100644 --- a/public/stylesheets/sass/sessions.sass +++ b/public/stylesheets/sass/sessions.sass @@ -24,7 +24,7 @@ :left 50% :text :align center - :font + :font :size 14px :padding 3px 0 @@ -135,7 +135,7 @@ input[type='password'] .username :width 200px :display inline - + input :display inline :width 200px diff --git a/spec/fixtures/evan_hcard b/spec/fixtures/evan_hcard index d34408759..8944ef1e3 100644 --- a/spec/fixtures/evan_hcard +++ b/spec/fixtures/evan_hcard @@ -62,7 +62,7 @@

Creative Commons Attribution 3.0:w - + All Evan Prodromou content and data are available under the Creative Commons Attribution 3.0 license.

diff --git a/spec/fixtures/hcard_response b/spec/fixtures/hcard_response index d87957a93..bbd06c4bf 100644 --- a/spec/fixtures/hcard_response +++ b/spec/fixtures/hcard_response @@ -1,44 +1,44 @@ -
-

Alexander Hamiltom

-
-
-

User profile

-
-
Nickname
-
- Alexander Hamiltom -
-
-
-
Full name
-
- Alexander -
+
+

Alexander Hamiltom

+
+
+

User profile

+
+
Nickname
+
+ Alexander Hamiltom +
+
+
+
Full name
+
+ Alexander +
-
-
Full name
-
- Hamiltom -
+
+
Full name
+
+ Hamiltom +
-
-
Full name
-
- Alexander Hamiltom -
-
-
-
URL
-
- http://tom.joindiaspora.com/ -
-
-
-
Note
-
Diaspora is awesome! vi is better than emacs!
-
-
-
+
+
Full name
+
+ Alexander Hamiltom +
+
+
+
URL
+
+ http://tom.joindiaspora.com/ +
+
+
+
Note
+
Diaspora is awesome! vi is better than emacs!
+
+
+
-
+
diff --git a/spec/fixtures/host_xrd b/spec/fixtures/host_xrd index dcb67d767..8118fa94a 100644 --- a/spec/fixtures/host_xrd +++ b/spec/fixtures/host_xrd @@ -1,6 +1,6 @@ - Resource Descriptor diff --git a/spec/misc_spec.rb b/spec/misc_spec.rb index 65cb9da60..c4b2cc67c 100644 --- a/spec/misc_spec.rb +++ b/spec/misc_spec.rb @@ -44,7 +44,7 @@ describe 'making sure the spec runner works' do @user2.reload @aspect2.reload end - + it 'makes the first user friends with the second' do @aspect1.people.include?(@user2.person).should be_true end diff --git a/spec/models/request_spec.rb b/spec/models/request_spec.rb index 4e1380df1..c8fb8af05 100644 --- a/spec/models/request_spec.rb +++ b/spec/models/request_spec.rb @@ -17,7 +17,7 @@ describe Request do person_request.valid?.should be true end - it 'should generate xml for the User as a Person' do + it 'should generate xml for the User as a Person' do request = @user.send_friend_request_to Factory.create(:person), @aspect xml = request.to_xml.to_s diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index ad7070eaa..a2e964dfd 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -8,7 +8,7 @@ describe User do let(:user) { Factory(:user) } let(:aspect) { user.aspect(:name => 'heroes') } - describe '#diaspora_handle' do + describe '#diaspora_handle' do it 'uses the pod config url to set the diaspora_handle' do user.diaspora_handle.should == user.username + "@example.org" end diff --git a/ubuntu-setup.bash b/ubuntu-setup.bash index 08c839f33..117a78ed9 100755 --- a/ubuntu-setup.bash +++ b/ubuntu-setup.bash @@ -9,29 +9,29 @@ # the COPYRIGHT file. -# Set extented globbing +# Set extented globbing shopt -s extglob # Check if the user has sudo privileges. sudo -v >/dev/null 2>&1 || { echo $(whoami) has no sudo privileges ; exit 1; } -# Check if universal repository is enabled +# Check if universal repository is enabled grep -i universe /etc/apt/sources.list > /dev/null || { echo "Please enable universe repository" ; exit 1 ; } -# Check if wget is installed +# Check if wget is installed test wget || echo "Installing wget.." && sudo apt-get install wget && echo "Installed wget.." -# Install build tools +# Install build tools echo "Installing build tools.." sudo apt-get -y --no-install-recommends install build-essential libxslt1.1 libxslt1-dev libxml2 echo "..Done installing build tools" -# Install Ruby 1.8.7 -echo "Installing ruby-full Ruby 1.8.7.." +# Install Ruby 1.8.7 +echo "Installing ruby-full Ruby 1.8.7.." sudo apt-get -y --no-install-recommends install ruby-full echo "..Done installing Ruby" -# Install Rake +# Install Rake echo "Installing rake.." sudo apt-get -y --no-install-recommends install rake echo "..Done installing rake" @@ -79,7 +79,7 @@ echo "Fetching and installing ruby gems.." else # Old version echo "." - cd /tmp + cd /tmp wget http://production.cf.rubygems.org/rubygems/rubygems-1.3.7.tgz echo "." tar -xf rubygems-1.3.7.tgz @@ -88,10 +88,10 @@ echo "Fetching and installing ruby gems.." echo "." sudo ruby setup.rb echo "." - sudo ln -s /usr/bin/gem1.8 /usr/bin/gem - echo "." - fi -) + sudo ln -s /usr/bin/gem1.8 /usr/bin/gem + echo "." + fi +) echo "Done installing the gems.." # Install bundler @@ -102,22 +102,22 @@ echo "Installed bundler.." # Take a clone of Diaspora ( -# Check if the user is already in a cloned source if not clone the source -[[ $( basename $PWD ) == "diaspora" ]] && echo "Already in diaspora directory" || git clone http://github.com/diaspora/diaspora.git ; cd diaspora +# Check if the user is already in a cloned source if not clone the source +[[ $( basename $PWD ) == "diaspora" ]] && echo "Already in diaspora directory" || git clone http://github.com/diaspora/diaspora.git ; cd diaspora echo "Cloned the source.." -# Install extra gems +# Install extra gems cd diaspora echo "Installing more gems.." sudo bundle install echo "Installed." -# Install DB setup +# Install DB setup echo "Seting up DB.." rake db:seed:tom echo "DB ready. Login -> tom and password -> evankorth. More details ./diaspora/db/seeds/tom.rb." -# Run appserver +# Run appserver echo "Starting server" -bundle exec thin start +bundle exec thin start ) From d8c497177f32de1f6fa7a7e16dda7562bb8a4ef5 Mon Sep 17 00:00:00 2001 From: Dorian Date: Sat, 25 Sep 2010 23:15:04 +0200 Subject: [PATCH 312/449] Improve whitespace:cleanup and whitespace:retab --- lib/tasks/whitespace.rake | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/tasks/whitespace.rake b/lib/tasks/whitespace.rake index c5b9d4c6e..657054aa9 100644 --- a/lib/tasks/whitespace.rake +++ b/lib/tasks/whitespace.rake @@ -1,15 +1,18 @@ namespace :whitespace do desc 'Removes trailing whitespace' task :cleanup do - sh %{find . -name '*.rb' -exec sed -i '' 's/ *$//g' {} \\;} + sh %{for f in `find . -type f | grep -v -e '.git/' -e 'public/' -e '.png'`; + do cat $f | sed 's/[ \t]*$//' > tmp; cp tmp $f; rm tmp; echo -n .; + done} end desc 'Converts hard-tabs into two-space soft-tabs' task :retab do - sh %{find . -name '*.rb' -exec sed -i '' 's/\t/ /g' {} \\;} + sh %{for f in `find . -type f | grep -v -e '.git/' -e 'public/' -e '.png'`; + do cat $f | sed 's/\t/ /g' > tmp; cp tmp $f; rm tmp; echo -n .; + done} end desc 'Remove consecutive blank lines' task :scrub_gratuitous_newlines do sh %{find . -name '*.rb' -exec sed -i '' '/./,/^$/!d' {} \\;} end end - From 4223769df08e9c0933579742b90d2b343c5ccef2 Mon Sep 17 00:00:00 2001 From: Dorian Date: Sun, 26 Sep 2010 11:47:05 +0200 Subject: [PATCH 313/449] Improve task which remove consecutive blank lines --- lib/tasks/whitespace.rake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/tasks/whitespace.rake b/lib/tasks/whitespace.rake index 657054aa9..7af099dd6 100644 --- a/lib/tasks/whitespace.rake +++ b/lib/tasks/whitespace.rake @@ -13,6 +13,8 @@ namespace :whitespace do end desc 'Remove consecutive blank lines' task :scrub_gratuitous_newlines do - sh %{find . -name '*.rb' -exec sed -i '' '/./,/^$/!d' {} \\;} + sh %{for f in `find . -type f | grep -v -e '.git/' -e 'public/' -e '.png'`; + do cat $f | sed '/./,/^$/!d' > tmp; cp tmp $f; rm tmp; echo -n .; + done} end end From e792344c0e9d88a6eb774810f9e35d08c05cf519 Mon Sep 17 00:00:00 2001 From: Dorian Date: Sun, 26 Sep 2010 11:48:19 +0200 Subject: [PATCH 314/449] Use improved whitespace:scrub_gratuitous_newlines --- Capfile | 2 -- Gemfile | 1 - README.md | 2 -- Rakefile | 2 -- app/views/albums/_new_album.haml | 1 - app/views/albums/edit.html.haml | 1 - app/views/albums/index.html.haml | 1 - app/views/albums/show.html.haml | 3 --- app/views/aspects/_new_aspect.haml | 1 - app/views/aspects/index.html.haml | 2 -- app/views/aspects/manage.html.haml | 3 --- app/views/aspects/show.html.haml | 1 - app/views/comments/_comment.html.haml | 1 - app/views/comments/_comments.html.haml | 1 - app/views/comments/_new_comment.html.haml | 1 - app/views/js/_websocket_js.haml | 3 --- app/views/layouts/application.html.haml | 1 - app/views/layouts/session_wall.html.haml | 1 - app/views/people/index.html.haml | 1 - app/views/people/new.html.haml | 2 -- app/views/people/show.html.haml | 1 - app/views/photos/_new_photo.haml | 1 - app/views/photos/_photo.haml | 1 - app/views/photos/edit.html.haml | 1 - app/views/photos/new.html.haml | 1 - app/views/photos/show.html.haml | 2 -- app/views/posts/_debug.haml | 1 - app/views/posts/_post.html.haml | 1 - app/views/registrations/new.html.haml | 1 - app/views/requests/_new_request.haml | 1 - app/views/shared/_aspect_friends.haml | 1 - app/views/shared/_aspect_nav.haml | 1 - app/views/shared/_post_wrapper.haml | 1 - app/views/shared/_publisher.haml | 1 - app/views/shared/_reshare.haml | 2 -- app/views/shared/log.haml | 1 - app/views/status_messages/_new_status_message.haml | 1 - app/views/status_messages/_status_message.html.haml | 1 - app/views/status_messages/index.html.haml | 1 - app/views/users/edit.html.haml | 1 - config.ru | 2 -- config/app_config.yml.example | 1 - config/deploy_config.yml | 2 -- config/locales/devise/devise.cs.yml | 1 - config/locales/devise/devise.cy.yml | 1 - config/locales/devise/devise.de.yml | 1 - config/locales/devise/devise.en.yml | 1 - config/locales/devise/devise.fr-informal.yml | 1 - config/locales/devise/devise.fr.yml | 1 - config/locales/devise/devise.he.yml | 1 - config/locales/devise/devise.it.yml | 1 - config/locales/devise/devise.lt.yml | 1 - config/locales/devise/devise.pl.yml | 1 - config/locales/devise/devise.pt-BR.yml | 1 - config/locales/devise/devise.pt-PT.yml | 1 - config/locales/devise/devise.ro.yml | 1 - config/locales/devise/devise.ru.yml | 1 - config/locales/devise/devise.sv.yml | 1 - config/locales/diaspora/cs.yml | 1 - config/locales/diaspora/cy.yml | 1 - config/locales/diaspora/de.yml | 1 - config/locales/diaspora/en.yml | 1 - config/locales/diaspora/es.yml | 1 - config/locales/diaspora/fr-informal.yml | 1 - config/locales/diaspora/it.yml | 1 - config/locales/diaspora/lt.yml | 1 - config/locales/diaspora/pl.yml | 1 - config/locales/diaspora/pt-BR.yml | 1 - config/locales/diaspora/pt-PT.yml | 1 - config/locales/diaspora/ru.yml | 1 - config/locales/diaspora/sv.yml | 1 - config/selenium.yml | 2 -- config/sprinkle/conf/nginx.conf | 2 -- config/thin.yml | 2 -- lib/tasks/db.rake | 2 -- lib/tasks/rspec.rake | 2 -- ubuntu-setup.bash | 1 - 77 files changed, 97 deletions(-) diff --git a/Capfile b/Capfile index af77f235a..306a9d64b 100644 --- a/Capfile +++ b/Capfile @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - load 'deploy' if respond_to?(:namespace) # cap2 differentiator Dir['vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) } diff --git a/Gemfile b/Gemfile index 419f75094..7fde201c1 100644 --- a/Gemfile +++ b/Gemfile @@ -3,7 +3,6 @@ source 'http://rubygems.org' gem 'rails', '3.0.0' gem 'bundler', '1.0.0' - #Security gem 'devise', :git => 'http://github.com/BadMinus/devise.git' diff --git a/README.md b/README.md index 97ec66834..c8f193afe 100644 --- a/README.md +++ b/README.md @@ -32,8 +32,6 @@ We are continuing to build features and improve the code base. When we think it is ready for general use, we will post more final instructions. - - ## Resources We are maintaining a diff --git a/Rakefile b/Rakefile index f00478e2e..fa9be254a 100644 --- a/Rakefile +++ b/Rakefile @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - # Add your own tasks in files placed in lib/tasks ending in .rake, # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. diff --git a/app/views/albums/_new_album.haml b/app/views/albums/_new_album.haml index daefe15f3..e0212a6b4 100644 --- a/app/views/albums/_new_album.haml +++ b/app/views/albums/_new_album.haml @@ -2,7 +2,6 @@ -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - %h1=t('.add_a_new_album') = form_for Album.new do |f| diff --git a/app/views/albums/edit.html.haml b/app/views/albums/edit.html.haml index 4dfb2294c..67cc3071d 100644 --- a/app/views/albums/edit.html.haml +++ b/app/views/albums/edit.html.haml @@ -2,7 +2,6 @@ -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - .back= link_to "⇧ #{@album.name}", @album %h1.big_text diff --git a/app/views/albums/index.html.haml b/app/views/albums/index.html.haml index af83b53eb..2e680c110 100644 --- a/app/views/albums/index.html.haml +++ b/app/views/albums/index.html.haml @@ -2,7 +2,6 @@ -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - - content_for :head do :javascript $(document).ready(function(){ diff --git a/app/views/albums/show.html.haml b/app/views/albums/show.html.haml index 7b5e6c8be..4c9ba19b8 100644 --- a/app/views/albums/show.html.haml +++ b/app/views/albums/show.html.haml @@ -2,7 +2,6 @@ -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - :javascript $(document).ready(function(){ $(".image_thumb img").load( function() { @@ -25,8 +24,6 @@ = @album.name ="#{t('.updated')} #{how_long_ago(@album)}" - - .album_id{:id => @album.id, :style => "display:hidden;"} -unless current_user.owns? @album diff --git a/app/views/aspects/_new_aspect.haml b/app/views/aspects/_new_aspect.haml index 9f0b662dd..548abd0d1 100644 --- a/app/views/aspects/_new_aspect.haml +++ b/app/views/aspects/_new_aspect.haml @@ -2,7 +2,6 @@ -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - %h1=t('.add_a_new_aspect') = form_for Aspect.new do |f| = f.error_messages diff --git a/app/views/aspects/index.html.haml b/app/views/aspects/index.html.haml index 11275b6b4..ae24e8e3b 100644 --- a/app/views/aspects/index.html.haml +++ b/app/views/aspects/index.html.haml @@ -2,11 +2,9 @@ -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - - content_for :page_title do = link_to t('.photos'), albums_path(:aspect => @aspect) - - content_for :left_pane do = render "shared/aspect_friends" diff --git a/app/views/aspects/manage.html.haml b/app/views/aspects/manage.html.haml index 043ce3308..e08f6dabd 100644 --- a/app/views/aspects/manage.html.haml +++ b/app/views/aspects/manage.html.haml @@ -2,7 +2,6 @@ -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - - content_for :head do = javascript_include_tag 'jquery-ui-1.8.4.custom.min.js' = javascript_include_tag 'aspect-edit.js' @@ -29,8 +28,6 @@ - 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')) - - %ul#aspect_list - for aspect in @aspects %li.aspect diff --git a/app/views/aspects/show.html.haml b/app/views/aspects/show.html.haml index d4262f838..ae24e8e3b 100644 --- a/app/views/aspects/show.html.haml +++ b/app/views/aspects/show.html.haml @@ -2,7 +2,6 @@ -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - - content_for :page_title do = link_to t('.photos'), albums_path(:aspect => @aspect) diff --git a/app/views/comments/_comment.html.haml b/app/views/comments/_comment.html.haml index 2c233f1dc..03a2fcf61 100644 --- a/app/views/comments/_comment.html.haml +++ b/app/views/comments/_comment.html.haml @@ -2,7 +2,6 @@ -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - %li.comment{:id => post.id} = person_image_tag(post.person) %span.from diff --git a/app/views/comments/_comments.html.haml b/app/views/comments/_comments.html.haml index 87e1c1db1..aecfb4bf1 100644 --- a/app/views/comments/_comments.html.haml +++ b/app/views/comments/_comments.html.haml @@ -2,7 +2,6 @@ -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - %div.comments %ul.comment_set{:id => post.id} - for comment in post.comments diff --git a/app/views/comments/_new_comment.html.haml b/app/views/comments/_new_comment.html.haml index a4268082d..99c03f898 100644 --- a/app/views/comments/_new_comment.html.haml +++ b/app/views/comments/_new_comment.html.haml @@ -2,7 +2,6 @@ -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - = form_for Comment.new, :remote => true do |f| %p %label{:for => "comment_text_on_#{post.id}"} Comment diff --git a/app/views/js/_websocket_js.haml b/app/views/js/_websocket_js.haml index 45a358652..4677f6ce6 100644 --- a/app/views/js/_websocket_js.haml +++ b/app/views/js/_websocket_js.haml @@ -2,7 +2,6 @@ -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - = javascript_include_tag 'FABridge', 'swfobject', 'web_socket' :javascript WebSocket.__swfLocation = "/javascripts/WebSocketMain.swf"; @@ -29,7 +28,6 @@ processPost(obj['class'], obj['html'], obj['aspect_ids']) } - }; ws.onclose = function() { debug("socket closed"); }; ws.onopen = function() { @@ -37,7 +35,6 @@ debug("connected..."); }; - }); function processRetraction(post_id){ $('#' + post_id ).fadeOut(500, function(){ diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index 71976017c..fc063e0b6 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -2,7 +2,6 @@ -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - !!! %html %head diff --git a/app/views/layouts/session_wall.html.haml b/app/views/layouts/session_wall.html.haml index 5611fd479..29b863b32 100644 --- a/app/views/layouts/session_wall.html.haml +++ b/app/views/layouts/session_wall.html.haml @@ -2,7 +2,6 @@ -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - !!! %html %head diff --git a/app/views/people/index.html.haml b/app/views/people/index.html.haml index c8425551d..5981569b8 100644 --- a/app/views/people/index.html.haml +++ b/app/views/people/index.html.haml @@ -2,7 +2,6 @@ -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - - content_for :publish do %h1 Search diff --git a/app/views/people/new.html.haml b/app/views/people/new.html.haml index 2b635e997..0584732bc 100644 --- a/app/views/people/new.html.haml +++ b/app/views/people/new.html.haml @@ -2,7 +2,6 @@ -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - - title=t('.new_person') = form_for @person do |f| @@ -28,5 +27,4 @@ = p.text_field :last_name = f.submit - %p= link_to t('.back_to_list'), people_path diff --git a/app/views/people/show.html.haml b/app/views/people/show.html.haml index 3fc80cfd7..9b5128160 100644 --- a/app/views/people/show.html.haml +++ b/app/views/people/show.html.haml @@ -2,7 +2,6 @@ -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - - content_for :page_title do profile diff --git a/app/views/photos/_new_photo.haml b/app/views/photos/_new_photo.haml index 7c3e7e76e..d1a4fc73f 100644 --- a/app/views/photos/_new_photo.haml +++ b/app/views/photos/_new_photo.haml @@ -2,7 +2,6 @@ -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - :javascript function createUploader(){ var uploader = new qq.FileUploader({ diff --git a/app/views/photos/_photo.haml b/app/views/photos/_photo.haml index 9fadad187..d39fd0666 100644 --- a/app/views/photos/_photo.haml +++ b/app/views/photos/_photo.haml @@ -2,7 +2,6 @@ -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - %li.message{:id => post.id} = person_image_tag(post.person) diff --git a/app/views/photos/edit.html.haml b/app/views/photos/edit.html.haml index bbaee2ef8..06556039c 100644 --- a/app/views/photos/edit.html.haml +++ b/app/views/photos/edit.html.haml @@ -2,7 +2,6 @@ -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - %h1.big_text .back = link_to "⇧ #{@album.name}", album_path(@album) diff --git a/app/views/photos/new.html.haml b/app/views/photos/new.html.haml index 1fdf71a84..d8701c265 100644 --- a/app/views/photos/new.html.haml +++ b/app/views/photos/new.html.haml @@ -2,7 +2,6 @@ -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - - title t('.new_photo') = form_for( @photo, :html => {:multipart => true}) do |f| diff --git a/app/views/photos/show.html.haml b/app/views/photos/show.html.haml index 08eba0c29..787f5861d 100644 --- a/app/views/photos/show.html.haml +++ b/app/views/photos/show.html.haml @@ -2,7 +2,6 @@ -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - :javascript $(document).keydown(function(e){ switch(e.keyCode) { @@ -35,7 +34,6 @@ -if current_user.owns? @album = link_to t('.edit_photo'), edit_photo_path(@photo), :class => "button" - %div{:id => @photo.id} #show_photo = linked_scaled_photo @photo, @album diff --git a/app/views/posts/_debug.haml b/app/views/posts/_debug.haml index 17d7baad8..ef1984d7d 100644 --- a/app/views/posts/_debug.haml +++ b/app/views/posts/_debug.haml @@ -2,7 +2,6 @@ -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - #debug_info %h5 DEBUG INFO #debug_more{ :style => "display:none;" } diff --git a/app/views/posts/_post.html.haml b/app/views/posts/_post.html.haml index 5b4493286..acad2e12b 100644 --- a/app/views/posts/_post.html.haml +++ b/app/views/posts/_post.html.haml @@ -2,7 +2,6 @@ -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - %ul %h3= link_to post.class, object_path(post) - for field in object_fields(post) diff --git a/app/views/registrations/new.html.haml b/app/views/registrations/new.html.haml index f837c92de..25902720e 100644 --- a/app/views/registrations/new.html.haml +++ b/app/views/registrations/new.html.haml @@ -1,6 +1,5 @@ = image_tag "http://needcoffee.cachefly.net/needcoffee/uploads/2009/02/predator-arnold-schwarzenegger.jpg" - = form_for(resource, :as => resource_name, :url => registration_path(resource_name)) do |f| %p = f.label :username diff --git a/app/views/requests/_new_request.haml b/app/views/requests/_new_request.haml index f47e47371..0dbf5b0a1 100644 --- a/app/views/requests/_new_request.haml +++ b/app/views/requests/_new_request.haml @@ -2,7 +2,6 @@ -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - %h1 =t('.add_a_new_friend_to') %i= aspect.name diff --git a/app/views/shared/_aspect_friends.haml b/app/views/shared/_aspect_friends.haml index e27bb3fdb..b4927edc6 100644 --- a/app/views/shared/_aspect_friends.haml +++ b/app/views/shared/_aspect_friends.haml @@ -2,7 +2,6 @@ -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - #friend_pictures = owner_image_link - for friend in @friends diff --git a/app/views/shared/_aspect_nav.haml b/app/views/shared/_aspect_nav.haml index 8e900e42d..a0a0ee0ad 100644 --- a/app/views/shared/_aspect_nav.haml +++ b/app/views/shared/_aspect_nav.haml @@ -2,7 +2,6 @@ -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - #aspect_nav %ul - for aspect in @aspects diff --git a/app/views/shared/_post_wrapper.haml b/app/views/shared/_post_wrapper.haml index b901fc608..956706b68 100644 --- a/app/views/shared/_post_wrapper.haml +++ b/app/views/shared/_post_wrapper.haml @@ -2,7 +2,6 @@ -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - %li.message{:id => post.id, :class => ("mine" if current_user.owns?(post))} = person_image_link(post.person) = yield post_yield_tag(post) diff --git a/app/views/shared/_publisher.haml b/app/views/shared/_publisher.haml index e163a3ba0..1a440b838 100644 --- a/app/views/shared/_publisher.haml +++ b/app/views/shared/_publisher.haml @@ -2,7 +2,6 @@ -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - #publisher = owner_image_tag diff --git a/app/views/shared/_reshare.haml b/app/views/shared/_reshare.haml index 1861c7d27..9df1c9ce1 100644 --- a/app/views/shared/_reshare.haml +++ b/app/views/shared/_reshare.haml @@ -2,8 +2,6 @@ -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - - :javascript $(".reshare_button").toggle(function(e){ e.preventDefault(); diff --git a/app/views/shared/log.haml b/app/views/shared/log.haml index 7472689e3..bf957bf7c 100644 --- a/app/views/shared/log.haml +++ b/app/views/shared/log.haml @@ -2,5 +2,4 @@ -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - = @log.to_s diff --git a/app/views/status_messages/_new_status_message.haml b/app/views/status_messages/_new_status_message.haml index b515dadff..c27585f0a 100644 --- a/app/views/status_messages/_new_status_message.haml +++ b/app/views/status_messages/_new_status_message.haml @@ -2,7 +2,6 @@ -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - = form_for StatusMessage.new, :remote => true do |f| = f.error_messages %p diff --git a/app/views/status_messages/_status_message.html.haml b/app/views/status_messages/_status_message.html.haml index f136a4c33..55c5123b7 100644 --- a/app/views/status_messages/_status_message.html.haml +++ b/app/views/status_messages/_status_message.html.haml @@ -2,7 +2,6 @@ -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - %li.message{:id => post.id, :class => ("mine" if current_user.owns?(post))} = person_image_link(post.person) diff --git a/app/views/status_messages/index.html.haml b/app/views/status_messages/index.html.haml index 42ed5fc09..43c065380 100644 --- a/app/views/status_messages/index.html.haml +++ b/app/views/status_messages/index.html.haml @@ -2,7 +2,6 @@ -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - %h1.big_text status messages = render "status_messages/new_status_message", :status_message => @status_message %ul#stream diff --git a/app/views/users/edit.html.haml b/app/views/users/edit.html.haml index 46e966f54..3385cb5ea 100644 --- a/app/views/users/edit.html.haml +++ b/app/views/users/edit.html.haml @@ -2,7 +2,6 @@ -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - - content_for :publish do %h1="#{t('.editing_profile')}" diff --git a/config.ru b/config.ru index cb12bcfa2..0c65f5908 100644 --- a/config.ru +++ b/config.ru @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - # This file is used by Rack-based servers to start the application. require ::File.expand_path('../config/environment', __FILE__) diff --git a/config/app_config.yml.example b/config/app_config.yml.example index b2251fefc..069823a05 100644 --- a/config/app_config.yml.example +++ b/config/app_config.yml.example @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - default: pod_url: "http://example.org/" debug: false diff --git a/config/deploy_config.yml b/config/deploy_config.yml index 9bd7a6b96..6aacbf3ff 100644 --- a/config/deploy_config.yml +++ b/config/deploy_config.yml @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - cross_server: deploy_to: '/usr/local/app/diaspora' user: 'root' diff --git a/config/locales/devise/devise.cs.yml b/config/locales/devise/devise.cs.yml index 34d9eb7c1..26ff8044d 100644 --- a/config/locales/devise/devise.cs.yml +++ b/config/locales/devise/devise.cs.yml @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - cs: errors: messages: diff --git a/config/locales/devise/devise.cy.yml b/config/locales/devise/devise.cy.yml index 2d09ac956..d8b6d94f4 100644 --- a/config/locales/devise/devise.cy.yml +++ b/config/locales/devise/devise.cy.yml @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - cy: errors: messages: diff --git a/config/locales/devise/devise.de.yml b/config/locales/devise/devise.de.yml index 82b658e99..e6608c181 100644 --- a/config/locales/devise/devise.de.yml +++ b/config/locales/devise/devise.de.yml @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - de: errors: messages: diff --git a/config/locales/devise/devise.en.yml b/config/locales/devise/devise.en.yml index 8876bc5bf..7ab686bd4 100644 --- a/config/locales/devise/devise.en.yml +++ b/config/locales/devise/devise.en.yml @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - en: errors: messages: diff --git a/config/locales/devise/devise.fr-informal.yml b/config/locales/devise/devise.fr-informal.yml index 9578af9d9..6fe14382e 100644 --- a/config/locales/devise/devise.fr-informal.yml +++ b/config/locales/devise/devise.fr-informal.yml @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - fr-informal: errors: messages: diff --git a/config/locales/devise/devise.fr.yml b/config/locales/devise/devise.fr.yml index b8691eb3a..240e9d967 100644 --- a/config/locales/devise/devise.fr.yml +++ b/config/locales/devise/devise.fr.yml @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - fr: errors: messages: diff --git a/config/locales/devise/devise.he.yml b/config/locales/devise/devise.he.yml index 851a90789..4ae726a4d 100644 --- a/config/locales/devise/devise.he.yml +++ b/config/locales/devise/devise.he.yml @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - en: errors: messages: diff --git a/config/locales/devise/devise.it.yml b/config/locales/devise/devise.it.yml index 76f761e37..96044d191 100644 --- a/config/locales/devise/devise.it.yml +++ b/config/locales/devise/devise.it.yml @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - it: errors: messages: diff --git a/config/locales/devise/devise.lt.yml b/config/locales/devise/devise.lt.yml index d6e33c1cb..8ae8f027b 100644 --- a/config/locales/devise/devise.lt.yml +++ b/config/locales/devise/devise.lt.yml @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - lt: errors: messages: diff --git a/config/locales/devise/devise.pl.yml b/config/locales/devise/devise.pl.yml index a490a1a39..503fb6d61 100644 --- a/config/locales/devise/devise.pl.yml +++ b/config/locales/devise/devise.pl.yml @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - pl: errors: messages: diff --git a/config/locales/devise/devise.pt-BR.yml b/config/locales/devise/devise.pt-BR.yml index ba2b3b5de..5a39a4734 100644 --- a/config/locales/devise/devise.pt-BR.yml +++ b/config/locales/devise/devise.pt-BR.yml @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - pt-BR: errors: messages: diff --git a/config/locales/devise/devise.pt-PT.yml b/config/locales/devise/devise.pt-PT.yml index cf16fd20d..c0c955517 100644 --- a/config/locales/devise/devise.pt-PT.yml +++ b/config/locales/devise/devise.pt-PT.yml @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - pt-PT: errors: messages: diff --git a/config/locales/devise/devise.ro.yml b/config/locales/devise/devise.ro.yml index 63501ea7b..b4d12e6b6 100644 --- a/config/locales/devise/devise.ro.yml +++ b/config/locales/devise/devise.ro.yml @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - ro: errors: messages: diff --git a/config/locales/devise/devise.ru.yml b/config/locales/devise/devise.ru.yml index 670d57026..1ac626861 100644 --- a/config/locales/devise/devise.ru.yml +++ b/config/locales/devise/devise.ru.yml @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - ru: errors: messages: diff --git a/config/locales/devise/devise.sv.yml b/config/locales/devise/devise.sv.yml index 3c41ea81b..c83179bde 100644 --- a/config/locales/devise/devise.sv.yml +++ b/config/locales/devise/devise.sv.yml @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - sv: errors: messages: diff --git a/config/locales/diaspora/cs.yml b/config/locales/diaspora/cs.yml index 91c904dc1..0f9ec4f09 100644 --- a/config/locales/diaspora/cs.yml +++ b/config/locales/diaspora/cs.yml @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - # Sample localization file for Lithuanian. Add more files in this directory for other locales. # See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. diff --git a/config/locales/diaspora/cy.yml b/config/locales/diaspora/cy.yml index e0198b1b6..97b4fd3df 100644 --- a/config/locales/diaspora/cy.yml +++ b/config/locales/diaspora/cy.yml @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - # Sample localization file for English. Add more files in this directory for other locales. # See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. diff --git a/config/locales/diaspora/de.yml b/config/locales/diaspora/de.yml index 9c7d67f4d..dd3cead59 100644 --- a/config/locales/diaspora/de.yml +++ b/config/locales/diaspora/de.yml @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - # Localization file for German. Add more files in this directory for other locales. # See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. diff --git a/config/locales/diaspora/en.yml b/config/locales/diaspora/en.yml index 9db808746..025aed149 100644 --- a/config/locales/diaspora/en.yml +++ b/config/locales/diaspora/en.yml @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - # Sample localization file for English. Add more files in this directory for other locales. # See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. diff --git a/config/locales/diaspora/es.yml b/config/locales/diaspora/es.yml index 1f6b6b2e7..37657e1f4 100644 --- a/config/locales/diaspora/es.yml +++ b/config/locales/diaspora/es.yml @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - # Sample localization file for English. Add more files in this directory for other locales. # See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. diff --git a/config/locales/diaspora/fr-informal.yml b/config/locales/diaspora/fr-informal.yml index 2342ff1ce..141584dad 100644 --- a/config/locales/diaspora/fr-informal.yml +++ b/config/locales/diaspora/fr-informal.yml @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - # Localization file for French (Informal Honorifics). Add more files in this directory for other locales. # See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. diff --git a/config/locales/diaspora/it.yml b/config/locales/diaspora/it.yml index bb44c6f27..4730b3cea 100644 --- a/config/locales/diaspora/it.yml +++ b/config/locales/diaspora/it.yml @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - # Sample localization file for Italian. Add more files in this directory for other locales. # See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. diff --git a/config/locales/diaspora/lt.yml b/config/locales/diaspora/lt.yml index e1a529431..01295e389 100644 --- a/config/locales/diaspora/lt.yml +++ b/config/locales/diaspora/lt.yml @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - # Sample localization file for Lithuanian. Add more files in this directory for other locales. # See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. diff --git a/config/locales/diaspora/pl.yml b/config/locales/diaspora/pl.yml index 2052779bd..c55b79691 100644 --- a/config/locales/diaspora/pl.yml +++ b/config/locales/diaspora/pl.yml @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - # Sample localization file for English. Add more files in this directory for other locales. # See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. diff --git a/config/locales/diaspora/pt-BR.yml b/config/locales/diaspora/pt-BR.yml index 10425864b..aa7a7af35 100644 --- a/config/locales/diaspora/pt-BR.yml +++ b/config/locales/diaspora/pt-BR.yml @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - # Sample localization file for Portuguese Brazilian. Add more files in this directory for other locales. # See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. diff --git a/config/locales/diaspora/pt-PT.yml b/config/locales/diaspora/pt-PT.yml index ce3d9abbc..6df399150 100644 --- a/config/locales/diaspora/pt-PT.yml +++ b/config/locales/diaspora/pt-PT.yml @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - # Sample localization file for Portuguese Portugal. Add more files in this directory for other locales. # See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. diff --git a/config/locales/diaspora/ru.yml b/config/locales/diaspora/ru.yml index 1b5d3b958..cc76b9b42 100644 --- a/config/locales/diaspora/ru.yml +++ b/config/locales/diaspora/ru.yml @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - # Sample localization file for Russian. Add more files in this directory for other locales. # See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. diff --git a/config/locales/diaspora/sv.yml b/config/locales/diaspora/sv.yml index dfb8deb7f..1aa9ac2dc 100644 --- a/config/locales/diaspora/sv.yml +++ b/config/locales/diaspora/sv.yml @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - # Swedish localization file. # See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. diff --git a/config/selenium.yml b/config/selenium.yml index 74ce21d73..0d679b602 100644 --- a/config/selenium.yml +++ b/config/selenium.yml @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - common: &common # Try to kill mongrel after suite if tmp/pids/mongrel_selenium.pid exists # kill_mongrel_after_suite: true diff --git a/config/sprinkle/conf/nginx.conf b/config/sprinkle/conf/nginx.conf index eba9fa45b..188daedcb 100644 --- a/config/sprinkle/conf/nginx.conf +++ b/config/sprinkle/conf/nginx.conf @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - worker_processes 1; pid /tmp/pids/nginx.pid; diff --git a/config/thin.yml b/config/thin.yml index ad91436c1..a49d85ce4 100644 --- a/config/thin.yml +++ b/config/thin.yml @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - rackup: /usr/local/app/diaspora/current/config.ru pid: /tmp/pids/thin.pid wait: 30 diff --git a/lib/tasks/db.rake b/lib/tasks/db.rake index 4b6202f29..e4e379a2a 100644 --- a/lib/tasks/db.rake +++ b/lib/tasks/db.rake @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - namespace :db do desc 'Seed the current RAILS_ENV database from db/seeds.rb' namespace :seed do diff --git a/lib/tasks/rspec.rake b/lib/tasks/rspec.rake index 35f0b8a98..54442d71e 100644 --- a/lib/tasks/rspec.rake +++ b/lib/tasks/rspec.rake @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - begin require 'rspec/core' require 'rspec/core/rake_task' diff --git a/ubuntu-setup.bash b/ubuntu-setup.bash index 117a78ed9..83c779b0c 100755 --- a/ubuntu-setup.bash +++ b/ubuntu-setup.bash @@ -8,7 +8,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - # Set extented globbing shopt -s extglob From 7e73f20c2aeebe536e5f40f2cdffbcac8a3f6a71 Mon Sep 17 00:00:00 2001 From: Dorian Date: Sun, 26 Sep 2010 11:51:25 +0200 Subject: [PATCH 315/449] Use whitespace:retab; manually retab ubuntu-setup.bash --- ubuntu-setup.bash | 52 +++++++++++++++++++++++------------------------ 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/ubuntu-setup.bash b/ubuntu-setup.bash index 83c779b0c..95d2a9628 100755 --- a/ubuntu-setup.bash +++ b/ubuntu-setup.bash @@ -64,32 +64,32 @@ echo "Installed git-core.." # Setting up ruby gems echo "Fetching and installing ruby gems.." ( - RELEASE=$(lsb_release -c | cut -f2) - if [ RELEASE == "maverick" ] - then - sudo apt-get install --no-install-recommends -y rubygems - sudo ln -s /var/lib/gems/1.8/bin/bundle /usr/local/bin/bundle #for PATH - elif [ RELEASE == "lucid" ] - then - sudo add-apt-repository ppa:maco.m/ruby - sudo apt-get update - sudo apt-get install --no-install-recommends -y rubygems - sudo ln -s /var/lib/gems/1.8/bin/bundle /usr/local/bin/bundle #for PATH - else - # Old version - echo "." - cd /tmp - wget http://production.cf.rubygems.org/rubygems/rubygems-1.3.7.tgz - echo "." - tar -xf rubygems-1.3.7.tgz - echo "." - cd rubygems-1.3.7 - echo "." - sudo ruby setup.rb - echo "." - sudo ln -s /usr/bin/gem1.8 /usr/bin/gem - echo "." - fi + RELEASE=$(lsb_release -c | cut -f2) + if [ RELEASE == "maverick" ] + then + sudo apt-get install --no-install-recommends -y rubygems + sudo ln -s /var/lib/gems/1.8/bin/bundle /usr/local/bin/bundle #for PATH + elif [ RELEASE == "lucid" ] + then + sudo add-apt-repository ppa:maco.m/ruby + sudo apt-get update + sudo apt-get install --no-install-recommends -y rubygems + sudo ln -s /var/lib/gems/1.8/bin/bundle /usr/local/bin/bundle #for PATH + else + # Old version + echo "." + cd /tmp + wget http://production.cf.rubygems.org/rubygems/rubygems-1.3.7.tgz + echo "." + tar -xf rubygems-1.3.7.tgz + echo "." + cd rubygems-1.3.7 + echo "." + sudo ruby setup.rb + echo "." + sudo ln -s /usr/bin/gem1.8 /usr/bin/gem + echo "." + fi ) echo "Done installing the gems.." From 611852bb74a61ce05f42cd36e70a101286cb75ec Mon Sep 17 00:00:00 2001 From: Dorian Date: Sun, 26 Sep 2010 11:53:42 +0200 Subject: [PATCH 316/449] Use rake whitespace:cleanup --- config/locales/diaspora/he.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/locales/diaspora/he.yml b/config/locales/diaspora/he.yml index 90ced9435..9f7670a97 100644 --- a/config/locales/diaspora/he.yml +++ b/config/locales/diaspora/he.yml @@ -41,7 +41,7 @@ he: new_album: create: "צור" add_a_new_album: "הוסף אלבום חדש" - show: + show: edit_album: "ערוך אלבום" albums: "אלבומים" updated: "עדכן" From 0ec074be6d1ba626ea4814b4d06091b7a2f0d51f Mon Sep 17 00:00:00 2001 From: Sarah Mei Date: Sun, 26 Sep 2010 10:00:29 -0700 Subject: [PATCH 317/449] Remove annoying deprecation warning from spec runs Add spec for validation hook --- app/models/user.rb | 2 +- spec/models/user_spec.rb | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/app/models/user.rb b/app/models/user.rb index ade7b7a2a..1e062b0c8 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -35,7 +35,7 @@ class User after_create :seed_aspects - before_validation_on_create :downcase_username + before_validation :downcase_username, :on => :create def self.find_for_authentication(conditions={}) if conditions[:username] =~ /^([\w\.%\+\-]+)@([\w\-]+\.)+([\w]{2,})$/i # email regex diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index ad7070eaa..46327576a 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -6,7 +6,14 @@ require 'spec_helper' describe User do let(:user) { Factory(:user) } - let(:aspect) { user.aspect(:name => 'heroes') } + + describe "validations" do + it "downcases the username" do + user = Factory.build(:user, :username => "ALLUPPERCASE") + user.valid? + user.username.should == "alluppercase" + end + end describe '#diaspora_handle' do it 'uses the pod config url to set the diaspora_handle' do @@ -27,6 +34,7 @@ describe User do end context 'aspects' do + let(:aspect) { user.aspect(:name => 'heroes') } let(:user2) { Factory(:user) } let(:aspect2) { user2.aspect(:name => 'stuff') } From 8d17b3537cdbd4a8b2e8ff5c780e579697dbe569 Mon Sep 17 00:00:00 2001 From: Stephen Caudill Date: Sun, 26 Sep 2010 14:18:58 -0400 Subject: [PATCH 318/449] Refactor to use a Background --- features/user_creates_an_aspect.feature | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/features/user_creates_an_aspect.feature b/features/user_creates_an_aspect.feature index 27cb6f2f3..fb65fde4c 100644 --- a/features/user_creates_an_aspect.feature +++ b/features/user_creates_an_aspect.feature @@ -4,20 +4,20 @@ Feature: User creates an aspect As a User I want to create a new aspect - Scenario: success + Background: Given I am signed in And I follow "Manage" in the header And I follow "Add a new aspect" - When I fill in "Name" with "Dorm Mates" in the modal window - And I press "Create" in the modal window + + Scenario: success + Given I fill in "Name" with "Dorm Mates" in the modal window + When I press "Create" in the modal window Then I should see "Manage Aspects" And I should see "Dorm Mates" in the header And I should see "Dorm Mates" in the aspect list Scenario: I omit the name - Given I am signed in - And I follow "Manage" in the header - And I follow "Add a new aspect" + Given I fill in "Name" with "" in the modal window When I press "Create" in the modal window Then I should see "Manage Aspects" And I should see "Aspect creation failed." From 5d1afe21be813c851e8b4ae8289a3d2472d76d2e Mon Sep 17 00:00:00 2001 From: Sarah Mei Date: Sun, 26 Sep 2010 13:08:30 -0700 Subject: [PATCH 319/449] Refactor user specs to speed up spec runs. --- spec/factories.rb | 16 +++- spec/models/user/posting_spec.rb | 111 +++++++++++++------------ spec/models/user/visible_posts_spec.rb | 68 ++++++--------- 3 files changed, 94 insertions(+), 101 deletions(-) diff --git a/spec/factories.rb b/spec/factories.rb index 834304e33..aecbf74cf 100644 --- a/spec/factories.rb +++ b/spec/factories.rb @@ -37,10 +37,18 @@ Factory.define :user do |u| u.sequence(:email) {|n| "bob#{n}@pivotallabs.com"} u.password "bluepin7" u.password_confirmation "bluepin7" - u.person { |a| Factory.create(:person_with_user, - :owner_id => a._id, - :diaspora_handle => "#{a.username}@#{APP_CONFIG[:pod_url].gsub(/(https?:|www\.)\/\//, '').chop!}") - } + u.after_build do |user| + user.person = Factory(:person_with_private_key, :owner_id => user._id, + :diaspora_handle => "#{user.username}@#{APP_CONFIG[:pod_url].gsub(/(https?:|www\.)\/\//, '').chop!}") + end +end + +Factory.define :user_with_aspect, :parent => :user do |u| + u.after_build { |user| user.aspects << Factory(:aspect) } +end + +Factory.define :aspect do |aspect| + aspect.name "generic" end Factory.define :status_message do |m| diff --git a/spec/models/user/posting_spec.rb b/spec/models/user/posting_spec.rb index 2f86ac549..76f4243f7 100644 --- a/spec/models/user/posting_spec.rb +++ b/spec/models/user/posting_spec.rb @@ -6,77 +6,78 @@ require 'spec_helper' describe User do - let(:user) { Factory(:user) } - let(:user2) { Factory(:user) } - let(:user3) { Factory(:user) } - let(:user4) { Factory(:user) } + let!(:user) { Factory(:user) } + let!(:aspect) { user.aspect(:name => 'heroes') } + let!(:aspect1) { user.aspect(:name => 'other') } - let(:aspect) {user.aspect(:name => 'heroes')} - let!(:aspect1) {user.aspect(:name => 'heroes')} - let!(:aspect2) {user2.aspect(:name => 'losers')} - let!(:aspect3) {user3.aspect(:name => 'heroes')} - let!(:aspect4) {user4.aspect(:name => 'heroes')} + let!(:user2) { Factory(:user) } + let!(:aspect2) { user2.aspect(:name => 'losers') } - before do - friend_users(user, aspect, user2, aspect2) - friend_users(user, aspect, user3, aspect3) - friend_users(user, aspect1, user4, aspect4) + describe '#validate_aspect_permissions' do + it 'requires an aspect' do + proc { + user.validate_aspect_permissions([]) + }.should raise_error /You must post to someone/ + end + + it "won't let you post to someone else's aspect" do + proc { + user.validate_aspect_permissions(aspect2.id) + }.should raise_error /Cannot post to an aspect you do not own./ + end + + it "lets you post to your own aspects" do + user.validate_aspect_permissions(aspect.id).should be_true + user.validate_aspect_permissions(aspect1.id).should be_true + end end - context 'posting' do - - describe '#validate_aspect_permissions' do - it 'should not be able to post without a aspect' do - proc { - user.validate_aspect_permissions([]) - }.should raise_error /You must post to someone/ - end - - it 'should not be able to post to someone elses aspect' do - proc { - user.validate_aspect_permissions(aspect2.id) - }.should raise_error /Cannot post to an aspect you do not own./ - end + describe '#post' do + it 'should put the post in the aspect post array' do + post = user.post(:status_message, :message => "hey", :to => aspect.id) + aspect.reload + aspect.posts.should include post end - describe '#post' do - it 'should put the post in the aspect post array' do - post = user.post(:status_message, :message => "hey", :to => aspect.id) - aspect.reload - aspect.posts.should include post - end - - it 'should put an album in the aspect post array' do - album = user.post :album, :name => "Georges", :to => aspect.id - aspect.reload - aspect.posts.should include album - end + it 'should put an album in the aspect post array' do + album = user.post :album, :name => "Georges", :to => aspect.id + aspect.reload + aspect.posts.should include album end + end - describe '#repost' do - let!(:status_message) { user.post(:status_message, :message => "hello", :to => aspect.id) } - - it 'should make the post visible in another aspect' do - user.repost( status_message, :to => aspect1.id ) - aspect1.reload - aspect1.posts.count.should be 1 - end + describe '#repost' do + it 'should make the post visible in another aspect' do + status_message = user.post(:status_message, :message => "hello", :to => aspect.id) + user.repost(status_message, :to => aspect1.id) + aspect1.reload + aspect1.posts.count.should be 1 end + end - describe '#update_post' do - let!(:album) { user.post(:album, :name => "Profile Photos", :to => aspect.id) } - - it 'should update fields' do - update_hash = { :name => "Other Photos" } - user.update_post( album, update_hash ) - album.name.should == "Other Photos" - end + describe '#update_post' do + it 'should update fields' do + album = user.post(:album, :name => "Profile Photos", :to => aspect.id) + update_hash = {:name => "Other Photos"} + user.update_post(album, update_hash) + album.name.should == "Other Photos" end end context 'dispatching' do + let!(:user3) { Factory(:user) } + let!(:aspect3) { user3.aspect(:name => 'heroes') } + let!(:user4) { Factory(:user) } + let!(:aspect4) { user4.aspect(:name => 'heroes') } + let!(:post) { user.build_post :status_message, :message => "hey" } + before do + friend_users(user, aspect, user2, aspect2) + friend_users(user, aspect, user3, aspect3) + friend_users(user, aspect1, user4, aspect4) + end + describe '#push_to_aspects' do it 'should push a post to a aspect' do user.should_receive(:salmon).twice diff --git a/spec/models/user/visible_posts_spec.rb b/spec/models/user/visible_posts_spec.rb index 8d20bcb96..e0a3d5215 100644 --- a/spec/models/user/visible_posts_spec.rb +++ b/spec/models/user/visible_posts_spec.rb @@ -5,41 +5,35 @@ require 'spec_helper' describe User do - let(:user) { Factory(:user) } + let!(:user) { Factory(:user_with_aspect) } + let!(:first_aspect) { user.aspects.first } + let!(:second_aspect) { user.aspect(:name => 'losers') } - let(:user2) { Factory(:user) } - let(:user3) { Factory(:user) } - let(:user4) { Factory(:user) } + let!(:user2) { Factory(:user_with_aspect) } - let!(:aspect) { user.aspect(:name => 'heroes') } - let!(:aspect2) { user.aspect(:name => 'losers') } - - let!(:user2_aspect) { user2.aspect(:name => 'dudes') } - let!(:user3_aspect) { user3.aspect(:name => 'dudes') } - let!(:user4_aspect) { user4.aspect(:name => 'dudes') } - - let(:status_message1) { user2.post :status_message, :message => "hi", :to => user2_aspect.id } - let(:status_message2) { user3.post :status_message, :message => "heyyyy", :to => user3_aspect.id } - let(:status_message3) { user4.post :status_message, :message => "yooo", :to => user4_aspect.id } + let!(:status_message1) { user2.post :status_message, :message => "hi", :to => user2.aspects.first.id } before do - friend_users(user, aspect, user2, user2_aspect) - friend_users(user, aspect2, user3, user3_aspect) - friend_users(user, aspect2, user4, user4_aspect) + friend_users(user, first_aspect, user2, user2.aspects.first) end - it 'should generate a valid stream for a aspect of people' do - (1..3).each{ |n| - eval("user.receive status_message#{n}.to_diaspora_xml") - } + describe "#visible_posts" do + it "generates a stream for each aspect that includes only that aspect's posts" do + user3 = Factory(:user_with_aspect) + status_message2 = user3.post :status_message, :message => "heyyyy", :to => user3.aspects.first.id + user4 = Factory(:user_with_aspect) + status_message3 = user4.post :status_message, :message => "yooo", :to => user4.aspects.first.id - user.visible_posts(:by_members_of => aspect).should include status_message1 - user.visible_posts(:by_members_of => aspect).should_not include status_message2 - user.visible_posts(:by_members_of => aspect).should_not include status_message3 + friend_users(user, second_aspect, user3, user3.aspects.first) + friend_users(user, second_aspect, user4, user4.aspects.first) - user.visible_posts(:by_members_of => aspect2).should_not include status_message1 - user.visible_posts(:by_members_of => aspect2).should include status_message2 - user.visible_posts(:by_members_of => aspect2).should include status_message3 + user.receive status_message1.to_diaspora_xml + user.receive status_message2.to_diaspora_xml + user.receive status_message3.to_diaspora_xml + + user.visible_posts(:by_members_of => first_aspect).should =~ [status_message1] + user.visible_posts(:by_members_of => second_aspect).should =~ [status_message2, status_message3] + end end context 'querying' do @@ -54,19 +48,9 @@ describe User do context 'albums' do before do - @album = user.post :album, :name => "Georges", :to => aspect.id - aspect.reload - aspect2.reload - user.reload - - @album2 = user.post :album, :name => "Borges", :to => aspect.id - aspect.reload - aspect2.reload - user.reload - - user.post :album, :name => "Luises", :to => aspect2.id - aspect.reload - aspect2.reload + user.post :album, :name => "Georges", :to => first_aspect.id + user.post :album, :name => "Borges", :to => first_aspect.id + user.post :album, :name => "Luises", :to => second_aspect.id user.reload end @@ -75,8 +59,8 @@ describe User do end it 'should return the right number of albums' do - user.albums_by_aspect(aspect).should have(2).albums - user.albums_by_aspect(aspect2).should have(1).album + user.albums_by_aspect(first_aspect.reload).should have(2).albums + user.albums_by_aspect(second_aspect.reload).should have(1).album end end end From 43fa70f90b9fcf7639756e35eea122b73e24ea27 Mon Sep 17 00:00:00 2001 From: Stephen Caudill Date: Sun, 26 Sep 2010 16:10:13 -0400 Subject: [PATCH 320/449] Label error notification as such. --- app/controllers/aspects_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/aspects_controller.rb b/app/controllers/aspects_controller.rb index 80e4c7d0d..2bfdee238 100644 --- a/app/controllers/aspects_controller.rb +++ b/app/controllers/aspects_controller.rb @@ -18,7 +18,7 @@ class AspectsController < ApplicationController if @aspect.valid? flash[:notice] = I18n.t('aspects.create.success') else - flash[:notice] = I18n.t('aspects.create.failure') + flash[:error] = I18n.t('aspects.create.failure') end respond_with :location => aspects_manage_path end From cf0df90daecb6c7ba5b602d3f11db38326b7784c Mon Sep 17 00:00:00 2001 From: ilya Date: Sun, 26 Sep 2010 22:08:42 -0700 Subject: [PATCH 321/449] moved the private key into user where it belongs, two failing cucumber tests --- app/models/person.rb | 20 ++++++-------------- app/models/user.rb | 24 ++++++++++++++++++++---- lib/diaspora/user/receiving.rb | 2 +- lib/encryptable.rb | 4 ++-- lib/encryptor.rb | 2 +- spec/factories.rb | 9 ++++----- spec/lib/diaspora_parser_spec.rb | 9 ++++++--- spec/user_encryption_spec.rb | 32 ++++++++++++++------------------ 8 files changed, 54 insertions(+), 48 deletions(-) diff --git a/app/models/person.rb b/app/models/person.rb index 9527a7bb7..2601de2bc 100644 --- a/app/models/person.rb +++ b/app/models/person.rb @@ -17,7 +17,7 @@ class Person key :url, String key :diaspora_handle, String, :unique => true - key :serialized_key, String + key :serialized_public_key, String key :owner_id, ObjectId @@ -29,7 +29,7 @@ class Person before_destroy :remove_all_traces before_validation :clean_url - validates_presence_of :url, :profile, :serialized_key + validates_presence_of :url, :profile, :serialized_public_key validates_format_of :url, :with => /^(https?):\/\/[a-z0-9]+([\-\.]{1}[a-z0-9]+)*(\.[a-z]{2,5})?(:[0-9]{1,5})?(\/.*)?$/ix @@ -49,30 +49,22 @@ class Person "#{self.url}receive/users/#{self.id}/" end - def encryption_key - OpenSSL::PKey::RSA.new( serialized_key ) - end - - def encryption_key= new_key - raise TypeError unless new_key.class == OpenSSL::PKey::RSA - serialized_key = new_key.export - end def public_key_hash Base64.encode64 OpenSSL::Digest::SHA256.new(self.exported_key).to_s end def public_key - encryption_key.public_key + OpenSSL::PKey::RSA.new( serialized_public_key ) end def exported_key - encryption_key.public_key.export + serialized_public_key end def exported_key= new_key - raise "Don't change a key" if serialized_key - @serialized_key = new_key + raise "Don't change a key" if serialized_public_key + @serialized_public_key = new_key end def self.by_webfinger( identifier, opts = {}) diff --git a/app/models/user.rb b/app/models/user.rb index a93b3a727..535577fd3 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -18,6 +18,7 @@ class User devise :database_authenticatable, :registerable, :recoverable, :rememberable, :trackable, :validatable key :username, :unique => true + key :serialized_private_key, String key :friend_ids, Array key :pending_request_ids, Array @@ -251,7 +252,9 @@ class User def self.instantiate!( opts = {} ) opts[:person][:diaspora_handle] = "#{opts[:username]}@#{APP_CONFIG[:terse_pod_url]}" opts[:person][:url] = APP_CONFIG[:pod_url] - opts[:person][:serialized_key] = generate_key + + opts[:serialized_private_key] = generate_key + opts[:person][:serialized_public_key] = opts[:serialized_private_key].public_key User.create(opts) end @@ -278,7 +281,20 @@ class User } } end - def self.generate_key - OpenSSL::PKey::RSA::generate 4096 - end + + + def self.generate_key + OpenSSL::PKey::RSA::generate 4096 + end + + def encryption_key + OpenSSL::PKey::RSA.new( serialized_private_key ) + end + + def encryption_key= new_key + raise TypeError unless new_key.class == OpenSSL::PKey::RSA + serialized_private_key = new_key.export + end + + end diff --git a/lib/diaspora/user/receiving.rb b/lib/diaspora/user/receiving.rb index 39b1af5d2..5d737d8e9 100644 --- a/lib/diaspora/user/receiving.rb +++ b/lib/diaspora/user/receiving.rb @@ -43,7 +43,7 @@ module Diaspora def receive_request request, xml person = Diaspora::Parser.parse_or_find_person_from_xml( xml ) - person.serialized_key ||= request.exported_key + person.serialized_public_key ||= request.exported_key request.person = person request.person.save old_request = Request.first(:id => request.id) diff --git a/lib/encryptable.rb b/lib/encryptable.rb index 5b00ca9ea..133c05156 100644 --- a/lib/encryptable.rb +++ b/lib/encryptable.rb @@ -15,7 +15,7 @@ if person.nil? Rails.logger.info("Verifying sig on #{signable_string} but no person is here") return false - elsif person.encryption_key.nil? + elsif person.public_key.nil? Rails.logger.info("Verifying sig on #{signable_string} but #{person.real_name} has no key") return false elsif signature.nil? @@ -23,7 +23,7 @@ return false end Rails.logger.debug("Verifying sig on #{signable_string} from person #{person.real_name}") - validity = person.encryption_key.verify "SHA", Base64.decode64(signature), signable_string + validity = person.public_key.verify "SHA", Base64.decode64(signature), signable_string Rails.logger.debug("Validity: #{validity}") validity end diff --git a/lib/encryptor.rb b/lib/encryptor.rb index d90e8bdfe..e9c4936e1 100644 --- a/lib/encryptor.rb +++ b/lib/encryptor.rb @@ -31,7 +31,7 @@ module Encryptor end def encrypt_aes_key key - Base64.encode64 encryption_key.public_encrypt( key.to_json ) + Base64.encode64 public_key.public_encrypt( key.to_json ) end end diff --git a/spec/factories.rb b/spec/factories.rb index aecbf74cf..826ca970d 100644 --- a/spec/factories.rb +++ b/spec/factories.rb @@ -17,7 +17,7 @@ Factory.define :person do |p| p.sequence(:url) {|n| "http://google-#{n}.com/"} p.profile Factory.create(:profile) - p.serialized_key OpenSSL::PKey::RSA.generate(1024).public_key.export + p.serialized_public_key OpenSSL::PKey::RSA.generate(1024).public_key.export end Factory.define :album do |p| @@ -29,16 +29,15 @@ Factory.define :person_with_private_key, :parent => :person do |p| p.serialized_key OpenSSL::PKey::RSA.generate(1024).export end -Factory.define :person_with_user, :parent => :person_with_private_key do |p| -end - Factory.define :user do |u| u.sequence(:username) {|n| "bob#{n}"} u.sequence(:email) {|n| "bob#{n}@pivotallabs.com"} u.password "bluepin7" u.password_confirmation "bluepin7" + u.serialized_private_key OpenSSL::PKey::RSA.generate(1024).export u.after_build do |user| - user.person = Factory(:person_with_private_key, :owner_id => user._id, + user.person = Factory(:person, :owner_id => user._id, + :serialized_public_key => user.encryption_key.public_key.export, :diaspora_handle => "#{user.username}@#{APP_CONFIG[:pod_url].gsub(/(https?:|www\.)\/\//, '').chop!}") end end diff --git a/spec/lib/diaspora_parser_spec.rb b/spec/lib/diaspora_parser_spec.rb index e37cf0116..530dca211 100644 --- a/spec/lib/diaspora_parser_spec.rb +++ b/spec/lib/diaspora_parser_spec.rb @@ -8,7 +8,9 @@ describe Diaspora::Parser do before do @user = Factory.create(:user, :email => "bob@aol.com") @aspect = @user.aspect(:name => 'spies') - @person = Factory.create(:person_with_private_key, :diaspora_handle => "bill@gates.com") + + @user3 = Factory.create :user + @person = @user3.person @user2 = Factory.create(:user) end @@ -64,12 +66,13 @@ describe Diaspora::Parser do original_person_id = @person.id xml = request.to_diaspora_xml + @user3.destroy @person.destroy Person.all.count.should == person_count -1 @user.receive xml Person.all.count.should == person_count - Person.first(:_id => original_person_id).serialized_key.include?("PUBLIC").should be true + Person.first(:_id => original_person_id).serialized_public_key.include?("PUBLIC").should be true url = "http://" + request.callback_url.split("/")[2] + "/" Person.where(:url => url).first.id.should == original_person_id end @@ -87,7 +90,7 @@ describe Diaspora::Parser do @user2.reload @user2.person.reload - @user2.person.serialized_key.include?("PRIVATE").should be true + @user2.serialized_private_key.include?("PRIVATE").should be true url = "http://" + request.callback_url.split("/")[2] + "/" Person.where(:url => url).first.id.should == original_person_id diff --git a/spec/user_encryption_spec.rb b/spec/user_encryption_spec.rb index b74006e3d..2188b106e 100644 --- a/spec/user_encryption_spec.rb +++ b/spec/user_encryption_spec.rb @@ -9,16 +9,9 @@ describe 'user encryption' do unstub_mocha_stubs @user = Factory.create(:user) @aspect = @user.aspect(:name => 'dudes') - @person = Factory.create(:person_with_private_key, - :profile => Profile.new(:first_name => 'Remote', - :last_name => 'Friend'), - :diaspora_handle => 'somewhere@else.com', - :url => 'http://distant-example.com/') - @person2 = Factory.create(:person_with_private_key, - :profile => Profile.new(:first_name => 'Second', - :last_name => 'Friend'), - :diaspora_handle => 'elsewhere@else.com', - :url => 'http://distanter-example.com/') + + @user2 = Factory.create(:user) + @aspect2 = @user2.aspect(:name => 'dudes') end after do @@ -74,7 +67,10 @@ describe 'user encryption' do describe 'comments' do before do - @remote_message = Factory.create(:status_message, :person => @person) + friend_users(@user, @aspect, @user2, @aspect2) + @remote_message = @user2.post :status_message, :message => "hello", :to => @aspect2.id + + @message = @user.post :status_message, :message => "hi", :to => @aspect.id end it 'should attach the creator signature if the user is commenting' do @@ -90,24 +86,24 @@ describe 'user encryption' do end it 'should verify a comment made on a remote post by a different friend' do - comment = Comment.new(:person => @person2, :text => "balls", :post => @remote_message) - comment.creator_signature = comment.send(:sign_with_key,@person2.encryption_key) + comment = Comment.new(:person => @user2.person, :text => "cats", :post => @remote_message) + comment.creator_signature = comment.send(:sign_with_key,@user2.encryption_key) comment.signature_valid?.should be true comment.verify_post_creator_signature.should be false - comment.post_creator_signature = comment.send(:sign_with_key,@person.encryption_key) + comment.post_creator_signature = comment.send(:sign_with_key,@user.encryption_key) comment.verify_post_creator_signature.should be true end it 'should reject comments on a remote post with only a creator sig' do - comment = Comment.new(:person => @person2, :text => "balls", :post => @remote_message) - comment.creator_signature = comment.send(:sign_with_key,@person2.encryption_key) + comment = Comment.new(:person => @user2.person, :text => "cats", :post => @remote_message) + comment.creator_signature = comment.send(:sign_with_key,@user2.encryption_key) comment.signature_valid?.should be true comment.verify_post_creator_signature.should be false end it 'should receive remote comments on a user post with a creator sig' do - comment = Comment.new(:person => @person2, :text => "balls", :post => @message) - comment.creator_signature = comment.send(:sign_with_key,@person2.encryption_key) + comment = Comment.new(:person => @user2.person, :text => "cats", :post => @message) + comment.creator_signature = comment.send(:sign_with_key,@user2.encryption_key) comment.signature_valid?.should be true comment.verify_post_creator_signature.should be false end From f36b99b03c008cd344d28b2db104877a75756b3a Mon Sep 17 00:00:00 2001 From: ilya Date: Sun, 26 Sep 2010 22:13:28 -0700 Subject: [PATCH 322/449] changed the deploy_config to play on remote --- config/deploy_config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/deploy_config.yml b/config/deploy_config.yml index 6aacbf3ff..6443a51ac 100644 --- a/config/deploy_config.yml +++ b/config/deploy_config.yml @@ -6,7 +6,7 @@ cross_server: deploy_to: '/usr/local/app/diaspora' user: 'root' repo: 'git://github.com/diaspora/diaspora.git' - branch: 'master' + branch: 'private_key_user_refactor' default_env: 'development' servers: tom: From b4d4986758f0cf17e3ceca0f706ca80e6652d98f Mon Sep 17 00:00:00 2001 From: danielvincent Date: Sun, 26 Sep 2010 22:20:01 -0700 Subject: [PATCH 323/449] removed inclusion block --- lib/diaspora/webhooks.rb | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/lib/diaspora/webhooks.rb b/lib/diaspora/webhooks.rb index 2be45d76a..fc241a6d3 100644 --- a/lib/diaspora/webhooks.rb +++ b/lib/diaspora/webhooks.rb @@ -4,16 +4,12 @@ module Diaspora module Webhooks - def self.included(klass) - klass.class_eval do - def to_diaspora_xml - xml = "" - xml += "#{self.to_xml.to_s}" - xml += "" - end - - end + def to_diaspora_xml + xml = "" + xml += "#{to_xml.to_s}" + xml += "" end + end end From 08c0c345f5f163d84b832e2c31ae4bf15c7364fc Mon Sep 17 00:00:00 2001 From: Yaron Shahrabani Date: Mon, 27 Sep 2010 09:49:38 +0200 Subject: [PATCH 324/449] Updated Hebrew translation --- config/locales/devise/devise.he.yml | 43 +++--- config/locales/diaspora/he.yml | 195 ++++++++++++++-------------- 2 files changed, 122 insertions(+), 116 deletions(-) diff --git a/config/locales/devise/devise.he.yml b/config/locales/devise/devise.he.yml index 4ae726a4d..c33cfa678 100644 --- a/config/locales/devise/devise.he.yml +++ b/config/locales/devise/devise.he.yml @@ -1,8 +1,9 @@ # Copyright (c) 2010, Diaspora Inc. This file is # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. +# Translated to Hebrew by Yaron Shahrabani , 2010. -en: +he: errors: messages: not_found: "לא נמצא" @@ -11,30 +12,30 @@ en: devise: failure: - unauthenticated: "צריך להתחבר או להירשם לפני שאפשר להמשיך." - unconfirmed: "צריך לאשר את החשבון לפני שאפשר להמשיך." - locked: "החשבון שלך נעול." - invalid: "אימייל או סיסמה לא נכונים." - invalid_token: "מספר אימות לא נכון." - timeout: "פג תוקפו של החיבור. נא להתחבר מחדש על מנת להמשיך." - inactive: "החשבון לא אומת עדיין." + unauthenticated: "עליך להיכנס או להירשם לפני המשך הפעילות." + unconfirmed: "עליך לאמת את חשבונך לפי המשך הפעילות." + locked: "חשבונך נעול." + invalid: "הססמה או הדוא״ל שגויים." + invalid_token: "אסימון האימות שגוי." + timeout: "ההפעלה שלך פגה, נא להיכנס שוב כדי להמשיך." + inactive: "חשבונך לא הופעל עדין." sessions: - signed_in: "התחברות עברה בהצלחה." - signed_out: "התנתקות עברה בהצלחה." + signed_in: "נכנסת בהצלחה." + signed_out: "יצאת בהצלחה." passwords: - send_instructions: "אימייל עם הוראות עיצד לאפס סיסמה יתקבל בקרוב." - updated: "סיסמה הוחלפה בהצלחה, את/ה כעת מחובר/ת." + send_instructions: "בעוד מספר דקות תתקבל לתיבת הדוא״ל שלך הודעה עם הנחיות כיצד לאפס את ססמתך." + updated: "ססמתך הוחלפה בהצלחה. נכנסת כעת." confirmations: - send_instructions: "אימייל עם הוראות כיצד לאמת את החשבון יתקבל בקרוב." - confirmed: "חשבון אומת בהצלחה. את/ה כעת מחובר/ת." + send_instructions: "בעוד מספר דקות תתקבל לתיבת הדוא״ל שלך הודעה עם הנחיות כיצד לאמת את חשבונך." + confirmed: "חשבונך אומת בהצלחה. נכנסת כעת." registrations: - signed_up: "התחברת בהצלחה, אם הדבר מאופשר, יתקבל אימייל אישור בקרוב.." + signed_up: "נרשמת בהצלחה. הודעת אימות תישלח אליך לדוא״ל במידה שהוגדרה." updated: "חשבונך עודכן בהצלחה." - destroyed: "להתראות! חשבונך נמחק בהצלחה. מקווים לראותך שוב בקרוב!" + destroyed: "להתראות! חשבונך בוטל בהצלחה. מקווים לראותך שוב בקרוב." unlocks: - send_instructions: "אימייל עם הוראות כיצד להסיר את הנעילה מחשבונך יתקבל בקרוב." - unlocked: "חשבונך נפתח בהצלחה. את/ה כעת מחובר/ת." + send_instructions: "בעוד מספר דקות תתקבל לתיבת הודא״ל שלך הודעה עם הנחיות כיצד לשחרר את חשבונך." + unlocked: "חשבונך שוחרר בהצלחה. נכנסת כעת." mailer: - confirmation_instructions: "הוראות אישור" - reset_password_instructions: "הוראות איפוס סיסמה" - unlock_instructions: "הוראות הסרת נעילה" + confirmation_instructions: "הנחיות לאימות" + reset_password_instructions: "הנחיות לאיפוס הססמה" + unlock_instructions: "הנחיות לשחרור" diff --git a/config/locales/diaspora/he.yml b/config/locales/diaspora/he.yml index 9f7670a97..8b348b3c7 100644 --- a/config/locales/diaspora/he.yml +++ b/config/locales/diaspora/he.yml @@ -1,67 +1,72 @@ # Copyright (c) 2010, Diaspora Inc. This file is # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. +# Translated to Hebrew by Yaron Shahrabani , 2010. + + +# Sample localization file for English. Add more files in this directory for other locales. +# See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. he: hello: "שלום עולם" application: helper: - unknown_person: "אדם לא מוכר" + unknown_person: "אדם לא ידוע" new_requests: "בקשות חדשות" dashboards: helper: home: "בית" error_messages: helper: - invalid_fields: "שדות לא חוקיים" - correct_the_following_errors_and_try_again: "נא לתקן את השגיאות הבאות ולנסות שוב." + invalid_fields: "שדות שגויים" + correct_the_following_errors_and_try_again: "יש לתקן את השגיאות הבאות ולנסות שוב." people: helper: results_for: " תוצאות עבור %{params}" - people_on_pod_are_aware_of: " אנשים בפוד מכירים את" + people_on_pod_are_aware_of: " אנשים בפוד מודעים לכך" layouts: application: - edit_profile: "ערוך פרופיל" - logout: "התנתק" + edit_profile: "עריכת הפרופיל" + logout: "יציאה" shared: aspect_nav: - all_aspects: "כל האספקטים" - manage: "נהל" - manage_your_aspects: "נהל אספקטים" + all_aspects: "כל ההיבטים" + manage: "ניהול" + manage_your_aspects: "ניהול ההיבטים שלך" sub_header: - all_aspects: "כל האספקטים" - manage_aspects: "נהל אספקטים" + all_aspects: "כל ההיבטים" + manage_aspects: "ניהול ההיבטים" publisher: - share: "שתף" + share: "שיתוף" aspect_friends: - add_friends: "הוסף חברים" + add_friends: "הוספת חברים" albums: album: - you: "אתה" + you: "את/ה" new_album: - create: "צור" - add_a_new_album: "הוסף אלבום חדש" - show: - edit_album: "ערוך אלבום" + create: "יצירה" + add_a_new_album: "הוספת אלבום חדש" + show: + edit_album: "עריכת אלבום" albums: "אלבומים" - updated: "עדכן" + updated: "תאריך העדכון" by: "על ידי" edit: editing: "עריכה" - updated: "עודכן" - are_you_sure: "האם את/ה בטוח/ה?" - delete_album: "מחק אלבום" - cancel: "בטל" + updated: "תאריך העדכון" + are_you_sure: "בבטחה?" + delete_album: "מחיקת אלבום" + cancel: "ביטול" index: home: "בית" new_album: "אלבום חדש" create: success: "יצרת אלבום בשם %{name}." update: - success: "אלבום %{name} עודכן בהצלחה." - failure: "עריכת אלבום %{name} נכשלה." + success: "האלבום %{name} נערך בהצלחה." + failure: "אירע כשל בעריכת האלבום %{name}." destroy: - success: "אלבום %{name} נמחק." + success: "האלבום %{name} נמחק." helper: friends_albums: "אלבומים של חברים" your_albums: "האלבומים שלך" @@ -71,42 +76,42 @@ he: show: photos: "תמונות" manage: - add_a_new_aspect: "הוסף אספקט" - add_a_new_friend: "הוסף חבר" - show: "הצג" - update_aspects: "עדכן אספקטים" + add_a_new_aspect: "הוספת היבט חדש" + add_a_new_friend: "הוספת חבר חדש" + show: "הצגה" + update_aspects: "עדכון ההיבטים" requests: "בקשות" - ignore_remove: "התעלם/מחק" + ignore_remove: "התעלמות/הסרה" new_aspect: - add_a_new_aspect: "הוסף אספקט" - create: "צור" + add_a_new_aspect: "הוספת היבט חדש" + create: "יציאה" create: - success: "לחץ על הפלוס בצד ימין על מנת לקבוע מי רשאי לצפות באספקט." + success: "יש ללחוץ על סמל הפלוס שמימין כדי לומר לדיאספורה מי יעול לצפות בהיבט החדש שלך." destroy: success: "%{name} הוסר בהצלחה." update: - success: "האספקט שלך, %{name}, נערך בהצלחה." + success: "ההיבט שלך, %{name}, נערך בהצלחה." move_friends: - failure: "עריכת אספקט נכשלה עבור %{real_name}." - success: "אספקטים נערכו בהצלחה." + failure: "עריכת ההיבט נכשלה עבור החבר %{real_name}." + success: "ההיבטים נערכו בהצלחה." move_friend: failure: "לא עבד %{inspect}" - success: "אתה כעת מציג לחברך אספקט שונה שלך." + success: "כעת יופיע בפני החברים שלך היבט אחר שלך." helper: - remove: "מחק" - aspect_not_empty: "אספקט לא ריק" + remove: "הסרה" + aspect_not_empty: "ההיסט אינו ריק" users: edit: - cancel: "בטל" - update_profile: "עדכן פרופיל" + cancel: "ביטול" + update_profile: "עדכון הפרופיל" home: "בית" - diaspora_username: "שם משתמש בדיאספורה" - info: "מידע" + diaspora_username: "שם המשתמש בדיאספורה" + info: "פרטים" picture: "תמונה" - editing_profile: "עורך פרופיל" + editing_profile: "עריכת הפרופיל" albums: "אלבומים" - you_dont_have_any_photos: "אין לך תמונות! עבור ל-" - page_to_upload_some: "דף להעלאה." + you_dont_have_any_photos: "אין לך תמונות! באפשרותך לגשת לעמוד" + page_to_upload_some: "כדי להעלות כמה." comments: comment: ago: "לפני" @@ -114,88 +119,88 @@ he: comment: "הערה" photos: show: - prev: "קודם" + prev: "הקודמת" full_size: "גודל מלא" - next: "הבא" - edit_photo: "ערוך תמונה" - delete_photo: "מחק תמונה" - are_you_sure: "האם אתה בטוח?" + next: "הבאה" + edit_photo: "עריכת תמונה" + delete_photo: "מחיקת תמונה" + are_you_sure: "בבטחה?" comments: "הערות" edit: editing: "עריכה" - are_you_sure: "האם אתה בטוח?" - delete_photo: "מחק תמונה" + are_you_sure: "בבטחה?" + delete_photo: "מחיקת תמונה" photo: - show_comments: "הצג הערות" - posted_a_new_photo_to: "הועלתה תמונה חדשה ל-" + show_comments: "הצגת הערות" + posted_a_new_photo_to: "פורסמה תמונה חדשה אל" new: new_photo: "תמונה חדשה" - back_to_list: "חרה לרשימה" - post_it: "שתף!" + back_to_list: "חזרה לרשימה" + post_it: "פרסום!" create: - runtime_error: "העלאת תמונה נכשלה. האם אתה חוגר חגורת בטיחות?" - integrity_error: "העלאת תמונה נכשלה. האם זו אכן הייתה תמונה?" - type_error: "העלאת תמונה נכשלה. האם אכן נוספה תמונה?" + runtime_error: "העלאת התמונה נכשלה. האם החגורה שלך מהודקת?" + integrity_error: "העלאת התמונה נכשלה. האם זו באמת הייתה תמונה?" + type_error: "העלאת התמונה נכשלה. האם באמת נוספה תמונה?" update: - notice: "תמונה עודכנה בהצלחה." - error: "עריכת תמונה נכשלה." + notice: "התמונה עודכנה בהצלחה." + error: "אירע כשל בעריכת התמונה." destroy: - notice: "תמונה נמחקה." + notice: "התמונה נמחקה." registrations: new: - sign_up: "הצטרפות" + sign_up: "הרשמה" create: success: "הצטרפת לדיאספורה!" status_messages: new_status_message: - tell_me_something_good: "ספר לי משהו נחמד" + tell_me_something_good: "בא לי לשמוע סיפור טוב" oh_yeah: "אחלה!" status_message: - show_comments: "הצג תגובות" - delete: "מחק" - are_you_sure: "האם אתה בטוח?" + show_comments: "הצגת הערות" + delete: "מחיקה" + are_you_sure: "בבטחה?" show: - status_message: "הודעת סטטוס" + status_message: "הודעת מצב" comments: "הערות" - are_you_sure: "האם אתה בטוח?" - destroy: "השמד" - view_all: "הצג הכל" + are_you_sure: "בבטחה?" + destroy: "הריבה" + view_all: "צפייה בכול" message: "הודעה" owner: "בעלים" helper: - no_message_to_display: "אין הודעה להציג." + no_message_to_display: "אין הודעה להצגה." people: person: - add_friend: "הוסף חבר" - pending_request: "בקשה על תנאי" + add_friend: "הוספת חבר" + pending_request: "בקשה ממתינה" index: - add_friend: "הוסף חבר" - real_name: "שם אמיתי" + add_friend: "הוספת חבר" + real_name: "שם אמתי" diaspora_handle: "כינוי בדיאספורה" - thats_you: "זה אתה!" - friend_request_pending: "בקשת חברות ממתינה" + thats_you: "מדובר בך!" + friend_request_pending: "בקשת החברות ממתינה" you_have_a_friend_request_from_this_person: "יש לך בקשת חברות מאדם זה" new: new_person: "אדם חדש" back_to_list: "חזרה לרשימה" show: - last_seen: "נראה לאחרונה: %{how_long_ago}" + last_seen: "פעילות אחרונה: %{how_long_ago}" friends_since: "חברים מאז: %{how_long_ago}" - save: "שמור" - are_you_sure: "האם אתה בטוח?" - remove_friend: "מחק חבר" + save: "שמירה" + are_you_sure: "בבטחה?" + remove_friend: "הסרת חבר" requests: new_request: - add_a_new_friend_to: "הוסף חבר חדש ל-" - enter_a_diaspora_username: "הכנס שם משתמש בדיאספורה:" - your_diaspora_username_is: "שם המשתמש שלך בדיאספורה: %{diaspora_handle}" - friends_username: "שם המשתמש של חבר" + add_a_new_friend_to: "הוספת חבר חדש אל" + enter_a_diaspora_username: "נא להזין שם משתמש בדיאספורה:" + your_diaspora_username_is: "שם המשתמש שלך בדיאספורה הוא: %{diaspora_handle}" + friends_username: "שם המשתמש של החבר" destroy: - success: "אתם כעת חברים." - error: "נא לבחור אספקט!" - ignore: "התעלמת מבקשת חברות." + success: "אתם חברים כעת." + error: "נא לבחור בהיבט!" + ignore: "בקשות חברות מהן התעלמת." create: - error: "לא נמצא זרע דיאספורה עם אימייל זה!" - already_friends: "את/ה כבר חבר של %{destination_url}!" - success: "בקשת חברות נשלחה ל%{destination_url}." - horribly_wrong: "משהו רע מאוד קרה." + error: "לא נמצא זרע של דיאספורה בכתובת דוא״ל זו!" + already_friends: "את/ה ו%{destination_url} כבר חברים!" + success: "בקשת חברות נשלחה אל %{destination_url}." + horribly_wrong: "משהו השתבש לגמרי." From 98bc2df841506ecccbec96274e65e8d88d042e65 Mon Sep 17 00:00:00 2001 From: ilya Date: Mon, 27 Sep 2010 10:10:54 -0700 Subject: [PATCH 325/449] removed the encryption key= method, and user with private key factory --- app/models/user.rb | 6 ------ spec/factories.rb | 4 ---- 2 files changed, 10 deletions(-) diff --git a/app/models/user.rb b/app/models/user.rb index 535577fd3..d89b8b59a 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -291,10 +291,4 @@ class User OpenSSL::PKey::RSA.new( serialized_private_key ) end - def encryption_key= new_key - raise TypeError unless new_key.class == OpenSSL::PKey::RSA - serialized_private_key = new_key.export - end - - end diff --git a/spec/factories.rb b/spec/factories.rb index 826ca970d..9f8efc4c3 100644 --- a/spec/factories.rb +++ b/spec/factories.rb @@ -25,10 +25,6 @@ Factory.define :album do |p| p.person { |a| Factory.create(:person) } end -Factory.define :person_with_private_key, :parent => :person do |p| - p.serialized_key OpenSSL::PKey::RSA.generate(1024).export -end - Factory.define :user do |u| u.sequence(:username) {|n| "bob#{n}"} u.sequence(:email) {|n| "bob#{n}@pivotallabs.com"} From 0aa8e0e7539cac21bbdd05ca52ea3d43d947e2b3 Mon Sep 17 00:00:00 2001 From: Raphael Date: Mon, 27 Sep 2010 10:39:29 -0700 Subject: [PATCH 326/449] Unfortunately, we can't put ruby-debug in the gemfile because it breaks 1.9.2 compatibility. Just put it back in locally when you want to use it, or figure out how to do a switch by ruby verison in the Gemfile --- Gemfile | 1 - Gemfile.lock | 8 -------- 2 files changed, 9 deletions(-) diff --git a/Gemfile b/Gemfile index 7fde201c1..9560f07d1 100644 --- a/Gemfile +++ b/Gemfile @@ -38,7 +38,6 @@ gem 'mini_magick' group :test, :development do gem 'factory_girl_rails' - gem 'ruby-debug' end group :test do diff --git a/Gemfile.lock b/Gemfile.lock index a56760270..71e42e422 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -116,7 +116,6 @@ GEM rack (>= 1.0.0) rack-test (>= 0.5.4) selenium-webdriver (>= 0.0.3) - columnize (0.3.1) crack (0.1.8) cucumber (0.9.0) builder (~> 2.1.2) @@ -152,7 +151,6 @@ GEM i18n (0.4.1) json (1.4.6) json_pure (1.4.6) - linecache (0.43) mail (2.2.6.1) activesupport (>= 2.3.6) mime-types @@ -214,11 +212,6 @@ GEM rspec-rails (2.0.0.beta.17) rspec (>= 2.0.0.beta.14) webrat (>= 0.7.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.28) ffi (>= 0.6.1) @@ -278,7 +271,6 @@ DEPENDENCIES roxml! rspec (>= 2.0.0.beta.17) rspec-rails (= 2.0.0.beta.17) - ruby-debug sprinkle! thin webmock From 4f89f957f10ac251c6b8659fa45ca70b5efbf09b Mon Sep 17 00:00:00 2001 From: Raphael Date: Mon, 27 Sep 2010 10:51:29 -0700 Subject: [PATCH 327/449] Putting in version switches for gems that don't work in 1.9 --- Gemfile | 3 ++- Gemfile.lock | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 9560f07d1..55e340dec 100644 --- a/Gemfile +++ b/Gemfile @@ -38,6 +38,7 @@ gem 'mini_magick' group :test, :development do gem 'factory_girl_rails' + gem 'ruby-debug' if RUBY_VERSION.include? "1.8" end group :test do @@ -46,7 +47,7 @@ group :test do gem 'rspec', '>= 2.0.0.beta.17' gem 'rspec-rails', '2.0.0.beta.17' gem 'mocha' - gem 'redgreen' + gem 'redgreen' if RUBY_VERSION.include? "1.8" gem 'autotest' gem 'database_cleaner' gem 'webmock' diff --git a/Gemfile.lock b/Gemfile.lock index 71e42e422..a56760270 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -116,6 +116,7 @@ GEM rack (>= 1.0.0) rack-test (>= 0.5.4) selenium-webdriver (>= 0.0.3) + columnize (0.3.1) crack (0.1.8) cucumber (0.9.0) builder (~> 2.1.2) @@ -151,6 +152,7 @@ GEM i18n (0.4.1) json (1.4.6) json_pure (1.4.6) + linecache (0.43) mail (2.2.6.1) activesupport (>= 2.3.6) mime-types @@ -212,6 +214,11 @@ GEM rspec-rails (2.0.0.beta.17) rspec (>= 2.0.0.beta.14) webrat (>= 0.7.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.28) ffi (>= 0.6.1) @@ -271,6 +278,7 @@ DEPENDENCIES roxml! rspec (>= 2.0.0.beta.17) rspec-rails (= 2.0.0.beta.17) + ruby-debug sprinkle! thin webmock From ce0accafbbafa06b0ea5218763527ef7a335e3c2 Mon Sep 17 00:00:00 2001 From: Raphael Date: Mon, 27 Sep 2010 11:03:48 -0700 Subject: [PATCH 328/449] Don't depend on user => person delagation so we can eventually get rid of that, thanks astronouth7303 --- app/controllers/users_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 260b5b7fa..243d448d8 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -10,7 +10,7 @@ class UsersController < ApplicationController def edit @user = current_user @person = @user.person - @profile = @user.profile + @profile = @user.person.profile @photos = Photo.find_all_by_person_id(@person.id).paginate :page => params[:page], :order => 'created_at DESC' end From 6b9bcfda6301ff5246432aeeb30a77e7e853246c Mon Sep 17 00:00:00 2001 From: Daniele Di Sarli Date: Sun, 26 Sep 2010 17:57:41 +0800 Subject: [PATCH 329/449] Corrected Italian translation --- config/locales/diaspora/it.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/locales/diaspora/it.yml b/config/locales/diaspora/it.yml index 4730b3cea..707704d25 100644 --- a/config/locales/diaspora/it.yml +++ b/config/locales/diaspora/it.yml @@ -21,7 +21,7 @@ it: people: helper: results_for: " risultati per %{params}" - people_on_pod_are_aware_of: " people on pod are aware of" + people_on_pod_are_aware_of: " persone su pod sono consapevoli di" layouts: application: edit_profile: "modifica profilo" @@ -136,7 +136,7 @@ it: back_to_list: "Torna all'elenco" post_it: "inseriscila!" create: - runtime_error: "Caricamento della foto fallito. Sei sicuro che la tua cintura di sicurezza è allacciata?" + runtime_error: "Caricamento della foto fallito. Hai allacciato le cinture?" integrity_error: "Caricamento della foto fallito. Sei sicuro che era un'immagine?" type_error: "Caricamento della foto fallito. Sei sicuro di aver aggiunto un'immagine?" update: From 2c55e700673494ca4baf392f49db227ef51da380 Mon Sep 17 00:00:00 2001 From: "michael.scheffler" Date: Mon, 27 Sep 2010 19:18:36 +0800 Subject: [PATCH 330/449] Replaced hardcoded '@example.com' with APP_CONFIG[:terse_pod_url] --- spec/models/person_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/models/person_spec.rb b/spec/models/person_spec.rb index c11d03455..6df3ddc1c 100644 --- a/spec/models/person_spec.rb +++ b/spec/models/person_spec.rb @@ -16,7 +16,7 @@ describe Person do describe '#diaspora_handle' do context 'local people' do it 'uses the pod config url to set the diaspora_handle' do - @user.person.diaspora_handle.should == @user.username + "@example.org" + @user.person.diaspora_handle.should == @user.username + "@" + APP_CONFIG[:terse_pod_url] end end From 1a876355d57602a0fbf78baeab6d9ee8d7beeddc Mon Sep 17 00:00:00 2001 From: Guillermo Date: Mon, 27 Sep 2010 02:49:31 +0800 Subject: [PATCH 331/449] Some fixes in spanish locale --- config/locales/diaspora/es.yml | 87 +++++++++++++++++----------------- 1 file changed, 44 insertions(+), 43 deletions(-) diff --git a/config/locales/diaspora/es.yml b/config/locales/diaspora/es.yml index 37657e1f4..f62c20480 100644 --- a/config/locales/diaspora/es.yml +++ b/config/locales/diaspora/es.yml @@ -6,7 +6,7 @@ # See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. es: - hello: "Hola Mundo" + hello: "Hola mundo" application: helper: unknown_person: "persona desconocida" @@ -17,15 +17,15 @@ es: error_messages: helper: invalid_fields: "Campos Invalidos" - correct_the_following_errors_and_try_again: "Corrija los siguentes errores y trate de nuevo." + correct_the_following_errors_and_try_again: "Corrija los siguentes errores e intente de nuevo." people: helper: results_for: " resultados para %{params}" - people_on_pod_are_aware_of: " gente en pod estan al tanto de " + people_on_pod_are_aware_of: " personas en pod estan al tanto de" layouts: application: edit_profile: "editar perfil" - logout: "desloguear" + logout: "cerrar sesión" shared: aspect_nav: all_aspects: "Todos los Aspectos" @@ -42,29 +42,29 @@ es: album: you: "usted" new_album: - create: "Crear" + create: "crear" add_a_new_album: "Añade un nuevo álbum" show: edit_album: "Editar Álbum" albums: "álbumes" - updated: "actualizar" + updated: "actualizado" by: "por" edit: editing: "Editando" updated: "actualizado" - are_you_sure: "Esta seguro?" + are_you_sure: "¿Está seguro?" delete_album: "Eliminar Álbum" cancel: "Cancelar" index: home: "home" new_album: "Nuevo Álbum" create: - success: "Creo el álbum llamado %{name}." + success: "Has creado el álbum llamado %{name}." update: - success: "Álbum %{name} fue editado exitosamente." - failure: "Fallo el editar el álbum %{name}." + success: "El álbum %{name} fue editado exitosamente." + failure: "Fallo al editar el álbum %{name}." destroy: - success: "Álbum %{name} fue eliminado." + success: "El álbum %{name} fue eliminado." helper: friends_albums: "Álbumes de amigos" your_albums: "Tus Álbumes" @@ -74,38 +74,39 @@ es: show: photos: "fotos" manage: - add_a_new_aspect: "Añadir nuevo aspecto" - add_a_new_friend: "Añadir nuevo amigo" + add_a_new_aspect: "Añadir un nuevo aspecto" + add_a_new_friend: "Añadir un nuevo amigo" show: "Mostrar" update_aspects: "Actualizar Aspectos" - requests: "Requests" + requests: "Peticiones" ignore_remove: "Ignorar/Remover" new_aspect: - add_a_new_aspect: "Añadir nuevo aspecto" + add_a_new_aspect: "Añadir un nuevo aspecto" create: "Crear" create: - success:"Pulsa en el signo de mas a la izquierda para escojer quien puede ver su nuevo aspecto." + success:"Pulsa el signo de mas a la izquierda para escojer quien puede ver su nuevo aspecto." + failure: "La creación del Aspecto falló." destroy: - success: "%{name} fue removido exitosamente." + success: "%{name} fue eliminado exitosamente." update: success: "Su aspecto, %{name}, fue editado exitosamente." move_friends: failure: "Fallo el editar aspecto para el amigo %{real_name}." - success: "Los aspectos fueron editados exitosamente." + success: "Aspectos editados exitosamente." move_friend: - error: "no funciono %{inspect}" + error: "no funcionó %{inspect}" notice: "Ahora estas mostrando a tu amigo un aspecto diferente de ti." helper: - remove: "remover" - aspect_not_empty: "Aspecto no esta vacio" + remove: "eliminar" + aspect_not_empty: "Aspecto no vacio" users: edit: cancel: "Cancelar" update_profile: "Actualizar Perfil" home: "Home" - diaspora_username: "USUARIO DE DIASPORA" + diaspora_username: "NOMBRE DE USUARIO DE DIASPORA" info: "Info" - picture: "Picture" + picture: "Foto" editing_profile: "Editando perfil" albums: "Álbums" you_dont_have_any_photos: "No tienes ninguna foto! ve a la pagina" @@ -114,41 +115,41 @@ es: comment: ago: "atras" new_comment: - comment: "Commentario" + comment: "Comentario" photos: show: prev: "prev" - full_size: "tamaño actual" + full_size: "tamaño completo" next: "prox" edit_photo: "Editar Foto" delete_photo: "Eliminar Foto" - are_you_sure: "Esta seguro?" + are_you_sure: "¿Está seguro?" comments: "comentarios" edit: editing: "Editando" - are_you_sure: "Esta seguro?" + are_you_sure: "¿Está seguro?" delete_photo: "Eliminar Foto" photo: show_comments: "mostrar comentarios" posted_a_new_photo_to: "a puesto una nueva foto en" new: new_photo: "Nueva Foto" - back_to_list: "Devuelta a la lista" + back_to_list: "Volver a la lista" post_it: "post it!" create: runtime_error: "Photo upload failed. Are you sure that your seatbelt is fastened?" - integrity_error: "Photo upload failed. Are you sure that was an image?" - type_error: "Photo upload failed. Are you sure an image was added?" + integrity_error: "Falló carga de la foto. ¿Está seguro de que era una imagen?" + type_error: "Falló carga de la foto. ¿Está seguro de que una imagen fue añadida?" update: - notice: "Photo successfully updated." - error: "Failed to edit photo." + notice: "Foto actualizada satisfactoriamente." + error: "Falló la edición de la foto." destroy: - notice: "Photo deleted." + notice: "Foto eliminada." registrations: new: - sign_up: "Registrate" + sign_up: "Regístrate" create: - success: "Esta registrado en Diaspora!" + success: "Se ha unido a Diaspora!" status_messages: new_status_message: tell_me_something_good: "dime algo bueno" @@ -160,8 +161,8 @@ es: show: status_message: "Mensaje de status" comments: "comentarios" - are_you_sure: "Esta seguro?" - destroy: "Destruir" + are_you_sure: "¿Está seguro?" + destroy: "Borrar" view_all: "Ver Todos" message: "Mensaje" owner: "Dueño" @@ -176,20 +177,20 @@ es: real_name: "nombre real" diaspora_handle: "usuario en diaspora" thats_you: "ese eres tu!" - friend_request_pending: "friend request pending" - you_have_a_friend_request_from_this_person: "you have a friend request from this person" + friend_request_pending: "petición de amistad pendiente" + you_have_a_friend_request_from_this_person: "tienes una petición de amistad de esta persona" show: last_seen: "ultima vez visto: %{how_long_ago}" friends_since: "amigos desde: %{how_long_ago}" save: "guardar" - are_you_sure: "Esta seguro?" - remove_friend: "remover amigo" + are_you_sure: "¿Está seguro?" + remove_friend: "eliminar amigo" requests: new_request: add_a_new_friend_to: "Añade un nuevo amigo a " enter_a_diaspora_username: "Escribe el usuario de Diaspora:" your_diaspora_username_is: "Tu usuario de Diaspora es: %{diaspora_handle}" - friends_username: "Usuario de amigo" + friends_username: "Nombre de usuario de amigo" destroy: success: "Ahora son amigos." error: "Seleccione un aspecto!" @@ -198,4 +199,4 @@ es: error: "No diaspora seed found with this email!" already_friends: "Ya eres amigo de %{destination_url}!" success: "Una peticion de amistad se envio a %{destination_url}." - horribly_wrong: "Algo horriblemente mal sucedio" + horribly_wrong: "Algo horriblemente incorrecto ha sucedido" From b823213c0db600eaab02fb6c5a923283996988dd Mon Sep 17 00:00:00 2001 From: ilya Date: Mon, 27 Sep 2010 15:29:55 -0700 Subject: [PATCH 332/449] added a generate:secret_token task, and added an initializer to generate one if the file does not exist --- .gitignore | 1 + config/initializers/check_session_secret.rb | 5 ++++ config/initializers/secret_token.rb | 2 +- lib/tasks/generate_session_secret.rake | 26 +++++++++++++++++++++ 4 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 config/initializers/check_session_secret.rb create mode 100644 lib/tasks/generate_session_secret.rake diff --git a/.gitignore b/.gitignore index 4a78ed39f..d02467332 100644 --- a/.gitignore +++ b/.gitignore @@ -17,3 +17,4 @@ public/uploads/* config/app_config.yml bin/* nbproject +config/initializers/secret_token.rb diff --git a/config/initializers/check_session_secret.rb b/config/initializers/check_session_secret.rb new file mode 100644 index 000000000..1970c5078 --- /dev/null +++ b/config/initializers/check_session_secret.rb @@ -0,0 +1,5 @@ +unless File.exists?( File.join(Rails.root, 'config', 'initializers', 'secret_token.rb')) + `rake generate:secret_token` + require File.join(Rails.root, 'config', 'initializers', 'secret_token.rb') +end + diff --git a/config/initializers/secret_token.rb b/config/initializers/secret_token.rb index 20f6087bf..66c59261a 100644 --- a/config/initializers/secret_token.rb +++ b/config/initializers/secret_token.rb @@ -8,4 +8,4 @@ # If you change this key, all old signed cookies will become invalid! # Make sure the secret is at least 30 characters and all random, # no regular words or you'll be exposed to dictionary attacks. -Rails.application.config.secret_token = 'ea08916110cae7f10fe9e1f7c7cb8c1fee13c3c3bee35180ac3061c370bd9ad985f28fcf2eb5f5684d0d618855efdeb862918628e994ed3e7fc806777428ef40' +Rails.application.config.secret_token = '3484b78b0f9d88f40cd44a20cf647140e5900632d0c9b85e1fd91dc539811d243f2f0756f791019c' diff --git a/lib/tasks/generate_session_secret.rake b/lib/tasks/generate_session_secret.rake new file mode 100644 index 000000000..90274dff3 --- /dev/null +++ b/lib/tasks/generate_session_secret.rake @@ -0,0 +1,26 @@ +namespace :generate do + desc 'Generates a Session Secret Token' + task :secret_token do + + path = File.join(Rails.root, 'config', 'initializers', 'secret_token.rb') + secret = ActiveSupport::SecureRandom.hex(40) + File.open(path, 'w') do |f| + f.write <<"EOF" +# Copyright (c) 2010, Diaspora Inc. This file is +# licensed under the Affero General Public License version 3. See +# the COPYRIGHT file. + +# Be sure to restart your server when you modify this file. + +# Your secret key for verifying the integrity of signed cookies. +# If you change this key, all old signed cookies will become invalid! +# Make sure the secret is at least 30 characters and all random, +# no regular words or you'll be exposed to dictionary attacks. +Rails.application.config.secret_token = '#{secret}' +EOF + +puts "YAY!!" +end + + end +end From 7b29e6ec269e322743f73e2bac738d7b81e8356a Mon Sep 17 00:00:00 2001 From: ilya Date: Mon, 27 Sep 2010 15:50:52 -0700 Subject: [PATCH 333/449] checking that a user is logged in before doing fb checking --- app/controllers/application_controller.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 46b011a61..8817bc645 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -40,8 +40,10 @@ class ApplicationController < ActionController::Base end def fb_user_info - @access_token = env['warden'].session[:access_token] - @logged_in = @access_token.present? + if current_user + @access_token = env['warden'].session[:access_token] + @logged_in = @access_token.present? + end end end From 50234b095b2ca3b71699c380a4accf059bb87c88 Mon Sep 17 00:00:00 2001 From: ilya Date: Mon, 27 Sep 2010 16:02:08 -0700 Subject: [PATCH 334/449] had to move translation around slightly, now the profile edit will be missing a template --- config/locales/diaspora/en.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/config/locales/diaspora/en.yml b/config/locales/diaspora/en.yml index 025aed149..838339641 100644 --- a/config/locales/diaspora/en.yml +++ b/config/locales/diaspora/en.yml @@ -101,6 +101,8 @@ en: aspect_not_empty: "Aspect not empty" users: edit: + editing_profile: "Editing profile" + profile: cancel: "Cancel" update_profile: "Update Profile" home: "Home" From a8f05244bae7a5b55076cd3c4668b1abe35ac917 Mon Sep 17 00:00:00 2001 From: ilya Date: Mon, 27 Sep 2010 16:07:24 -0700 Subject: [PATCH 335/449] localization should be fixed --- config/locales/diaspora/cs.yml | 2 ++ config/locales/diaspora/cy.yml | 4 +++- config/locales/diaspora/de.yml | 2 ++ config/locales/diaspora/es.yml | 2 ++ config/locales/diaspora/fr-informal.yml | 2 ++ config/locales/diaspora/fr.yml | 2 ++ config/locales/diaspora/he.yml | 2 ++ config/locales/diaspora/it.yml | 2 ++ config/locales/diaspora/pt-BR.yml | 2 ++ config/locales/diaspora/ro.yml | 2 ++ config/locales/diaspora/ru.yml | 2 ++ 11 files changed, 23 insertions(+), 1 deletion(-) diff --git a/config/locales/diaspora/cs.yml b/config/locales/diaspora/cs.yml index 78666424c..898428db2 100644 --- a/config/locales/diaspora/cs.yml +++ b/config/locales/diaspora/cs.yml @@ -113,6 +113,8 @@ cs: aspect_not_empty: "Aspekt není prázdný" users: edit: + editing_profile: "Upravit profil" + profile: cancel: "Zrušit" update_profile: "Aktualizovat profil" home: "Domů" diff --git a/config/locales/diaspora/cy.yml b/config/locales/diaspora/cy.yml index 97b4fd3df..cd1c7dbd6 100644 --- a/config/locales/diaspora/cy.yml +++ b/config/locales/diaspora/cy.yml @@ -69,6 +69,8 @@ cy: success:"Cliciwch ar y plus ar y chwith i ddweud wrth Diaspora pwy all weld eich agwedd newydd." users: edit: + editing_profile: "Golygu proffil" + profile: cancel: "Cancel" update_profile: "Diweddaru Proffil" home: "Adref" @@ -139,4 +141,4 @@ cy: friends_since: "yn ffrindiau ers: %{how_long_ago}" save: "arbed" are_you_sure: "Ydych chi'n sicr?" - remove_friend: "dileu ffrind" \ No newline at end of file + remove_friend: "dileu ffrind" diff --git a/config/locales/diaspora/de.yml b/config/locales/diaspora/de.yml index dd3cead59..e277a5efd 100644 --- a/config/locales/diaspora/de.yml +++ b/config/locales/diaspora/de.yml @@ -100,6 +100,8 @@ de: aspect_not_empty: "Aspekt ist nicht leer" users: edit: + editing_profile: "Profil bearbeiten" + profile: cancel: "Abbrechen" update_profile: "Profil aktualisieren" home: "Startseite" diff --git a/config/locales/diaspora/es.yml b/config/locales/diaspora/es.yml index f62c20480..5a73715b9 100644 --- a/config/locales/diaspora/es.yml +++ b/config/locales/diaspora/es.yml @@ -101,6 +101,8 @@ es: aspect_not_empty: "Aspecto no vacio" users: edit: + editing_profile: "Editando perfil" + profile: cancel: "Cancelar" update_profile: "Actualizar Perfil" home: "Home" diff --git a/config/locales/diaspora/fr-informal.yml b/config/locales/diaspora/fr-informal.yml index 141584dad..1c7950fe5 100644 --- a/config/locales/diaspora/fr-informal.yml +++ b/config/locales/diaspora/fr-informal.yml @@ -100,6 +100,8 @@ fr-informal: aspect_not_empty: "L’aspect n’est pas vide" users: edit: + editing_profile: "Édition du profil" + profile: cancel: "Annuler" update_profile: "Mettre à jour le profil" home: "Accueil" diff --git a/config/locales/diaspora/fr.yml b/config/locales/diaspora/fr.yml index 8a44e6dac..bab6f3852 100644 --- a/config/locales/diaspora/fr.yml +++ b/config/locales/diaspora/fr.yml @@ -87,6 +87,8 @@ fr: success:"Cliquez sur plus situé sur le côté gauche afin d’en informer Diaspora qui peut voir votre nouvel aspect." users: edit: + editing_profile: "Édition du profil" + profile: cancel: "Annuler" update_profile: "Mettre à jour le profil" home: "Accueil" diff --git a/config/locales/diaspora/he.yml b/config/locales/diaspora/he.yml index 8b348b3c7..47f2a52c2 100644 --- a/config/locales/diaspora/he.yml +++ b/config/locales/diaspora/he.yml @@ -102,6 +102,8 @@ he: aspect_not_empty: "ההיסט אינו ריק" users: edit: + editing_profile: "עריכת הפרופיל" + profile: cancel: "ביטול" update_profile: "עדכון הפרופיל" home: "בית" diff --git a/config/locales/diaspora/it.yml b/config/locales/diaspora/it.yml index 707704d25..24681fbe0 100644 --- a/config/locales/diaspora/it.yml +++ b/config/locales/diaspora/it.yml @@ -100,6 +100,8 @@ it: aspect_not_empty: "Aspetto non vuoto" users: edit: + editing_profile: "Modifica del profilo" + profile: cancel: "Annulla" update_profile: "Aggiorna profilo" home: "Home" diff --git a/config/locales/diaspora/pt-BR.yml b/config/locales/diaspora/pt-BR.yml index 8e87425e9..e8ffcc8e1 100644 --- a/config/locales/diaspora/pt-BR.yml +++ b/config/locales/diaspora/pt-BR.yml @@ -100,6 +100,8 @@ pt-BR: aspect_not_empty: "Aspecto não está vazio" users: edit: + editing_profile: "Editando perfil" + profile: cancel: "Cancelar" update_profile: "Atualizar Perfil" home: "Home" diff --git a/config/locales/diaspora/ro.yml b/config/locales/diaspora/ro.yml index 5800f4a30..ed3234571 100644 --- a/config/locales/diaspora/ro.yml +++ b/config/locales/diaspora/ro.yml @@ -66,6 +66,8 @@ ro: success:"Click pe semnul plus în partea stângă pentru a indica cine poate accesa noul aspect." users: edit: + editing_profile: "Editare profil" + profile: cancel: "Renunță" update_profile: "Actualizează Profil" home: "Home" diff --git a/config/locales/diaspora/ru.yml b/config/locales/diaspora/ru.yml index cc76b9b42..daeb35915 100644 --- a/config/locales/diaspora/ru.yml +++ b/config/locales/diaspora/ru.yml @@ -69,6 +69,8 @@ ru: success:"Нажмите на плюс слева, для того, что-бы указать Diaspora тех, кто может видеть ваш новый аспект." users: edit: + editing_profile: "Редактирование профиля" + profile: cancel: "Отмена" update_profile: "Обновить профиль" home: "Домой" From d41b37063023cec4b61fb9a4c7be4107ff9a8107 Mon Sep 17 00:00:00 2001 From: ilya Date: Mon, 27 Sep 2010 16:20:27 -0700 Subject: [PATCH 336/449] removing the fb feed for now --- app/views/aspects/public.html.haml | 4 ---- app/views/fb_status/_fb_status.html.haml | 13 ------------- 2 files changed, 17 deletions(-) delete mode 100644 app/views/fb_status/_fb_status.html.haml diff --git a/app/views/aspects/public.html.haml b/app/views/aspects/public.html.haml index 4399034f7..f04b63489 100644 --- a/app/views/aspects/public.html.haml +++ b/app/views/aspects/public.html.haml @@ -18,10 +18,6 @@ %ul#stream - for post in @posts = render type_partial(post), :post => post unless post.class == Album - - if @logged_in - - MiniFB.get(@access_token, 'me', :type => "feed")[:data].each do |item| - - if item[:type] == 'status' - = render "fb_status/fb_status", :post => FbStatus.from_api(item) #pagination = will_paginate @posts diff --git a/app/views/fb_status/_fb_status.html.haml b/app/views/fb_status/_fb_status.html.haml deleted file mode 100644 index d5a57bd22..000000000 --- a/app/views/fb_status/_fb_status.html.haml +++ /dev/null @@ -1,13 +0,0 @@ --# Copyright (c) 2010, Diaspora Inc. This file is --# licensed under the Affero General Public License version 3. See --# the COPYRIGHT file. - - -%li.message{:id => post.id} - - = image_tag( "http://graph.facebook.com/#{post.author_id}/picture" ) - - .content - %span.from - = post.author_name - = post.message From 52313b799b8e9aea4204e405ea99660d4e224a50 Mon Sep 17 00:00:00 2001 From: ilya Date: Mon, 27 Sep 2010 16:31:05 -0700 Subject: [PATCH 337/449] added a warning, moved connected as into a partial, removed the publishing box from settings page --- app/helpers/application_helper.rb | 5 +++++ app/views/shared/_publisher.haml | 2 +- app/views/users/_services.haml | 12 ++++-------- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 688ddb10b..7745ace96 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -66,4 +66,9 @@ module ApplicationHelper def post_yield_tag(post) (':' + post.id.to_s).to_sym end + + def connected_fb_as token + response_hash = MiniFB.get(token, 'me') + "Connected to facebook as #{response_hash[:name]}" + end end diff --git a/app/views/shared/_publisher.haml b/app/views/shared/_publisher.haml index 5db168f6f..d1ad995df 100644 --- a/app/views/shared/_publisher.haml +++ b/app/views/shared/_publisher.haml @@ -10,7 +10,7 @@ %p %label{:for => "status_message_message"} Message = f.text_area :message, :rows => 2, :value => params[:prefill] - = "going to Facebook as #{MiniFB.get(@access_token, 'me')[:name]}" if @logged_in && @aspect == :public + = connected_fb_as(@access_token) if @logged_in && @aspect == :public = f.hidden_field( :public, :value => (params[:action] == 'public') ) %ul.aspect_selector{ :style => "display:none;"} diff --git a/app/views/users/_services.haml b/app/views/users/_services.haml index c6e31939a..f2d976a79 100644 --- a/app/views/users/_services.haml +++ b/app/views/users/_services.haml @@ -8,20 +8,16 @@ %h3 Facebook %p - if @logged_in - Connected to facebook as - - @response_hash = MiniFB.get(@access_token, 'me') - = @response_hash[:name] - + = connected_fb_as(@access_token) + + %p - @fb_friends = MiniFB.get(@access_token, 'me', :type => "friends") - @fb_friends[:data].each do |friend| = image_tag( "http://graph.facebook.com/#{friend[:id]}/picture" ) - - form_tag "/services/fb_post" do - = text_area_tag "message" - = submit_tag "send it off" = link_to "Disconnect from Facebook", services_destroy_path - else - = link_to "Connect to Facebook", @fb_access_url + = link_to "Connect to Facebook (DO NOT USE WITH A REAL ACCOUNT)", @fb_access_url #content_bottom .back From e9f433e12f1879e5b55499887571a95b9c4c2c94 Mon Sep 17 00:00:00 2001 From: Raphael Date: Mon, 27 Sep 2010 16:54:08 -0700 Subject: [PATCH 338/449] Add spec for not overwriting the image_url on profile update --- spec/controllers/users_controller_spec.rb | 33 +++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 spec/controllers/users_controller_spec.rb diff --git a/spec/controllers/users_controller_spec.rb b/spec/controllers/users_controller_spec.rb new file mode 100644 index 000000000..a050738e1 --- /dev/null +++ b/spec/controllers/users_controller_spec.rb @@ -0,0 +1,33 @@ +# Copyright (c) 2010, Diaspora Inc. This file is +# licensed under the Affero General Public License version 3. See +# the COPYRIGHT file. + +require 'spec_helper' + +describe UsersController do + before do + @user = Factory.create(:user) + sign_in :user, @user + @user.aspect(:name => "lame-os") + end + + describe '#update' do + context 'with a profile photo set' do + before do + @user.person.profile.image_url = "http://tom.joindiaspora.com/images/user/tom.jpg" + @user.person.profile.save + end + + it "doesn't overwrite the profile photo when an empty string is passed in" do + image_url = @user.person.profile.image_url + put("update", :id => @user.id, "user"=> {"profile"=> + {"image_url" => "", + "last_name" => @user.person.profile.last_name, + "first_name" => @user.person.profile.first_name}}) + + @user.person.profile.image_url.should == image_url + end + + end + end +end From efe85a4c28624d1ed4374065473b072bf1df8476 Mon Sep 17 00:00:00 2001 From: Raphael Date: Mon, 27 Sep 2010 16:54:42 -0700 Subject: [PATCH 339/449] db:reset should call db:seed:dev, not db:seed:tom --- lib/tasks/db.rake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/tasks/db.rake b/lib/tasks/db.rake index e4e379a2a..396bb145d 100644 --- a/lib/tasks/db.rake +++ b/lib/tasks/db.rake @@ -42,7 +42,7 @@ namespace :db do puts "Resetting the database for #{Rails.env}".upcase Rake::Task['db:purge'].invoke - Rake::Task['db:seed:tom'].invoke + Rake::Task['db:seed:dev'].invoke puts "Success!" end From c2b84fd9c686beeb06449e45bf1972ee1b2abc77 Mon Sep 17 00:00:00 2001 From: ilya Date: Mon, 27 Sep 2010 16:59:54 -0700 Subject: [PATCH 340/449] added a public key to post --- app/controllers/aspects_controller.rb | 2 +- app/models/post.rb | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/controllers/aspects_controller.rb b/app/controllers/aspects_controller.rb index 722828a2e..33a33db71 100644 --- a/app/controllers/aspects_controller.rb +++ b/app/controllers/aspects_controller.rb @@ -52,7 +52,7 @@ class AspectsController < ApplicationController @fb_access_url = MiniFB.oauth_url(FB_APP_ID, APP_CONFIG[:pod_url] + "services/create", :scope=>MiniFB.scopes.join(",")) - @posts = current_user.visible_posts(:by_members_of => :all).paginate :page => params[:page], :per_page => 15, :order => 'created_at DESC' + @posts = current_user.raw_visible_posts.all(:public => true, :order => 'created_at DESC').paginate :page => params[:page], :per_page => 15, :order => 'created_at DESC' respond_with @aspect end diff --git a/app/models/post.rb b/app/models/post.rb index 983d0e68f..aba822160 100644 --- a/app/models/post.rb +++ b/app/models/post.rb @@ -13,6 +13,9 @@ class Post xml_accessor :_id xml_accessor :person, :as => Person + xml_reader :public + + key :public , Boolean, :default => false key :person_id, ObjectId key :user_refs, Integer, :default => 0 From 6e407572c43b006b5d8011566378fc59e1d381da Mon Sep 17 00:00:00 2001 From: ilya Date: Mon, 27 Sep 2010 17:27:49 -0700 Subject: [PATCH 341/449] removed unused repost method, going through the warden object --- app/controllers/application_controller.rb | 2 +- app/controllers/services_controller.rb | 6 +++--- app/models/user.rb | 6 ------ spec/models/user/posting_spec.rb | 9 --------- 4 files changed, 4 insertions(+), 19 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 8817bc645..52975730b 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -41,7 +41,7 @@ class ApplicationController < ActionController::Base def fb_user_info if current_user - @access_token = env['warden'].session[:access_token] + @access_token = warden.session[:access_token] @logged_in = @access_token.present? end end diff --git a/app/controllers/services_controller.rb b/app/controllers/services_controller.rb index b39538d96..82a58c508 100644 --- a/app/controllers/services_controller.rb +++ b/app/controllers/services_controller.rb @@ -17,15 +17,15 @@ class ServicesController < ApplicationController # TODO: This is where you'd want to store the token in your database # but for now, we'll just keep it in the session so we don't need a database - env['warden'].session[:access_token] = @access_token + warden.session[:access_token] = @access_token flash[:success] = "Authentication successful." end redirect_to edit_user_url current_user end def destroy - env['warden'].session[:access_token] = nil - env['warden'].session[:user_id] = nil + warden.session[:access_token] = nil + warden.session[:user_id] = nil redirect_to edit_user_url current_user end diff --git a/app/models/user.rb b/app/models/user.rb index d89b8b59a..ca248a8f2 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -114,12 +114,6 @@ class User post end - def repost( post, options = {} ) - aspect_ids = validate_aspect_permissions(options[:to]) - push_to_aspects(post, aspect_ids) - post - end - def update_post( post, post_hash = {} ) if self.owns? post post.update_attributes(post_hash) diff --git a/spec/models/user/posting_spec.rb b/spec/models/user/posting_spec.rb index 76f4243f7..d86433ad6 100644 --- a/spec/models/user/posting_spec.rb +++ b/spec/models/user/posting_spec.rb @@ -46,15 +46,6 @@ describe User do end end - describe '#repost' do - it 'should make the post visible in another aspect' do - status_message = user.post(:status_message, :message => "hello", :to => aspect.id) - user.repost(status_message, :to => aspect1.id) - aspect1.reload - aspect1.posts.count.should be 1 - end - end - describe '#update_post' do it 'should update fields' do album = user.post(:album, :name => "Profile Photos", :to => aspect.id) From fad27483cdecab227d0016eaef0b595e275782df Mon Sep 17 00:00:00 2001 From: Raphael Date: Mon, 27 Sep 2010 17:54:20 -0700 Subject: [PATCH 342/449] Pulling in drt24's changes to ubuntu-setup.bash --- ubuntu-setup.bash | 181 +++++++++++++++++++++++++++++----------------- 1 file changed, 115 insertions(+), 66 deletions(-) diff --git a/ubuntu-setup.bash b/ubuntu-setup.bash index 95d2a9628..c335fcf65 100755 --- a/ubuntu-setup.bash +++ b/ubuntu-setup.bash @@ -8,48 +8,81 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. -# Set extented globbing +# USAGE: ./script/ubuntu-setup.bash +# Do NOT run this script as root. + +# Set extented globbing shopt -s extglob +# fail on error +set -e + +[ "$(whoami)" == "root" ] && echo "Please do not run this script as root/sudo +We need to do some actions as an ordinary user. We use sudo where necessary." && exit 1 + # Check if the user has sudo privileges. sudo -v >/dev/null 2>&1 || { echo $(whoami) has no sudo privileges ; exit 1; } -# Check if universal repository is enabled -grep -i universe /etc/apt/sources.list > /dev/null || { echo "Please enable universe repository" ; exit 1 ; } +# Check if universal repository is enabled +grep -i universe /etc/apt/sources.list > /dev/null || \ + { echo "Please enable universe repository" ; exit 1 ; } -# Check if wget is installed -test wget || echo "Installing wget.." && sudo apt-get install wget && echo "Installed wget.." +# Make sure that we only install the latest version of packages +sudo apt-get update -# Install build tools +# Check if wget is installed +test wget || { echo "Installing wget.." && sudo apt-get install wget \ + && echo "Installed wget.." ; } + +# Install build tools echo "Installing build tools.." -sudo apt-get -y --no-install-recommends install build-essential libxslt1.1 libxslt1-dev libxml2 +sudo apt-get -y --no-install-recommends install \ + build-essential libxslt1.1 libxslt1-dev libxml2 echo "..Done installing build tools" -# Install Ruby 1.8.7 -echo "Installing ruby-full Ruby 1.8.7.." +# Install Ruby 1.8.7 +echo "Installing ruby-full Ruby 1.8.7.." sudo apt-get -y --no-install-recommends install ruby-full echo "..Done installing Ruby" -# Install Rake +# Install Rake echo "Installing rake.." sudo apt-get -y --no-install-recommends install rake echo "..Done installing rake" +#Store the release name so we can use it here and later +RELEASE=$(lsb_release -c | cut -f2) + # Get the current release and install mongodb -lsb=$(lsb_release -rs) -ver=${lsb//.+(0)/.} -repo="deb http://downloads.mongodb.org/distros/ubuntu ${ver} 10gen" -echo "Setting up MongoDB.." -echo "." -echo ${repo} | sudo tee -a /etc/apt/sources.list -echo "." -echo "Fetching keys.." -sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10 -echo "." -sudo apt-get update -echo "." -sudo apt-get -y --no-install-recommends install mongodb-stable -echo "Done installing monngodb-stable.." +if [ $RELEASE == "maverick" ] +then + #mongodb does not supply a repository for maverick yet so install + # an older version from the ubuntu repositories + if [ ! -f /usr/lib/libmozjs.so ] + then + echo "Lanchpad bug https://bugs.launchpad.net/ubuntu/+source/mongodb/+bug/557024 +has not been fixed using workaround:" + echo "sudo ln -s /usr/lib/xulrunner-1.9.2.10/libmozjs.so /usr/lib/libmozjs.so" + sudo ln -s /usr/lib/xulrunner-1.9.2.10/libmozjs.so /usr/lib/libmozjs.so + fi + + sudo apt-get -y --no-install-recommends install mongodb +else + lsb=$(lsb_release -rs) + ver=${lsb//.+(0)/.} + repo="deb http://downloads.mongodb.org/distros/ubuntu ${ver} 10gen" + echo "Setting up MongoDB.." + echo "." + echo ${repo} | sudo tee -a /etc/apt/sources.list + echo "." + echo "Fetching keys.." + sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10 + echo "." + sudo apt-get update + echo "." + sudo apt-get -y --no-install-recommends install mongodb-stable + echo "Done installing monngodb-stable.." +fi # Install imagemagick echo "Installing imagemagick.." @@ -64,33 +97,32 @@ echo "Installed git-core.." # Setting up ruby gems echo "Fetching and installing ruby gems.." ( - RELEASE=$(lsb_release -c | cut -f2) - if [ RELEASE == "maverick" ] - then - sudo apt-get install --no-install-recommends -y rubygems - sudo ln -s /var/lib/gems/1.8/bin/bundle /usr/local/bin/bundle #for PATH - elif [ RELEASE == "lucid" ] - then - sudo add-apt-repository ppa:maco.m/ruby - sudo apt-get update - sudo apt-get install --no-install-recommends -y rubygems - sudo ln -s /var/lib/gems/1.8/bin/bundle /usr/local/bin/bundle #for PATH - else - # Old version - echo "." - cd /tmp - wget http://production.cf.rubygems.org/rubygems/rubygems-1.3.7.tgz - echo "." - tar -xf rubygems-1.3.7.tgz - echo "." - cd rubygems-1.3.7 - echo "." - sudo ruby setup.rb - echo "." - sudo ln -s /usr/bin/gem1.8 /usr/bin/gem - echo "." - fi -) + if [ $RELEASE == "maverick" ] + then + sudo apt-get install --no-install-recommends -y rubygems + sudo ln -s /var/lib/gems/1.8/bin/bundle /usr/local/bin/bundle #for PATH + elif [ $RELEASE == "lucid" ] + then + sudo add-apt-repository ppa:maco.m/ruby + sudo apt-get update + sudo apt-get install --no-install-recommends -y rubygems + sudo ln -s /var/lib/gems/1.8/bin/bundle /usr/local/bin/bundle #for PATH + else + # Old version + echo "." + cd /tmp + wget http://production.cf.rubygems.org/rubygems/rubygems-1.3.7.tgz + echo "." + tar -xf rubygems-1.3.7.tgz + echo "." + cd rubygems-1.3.7 + echo "." + sudo ruby setup.rb + echo "." + sudo ln -s /usr/bin/gem1.8 /usr/bin/gem + echo "." + fi +) echo "Done installing the gems.." # Install bundler @@ -100,23 +132,40 @@ echo "Installed bundler.." # Take a clone of Diaspora ( + # Check if the user is already in a cloned source if not clone the source + [[ $( basename $PWD ) == "diaspora" ]] && \ + echo "Already in diaspora directory" || \ + { git clone http://github.com/diaspora/diaspora.git && cd diaspora + echo "Cloned the source.." + } -# Check if the user is already in a cloned source if not clone the source -[[ $( basename $PWD ) == "diaspora" ]] && echo "Already in diaspora directory" || git clone http://github.com/diaspora/diaspora.git ; cd diaspora -echo "Cloned the source.." + # Install extra gems + echo "Installing more gems.." + bundle install + echo "Installed." -# Install extra gems -cd diaspora -echo "Installing more gems.." -sudo bundle install -echo "Installed." + #Configure diaspora + cp config/app_config.yml.example config/app_config.yml + echo "You need to configure diaspora to tell it which URL it has. +Opening editor in 5 seconds and then continuing with install." + sleep 5 + #ensure EDITOR is set + if [ -z "${EDITOR}"] + then + EDITOR=vi + fi + $EDITOR config/app_config.yml -# Install DB setup -echo "Seting up DB.." -rake db:seed:tom -echo "DB ready. Login -> tom and password -> evankorth. More details ./diaspora/db/seeds/tom.rb." + # Create the shared directory which is used by rake db:seed:tom + mkdir shared -# Run appserver -echo "Starting server" -bundle exec thin start + # Install DB setup + echo "Seting up DB.." + rake db:seed:tom + echo "DB ready. Login -> tom and password -> evankorth. +More details ./diaspora/db/seeds/tom.rb." + + # Run appserver + echo "Starting server" + bundle exec thin start ) From 77356d7a17213ad7290a4484e29ae20ee2c0af2b Mon Sep 17 00:00:00 2001 From: Raphael Date: Mon, 27 Sep 2010 17:55:04 -0700 Subject: [PATCH 343/449] Moving ubuntu-setup.bash to script/ --- ubuntu-setup.bash => script/ubuntu-setup.bash | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename ubuntu-setup.bash => script/ubuntu-setup.bash (100%) diff --git a/ubuntu-setup.bash b/script/ubuntu-setup.bash similarity index 100% rename from ubuntu-setup.bash rename to script/ubuntu-setup.bash From df800dc87ee0ae1dfc3bafc2bfac9e107ede822c Mon Sep 17 00:00:00 2001 From: danielvincent Date: Mon, 27 Sep 2010 17:58:34 -0700 Subject: [PATCH 344/449] ostatus builder --- app/models/person.rb | 4 ++ lib/diaspora/ostatus_builder.rb | 71 +++++++++++++++++++++++ spec/lib/diaspora_ostatus_builder_spec.rb | 18 ++++++ 3 files changed, 93 insertions(+) create mode 100644 lib/diaspora/ostatus_builder.rb create mode 100644 spec/lib/diaspora_ostatus_builder_spec.rb diff --git a/app/models/person.rb b/app/models/person.rb index 2601de2bc..0cbde015a 100644 --- a/app/models/person.rb +++ b/app/models/person.rb @@ -49,6 +49,10 @@ class Person "#{self.url}receive/users/#{self.id}/" end + def public_url + "#{self.url}users/#{self.id}/public" + end + def public_key_hash Base64.encode64 OpenSSL::Digest::SHA256.new(self.exported_key).to_s diff --git a/lib/diaspora/ostatus_builder.rb b/lib/diaspora/ostatus_builder.rb new file mode 100644 index 000000000..f243a6d73 --- /dev/null +++ b/lib/diaspora/ostatus_builder.rb @@ -0,0 +1,71 @@ +# Copyright (c) 2010, Diaspora Inc. This file is +# licensed under the Affero General Public License version 3. See +# the COPYRIGHT file. + +module Diaspora + module OstatusBuilder + + def build(user) + if @user = User.find_by_id(user.id) + xml = "" + xml << create_headers + xml << create_endpoints + xml << create_subject + xml << create_body + xml << create_footer + else raise "Invalid user sent to builder" end + end + + def create_headers + <<-XML + + + Diaspora + #{@user.username}/public + Stream + its a stream + #{Time.now.xmlschema} + + #{@user.real_name} + #{@user.public_url} + + XML + end + + def create_endpoints + <<-XML + + XML + end + + def create_subject + <<-XML + + http://activitystrea.ms/schema/1.0/person + #{@user.public_url} + #{@user.real_name} + + + XML + end + + def create_body + @user.raw_visible_posts.all.inject do |xml,curr| + if curr.respond_to?(:to_activity) + unless xml + xml = curr.to_activity + else + xml + curr.to_activity + end + end + end + end + + def create_footer + <<-XML + + XML + end + + end +end diff --git a/spec/lib/diaspora_ostatus_builder_spec.rb b/spec/lib/diaspora_ostatus_builder_spec.rb new file mode 100644 index 000000000..ce29e1543 --- /dev/null +++ b/spec/lib/diaspora_ostatus_builder_spec.rb @@ -0,0 +1,18 @@ +# Copyright (c) 2010, Diaspora Inc. This file is +# licensed under the Affero General Public License version 3. See +# the COPYRIGHT file. + +require 'spec_helper' +require File.dirname(__FILE__) + '/../../lib/diaspora/ostatus_builder' + +describe Diaspora::OstatusBuilder do + + let(:user) { Factory(:user) } + let(:aspect) { user.aspect(:name => "Public People") } + let!(:status_message1) { user.post(:status_message, :message => "One", :to => aspect.id) } + let!(:status_message2) { user.post(:status_message, :message => "Two", :to => aspect.id) } + + let!(:atom) { Diaspora::OstatusBuilder::build(user) } + +end + From 6100b318e47276f5abc58c48b5dd2fc1f504d651 Mon Sep 17 00:00:00 2001 From: Raphael Date: Mon, 27 Sep 2010 18:12:55 -0700 Subject: [PATCH 345/449] More accurately describe a spec --- spec/lib/message_handler_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/lib/message_handler_spec.rb b/spec/lib/message_handler_spec.rb index adb375c17..cb0592e9a 100644 --- a/spec/lib/message_handler_spec.rb +++ b/spec/lib/message_handler_spec.rb @@ -39,7 +39,7 @@ describe MessageHandler do } end - it 'should only retry a bad request three times ' do + it 'should only retry a bad request the correct number of times' do request = FakeHttpRequest.new(:failure) request.should_receive(:get).exactly(MessageHandler::NUM_TRIES).times.and_return(request) EventMachine::HttpRequest.stub!(:new).and_return(request) From 7852c346f2823e64ec1eaee21ca83d80ca039ffc Mon Sep 17 00:00:00 2001 From: ilya Date: Mon, 27 Sep 2010 18:31:37 -0700 Subject: [PATCH 346/449] mode the visible posts api more general and moved to it on the public controller --- app/controllers/aspects_controller.rb | 2 +- app/controllers/people_controller.rb | 2 +- lib/diaspora/user/querying.rb | 5 +++-- spec/models/user/visible_posts_spec.rb | 27 +++++++++++++++++++++++++- 4 files changed, 31 insertions(+), 5 deletions(-) diff --git a/app/controllers/aspects_controller.rb b/app/controllers/aspects_controller.rb index 33a33db71..cf9cc1583 100644 --- a/app/controllers/aspects_controller.rb +++ b/app/controllers/aspects_controller.rb @@ -52,7 +52,7 @@ class AspectsController < ApplicationController @fb_access_url = MiniFB.oauth_url(FB_APP_ID, APP_CONFIG[:pod_url] + "services/create", :scope=>MiniFB.scopes.join(",")) - @posts = current_user.raw_visible_posts.all(:public => true, :order => 'created_at DESC').paginate :page => params[:page], :per_page => 15, :order => 'created_at DESC' + @posts = current_user.visible_posts(:public => true).paginate :page => params[:page], :per_page => 15, :order => 'created_at DESC' respond_with @aspect end diff --git a/app/controllers/people_controller.rb b/app/controllers/people_controller.rb index a8b8fffc0..be1f89991 100644 --- a/app/controllers/people_controller.rb +++ b/app/controllers/people_controller.rb @@ -21,7 +21,7 @@ class PeopleController < ApplicationController @profile = @person.profile @aspects_with_person = current_user.aspects_with_person(@person) @aspects_dropdown_array = current_user.aspects.collect{|x| [x.to_s, x.id]} - @posts = current_user.visible_posts(:from => @person).paginate :page => params[:page], :order => 'created_at DESC' + @posts = current_user.visible_posts(:person_id => @person.id).paginate :page => params[:page], :order => 'created_at DESC' @latest_status_message = current_user.raw_visible_posts.find_all_by__type_and_person_id("StatusMessage", params[:id]).last @post_count = @posts.count respond_with @person diff --git a/lib/diaspora/user/querying.rb b/lib/diaspora/user/querying.rb index 29f119238..7d74df4ed 100644 --- a/lib/diaspora/user/querying.rb +++ b/lib/diaspora/user/querying.rb @@ -11,12 +11,13 @@ module Diaspora end def visible_posts( opts = {} ) + opts[:order] ||= 'created_at DESC' if opts[:by_members_of] return raw_visible_posts if opts[:by_members_of] == :all aspect = self.aspects.find_by_id( opts[:by_members_of].id ) aspect.posts - elsif opts[:from] - self.raw_visible_posts.find_all_by_person_id(opts[:from].id, :order => 'created_at DESC') + else + self.raw_visible_posts.all(opts) end end diff --git a/spec/models/user/visible_posts_spec.rb b/spec/models/user/visible_posts_spec.rb index e0a3d5215..040fcd1bc 100644 --- a/spec/models/user/visible_posts_spec.rb +++ b/spec/models/user/visible_posts_spec.rb @@ -12,13 +12,38 @@ describe User do let!(:user2) { Factory(:user_with_aspect) } let!(:status_message1) { user2.post :status_message, :message => "hi", :to => user2.aspects.first.id } + let!(:status_message2) { user2.post :status_message, :message => "hey", :public => true , :to => user2.aspects.first.id } + let!(:status_message3) { user2.post :status_message, :message => "va", :to => user2.aspects.first.id } + let!(:status_message4) { user2.post :status_message, :message => "da", :public => true , :to => user2.aspects.first.id } + before do friend_users(user, first_aspect, user2, user2.aspects.first) end describe "#visible_posts" do - it "generates a stream for each aspect that includes only that aspect's posts" do + it "queries by person id" do + user2.visible_posts(:person_id => user2.person.id).include?(status_message1).should == true + user2.visible_posts(:person_id => user2.person.id).include?(status_message2).should == true + user2.visible_posts(:person_id => user2.person.id).include?(status_message3).should == true + user2.visible_posts(:person_id => user2.person.id).include?(status_message4).should == true + end + + it "selects public posts" do + user2.visible_posts(:public => true).include?(status_message2).should == true + user2.visible_posts(:public => true).include?(status_message4).should == true + end + + it "selects non public posts" do + user2.visible_posts(:public => false).include?(status_message1).should == true + user2.visible_posts(:public => false).include?(status_message3).should == true + end + + it "selects by message contents" do + user2.visible_posts(:message => "hi").include?(status_message1).should == true + end + + it "queries by aspect" do user3 = Factory(:user_with_aspect) status_message2 = user3.post :status_message, :message => "heyyyy", :to => user3.aspects.first.id user4 = Factory(:user_with_aspect) From 3b8ddf76a36341ec4979421f6a850a1b8eff31fa Mon Sep 17 00:00:00 2001 From: danielvincent Date: Mon, 27 Sep 2010 18:34:47 -0700 Subject: [PATCH 347/449] temp route for atom feed. also, public atom currently displays all posts. --- app/controllers/publics_controller.rb | 7 +++++++ config/routes.rb | 2 ++ lib/diaspora/ostatus_builder.rb | 14 +++++++------- spec/lib/diaspora_ostatus_builder_spec.rb | 4 ++++ 4 files changed, 20 insertions(+), 7 deletions(-) diff --git a/app/controllers/publics_controller.rb b/app/controllers/publics_controller.rb index fcfdb0db6..76360fb90 100644 --- a/app/controllers/publics_controller.rb +++ b/app/controllers/publics_controller.rb @@ -4,7 +4,9 @@ class PublicsController < ApplicationController require File.expand_path('../../../lib/diaspora/parser', __FILE__) + require File.expand_path('../../../lib/diaspora/ostatus_builder', __FILE__) include Diaspora::Parser + include Diaspora::OstatusBuilder layout false def hcard @@ -40,4 +42,9 @@ class PublicsController < ApplicationController @user.receive_salmon params[:xml] end + def public + user = User.find_by_username(params[:username]) + render :xml => Diaspora::OstatusBuilder::build(user) + end + end diff --git a/config/routes.rb b/config/routes.rb index c2a38dbc6..4d227a0a1 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -32,6 +32,8 @@ Diaspora::Application.routes.draw do match 'get_to_the_choppa', :to => redirect("/signup") #public routes # + match 'public/:username', :to => 'publics#public' + match 'webfinger', :to => 'publics#webfinger' match 'hcard/users/:id', :to => 'publics#hcard' diff --git a/lib/diaspora/ostatus_builder.rb b/lib/diaspora/ostatus_builder.rb index f243a6d73..0770f4c5c 100644 --- a/lib/diaspora/ostatus_builder.rb +++ b/lib/diaspora/ostatus_builder.rb @@ -5,7 +5,7 @@ module Diaspora module OstatusBuilder - def build(user) + def self.build(user) if @user = User.find_by_id(user.id) xml = "" xml << create_headers @@ -16,8 +16,8 @@ module Diaspora else raise "Invalid user sent to builder" end end - def create_headers - <<-XML + def self.create_headers + <<-XML.strip Diaspora @@ -32,13 +32,13 @@ module Diaspora XML end - def create_endpoints + def self.create_endpoints <<-XML XML end - def create_subject + def self.create_subject <<-XML http://activitystrea.ms/schema/1.0/person @@ -49,7 +49,7 @@ module Diaspora XML end - def create_body + def self.create_body @user.raw_visible_posts.all.inject do |xml,curr| if curr.respond_to?(:to_activity) unless xml @@ -61,7 +61,7 @@ module Diaspora end end - def create_footer + def self.create_footer <<-XML XML diff --git a/spec/lib/diaspora_ostatus_builder_spec.rb b/spec/lib/diaspora_ostatus_builder_spec.rb index ce29e1543..cc46bd0c5 100644 --- a/spec/lib/diaspora_ostatus_builder_spec.rb +++ b/spec/lib/diaspora_ostatus_builder_spec.rb @@ -14,5 +14,9 @@ describe Diaspora::OstatusBuilder do let!(:atom) { Diaspora::OstatusBuilder::build(user) } + it 'should include a users posts' do + atom.should include status_message.message + end + end From 58b688aa6872df557f6d645bd1286a4ac455ed15 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Mon, 27 Sep 2010 21:28:21 -0700 Subject: [PATCH 348/449] fixed builder spec --- lib/diaspora/ostatus_builder.rb | 4 ++-- spec/lib/diaspora_ostatus_builder_spec.rb | 9 ++++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/lib/diaspora/ostatus_builder.rb b/lib/diaspora/ostatus_builder.rb index 0770f4c5c..ce4ebfeb4 100644 --- a/lib/diaspora/ostatus_builder.rb +++ b/lib/diaspora/ostatus_builder.rb @@ -50,10 +50,10 @@ module Diaspora end def self.create_body - @user.raw_visible_posts.all.inject do |xml,curr| + @user.visible_posts(:public=>true).inject("") do |xml,curr| if curr.respond_to?(:to_activity) unless xml - xml = curr.to_activity + curr.to_activity else xml + curr.to_activity end diff --git a/spec/lib/diaspora_ostatus_builder_spec.rb b/spec/lib/diaspora_ostatus_builder_spec.rb index cc46bd0c5..0670755f7 100644 --- a/spec/lib/diaspora_ostatus_builder_spec.rb +++ b/spec/lib/diaspora_ostatus_builder_spec.rb @@ -9,13 +9,16 @@ describe Diaspora::OstatusBuilder do let(:user) { Factory(:user) } let(:aspect) { user.aspect(:name => "Public People") } - let!(:status_message1) { user.post(:status_message, :message => "One", :to => aspect.id) } - let!(:status_message2) { user.post(:status_message, :message => "Two", :to => aspect.id) } + let!(:status_message1) { user.post(:status_message, :message => "One", :public => true, :to => aspect.id) } + let!(:status_message2) { user.post(:status_message, :message => "Two", :public => true, :to => aspect.id) } + let!(:status_message3) { user.post(:status_message, :message => "Three", :public => false, :to => aspect.id) } let!(:atom) { Diaspora::OstatusBuilder::build(user) } it 'should include a users posts' do - atom.should include status_message.message + atom.should include status_message1.message + atom.should include status_message2.message + atom.should_not include status_message3.message end end From eac6b8a63b6550d634f158198f88a8d291613852 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Mon, 27 Sep 2010 21:54:01 -0700 Subject: [PATCH 349/449] builder is now a class initialized with a user. added director class. --- app/controllers/publics_controller.rb | 8 +++- lib/diaspora/ostatus_builder.rb | 39 +++++++++++-------- ...uilder_spec.rb => ostatus_builder_spec.rb} | 4 +- 3 files changed, 31 insertions(+), 20 deletions(-) rename spec/lib/{diaspora_ostatus_builder_spec.rb => ostatus_builder_spec.rb} (86%) diff --git a/app/controllers/publics_controller.rb b/app/controllers/publics_controller.rb index 76360fb90..c4ea0d29a 100644 --- a/app/controllers/publics_controller.rb +++ b/app/controllers/publics_controller.rb @@ -6,7 +6,7 @@ class PublicsController < ApplicationController require File.expand_path('../../../lib/diaspora/parser', __FILE__) require File.expand_path('../../../lib/diaspora/ostatus_builder', __FILE__) include Diaspora::Parser - include Diaspora::OstatusBuilder + layout false def hcard @@ -44,7 +44,11 @@ class PublicsController < ApplicationController def public user = User.find_by_username(params[:username]) - render :xml => Diaspora::OstatusBuilder::build(user) + + director = Diaspora::Director.new + ostatus_builder = Diaspora::OstatusBuilder.new(user) + + render :xml => director.build(ostatus_builder) end end diff --git a/lib/diaspora/ostatus_builder.rb b/lib/diaspora/ostatus_builder.rb index ce4ebfeb4..d3640771c 100644 --- a/lib/diaspora/ostatus_builder.rb +++ b/lib/diaspora/ostatus_builder.rb @@ -3,20 +3,27 @@ # the COPYRIGHT file. module Diaspora - module OstatusBuilder - def self.build(user) - if @user = User.find_by_id(user.id) - xml = "" - xml << create_headers - xml << create_endpoints - xml << create_subject - xml << create_body - xml << create_footer - else raise "Invalid user sent to builder" end + class Director + def initialize + @structure = [:create_headers, :create_endpoints, :create_subject, + :create_body, :create_footer] end - def self.create_headers + def build(builder) + @structure.inject("") do |xml, method| + xml << builder.send(method) + end + end + end + + + class OstatusBuilder + def initialize(user) + @user = user + end + + def create_headers <<-XML.strip @@ -32,13 +39,13 @@ module Diaspora XML end - def self.create_endpoints + def create_endpoints <<-XML XML end - def self.create_subject + def create_subject <<-XML http://activitystrea.ms/schema/1.0/person @@ -49,7 +56,7 @@ module Diaspora XML end - def self.create_body + def create_body @user.visible_posts(:public=>true).inject("") do |xml,curr| if curr.respond_to?(:to_activity) unless xml @@ -61,11 +68,11 @@ module Diaspora end end - def self.create_footer + def create_footer <<-XML XML end - end + end diff --git a/spec/lib/diaspora_ostatus_builder_spec.rb b/spec/lib/ostatus_builder_spec.rb similarity index 86% rename from spec/lib/diaspora_ostatus_builder_spec.rb rename to spec/lib/ostatus_builder_spec.rb index 0670755f7..042bf202b 100644 --- a/spec/lib/diaspora_ostatus_builder_spec.rb +++ b/spec/lib/ostatus_builder_spec.rb @@ -7,13 +7,13 @@ require File.dirname(__FILE__) + '/../../lib/diaspora/ostatus_builder' describe Diaspora::OstatusBuilder do - let(:user) { Factory(:user) } + let!(:user) { Factory(:user) } let(:aspect) { user.aspect(:name => "Public People") } let!(:status_message1) { user.post(:status_message, :message => "One", :public => true, :to => aspect.id) } let!(:status_message2) { user.post(:status_message, :message => "Two", :public => true, :to => aspect.id) } let!(:status_message3) { user.post(:status_message, :message => "Three", :public => false, :to => aspect.id) } - let!(:atom) { Diaspora::OstatusBuilder::build(user) } + let!(:atom) { director = Diaspora::Director.new; director.build(Diaspora::OstatusBuilder.new(user)) } it 'should include a users posts' do atom.should include status_message1.message From 44c29cf8e6794d5a3f6fff400f15376bae4adec6 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Mon, 27 Sep 2010 21:57:52 -0700 Subject: [PATCH 350/449] deploy_config back to master --- config/deploy_config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/deploy_config.yml b/config/deploy_config.yml index b6cba3056..6aacbf3ff 100644 --- a/config/deploy_config.yml +++ b/config/deploy_config.yml @@ -6,7 +6,7 @@ cross_server: deploy_to: '/usr/local/app/diaspora' user: 'root' repo: 'git://github.com/diaspora/diaspora.git' - branch: 'fb' + branch: 'master' default_env: 'development' servers: tom: From d8c49e88521b5a9cd15a960c7f89584980d4c7db Mon Sep 17 00:00:00 2001 From: ilya Date: Mon, 27 Sep 2010 22:06:47 -0700 Subject: [PATCH 351/449] moved stuff around in the readme --- README.md | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index c8f193afe..f21676bdd 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,18 @@ +# Diaspora + +The privacy aware, personally controlled, do-it-all, open source social +network. + +**DISCLAIMER: THIS IS PRE-ALPHA SOFTWARE AND SHOULD BE TREATED ACCORDINGLY.** +**PLEASE, DO NOT RUN IN PRODUCTION. IT IS FUN TO GET RUNNING, BUT EXPECT THINGS +TO BE BROKEN** + +Initial installation instructions are [here](http://github.com/diaspora/diaspora/wiki/Installing-and-Running-Diaspora). + +We are continuing to build features and improve the code base. +When we think it is ready for general use, we will post more final +instructions. + ## Commit Guidlines You are welcome to contribute, add to and extend Diaspora however you see fit. We @@ -17,21 +32,6 @@ Nokogiri, Mongomapper, and EM::HttpRequest as much as possible. We have a few gems in the project we'd rather not use, but if you can, use dependencies we already have. -# Diaspora - -The privacy aware, personally controlled, do-it-all, open source social -network. - -**DISCLAIMER: THIS IS PRE-ALPHA SOFTWARE AND SHOULD BE TREATED ACCORDINGLY.** -**PLEASE, DO NOT RUN IN PRODUCTION. IT IS FUN TO GET RUNNING, BUT EXPECT THINGS -TO BE BROKEN** - -Some initial installation instructions are [here](http://github.com/diaspora/diaspora/wiki/Installing-and-Running-Diaspora). - -We are continuing to build features and improve the code base. -When we think it is ready for general use, we will post more final -instructions. - ## Resources We are maintaining a From 762646dbe80a89cfb30dd5c033e847379acdb335 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Mon, 27 Sep 2010 22:11:14 -0700 Subject: [PATCH 352/449] make the director more forgiving --- lib/diaspora/ostatus_builder.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/diaspora/ostatus_builder.rb b/lib/diaspora/ostatus_builder.rb index d3640771c..997e538f3 100644 --- a/lib/diaspora/ostatus_builder.rb +++ b/lib/diaspora/ostatus_builder.rb @@ -12,7 +12,7 @@ module Diaspora def build(builder) @structure.inject("") do |xml, method| - xml << builder.send(method) + xml << builder.send(method) if builder.respond_to? method end end end From 15a4609c1428c1701e3ece297a9288c99cb5e292 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Mon, 27 Sep 2010 22:30:16 -0700 Subject: [PATCH 353/449] moved user's public route to user controller. changed person.public_url to reflect change. --- app/controllers/publics_controller.rb | 10 ---------- app/controllers/users_controller.rb | 12 +++++++++++- app/models/person.rb | 2 +- config/routes.rb | 6 ++++-- 4 files changed, 16 insertions(+), 14 deletions(-) diff --git a/app/controllers/publics_controller.rb b/app/controllers/publics_controller.rb index c4ea0d29a..e3c90fc16 100644 --- a/app/controllers/publics_controller.rb +++ b/app/controllers/publics_controller.rb @@ -4,7 +4,6 @@ class PublicsController < ApplicationController require File.expand_path('../../../lib/diaspora/parser', __FILE__) - require File.expand_path('../../../lib/diaspora/ostatus_builder', __FILE__) include Diaspora::Parser layout false @@ -42,13 +41,4 @@ class PublicsController < ApplicationController @user.receive_salmon params[:xml] end - def public - user = User.find_by_username(params[:username]) - - director = Diaspora::Director.new - ostatus_builder = Diaspora::OstatusBuilder.new(user) - - render :xml => director.build(ostatus_builder) - end - end diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index ac284a219..0d5c4d449 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -3,7 +3,9 @@ # the COPYRIGHT file. class UsersController < ApplicationController - before_filter :authenticate_user!, :except => [:new, :create] + require File.expand_path('../../../lib/diaspora/ostatus_builder', __FILE__) + + before_filter :authenticate_user!, :except => [:new, :create, :public] respond_to :html @@ -27,6 +29,14 @@ class UsersController < ApplicationController respond_with(@user, :location => root_url) end + def public + user = User.find_by_username(params[:username]) + director = Diaspora::Director.new + ostatus_builder = Diaspora::OstatusBuilder.new(user) + + render :xml => director.build(ostatus_builder) + end + private def prep_image_url(params) url = APP_CONFIG[:pod_url].chop if APP_CONFIG[:pod_url][-1,1] == '/' diff --git a/app/models/person.rb b/app/models/person.rb index 0cbde015a..28503e921 100644 --- a/app/models/person.rb +++ b/app/models/person.rb @@ -50,7 +50,7 @@ class Person end def public_url - "#{self.url}users/#{self.id}/public" + "#{self.url}users/#{self.owner.username}/public" end diff --git a/config/routes.rb b/config/routes.rb index 0a8aa2630..56ec559c9 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -4,12 +4,15 @@ Diaspora::Application.routes.draw do resources :people, :only => [:index, :show, :destroy] - resources :users, :except => [:create, :new, :show] resources :status_messages, :only => [:create, :destroy, :show] resources :comments, :except => [:index] resources :requests, :except => [:edit, :update] resources :photos, :except => [:index] resources :albums + + # added public route to user + match 'users/:username/public', :to => 'users#public' + resources :users, :except => [:create, :new, :show] match 'aspects/move_friends', :to => 'aspects#move_friends', :as => 'move_friends' match 'aspects/move_friend', :to => 'aspects#move_friend', :as => 'move_friend' @@ -36,7 +39,6 @@ Diaspora::Application.routes.draw do match 'get_to_the_choppa', :to => redirect("/signup") #public routes # - match 'public/:username', :to => 'publics#public' match 'webfinger', :to => 'publics#webfinger' match 'hcard/users/:id', :to => 'publics#hcard' From bf587be4618c412884a2b6522fd328cb632df083 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Mon, 27 Sep 2010 22:50:11 -0700 Subject: [PATCH 354/449] public indicator tag on status message partial. --- .../status_messages/_status_message.html.haml | 5 ++++ public/stylesheets/application.css | 15 ++++++++++++ public/stylesheets/sass/application.sass | 23 +++++++++++++++++++ 3 files changed, 43 insertions(+) diff --git a/app/views/status_messages/_status_message.html.haml b/app/views/status_messages/_status_message.html.haml index 55c5123b7..f4ac1cadf 100644 --- a/app/views/status_messages/_status_message.html.haml +++ b/app/views/status_messages/_status_message.html.haml @@ -22,3 +22,8 @@ .destroy_link = link_to t('.delete'), status_message_path(post), :confirm => t('.are_you_sure'), :method => :delete, :remote => true, :class => "delete" = render "shared/reshare", :post => post, :current_user => current_user + + - if post.public? + .aspect_tag + public + diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index 53da697cc..23ef5ff7a 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -675,3 +675,18 @@ ul#settings_nav { #fancybox-close:hover { background-color: transparent; } + +.aspect_tag { + position: absolute; + top: 15px; + right: 2em; + background-color: #fffc7f; + border-radius: 5px; + -webkit-border-radius: 5px; + -moz-border-radius: 5px; + font-size: smaller; + padding: 0 6px; + color: #999999; + text-shadow: 0 1px white; + border-bottom: 1px solid #eeeeee; + cursor: default; } diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass index 2a3136393..133fe9dcb 100644 --- a/public/stylesheets/sass/application.sass +++ b/public/stylesheets/sass/application.sass @@ -866,3 +866,26 @@ ul#settings_nav :background :color transparent +.aspect_tag + :position absolute + :top 15px + :right 2em + :background + :color #FFFC7F + + :border-radius 5px + :-webkit-border-radius 5px + :-moz-border-radius 5px + + :font + :size smaller + :padding 0 6px + + :color #999 + :text + :shadow 0 1px #fff + + :border + :bottom 1px solid #eee + + :cursor default From cb7c35af73416f4deaa17f73ee1b510135236f93 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Mon, 27 Sep 2010 23:15:48 -0700 Subject: [PATCH 355/449] fixed thumbnail positioning --- app/views/shared/_aspect_friends.haml | 28 ++++++++++++++++++++++++ public/stylesheets/application.css | 8 +++++++ public/stylesheets/sass/application.sass | 8 +++++++ 3 files changed, 44 insertions(+) diff --git a/app/views/shared/_aspect_friends.haml b/app/views/shared/_aspect_friends.haml index f8e635f8d..6d1a0e2f4 100644 --- a/app/views/shared/_aspect_friends.haml +++ b/app/views/shared/_aspect_friends.haml @@ -3,6 +3,34 @@ -# the COPYRIGHT file. #friend_pictures + = owner_image_link + = owner_image_link + = owner_image_link + = owner_image_link + = owner_image_link + = owner_image_link + = owner_image_link + = owner_image_link + = owner_image_link + = owner_image_link + = owner_image_link + = owner_image_link + = owner_image_link + = owner_image_link + = owner_image_link + = owner_image_link + = owner_image_link + = owner_image_link + = owner_image_link + = owner_image_link + = owner_image_link + = owner_image_link + = owner_image_link + = owner_image_link + = owner_image_link + = owner_image_link + = owner_image_link + = owner_image_link = owner_image_link - for friend in @friends = person_image_link(friend) diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index 23ef5ff7a..e886e3480 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -690,3 +690,11 @@ ul#settings_nav { text-shadow: 0 1px white; border-bottom: 1px solid #eeeeee; cursor: default; } + +#friend_pictures { + line-height: 1em; } + #friend_pictures img { + margin-right: -1px; } + +#thumbnails { + line-height: 14px; } diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass index 133fe9dcb..ab4674760 100644 --- a/public/stylesheets/sass/application.sass +++ b/public/stylesheets/sass/application.sass @@ -889,3 +889,11 @@ ul#settings_nav :bottom 1px solid #eee :cursor default + +#friend_pictures + :line-height 1em + img + :margin-right -1px + +#thumbnails + :line-height 14px From 79926da3d32aa0895c461fdfb0dc2f34e2dc06a8 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Mon, 27 Sep 2010 23:16:19 -0700 Subject: [PATCH 356/449] removed owner image repeat --- app/views/shared/_aspect_friends.haml | 28 --------------------------- 1 file changed, 28 deletions(-) diff --git a/app/views/shared/_aspect_friends.haml b/app/views/shared/_aspect_friends.haml index 6d1a0e2f4..f8e635f8d 100644 --- a/app/views/shared/_aspect_friends.haml +++ b/app/views/shared/_aspect_friends.haml @@ -3,34 +3,6 @@ -# the COPYRIGHT file. #friend_pictures - = owner_image_link - = owner_image_link - = owner_image_link - = owner_image_link - = owner_image_link - = owner_image_link - = owner_image_link - = owner_image_link - = owner_image_link - = owner_image_link - = owner_image_link - = owner_image_link - = owner_image_link - = owner_image_link - = owner_image_link - = owner_image_link - = owner_image_link - = owner_image_link - = owner_image_link - = owner_image_link - = owner_image_link - = owner_image_link - = owner_image_link - = owner_image_link - = owner_image_link - = owner_image_link - = owner_image_link - = owner_image_link = owner_image_link - for friend in @friends = person_image_link(friend) From 263615ad14ea9acf5dff2ad7f7f0747c2730b904 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Mon, 27 Sep 2010 23:51:20 -0700 Subject: [PATCH 357/449] all status messages have labels --- .../status_messages/_status_message.html.haml | 7 +++- public/stylesheets/application.css | 26 +++++++++++- public/stylesheets/sass/application.sass | 41 +++++++++++++++++-- 3 files changed, 68 insertions(+), 6 deletions(-) diff --git a/app/views/status_messages/_status_message.html.haml b/app/views/status_messages/_status_message.html.haml index f4ac1cadf..d1568c7bb 100644 --- a/app/views/status_messages/_status_message.html.haml +++ b/app/views/status_messages/_status_message.html.haml @@ -24,6 +24,11 @@ = render "shared/reshare", :post => post, :current_user => current_user - if post.public? - .aspect_tag + .public_aspect_tag public + - else + .aspect_tag + %ul + - for aspect in current_user.aspects_with_post( post.id ) + %li= aspect.name diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index e886e3480..42b61f513 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -676,11 +676,11 @@ ul#settings_nav { #fancybox-close:hover { background-color: transparent; } -.aspect_tag { +.aspect_tag, +.public_aspect_tag { position: absolute; top: 15px; right: 2em; - background-color: #fffc7f; border-radius: 5px; -webkit-border-radius: 5px; -moz-border-radius: 5px; @@ -691,6 +691,28 @@ ul#settings_nav { border-bottom: 1px solid #eeeeee; cursor: default; } +.public_aspect_tag { + background-color: #fffc7f; } + +.aspect_tag { + background-color: #eeeeee; + color: #999999; + text-shadow: 0 1px white; } + .aspect_tag ul { + display: inline; + margin: 0; + padding: 0; + list-style: none; } + .aspect_tag ul li { + display: inline; + margin-right: 2px; + padding-right: 4px; + border-right: 1px solid #cccccc; } + .aspect_tag ul li:last-child { + margin-right: 0; + padding-right: 0; + border-right: none; } + #friend_pictures { line-height: 1em; } #friend_pictures img { diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass index ab4674760..71589e3cc 100644 --- a/public/stylesheets/sass/application.sass +++ b/public/stylesheets/sass/application.sass @@ -866,12 +866,11 @@ ul#settings_nav :background :color transparent -.aspect_tag +.aspect_tag, +.public_aspect_tag :position absolute :top 15px :right 2em - :background - :color #FFFC7F :border-radius 5px :-webkit-border-radius 5px @@ -890,6 +889,42 @@ ul#settings_nav :cursor default +.public_aspect_tag + :background + :color #FFFC7F + +.aspect_tag + :background + :color #eee + :color #999 + :text + :shadow 0 1px #fff + + ul + :display inline + :margin 0 + :padding 0 + :list + :style none + + li + :display inline + :margin + :right 2px + :padding + :right 4px + :border + :right 1px solid #ccc + + &:last-child + :margin + :right 0 + :padding + :right 0 + :border + :right none + + #friend_pictures :line-height 1em img From 0fed72d50511b54e30d431aa50f765bb09fae559 Mon Sep 17 00:00:00 2001 From: Kashif Rasul Date: Tue, 28 Sep 2010 13:57:40 +0200 Subject: [PATCH 358/449] Added Arabic locales. --- config/locales/ar.yml | 207 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 207 insertions(+) create mode 100644 config/locales/ar.yml diff --git a/config/locales/ar.yml b/config/locales/ar.yml new file mode 100644 index 000000000..edc2024ae --- /dev/null +++ b/config/locales/ar.yml @@ -0,0 +1,207 @@ +# Copyright (c) 2010, Diaspora Inc. This file is +# licensed under the Affero General Public License version 3. See +# the COPYRIGHT file. + +# Sample localization file for English. Add more files in this directory for other locales. +# See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. + +en: + hello: "مرحبا العال" + application: + helper: + unknown_person: "غير معروف شخ" + new_requests: "طلبات جديد" + dashboards: + helper: + home: "منزل" + error_messages: + helper: + invalid_fields: "الحقول غير صالح" + correct_the_following_errors_and_try_again: "تصحيح الأخطاء التالية وحاول مرة أخرى" + people: + helper: + results_for: "%{params} نتائ " + people_on_pod_are_aware_of: "الناس في جراب على عل " + layouts: + application: + edit_profile: "تعديل الملف الشخص" + logout: "خرو" + shared: + aspect_nav: + all_aspects: "جميع الجوان" + manage: "نجح" + manage_your_aspects: "إدارة جوانب الخا" + sub_header: + all_aspects: "جميع الجوان" + manage_aspects: "إدارة الجوان" + publisher: + share: "تقاسم" + aspect_friends: + add_friends: "أضف أصدقا" + albums: + album: + you: "أنت" + new_album: + create: "خلق" + add_a_new_album: "إضافة ألبوم جدي" + show: + edit_album: "تعديل الألبو" + albums: "البومات" + updated: "تحديث" + by: "بواسطة" + edit: + editing: "التحرير" + updated: "تحديث" + are_you_sure: "هل أنت متأكد؟" + delete_album: "حذف ألبو" + cancel: "إلغاء" + index: + home: "منزل" + new_album: "ألبوم جدي" + create: + success: ".%{name} لقد قمت بإنشاء اسم الألبو" + update: + success: ".تحرير بنجا %{name} الألبوم" + failure: ".%{name} فشلت في تحرير الألبو" + destroy: + success: ".حذفها %{name} الألبوم" + helper: + friends_albums: "أصدقاء البوما" + your_albums: "البومات الخا" + aspects: + index: + photos: "صور" + show: + photos: "صور" + manage: + add_a_new_aspect: "أضف جانبا جديد" + add_a_new_friend: "إضافة صديق جدي" + show: "عرض" + update_aspects: "تحديث الجوان" + requests: "طلبات" + ignore_remove: "تجاهل/إزال" + new_aspect: + add_a_new_aspect: "أضف جانبا جديد" + create: "خلق" + create: + success: ".الذي يمكن أن نرى الجانب الجديد الخاص بك Diaspora انقر على علامة الجمع على الجانب الأيسر لنقو" + failure: ".فشل إنشاء الجانب" + destroy: + success: ".%{name} وقد نجحت في إزال" + update: + success: ".تحرير بنجاح ,%{name} ,وقد الجانب الخاص بك" + move_friends: + failure: ".%{real_name} فشل تحرير آسبكت لصدي" + success: ".جوانب الموضوع بنجاح" + move_friend: + failure: "%{inspect} لم تنج" + success: ".أنت الآن عرض صديقك جانبا مختلفا من جوانب نفسك" + helper: + remove: "نزع" + aspect_not_empty: "الجانب يست فارغ" + users: + edit: + editing_profile: "تحرير الملف الشخص" + profile: + cancel: "إلغاء" + update_profile: "تحديث الملف الشخص" + home: "منزل" + diaspora_username: "اسم المستخد DIASPORA" + info: "معلومات" + picture: "صورة" + editing_profile: "تحرير الملف الشخص" + albums: "البومات" + you_dont_have_any_photos: "ليس لديك أي صوا! نتقل إل" + page_to_upload_some: ".الصفحة لتحميل بع" + comments: + comment: + ago: "منذ" + new_comment: + comment: "كيف" + photos: + show: + prev: "السابق" + full_size: "الحجم الكام" + next: "القادم" + edit_photo: "تحرير الصو" + delete_photo: "حذف الصو" + are_you_sure: "هل أنت متأكد؟" + comments: "تعليقات" + edit: + editing: "تصحيح" + are_you_sure: "هل أنت متأك؟" + delete_photo: "حذف الصو" + photo: + show_comments: "sعرض التعليقا" + posted_a_new_photo_to: "أرسلت صورة جديدة ل" + new: + new_photo: "جديد الصو" + back_to_list: "عودة إلى قائم" + post_it: "!بعد ذلك" + create: + runtime_error: "?فشل تحميل الصور. هل أنت متأكد من أن يتم ربط حزام الأمان" + integrity_error: "?فشل تحميل الصور. هل أنت متأكد من أن صورة" + type_error: "?فشل تحميل الصور. هل أنت متأكد من وأضيف صورة" + update: + notice: ".الصورة تحديثها بنجاح" + error: ".فشل لتحرير الصو" + destroy: + notice: ".الصور المحذوفة" + registrations: + new: + sign_up: "قم بالتسجي" + create: + success: "!Diaspora لقد انضممت" + status_messages: + new_status_message: + tell_me_something_good: "قل لي شيئا جيد" + oh_yeah: "!نعم" + status_message: + show_comments: "عرض التعليقا" + delete: "حذف" + are_you_sure: "هل أنت متأكد؟" + show: + status_message: "رسالة الحالة" + comments: "تعليقات" + are_you_sure: "هل أنت متأكد؟" + destroy: "هدم" + view_all: "عرض الك" + message: "رسالة" + owner: "مالك" + helper: + no_message_to_display: ".أي رسالة لعرضه" + people: + person: + add_friend: "أضف صدي" + pending_request: "في انتظار طلب" + index: + add_friend: "أضف صدي" + real_name: "اسمه الحقيقي" + diaspora_handle: "اسمك المستعار diaspora" + thats_you: "!هذا لك" + friend_request_pending: "طلب صديق معلقة" + you_have_a_friend_request_from_this_person: "لديك صديق طلب من هذا الشخص" + new: + new_person: "شخص جديد" + back_to_list: "عودة إلى قائمة" + show: + last_seen: "%{how_long_ago} :المشاهدة الأخيرة" + friends_since: "%{how_long_ago} :أصدقاء منذ" + save: "حفظ" + are_you_sure: "هل أنت متأكد؟" + remove_friend: "إزالة صديق" + requests: + new_request: + add_a_new_friend_to: "إضافة صديق جديد إلى" + enter_a_diaspora_username: ":Diaspora أدخل اسم مستخدم" + your_diaspora_username_is: "%{diaspora_handle} :هو Diaspora اسم المستخدم الخاص" + friends_username: "صديق اسم المستخدم" + destroy: + success: ".أنت الآن أصدقاء" + error: "!الرجاء اختيار جانبا" + ignore: ".صديق تجاهل الطلب" + create: + error: "!مع هذا البريد الإلكتروني diaspora لم يتم العثور على بذور" + already_friends: "!%{destination_url} كنت بالفعل مع أصدقاء" + success: ".%{destination_url} وأرسل طلب صداقة إلى" + horribly_wrong: ".ذهب شيء خاطئ" From 3e7d4b1db3abcca33c9b0c4d96d979fc3a725168 Mon Sep 17 00:00:00 2001 From: "Jesse B. Hannah" Date: Tue, 28 Sep 2010 09:55:39 -0700 Subject: [PATCH 359/449] Fixed mailing list link typo in README.md. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f21676bdd..e3bd8c865 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,7 @@ Ongoing discussion: More general info and updates about the project can be found on: [Our blog](http://joindiaspora.com), [and on Twitter](http://twitter.com/joindiaspora). -Also, be sure to join the official [mailing list](http://http://eepurl.com/Vebk). +Also, be sure to join the official [mailing list](http://eepurl.com/Vebk). If you wish to contact us privately about any exploits in Diaspora you may find, you can email From bf15514bc969d272e32182038062debc3ace0b48 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Tue, 28 Sep 2010 10:23:03 -0700 Subject: [PATCH 360/449] redirect users#public to root_url if user does not exist. --- app/controllers/users_controller.rb | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 0d5c4d449..1cc280577 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -31,10 +31,16 @@ class UsersController < ApplicationController def public user = User.find_by_username(params[:username]) - director = Diaspora::Director.new - ostatus_builder = Diaspora::OstatusBuilder.new(user) - render :xml => director.build(ostatus_builder) + if user + director = Diaspora::Director.new + ostatus_builder = Diaspora::OstatusBuilder.new(user) + + render :xml => director.build(ostatus_builder) + else + flash[:error] = "User #{params[:username]} does not exist!" + redirect_to root_url + end end private From 241ea4559ab69c55110a2834d9814bf98dde5c47 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Tue, 28 Sep 2010 10:41:38 -0700 Subject: [PATCH 361/449] gradients on aspect tags on status messages --- public/stylesheets/application.css | 12 +++++++++--- public/stylesheets/sass/application.sass | 10 ++++++++-- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index 42b61f513..5b8a656da 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -692,12 +692,18 @@ ul#settings_nav { cursor: default; } .public_aspect_tag { - background-color: #fffc7f; } + background: -moz-linear-gradient(19% 75% 90deg, #fffa75, #fff8ba); + background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#fff8ba), to(#fffa75)); + background-color: #fffc7f; + border-top: 1px solid #ebe66c; } .aspect_tag { - background-color: #eeeeee; + background: -moz-linear-gradient(19% 75% 90deg, #e0e0e0, #f0f0f0); + background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#f0f0f0), to(#e0e0e0)); + background-color: #eeeeee; color: #999999; - text-shadow: 0 1px white; } + text-shadow: 0 1px white; + border-top: 1px solid #dddddd; } .aspect_tag ul { display: inline; margin: 0; diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass index 71589e3cc..0fcc6eab2 100644 --- a/public/stylesheets/sass/application.sass +++ b/public/stylesheets/sass/application.sass @@ -890,15 +890,21 @@ ul#settings_nav :cursor default .public_aspect_tag - :background + :background -moz-linear-gradient(19% 75% 90deg,#FFFA75, #FFF8BA) + :background -webkit-gradient(linear, 0% 0%, 0% 100%, from(#FFF8BA), to(#FFFA75)) :color #FFFC7F + :border + :top 1px solid #EBE66C .aspect_tag - :background + :background -moz-linear-gradient(19% 75% 90deg,#E0E0E0, #F0F0F0) + :background -webkit-gradient(linear, 0% 0%, 0% 100%, from(#F0F0F0), to(#E0E0E0)) :color #eee :color #999 :text :shadow 0 1px #fff + :border + :top 1px solid #ddd ul :display inline From b068eaf15cd0e550eb2287fd07f819a08d9235e7 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Tue, 28 Sep 2010 10:48:45 -0700 Subject: [PATCH 362/449] limit content width to 600px --- public/stylesheets/application.css | 3 ++- public/stylesheets/sass/application.sass | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index 5b8a656da..92944841c 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -160,7 +160,8 @@ li.message { li.message .delete:hover { background: #eeeeee; } li.message .content { - padding-left: 65px; } + padding-left: 65px; + width: 600px; } li.message .content span.from { color: black; font-weight: normal; diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass index 0fcc6eab2..b86ddc1bf 100644 --- a/public/stylesheets/sass/application.sass +++ b/public/stylesheets/sass/application.sass @@ -209,6 +209,7 @@ li.message .content :padding :left 65px + :width 600px span.from :color #000 From 904143d10057099e6027bc985734705d6e9c97e4 Mon Sep 17 00:00:00 2001 From: ilya Date: Tue, 28 Sep 2010 11:25:18 -0700 Subject: [PATCH 363/449] rake task to move the private key --- lib/tasks/db.rake | 13 +++++++++++++ lib/tasks/generate_session_secret.rake | 1 - 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/lib/tasks/db.rake b/lib/tasks/db.rake index 396bb145d..82fc6fa9f 100644 --- a/lib/tasks/db.rake +++ b/lib/tasks/db.rake @@ -65,4 +65,17 @@ namespace :db do } puts "everything should be peachy" end + + task :move_private_key do + User.all.each do |user| + if user.private_key.nil? + user.private_key = user.person.serialized_key + user.save + person = user.person + person.serialized_key = nil + person.serialized_public_key = user.encryption_key.public_key + person.save + end + end + end end diff --git a/lib/tasks/generate_session_secret.rake b/lib/tasks/generate_session_secret.rake index 90274dff3..c9fc129de 100644 --- a/lib/tasks/generate_session_secret.rake +++ b/lib/tasks/generate_session_secret.rake @@ -19,7 +19,6 @@ namespace :generate do Rails.application.config.secret_token = '#{secret}' EOF -puts "YAY!!" end end From 577b5545bf66730cfb4fe3f0b792779da4926249 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Tue, 28 Sep 2010 11:50:13 -0700 Subject: [PATCH 364/449] comment blocks slide --- public/javascripts/stream.js | 4 ++-- public/stylesheets/application.css | 4 ++-- public/stylesheets/sass/application.sass | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/public/javascripts/stream.js b/public/javascripts/stream.js index e8db10abd..7811fb1a3 100644 --- a/public/javascripts/stream.js +++ b/public/javascripts/stream.js @@ -21,10 +21,10 @@ $(".show_post_comments").live('click', function(event) { if( $this.hasClass( "visible")) { $this.html($(this).html().replace("hide", "show")); - $this.closest("li").children(".content").children(".comments").fadeOut(100); + $this.closest("li").children(".content").children(".comments").slideUp(150); } else { $this.html($(this).html().replace("show", "hide")); - $this.closest("li").children(".content").children(".comments").fadeIn(100); + $this.closest("li").children(".content").children(".comments").slideDown(150); } $(this).toggleClass( "visible" ); }); diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index 92944841c..afaebdb29 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -263,7 +263,7 @@ ul.comment_set { margin-bottom: 0.5em; background-color: rgba(10, 81, 109, 0.05); padding: 0.6em; - border-bottom: 1px solid #cccccc; } + border-bottom: 1px solid #dddddd; } ul.comment_set li.comment .from { font-size: 1em; } ul.comment_set li.comment div.time { @@ -711,7 +711,7 @@ ul#settings_nav { padding: 0; list-style: none; } .aspect_tag ul li { - display: inline; + display: inlinte; margin-right: 2px; padding-right: 4px; border-right: 1px solid #cccccc; } diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass index b86ddc1bf..f7c58beac 100644 --- a/public/stylesheets/sass/application.sass +++ b/public/stylesheets/sass/application.sass @@ -356,7 +356,7 @@ ul.comment_set :color rgba(10,81,109,0.05) :padding 0.6em :border - :bottom 1px solid #ccc + :bottom 1px solid #ddd .from :font @@ -915,7 +915,7 @@ ul#settings_nav :style none li - :display inline + :display inlinte :margin :right 2px :padding From 0a34c24f226dac74b9e640009b9d5af23293ce45 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Tue, 28 Sep 2010 11:51:52 -0700 Subject: [PATCH 365/449] tag fix --- public/stylesheets/application.css | 2 +- public/stylesheets/sass/application.sass | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index afaebdb29..7c8c9beb4 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -711,7 +711,7 @@ ul#settings_nav { padding: 0; list-style: none; } .aspect_tag ul li { - display: inlinte; + display: inline-block; margin-right: 2px; padding-right: 4px; border-right: 1px solid #cccccc; } diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass index f7c58beac..b7af588fe 100644 --- a/public/stylesheets/sass/application.sass +++ b/public/stylesheets/sass/application.sass @@ -915,7 +915,7 @@ ul#settings_nav :style none li - :display inlinte + :display inline-block :margin :right 2px :padding From 4627c5338ee3eeea3cffdd427f9eeb30c568ffc0 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Tue, 28 Sep 2010 12:29:35 -0700 Subject: [PATCH 366/449] found placement of all aspects tab confusing; moved it to be the first tab --- app/views/shared/_aspect_nav.haml | 4 ++-- public/stylesheets/application.css | 10 +++++++--- public/stylesheets/sass/application.sass | 12 +++++++++--- 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/app/views/shared/_aspect_nav.haml b/app/views/shared/_aspect_nav.haml index 4c4a501d2..dc01afd20 100644 --- a/app/views/shared/_aspect_nav.haml +++ b/app/views/shared/_aspect_nav.haml @@ -4,11 +4,11 @@ #aspect_nav %ul + %li{:class => ("selected" if @aspect == :all)} + = link_to t('.all_aspects'), root_url - for aspect in @aspects %li{:class => ("selected" if current_aspect?(aspect))} = link_for_aspect aspect - %li{:class => ("selected" if @aspect == :all)} - = link_to t('.all_aspects'), root_url %ul{ :style => "position:absolute;right:0;bottom:0.01em;"} %li{:class => ("selected" if @aspect == :public)} diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index 7c8c9beb4..18e6ce4ba 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -118,6 +118,10 @@ header { header #session_action ul li:last-child { margin-right: 0; } header #aspect_header { + -webkit-box-shadow: 0px -4px 6px -2px #777777; + -moz-box-shadow: 0px -4px 6px -2px #777777; + background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#f7f7f7), to(#eeeeee)); + background: -moz-linear-gradient(19% 75% 90deg, #eeeeee, #f7f7f7); background-color: #eeeeee; border-top: 1px solid white; padding: 20px 0; } @@ -529,10 +533,10 @@ h1.big_text { line-height: 18px; font-weight: bold; background-color: #eeeeee; - background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(white), to(#eeeeee)); - background: -moz-linear-gradient(19% 75% 90deg, #eeeeee, white); + background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(white), to(#f7f7f7)); + background: -moz-linear-gradient(19% 75% 90deg, #f7f7f7, white); border: 1px solid white; - border-bottom: 1px solid #eeeeee; + border-bottom: 1px solid #f7f7f7; color: black; } #aspect_nav ul > li.selected a:hover { background-color: #efefef; } diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass index b7af588fe..b3397e68c 100644 --- a/public/stylesheets/sass/application.sass +++ b/public/stylesheets/sass/application.sass @@ -146,6 +146,12 @@ header :right 0 #aspect_header + :-webkit-box-shadow 0px -4px 6px -2px #777 + :-moz-box-shadow 0px -4px 6px -2px #777 + + :background -webkit-gradient(linear, 0% 0%, 0% 100%, from(#F7F7F7), to(#EEEEEE)) + :background -moz-linear-gradient(19% 75% 90deg, #eee, #f7f7f7) + :background :color #eee :border @@ -713,11 +719,11 @@ h1.big_text :background :color #eee - :background -webkit-gradient(linear, 0% 0%, 0% 100%, from(#fff), to(#eee)) - :background -moz-linear-gradient(19% 75% 90deg, #eee, #fff) + :background -webkit-gradient(linear, 0% 0%, 0% 100%, from(#fff), to(#F7F7F7)) + :background -moz-linear-gradient(19% 75% 90deg, #f7f7f7, #fff) :border 1px solid #fff - :bottom 1px solid #eee + :bottom 1px solid #F7F7F7 :color #000 &:hover :background From 6eede48f9fd47ef316245b82f9f1da337f844397 Mon Sep 17 00:00:00 2001 From: ilya Date: Tue, 28 Sep 2010 12:39:33 -0700 Subject: [PATCH 367/449] started to refactor the salmon spec, changed data in to be parsed data to be more clear --- lib/diaspora/user/receiving.rb | 4 +- lib/salmon/salmon.rb | 4 +- spec/lib/salmon_salmon_spec.rb | 96 ++++++++++++++++++++-------------- 3 files changed, 60 insertions(+), 44 deletions(-) diff --git a/lib/diaspora/user/receiving.rb b/lib/diaspora/user/receiving.rb index 5d737d8e9..671db1a59 100644 --- a/lib/diaspora/user/receiving.rb +++ b/lib/diaspora/user/receiving.rb @@ -5,8 +5,8 @@ module Diaspora cleartext = decrypt( ciphertext) salmon = Salmon::SalmonSlap.parse cleartext if salmon.verified_for_key?(salmon.author.public_key) - Rails.logger.info("data in salmon: #{salmon.data}") - self.receive(salmon.data) + Rails.logger.info("data in salmon: #{salmon.parsed_data}") + self.receive(salmon.parsed_data) end end diff --git a/lib/salmon/salmon.rb b/lib/salmon/salmon.rb index 5d2857196..15e1c3e1e 100644 --- a/lib/salmon/salmon.rb +++ b/lib/salmon/salmon.rb @@ -41,7 +41,7 @@ end module Salmon class SalmonSlap - attr_accessor :magic_sig, :author, :author_email, :data, :data_type, :sig + attr_accessor :magic_sig, :author, :author_email, :parsed_data, :data_type, :sig def self.parse(xml) slap = self.new doc = Nokogiri::XML(xml) @@ -50,7 +50,7 @@ module Salmon slap.magic_sig = MagicSigEnvelope.parse sig_doc if 'base64url' == slap.magic_sig.encoding - slap.data = decode64url(slap.magic_sig.data) + slap.parsed_data = decode64url(slap.magic_sig.data) slap.sig = slap.magic_sig.sig else raise ArgumentError, "Magic Signature data must be encoded with base64url, was #{slap.magic_sig.encoding}" diff --git a/spec/lib/salmon_salmon_spec.rb b/spec/lib/salmon_salmon_spec.rb index 6d467d4ea..b75a90abd 100644 --- a/spec/lib/salmon_salmon_spec.rb +++ b/spec/lib/salmon_salmon_spec.rb @@ -5,52 +5,68 @@ require 'spec_helper' describe Salmon do - before do + let(:user){Factory.create :user} + let(:post){ user.post :status_message, :message => "hi", :to => user.aspect(:name => "sdg").id } - @user = Factory.create :user - @post = @user.post :status_message, :message => "hi", :to => @user.aspect(:name => "sdg").id - @sent_salmon = Salmon::SalmonSlap.create(@user, @post.to_diaspora_xml) - @parsed_salmon = Salmon::SalmonSlap.parse @sent_salmon.to_xml - stub_success("tom@tom.joindiaspora.com") - end + describe '#create' do + let!(:created_salmon) {Salmon::SalmonSlap.create(user, post.to_diaspora_xml)} - it 'should verify the signature on a roundtrip' do - - @sent_salmon.magic_sig.data.should == @parsed_salmon.magic_sig.data - - @sent_salmon.magic_sig.sig.should == @parsed_salmon.magic_sig.sig - @sent_salmon.magic_sig.signable_string.should == @parsed_salmon.magic_sig.signable_string - - @parsed_salmon.verified_for_key?(OpenSSL::PKey::RSA.new(@user.exported_key)).should be true - @sent_salmon.verified_for_key?(OpenSSL::PKey::RSA.new(@user.exported_key)).should be true - end - - it 'should return the data so it can be "received"' do - - xml = @post.to_diaspora_xml - - @parsed_salmon.data.should == xml - end - - it 'should parse out the authors diaspora_handle' do - @parsed_salmon.author_email.should == @user.person.diaspora_handle + it 'has data in the magic envelope' do + created_salmon.magic_sig.data.should_not be nil + end + + it 'has no parsed_data' do + created_salmon.parsed_data.should be nil + end end - it 'should reference a local author' do - @parsed_salmon.author.should == @user.person - end + context 'round trip' do + before do + @sent_salmon = Salmon::SalmonSlap.create(user, post.to_diaspora_xml) + @parsed_salmon = Salmon::SalmonSlap.parse @sent_salmon.to_xml + stub_success("tom@tom.joindiaspora.com") + end - it 'should reference a remote author' do - @parsed_salmon.author_email = 'tom@tom.joindiaspora.com' - @parsed_salmon.author.public_key.should_not be_nil - end - it 'should fail to reference a nonexistent remote author' do - @parsed_salmon.author_email = 'idsfug@difgubhpsduh.rgd' - proc { - Redfinger.stub(:finger).and_return(nil) #Redfinger returns nil when there is no profile - @parsed_salmon.author.real_name}.should raise_error /No webfinger profile found/ - end + it 'should verify the signature on a roundtrip' do + @sent_salmon.magic_sig.data.should == @parsed_salmon.magic_sig.data + + @sent_salmon.magic_sig.sig.should == @parsed_salmon.magic_sig.sig + @sent_salmon.magic_sig.signable_string.should == @parsed_salmon.magic_sig.signable_string + + @parsed_salmon.verified_for_key?(OpenSSL::PKey::RSA.new(user.exported_key)).should be true + @sent_salmon.verified_for_key?(OpenSSL::PKey::RSA.new(user.exported_key)).should be true + end + + it 'should return the data so it can be "received"' do + + xml = post.to_diaspora_xml + + @parsed_salmon.parsed_data.should == xml + end + + it 'should parse out the authors diaspora_handle' do + @parsed_salmon.author_email.should == user.person.diaspora_handle + + end + + it 'should reference a local author' do + @parsed_salmon.author.should == user.person + end + + it 'should reference a remote author' do + @parsed_salmon.author_email = 'tom@tom.joindiaspora.com' + @parsed_salmon.author.public_key.should_not be_nil + end + + it 'should fail to reference a nonexistent remote author' do + @parsed_salmon.author_email = 'idsfug@difgubhpsduh.rgd' + proc { + Redfinger.stub(:finger).and_return(nil) #Redfinger returns nil when there is no profile + @parsed_salmon.author.real_name}.should raise_error /No webfinger profile found/ + end + + end end From e0159aaaeb8737771095e4cfe0da9620cd49e963 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Tue, 28 Sep 2010 12:58:34 -0700 Subject: [PATCH 368/449] small visual tweaks --- app/views/status_messages/show.html.haml | 1 + public/stylesheets/application.css | 14 +++++++++----- public/stylesheets/sass/application.sass | 15 +++++++++++---- 3 files changed, 21 insertions(+), 9 deletions(-) diff --git a/app/views/status_messages/show.html.haml b/app/views/status_messages/show.html.haml index ae4ece073..3d78dd29e 100644 --- a/app/views/status_messages/show.html.haml +++ b/app/views/status_messages/show.html.haml @@ -7,6 +7,7 @@ = @status_message.message %h4= "#{t('.comments')} (#{@status_message.comments.count})" + = render "comments/comments", :post => @status_message %p diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index 18e6ce4ba..2b752f9ce 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -147,7 +147,9 @@ ul#stream { padding: 12px 0; border-bottom: 1px solid #eeeeee; } ul#stream > li:hover { - background-color: #fafafa; } + background: -webkit-gradient(linear, 0% 0%, 0% 50%, from(#fafafa), to(#fcfcfc)); + background-color: #fafafa; + border-bottom: 1px solid #dddddd; } ul#stream > li:hover .destroy_link { display: inline; } ul#stream .right { @@ -392,13 +394,15 @@ label { height: 42px; margin-top: 0; margin-bottom: 0; - box-shadow: 0 1px white; - -moz-box-shadow: 0 1px white; - -webkit-box-shadow: 0 1px white; } + box-shadow: 0 1px 2px white; + -moz-box-shadow: 0 1px 2px white; + -webkit-box-shadow: 0 1px 2px white; } #publisher .button { margin-left: 100px; } #publisher img { - -webkit-box-shadow: 0 1px 0 white; + box-shadow: 0 1px 2px white; + -moz-box-shadow: 0 1px 2px white; + -webkit-box-shadow: 0 1px 2px white; border: 1px solid #bbbbbb; border-top: 1px solid #666666; } diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass index b3397e68c..abf7bd147 100644 --- a/public/stylesheets/sass/application.sass +++ b/public/stylesheets/sass/application.sass @@ -188,9 +188,14 @@ ul#stream :bottom 1px solid #eee &:hover + :background -webkit-gradient(linear, 0% 0%, 0% 50%, from(#FAFAFA), to(#FCFCFC)) + :background :color #fafafa + :border + :bottom 1px solid #ddd + .destroy_link :display inline @@ -522,15 +527,17 @@ label :top 0 :bottom 0 - :box-shadow 0 1px #fff - :-moz-box-shadow 0 1px #fff - :-webkit-box-shadow 0 1px #fff + :box-shadow 0 1px 2px #fff + :-moz-box-shadow 0 1px 2px #fff + :-webkit-box-shadow 0 1px 2px #fff .button :margin-left 100px img - :-webkit-box-shadow 0 1px 0 #fff + :box-shadow 0 1px 2px #fff + :-moz-box-shadow 0 1px 2px #fff + :-webkit-box-shadow 0 1px 2px #fff :border 1px solid #bbb :top 1px solid #666 From f5a57a6f4afed5dc7b0e017628b8a5e69d22f69e Mon Sep 17 00:00:00 2001 From: danielvincent Date: Tue, 28 Sep 2010 13:05:58 -0700 Subject: [PATCH 369/449] photo partial now has labels --- app/views/photos/_photo.haml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/views/photos/_photo.haml b/app/views/photos/_photo.haml index d39fd0666..5e86e32a6 100644 --- a/app/views/photos/_photo.haml +++ b/app/views/photos/_photo.haml @@ -22,3 +22,13 @@ \-- = link_to "#{t('.show_comments')} (#{post.comments.count})", '#', :class => "show_post_comments" = render "comments/comments", :post => post + + - if post.public? + .public_aspect_tag + public + - else + .aspect_tag + %ul + - for aspect in current_user.aspects_with_post( post.id ) + %li= aspect.name + From c7d29b29c84eb0502cbc85b5245e38304ab79930 Mon Sep 17 00:00:00 2001 From: ilya Date: Tue, 28 Sep 2010 13:22:19 -0700 Subject: [PATCH 370/449] the salmon now encrypts the activity, and stores the aes key in the header --- lib/salmon/salmon.rb | 21 +++++++++++++-------- spec/lib/salmon_salmon_spec.rb | 10 ++++++++++ 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/lib/salmon/salmon.rb b/lib/salmon/salmon.rb index 15e1c3e1e..82893a59d 100644 --- a/lib/salmon/salmon.rb +++ b/lib/salmon/salmon.rb @@ -41,7 +41,19 @@ end module Salmon class SalmonSlap - attr_accessor :magic_sig, :author, :author_email, :parsed_data, :data_type, :sig + attr_accessor :magic_sig, :author, :author_email, :aes_key, :iv, :parsed_data, + :data_type, :sig + + def self.create(user, activity) + salmon = self.new + salmon.author = user.person + aes_key_hash = user.person.gen_aes_key + salmon.aes_key = aes_key_hash['key'] + salmon.iv = aes_key_hash['iv'] + salmon.magic_sig = MagicSigEnvelope.create(user , user.person.aes_encrypt(activity, aes_key_hash)) + salmon + end + def self.parse(xml) slap = self.new doc = Nokogiri::XML(xml) @@ -65,13 +77,6 @@ module Salmon slap end - def self.create(user, activity) - salmon = self.new - salmon.author = user.person - salmon.magic_sig = MagicSigEnvelope.create(user , activity) - salmon - end - def to_xml xml =< diff --git a/spec/lib/salmon_salmon_spec.rb b/spec/lib/salmon_salmon_spec.rb index b75a90abd..ef24b5037 100644 --- a/spec/lib/salmon_salmon_spec.rb +++ b/spec/lib/salmon_salmon_spec.rb @@ -18,7 +18,17 @@ describe Salmon do it 'has no parsed_data' do created_salmon.parsed_data.should be nil end + + it 'sets aes and iv key' do + created_salmon.aes_key.should_not be nil + created_salmon.iv.should_not be nil + end + it 'should make the data in the signature encrypted with that key' do + key_hash = {'key' => created_salmon.aes_key, 'iv' => created_salmon.iv} + decoded_string = Salmon::SalmonSlap.decode64url(created_salmon.magic_sig.data) + user.aes_decrypt(decoded_string, key_hash).to_s.should == post.to_diaspora_xml.to_s + end end context 'round trip' do From 46bf0cfd99e0504122e3caeb9065848119870b4b Mon Sep 17 00:00:00 2001 From: ilya Date: Tue, 28 Sep 2010 15:11:01 -0700 Subject: [PATCH 371/449] roundtrip done, just need to clean and move to the new api --- lib/salmon/salmon.rb | 43 ++++++++++++++++++++++++++++++++-- spec/lib/salmon_salmon_spec.rb | 42 +++++++++++++++++++++++++++++---- 2 files changed, 79 insertions(+), 6 deletions(-) diff --git a/lib/salmon/salmon.rb b/lib/salmon/salmon.rb index 82893a59d..bd2c0b1b9 100644 --- a/lib/salmon/salmon.rb +++ b/lib/salmon/salmon.rb @@ -54,15 +54,26 @@ module Salmon salmon end - def self.parse(xml) + def self.parse(xml, user) slap = self.new doc = Nokogiri::XML(xml) sig_doc = doc.search('entry') + + ### Header ## + decrypted_header = user.decrypt(doc.search('encrypted_header').text) + puts decrypted_header + header_doc = Nokogiri::XML(decrypted_header) + puts header_doc.inspect + slap.aes_key = header_doc.search('aes_key').text + slap.iv = header_doc.search('iv').text + slap.magic_sig = MagicSigEnvelope.parse sig_doc if 'base64url' == slap.magic_sig.encoding - slap.parsed_data = decode64url(slap.magic_sig.data) + + key_hash = {'key' => slap.aes_key, 'iv' => slap.iv} + slap.parsed_data = user.aes_decrypt(decode64url(slap.magic_sig.data), key_hash) slap.sig = slap.magic_sig.sig else raise ArgumentError, "Magic Signature data must be encoded with base64url, was #{slap.magic_sig.encoding}" @@ -91,6 +102,34 @@ ENTRY end + def xml_for person + xml =< + + #{person.encrypt(decrypted_header.rstrip)} + + #{@author.real_name} + acct:#{@author.diaspora_handle} + + #{@magic_sig.to_xml} + +ENTRY + + end + + def decrypted_header + header =<
+ #{iv} + #{aes_key} + + #{@author.real_name} + acct:#{@author.diaspora_handle} + +
+HEADER + end + def author if @author @author diff --git a/spec/lib/salmon_salmon_spec.rb b/spec/lib/salmon_salmon_spec.rb index ef24b5037..3ea98afe0 100644 --- a/spec/lib/salmon_salmon_spec.rb +++ b/spec/lib/salmon_salmon_spec.rb @@ -6,10 +6,12 @@ require 'spec_helper' describe Salmon do let(:user){Factory.create :user} + let(:user2) {Factory.create :user} let(:post){ user.post :status_message, :message => "hi", :to => user.aspect(:name => "sdg").id } + let!(:created_salmon) {Salmon::SalmonSlap.create(user, post.to_diaspora_xml)} + describe '#create' do - let!(:created_salmon) {Salmon::SalmonSlap.create(user, post.to_diaspora_xml)} it 'has data in the magic envelope' do created_salmon.magic_sig.data.should_not be nil @@ -24,17 +26,49 @@ describe Salmon do created_salmon.iv.should_not be nil end - it 'should make the data in the signature encrypted with that key' do + it 'makes the data in the signature encrypted with that key' do key_hash = {'key' => created_salmon.aes_key, 'iv' => created_salmon.iv} decoded_string = Salmon::SalmonSlap.decode64url(created_salmon.magic_sig.data) - user.aes_decrypt(decoded_string, key_hash).to_s.should == post.to_diaspora_xml.to_s + user.aes_decrypt(decoded_string, key_hash).should == post.to_diaspora_xml end end + + describe '#xml_for' do + let(:xml) {created_salmon.xml_for user2.person} + + it 'has a encrypted header field' do + xml.include?("encrypted_header").should be true + end + + it 'the encrypted_header field should contain the aes key' do + doc = Nokogiri::XML(xml) + decrypted_header = user2.decrypt(doc.search('encrypted_header').text) + decrypted_header.include?(created_salmon.aes_key).should be true + end + end + + context 'marshaling' do + let(:xml) {created_salmon.xml_for user2.person} + let(:parsed_salmon) { Salmon::SalmonSlap.parse(xml, user2)} + + it 'should parse out the aes key' do + parsed_salmon.aes_key.should == created_salmon.aes_key + end + + it 'should parse out the iv' do + parsed_salmon.iv.should == created_salmon.iv + end + + it 'contains the original data' do + parsed_salmon.parsed_data.should == post.to_diaspora_xml + end + + end context 'round trip' do before do @sent_salmon = Salmon::SalmonSlap.create(user, post.to_diaspora_xml) - @parsed_salmon = Salmon::SalmonSlap.parse @sent_salmon.to_xml + @parsed_salmon = stub_success("tom@tom.joindiaspora.com") end From fa8cc5b8769dc2ee6cf8b870c0687087b32a0e1d Mon Sep 17 00:00:00 2001 From: danielvincent Date: Tue, 28 Sep 2010 23:24:04 -0400 Subject: [PATCH 372/449] moz box shadow does not like negative blur --- public/stylesheets/application.css | 1 - public/stylesheets/sass/application.sass | 1 - 2 files changed, 2 deletions(-) diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index 2b752f9ce..27f5543f1 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -119,7 +119,6 @@ header { margin-right: 0; } header #aspect_header { -webkit-box-shadow: 0px -4px 6px -2px #777777; - -moz-box-shadow: 0px -4px 6px -2px #777777; background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#f7f7f7), to(#eeeeee)); background: -moz-linear-gradient(19% 75% 90deg, #eeeeee, #f7f7f7); background-color: #eeeeee; diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass index abf7bd147..a3873d4c8 100644 --- a/public/stylesheets/sass/application.sass +++ b/public/stylesheets/sass/application.sass @@ -147,7 +147,6 @@ header #aspect_header :-webkit-box-shadow 0px -4px 6px -2px #777 - :-moz-box-shadow 0px -4px 6px -2px #777 :background -webkit-gradient(linear, 0% 0%, 0% 100%, from(#F7F7F7), to(#EEEEEE)) :background -moz-linear-gradient(19% 75% 90deg, #eee, #f7f7f7) From 046dbf063b437f037f2fc30226e13e7b16d046a0 Mon Sep 17 00:00:00 2001 From: Jeffry Degrande Date: Wed, 29 Sep 2010 01:49:35 -0300 Subject: [PATCH 373/449] fix i18n => I18n --- app/controllers/aspects_controller.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/controllers/aspects_controller.rb b/app/controllers/aspects_controller.rb index 2bf1edb76..bf24e56f9 100644 --- a/app/controllers/aspects_controller.rb +++ b/app/controllers/aspects_controller.rb @@ -29,7 +29,7 @@ class AspectsController < ApplicationController begin current_user.drop_aspect @aspect - flash[:notice] = i18n.t 'aspects.destroy.success',:name => @aspect.name + flash[:notice] = I18n.t 'aspects.destroy.success',:name => @aspect.name rescue RuntimeError => e flash[:error] = e.message end @@ -55,7 +55,7 @@ class AspectsController < ApplicationController data = clean_hash(params[:aspect]) @aspect.update_attributes( data ) - flash[:notice] = i18n.t 'aspects.update.success',:name => @aspect.name + flash[:notice] = I18n.t 'aspects.update.success',:name => @aspect.name respond_with @aspect end @@ -63,13 +63,13 @@ class AspectsController < ApplicationController params[:moves].each{ |move| move = move[1] unless current_user.move_friend(move) - flash[:error] = i18n.t 'aspects.move_friends.failure', :real_name => Person.find_by_id( move[:friend_id] ).real_name + flash[:error] = I18n.t 'aspects.move_friends.failure', :real_name => Person.find_by_id( move[:friend_id] ).real_name redirect_to aspects_manage_path return end } - flash[:notice] = i18n.t 'aspects.move_friends.success' + flash[:notice] = I18n.t 'aspects.move_friends.success' redirect_to aspects_manage_path end From 08ddae089425b4c815ecccef243f7d40c162ee61 Mon Sep 17 00:00:00 2001 From: Kashif Rasul Date: Wed, 29 Sep 2010 16:54:33 +0200 Subject: [PATCH 374/449] Added devise Arabic locales and moved locale to correct folder. --- config/locales/devise/devise.ar.yml | 40 ++++++++++++++++++++++++++++ config/locales/{ => diaspora}/ar.yml | 35 ++++++++++++------------ 2 files changed, 57 insertions(+), 18 deletions(-) create mode 100644 config/locales/devise/devise.ar.yml rename config/locales/{ => diaspora}/ar.yml (88%) diff --git a/config/locales/devise/devise.ar.yml b/config/locales/devise/devise.ar.yml new file mode 100644 index 000000000..2b555cb5f --- /dev/null +++ b/config/locales/devise/devise.ar.yml @@ -0,0 +1,40 @@ +# Copyright (c) 2010, Diaspora Inc. This file is +# licensed under the Affero General Public License version 3. See +# the COPYRIGHT file. + +ar: + errors: + messages: + not_found: "لم يتم العثور على" + already_confirmed: "وقد أكد بالفعل" + not_locked: "لم يكن مغلق" + + devise: + failure: + unauthenticated: ".تحتاج إلى تسجيل الدخول أو قم بالتسجيل قبل الشروع في الاستمرار" + unconfirmed: ".لديك لتأكيد الحساب الخاص بك قبل المتابعة" + locked: ".مؤمن حسابك" + invalid: ".بريد إلكتروني غير صالح أو كلمة المرور" + invalid_token: ".المصادقة غير صالح الرمز المميز" + timeout: ".انتهت الدورة الخاصة بك ، الرجاء تسجيل الدخول مرة أخرى للمتابعة" + inactive: ".ولم يتم تفعيل حسابك بعد" + sessions: + signed_in: ".وقعت في بنجاح" + signed_out: ".بتسجيل الخروج بنجاح" + passwords: + send_instructions: ".سوف تتلقى رسالة بريد إلكتروني مع تعليمات حول كيفية إعادة تعيين كلمة السر الخاصة بك في بضع دقائق" + updated: ".تم تغيير كلمة السر الخاصة بك بنجاح. وقعت الآن دخولك" + confirmations: + send_instructions: ".سوف تتلقى رسالة بريد إلكتروني مع تعليمات حول كيفية تأكيد الحساب الخاص بك في بضع دقائق" + confirmed: ".وأكد حسابك بنجاح. وقعت الآن دخولك" + registrations: + signed_up: ".لقد قمت بتسجيل بنجاح. إذا مكن، وجهت رسالة تأكيد إلى البريد الإلكتروني الخاص بك" + updated: ".قمت بتحديث حسابك بنجاح" + destroyed: ".وداعا! تم إلغاء حسابك بنجاح. ونأمل أن نراكم مرة أخرى قريبا" + unlocks: + send_instructions: ".سوف تتلقى رسالة بريد إلكتروني مع تعليمات حول كيفية فتح حساب في بضع دقائق" + unlocked: ".كان حسابك مقفلة بنجاح. وقعت الآن دخولك" + mailer: + confirmation_instructions: "تأكيد تعليمات" + reset_password_instructions: "تعليمات إعادة تعيين كلمة المرور" + unlock_instructions: "فتح التعليمات" diff --git a/config/locales/ar.yml b/config/locales/diaspora/ar.yml similarity index 88% rename from config/locales/ar.yml rename to config/locales/diaspora/ar.yml index edc2024ae..0b273c879 100644 --- a/config/locales/ar.yml +++ b/config/locales/diaspora/ar.yml @@ -2,48 +2,47 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. -# Sample localization file for English. Add more files in this directory for other locales. -# See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. +# Sample localization file for Arabic. -en: - hello: "مرحبا العال" +ar: + hello: "مرحبا العالم" application: helper: - unknown_person: "غير معروف شخ" - new_requests: "طلبات جديد" + unknown_person: "غير معروف شخص" + new_requests: "طلبات جديدة" dashboards: helper: home: "منزل" error_messages: helper: - invalid_fields: "الحقول غير صالح" - correct_the_following_errors_and_try_again: "تصحيح الأخطاء التالية وحاول مرة أخرى" + invalid_fields: "الحقول غير صالحة" + correct_the_following_errors_and_try_again: ".تصحيح الأخطاء التالية وحاول مرة أخرى" people: helper: - results_for: "%{params} نتائ " - people_on_pod_are_aware_of: "الناس في جراب على عل " + results_for: "%{params} نتائج " + people_on_pod_are_aware_of: "الناس في جراب على علم " layouts: application: - edit_profile: "تعديل الملف الشخص" - logout: "خرو" + edit_profile: "تعديل الملف الشخصي" + logout: "خروج" shared: aspect_nav: - all_aspects: "جميع الجوان" + all_aspects: "جميع الجوانب" manage: "نجح" - manage_your_aspects: "إدارة جوانب الخا" + manage_your_aspects: "إدارة جوانب الخاص" sub_header: - all_aspects: "جميع الجوان" - manage_aspects: "إدارة الجوان" + all_aspects: "جميع الجوانب" + manage_aspects: "إدارة الجوانب" publisher: share: "تقاسم" aspect_friends: - add_friends: "أضف أصدقا" + add_friends: "أضف أصدقاء" albums: album: you: "أنت" new_album: create: "خلق" - add_a_new_album: "إضافة ألبوم جدي" + add_a_new_album: "إضافة ألبوم جديد" show: edit_album: "تعديل الألبو" albums: "البومات" From 330cf63599926a446c8d40fe739720067237ddde Mon Sep 17 00:00:00 2001 From: Kashif Rasul Date: Wed, 29 Sep 2010 17:13:27 +0200 Subject: [PATCH 375/449] Arabic locale fixes. --- config/locales/diaspora/ar.yml | 42 +++++++++++++++++----------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/config/locales/diaspora/ar.yml b/config/locales/diaspora/ar.yml index 0b273c879..f46434621 100644 --- a/config/locales/diaspora/ar.yml +++ b/config/locales/diaspora/ar.yml @@ -44,7 +44,7 @@ ar: create: "خلق" add_a_new_album: "إضافة ألبوم جديد" show: - edit_album: "تعديل الألبو" + edit_album: "تعديل الألبوم" albums: "البومات" updated: "تحديث" by: "بواسطة" @@ -52,66 +52,66 @@ ar: editing: "التحرير" updated: "تحديث" are_you_sure: "هل أنت متأكد؟" - delete_album: "حذف ألبو" + delete_album: "حذف ألبوم" cancel: "إلغاء" index: home: "منزل" - new_album: "ألبوم جدي" + new_album: "ألبوم جديد" create: - success: ".%{name} لقد قمت بإنشاء اسم الألبو" + success: ".ألبوما %{name} لقد قمت دعا" update: - success: ".تحرير بنجا %{name} الألبوم" - failure: ".%{name} فشلت في تحرير الألبو" + success: ".تحرير بنجاح %{name} الألبوم" + failure: ".%{name} فشلت في تحرير ألبوم" destroy: success: ".حذفها %{name} الألبوم" helper: - friends_albums: "أصدقاء البوما" - your_albums: "البومات الخا" + friends_albums: "أصدقاء البومات" + your_albums: "البومات الخاص" aspects: index: photos: "صور" show: photos: "صور" manage: - add_a_new_aspect: "أضف جانبا جديد" - add_a_new_friend: "إضافة صديق جدي" + add_a_new_aspect: "أضف جانبا جديدا" + add_a_new_friend: "إضافة صديق جديد" show: "عرض" - update_aspects: "تحديث الجوان" + update_aspects: "تحديث الجوانب" requests: "طلبات" - ignore_remove: "تجاهل/إزال" + ignore_remove: "تجاهل/إزالة" new_aspect: - add_a_new_aspect: "أضف جانبا جديد" + add_a_new_aspect: "أضف جانبا جديدا" create: "خلق" create: success: ".الذي يمكن أن نرى الجانب الجديد الخاص بك Diaspora انقر على علامة الجمع على الجانب الأيسر لنقو" failure: ".فشل إنشاء الجانب" destroy: - success: ".%{name} وقد نجحت في إزال" + success: ".%{name} وقد نجحت في إزالة" update: success: ".تحرير بنجاح ,%{name} ,وقد الجانب الخاص بك" move_friends: failure: ".%{real_name} فشل تحرير آسبكت لصدي" success: ".جوانب الموضوع بنجاح" move_friend: - failure: "%{inspect} لم تنج" + failure: "%{inspect} لم تنجح" success: ".أنت الآن عرض صديقك جانبا مختلفا من جوانب نفسك" helper: remove: "نزع" aspect_not_empty: "الجانب يست فارغ" users: edit: - editing_profile: "تحرير الملف الشخص" + editing_profile: "تحرير الملف الشخصي" profile: cancel: "إلغاء" - update_profile: "تحديث الملف الشخص" + update_profile: "تحديث الملف الشخصي" home: "منزل" - diaspora_username: "اسم المستخد DIASPORA" + diaspora_username: "اسم المستخدم DIASPORA" info: "معلومات" picture: "صورة" - editing_profile: "تحرير الملف الشخص" + editing_profile: "تحرير الملف الشخصي" albums: "البومات" - you_dont_have_any_photos: "ليس لديك أي صوا! نتقل إل" - page_to_upload_some: ".الصفحة لتحميل بع" + you_dont_have_any_photos: "ليس لديك أي صوا! نتقل إلى" + page_to_upload_some: ".الصفحة لتحميل بعض" comments: comment: ago: "منذ" From ff7c8c7a504272ab6588e98d79eaa8dede92456a Mon Sep 17 00:00:00 2001 From: Stig Johan Berggren Date: Wed, 29 Sep 2010 17:53:34 +0200 Subject: [PATCH 376/449] =?UTF-8?q?Added=20locale=20files=20for=20Norwegia?= =?UTF-8?q?n=20(bokm=C3=A5l)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Localization files for Norwegian bokmål (nm) inserted. They have been tested a little locally and do not produce any errors. --- config/locales/devise/devise.nb.yml | 40 ++++++ config/locales/diaspora/nb.yml | 207 ++++++++++++++++++++++++++++ 2 files changed, 247 insertions(+) create mode 100644 config/locales/devise/devise.nb.yml create mode 100644 config/locales/diaspora/nb.yml diff --git a/config/locales/devise/devise.nb.yml b/config/locales/devise/devise.nb.yml new file mode 100644 index 000000000..d1e8ca2f7 --- /dev/null +++ b/config/locales/devise/devise.nb.yml @@ -0,0 +1,40 @@ +# Copyright (c) 2010, Diaspora Inc. This file is +# licensed under the Affero General Public License version 3. See +# the COPYRIGHT file. + +no_NO: + errors: + messages: + not_found: "ble ikke funnet" + already_confirmed: "er allerede bekrefta" + not_locked: "er ikke låst" + + devise: + failure: + unauthenticated: "Du må logge inn eller lage en bruker før du kan fortsette." + unconfirmed: "Du må bekrefte brukeren din før du kan fortsette." + locked: "Brukeren din er låst." + invalid: "Ugyldig e-postadresse eller passord." + invalid_token: "Ugyldig authentication token." + timeout: "Økta har løpt ut, logg inn igjen for å fortsette." + inactive: "Brukeren din er ikke aktivert ennå." + sessions: + signed_in: "Innlogginga var vellykka." + signed_out: "Utlogginga var vellykka." + passwords: + send_instructions: "Du vil få en e-post med instrukser om hvordan du tilbakestiller passordet ditt om kort tid." + updated: "Passordet ditt er nå endra, og du har logga inn." + confirmations: + send_instructions: "Du vil få en e-post med instrukser om hvordan du bekrefter brukeren din om kort tid." + confirmed: "Brukeren din er nå bekrefta, og du er logga inn." + registrations: + signed_up: "Du har nå laga en bruker. Hvis du valgte å få en e-post med bekreftelse på dette, er den nå sendt." + updated: "Du har oppdatert brukeren din." + destroyed: "Ha det! Brukeren din er nå sagt opp. Vi håper å se deg igjen snart." + unlocks: + send_instructions: "Du vil få en e-post med instrukser om hvordan du låser opp brukeren din om kort tid." + unlocked: "Brukeren din er nå låst opp, og du er logga in." + mailer: + confirmation_instructions: "Instrukser for bekreftelse" + reset_password_instructions: "Instrukser for tilbakestilling av passord" + unlock_instructions: "Instrukser for å låse opp" diff --git a/config/locales/diaspora/nb.yml b/config/locales/diaspora/nb.yml new file mode 100644 index 000000000..6e2dc0ad3 --- /dev/null +++ b/config/locales/diaspora/nb.yml @@ -0,0 +1,207 @@ +# Copyright (c) 2010, Diaspora Inc. This file is +# licensed under the Affero General Public License version 3. See +# the COPYRIGHT file. + +# Sample localization file for English. Add more files in this directory for other locales. +# See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. + +en: + hello: "Hallo, verden!" + application: + helper: + unknown_person: "ukjent person" + new_requests: "nye forespørsler" + dashboards: + helper: + home: "hjem" + error_messages: + helper: + invalid_fields: "Ugyldige felter" + correct_the_following_errors_and_try_again: "Rett opp de følgende feilene og prøv igjen." + people: + helper: + results_for: " resultater for %{params}" + people_on_pod_are_aware_of: " folk i belgen er oppmerksomme på" + layouts: + application: + edit_profile: "endre profil" + logout: "logg ut" + shared: + aspect_nav: + all_aspects: "Alle aspekter" + manage: "Organisere" + manage_your_aspects: "Organiser aspektene dine" + sub_header: + all_aspects: "Alle aspekter" + manage_aspects: "Organiser aspekter" + publisher: + share: "Del" + aspect_friends: + add_friends: "legg til venner" + albums: + album: + you: "deg" + new_album: + create: "Opprett" + add_a_new_album: "Legg til et nytt album" + show: + edit_album: "Endre album" + albums: "album" + updated: "oppdatert" + by: "av" + edit: + editing: "Redigerer" + updated: "oppdatert" + are_you_sure: "Er du sikker?" + delete_album: "Slett album" + cancel: "Avbryt" + index: + home: "hjem" + new_album: "Nytt album" + create: + success: "Du har oppretta albumet %{name}." + update: + success: "Albumet %{name} er endra." + failure: "Greide ikke å endre albumet %{name}." + destroy: + success: "Albumet %{name} er sletta." + helper: + friends_albums: "Venners album" + your_albums: "Dine album" + aspects: + index: + photos: "bilder" + show: + photos: "bilder" + manage: + add_a_new_aspect: "Legg til et nytt aspekt" + add_a_new_friend: "Legg til en ny venn" + show: "Vis" + update_aspects: "Oppdater aspekter" + requests: "Forespørsler" + ignore_remove: "Ignorer/fjern" + new_aspect: + add_a_new_aspect: "Legg til et nytt aspekt" + create: "Opprett" + create: + success: "Klikk på plusstegnet på venstre side for å fortelle Diaspora hvem som kan se det nye aspektet ditt." + failure: "Greide ikke å opprette aspektet." + destroy: + success: "%{name} har blitt fjerna." + update: + success: "Aspektet ditt, %{name}, har blitt endra." + move_friends: + failure: "Greide ikke å endre aspektet for vennen %{real_name}." + success: "Aspektene har blitt endra." + move_friend: + failure: "virka ikke %{inspect}" + success: "Vennen din ser nå et annet aspekt av deg." + helper: + remove: "fjern" + aspect_not_empty: "Aspektet er ikke tomt" + users: + edit: + editing_profile: "Redigerer profil" + profile: + cancel: "Avbryt" + update_profile: "Oppdater profil" + home: "Hjem" + diaspora_username: "DIASPORA-BRUKERNAVN" + info: "Informasjon" + picture: "Bilde" + editing_profile: "Redigerer profil" + albums: "Album" + you_dont_have_any_photos: "Du har ikke noen bilder! Gå til" + page_to_upload_some: "for å laste opp noen." + comments: + comment: + ago: "sia" + new_comment: + comment: "Kommenter" + photos: + show: + prev: "forrige" + full_size: "full størrelse" + next: "neste" + edit_photo: "Rediger bilde" + delete_photo: "Slett bilde" + are_you_sure: "Er du sikker?" + comments: "kommentarer" + edit: + editing: "Redigerer" + are_you_sure: "Er du sikker?" + delete_photo: "Slett bilde" + photo: + show_comments: "vis kommentarer" + posted_a_new_photo_to: "la til ett nytt bilde i" + new: + new_photo: "Nytt bilde" + back_to_list: "Tilbake til lista" + post_it: "legg ut!" + create: + runtime_error: "Greide ikke å laste opp bildet. Er du sikker på at setebeltet er festa?" + integrity_error: "Greide ikke å laste opp bildet. Er du sikker på at det var et bilde?" + type_error: "Greide ikke å laste opp bildet. Er du sikker på at et bilde ble lagt til?" + update: + notice: "Bildet er oppdatert." + error: "Greide ikke å endre bildet." + destroy: + notice: "Bildet er sletta." + registrations: + new: + sign_up: "Registrer deg" + create: + success: "Du er nå med i Diaspora!" + status_messages: + new_status_message: + tell_me_something_good: "Fortell noe tøft" + oh_yeah: "Ja da!" + status_message: + show_comments: "vis kommentarer" + delete: "Slett" + are_you_sure: "Er du sikker?" + show: + status_message: "Statusmelding" + comments: "kommentarer" + are_you_sure: "Er du sikker?" + destroy: "Utslett" + view_all: "Vis alle" + message: "Melding" + owner: "Eier" + helper: + no_message_to_display: "Ingen melding å vise." + people: + person: + add_friend: "legg til venn" + pending_request: "venter på svar" + index: + add_friend: "legg til venn" + real_name: "ekte navn" + diaspora_handle: "diaspora-bruker" + thats_you: "det er deg!" + friend_request_pending: "ubesvart venneforespørsel" + you_have_a_friend_request_from_this_person: "du har en venneforespørsel fra denne personen" + new: + new_person: "Ny person" + back_to_list: "Tilbake til lista" + show: + last_seen: "sist sett: %{how_long_ago}" + friends_since: "venner sia: %{how_long_ago}" + save: "lagre" + are_you_sure: "Er du sikker?" + remove_friend: "fjern venn" + requests: + new_request: + add_a_new_friend_to: "Legg til en ny venn i" + enter_a_diaspora_username: "Skriv en Diaspora-bruker:" + your_diaspora_username_is: "Din Diaspora-bruker er: %{diaspora_handle}" + friends_username: "Brukeren til vennen" + destroy: + success: "Dere er nå venner." + error: "Velg et aspekt først!" + ignore: "Ignorerte venneforespørsel" + create: + error: "Fant ingen diasporabruker med denne e-posten!" + already_friends: "Du er allerede venn med %{destination_url}!" + success: "Du sendte en venneforespørsel til %{destination_url}." + horribly_wrong: "Noe gikk forferdelig galt." From e9521d71441801dca530b6fc88dfedc028f6d806 Mon Sep 17 00:00:00 2001 From: ilya Date: Wed, 29 Sep 2010 12:15:54 -0700 Subject: [PATCH 377/449] tiny commit to switch branches --- spec/lib/salmon_salmon_spec.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/spec/lib/salmon_salmon_spec.rb b/spec/lib/salmon_salmon_spec.rb index 3ea98afe0..116e0719d 100644 --- a/spec/lib/salmon_salmon_spec.rb +++ b/spec/lib/salmon_salmon_spec.rb @@ -7,6 +7,7 @@ require 'spec_helper' describe Salmon do let(:user){Factory.create :user} let(:user2) {Factory.create :user} + let(:user3) {Factory.create :user} let(:post){ user.post :status_message, :message => "hi", :to => user.aspect(:name => "sdg").id } let!(:created_salmon) {Salmon::SalmonSlap.create(user, post.to_diaspora_xml)} @@ -58,6 +59,10 @@ describe Salmon do it 'should parse out the iv' do parsed_salmon.iv.should == created_salmon.iv end + it 'should parse out the authors diaspora_handle' do + parsed_salmon.author_email.should == user.person.diaspora_handle + + end it 'contains the original data' do parsed_salmon.parsed_data.should == post.to_diaspora_xml @@ -91,10 +96,7 @@ describe Salmon do @parsed_salmon.parsed_data.should == xml end - it 'should parse out the authors diaspora_handle' do - @parsed_salmon.author_email.should == user.person.diaspora_handle - end it 'should reference a local author' do @parsed_salmon.author.should == user.person From e145cbab5b5864c562c6e3019352135be800e7db Mon Sep 17 00:00:00 2001 From: danielvincent Date: Wed, 29 Sep 2010 17:42:56 -0400 Subject: [PATCH 378/449] tar the app's source and throw it in the public folder on server boot. --- public/stylesheets/application.css | 15 +++++++++------ public/stylesheets/sass/application.sass | 14 +++++++++----- script/server | 3 +++ 3 files changed, 21 insertions(+), 11 deletions(-) diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index 27f5543f1..39427a4f4 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -353,8 +353,14 @@ input[type='text'], textarea { padding: 0.3em; display: block; width: 66%; - border-top: 1px solid #666666; - height: auto; } + border: 1px solid #cccccc; + height: auto; + border-radius: 5px; + -webkit-border-radius: 5px; + -moz-border-radius: 5px; + box-shadow: 0 1px 2px white; + -moz-box-shadow: 0 1px 2px white; + -webkit-box-shadow: 0 1px 2px white; } #submit_block { text-align: right; @@ -392,10 +398,7 @@ label { width: 600px; height: 42px; margin-top: 0; - margin-bottom: 0; - box-shadow: 0 1px 2px white; - -moz-box-shadow: 0 1px 2px white; - -webkit-box-shadow: 0 1px 2px white; } + margin-bottom: 0; } #publisher .button { margin-left: 100px; } #publisher img { diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass index a3873d4c8..225c5ca84 100644 --- a/public/stylesheets/sass/application.sass +++ b/public/stylesheets/sass/application.sass @@ -474,9 +474,17 @@ input[type='text'], textarea :padding 0.3em :display block :width 66% - :border-top 1px solid #666 + :border 1px solid #ccc :height auto + :border-radius 5px + :-webkit-border-radius 5px + :-moz-border-radius 5px + + :box-shadow 0 1px 2px #fff + :-moz-box-shadow 0 1px 2px #fff + :-webkit-box-shadow 0 1px 2px #fff + #submit_block :text :align right @@ -526,10 +534,6 @@ label :top 0 :bottom 0 - :box-shadow 0 1px 2px #fff - :-moz-box-shadow 0 1px 2px #fff - :-webkit-box-shadow 0 1px 2px #fff - .button :margin-left 100px diff --git a/script/server b/script/server index 3804ccad9..259ad06cb 100755 --- a/script/server +++ b/script/server @@ -7,6 +7,9 @@ then echo "Mongod not started" else mkdir -p -v log/thin/ + #force AGPL + tar cf ../_source.tar --exclude='*.yml' --exclude='public/uploads' * + mv ../_source.tar public/source.tar bundle exec ruby ./script/websocket_server.rb& bundle exec thin start $@ fi From a53d15f50abdb4c2082dab88b07ad05c63239068 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Wed, 29 Sep 2010 17:45:36 -0400 Subject: [PATCH 379/449] update gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index d02467332..bd8338dc5 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,4 @@ config/app_config.yml bin/* nbproject config/initializers/secret_token.rb +public/source.tar From f1f7ce338f13cfa13fa75d2b497aa1d2d284a4c0 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Thu, 30 Sep 2010 13:40:36 -0400 Subject: [PATCH 380/449] tar ignores files specified in .gitignore --- script/server | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/server b/script/server index 259ad06cb..da43895fd 100755 --- a/script/server +++ b/script/server @@ -8,7 +8,7 @@ then else mkdir -p -v log/thin/ #force AGPL - tar cf ../_source.tar --exclude='*.yml' --exclude='public/uploads' * + tar cf ../_source.tar -X .gitignore * mv ../_source.tar public/source.tar bundle exec ruby ./script/websocket_server.rb& bundle exec thin start $@ From b6a912dd02b827da26c2ae493b448328628396d0 Mon Sep 17 00:00:00 2001 From: ilya Date: Thu, 30 Sep 2010 15:17:53 -0700 Subject: [PATCH 381/449] slowly getting specs to pass on with the new api --- app/models/user.rb | 11 +++-- lib/diaspora/user/friending.rb | 4 +- lib/diaspora/user/receiving.rb | 2 +- lib/salmon/salmon.rb | 20 +-------- spec/lib/salmon_salmon_spec.rb | 69 ++++++++++++-------------------- spec/models/user/receive_spec.rb | 5 ++- 6 files changed, 39 insertions(+), 72 deletions(-) diff --git a/app/models/user.rb b/app/models/user.rb index ca248a8f2..0e19eb6af 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -170,8 +170,9 @@ class User end def push_to_people(post, people) + salmon = salmon(post) people.each{|person| - salmon(post, :to => person) + push_to_person( person, salmon.xml_for( person )) } end @@ -182,10 +183,8 @@ class User end - def salmon( post, opts = {} ) - salmon = Salmon::SalmonSlap.create(self, post.to_diaspora_xml) - push_to_person( opts[:to], salmon.to_xml) - salmon + def salmon( post ) + Salmon::SalmonSlap.create(self, post.to_diaspora_xml) end ######## Commenting ######## @@ -217,7 +216,7 @@ class User push_to_people comment, people_in_aspects(aspects_with_post(comment.post.id)) elsif owns? comment comment.save - salmon comment, :to => comment.post.person + push_to_people comment, [comment.post.person] end end diff --git a/lib/diaspora/user/friending.rb b/lib/diaspora/user/friending.rb index 0f6cc6c5c..36850c745 100644 --- a/lib/diaspora/user/friending.rb +++ b/lib/diaspora/user/friending.rb @@ -22,7 +22,7 @@ module Diaspora aspect.requests << request aspect.save - salmon request, :to => desired_friend + push_to_people request, [desired_friend] end request end @@ -80,7 +80,7 @@ module Diaspora def unfriend(bad_friend) Rails.logger.info("#{self.real_name} is unfriending #{bad_friend.inspect}") retraction = Retraction.for(self) - salmon( retraction, :to => bad_friend) + push_to_people retraction, [bad_friend] remove_friend(bad_friend) end diff --git a/lib/diaspora/user/receiving.rb b/lib/diaspora/user/receiving.rb index 671db1a59..fe6b7d8c8 100644 --- a/lib/diaspora/user/receiving.rb +++ b/lib/diaspora/user/receiving.rb @@ -3,7 +3,7 @@ module Diaspora module Receiving def receive_salmon ciphertext cleartext = decrypt( ciphertext) - salmon = Salmon::SalmonSlap.parse cleartext + salmon = Salmon::SalmonSlap.parse cleartext, self if salmon.verified_for_key?(salmon.author.public_key) Rails.logger.info("data in salmon: #{salmon.parsed_data}") self.receive(salmon.parsed_data) diff --git a/lib/salmon/salmon.rb b/lib/salmon/salmon.rb index bd2c0b1b9..5ce1156be 100644 --- a/lib/salmon/salmon.rb +++ b/lib/salmon/salmon.rb @@ -62,9 +62,7 @@ module Salmon ### Header ## decrypted_header = user.decrypt(doc.search('encrypted_header').text) - puts decrypted_header header_doc = Nokogiri::XML(decrypted_header) - puts header_doc.inspect slap.aes_key = header_doc.search('aes_key').text slap.iv = header_doc.search('iv').text @@ -88,20 +86,6 @@ module Salmon slap end - def to_xml - xml =< - - - #{@author.real_name} - acct:#{@author.diaspora_handle} - - #{@magic_sig.to_xml} - -ENTRY - - end - def xml_for person xml =< @@ -119,14 +103,14 @@ ENTRY def decrypted_header header =<
+ #{iv} #{aes_key} #{@author.real_name} acct:#{@author.diaspora_handle} -
+ HEADER end diff --git a/spec/lib/salmon_salmon_spec.rb b/spec/lib/salmon_salmon_spec.rb index 116e0719d..e10ad5b48 100644 --- a/spec/lib/salmon_salmon_spec.rb +++ b/spec/lib/salmon_salmon_spec.rb @@ -64,55 +64,38 @@ describe Salmon do end + describe '#author' do + before do + stub_success("tom@tom.joindiaspora.com") + end + + it 'should reference a local author' do + parsed_salmon.author.should == user.person + end + + it 'should reference a remote author' do + parsed_salmon.author_email = 'tom@tom.joindiaspora.com' + parsed_salmon.author.public_key.should_not be_nil + end + + it 'should fail to reference a nonexistent remote author' do + parsed_salmon.author_email = 'idsfug@difgubhpsduh.rgd' + proc { + Redfinger.stub(:finger).and_return(nil) #Redfinger returns nil when there is no profile + parsed_salmon.author.real_name}.should raise_error /No webfinger profile found/ + end + end + + it 'verifies the signature for the sender' do + parsed_salmon.verified_for_key?(user.public_key).should be true + end + it 'contains the original data' do parsed_salmon.parsed_data.should == post.to_diaspora_xml end end - context 'round trip' do - before do - @sent_salmon = Salmon::SalmonSlap.create(user, post.to_diaspora_xml) - @parsed_salmon = - stub_success("tom@tom.joindiaspora.com") - end - it 'should verify the signature on a roundtrip' do - - @sent_salmon.magic_sig.data.should == @parsed_salmon.magic_sig.data - - @sent_salmon.magic_sig.sig.should == @parsed_salmon.magic_sig.sig - @sent_salmon.magic_sig.signable_string.should == @parsed_salmon.magic_sig.signable_string - - @parsed_salmon.verified_for_key?(OpenSSL::PKey::RSA.new(user.exported_key)).should be true - @sent_salmon.verified_for_key?(OpenSSL::PKey::RSA.new(user.exported_key)).should be true - end - - it 'should return the data so it can be "received"' do - - xml = post.to_diaspora_xml - - @parsed_salmon.parsed_data.should == xml - end - - - - it 'should reference a local author' do - @parsed_salmon.author.should == user.person - end - - it 'should reference a remote author' do - @parsed_salmon.author_email = 'tom@tom.joindiaspora.com' - @parsed_salmon.author.public_key.should_not be_nil - end - - it 'should fail to reference a nonexistent remote author' do - @parsed_salmon.author_email = 'idsfug@difgubhpsduh.rgd' - proc { - Redfinger.stub(:finger).and_return(nil) #Redfinger returns nil when there is no profile - @parsed_salmon.author.real_name}.should raise_error /No webfinger profile found/ - end - - end end diff --git a/spec/models/user/receive_spec.rb b/spec/models/user/receive_spec.rb index 5bdddce67..f11de234f 100644 --- a/spec/models/user/receive_spec.rb +++ b/spec/models/user/receive_spec.rb @@ -173,11 +173,12 @@ describe User do describe 'salmon' do before do @post = @user.post :status_message, :message => "hello", :to => @aspect.id - @salmon = @user.salmon( @post, :to => @user2.person ) + @salmon = @user.salmon( @post ) end it 'should receive a salmon for a post' do - @user2.receive_salmon( @user2.person.encrypt(@salmon.to_xml) ) + puts @salmon.inspect + @user2.receive_salmon( @salmon.xml_for @user2.person ) @user2.visible_post_ids.include?(@post.id).should be true end end From 7dcde292e1da7b36b9b973b06d2f0723fbc221e0 Mon Sep 17 00:00:00 2001 From: ilya Date: Sat, 2 Oct 2010 12:34:16 -0700 Subject: [PATCH 382/449] user posting spec is now green, now stubbing on the apropriate method --- app/models/user.rb | 12 ++++++++++-- spec/models/user/posting_spec.rb | 6 +++--- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/app/models/user.rb b/app/models/user.rb index 0e19eb6af..a70594adc 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -166,13 +166,18 @@ class User aspect.save target_people = target_people | aspect.people } + push_to_people(post, target_people) end def push_to_people(post, people) + puts post.inspect + puts post.to_diaspora_xml + puts "Leaving push_to_people" salmon = salmon(post) people.each{|person| - push_to_person( person, salmon.xml_for( person )) + xml = salmon.xml_for person + push_to_person( person, xml) } end @@ -184,7 +189,10 @@ class User end def salmon( post ) - Salmon::SalmonSlap.create(self, post.to_diaspora_xml) + puts post.inspect + puts post.to_diaspora_xml + created_salmon = Salmon::SalmonSlap.create(self, post.to_diaspora_xml) + created_salmon end ######## Commenting ######## diff --git a/spec/models/user/posting_spec.rb b/spec/models/user/posting_spec.rb index d86433ad6..518c03d2d 100644 --- a/spec/models/user/posting_spec.rb +++ b/spec/models/user/posting_spec.rb @@ -71,19 +71,19 @@ describe User do describe '#push_to_aspects' do it 'should push a post to a aspect' do - user.should_receive(:salmon).twice + user.should_receive(:push_to_person).twice user.push_to_aspects(post, aspect.id) end it 'should push a post to all aspects' do - user.should_receive(:salmon).exactly(3).times + user.should_receive(:push_to_person).exactly(3).times user.push_to_aspects(post, :all) end end describe '#push_to_people' do it 'should push to people' do - user.should_receive(:salmon).twice + user.should_receive(:push_to_person).twice user.push_to_people(post, [user2.person, user3.person]) end end From 304e4ad32be9f765aa04c86d26e44be82cc6053d Mon Sep 17 00:00:00 2001 From: ilya Date: Sat, 2 Oct 2010 12:37:53 -0700 Subject: [PATCH 383/449] removed the puts --- app/models/user.rb | 5 ----- 1 file changed, 5 deletions(-) diff --git a/app/models/user.rb b/app/models/user.rb index a70594adc..1ec3c63e5 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -171,9 +171,6 @@ class User end def push_to_people(post, people) - puts post.inspect - puts post.to_diaspora_xml - puts "Leaving push_to_people" salmon = salmon(post) people.each{|person| xml = salmon.xml_for person @@ -189,8 +186,6 @@ class User end def salmon( post ) - puts post.inspect - puts post.to_diaspora_xml created_salmon = Salmon::SalmonSlap.create(self, post.to_diaspora_xml) created_salmon end From f9cecd9d895690431b2bfc988996b2fdb146ada6 Mon Sep 17 00:00:00 2001 From: ilya Date: Sat, 2 Oct 2010 13:03:11 -0700 Subject: [PATCH 384/449] specs are green --- lib/diaspora/user/receiving.rb | 5 ++-- spec/controllers/publics_controller_spec.rb | 33 +++++++++++---------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/lib/diaspora/user/receiving.rb b/lib/diaspora/user/receiving.rb index fe6b7d8c8..a16727c26 100644 --- a/lib/diaspora/user/receiving.rb +++ b/lib/diaspora/user/receiving.rb @@ -1,9 +1,8 @@ module Diaspora module UserModules module Receiving - def receive_salmon ciphertext - cleartext = decrypt( ciphertext) - salmon = Salmon::SalmonSlap.parse cleartext, self + def receive_salmon salmon_xml + salmon = Salmon::SalmonSlap.parse salmon_xml, self if salmon.verified_for_key?(salmon.author.public_key) Rails.logger.info("data in salmon: #{salmon.parsed_data}") self.receive(salmon.parsed_data) diff --git a/spec/controllers/publics_controller_spec.rb b/spec/controllers/publics_controller_spec.rb index 70d851a3e..83042ea55 100644 --- a/spec/controllers/publics_controller_spec.rb +++ b/spec/controllers/publics_controller_spec.rb @@ -5,16 +5,16 @@ require 'spec_helper' describe PublicsController do - render_views + render_views + let(:user) {Factory.create :user} before do - @user = Factory.create(:user) - sign_in :user, @user + sign_in :user, user end describe 'receive endpoint' do it 'should have a and endpoint and return a 200 on successful receipt of a request' do - post :receive, :id =>@user.person.id + post :receive, :id =>user.person.id response.code.should == '200' end @@ -22,14 +22,15 @@ describe PublicsController do user2 = Factory.create(:user) message = user2.build_post(:status_message, :message => "hi") - @user.reload - @user.visible_post_ids.include?(message.id).should be false - xml = @user.person.encrypt(user2.salmon(message, :to => @user.person).to_xml) + user.reload + user.visible_post_ids.include?(message.id).should be false + + xml = user2.salmon(message).xml_for(user.person) - post :receive, :id => @user.person.id, :xml => xml + post :receive, :id => user.person.id, :xml => xml - @user.reload - @user.visible_post_ids.include?(message.id).should be true + user.reload + user.visible_post_ids.include?(message.id).should be true end end @@ -47,9 +48,9 @@ describe PublicsController do @user3 = Factory.create(:user) - req = @user2.send_friend_request_to(@user.person, aspect) + req = @user2.send_friend_request_to(user.person, aspect) - @xml = @user.person.encrypt(@user2.salmon(req, :to => @user.person).to_xml) + @xml = @user2.salmon(req).xml_for(user.person) req.delete @user2.reload @@ -58,18 +59,18 @@ describe PublicsController do it 'should add the pending request to the right user if the target person exists locally' do @user2.delete - post :receive, :id => @user.person.id, :xml => @xml + post :receive, :id => user.person.id, :xml => @xml - assigns(:user).should eq(@user) + assigns(:user).should eq(user) end it 'should add the pending request to the right user if the target person does not exist locally' do Person.should_receive(:by_webfinger).with(@user2.person.diaspora_handle).and_return(@user2.person) @user2.person.delete @user2.delete - post :receive, :id => @user.person.id, :xml => @xml + post :receive, :id => user.person.id, :xml => @xml - assigns(:user).should eq(@user) + assigns(:user).should eq(user) end end end From 7b690f5dcbd0984a900de370aa5b2e52fdc515e0 Mon Sep 17 00:00:00 2001 From: ilya Date: Sat, 2 Oct 2010 13:20:23 -0700 Subject: [PATCH 385/449] slight publics controller spec refactor --- spec/controllers/publics_controller_spec.rb | 30 +++++++++------------ spec/models/user/receive_spec.rb | 1 - 2 files changed, 12 insertions(+), 19 deletions(-) diff --git a/spec/controllers/publics_controller_spec.rb b/spec/controllers/publics_controller_spec.rb index 83042ea55..d8d700bd8 100644 --- a/spec/controllers/publics_controller_spec.rb +++ b/spec/controllers/publics_controller_spec.rb @@ -7,6 +7,7 @@ require 'spec_helper' describe PublicsController do render_views let(:user) {Factory.create :user} + let(:user2){Factory.create :user} before do sign_in :user, user @@ -19,7 +20,6 @@ describe PublicsController do end it 'should accept a post from another node and save the information' do - user2 = Factory.create(:user) message = user2.build_post(:status_message, :message => "hi") user.reload @@ -42,33 +42,27 @@ describe PublicsController do end describe 'friend requests' do + let(:aspect2) {user2.aspect(:name => 'disciples')} + let!(:req) {user2.send_friend_request_to(user.person, aspect2)} + let!(:xml) {user2.salmon(req).xml_for(user.person)} before do - @user2 = Factory.create(:user) - aspect = @user2.aspect(:name => 'disciples') - - @user3 = Factory.create(:user) - - req = @user2.send_friend_request_to(user.person, aspect) - - @xml = @user2.salmon(req).xml_for(user.person) - req.delete - @user2.reload - @user2.pending_requests.count.should be 1 + user2.reload + user2.pending_requests.count.should be 1 end it 'should add the pending request to the right user if the target person exists locally' do - @user2.delete - post :receive, :id => user.person.id, :xml => @xml + user2.delete + post :receive, :id => user.person.id, :xml => xml assigns(:user).should eq(user) end it 'should add the pending request to the right user if the target person does not exist locally' do - Person.should_receive(:by_webfinger).with(@user2.person.diaspora_handle).and_return(@user2.person) - @user2.person.delete - @user2.delete - post :receive, :id => user.person.id, :xml => @xml + Person.should_receive(:by_webfinger).with(user2.person.diaspora_handle).and_return(user2.person) + user2.person.delete + user2.delete + post :receive, :id => user.person.id, :xml => xml assigns(:user).should eq(user) end diff --git a/spec/models/user/receive_spec.rb b/spec/models/user/receive_spec.rb index f11de234f..fce699cf6 100644 --- a/spec/models/user/receive_spec.rb +++ b/spec/models/user/receive_spec.rb @@ -177,7 +177,6 @@ describe User do end it 'should receive a salmon for a post' do - puts @salmon.inspect @user2.receive_salmon( @salmon.xml_for @user2.person ) @user2.visible_post_ids.include?(@post.id).should be true end From 88dafbf5cc97c1d994495b7030d5eef848f5fee6 Mon Sep 17 00:00:00 2001 From: ilya Date: Sat, 2 Oct 2010 13:29:36 -0700 Subject: [PATCH 386/449] changed deploy branch --- config/deploy_config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/deploy_config.yml b/config/deploy_config.yml index 6aacbf3ff..38e504a03 100644 --- a/config/deploy_config.yml +++ b/config/deploy_config.yml @@ -6,7 +6,7 @@ cross_server: deploy_to: '/usr/local/app/diaspora' user: 'root' repo: 'git://github.com/diaspora/diaspora.git' - branch: 'master' + branch: 'salmon_refactor' default_env: 'development' servers: tom: From 2cd8cf0621b0b830f02822f89886f53b70d2644a Mon Sep 17 00:00:00 2001 From: Raphael Date: Sat, 2 Oct 2010 20:29:35 -0400 Subject: [PATCH 387/449] Remove a bunch of deleted backer servers --- config/deploy_config.yml | 41 +++------------------------------------- 1 file changed, 3 insertions(+), 38 deletions(-) diff --git a/config/deploy_config.yml b/config/deploy_config.yml index 6aacbf3ff..a502bfffb 100644 --- a/config/deploy_config.yml +++ b/config/deploy_config.yml @@ -12,52 +12,17 @@ servers: tom: - url: 'tom.joindiaspora.com' backer: - - username: 'washington' - given_name: 'George' - family_name: 'Washington' - number: 0 - pin: 5072 - - username: 'adams' + - username: 'adams' given_name: 'John' family_name: 'Adams' number: 1 pin: 3742 - - username: 'jefferson' - given_name: 'Thomas' - family_name: 'Jefferson' - number: 2 - pin: 7782 - - username: 'madison' - given_name: 'James' - family_name: 'Madison' - number: 3 - pin: 2691 - - username: 'monroe' - given_name: 'James' - family_name: 'Monroe' - number: 4 - pin: 6133 - - username: 'quincyadams' - given_name: 'John Quincy' - family_name: 'Adams' - number: 5 - pin: 7558 - - username: 'jackson' + - username: 'jackson' given_name: 'Andrew' family_name: 'Jackson' number: 6 pin: 8670 - - username: 'buren' - given_name: 'Martin' - family_name: 'Van Buren' - number: 7 - pin: 1559 - - username: 'harrison' - given_name: 'William Henry' - family_name: 'Harrison' - number: 8 - pin: 5404 - - username: 'tyler' + - username: 'tyler' given_name: 'John' family_name: 'Tyler' number: 9 From dadacbd0925703404fcd70e93df56bc8a4fee6fb Mon Sep 17 00:00:00 2001 From: ilya Date: Sun, 3 Oct 2010 13:33:01 -0700 Subject: [PATCH 388/449] removed whitespace striping --- lib/salmon/salmon.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/salmon/salmon.rb b/lib/salmon/salmon.rb index 5ce1156be..9ed5567c5 100644 --- a/lib/salmon/salmon.rb +++ b/lib/salmon/salmon.rb @@ -90,7 +90,7 @@ module Salmon xml =< - #{person.encrypt(decrypted_header.rstrip)} + #{person.encrypt(decrypted_header)} #{@author.real_name} acct:#{@author.diaspora_handle} From 3eaf4e0ba1658d61c54a0f646650f3c649cbbe75 Mon Sep 17 00:00:00 2001 From: ilya Date: Sun, 3 Oct 2010 17:33:31 -0700 Subject: [PATCH 389/449] a couple of logger lines to help debug on remote --- lib/diaspora/user/receiving.rb | 1 + lib/encryptor.rb | 1 + lib/salmon/salmon.rb | 6 +++--- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/diaspora/user/receiving.rb b/lib/diaspora/user/receiving.rb index a16727c26..cf4015eeb 100644 --- a/lib/diaspora/user/receiving.rb +++ b/lib/diaspora/user/receiving.rb @@ -2,6 +2,7 @@ module Diaspora module UserModules module Receiving def receive_salmon salmon_xml + Rails.logger.info("#{self.real_name} got a salmon #{salmon_xml}") salmon = Salmon::SalmonSlap.parse salmon_xml, self if salmon.verified_for_key?(salmon.author.public_key) Rails.logger.info("data in salmon: #{salmon.parsed_data}") diff --git a/lib/encryptor.rb b/lib/encryptor.rb index e9c4936e1..232b10e0f 100644 --- a/lib/encryptor.rb +++ b/lib/encryptor.rb @@ -37,6 +37,7 @@ module Encryptor module Private def decrypt cipher_json + Rails.logger.info("#{self.real_name} is JSON parsing the #{ Base64.decode64 cipher_json} ") json = JSON.parse(Base64.decode64 cipher_json) aes_key = get_aes_key json['aes_key'] aes_decrypt(json['ciphertext'], aes_key) diff --git a/lib/salmon/salmon.rb b/lib/salmon/salmon.rb index 9ed5567c5..4258a8d88 100644 --- a/lib/salmon/salmon.rb +++ b/lib/salmon/salmon.rb @@ -62,9 +62,9 @@ module Salmon ### Header ## decrypted_header = user.decrypt(doc.search('encrypted_header').text) - header_doc = Nokogiri::XML(decrypted_header) - slap.aes_key = header_doc.search('aes_key').text - slap.iv = header_doc.search('iv').text + header_doc = Nokogiri::XML(decrypted_header) + slap.aes_key = header_doc.search('aes_key').text + slap.iv = header_doc.search('iv').text slap.magic_sig = MagicSigEnvelope.parse sig_doc From ce4f8cab8b6ea8298c133b83e1c4fb3db62749ec Mon Sep 17 00:00:00 2001 From: ilya Date: Sun, 3 Oct 2010 17:39:16 -0700 Subject: [PATCH 390/449] not encrypting the entire thing --- app/models/user.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/user.rb b/app/models/user.rb index 1ec3c63e5..2f63f4b5f 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -180,7 +180,7 @@ class User def push_to_person( person, xml ) Rails.logger.debug("Adding xml for #{self} to message queue to #{url}") - QUEUE.add_post_request( person.receive_url, person.encrypt(xml) ) + QUEUE.add_post_request( person.receive_url, xml ) QUEUE.process end From 0d2d5b65fb8df68fe18c0e1ee2f63fe37304cc48 Mon Sep 17 00:00:00 2001 From: ilya Date: Sun, 3 Oct 2010 18:08:18 -0700 Subject: [PATCH 391/449] removed the logging statements, now servers communicate sucessfully and only re-encrypt the header for people --- lib/diaspora/user/receiving.rb | 1 - lib/encryptor.rb | 1 - 2 files changed, 2 deletions(-) diff --git a/lib/diaspora/user/receiving.rb b/lib/diaspora/user/receiving.rb index cf4015eeb..a16727c26 100644 --- a/lib/diaspora/user/receiving.rb +++ b/lib/diaspora/user/receiving.rb @@ -2,7 +2,6 @@ module Diaspora module UserModules module Receiving def receive_salmon salmon_xml - Rails.logger.info("#{self.real_name} got a salmon #{salmon_xml}") salmon = Salmon::SalmonSlap.parse salmon_xml, self if salmon.verified_for_key?(salmon.author.public_key) Rails.logger.info("data in salmon: #{salmon.parsed_data}") diff --git a/lib/encryptor.rb b/lib/encryptor.rb index 232b10e0f..e9c4936e1 100644 --- a/lib/encryptor.rb +++ b/lib/encryptor.rb @@ -37,7 +37,6 @@ module Encryptor module Private def decrypt cipher_json - Rails.logger.info("#{self.real_name} is JSON parsing the #{ Base64.decode64 cipher_json} ") json = JSON.parse(Base64.decode64 cipher_json) aes_key = get_aes_key json['aes_key'] aes_decrypt(json['ciphertext'], aes_key) From a09a6d82b75f1571ce673a40920ab1479bca2b0f Mon Sep 17 00:00:00 2001 From: Maxwell Salzberg Date: Mon, 4 Oct 2010 09:45:12 -0700 Subject: [PATCH 392/449] updated bundler dependency to include newer ones --- Gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 16788eeb3..29ad0f73d 100644 --- a/Gemfile +++ b/Gemfile @@ -1,7 +1,7 @@ source 'http://rubygems.org' gem 'rails', '3.0.0' -gem 'bundler', '1.0.0' +gem 'bundler', '>= 1.0.0' #Security gem 'devise', :git => 'http://github.com/BadMinus/devise.git' From be909e27d6268e815a928ca46f19dd190252754d Mon Sep 17 00:00:00 2001 From: Raphael Date: Mon, 4 Oct 2010 14:49:27 -0400 Subject: [PATCH 393/449] Deleting adams --- config/deploy_config.yml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/config/deploy_config.yml b/config/deploy_config.yml index a502bfffb..c7477314a 100644 --- a/config/deploy_config.yml +++ b/config/deploy_config.yml @@ -12,17 +12,12 @@ servers: tom: - url: 'tom.joindiaspora.com' backer: - - username: 'adams' - given_name: 'John' - family_name: 'Adams' - number: 1 - pin: 3742 - - username: 'jackson' + - username: 'jackson' given_name: 'Andrew' family_name: 'Jackson' number: 6 pin: 8670 - - username: 'tyler' + - username: 'tyler' given_name: 'John' family_name: 'Tyler' number: 9 From 1fa732498bc4520a8d2e0454ffbc3b63288293e3 Mon Sep 17 00:00:00 2001 From: Raphael Date: Tue, 5 Oct 2010 11:55:47 -0700 Subject: [PATCH 394/449] Update sprinkle script --- config/sprinkle/packages/database.rb | 7 +++---- config/sprinkle/packages/ruby.rb | 12 ++++++------ 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/config/sprinkle/packages/database.rb b/config/sprinkle/packages/database.rb index 0c1b1ca50..ef290b424 100644 --- a/config/sprinkle/packages/database.rb +++ b/config/sprinkle/packages/database.rb @@ -9,10 +9,9 @@ #end package :mongodb, :provides => :database do - description 'Mongodb debian package.' - version '1.4.3' - - binary "http://downloads.mongodb.org/linux/mongodb-linux-x86_64-static-legacy-#{version}.tgz" do + description 'Mongodb binary.' + version '1.6.3' + binary "http://fastdl.mongodb.org/linux/mongodb-linux-x86_64-static-legacy-#{version}.tgz" do post :install, "ln -s -f /usr/local/bin/mongodb-linux-x86_64-static-#{version}/bin/mongod /usr/bin/mongod" end end diff --git a/config/sprinkle/packages/ruby.rb b/config/sprinkle/packages/ruby.rb index 947732a79..c29af29cf 100644 --- a/config/sprinkle/packages/ruby.rb +++ b/config/sprinkle/packages/ruby.rb @@ -6,9 +6,9 @@ package :ruby do description 'Ruby Virtual Machine' - version '1.8.7' - patchlevel '249' - source "ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-#{version}-p#{patchlevel}.tar.gz" # implicit :style => :gnu + version '1.9.2' + patchlevel '0' + source "ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-#{version}-p#{patchlevel}.tar.gz" requires :ruby_dependencies end @@ -23,21 +23,21 @@ package :rubygems do source "http://production.cf.rubygems.org/rubygems/rubygems-#{version}.tgz" do custom_install 'ruby setup.rb' end - run( "PATH=$PATH:/var/lib/gems/1.8/bin") + run( "PATH=$PATH:/var/lib/gems/1.9/bin") run( "export PATH") requires :ruby end package :bundler do description 'bundler' - version '0.9.26' + version '1.0.0' gem 'bundler' requires :rubygems end package :diaspora_dependencies do description 'random dependencies' - apt %w(libxslt1.1 libxslt1-dev libxml2 libgpgme11-dev imagemagick libmagick9-dev) + apt %w(libxslt1.1 libxslt1-dev libxml2 imagemagick libmagick9-dev) end #package :diaspora do # description 'Diaspora' From 82455981b8afae27b3d1b9499bfdf2e6de572a19 Mon Sep 17 00:00:00 2001 From: ilya Date: Tue, 5 Oct 2010 12:21:33 -0700 Subject: [PATCH 395/449] added fb_config to gitignore --- .gitignore | 1 + config/fb_config.yml.example | 4 ++++ 2 files changed, 5 insertions(+) create mode 100644 config/fb_config.yml.example diff --git a/.gitignore b/.gitignore index bd8338dc5..1fbfd2e04 100644 --- a/.gitignore +++ b/.gitignore @@ -19,3 +19,4 @@ bin/* nbproject config/initializers/secret_token.rb public/source.tar +config/fb_config.yml diff --git a/config/fb_config.yml.example b/config/fb_config.yml.example new file mode 100644 index 000000000..5bb145316 --- /dev/null +++ b/config/fb_config.yml.example @@ -0,0 +1,4 @@ +fb_api_key: {key} +fb_secret: {secret} +fb_app_id: {app_id} +host: http://localhost:3000/ From 85f71aa4aac76a24f1d97fa375588a05761d4871 Mon Sep 17 00:00:00 2001 From: ilya Date: Tue, 5 Oct 2010 12:38:20 -0700 Subject: [PATCH 396/449] added the deploy task to symlink the fb_config --- config/deploy.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/config/deploy.rb b/config/deploy.rb index 98d8971f7..66c642885 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -56,6 +56,11 @@ namespace :deploy do run "ln -s -f #{shared_path}/app_config.yml #{current_path}/config/app_config.yml" end + task :symlink_fb_config do + run "touch #{shared_path}/fb_config.yml" + run "ln -s -f #{shared_path}/fb_config.yml #{current_path}/config/fb_config.yml" + end + task :start do start_mongo start_thin @@ -152,4 +157,4 @@ namespace :db do end -after "deploy:symlink", "deploy:symlink_images", "deploy:symlink_bundle", 'deploy:symlink_config' +after "deploy:symlink", "deploy:symlink_images", "deploy:symlink_bundle", 'deploy:symlink_config', 'deploy:symlink_fb_config' From aed9125e93b6b43516a5f5c04173f28b3b721378 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Tue, 5 Oct 2010 12:41:41 -0700 Subject: [PATCH 397/449] more querying through the current_user in controllers --- Gemfile.lock | 2 +- app/controllers/photos_controller.rb | 3 ++- app/controllers/users_controller.rb | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 8534f580a..44d386e33 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -258,7 +258,7 @@ DEPENDENCIES autotest bson (= 1.0.7) bson_ext (= 1.0.7) - bundler (= 1.0.0) + bundler (>= 1.0.0) capybara (~> 0.3.9) carrierwave! cucumber-rails (= 0.3.2) diff --git a/app/controllers/photos_controller.rb b/app/controllers/photos_controller.rb index 4d865573c..dca510374 100644 --- a/app/controllers/photos_controller.rb +++ b/app/controllers/photos_controller.rb @@ -9,7 +9,8 @@ class PhotosController < ApplicationController respond_to :json, :only => :show def create - album = Album.find_by_id params[:album_id] + album = current_user.find_visible_post_by_id( params[:album_id] ) + begin ######################## dealing with local files ############# diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 1cc280577..3e6472786 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -13,7 +13,7 @@ class UsersController < ApplicationController @user = current_user @person = @user.person @profile = @user.person.profile - @photos = Photo.find_all_by_person_id(@person.id).paginate :page => params[:page], :order => 'created_at DESC' + @photos = current_user.visible_posts(:person_id => current_user.person.id, :_type => 'Photo').paginate :page => params[:page], :order => 'created_at DESC' @fb_access_url = MiniFB.oauth_url(FB_APP_ID, APP_CONFIG[:pod_url] + "services/create", :scope=>MiniFB.scopes.join(",")) From 63cb7dcbdd26f2f8564a930a285f8bd6950c1b09 Mon Sep 17 00:00:00 2001 From: ilya Date: Tue, 5 Oct 2010 13:00:42 -0700 Subject: [PATCH 398/449] Fb friends are displayed only once --- app/views/shared/_aspect_friends.haml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/views/shared/_aspect_friends.haml b/app/views/shared/_aspect_friends.haml index f8e635f8d..e24dc5537 100644 --- a/app/views/shared/_aspect_friends.haml +++ b/app/views/shared/_aspect_friends.haml @@ -6,11 +6,11 @@ = owner_image_link - for friend in @friends = person_image_link(friend) - - if @logged_in && (@aspect == :public) - %h3 Facebook Friends - - @fb_friends = MiniFB.get(@access_token, 'me', :type => "friends") - - @fb_friends[:data].each do |friend| - = image_tag( "http://graph.facebook.com/#{friend[:id]}/picture" ) + - if @logged_in && (@aspect == :public) + %h3 Facebook Friends + - @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) = link_to (image_tag('add_friend_button.png', :height => "50px", :width => "50px")), "#add_request_pane", :id => 'add_request_button' From 45d40f27d9772ae3085791554b7266c416c10db8 Mon Sep 17 00:00:00 2001 From: ilya Date: Tue, 5 Oct 2010 13:06:55 -0700 Subject: [PATCH 399/449] changed the deploy config back to master --- config/deploy_config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/deploy_config.yml b/config/deploy_config.yml index c53f90d60..c7477314a 100644 --- a/config/deploy_config.yml +++ b/config/deploy_config.yml @@ -6,7 +6,7 @@ cross_server: deploy_to: '/usr/local/app/diaspora' user: 'root' repo: 'git://github.com/diaspora/diaspora.git' - branch: 'salmon_refactor' + branch: 'master' default_env: 'development' servers: tom: From f3c34692d8afb4b8cc2e6dca152e7a1cdba830e3 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Tue, 5 Oct 2010 13:39:56 -0700 Subject: [PATCH 400/449] pubsub support --- app/controllers/publics_controller.rb | 6 ++++++ app/models/person.rb | 2 +- app/models/user.rb | 12 +++++++++--- config/routes.rb | 2 ++ lib/message_handler.rb | 7 +++++++ spec/lib/message_handler_spec.rb | 20 ++++++++++++++++++++ 6 files changed, 45 insertions(+), 4 deletions(-) diff --git a/app/controllers/publics_controller.rb b/app/controllers/publics_controller.rb index e3c90fc16..311fdf73f 100644 --- a/app/controllers/publics_controller.rb +++ b/app/controllers/publics_controller.rb @@ -28,6 +28,12 @@ class PublicsController < ApplicationController end end + def hub + if params['hub.mode'] == 'subscribe' || params['hub.mode'] == 'unsubscribe' + render :text => params['hub.challenge'], :status => 202, :layout => false + end + end + def receive render :nothing => true return unless params[:xml] diff --git a/app/models/person.rb b/app/models/person.rb index 28503e921..75bd2b39b 100644 --- a/app/models/person.rb +++ b/app/models/person.rb @@ -50,7 +50,7 @@ class Person end def public_url - "#{self.url}users/#{self.owner.username}/public" + "#{self.url}users/#{self.owner.username}/public.atom" end diff --git a/app/models/user.rb b/app/models/user.rb index 2f63f4b5f..91c82f101 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -167,6 +167,8 @@ class User target_people = target_people | aspect.people } + push_to_hub(post) if post.respond_to?(:public) && post.public + push_to_people(post, target_people) end @@ -179,10 +181,14 @@ class User end def push_to_person( person, xml ) - Rails.logger.debug("Adding xml for #{self} to message queue to #{url}") - QUEUE.add_post_request( person.receive_url, xml ) - QUEUE.process + Rails.logger.debug("Adding xml for #{self} to message queue to #{self.url}") + QUEUE.add_post_request( person.receive_url, xml ) + QUEUE.process + end + def push_to_hub(post) + Rails.logger.debug("Pushing update to pubsub server") + QUEUE.add_hub_notification(APP_CONFIG[:pubsub_server], self.public_url) end def salmon( post ) diff --git a/config/routes.rb b/config/routes.rb index 56ec559c9..16f6a9c98 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -43,6 +43,8 @@ Diaspora::Application.routes.draw do match 'webfinger', :to => 'publics#webfinger' match 'hcard/users/:id', :to => 'publics#hcard' + match 'hub', :to => 'publics#hub' + match '.well-known/host-meta',:to => 'publics#host_meta' match 'receive/users/:id', :to => 'publics#receive' match 'log', :to => "dev_utilities#log" diff --git a/lib/message_handler.rb b/lib/message_handler.rb index e6ce75ffc..c6d1f013c 100644 --- a/lib/message_handler.rb +++ b/lib/message_handler.rb @@ -20,6 +20,10 @@ class MessageHandler [*destinations].each{|dest| @queue.push(Message.new(:post, dest, :body => b))} end + def add_hub_notification(hub_url, feed_url) + @queue.push(Message.new(:hub_publish, hub_url, :body => feed_url)) + end + def process @queue.pop{ |query| case query.type @@ -29,6 +33,9 @@ class MessageHandler when :get http = EventMachine::HttpRequest.new(query.destination).get :timeout => TIMEOUT http.callback {process} + when :hub_publish + http = EventMachine::PubSubHubBub.new(query.destination).get :timeout => TIMEOUT + http.callback {process} else raise "message is not a type I know!" end diff --git a/spec/lib/message_handler_spec.rb b/spec/lib/message_handler_spec.rb index cb0592e9a..ddc822334 100644 --- a/spec/lib/message_handler_spec.rb +++ b/spec/lib/message_handler_spec.rb @@ -94,6 +94,26 @@ describe MessageHandler do end end + describe "Hub publish" do + it 'should correctly queue up a pubsubhubbub publish request' do + destination = "http://identi.ca/hub/" + feed_location = "http://google.com/" + + EventMachine.run { + @handler.add_hub_notification(destination, feed_location) + q = @handler.instance_variable_get(:@queue) + + message = "" + q.pop{|m| message = m} + + message.destination.should == destination + message.body.should == feed_location + + EventMachine.stop + } + end + end + describe "Mixed Queries" do it 'should process both POST and GET requests in the same queue' do From c284c9b07f88e915b7306ca02b16a529ac3ea410 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Tue, 5 Oct 2010 13:47:42 -0700 Subject: [PATCH 401/449] added public back into webfinger --- app/views/publics/webfinger.erb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/views/publics/webfinger.erb b/app/views/publics/webfinger.erb index 47b76e6e6..b689f2a54 100644 --- a/app/views/publics/webfinger.erb +++ b/app/views/publics/webfinger.erb @@ -5,5 +5,8 @@ + + +
From a9806ddad0f4ee928656ec53d47889dab1fae253 Mon Sep 17 00:00:00 2001 From: Alec Leamas Date: Tue, 5 Oct 2010 18:19:20 +0800 Subject: [PATCH 402/449] Fixing bad execute permissions on various *.html, *.js, *.css,*.png etc. --- public/javascripts/fancybox/jquery.easing-1.3.pack.js | 0 public/javascripts/fancybox/jquery.fancybox-1.3.1.css | 0 public/javascripts/fancybox/jquery.fancybox-1.3.1.js | 0 public/javascripts/fancybox/jquery.fancybox-1.3.1.pack.js | 0 public/javascripts/fancybox/jquery.mousewheel-3.0.2.pack.js | 0 public/javascripts/fileuploader.js | 0 public/javascripts/jquery.cycle/jquery.cycle.lite.min.js | 0 public/javascripts/jquery.infieldlabel.js | 0 public/javascripts/web_socket.js | 0 public/stylesheets/blueprint/src/grid.css | 0 public/stylesheets/blueprint/src/print.css | 0 public/stylesheets/blueprint/src/reset.css | 0 .../stylesheets/brandongrotesque_light/Brandon_light-webfont.svg | 0 public/stylesheets/brandongrotesque_light/demo.html | 0 public/stylesheets/brandongrotesque_light/stylesheet.css | 0 public/stylesheets/fileuploader.css | 0 16 files changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 public/javascripts/fancybox/jquery.easing-1.3.pack.js mode change 100755 => 100644 public/javascripts/fancybox/jquery.fancybox-1.3.1.css mode change 100755 => 100644 public/javascripts/fancybox/jquery.fancybox-1.3.1.js mode change 100755 => 100644 public/javascripts/fancybox/jquery.fancybox-1.3.1.pack.js mode change 100755 => 100644 public/javascripts/fancybox/jquery.mousewheel-3.0.2.pack.js mode change 100755 => 100644 public/javascripts/fileuploader.js mode change 100755 => 100644 public/javascripts/jquery.cycle/jquery.cycle.lite.min.js mode change 100755 => 100644 public/javascripts/jquery.infieldlabel.js mode change 100755 => 100644 public/javascripts/web_socket.js mode change 100755 => 100644 public/stylesheets/blueprint/src/grid.css mode change 100755 => 100644 public/stylesheets/blueprint/src/print.css mode change 100755 => 100644 public/stylesheets/blueprint/src/reset.css mode change 100755 => 100644 public/stylesheets/brandongrotesque_light/Brandon_light-webfont.svg mode change 100755 => 100644 public/stylesheets/brandongrotesque_light/demo.html mode change 100755 => 100644 public/stylesheets/brandongrotesque_light/stylesheet.css mode change 100755 => 100644 public/stylesheets/fileuploader.css diff --git a/public/javascripts/fancybox/jquery.easing-1.3.pack.js b/public/javascripts/fancybox/jquery.easing-1.3.pack.js old mode 100755 new mode 100644 diff --git a/public/javascripts/fancybox/jquery.fancybox-1.3.1.css b/public/javascripts/fancybox/jquery.fancybox-1.3.1.css old mode 100755 new mode 100644 diff --git a/public/javascripts/fancybox/jquery.fancybox-1.3.1.js b/public/javascripts/fancybox/jquery.fancybox-1.3.1.js old mode 100755 new mode 100644 diff --git a/public/javascripts/fancybox/jquery.fancybox-1.3.1.pack.js b/public/javascripts/fancybox/jquery.fancybox-1.3.1.pack.js old mode 100755 new mode 100644 diff --git a/public/javascripts/fancybox/jquery.mousewheel-3.0.2.pack.js b/public/javascripts/fancybox/jquery.mousewheel-3.0.2.pack.js old mode 100755 new mode 100644 diff --git a/public/javascripts/fileuploader.js b/public/javascripts/fileuploader.js old mode 100755 new mode 100644 diff --git a/public/javascripts/jquery.cycle/jquery.cycle.lite.min.js b/public/javascripts/jquery.cycle/jquery.cycle.lite.min.js old mode 100755 new mode 100644 diff --git a/public/javascripts/jquery.infieldlabel.js b/public/javascripts/jquery.infieldlabel.js old mode 100755 new mode 100644 diff --git a/public/javascripts/web_socket.js b/public/javascripts/web_socket.js old mode 100755 new mode 100644 diff --git a/public/stylesheets/blueprint/src/grid.css b/public/stylesheets/blueprint/src/grid.css old mode 100755 new mode 100644 diff --git a/public/stylesheets/blueprint/src/print.css b/public/stylesheets/blueprint/src/print.css old mode 100755 new mode 100644 diff --git a/public/stylesheets/blueprint/src/reset.css b/public/stylesheets/blueprint/src/reset.css old mode 100755 new mode 100644 diff --git a/public/stylesheets/brandongrotesque_light/Brandon_light-webfont.svg b/public/stylesheets/brandongrotesque_light/Brandon_light-webfont.svg old mode 100755 new mode 100644 diff --git a/public/stylesheets/brandongrotesque_light/demo.html b/public/stylesheets/brandongrotesque_light/demo.html old mode 100755 new mode 100644 diff --git a/public/stylesheets/brandongrotesque_light/stylesheet.css b/public/stylesheets/brandongrotesque_light/stylesheet.css old mode 100755 new mode 100644 diff --git a/public/stylesheets/fileuploader.css b/public/stylesheets/fileuploader.css old mode 100755 new mode 100644 From 8bea8a98b24100676e67c97030ee7e093d475124 Mon Sep 17 00:00:00 2001 From: Alec Leamas Date: Tue, 5 Oct 2010 23:58:28 +0800 Subject: [PATCH 403/449] Don't use any scratch dir, handle write-protected installation --- script/server | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/script/server b/script/server index da43895fd..c5357a32e 100755 --- a/script/server +++ b/script/server @@ -7,9 +7,13 @@ then echo "Mongod not started" else mkdir -p -v log/thin/ - #force AGPL - tar cf ../_source.tar -X .gitignore * - mv ../_source.tar public/source.tar + #force AGPL + test -w public -a ! -e public/source.tar && + tar cf public/source.tar --exclude='source.tar' -X .gitignore * + test -e public/source.tar || { + echo "Can't find, or even create, public/source.tar. Giving up" + exit 2 + } bundle exec ruby ./script/websocket_server.rb& bundle exec thin start $@ fi From 4a8a21b95f940158d658995d7f8f5a6a4adcbdfb Mon Sep 17 00:00:00 2001 From: danielvincent Date: Tue, 5 Oct 2010 16:28:01 -0700 Subject: [PATCH 404/449] public fix --- app/controllers/aspects_controller.rb | 2 +- lib/diaspora/ostatus_builder.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/aspects_controller.rb b/app/controllers/aspects_controller.rb index cf9cc1583..3b9180be8 100644 --- a/app/controllers/aspects_controller.rb +++ b/app/controllers/aspects_controller.rb @@ -52,7 +52,7 @@ class AspectsController < ApplicationController @fb_access_url = MiniFB.oauth_url(FB_APP_ID, APP_CONFIG[:pod_url] + "services/create", :scope=>MiniFB.scopes.join(",")) - @posts = current_user.visible_posts(:public => true).paginate :page => params[:page], :per_page => 15, :order => 'created_at DESC' + @posts = current_user.visible_posts(:person_id => current_user.person.id, :public => true).paginate :page => params[:page], :per_page => 15, :order => 'created_at DESC' respond_with @aspect end diff --git a/lib/diaspora/ostatus_builder.rb b/lib/diaspora/ostatus_builder.rb index 997e538f3..e0d24a055 100644 --- a/lib/diaspora/ostatus_builder.rb +++ b/lib/diaspora/ostatus_builder.rb @@ -57,7 +57,7 @@ module Diaspora end def create_body - @user.visible_posts(:public=>true).inject("") do |xml,curr| + @user.visible_posts(:person_id => @user.person.id, :public=>true).inject("") do |xml,curr| if curr.respond_to?(:to_activity) unless xml curr.to_activity From 11857a9308a1661a3da21ab218a12bf3aa7cfb64 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Tue, 5 Oct 2010 16:35:29 -0700 Subject: [PATCH 405/449] fixing id field in atom --- lib/diaspora/ostatus_builder.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/diaspora/ostatus_builder.rb b/lib/diaspora/ostatus_builder.rb index e0d24a055..fbf6563f9 100644 --- a/lib/diaspora/ostatus_builder.rb +++ b/lib/diaspora/ostatus_builder.rb @@ -28,8 +28,8 @@ module Diaspora Diaspora - #{@user.username}/public - Stream + #{@user.public_url} + #{@user.real_name}'s Public Feed its a stream #{Time.now.xmlschema} From 6723a511496674fb779296cdfbc62016100fa2bd Mon Sep 17 00:00:00 2001 From: danielvincent Date: Tue, 5 Oct 2010 16:40:50 -0700 Subject: [PATCH 406/449] correctly indent xml --- app/models/status_message.rb | 12 +++++----- lib/diaspora/ostatus_builder.rb | 40 ++++++++++++++++----------------- 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/app/models/status_message.rb b/app/models/status_message.rb index c616efc5e..327f74f64 100644 --- a/app/models/status_message.rb +++ b/app/models/status_message.rb @@ -13,12 +13,12 @@ class StatusMessage < Post def to_activity <<-XML - http://activitystrea.ms/schema/1.0/post - #{self.message} - - #{person.url}status_messages/#{self.id} - #{self.created_at.xmlschema} - #{self.updated_at.xmlschema} + http://activitystrea.ms/schema/1.0/post + #{self.message} + + #{person.url}status_messages/#{self.id} + #{self.created_at.xmlschema} + #{self.updated_at.xmlschema} XML end diff --git a/lib/diaspora/ostatus_builder.rb b/lib/diaspora/ostatus_builder.rb index fbf6563f9..60c90f704 100644 --- a/lib/diaspora/ostatus_builder.rb +++ b/lib/diaspora/ostatus_builder.rb @@ -24,35 +24,35 @@ module Diaspora end def create_headers - <<-XML.strip - - - Diaspora - #{@user.public_url} - #{@user.real_name}'s Public Feed - its a stream - #{Time.now.xmlschema} - - #{@user.real_name} - #{@user.public_url} - + <<-XML + + +Diaspora +#{@user.public_url} +#{@user.real_name}'s Public Feed +its a stream +#{Time.now.xmlschema} + + #{@user.real_name} + #{@user.public_url} + XML end def create_endpoints <<-XML - + XML end def create_subject <<-XML - - http://activitystrea.ms/schema/1.0/person - #{@user.public_url} - #{@user.real_name} - - + + http://activitystrea.ms/schema/1.0/person + #{@user.public_url} + #{@user.real_name} + + XML end @@ -70,7 +70,7 @@ module Diaspora def create_footer <<-XML - + XML end end From 09b861c7a33108b6d1a624eafefe15dcf235c2aa Mon Sep 17 00:00:00 2001 From: danielvincent Date: Tue, 5 Oct 2010 16:51:27 -0700 Subject: [PATCH 407/449] remove .atom from public url --- app/models/person.rb | 2 +- lib/diaspora/ostatus_builder.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/person.rb b/app/models/person.rb index 75bd2b39b..28503e921 100644 --- a/app/models/person.rb +++ b/app/models/person.rb @@ -50,7 +50,7 @@ class Person end def public_url - "#{self.url}users/#{self.owner.username}/public.atom" + "#{self.url}users/#{self.owner.username}/public" end diff --git a/lib/diaspora/ostatus_builder.rb b/lib/diaspora/ostatus_builder.rb index 60c90f704..74011e79a 100644 --- a/lib/diaspora/ostatus_builder.rb +++ b/lib/diaspora/ostatus_builder.rb @@ -28,7 +28,7 @@ module Diaspora Diaspora -#{@user.public_url} +#{@user.public_url}.atom #{@user.real_name}'s Public Feed its a stream #{Time.now.xmlschema} From e7c153df4ef1bd56966872572601fb919258217f Mon Sep 17 00:00:00 2001 From: UserAd Date: Thu, 30 Sep 2010 04:56:16 +0800 Subject: [PATCH 408/449] Add translation support in profile ('or' between buttons). Fix Russian locale --- app/views/users/_profile.haml | 2 +- config/locales/diaspora/en.yml | 1 + config/locales/diaspora/ru.yml | 10 +++++++--- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/app/views/users/_profile.haml b/app/views/users/_profile.haml index 2b26eead0..774f3a094 100644 --- a/app/views/users/_profile.haml +++ b/app/views/users/_profile.haml @@ -50,7 +50,7 @@ #submit_block = link_to t('.cancel'), root_path - or + = t('.or') = f.submit t('.update_profile') #content_bottom diff --git a/config/locales/diaspora/en.yml b/config/locales/diaspora/en.yml index 838339641..5595c4caa 100644 --- a/config/locales/diaspora/en.yml +++ b/config/locales/diaspora/en.yml @@ -113,6 +113,7 @@ en: albums: "Albums" you_dont_have_any_photos: "You don't have any photos! Go to the" page_to_upload_some: "page to upload some." + or: "or" comments: comment: ago: "ago" diff --git a/config/locales/diaspora/ru.yml b/config/locales/diaspora/ru.yml index daeb35915..c4c1f32cc 100644 --- a/config/locales/diaspora/ru.yml +++ b/config/locales/diaspora/ru.yml @@ -66,7 +66,10 @@ ru: add_a_new_aspect: "Добавить аспект" create: "Создать" create: - success:"Нажмите на плюс слева, для того, что-бы указать Diaspora тех, кто может видеть ваш новый аспект." + success:"Нажмите на плюс слева, для того, что-бы указать Diaspora тех, кто может видеть ваш новый аспект + helper: + remove: "Удалить" + aspect_not_empty: "Аспект не пуст" users: edit: editing_profile: "Редактирование профиля" @@ -79,8 +82,9 @@ ru: picture: "Аватар" editing_profile: "Редактирование профиля" albums: "Альбомы" - you_dont_have_any_photos: "У вас нет ни одной фотографии! Перейдите на " - page_to_upload_some: "страницу для загрузки." + you_dont_have_any_photos: "У вас нет ни одной фотографии! Перейдите в" + page_to_upload_some: "для загрузки." + or: "или" comments: comment: ago: "ранее" From 1d0a4579f6b64361e5921e74021ae80987f5baaf Mon Sep 17 00:00:00 2001 From: UserAd Date: Thu, 30 Sep 2010 05:17:33 +0800 Subject: [PATCH 409/449] Add missing localization for aspect managment --- config/locales/diaspora/ru.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/config/locales/diaspora/ru.yml b/config/locales/diaspora/ru.yml index c4c1f32cc..f432c82d6 100644 --- a/config/locales/diaspora/ru.yml +++ b/config/locales/diaspora/ru.yml @@ -146,3 +146,18 @@ ru: save: "сохранить" are_you_sure: "Вы уверены?" remove_friend: "удалить друга" + requests: + new_request: + add_a_new_friend_to: "добавить нового друга к" + enter_a_diaspora_username: "Введите имя пользователя Diaspora:" + your_diaspora_username_is: "Ваше имя пользователя Diaspora: %{diaspora_handle}" + friends_username: "Имя пользователя друга" + destroy: + success: "Теперь вы друзья." + error: "Выберите аспект!" + ignore: "Игнорированные запросы дружбы." + create: + error: "Для этого адреса не найдено семя Diaspora!" + already_friends: "Вы уже друзья с %{destination_url}!" + success: "Запрос на дружбу выслан к %{destination_url}." + horribly_wrong: "Что-то пошло совсем не так." From 37fb2bfd3222d065b8a43b8adb1436adc582faff Mon Sep 17 00:00:00 2001 From: Raphael Date: Tue, 5 Oct 2010 16:57:22 -0700 Subject: [PATCH 410/449] Don't require a facebook yml --- Gemfile.lock | 10 ---------- app/views/users/_services.haml | 25 +++++++++++++------------ config/environment.rb | 16 +++++++++------- 3 files changed, 22 insertions(+), 29 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 44d386e33..5ae63f097 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -116,7 +116,6 @@ GEM rack (>= 1.0.0) rack-test (>= 0.5.4) selenium-webdriver (>= 0.0.3) - columnize (0.3.1) crack (0.1.8) cucumber (0.9.0) builder (~> 2.1.2) @@ -152,7 +151,6 @@ GEM i18n (0.4.1) json (1.4.6) json_pure (1.4.6) - linecache (0.43) mail (2.2.6.1) activesupport (>= 2.3.6) mime-types @@ -201,7 +199,6 @@ GEM rake (>= 0.8.4) thor (~> 0.14.0) rake (0.8.7) - redgreen (1.2.2) rest-client (1.6.1) mime-types (>= 1.16) rspec (2.0.0.beta.22) @@ -217,11 +214,6 @@ GEM rspec-rails (2.0.0.beta.17) rspec (>= 2.0.0.beta.14) webrat (>= 0.7.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.28) ffi (>= 0.6.1) @@ -278,11 +270,9 @@ DEPENDENCIES pubsubhubbub rails (= 3.0.0) redfinger! - redgreen roxml! rspec (>= 2.0.0.beta.17) rspec-rails (= 2.0.0.beta.17) - ruby-debug sprinkle! thin webmock diff --git a/app/views/users/_services.haml b/app/views/users/_services.haml index f2d976a79..fd1894d11 100644 --- a/app/views/users/_services.haml +++ b/app/views/users/_services.haml @@ -5,19 +5,20 @@ %h2 Services -%h3 Facebook -%p - - if @logged_in - = connected_fb_as(@access_token) - - %p - - @fb_friends = MiniFB.get(@access_token, 'me', :type => "friends") - - @fb_friends[:data].each do |friend| - = image_tag( "http://graph.facebook.com/#{friend[:id]}/picture" ) +- if FACEBOOK + %h3 Facebook + %p + - if @logged_in + = connected_fb_as(@access_token) + + %p + - @fb_friends = MiniFB.get(@access_token, 'me', :type => "friends") + - @fb_friends[:data].each do |friend| + = image_tag( "http://graph.facebook.com/#{friend[:id]}/picture" ) - = 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 "Disconnect from Facebook", services_destroy_path + - else + = link_to "Connect to Facebook (DO NOT USE WITH A REAL ACCOUNT)", @fb_access_url #content_bottom .back diff --git a/config/environment.rb b/config/environment.rb index 6b960209f..7fff237bd 100644 --- a/config/environment.rb +++ b/config/environment.rb @@ -7,13 +7,15 @@ require File.expand_path('../application', __FILE__) Haml::Template.options[:format] = :html5 Haml::Template.options[:escape_html] = true -# Load facebook connection application credentials -fb_config = YAML::load(File.open(File.expand_path("./config/fb_config.yml"))) -FB_API_KEY = fb_config['fb_api_key'] -FB_SECRET = fb_config['fb_secret'] -FB_APP_ID = fb_config['fb_app_id'] -HOST = fb_config['host'] - +if File.exists?(File.expand_path("./config/fb_config.yml")) + # Load facebook connection application credentials + fb_config = YAML::load(File.open(File.expand_path("./config/fb_config.yml"))) + FB_API_KEY = fb_config['fb_api_key'] + FB_SECRET = fb_config['fb_secret'] + FB_APP_ID = fb_config['fb_app_id'] + HOST = fb_config['host'] + FACEBOOK = true +end # Initialize the rails application Diaspora::Application.initialize! From 830b3772d5499fe8a301dcfb3c2840e931223dbe Mon Sep 17 00:00:00 2001 From: danielvincent Date: Tue, 5 Oct 2010 16:59:55 -0700 Subject: [PATCH 411/449] self reference in atom --- app/models/status_message.rb | 3 ++- lib/diaspora/ostatus_builder.rb | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/models/status_message.rb b/app/models/status_message.rb index 327f74f64..b509bfe5a 100644 --- a/app/models/status_message.rb +++ b/app/models/status_message.rb @@ -13,12 +13,13 @@ class StatusMessage < Post def to_activity <<-XML - http://activitystrea.ms/schema/1.0/post #{self.message} #{person.url}status_messages/#{self.id} #{self.created_at.xmlschema} #{self.updated_at.xmlschema} + http://activitystrea.ms/schema/1.0/post + http://activitystrea.ms/schema/1.0/note XML end diff --git a/lib/diaspora/ostatus_builder.rb b/lib/diaspora/ostatus_builder.rb index 74011e79a..f75495ad2 100644 --- a/lib/diaspora/ostatus_builder.rb +++ b/lib/diaspora/ostatus_builder.rb @@ -42,6 +42,7 @@ module Diaspora def create_endpoints <<-XML + XML end From a2209d454bdefbbdef3e920651b6234dd7963a29 Mon Sep 17 00:00:00 2001 From: Raphael Date: Tue, 5 Oct 2010 17:01:23 -0700 Subject: [PATCH 412/449] Add a link to authoritative rebase instructions --- README.md | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index f21676bdd..57bb01c4e 100644 --- a/README.md +++ b/README.md @@ -18,13 +18,11 @@ instructions. You are welcome to contribute, add to and extend Diaspora however you see fit. We will do our best to incorporate everything that meets our guidelines. -We need you to fill out a -[contributor agreement form](https://spreadsheets.google.com/a/joindiaspora.com/viewform?formkey=dGI2cHA3ZnNHLTJvbm10LUhXRTJjR0E6MQ&theme=0AX42CRMsmRFbUy1iOGYwN2U2Mi1hNWU0LTRlNjEtYWMyOC1lZmU4ODg1ODc1ODI&ifq) -before we can accept your patches. The agreement gives Diaspora joint -ownership of the patch so the copyright isn't scattered. You can find it -[here](https://spreadsheets.google.com/a/joindiaspora.com/viewform?formkey=dGI2cHA3ZnNHLTJvbm10LUhXRTJjR0E6MQ&theme=0AX42CRMsmRFbUy1iOGYwN2U2Mi1hNWU0LTRlNjEtYWMyOC1lZmU4ODg1ODc1ODI&ifq). +Please do not rebase our tree into yours. +See [here](http://www.mail-archive.com/dri-devel@lists.sourceforge.net/msg39091.html) +for when to rebase. -All commits must be tested, and after each commit, all tests should be green +All commits must be tested, and all your tests should be green before a pull request is sent. Please write your tests in Rspec. GEMS: We would like to keep external dependencies unduplicated. We're using @@ -32,6 +30,12 @@ Nokogiri, Mongomapper, and EM::HttpRequest as much as possible. We have a few gems in the project we'd rather not use, but if you can, use dependencies we already have. +We need you to fill out a +[contributor agreement form](https://spreadsheets.google.com/a/joindiaspora.com/viewform?formkey=dGI2cHA3ZnNHLTJvbm10LUhXRTJjR0E6MQ&theme=0AX42CRMsmRFbUy1iOGYwN2U2Mi1hNWU0LTRlNjEtYWMyOC1lZmU4ODg1ODc1ODI&ifq) +before we can accept your patches. The agreement gives Diaspora joint +ownership of the patch so the copyright isn't scattered. You can find it +[here](https://spreadsheets.google.com/a/joindiaspora.com/viewform?formkey=dGI2cHA3ZnNHLTJvbm10LUhXRTJjR0E6MQ&theme=0AX42CRMsmRFbUy1iOGYwN2U2Mi1hNWU0LTRlNjEtYWMyOC1lZmU4ODg1ODc1ODI&ifq). + ## Resources We are maintaining a From c9d97d3233c54e26977c872556eec9065cc36dc0 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Tue, 5 Oct 2010 17:15:00 -0700 Subject: [PATCH 413/449] render public with correct mime type --- app/controllers/users_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 3e6472786..2cac200e2 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -36,7 +36,7 @@ class UsersController < ApplicationController director = Diaspora::Director.new ostatus_builder = Diaspora::OstatusBuilder.new(user) - render :xml => director.build(ostatus_builder) + render :xml => director.build(ostatus_builder), :content_type => 'application/atom+xml' else flash[:error] = "User #{params[:username]} does not exist!" redirect_to root_url From 85b384010e2d00c601b30b1979ea098333effa16 Mon Sep 17 00:00:00 2001 From: kook Date: Thu, 30 Sep 2010 06:23:11 +0200 Subject: [PATCH 414/449] exchange photos on adding new friend --- app/models/person.rb | 2 +- app/views/publics/hcard.erb | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/app/models/person.rb b/app/models/person.rb index 28503e921..a6d295529 100644 --- a/app/models/person.rb +++ b/app/models/person.rb @@ -110,7 +110,7 @@ class Person hcard = HCard.find profile.hcard.first[:href] new_person.url = hcard[:url] - new_person.profile = Profile.new(:first_name => hcard[:given_name], :last_name => hcard[:family_name]) + new_person.profile = Profile.new(:first_name => hcard[:given_name], :last_name => hcard[:family_name], :image_url => hcard[:photo]) if new_person.save new_person else diff --git a/app/views/publics/hcard.erb b/app/views/publics/hcard.erb index 9e3f27796..aadddc4e1 100644 --- a/app/views/publics/hcard.erb +++ b/app/views/publics/hcard.erb @@ -33,9 +33,15 @@ <%= @person.url%> +
+
Photo
+
+ <%= @person.profile.image_url%> +
+
Note
-
Diaspora is awesome! vi is better than emacs!
+
Diaspora is awesome! Emacs is better than vi!
From c01bbbb3e0b6be5d0cda7950e9948cbacb6de895 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Tue, 5 Oct 2010 17:24:00 -0700 Subject: [PATCH 415/449] capitalization error. should push to pubsub now. --- lib/message_handler.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/message_handler.rb b/lib/message_handler.rb index c6d1f013c..a8fd09fee 100644 --- a/lib/message_handler.rb +++ b/lib/message_handler.rb @@ -34,7 +34,7 @@ class MessageHandler http = EventMachine::HttpRequest.new(query.destination).get :timeout => TIMEOUT http.callback {process} when :hub_publish - http = EventMachine::PubSubHubBub.new(query.destination).get :timeout => TIMEOUT + http = EventMachine::PubSubHubbub.new(query.destination).get :timeout => TIMEOUT http.callback {process} else raise "message is not a type I know!" From 5847e7767d80a1ab59aa44a7a8c13f40aad9de65 Mon Sep 17 00:00:00 2001 From: Raphael Date: Tue, 5 Oct 2010 17:23:56 -0700 Subject: [PATCH 416/449] Add profile photo url to hcard parser --- app/views/publics/hcard.erb | 2 +- lib/hcard.rb | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/views/publics/hcard.erb b/app/views/publics/hcard.erb index aadddc4e1..17b0ebdb7 100644 --- a/app/views/publics/hcard.erb +++ b/app/views/publics/hcard.erb @@ -41,7 +41,7 @@
Note
-
Diaspora is awesome! Emacs is better than vi!
+
Diaspora is awesome! vi is better than emacs!
diff --git a/lib/hcard.rb b/lib/hcard.rb index 5640e711b..e6baa49fd 100644 --- a/lib/hcard.rb +++ b/lib/hcard.rb @@ -7,6 +7,7 @@ module HCard doc = Nokogiri::HTML(Net::HTTP.get URI.parse(url)) {:given_name => doc.css(".given_name").text, :family_name => doc.css(".family_name").text, - :url => doc.css("#pod_location").text} + :url => doc.css("#pod_location").text, + :photo => doc.css(".photo")} end end From 5074d2f8f2e678585cc59dcdc4a90e4527c5c3cc Mon Sep 17 00:00:00 2001 From: Daniele Di Sarli Date: Thu, 30 Sep 2010 01:42:57 +0800 Subject: [PATCH 417/449] Updated Italian translation --- config/locales/diaspora/it.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/config/locales/diaspora/it.yml b/config/locales/diaspora/it.yml index 24681fbe0..fe4b305cc 100644 --- a/config/locales/diaspora/it.yml +++ b/config/locales/diaspora/it.yml @@ -85,6 +85,7 @@ it: create: "Crea" create: success: "Clicca sul segno più nella parte sinistra per dire a Diaspora chi può vedere il tuo nuovo aspetto." + failure: "Creazione dell'aspetto fallita." destroy: success: "%{name} è stato rimosso con successo." update: From 0e8b84fb9658b444bf634e45b018bc0a69bf3bfb Mon Sep 17 00:00:00 2001 From: danielvincent Date: Tue, 5 Oct 2010 17:26:26 -0700 Subject: [PATCH 418/449] publish instead of get --- lib/message_handler.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/message_handler.rb b/lib/message_handler.rb index a8fd09fee..214d7f50a 100644 --- a/lib/message_handler.rb +++ b/lib/message_handler.rb @@ -34,7 +34,7 @@ class MessageHandler http = EventMachine::HttpRequest.new(query.destination).get :timeout => TIMEOUT http.callback {process} when :hub_publish - http = EventMachine::PubSubHubbub.new(query.destination).get :timeout => TIMEOUT + http = EventMachine::PubSubHubbub.new(query.destination).publish :timeout => TIMEOUT http.callback {process} else raise "message is not a type I know!" From 9eb8fe0c5a32b5037781f8a7b94d4f313f507c8b Mon Sep 17 00:00:00 2001 From: Stoyan Gaydarov Date: Mon, 4 Oct 2010 07:43:49 +0800 Subject: [PATCH 419/449] use the correct pod url in the user spec --- spec/models/user_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index 7d072bdd5..049115ff2 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -17,7 +17,7 @@ describe User do describe '#diaspora_handle' do it 'uses the pod config url to set the diaspora_handle' do - user.diaspora_handle.should == user.username + "@example.org" + user.diaspora_handle.should == user.username + "@" + APP_CONFIG[:terse_pod_url] end end From dbacff250a98539764296213d2794ac992c18418 Mon Sep 17 00:00:00 2001 From: Stoyan Gaydarov Date: Mon, 4 Oct 2010 07:51:19 +0800 Subject: [PATCH 420/449] added extra user spec --- spec/models/user_spec.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index 049115ff2..d21b1d57c 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -12,6 +12,10 @@ describe User do user = Factory.build(:user, :username => "ALLUPPERCASE") user.valid? user.username.should == "alluppercase" + + user = Factory.build(:user, :username => "someUPPERCASE") + user.valid? + user.username.should == "someuppercase" end end From 77d5b68e151e838d78a9f127b39cc323fb624ec4 Mon Sep 17 00:00:00 2001 From: Yaron Shahrabani Date: Tue, 28 Sep 2010 15:31:27 +0800 Subject: [PATCH 421/449] Fixed some typos --- config/locales/devise/devise.he.yml | 2 +- config/locales/diaspora/he.yml | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/config/locales/devise/devise.he.yml b/config/locales/devise/devise.he.yml index c33cfa678..997ab6df0 100644 --- a/config/locales/devise/devise.he.yml +++ b/config/locales/devise/devise.he.yml @@ -18,7 +18,7 @@ he: invalid: "הססמה או הדוא״ל שגויים." invalid_token: "אסימון האימות שגוי." timeout: "ההפעלה שלך פגה, נא להיכנס שוב כדי להמשיך." - inactive: "חשבונך לא הופעל עדין." + inactive: "חשבונך לא הופעל עדיין." sessions: signed_in: "נכנסת בהצלחה." signed_out: "יצאת בהצלחה." diff --git a/config/locales/diaspora/he.yml b/config/locales/diaspora/he.yml index 47f2a52c2..1105a3bcb 100644 --- a/config/locales/diaspora/he.yml +++ b/config/locales/diaspora/he.yml @@ -86,7 +86,7 @@ he: add_a_new_aspect: "הוספת היבט חדש" create: "יציאה" create: - success: "יש ללחוץ על סמל הפלוס שמימין כדי לומר לדיאספורה מי יעול לצפות בהיבט החדש שלך." + success: "יש ללחוץ על סמל הפלוס שמימין כדי לומר לדיאספורה מי יכול לצפות בהיבט החדש שלך." destroy: success: "%{name} הוסר בהצלחה." update: @@ -99,7 +99,7 @@ he: success: "כעת יופיע בפני החברים שלך היבט אחר שלך." helper: remove: "הסרה" - aspect_not_empty: "ההיסט אינו ריק" + aspect_not_empty: "ההיבט אינו ריק" users: edit: editing_profile: "עריכת הפרופיל" @@ -134,13 +134,13 @@ he: delete_photo: "מחיקת תמונה" photo: show_comments: "הצגת הערות" - posted_a_new_photo_to: "פורסמה תמונה חדשה אל" + posted_a_new_photo_to: "פורסמה תמונה חדשה באלבום" new: new_photo: "תמונה חדשה" back_to_list: "חזרה לרשימה" post_it: "פרסום!" create: - runtime_error: "העלאת התמונה נכשלה. האם החגורה שלך מהודקת?" + runtime_error: "העלאת התמונה נכשלה. הידקת את החגורה?" integrity_error: "העלאת התמונה נכשלה. האם זו באמת הייתה תמונה?" type_error: "העלאת התמונה נכשלה. האם באמת נוספה תמונה?" update: @@ -155,7 +155,7 @@ he: success: "הצטרפת לדיאספורה!" status_messages: new_status_message: - tell_me_something_good: "בא לי לשמוע סיפור טוב" + tell_me_something_good: "בא לי לשמוע סיפור נחמד" oh_yeah: "אחלה!" status_message: show_comments: "הצגת הערות" @@ -165,7 +165,7 @@ he: status_message: "הודעת מצב" comments: "הערות" are_you_sure: "בבטחה?" - destroy: "הריבה" + destroy: "הריסה" view_all: "צפייה בכול" message: "הודעה" owner: "בעלים" From 7c4feb74646c794a27edea5f2a99240b5ae10120 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Tue, 5 Oct 2010 17:34:03 -0700 Subject: [PATCH 422/449] better log message --- app/models/user.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/user.rb b/app/models/user.rb index 91c82f101..15c3515c2 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -187,7 +187,7 @@ class User end def push_to_hub(post) - Rails.logger.debug("Pushing update to pubsub server") + Rails.logger.debug("Pushing update to pubsub server #{APP_CONFIG[:pubsub_server]} with url #{self.public_url}") QUEUE.add_hub_notification(APP_CONFIG[:pubsub_server], self.public_url) end From d890b57b131d72393d5ec84635a7b72bf819d538 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Tue, 5 Oct 2010 17:45:35 -0700 Subject: [PATCH 423/449] temp logger message --- lib/message_handler.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/message_handler.rb b/lib/message_handler.rb index 214d7f50a..351ca99d6 100644 --- a/lib/message_handler.rb +++ b/lib/message_handler.rb @@ -35,7 +35,7 @@ class MessageHandler http.callback {process} when :hub_publish http = EventMachine::PubSubHubbub.new(query.destination).publish :timeout => TIMEOUT - http.callback {process} + http.callback {process; Rails.logger.debug(http.response)} else raise "message is not a type I know!" end From de9cdfbe7bcb0124437137943bb7d0cb60480c8c Mon Sep 17 00:00:00 2001 From: Raphael Date: Tue, 5 Oct 2010 17:46:14 -0700 Subject: [PATCH 424/449] Always set the FACEBOOK constant --- config/environment.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/config/environment.rb b/config/environment.rb index 7fff237bd..ddfc9c247 100644 --- a/config/environment.rb +++ b/config/environment.rb @@ -15,6 +15,8 @@ if File.exists?(File.expand_path("./config/fb_config.yml")) FB_APP_ID = fb_config['fb_app_id'] HOST = fb_config['host'] FACEBOOK = true +else + FACEBOOK = false end # Initialize the rails application Diaspora::Application.initialize! From d638bdb018047a168e6292f6813ba8b977f7444d Mon Sep 17 00:00:00 2001 From: maxwell Date: Tue, 5 Oct 2010 17:49:06 -0700 Subject: [PATCH 425/449] MS IZ password change field is now in edit profile --- Gemfile.lock | 12 +------- app/controllers/users_controller.rb | 17 +++++++++-- app/views/users/_profile.haml | 7 +++++ spec/controllers/users_controller_spec.rb | 35 +++++++++++++++++++++++ 4 files changed, 58 insertions(+), 13 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 8534f580a..5ae63f097 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -116,7 +116,6 @@ GEM rack (>= 1.0.0) rack-test (>= 0.5.4) selenium-webdriver (>= 0.0.3) - columnize (0.3.1) crack (0.1.8) cucumber (0.9.0) builder (~> 2.1.2) @@ -152,7 +151,6 @@ GEM i18n (0.4.1) json (1.4.6) json_pure (1.4.6) - linecache (0.43) mail (2.2.6.1) activesupport (>= 2.3.6) mime-types @@ -201,7 +199,6 @@ GEM rake (>= 0.8.4) thor (~> 0.14.0) rake (0.8.7) - redgreen (1.2.2) rest-client (1.6.1) mime-types (>= 1.16) rspec (2.0.0.beta.22) @@ -217,11 +214,6 @@ GEM rspec-rails (2.0.0.beta.17) rspec (>= 2.0.0.beta.14) webrat (>= 0.7.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.28) ffi (>= 0.6.1) @@ -258,7 +250,7 @@ DEPENDENCIES autotest bson (= 1.0.7) bson_ext (= 1.0.7) - bundler (= 1.0.0) + bundler (>= 1.0.0) capybara (~> 0.3.9) carrierwave! cucumber-rails (= 0.3.2) @@ -278,11 +270,9 @@ DEPENDENCIES pubsubhubbub rails (= 3.0.0) redfinger! - redgreen roxml! rspec (>= 2.0.0.beta.17) rspec-rails (= 2.0.0.beta.17) - ruby-debug sprinkle! thin webmock diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 1cc280577..4a68d8bd2 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -21,12 +21,25 @@ class UsersController < ApplicationController def update @user = current_user - data = clean_hash params[:user] prep_image_url(data) + + params[:user].delete(:password) if params[:user][:password].blank? + params[:user].delete(:password_confirmation) if params[:user][:password].blank? and params[:user][:password_confirmation].blank? + + if params[:user][:password] && params[:user][:password_confirmation] + if @user.update_attributes(:password => params[:user][:password], :password_confirmation => params[:user][:password_confirmation]) + flash[:notice] = "Password Changed" + else + flash[:error] = "Password Change Failed" + end + + end + @user.update_profile data - respond_with(@user, :location => root_url) + redirect_to edit_user_path(@user) + end def public diff --git a/app/views/users/_profile.haml b/app/views/users/_profile.haml index 2b26eead0..78304d183 100644 --- a/app/views/users/_profile.haml +++ b/app/views/users/_profile.haml @@ -47,6 +47,13 @@ %p = p.label :last_name = p.text_field :last_name, :value => @profile.last_name + %p + = f.label :password + = f.text_field :password + %p + = f.label :password_confirmation + = f.text_field :password_confirmation + #submit_block = link_to t('.cancel'), root_path diff --git a/spec/controllers/users_controller_spec.rb b/spec/controllers/users_controller_spec.rb index a050738e1..272775771 100644 --- a/spec/controllers/users_controller_spec.rb +++ b/spec/controllers/users_controller_spec.rb @@ -27,7 +27,42 @@ describe UsersController do @user.person.profile.image_url.should == image_url end + end + context 'should allow the user to update their password' do + it 'should change a users password ' do + old_password = @user.encrypted_password + + put("update", :id => @user.id, "user"=> {"password" => "foobaz", 'password_confirmation' => "foobaz","profile"=> + {"image_url" => "", + "last_name" => @user.person.profile.last_name, + "first_name" => @user.person.profile.first_name}}) + + @user.reload + @user.encrypted_password.should_not == old_password + end + + it 'should not change a password if they do not match' do + old_password = @user.encrypted_password + put("update", :id => @user.id, "user"=> {"password" => "foobarz", 'password_confirmation' => "not_the_same","profile"=> + {"image_url" => "", + "last_name" => @user.person.profile.last_name, + "first_name" => @user.person.profile.first_name}}) + @user.reload + @user.encrypted_password.should == old_password + end + + + it 'should not update if the password fields are left blank' do + + old_password = @user.encrypted_password + put("update", :id => @user.id, "user"=> {"password" => "", 'password_confirmation' => "","profile"=> + {"image_url" => "", + "last_name" => @user.person.profile.last_name, + "first_name" => @user.person.profile.first_name}}) + @user.reload + @user.encrypted_password.should == old_password + end end end end From a063207a0a7b64335d75102062c7b78533602445 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Tue, 5 Oct 2010 17:52:21 -0700 Subject: [PATCH 426/449] logger instead of debug --- lib/message_handler.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/message_handler.rb b/lib/message_handler.rb index 351ca99d6..a9dc79d17 100644 --- a/lib/message_handler.rb +++ b/lib/message_handler.rb @@ -35,7 +35,7 @@ class MessageHandler http.callback {process} when :hub_publish http = EventMachine::PubSubHubbub.new(query.destination).publish :timeout => TIMEOUT - http.callback {process; Rails.logger.debug(http.response)} + http.callback {Rails.logger.info(http.response); process} else raise "message is not a type I know!" end From cc01345eddf89c639e90869bc9d432e729a37e6a Mon Sep 17 00:00:00 2001 From: danielvincent Date: Tue, 5 Oct 2010 17:56:13 -0700 Subject: [PATCH 427/449] debug statements --- lib/message_handler.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/message_handler.rb b/lib/message_handler.rb index a9dc79d17..782402137 100644 --- a/lib/message_handler.rb +++ b/lib/message_handler.rb @@ -21,6 +21,7 @@ class MessageHandler end def add_hub_notification(hub_url, feed_url) + Rails.logger.info("in message handler") @queue.push(Message.new(:hub_publish, hub_url, :body => feed_url)) end @@ -35,7 +36,7 @@ class MessageHandler http.callback {process} when :hub_publish http = EventMachine::PubSubHubbub.new(query.destination).publish :timeout => TIMEOUT - http.callback {Rails.logger.info(http.response); process} + http.callback {Rails.logger.info("got into hub_publish"); process} else raise "message is not a type I know!" end From caffd8f9ff88ac1c40dc566e76e519563c63424b Mon Sep 17 00:00:00 2001 From: Raphael Date: Tue, 5 Oct 2010 17:58:48 -0700 Subject: [PATCH 428/449] Don't check for servers that aren't there --- config/deploy.rb | 2 +- config/deploy_config.yml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/config/deploy.rb b/config/deploy.rb index 66c642885..a4f139b9c 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -142,7 +142,7 @@ namespace :db do end task :backer_seed, :roles => :backer do - (0..10).each { |n| + (0..2).each { |n| run "curl -silent http://localhost/set_backer_number?number=#{n}", :only => {:number => n} } run "cd #{current_path} && bundle exec rake db:seed:backer --trace RAILS_ENV=#{rails_env}" diff --git a/config/deploy_config.yml b/config/deploy_config.yml index c7477314a..55aa00f6e 100644 --- a/config/deploy_config.yml +++ b/config/deploy_config.yml @@ -15,15 +15,15 @@ servers: - username: 'jackson' given_name: 'Andrew' family_name: 'Jackson' - number: 6 + number: 0 pin: 8670 - username: 'tyler' given_name: 'John' family_name: 'Tyler' - number: 9 + number: 1 pin: 6431 - username: 'polk' given_name: 'James K.' family_name: 'Polk' - number: 10 + number: 2 pin: 1957 From 57e47e5a68731d5a564d219411efbe85fe5ffcf2 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Tue, 5 Oct 2010 17:58:56 -0700 Subject: [PATCH 429/449] removed excess dumb. pubsub should work now --- lib/message_handler.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/message_handler.rb b/lib/message_handler.rb index 782402137..e3890d94f 100644 --- a/lib/message_handler.rb +++ b/lib/message_handler.rb @@ -21,7 +21,6 @@ class MessageHandler end def add_hub_notification(hub_url, feed_url) - Rails.logger.info("in message handler") @queue.push(Message.new(:hub_publish, hub_url, :body => feed_url)) end @@ -35,8 +34,8 @@ class MessageHandler http = EventMachine::HttpRequest.new(query.destination).get :timeout => TIMEOUT http.callback {process} when :hub_publish - http = EventMachine::PubSubHubbub.new(query.destination).publish :timeout => TIMEOUT - http.callback {Rails.logger.info("got into hub_publish"); process} + http = EventMachine::PubSubHubbub.new(query.destination).publish query.body, :timeout => TIMEOUT + http.callback {process} else raise "message is not a type I know!" end From 7f652eb81ca56357b6f67dd038e14b641f7b856d Mon Sep 17 00:00:00 2001 From: danielvincent Date: Tue, 5 Oct 2010 18:03:17 -0700 Subject: [PATCH 430/449] more logging --- lib/message_handler.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/message_handler.rb b/lib/message_handler.rb index e3890d94f..f4ad8d2a2 100644 --- a/lib/message_handler.rb +++ b/lib/message_handler.rb @@ -35,7 +35,7 @@ class MessageHandler http.callback {process} when :hub_publish http = EventMachine::PubSubHubbub.new(query.destination).publish query.body, :timeout => TIMEOUT - http.callback {process} + http.callback {Rails.logger.info("in publish"); Rails.logger.info(http.response) ;process} else raise "message is not a type I know!" end From fc31eb405dc0ff5b3f2cc056ab3c0c5a3203442b Mon Sep 17 00:00:00 2001 From: danielvincent Date: Tue, 5 Oct 2010 18:34:56 -0700 Subject: [PATCH 431/449] removing logging messages --- lib/message_handler.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/message_handler.rb b/lib/message_handler.rb index f4ad8d2a2..e3890d94f 100644 --- a/lib/message_handler.rb +++ b/lib/message_handler.rb @@ -35,7 +35,7 @@ class MessageHandler http.callback {process} when :hub_publish http = EventMachine::PubSubHubbub.new(query.destination).publish query.body, :timeout => TIMEOUT - http.callback {Rails.logger.info("in publish"); Rails.logger.info(http.response) ;process} + http.callback {process} else raise "message is not a type I know!" end From d519e46f4d39b80557750eb0e8be66b97b7f883e Mon Sep 17 00:00:00 2001 From: danielvincent Date: Tue, 5 Oct 2010 19:01:04 -0700 Subject: [PATCH 432/449] webfinger edit --- app/views/publics/webfinger.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/publics/webfinger.erb b/app/views/publics/webfinger.erb index b689f2a54..8c6d08657 100644 --- a/app/views/publics/webfinger.erb +++ b/app/views/publics/webfinger.erb @@ -6,7 +6,7 @@ - +
From dc88110716ed89621b5e3374359f54eda6080e52 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Tue, 5 Oct 2010 20:22:13 -0700 Subject: [PATCH 433/449] img tag in hcard --- Gemfile.lock | 10 ++++++++++ app/views/publics/hcard.erb | 2 +- lib/diaspora/ostatus_builder.rb | 2 +- lib/hcard.rb | 2 +- 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 5ae63f097..44d386e33 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -116,6 +116,7 @@ GEM rack (>= 1.0.0) rack-test (>= 0.5.4) selenium-webdriver (>= 0.0.3) + columnize (0.3.1) crack (0.1.8) cucumber (0.9.0) builder (~> 2.1.2) @@ -151,6 +152,7 @@ GEM i18n (0.4.1) json (1.4.6) json_pure (1.4.6) + linecache (0.43) mail (2.2.6.1) activesupport (>= 2.3.6) mime-types @@ -199,6 +201,7 @@ GEM rake (>= 0.8.4) thor (~> 0.14.0) rake (0.8.7) + redgreen (1.2.2) rest-client (1.6.1) mime-types (>= 1.16) rspec (2.0.0.beta.22) @@ -214,6 +217,11 @@ GEM rspec-rails (2.0.0.beta.17) rspec (>= 2.0.0.beta.14) webrat (>= 0.7.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.28) ffi (>= 0.6.1) @@ -270,9 +278,11 @@ DEPENDENCIES pubsubhubbub rails (= 3.0.0) redfinger! + redgreen roxml! rspec (>= 2.0.0.beta.17) rspec-rails (= 2.0.0.beta.17) + ruby-debug sprinkle! thin webmock diff --git a/app/views/publics/hcard.erb b/app/views/publics/hcard.erb index 17b0ebdb7..6b8ab3209 100644 --- a/app/views/publics/hcard.erb +++ b/app/views/publics/hcard.erb @@ -36,7 +36,7 @@
Photo
- <%= @person.profile.image_url%> +
diff --git a/lib/diaspora/ostatus_builder.rb b/lib/diaspora/ostatus_builder.rb index f75495ad2..e95604402 100644 --- a/lib/diaspora/ostatus_builder.rb +++ b/lib/diaspora/ostatus_builder.rb @@ -30,7 +30,7 @@ module Diaspora Diaspora #{@user.public_url}.atom #{@user.real_name}'s Public Feed -its a stream +Posts from Diaspora #{Time.now.xmlschema} #{@user.real_name} diff --git a/lib/hcard.rb b/lib/hcard.rb index e6baa49fd..d43326b56 100644 --- a/lib/hcard.rb +++ b/lib/hcard.rb @@ -8,6 +8,6 @@ module HCard {:given_name => doc.css(".given_name").text, :family_name => doc.css(".family_name").text, :url => doc.css("#pod_location").text, - :photo => doc.css(".photo")} + :photo => doc.css(".photo").src} end end From 91bbd607e6fcdae9cb7b03375bf429f745c53577 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Tue, 5 Oct 2010 20:27:33 -0700 Subject: [PATCH 434/449] user avatar in public feed activity:subject --- lib/diaspora/ostatus_builder.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/diaspora/ostatus_builder.rb b/lib/diaspora/ostatus_builder.rb index e95604402..c4a0466fc 100644 --- a/lib/diaspora/ostatus_builder.rb +++ b/lib/diaspora/ostatus_builder.rb @@ -53,6 +53,7 @@ module Diaspora #{@user.public_url} #{@user.real_name} + XML end From 982f51b9c79b229e8fc5450acfd1217d707409ca Mon Sep 17 00:00:00 2001 From: danielvincent Date: Tue, 5 Oct 2010 20:31:40 -0700 Subject: [PATCH 435/449] prepend pod_url to image paths --- app/views/publics/hcard.erb | 2 +- lib/diaspora/ostatus_builder.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/publics/hcard.erb b/app/views/publics/hcard.erb index 6b8ab3209..0cd7f4d02 100644 --- a/app/views/publics/hcard.erb +++ b/app/views/publics/hcard.erb @@ -36,7 +36,7 @@
Photo
- +
diff --git a/lib/diaspora/ostatus_builder.rb b/lib/diaspora/ostatus_builder.rb index c4a0466fc..ec5751659 100644 --- a/lib/diaspora/ostatus_builder.rb +++ b/lib/diaspora/ostatus_builder.rb @@ -53,7 +53,7 @@ module Diaspora #{@user.public_url} #{@user.real_name} - + XML end From 6b74053e068d0163ca253c1b11e6e1bbfbaf4677 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Tue, 5 Oct 2010 20:37:28 -0700 Subject: [PATCH 436/449] scratch that last commit --- app/views/publics/hcard.erb | 2 +- lib/diaspora/ostatus_builder.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/publics/hcard.erb b/app/views/publics/hcard.erb index 0cd7f4d02..6b8ab3209 100644 --- a/app/views/publics/hcard.erb +++ b/app/views/publics/hcard.erb @@ -36,7 +36,7 @@
Photo
- +
diff --git a/lib/diaspora/ostatus_builder.rb b/lib/diaspora/ostatus_builder.rb index ec5751659..92e12122a 100644 --- a/lib/diaspora/ostatus_builder.rb +++ b/lib/diaspora/ostatus_builder.rb @@ -53,7 +53,7 @@ module Diaspora #{@user.public_url} #{@user.real_name} - + XML end From 66b356b5fe2aa815159096d9faee3161c1c32279 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Wed, 6 Oct 2010 18:13:53 -0700 Subject: [PATCH 437/449] moved public route --- app/models/person.rb | 2 +- config/routes.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/person.rb b/app/models/person.rb index a6d295529..e568aee17 100644 --- a/app/models/person.rb +++ b/app/models/person.rb @@ -50,7 +50,7 @@ class Person end def public_url - "#{self.url}users/#{self.owner.username}/public" + "#{self.url}users/#{self.owner.username}" end diff --git a/config/routes.rb b/config/routes.rb index 16f6a9c98..b6e8a293e 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -11,7 +11,7 @@ Diaspora::Application.routes.draw do resources :albums # added public route to user - match 'users/:username/public', :to => 'users#public' + match 'users/:username', :to => 'users#public' resources :users, :except => [:create, :new, :show] match 'aspects/move_friends', :to => 'aspects#move_friends', :as => 'move_friends' From c68a0266583d1f650a131de29635680be1fb239c Mon Sep 17 00:00:00 2001 From: maxwell Date: Wed, 6 Oct 2010 18:19:58 -0700 Subject: [PATCH 438/449] MS changed the profile edit field to be private --- app/views/users/_profile.haml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/users/_profile.haml b/app/views/users/_profile.haml index 8cffa53cb..cef161127 100644 --- a/app/views/users/_profile.haml +++ b/app/views/users/_profile.haml @@ -49,10 +49,10 @@ = p.text_field :last_name, :value => @profile.last_name %p = f.label :password - = f.text_field :password + = f.password_field :password %p = f.label :password_confirmation - = f.text_field :password_confirmation + = f.password_field :password_confirmation #submit_block From ee4c197b897b9fbcce28b8d1b055c12a8cf8853b Mon Sep 17 00:00:00 2001 From: danielvincent Date: Wed, 6 Oct 2010 18:32:56 -0700 Subject: [PATCH 439/449] fixed hcard finder on image --- lib/hcard.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/hcard.rb b/lib/hcard.rb index d43326b56..041f4d384 100644 --- a/lib/hcard.rb +++ b/lib/hcard.rb @@ -8,6 +8,6 @@ module HCard {:given_name => doc.css(".given_name").text, :family_name => doc.css(".family_name").text, :url => doc.css("#pod_location").text, - :photo => doc.css(".photo").src} + :photo => doc.css(".photo[src]").text} end end From 0fb091ebbc14c6232ccaef8df4597f574c69f599 Mon Sep 17 00:00:00 2001 From: maxwell Date: Wed, 6 Oct 2010 18:38:37 -0700 Subject: [PATCH 440/449] MS pretty sure we dont need to get the oauth path every time we load the public aspect... --- app/controllers/aspects_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/aspects_controller.rb b/app/controllers/aspects_controller.rb index 3b9180be8..3d750d41f 100644 --- a/app/controllers/aspects_controller.rb +++ b/app/controllers/aspects_controller.rb @@ -49,8 +49,8 @@ class AspectsController < ApplicationController end def public - @fb_access_url = MiniFB.oauth_url(FB_APP_ID, APP_CONFIG[:pod_url] + "services/create", - :scope=>MiniFB.scopes.join(",")) + # @fb_access_url = MiniFB.oauth_url(FB_APP_ID, APP_CONFIG[:pod_url] + "services/create", + # :scope=>MiniFB.scopes.join(",")) @posts = current_user.visible_posts(:person_id => current_user.person.id, :public => true).paginate :page => params[:page], :per_page => 15, :order => 'created_at DESC' From 131e905322e3fe96b8721e91157e5a0987db648d Mon Sep 17 00:00:00 2001 From: ilya Date: Wed, 6 Oct 2010 19:05:43 -0700 Subject: [PATCH 441/449] fixed the public route --- app/models/person.rb | 2 +- config/routes.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/person.rb b/app/models/person.rb index e568aee17..8d1fee5d5 100644 --- a/app/models/person.rb +++ b/app/models/person.rb @@ -50,7 +50,7 @@ class Person end def public_url - "#{self.url}users/#{self.owner.username}" + "#{self.url}public/#{self.owner.username}" end diff --git a/config/routes.rb b/config/routes.rb index b6e8a293e..2827c4cc7 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -11,7 +11,7 @@ Diaspora::Application.routes.draw do resources :albums # added public route to user - match 'users/:username', :to => 'users#public' + match 'public/:username', :to => 'users#public' resources :users, :except => [:create, :new, :show] match 'aspects/move_friends', :to => 'aspects#move_friends', :as => 'move_friends' From bb6866fa0f8df2305a8afaff61d4bf89ee2b1e75 Mon Sep 17 00:00:00 2001 From: ilya Date: Wed, 6 Oct 2010 23:20:28 -0700 Subject: [PATCH 442/449] removed depricated non-encrypted author info fields from salmon --- lib/salmon/salmon.rb | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/lib/salmon/salmon.rb b/lib/salmon/salmon.rb index 4258a8d88..d9352ef41 100644 --- a/lib/salmon/salmon.rb +++ b/lib/salmon/salmon.rb @@ -63,6 +63,7 @@ module Salmon ### Header ## decrypted_header = user.decrypt(doc.search('encrypted_header').text) header_doc = Nokogiri::XML(decrypted_header) + slap.author_email= header_doc.search('uri').text.split("acct:").last slap.aes_key = header_doc.search('aes_key').text slap.iv = header_doc.search('iv').text @@ -81,8 +82,6 @@ module Salmon raise ArgumentError, "Magic Signature data must be signed with RSA-SHA256, was #{slap.magic_sig.alg}" unless 'RSA-SHA256' == slap.magic_sig.alg - uri = doc.search('uri').text - slap.author_email = uri.split("acct:").last slap end @@ -91,10 +90,6 @@ module Salmon #{person.encrypt(decrypted_header)} - - #{@author.real_name} - acct:#{@author.diaspora_handle} - #{@magic_sig.to_xml} ENTRY From e9252e8aec9b121843818dce5f94a875a670856a Mon Sep 17 00:00:00 2001 From: Alec Leamas Date: Thu, 7 Oct 2010 14:59:13 +0200 Subject: [PATCH 443/449] After applying known rules in diaspora-bundle.spec, perm-fix patch + *.png --- public/javascripts/fancybox/blank.gif | Bin public/javascripts/fancybox/fancy_close.png | Bin public/javascripts/fancybox/fancy_loading.png | Bin public/javascripts/fancybox/fancy_nav_left.png | Bin public/javascripts/fancybox/fancy_nav_right.png | Bin public/javascripts/fancybox/fancy_shadow_e.png | Bin public/javascripts/fancybox/fancy_shadow_n.png | Bin public/javascripts/fancybox/fancy_shadow_ne.png | Bin public/javascripts/fancybox/fancy_shadow_nw.png | Bin public/javascripts/fancybox/fancy_shadow_s.png | Bin public/javascripts/fancybox/fancy_shadow_se.png | Bin public/javascripts/fancybox/fancy_shadow_sw.png | Bin public/javascripts/fancybox/fancy_shadow_w.png | Bin public/javascripts/fancybox/fancy_title_left.png | Bin public/javascripts/fancybox/fancy_title_main.png | Bin public/javascripts/fancybox/fancy_title_over.png | Bin public/javascripts/fancybox/fancy_title_right.png | Bin public/javascripts/fancybox/fancybox-x.png | Bin public/javascripts/fancybox/fancybox-y.png | Bin public/javascripts/fancybox/fancybox.png | Bin .../jquery.cycle/src/jquery.cycle.lite.js | 0 .../blueprint/plugins/buttons/icons/cross.png | Bin .../blueprint/plugins/buttons/icons/key.png | Bin .../blueprint/plugins/buttons/icons/tick.png | Bin .../Brandon_light-webfont.eot | Bin .../Brandon_light-webfont.ttf | Bin .../Brandon_light-webfont.woff | Bin .../Extras/alt_base64_stylesheet.css | 0 public/stylesheets/loading.gif | Bin 29 files changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 public/javascripts/fancybox/blank.gif mode change 100755 => 100644 public/javascripts/fancybox/fancy_close.png mode change 100755 => 100644 public/javascripts/fancybox/fancy_loading.png mode change 100755 => 100644 public/javascripts/fancybox/fancy_nav_left.png mode change 100755 => 100644 public/javascripts/fancybox/fancy_nav_right.png mode change 100755 => 100644 public/javascripts/fancybox/fancy_shadow_e.png mode change 100755 => 100644 public/javascripts/fancybox/fancy_shadow_n.png mode change 100755 => 100644 public/javascripts/fancybox/fancy_shadow_ne.png mode change 100755 => 100644 public/javascripts/fancybox/fancy_shadow_nw.png mode change 100755 => 100644 public/javascripts/fancybox/fancy_shadow_s.png mode change 100755 => 100644 public/javascripts/fancybox/fancy_shadow_se.png mode change 100755 => 100644 public/javascripts/fancybox/fancy_shadow_sw.png mode change 100755 => 100644 public/javascripts/fancybox/fancy_shadow_w.png mode change 100755 => 100644 public/javascripts/fancybox/fancy_title_left.png mode change 100755 => 100644 public/javascripts/fancybox/fancy_title_main.png mode change 100755 => 100644 public/javascripts/fancybox/fancy_title_over.png mode change 100755 => 100644 public/javascripts/fancybox/fancy_title_right.png mode change 100755 => 100644 public/javascripts/fancybox/fancybox-x.png mode change 100755 => 100644 public/javascripts/fancybox/fancybox-y.png mode change 100755 => 100644 public/javascripts/fancybox/fancybox.png mode change 100755 => 100644 public/javascripts/jquery.cycle/src/jquery.cycle.lite.js mode change 100755 => 100644 public/stylesheets/blueprint/plugins/buttons/icons/cross.png mode change 100755 => 100644 public/stylesheets/blueprint/plugins/buttons/icons/key.png mode change 100755 => 100644 public/stylesheets/blueprint/plugins/buttons/icons/tick.png mode change 100755 => 100644 public/stylesheets/brandongrotesque_light/Brandon_light-webfont.eot mode change 100755 => 100644 public/stylesheets/brandongrotesque_light/Brandon_light-webfont.ttf mode change 100755 => 100644 public/stylesheets/brandongrotesque_light/Brandon_light-webfont.woff mode change 100755 => 100644 public/stylesheets/brandongrotesque_light/Extras/alt_base64_stylesheet.css mode change 100755 => 100644 public/stylesheets/loading.gif diff --git a/public/javascripts/fancybox/blank.gif b/public/javascripts/fancybox/blank.gif old mode 100755 new mode 100644 diff --git a/public/javascripts/fancybox/fancy_close.png b/public/javascripts/fancybox/fancy_close.png old mode 100755 new mode 100644 diff --git a/public/javascripts/fancybox/fancy_loading.png b/public/javascripts/fancybox/fancy_loading.png old mode 100755 new mode 100644 diff --git a/public/javascripts/fancybox/fancy_nav_left.png b/public/javascripts/fancybox/fancy_nav_left.png old mode 100755 new mode 100644 diff --git a/public/javascripts/fancybox/fancy_nav_right.png b/public/javascripts/fancybox/fancy_nav_right.png old mode 100755 new mode 100644 diff --git a/public/javascripts/fancybox/fancy_shadow_e.png b/public/javascripts/fancybox/fancy_shadow_e.png old mode 100755 new mode 100644 diff --git a/public/javascripts/fancybox/fancy_shadow_n.png b/public/javascripts/fancybox/fancy_shadow_n.png old mode 100755 new mode 100644 diff --git a/public/javascripts/fancybox/fancy_shadow_ne.png b/public/javascripts/fancybox/fancy_shadow_ne.png old mode 100755 new mode 100644 diff --git a/public/javascripts/fancybox/fancy_shadow_nw.png b/public/javascripts/fancybox/fancy_shadow_nw.png old mode 100755 new mode 100644 diff --git a/public/javascripts/fancybox/fancy_shadow_s.png b/public/javascripts/fancybox/fancy_shadow_s.png old mode 100755 new mode 100644 diff --git a/public/javascripts/fancybox/fancy_shadow_se.png b/public/javascripts/fancybox/fancy_shadow_se.png old mode 100755 new mode 100644 diff --git a/public/javascripts/fancybox/fancy_shadow_sw.png b/public/javascripts/fancybox/fancy_shadow_sw.png old mode 100755 new mode 100644 diff --git a/public/javascripts/fancybox/fancy_shadow_w.png b/public/javascripts/fancybox/fancy_shadow_w.png old mode 100755 new mode 100644 diff --git a/public/javascripts/fancybox/fancy_title_left.png b/public/javascripts/fancybox/fancy_title_left.png old mode 100755 new mode 100644 diff --git a/public/javascripts/fancybox/fancy_title_main.png b/public/javascripts/fancybox/fancy_title_main.png old mode 100755 new mode 100644 diff --git a/public/javascripts/fancybox/fancy_title_over.png b/public/javascripts/fancybox/fancy_title_over.png old mode 100755 new mode 100644 diff --git a/public/javascripts/fancybox/fancy_title_right.png b/public/javascripts/fancybox/fancy_title_right.png old mode 100755 new mode 100644 diff --git a/public/javascripts/fancybox/fancybox-x.png b/public/javascripts/fancybox/fancybox-x.png old mode 100755 new mode 100644 diff --git a/public/javascripts/fancybox/fancybox-y.png b/public/javascripts/fancybox/fancybox-y.png old mode 100755 new mode 100644 diff --git a/public/javascripts/fancybox/fancybox.png b/public/javascripts/fancybox/fancybox.png old mode 100755 new mode 100644 diff --git a/public/javascripts/jquery.cycle/src/jquery.cycle.lite.js b/public/javascripts/jquery.cycle/src/jquery.cycle.lite.js old mode 100755 new mode 100644 diff --git a/public/stylesheets/blueprint/plugins/buttons/icons/cross.png b/public/stylesheets/blueprint/plugins/buttons/icons/cross.png old mode 100755 new mode 100644 diff --git a/public/stylesheets/blueprint/plugins/buttons/icons/key.png b/public/stylesheets/blueprint/plugins/buttons/icons/key.png old mode 100755 new mode 100644 diff --git a/public/stylesheets/blueprint/plugins/buttons/icons/tick.png b/public/stylesheets/blueprint/plugins/buttons/icons/tick.png old mode 100755 new mode 100644 diff --git a/public/stylesheets/brandongrotesque_light/Brandon_light-webfont.eot b/public/stylesheets/brandongrotesque_light/Brandon_light-webfont.eot old mode 100755 new mode 100644 diff --git a/public/stylesheets/brandongrotesque_light/Brandon_light-webfont.ttf b/public/stylesheets/brandongrotesque_light/Brandon_light-webfont.ttf old mode 100755 new mode 100644 diff --git a/public/stylesheets/brandongrotesque_light/Brandon_light-webfont.woff b/public/stylesheets/brandongrotesque_light/Brandon_light-webfont.woff old mode 100755 new mode 100644 diff --git a/public/stylesheets/brandongrotesque_light/Extras/alt_base64_stylesheet.css b/public/stylesheets/brandongrotesque_light/Extras/alt_base64_stylesheet.css old mode 100755 new mode 100644 diff --git a/public/stylesheets/loading.gif b/public/stylesheets/loading.gif old mode 100755 new mode 100644 From 0d51af0a13079675e41b2b2cbc82ffe2de178b51 Mon Sep 17 00:00:00 2001 From: Alec Leamas Date: Thu, 7 Oct 2010 16:11:43 +0200 Subject: [PATCH 444/449] Removing shebang on non-script. --- config/sprinkle/provision.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/sprinkle/provision.rb b/config/sprinkle/provision.rb index 3e30c26f4..c3a7acae8 100644 --- a/config/sprinkle/provision.rb +++ b/config/sprinkle/provision.rb @@ -1,4 +1,4 @@ -#!/usr/bin/env sprinkle -s +# # Copyright (c) 2010, Diaspora Inc. This file is # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. From 56ed245db098491bead6825ffe140cbdb39e7f77 Mon Sep 17 00:00:00 2001 From: Crimer Date: Thu, 7 Oct 2010 14:29:17 +0000 Subject: [PATCH 445/449] MongoMapper now not overrides database name in MONGOHQ_URL configuration if provided. It also works on Heroku. --- .gitignore | 19 +++++++++---------- config/initializers/_mongo.rb | 11 ++++------- 2 files changed, 13 insertions(+), 17 deletions(-) diff --git a/.gitignore b/.gitignore index 1fbfd2e04..571cd38ae 100644 --- a/.gitignore +++ b/.gitignore @@ -1,22 +1,21 @@ .bundle +.DS_Store .idea +.rvmrc *.swap -*.swp *.swo +*.swp *~ -.bundle +bin/* +config/app_config.yml +config/fb_config.yml +config/initializers/secret_token.rb db/*.sqlite3 log/* -tmp/**/* +nbproject gpg/diaspora-development/*.gpg gpg/diaspora-production/*.gpg gpg/*/random_seed public/uploads/* -.rvmrc -.DS_Store -config/app_config.yml -bin/* -nbproject -config/initializers/secret_token.rb public/source.tar -config/fb_config.yml +tmp/**/* diff --git a/config/initializers/_mongo.rb b/config/initializers/_mongo.rb index 8948a0c59..7d14315a7 100644 --- a/config/initializers/_mongo.rb +++ b/config/initializers/_mongo.rb @@ -2,13 +2,10 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. -if ENV['MONGOHQ_URL'] - MongoMapper.config = {RAILS_ENV => {'uri' => ENV['MONGOHQ_URL']}} -else - MongoMapper.connection = Mongo::Connection.new(APP_CONFIG['mongo_host'], APP_CONFIG['mongo_port']) -end +ENV['MONGODB_URL'] = ENV['MONGOHQ_URL'] || URI::Generic.build(:scheme => 'mongodb', :host => APP_CONFIG['mongo_host'], :port => APP_CONFIG['mongo_port'], :path => "/diaspora-#{Rails.env}").to_s -MongoMapper.database = "diaspora-#{Rails.env}" +MongoMapper.config = {RAILS_ENV => {'uri' => ENV['MONGODB_URL']}} +MongoMapper.connect RAILS_ENV if defined?(PhusionPassenger) PhusionPassenger.on_event(:starting_worker_process) do |forked| @@ -16,4 +13,4 @@ if defined?(PhusionPassenger) end end -Magent.connection = Mongo::Connection.new(APP_CONFIG['mongo_host'], APP_CONFIG['mongo_port']) +Magent.connection = MongoMapper.connection From 67fc01aa36438d8438e4b93260fef694a7d724b3 Mon Sep 17 00:00:00 2001 From: Raphael Date: Thu, 7 Oct 2010 09:49:34 -0700 Subject: [PATCH 446/449] Send friend_acceptances correctly --- lib/diaspora/user/friending.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/diaspora/user/friending.rb b/lib/diaspora/user/friending.rb index 36850c745..61f86a19b 100644 --- a/lib/diaspora/user/friending.rb +++ b/lib/diaspora/user/friending.rb @@ -38,7 +38,8 @@ module Diaspora end def dispatch_friend_acceptance(request, requester) - salmon request, :to => requester + friend_acceptance = salmon(request) + push_to_person requester, friend_acceptance.xml_for(requester) request.destroy unless request.callback_url.include? url end From d7bbb66d27a79d29ec3ba157f11c1c71a5580282 Mon Sep 17 00:00:00 2001 From: Raphael Date: Thu, 7 Oct 2010 10:47:37 -0700 Subject: [PATCH 447/449] Run whitespace:cleanup --- README.md | 2 +- app/controllers/aspects_controller.rb | 2 +- app/controllers/publics_controller.rb | 2 +- app/controllers/status_messages_controller.rb | 4 +-- app/controllers/users_controller.rb | 6 ++-- app/models/fb_status.rb | 8 +++--- app/models/user.rb | 4 +-- app/views/aspects/public.html.haml | 2 +- app/views/shared/_aspect_friends.haml | 4 +-- app/views/users/_services.haml | 2 +- app/views/users/edit.html.haml | 2 +- config/locales/diaspora/ar.yml | 2 +- config/locales/diaspora/cs.yml | 2 +- config/locales/diaspora/he.yml | 2 +- config/routes.rb | 2 +- features/step_definitions/web_steps.rb | 10 +++---- features/support/env.rb | 6 ++-- lib/diaspora/ostatus_builder.rb | 4 +-- lib/salmon/salmon.rb | 2 +- lib/tasks/cucumber.rake | 4 +-- script/ubuntu-setup.bash | 18 ++++++------ spec/controllers/publics_controller_spec.rb | 2 +- spec/controllers/users_controller_spec.rb | 28 +++++++++---------- spec/lib/diaspora_parser_spec.rb | 2 +- spec/lib/salmon_salmon_spec.rb | 10 +++---- spec/models/fb_status_spec.rb | 8 +++--- spec/user_encryption_spec.rb | 2 +- 27 files changed, 71 insertions(+), 71 deletions(-) diff --git a/README.md b/README.md index 57bb01c4e..c1e81ee73 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ instructions. You are welcome to contribute, add to and extend Diaspora however you see fit. We will do our best to incorporate everything that meets our guidelines. -Please do not rebase our tree into yours. +Please do not rebase our tree into yours. See [here](http://www.mail-archive.com/dri-devel@lists.sourceforge.net/msg39091.html) for when to rebase. diff --git a/app/controllers/aspects_controller.rb b/app/controllers/aspects_controller.rb index 3d750d41f..de20fa567 100644 --- a/app/controllers/aspects_controller.rb +++ b/app/controllers/aspects_controller.rb @@ -56,7 +56,7 @@ class AspectsController < ApplicationController respond_with @aspect end - + def manage @aspect = :manage @remote_requests = Request.for_user(current_user).all diff --git a/app/controllers/publics_controller.rb b/app/controllers/publics_controller.rb index 311fdf73f..f57b94540 100644 --- a/app/controllers/publics_controller.rb +++ b/app/controllers/publics_controller.rb @@ -30,7 +30,7 @@ class PublicsController < ApplicationController def hub if params['hub.mode'] == 'subscribe' || params['hub.mode'] == 'unsubscribe' - render :text => params['hub.challenge'], :status => 202, :layout => false + render :text => params['hub.challenge'], :status => 202, :layout => false end end diff --git a/app/controllers/status_messages_controller.rb b/app/controllers/status_messages_controller.rb index b072564bb..6f384b363 100644 --- a/app/controllers/status_messages_controller.rb +++ b/app/controllers/status_messages_controller.rb @@ -12,11 +12,11 @@ class StatusMessagesController < ApplicationController params[:status_message][:to] = params[:aspect_ids] data = clean_hash params[:status_message] - + if @logged_in && params[:status_message][:public] == 'true' id = 'me' type = 'feed' - + Rails.logger.info("Sending a message: #{params[:status_message][:message]} to Facebook") @res = MiniFB.post(@access_token, id, :type=>type, :metadata=>true, :params=>{:message => params[:status_message][:message]}) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index ab8939b87..9b41b1fc9 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -27,16 +27,16 @@ class UsersController < ApplicationController params[:user].delete(:password) if params[:user][:password].blank? params[:user].delete(:password_confirmation) if params[:user][:password].blank? and params[:user][:password_confirmation].blank? - + if params[:user][:password] && params[:user][:password_confirmation] if @user.update_attributes(:password => params[:user][:password], :password_confirmation => params[:user][:password_confirmation]) flash[:notice] = "Password Changed" else flash[:error] = "Password Change Failed" end - + end - + @user.update_profile data redirect_to edit_user_path(@user) diff --git a/app/models/fb_status.rb b/app/models/fb_status.rb index fd190c2c7..40d9cb16e 100644 --- a/app/models/fb_status.rb +++ b/app/models/fb_status.rb @@ -3,14 +3,14 @@ # the COPYRIGHT file. -class FbStatus +class FbStatus include MongoMapper::Document key :graph_id, String key :author_id, String key :author_name, String key :message, String - key :updated_time, Time + key :updated_time, Time timestamps! @@ -18,7 +18,7 @@ class FbStatus def self.from_api(hash) #just keeping them in memory for now - self.new( + self.new( :graph_id => hash['id'], :author_id => hash['from']['id'], :author_name => hash['from']['name'], @@ -26,6 +26,6 @@ class FbStatus :updated_time => Time.parse(hash['updated_time']) ) end - + end diff --git a/app/models/user.rb b/app/models/user.rb index 15c3515c2..238397bdc 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -254,7 +254,7 @@ class User def self.instantiate!( opts = {} ) opts[:person][:diaspora_handle] = "#{opts[:username]}@#{APP_CONFIG[:terse_pod_url]}" opts[:person][:url] = APP_CONFIG[:pod_url] - + opts[:serialized_private_key] = generate_key opts[:person][:serialized_public_key] = opts[:serialized_private_key].public_key User.create(opts) @@ -288,7 +288,7 @@ class User def self.generate_key OpenSSL::PKey::RSA::generate 4096 end - + def encryption_key OpenSSL::PKey::RSA.new( serialized_private_key ) end diff --git a/app/views/aspects/public.html.haml b/app/views/aspects/public.html.haml index f04b63489..e85cae276 100644 --- a/app/views/aspects/public.html.haml +++ b/app/views/aspects/public.html.haml @@ -12,7 +12,7 @@ - content_for :publish do - if @logged_in = render "shared/publisher", :aspect_ids => :public - - else + - else = render "shared/publisher", :aspect_ids => :all %ul#stream diff --git a/app/views/shared/_aspect_friends.haml b/app/views/shared/_aspect_friends.haml index e24dc5537..8c22700aa 100644 --- a/app/views/shared/_aspect_friends.haml +++ b/app/views/shared/_aspect_friends.haml @@ -8,8 +8,8 @@ = person_image_link(friend) - if @logged_in && (@aspect == :public) %h3 Facebook Friends - - @fb_friends = MiniFB.get(@access_token, 'me', :type => "friends") - - @fb_friends[:data].each do |friend| + - @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) = link_to (image_tag('add_friend_button.png', :height => "50px", :width => "50px")), "#add_request_pane", :id => 'add_request_button' diff --git a/app/views/users/_services.haml b/app/views/users/_services.haml index fd1894d11..648fbe161 100644 --- a/app/views/users/_services.haml +++ b/app/views/users/_services.haml @@ -10,7 +10,7 @@ %p - if @logged_in = connected_fb_as(@access_token) - + %p - @fb_friends = MiniFB.get(@access_token, 'me', :type => "friends") - @fb_friends[:data].each do |friend| diff --git a/app/views/users/edit.html.haml b/app/views/users/edit.html.haml index a3f090027..81fc639e7 100644 --- a/app/views/users/edit.html.haml +++ b/app/views/users/edit.html.haml @@ -26,5 +26,5 @@ #services.settings_pane = render 'users/services' - + diff --git a/config/locales/diaspora/ar.yml b/config/locales/diaspora/ar.yml index f46434621..cddf87706 100644 --- a/config/locales/diaspora/ar.yml +++ b/config/locales/diaspora/ar.yml @@ -193,7 +193,7 @@ ar: new_request: add_a_new_friend_to: "إضافة صديق جديد إلى" enter_a_diaspora_username: ":Diaspora أدخل اسم مستخدم" - your_diaspora_username_is: "%{diaspora_handle} :هو Diaspora اسم المستخدم الخاص" + your_diaspora_username_is: "%{diaspora_handle} :هو Diaspora اسم المستخدم الخاص" friends_username: "صديق اسم المستخدم" destroy: success: ".أنت الآن أصدقاء" diff --git a/config/locales/diaspora/cs.yml b/config/locales/diaspora/cs.yml index 898428db2..7b454f813 100644 --- a/config/locales/diaspora/cs.yml +++ b/config/locales/diaspora/cs.yml @@ -57,7 +57,7 @@ cs: new_album: create: "vytvořit" add_a_new_album: "Přidat nové album" - show: + show: edit_album: "Upravit album" albums: "alba" updated: "aktualizované" diff --git a/config/locales/diaspora/he.yml b/config/locales/diaspora/he.yml index 1105a3bcb..221a7c5f7 100644 --- a/config/locales/diaspora/he.yml +++ b/config/locales/diaspora/he.yml @@ -46,7 +46,7 @@ he: new_album: create: "יצירה" add_a_new_album: "הוספת אלבום חדש" - show: + show: edit_album: "עריכת אלבום" albums: "אלבומים" updated: "תאריך העדכון" diff --git a/config/routes.rb b/config/routes.rb index 2827c4cc7..12fae72e6 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -9,7 +9,7 @@ Diaspora::Application.routes.draw do resources :requests, :except => [:edit, :update] resources :photos, :except => [:index] resources :albums - + # added public route to user match 'public/:username', :to => 'users#public' resources :users, :except => [:create, :new, :show] diff --git a/features/step_definitions/web_steps.rb b/features/step_definitions/web_steps.rb index 0f0af8aa2..5a5529704 100644 --- a/features/step_definitions/web_steps.rb +++ b/features/step_definitions/web_steps.rb @@ -1,6 +1,6 @@ # IMPORTANT: This file is generated by cucumber-rails - edit at your own peril. -# It is recommended to regenerate this file in the future when you upgrade to a -# newer version of cucumber-rails. Consider adding your own code to a new file +# It is recommended to regenerate this file in the future when you upgrade to a +# newer version of cucumber-rails. Consider adding your own code to a new file # instead of editing this one. Cucumber will automatically load all features/**/*.rb # files. @@ -191,7 +191,7 @@ Then /^the "([^"]*)" checkbox(?: within "([^"]*)")? should not be checked$/ do | end end end - + Then /^(?:|I )should be on (.+)$/ do |page_name| current_path = URI.parse(current_url).path if current_path.respond_to? :should @@ -205,8 +205,8 @@ Then /^(?:|I )should have the following query string:$/ do |expected_pairs| query = URI.parse(current_url).query actual_params = query ? CGI.parse(query) : {} expected_params = {} - expected_pairs.rows_hash.each_pair{|k,v| expected_params[k] = v.split(',')} - + expected_pairs.rows_hash.each_pair{|k,v| expected_params[k] = v.split(',')} + if actual_params.respond_to? :should actual_params.should == expected_params else diff --git a/features/support/env.rb b/features/support/env.rb index bcb1fdd00..2fb86c4dc 100644 --- a/features/support/env.rb +++ b/features/support/env.rb @@ -1,6 +1,6 @@ # IMPORTANT: This file is generated by cucumber-rails - edit at your own peril. -# It is recommended to regenerate this file in the future when you upgrade to a -# newer version of cucumber-rails. Consider adding your own code to a new file +# It is recommended to regenerate this file in the future when you upgrade to a +# newer version of cucumber-rails. Consider adding your own code to a new file # instead of editing this one. Cucumber will automatically load all features/**/*.rb # files. @@ -24,7 +24,7 @@ Capybara.default_selector = :css WebMock.disable_net_connect!(:allow_localhost => true) -# If you set this to false, any error raised from within your app will bubble +# If you set this to false, any error raised from within your app will bubble # up to your step definition and out to cucumber unless you catch it somewhere # on the way. You can make Rails rescue errors and render error pages on a # per-scenario basis by tagging a scenario or feature with the @allow-rescue tag. diff --git a/lib/diaspora/ostatus_builder.rb b/lib/diaspora/ostatus_builder.rb index 92e12122a..48db7fd86 100644 --- a/lib/diaspora/ostatus_builder.rb +++ b/lib/diaspora/ostatus_builder.rb @@ -62,9 +62,9 @@ module Diaspora @user.visible_posts(:person_id => @user.person.id, :public=>true).inject("") do |xml,curr| if curr.respond_to?(:to_activity) unless xml - curr.to_activity + curr.to_activity else - xml + curr.to_activity + xml + curr.to_activity end end end diff --git a/lib/salmon/salmon.rb b/lib/salmon/salmon.rb index d9352ef41..e7690a578 100644 --- a/lib/salmon/salmon.rb +++ b/lib/salmon/salmon.rb @@ -53,7 +53,7 @@ module Salmon salmon.magic_sig = MagicSigEnvelope.create(user , user.person.aes_encrypt(activity, aes_key_hash)) salmon end - + def self.parse(xml, user) slap = self.new doc = Nokogiri::XML(xml) diff --git a/lib/tasks/cucumber.rake b/lib/tasks/cucumber.rake index 15d405ad4..055af1c6c 100644 --- a/lib/tasks/cucumber.rake +++ b/lib/tasks/cucumber.rake @@ -1,6 +1,6 @@ # IMPORTANT: This file is generated by cucumber-rails - edit at your own peril. -# It is recommended to regenerate this file in the future when you upgrade to a -# newer version of cucumber-rails. Consider adding your own code to a new file +# It is recommended to regenerate this file in the future when you upgrade to a +# newer version of cucumber-rails. Consider adding your own code to a new file # instead of editing this one. Cucumber will automatically load all features/**/*.rb # files. diff --git a/script/ubuntu-setup.bash b/script/ubuntu-setup.bash index c335fcf65..666eac818 100755 --- a/script/ubuntu-setup.bash +++ b/script/ubuntu-setup.bash @@ -11,7 +11,7 @@ # USAGE: ./script/ubuntu-setup.bash # Do NOT run this script as root. -# Set extented globbing +# Set extented globbing shopt -s extglob # fail on error @@ -23,29 +23,29 @@ We need to do some actions as an ordinary user. We use sudo where necessary." && # Check if the user has sudo privileges. sudo -v >/dev/null 2>&1 || { echo $(whoami) has no sudo privileges ; exit 1; } -# Check if universal repository is enabled +# Check if universal repository is enabled grep -i universe /etc/apt/sources.list > /dev/null || \ { echo "Please enable universe repository" ; exit 1 ; } # Make sure that we only install the latest version of packages sudo apt-get update -# Check if wget is installed +# Check if wget is installed test wget || { echo "Installing wget.." && sudo apt-get install wget \ && echo "Installed wget.." ; } -# Install build tools +# Install build tools echo "Installing build tools.." sudo apt-get -y --no-install-recommends install \ build-essential libxslt1.1 libxslt1-dev libxml2 echo "..Done installing build tools" -# Install Ruby 1.8.7 -echo "Installing ruby-full Ruby 1.8.7.." +# Install Ruby 1.8.7 +echo "Installing ruby-full Ruby 1.8.7.." sudo apt-get -y --no-install-recommends install ruby-full echo "..Done installing Ruby" -# Install Rake +# Install Rake echo "Installing rake.." sudo apt-get -y --no-install-recommends install rake echo "..Done installing rake" @@ -121,8 +121,8 @@ echo "Fetching and installing ruby gems.." echo "." sudo ln -s /usr/bin/gem1.8 /usr/bin/gem echo "." - fi -) + fi +) echo "Done installing the gems.." # Install bundler diff --git a/spec/controllers/publics_controller_spec.rb b/spec/controllers/publics_controller_spec.rb index d8d700bd8..22e71befb 100644 --- a/spec/controllers/publics_controller_spec.rb +++ b/spec/controllers/publics_controller_spec.rb @@ -24,7 +24,7 @@ describe PublicsController do user.reload user.visible_post_ids.include?(message.id).should be false - + xml = user2.salmon(message).xml_for(user.person) post :receive, :id => user.person.id, :xml => xml diff --git a/spec/controllers/users_controller_spec.rb b/spec/controllers/users_controller_spec.rb index 272775771..0352d2bf2 100644 --- a/spec/controllers/users_controller_spec.rb +++ b/spec/controllers/users_controller_spec.rb @@ -20,11 +20,11 @@ describe UsersController do it "doesn't overwrite the profile photo when an empty string is passed in" do image_url = @user.person.profile.image_url - put("update", :id => @user.id, "user"=> {"profile"=> + put("update", :id => @user.id, "user"=> {"profile"=> {"image_url" => "", "last_name" => @user.person.profile.last_name, "first_name" => @user.person.profile.first_name}}) - + @user.person.profile.image_url.should == image_url end end @@ -33,33 +33,33 @@ describe UsersController do it 'should change a users password ' do old_password = @user.encrypted_password - put("update", :id => @user.id, "user"=> {"password" => "foobaz", 'password_confirmation' => "foobaz","profile"=> + put("update", :id => @user.id, "user"=> {"password" => "foobaz", 'password_confirmation' => "foobaz","profile"=> {"image_url" => "", "last_name" => @user.person.profile.last_name, - "first_name" => @user.person.profile.first_name}}) + "first_name" => @user.person.profile.first_name}}) @user.reload @user.encrypted_password.should_not == old_password end - it 'should not change a password if they do not match' do - old_password = @user.encrypted_password - put("update", :id => @user.id, "user"=> {"password" => "foobarz", 'password_confirmation' => "not_the_same","profile"=> + it 'should not change a password if they do not match' do + old_password = @user.encrypted_password + put("update", :id => @user.id, "user"=> {"password" => "foobarz", 'password_confirmation' => "not_the_same","profile"=> {"image_url" => "", "last_name" => @user.person.profile.last_name, - "first_name" => @user.person.profile.first_name}}) + "first_name" => @user.person.profile.first_name}}) @user.reload @user.encrypted_password.should == old_password end - - it 'should not update if the password fields are left blank' do - - old_password = @user.encrypted_password - put("update", :id => @user.id, "user"=> {"password" => "", 'password_confirmation' => "","profile"=> + + it 'should not update if the password fields are left blank' do + + old_password = @user.encrypted_password + put("update", :id => @user.id, "user"=> {"password" => "", 'password_confirmation' => "","profile"=> {"image_url" => "", "last_name" => @user.person.profile.last_name, - "first_name" => @user.person.profile.first_name}}) + "first_name" => @user.person.profile.first_name}}) @user.reload @user.encrypted_password.should == old_password end diff --git a/spec/lib/diaspora_parser_spec.rb b/spec/lib/diaspora_parser_spec.rb index 530dca211..d5722fd65 100644 --- a/spec/lib/diaspora_parser_spec.rb +++ b/spec/lib/diaspora_parser_spec.rb @@ -8,7 +8,7 @@ describe Diaspora::Parser do before do @user = Factory.create(:user, :email => "bob@aol.com") @aspect = @user.aspect(:name => 'spies') - + @user3 = Factory.create :user @person = @user3.person @user2 = Factory.create(:user) diff --git a/spec/lib/salmon_salmon_spec.rb b/spec/lib/salmon_salmon_spec.rb index e10ad5b48..40f928c18 100644 --- a/spec/lib/salmon_salmon_spec.rb +++ b/spec/lib/salmon_salmon_spec.rb @@ -11,17 +11,17 @@ describe Salmon do let(:post){ user.post :status_message, :message => "hi", :to => user.aspect(:name => "sdg").id } let!(:created_salmon) {Salmon::SalmonSlap.create(user, post.to_diaspora_xml)} - + describe '#create' do it 'has data in the magic envelope' do created_salmon.magic_sig.data.should_not be nil end - + it 'has no parsed_data' do created_salmon.parsed_data.should be nil end - + it 'sets aes and iv key' do created_salmon.aes_key.should_not be nil created_salmon.iv.should_not be nil @@ -33,7 +33,7 @@ describe Salmon do user.aes_decrypt(decoded_string, key_hash).should == post.to_diaspora_xml end end - + describe '#xml_for' do let(:xml) {created_salmon.xml_for user2.person} @@ -50,7 +50,7 @@ describe Salmon do context 'marshaling' do let(:xml) {created_salmon.xml_for user2.person} - let(:parsed_salmon) { Salmon::SalmonSlap.parse(xml, user2)} + let(:parsed_salmon) { Salmon::SalmonSlap.parse(xml, user2)} it 'should parse out the aes key' do parsed_salmon.aes_key.should == created_salmon.aes_key diff --git a/spec/models/fb_status_spec.rb b/spec/models/fb_status_spec.rb index 368f8bd16..2ab232fce 100644 --- a/spec/models/fb_status_spec.rb +++ b/spec/models/fb_status_spec.rb @@ -7,9 +7,9 @@ require File.dirname(__FILE__) + '/../spec_helper' describe FbStatus do - + let(:fb_status) { Factory.create :fb_status } - + it 'is valid' do fb_status.should be_valid end @@ -22,7 +22,7 @@ describe FbStatus do it 'has graph_id' do status_from_json.graph_id.should == json_object['id'] end - + it 'has author_id' do status_from_json.author_id.should == json_object['from']['id'] end @@ -39,5 +39,5 @@ describe FbStatus do status_from_json.updated_time.should == Time.parse(json_object['updated_time']) end end - + end diff --git a/spec/user_encryption_spec.rb b/spec/user_encryption_spec.rb index 2188b106e..a7fd8c548 100644 --- a/spec/user_encryption_spec.rb +++ b/spec/user_encryption_spec.rb @@ -9,7 +9,7 @@ describe 'user encryption' do unstub_mocha_stubs @user = Factory.create(:user) @aspect = @user.aspect(:name => 'dudes') - + @user2 = Factory.create(:user) @aspect2 = @user2.aspect(:name => 'dudes') end From e26ad0bdf89542ac4bdd0681ab4e764feba1a638 Mon Sep 17 00:00:00 2001 From: Raphael Date: Thu, 7 Oct 2010 11:38:07 -0700 Subject: [PATCH 448/449] topic branch --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 26858e61e..bac9cd40f 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,9 @@ instructions. You are welcome to contribute, add to and extend Diaspora however you see fit. We will do our best to incorporate everything that meets our guidelines. +Please make your changes on a topic branch in your repo and submit your pull request +from there, so that commits you don't want to submit aren't included. + Please do not rebase our tree into yours. See [here](http://www.mail-archive.com/dri-devel@lists.sourceforge.net/msg39091.html) for when to rebase. From 9cbdf78aa747b649c75827d020b3e0692039c40e Mon Sep 17 00:00:00 2001 From: Raphael Date: Thu, 7 Oct 2010 12:01:49 -0700 Subject: [PATCH 449/449] Don't redirect on status message create --- app/controllers/status_messages_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/status_messages_controller.rb b/app/controllers/status_messages_controller.rb index 6f384b363..137dd8a7e 100644 --- a/app/controllers/status_messages_controller.rb +++ b/app/controllers/status_messages_controller.rb @@ -23,7 +23,7 @@ class StatusMessagesController < ApplicationController end @status_message = current_user.post(:status_message, data) - respond_with @status_message + render :nothing => true end def destroy