Merged with diaspora; fixed conflicts; only 2 red
This commit is contained in:
commit
e9f74675e9
19 changed files with 261 additions and 52 deletions
|
|
@ -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}/i) | Person.all('profile.last_name' => /^#{query}/i)
|
||||
end
|
||||
|
||||
def real_name
|
||||
|
|
|
|||
|
|
@ -12,6 +12,9 @@
|
|||
|
||||
.requests
|
||||
%ul.dropzone
|
||||
- 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)
|
||||
|
|
@ -21,6 +24,7 @@
|
|||
|
||||
%li.remove
|
||||
%ul.dropzone
|
||||
%li.grey Drag to ignore/remove
|
||||
|
||||
- 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'))
|
||||
|
|
|
|||
26
app/views/people/_person.html.haml
Normal file
26
app/views/people/_person.html.haml
Normal file
|
|
@ -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 =t('.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 t('.add_friend')
|
||||
|
|
@ -8,44 +8,18 @@
|
|||
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
|
||||
\.
|
||||
|
||||
= (@people.count).to_s + search_or_index
|
||||
%table
|
||||
%tr
|
||||
%th=t('.real_name')
|
||||
%th=t('.diaspora_handle')
|
||||
%th url
|
||||
%h1
|
||||
search results for
|
||||
%u= params[:q]
|
||||
|
||||
%ul#stream
|
||||
- for person in @people
|
||||
%tr
|
||||
- if current_user.friends.include? person
|
||||
%td= link_to person.real_name, person
|
||||
- else
|
||||
%td= person.real_name
|
||||
= render 'people/person', :person => person
|
||||
|
||||
%td= person.diaspora_handle
|
||||
%td= person.url
|
||||
|
||||
-if current_user.friends.include? person
|
||||
|
||||
- elsif person.id == current_user.person.id
|
||||
%td
|
||||
%td=t('.thats_you')
|
||||
-elsif current_user.pending_requests.find_by_person_id(person.id)
|
||||
%td
|
||||
%td="^-#{t('.you_have_a_friend_request_from_this_person')}"
|
||||
-elsif current_user.pending_requests.find_by_url(person.receive_url)
|
||||
%td
|
||||
%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 t('.add_friend')
|
||||
= will_paginate @people
|
||||
|
|
|
|||
|
|
@ -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/'
|
||||
|
|
|
|||
10
config/locales/cs.yml
Normal file
10
config/locales/cs.yml
Normal file
|
|
@ -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"
|
||||
41
config/locales/devise.cs.yml
Normal file
41
config/locales/devise.cs.yml
Normal file
|
|
@ -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.
|
||||
|
||||
|
||||
cs:
|
||||
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í'
|
||||
41
config/locales/devise.fi.yml
Normal file
41
config/locales/devise.fi.yml
Normal file
|
|
@ -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'
|
||||
41
config/locales/devise.it.yml
Normal file
41
config/locales/devise.it.yml
Normal file
|
|
@ -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'account"
|
||||
41
config/locales/devise.pt-BR.yml
Normal file
41
config/locales/devise.pt-BR.yml
Normal file
|
|
@ -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'
|
||||
|
|
@ -169,6 +169,9 @@ en:
|
|||
helper:
|
||||
no_message_to_display: "No message to display."
|
||||
people:
|
||||
person:
|
||||
add_friend: "add friend"
|
||||
pending_request: "pending request"
|
||||
index:
|
||||
add_friend: "add friend"
|
||||
real_name: "real name"
|
||||
|
|
|
|||
|
|
@ -170,6 +170,9 @@ es:
|
|||
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"
|
||||
|
|
|
|||
10
config/locales/fi.yml
Normal file
10
config/locales/fi.yml
Normal file
|
|
@ -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"
|
||||
10
config/locales/pt-BR.yml
Normal file
10
config/locales/pt-BR.yml
Normal file
|
|
@ -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"
|
||||
|
|
@ -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',
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -186,6 +186,9 @@ ul#stream
|
|||
:padding
|
||||
:top 0
|
||||
|
||||
.right
|
||||
:top 0
|
||||
|
||||
li.message
|
||||
:position relative
|
||||
:line-height 140%
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue