Merge branch 'master' of github.com:diaspora/diaspora into reposting
This commit is contained in:
commit
81250c0e9d
7 changed files with 159 additions and 13 deletions
21
README.md
21
README.md
|
|
@ -1,7 +1,8 @@
|
|||
## Commit Guidlines
|
||||
|
||||
You are welcome to contribute, add and extend Diaspora however you see fit. We will do our best to incorporate everything that meets our guidelines.
|
||||
|
||||
We need you to fill out a [contributor agreement form](https://spreadsheets.google.com/a/joindiaspora.com/viewform?formkey=dGI2cHA3ZnNHLTJvbm10LUhXRTJjR0E6MQ&theme=0AX42CRMsmRFbUy1iOGYwN2U2Mi1hNWU0LTRlNjEtYWMyOC1lZmU4ODg1ODc1ODI&ifq) before we can accept your patches. The agreement gives Diaspora joint ownership of the patch so the copyright isn't scattered. You can find it [here](https://spreadsheets.google.com/a/joindiaspora.com/viewform?formkey=dGI2cHA3ZnNHLTJvbm10LUhXRTJjR0E6MQ&theme=0AX42CRMsmRFbUy1iOGYwN2U2Mi1hNWU0LTRlNjEtYWMyOC1lZmU4ODg1ODc1ODI&ifq).
|
||||
We need you to fill out a [contributor agreement form](https://spreadsheets.google.com/a/joindiaspora.com/viewform?formkey=dGI2cHA3ZnNHLTJvbm10LUhXRTJjR0E6MQ&theme=0AX42CRMsmRFbUy1iOGYwN2U2Mi1hNWU0LTRlNjEtYWMyOC1lZmU4ODg1ODc1ODI&ifq) before we can accept your patches. The agreement gives Diaspora joint ownership of the patch so the copyright isn't scattered. You can find it [here](https://spreadsheets.google.com/a/joindiaspora.com/viewform?formkey=dGI2cHA3ZnNHLTJvbm10LUhXRTJjR0E6MQ&theme=0AX42CRMsmRFbUy1iOGYwN2U2Mi1hNWU0LTRlNjEtYWMyOC1lZmU4ODg1ODc1ODI&ifq).
|
||||
|
||||
All commits must be tested, and after each commit, all tests should be green before a pull request is sent. Please write your tests in Rspec.
|
||||
|
||||
|
|
@ -14,7 +15,7 @@ The privacy aware, personally controlled, do-it-all, open source social network.
|
|||
**DISCLAIMER: THIS IS PRE-ALPHA SOFTWARE AND SHOULD BE TREATED ACCORDINGLY.**
|
||||
**PLEASE, DO NOT RUN IN PRODUCTION. IT IS FUN TO GET RUNNING, BUT EXPECT THINGS TO BE BROKEN**
|
||||
|
||||
Also, we really want to continue to focus on features and improving the code base. When we think it is
|
||||
Also, we really want to continue to focus on features and improving the code base. When we think it is
|
||||
ready for general use, we will post more detailed instructions.
|
||||
|
||||
## Notice
|
||||
|
|
@ -30,6 +31,7 @@ We will try and fully support more webservers later, but that is what works for
|
|||
These instructions are for machines running [Ubuntu](http://www.ubuntu.com/), [Fedora](http://www.fedoraproject.org) or Mac OS X. We are developing Diaspora for the latest and greatest browsers, so please update your Firefox, Chrome or Safari to the latest and greatest.
|
||||
|
||||
## Preparing your system
|
||||
|
||||
In order to run Diaspora, you will need to download the following dependencies (specific instructions follow):
|
||||
|
||||
- Build Tools - Packages needed to compile the components that follow.
|
||||
|
|
@ -64,7 +66,7 @@ To install Ruby 1.8.7 on **Ubuntu**, run the following command:
|
|||
|
||||
sudo apt-get install ruby-full
|
||||
|
||||
Please note that you need to have Universe enabled in your /etc/apt/sources.list file to install ruby using apt-get.
|
||||
Please note that you need to have Universe enabled in your /etc/apt/sources.list file to install ruby using apt-get.
|
||||
|
||||
At this time Fedora does not have Ruby 1.8.7. As a workaround it is possible to use [rvm](http://rvm.beginrescueend.com/) with a locally compiled Ruby installation. A semi automated method for doing this is available. It is highly recommended that you review the script before running it so you understand what will occur. The script can be executed by running the following command:
|
||||
|
||||
|
|
@ -90,11 +92,11 @@ Then run:
|
|||
|
||||
You can also run the binary directly by doing the following:
|
||||
|
||||
If you're running a 32-bit system, run:
|
||||
If you're running a 32-bit system, run:
|
||||
|
||||
wget http://fastdl.mongodb.org/linux/mongodb-linux-i686-1.6.2.tgz
|
||||
|
||||
If you're running a 64-bit system, run:
|
||||
|
||||
If you're running a 64-bit system, run:
|
||||
|
||||
wget http://fastdl.mongodb.org/linux/mongodb-linux-x86_64-1.6.2.tgz
|
||||
|
||||
|
|
@ -202,9 +204,11 @@ If you have never used github before, their [help desk](http://help.github.com/)
|
|||
## Running Diaspora
|
||||
|
||||
### Install required gems
|
||||
|
||||
To start the app server for the first time, you need to use Bundler to install Diaspora's gem depencencies. Run `bundle install` from Diaspora's root directory. Bundler will also warn you if there is a new dependency and you need to bundle install again.
|
||||
|
||||
### Start Mongo
|
||||
|
||||
If you installed the Ubuntu package, MongoDB should already be running (if not, run `service mongodb start`). If you installed the binary manually, run `sudo mongod` from where mongo is installed to start mongo.
|
||||
|
||||
If you installed the Fedora package, MongoDB will need to be started via `service mongodb start`. If you installed the binary manually, run `sudo mongod` from where Mongo is installed to start Mongo.
|
||||
|
|
@ -214,19 +218,24 @@ If you installed the OsX package through "brew", MongoDB will need to be started
|
|||
Diaspora will not run unless Mongo is running. Mongo will not run by default, and will need to be started every time you wish to use or run the test suite for Diaspora.
|
||||
|
||||
### Run the server
|
||||
|
||||
`./script/server` will start both thin and the websocket server. If you want to run a different app server, you will have to run them separately. See below for instructions.
|
||||
|
||||
### Run the app server
|
||||
|
||||
Once mongo is running and bundler has finished, run `bundle exec thin start` from the root Diaspora directory. This will start the app server in development mode[.](http://bit.ly/9mwtUw)
|
||||
|
||||
### Run the websocket server
|
||||
|
||||
run `bundle exec ruby ./script/websocket_server` to start the websocket server on port 8080. Change the port in config/app_config.yml.
|
||||
|
||||
### Logging in with a sample user
|
||||
|
||||
Run `rake db:seed:tom`, then login with user `tom` and password `evankorth`. More details in db/seeds/tom.rb.
|
||||
|
||||
|
||||
### Testing
|
||||
|
||||
Diaspora's test suite uses [rspec](http://rspec.info/), a behavior driven testing framework. In order to run the tests, run `bundle exec rspec spec`.
|
||||
|
||||
## Resources
|
||||
|
|
|
|||
|
|
@ -47,8 +47,8 @@ class RequestsController < ApplicationController
|
|||
begin
|
||||
@request = current_user.send_friend_request_to(rel_hash[:friend], aspect)
|
||||
rescue Exception => e
|
||||
raise e unless e.message.include? "already friends"
|
||||
flash[:notice] = "You are already friends with #{params[:request][:destination_url]}!"
|
||||
raise e unless e.message.include? "already"
|
||||
flash[:notice] = "#{e.message} #{params[:request][:destination_url]}"
|
||||
respond_with :location => aspect
|
||||
return
|
||||
end
|
||||
|
|
|
|||
|
|
@ -104,8 +104,8 @@ class Person
|
|||
|
||||
return nil unless public_key_entry
|
||||
|
||||
public_key = public_key_entry.first.href
|
||||
new_person.exported_key = Base64.decode64 public_key
|
||||
pubkey = public_key_entry.first.href
|
||||
new_person.exported_key = Base64.decode64 pubkey
|
||||
|
||||
guid = profile.links.select{|x| x.rel == 'http://joindiaspora.com/guid'}.first.href
|
||||
new_person.id = guid
|
||||
|
|
|
|||
|
|
@ -17,11 +17,11 @@
|
|||
|
||||
%h3 Picture
|
||||
%div#image_picker
|
||||
= p.hidden_field :image_url, :value => (@profile.image_url.sub(APP_CONFIG[:pod_url],'/') if @profile.image_url), :id => 'image_url_field'
|
||||
= p.hidden_field :image_url, :value => (@profile.image_url if @profile.image_url), :id => 'image_url_field'
|
||||
|
||||
- unless @photos.nil? || @photos.empty?
|
||||
- for photo in @photos
|
||||
- if @profile.image_url && (photo.url(:thumb_medium) == @profile.image_url.sub(APP_CONFIG[:pod_url],'/'))
|
||||
- if @profile.image_url && @profile.image_url.include?(photo.url(:thumb_medium))
|
||||
%div.small_photo{:id => photo.url(:thumb_medium), :class=>'selected'}
|
||||
= check_box_tag 'checked_photo', true, true
|
||||
= link_to image_tag(photo.url(:thumb_medium)), "#"
|
||||
|
|
|
|||
|
|
@ -51,5 +51,6 @@ module Diaspora
|
|||
|
||||
# Configure sensitive parameters which will be filtered from the log file.
|
||||
config.filter_parameters += [:password]
|
||||
config.filter_parameters += [:xml]
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -7,4 +7,137 @@
|
|||
# See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
|
||||
|
||||
pt-BR:
|
||||
hello: "Olá Mundo"
|
||||
hello: "Olá mundo"
|
||||
layouts:
|
||||
application:
|
||||
edit_profile: "editar perfil"
|
||||
logout: "sair"
|
||||
shared:
|
||||
aspect_nav:
|
||||
all_aspects: "Todos Aspectos"
|
||||
manage: "Gerenciar"
|
||||
manage_your_aspects: "Gerencie seus Aspectos"
|
||||
sub_header:
|
||||
all_aspects: "Todos Aspectos"
|
||||
manage_aspects: "Gerenciar Aspectos"
|
||||
publisher:
|
||||
share: "Compartilhar"
|
||||
aspect_friends:
|
||||
add_friends: "adicionar amigos"
|
||||
albums:
|
||||
album:
|
||||
you: "você"
|
||||
new_album:
|
||||
create: "criar"
|
||||
add_a_new_album: "Adicionar novo álbum"
|
||||
show:
|
||||
edit_album: "Editar Álbum"
|
||||
albums: "álbuns"
|
||||
updated: "atualizado"
|
||||
by: "por"
|
||||
edit:
|
||||
editing: "Editando"
|
||||
updated: "atualizado"
|
||||
are_you_sure: "Tem certeza?"
|
||||
delete_album: "Excluir Álbum"
|
||||
cancel: "Cancelar"
|
||||
index:
|
||||
home: "home"
|
||||
new_album: "Novo Álbum"
|
||||
create:
|
||||
success: "Você criou com sucesso um álbum chamado %{name}."
|
||||
update:
|
||||
success: "O álbum %{name} foi editado com sucesso."
|
||||
failure: "Erro ao editar o álbum %{name}."
|
||||
destroy:
|
||||
success: "O álbum %{name} foi excluído com sucesso."
|
||||
aspects:
|
||||
index:
|
||||
photos: "photos"
|
||||
show:
|
||||
photos: "photos"
|
||||
manage:
|
||||
add_a_new_aspect: "Adicionar um novo aspecto"
|
||||
add_a_new_friend: "Adicionar um novo amigo"
|
||||
show: "Exibir"
|
||||
update_aspects: "Atualizar Aspectos"
|
||||
requests: "Solicitações"
|
||||
ignore_remove: "Ignorar/Excluir"
|
||||
new_aspect:
|
||||
add_a_new_aspect: "Adicionar um novo aspecto"
|
||||
create: "Criar"
|
||||
create:
|
||||
success:"Clique no mais(+) do lado esquerdo para dizer ao Diaspora quem pode ver seu novo aspecto."
|
||||
users:
|
||||
edit:
|
||||
cancel: "Cancelar"
|
||||
update_profile: "Atualizar Perfil"
|
||||
home: "Home"
|
||||
diaspora_username: "USUÁRIO DIASPORA"
|
||||
info: "Informações"
|
||||
picture: "Imagem"
|
||||
editing_profile: "Editando perfil"
|
||||
albums: "Álbuns"
|
||||
you_dont_have_any_photos: "Você não possui nenhuma photo! Vá para"
|
||||
page_to_upload_some: "para fazer o upload de alguma."
|
||||
comments:
|
||||
comment:
|
||||
ago: "atrás"
|
||||
new_comment:
|
||||
comment: "Comentário"
|
||||
photos:
|
||||
show:
|
||||
prev: "anterior"
|
||||
full_size: "tamanho máximo"
|
||||
next: "próxima"
|
||||
edit_photo: "Editar Foto"
|
||||
delete_photo: "Excluir Foto"
|
||||
are_you_sure: "Tem certeza?"
|
||||
comments: "comentários"
|
||||
edit:
|
||||
editing: "Editando"
|
||||
are_you_sure: "Tem certeza?"
|
||||
delete_photo: "Excluir Foto"
|
||||
photo:
|
||||
show_comments: "exibir comentários"
|
||||
posted_a_new_photo_to: "enviada um nova foto para"
|
||||
new:
|
||||
new_photo: "Nova Foto"
|
||||
back_to_list: "Voltar para a Lista"
|
||||
post_it: "enviar!"
|
||||
registrations:
|
||||
new:
|
||||
sign_up: "Cadastro"
|
||||
status_messages:
|
||||
new_status_message:
|
||||
tell_me_something_good: "diga-me qualquer coisa legal"
|
||||
oh_yeah: "É isso aí!"
|
||||
status_message:
|
||||
show_comments: "exibir comentários"
|
||||
delete: "Excluir"
|
||||
are_you_sure: "Tem certeza?"
|
||||
show:
|
||||
status_message: "Mensagem de Status"
|
||||
comments: "comentários"
|
||||
are_you_sure: "Tem certeza?"
|
||||
destroy: "Excluir"
|
||||
view_all: "Exibir Todas"
|
||||
message: "Mensagem"
|
||||
owner: "Pertence a"
|
||||
people:
|
||||
index:
|
||||
add_friend: "adicionar amigo(a)"
|
||||
real_name: "nome real"
|
||||
diaspora_handle: "diaspora handle"
|
||||
thats_you: "esse é você!"
|
||||
friend_request_pending: "pedido de amizade pendente"
|
||||
you_have_a_friend_request_from_this_person: "você possui um pedido de amizade dessa pessoa"
|
||||
new:
|
||||
new_person: "Nova Pessoa"
|
||||
back_to_list: "Voltar para a Lista"
|
||||
show:
|
||||
last_seen: "visto pela última vez a: %{how_long_ago}"
|
||||
friends_since: "amigos desde: %{how_long_ago}"
|
||||
save: "salvar"
|
||||
are_you_sure: "Tem certeza?"
|
||||
remove_friend: "excluir amigo"
|
||||
|
|
|
|||
|
|
@ -8,6 +8,9 @@ module Diaspora
|
|||
module UserModules
|
||||
module Friending
|
||||
def send_friend_request_to(desired_friend, aspect)
|
||||
# should have different exception types for these?
|
||||
raise "You have already sent a friend request to that person!" if self.pending_requests.detect{
|
||||
|x| x.destination_url == desired_friend.receive_url }
|
||||
raise "You are already friends with that person!" if self.friends.detect{
|
||||
|x| x.receive_url == desired_friend.receive_url}
|
||||
request = Request.instantiate(
|
||||
|
|
|
|||
Loading…
Reference in a new issue