Merge branch 'master' of github.com:diaspora/diaspora
This commit is contained in:
commit
01e3bdaa29
9 changed files with 207 additions and 67 deletions
|
|
@ -56,6 +56,8 @@ 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.
|
||||
|
||||
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:
|
||||
|
||||
./script/bootstrap-fedora-diaspora.sh
|
||||
|
|
@ -71,7 +73,7 @@ To install MongoDB on **Ubuntu**, add the official MongoDB repository from this
|
|||
|
||||
http://www.mongodb.org/display/DOCS/Ubuntu+and+Debian+packages
|
||||
|
||||
For Lucid, add the following line to your /etc/apt/sources.list:
|
||||
For Lucid, add the following line to your /etc/apt/sources.list (for other distros, see http://www.mongodb.org/display/DOCS/Ubuntu+and+Debian+packages):
|
||||
|
||||
deb http://downloads.mongodb.org/distros/ubuntu 10.4 10gen
|
||||
|
||||
|
|
@ -117,6 +119,8 @@ If you're running a 32-bit system, run `wget http://fastdl.mongodb.org/linux/mon
|
|||
To install MongoDB on **Mac OS X**, run the following:
|
||||
|
||||
brew install mongo
|
||||
sudo mkdir -p /data/db
|
||||
sudo chmod -Rv 777 /data/
|
||||
|
||||
### OpenSSL
|
||||
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ class Post
|
|||
key :person_id, ObjectId
|
||||
key :user_refs, Integer, :default => 0
|
||||
|
||||
many :comments, :class_name => 'Comment', :foreign_key => :post_id
|
||||
many :comments, :class_name => 'Comment', :foreign_key => :post_id, :order => 'created_at ASC'
|
||||
belongs_to :person, :class_name => 'Person'
|
||||
|
||||
timestamps!
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
element: document.getElementById('file-upload'),
|
||||
params: {'album_id' : "#{@album.id}"},
|
||||
allowedExtensions: ['jpg', 'jpeg', 'png'],
|
||||
action: "/photos"
|
||||
action: "#{photos_path}"
|
||||
});
|
||||
}
|
||||
window.onload = createUploader;
|
||||
|
|
|
|||
8
config/initializers/locale.rb
Normal file
8
config/initializers/locale.rb
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
# Copyright (c) 2010, Diaspora Inc. This file is
|
||||
# licensed under the Affero General Public License version 3. See
|
||||
# the COPYRIGHT file.
|
||||
|
||||
|
||||
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
|
||||
I18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
|
||||
I18n.default_locale = :en
|
||||
42
config/locales/devise.es.yml
Normal file
42
config/locales/devise.es.yml
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
es:
|
||||
errors:
|
||||
messages:
|
||||
not_found: 'no encontrado'
|
||||
already_confirmed: 'ya ha sido confirmada'
|
||||
not_locked: 'no está bloqueada'
|
||||
|
||||
devise:
|
||||
failure:
|
||||
unauthenticated: 'Necesitas acceder a tu cuenta o registrarte antes de continuar.'
|
||||
unconfirmed: 'Necesitas confirmar tu cuenta antes de continuar.'
|
||||
locked: 'Tu cuenta esta bloqueada.'
|
||||
invalid: 'Contraseña o Email incorrecto.'
|
||||
invalid_token: 'Token de autenticación incorrecto.'
|
||||
timeout: 'Tu sesión ha expirado, por favor accede de nuevo para continuar.'
|
||||
inactive: 'Tu cuenta no ha sido activada.'
|
||||
sessions:
|
||||
signed_in: 'Has ingresado correctamente.'
|
||||
signed_out: 'Has salido correctamente.'
|
||||
passwords:
|
||||
send_instructions: 'Recibirás un email con instrucciones para cambiar tu contraseña en poco minutos.'
|
||||
updated: 'Tu contraseña ha sido modificada. Ya has accedido a tu cuenta.'
|
||||
confirmations:
|
||||
send_instructions: 'Recibirás un email con instrucciones para confirmar tu cuenta en poco minutos.'
|
||||
confirmed: 'Tu cuenta ha sido confirmada. Ya has accedido a tu cuenta.'
|
||||
registrations:
|
||||
signed_up: 'Te has registrado correctamente. Si está disponible, te habremos enviado un email de confirmación.'
|
||||
updated: 'Has actualizado tu cuenta correctamente.'
|
||||
destroyed: '!Adiós! Tu cuenta ha sido cancelada. Esperamos verte pronto.'
|
||||
unlocks:
|
||||
send_instructions: 'Recibirás un email con instrucciones para desbloquear tu cuenta en pocos minutos.'
|
||||
unlocked: 'Tu cuenta ha sido desbloqueada. Ya has accedido a tu cuenta.'
|
||||
oauth_callbacks:
|
||||
success: 'Has sido autorizado satisfactoriamente de la cuenta %{kind}.'
|
||||
failure: 'No has sido autorizado en la cuenta %{kind} porque "%{reason}".'
|
||||
mailer:
|
||||
confirmation_instructions:
|
||||
subject: 'Instrucciones de confirmación'
|
||||
reset_password_instructions:
|
||||
subject: 'Instrucciones para cambiar tu contraseña'
|
||||
unlock_instructions:
|
||||
subject: 'Instrucciones para desbloquear tu cuenta'
|
||||
41
config/locales/devise.lt.yml
Normal file
41
config/locales/devise.lt.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.
|
||||
|
||||
|
||||
lt:
|
||||
errors:
|
||||
messages:
|
||||
not_found: "nerasta"
|
||||
already_confirmed: "jau patvirtinta"
|
||||
not_locked: "nebuvo užrakinta"
|
||||
|
||||
devise:
|
||||
failure:
|
||||
unauthenticated: 'Norint tęsti, reikia prisijungti arba susikurti paskyrą.'
|
||||
unconfirmed: 'Norint prisijungti, reikia patvirtinti savo paskyrą.'
|
||||
locked: 'Jūsų paskyra yra užrakinta.'
|
||||
invalid: 'Neteisingas el. pašto adresas arba slaptažodis.'
|
||||
invalid_token: 'Neteisingas prisijungimo raktas.'
|
||||
timeout: 'Sesija baigėsi. Norint tęsti, reikia prisijungti iš naujo.'
|
||||
inactive: 'Paskyra dar neaktyvuota.'
|
||||
sessions:
|
||||
signed_in: 'Sėkmingai prisijungta.'
|
||||
signed_out: 'Sėkmingai atsijungta.'
|
||||
passwords:
|
||||
send_instructions: 'Netrukus gausite el. laišką su nurodymais slaptažodžiui atstatyti.'
|
||||
updated: 'Slaptažodis pakeistas sėkmingai. Jūs esate prisijungęs.'
|
||||
confirmations:
|
||||
send_instructions: 'Netrukus gausite el. laišką su nurodymais paskyros patvirtinimui.'
|
||||
confirmed: 'Paskyra patvirtinta. Prisijungėte.'
|
||||
registrations:
|
||||
signed_up: 'Prisijungta sėkmingai. Jei nustatyta, patvirtinimas išsiųstas į jūsų el. paštą.'
|
||||
updated: 'Paskyra atnaujinta sėkmingai.'
|
||||
destroyed: 'Paskyra sėkmingai atšaukta. Iki pasimatymo!'
|
||||
unlocks:
|
||||
send_instructions: 'Netrukus gausite el. laišką su nurodymais paskyros atrakinimui.'
|
||||
unlocked: 'Paskyra atrakinta. Prisijungėte.'
|
||||
mailer:
|
||||
confirmation_instructions: 'Nurodymai patvirtinimui'
|
||||
reset_password_instructions: 'Nurodymai slaptažodžio atstatymui'
|
||||
unlock_instructions: 'Nurodymai paskyros atrakinimui'
|
||||
10
config/locales/lt.yml
Normal file
10
config/locales/lt.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.
|
||||
|
||||
lt:
|
||||
hello: "Sveikas pasauli"
|
||||
|
|
@ -3,40 +3,53 @@
|
|||
* the COPYRIGHT file.
|
||||
*/
|
||||
|
||||
|
||||
$('#move_friends_link').live( 'click', function(){
|
||||
$.post('/aspects/move_friends',
|
||||
{ 'moves' : $('#aspect_list').data() },
|
||||
function(){ $('#aspect_title').html("Groups edited successfully!");});
|
||||
|
||||
$(".person").css('background-color','none');
|
||||
$('#aspect_list').removeData();
|
||||
$(".person").attr('from_aspect_id', function(){return $(this).parent().attr('id')})
|
||||
|
||||
});
|
||||
|
||||
function decrementRequestsCounter(){
|
||||
var old_request_count = $(".new_requests").html().match(/\d+/);
|
||||
function decrementRequestsCounter() {
|
||||
var $new_requests = $(".new_requests"),
|
||||
request_html = $new_requests.html(),
|
||||
old_request_count = request_html.match(/\d+/);
|
||||
|
||||
if( old_request_count == 1 ) {
|
||||
$(".new_requests").html(
|
||||
$(".new_requests").html().replace(/ \(\d+\)/,''));
|
||||
|
||||
$new_requests.html(
|
||||
request_html.replace(/ \(\d+\)/,'')
|
||||
);
|
||||
} else {
|
||||
$(".new_requests").html(
|
||||
$(".new_requests").html().replace(/\d+/,old_request_count-1));
|
||||
$new_requests.html(
|
||||
request_html.replace(/\d+/,old_request_count-1)
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$(function() {
|
||||
$("ul .person").draggable({
|
||||
|
||||
|
||||
$('#move_friends_link').live( 'click', function(){
|
||||
$.post(
|
||||
'/aspects/move_friends',
|
||||
{ 'moves' : $('#aspect_list').data() },
|
||||
function() {
|
||||
$('#aspect_title').html("Groups edited successfully!");
|
||||
}
|
||||
);
|
||||
|
||||
// should the following logic be moved into the $.post() callback?
|
||||
$("#aspect_list").removeData();
|
||||
|
||||
$(".person")
|
||||
.css('background-color','none')
|
||||
.attr('from_aspect_id', function() {
|
||||
return $(this).parent().attr('id')
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
$("ul .person .requested_person").draggable({
|
||||
revert: true
|
||||
});
|
||||
|
||||
$("ul .requested_person").draggable({
|
||||
revert: true
|
||||
});
|
||||
// Moved class to logic above - unnec duplicate logic
|
||||
//$("ul .requested_person").draggable({
|
||||
// revert: true
|
||||
//});
|
||||
|
||||
$(".aspect ul").droppable({
|
||||
hoverClass: 'active',
|
||||
|
|
@ -52,16 +65,23 @@ $(function() {
|
|||
}
|
||||
});
|
||||
|
||||
}else {
|
||||
var move = {};
|
||||
move[ 'friend_id' ] = ui.draggable[0].id
|
||||
move[ 'to' ] = $(this)[0].id;
|
||||
move[ 'from' ] = ui.draggable[0].getAttribute('from_aspect_id');
|
||||
} else {
|
||||
var $aspect_list = $('#aspect_list'),
|
||||
move = {};
|
||||
|
||||
// This is poor implementation
|
||||
move[ 'friend_id' ] = ui.draggable[0].id; // ui.draggable.attr('id')
|
||||
move[ 'to' ] = $(this)[0].id;// $(this).attr('id');
|
||||
move[ 'from' ] = ui.draggable[0].getAttribute('from_aspect_id'); // ui.draggable.attr('from_aspect_id')
|
||||
|
||||
// if created custom attr's - should be using `data-foo`
|
||||
|
||||
|
||||
if (move['to'] == move['from']){
|
||||
$('#aspect_list').data( ui.draggable[0].id, []);
|
||||
$aspect_list.data( ui.draggable[0].id, []);
|
||||
ui.draggable.css('background-color','#eee');
|
||||
} else {
|
||||
$('#aspect_list').data( ui.draggable[0].id, move);
|
||||
$aspect_list.data( ui.draggable[0].id, move);
|
||||
ui.draggable.css('background-color','orange');
|
||||
}
|
||||
}
|
||||
|
|
@ -76,28 +96,33 @@ $(function() {
|
|||
if ($(ui.draggable[0]).hasClass('requested_person')){
|
||||
$.ajax({
|
||||
type: "DELETE",
|
||||
url: "/requests/" + ui.draggable[0].getAttribute('request_id')
|
||||
});
|
||||
url: "/requests/" + ui.draggable.attr('request_id'),
|
||||
success: function () {
|
||||
decrementRequestsCounter();
|
||||
$(ui.draggable[0]).fadeOut('slow')
|
||||
}else{
|
||||
}
|
||||
});
|
||||
|
||||
} else {
|
||||
$.ajax({
|
||||
type: "DELETE",
|
||||
url: "/people/" + ui.draggable[0].id
|
||||
});
|
||||
url: "/people/" + ui.draggable.attr('id'),
|
||||
success: function () {
|
||||
alert("Removed Friend, proably want an undo countdown.")
|
||||
$(ui.draggable[0]).fadeOut('slow')
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$(".aspect h1").live( 'focus', function() {
|
||||
}
|
||||
|
||||
var $this = $(this);
|
||||
var id = $this.closest("li").children("ul").attr("id");
|
||||
var link = "/aspects/"+ id;
|
||||
$(ui.draggable[0]).fadeOut('slow'); // ui.draggable.fadeOut('slow')
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
$(".aspect h1").live( 'focus', function() {
|
||||
|
||||
var $this = $(this),
|
||||
id = $this.closest("li").children("ul").attr("id"),
|
||||
link = "/aspects/"+ id;
|
||||
|
||||
$this.keypress(function(e) {
|
||||
if (e.which == 13) {
|
||||
|
|
@ -116,4 +141,6 @@ $(".aspect h1").live( 'focus', function() {
|
|||
$("#aspect_nav a[href='"+link+"']").text($this.text());
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,5 +1,13 @@
|
|||
#!/bin/bash
|
||||
|
||||
mkdir -p -v log/thin/
|
||||
bundle exec ruby ./script/websocket_server.rb&
|
||||
bundle exec thin start $@
|
||||
# Check if Mongo is running
|
||||
|
||||
if ! ps ax | grep -v grep | grep mongod >/dev/null
|
||||
then
|
||||
echo "Mongod not started"
|
||||
else
|
||||
mkdir -p -v log/thin/
|
||||
bundle exec ruby ./script/websocket_server.rb&
|
||||
bundle exec thin start $@
|
||||
fi
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue