Merge branch 'master' of git://github.com/diaspora/diaspora
This commit is contained in:
commit
1b96787d4a
12 changed files with 112 additions and 49 deletions
|
|
@ -35,7 +35,7 @@ class Person
|
||||||
/^(https?):\/\/[a-z0-9]+([\-\.]{1}[a-z0-9]+)*(\.[a-z]{2,5})?(:[0-9]{1,5})?(\/.*)?$/ix
|
/^(https?):\/\/[a-z0-9]+([\-\.]{1}[a-z0-9]+)*(\.[a-z]{2,5})?(:[0-9]{1,5})?(\/.*)?$/ix
|
||||||
|
|
||||||
def self.search(query)
|
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
|
end
|
||||||
|
|
||||||
def real_name
|
def real_name
|
||||||
|
|
|
||||||
|
|
@ -13,16 +13,20 @@
|
||||||
|
|
||||||
.requests
|
.requests
|
||||||
%ul.dropzone
|
%ul.dropzone
|
||||||
- for request in @remote_requests
|
- if @remote_requests.size < 1
|
||||||
%li.requested_person{:id => request.person.id, :request_id => request.id}
|
%li.grey No new requests
|
||||||
= person_image_tag(request.person)
|
- else
|
||||||
.name
|
- for request in @remote_requests
|
||||||
= request.person.real_name
|
%li.requested_person{:id => request.person.id, :request_id => request.id}
|
||||||
|
= person_image_tag(request.person)
|
||||||
|
.name
|
||||||
|
= request.person.real_name
|
||||||
%h1
|
%h1
|
||||||
Ignore/Remove
|
Ignore/Remove
|
||||||
|
|
||||||
%li.remove
|
%li.remove
|
||||||
%ul.dropzone
|
%ul.dropzone
|
||||||
|
%li.grey Drag to ignore/remove
|
||||||
|
|
||||||
- content_for :publish do
|
- 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("add a new aspect", "#add_aspect_pane", :id => "add_aspect_button", :class => "new_aspect button", :title => "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 "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"
|
||||||
|
|
@ -8,44 +8,18 @@
|
||||||
Search
|
Search
|
||||||
|
|
||||||
=form_tag '/people', :method => "get" do
|
=form_tag '/people', :method => "get" do
|
||||||
= text_field_tag :q
|
= text_field_tag :q, params[:q]
|
||||||
= submit_tag "search"
|
= submit_tag "search"
|
||||||
|
|
||||||
- content_for :left_pane do
|
- content_for :left_pane do
|
||||||
\.
|
\.
|
||||||
|
|
||||||
= (@people.count).to_s + search_or_index
|
%h1
|
||||||
%table
|
search results for
|
||||||
%tr
|
%u= params[:q]
|
||||||
%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
|
|
||||||
|
|
||||||
%td= person.diaspora_handle
|
%ul#stream
|
||||||
%td= person.url
|
- for person in @people
|
||||||
|
= render 'people/person', :person => person
|
||||||
|
|
||||||
-if current_user.friends.include? person
|
= will_paginate @people
|
||||||
|
|
||||||
- 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
|
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@
|
||||||
development:
|
development:
|
||||||
debug: false
|
debug: false
|
||||||
socket_debug : false
|
socket_debug : false
|
||||||
|
socket_host: 0.0.0.0
|
||||||
socket_port: 8080
|
socket_port: 8080
|
||||||
socket_collection_name: 'websocket'
|
socket_collection_name: 'websocket'
|
||||||
pubsub_server: 'https://pubsubhubbub.appspot.com/'
|
pubsub_server: 'https://pubsubhubbub.appspot.com/'
|
||||||
|
|
@ -14,11 +15,13 @@ development:
|
||||||
test:
|
test:
|
||||||
debug: false
|
debug: false
|
||||||
socket_debug : false
|
socket_debug : false
|
||||||
|
socket_host: 0.0.0.0
|
||||||
socket_port: 8081
|
socket_port: 8081
|
||||||
pubsub_server: 'https://pubsubhubbub.appspot.com/'
|
pubsub_server: 'https://pubsubhubbub.appspot.com/'
|
||||||
|
|
||||||
production:
|
production:
|
||||||
debug: false
|
debug: false
|
||||||
socket_debug : false
|
socket_debug : false
|
||||||
|
socket_host: 0.0.0.0
|
||||||
socket_port: 8080
|
socket_port: 8080
|
||||||
pubsub_server: 'https://pubsubhubbub.appspot.com/'
|
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í'
|
||||||
|
|
@ -42,14 +42,14 @@ $(function() {
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
$("ul .person .requested_person").draggable({
|
// Multiple classes here won't work
|
||||||
|
$("ul .person").draggable({
|
||||||
revert: true
|
revert: true
|
||||||
});
|
});
|
||||||
|
|
||||||
// Moved class to logic above - unnec duplicate logic
|
$("ul .requested_person").draggable({
|
||||||
//$("ul .requested_person").draggable({
|
revert: true
|
||||||
// revert: true
|
});
|
||||||
//});
|
|
||||||
|
|
||||||
$(".aspect ul").droppable({
|
$(".aspect ul").droppable({
|
||||||
hoverClass: 'active',
|
hoverClass: 'active',
|
||||||
|
|
|
||||||
|
|
@ -145,6 +145,8 @@ ul#stream {
|
||||||
border-bottom: 1px solid #eeeeee; }
|
border-bottom: 1px solid #eeeeee; }
|
||||||
ul#stream > li:first-child {
|
ul#stream > li:first-child {
|
||||||
padding-top: 0; }
|
padding-top: 0; }
|
||||||
|
ul#stream .right {
|
||||||
|
top: 0; }
|
||||||
|
|
||||||
li.message {
|
li.message {
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
|
||||||
|
|
@ -186,6 +186,9 @@ ul#stream
|
||||||
:padding
|
:padding
|
||||||
:top 0
|
:top 0
|
||||||
|
|
||||||
|
.right
|
||||||
|
:top 0
|
||||||
|
|
||||||
li.message
|
li.message
|
||||||
:position relative
|
:position relative
|
||||||
:line-height 140%
|
:line-height 140%
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ begin
|
||||||
Diaspora::WebSocket.initialize_channels
|
Diaspora::WebSocket.initialize_channels
|
||||||
|
|
||||||
EventMachine::WebSocket.start(
|
EventMachine::WebSocket.start(
|
||||||
:host => "0.0.0.0",
|
:host => APP_CONFIG[:socket_host],
|
||||||
:port => APP_CONFIG[:socket_port],
|
:port => APP_CONFIG[:socket_port],
|
||||||
:debug =>APP_CONFIG[:socket_debug]) do |ws|
|
:debug =>APP_CONFIG[:socket_debug]) do |ws|
|
||||||
ws.onopen {
|
ws.onopen {
|
||||||
|
|
|
||||||
|
|
@ -134,13 +134,13 @@ describe Person do
|
||||||
people.include?(@friend_three).should == false
|
people.include?(@friend_three).should == false
|
||||||
people.include?(@friend_four).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_two).should == true
|
||||||
people.include?(@friend_one).should == false
|
people.include?(@friend_one).should == false
|
||||||
people.include?(@friend_three).should == false
|
people.include?(@friend_three).should == false
|
||||||
people.include?(@friend_four).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_one).should == true
|
||||||
people.include?(@friend_four).should == true
|
people.include?(@friend_four).should == true
|
||||||
people.include?(@friend_two).should == false
|
people.include?(@friend_two).should == false
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue