Merge branch 'master' of git://github.com/diaspora/diaspora

This commit is contained in:
maco 2010-09-19 07:41:03 +00:00
commit 1b96787d4a
12 changed files with 112 additions and 49 deletions

View file

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

View file

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

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

View file

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

View file

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

View 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í'

View file

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

View file

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

View file

@ -186,6 +186,9 @@ ul#stream
:padding
:top 0
.right
:top 0
li.message
:position relative
:line-height 140%

View file

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

View file

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