Merge branch 'master' into HEAD

This commit is contained in:
Raphael 2010-09-24 15:50:48 -07:00
commit 9d2ee2f961
65 changed files with 161 additions and 648 deletions

2
.gitignore vendored
View file

@ -15,3 +15,5 @@ public/uploads/*
.rvmrc
.DS_Store
config/app_config.yml
bin/*
nbproject

View file

@ -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'
@ -47,7 +46,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'
@ -57,7 +55,6 @@ end
group :development do
gem 'nifty-generators'
gem 'ruby-debug'
end
group :deployment do

View file

@ -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:
@ -104,8 +98,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)
@ -117,7 +109,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)
@ -137,7 +128,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)
@ -184,7 +174,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)
@ -200,11 +189,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)
@ -214,8 +198,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 +224,6 @@ PLATFORMS
DEPENDENCIES
addressable
async_sinatra
autotest
bson (= 1.0.7)
bson_ext (= 1.0.7)
@ -254,24 +235,20 @@ 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)
redfinger!
redgreen
roxml!
rspec (>= 2.0.0.beta.17)
rspec-rails (= 2.0.0.beta.17)
ruby-debug
saucelabs-adapter (= 0.8.12)
selenium-rc
sinatra (= 1.0)
sprinkle!
thin
webmock

View file

@ -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/)
@ -52,7 +53,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

View file

@ -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)
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
# create several required methods for this temporal file
Tempfile.send(:define_method, "content_type") {return att_content_type}

View file

@ -4,7 +4,7 @@
class PublicsController < ApplicationController
require 'lib/diaspora/parser'
require File.expand_path('../../../lib/diaspora/parser', __FILE__)
include Diaspora::Parser
layout false
@ -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

View file

@ -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)

View file

@ -3,7 +3,7 @@
# the COPYRIGHT file.
require 'lib/hcard'
require File.expand_path('../../../lib/hcard', __FILE__)
class Person
include MongoMapper::Document

View file

@ -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

View file

@ -4,8 +4,8 @@
class Post
require 'lib/diaspora/websocket'
require 'lib/encryptable'
require File.expand_path('../../../lib/encryptable', __FILE__)
require File.expand_path('../../../lib/diaspora/websocket', __FILE__)
include MongoMapper::Document
include ApplicationHelper
include ROXML

View file

@ -5,7 +5,7 @@
class Profile
include MongoMapper::EmbeddedDocument
require 'lib/diaspora/webhooks'
require File.expand_path('../../../lib/diaspora/webhooks', __FILE__)
include Diaspora::Webhooks
include ROXML

View file

@ -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

View file

@ -2,11 +2,10 @@
# licensed under the Affero General Public License version 3. See
# the COPYRIGHT file.
require 'lib/diaspora/user/friending.rb'
require 'lib/diaspora/user/querying.rb'
require 'lib/diaspora/user/receiving.rb'
require '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/diaspora/user/receiving', __FILE__)
require File.expand_path('../../../lib/salmon/salmon', __FILE__)
class User
include MongoMapper::Document
@ -129,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
@ -258,7 +261,6 @@ class User
aspect(:name => "Family")
aspect(:name => "Work")
end
def diaspora_handle
"#{self.username}@#{APP_CONFIG[:terse_pod_url]}"

View file

@ -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

View file

@ -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 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.

View file

@ -3,7 +3,7 @@
# the COPYRIGHT file.
require '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

View file

@ -1,264 +0,0 @@
# 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 "

View file

@ -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'

View file

@ -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'

View file

@ -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: "na 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 dauthentification invalide.'
timeout: 'Votre session a expiré, veuillez vous connecter de nouveau afin de continuer.'
inactive: 'Votre compte na 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'

View file

@ -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"

View file

@ -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'

View file

@ -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: 'Разблокирование учётной записи'

View file

@ -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"

View file

@ -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.'

View file

@ -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"

View file

@ -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 lalbum"
cancel: "Annuler"
index:
@ -66,7 +66,7 @@ fr-informal:
failure: "Lédition de lalbum %{name} a échoué."
destroy:
success: "Lalbum %{name} a été supprimé."
helper:
helper:
friends_albums: "Albums damis"
your_albums: "Tes albums"
aspects:
@ -202,4 +202,4 @@ fr-informal:
error: "Aucun résultat Diaspora na été trouvé avec cette adresse e-mail !"
already_friends: "Tu es déjà ami avec %{destination_url}!"
success: "Une requête dami a été envoyée à %{destination_url}."
horribly_wrong: "Quelque chose dhorrible sest produit."
horribly_wrong: "Quelque chose dhorrible sest produit."

View file

@ -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'

View file

@ -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",

View file

@ -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')))

View file

@ -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')))

View file

@ -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]

View file

@ -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;

View file

@ -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

View file

@ -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__)

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -31,8 +31,13 @@ describe Photo do
it 'should save a photo' do
@photo.image.store! File.open(@fixture_name)
@photo.save.should == true
binary = @photo.image.read
fixture_binary = File.open(@fixture_name).read
begin
binary = @photo.image.read.force_encoding('BINARY')
fixture_binary = File.open(@fixture_name).read.force_encoding('BINARY')
rescue NoMethodError # Ruby 1.8 doesn't have force_encoding
binary = @photo.image.read
fixture_binary = File.open(@fixture_name).read
end
binary.should == fixture_binary
end

View file

@ -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')