diff --git a/README.md b/README.md index 2398be5dc..066e4171c 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ After you have Ruby installed on your system, you will need to get RubyGems, the - [RubyGems](http://rubygems.org/) - Source for Ruby gems. - [Bundler](http://gembundler.com/) - Gem management tool for Ruby projects. -**We suggest using a package management system to download these dependencies. Trust us, it's going to make your life a lot easier. If you're using Mac OS X, you can use [homebrew](http://mxcl.github.com/homebrew/); if you're using Ubuntu, just use [Synaptic](http://www.nongnu.org/synaptic/) (it comes pre-installed); if you're using Fedora simply use [yum](http://yum.baseurl.org/). The instructions below assume you have these installed.** +**We suggest using a package management system to download these dependencies. Trust us, it's going to make your life a lot easier. If you're using Mac OS X, you can use [homebrew](http://mxcl.github.com/homebrew/); if you're using Ubuntu, just use [Synaptic](http://www.nongnu.org/synaptic/) (it comes pre-installed); if you're using Fedora simply use [yum](http://yum.baseurl.org/). The instructions below assume you have these installed.** ### Build Tools @@ -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 @@ -89,7 +91,7 @@ If you're running a 32-bit system, run `wget http://fastdl.mongodb.org/linux/mon # create the required data directory sudo mkdir -p /data/db sudo chmod -Rv 777 /data/ - + To install MongoDB on a x86_64 **Fedora** system, add the official MongoDB repository from MongoDB (http://www.mongodb.org/display/DOCS/CentOS+and+Fedora+Packages) into /etc/yum.repos.d/10gen.repo: @@ -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 @@ -139,11 +143,11 @@ To install ImageMagick on **Mac OS X**, run the following: ### Git To install Git on **Ubuntu**, run the following: - + sudo apt-get install git-core To install Git on **Fedora**, run the following: - + sudo yum install git @@ -233,5 +237,5 @@ Diaspora is free software: you can redistribute it and/or modify it under the te Diaspora is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. -You should have received a copy of the GNU Affero General Public License along with Diaspora. If not, see . +You should have received a copy of the GNU Affero General Public License along with Diaspora. If not, see . diff --git a/app/models/post.rb b/app/models/post.rb index 9f7c3ff27..e9e135abb 100644 --- a/app/models/post.rb +++ b/app/models/post.rb @@ -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! diff --git a/app/views/photos/_new_photo.haml b/app/views/photos/_new_photo.haml index f6777fa4a..0f1e423fb 100644 --- a/app/views/photos/_new_photo.haml +++ b/app/views/photos/_new_photo.haml @@ -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; diff --git a/config/initializers/locale.rb b/config/initializers/locale.rb new file mode 100644 index 000000000..42f34a3a7 --- /dev/null +++ b/config/initializers/locale.rb @@ -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 \ No newline at end of file diff --git a/config/locales/devise.es.yml b/config/locales/devise.es.yml new file mode 100644 index 000000000..70209ff79 --- /dev/null +++ b/config/locales/devise.es.yml @@ -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' \ No newline at end of file diff --git a/config/locales/devise.lt.yml b/config/locales/devise.lt.yml new file mode 100644 index 000000000..d6e33c1cb --- /dev/null +++ b/config/locales/devise.lt.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. + + +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' diff --git a/config/locales/lt.yml b/config/locales/lt.yml new file mode 100644 index 000000000..e1a529431 --- /dev/null +++ b/config/locales/lt.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. + +lt: + hello: "Sveikas pasauli" diff --git a/public/javascripts/aspect-edit.js b/public/javascripts/aspect-edit.js index 86c61ba93..c7061797d 100644 --- a/public/javascripts/aspect-edit.js +++ b/public/javascripts/aspect-edit.js @@ -3,41 +3,54 @@ * 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({ - revert: true + + + $('#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 .requested_person").draggable({ + $("ul .person .requested_person").draggable({ revert: true }); + // Moved class to logic above - unnec duplicate logic + //$("ul .requested_person").draggable({ + // revert: true + //}); + $(".aspect ul").droppable({ hoverClass: 'active', drop: function(event, ui) { @@ -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,44 +96,51 @@ $(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(); + } }); - 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.") + } }); - alert("Removed Friend, proably want an undo countdown.") - $(ui.draggable[0]).fadeOut('slow') - + } + + $(ui.draggable[0]).fadeOut('slow'); // ui.draggable.fadeOut('slow') } }); -}); -$(".aspect h1").live( 'focus', function() { - var $this = $(this); - var id = $this.closest("li").children("ul").attr("id"); - var link = "/aspects/"+ id; + $(".aspect h1").live( 'focus', function() { - $this.keypress(function(e) { - if (e.which == 13) { - e.preventDefault(); - $this.blur(); + var $this = $(this), + id = $this.closest("li").children("ul").attr("id"), + link = "/aspects/"+ id; - //save changes - $.ajax({ - type: "PUT", - url: link, - data: {"aspect" : {"name" : $this.text() }} + $this.keypress(function(e) { + if (e.which == 13) { + e.preventDefault(); + $this.blur(); + + //save changes + $.ajax({ + type: "PUT", + url: link, + data: {"aspect" : {"name" : $this.text() }} + }); + } + //update all other aspect links + $this.keyup(function(e) { + $("#aspect_nav a[href='"+link+"']").text($this.text()); }); - } - //update all other aspect links - $this.keyup(function(e) { - $("#aspect_nav a[href='"+link+"']").text($this.text()); }); }); + }); diff --git a/script/server b/script/server index 0094482b1..3804ccad9 100755 --- a/script/server +++ b/script/server @@ -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 +