diff --git a/app/models/person.rb b/app/models/person.rb index 1e2a7b18d..b1e7e3745 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}/i) | Person.all('profile.last_name' => /^#{query}/i) end def real_name diff --git a/app/views/aspects/manage.html.haml b/app/views/aspects/manage.html.haml index 3f4dd7d38..1a6bc3b0d 100644 --- a/app/views/aspects/manage.html.haml +++ b/app/views/aspects/manage.html.haml @@ -12,15 +12,19 @@ .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=t('.ignore_remove') %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')) diff --git a/app/views/people/_person.html.haml b/app/views/people/_person.html.haml new file mode 100644 index 000000000..1e75b8ab2 --- /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 =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') diff --git a/app/views/people/index.html.haml b/app/views/people/index.html.haml index 57e46d6df..2cd1dc4a7 100644 --- a/app/views/people/index.html.haml +++ b/app/views/people/index.html.haml @@ -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 - - 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=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 +%ul#stream + - for person in @people + = render 'people/person', :person => person + += will_paginate @people 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/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..34d9eb7c1 --- /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. + + +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í' diff --git a/config/locales/devise.fi.yml b/config/locales/devise.fi.yml new file mode 100644 index 000000000..4ee6761f8 --- /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/devise.it.yml b/config/locales/devise.it.yml new file mode 100644 index 000000000..75b90affc --- /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'account" 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/en.yml b/config/locales/en.yml index 3a416b54f..d25c04591 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -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" diff --git a/config/locales/es.yml b/config/locales/es.yml index de2617886..296a560d0 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -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" 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" 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" 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', 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% 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 { 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