diff --git a/.gitignore b/.gitignore index 0025a86f53a22fea18824e93fa20865a1f343bb9..d02467332235dbd662db0ca040f361d16a771390 100644 --- a/.gitignore +++ b/.gitignore @@ -13,4 +13,8 @@ gpg/diaspora-production/*.gpg gpg/*/random_seed public/uploads/* .rvmrc +.DS_Store config/app_config.yml +bin/* +nbproject +config/initializers/secret_token.rb diff --git a/COPYRIGHT b/COPYRIGHT index f1bed1a6b30769f7f9d1bade1bf007066e75a4f6..b150ae948a06bb371b63a82cef02a33e0dfaa5f5 100644 --- a/COPYRIGHT +++ b/COPYRIGHT @@ -16,8 +16,8 @@ including the two. You must obey the GNU Affero General Public License V3 or later in all respects for all of the code used other than OpenSSL or the components mentioned -above. If you modify file(s) with this exception, you may extend this -exception to your version of the file(s), but you are not obligated to +above. If you modify file(s) with this exception, you may extend this +exception to your version of the file(s), but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your -version. If you delete this exception statement from all source files in the +version. If you delete this exception statement from all source files in the program, then also delete it here. diff --git a/Capfile b/Capfile index af77f235a5711b661e66a9b8ee36ff2bf3a47124..306a9d64b4d13679a3e274e38b23d7d616826fcb 100644 --- a/Capfile +++ b/Capfile @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - load 'deploy' if respond_to?(:namespace) # cap2 differentiator Dir['vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) } diff --git a/Gemfile b/Gemfile index 18cfef69200d0de7b6b00522215d56e55b982f5c..16788eeb3a79d1c3f4cea600e9ccb83b20a56f68 100644 --- a/Gemfile +++ b/Gemfile @@ -3,13 +3,11 @@ source 'http://rubygems.org' gem 'rails', '3.0.0' gem 'bundler', '1.0.0' - #Security gem 'devise', :git => 'http://github.com/BadMinus/devise.git' #Mongo -gem 'mongo_mapper', '0.8.4', :git => 'http://github.com/jnunemaker/mongomapper.git' -gem 'jnunemaker-validatable', '1.8.4', :git => 'http://github.com/jnunemaker/validatable.git' +gem 'mongo_mapper', :branch => 'rails3', :git => 'http://github.com/jnunemaker/mongomapper.git' gem 'bson_ext', '1.0.7' gem 'bson', '1.0.7' @@ -41,24 +39,23 @@ gem 'mini_magick' group :test, :development do gem 'factory_girl_rails' + gem 'ruby-debug' if RUBY_VERSION.include? "1.8" end group :test do - gem 'rspec', '>= 2.0.0.beta.17' - gem 'rspec-rails', '2.0.0.beta.17' + gem 'capybara', '~> 0.3.9' + gem 'cucumber-rails', '0.3.2' + gem 'rspec', '>= 2.0.0.beta.17' + gem 'rspec-rails', '2.0.0.beta.17' gem 'mocha' - gem 'webrat', '0.7.2.beta.1' - gem 'redgreen' + gem 'redgreen' if RUBY_VERSION.include? "1.8" gem 'autotest' gem 'database_cleaner' - gem 'saucelabs-adapter', '= 0.8.12' - gem 'selenium-rc' gem 'webmock' end group :development do gem 'nifty-generators' - gem 'ruby-debug' end group :deployment do diff --git a/Gemfile.lock b/Gemfile.lock index 68cf442726a30d8aeb302633e68e89b7a4c1ec64..8534f580a340b0066a067016c09cbc69da4a288f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -57,20 +57,14 @@ GIT GIT remote: http://github.com/jnunemaker/mongomapper.git - revision: 931dab779011aa7acf60c1a4c7ad19e1ba838345 + revision: b0eac421ef5b3bee782e15d391eca372a189d414 + branch: rails3 specs: mongo_mapper (0.8.4) - activesupport (>= 2.3.4) - jnunemaker-validatable (~> 1.8.4) + activemodel (~> 3.0.0) + activesupport (~> 3.0.0) plucky (~> 0.3.5) -GIT - remote: http://github.com/jnunemaker/validatable.git - revision: 8d7c3ce14133760e748a0e34b99dfe6ec4d69153 - specs: - jnunemaker-validatable (1.8.4) - activesupport (>= 2.3.4) - GEM remote: http://rubygems.org/ specs: @@ -115,8 +109,24 @@ GEM net-sftp (>= 2.0.0) net-ssh (>= 2.0.14) net-ssh-gateway (>= 1.0.0) + capybara (0.3.9) + culerity (>= 0.2.4) + mime-types (>= 1.16) + nokogiri (>= 1.3.3) + rack (>= 1.0.0) + rack-test (>= 0.5.4) + selenium-webdriver (>= 0.0.3) columnize (0.3.1) crack (0.1.8) + cucumber (0.9.0) + builder (~> 2.1.2) + diff-lcs (~> 1.1.2) + gherkin (~> 2.2.2) + json (~> 1.4.6) + term-ansicolor (~> 1.0.5) + cucumber-rails (0.3.2) + cucumber (>= 0.8.0) + culerity (0.2.12) daemons (1.1.0) database_cleaner (0.5.2) diff-lcs (1.1.2) @@ -130,13 +140,19 @@ GEM factory_girl_rails (1.0) factory_girl (~> 1.3) rails (>= 3.0.0.beta4) + ffi (0.6.3) + rake (>= 0.8.7) + gherkin (2.2.4) + json (~> 1.4.6) + term-ansicolor (~> 1.0.5) + trollop (~> 1.16.2) haml (3.0.18) hashie (0.4.0) highline (1.6.1) i18n (0.4.1) json (1.4.6) + json_pure (1.4.6) linecache (0.43) - lsof (0.3.0) mail (2.2.6.1) activesupport (>= 2.3.6) mime-types @@ -206,16 +222,13 @@ GEM ruby-debug-base (~> 0.10.3.0) ruby-debug-base (0.10.3) linecache (>= 0.3) - saucelabs-adapter (0.8.12) - lsof (>= 0.3.0) - net-ssh (>= 2.0.12) - net-ssh-gateway (>= 1.0.1) - rest-client (>= 1.2.0) - selenium-client (>= 1.2.17) - selenium-client (1.2.18) - selenium-rc (2.2.4) - selenium-client (>= 1.2.18) + rubyzip (0.9.4) + selenium-webdriver (0.0.28) + ffi (>= 0.6.1) + json_pure + rubyzip subexec (0.0.4) + term-ansicolor (1.0.5) thin (1.2.7) daemons (>= 1.0.9) eventmachine (>= 0.12.6) @@ -223,6 +236,7 @@ GEM thor (0.14.0) treetop (1.4.8) polyglot (>= 0.3.1) + trollop (1.16.2) tzinfo (0.3.23) uuidtools (2.1.1) warden (0.10.7) @@ -245,20 +259,21 @@ DEPENDENCIES bson (= 1.0.7) bson_ext (= 1.0.7) bundler (= 1.0.0) + capybara (~> 0.3.9) carrierwave! + cucumber-rails (= 0.3.2) database_cleaner devise! em-http-request! em-websocket factory_girl_rails haml - jnunemaker-validatable (= 1.8.4)! json magent! mini_fb mini_magick mocha - mongo_mapper (= 0.8.4)! + mongo_mapper! nifty-generators pubsubhubbub rails (= 3.0.0) @@ -268,10 +283,7 @@ DEPENDENCIES rspec (>= 2.0.0.beta.17) rspec-rails (= 2.0.0.beta.17) ruby-debug - saucelabs-adapter (= 0.8.12) - selenium-rc sprinkle! thin webmock - webrat (= 0.7.2.beta.1) will_paginate (= 3.0.pre2) diff --git a/README.md b/README.md index 4e5152fbf4834e66c8286c7ddc51de89eebe24f1..c8f193afede1d4f39be4456b38dcebd62a4369b7 100644 --- a/README.md +++ b/README.md @@ -26,288 +26,12 @@ network. **PLEASE, DO NOT RUN IN PRODUCTION. IT IS FUN TO GET RUNNING, BUT EXPECT THINGS TO BE BROKEN** +Some initial installation instructions are [here](http://github.com/diaspora/diaspora/wiki/Installing-and-Running-Diaspora). + We are continuing to build features and improve the code base. -When we think it is ready for general use, we will post more detailed +When we think it is ready for general use, we will post more final instructions. -## Notice - -We currently run Diaspora with the [thin](http://code.macournoyer.com/thin/) as -our webserver, behind [nginx](http://wiki.nginx.org/Main). Diaspora uses the -asynchronous feature of [EventMachine](http://rubyeventmachine.com/) to send -messages between seeds, using the power of the -[Reactor](http://en.wikipedia.org/wiki/Reactor_pattern) pattern. If you use -mod_rails, mongrel, or another non-eventmachine based application server, -federation and/or websockets may not work. - -If you don't like thin, you can always try -[Rainbows!](http://rainbows.rubyforge.org/) We will try and fully support more -webservers later, but that is what works for now. - -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. -- [Ruby](http://www.ruby-lang.org) - The Ruby programming language. - (We're using **1.8.7**. It comes preinstalled on Mac OS X.) -- [MongoDB](http://www.mongodb.org) - A snappy noSQL database. -- [OpenSSL](http://www.openssl.org/) - An encryption library. - (It comes preinstalled on Mac OS X and Ubuntu.) -- [ImageMagick](http://www.imagemagick.org/) - An Image processing library used - to resize uploaded photos. -- [Git](http://git-scm.com/) - The fast version control system. - -After you have Ruby installed on your system, you will need to get RubyGems, -then install Bundler: - -- [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.** - -### Build Tools - -To install build tools on **Ubuntu**, run the following (includes the gcc and -xml parsing dependencies): - - sudo apt-get install build-essential libxslt1.1 libxslt1-dev libxml2 - -To install build tools on **Fedora**, run the following: - - sudo yum install libxslt libxslt-devel libxml2 libxml2-devel - -To install build tools on **Mac OS X**, you need to download and install -[Xcode](http://developer.apple.com/technologies/tools/xcode.html). - -### Ruby - -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 - -After reviewing and executing the above script you will need to follow the -"MongoDB" section and then you should skip all the way down to "Start Mongo". - -If you're on **Mac OS X**, you already have Ruby on your system. Yay! - -### MongoDB - -To install MongoDB on **Ubuntu**, add the official MongoDB repository -[here](http://www.mongodb.org/display/DOCS/Ubuntu+and+Debian+packages). - -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 - -Then run: - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10 - sudo apt-get update - sudo apt-get install mongodb-stable - -You can also run the binary directly by doing the following: - -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: - - wget http://fastdl.mongodb.org/linux/mongodb-linux-x86_64-1.6.2.tgz - -Then run: - - # extract - tar xzf mongodb-linux-i686-1.4.0.tgz - # 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: - - [10gen] - name=10gen Repository - baseurl=http://downloads.mongodb.org/distros/fedora/13/os/x86_64/ - gpgcheck=0 - enabled=1 - -Then use yum to install the packages: - - sudo yum install mongo-stable mongo-stable-server - -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 `wget -http://fastdl.mongodb.org/linux/mongodb-linux-x86_64-1.6.2.tgz`. - - # extract - tar xzf mongodb-linux-i686-1.4.0.tgz - # create the required data directory - sudo mkdir -p /data/db - sudo chmod -Rv 777 /data/ - -To install MongoDB on **Mac OS X**, run the following: - - brew install mongo - sudo mkdir -p /data/db - sudo chmod -Rv 777 /data/ - -### OpenSSL - -If you're running either **Ubuntu**, **Fedora** or **Mac OS X** you already -have OpenSSL installed! - -### ImageMagick - -To install ImageMagick on **Ubuntu**, run the following: - - sudo apt-get install imagemagick libmagick9-dev - -To install ImageMagick on **Fedora**, run the following: - - sudo yum install ImageMagick - -To install ImageMagick on **Mac OS X**, run the following: - - brew install imagemagick - -### 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 - - -To install Git on **Mac OS X**, run the following: - - brew install git - - -### Rubygems - -On **Ubuntu** 10.04, run the following: - - sudo add-apt-repository ppa:maco.m/ruby - sudo apt-get update - sudo apt-get install rubygems - -This PPA is maintained by an Ubuntu Developer. For Ubuntu 10.10, this version -of rubygems is in the repositories. - -On **Fedora**, run the following: - - sudo yum install rubygems - -On **Mac OS X**, RubyGems comes preinstalled; however, you might need to update -it for use with the latest Bundler. To update RubyGems, run `sudo gem update ---system`. - - -### Bundler - -After RubyGems is updated, simply run `sudo gem install bundler` to get -Bundler. If you're using Ubuntu repository .debs, bundler is found at -/var/lib/gems/1.8/bin/bundle - - -## Getting Diaspora - - git clone http://github.com/diaspora/diaspora.git - -If you have never used github before, their -[help desk](http://help.github.com/) has a pretty awesome guide on getting -setup. - - -## 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. - -If you installed the OsX package through "brew", MongoDB will need to be -started via `sudo launchctl load -/Library/LaunchDaemons/org.mongodb.mongod.plist`. (before you have to go to -/Library/LaunchDaemons and add a symlink to -/usr/local/Cellar/mongodb/1.6.2-x86_64/org.mongodb.mongod.plist) - -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 We are maintaining a @@ -318,6 +42,7 @@ file [bug reports](https://github.com/diaspora/diaspora/issues) right here on github. Ongoing discussion: + - [Diaspora Developer Google Group](http://groups.google.com/group/diaspora-dev) - [Diaspora Discussion Google Group](http://groups.google.com/group/diaspora-discuss) - [Diaspora Q&A site](http://diaspora.shapado.com/) @@ -326,7 +51,7 @@ Ongoing discussion: More general info and updates about the project can be found on: [Our blog](http://joindiaspora.com), -[and on Twitter](http://twitter.com/joindiaspora). +[and on Twitter](http://twitter.com/joindiaspora). Also, be sure to join the official [mailing list](http://http://eepurl.com/Vebk). If you wish to contact us privately about any exploits in Diaspora you may diff --git a/Rakefile b/Rakefile index c9b50786e2e9da6ebd05c25a907bbcc033772f8c..fa9be254a924b609d6ece3081039651634812374 100644 --- a/Rakefile +++ b/Rakefile @@ -2,12 +2,11 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - # Add your own tasks in files placed in lib/tasks ending in .rake, # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. require File.expand_path('../config/application', __FILE__) require 'rake' ENV['GNUPGHOME'] = File.expand_path("../../gpg/diaspora-#{Rails.env}/", __FILE__) + Diaspora::Application.load_tasks diff --git a/app/controllers/albums_controller.rb b/app/controllers/albums_controller.rb index d3cad54e25ca41f43d1cbd961d8a824f5bdd372c..9e48598302c26a42768fe5a7c0e9940df22dfb9c 100644 --- a/app/controllers/albums_controller.rb +++ b/app/controllers/albums_controller.rb @@ -20,7 +20,7 @@ class AlbumsController < ApplicationController data = clean_hash(params[:album]) @album = current_user.post(:album, data) - flash[:notice] = "You've created an album called #{@album.name}." + flash[:notice] = I18n.t 'albums.create.success', :name => @album.name redirect_to :action => :show, :id => @album.id, :aspect => aspect end @@ -31,7 +31,7 @@ class AlbumsController < ApplicationController def destroy @album = current_user.find_visible_post_by_id params[:id] @album.destroy - flash[:notice] = "Album #{@album.name} deleted." + flash[:notice] = I18n.t 'albums.destroy.success', :name => @album.name respond_with :location => albums_url end @@ -53,10 +53,10 @@ class AlbumsController < ApplicationController data = clean_hash(params[:album]) if current_user.update_post( @album, data ) - flash[:notice] = "Album #{@album.name} successfully edited." + flash[:notice] = I18n.t 'albums.update.success', :name => @album.name respond_with @album else - flash[:error] = "Failed to edit album #{@album.name}." + flash[:error] = I18n.t 'albums.update.failure', :name => @album.name render :action => :edit end end diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 2bf2bf17463396dda69fbca6c56b9076027fc8cb..46b011a618361a6b39a3ce4057b6131c9ce5490b 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - class ApplicationController < ActionController::Base protect_from_forgery :except => :receive diff --git a/app/controllers/aspects_controller.rb b/app/controllers/aspects_controller.rb index f05edfe6e0d50f765d0df6e9c89287240e795758..722828a2e9bb5ffb573e774c456b1475d95aff81 100644 --- a/app/controllers/aspects_controller.rb +++ b/app/controllers/aspects_controller.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - class AspectsController < ApplicationController before_filter :authenticate_user! @@ -15,8 +14,12 @@ class AspectsController < ApplicationController end def create - @aspect = current_user.aspect params[:aspect] - flash[:notice] = I18n.t('aspects.create.success') + @aspect = current_user.aspect(params[:aspect]) + if @aspect.valid? + flash[:notice] = I18n.t('aspects.create.success') + else + flash[:error] = I18n.t('aspects.create.failure') + end respond_with :location => aspects_manage_path end @@ -29,8 +32,8 @@ class AspectsController < ApplicationController begin current_user.drop_aspect @aspect - flash[:notice] = "#{@aspect.name} was successfully removed." - rescue RuntimeError => e + flash[:notice] = i18n.t 'aspects.destroy.success',:name => @aspect.name + rescue RuntimeError => e flash[:error] = e.message end @@ -64,7 +67,7 @@ class AspectsController < ApplicationController data = clean_hash(params[:aspect]) @aspect.update_attributes( data ) - flash[:notice] = "Your aspect, #{@aspect.name}, has been successfully edited." + flash[:notice] = i18n.t 'aspects.update.success',:name => @aspect.name respond_with @aspect end @@ -72,25 +75,25 @@ class AspectsController < ApplicationController params[:moves].each{ |move| move = move[1] unless current_user.move_friend(move) - flash[:error] = "Aspect editing failed for friend #{current_user.visible_person_by_id( move[:friend_id] ).real_name}." + flash[:error] = i18n.t 'aspects.move_friends.failure', :real_name => Person.find_by_id( move[:friend_id] ).real_name redirect_to aspects_manage_path return end } - flash[:notice] = "Aspects edited successfully." + flash[:notice] = i18n.t 'aspects.move_friends.success' redirect_to aspects_manage_path end def move_friend unless current_user.move_friend( :friend_id => params[:friend_id], :from => params[:from], :to => params[:to][:to]) - flash[:error] = "didn't work #{params.inspect}" + flash[:error] = I18n.t 'aspects.move_friend.error',:inspect => params.inspect end if aspect = current_user.aspect_by_id(params[:to][:to]) - flash[:notice] = "You are now showing your friend a different aspect of yourself." + flash[:notice] = I18n.t 'aspects.move_friend.success' render :nothing => true else - flash[:error] = "Invalid aspect id!" + flash[:notice] = I18n.t 'aspects.move_friend.failure' render aspects_manage_path end end diff --git a/app/controllers/comments_controller.rb b/app/controllers/comments_controller.rb index 4caeb1414281cae8d135330bf14ea73b5f5b179f..d1efc3e109c068970d1edbdfa0ff23b320fddd7b 100644 --- a/app/controllers/comments_controller.rb +++ b/app/controllers/comments_controller.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - class CommentsController < ApplicationController before_filter :authenticate_user! @@ -10,7 +9,7 @@ class CommentsController < ApplicationController respond_to :json, :only => :show def create - target = Post.find_by_id params[:comment][:post_id] + target = current_user.find_visible_post_by_id params[:comment][:post_id] text = params[:comment][:text] @comment = current_user.comment text, :on => target diff --git a/app/controllers/dev_utilities_controller.rb b/app/controllers/dev_utilities_controller.rb index 30d1a1799922ce1211fc5a1e3894e0d6f8808a0d..e8a40a4c2e87d2cbc5b6f4ec000d114415a03ec2 100644 --- a/app/controllers/dev_utilities_controller.rb +++ b/app/controllers/dev_utilities_controller.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - class DevUtilitiesController < ApplicationController before_filter :authenticate_user!, :except => [:set_backer_number] include ApplicationHelper @@ -16,7 +15,7 @@ class DevUtilitiesController < ApplicationController bkr_info.each do |backer| backer_email = "#{backer['username']}@#{backer['username']}.joindiaspora.com" rel_hash = relationship_flow(backer_email) - logger.info "Zombefriending #{backer['given_name']} #{backer['family_name']}" + logger.info "Zombiefriending #{backer['given_name']} #{backer['family_name']}" logger.info "Calling send_friend_request with #{rel_hash[:friend]} and #{current_user.aspects.first}" current_user.send_friend_request_to(rel_hash[:friend], current_user.aspects.first) end @@ -30,11 +29,6 @@ class DevUtilitiesController < ApplicationController } end - def backer_info - config = YAML.load_file(File.dirname(__FILE__) + '/../../config/deploy_config.yml') - config['servers']['backer'] - end - def set_backer_number render :nothing => true seed_num_hash = {:seed_number => params[:number]} @@ -44,7 +38,6 @@ class DevUtilitiesController < ApplicationController end def set_profile_photo - render :nothing => true album = Album.create(:person => current_user.person, :name => "Profile Photos") current_user.raw_visible_posts << album @@ -53,7 +46,7 @@ class DevUtilitiesController < ApplicationController backer_number = YAML.load_file(Rails.root.join('config','backer_number.yml'))[:seed_number].to_i username = backer_info[backer_number]['username'].gsub(/ /,'').downcase - @fixture_name = File.dirname(__FILE__) + "/../../public/images/user/#{username}.jpg" + @fixture_name = File.join(File.dirname(__FILE__), "..", "..", "public", "images", "user", "#{username}.jpg") photo = Photo.new(:person => current_user.person, :album => album) photo.image.store! File.open(@fixture_name) @@ -63,7 +56,6 @@ class DevUtilitiesController < ApplicationController current_user.raw_visible_posts << photo current_user.save - current_user.update_profile(:image_url => photo.url(:thumb_medium)) current_user.save end @@ -73,4 +65,11 @@ class DevUtilitiesController < ApplicationController render "shared/log" end + + protected + + def backer_info + config = YAML.load_file(File.join(File.dirname(__FILE__), "..", "..", "config", "deploy_config.yml")) + config['servers']['backer'] + end end diff --git a/app/controllers/people_controller.rb b/app/controllers/people_controller.rb index 08acdd4241dd3980bf766d4e76c439621ccc9241..a8b8fffc053143ef8fcfda5dd14f57dbb538c332 100644 --- a/app/controllers/people_controller.rb +++ b/app/controllers/people_controller.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - class PeopleController < ApplicationController before_filter :authenticate_user! diff --git a/app/controllers/photos_controller.rb b/app/controllers/photos_controller.rb index d0cb1871e41317b01a1069ed5818e4299950ac4b..4d865573c8c85ecd5e5ac96350403ad2aab131f5 100644 --- a/app/controllers/photos_controller.rb +++ b/app/controllers/photos_controller.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - class PhotosController < ApplicationController before_filter :authenticate_user! @@ -19,9 +18,15 @@ class PhotosController < ApplicationController # get file content type att_content_type = (request.content_type.to_s == "") ? "application/octet-stream" : request.content_type.to_s # create temporal file - file = Tempfile.new(file_name) + begin + file = Tempfile.new(file_name, {:encoding => 'BINARY'}) + file.print request.raw_post.force_encoding('BINARY') + rescue RuntimeError => e + raise e unless e.message.include?('cannot generate tempfile') + file = Tempfile.new(file_name) # Ruby 1.8 compatibility + file.print request.raw_post + end # put data into this file from raw post request - file.print request.raw_post # create several required methods for this temporal file Tempfile.send(:define_method, "content_type") {return att_content_type} @@ -29,12 +34,10 @@ class PhotosController < ApplicationController ############## - params[:user_file] = file data = clean_hash(params) - @photo = current_user.post(:photo, data) respond_to do |format| @@ -42,15 +45,15 @@ class PhotosController < ApplicationController end rescue TypeError - message = "Photo upload failed. Are you sure an image was added?" + message = I18n.t 'photos.create.type_error' respond_with :location => album, :error => message rescue CarrierWave::IntegrityError - message = "Photo upload failed. Are you sure that was an image?" + message = I18n.t 'photos.create.integrity_error' respond_with :location => album, :error => message rescue RuntimeError => e - message = "Photo upload failed. Are you sure that your seatbelt is fastened?" + message = I18n.t 'photos.create.runtime_error' respond_with :location => album, :error => message raise e end @@ -66,7 +69,7 @@ class PhotosController < ApplicationController @photo = current_user.find_visible_post_by_id params[:id] @photo.destroy - flash[:notice] = "Photo deleted." + flash[:notice] = I18n.t 'photos.destroy.notice' respond_with :location => @photo.album end @@ -89,15 +92,14 @@ class PhotosController < ApplicationController data = clean_hash(params) if current_user.update_post( @photo, data[:photo] ) - flash[:notice] = "Photo successfully updated." + flash[:notice] = I18n.t 'photos.update.notice' respond_with @photo else - flash[:error] = "Failed to edit photo." + flash[:error] = I18n.t 'photos.update.error' render :action => :edit end end - private def clean_hash(params) if params[:photo] diff --git a/app/controllers/publics_controller.rb b/app/controllers/publics_controller.rb index d7f4825decee6e670b0f3e2abb194b483a4abd9b..fcfdb0db671030a930b6ba406cfa229c106bf64e 100644 --- a/app/controllers/publics_controller.rb +++ b/app/controllers/publics_controller.rb @@ -2,9 +2,8 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - class PublicsController < ApplicationController - require 'lib/diaspora/parser' + require File.expand_path('../../../lib/diaspora/parser', __FILE__) include Diaspora::Parser layout false @@ -20,7 +19,7 @@ class PublicsController < ApplicationController end def webfinger - @person = Person.by_webfinger(params[:q], :local => true) + @person = Person.by_webfinger(params[:q], :local => true) if params[:q] unless @person.nil? || @person.owner.nil? render 'webfinger', :content_type => 'application/xrd+xml' else diff --git a/app/controllers/registrations_controller.rb b/app/controllers/registrations_controller.rb index d1f0718bc5c14c6d063c06bfff431b7c44903398..b630c6617d240c7617067e096aac664c32681cf2 100644 --- a/app/controllers/registrations_controller.rb +++ b/app/controllers/registrations_controller.rb @@ -15,7 +15,7 @@ class RegistrationsController < Devise::RegistrationsController flash[:error] = e.message end if user - flash[:notice] = "You've joined Diaspora!" + flash[:notice] = I18n.t 'registrations.create.success' sign_in_and_redirect(:user, user) else redirect_to new_user_registration_path diff --git a/app/controllers/requests_controller.rb b/app/controllers/requests_controller.rb index 2a8090c9ed4948011eb056f121ca6fb3ab24988d..31c6e6efd565e6bc2ea6d0ed06868276bbe3242c 100644 --- a/app/controllers/requests_controller.rb +++ b/app/controllers/requests_controller.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - class RequestsController < ApplicationController before_filter :authenticate_user! include RequestsHelper @@ -13,15 +12,15 @@ class RequestsController < ApplicationController if params[:accept] if params[:aspect_id] @friend = current_user.accept_and_respond( params[:id], params[:aspect_id]) - flash[:notice] = "You are now friends." + flash[:notice] = I18n.t 'requests.destroy.success' respond_with :location => current_user.aspect_by_id(params[:aspect_id]) else - flash[:error] = "Please select an aspect!" + flash[:error] = I18n.t 'requests.destroy.error' respond_with :location => requests_url end else current_user.ignore_friend_request params[:id] - flash[:notice] = "Ignored friend request." + flash[:notice] = I18n.t 'requests.destroy.ignore' respond_with :location => requests_url end end @@ -37,27 +36,28 @@ class RequestsController < ApplicationController rel_hash = relationship_flow(params[:request][:destination_url]) rescue Exception => e raise e unless e.message.include? "not found" - flash[:error] = "No diaspora seed found with this email!" + flash[:error] = I18n.t 'requests.create.error' respond_with :location => aspect return end + # rel_hash = {:friend => params[:friend_handle]} Rails.logger.debug("Sending request: #{rel_hash}") begin @request = current_user.send_friend_request_to(rel_hash[:friend], aspect) rescue Exception => e raise e unless e.message.include? "already" - flash[:notice] = "#{e.message} #{params[:request][:destination_url]}" + flash[:notice] = I18n.t 'requests.create.already_friends', :destination_url => params[:request][:destination_url] respond_with :location => aspect return end if @request - flash[:notice] = "A friend request was sent to #{@request.destination_url}." + flash[:notice] = I18n.t 'requests.create.success',:destination_url => @request.destination_url respond_with :location => aspect else - flash[:error] = "Something went horribly wrong." + flash[:error] = I18n.t 'requests.create.horribly_wrong' respond_with :location => aspect end end diff --git a/app/controllers/sockets_controller.rb b/app/controllers/sockets_controller.rb index 9b90ea83177a7447f778d704dd2b4bbededa1103..88d8e6b409c7374832f4569d9ad63fa99d4c03ef 100644 --- a/app/controllers/sockets_controller.rb +++ b/app/controllers/sockets_controller.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - class SocketsController < ApplicationController include ApplicationHelper include SocketsHelper diff --git a/app/controllers/status_messages_controller.rb b/app/controllers/status_messages_controller.rb index 98ae19b827656827f49ce8c7c2b441d7a3badfb4..b072564bb9246f854a5c4e2fb44fc1f23025dcd5 100644 --- a/app/controllers/status_messages_controller.rb +++ b/app/controllers/status_messages_controller.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - class StatusMessagesController < ApplicationController before_filter :authenticate_user! diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index c425729b2e597dbac0b7e5d0008e660b091f2276..ac284a21924c25646d572d87240f4f549709a54a 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - class UsersController < ApplicationController before_filter :authenticate_user!, :except => [:new, :create] @@ -11,7 +10,7 @@ class UsersController < ApplicationController def edit @user = current_user @person = @user.person - @profile = @user.profile + @profile = @user.person.profile @photos = Photo.find_all_by_person_id(@person.id).paginate :page => params[:page], :order => 'created_at DESC' @fb_access_url = MiniFB.oauth_url(FB_APP_ID, APP_CONFIG[:pod_url] + "services/create", @@ -30,10 +29,15 @@ class UsersController < ApplicationController private def prep_image_url(params) + url = APP_CONFIG[:pod_url].chop if APP_CONFIG[:pod_url][-1,1] == '/' if params[:profile][:image_url].empty? params[:profile].delete(:image_url) else - params[:profile][:image_url] = "http://" + request.host + ":" + request.port.to_s + params[:profile][:image_url] + if /^http:\/\// =~ params[:profile][:image_url] + params[:profile][:image_url] = params[:profile][:image_url] + else + params[:profile][:image_url] = url + params[:profile][:image_url] + end end end diff --git a/app/helpers/albums_helper.rb b/app/helpers/albums_helper.rb index 50b7fbaf776fa58aa5c085b0f36fa3ca199e61d9..6d85c747c27c70aa32e48e816e376727540134cf 100644 --- a/app/helpers/albums_helper.rb +++ b/app/helpers/albums_helper.rb @@ -2,21 +2,20 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - module AlbumsHelper def friends_albums_link if params[:friends] - "Friends Albums" + I18n.t('albums.helper.friends_albums') else - link_to 'Friends Albums', albums_path({:friends => true}) + link_to I18n.t('albums.helper.friends_albums'), albums_path({:friends => true}) end end def your_albums_link if params[:friends] - link_to 'Your Albums', albums_path + link_to I18n.t('albums.helper.your_albums'), albums_path else - 'Your Albums' + I18n.t('albums.helper.your_albums') end end end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 2c110f422fc1838012cf1ec36640eb3dfbe818af..688ddb10bd3bd1b396c2b269031197e2b7f03e70 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - module ApplicationHelper def current_aspect?(aspect) !@aspect.is_a?(Symbol) && @aspect.id == aspect.id @@ -37,7 +36,7 @@ module ApplicationHelper when "Person" person_path(person) else - "unknown person" + I18n.t('application.helper.unknown_person') end end @@ -61,7 +60,7 @@ module ApplicationHelper end def new_request(request_count) - "new_requests" if request_count > 0 + I18n.t('application.helper.new_requests') if request_count > 0 end def post_yield_tag(post) diff --git a/app/helpers/aspects_helper.rb b/app/helpers/aspects_helper.rb index 1c8f69b8abedabd4b1858d61c06d430813a2db81..66baffca2b98e36d9a925354c4a3c5e70847f914 100644 --- a/app/helpers/aspects_helper.rb +++ b/app/helpers/aspects_helper.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - module AspectsHelper def link_for_aspect( aspect ) link_to aspect.name, aspect @@ -10,9 +9,9 @@ module AspectsHelper def remove_link( aspect ) if aspect.people.size == 0 - link_to "remove", aspect, :method => :delete + link_to I18n.t('aspects.helper.remove'), aspect, :method => :delete else - "<span class='grey' title='Aspect not empty'>remove</span>" + "<span class='grey' title=#{I18n.t('aspects.helper.aspect_not_empty')}>#{I18n.t('aspects.helper.remove')}</span>" end end end diff --git a/app/helpers/dashboards_helper.rb b/app/helpers/dashboards_helper.rb index ee83d72eb9268c1e4d3cdc9b0e4d4f0674435c27..e8a9d8f7171339edaacafe0a6f7f58fe772289c0 100644 --- a/app/helpers/dashboards_helper.rb +++ b/app/helpers/dashboards_helper.rb @@ -2,9 +2,8 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - module DashboardsHelper def title_for_page - 'home' + I18n.t('dashboards.helper.home') end end diff --git a/app/helpers/error_messages_helper.rb b/app/helpers/error_messages_helper.rb index 699070b705bac0049eeeaf513decb6267cded360..9a64dca365f1f0281b45c29219e4dad411734d91 100644 --- a/app/helpers/error_messages_helper.rb +++ b/app/helpers/error_messages_helper.rb @@ -2,13 +2,12 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - module ErrorMessagesHelper # Render error messages for the given objects. The :message and :header_message options are allowed. def error_messages_for(*objects) options = objects.extract_options! - options[:header_message] ||= "Invalid Fields" - options[:message] ||= "Correct the following errors and try again." + options[:header_message] ||= I18n.t('error_messages.helper.invalid_fields') + options[:message] ||= I18n.t('error_messages.helper.correct_the_following_errors_and_try_again') messages = objects.compact.map { |o| o.errors.full_messages }.flatten unless messages.empty? content_tag(:div, :class => "error_messages") do diff --git a/app/helpers/layout_helper.rb b/app/helpers/layout_helper.rb index 2398771a30a6f81a03f71fba6143472c1bcf2203..e33556c355f052615adb511c515b05213bd43fe5 100644 --- a/app/helpers/layout_helper.rb +++ b/app/helpers/layout_helper.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - # These helper methods can be called in your template to set variables to be used in the layout # This module should be included in all views globally, # to do so you may need to add this line to your ApplicationController diff --git a/app/helpers/people_helper.rb b/app/helpers/people_helper.rb index 37d18d20f135a05c039403e880eb9a26a5583ab1..f1fa6487f5278cd1f9acac30d321daf0e7bfe595 100644 --- a/app/helpers/people_helper.rb +++ b/app/helpers/people_helper.rb @@ -2,14 +2,13 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - module PeopleHelper def search_or_index if params[:q] - " results for #{params[:q]}" + I18n.t 'people.helper.results_for',:params => params[:q] else - " people on pod is aware of" + I18n.t "people.helper.people_on_pod_are_aware_of" end end diff --git a/app/helpers/photos_helper.rb b/app/helpers/photos_helper.rb index 2737d3a2d0d9f77dec91c1a601f37775966d62f2..1f52daa0cd97fe2b2713103a7833129e2eda17dd 100644 --- a/app/helpers/photos_helper.rb +++ b/app/helpers/photos_helper.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - module PhotosHelper def linked_scaled_photo(photo, album) link_to (image_tag photo.url(:scaled_full)), photo_path(album.next_photo(photo)), :rel => "prefetch" diff --git a/app/helpers/publics_helper.rb b/app/helpers/publics_helper.rb index 46e778e2bd0a1219421d5b264e0dd886b7372f00..f14fad7a6a04e97627958602fb0c0daffa862abc 100644 --- a/app/helpers/publics_helper.rb +++ b/app/helpers/publics_helper.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - module PublicsHelper def subscribe(opts = {}) subscriber = Subscriber.first(:url => opts[:callback], :topic => opts[:topic]) diff --git a/app/helpers/requests_helper.rb b/app/helpers/requests_helper.rb index fec093aac6ae860f1daa04ef9b9917c237e14383..98ccc8f75d6cb3032343ac97b78c6fb4de2a4327 100644 --- a/app/helpers/requests_helper.rb +++ b/app/helpers/requests_helper.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - module RequestsHelper def subscription_mode(profile) if diaspora?(profile) diff --git a/app/helpers/sockets_helper.rb b/app/helpers/sockets_helper.rb index 69135092a2bfe143d80ba6dbc9a9032fd5bc30fc..892e15f59bb445658c0da8d14361eb51f73dc1ee 100644 --- a/app/helpers/sockets_helper.rb +++ b/app/helpers/sockets_helper.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - module SocketsHelper include ApplicationHelper diff --git a/app/helpers/status_messages_helper.rb b/app/helpers/status_messages_helper.rb index ff6c2674a03ea4a7bb889e76a04de20e3745c726..08461b6353ebbb92714b4a4c88d2803cf95e6880 100644 --- a/app/helpers/status_messages_helper.rb +++ b/app/helpers/status_messages_helper.rb @@ -2,13 +2,12 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - module StatusMessagesHelper def my_latest_message unless @latest_status_message.nil? return @latest_status_message.message else - return "No message to display." + return I18n.t('status_messages.helper.no_message_to_display') end end end diff --git a/app/models/album.rb b/app/models/album.rb index 10737bdfade1f1d4c91ebca503d63e853dfbf640..f62cbdb794a9437939597625fe00aeb64541adbd 100644 --- a/app/models/album.rb +++ b/app/models/album.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - class Album < Post xml_reader :name @@ -17,7 +16,6 @@ class Album < Post before_destroy :destroy_photos - def self.mine_or_friends(friend_param, current_user) friend_param ? Album.find_all_by_person_id(current_user.friend_ids) : current_user.person.albums end diff --git a/app/models/aspect.rb b/app/models/aspect.rb index b6014267137eb9d1a8ed04a0cf29e972681f0ff9..10f7aba142de6c7dd0a37092b52563d40407c671 100644 --- a/app/models/aspect.rb +++ b/app/models/aspect.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - class Aspect include MongoMapper::Document diff --git a/app/models/comment.rb b/app/models/comment.rb index 3fa986503f7db886aa08692bee12ff50a5847265..4bf0dbd5e86e4777ab434b81cb42090cc692443c 100644 --- a/app/models/comment.rb +++ b/app/models/comment.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - class Comment include MongoMapper::Document include ROXML @@ -19,7 +18,6 @@ class Comment key :post_id, ObjectId key :person_id, ObjectId - belongs_to :post, :class_name => "Post" belongs_to :person, :class_name => "Person" diff --git a/app/models/person.rb b/app/models/person.rb index f2209f0ce806d13db2c4cfe71cf47281c171ba5f..2601de2bc3993cc61e9ecfda4bd85dd601111607 100644 --- a/app/models/person.rb +++ b/app/models/person.rb @@ -2,8 +2,7 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - -require 'lib/hcard' +require File.expand_path('../../../lib/hcard', __FILE__) class Person include MongoMapper::Document @@ -18,7 +17,7 @@ class Person key :url, String key :diaspora_handle, String, :unique => true - key :serialized_key, String + key :serialized_public_key, String key :owner_id, ObjectId @@ -30,7 +29,7 @@ class Person before_destroy :remove_all_traces before_validation :clean_url - validates_presence_of :url, :profile, :serialized_key + validates_presence_of :url, :profile, :serialized_public_key validates_format_of :url, :with => /^(https?):\/\/[a-z0-9]+([\-\.]{1}[a-z0-9]+)*(\.[a-z]{2,5})?(:[0-9]{1,5})?(\/.*)?$/ix @@ -50,36 +49,28 @@ class Person "#{self.url}receive/users/#{self.id}/" end - def encryption_key - OpenSSL::PKey::RSA.new( serialized_key ) - end - - def encryption_key= new_key - raise TypeError unless new_key.class == OpenSSL::PKey::RSA - serialized_key = new_key.export - end def public_key_hash Base64.encode64 OpenSSL::Digest::SHA256.new(self.exported_key).to_s end def public_key - encryption_key.public_key + OpenSSL::PKey::RSA.new( serialized_public_key ) end def exported_key - encryption_key.public_key.export + serialized_public_key end def exported_key= new_key - raise "Don't change a key" if serialized_key - @serialized_key = new_key + raise "Don't change a key" if serialized_public_key + @serialized_public_key = new_key end def self.by_webfinger( identifier, opts = {}) #need to check if this is a valid email structure, maybe should do in JS local_person = Person.first(:diaspora_handle => identifier.gsub('acct:', '').to_s.downcase) - + if local_person Rails.logger.info("Do not need to webfinger, found a local person #{local_person.real_name}") local_person @@ -101,9 +92,9 @@ class Person new_person = Person.new public_key_entry = profile.links.select{|x| x.rel == 'diaspora-public-key'} - + return nil unless public_key_entry - + pubkey = public_key_entry.first.href new_person.exported_key = Base64.decode64 pubkey diff --git a/app/models/photo.rb b/app/models/photo.rb index 8792911f3264b21e34ccb6cb457e393b596a47ff..15d105739c7963f1cc61d9bbc7b009d959aa8c79 100644 --- a/app/models/photo.rb +++ b/app/models/photo.rb @@ -2,7 +2,13 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - +class PhotoAlbumValidator < ActiveModel::Validator + def validate(document) + unless document.album.person_id == document.person_id + document.errors[:base] << "You post photos to that album" + end + end +end class Photo < Post require 'carrierwave/orm/mongomapper' include MongoMapper::Document @@ -22,7 +28,7 @@ class Photo < Post timestamps! validates_presence_of :album - validates_true_for :album_id, :logic => lambda {self.validate_album_person} + validates_with PhotoAlbumValidator before_destroy :ensure_user_picture @@ -36,10 +42,6 @@ class Photo < Post photo end - def validate_album_person - album.person_id == person_id - end - def remote_photo image.url.nil? ? (remote_photo_path + '/' + remote_photo_name) : image.url end @@ -70,3 +72,4 @@ class Photo < Post {:thumb_url => url(:thumb_medium), :id => id, :album_id => album_id} end end + diff --git a/app/models/post.rb b/app/models/post.rb index e9e135abb5d7389250fb4ec81f0e51293ed01ede..983d0e68fc953db3db66bf1b2da1c2d2c06ec0be 100644 --- a/app/models/post.rb +++ b/app/models/post.rb @@ -2,10 +2,9 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - class Post - require 'lib/diaspora/websocket' - require 'lib/encryptable' + require File.expand_path('../../../lib/encryptable', __FILE__) + require File.expand_path('../../../lib/diaspora/websocket', __FILE__) include MongoMapper::Document include ApplicationHelper include ROXML @@ -33,7 +32,6 @@ class Post self.create params.to_hash end - def as_json(opts={}) { :post => { diff --git a/app/models/profile.rb b/app/models/profile.rb index f03843226c5beee793a2da6386fd2d3b4c7f3691..2b8303bd18dd6a97672642390c94f65fc989f7e6 100644 --- a/app/models/profile.rb +++ b/app/models/profile.rb @@ -2,10 +2,9 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - class Profile include MongoMapper::EmbeddedDocument - require 'lib/diaspora/webhooks' + require File.expand_path('../../../lib/diaspora/webhooks', __FILE__) include Diaspora::Webhooks include ROXML diff --git a/app/models/request.rb b/app/models/request.rb index 739500e4e8c8fed1a9ae9cf4a2cbbaafe72f506e..5ba4769a206b87a4ae6fcaf4520da09c77f2d8e6 100644 --- a/app/models/request.rb +++ b/app/models/request.rb @@ -2,9 +2,8 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - class Request - require 'lib/diaspora/webhooks' + require File.expand_path('../../../lib/diaspora/webhooks', __FILE__) include MongoMapper::Document include Diaspora::Webhooks include ROXML diff --git a/app/models/retraction.rb b/app/models/retraction.rb index 9c1f13f450c31cf87bf6b96091808bf25e62e996..20f74bf29285eca1916bf0f08e5f669cc5f32bd1 100644 --- a/app/models/retraction.rb +++ b/app/models/retraction.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - class Retraction include ROXML include Diaspora::Webhooks diff --git a/app/models/status_message.rb b/app/models/status_message.rb index f75536205e95b1acbf9e669b0172a486ea8a80d5..c616efc5e7fa11ddc17f2246c649a0bbba442851 100644 --- a/app/models/status_message.rb +++ b/app/models/status_message.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - class StatusMessage < Post xml_name :status_message @@ -11,7 +10,6 @@ class StatusMessage < Post key :message, String validates_presence_of :message - def to_activity <<-XML <entry> diff --git a/app/models/user.rb b/app/models/user.rb index 8f74e2233a711d51780da54381d8786b25434e47..d89b8b59ad558a66a5f7e4c047205dc351f28064 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -2,11 +2,10 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - -require 'lib/diaspora/user/friending.rb' -require 'lib/diaspora/user/querying.rb' -require 'lib/diaspora/user/receiving.rb' -require 'lib/salmon/salmon' +require File.expand_path('../../../lib/diaspora/user/friending', __FILE__) +require File.expand_path('../../../lib/diaspora/user/querying', __FILE__) +require File.expand_path('../../../lib/diaspora/user/receiving', __FILE__) +require File.expand_path('../../../lib/salmon/salmon', __FILE__) class User include MongoMapper::Document @@ -19,6 +18,7 @@ class User devise :database_authenticatable, :registerable, :recoverable, :rememberable, :trackable, :validatable key :username, :unique => true + key :serialized_private_key, String key :friend_ids, Array key :pending_request_ids, Array @@ -36,7 +36,7 @@ class User after_create :seed_aspects - before_validation_on_create :downcase_username + before_validation :downcase_username, :on => :create def self.find_for_authentication(conditions={}) if conditions[:username] =~ /^([\w\.%\+\-]+)@([\w\-]+\.)+([\w]{2,})$/i # email regex @@ -67,12 +67,11 @@ class User def drop_aspect( aspect ) if aspect.people.size == 0 aspect.destroy - else + else raise "Aspect not empty" end end - def move_friend( opts = {}) return true if opts[:to] == opts[:from] friend = Person.first(:_id => opts[:friend_id]) @@ -108,12 +107,11 @@ class User intitial_post(class_name, aspect_ids, options) end - - def intitial_post(class_name, aspect_ids, options = {}) + def intitial_post(class_name, aspect_ids, options = {}) post = build_post(class_name, options) post.socket_to_uid(id, :aspect_ids => aspect_ids) if post.respond_to?(:socket_to_uid) push_to_aspects(post, aspect_ids) - post + post end def repost( post, options = {} ) @@ -129,16 +127,20 @@ class User end def validate_aspect_permissions(aspect_ids) - aspect_ids = [aspect_ids.to_s] if aspect_ids.is_a? BSON::ObjectId + if aspect_ids == "all" + return aspect_ids + end + + aspect_ids = [aspect_ids.to_s] unless aspect_ids.is_a? Array if aspect_ids.nil? || aspect_ids.empty? raise ArgumentError.new("You must post to someone.") end aspect_ids.each do |aspect_id| - unless aspect_id == "all" || self.aspects.find(aspect_id) + unless self.aspects.find(aspect_id) raise ArgumentError.new("Cannot post to an aspect you do not own.") - end + end end aspect_ids @@ -250,7 +252,9 @@ class User def self.instantiate!( opts = {} ) opts[:person][:diaspora_handle] = "#{opts[:username]}@#{APP_CONFIG[:terse_pod_url]}" opts[:person][:url] = APP_CONFIG[:pod_url] - opts[:person][:serialized_key] = generate_key + + opts[:serialized_private_key] = generate_key + opts[:person][:serialized_public_key] = opts[:serialized_private_key].public_key User.create(opts) end @@ -258,22 +262,15 @@ class User aspect(:name => "Family") aspect(:name => "Work") end - - def terse_url - terse = APP_CONFIG[:pod_url].gsub(/(https?:|www\.)\/\//, '') - terse = terse.chop! if terse[-1, 1] == '/' - terse - end def diaspora_handle - "#{self.username}@#{self.terse_url}" + "#{self.username}@#{APP_CONFIG[:terse_pod_url]}" end def downcase_username username.downcase! if username end - def as_json(opts={}) { :user => { @@ -284,7 +281,14 @@ class User } } end - def self.generate_key - OpenSSL::PKey::RSA::generate 4096 - end + + + def self.generate_key + OpenSSL::PKey::RSA::generate 4096 + end + + def encryption_key + OpenSSL::PKey::RSA.new( serialized_private_key ) + end + end diff --git a/app/uploaders/image_uploader.rb b/app/uploaders/image_uploader.rb index 6e5312341628cbddb47f8b748fe5d72268cd9a41..58399c90d46831e02b51a4ce74416a56f9475c54 100644 --- a/app/uploaders/image_uploader.rb +++ b/app/uploaders/image_uploader.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - class ImageUploader < CarrierWave::Uploader::Base include CarrierWave::MiniMagick diff --git a/app/views/albums/_album.html.haml b/app/views/albums/_album.html.haml index f4893ed8ff76ecf98586d2045151737dbc99cdc1..4f41e5cfbf78e7e20e5580697e62545ad2b84e87 100644 --- a/app/views/albums/_album.html.haml +++ b/app/views/albums/_album.html.haml @@ -8,11 +8,11 @@ %div.time by - = link_to ((current_user.person == post.person)? 'you' : post.person.real_name), person_path(post.person) + = link_to ((current_user.person == post.person)? t('.you') : post.person.real_name), person_path(post.person) %br = link_to(how_long_ago(post), object_path(post, :aspect => @aspect)) %div.image_cycle - for photo in post.photos[0..3] = link_to (image_tag photo.url(:thumb_large)), album_path(post, :aspect => @aspect) - + diff --git a/app/views/albums/_new_album.haml b/app/views/albums/_new_album.haml index 8a37cb2c03746de7ccffd53ce85d9c932328740c..e0212a6b4566c7218960cba9698e549ee8503e20 100644 --- a/app/views/albums/_new_album.haml +++ b/app/views/albums/_new_album.haml @@ -2,8 +2,7 @@ -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - -%h1 Add a new album +%h1=t('.add_a_new_album') = form_for Album.new do |f| = f.error_messages @@ -11,4 +10,4 @@ = f.label :name = f.text_field :name = f.hidden_field :to, :value => aspect - = f.submit 'create', :class => 'button' + = f.submit t('.create'), :class => 'button' diff --git a/app/views/albums/edit.html.haml b/app/views/albums/edit.html.haml index a4bf3aef656c3b8bf54c5edae4fadd3fe0cef1b1..67cc3071d6355ae51b772f0922bc30f63a3d5939 100644 --- a/app/views/albums/edit.html.haml +++ b/app/views/albums/edit.html.haml @@ -2,14 +2,13 @@ -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - .back= link_to "⇧ #{@album.name}", @album %h1.big_text - = "Editing #{@album.name}" + = "#{t('.editing')} #{@album.name}" .sub_header - ="updated #{how_long_ago(@album)}" + ="#{t('.updated')} #{how_long_ago(@album)}" - form_for @album do |a| = a.error_messages @@ -21,12 +20,12 @@ .photo_edit_block= image_tag photo.url(:thumb_medium) #submit_block - = link_to "Cancel", root_path + = link_to t('.cancel'), root_path or = a.submit .button.delete - = link_to 'Delete Album', @album, :confirm => 'Are you sure?', :method => :delete + = link_to t('.delete_album'), @album, :confirm => t('.are_you_sure'), :method => :delete #content_bottom .back diff --git a/app/views/albums/index.html.haml b/app/views/albums/index.html.haml index fa4098c180fec72eb1c815a66f0a19c0cdb3f966..2e680c1102137f34748420281fcd91532e31a8f0 100644 --- a/app/views/albums/index.html.haml +++ b/app/views/albums/index.html.haml @@ -2,7 +2,6 @@ -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - - content_for :head do :javascript $(document).ready(function(){ @@ -10,7 +9,7 @@ }); = content_for :page_title do - = link_to "â—‚ Home", aspects_path, :aspect => params[:aspect] + = link_to "â—‚ #{t('.home')}", aspects_path, :aspect => params[:aspect] - content_for :left_pane do = render "shared/aspect_friends" @@ -19,7 +18,7 @@ %h1 Albums .right - = link_to 'New Album', '#new_album_pane', {:class => "button", :id => "add_album_button"} + = link_to t('.new_album'), '#new_album_pane', {:class => "button", :id => "add_album_button"} .yo{:style => "display:none;" } #new_album_pane @@ -34,4 +33,4 @@ #content_bottom .back - = link_to "⇧ home", root_path + = link_to "⇧ #{t('.home')}", root_path diff --git a/app/views/albums/show.html.haml b/app/views/albums/show.html.haml index 3c71cede1022c0ef17a743b1e869ce5ea1d5787f..4c9ba19b861e1643943cee031ae79ec3db7c357f 100644 --- a/app/views/albums/show.html.haml +++ b/app/views/albums/show.html.haml @@ -2,7 +2,6 @@ -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - :javascript $(document).ready(function(){ $(".image_thumb img").load( function() { @@ -11,7 +10,7 @@ }); = content_for :page_title do - = link_to "â—‚ Albums", albums_path(:aspect => @aspect) + = link_to "â—‚ #{t('.albums')}", albums_path(:aspect => @aspect) - content_for :left_pane do = render "shared/aspect_friends" @@ -20,17 +19,15 @@ -if current_user.owns? @album .right =render 'photos/new_photo' - = link_to 'Edit Album', edit_album_path(@album), :class => 'button' + = link_to t('.edit_album'), edit_album_path(@album), :class => 'button' %h1 = @album.name - ="updated #{how_long_ago(@album)}" - - + ="#{t('.updated')} #{how_long_ago(@album)}" .album_id{:id => @album.id, :style => "display:hidden;"} -unless current_user.owns? @album - %h4= "by #{@album.person.real_name}" + %h4= "#{t('.by')} #{@album.person.real_name}" #thumbnails - for photo in @album_photos @@ -39,5 +36,4 @@ #content_bottom .back - = link_to "⇧ albums", albums_path - + = link_to "⇧ #{t('.albums')}", albums_path diff --git a/app/views/aspects/_new_aspect.haml b/app/views/aspects/_new_aspect.haml index 3ca07ac17c38987d4dbdcc49aa9eb717a9648409..548abd0d1a91ae6f7e084866fe3e51c8548f05e4 100644 --- a/app/views/aspects/_new_aspect.haml +++ b/app/views/aspects/_new_aspect.haml @@ -2,11 +2,10 @@ -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - %h1=t('.add_a_new_aspect') = form_for Aspect.new do |f| = f.error_messages %p = f.label :name = f.text_field :name - = f.submit 'create', :class => 'button' + = f.submit t('.create'), :class => 'button' diff --git a/app/views/aspects/index.html.haml b/app/views/aspects/index.html.haml index 5ea9cadb31fda44da0fc9cdbed4ff0f2b9c1c8c8..ae24e8e3b72750d347db1a1aff74b20df681e34e 100644 --- a/app/views/aspects/index.html.haml +++ b/app/views/aspects/index.html.haml @@ -2,10 +2,8 @@ -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - - content_for :page_title do - = link_to "photos", albums_path(:aspect => @aspect) - + = link_to t('.photos'), albums_path(:aspect => @aspect) - content_for :left_pane do = render "shared/aspect_friends" diff --git a/app/views/aspects/manage.html.haml b/app/views/aspects/manage.html.haml index 3903039eadb42bbfe88c12f032b8bdee34e3ef08..e08f6dabdbc2de5308f4853a0d36744789d9b133 100644 --- a/app/views/aspects/manage.html.haml +++ b/app/views/aspects/manage.html.haml @@ -2,14 +2,12 @@ -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - -- content_for :head do +- content_for :head do = javascript_include_tag 'jquery-ui-1.8.4.custom.min.js' = javascript_include_tag 'aspect-edit.js' - content_for :left_pane do - %h1 - Requests + %h1=t('.requests') .requests %ul.dropzone @@ -21,34 +19,31 @@ = person_image_tag(request.person) .name = request.person.real_name - %h1 - Ignore/Remove + %h1=t('.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") - - + = link_to(t('.add_a_new_aspect'), "#add_aspect_pane", :id => "add_aspect_button", :class => "new_aspect button", :title => t('.add_a_new_aspect')) %ul#aspect_list - for aspect in @aspects %li.aspect - + .aspect_name %span.edit_name_field %h1{:contenteditable => true}= aspect.name %span.tip click to edit %ul.tools - %li= link_to "add a new friend", "#add_request_pane_#{aspect.id}", :class => 'add_request_button' - %li= link_to "show", aspect_path(aspect) + %li= link_to t('.add_a_new_friend'), "#add_request_pane_#{aspect.id}", :class => 'add_request_button' + %li= link_to t('.show'), aspect_path(aspect) %li!= remove_link(aspect) - + %ul.dropzone{:id => aspect.id} - + -if aspect.people.size < 1 %li.grey Drag to add people diff --git a/app/views/aspects/show.html.haml b/app/views/aspects/show.html.haml index f10ccee74658c7ebb9c7da3609500c0ebbbc3404..ae24e8e3b72750d347db1a1aff74b20df681e34e 100644 --- a/app/views/aspects/show.html.haml +++ b/app/views/aspects/show.html.haml @@ -2,9 +2,8 @@ -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - - content_for :page_title do - = link_to "photos", albums_path(:aspect => @aspect) + = link_to t('.photos'), albums_path(:aspect => @aspect) - content_for :left_pane do = render "shared/aspect_friends" diff --git a/app/views/comments/_comment.html.haml b/app/views/comments/_comment.html.haml index 4fd46eb56c89f10d5e9dd757106839be04033801..03a2fcf61fd13fed1463304c753130984b5576ba 100644 --- a/app/views/comments/_comment.html.haml +++ b/app/views/comments/_comment.html.haml @@ -2,8 +2,7 @@ -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - -%li.comment{:id => post.id} +%li.comment{:id => post.id} = person_image_tag(post.person) %span.from = link_to post.person.real_name, post.person diff --git a/app/views/comments/_comments.html.haml b/app/views/comments/_comments.html.haml index fc5c64da78fb88177b55f8481eff7cf8a09db380..aecfb4bf17bf8ac64948d4b99980e7115d2d7e3b 100644 --- a/app/views/comments/_comments.html.haml +++ b/app/views/comments/_comments.html.haml @@ -2,11 +2,10 @@ -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - %div.comments %ul.comment_set{:id => post.id} - for comment in post.comments = render 'comments/comment', :post => comment %li.comment.show = render 'comments/new_comment', :post => post - + diff --git a/app/views/comments/_new_comment.html.haml b/app/views/comments/_new_comment.html.haml index a4268082d8844d4aacfe532ba0bbcb49e5dbba90..99c03f8986ed13d8150f0f5e2ca1a3402820ec58 100644 --- a/app/views/comments/_new_comment.html.haml +++ b/app/views/comments/_new_comment.html.haml @@ -2,7 +2,6 @@ -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - = form_for Comment.new, :remote => true do |f| %p %label{:for => "comment_text_on_#{post.id}"} Comment diff --git a/app/views/devise/sessions/new.html.haml b/app/views/devise/sessions/new.html.haml index 15880df0bbeb051ac4434cb712f349bc16b8dd0a..5803415b44cb0b460d2e92a2c123af2694f0f7f6 100644 --- a/app/views/devise/sessions/new.html.haml +++ b/app/views/devise/sessions/new.html.haml @@ -1,7 +1,7 @@ %h1 This is a technology preview, do not provide any private information. -%h3 - your account may be deleted until we move into a more stable development period. +%h3 + your account may be deleted until we move into a more stable development period. %h3 USE AT YOUR OWN RISK!! = form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f| @@ -10,7 +10,7 @@ = f.label :username = f.text_field :username %p.user_network - ="@#{APP_CONFIG[:pod_url]}" + ="@#{APP_CONFIG[:terse_pod_url]}" %p = f.label :password diff --git a/app/views/js/_websocket_js.haml b/app/views/js/_websocket_js.haml index 33af68cce8e3fc3caffe46129e56d1be7a614f42..4677f6ce677f67b42529f413b367617022f2e3c2 100644 --- a/app/views/js/_websocket_js.haml +++ b/app/views/js/_websocket_js.haml @@ -2,7 +2,6 @@ -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - = javascript_include_tag 'FABridge', 'swfobject', 'web_socket' :javascript WebSocket.__swfLocation = "/javascripts/WebSocketMain.swf"; @@ -19,25 +18,23 @@ if (obj['class']=="retractions"){ processRetraction(obj['post_id']); - + }else if (obj['class']=="comments"){ - processComment(obj['post_id'], obj['html']) - + processComment(obj['post_id'], obj['html']) + }else if (obj['class']=='photos' && onPageForClass('albums')){ processPhotoInAlbum(obj['photo_hash']) }else{ processPost(obj['class'], obj['html'], obj['aspect_ids']) } - - }; + }; ws.onclose = function() { debug("socket closed"); }; ws.onopen = function() { ws.send(location.pathname); debug("connected..."); }; - }); function processRetraction(post_id){ $('#' + post_id ).fadeOut(500, function(){ @@ -66,7 +63,7 @@ $(html).fadeIn("fast", function(){ $("#stream label:first").inFieldLabels(); }) - ); + ); } } @@ -77,13 +74,13 @@ html = "<div class=\'image_thumb\' id=\'"+photoHash['id']+"\' style=\'padding-right:3px;\'> \ <a href=\"/photos/"+ photoHash['id'] +"\"> \ <img alt=\"New thumbnail\" src=\""+ photoHash['thumb_url'] +"\" /> \ - </a> </div>" + </a> </div>" $("#thumbnails").append( $(html) ) $("#"+ photoHash['id'] + " img").load( function() { $(this).fadeIn("slow"); }); } - + function onPageForClass(className){ return (location.href.indexOf(className) != -1 ); } @@ -100,9 +97,9 @@ } function onPageForAspect(aspectId){ - return (location.href.indexOf(aspectId) != -1 ) + return (location.href.indexOf(aspectId) != -1 ) } - + function onPageOne() { var c = document.location.search.charAt(document.location.search.length-1); return ((c =='') || (c== '1')); diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index 4226ef139c8e61d4e9529cd1e4838332b87790a2..fc063e0b6acf3c9f5a229fdb69d9e9a0b27b203c 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -2,7 +2,6 @@ -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - !!! %html %head @@ -10,24 +9,24 @@ = "#{current_user.real_name} | diaspora" if current_user %meta{"http-equiv"=>"Content-Type", :content=>"text/html; charset=utf-8"}/ - + = stylesheet_link_tag "blueprint/screen", :media => 'screen' = stylesheet_link_tag "application", "ui" - = stylesheet_link_tag "/../javascripts/fancybox/jquery.fancybox-1.3.1" - = stylesheet_link_tag "fileuploader" + = stylesheet_link_tag "/../javascripts/fancybox/jquery.fancybox-1.3.1" + = stylesheet_link_tag "fileuploader" /= javascript_include_tag "http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" = javascript_include_tag 'jquery-1.4.2.min', 'rails' = javascript_include_tag 'jquery.infieldlabel', 'jquery.cycle/jquery.cycle.min.js' - + = javascript_include_tag 'fancybox/jquery.fancybox-1.3.1.pack' = javascript_include_tag 'fileuploader' = javascript_include_tag 'view', 'image_picker', 'stream' = render 'js/websocket_js' - + = csrf_meta_tag = yield(:head) @@ -50,8 +49,8 @@ = text_field_tag 'q' %li= link_to current_user.real_name, current_user.person - %li= link_to "settings", edit_user_path(current_user) - %li= link_to "logout", destroy_user_session_path + %li= link_to t('.edit_profile'), edit_user_path(current_user) + %li= link_to t('.logout.'), destroy_user_session_path = render "shared/aspect_nav" = render "shared/sub_header" diff --git a/app/views/layouts/session_wall.html.haml b/app/views/layouts/session_wall.html.haml index 351daee0ea3d61e3fbe859a334d9ee49ff0202c0..29b863b32de2bd9027d3092211a41c4e6f84af3f 100644 --- a/app/views/layouts/session_wall.html.haml +++ b/app/views/layouts/session_wall.html.haml @@ -2,7 +2,6 @@ -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - !!! %html %head @@ -10,7 +9,7 @@ DIASPORA | login %meta{"http-equiv"=>"Content-Type", :content=>"text/html; charset=utf-8"}/ %meta{"http-equiv"=> "X-UA-Compatible", :content =>"chrome=1" } - + = stylesheet_link_tag "sessions" /= javascript_include_tag"http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" = javascript_include_tag 'jquery142' @@ -18,10 +17,10 @@ :javascript $(document).ready(function(){ - $("#user_username").focus(); + $("#user_username").focus(); $("label").inFieldLabels(); }); - + = csrf_meta_tag = yield(:head) @@ -44,11 +43,11 @@ </div> </div> <![endif]--> - + - flash.each do |name, msg| = content_tag :div, msg, :id => "flash_#{name}" %div#huge_text DIASPORA* = yield - + /= link_to "signup", "/signup" diff --git a/app/views/people/_person.html.haml b/app/views/people/_person.html.haml index e0c77d9909babf57ed747de2106b2207dbc873a4..7e22a5570b274f5534d48ed2d5b2543db2b45067 100644 --- a/app/views/people/_person.html.haml +++ b/app/views/people/_person.html.haml @@ -19,9 +19,9 @@ - elsif current_user.friends.include?(person) Already friends - elsif current_user.pending_requests.find_by_person_id(person.id) - = link_to "pending request", aspects_manage_path + = link_to =t('.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" + = f.submit t('.add_friend') diff --git a/app/views/people/index.html.haml b/app/views/people/index.html.haml index 2cd1dc4a7b3fec973e4942942a53d70fce0ba180..5981569b82fa577f7fa739da78d8b6d7e26c2399 100644 --- a/app/views/people/index.html.haml +++ b/app/views/people/index.html.haml @@ -2,7 +2,6 @@ -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - - content_for :publish do %h1 Search @@ -21,5 +20,5 @@ %ul#stream - for person in @people = render 'people/person', :person => person - + = will_paginate @people diff --git a/app/views/people/new.html.haml b/app/views/people/new.html.haml index b2203eb3f9081c04f48ccae208b56ac768b154f5..0584732bc0776a5aae297d6db44602111bdce093 100644 --- a/app/views/people/new.html.haml +++ b/app/views/people/new.html.haml @@ -2,8 +2,7 @@ -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - -- title "New Person" +- title=t('.new_person') = form_for @person do |f| = f.error_messages @@ -15,18 +14,17 @@ = f.label :url %br = f.text_field :url - + =f.fields_for :profile do |p| %p = p.label :first_name %br = p.text_field :first_name - + %p = p.label :last_name %br = p.text_field :last_name = f.submit - -%p= link_to "Back to List", people_path +%p= link_to t('.back_to_list'), people_path diff --git a/app/views/people/show.html.haml b/app/views/people/show.html.haml index 0939bd376271bd8b2a1f3f0398a22e451bbc61f7..9b5128160e678078e31015389bc60a808f80b5b4 100644 --- a/app/views/people/show.html.haml +++ b/app/views/people/show.html.haml @@ -2,7 +2,6 @@ -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - - content_for :page_title do profile @@ -13,22 +12,22 @@ %ul -unless @posts.first.nil? %li - %i= "last seen: #{how_long_ago(@posts.first)}" + %i= t(".last_seen",:how_long_ago => how_long_ago(@posts.first)) - if @person != current_user.person && current_user.friends.include?(@person) %li - %i= "friends since: #{how_long_ago(@person)}" + %i= t(".friends_since",:how_long_ago => how_long_ago(@person)) %li = form_tag move_friend_path = select :to, :to, @aspects_dropdown_array, :selected => @aspects_with_person.first.id = hidden_field_tag :from, :from, :value => @aspects_with_person.first.id = hidden_field_tag :friend_id, :friend_id, :value => @person.id - = submit_tag "save" + = submit_tag t('.save') - if @person != current_user.person && current_user.friends.include?(@person) - = link_to 'remove friend', @person, :confirm => 'Are you sure?', :method => :delete, :class => "button" + = link_to t('.remove_friend'), @person, :confirm => t('.are_you_sure'), :method => :delete, :class => "button" .span-20.last - + .span-19.last - if @posts %ul#stream @@ -36,4 +35,4 @@ = render type_partial(post), :post => post unless post.class == Album = will_paginate @posts - else - %h3 no posts to display! + %h3=t('no posts to display!') diff --git a/app/views/photos/_new_photo.haml b/app/views/photos/_new_photo.haml index 0f1e423fb11bcfff3b86b605834dadf1e5391c83..d1a4fc73f576560c7977181884024da1d60dfc60 100644 --- a/app/views/photos/_new_photo.haml +++ b/app/views/photos/_new_photo.haml @@ -2,16 +2,15 @@ -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - :javascript - function createUploader(){ + function createUploader(){ var uploader = new qq.FileUploader({ element: document.getElementById('file-upload'), params: {'album_id' : "#{@album.id}"}, - allowedExtensions: ['jpg', 'jpeg', 'png'], + allowedExtensions: ['jpg', 'jpeg', 'png', 'gif'], action: "#{photos_path}" - }); + }); } - window.onload = createUploader; + window.onload = createUploader; #file-upload diff --git a/app/views/photos/_photo.haml b/app/views/photos/_photo.haml index f0a3f2c830bb6966f6858fd0447c9e38c3e3c993..d39fd0666d7f2cd1fa839b9f460bd6120fe71d80 100644 --- a/app/views/photos/_photo.haml +++ b/app/views/photos/_photo.haml @@ -2,7 +2,6 @@ -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - %li.message{:id => post.id} = person_image_tag(post.person) @@ -11,15 +10,15 @@ %span.from = link_to post.person.real_name, post.person %b - posted a new photo to + =t('.posted_a_new_photo_to') = link_to post.album.name, object_path(post.album) %br = render "albums/album", :post => post.album, :current_user => current_user = link_to (image_tag post.url(:thumb_medium)), object_path(post) - + .info = link_to(how_long_ago(post), photo_path(post)) \-- - = link_to "show comments (#{post.comments.count})", '#', :class => "show_post_comments" - = render "comments/comments", :post => post + = link_to "#{t('.show_comments')} (#{post.comments.count})", '#', :class => "show_post_comments" + = render "comments/comments", :post => post diff --git a/app/views/photos/edit.html.haml b/app/views/photos/edit.html.haml index f695f850d05b9c760fc89fba19acb6c62cf5d5cb..06556039cc862511b00fbead532de680cdd64149 100644 --- a/app/views/photos/edit.html.haml +++ b/app/views/photos/edit.html.haml @@ -2,11 +2,10 @@ -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - %h1.big_text .back = link_to "⇧ #{@album.name}", album_path(@album) - = "Editing #{@photo.image}" + = "#{t('.editing')} #{@photo.image}" %div{:id => @photo.id} @@ -14,6 +13,7 @@ = linked_scaled_photo @photo, @album = form_for @photo do |p| + = p.label :caption = p.text_field :caption, :value => @photo.caption = p.submit @@ -22,5 +22,5 @@ = link_to "⇧ #{@album.name}", album_path(@album) -if current_user.owns? @album .button.right - = link_to 'Delete Photo', @photo, :confirm => 'Are you sure?', :method => :delete + = link_to t('.delete_photo'), @photo, :confirm => t('.are_you_sure'), :method => :delete diff --git a/app/views/photos/new.html.haml b/app/views/photos/new.html.haml index a8814d7704306b04308d604c4803a73f9bf76503..d8701c265157ac65e65290b868991d483a97b081 100644 --- a/app/views/photos/new.html.haml +++ b/app/views/photos/new.html.haml @@ -2,13 +2,12 @@ -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - -- title "New Photo" +- title t('.new_photo') = form_for( @photo, :html => {:multipart => true}) do |f| = f.error_messages %p = f.file_field :image - = f.submit 'post it!', :class => 'button' + = f.submit t('.post_it'), :class => 'button' -%p= link_to "Back to List", photos_path +%p= link_to t('.back_to_list'), photos_path diff --git a/app/views/photos/show.html.haml b/app/views/photos/show.html.haml index 654bea89251ab93b41604f549295b130f7a67e68..787f5861dfc85029c8d4682e9272b2fb10d7546d 100644 --- a/app/views/photos/show.html.haml +++ b/app/views/photos/show.html.haml @@ -2,7 +2,6 @@ -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - :javascript $(document).keydown(function(e){ switch(e.keyCode) { @@ -25,16 +24,15 @@ %h1 = @photo.image - = link_to "<< prev", url_to_prev(@photo, @album) + = link_to "<< #{t('.prev')}", url_to_prev(@photo, @album) | - = link_to "full size", @photo.url + = link_to "#{t('.full_size')}", @photo.url | - = link_to "next >>", url_to_next(@photo, @album) + = link_to "#{t('.next')} >>", url_to_next(@photo, @album) .right -if current_user.owns? @album - = link_to 'Edit Photo', edit_photo_path(@photo), :class => "button" - + = link_to t('.edit_photo'), edit_photo_path(@photo), :class => "button" %div{:id => @photo.id} #show_photo @@ -48,9 +46,9 @@ -if current_user.owns? @album .right - = link_to 'Delete Photo', @photo, :confirm => 'Are you sure?', :method => :delete, :class => 'button' + = link_to t('.delete_photo'), @photo, :confirm => t('.are_you_sure'), :method => :delete, :class => 'button' %h4{:class => "show_post_comments"} - = "comments (#{@photo.comments.count})" + = "#{t('.comments')} (#{@photo.comments.count})" = render "comments/comments", :post => @photo - + diff --git a/app/views/posts/_debug.haml b/app/views/posts/_debug.haml index 17d7baad8340a204dc116c6fce51c8f4db476bf9..ef1984d7d7e7a296548112804198d193452d550e 100644 --- a/app/views/posts/_debug.haml +++ b/app/views/posts/_debug.haml @@ -2,7 +2,6 @@ -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - #debug_info %h5 DEBUG INFO #debug_more{ :style => "display:none;" } diff --git a/app/views/posts/_post.html.haml b/app/views/posts/_post.html.haml index 217441465e9ef698a8f846b65ec201116fecfafd..acad2e12be4789fddfc83f5239f3c4b1635f213f 100644 --- a/app/views/posts/_post.html.haml +++ b/app/views/posts/_post.html.haml @@ -2,8 +2,7 @@ -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - %ul - %h3= link_to post.class, object_path(post) + %h3= link_to post.class, object_path(post) - for field in object_fields(post) - %li= "#{field}: #{post.attributes[field]}" + %li= "#{field}: #{post.attributes[field]}" diff --git a/app/views/publics/hcard.erb b/app/views/publics/hcard.erb index f8a3fef916a060b4cac73857fe6bfbc32ae81d3e..9e3f27796850f0c5f44c27038d1f274c8cdf8c6b 100644 --- a/app/views/publics/hcard.erb +++ b/app/views/publics/hcard.erb @@ -1,42 +1,42 @@ -<div id="content"> - <h1><%=@person.real_name%></h1> - <div id="content_inner"> - <div id="i" class="entity_profile vcard author"> - <h2>User profile</h2> - <dl class="entity_nickname"> - <dt>Nickname</dt> - <dd> - <a href="<%=@person.url%>" rel="me" class="nickname url uid"><%= @person.real_name%></a> - </dd> - </dl> - <dl class="entity_given_name"> - <dt>Full name</dt> - <dd> - <span class="given_name" ><%= @person.profile.first_name %></span> - </dd> +<div id="content"> + <h1><%=@person.real_name%></h1> + <div id="content_inner"> + <div id="i" class="entity_profile vcard author"> + <h2>User profile</h2> + <dl class="entity_nickname"> + <dt>Nickname</dt> + <dd> + <a href="<%=@person.url%>" rel="me" class="nickname url uid"><%= @person.real_name%></a> + </dd> + </dl> + <dl class="entity_given_name"> + <dt>Full name</dt> + <dd> + <span class="given_name" ><%= @person.profile.first_name %></span> + </dd> </dl> - <dl class="entity_family_name"> - <dt>Full name</dt> - <dd> - <span class="family_name" ><%= @person.profile.last_name %></span> - </dd> + <dl class="entity_family_name"> + <dt>Full name</dt> + <dd> + <span class="family_name" ><%= @person.profile.last_name %></span> + </dd> </dl> - <dl class="entity_fn"> - <dt>Full name</dt> - <dd> - <span class="fn" ><%= @person.real_name %></span> - </dd> - </dl> - <dl class="entity_url"> - <dt>URL</dt> - <dd> - <a href="<%= @person.url%>" rel="me" id="pod_location" class="url"><%= @person.url%></a> - </dd> - </dl> - <dl class="entity_note"> - <dt>Note</dt> - <dd class="note">Diaspora is awesome! vi is better than emacs!</dd> - </dl> - </div> - </div> -</div> + <dl class="entity_fn"> + <dt>Full name</dt> + <dd> + <span class="fn" ><%= @person.real_name %></span> + </dd> + </dl> + <dl class="entity_url"> + <dt>URL</dt> + <dd> + <a href="<%= @person.url%>" rel="me" id="pod_location" class="url"><%= @person.url%></a> + </dd> + </dl> + <dl class="entity_note"> + <dt>Note</dt> + <dd class="note">Diaspora is awesome! vi is better than emacs!</dd> + </dl> + </div> + </div> +</div> diff --git a/app/views/publics/host_meta.erb b/app/views/publics/host_meta.erb index e28fb62117c7e719a8a23567499b1716f7643843..ff24552b9df7a26843d21fde56d65d87480d9bfb 100644 --- a/app/views/publics/host_meta.erb +++ b/app/views/publics/host_meta.erb @@ -1,8 +1,8 @@ <?xml version='1.0' encoding='UTF-8'?> -<XRD xmlns='http://docs.oasis-open.org/ns/xri/xrd-1.0' +<XRD xmlns='http://docs.oasis-open.org/ns/xri/xrd-1.0' xmlns:hm='http://host-meta.net/xrd/1.0'> <hm:Host><%= terse_url(root_url) %></hm:Host> - <Link rel='lrdd' + <Link rel='lrdd' template='<%= root_url %>webfinger?q={uri}'> <Title>Resource Descriptor</Title> </Link> diff --git a/app/views/registrations/new.html.haml b/app/views/registrations/new.html.haml index 3e1dc083047293fefdb18153cbd9650aac45b376..25902720e9b637cb5a54b352a405b43411a9bcf1 100644 --- a/app/views/registrations/new.html.haml +++ b/app/views/registrations/new.html.haml @@ -1,6 +1,5 @@ = image_tag "http://needcoffee.cachefly.net/needcoffee/uploads/2009/02/predator-arnold-schwarzenegger.jpg" - = form_for(resource, :as => resource_name, :url => registration_path(resource_name)) do |f| %p = f.label :username @@ -24,5 +23,5 @@ = pr.label :last_name = pr.text_field :last_name - = f.submit "Sign up" + = f.submit t('.sign_up') = render :partial => "devise/shared/links" diff --git a/app/views/requests/_new_request.haml b/app/views/requests/_new_request.haml index b7e5819f69cbf5534b2013577e9597b988b488de..0dbf5b0a129189a6f6f735fc58941d611419f1b0 100644 --- a/app/views/requests/_new_request.haml +++ b/app/views/requests/_new_request.haml @@ -2,20 +2,19 @@ -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - %h1 - Add a new friend to + =t('.add_a_new_friend_to') %i= aspect.name = form_for Request.new do |f| = f.error_messages - Enter a Diaspora username: + =t('.enter_a_diaspora_username') %br - %i= "Your Diaspora username is: #{current_user.diaspora_handle}" + %i= t '.your_diaspora_username_is', :diaspora_handle => current_user.diaspora_handle %p - = f.label :destination_url, "Friend's username" + = f.label :destination_url, t(".friends_username") = f.text_field :destination_url = f.hidden_field :aspect_id, :value => aspect.id = f.submit diff --git a/app/views/shared/_aspect_friends.haml b/app/views/shared/_aspect_friends.haml index 0a28a9676a5bee60e1a9d7f1e057e92bf07d1207..f8e635f8d87e7ae3f8f1c16b8d13f7500eb7519d 100644 --- a/app/views/shared/_aspect_friends.haml +++ b/app/views/shared/_aspect_friends.haml @@ -2,7 +2,6 @@ -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - #friend_pictures = owner_image_link - for friend in @friends @@ -14,11 +13,11 @@ = image_tag( "http://graph.facebook.com/#{friend[:id]}/picture" ) -unless (@aspect == :all) || (@aspect == :public) = link_to (image_tag('add_friend_button.png', :height => "50px", :width => "50px")), "#add_request_pane", :id => 'add_request_button' - + .yo{:style => 'display:none'} #add_request_pane - = render "requests/new_request", :aspect => @aspect + = render "requests/new_request", :aspect => @aspect -else .clear - = link_to "add friends", aspects_manage_path + = link_to t('.add_friends'), aspects_manage_path diff --git a/app/views/shared/_aspect_nav.haml b/app/views/shared/_aspect_nav.haml index 1d49ef049c40de70ca956133e20633987034d3b2..4c4a501d20ebe4e39c4f410dbc4c5df336262c28 100644 --- a/app/views/shared/_aspect_nav.haml +++ b/app/views/shared/_aspect_nav.haml @@ -2,21 +2,20 @@ -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - #aspect_nav %ul - for aspect in @aspects %li{:class => ("selected" if current_aspect?(aspect))} = link_for_aspect aspect %li{:class => ("selected" if @aspect == :all)} - = link_to "All Aspects", root_url + = link_to t('.all_aspects'), root_url %ul{ :style => "position:absolute;right:0;bottom:0.01em;"} %li{:class => ("selected" if @aspect == :public)} = link_to "Public", aspects_public_path %li{ :style => "margin-right:0;", :class => ("selected" if @aspect == :manage)} - = link_to ( (@request_count == 0)? "Manage Aspects" : "Manage Aspects (#{@request_count})"), {:controller => :aspects, :action => :manage}, :class => "edit_aspect_button", :class => new_request(@request_count), :title => "Manage your Aspects" + = link_to ( (@request_count == 0)? t('.manage') : "#{t('.manage')} (#{@request_count})"), {:controller => :aspects, :action => :manage}, :class => "edit_aspect_button", :class => new_request(@request_count), :title => t('.manage_your_aspects') .yo{ :style => "display:none;"} #add_aspect_pane diff --git a/app/views/shared/_post_wrapper.haml b/app/views/shared/_post_wrapper.haml index b901fc60858b210cf26c30c1e347e7262d52871e..956706b683c7a650d94ff81a4436bf7bbd20ef0b 100644 --- a/app/views/shared/_post_wrapper.haml +++ b/app/views/shared/_post_wrapper.haml @@ -2,7 +2,6 @@ -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - %li.message{:id => post.id, :class => ("mine" if current_user.owns?(post))} = person_image_link(post.person) = yield post_yield_tag(post) diff --git a/app/views/shared/_publisher.haml b/app/views/shared/_publisher.haml index a137ccdeb15bff05afdc3263e7e9ec281edecf69..5db168f6f405e098c81bda4ed355b7f72910500e 100644 --- a/app/views/shared/_publisher.haml +++ b/app/views/shared/_publisher.haml @@ -2,7 +2,6 @@ -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - #publisher = owner_image_tag @@ -20,6 +19,4 @@ %li = check_box_tag("aspect_ids[]", aspect.id, @aspect == :public || @aspect == :all || current_aspect?(aspect) ) = aspect.name - - = f.submit "Share" - + = f.submit t('.share') diff --git a/app/views/shared/_reshare.haml b/app/views/shared/_reshare.haml index 0b4120d5216b5ffd2391cf4558ccd4f239d96f18..9df1c9ce19d6f1fda94df07a630edcab5b1ab224 100644 --- a/app/views/shared/_reshare.haml +++ b/app/views/shared/_reshare.haml @@ -2,8 +2,6 @@ -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - - :javascript $(".reshare_button").toggle(function(e){ e.preventDefault(); @@ -19,7 +17,7 @@ %ul.reshare_box - for aspect in current_user.aspects_with_post( post.id ) - + %li.currently_sharing= aspect.name - for aspect in current_user.aspects diff --git a/app/views/shared/_sub_header.haml b/app/views/shared/_sub_header.haml index c8b2bd5e98ae559c258166df1c575010b4573c9e..227b63d4e3bd9a8e787d70747167bc9807ad44c5 100644 --- a/app/views/shared/_sub_header.haml +++ b/app/views/shared/_sub_header.haml @@ -7,11 +7,11 @@ - else %h1 - if @aspect == :all - = link_to "All Aspects", root_path - - elsif @aspect == :manage - = "Manage Aspects" + = link_to t('.all_aspects'), root_path - elsif @aspect == :public = "Public" + - elsif @aspect == :manage + = link_to t('.manage_aspects'), root_path - else = link_to @aspect.name, @aspect diff --git a/app/views/shared/log.haml b/app/views/shared/log.haml index 7472689e3f55b4db37c118f438fbd8a2e1e2cbe3..bf957bf7ce2dfc64e26d6458d4e46cb11d62cc69 100644 --- a/app/views/shared/log.haml +++ b/app/views/shared/log.haml @@ -2,5 +2,4 @@ -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - = @log.to_s diff --git a/app/views/status_messages/_new_status_message.haml b/app/views/status_messages/_new_status_message.haml index 329e72d660198de985e3e4d8716729af3fcee838..c27585f0a572dfe2c3e58efbef5952b9e89d2d62 100644 --- a/app/views/status_messages/_new_status_message.haml +++ b/app/views/status_messages/_new_status_message.haml @@ -2,9 +2,8 @@ -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - = form_for StatusMessage.new, :remote => true do |f| = f.error_messages %p - = f.text_field :message, :value => "tell me something good" - = f.submit 'oh yeah!', :class => 'button' + = f.text_field :message, :value => t('.tell_me_something_good') + = f.submit t('.oh_yeah'), :class => 'button' diff --git a/app/views/status_messages/_status_message.html.haml b/app/views/status_messages/_status_message.html.haml index 33764453f63ccefc4f5e2df7e3ff1757c99a1b5d..55c5123b7f4f4a2a4b547fd7ef87a9a1432631ab 100644 --- a/app/views/status_messages/_status_message.html.haml +++ b/app/views/status_messages/_status_message.html.haml @@ -2,25 +2,23 @@ -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - %li.message{:id => post.id, :class => ("mine" if current_user.owns?(post))} = person_image_link(post.person) .content %span.from - = link_to post.person.real_name, post.person + = link_to post.person.real_name, post.person = post.message - + .info %span.time= link_to(how_long_ago(post), object_path(post)) \-- - = link_to "show comments (#{post.comments.count})", '#', :class => "show_post_comments" + = link_to "#{t('.show_comments')} (#{post.comments.count})", '#', :class => "show_post_comments" - = render "comments/comments", :post => post + = render "comments/comments", :post => post - if current_user.owns?(post) .destroy_link - = link_to 'Delete', status_message_path(post), :confirm => 'Are you sure?', :method => :delete, :remote => true, :class => "delete" - = render "shared/reshare", :post => post, :current_user => current_user - + = link_to t('.delete'), status_message_path(post), :confirm => t('.are_you_sure'), :method => :delete, :remote => true, :class => "delete" + = render "shared/reshare", :post => post, :current_user => current_user diff --git a/app/views/status_messages/index.html.haml b/app/views/status_messages/index.html.haml index c2a579d87b841ebf26e6f0e1d48f55d71e7f087c..43c065380a86ee32ef62d10d8c540cc94e58346c 100644 --- a/app/views/status_messages/index.html.haml +++ b/app/views/status_messages/index.html.haml @@ -2,11 +2,10 @@ -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - %h1.big_text status messages = render "status_messages/new_status_message", :status_message => @status_message %ul#stream - + - for status_message in @status_messages = render "status_message", :post => status_message #pagination diff --git a/app/views/status_messages/show.html.haml b/app/views/status_messages/show.html.haml index 4a701d6a621f7253f91b55b06374a1192b982068..ae4ece073bcf9540e73b2bfeae35e2681edf86e7 100644 --- a/app/views/status_messages/show.html.haml +++ b/app/views/status_messages/show.html.haml @@ -2,15 +2,13 @@ -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - %h1 = link_to @status_message.person.real_name, @status_message.person = @status_message.message - -%h4= "comments (#{@status_message.comments.count})" +%h4= "#{t('.comments')} (#{@status_message.comments.count})" = render "comments/comments", :post => @status_message %p - if current_user.owns? @status_message - = link_to "Destroy", @status_message, :confirm => 'Are you sure?', :method => :delete + = link_to t('.destroy'), @status_message, :confirm => t('are_you_sure?'), :method => :delete diff --git a/app/views/users/_profile.haml b/app/views/users/_profile.haml index e1da956490e511c04a089f13e9bf9ce8d7eaa59f..2b26eead0f0f7e841ee10fc24b5483c037e331af 100644 --- a/app/views/users/_profile.haml +++ b/app/views/users/_profile.haml @@ -10,7 +10,7 @@ = f.fields_for :profile do |p| - %h3 Picture + %h3="#{t('.picture')}" %div#image_picker = p.hidden_field :image_url, :value => (@profile.image_url if @profile.image_url), :id => 'image_url_field' @@ -26,34 +26,34 @@ = link_to image_tag(photo.url(:thumb_medium)), "#" - else - You don't have any photos! Go to the - = link_to "albums", albums_path(:aspect => 'all') - page to upload some. + =t('.you_dont_have_any_photos') + = link_to t('.albums'), albums_path(:aspect => 'all') + =t('.page_to_upload_some') =will_paginate @photos %br - %h3 Info + %h3="#{t('.info')}" %p %b - DIASPORA USERNAME: + ="#{t('.diaspora_username')}:" = @user.diaspora_handle %p = p.label :first_name = p.text_field :first_name, :value => @profile.first_name %p - = p.label :last_name + = p.label :last_name = p.text_field :last_name, :value => @profile.last_name #submit_block - = link_to "Cancel", root_path + = link_to t('.cancel'), root_path or - = f.submit "Update Profile" + = f.submit t('.update_profile') #content_bottom .back - = link_to "⇧ home", root_path + = link_to "⇧ #{t('.home')}", root_path diff --git a/app/views/users/edit.html.haml b/app/views/users/edit.html.haml index b4ef0226c1e449854a72453544d9641d0356dfd5..a3f090027880c82dde29aded7294134600b7bc21 100644 --- a/app/views/users/edit.html.haml +++ b/app/views/users/edit.html.haml @@ -2,7 +2,6 @@ -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - :javascript $("#settings_nav li > a").click( function() { var target = "#"+$(this).attr('class'); @@ -15,8 +14,7 @@ - content_for :publish do - %h1 - Settings + %h1="#{t('.editing_profile')}" - content_for :left_pane do %ul#settings_nav @@ -29,3 +27,4 @@ #services.settings_pane = render 'users/services' + diff --git a/autotest/discover.rb b/autotest/discover.rb index 99ab1f6e44543a0d3f36fc4212237f9a991cbdb6..76b9d2044101321d9997650c53c6a2a4dec7a1c2 100644 --- a/autotest/discover.rb +++ b/autotest/discover.rb @@ -2,6 +2,5 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - Autotest.add_discovery { "rails" } Autotest.add_discovery { "rspec2" } diff --git a/config.ru b/config.ru index cb12bcfa2b582da1931c875cbd4b49f98cd9857d..0c65f5908bfbdbd3f73fc23baf15883a19c8b7f4 100644 --- a/config.ru +++ b/config.ru @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - # This file is used by Rack-based servers to start the application. require ::File.expand_path('../config/environment', __FILE__) diff --git a/config/app_config.yml.example b/config/app_config.yml.example index 5ee07c405656c2bdec681f9d47abadc690c392f6..069823a05c8c1075ce7a546f9f2ff0be1142a1b4 100644 --- a/config/app_config.yml.example +++ b/config/app_config.yml.example @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - default: pod_url: "http://example.org/" debug: false @@ -12,8 +11,8 @@ default: socket_collection_name: 'websocket' pubsub_server: 'https://pubsubhubbub.appspot.com/' mongo_host: 'localhost' - mongo_post: 27017 - + mongo_port: 27017 + development: test: diff --git a/config/application.rb b/config/application.rb index bf3b5699aff01bf397ca2b2c0fa76761902168fe..59b82e21697ab87e64bc948c76ce9b7662981ffd 100644 --- a/config/application.rb +++ b/config/application.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - require File.expand_path('../boot', __FILE__) require 'action_controller/railtie' @@ -13,7 +11,7 @@ require 'active_resource/railtie' # you've limited to :test, :development, or :production. Bundler.require(:default, Rails.env) if defined?(Bundler) -require 'lib/mongo_mapper/bson_id' +require File.expand_path('../../lib/mongo_mapper/bson_id', __FILE__) module Diaspora class Application < Rails::Application # Settings in config/environments/* take precedence over those specified here. diff --git a/config/boot.rb b/config/boot.rb index faeac67421c4325bf206025c157359246d8a12bd..0d0c42268975555044d179ada47e531923e3e296 100644 --- a/config/boot.rb +++ b/config/boot.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - require 'rubygems' # Set up gems listed in the Gemfile. diff --git a/config/cucumber.yml b/config/cucumber.yml new file mode 100644 index 0000000000000000000000000000000000000000..621a14cea66bdbd16ed389c9de074388cb149a7a --- /dev/null +++ b/config/cucumber.yml @@ -0,0 +1,8 @@ +<% +rerun = File.file?('rerun.txt') ? IO.read('rerun.txt') : "" +rerun_opts = rerun.to_s.strip.empty? ? "--format #{ENV['CUCUMBER_FORMAT'] || 'progress'} features" : "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} #{rerun}" +std_opts = "--format #{ENV['CUCUMBER_FORMAT'] || 'progress'} --strict --tags ~@wip" +%> +default: <%= std_opts %> features +wip: --tags @wip:3 --wip features +rerun: <%= rerun_opts %> --format rerun --out rerun.txt --strict --tags ~@wip diff --git a/config/deploy.rb b/config/deploy.rb index 8693285336975b366e296184c37d3575e9f32fae..98d8971f71a8531371c94ffcc6fa5b434f482775 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - config = YAML.load_file(File.dirname(__FILE__) + '/deploy_config.yml') all = config['cross_server'] @@ -108,7 +106,6 @@ namespace :deploy do run 'gem install bundler' end - task :migrate do end end @@ -153,7 +150,6 @@ namespace :db do deploy::restart end - end after "deploy:symlink", "deploy:symlink_images", "deploy:symlink_bundle", 'deploy:symlink_config' diff --git a/config/deploy_config.yml b/config/deploy_config.yml index fcecaa6b18c7e0658a8b1fac7816d691a0539a24..b6cba30566cd923bc2bac480ef7442acb6a43afe 100644 --- a/config/deploy_config.yml +++ b/config/deploy_config.yml @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - cross_server: deploy_to: '/usr/local/app/diaspora' user: 'root' diff --git a/config/environment.rb b/config/environment.rb index 7bf59851a33561948c3594464a91f7a2dcea7210..6b960209fb198744dd7b32970b6732ffd91a4095 100644 --- a/config/environment.rb +++ b/config/environment.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - # Load the rails application require File.expand_path('../application', __FILE__) Haml::Template.options[:format] = :html5 diff --git a/config/environments/development.rb b/config/environments/development.rb index e73a3e9d171e7d08f20ddd63a3f4d64e722b4814..15d1fc2bba372ae28e8260a22b0563d0dd401af7 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -2,8 +2,7 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - -require 'lib/mongo_mapper/clear_dev_memory' +require File.expand_path('../../../lib/mongo_mapper/clear_dev_memory', __FILE__) Diaspora::Application.configure do # Settings specified here will take precedence over those in config/environment.rb diff --git a/config/environments/production.rb b/config/environments/production.rb index 3207c627d934257211e452da1d27c2e64889c02b..cb13c1d1c1222783cc0c979a14e8164930d85fb8 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - Diaspora::Application.configure do # Settings specified here will take precedence over those in config/environment.rb @@ -16,7 +15,7 @@ Diaspora::Application.configure do # Specifies the header that your server uses for sending files #config.action_dispatch.x_sendfile_header = "X-Sendfile" - + config.active_support.deprecation = :notify # For nginx: diff --git a/config/environments/test.rb b/config/environments/test.rb index 4e17d81e87a072f034160106f69f9e7ef31cb6b0..46b44db551a26d7bc07b570600568bf7d4c8ec1d 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - Diaspora::Application.configure do # Settings specified here will take precedence over those in config/environment.rb @@ -32,13 +31,11 @@ Diaspora::Application.configure do config.active_support.deprecation = :stderr config.threadsafe! - # Use SQL instead of Active Record's schema dumper when creating the test database. # This is necessary if your schema can't be completely dumped by the schema dumper, # like if you have constraints or database-specific column types # config.active_record.schema_format = :sql - begin require 'database_cleaner' DatabaseCleaner.strategy = :truncation diff --git a/config/initializers/_load_app_config.rb b/config/initializers/_load_app_config.rb index e739941e9990933924bda41ab06598115f4200a2..22bf14ead0b29f93c7bef4cd64d668be2061421b 100644 --- a/config/initializers/_load_app_config.rb +++ b/config/initializers/_load_app_config.rb @@ -20,7 +20,7 @@ else APP_CONFIG = all_envs['default'].symbolize_keys end -APP_CONFIG[:terse_pod_url] = APP_CONFIG[:pod_url].gsub(/(https?:|www\.)\/\//, '') +APP_CONFIG[:terse_pod_url] = APP_CONFIG[:pod_url].gsub(/(https?:|www\.)\/\//, '') APP_CONFIG[:terse_pod_url].chop! if APP_CONFIG[:terse_pod_url][-1, 1] == '/' puts "WARNING: Please modify your app_config.yml to have a proper pod_url!" if APP_CONFIG[:terse_pod_url] == "example.org" && Rails.env != :test diff --git a/config/initializers/backtrace_silencers.rb b/config/initializers/backtrace_silencers.rb index d456f8c8bbd13359d935842bdb93ffc4ea989669..1efed86e96f62305d888eb35a905082827e36be3 100644 --- a/config/initializers/backtrace_silencers.rb +++ b/config/initializers/backtrace_silencers.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - # Be sure to restart your server when you modify this file. # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces. diff --git a/config/initializers/carrierwave.rb b/config/initializers/carrierwave.rb index 6dea937e9f98ea80255127ea60c9bff238aa607d..b28f1be669466018ced26e91411de3bc7d6af795 100644 --- a/config/initializers/carrierwave.rb +++ b/config/initializers/carrierwave.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - CarrierWave.configure do |config| config.storage = :file end diff --git a/config/initializers/check_session_secret.rb b/config/initializers/check_session_secret.rb new file mode 100644 index 0000000000000000000000000000000000000000..1970c5078bb53f9664634c7d0cada53d97bdf40f --- /dev/null +++ b/config/initializers/check_session_secret.rb @@ -0,0 +1,5 @@ +unless File.exists?( File.join(Rails.root, 'config', 'initializers', 'secret_token.rb')) + `rake generate:secret_token` + require File.join(Rails.root, 'config', 'initializers', 'secret_token.rb') +end + diff --git a/config/initializers/devise.rb b/config/initializers/devise.rb index 9f483a8bf21789fc5f13d849b69165fd0db5d4f6..a02045546ee67aac310969916ed69b91008c459d 100644 --- a/config/initializers/devise.rb +++ b/config/initializers/devise.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - # Use this hook to configure devise mailer, warden hooks and so forth. The first # four configuration values can also be set straight in your models. Devise.setup do |config| diff --git a/config/initializers/git_info.rb b/config/initializers/git_info.rb index a6d767aa46bcb11bd7be2e299c14ce7621287aeb..82fc99143c2db46c72acb66c6bfec6db6f172166 100644 --- a/config/initializers/git_info.rb +++ b/config/initializers/git_info.rb @@ -2,5 +2,4 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - -GIT_INFO = `git show` +GIT_INFO = `git show --name-only` diff --git a/config/initializers/inflections.rb b/config/initializers/inflections.rb index 3171994eedcb9535c03c06292cb813ee9dda6620..0e4097c04451821067c4921b1068c191b44c3a36 100644 --- a/config/initializers/inflections.rb +++ b/config/initializers/inflections.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - # Be sure to restart your server when you modify this file. # Add new inflection rules using the following format diff --git a/config/initializers/locale.rb b/config/initializers/locale.rb index 42f34a3a7c8c1fb3a9b13c57e17696749f667bed..823179842d6e01d3a177b4949f11feaef56b4820 100644 --- a/config/initializers/locale.rb +++ b/config/initializers/locale.rb @@ -2,7 +2,6 @@ # 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 +I18n.load_path += Dir[Rails.root.join('config', 'locales', '**', '*.{rb,yml}')] +I18n.default_locale = :en diff --git a/config/initializers/logging.rb b/config/initializers/logging.rb index 86abdbea3c35a2ada22521662370388c0144b187..48cc2fa303da9316d03df477eb9d4fbf86ae31aa 100644 --- a/config/initializers/logging.rb +++ b/config/initializers/logging.rb @@ -2,6 +2,5 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - Rails.logger = Logger.new( Rails.root.join("log",Rails.env + ".log"),3,5*1024*1024) diff --git a/config/initializers/mime_types.rb b/config/initializers/mime_types.rb index a5a89433ad76351c7b747cce5c6124e63e37c75d..77424db27ac5e336e2674bf66a14f2b91aea983b 100644 --- a/config/initializers/mime_types.rb +++ b/config/initializers/mime_types.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - # Be sure to restart your server when you modify this file. # Add new mime types for use in respond_to blocks: diff --git a/config/initializers/rspec_generator.rb b/config/initializers/rspec_generator.rb index caf2be23a558b589753050a6e2c71dd66fd0f37d..bdec44a0329f5f35ddcce37f03b633b277a164a5 100644 --- a/config/initializers/rspec_generator.rb +++ b/config/initializers/rspec_generator.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - Diaspora::Application.configure do config.generators do |g| g.integration_tool :rspec diff --git a/config/initializers/secret_token.rb b/config/initializers/secret_token.rb index c61c96d33df5c14a0dd7640d5706c278fe176b7a..66c59261abcf768bab8e5450bfd1151a384c3c8b 100644 --- a/config/initializers/secret_token.rb +++ b/config/initializers/secret_token.rb @@ -2,11 +2,10 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - # Be sure to restart your server when you modify this file. # Your secret key for verifying the integrity of signed cookies. # If you change this key, all old signed cookies will become invalid! # Make sure the secret is at least 30 characters and all random, # no regular words or you'll be exposed to dictionary attacks. -Rails.application.config.secret_token = 'ea08916110cae7f10fe9e1f7c7cb8c1fee13c3c3bee35180ac3061c370bd9ad985f28fcf2eb5f5684d0d618855efdeb862918628e994ed3e7fc806777428ef40' +Rails.application.config.secret_token = '3484b78b0f9d88f40cd44a20cf647140e5900632d0c9b85e1fd91dc539811d243f2f0756f791019c' diff --git a/config/initializers/session_store.rb b/config/initializers/session_store.rb index de79a36ebcf8572acd679628f223a5ec48805240..f4e36ea899d2d79e83e832da5b394081ddf9a9e9 100644 --- a/config/initializers/session_store.rb +++ b/config/initializers/session_store.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - # Be sure to restart your server when you modify this file. Rails.application.config.session_store :cookie_store, :key => '_diaspora_session' diff --git a/config/locales/cs.yml b/config/locales/cs.yml deleted file mode 100644 index 91c904dc19272fdd90ec7dcecff953cb322287cb..0000000000000000000000000000000000000000 --- a/config/locales/cs.yml +++ /dev/null @@ -1,10 +0,0 @@ -# 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" diff --git a/config/locales/de.yml b/config/locales/de.yml deleted file mode 100644 index 093df34661d5a59a767ff3423f98ed169fc704d7..0000000000000000000000000000000000000000 --- a/config/locales/de.yml +++ /dev/null @@ -1,116 +0,0 @@ -# Copyright (c) 2010, Diaspora Inc. This file is -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - - -# Localization file for German. Add more files in this directory for other locales. -# See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. - -de: - hello: "Hallo Welt" - layouts: - application: - edit_profile: "Profil bearbeiten" - logout: "Abmelden" - shared: - aspect_nav: - all_aspects: "Alle Aspekte" - manage: "Verwalten" - manage_your_aspects: "Aspekte verwalten" - sub_header: - all_aspects: "Alle Aspekte" - manage_aspects: "Aspekte verwalten" - publisher: - share: "Teilen" - aspect_friends: - add_friends: "Freunde hinzufügen" - albums: - album: - you: "dir" - new_album: - create: "erstellen" - add_a_new_album: "Album hinzufügen" - show: - edit_album: "Album bearbeiten" - albums: "Alben" - updated: "aktualisiert" - by: "von" - edit: - editing: "Bearbeite" - updated: "geändert" - are_you_sure: "Bist du sicher?" - delete_album: "Album löschen" - cancel: "Abbrechen" - index: - home: "Startseite" - new_album: "Neues Album" - aspects: - index: - photos: "Fotos" - show: - photos: "Fotos" - manage: - add_a_new_aspect: "Neuen Aspekt erstellen" - add_a_new_friend: "Freund hinzufügen" - show: "Anzeigen" - update_aspects: "Aspekte aktualisieren" - requests: "Anfragen" - ignore_remove: "Ignorieren/Entfernen" - new_aspect: - create: "Erstellen" - users: - edit: - cancel: "Abbrechen" - update_profile: "Profil aktualisieren" - home: "Startseite" - diaspora_username: "Diaspora Benutzername" - info: "Info" - picture: "Bild" - editing_profile: "Profil bearbeiten" - albums: "Alben" - comments: - comment: - # this won't work in german at all. Needs more thorough I18n - ago: "ago" - new_comment: - comment: "Kommentar" - photos: - show: - prev: "zurück" - full_size: "volle Größe" - next: "vor" - edit_photo: "Foto bearbeiten" - delete_photo: "Foto löschen" - are_you_sure: "Bist du sicher?" - comments: "Kommentare" - edit: - editing: "Bearbeite" - are_you_sure: "Bist du sicher?" - delete_photo: "Foto löschen" - photo: - show_comments: "Kommentare anzeigen" - new: - new_photo: "Foto erstellen" - back_to_list: "Zurück zur Liste" - post_it: "Hochladen" - registrations: - new: - sign_up: "Anmelden" - status_messages: - new_status_message: - tell_me_something_good: "Erzähl' mir was schönes!" - oh_yeah: "Hey, super!" - status_message: - show_comments: "Kommentare anzeigen" - delete: "Löschen" - are_you_sure: "Bist du sicher?" - show: - status_message: "Statusmeldung" - comments: "Kommentare" - are_you_sure: "Bist du sicher?" - destroy: "Löschen" - view_all: "Alle anzeigen" - message: "Nachricht" - owner: "Besitzer" - - diff --git a/config/locales/devise.de.yml b/config/locales/devise.de.yml deleted file mode 100644 index 7c0e0e75843c28b95c391367ae306943ce1c5ce8..0000000000000000000000000000000000000000 --- a/config/locales/devise.de.yml +++ /dev/null @@ -1,41 +0,0 @@ -# Copyright (c) 2010, Diaspora Inc. This file is -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - - -de: - errors: - messages: - not_found: "nicht gefunden" - already_confirmed: "wurde bereits bestätigt" - not_locked: "war nicht gesperrt" - - devise: - failure: - unauthenticated: 'Du musst dich anmelden oder registrieren um fortzufahren.' - unconfirmed: 'Du musst dein Konto bestätigen um fortzufahren.' - locked: 'Dein Konto ist gesperrt.' - invalid: 'Ungültige E-Mail-Adresse oder Passwort.' - invalid_token: 'Ungültiger Authentifizierungstoken.' - timeout: 'Deine Sitzung ist abgelaufen, bitte melde dich erneut an um fortzufahren.' - inactive: 'Dein Konto wurde noch nicht aktiviert.' - sessions: - signed_in: 'Erfolgreich angemeldet.' - signed_out: 'Erfolgreich abgemeldet.' - passwords: - send_instructions: 'Du wirst in ein paar Minuten eine E-Mail erhalten, die beschreibt, wie du dein Passwort zurücksetzt.' - updated: 'Dein Passwort wurde erfolgreich geändert. Du bist nun angemeldet.' - confirmations: - send_instructions: 'Du wirst in ein paar Minuten eine E-Mail erhalten, die beschreibt, wie du dein Konto bestätigst.' - confirmed: 'Dein Konto wurde erfolgreich bestätigt. Du bist nun angemeldet.' - registrations: - signed_up: 'Du hast dich erfolgreich registriert. Sofern aktiviert, wurde dir eine Bestätigung per E-Mail gesendet.' - updated: 'Dein Konto wurde aktualisiert.' - destroyed: 'Tschüss! Dein Konto wurde erfolgreich gekündigt. Wir hoffen dich bald wiederzusehen.' - unlocks: - send_instructions: 'Du wirst in ein paar Minuten eine E-Mail erhalten, die beschreibt, wie du dein Konto entsperren kannst.' - unlocked: 'Dein Konto wurde erfolgreich entsperrt. Du bist nun angemeldet.' - mailer: - confirmation_instructions: 'Instruktionen zur Bestätigung' - reset_password_instructions: 'Instruktionen zum Zurücksetzen des Passworts' - unlock_instructions: 'Instruktionen zum Entsperren' diff --git a/config/locales/devise.en.yml b/config/locales/devise.en.yml deleted file mode 100644 index 09d3ac62c691644b50b994ba0067b4b4d9612ed5..0000000000000000000000000000000000000000 --- a/config/locales/devise.en.yml +++ /dev/null @@ -1,41 +0,0 @@ -# Copyright (c) 2010, Diaspora Inc. This file is -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - - -en: - errors: - messages: - not_found: "not found" - already_confirmed: "was already confirmed" - not_locked: "was not locked" - - devise: - failure: - unauthenticated: 'You need to sign in or sign up before continuing.' - unconfirmed: 'You have to confirm your account before continuing.' - locked: 'Your account is locked.' - invalid: 'Invalid email or password.' - invalid_token: 'Invalid authentication token.' - timeout: 'Your session expired, please sign in again to continue.' - inactive: 'Your account was not activated yet.' - sessions: - signed_in: 'Signed in successfully.' - signed_out: 'Signed out successfully.' - passwords: - send_instructions: 'You will receive an email with instructions about how to reset your password in a few minutes.' - updated: 'Your password was changed successfully. You are now signed in.' - confirmations: - send_instructions: 'You will receive an email with instructions about how to confirm your account in a few minutes.' - confirmed: 'Your account was successfully confirmed. You are now signed in.' - registrations: - signed_up: 'You have signed up successfully. If enabled, a confirmation was sent to your e-mail.' - updated: 'You updated your account successfully.' - destroyed: 'Bye! Your account was successfully cancelled. We hope to see you again soon.' - unlocks: - send_instructions: 'You will receive an email with instructions about how to unlock your account in a few minutes.' - unlocked: 'Your account was successfully unlocked. You are now signed in.' - mailer: - confirmation_instructions: 'Confirmation instructions' - reset_password_instructions: 'Reset password instructions' - unlock_instructions: 'Unlock Instructions' diff --git a/config/locales/devise.cs.yml b/config/locales/devise/devise.cs.yml similarity index 99% rename from config/locales/devise.cs.yml rename to config/locales/devise/devise.cs.yml index 34d9eb7c1ef51ccb18143325d6e06f2b0dd9a30a..26ff8044db7b2e66f8e679029a632dba2a931a89 100644 --- a/config/locales/devise.cs.yml +++ b/config/locales/devise/devise.cs.yml @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - cs: errors: messages: diff --git a/config/locales/devise/devise.cy.yml b/config/locales/devise/devise.cy.yml new file mode 100644 index 0000000000000000000000000000000000000000..d8b6d94f49e75d2e28291272fed0ad3a750ea095 --- /dev/null +++ b/config/locales/devise/devise.cy.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. + +cy: + errors: + messages: + not_found: "ni chanfuwyd" + already_confirmed: "cadarnhawyd eisioes" + not_locked: "heb ei gloi" + + devise: + failure: + unauthenticated: "Mae angen i chi arwyddo i mewn neu ymuno cyn parhau." + unconfirmed: "Rhaid i chi gadarnhau eich cyfrif cyn parhau." + locked: "Mae eich cyfrif wedi'i gloi." + invalid: "E-bost neu gyfrinair annilys." + invalid_token: "Tocyn dilysu annilys." + timeout: "Mae eich sesiwn wedi dod i ben, arwyddwch i mewn eto i barhau." + inactive: "Nid yw eich cyfrif wedi'i actifadu." + sessions: + signed_in: "Arwyddwyd i fewn yn llwyddiannus." + signed_out: "Arwyddwyd allan yn llwyddiannus." + passwords: + send_instructions: "Byddwch yn derbyn e-bost â chyfarwyddiadau ar sut i gadarnhau eich cyfrif mewn ychydig funudau." + updated: "Newidiwyd eich cyfrinair yn llwyddiannus. Rydych chi wedi arwyddo i fewn." + confirmations: + send_instructions: "Byddwch yn derbyn e-bost â chyfarwyddiadau ar sut i gadarnhau eich cyfrif mewn ychydig funudau." + confirmed: "Cadarnhawyd eich cyfrif yn llwyddiannus. Rydych chi wedi arwyddo i fewn." + registrations: + signed_up: "Rydych chi wedi arwyddo i fyny yn llwyddiannus. Anfonwyd cadarnhad at eich e-bost os yw wedi'i alluogi." + updated: "Diweddarwyd eich cyfrif yn llwyddiannus." + destroyed: "Hwyl fawr! Canslwyd eich cyfrif yn llwyddiannus. Rydym yn gobeithio gweld chi eto yn fuan." + unlocks: + send_instructions: "Byddwch yn derbyn e-bost gyda cyfarwyddiadau ar sut i agor eich cyfrif mewn ychydig funudau." + unlocked: "Datglowyd eich cyfrif yn llwyddiannus. Rydych chi wedi arwyddo i fewn." + mailer: + confirmation_instructions: "Cyfarwyddiadau cadarnhad." + reset_password_instructions: "Ailosod cyfarwyddiadau cyfrinair" + unlock_instructions: "Cyfarwyddiadau Datgloi" + diff --git a/config/locales/devise/devise.de.yml b/config/locales/devise/devise.de.yml new file mode 100644 index 0000000000000000000000000000000000000000..e6608c18191dec3c3ebe7269d7041f01c0543350 --- /dev/null +++ b/config/locales/devise/devise.de.yml @@ -0,0 +1,40 @@ +# Copyright (c) 2010, Diaspora Inc. This file is +# licensed under the Affero General Public License version 3. See +# the COPYRIGHT file. + +de: + errors: + messages: + not_found: "nicht gefunden" + already_confirmed: "wurde bereits bestätigt" + not_locked: "war nicht gesperrt" + + devise: + failure: + unauthenticated: "Du musst dich anmelden oder registrieren um fortzufahren." + unconfirmed: "Du musst dein Konto bestätigen um fortzufahren." + locked: "Dein Konto ist gesperrt." + invalid: "Ungültige E-Mail-Adresse oder Passwort." + invalid_token: "Ungültiger Authentifizierungstoken." + timeout: "Deine Sitzung ist abgelaufen, bitte melde dich erneut an um fortzufahren." + inactive: "Dein Konto wurde noch nicht aktiviert." + sessions: + signed_in: "Erfolgreich angemeldet." + signed_out: "Erfolgreich abgemeldet." + passwords: + send_instructions: "Du wirst in ein paar Minuten eine E-Mail erhalten, die beschreibt, wie du dein Passwort zurücksetzt." + updated: "Dein Passwort wurde erfolgreich geändert. Du bist nun angemeldet." + confirmations: + send_instructions: "Du wirst in ein paar Minuten eine E-Mail erhalten, die beschreibt, wie du dein Konto bestätigst." + confirmed: "Dein Konto wurde erfolgreich bestätigt. Du bist nun angemeldet." + registrations: + signed_up: "Du hast dich erfolgreich registriert. Sofern aktiviert, wurde dir eine Bestätigung per E-Mail gesendet." + updated: "Dein Konto wurde aktualisiert." + destroyed: "Tschüss! Dein Konto wurde erfolgreich gekündigt. Wir hoffen dich bald wiederzusehen." + unlocks: + send_instructions: "Du wirst in ein paar Minuten eine E-Mail erhalten, die beschreibt, wie du dein Konto entsperren kannst." + unlocked: "Dein Konto wurde erfolgreich entsperrt. Du bist nun angemeldet." + mailer: + confirmation_instructions: "Instruktionen zur Bestätigung" + reset_password_instructions: "Instruktionen zum Zurücksetzen des Passworts" + unlock_instructions: "Instruktionen zum Entsperren" diff --git a/config/locales/devise/devise.en.yml b/config/locales/devise/devise.en.yml new file mode 100644 index 0000000000000000000000000000000000000000..7ab686bd4e9843ff0aecfe8e9106d1d2ebaefafe --- /dev/null +++ b/config/locales/devise/devise.en.yml @@ -0,0 +1,40 @@ +# Copyright (c) 2010, Diaspora Inc. This file is +# licensed under the Affero General Public License version 3. See +# the COPYRIGHT file. + +en: + errors: + messages: + not_found: "not found" + already_confirmed: "was already confirmed" + not_locked: "was not locked" + + devise: + failure: + unauthenticated: "You need to sign in or sign up before continuing." + unconfirmed: "You have to confirm your account before continuing." + locked: "Your account is locked." + invalid: "Invalid email or password." + invalid_token: "Invalid authentication token." + timeout: "Your session expired, please sign in again to continue." + inactive: "Your account was not activated yet." + sessions: + signed_in: "Signed in successfully." + signed_out: "Signed out successfully." + passwords: + send_instructions: "You will receive an email with instructions about how to reset your password in a few minutes." + updated: "Your password was changed successfully. You are now signed in." + confirmations: + send_instructions: "You will receive an email with instructions about how to confirm your account in a few minutes." + confirmed: "Your account was successfully confirmed. You are now signed in." + registrations: + signed_up: "You have signed up successfully. If enabled, a confirmation was sent to your e-mail." + updated: "You updated your account successfully." + destroyed: "Bye! Your account was successfully cancelled. We hope to see you again soon." + unlocks: + send_instructions: "You will receive an email with instructions about how to unlock your account in a few minutes." + unlocked: "Your account was successfully unlocked. You are now signed in." + mailer: + confirmation_instructions: "Confirmation instructions" + reset_password_instructions: "Reset password instructions" + unlock_instructions: "Unlock Instructions" diff --git a/config/locales/devise.es.yml b/config/locales/devise/devise.es.yml similarity index 100% rename from config/locales/devise.es.yml rename to config/locales/devise/devise.es.yml diff --git a/config/locales/devise.fi.yml b/config/locales/devise/devise.fi.yml similarity index 97% rename from config/locales/devise.fi.yml rename to config/locales/devise/devise.fi.yml index 9109b40a85f5e03db80fabfc78eb7b138a04bca9..c77ead4b26c2ca963d3b565fe0918f649370eb06 100644 --- a/config/locales/devise.fi.yml +++ b/config/locales/devise/devise.fi.yml @@ -1,7 +1,7 @@ # Copyright (c) 2010, Diaspora Inc. This file is # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. -# Translator: jarkko moilanen, jm60697@gmail.com +# Translator: jarkko moilanen, jm60697@gmail.com fi: errors: diff --git a/config/locales/devise/devise.fr-informal.yml b/config/locales/devise/devise.fr-informal.yml new file mode 100644 index 0000000000000000000000000000000000000000..6fe14382e3ee17de7d2ede8805e9f65eb4d71824 --- /dev/null +++ b/config/locales/devise/devise.fr-informal.yml @@ -0,0 +1,40 @@ +# Copyright (c) 2010, Diaspora Inc. This file is +# licensed under the Affero General Public License version 3. See +# the COPYRIGHT file. + +fr-informal: + errors: + messages: + not_found: "introuvable" + already_confirmed: "a déjà été confirmé" + not_locked: "n’a pas été verrouillé" + + devise: + failure: + unauthenticated: 'Tu dois te connecter ou t’inscrire avant de continuer.' + unconfirmed: 'Tu dois confirmer ton compte avant de continuer.' + locked: 'Ton compte est verrouillé.' + invalid: 'Adresse e-mail ou mot de passe invalide.' + invalid_token: 'Jeton d’authentification invalide.' + timeout: 'Ta session a expiré, merci de te connecter de nouveau afin de continuer.' + inactive: 'Ton compte n’a pas encore été activé.' + sessions: + signed_in: 'Connecté avec succès.' + signed_out: 'Déconnecté avec succès.' + passwords: + send_instructions: 'Tu vas recevoir dans quelques minutes un e-mail contenant des instructions t’expliquant comment réinitialiser ton mot de passe.' + updated: 'Ton mot de passe a été modifié avec succès. Tu es à présent connecté.' + confirmations: + send_instructions: 'Tu vas recevoir dans quelques minutes un e-mail contenant des instructions t’expliquant comment confirmer ton compte.' + confirmed: 'Ton compte a été confirmé avec succès. Tu es à présent connecté.' + registrations: + signed_up: 'Tu t’es inscrit avec succès. Si activée, une confirmation a été envoyée sur ton adresse e-mail.' + updated: 'Tu as mis à jour ton compte avec succès.' + destroyed: 'Au revoir ! Ton compte a été résilié avec succès. Nous espérons te revoir très bientôt.' + unlocks: + send_instructions: 'Tu vas recevoir dans quelques minutes un e-mail contenant des instructions t’expliquant comment déverrouiller ton compte.' + unlocked: 'Ton compte a été déverrouillé avec succès. Tu es à présent connecté.' + mailer: + confirmation_instructions: 'Instructions de confirmation' + reset_password_instructions: 'Réinitialiser les instructions du mot de passe' + unlock_instructions: 'Instructions de déverrouillage' diff --git a/config/locales/devise.fr.yml b/config/locales/devise/devise.fr.yml similarity index 99% rename from config/locales/devise.fr.yml rename to config/locales/devise/devise.fr.yml index b8691eb3a3291e7e9279374edec0ea9eb78d622d..240e9d967d21b049aae335cf8b4e428df1ff238f 100644 --- a/config/locales/devise.fr.yml +++ b/config/locales/devise/devise.fr.yml @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - fr: errors: messages: diff --git a/config/locales/devise/devise.he.yml b/config/locales/devise/devise.he.yml new file mode 100644 index 0000000000000000000000000000000000000000..c33cfa67888cbe958fac58282f8d1c26d3a7fe7e --- /dev/null +++ b/config/locales/devise/devise.he.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. +# Translated to Hebrew by Yaron Shahrabani <sh.yaron@gmail.com>, 2010. + +he: + errors: + messages: + not_found: "×œ× × ×ž×¦×" + already_confirmed: "כבר ×ושר" + not_locked: "×œ× × × ×¢×œ" + + devise: + failure: + unauthenticated: "עליך ×œ×”×™×›× ×¡ ×ו ×œ×”×™×¨×©× ×œ×¤× ×™ המשך הפעילות." + unconfirmed: "עליך ל×מת ×ת ×—×©×‘×•× ×š לפי המשך הפעילות." + locked: "×—×©×‘×•× ×š × ×¢×•×œ." + invalid: "הססמה ×ו הדו×״ל שגויי×." + invalid_token: "×סימון ×”×ימות שגוי." + timeout: "ההפעלה שלך פגה, × × ×œ×”×™×›× ×¡ שוב כדי להמשיך." + inactive: "×—×©×‘×•× ×š ×œ× ×”×•×¤×¢×œ עדין." + sessions: + signed_in: "× ×›× ×¡×ª בהצלחה." + signed_out: "יצ×ת בהצלחה." + passwords: + send_instructions: "בעוד מספר דקות תתקבל לתיבת הדו×״ל שלך הודעה ×¢× ×”× ×—×™×•×ª כיצד ל×פס ×ת ססמתך." + updated: "ססמתך הוחלפה בהצלחה. × ×›× ×¡×ª כעת." + confirmations: + send_instructions: "בעוד מספר דקות תתקבל לתיבת הדו×״ל שלך הודעה ×¢× ×”× ×—×™×•×ª כיצד ל×מת ×ת ×—×©×‘×•× ×š." + confirmed: "×—×©×‘×•× ×š ×ומת בהצלחה. × ×›× ×¡×ª כעת." + registrations: + signed_up: "× ×¨×©×ž×ª בהצלחה. הודעת ×ימות תישלח ×ליך לדו×״ל במידה שהוגדרה." + updated: "×—×©×‘×•× ×š עודכן בהצלחה." + destroyed: "להתר×ות! ×—×©×‘×•× ×š בוטל בהצלחה. ×ž×§×•×•×™× ×œ×¨×ותך שוב בקרוב." + unlocks: + send_instructions: "בעוד מספר דקות תתקבל לתיבת הוד×״ל שלך הודעה ×¢× ×”× ×—×™×•×ª כיצד לשחרר ×ת ×—×©×‘×•× ×š." + unlocked: "×—×©×‘×•× ×š שוחרר בהצלחה. × ×›× ×¡×ª כעת." + mailer: + confirmation_instructions: "×”× ×—×™×•×ª ל×ימות" + reset_password_instructions: "×”× ×—×™×•×ª ל×יפוס הססמה" + unlock_instructions: "×”× ×—×™×•×ª לשחרור" diff --git a/config/locales/devise.it.yml b/config/locales/devise/devise.it.yml similarity index 99% rename from config/locales/devise.it.yml rename to config/locales/devise/devise.it.yml index 76f761e377e5d9ec302a0d86f3ad94b89e8450ad..96044d191844cc11511751f2afe6fc3412c06062 100644 --- a/config/locales/devise.it.yml +++ b/config/locales/devise/devise.it.yml @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - it: errors: messages: diff --git a/config/locales/devise.lt.yml b/config/locales/devise/devise.lt.yml similarity index 99% rename from config/locales/devise.lt.yml rename to config/locales/devise/devise.lt.yml index d6e33c1cbe84c72a3aaf5ca55cef08fe4a86472e..8ae8f027b5b3e1aef526d2f648deefdf902eb076 100644 --- a/config/locales/devise.lt.yml +++ b/config/locales/devise/devise.lt.yml @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - lt: errors: messages: diff --git a/config/locales/devise.pl.yml b/config/locales/devise/devise.pl.yml similarity index 99% rename from config/locales/devise.pl.yml rename to config/locales/devise/devise.pl.yml index a490a1a3980c573a7b8a8479835282b6cb30bacb..503fb6d6136a2db73be11e1dbb7de39ff73e005e 100644 --- a/config/locales/devise.pl.yml +++ b/config/locales/devise/devise.pl.yml @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - pl: errors: messages: diff --git a/config/locales/devise.pt-BR.yml b/config/locales/devise/devise.pt-BR.yml similarity index 99% rename from config/locales/devise.pt-BR.yml rename to config/locales/devise/devise.pt-BR.yml index ba2b3b5de9b6f0c3adce60714923b43d8487320c..5a39a4734550150d5c3006916b70a35b1cb5eeb2 100644 --- a/config/locales/devise.pt-BR.yml +++ b/config/locales/devise/devise.pt-BR.yml @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - pt-BR: errors: messages: diff --git a/config/locales/devise.pt-PT.yml b/config/locales/devise/devise.pt-PT.yml similarity index 99% rename from config/locales/devise.pt-PT.yml rename to config/locales/devise/devise.pt-PT.yml index cf16fd20d4e65d8ec8db1a19d1d5068fb5537c14..c0c9555171ce189c5c892b730f2eda5b67cbf546 100644 --- a/config/locales/devise.pt-PT.yml +++ b/config/locales/devise/devise.pt-PT.yml @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - pt-PT: errors: messages: diff --git a/config/locales/devise/devise.ro.yml b/config/locales/devise/devise.ro.yml new file mode 100644 index 0000000000000000000000000000000000000000..b4d12e6b67825509b52e353cd07467d6126b1d9b --- /dev/null +++ b/config/locales/devise/devise.ro.yml @@ -0,0 +1,40 @@ +# Copyright (c) 2010, Diaspora Inc. This file is +# licensed under the Affero General Public License version 3. See +# the COPYRIGHT file. + +ro: + errors: + messages: + not_found: "inexistent" + already_confirmed: "a fost deja confirmat" + not_locked: "nu a fost blocat" + + devise: + failure: + unauthenticated: 'Pentru a continuna, înregistraÈ›i-vă.' + unconfirmed: 'Pentru a continua, confirmaÈ›i contul dvs.' + locked: 'Contul dvs. este blocat.' + invalid: 'Email sau parolă incorectă.' + invalid_token: 'Cheie de autentificare invalidă.' + timeout: 'Sesiunea dvs. a expirat, autentificaÈ›i-vă din nou pentru a continua.' + inactive: 'Contul dvs. încă nu a fost activat.' + sessions: + signed_in: 'Autentificare cu succes.' + signed_out: 'Deconectare cu succes.' + passwords: + send_instructions: 'ÃŽn scurt timp veÈ›i primi un email cu instrucÈ›iuni pentru resetarea parolei.' + updated: 'Parolă schimbată cu success. SunteÈ›i acum autentificat(ă).' + confirmations: + send_instructions: 'ÃŽn scurt timp veÈ›i primi un email cu instrucÈ›iuni pentru confirmarea contului.' + confirmed: 'Contul dvs. a fost confirmat cu succes. SunteÈ›i acum autentificat(ă).' + registrations: + signed_up: 'SunteÈ›i autentificat(ă). Dacă este cazul, un mesaj de confirmare a fost trimis pe email-ul dvs.' + updated: 'Cont actualizat cu succes.' + destroyed: 'Pa! Contul dvs. a fost dezactivat cu succes. Sperăm să vă revedem în curând.' + unlocks: + send_instructions: 'ÃŽn scurt timp veÈ›i primi un email cu instrucÈ›iuni pentru deblocarea contului.' + unlocked: 'Cont deblocat cu succes. SunteÈ›i acum autentificat(ă).' + mailer: + confirmation_instructions: 'InstrucÈ›iuni pentru confirmarea contului.' + reset_password_instructions: 'InstrucÈ›iuni pentru resetarea parolei.' + unlock_instructions: 'InstrucÈ›iuni pentru deblocare contului.' diff --git a/config/locales/devise.ru.yml b/config/locales/devise/devise.ru.yml similarity index 99% rename from config/locales/devise.ru.yml rename to config/locales/devise/devise.ru.yml index 670d570267257560e5f0fbf5b73cbe3b10fdda32..1ac6268618d59582167a5d1f877f7423cd50ab3d 100644 --- a/config/locales/devise.ru.yml +++ b/config/locales/devise/devise.ru.yml @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - ru: errors: messages: diff --git a/config/locales/devise.sv.yml b/config/locales/devise/devise.sv.yml similarity index 99% rename from config/locales/devise.sv.yml rename to config/locales/devise/devise.sv.yml index b434666cee8a33c242c97618c6c37d1acea0cb8b..c83179bde9212605431d24e9b22fa2ee9221b24b 100644 --- a/config/locales/devise.sv.yml +++ b/config/locales/devise/devise.sv.yml @@ -1,7 +1,6 @@ # Copyright (c) 2010, Diaspora Inc. This file is # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - sv: errors: diff --git a/config/locales/diaspora/cs.yml b/config/locales/diaspora/cs.yml new file mode 100644 index 0000000000000000000000000000000000000000..78666424c458e5a7bf3ab765f53cd0371d02cf54 --- /dev/null +++ b/config/locales/diaspora/cs.yml @@ -0,0 +1,217 @@ +# 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" + application: + helper: + unknown_person: "neznámá osoba" + new_requests: "nové žádosti" + dashboards: + helper: + home: "domů" + datetime: + distance_in_words: + less_than_x_seconds: "ménÄ› než %{count} sekund" + half_a_minute: "půl minuty" + less_than_x_minutes: "ménÄ› než %{count} minut" + x_minutes: "%{count} minuty" + about_x_hours: "zhruba %{count} hodin" + x_days: "%{count} dnÃ" + about_x_months: "zhruba %{count} mÄ›sÃců" + x_months: "%{count} mÄ›sÃců" + about_x_years: "zhruba %{count} let" + over_x_years: "pÅ™ez %{count} let" + almost_x_years: "skoro %{count} let" + error_messages: + helper: + invalid_fields: "Neplatná pole" + correct_the_following_errors_and_try_again: "Opravte následujÃcà chyby a zkuste to znovu." + people: + helper: + results_for: " vysledky vyhledávánà %{params}" + people_on_pod_are_aware_of: " people on pod are aware of" + layouts: + application: + edit_profile: "upravit profil" + logout: "odhlásit se" + shared: + aspect_nav: + all_aspects: "VÅ¡echny aspekty" + manage: "Spravovat" + manage_your_aspects: "Spravovat vaÅ¡e aspekty" + sub_header: + all_aspects: "VÅ¡echny aspekty" + manage_aspects: "Spravovat aspekty" + publisher: + share: "SdÄ›lit" + aspect_friends: + add_friends: "pÅ™idat přátele" + albums: + album: + you: "vy" + new_album: + create: "vytvoÅ™it" + add_a_new_album: "PÅ™idat nové album" + show: + edit_album: "Upravit album" + albums: "alba" + updated: "aktualizované" + by: "uživatelem" + edit: + editing: "Upravuje se" + updated: "aktualizováno" + are_you_sure: "Jste si jisti?" + delete_album: "Smazat Album" + cancel: "ZruÅ¡it" + index: + home: "doma" + new_album: "Nové Album" + create: + success: "VytvoÅ™ili jste nové album nazvané %{name}." + update: + success: "Album %{name} úspěšnÄ› upraveno." + failure: "NepodaÅ™ilo se upravit album %{name}." + destroy: + success: "Album %{name} smazáno." + helper: + friends_albums: "Alba přátel" + your_albums: "VaÅ¡e Alba" + aspects: + index: + photos: "fotografie" + show: + photos: "fotografie" + manage: + add_a_new_aspect: "PÅ™idat aspekt" + add_a_new_friend: "PÅ™idat nového pÅ™Ãtele" + show: "Show" + update_aspects: "Aktualizovat aspekty" + requests: "Žádosti" + ignore_remove: "Ignorovat/Odebrat" + new_aspect: + add_a_new_aspect: "PÅ™idat nový aspekt" + create: "VytvoÅ™it" + create: + success: "ŘeknÄ›te DiaspoÅ™e kdo může vidÄ›t váš nový aspekt kliknutÃm na plus na levé stranÄ›." + destroy: + success: "%{name} byl úspěšnÄ› odebrán." + update: + success: "Váš aspekt, %{name}, byl úspěšnÄ› upraven." + move_friends: + failure: "Úprava aspektu pÅ™Ãtelem %{real_name} selhala." + success: "Aspekty úspěšnÄ› upraveny." + move_friend: + failure: "nepodaÅ™ilo se %{inspect}" + success: "Nynà svému pÅ™Ãteli ukazujete jiný ze svých aspektů." + helper: + remove: "odebrat" + aspect_not_empty: "Aspekt nenà prázdný" + users: + edit: + cancel: "ZruÅ¡it" + update_profile: "Aktualizovat profil" + home: "Domů" + diaspora_username: "UŽIVATELSKÉ JMÉNO V DIASPOŘE" + info: "Info" + picture: "Obrázek" + editing_profile: "Upravit profil" + albums: "Alba" + you_dont_have_any_photos: "Nemáte žádné fotky. JdÄ›te na stránku" + page_to_upload_some: "a nÄ›jaké nahrajte." + comments: + comment: + ago: "nazpÄ›t" + new_comment: + comment: "Komentář" + photos: + show: + prev: "pÅ™edchozÃ" + full_size: "plná velkost" + next: "dalÅ¡Ã" + edit_photo: "Upravit fotku" + delete_photo: "Smazat fotku" + are_you_sure: "Jste si jisti?" + comments: "komentáře" + edit: + editing: "Uprait" + are_you_sure: "Jste si jisti?" + delete_photo: "Smazat fotku" + photo: + show_comments: "zobrazit komentáře" + posted_a_new_photo_to: "poslal novou fotku do" + new: + new_photo: "Nová fotka" + back_to_list: "ZpÄ›t na seznam" + post_it: "poslat!" + create: + runtime_error: "Poslánà fotky selhalo. Jste si jisti, že máte zapnuté pásy?" + integrity_error: "Poslánà fotky selhalo. Jste si jisti že to byl obrázek?" + type_error: "Poslánà fotky selhalo. Jste si jisti zÄ› byl pÅ™idán obrázek?" + update: + notice: "Fotka úspěšnÄ› aktualizována." + error: "NepodaÅ™ilo se upravit fotku." + destroy: + notice: "Fotka smazána." + registrations: + new: + sign_up: "Zapsat se" + create: + success: "PÅ™ipojili jste se k DiaspoÅ™e!" + status_messages: + new_status_message: + tell_me_something_good: "povÄ›z mi nÄ›co dobrého" + oh_yeah: "ó ano!" + status_message: + show_comments: "zobrazit komentáře" + delete: "Smazat" + are_you_sure: "Jste si jisti?" + show: + status_message: "Zpráva o stavu" + comments: "komentáře" + are_you_sure: "Jste si jisti?" + destroy: "ZniÄit" + view_all: "Zobrazit VÅ¡e" + message: "Zpráva" + owner: "VlastnÃk" + helper: + no_message_to_display: "Nenà k zobrazenà žádná zpráva." + people: + person: + add_friend: "pÅ™idat pÅ™Ãtele" + pending_request: "nevyÅ™Ãzené žádosti" + index: + add_friend: "pÅ™idat pÅ™Ãtele" + real_name: "pravé jméno" + diaspora_handle: "adresa v diaspoÅ™e" + thats_you: "to jste vy!" + friend_request_pending: "nevyÅ™Ãzená žádost o přátelstvÃ" + you_have_a_friend_request_from_this_person: "od této osoby máte žádost o přátelstvÃ" + new: + new_person: "Nová Osoba" + back_to_list: "ZpÄ›t na Seznam" + show: + last_seen: "naposledy vidÄ›ni: %{how_long_ago}" + friends_since: "přáteli od: %{how_long_ago}" + save: "save" + are_you_sure: "Jste si jisti?" + remove_friend: "odebrat pÅ™Ãtele" + requests: + new_request: + add_a_new_friend_to: "Pridat nového pÅ™Ãtele do" + enter_a_diaspora_username: "Vložte uživatelské jméno v diaspoÅ™e:" + your_diaspora_username_is: "VaÅ¡e uživatelské jméno v diaspoÅ™e je: %{diaspora_handle}" + friends_username: "Uživatelské jméno pÅ™Ãtele" + destroy: + success: "Nynà jste přáteli." + error: "ProsÃm vyberte aspekt!" + ignore: "Ignorovat žádost o přátelstvÃ." + create: + error: "SemÃnko diaspory s touto adresou nenalezeno!" + already_friends: "S %{destination_url} už jste přáteli!" + success: "byla poslána žádost o přátelstvà na %{destination_url}" + horribly_wrong: "NÄ›co se oÅ¡klivÄ› pokazilo." diff --git a/config/locales/diaspora/cy.yml b/config/locales/diaspora/cy.yml new file mode 100644 index 0000000000000000000000000000000000000000..97b4fd3df79ef6145d6d83b96df839fb9ece0bf0 --- /dev/null +++ b/config/locales/diaspora/cy.yml @@ -0,0 +1,142 @@ +# 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 English. Add more files in this directory for other locales. +# See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. + +cy: + hello: "Helo byd" + layouts: + application: + edit_profile: "golygu proffil" + logout: "arwyddo allan" + shared: + aspect_nav: + all_aspects: "Pob agwedd" + manage: "Rheoli" + manage_your_aspects: "Rheoli eich agweddau" + sub_header: + all_aspects: "Pob agwedd" + manage_aspects: "Rheloi agweddau" + publisher: + share: "Rhannu" + aspect_friends: + add_friends: "ychwanegu ffrindiau" + albums: + album: + you: "chi" + new_album: + create: "creu" + add_a_new_album: "Ychwanegu albwm newydd" + show: + edit_album: "Golygu Albwm" + albums: "albymau" + updated: "diweddarwyd" + by: "gan" + edit: + editing: "Wrthi'n golygu" + updated: "diweddarwyd" + are_you_sure: "Ydych chi'n sicr?" + delete_album: "Dileu Albwm" + cancel: "Cancel" + index: + home: "adref" + new_album: "Albwm Newydd" + create: + success: "Chi wedi creu albwm a'i enwi'n %{name}." + update: + success: "Mae albwm %{name} wedi'i olygu yn llwyddiannus." + failure: "Wedi methu golygu albwm %{name}." + destroy: + success: "Wedi dileu albwm %{name}." + aspects: + index: + photos: "lluniau" + show: + photos: "lluniau" + manage: + add_a_new_aspect: "Ychwanegwch agwedd" + add_a_new_friend: "Ychwanegwch ffrind newydd" + show: "Dangos" + update_aspects: "Diweddaru Agweddau" + requests: "Ceisiadau" + ignore_remove: "Anwybyddu/Tynnu" + new_aspect: + add_a_new_aspect: "Ychwanegwch agwedd newydd" + create: "Creu" + create: + success:"Cliciwch ar y plus ar y chwith i ddweud wrth Diaspora pwy all weld eich agwedd newydd." + users: + edit: + cancel: "Cancel" + update_profile: "Diweddaru Proffil" + home: "Adref" + diaspora_username: "FFUGENW DIASPORA" + info: "Gwybodaeth" + picture: "Llun" + editing_profile: "Golygu proffil" + albums: "Albymau" + you_dont_have_any_photos: "Does gennych chi ddim lluniau! Ewch i'r" + page_to_upload_some: "dudalen i uwchlwytho rhai." + comments: + comment: + ago: "yn ol" + new_comment: + comment: "Sylw" + photos: + show: + prev: "blaenorol" + full_size: "maint llawn" + next: "neasf" + edit_photo: "Golygu Llun" + delete_photo: "Dileu Llun" + are_you_sure: "Ydych chi'n sicr?" + comments: "sylwadau" + edit: + editing: "Golygu" + are_you_sure: "Ydych chi'n sicr?" + delete_photo: "Dileu Llun" + photo: + show_comments: "dangos sylwadau" + posted_a_new_photo_to: "postiwyd llun newydd i" + new: + new_photo: "Llun Newydd" + back_to_list: "Nol i'r Rhestr" + post_it: "postiwch e!" + registrations: + new: + sign_up: "Cofrestrwch" + status_messages: + new_status_message: + tell_me_something_good: "Dwi eisiau clywed rhwbeth da" + oh_yeah: "oh yeah!" + status_message: + show_comments: "dangos sylwadau" + delete: "Dileu" + are_you_sure: "Ydych chi'n sicr?" + show: + status_message: "Neges Statws" + comments: "sylwadau" + are_you_sure: "Ydych chi'n sicr?" + destroy: "Dinistrio" + view_all: "Gweld Pob Un" + message: "Neges" + owner: "Perchennog" + people: + index: + add_friend: "ychwanegu ffrind" + real_name: "enw llawn" + diaspora_handle: "bachyn diaspora" + thats_you: "dyna chi!" + friend_request_pending: "cais ffrind dan ystyriaeth" + you_have_a_friend_request_from_this_person: "mae'r person yma eisiau bod yn ffrind i chi" + new: + new_person: "Person Newydd" + back_to_list: "Nol i'r Rhestr" + show: + last_seen: "gwelwyd diwethaf: %{how_long_ago}" + friends_since: "yn ffrindiau ers: %{how_long_ago}" + save: "arbed" + are_you_sure: "Ydych chi'n sicr?" + remove_friend: "dileu ffrind" \ No newline at end of file diff --git a/config/locales/diaspora/de.yml b/config/locales/diaspora/de.yml new file mode 100644 index 0000000000000000000000000000000000000000..dd3cead597219a101875f753f53ac6dce9510dc8 --- /dev/null +++ b/config/locales/diaspora/de.yml @@ -0,0 +1,205 @@ +# Copyright (c) 2010, Diaspora Inc. This file is +# licensed under the Affero General Public License version 3. See +# the COPYRIGHT file. + +# Localization file for German. Add more files in this directory for other locales. +# See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. + +de: + hello: "Hallo Welt" + application: + helper: + unknown_person: "unbekannte Person" + new_requests: "neue Anfrage" + dashboards: + helper: + home: "Startseite" + error_messages: + helper: + invalid_fields: "Ungültige Felder" + correct_the_following_errors_and_try_again: "Korrigiere die folgenden Fehler und probiere es erneut." + people: + helper: + results_for: " Resultate für %{params}" + people_on_pod_are_aware_of: " people on pod are aware of" + layouts: + application: + edit_profile: "Profil bearbeiten" + logout: "Abmelden" + shared: + aspect_nav: + all_aspects: "Alle Aspekte" + manage: "Verwalten" + manage_your_aspects: "Aspekte verwalten" + sub_header: + all_aspects: "Alle Aspekte" + manage_aspects: "Aspekte verwalten" + publisher: + share: "Teilen" + aspect_friends: + add_friends: "Freunde hinzufügen" + albums: + album: + you: "dir" + new_album: + create: "erstellen" + add_a_new_album: "Album hinzufügen" + show: + edit_album: "Album bearbeiten" + albums: "Alben" + updated: "aktualisiert" + by: "von" + edit: + editing: "Bearbeite" + updated: "geändert" + are_you_sure: "Bist du sicher?" + delete_album: "Album löschen" + cancel: "Abbrechen" + index: + home: "Startseite" + new_album: "Neues Album" + create: + success: "Du hast das Album %{name} erstellt." + update: + success: "Album %{name} erfolgreich geändert." + failure: "%{name} wurde nicht geändert." + destroy: + success: "Album %{name} gelöscht." + helper: + friends_albums: "Alben von Freunden" + your_albums: "Deine Alben" + aspects: + index: + photos: "Fotos" + show: + photos: "Fotos" + manage: + add_a_new_aspect: "Neuen Aspekt erstellen" + add_a_new_friend: "Freund hinzufügen" + show: "Anzeigen" + update_aspects: "Aspekte aktualisieren" + requests: "Anfragen" + ignore_remove: "Ignorieren/Entfernen" + new_aspect: + add_a_new_aspect: "Neuen Aspekt erstellen" + create: "Erstellen" + create: + success: "Klicke auf das Plus auf der linken Seite um Diaspora mitzuteilen wer deinen neuen Aspekt sehen kann." + destroy: + success: "%{name} wurde erfolgreich gelöscht." + update: + success: "Dein Aspekt, %{name}, wurde erfolgreich geändert." + move_friends: + failure: "Ändern des Aspekts für deinen Freund %{real_name} fehlgeschlagen." + success: "Aspekt erfolgreich geändert." + move_friend: + error: "didn't work %{inspect}" + notice: "Du zeigst deinem Freund jetzt einen anderen Aspekt von dir." + helper: + remove: "entfernen" + aspect_not_empty: "Aspekt ist nicht leer" + users: + edit: + cancel: "Abbrechen" + update_profile: "Profil aktualisieren" + home: "Startseite" + diaspora_username: "Diaspora Benutzername" + info: "Info" + picture: "Bild" + editing_profile: "Profil bearbeiten" + albums: "Alben" + you_dont_have_any_photos: "Du hast keine Fotos! Gehe auf die" + page_to_upload_some: "Seite um welche hochzuladen." + comments: + comment: + # this won't work in german at all. Needs more thorough I18n + ago: "ago" + new_comment: + comment: "Kommentar" + photos: + show: + prev: "zurück" + full_size: "volle Größe" + next: "vor" + edit_photo: "Foto bearbeiten" + delete_photo: "Foto löschen" + are_you_sure: "Bist du sicher?" + comments: "Kommentare" + edit: + editing: "Bearbeite" + are_you_sure: "Bist du sicher?" + delete_photo: "Foto löschen" + photo: + show_comments: "Kommentare anzeigen" + posted_a_new_photo_to: "neues Foto veröffentlicht bei" + new: + new_photo: "Foto erstellen" + back_to_list: "Zurück zur Liste" + post_it: "Hochladen" + create: + runtime_error: "Hochladen eines Fotos fehlgeschlagen. Bist du sicher, dass dein Sicherheitsgurt befestigt ist?" + integrity_error: "Hochladen eines Fotos fehlgeschlagen. Bist du sicher, dass das ein Bild war?" + type_error: "Hochladen eines Fotos fehlgeschlagen. Bist du sicher, dass ein Bild hinzugefügt wurde?" + update: + notice: "Foto erfolgreich aktualisiert." + error: "Ändern des Fotos fehlgeschlagen." + destroy: + notice: "Foto gelöscht." + registrations: + new: + sign_up: "Anmelden" + create: + success: "Du bist Diaspora beigetreten!" + status_messages: + new_status_message: + tell_me_something_good: "Erzähl' mir was schönes!" + oh_yeah: "Oh, super!" + status_message: + show_comments: "Kommentare anzeigen" + delete: "Löschen" + are_you_sure: "Bist du sicher?" + show: + status_message: "Statusmeldung" + comments: "Kommentare" + are_you_sure: "Bist du sicher?" + destroy: "Löschen" + view_all: "Alle anzeigen" + message: "Nachricht" + owner: "Eigentümer" + helper: + no_message_to_display: "Keine Nachricht zum anzeigen." + people: + person: + add_friend: "Freund hinzufügen" + pending_request: "Anfrage ausstehend" + index: + add_friend: "Freund hinzufügen" + real_name: "Echter Name" + diaspora_handle: "diaspora handle" + thats_you: "das bist du!" + friend_request_pending: "Ausstehende Freundschaftsanfrage" + you_have_a_friend_request_from_this_person: "Du hast eine Freundschaftsanfrage von dieser Person" + new: + new_person: "Neue Person" + back_to_list: "Zurück zur Liste" + show: + last_seen: "zuletzt gesehen: %{how_long_ago}" + friends_since: "Freunde seit: %{how_long_ago}" + save: "speichern" + are_you_sure: "Bist du sicher?" + remove_friend: "Freund entfernen" + requests: + new_request: + add_a_new_friend_to: "Add a new friend to" + enter_a_diaspora_username: "Gebe einen Diaspora Benutzernamen ein:" + your_diaspora_username_is: "Dein Diaspora Benutzername ist: %{diaspora_handle}" + friends_username: "Freundes Benutzername" + destroy: + success: "Ihr seid jetzt Freunde." + error: "Bitte wähle einen Aspekt aus!" + ignore: "Freundschaftsanfrage ignorieren." + create: + error: "Kein Diaspora-Seed in dieser E-Mail gefunden!" + already_friends: "Du bist bereits mit %{destination_url} befreundet!" + success: "Eine Freundschaftsanfrage wurde an %{destination_url} gesendet." + horribly_wrong: "Etwas ging tierisch schief." diff --git a/config/locales/en.yml b/config/locales/diaspora/en.yml similarity index 61% rename from config/locales/en.yml rename to config/locales/diaspora/en.yml index 867b120e0304669e06854d5bb5a11b6182823e82..025aed1493677d5c4423e2f2a934968923aadda3 100644 --- a/config/locales/en.yml +++ b/config/locales/diaspora/en.yml @@ -2,12 +2,26 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - # Sample localization file for English. Add more files in this directory for other locales. # See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. en: hello: "Hello world" + application: + helper: + unknown_person: "unknown person" + new_requests: "new requests" + dashboards: + helper: + home: "home" + error_messages: + helper: + invalid_fields: "Invalid Fields" + correct_the_following_errors_and_try_again: "Correct the following errors and try again." + people: + helper: + results_for: " results for %{params}" + people_on_pod_are_aware_of: " people on pod are aware of" layouts: application: edit_profile: "edit profile" @@ -30,7 +44,7 @@ en: new_album: create: "create" add_a_new_album: "Add a new album" - show: + show: edit_album: "Edit Album" albums: "albums" updated: "updated" @@ -51,6 +65,9 @@ en: failure: "Failed to edit album %{name}." destroy: success: "Album %{name} deleted." + helper: + friends_albums: "Friends Albums" + your_albums: "Your Albums" aspects: index: photos: "photos" @@ -67,7 +84,21 @@ en: add_a_new_aspect: "Add a new aspect" create: "Create" create: - success:"Click on the plus on the left side to tell Diaspora who can see your new aspect." + success: "Click on the plus on the left side to tell Diaspora who can see your new aspect." + failure: "Aspect creation failed." + destroy: + success: "%{name} was successfully removed." + update: + success: "Your aspect, %{name}, has been successfully edited." + move_friends: + failure: "Aspect editing failed for friend %{real_name}." + success: "Aspects edited successfully." + move_friend: + failure: "didn't work %{inspect}" + success: "You are now showing your friend a different aspect of yourself." + helper: + remove: "remove" + aspect_not_empty: "Aspect not empty" users: edit: cancel: "Cancel" @@ -105,9 +136,20 @@ en: new_photo: "New Photo" back_to_list: "Back to List" post_it: "post it!" + create: + runtime_error: "Photo upload failed. Are you sure that your seatbelt is fastened?" + integrity_error: "Photo upload failed. Are you sure that was an image?" + type_error: "Photo upload failed. Are you sure an image was added?" + update: + notice: "Photo successfully updated." + error: "Failed to edit photo." + destroy: + notice: "Photo deleted." registrations: new: sign_up: "Sign up" + create: + success: "You've joined Diaspora!" status_messages: new_status_message: tell_me_something_good: "tell me something good" @@ -124,7 +166,12 @@ en: view_all: "View All" message: "Message" owner: "Owner" + helper: + no_message_to_display: "No message to display." people: + person: + add_friend: "add friend" + pending_request: "pending request" index: add_friend: "add friend" real_name: "real name" @@ -140,4 +187,19 @@ en: friends_since: "friends since: %{how_long_ago}" save: "save" are_you_sure: "Are you sure?" - remove_friend: "remove friend" \ No newline at end of file + remove_friend: "remove friend" + requests: + new_request: + add_a_new_friend_to: "Add a new friend to" + enter_a_diaspora_username: "Enter a Diaspora username:" + your_diaspora_username_is: "Your Diaspora username is: %{diaspora_handle}" + friends_username: "Friend's username" + destroy: + success: "You are now friends." + error: "Please select an aspect!" + ignore: "Ignored friend request." + create: + error: "No diaspora seed found with this email!" + already_friends: "You are already friends with %{destination_url}!" + success: "A friend request was sent to %{destination_url}." + horribly_wrong: "Something went horribly wrong." diff --git a/config/locales/diaspora/es.yml b/config/locales/diaspora/es.yml new file mode 100644 index 0000000000000000000000000000000000000000..f62c204809063ca93175af4686a67e4e56eac3bc --- /dev/null +++ b/config/locales/diaspora/es.yml @@ -0,0 +1,202 @@ +# 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 English. Add more files in this directory for other locales. +# See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. + +es: + hello: "Hola mundo" + application: + helper: + unknown_person: "persona desconocida" + new_requests: "nuevas peticiones" + dashboards: + helper: + home: "home" + error_messages: + helper: + invalid_fields: "Campos Invalidos" + correct_the_following_errors_and_try_again: "Corrija los siguentes errores e intente de nuevo." + people: + helper: + results_for: " resultados para %{params}" + people_on_pod_are_aware_of: " personas en pod estan al tanto de" + layouts: + application: + edit_profile: "editar perfil" + logout: "cerrar sesión" + shared: + aspect_nav: + all_aspects: "Todos los Aspectos" + manage: "Manejar" + manage_your_aspects: "Maneja tus Aspectos" + sub_header: + all_aspects: "Todos los Aspectos" + manage_aspects: "Manejar Aspectos" + publisher: + share: "Compartir" + aspect_friends: + add_friends: "Añade amigos" + albums: + album: + you: "usted" + new_album: + create: "crear" + add_a_new_album: "Añade un nuevo álbum" + show: + edit_album: "Editar Ãlbum" + albums: "álbumes" + updated: "actualizado" + by: "por" + edit: + editing: "Editando" + updated: "actualizado" + are_you_sure: "¿Está seguro?" + delete_album: "Eliminar Ãlbum" + cancel: "Cancelar" + index: + home: "home" + new_album: "Nuevo Ãlbum" + create: + success: "Has creado el álbum llamado %{name}." + update: + success: "El álbum %{name} fue editado exitosamente." + failure: "Fallo al editar el álbum %{name}." + destroy: + success: "El álbum %{name} fue eliminado." + helper: + friends_albums: "Ãlbumes de amigos" + your_albums: "Tus Ãlbumes" + aspects: + index: + photos: "fotos" + show: + photos: "fotos" + manage: + add_a_new_aspect: "Añadir un nuevo aspecto" + add_a_new_friend: "Añadir un nuevo amigo" + show: "Mostrar" + update_aspects: "Actualizar Aspectos" + requests: "Peticiones" + ignore_remove: "Ignorar/Remover" + new_aspect: + add_a_new_aspect: "Añadir un nuevo aspecto" + create: "Crear" + create: + success:"Pulsa el signo de mas a la izquierda para escojer quien puede ver su nuevo aspecto." + failure: "La creación del Aspecto falló." + destroy: + success: "%{name} fue eliminado exitosamente." + update: + success: "Su aspecto, %{name}, fue editado exitosamente." + move_friends: + failure: "Fallo el editar aspecto para el amigo %{real_name}." + success: "Aspectos editados exitosamente." + move_friend: + error: "no funcionó %{inspect}" + notice: "Ahora estas mostrando a tu amigo un aspecto diferente de ti." + helper: + remove: "eliminar" + aspect_not_empty: "Aspecto no vacio" + users: + edit: + cancel: "Cancelar" + update_profile: "Actualizar Perfil" + home: "Home" + diaspora_username: "NOMBRE DE USUARIO DE DIASPORA" + info: "Info" + picture: "Foto" + editing_profile: "Editando perfil" + albums: "Ãlbums" + you_dont_have_any_photos: "No tienes ninguna foto! ve a la pagina" + page_to_upload_some: "para subir algunas" + comments: + comment: + ago: "atras" + new_comment: + comment: "Comentario" + photos: + show: + prev: "prev" + full_size: "tamaño completo" + next: "prox" + edit_photo: "Editar Foto" + delete_photo: "Eliminar Foto" + are_you_sure: "¿Está seguro?" + comments: "comentarios" + edit: + editing: "Editando" + are_you_sure: "¿Está seguro?" + delete_photo: "Eliminar Foto" + photo: + show_comments: "mostrar comentarios" + posted_a_new_photo_to: "a puesto una nueva foto en" + new: + new_photo: "Nueva Foto" + back_to_list: "Volver a la lista" + post_it: "post it!" + create: + runtime_error: "Photo upload failed. Are you sure that your seatbelt is fastened?" + integrity_error: "Falló carga de la foto. ¿Está seguro de que era una imagen?" + type_error: "Falló carga de la foto. ¿Está seguro de que una imagen fue añadida?" + update: + notice: "Foto actualizada satisfactoriamente." + error: "Falló la edición de la foto." + destroy: + notice: "Foto eliminada." + registrations: + new: + sign_up: "RegÃstrate" + create: + success: "Se ha unido a Diaspora!" + status_messages: + new_status_message: + tell_me_something_good: "dime algo bueno" + oh_yeah: "oh yeah!" + status_message: + show_comments: "mostrar comentarios" + delete: "Eliminar" + are_you_sure: "Esta seguro?" + show: + status_message: "Mensaje de status" + comments: "comentarios" + are_you_sure: "¿Está seguro?" + destroy: "Borrar" + view_all: "Ver Todos" + message: "Mensaje" + owner: "Dueño" + helper: + no_message_to_display: "No hay mensajes que mostrar." + people: + person: + add_friend: "añadir amigo" + pending_request: "petición pendiente" + index: + add_friend: "añadir amigo" + real_name: "nombre real" + diaspora_handle: "usuario en diaspora" + thats_you: "ese eres tu!" + friend_request_pending: "petición de amistad pendiente" + you_have_a_friend_request_from_this_person: "tienes una petición de amistad de esta persona" + show: + last_seen: "ultima vez visto: %{how_long_ago}" + friends_since: "amigos desde: %{how_long_ago}" + save: "guardar" + are_you_sure: "¿Está seguro?" + remove_friend: "eliminar amigo" + requests: + new_request: + add_a_new_friend_to: "Añade un nuevo amigo a " + enter_a_diaspora_username: "Escribe el usuario de Diaspora:" + your_diaspora_username_is: "Tu usuario de Diaspora es: %{diaspora_handle}" + friends_username: "Nombre de usuario de amigo" + destroy: + success: "Ahora son amigos." + error: "Seleccione un aspecto!" + ignore: "Ignorar peticion de amistad" + create: + error: "No diaspora seed found with this email!" + already_friends: "Ya eres amigo de %{destination_url}!" + success: "Una peticion de amistad se envio a %{destination_url}." + horribly_wrong: "Algo horriblemente incorrecto ha sucedido" diff --git a/config/locales/fi.yml b/config/locales/diaspora/fi.yml similarity index 100% rename from config/locales/fi.yml rename to config/locales/diaspora/fi.yml diff --git a/config/locales/diaspora/fr-informal.yml b/config/locales/diaspora/fr-informal.yml new file mode 100644 index 0000000000000000000000000000000000000000..141584dad5f4d074abbe02d74d1d41fbcc2e9cf9 --- /dev/null +++ b/config/locales/diaspora/fr-informal.yml @@ -0,0 +1,204 @@ +# Copyright (c) 2010, Diaspora Inc. This file is +# licensed under the Affero General Public License version 3. See +# the COPYRIGHT file. + +# Localization file for French (Informal Honorifics). Add more files in this directory for other locales. +# See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. + +fr-informal: + hello: "Bonjour tout le monde" + application: + helper: + unknown_person: "personne inconnue" + new_requests: "nouvelles requêtes" + dashboards: + helper: + home: "accueil" + error_messages: + helper: + invalid_fields: "Champs invalides" + correct_the_following_errors_and_try_again: "Corrige les erreurs suivantes, puis réessaie." + people: + helper: + results_for: " résultats concernant %{params}" + people_on_pod_are_aware_of: " personnes agissant comme des automates sont conscients de" + layouts: + application: + edit_profile: "éditer le profil" + logout: "déconnexion" + shared: + aspect_nav: + all_aspects: "Tous les aspects" + manage: "Gérer" + manage_your_aspects: "Gérer tes aspects" + sub_header: + all_aspects: "Tous les aspects" + manage_aspects: "Gérer les aspects" + publisher: + share: "Partager" + aspect_friends: + add_friends: "ajouter des amis" + albums: + album: + you: "toi" + new_album: + create: "créer" + add_a_new_album: "Ajouter un nouvel album" + show: + edit_album: "Éditer l’album" + albums: "albums" + updated: "mis à jour" + by: "par" + edit: + editing: "Édition" + updated: "mis à jour" + are_you_sure: "Es-tu sûr(e)?" + delete_album: "Supprimer l’album" + cancel: "Annuler" + index: + home: "accueil" + new_album: "Nouvel album" + create: + success: "Tu as créé un album nommé %{name}." + update: + success: "L’album %{name} a été édité avec succès." + failure: "L’édition de l’album %{name} a échoué." + destroy: + success: "L’album %{name} a été supprimé." + helper: + friends_albums: "Albums d’amis" + your_albums: "Tes albums" + aspects: + index: + photos: "photos" + show: + photos: "photos" + manage: + add_a_new_aspect: "Ajouter un nouvel aspect" + add_a_new_friend: "Ajouter un nouvel ami" + show: "Afficher" + update_aspects: "Mettre à jour les aspects" + requests: "Requêtes" + ignore_remove: "Ignorer/Supprimer" + new_aspect: + add_a_new_aspect: "Ajouter un nouvel aspect" + create: "Créer" + create: + success:"Clique sur le symbole plus situé sur le côté gauche afin que Diaspora détermine qui peut voir ton nouvel aspect." + destroy: + success: "%{name} a été supprimé avec succès." + update: + success: "Ton aspect, %{name}, a été édité avec succès." + move_friends: + failure: "L’édition de l’aspect concernant l’ami %{real_name} a échoué." + success: "Les aspects ont été édités avec succès." + move_friend: + error: "ne fonctionne pas %{inspect}" + notice: "Tu montres à présent à ton ami un aspect différent au tien." + helper: + remove: "supprimer" + aspect_not_empty: "L’aspect n’est pas vide" + users: + edit: + cancel: "Annuler" + update_profile: "Mettre à jour le profil" + home: "Accueil" + diaspora_username: "NOM D’UTILISATEUR DIASPORA" + info: "Information" + picture: "Image" + editing_profile: "Édition du profil" + albums: "Albums" + you_dont_have_any_photos: "Tu n’as aucune photo ! Rends-toi sur la page" + page_to_upload_some: "afin d’en transférer quelques-unes." + comments: + comment: + ago: "il y a" + new_comment: + comment: "Commentaire" + photos: + show: + prev: "précédent" + full_size: "taille réelle" + next: "suivant" + edit_photo: "Éditer la photo" + delete_photo: "Supprimer la photo" + are_you_sure: "Es-tu sûr(e) ?" + comments: "commentaires" + edit: + editing: "Édition" + are_you_sure: "Es-tu sûr(e) ?" + delete_photo: "Supprimer la photo" + photo: + show_comments: "afficher les commentaires" + posted_a_new_photo_to: "a publié une nouvelle photo sur" + new: + new_photo: "Nouvelle photo" + back_to_list: "Retourner à la liste" + post_it: "publie-la !" + create: + runtime_error: "Le transfert de la photo a échoué. Es-tu sûr(e) que ta ceinture de sécurité est bien attachée ?" + integrity_error: "Le transfert de la photo a échoué. Es-tu sûr(e) que c’était bien une image ?" + type_error: "Le transfert de la photo a échoué. Es-tu sûr(e) que l’image était bien ajoutée ?" + update: + notice: "La photo a été mise à jour avec succès." + error: "Échec de l’édition de la photo." + destroy: + notice: "Photo supprimée." + registrations: + new: + sign_up: "Inscription" + create: + success: "Tu as rejoint Diaspora !" + status_messages: + new_status_message: + tell_me_something_good: "dis-moi quelque chose de bien" + oh_yeah: "oh ouais !" + status_message: + show_comments: "afficher les commentaires" + delete: "Supprimer" + are_you_sure: "Es-tu sûr(e) ?" + show: + status_message: "Message d’état" + comments: "commentaires" + are_you_sure: "Es-tu sûr(e) ?" + destroy: "Détruire" + view_all: "Tout voir" + message: "Message" + owner: "Propriétaire" + helper: + no_message_to_display: "Aucun message à afficher." + people: + person: + add_friend: "ajouter un ami" + pending_request: "requête en attente" + index: + add_friend: "ajouter un ami" + real_name: "nom réel" + diaspora_handle: "maniement de Diaspora" + thats_you: "c’est toi !" + friend_request_pending: "Requête d’ami en attente" + you_have_a_friend_request_from_this_person: "tu as une requête d’ami de la part de cette personne" + new: + new_person: "Nouvelle personne" + back_to_list: "Retourner à la liste" + show: + last_seen: "dernière connexion : %{how_long_ago}" + friends_since: "amis depuis : %{how_long_ago}" + save: "sauvegarder" + are_you_sure: "Es-tu sûr(e) ?" + remove_friend: "supprimer un ami" + requests: + new_request: + add_a_new_friend_to: "Ajouter un ami à " + enter_a_diaspora_username: "Saisi un nom d’utilisateur Diaspora :" + your_diaspora_username_is: "Ton nom d’utilisateur Diaspora est : %{diaspora_handle}" + friends_username: "Nom d’utilisateur de l’ami" + destroy: + success: "Vous êtes à présent amis." + error: "Merci de sélectionner un aspect !" + ignore: "Requête d’ami ignorée." + create: + error: "Aucun résultat Diaspora n’a été trouvé avec cette adresse e-mail !" + already_friends: "Tu es déjà ami avec %{destination_url}!" + success: "Une requête d’ami a été envoyée à %{destination_url}." + horribly_wrong: "Quelque chose d’horrible s’est produit." diff --git a/config/locales/fr.yml b/config/locales/diaspora/fr.yml similarity index 77% rename from config/locales/fr.yml rename to config/locales/diaspora/fr.yml index 9c05ff973a4c676e075dba8f0936c490dc45c71f..8a44e6dace21626444c4d48b8f7af0cc1b0dad9c 100644 --- a/config/locales/fr.yml +++ b/config/locales/diaspora/fr.yml @@ -2,35 +2,49 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - # Localization file for French. Add more files in this directory for other locales. # See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. fr: hello: "Bonjour tout le monde" + application: + helper: + unknown_person: "unknown person" + new_requests: "new requests" + dashboards: + helper: + home: "home" + error_messages: + helper: + invalid_fields: "Invalid Fields" + correct_the_following_errors_and_try_again: "Correct the following errors and try again." + people: + helper: + results_for: " resultados para %{params}" + people_on_pod_are_aware_of: " gente en pod estan al tanto de " layouts: application: - edit_profile: "éditer le profil" - logout: "déconnexion" + edit_profile: "Éditez votre profil" + logout: "Déconnexion" shared: aspect_nav: - all_aspects: "Tous les aspects" - manage: "Gérer" - manage_your_aspects: "Gérer vos aspects" + all_aspects: "Tous les Aspects" + manage: "Gérez" + manage_your_aspects: "Gérez vos Aspects" sub_header: - all_aspects: "Tous les aspects" - manage_aspects: "Gérer les aspects" + all_aspects: "Tous les Aspects" + manage_aspects: "Gérez vos Aspects" publisher: share: "Partager" aspect_friends: - add_friends: "ajouter des amis" + add_friends: "Ajouter des amis" albums: album: you: "vous" new_album: create: "créer" add_a_new_album: "Ajouter un nouvel album" - show: + show: edit_album: "Éditer l’album" albums: "albums" updated: "mis à jour" @@ -38,12 +52,15 @@ fr: edit: editing: "Édition" updated: "mis à jour" - are_you_sure: "Êtes-vous sûr ?" - delete_album: "Supprimer l’album" + are_you_sure: "Êtes-vous sûr?" + delete_album: "Supprimer l'album" cancel: "Annuler" index: home: "accueil" new_album: "Nouvel album" + helper: + friends_albums: "Friends Albums" + your_albums: "Your Albums" create: success: "Tu as créé un album nommé %{name}." update: @@ -58,9 +75,9 @@ fr: photos: "photos" manage: add_a_new_aspect: "Ajouter un nouvel aspect" - add_a_new_friend: "Ajouter un nouvel ami" - show: "Afficher" - update_aspects: "Metre à jour les aspects" + add_a_new_friend: "Ajouter un nouvel amis" + show: "Voir" + update_aspects: "Mettre à jour les aspects" requests: "Requêtes" ignore_remove: "Ignorer/Supprimer" new_aspect: @@ -128,7 +145,7 @@ fr: index: add_friend: "ajouter un ami" real_name: "nom réel" - diaspora_handle: "maniement de diaspora" + diaspora_handle: "maniement de Diaspora" thats_you: "c’est vous !" friend_request_pending: "Requête d’ami en attente" you_have_a_friend_request_from_this_person: "vous avez une requête d’ami de la part de cette personne" @@ -140,4 +157,4 @@ fr: friends_since: "amis depuis : %{how_long_ago}" save: "sauvegarder" are_you_sure: "Êtes-vous sûr ?" - remove_friend: "supprimer un ami" \ No newline at end of file + remove_friend: "supprimer un ami" diff --git a/config/locales/diaspora/he.yml b/config/locales/diaspora/he.yml new file mode 100644 index 0000000000000000000000000000000000000000..8b348b3c72f196151323106ee371302f600ab9c0 --- /dev/null +++ b/config/locales/diaspora/he.yml @@ -0,0 +1,206 @@ +# Copyright (c) 2010, Diaspora Inc. This file is +# licensed under the Affero General Public License version 3. See +# the COPYRIGHT file. +# Translated to Hebrew by Yaron Shahrabani <sh.yaron@gmail.com>, 2010. + + +# Sample localization file for English. Add more files in this directory for other locales. +# See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. + +he: + hello: "×©×œ×•× ×¢×•×œ×" + application: + helper: + unknown_person: "××“× ×œ× ×™×“×•×¢" + new_requests: "בקשות חדשות" + dashboards: + helper: + home: "בית" + error_messages: + helper: + invalid_fields: "שדות שגויי×" + correct_the_following_errors_and_try_again: "יש לתקן ×ת השגי×ות הב×ות ×•×œ× ×¡×•×ª שוב." + people: + helper: + results_for: " תוצ×ות עבור %{params}" + people_on_pod_are_aware_of: " ×× ×©×™× ×‘×¤×•×“ ×ž×•×“×¢×™× ×œ×›×š" + layouts: + application: + edit_profile: "עריכת הפרופיל" + logout: "יצי××”" + shared: + aspect_nav: + all_aspects: "כל ההיבטי×" + manage: "× ×™×”×•×œ" + manage_your_aspects: "× ×™×”×•×œ ×”×”×™×‘×˜×™× ×©×œ×š" + sub_header: + all_aspects: "כל ההיבטי×" + manage_aspects: "× ×™×”×•×œ ההיבטי×" + publisher: + share: "שיתוף" + aspect_friends: + add_friends: "הוספת חברי×" + albums: + album: + you: "×ת/×”" + new_album: + create: "יצירה" + add_a_new_album: "הוספת ××œ×‘×•× ×—×“×©" + show: + edit_album: "עריכת ×לבו×" + albums: "×לבומי×" + updated: "ת×ריך העדכון" + by: "על ידי" + edit: + editing: "עריכה" + updated: "ת×ריך העדכון" + are_you_sure: "בבטחה?" + delete_album: "מחיקת ×לבו×" + cancel: "ביטול" + index: + home: "בית" + new_album: "××œ×‘×•× ×—×“×©" + create: + success: "יצרת ××œ×‘×•× ×‘×©× %{name}." + update: + success: "×”××œ×‘×•× %{name} × ×¢×¨×š בהצלחה." + failure: "×ירע כשל בעריכת ×”××œ×‘×•× %{name}." + destroy: + success: "×”××œ×‘×•× %{name} × ×ž×—×§." + helper: + friends_albums: "××œ×‘×•×ž×™× ×©×œ חברי×" + your_albums: "×”××œ×‘×•×ž×™× ×©×œ×š" + aspects: + index: + photos: "×ª×ž×•× ×•×ª" + show: + photos: "×ª×ž×•× ×•×ª" + manage: + add_a_new_aspect: "הוספת היבט חדש" + add_a_new_friend: "הוספת חבר חדש" + show: "הצגה" + update_aspects: "עדכון ההיבטי×" + requests: "בקשות" + ignore_remove: "התעלמות/הסרה" + new_aspect: + add_a_new_aspect: "הוספת היבט חדש" + create: "יצי××”" + create: + success: "יש ללחוץ על סמל הפלוס שמימין כדי לומר לדי×ספורה מי יעול לצפות בהיבט החדש שלך." + destroy: + success: "%{name} הוסר בהצלחה." + update: + success: "ההיבט שלך, %{name}, × ×¢×¨×š בהצלחה." + move_friends: + failure: "עריכת ההיבט × ×›×©×œ×” עבור החבר %{real_name}." + success: "×”×”×™×‘×˜×™× × ×¢×¨×›×• בהצלחה." + move_friend: + failure: "×œ× ×¢×‘×“ %{inspect}" + success: "כעת יופיע ×‘×¤× ×™ ×”×—×‘×¨×™× ×©×œ×š היבט ×חר שלך." + helper: + remove: "הסרה" + aspect_not_empty: "ההיסט ××™× ×• ריק" + users: + edit: + cancel: "ביטול" + update_profile: "עדכון הפרופיל" + home: "בית" + diaspora_username: "×©× ×”×ž×©×ª×ž×© בדי×ספורה" + info: "פרטי×" + picture: "×ª×ž×•× ×”" + editing_profile: "עריכת הפרופיל" + albums: "×לבומי×" + you_dont_have_any_photos: "×ין לך ×ª×ž×•× ×•×ª! ב×פשרותך לגשת לעמוד" + page_to_upload_some: "כדי להעלות כמה." + comments: + comment: + ago: "×œ×¤× ×™" + new_comment: + comment: "הערה" + photos: + show: + prev: "הקודמת" + full_size: "גודל מל×" + next: "הב××”" + edit_photo: "עריכת ×ª×ž×•× ×”" + delete_photo: "מחיקת ×ª×ž×•× ×”" + are_you_sure: "בבטחה?" + comments: "הערות" + edit: + editing: "עריכה" + are_you_sure: "בבטחה?" + delete_photo: "מחיקת ×ª×ž×•× ×”" + photo: + show_comments: "הצגת הערות" + posted_a_new_photo_to: "פורסמה ×ª×ž×•× ×” חדשה ×ל" + new: + new_photo: "×ª×ž×•× ×” חדשה" + back_to_list: "חזרה לרשימה" + post_it: "פרסו×!" + create: + runtime_error: "העל×ת ×”×ª×ž×•× ×” × ×›×©×œ×”. ×”×× ×”×—×’×•×¨×” שלך מהודקת?" + integrity_error: "העל×ת ×”×ª×ž×•× ×” × ×›×©×œ×”. ×”×× ×–×• ב×מת הייתה ×ª×ž×•× ×”?" + type_error: "העל×ת ×”×ª×ž×•× ×” × ×›×©×œ×”. ×”×× ×‘×מת × ×•×¡×¤×” ×ª×ž×•× ×”?" + update: + notice: "×”×ª×ž×•× ×” ×¢×•×“×›× ×” בהצלחה." + error: "×ירע כשל בעריכת ×”×ª×ž×•× ×”." + destroy: + notice: "×”×ª×ž×•× ×” × ×ž×—×§×”." + registrations: + new: + sign_up: "הרשמה" + create: + success: "הצטרפת לדי×ספורה!" + status_messages: + new_status_message: + tell_me_something_good: "×‘× ×œ×™ לשמוע סיפור טוב" + oh_yeah: "×חלה!" + status_message: + show_comments: "הצגת הערות" + delete: "מחיקה" + are_you_sure: "בבטחה?" + show: + status_message: "הודעת מצב" + comments: "הערות" + are_you_sure: "בבטחה?" + destroy: "הריבה" + view_all: "צפייה בכול" + message: "הודעה" + owner: "בעלי×" + helper: + no_message_to_display: "×ין הודעה להצגה." + people: + person: + add_friend: "הוספת חבר" + pending_request: "בקשה ×ž×ž×ª×™× ×”" + index: + add_friend: "הוספת חבר" + real_name: "×©× ×מתי" + diaspora_handle: "×›×™× ×•×™ בדי×ספורה" + thats_you: "מדובר בך!" + friend_request_pending: "בקשת החברות ×ž×ž×ª×™× ×”" + you_have_a_friend_request_from_this_person: "יש לך בקשת חברות מ××“× ×–×”" + new: + new_person: "××“× ×—×“×©" + back_to_list: "חזרה לרשימה" + show: + last_seen: "פעילות ××—×¨×•× ×”: %{how_long_ago}" + friends_since: "×—×‘×¨×™× ×ž××–: %{how_long_ago}" + save: "שמירה" + are_you_sure: "בבטחה?" + remove_friend: "הסרת חבר" + requests: + new_request: + add_a_new_friend_to: "הוספת חבר חדש ×ל" + enter_a_diaspora_username: "× × ×œ×”×–×™×Ÿ ×©× ×ž×©×ª×ž×© בדי×ספורה:" + your_diaspora_username_is: "×©× ×”×ž×©×ª×ž×© שלך בדי×ספורה הו×: %{diaspora_handle}" + friends_username: "×©× ×”×ž×©×ª×ž×© של החבר" + destroy: + success: "××ª× ×—×‘×¨×™× ×›×¢×ª." + error: "× × ×œ×‘×—×•×¨ בהיבט!" + ignore: "בקשות חברות מהן התעלמת." + create: + error: "×œ× × ×ž×¦× ×–×¨×¢ של די×ספורה בכתובת דו×״ל זו!" + already_friends: "×ת/×” ו%{destination_url} כבר חברי×!" + success: "בקשת חברות × ×©×œ×—×” ×ל %{destination_url}." + horribly_wrong: "משהו השתבש לגמרי." diff --git a/config/locales/diaspora/it.yml b/config/locales/diaspora/it.yml new file mode 100644 index 0000000000000000000000000000000000000000..707704d258c6c5102d36bbc0737fbb1f454f932c --- /dev/null +++ b/config/locales/diaspora/it.yml @@ -0,0 +1,204 @@ +# 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 Italian. Add more files in this directory for other locales. +# See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. + +it: + hello: "Ciao mondo" + application: + helper: + unknown_person: "persona sconosciuta" + new_requests: "nuove richieste" + dashboards: + helper: + home: "home" + error_messages: + helper: + invalid_fields: "Campi non validi" + correct_the_following_errors_and_try_again: "Correggi i seguenti errori e riprova." + people: + helper: + results_for: " risultati per %{params}" + people_on_pod_are_aware_of: " persone su pod sono consapevoli di" + layouts: + application: + edit_profile: "modifica profilo" + logout: "disconnetti" + shared: + aspect_nav: + all_aspects: "Tutti gli Aspetti" + manage: "Gestisci" + manage_your_aspects: "Gestisci i tuoi Aspetti" + sub_header: + all_aspects: "Tutti gli Aspetti" + manage_aspects: "Gestisci Aspetti" + publisher: + share: "Condividi" + aspect_friends: + add_friends: "aggiungi amici" + albums: + album: + you: "tu" + new_album: + create: "crea" + add_a_new_album: "Aggiungi un nuovo album" + show: + edit_album: "Modifica album" + albums: "album" + updated: "aggiornato" + by: "da" + edit: + editing: "Modifica" + updated: "aggiornato" + are_you_sure: "Sei sicuro?" + delete_album: "Elimina album" + cancel: "Annulla" + index: + home: "home" + new_album: "Nuovo album" + create: + success: "Hai creato un album chiamato %{name}." + update: + success: "L'album %{name} è stato modificato." + failure: "Modifica dell'album %{name} fallita." + destroy: + success: "L'album %{name} è stato eliminato." + helper: + friends_albums: "Album degli amici" + your_albums: "I tuoi album" + aspects: + index: + photos: "foto" + show: + photos: "foto" + manage: + add_a_new_aspect: "Aggiungi un nuovo aspetto" + add_a_new_friend: "Aggiungi un nuovo amico" + show: "Mostra" + update_aspects: "Aggiorna Aspetti" + requests: "Richieste" + ignore_remove: "Ignora/Rimuovi" + new_aspect: + add_a_new_aspect: "Aggiungi un nuovo aspetto" + create: "Crea" + create: + success: "Clicca sul segno più nella parte sinistra per dire a Diaspora chi può vedere il tuo nuovo aspetto." + destroy: + success: "%{name} è stato rimosso con successo." + update: + success: "Il tuo aspetto, %{name}, è stato modificato con successo." + move_friends: + failure: "Modifica dell'aspetto fallita per l'amico %{real_name}." + success: "Aspetti modificati con successo." + move_friend: + failure: "non ha funzionato %{inspect}" + success: "Adesso stai mostrando al tuo amico un aspetto differente di te stesso." + helper: + remove: "rimuovi" + aspect_not_empty: "Aspetto non vuoto" + users: + edit: + cancel: "Annulla" + update_profile: "Aggiorna profilo" + home: "Home" + diaspora_username: "NOME UTENTE DIASPORA" + info: "Info" + picture: "Immagine" + editing_profile: "Modifica del profilo" + albums: "Album" + you_dont_have_any_photos: "Non hai nessuna foto! Vai alla pagina" + page_to_upload_some: "per caricarne qualcuna." + comments: + comment: + ago: "fa" + new_comment: + comment: "Commento" + photos: + show: + prev: "indietro" + full_size: "dimensione intera" + next: "avanti" + edit_photo: "Modifica foto" + delete_photo: "Elimina foto" + are_you_sure: "Sei sicuro?" + comments: "commenti" + edit: + editing: "Modifica" + are_you_sure: "Sei sicuro?" + delete_photo: "Elimina foto" + photo: + show_comments: "mostra commenti" + posted_a_new_photo_to: "ha caricato una nuova foto in" + new: + new_photo: "Nuova foto" + back_to_list: "Torna all'elenco" + post_it: "inseriscila!" + create: + runtime_error: "Caricamento della foto fallito. Hai allacciato le cinture?" + integrity_error: "Caricamento della foto fallito. Sei sicuro che era un'immagine?" + type_error: "Caricamento della foto fallito. Sei sicuro di aver aggiunto un'immagine?" + update: + notice: "Foto aggiornata con successo." + error: "Modifica della foto fallita." + destroy: + notice: "Foto eliminata." + registrations: + new: + sign_up: "Iscriviti" + create: + success: "Ti sei unito a Diaspora!" + status_messages: + new_status_message: + tell_me_something_good: "dimmi qualcosa di buono" + oh_yeah: "oh si!" + status_message: + show_comments: "mostra commenti" + delete: "Elimina" + are_you_sure: "Sei sicuro?" + show: + status_message: "Messaggio di stato" + comments: "commenti" + are_you_sure: "Sei sicuro?" + destroy: "Distruggi" + view_all: "Vedi tutto" + message: "Messaggio" + owner: "Proprietario" + helper: + no_message_to_display: "Nessun messaggio da visualizzare." + people: + person: + add_friend: "aggiungi amico" + pending_request: "richiesta in sospeso" + index: + add_friend: "aggiungi amico" + real_name: "nome reale" + diaspora_handle: "diaspora handle" + thats_you: "sei tu!" + friend_request_pending: "richiesta d'amicizia in sospeso" + you_have_a_friend_request_from_this_person: "hai una richiesta d'amicizia da questa persona" + new: + new_person: "Nuova persona" + back_to_list: "Torna all'elenco" + show: + last_seen: "ultima visualizzazione: %{how_long_ago}" + friends_since: "amici da: %{how_long_ago}" + save: "salva" + are_you_sure: "Sei sicuro?" + remove_friend: "rimuovi amico" + requests: + new_request: + add_a_new_friend_to: "Aggiungi un amico a" + enter_a_diaspora_username: "Inserisci un nome utente Diaspora:" + your_diaspora_username_is: "Il tuo nome utente Diaspora è: %{diaspora_handle}" + friends_username: "nome utente dell'amico" + destroy: + success: "Adesso siete amici." + error: "Seleziona un aspetto!" + ignore: "Ignora richiesta di amicizia." + create: + error: "Nessun seed Diaspora trovato con questa email!" + already_friends: "Sei già amico con %{destination_url}!" + success: "Una richiesta di amicizia è stata inviata a %{destination_url}." + horribly_wrong: "Qualcosa è andato orribilmente storto." diff --git a/config/locales/lt.yml b/config/locales/diaspora/lt.yml similarity index 99% rename from config/locales/lt.yml rename to config/locales/diaspora/lt.yml index e1a529431b9192d7fe815e609ac1e22693ea11fa..01295e3895da41ca95aa628a13ae710a0fb25c89 100644 --- a/config/locales/lt.yml +++ b/config/locales/diaspora/lt.yml @@ -2,7 +2,6 @@ # 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. diff --git a/config/locales/pl.yml b/config/locales/diaspora/pl.yml similarity index 99% rename from config/locales/pl.yml rename to config/locales/diaspora/pl.yml index 2052779bd14f6703ae992ffaa03a6c164c9e2ccc..c55b7969192553973a4e3d10f135515d30c7b413 100644 --- a/config/locales/pl.yml +++ b/config/locales/diaspora/pl.yml @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - # Sample localization file for English. Add more files in this directory for other locales. # See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. diff --git a/config/locales/pt-BR.yml b/config/locales/diaspora/pt-BR.yml similarity index 63% rename from config/locales/pt-BR.yml rename to config/locales/diaspora/pt-BR.yml index 10425864bfc23af31a02423b7a4847e26c3dba19..8e87425e9b1f887c77bcd2e6c7de37c6fb7b3720 100644 --- a/config/locales/pt-BR.yml +++ b/config/locales/diaspora/pt-BR.yml @@ -2,12 +2,26 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - # Sample localization file for Portuguese Brazilian. Add more files in this directory for other locales. # See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. pt-BR: hello: "Olá mundo" + application: + helper: + unknown_person: "pessoa desconhecida" + new_requests: "nova requisição" + dashboards: + helper: + home: "casa" + error_messages: + helper: + invalid_fields: "Campos inválidos" + correct_the_following_errors_and_try_again: "Corrija os erros a seguir e tente novamente." + people: + helper: + results_for: " resultados para %{params}" + people_on_pod_are_aware_of: " pessoas no pod estão conscientes de" layouts: application: edit_profile: "editar perfil" @@ -51,6 +65,9 @@ pt-BR: failure: "Erro ao editar o álbum %{name}." destroy: success: "O álbum %{name} foi excluÃdo com sucesso." + helper: + friends_albums: "Ãlbum de amigos" + your_albums: "Seus álbuns" aspects: index: photos: "photos" @@ -68,12 +85,25 @@ pt-BR: create: "Criar" create: success:"Clique no mais(+) do lado esquerdo para dizer ao Diaspora quem pode ver seu novo aspecto." + destroy: + success: "%{name} foi removido com sucesso." + update: + success: "Seu aspecto, %{name}, foi editado com sucesso." + move_friends: + failure: "Falha ao editar aspecto para o amigo(a) %{real_name}." + success: "Aspectos editados com sucesso." + move_friend: + failure: "não funcionou %{inspect}" + success: "Você está agora mostrando um diferente aspecto seu a um amigo(a)." + helper: + remove: "remover" + aspect_not_empty: "Aspecto não está vazio" users: edit: cancel: "Cancelar" update_profile: "Atualizar Perfil" home: "Home" - diaspora_username: "USUÃRIO DIASPORA" + diaspora_username: "NOME DE USUÃRIO DIASPORA" info: "Informações" picture: "Imagem" editing_profile: "Editando perfil" @@ -105,9 +135,20 @@ pt-BR: new_photo: "Nova Foto" back_to_list: "Voltar para a Lista" post_it: "enviar!" + create: + runtime_error: "Envio de foto falhou. Você tem tem certeza que seu sinto de segurança está preso?" + integrity_error: "Envio de foto falhou. Você tem certeza que é uma imagem?" + type_error: "Envio de foto falhou. Você tem certeza que adicionou uma imagem?" + update: + notice: "Foto enviada com sucesso." + error: "Falha ao editar foto." + destroy: + notice: "Foto removida." registrations: new: sign_up: "Cadastro" + create: + success: "Vocé entrou na Diaspora!" status_messages: new_status_message: tell_me_something_good: "diga-me qualquer coisa legal" @@ -124,7 +165,12 @@ pt-BR: view_all: "Exibir Todas" message: "Mensagem" owner: "Pertence a" + helper: + no_message_to_display: "Nenhuma mensagem para ser mostrada." people: + person: + add_friend: "adicionar amigo(a)" + pending_request: "requisições pendentes" index: add_friend: "adicionar amigo(a)" real_name: "nome real" @@ -141,3 +187,18 @@ pt-BR: save: "salvar" are_you_sure: "Tem certeza?" remove_friend: "excluir amigo" + requests: + new_request: + add_a_new_friend_to: "Adicionar novo amigo(a) em" + enter_a_diaspora_username: "Digite seu nome de usuário Diaspora:" + your_diaspora_username_is: "Seu nome de usuário Diaspora é: %{diaspora_handle}" + friends_username: "Nome de usuário do Amigo(a)" + destroy: + success: "Vocês agora são amigos." + error: "Favor selecionar um aspecto!" + ignore: "Requisições de amigos ignoradas." + create: + error: "Nenhum semente Diaspora encontrado com esse email." + already_friends: "Você já é amigo(a) de %{destination_url}!" + success: "Uma requisição de amizade foi enviada para %{destination_url}." + horribly_wrong: "Algo horrÃvel aconteceu." diff --git a/config/locales/pt-PT.yml b/config/locales/diaspora/pt-PT.yml similarity index 99% rename from config/locales/pt-PT.yml rename to config/locales/diaspora/pt-PT.yml index ce3d9abbc458f3fc51172881e1542e0ce1603dc0..6df399150c8ca51f34f26631d80e0a62cac0d087 100644 --- a/config/locales/pt-PT.yml +++ b/config/locales/diaspora/pt-PT.yml @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - # Sample localization file for Portuguese Portugal. Add more files in this directory for other locales. # See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. diff --git a/config/locales/diaspora/ro.yml b/config/locales/diaspora/ro.yml new file mode 100644 index 0000000000000000000000000000000000000000..5800f4a30e25a4c5c4890f045a872e5736c184e7 --- /dev/null +++ b/config/locales/diaspora/ro.yml @@ -0,0 +1,139 @@ +# Copyright (c) 2010, Diaspora Inc. This file is +# licensed under the Affero General Public License version 3. See +# the COPYRIGHT file. + +ro: + hello: "Bună, lume!" + layouts: + application: + edit_profile: "editare profil" + logout: "deconectare" + shared: + aspect_nav: + all_aspects: "Toate Aspectele" + manage: "Administrare" + manage_your_aspects: "Administrare Aspecte" + sub_header: + all_aspects: "Toate Aspectele" + manage_aspects: "Administrare Aspecte" + publisher: + share: "Distribuie" + aspect_friends: + add_friends: "adăugare prieteni" + albums: + album: + you: "tu" + new_album: + create: "crează" + add_a_new_album: "Album nou" + show: + edit_album: "Editare Album" + albums: "albume" + updated: "actualizat" + by: "de" + edit: + editing: "Editare" + updated: "actualizat" + are_you_sure: "SunteÈ›i sigur(ă)?" + delete_album: "Șterge Album" + cancel: "Renuță" + index: + home: "acasă" + new_album: "Album Nou" + create: + success: "AÈ›i creat un album numit %{name}." + update: + success: "Albumul %{name} a fost modificat cu succes." + failure: "Eroare la editarea albumului %{name}." + destroy: + success: "Albumul %{name} a fost È™ters." + aspects: + index: + photos: "poze" + show: + photos: "poze" + manage: + add_a_new_aspect: "Adaugă aspect" + add_a_new_friend: "Adadugă prieten" + show: "Arată" + update_aspects: "Actualizează Aspecte" + requests: "Cereri" + ignore_remove: "Ignoră/Șterge" + new_aspect: + add_a_new_aspect: "Adaugă aspect" + create: "Crează" + create: + success:"Click pe semnul plus în partea stângă pentru a indica cine poate accesa noul aspect." + users: + edit: + cancel: "Renunță" + update_profile: "Actualizează Profil" + home: "Home" + diaspora_username: "DIASPORA USERNAME" + info: "Info" + picture: "Poză" + editing_profile: "Editare profil" + albums: "Albume" + you_dont_have_any_photos: "Nu ai nici o fotografie! Mergi la" + page_to_upload_some: "pentru a încărca câteva." + comments: + comment: + ago: "în urmă" + new_comment: + comment: "Comentariu" + photos: + show: + prev: "precedent" + full_size: "mărime deplină" + next: "următor" + edit_photo: "Modifică Poză" + delete_photo: "Șterge Poză" + are_you_sure: "SunteÈ›i sigur(ă)?" + comments: "comments" + edit: + editing: "Modificare" + are_you_sure: "SunteÈ›i sigur(ă)?" + delete_photo: "Șterge poză" + photo: + show_comments: "arată comentarii" + posted_a_new_photo_to: "a postat o nouă poză în" + new: + new_photo: "Poză nouă" + back_to_list: "ÃŽnapoi la Listă" + post_it: "postează!" + registrations: + new: + sign_up: "ÃŽnregistrare" + status_messages: + new_status_message: + tell_me_something_good: "spune-mi ceva bun" + oh_yeah: "o, da!" + status_message: + show_comments: "arată comentarii" + delete: "Șterge" + are_you_sure: "SunteÈ›i sigur(ă)?" + show: + status_message: "Mesaj Stare" + comments: "comentarii" + are_you_sure: "SunteÈ›i sigur(ă)?" + destroy: "Distruge" + view_all: "Vezi Toate" + message: "Mesaj" + owner: "Proprietar" + people: + index: + add_friend: "adaugă prieten" + real_name: "nume real" + diaspora_handle: "diaspora id" + thats_you: "acesta eÈ™ti tu!" + friend_request_pending: "cerere de prietenie nerezolvată" + you_have_a_friend_request_from_this_person: "aveÈ›i o cerere de prietenie din partea acestei persoane" + new: + new_person: "Persoană Nouă" + back_to_list: "ÃŽnapoi la Listă" + show: + last_seen: "văzut: %{how_long_ago}" + friends_since: "prieteni: %{how_long_ago}" + save: "salvează" + are_you_sure: "SunteÈ›i sigur(ă)?" + remove_friend: "È™terge prieten" diff --git a/config/locales/diaspora/ru.yml b/config/locales/diaspora/ru.yml new file mode 100644 index 0000000000000000000000000000000000000000..cc76b9b426fbeca18e91255ff623becae9456499 --- /dev/null +++ b/config/locales/diaspora/ru.yml @@ -0,0 +1,142 @@ +# 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 Russian. Add more files in this directory for other locales. +# See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. + +ru: + hello: "Привет, мир" + layouts: + application: + edit_profile: "редактировать профиль" + logout: "выйти" + shared: + aspect_nav: + all_aspects: "Ð’Ñе аÑпекты" + manage: "Управление" + manage_your_aspects: "Управление вашими аÑпектами" + sub_header: + all_aspects: "Ð’Ñе аÑпекты" + manage_aspects: "Управление аÑпектами" + publisher: + share: "Опубликовать" + aspect_friends: + add_friends: "добавить друзей" + albums: + album: + you: "Ð’Ñ‹" + new_album: + create: "Ñоздать" + add_a_new_album: "Добавить новый альбом" + show: + edit_album: "Редактировать альбом" + albums: "альбомы" + updated: "обновленные" + by: "по" + edit: + editing: "Редактирование" + updated: "обновлено" + are_you_sure: "Ð’Ñ‹ уверены?" + delete_album: "Удалить альбом" + cancel: "Отмена" + index: + home: "домой" + new_album: "Ðовый альбом" + create: + success: "Ð’Ñ‹ Ñоздали новый альбом %{name}." + update: + success: "Ðльбом %{name} уÑпешно редактирован." + failure: "Ðевозможно редактировать альбом %{name}." + destroy: + success: "Ðльбом %{name} удален." + aspects: + index: + photos: "фотографии" + show: + photos: "фотографии" + manage: + add_a_new_aspect: "Добавить аÑпект" + add_a_new_friend: "Добавить друга" + show: "Показать" + update_aspects: "Обновить аÑпекты" + requests: "ЗапроÑÑ‹" + ignore_remove: "Игнорировать/Удалить" + new_aspect: + add_a_new_aspect: "Добавить аÑпект" + create: "Создать" + create: + success:"Ðажмите на Ð¿Ð»ÑŽÑ Ñлева, Ð´Ð»Ñ Ñ‚Ð¾Ð³Ð¾, что-бы указать Diaspora тех, кто может видеть ваш новый аÑпект." + users: + edit: + cancel: "Отмена" + update_profile: "Обновить профиль" + home: "Домой" + diaspora_username: "Ð˜Ð¼Ñ Ð¿Ð¾Ð»ÑŒÐ·Ð¾Ð²Ð°Ñ‚ÐµÐ»Ñ DIASPORA" + info: "ИнформациÑ" + picture: "Ðватар" + editing_profile: "Редактирование профилÑ" + albums: "Ðльбомы" + you_dont_have_any_photos: "У Ð²Ð°Ñ Ð½ÐµÑ‚ ни одной фотографии! Перейдите на " + page_to_upload_some: "Ñтраницу Ð´Ð»Ñ Ð·Ð°Ð³Ñ€ÑƒÐ·ÐºÐ¸." + comments: + comment: + ago: "ранее" + new_comment: + comment: "Комментарий" + photos: + show: + prev: "предыдущаÑ" + full_size: "полный размер" + next: "ÑледующаÑ" + edit_photo: "Редактировать" + delete_photo: "Удалить" + are_you_sure: "Ð’Ñ‹ уверены?" + comments: "комментарии" + edit: + editing: "Редактирование" + are_you_sure: "Ð’Ñ‹ уверены?" + delete_photo: "Удалить фотографию" + photo: + show_comments: "показать комментарии" + posted_a_new_photo_to: "опубликовано в" + new: + new_photo: "ÐÐ¾Ð²Ð°Ñ Ñ„Ð¾Ñ‚Ð¾Ð³Ñ€Ð°Ñ„Ð¸Ñ" + back_to_list: "ВернутьÑÑ Ðº ÑпиÑку" + post_it: "опубликовать!" + registrations: + new: + sign_up: "Выйти" + status_messages: + new_status_message: + tell_me_something_good: "Ñкажи мне что-нибудь хорошее" + oh_yeah: "о да!" + status_message: + show_comments: "показать комментарии" + delete: "Удалить" + are_you_sure: "Ð’Ñ‹ уверены?" + show: + status_message: "Сообщение о ÑтатуÑе" + comments: "комментарии" + are_you_sure: "Ð’Ñ‹ уверены?" + destroy: "Уничтожить" + view_all: "Показать вÑе" + message: "Сообщение" + owner: "Владелец" + people: + index: + add_friend: "добавить друга" + real_name: "наÑтоÑщее имÑ" + diaspora_handle: "идентификатор diaspora" + thats_you: "Ñто Ð’Ñ‹!" + friend_request_pending: "Ð·Ð°Ð¿Ñ€Ð¾Ñ Ð½Ð° дружбу в ожидании" + you_have_a_friend_request_from_this_person: "у Ð²Ð°Ñ ÐµÑÑ‚ÑŒ Ð·Ð°Ð¿Ñ€Ð¾Ñ Ð½Ð° дружбу от Ñтого человека" + new: + new_person: "ÐÐ¾Ð²Ð°Ñ Ð¿ÐµÑ€Ñона" + back_to_list: "Обратно к ÑпиÑку" + show: + last_seen: "поÑледний раз был %{how_long_ago}" + friends_since: "Ð´Ñ€ÑƒÐ·ÑŒÑ Ñ %{how_long_ago}" + save: "Ñохранить" + are_you_sure: "Ð’Ñ‹ уверены?" + remove_friend: "удалить друга" diff --git a/config/locales/sv.yml b/config/locales/diaspora/sv.yml similarity index 89% rename from config/locales/sv.yml rename to config/locales/diaspora/sv.yml index 1caf878b88f08f66e5bacbb6dffb6b1903ca77a6..1aa9ac2dcee2fb6b1843de5a379821be1684831f 100644 --- a/config/locales/sv.yml +++ b/config/locales/diaspora/sv.yml @@ -2,8 +2,7 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - -# Swedish localization file. +# Swedish localization file. # See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. sv: diff --git a/config/locales/es.yml b/config/locales/es.yml deleted file mode 100644 index 11c2effdd13cd13cb0c3eab51951da64cf5f34c5..0000000000000000000000000000000000000000 --- a/config/locales/es.yml +++ /dev/null @@ -1,10 +0,0 @@ -# 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 English. Add more files in this directory for other locales. -# See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. - -es: - hello: "Hello world" \ No newline at end of file diff --git a/config/locales/it.yml b/config/locales/it.yml deleted file mode 100644 index 1da349bf9192089461cb72ccea9ba567a7520e6d..0000000000000000000000000000000000000000 --- a/config/locales/it.yml +++ /dev/null @@ -1,10 +0,0 @@ -# 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 Italian. Add more files in this directory for other locales. -# See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. - -it: - hello: "Ciao mondo!" diff --git a/config/locales/ru.yml b/config/locales/ru.yml deleted file mode 100644 index fe944aa599cb25f9db63efae6d4479900a1fa784..0000000000000000000000000000000000000000 --- a/config/locales/ru.yml +++ /dev/null @@ -1,10 +0,0 @@ -# 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 English. Add more files in this directory for other locales. -# See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. - -ru: - hello: "Привет, мир" diff --git a/config/routes.rb b/config/routes.rb index 112ff5768d51e3ce5dbd02b649e7448eeda958e5..5a35ad7d3223a4b75bfaab26bd576fb1517bed34 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - Diaspora::Application.routes.draw do resources :people, :only => [:index, :show, :destroy] resources :users, :except => [:create, :new, :show] @@ -28,7 +26,6 @@ Diaspora::Application.routes.draw do match 'zombiefriendaccept', :to => "dev_utilities#zombiefriendaccept" match 'set_backer_number', :to => "dev_utilities#set_backer_number" match 'set_profile_photo', :to => "dev_utilities#set_profile_photo" - #routes for devise, not really sure you will need to mess with this in the future, lets put default, #non mutable stuff in anohter file devise_for :users, :controllers => {:registrations => "registrations"} @@ -36,7 +33,7 @@ Diaspora::Application.routes.draw do match 'logout', :to => 'devise/sessions#destroy', :as => "destroy_user_session" match 'signup', :to => 'registrations#new', :as => "new_user_registration" - match 'get_to_the_choppa', :to => redirect("/signup") + match 'get_to_the_choppa', :to => redirect("/signup") #public routes # match 'webfinger', :to => 'publics#webfinger' diff --git a/config/selenium.yml b/config/selenium.yml index 74ce21d73b86ecec22b00b6656d2e0719ff455f5..0d679b602e13781ade17de32f46d671c231a7f76 100644 --- a/config/selenium.yml +++ b/config/selenium.yml @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - common: &common # Try to kill mongrel after suite if tmp/pids/mongrel_selenium.pid exists # kill_mongrel_after_suite: true diff --git a/config/sprinkle/conf/nginx.conf b/config/sprinkle/conf/nginx.conf index eba9fa45b4fed6293c00bab137b76a11a9503a7a..188daedcb3c52a890b6444cc11754e4ef6983789 100644 --- a/config/sprinkle/conf/nginx.conf +++ b/config/sprinkle/conf/nginx.conf @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - worker_processes 1; pid /tmp/pids/nginx.pid; diff --git a/config/sprinkle/packages/database.rb b/config/sprinkle/packages/database.rb index 2463007ff4473eeafaa727b2c5b5644d9eca103e..0c1b1ca5072a375248e7e1448b3b7582e82f8231 100644 --- a/config/sprinkle/packages/database.rb +++ b/config/sprinkle/packages/database.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - #package :mongo, :provides => :database do # description 'Mongodb' # version '1.4.3' diff --git a/config/sprinkle/packages/essential.rb b/config/sprinkle/packages/essential.rb index fba076e270956a8b68ecbbcc7c8e31a3dd6ff193..8b4349d061ce71ec81932f6d2aca5aee130f3844 100644 --- a/config/sprinkle/packages/essential.rb +++ b/config/sprinkle/packages/essential.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - ## Special package, anything that defines a 'source' package means build-essential should be installed for Ubuntu package :build_essential do diff --git a/config/sprinkle/packages/ruby.rb b/config/sprinkle/packages/ruby.rb index 708ab0eeb20079d7042d68f97bc2963a19a5101b..947732a7952fbadc6b319682905892d671c02ef7 100644 --- a/config/sprinkle/packages/ruby.rb +++ b/config/sprinkle/packages/ruby.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - ## Defines available packages package :ruby do @@ -43,7 +41,7 @@ package :diaspora_dependencies do end #package :diaspora do # description 'Diaspora' - + =begin package :rails do description 'Ruby on Rails' diff --git a/config/sprinkle/packages/scm.rb b/config/sprinkle/packages/scm.rb index 22ece7d984ee9b6228b474644982563954e98991..981214a605738bd028b46be6a0316eb06e19e803 100644 --- a/config/sprinkle/packages/scm.rb +++ b/config/sprinkle/packages/scm.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - package :git, :provides => :scm do description 'Git Distributed Version Control' apt %w( git-core ) diff --git a/config/sprinkle/packages/server.rb b/config/sprinkle/packages/server.rb index 68e1a12aa08b9d4fbc1ff7eb6224c91986713876..004883dada463fc7e60f69f2115ff1e5a7cd4b6b 100644 --- a/config/sprinkle/packages/server.rb +++ b/config/sprinkle/packages/server.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - package :nginx, :provides=> :webserver do description 'Nginx HTTP server' version '0.7.67' diff --git a/config/sprinkle/packages/unfortunately_essential.rb b/config/sprinkle/packages/unfortunately_essential.rb index d1504bc43b9493b8856ef71574f1545dd9b4afef..23975f870933c1858188939d542e104c513648b6 100644 --- a/config/sprinkle/packages/unfortunately_essential.rb +++ b/config/sprinkle/packages/unfortunately_essential.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - #Fix dreamhost # diff --git a/config/sprinkle/provision.rb b/config/sprinkle/provision.rb index fc81b1ca3ee154adbb3971db1b4a8b50c8fd742e..3e30c26f4fc3998cde69bd06c835d01ba190f636 100644 --- a/config/sprinkle/provision.rb +++ b/config/sprinkle/provision.rb @@ -3,10 +3,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - - - require '#{File.dirname(__FILE__)}/packages/essential' require '#{File.dirname(__FILE__)}/packages/database' require '#{File.dirname(__FILE__)}/packages/server' @@ -26,7 +22,6 @@ policy :diaspora, :roles => [:pivots] do requires :nginx_conf end - deployment do # mechanism for deployment diff --git a/config/thin.yml b/config/thin.yml index ad91436c1a55b7b5ad4d6edc63a878d1a2cd2128..a49d85ce4e11db1a3b6bab1bf3727cf60d295345 100644 --- a/config/thin.yml +++ b/config/thin.yml @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - rackup: /usr/local/app/diaspora/current/config.ru pid: /tmp/pids/thin.pid wait: 30 diff --git a/db/schema.rb b/db/schema.rb index a4f92eb4bb099513613e8ed2f3485487cde2dbed..19e6df260c35eb94eff1dc978dd690e92eb2ae66 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - # This file is auto-generated from the current state of the database. Instead of editing this file, # please use the migrations feature of Active Record to incrementally modify your database, and # then regenerate this schema definition. diff --git a/db/seeds.rb b/db/seeds.rb index 29a5191f4f70ac9c264107da3eb3f88653317e35..687d2622e5a2b7b754ef89b9eda36dbb0f265884 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - # This file should contain all the record creation needed to seed the database with its default values. # The data can then be loaded with the rake db:seed (or created alongside the db with db:setup). # @@ -12,5 +10,5 @@ # cities = City.create([{ :name => 'Chicago' }, { :name => 'Copenhagen' }]) # Mayor.create(:name => 'Daley', :city => citie -require 'config/environment' +require File.join(File.dirname(__FILE__), "..", "..", "config", "environment") diff --git a/db/seeds/backer.rb b/db/seeds/backer.rb index 12e6236f87ead8f2db478d3e23d160d3078ba45c..c4805eae82ced46a7e350f6962e8c70302c7fb7e 100644 --- a/db/seeds/backer.rb +++ b/db/seeds/backer.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - # This file should contain all the record creation needed to seed the database with its default values. # The data can then be loaded with the rake db:seed (or created alongside the db with db:setup). # @@ -12,12 +10,11 @@ # cities = City.create([{ :name => 'Chicago' }, { :name => 'Copenhagen' }]) # Mayor.create(:name => 'Daley', :city => citie -require 'config/environment' +require File.join(File.dirname(__FILE__), "..", "..", "config", "environment") def create - - config = YAML.load_file(File.dirname(__FILE__) + '/../../config/deploy_config.yml') + config = YAML.load_file(File.join(File.dirname(__FILE__), "..", "..", "config", "deploy_config.yml")) backer_info = config['servers']['backer'] backer_number = YAML.load_file(Rails.root.join('config','backer_number.yml'))[:seed_number].to_i @@ -25,7 +22,7 @@ def create #set pod url username = backer_info[backer_number]['username'].gsub(/ /,'').downcase set_app_config username - require 'config/initializers/_load_app_config.rb' + require File.join(File.dirname(__FILE__), "..", "..", "config", "initializers", "_load_app_config.rb") # Create seed user user = User.instantiate!(:email => "#{username}@#{username}.joindiaspora.com", diff --git a/db/seeds/dev.rb b/db/seeds/dev.rb index e2d8a5495df936227bd118bf394dfb0c924ae0cb..f10abec4f67d87fecd371dca3e46a4e54d9d0fb0 100644 --- a/db/seeds/dev.rb +++ b/db/seeds/dev.rb @@ -2,9 +2,7 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - -require 'config/environment' +require File.join(File.dirname(__FILE__), "..", "..", "config", "environment") def set_app_config username current_config = YAML.load(File.read(Rails.root.join('config', 'app_config.yml.example'))) diff --git a/db/seeds/tom.rb b/db/seeds/tom.rb index 1eaa5b23612b6754d13f51f4289f8ba88b60483a..5c418c8db850ea82a34c4bc5af84c27e7bbcf238 100644 --- a/db/seeds/tom.rb +++ b/db/seeds/tom.rb @@ -2,9 +2,7 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - -require 'config/environment' +require File.join(File.dirname(__FILE__), "..", "..", "config", "environment") def set_app_config username current_config = YAML.load(File.read(Rails.root.join('config', 'app_config.yml.example'))) @@ -19,7 +17,6 @@ end set_app_config "tom" require 'config/initializers/_load_app_config.rb' - # Create seed user user = User.instantiate!( :email => "tom@tom.joindiaspora.com", :username => "tom", @@ -47,4 +44,3 @@ reversed_request = user2.accept_friend_request( request.id, user2.aspect(:name = user.receive reversed_request.to_diaspora_xml user.aspect(:name => "Presidents") - diff --git a/features/step_definitions/custom_web_steps.rb b/features/step_definitions/custom_web_steps.rb new file mode 100644 index 0000000000000000000000000000000000000000..e3f8bc3730443b9ed8a40f4acf1824218077b58b --- /dev/null +++ b/features/step_definitions/custom_web_steps.rb @@ -0,0 +1,17 @@ +When /^(.*) in the header$/ do |action| + within('header') do + When action + end +end + +When /^(.*) in the modal window$/ do |action| + within('#fancybox-wrap') do + When action + end +end + +When /^(.*) in the aspect list$/ do |action| + within('#aspect_list') do + When action + end +end diff --git a/features/step_definitions/debug_steps.rb b/features/step_definitions/debug_steps.rb new file mode 100644 index 0000000000000000000000000000000000000000..c56973edf9b02994630377c78e891d7645065a18 --- /dev/null +++ b/features/step_definitions/debug_steps.rb @@ -0,0 +1,4 @@ +When 'I debug' do + debugger + true +end diff --git a/features/step_definitions/factory_steps.rb b/features/step_definitions/factory_steps.rb new file mode 100644 index 0000000000000000000000000000000000000000..cf1495e999edc0636e376c5ad516cdc7885fc82d --- /dev/null +++ b/features/step_definitions/factory_steps.rb @@ -0,0 +1,68 @@ +module FactoryMethods + def create_from_table(model_name, table, extra = {}) + factory_name = model_name.gsub(/\W+/, '_').downcase.singularize.to_sym + is_singular = model_name.to_s.singularize == model_name.to_s + hashes = if is_singular + if table.kind_of?(Hash) + [table] + else + [table.rows_hash] + end + else + table.hashes + end + klass = Factory.factories[factory_name].class_name.to_s.classify.constantize + @they = hashes.map do |hash| + hash = hash.merge(extra).inject({}) do |h,(k,v)| + k = k.gsub(/\W+/,'_') + v = v.split(/\s*,\s*/) if klass.serialized_attributes[k] == Array + h.update(k.to_sym => v) + end + object = Factory.build(factory_name, hash) + yield object if block_given? + object.save! + object + end + if is_singular + @it = @they.last + instance_variable_set("@#{factory_name}", @it) + end + end +end + +World(FactoryMethods) + +Given %r{^I have a (.+)$} do |model_name| + create_from_table(model_name, {}, 'user' => @me) +end + +Given %r{^I have the following (.+):$} do |child, table| + Given "that me has the following #{child}:", table +end + +Given %r{^the following (.+):$} do |model_name, table| + create_from_table(model_name, table) +end + +Given %r{^that (.+) has the following (.+):$} do |parent, child, table| + child= child.gsub(/\W+/,'_') + parent = parent.gsub(/\W+/,'_').downcase.sub(/^_/, '') + parent_instance = instance_variable_get("@#{parent}") + parent_class = parent_instance.class + if assoc = parent_class.reflect_on_association(child.to_sym) || parent_class.reflect_on_association(child.pluralize.to_sym) + parent = (assoc.options[:as] || parent).to_s + child = (assoc.options[:class_name] || child).to_s + end + if child.classify.constantize.method_defined?(parent.pluralize) + create_from_table(child, table, parent.pluralize => [parent_instance]) + elsif child.classify.constantize.method_defined?(parent) + create_from_table(child, table, parent => parent_instance) + else + create_from_table(child, table) + if assoc.macro == :has_many + parent_instance.send("#{assoc.name}=", @they) + else + parent_instance.send("#{assoc.name}=", @they.first) + end + end +end diff --git a/features/step_definitions/scope_steps.rb b/features/step_definitions/scope_steps.rb new file mode 100644 index 0000000000000000000000000000000000000000..43fe2f48a9e15f5079cb58b6b8c7fa7236a2367f --- /dev/null +++ b/features/step_definitions/scope_steps.rb @@ -0,0 +1,30 @@ +module SectionLocator + + def within_parent(content, elements = ['*'], &block) + expr = %(//*[(#{elements.join('|')})/descendant-or-self::*[contains(., "#{content}")]]) + within(expr, &block) + end + +end + +World(SectionLocator) + +sections = %w(h1 h2 h3 h4 h5 h6 legend caption dt strong header) + +When /^(.*) in the "([^\"]*)" section$/ do |action, title| + within_parent(title, sections) do + When action + end +end + +When /^(.*) in the "([^\"]*)" section:$/ do |action, title, table| + within_parent(title, sections) do + When "#{action}:", table + end +end + +When /^(.*) in the "([^\"]*)" row$/ do |action, title| + within_parent(title, %w(th td)) do + When action + end +end diff --git a/features/step_definitions/session_steps.rb b/features/step_definitions/session_steps.rb new file mode 100644 index 0000000000000000000000000000000000000000..abc9e87df0a20d5b5557f977c7d3e35db5542d07 --- /dev/null +++ b/features/step_definitions/session_steps.rb @@ -0,0 +1,26 @@ +Given /^I am signed in as the following (\w+):$/ do |role, table| + Given %(the following #{role}:), table + @me = @it + Given 'I am signed in' +end + +Given /^I (?:am signed|sign) in as an? (\w+)$/ do |role| + @me = Factory(role.to_sym) + Given 'I am signed in' +end + + +Given 'I am signed in' do + @me ||= Factory(:user) + When %(I go to the new user session page) + When %(I fill in "Username" with "#{@me.username}") + When %(I fill in "Password" with "#{@me.password}") + When %(I press "Sign in") +end + + +When /^I sign in as "([^"]*)"$/ do |email| + @me = User.find_by_email(email) + @me.password ||= 'password' + Given 'I am signed in' +end diff --git a/features/step_definitions/web_steps.rb b/features/step_definitions/web_steps.rb new file mode 100644 index 0000000000000000000000000000000000000000..0f0af8aa21238dba5a61badfccc3a32a209c4e1e --- /dev/null +++ b/features/step_definitions/web_steps.rb @@ -0,0 +1,219 @@ +# IMPORTANT: This file is generated by cucumber-rails - edit at your own peril. +# It is recommended to regenerate this file in the future when you upgrade to a +# newer version of cucumber-rails. Consider adding your own code to a new file +# instead of editing this one. Cucumber will automatically load all features/**/*.rb +# files. + + +require 'uri' +require 'cgi' +require File.expand_path(File.join(File.dirname(__FILE__), "..", "support", "paths")) + +module WithinHelpers + def with_scope(locator) + locator ? within(locator) { yield } : yield + end +end +World(WithinHelpers) + +Given /^(?:|I )am on (.+)$/ do |page_name| + visit path_to(page_name) +end + +When /^(?:|I )go to (.+)$/ do |page_name| + visit path_to(page_name) +end + +When /^(?:|I )press "([^"]*)"(?: within "([^"]*)")?$/ do |button, selector| + with_scope(selector) do + click_button(button) + end +end + +When /^(?:|I )follow "([^"]*)"(?: within "([^"]*)")?$/ do |link, selector| + with_scope(selector) do + click_link(link) + end +end + +When /^(?:|I )fill in "([^"]*)" with "([^"]*)"(?: within "([^"]*)")?$/ do |field, value, selector| + with_scope(selector) do + fill_in(field, :with => value) + end +end + +When /^(?:|I )fill in "([^"]*)" for "([^"]*)"(?: within "([^"]*)")?$/ do |value, field, selector| + with_scope(selector) do + fill_in(field, :with => value) + end +end + +# Use this to fill in an entire form with data from a table. Example: +# +# When I fill in the following: +# | Account Number | 5002 | +# | Expiry date | 2009-11-01 | +# | Note | Nice guy | +# | Wants Email? | | +# +# TODO: Add support for checkbox, select og option +# based on naming conventions. +# +When /^(?:|I )fill in the following(?: within "([^"]*)")?:$/ do |selector, fields| + with_scope(selector) do + fields.rows_hash.each do |name, value| + When %{I fill in "#{name}" with "#{value}"} + end + end +end + +When /^(?:|I )select "([^"]*)" from "([^"]*)"(?: within "([^"]*)")?$/ do |value, field, selector| + with_scope(selector) do + select(value, :from => field) + end +end + +When /^(?:|I )check "([^"]*)"(?: within "([^"]*)")?$/ do |field, selector| + with_scope(selector) do + check(field) + end +end + +When /^(?:|I )uncheck "([^"]*)"(?: within "([^"]*)")?$/ do |field, selector| + with_scope(selector) do + uncheck(field) + end +end + +When /^(?:|I )choose "([^"]*)"(?: within "([^"]*)")?$/ do |field, selector| + with_scope(selector) do + choose(field) + end +end + +When /^(?:|I )attach the file "([^"]*)" to "([^"]*)"(?: within "([^"]*)")?$/ do |path, field, selector| + with_scope(selector) do + attach_file(field, path) + end +end + +Then /^(?:|I )should see JSON:$/ do |expected_json| + require 'json' + expected = JSON.pretty_generate(JSON.parse(expected_json)) + actual = JSON.pretty_generate(JSON.parse(response.body)) + expected.should == actual +end + +Then /^(?:|I )should see "([^"]*)"(?: within "([^"]*)")?$/ do |text, selector| + with_scope(selector) do + if page.respond_to? :should + page.should have_content(text) + else + assert page.has_content?(text) + end + end +end + +Then /^(?:|I )should see \/([^\/]*)\/(?: within "([^"]*)")?$/ do |regexp, selector| + regexp = Regexp.new(regexp) + with_scope(selector) do + if page.respond_to? :should + page.should have_xpath('//*', :text => regexp) + else + assert page.has_xpath?('//*', :text => regexp) + end + end +end + +Then /^(?:|I )should not see "([^"]*)"(?: within "([^"]*)")?$/ do |text, selector| + with_scope(selector) do + if page.respond_to? :should + page.should have_no_content(text) + else + assert page.has_no_content?(text) + end + end +end + +Then /^(?:|I )should not see \/([^\/]*)\/(?: within "([^"]*)")?$/ do |regexp, selector| + regexp = Regexp.new(regexp) + with_scope(selector) do + if page.respond_to? :should + page.should have_no_xpath('//*', :text => regexp) + else + assert page.has_no_xpath?('//*', :text => regexp) + end + end +end + +Then /^the "([^"]*)" field(?: within "([^"]*)")? should contain "([^"]*)"$/ do |field, selector, value| + with_scope(selector) do + field = find_field(field) + field_value = (field.tag_name == 'textarea') ? field.text : field.value + if field_value.respond_to? :should + field_value.should =~ /#{value}/ + else + assert_match(/#{value}/, field_value) + end + end +end + +Then /^the "([^"]*)" field(?: within "([^"]*)")? should not contain "([^"]*)"$/ do |field, selector, value| + with_scope(selector) do + field = find_field(field) + field_value = (field.tag_name == 'textarea') ? field.text : field.value + if field_value.respond_to? :should_not + field_value.should_not =~ /#{value}/ + else + assert_no_match(/#{value}/, field_value) + end + end +end + +Then /^the "([^"]*)" checkbox(?: within "([^"]*)")? should be checked$/ do |label, selector| + with_scope(selector) do + field_checked = find_field(label)['checked'] + if field_checked.respond_to? :should + field_checked.should be_true + else + assert field_checked + end + end +end + +Then /^the "([^"]*)" checkbox(?: within "([^"]*)")? should not be checked$/ do |label, selector| + with_scope(selector) do + field_checked = find_field(label)['checked'] + if field_checked.respond_to? :should + field_checked.should be_false + else + assert !field_checked + end + end +end + +Then /^(?:|I )should be on (.+)$/ do |page_name| + current_path = URI.parse(current_url).path + if current_path.respond_to? :should + current_path.should == path_to(page_name) + else + assert_equal path_to(page_name), current_path + end +end + +Then /^(?:|I )should have the following query string:$/ do |expected_pairs| + query = URI.parse(current_url).query + actual_params = query ? CGI.parse(query) : {} + expected_params = {} + expected_pairs.rows_hash.each_pair{|k,v| expected_params[k] = v.split(',')} + + if actual_params.respond_to? :should + actual_params.should == expected_params + else + assert_equal expected_params, actual_params + end +end + +Then /^show me the page$/ do + save_and_open_page +end diff --git a/features/support/env.rb b/features/support/env.rb new file mode 100644 index 0000000000000000000000000000000000000000..bcb1fdd000b72b839bff6e36da212663e13cf00d --- /dev/null +++ b/features/support/env.rb @@ -0,0 +1,45 @@ +# IMPORTANT: This file is generated by cucumber-rails - edit at your own peril. +# It is recommended to regenerate this file in the future when you upgrade to a +# newer version of cucumber-rails. Consider adding your own code to a new file +# instead of editing this one. Cucumber will automatically load all features/**/*.rb +# files. + +ENV["RAILS_ENV"] ||= "test" +require File.expand_path(File.dirname(__FILE__) + '/../../config/environment') + +require 'cucumber/formatter/unicode' # Remove this line if you don't want Cucumber Unicode support +require 'cucumber/rails/rspec' +require 'cucumber/rails/world' +require 'cucumber/web/tableish' + +require 'capybara/rails' +require 'capybara/cucumber' +require 'capybara/session' +require 'cucumber/rails/capybara_javascript_emulation' # Lets you click links with onclick javascript handlers without using @culerity or @javascript +# Capybara defaults to XPath selectors rather than Webrat's default of CSS3. In +# order to ease the transition to Capybara we set the default here. If you'd +# prefer to use XPath just remove this line and adjust any selectors in your +# steps to use the XPath syntax. +Capybara.default_selector = :css + +WebMock.disable_net_connect!(:allow_localhost => true) + +# If you set this to false, any error raised from within your app will bubble +# up to your step definition and out to cucumber unless you catch it somewhere +# on the way. You can make Rails rescue errors and render error pages on a +# per-scenario basis by tagging a scenario or feature with the @allow-rescue tag. +# +# If you set this to true, Rails will rescue all errors and render error +# pages, more or less in the same way your application would behave in the +# default production environment. It's not recommended to do this for all +# of your scenarios, as this makes it hard to discover errors in your application. +ActionController::Base.allow_rescue = false + +# How to clean your database when transactions are turned off. See +# http://github.com/bmabey/database_cleaner for more info. +begin + require 'database_cleaner' + require 'database_cleaner/cucumber' + DatabaseCleaner.strategy = :truncation + DatabaseCleaner.orm = "mongo_mapper" +end diff --git a/features/support/paths.rb b/features/support/paths.rb new file mode 100644 index 0000000000000000000000000000000000000000..3d3f64724f0b9e1591eed06d69de05fa58490090 --- /dev/null +++ b/features/support/paths.rb @@ -0,0 +1,16 @@ +module NavigationHelpers + def path_to(page_name) + case page_name + when /^its ([\w ]+) page$/ + send("#{$1.gsub(/\W+/, '_')}_path", @it) + when /^the ([\w ]+) page$/ + send("#{$1.gsub(/\W+/, '_')}_path") + when /^"(\/.*)"/ + $1 + else + raise "Can't find mapping from \"#{page_name}\" to a path." + end + end +end + +World(NavigationHelpers) diff --git a/features/user_creates_an_aspect.feature b/features/user_creates_an_aspect.feature new file mode 100644 index 0000000000000000000000000000000000000000..fb65fde4c592b195d27eea29d13f380f28f54d52 --- /dev/null +++ b/features/user_creates_an_aspect.feature @@ -0,0 +1,23 @@ +@aspects @javascript +Feature: User creates an aspect + In order to share with a limited group + As a User + I want to create a new aspect + + Background: + Given I am signed in + And I follow "Manage" in the header + And I follow "Add a new aspect" + + Scenario: success + Given I fill in "Name" with "Dorm Mates" in the modal window + When I press "Create" in the modal window + Then I should see "Manage Aspects" + And I should see "Dorm Mates" in the header + And I should see "Dorm Mates" in the aspect list + + Scenario: I omit the name + Given I fill in "Name" with "" in the modal window + When I press "Create" in the modal window + Then I should see "Manage Aspects" + And I should see "Aspect creation failed." diff --git a/lib/chrome_frame.rb b/lib/chrome_frame.rb index 10ef3dea38f5f28501985141ce76881c513246a7..52a4eb45977bf39c6399b6127f7b1adfa0ea8b03 100644 --- a/lib/chrome_frame.rb +++ b/lib/chrome_frame.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - module Rack class ChromeFrame diff --git a/lib/diaspora.rb b/lib/diaspora.rb index 959d0bb92fcef9396a7f0049bfab6b9a07e16b0e..e8508b38ba0778135a4351bf2a1bd81e6c308fcb 100644 --- a/lib/diaspora.rb +++ b/lib/diaspora.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - module Diaspora autoload :Parser diff --git a/lib/diaspora/parser.rb b/lib/diaspora/parser.rb index 6bc5d4eabea4baaf971c271a77a2aba7ff0bbd9d..e8e7e8a2bfbbf131fca703341ed27235e85098ac 100644 --- a/lib/diaspora/parser.rb +++ b/lib/diaspora/parser.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - module Diaspora module Parser def self.owner_id_from_xml(xml) diff --git a/lib/diaspora/user/friending.rb b/lib/diaspora/user/friending.rb index f3b30f9b35b13eaf90cbc1f42743084e2c6ab301..0f6cc6c5ce5fb9bc82be625cfb2c417802f4c4f0 100644 --- a/lib/diaspora/user/friending.rb +++ b/lib/diaspora/user/friending.rb @@ -2,14 +2,12 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - 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{ + 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} @@ -29,7 +27,6 @@ module Diaspora request end - def accept_friend_request(friend_request_id, aspect_id) request = Request.find_by_id(friend_request_id) pending_requests.delete(request) @@ -89,7 +86,7 @@ module Diaspora def remove_friend(bad_friend) raise "Friend not deleted" unless self.friend_ids.delete( bad_friend.id ) - aspects.each{|aspect| + aspects.each{|aspect| aspect.person_ids.delete( bad_friend.id )} self.save diff --git a/lib/diaspora/user/querying.rb b/lib/diaspora/user/querying.rb index bd4174c76e43b507d4c9a3900ebcddebee940755..29f11923842aa99b5131dc076f06f496451937d3 100644 --- a/lib/diaspora/user/querying.rb +++ b/lib/diaspora/user/querying.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - module Diaspora module UserModules module Querying diff --git a/lib/diaspora/user/receiving.rb b/lib/diaspora/user/receiving.rb index 39b1af5d2d8700dff9e85def1fb14c41c29fb441..5d737d8e91d157bf76fce88c290ed8b49259493e 100644 --- a/lib/diaspora/user/receiving.rb +++ b/lib/diaspora/user/receiving.rb @@ -43,7 +43,7 @@ module Diaspora def receive_request request, xml person = Diaspora::Parser.parse_or_find_person_from_xml( xml ) - person.serialized_key ||= request.exported_key + person.serialized_public_key ||= request.exported_key request.person = person request.person.save old_request = Request.first(:id => request.id) diff --git a/lib/diaspora/webhooks.rb b/lib/diaspora/webhooks.rb index 81f7bcfaf17b86cf5dcfd313d832fa8925ec3f40..fc241a6d314087b79e6afa509eade45bfd4e1e55 100644 --- a/lib/diaspora/webhooks.rb +++ b/lib/diaspora/webhooks.rb @@ -2,20 +2,14 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - module Diaspora module Webhooks - def self.included(klass) - klass.class_eval do - def to_diaspora_xml - xml = "<XML>" - xml += "<post>#{self.to_xml.to_s}</post>" - xml += "</XML>" - end - - end + def to_diaspora_xml + xml = "<XML>" + xml += "<post>#{to_xml.to_s}</post>" + xml += "</XML>" end + end end diff --git a/lib/diaspora/websocket.rb b/lib/diaspora/websocket.rb index 687bd2b7c27074a979ee47809e93dc6a066628ca..10e8bc9c83df666242c5413c262a89dd04c4fe08 100644 --- a/lib/diaspora/websocket.rb +++ b/lib/diaspora/websocket.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - module Diaspora module WebSocket def self.queue_to_user(uid, data) diff --git a/lib/encryptable.rb b/lib/encryptable.rb index ba36d6ec3de49960f94e8b4213b5d2ae28f4d64f..133c051561e73ca1b2179a51584ba05a2dddd170 100644 --- a/lib/encryptable.rb +++ b/lib/encryptable.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - module Encryptable def signable_string raise NotImplementedException("Override this in your encryptable class") @@ -17,7 +15,7 @@ if person.nil? Rails.logger.info("Verifying sig on #{signable_string} but no person is here") return false - elsif person.encryption_key.nil? + elsif person.public_key.nil? Rails.logger.info("Verifying sig on #{signable_string} but #{person.real_name} has no key") return false elsif signature.nil? @@ -25,7 +23,7 @@ return false end Rails.logger.debug("Verifying sig on #{signable_string} from person #{person.real_name}") - validity = person.encryption_key.verify "SHA", Base64.decode64(signature), signable_string + validity = person.public_key.verify "SHA", Base64.decode64(signature), signable_string Rails.logger.debug("Validity: #{validity}") validity end diff --git a/lib/encryptor.rb b/lib/encryptor.rb index ed9fbedb1f56026f48fd5cb7e0117d434afa8656..e9c4936e1fe1df9fc0900e21a5987edb432926dc 100644 --- a/lib/encryptor.rb +++ b/lib/encryptor.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - module Encryptor module Public def encrypt cleartext @@ -33,7 +31,7 @@ module Encryptor end def encrypt_aes_key key - Base64.encode64 encryption_key.public_encrypt( key.to_json ) + Base64.encode64 public_key.public_encrypt( key.to_json ) end end @@ -60,6 +58,5 @@ module Encryptor txt end - end end diff --git a/lib/hcard.rb b/lib/hcard.rb index 7658c5a1d3d69aae39eb48b6745fad0f586b5c4d..5640e711b383667330132712ce0f6d2e455ead30 100644 --- a/lib/hcard.rb +++ b/lib/hcard.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - module HCard def self.find url doc = Nokogiri::HTML(Net::HTTP.get URI.parse(url)) diff --git a/lib/message_handler.rb b/lib/message_handler.rb index 0b55ee0f7e50d14f339ce81574241a45d3831899..e6ce75ffc923b973b61021f5a715b6af69544392 100644 --- a/lib/message_handler.rb +++ b/lib/message_handler.rb @@ -2,11 +2,8 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - class MessageHandler - NUM_TRIES = 3 TIMEOUT = 5 #seconds diff --git a/lib/mongo_mapper/bson_id.rb b/lib/mongo_mapper/bson_id.rb index 4de833a66108da99c732464000e3b91e65274983..328c69a03b891b414d78e7bc5b0c81541e18b21b 100644 --- a/lib/mongo_mapper/bson_id.rb +++ b/lib/mongo_mapper/bson_id.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - class String def to_id BSON::ObjectId self diff --git a/lib/mongo_mapper/clear_dev_memory.rb b/lib/mongo_mapper/clear_dev_memory.rb index 88c7faccedb733959a3fc3079185ea08de0a6f7a..d63084765781ed139b8a37cab446ba8273e4c4ec 100644 --- a/lib/mongo_mapper/clear_dev_memory.rb +++ b/lib/mongo_mapper/clear_dev_memory.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - module MongoMapper class ClearDevMemory def initialize(app) diff --git a/lib/salmon/salmon.rb b/lib/salmon/salmon.rb index 931598691ab77bba94230a3ea871d77b31bbe318..5d285719691a8f80f56c8cf846dd78c8b44ede97 100644 --- a/lib/salmon/salmon.rb +++ b/lib/salmon/salmon.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - # Add URL safe Base64 support module Base64 module_function @@ -51,8 +49,6 @@ module Salmon sig_doc = doc.search('entry') slap.magic_sig = MagicSigEnvelope.parse sig_doc - - if 'base64url' == slap.magic_sig.encoding slap.data = decode64url(slap.magic_sig.data) slap.sig = slap.magic_sig.sig @@ -98,9 +94,6 @@ ENTRY end end - - - # Decode URL-safe-Base64. This implements def self.decode64url(str) # remove whitespace @@ -128,7 +121,6 @@ ENTRY signature = Base64.urlsafe_decode64(self.magic_sig.sig) signed_data = self.magic_sig.signable_string# Base64.urlsafe_decode64(self.magic_sig.signable_string) - public_key.verify(OpenSSL::Digest::SHA256.new, signature, signed_data ) end @@ -194,7 +186,6 @@ ENTRY env.encoding = env.get_encoding env.alg = env.get_alg - env.sig = Base64.urlsafe_encode64( user.encryption_key.sign OpenSSL::Digest::SHA256.new, env.signable_string ) diff --git a/lib/tasks/cucumber.rake b/lib/tasks/cucumber.rake new file mode 100644 index 0000000000000000000000000000000000000000..15d405ad4c1ff74a4982eab90ea06326006724c9 --- /dev/null +++ b/lib/tasks/cucumber.rake @@ -0,0 +1,55 @@ +# IMPORTANT: This file is generated by cucumber-rails - edit at your own peril. +# It is recommended to regenerate this file in the future when you upgrade to a +# newer version of cucumber-rails. Consider adding your own code to a new file +# instead of editing this one. Cucumber will automatically load all features/**/*.rb +# files. + + +unless ARGV.any? {|a| a =~ /^gems/} # Don't load anything when running the gems:* tasks + +vendored_cucumber_bin = Dir["#{Rails.root}/vendor/{gems,plugins}/cucumber*/bin/cucumber"].first +$LOAD_PATH.unshift(File.dirname(vendored_cucumber_bin) + '/../lib') unless vendored_cucumber_bin.nil? + +begin + require 'cucumber/rake/task' + + namespace :cucumber do + Cucumber::Rake::Task.new(:ok, 'Run features that should pass') do |t| + t.binary = vendored_cucumber_bin # If nil, the gem's binary is used. + t.fork = true # You may get faster startup if you set this to false + t.profile = 'default' + end + + Cucumber::Rake::Task.new(:wip, 'Run features that are being worked on') do |t| + t.binary = vendored_cucumber_bin + t.fork = true # You may get faster startup if you set this to false + t.profile = 'wip' + end + + Cucumber::Rake::Task.new(:rerun, 'Record failing features and run only them if any exist') do |t| + t.binary = vendored_cucumber_bin + t.fork = true # You may get faster startup if you set this to false + t.profile = 'rerun' + end + + desc 'Run all features' + task :all => [:ok, :wip] + end + desc 'Alias for cucumber:ok' + task :cucumber => 'cucumber:ok' + + Rake.application.instance_variable_get('@tasks').delete('default') + + task :default => [:cucumber, :spec] + + task :features => :cucumber do + STDERR.puts "*** The 'features' task is deprecated. See rake -T cucumber ***" + end +rescue LoadError + desc 'cucumber rake task not available (cucumber not installed)' + task :cucumber do + abort 'Cucumber rake task is not available. Be sure to install cucumber as a gem or plugin' + end +end + +end diff --git a/lib/tasks/db.rake b/lib/tasks/db.rake index 80e3bafe5d5fca082004e2bad0e301d51eccf906..e4e379a2a2d66587be542c8d745e62f57de68d69 100644 --- a/lib/tasks/db.rake +++ b/lib/tasks/db.rake @@ -2,38 +2,36 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - namespace :db do desc 'Seed the current RAILS_ENV database from db/seeds.rb' namespace :seed do task :tom do puts "Seeding the database for #{Rails.env}..." - require 'db/seeds/tom' + require File.dirname(__FILE__) + '/../../db/seeds/tom' end task :dev do puts "Seeding the database for #{Rails.env}..." - require 'db/seeds/dev' + require File.dirname(__FILE__) + '/../../db/seeds/dev' end task :backer do puts "Seeding the database for #{Rails.env}..." - require 'db/seeds/backer' + require File.dirname(__FILE__) + '/../../db/seeds/backer' create end - + end desc 'Delete the collections in the current RAILS_ENV database' task :purge do - require 'config/environment' + require File.dirname(__FILE__) + '/../../config/environment' puts "Purging the database for #{Rails.env}..." # Specifiy what models to remove # No! Drop the fucking database. - MongoMapper::connection.drop_database(MongoMapper::database.name) + MongoMapper::connection.drop_database(MongoMapper::database.name) puts 'Deleting tmp folder...' `rm -rf #{File.dirname(__FILE__)}/../../public/uploads/*` @@ -41,7 +39,7 @@ namespace :db do desc 'Purge and seed the current RAILS_ENV database using information from db/seeds.rb' task :reset do - + puts "Resetting the database for #{Rails.env}".upcase Rake::Task['db:purge'].invoke Rake::Task['db:seed:tom'].invoke @@ -54,23 +52,17 @@ namespace :db do Rake::Task['db:seed:dev'].invoke puts "you did it!" end - + task :fix_diaspora_handle do puts "fixing the people in this seed" - require 'config/environment' - - people = Person.all( '$where' => "function(){ - return this.diaspora_handle.charAt(this.diaspora_handle.length-1) == '@' - }") - - puts "Found #{people.count} people with broken diaspora_handle fields" - people.each do |person| + require File.dirname(__FILE__) + '/../../config/environment' + Person.where(:url => 'example.org').all.each{|person| if person.owner - puts "Resetting diaspora handle for #{person.owner.username}" + person.url = APP_CONFIG[:pod_url] person.diaspora_handle = person.owner.diaspora_handle person.save end - end + } puts "everything should be peachy" end end diff --git a/lib/tasks/generate_session_secret.rake b/lib/tasks/generate_session_secret.rake new file mode 100644 index 0000000000000000000000000000000000000000..90274dff34246b3b612b423fce4758d32ca32e4d --- /dev/null +++ b/lib/tasks/generate_session_secret.rake @@ -0,0 +1,26 @@ +namespace :generate do + desc 'Generates a Session Secret Token' + task :secret_token do + + path = File.join(Rails.root, 'config', 'initializers', 'secret_token.rb') + secret = ActiveSupport::SecureRandom.hex(40) + File.open(path, 'w') do |f| + f.write <<"EOF" +# Copyright (c) 2010, Diaspora Inc. This file is +# licensed under the Affero General Public License version 3. See +# the COPYRIGHT file. + +# Be sure to restart your server when you modify this file. + +# Your secret key for verifying the integrity of signed cookies. +# If you change this key, all old signed cookies will become invalid! +# Make sure the secret is at least 30 characters and all random, +# no regular words or you'll be exposed to dictionary attacks. +Rails.application.config.secret_token = '#{secret}' +EOF + +puts "YAY!!" +end + + end +end diff --git a/lib/tasks/rspec.rake b/lib/tasks/rspec.rake index 85ae513f6d081890bd380609cb1f1e533cec4efb..54442d71ea8d980447739fde820a38a7f1dd0bb7 100644 --- a/lib/tasks/rspec.rake +++ b/lib/tasks/rspec.rake @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - begin require 'rspec/core' require 'rspec/core/rake_task' @@ -32,13 +30,10 @@ MSG end end -Rake.application.instance_variable_get('@tasks').delete('default') - spec_prereq = Rails.root.join('config', 'database.yml').exist? ? "db:test:prepare" : :noop task :noop do end -task :default => :spec task :stats => "spec:statsetup" desc "Run all specs in spec directory (excluding plugin specs)" diff --git a/lib/tasks/saucelabs_adapter.rake b/lib/tasks/saucelabs_adapter.rake deleted file mode 100644 index 76f6cbbc4b9be0bd2b600371ae83847296d07839..0000000000000000000000000000000000000000 --- a/lib/tasks/saucelabs_adapter.rake +++ /dev/null @@ -1,59 +0,0 @@ -# Copyright (c) 2010, Diaspora Inc. This file is -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - - - -require 'saucelabs_adapter/run_utils' - -class Rake::Task - def self.exists?(name) - tasks.any? { |t| t.name == name } - end -end - -namespace :selenium do - - # Rake tasks are cumulative, and some old plugins are still defining selenium:server, so clear it. - Rake::Task[:'selenium:server'].clear_actions if Rake::Task.exists?('selenium:server') - - desc "Run the selenium remote-control server" - task :server do - system('bundle exec selenium-rc') - end - - desc "Run the selenium remote-control server in the background" - task :server_bg do - system('nohup selenium-rc 2&>1 &') - end - - desc "Runs Selenium tests locally (selenium server must already be started)" - task :local => [:local_env, :suite] - - desc "Run Selenium tests at saucelabs.com (using configuration 'saucelabs' in config/selenium.yml)" - task :sauce => [:sauce_env, :suite] - - desc "Run Selenium tests using configuration SELENIUM_ENV (from config/selenium.yml)" - task :custom => [:check_selenium_env_is_set, :suite] - - task :local_env do - ENV['SELENIUM_ENV'] = 'local' - end - - task :sauce_env do - ENV['SELENIUM_ENV'] = 'saucelabs' - end - - task :check_selenium_env_is_set do - raise "SELENIUM_ENV must be set" unless ENV['SELENIUM_ENV'] - end - - task :suite do - if (File.exists?("test/selenium/selenium_suite.rb")) - RunUtils.run "ruby test/selenium/selenium_suite.rb" - else - puts "test/selenium/selenium_suite.rb not found, bailing.\nPlease create a script that will run your selenium tests." - exit 1 - end - end -end diff --git a/lib/tasks/whitespace.rake b/lib/tasks/whitespace.rake index 397674ae5e23db7de44c581c9f498f508a74feb9..7af099dd69797047a17dfaaf4a2ad1dd5454631e 100644 --- a/lib/tasks/whitespace.rake +++ b/lib/tasks/whitespace.rake @@ -1,10 +1,20 @@ namespace :whitespace do desc 'Removes trailing whitespace' task :cleanup do - sh %{find . -name '*.rb' -exec sed -i '' 's/ *$//g' {} \\;} + sh %{for f in `find . -type f | grep -v -e '.git/' -e 'public/' -e '.png'`; + do cat $f | sed 's/[ \t]*$//' > tmp; cp tmp $f; rm tmp; echo -n .; + done} end + desc 'Converts hard-tabs into two-space soft-tabs' task :retab do - sh %{find . -name '*.rb' -exec sed -i '' 's/\t/ /g' {} \\;} + sh %{for f in `find . -type f | grep -v -e '.git/' -e 'public/' -e '.png'`; + do cat $f | sed 's/\t/ /g' > tmp; cp tmp $f; rm tmp; echo -n .; + done} + end + desc 'Remove consecutive blank lines' + task :scrub_gratuitous_newlines do + sh %{for f in `find . -type f | grep -v -e '.git/' -e 'public/' -e '.png'`; + do cat $f | sed '/./,/^$/!d' > tmp; cp tmp $f; rm tmp; echo -n .; + done} end end - diff --git a/public/javascripts/aspect-edit.js b/public/javascripts/aspect-edit.js index 9f9e5803e88cdba37bbc3b8c8385046945460d30..cb36d394e9b37b9c6af6810bc26e45947bb0cbf4 100644 --- a/public/javascripts/aspect-edit.js +++ b/public/javascripts/aspect-edit.js @@ -5,7 +5,7 @@ function decrementRequestsCounter() { var $new_requests = $(".new_requests"), - request_html = $new_requests.html(), + request_html = $new_requests.html(), old_request_count = request_html.match(/\d+/); if( old_request_count == 1 ) { @@ -24,11 +24,11 @@ $(function() { $("ul .person").draggable({ revert: true }); - + $("ul .requested_person").draggable({ revert: true }); - + $(".aspect ul").droppable({ hoverClass: 'active', drop: function(event, ui) { @@ -72,32 +72,32 @@ $(function() { if ($(ui.draggable[0]).hasClass('requested_person')){ $.ajax({ type: "DELETE", - url: "/requests/" + ui.draggable.attr('request_id'), + url: "/requests/" + ui.draggable.attr('request_id'), success: function () { decrementRequestsCounter(); } }); - + } else { $.ajax({ type: "DELETE", - url: "/people/" + ui.draggable.attr('id'), + url: "/people/" + ui.draggable.attr('id'), success: function () { alert("Removed Friend, proably want an undo countdown.") } }); - + } - $(ui.draggable[0]).fadeOut('slow'); // ui.draggable.fadeOut('slow') + $(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"), + var $this = $(this), + id = $this.closest("li").children("ul").attr("id"), link = "/aspects/"+ id; $this.keypress(function(e) { diff --git a/public/javascripts/view.js b/public/javascripts/view.js index 092d69f16733e36441672ea17763ee193591c4ef..1509145dad73a2ad0284ebcb7a23990dc1d16e0f 100644 --- a/public/javascripts/view.js +++ b/public/javascripts/view.js @@ -5,15 +5,15 @@ $(document).ready(function(){ - + $('#debug_info').click(function() { $('#debug_more').toggle('fast'); }); - + $("label").inFieldLabels(); - + $('#flash_notice, #flash_error, #flash_alert').delay(2500).slideUp(130); - + $("div.image_cycle").cycle({ fx: 'fade', random: 1, diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index 4c83aa0c21189bed9b1ac19c7a1d1126514cda68..53da697cc1c91b9656ec238acca869ad5f6b2daf 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -342,7 +342,7 @@ ul.comment_set { color: #cccccc; } input[type='text'], textarea { - font-family: "lucida grande", "sans-serif"; + font-family: "lucida grande", "lucida sans", "sans-serif"; font-size: 14px; padding: 0.3em; display: block; diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass index 890ef770850f20635b80b1a155375ae61805df79..2a3136393654e0f907ad50ddc79886e221990682 100644 --- a/public/stylesheets/sass/application.sass +++ b/public/stylesheets/sass/application.sass @@ -35,7 +35,7 @@ h1 h3 :font - :size 18px + :size 18px :weight bold .avatar @@ -54,7 +54,7 @@ h3 :left 50% :text :align center - :font + :font :size 14px :padding 3px 0 @@ -205,7 +205,7 @@ li.message .delete:hover :background #eee - + .content :padding :left 65px @@ -240,7 +240,7 @@ li.message :margin :top 5px :padding 0 - + :background :color #fafafa @@ -254,7 +254,7 @@ li.message :text-shadow 0 2px #fff :color #000 - > li + > li :font :weight bold @@ -285,11 +285,11 @@ form :size 120% :margin 1em :left 0em - + #user_name :margin :bottom 20px - + img :margin :right 10px @@ -305,7 +305,7 @@ form :color #000 span - :size small + :size small :font :weight normal :color #999 @@ -321,7 +321,7 @@ form :display inline :margin :right 1em - + #stream div.comments :display none @@ -336,7 +336,7 @@ input.comment_submit :display none :margin :right -10px - + ul.comment_set :margin 0 @@ -360,7 +360,7 @@ ul.comment_set .from :font :size 1em - + div.time :color #666 :font-size 70% @@ -385,7 +385,7 @@ ul.comment_set :list-style-type none :margin 0 :padding 0 - + #stream, #profile, .comments @@ -399,12 +399,12 @@ ul.comment_set :float left :margin :right 10px - + .pagination a :padding 3px - + .destroy_link, .request_button :position absolute :right 2em @@ -458,7 +458,7 @@ ul.comment_set input[type='text'], textarea :font - :family 'lucida grande', 'sans-serif' + :family 'lucida grande', 'lucida sans', 'sans-serif' :size 14px :padding 0.3em :display block @@ -496,9 +496,9 @@ label p :position absolute - :left 0 + :left 0 :top 0 - + form :display inline @@ -526,7 +526,7 @@ label :-webkit-box-shadow 0 1px 0 #fff :border 1px solid #bbb :top 1px solid #666 - + #image_picker @@ -563,13 +563,13 @@ label .name :position absolute - :z-index 6 + :z-index 6 :padding 1em :background rgba(0,0,0,0.8) :bottom 20px :font :size 18px - + :text-shadow 0 2px 0 #000 .time @@ -586,7 +586,7 @@ label .field_with_submit input[type='text'] :width 82% - :display inline + :display inline h1.big_text :position relative @@ -615,7 +615,7 @@ h1.big_text :margin 0 :top 25px - :bottom 25px + :bottom 25px :min-height 36px @@ -815,7 +815,7 @@ h1.big_text .person, .requested_person :display inline-block - :padding 5px + :padding 5px :cursor move :margin 5px :z-index 10 diff --git a/public/stylesheets/sass/sessions.sass b/public/stylesheets/sass/sessions.sass index 326d46b0fdc5e46784e3ffc97e5ce74cd19d000f..d7cf4644e56465cdd337134bcdf9ed31323a06ee 100644 --- a/public/stylesheets/sass/sessions.sass +++ b/public/stylesheets/sass/sessions.sass @@ -24,7 +24,7 @@ :left 50% :text :align center - :font + :font :size 14px :padding 3px 0 @@ -135,7 +135,7 @@ input[type='password'] .username :width 200px :display inline - + input :display inline :width 200px diff --git a/script/cucumber b/script/cucumber new file mode 100755 index 0000000000000000000000000000000000000000..7fa5c9208675ca06c02b2d3a3279f17623d1cbc9 --- /dev/null +++ b/script/cucumber @@ -0,0 +1,10 @@ +#!/usr/bin/env ruby + +vendored_cucumber_bin = Dir["#{File.dirname(__FILE__)}/../vendor/{gems,plugins}/cucumber*/bin/cucumber"].first +if vendored_cucumber_bin + load File.expand_path(vendored_cucumber_bin) +else + require 'rubygems' unless ENV['NO_RUBYGEMS'] + require 'cucumber' + load Cucumber::BINARY +end diff --git a/script/rails b/script/rails index f138a34a41b33ca6d4bd6ffbe2bfeb3ffdff1297..f8da2cffd4de029d658fe2f7b9ec88f28dc34a9a 100755 --- a/script/rails +++ b/script/rails @@ -1,4 +1,4 @@ -#!/usr/bin/env ruby1.8 +#!/usr/bin/env ruby # This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application. APP_PATH = File.expand_path('../../config/application', __FILE__) diff --git a/spec/controllers/albums_controller_spec.rb b/spec/controllers/albums_controller_spec.rb index 67b7d9a78298fcd35fb0d1bfc3099a7eccd91f76..a8f5f8506b7492cd02443701ecc86a4eb2c235f8 100644 --- a/spec/controllers/albums_controller_spec.rb +++ b/spec/controllers/albums_controller_spec.rb @@ -2,9 +2,8 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. +require 'spec_helper' -require File.dirname(__FILE__) + '/../spec_helper' -include ApplicationHelper describe AlbumsController do render_views before do @@ -20,4 +19,14 @@ describe AlbumsController do @album.reload.name.should eql("new_name") end + describe '#create' do + it 'all aspects' do + params = {"album" => {"name" => "Sunsets","to" => "all"}} + post :create, params + end + it 'one aspect' do + params = {"album" => {"name" => "Sunsets","to" => @aspect.id.to_s}} + post :create, params + end + end end diff --git a/spec/controllers/aspects_controller_spec.rb b/spec/controllers/aspects_controller_spec.rb index a186e8b7c45ac4147c459c882585f8b8cd049604..2e05b850ccc2b78cf353e6908c2122e887a8bbc1 100644 --- a/spec/controllers/aspects_controller_spec.rb +++ b/spec/controllers/aspects_controller_spec.rb @@ -2,10 +2,8 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. +require 'spec_helper' - -require File.dirname(__FILE__) + '/../spec_helper' -include ApplicationHelper describe AspectsController do render_views before do diff --git a/spec/controllers/dev_utilities_controller_spec.rb b/spec/controllers/dev_utilities_controller_spec.rb new file mode 100644 index 0000000000000000000000000000000000000000..66c07350f41da88a3b474b9295b90b54c8d5b4ac --- /dev/null +++ b/spec/controllers/dev_utilities_controller_spec.rb @@ -0,0 +1,42 @@ +# Copyright (c) 2010, Diaspora Inc. This file is +# licensed under the Affero General Public License version 3. See +# the COPYRIGHT file. + +require File.join(File.dirname(__FILE__), "..", "spec_helper") + +describe DevUtilitiesController do + render_views + + before do + @tom = Factory.create(:user, :email => "tom@tom.joindiaspora.org") + sign_in :user, @tom + end + + describe "#zombiefriends" do + it "succeeds" do + get :zombiefriends + response.should be_success + end + end + + describe "#set_profile_photo" do + # In case anyone wants their config/backer_number.yml to still exist after running specs + before do + @backer_number_file = File.join(File.dirname(__FILE__), "..", "..", "config", "backer_number.yml") + @temp_file = File.join(File.dirname(__FILE__), "..", "..", "config", "backer_number.yml-tmp") + FileUtils.mv(@backer_number_file, @temp_file, :force => true) + end + after do + if File.exists?(@temp_file) + FileUtils.mv(@temp_file, @backer_number_file, :force => true) + else + FileUtils.rm_rf(@backer_number_file) + end + end + it "succeeds" do + get :set_backer_number, 'number' => '3' + get :set_profile_photo + response.should be_success + end + end +end diff --git a/spec/controllers/people_controller_spec.rb b/spec/controllers/people_controller_spec.rb index badfdf496bb445bea5dfbf2e150b80d56d2e4601..4ce6e3e695048b2f8273a0e5885b8579a85ad287 100644 --- a/spec/controllers/people_controller_spec.rb +++ b/spec/controllers/people_controller_spec.rb @@ -2,9 +2,7 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - -require File.dirname(__FILE__) + '/../spec_helper' +require 'spec_helper' describe PeopleController do render_views diff --git a/spec/controllers/publics_controller_spec.rb b/spec/controllers/publics_controller_spec.rb index bea772e20c425771f2b61e1493b5ca1ced199c07..70d851a3e066523d1a3986fa58c278e273a853ae 100644 --- a/spec/controllers/publics_controller_spec.rb +++ b/spec/controllers/publics_controller_spec.rb @@ -2,9 +2,7 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - -require File.dirname(__FILE__) + '/../spec_helper' +require 'spec_helper' describe PublicsController do render_views diff --git a/spec/controllers/requests_controller_spec.rb b/spec/controllers/requests_controller_spec.rb deleted file mode 100644 index f0864abe1e018c00e0309f2e36e882fd356c7384..0000000000000000000000000000000000000000 --- a/spec/controllers/requests_controller_spec.rb +++ /dev/null @@ -1,23 +0,0 @@ -# Copyright (c) 2010, Diaspora Inc. This file is -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - - - -require File.dirname(__FILE__) + '/../spec_helper' -include ApplicationHelper -include RequestsHelper -describe RequestsController do - render_views - before do - @user = Factory.create :user - stub_success("tom@tom.joindiaspora.com") - - @tom = Redfinger.finger('tom@tom.joindiaspora.com') - sign_in :user, @user - stub!(:current_user).and_return @user - end - it 'should return the correct tag and url for a given address' do - relationship_flow('tom@tom.joindiaspora.com')[:friend].receive_url.include?("receive/user").should == true - end -end diff --git a/spec/controllers/sockets_controller_spec.rb b/spec/controllers/sockets_controller_spec.rb index 4104d0d518d1688b6338b56cf03e3331a31a44cb..905b1611e3b10048a8a2d83efee2564c49185702 100644 --- a/spec/controllers/sockets_controller_spec.rb +++ b/spec/controllers/sockets_controller_spec.rb @@ -2,15 +2,13 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. +require 'spec_helper' - -require File.dirname(__FILE__) + '/../spec_helper' - -class SocketsController +SocketsController.class_eval <<-EOT def url_options {:host => ""} end -end +EOT describe SocketsController do render_views diff --git a/spec/factories.rb b/spec/factories.rb index 0b00ed3d5577f009fb12d1879619a1623c87846d..3444cf9e1f233101cb7f6dd3952c7e404d6fd84c 100644 --- a/spec/factories.rb +++ b/spec/factories.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - #For Guidance #http://github.com/thoughtbot/factory_girl # http://railscasts.com/episodes/158-factories-not-fixtures @@ -19,7 +17,7 @@ Factory.define :person do |p| p.sequence(:url) {|n| "http://google-#{n}.com/"} p.profile Factory.create(:profile) - p.serialized_key OpenSSL::PKey::RSA.generate(1024).public_key.export + p.serialized_public_key OpenSSL::PKey::RSA.generate(1024).public_key.export end Factory.define :album do |p| @@ -27,22 +25,25 @@ Factory.define :album do |p| p.person { |a| Factory.create(:person) } end -Factory.define :person_with_private_key, :parent => :person do |p| - p.serialized_key OpenSSL::PKey::RSA.generate(1024).export -end - -Factory.define :person_with_user, :parent => :person_with_private_key do |p| -end - Factory.define :user do |u| u.sequence(:username) {|n| "bob#{n}"} u.sequence(:email) {|n| "bob#{n}@pivotallabs.com"} u.password "bluepin7" u.password_confirmation "bluepin7" - u.person { |a| Factory.create(:person_with_user, - :owner_id => a._id, - :diaspora_handle => "#{a.username}@#{APP_CONFIG[:pod_url].gsub(/(https?:|www\.)\/\//, '').chop!}") - } + u.serialized_private_key OpenSSL::PKey::RSA.generate(1024).export + u.after_build do |user| + user.person = Factory(:person, :owner_id => user._id, + :serialized_public_key => user.encryption_key.public_key.export, + :diaspora_handle => "#{user.username}@#{APP_CONFIG[:pod_url].gsub(/(https?:|www\.)\/\//, '').chop!}") + end +end + +Factory.define :user_with_aspect, :parent => :user do |u| + u.after_build { |user| user.aspects << Factory(:aspect) } +end + +Factory.define :aspect do |aspect| + aspect.name "generic" end Factory.define :status_message do |m| @@ -55,7 +56,6 @@ Factory.define :blog do |b| b.sequence(:body) {|n| "jimmy's huge #{n} whales"} end - Factory.define :bookmark do |b| b.link "http://www.yahooligans.com/" end diff --git a/spec/fixtures/evan_hcard b/spec/fixtures/evan_hcard index d3440875955310ca418f93dfe0694dbf6c3c2ac7..8944ef1e3d114158d2a0bd319a11bda22672837b 100644 --- a/spec/fixtures/evan_hcard +++ b/spec/fixtures/evan_hcard @@ -62,7 +62,7 @@ <dd id="site_content_license_cc"> <p> <img id="license_cc" src="http://i.creativecommons.org/l/by/3.0/80x15.png" alt="Creative Commons Attribution 3.0" width="80" height="15"/>:w - + All Evan Prodromou content and data are available under the <a class="license" rel="external license" href="http://creativecommons.org/licenses/by/3.0/">Creative Commons Attribution 3.0</a> license.</p> </dd> diff --git a/spec/fixtures/hcard_response b/spec/fixtures/hcard_response index d87957a93efd533da89542179b3e0d137943ebd4..bbd06c4bf4478f5ed92fadb509e79b1c3a761ffb 100644 --- a/spec/fixtures/hcard_response +++ b/spec/fixtures/hcard_response @@ -1,44 +1,44 @@ -<div id="content"> - <h1>Alexander Hamiltom</h1> - <div id="content_inner"> - <div id="i" class="entity_profile vcard author"> - <h2>User profile</h2> - <dl class="entity_nickname"> - <dt>Nickname</dt> - <dd> - <a href="http://tom.joindiaspora.com/" rel="me" class="nickname url uid">Alexander Hamiltom</a> - </dd> - </dl> - <dl class="entity_given_name"> - <dt>Full name</dt> - <dd> - <span class="given_name" >Alexander</span> - </dd> +<div id="content"> + <h1>Alexander Hamiltom</h1> + <div id="content_inner"> + <div id="i" class="entity_profile vcard author"> + <h2>User profile</h2> + <dl class="entity_nickname"> + <dt>Nickname</dt> + <dd> + <a href="http://tom.joindiaspora.com/" rel="me" class="nickname url uid">Alexander Hamiltom</a> + </dd> + </dl> + <dl class="entity_given_name"> + <dt>Full name</dt> + <dd> + <span class="given_name" >Alexander</span> + </dd> </dl> - <dl class="entity_family_name"> - <dt>Full name</dt> - <dd> - <span class="family_name" >Hamiltom</span> - </dd> + <dl class="entity_family_name"> + <dt>Full name</dt> + <dd> + <span class="family_name" >Hamiltom</span> + </dd> </dl> - <dl class="entity_fn"> - <dt>Full name</dt> - <dd> - <span class="fn" >Alexander Hamiltom</span> - </dd> - </dl> - <dl class="entity_url"> - <dt>URL</dt> - <dd> - <a href="http://tom.joindiaspora.com/" rel="me" id="pod_location" class="url">http://tom.joindiaspora.com/</a> - </dd> - </dl> - <dl class="entity_note"> - <dt>Note</dt> - <dd class="note">Diaspora is awesome! vi is better than emacs!</dd> - </dl> - </div> - </div> + <dl class="entity_fn"> + <dt>Full name</dt> + <dd> + <span class="fn" >Alexander Hamiltom</span> + </dd> + </dl> + <dl class="entity_url"> + <dt>URL</dt> + <dd> + <a href="http://tom.joindiaspora.com/" rel="me" id="pod_location" class="url">http://tom.joindiaspora.com/</a> + </dd> + </dl> + <dl class="entity_note"> + <dt>Note</dt> + <dd class="note">Diaspora is awesome! vi is better than emacs!</dd> + </dl> + </div> + </div> -</div> +</div> diff --git a/spec/fixtures/host_xrd b/spec/fixtures/host_xrd index dcb67d76747a282134542eb70940391b8bc365f4..8118fa94a59e5ef5d516cc77c261aafa6769a19b 100644 --- a/spec/fixtures/host_xrd +++ b/spec/fixtures/host_xrd @@ -1,6 +1,6 @@ <?xml version='1.0' encoding='UTF-8'?> <XRD xmlns='http://docs.oasis-open.org/ns/xri/xrd-1.0'> - <Link rel='lrdd' + <Link rel='lrdd' template='http://example.com/webfinger/?q={uri}'> <Title>Resource Descriptor</Title> </Link> diff --git a/spec/helpers/application_helper_spec.rb b/spec/helpers/application_helper_spec.rb index 4b89c7b31463f18c4e7f7a1d055c1d587548b9b2..459563cffb2b2bef8c01bdec9a4f20217a1894b3 100644 --- a/spec/helpers/application_helper_spec.rb +++ b/spec/helpers/application_helper_spec.rb @@ -2,18 +2,14 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. +require 'spec_helper' - -require File.dirname(__FILE__) + '/../spec_helper' - -include ApplicationHelper describe ApplicationHelper do before do @user = Factory.create(:user) @person = Factory.create(:person) end - it "should provide a correct show path for a given person" do person_url(@person).should == "/people/#{@person.id}" end diff --git a/spec/helpers/publics_helper_spec.rb b/spec/helpers/publics_helper_spec.rb index 70e9d460681c10029a1d6370ae1a23a41079c48b..bc6a5021b4ce596b392a949b15cefa8ef60dcbdb 100644 --- a/spec/helpers/publics_helper_spec.rb +++ b/spec/helpers/publics_helper_spec.rb @@ -2,11 +2,8 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. +require 'spec_helper' - -require File.dirname(__FILE__) + '/../spec_helper' - -include PublicsHelper describe PublicsHelper do before do @user = Factory.create(:user) diff --git a/spec/helpers/requests_helper_spec.rb b/spec/helpers/requests_helper_spec.rb index 2d2be1acb773ecba32e087b0f56c26ce16b93743..bf99f89d1893b2da25598a03bd9eb583bbeb4054 100644 --- a/spec/helpers/requests_helper_spec.rb +++ b/spec/helpers/requests_helper_spec.rb @@ -2,16 +2,11 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - -require File.dirname(__FILE__) + '/../spec_helper' - -include RequestsHelper +require 'spec_helper' describe RequestsHelper do before do - stub_success("tom@tom.joindiaspora.com") stub_success("evan@status.net") @tom = Redfinger.finger('tom@tom.joindiaspora.com') @@ -24,4 +19,16 @@ describe RequestsHelper do subscription_mode(@evan).should == :none end end + + describe "#relationship_flow" do + let(:tom){ Factory(:user, :email => 'tom@tom.joindiaspora.com') } + + before do + stub!(:current_user).and_return(tom) + end + + it 'should return the correct tag and url for a given address' do + relationship_flow('tom@tom.joindiaspora.com')[:friend].receive_url.should include("receive/user") + end + end end diff --git a/spec/lib/diaspora_parser_spec.rb b/spec/lib/diaspora_parser_spec.rb index cdd1063ab55834f00a01b339b595d396f16d0283..530dca21150987e0efb6ed104ec53252f8a7fc0f 100644 --- a/spec/lib/diaspora_parser_spec.rb +++ b/spec/lib/diaspora_parser_spec.rb @@ -2,20 +2,15 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - -require File.dirname(__FILE__) + '/../spec_helper' - -include ApplicationHelper -include Diaspora::Parser - - +require 'spec_helper' describe Diaspora::Parser do before do @user = Factory.create(:user, :email => "bob@aol.com") @aspect = @user.aspect(:name => 'spies') - @person = Factory.create(:person_with_private_key, :diaspora_handle => "bill@gates.com") + + @user3 = Factory.create :user + @person = @user3.person @user2 = Factory.create(:user) end @@ -71,12 +66,13 @@ describe Diaspora::Parser do original_person_id = @person.id xml = request.to_diaspora_xml + @user3.destroy @person.destroy Person.all.count.should == person_count -1 @user.receive xml Person.all.count.should == person_count - Person.first(:_id => original_person_id).serialized_key.include?("PUBLIC").should be true + Person.first(:_id => original_person_id).serialized_public_key.include?("PUBLIC").should be true url = "http://" + request.callback_url.split("/")[2] + "/" Person.where(:url => url).first.id.should == original_person_id end @@ -88,14 +84,13 @@ describe Diaspora::Parser do original_person_id = @user2.person.id xml = request.to_diaspora_xml - Person.all.count.should be person_count @user.receive xml Person.all.count.should be person_count @user2.reload @user2.person.reload - @user2.person.serialized_key.include?("PRIVATE").should be true + @user2.serialized_private_key.include?("PRIVATE").should be true url = "http://" + request.callback_url.split("/")[2] + "/" Person.where(:url => url).first.id.should == original_person_id @@ -103,7 +98,7 @@ describe Diaspora::Parser do it "should activate the Person if I initiated a request to that url" do request = @user.send_friend_request_to( @user2.person, @aspect) - + @user.reload request.reverse_for @user2 xml = request.to_diaspora_xml @@ -121,10 +116,10 @@ describe Diaspora::Parser do @user.friends.include?(new_person).should be true end - it 'should process retraction for a person' do person_count = Person.all.count request = @user.send_friend_request_to( @user2.person, @aspect) + @user.reload request.reverse_for @user2 xml = request.to_diaspora_xml @@ -139,7 +134,6 @@ describe Diaspora::Parser do aspect_people_count = @aspect.people.size #They are now friends - Person.count.should == person_count @user.receive retraction_xml diff --git a/spec/lib/hcard_spec.rb b/spec/lib/hcard_spec.rb index 89ad499249ee6d9b303bb1722e39c25a974a9d37..45d7157b9644f6817564da957ade00812ae101a8 100644 --- a/spec/lib/hcard_spec.rb +++ b/spec/lib/hcard_spec.rb @@ -2,9 +2,7 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - -require File.dirname(__FILE__) + '/../spec_helper' +require 'spec_helper' require File.dirname(__FILE__) + '/../../lib/hcard' describe HCard do diff --git a/spec/lib/message_handler_spec.rb b/spec/lib/message_handler_spec.rb index e6cd668e27675021d95231293a35c091165b5d56..adb375c1793d403f191b3dc7bcf108238cacbb0c 100644 --- a/spec/lib/message_handler_spec.rb +++ b/spec/lib/message_handler_spec.rb @@ -2,9 +2,7 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - -require File.dirname(__FILE__) + '/../spec_helper' +require 'spec_helper' describe MessageHandler do before do @@ -41,7 +39,6 @@ describe MessageHandler do } end - it 'should only retry a bad request three times ' do request = FakeHttpRequest.new(:failure) request.should_receive(:get).exactly(MessageHandler::NUM_TRIES).times.and_return(request) @@ -61,7 +58,6 @@ describe MessageHandler do describe 'POST messages' do - it 'should be able to add a post message to the queue' do EventMachine.run { @handler.size.should ==0 diff --git a/spec/lib/salmon_salmon_spec.rb b/spec/lib/salmon_salmon_spec.rb index a14ef8f77d68c0fb953dc230417a5ea520e83160..6d467d4eac26338b96b2e16cea15baed58d5ba5e 100644 --- a/spec/lib/salmon_salmon_spec.rb +++ b/spec/lib/salmon_salmon_spec.rb @@ -2,9 +2,7 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - -require File.dirname(__FILE__) + '/../spec_helper' +require 'spec_helper' describe Salmon do before do @@ -23,7 +21,6 @@ describe Salmon do @sent_salmon.magic_sig.sig.should == @parsed_salmon.magic_sig.sig @sent_salmon.magic_sig.signable_string.should == @parsed_salmon.magic_sig.signable_string - @parsed_salmon.verified_for_key?(OpenSSL::PKey::RSA.new(@user.exported_key)).should be true @sent_salmon.verified_for_key?(OpenSSL::PKey::RSA.new(@user.exported_key)).should be true end diff --git a/spec/lib/web_hooks_spec.rb b/spec/lib/web_hooks_spec.rb index d3486f1b5055e19280fc17f059b4fa579a7e2774..e316817d402c999d9410019982d61fb8d08d2546 100644 --- a/spec/lib/web_hooks_spec.rb +++ b/spec/lib/web_hooks_spec.rb @@ -2,32 +2,25 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. +require 'spec_helper' + +describe Diaspora::Webhooks do + before do + @user = Factory.create(:user) + @aspect = @user.aspect(:name => "losers") + @user2 = Factory.create(:user) + @aspect2 = @user2.aspect(:name => "losers") + friend_users(@user, @aspect, @user2, @aspect2) + end - -require File.dirname(__FILE__) + '/../spec_helper' - -include Diaspora - -describe Diaspora do - - describe Webhooks do + describe "body" do before do - @user = Factory.create(:user) - @aspect = @user.aspect(:name => "losers") - @user2 = Factory.create(:user) - @aspect2 = @user2.aspect(:name => "losers") - friend_users(@user, @aspect, @user2, @aspect2) + @post = Factory.build(:status_message, :person => @user.person) end - describe "body" do - before do - @post = Factory.build(:status_message, :person => @user.person) - end - - it "should add the following methods to Post on inclusion" do - @post.respond_to?(:to_diaspora_xml).should be true - end - + it "should add the following methods to Post on inclusion" do + @post.respond_to?(:to_diaspora_xml).should be true end + end end diff --git a/spec/lib/websocket_spec.rb b/spec/lib/websocket_spec.rb index edac7051ad4998e0ec13cbe759ca602972372a68..0b76e0f5244e8f52756589822b24ee09a8fc7044 100644 --- a/spec/lib/websocket_spec.rb +++ b/spec/lib/websocket_spec.rb @@ -2,7 +2,7 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. -require File.dirname(__FILE__) + '/../spec_helper' +require 'spec_helper' describe Diaspora::WebSocket do before do diff --git a/spec/misc_spec.rb b/spec/misc_spec.rb index 14f1d4c3eadc22d0454eeee5f6e8c4bb757fb9a6..c4b2cc67c27aee4c18eb27b4cd0e00ef285b5d28 100644 --- a/spec/misc_spec.rb +++ b/spec/misc_spec.rb @@ -2,9 +2,7 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - -require File.dirname(__FILE__) + '/spec_helper' +require 'spec_helper' describe 'making sure the spec runner works' do @@ -34,4 +32,25 @@ describe 'making sure the spec runner works' do end end + describe '#friend_users' do + before do + @user1 = Factory.create(:user) + @aspect1 = @user1.aspect(:name => "losers") + @user2 = Factory.create(:user) + @aspect2 = @user2.aspect(:name => "bruisers") + friend_users(@user1, @aspect1, @user2, @aspect2) + @user1.reload + @aspect1.reload + @user2.reload + @aspect2.reload + end + + it 'makes the first user friends with the second' do + @aspect1.people.include?(@user2.person).should be_true + end + + it 'makes the second user friends with the first' do + @aspect2.people.include?(@user1.person).should be_true + end + end end diff --git a/spec/models/aspect_spec.rb b/spec/models/aspect_spec.rb index 5931970cf7c344443b53bea5f2f396d057c403b3..23453eee915af22669da41338a4165947eef705d 100644 --- a/spec/models/aspect_spec.rb +++ b/spec/models/aspect_spec.rb @@ -2,9 +2,7 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - -require File.dirname(__FILE__) + '/../spec_helper' +require 'spec_helper' describe Aspect do before do @@ -20,7 +18,7 @@ describe Aspect do aspect.name.should == "losers" end - it 'should be able to have people' do + it 'should be creatable with people' do aspect = @user.aspect(:name => 'losers', :people => [@friend, @friend_2]) aspect.people.size.should == 2 end @@ -156,16 +154,16 @@ describe Aspect do @user.receive message.to_diaspora_xml @aspect.reload - @aspect.posts.count.should be 1 - @aspect3.posts.count.should be 0 + @aspect.posts.count.should == 1 + @aspect3.posts.count.should == 0 @user.reload @user.move_friend(:friend_id => @user2.person.id, :from => @aspect.id, :to => @aspect3.id) @aspect.reload @aspect3.reload - @aspect3.posts.count.should be 1 - @aspect.posts.count.should be 0 + @aspect3.posts.count.should == 1 + @aspect.posts.count.should == 0 end diff --git a/spec/models/comments_spec.rb b/spec/models/comments_spec.rb index 1c20354cf51a52a71282cc2ec6d6fa3bf00e2c57..732c4349b25e1754d7558582d72cdb33070c76c9 100644 --- a/spec/models/comments_spec.rb +++ b/spec/models/comments_spec.rb @@ -2,9 +2,7 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - -require File.dirname(__FILE__) + '/../spec_helper' +require 'spec_helper' describe Comment do describe "user" do diff --git a/spec/models/person_spec.rb b/spec/models/person_spec.rb index 3275d9245223017007c6352ff2d084b9d1b43bed..6df3ddc1c884ab7b64bec9a0bd48de10ff57f222 100644 --- a/spec/models/person_spec.rb +++ b/spec/models/person_spec.rb @@ -2,9 +2,7 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - -require File.dirname(__FILE__) + '/../spec_helper' +require 'spec_helper' describe Person do before do @@ -18,13 +16,13 @@ describe Person do describe '#diaspora_handle' do context 'local people' do it 'uses the pod config url to set the diaspora_handle' do - @user.person.diaspora_handle.should == @user.username + "@example.org" + @user.person.diaspora_handle.should == @user.username + "@" + APP_CONFIG[:terse_pod_url] end end - + context 'remote people' do it 'stores the diaspora_handle in the database' do - @person.diaspora_handle.include?(@user.terse_url).should be false + @person.diaspora_handle.include?(APP_CONFIG[:terse_pod_url]).should be false end end end diff --git a/spec/models/photo_spec.rb b/spec/models/photo_spec.rb index 516c16df84b9d99f762ed516d8f22f5e00de6875..f3f77f3db26f249006a8a50760fee43a678594c5 100644 --- a/spec/models/photo_spec.rb +++ b/spec/models/photo_spec.rb @@ -2,9 +2,7 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - -require File.dirname(__FILE__) + '/../spec_helper' +require 'spec_helper' describe Photo do before do @@ -16,7 +14,6 @@ describe Photo do @fixture_name = File.dirname(__FILE__) + '/../fixtures/button.png' @fail_fixture_name = File.dirname(__FILE__) + '/../fixtures/msg.xml' - @photo = Photo.new(:person => @user.person, :album => @album) end @@ -31,8 +28,13 @@ describe Photo do it 'should save a photo' do @photo.image.store! File.open(@fixture_name) @photo.save.should == true - binary = @photo.image.read - fixture_binary = File.open(@fixture_name).read + begin + binary = @photo.image.read.force_encoding('BINARY') + fixture_binary = File.open(@fixture_name).read.force_encoding('BINARY') + rescue NoMethodError # Ruby 1.8 doesn't have force_encoding + binary = @photo.image.read + fixture_binary = File.open(@fixture_name).read + end binary.should == fixture_binary end diff --git a/spec/models/post_spec.rb b/spec/models/post_spec.rb index dc9d4a9b8bb1a99d5c20547092b99277a7a26227..b0ed59b7d59b066e2c9809b00440c70ca4a3678f 100644 --- a/spec/models/post_spec.rb +++ b/spec/models/post_spec.rb @@ -2,9 +2,7 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - -require File.dirname(__FILE__) + '/../spec_helper' +require 'spec_helper' describe Post do before do diff --git a/spec/models/profile_spec.rb b/spec/models/profile_spec.rb index b5bd8f9a5ff2a44fa5a800c1e855eb4fa81b6ef2..2e38c20ae3afec3d561374b78445611263fcf173 100644 --- a/spec/models/profile_spec.rb +++ b/spec/models/profile_spec.rb @@ -2,9 +2,7 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - -require File.dirname(__FILE__) + '/../spec_helper' +require 'spec_helper' describe Profile do before do @@ -29,4 +27,3 @@ describe Profile do end end - diff --git a/spec/models/request_spec.rb b/spec/models/request_spec.rb index 5899cb7fb03d140e49d3b3ad13c369253e686650..c8fb8af0570a4decdadd5b4fe61834ae1bd9d7df 100644 --- a/spec/models/request_spec.rb +++ b/spec/models/request_spec.rb @@ -2,9 +2,7 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - -require File.dirname(__FILE__) + '/../spec_helper' +require 'spec_helper' describe Request do before do @@ -19,7 +17,7 @@ describe Request do person_request.valid?.should be true end - it 'should generate xml for the User as a Person' do + it 'should generate xml for the User as a Person' do request = @user.send_friend_request_to Factory.create(:person), @aspect xml = request.to_xml.to_s diff --git a/spec/models/retraction_spec.rb b/spec/models/retraction_spec.rb index 9aa2b8a769cff0454a6f091530053fb9338c9ab1..7778552340a923e9db42b4625ee2cfc2758ca393 100644 --- a/spec/models/retraction_spec.rb +++ b/spec/models/retraction_spec.rb @@ -2,9 +2,7 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - -require File.dirname(__FILE__) + '/../spec_helper' +require 'spec_helper' describe Retraction do before do diff --git a/spec/models/status_message_spec.rb b/spec/models/status_message_spec.rb index 005038bf1d965aa06630d2a5e3acad5e5eb90b27..d7dbf19e45af5054b8e0d733b48e4e7e6cd70f29 100644 --- a/spec/models/status_message_spec.rb +++ b/spec/models/status_message_spec.rb @@ -2,9 +2,7 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - -require File.dirname(__FILE__) + '/../spec_helper' +require 'spec_helper' describe StatusMessage do before do @@ -37,6 +35,5 @@ describe StatusMessage do end end - end diff --git a/spec/models/user/posting_spec.rb b/spec/models/user/posting_spec.rb index d307e7a43686af2d1c26315a69522a5e5fab3a5b..76f4243f7f81df4c84eaff2d8ab95d75e68bda60 100644 --- a/spec/models/user/posting_spec.rb +++ b/spec/models/user/posting_spec.rb @@ -2,83 +2,82 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - -require File.dirname(__FILE__) + '/../../spec_helper' +require 'spec_helper' describe User do - let(:user) { Factory(:user) } - let(:user2) { Factory(:user) } - let(:user3) { Factory(:user) } - let(:user4) { Factory(:user) } - - let(:aspect) {user.aspect(:name => 'heroes')} - let!(:aspect1) {user.aspect(:name => 'heroes')} - let!(:aspect2) {user2.aspect(:name => 'losers')} - let!(:aspect3) {user3.aspect(:name => 'heroes')} - let!(:aspect4) {user4.aspect(:name => 'heroes')} - - before do - friend_users(user, aspect, user2, aspect2) - friend_users(user, aspect, user3, aspect3) - friend_users(user, aspect1, user4, aspect4) - end + let!(:user) { Factory(:user) } + let!(:aspect) { user.aspect(:name => 'heroes') } + let!(:aspect1) { user.aspect(:name => 'other') } - context 'posting' do - - describe '#validate_aspect_permissions' do - it 'should not be able to post without a aspect' do - proc { - user.validate_aspect_permissions([]) - }.should raise_error /You must post to someone/ - end + let!(:user2) { Factory(:user) } + let!(:aspect2) { user2.aspect(:name => 'losers') } - it 'should not be able to post to someone elses aspect' do - proc { - user.validate_aspect_permissions(aspect2.id) - }.should raise_error /Cannot post to an aspect you do not own./ - end + describe '#validate_aspect_permissions' do + it 'requires an aspect' do + proc { + user.validate_aspect_permissions([]) + }.should raise_error /You must post to someone/ end - describe '#post' do - it 'should put the post in the aspect post array' do - post = user.post(:status_message, :message => "hey", :to => aspect.id) - aspect.reload - aspect.posts.should include post - end + it "won't let you post to someone else's aspect" do + proc { + user.validate_aspect_permissions(aspect2.id) + }.should raise_error /Cannot post to an aspect you do not own./ + end - it 'should put an album in the aspect post array' do - album = user.post :album, :name => "Georges", :to => aspect.id - aspect.reload - aspect.posts.should include album - end + it "lets you post to your own aspects" do + user.validate_aspect_permissions(aspect.id).should be_true + user.validate_aspect_permissions(aspect1.id).should be_true end + end - describe '#repost' do - let!(:status_message) { user.post(:status_message, :message => "hello", :to => aspect.id) } + describe '#post' do + it 'should put the post in the aspect post array' do + post = user.post(:status_message, :message => "hey", :to => aspect.id) + aspect.reload + aspect.posts.should include post + end - it 'should make the post visible in another aspect' do - user.repost( status_message, :to => aspect1.id ) - aspect1.reload - aspect1.posts.count.should be 1 - end + it 'should put an album in the aspect post array' do + album = user.post :album, :name => "Georges", :to => aspect.id + aspect.reload + aspect.posts.should include album end + end - describe '#update_post' do - let!(:album) { user.post(:album, :name => "Profile Photos", :to => aspect.id) } + describe '#repost' do + it 'should make the post visible in another aspect' do + status_message = user.post(:status_message, :message => "hello", :to => aspect.id) + user.repost(status_message, :to => aspect1.id) + aspect1.reload + aspect1.posts.count.should be 1 + end + end - it 'should update fields' do - update_hash = { :name => "Other Photos" } - user.update_post( album, update_hash ) - album.name.should == "Other Photos" - end + describe '#update_post' do + it 'should update fields' do + album = user.post(:album, :name => "Profile Photos", :to => aspect.id) + update_hash = {:name => "Other Photos"} + user.update_post(album, update_hash) + album.name.should == "Other Photos" end end context 'dispatching' do + let!(:user3) { Factory(:user) } + let!(:aspect3) { user3.aspect(:name => 'heroes') } + let!(:user4) { Factory(:user) } + let!(:aspect4) { user4.aspect(:name => 'heroes') } + let!(:post) { user.build_post :status_message, :message => "hey" } + before do + friend_users(user, aspect, user2, aspect2) + friend_users(user, aspect, user3, aspect3) + friend_users(user, aspect1, user4, aspect4) + end + describe '#push_to_aspects' do it 'should push a post to a aspect' do user.should_receive(:salmon).twice diff --git a/spec/models/user/receive_spec.rb b/spec/models/user/receive_spec.rb index 37648a98cd0a0f393894f76f0e6eb26f71dea815..5bdddce67a5fc8ef440be1adf73ac0e3124169a2 100644 --- a/spec/models/user/receive_spec.rb +++ b/spec/models/user/receive_spec.rb @@ -2,9 +2,7 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - -require File.dirname(__FILE__) + '/../../spec_helper' +require 'spec_helper' describe User do diff --git a/spec/models/user/user_friending_spec.rb b/spec/models/user/user_friending_spec.rb index 67ed9f7991272707df656e4d2741ab4636233e4d..4ea51ad19e72184ac05aafa4d2f0ee177113a35c 100644 --- a/spec/models/user/user_friending_spec.rb +++ b/spec/models/user/user_friending_spec.rb @@ -2,9 +2,7 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - -require File.dirname(__FILE__) + '/../../spec_helper' +require 'spec_helper' describe User do before do @@ -24,7 +22,6 @@ describe User do aspect.requests.size.should == 1 end - it "should be able to accept a pending friend request" do friend = Factory.create(:person) r = Request.instantiate(:to => @user.receive_url, :from => friend) @@ -53,12 +50,9 @@ describe User do @user.friends << friend @user.save - proc {@user.send_friend_request_to( friend, @aspect)}.should raise_error end - - describe 'multiple users accepting/rejecting the same person' do before do @person_one = Factory.create :person @@ -144,7 +138,6 @@ describe User do Person.all.count.should be 3 end - end describe 'a user accepting rejecting multiple people' do @@ -231,6 +224,5 @@ describe User do end end - end end diff --git a/spec/models/user/visible_posts_spec.rb b/spec/models/user/visible_posts_spec.rb index bcab473bcce0060021fdbcc6f1bb541856dc712e..e0a3d5215ec509ccb69b2e53a81f9ef4407138af 100644 --- a/spec/models/user/visible_posts_spec.rb +++ b/spec/models/user/visible_posts_spec.rb @@ -2,46 +2,38 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - -require File.dirname(__FILE__) + '/../../spec_helper' +require 'spec_helper' describe User do - let(:user) { Factory(:user) } - - let(:user2) { Factory(:user) } - let(:user3) { Factory(:user) } - let(:user4) { Factory(:user) } + let!(:user) { Factory(:user_with_aspect) } + let!(:first_aspect) { user.aspects.first } + let!(:second_aspect) { user.aspect(:name => 'losers') } - let!(:aspect) { user.aspect(:name => 'heroes') } - let!(:aspect2) { user.aspect(:name => 'losers') } + let!(:user2) { Factory(:user_with_aspect) } - let!(:user2_aspect) { user2.aspect(:name => 'dudes') } - let!(:user3_aspect) { user3.aspect(:name => 'dudes') } - let!(:user4_aspect) { user4.aspect(:name => 'dudes') } - - let(:status_message1) { user2.post :status_message, :message => "hi", :to => user2_aspect.id } - let(:status_message2) { user3.post :status_message, :message => "heyyyy", :to => user3_aspect.id } - let(:status_message3) { user4.post :status_message, :message => "yooo", :to => user4_aspect.id } + let!(:status_message1) { user2.post :status_message, :message => "hi", :to => user2.aspects.first.id } before do - friend_users(user, aspect, user2, user2_aspect) - friend_users(user, aspect2, user3, user3_aspect) - friend_users(user, aspect2, user4, user4_aspect) + friend_users(user, first_aspect, user2, user2.aspects.first) end - it 'should generate a valid stream for a aspect of people' do - (1..3).each{ |n| - eval("user.receive status_message#{n}.to_diaspora_xml") - } + describe "#visible_posts" do + it "generates a stream for each aspect that includes only that aspect's posts" do + user3 = Factory(:user_with_aspect) + status_message2 = user3.post :status_message, :message => "heyyyy", :to => user3.aspects.first.id + user4 = Factory(:user_with_aspect) + status_message3 = user4.post :status_message, :message => "yooo", :to => user4.aspects.first.id + + friend_users(user, second_aspect, user3, user3.aspects.first) + friend_users(user, second_aspect, user4, user4.aspects.first) - user.visible_posts(:by_members_of => aspect).should include status_message1 - user.visible_posts(:by_members_of => aspect).should_not include status_message2 - user.visible_posts(:by_members_of => aspect).should_not include status_message3 + user.receive status_message1.to_diaspora_xml + user.receive status_message2.to_diaspora_xml + user.receive status_message3.to_diaspora_xml - user.visible_posts(:by_members_of => aspect2).should_not include status_message1 - user.visible_posts(:by_members_of => aspect2).should include status_message2 - user.visible_posts(:by_members_of => aspect2).should include status_message3 + user.visible_posts(:by_members_of => first_aspect).should =~ [status_message1] + user.visible_posts(:by_members_of => second_aspect).should =~ [status_message2, status_message3] + end end context 'querying' do @@ -55,21 +47,10 @@ describe User do context 'albums' do - before do - @album = user.post :album, :name => "Georges", :to => aspect.id - aspect.reload - aspect2.reload - user.reload - - @album2 = user.post :album, :name => "Borges", :to => aspect.id - aspect.reload - aspect2.reload - user.reload - - user.post :album, :name => "Luises", :to => aspect2.id - aspect.reload - aspect2.reload + user.post :album, :name => "Georges", :to => first_aspect.id + user.post :album, :name => "Borges", :to => first_aspect.id + user.post :album, :name => "Luises", :to => second_aspect.id user.reload end @@ -78,8 +59,8 @@ describe User do end it 'should return the right number of albums' do - user.albums_by_aspect(aspect).should have(2).albums - user.albums_by_aspect(aspect2).should have(1).album + user.albums_by_aspect(first_aspect.reload).should have(2).albums + user.albums_by_aspect(second_aspect.reload).should have(1).album end end end diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index 1608bbe581778b19cbcce74010ed23a1b07dac68..7d072bdd571c2a2d0ad38229527678837609318d 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -2,15 +2,20 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - -require File.dirname(__FILE__) + '/../spec_helper' +require 'spec_helper' describe User do let(:user) { Factory(:user) } - let(:aspect) { user.aspect(:name => 'heroes') } - describe '#diaspora_handle' do + describe "validations" do + it "downcases the username" do + user = Factory.build(:user, :username => "ALLUPPERCASE") + user.valid? + user.username.should == "alluppercase" + end + end + + describe '#diaspora_handle' do it 'uses the pod config url to set the diaspora_handle' do user.diaspora_handle.should == user.username + "@example.org" end @@ -29,6 +34,7 @@ describe User do end context 'aspects' do + let(:aspect) { user.aspect(:name => 'heroes') } let(:user2) { Factory(:user) } let(:aspect2) { user2.aspect(:name => 'stuff') } diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 3fdac98106467a68adf02d5102bad679f5e5719a..4149200d8ac3a0f7f0bbc9d36e4018e2c669881d 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - # This file is copied to ~/spec when you run 'ruby script/generate rspec' # from the project root directory. @@ -16,8 +14,6 @@ require 'webmock/rspec' include Devise::TestHelpers include WebMock - - # Requires supporting files with custom matchers and macros, etc, # in ./support/ and its subdirectories. Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f} @@ -45,6 +41,9 @@ RSpec.configure do |config| DatabaseCleaner.clean end end + +ImageUploader.enable_processing = false + def stub_sockets Diaspora::WebSocket.stub!(:queue_to_user).and_return(true) Diaspora::WebSocket.stub!(:subscribe).and_return(true) @@ -82,7 +81,12 @@ end def friend_users(user1, aspect1, user2, aspect2) request = user1.send_friend_request_to(user2.person, aspect1) reversed_request = user2.accept_friend_request( request.id, aspect2.id) + user1.reload user1.receive reversed_request.to_diaspora_xml + user1.reload + aspect1.reload + user2.reload + aspect2.reload end def stub_success(address = 'abc@example.com') diff --git a/spec/user_encryption_spec.rb b/spec/user_encryption_spec.rb index 33b86d52caae154b70eed8bac10a6167f100d95b..2188b106e46c93500d2f81543087d6ddf5fee9d9 100644 --- a/spec/user_encryption_spec.rb +++ b/spec/user_encryption_spec.rb @@ -2,27 +2,16 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - -require File.dirname(__FILE__) + '/spec_helper' -include ApplicationHelper -include Diaspora::Parser +require 'spec_helper' describe 'user encryption' do before do unstub_mocha_stubs @user = Factory.create(:user) @aspect = @user.aspect(:name => 'dudes') - @person = Factory.create(:person_with_private_key, - :profile => Profile.new(:first_name => 'Remote', - :last_name => 'Friend'), - :diaspora_handle => 'somewhere@else.com', - :url => 'http://distant-example.com/') - @person2 = Factory.create(:person_with_private_key, - :profile => Profile.new(:first_name => 'Second', - :last_name => 'Friend'), - :diaspora_handle => 'elsewhere@else.com', - :url => 'http://distanter-example.com/') + + @user2 = Factory.create(:user) + @aspect2 = @user2.aspect(:name => 'dudes') end after do @@ -78,7 +67,10 @@ describe 'user encryption' do describe 'comments' do before do - @remote_message = Factory.create(:status_message, :person => @person) + friend_users(@user, @aspect, @user2, @aspect2) + @remote_message = @user2.post :status_message, :message => "hello", :to => @aspect2.id + + @message = @user.post :status_message, :message => "hi", :to => @aspect.id end it 'should attach the creator signature if the user is commenting' do @@ -94,24 +86,24 @@ describe 'user encryption' do end it 'should verify a comment made on a remote post by a different friend' do - comment = Comment.new(:person => @person2, :text => "balls", :post => @remote_message) - comment.creator_signature = comment.send(:sign_with_key,@person2.encryption_key) + comment = Comment.new(:person => @user2.person, :text => "cats", :post => @remote_message) + comment.creator_signature = comment.send(:sign_with_key,@user2.encryption_key) comment.signature_valid?.should be true comment.verify_post_creator_signature.should be false - comment.post_creator_signature = comment.send(:sign_with_key,@person.encryption_key) + comment.post_creator_signature = comment.send(:sign_with_key,@user.encryption_key) comment.verify_post_creator_signature.should be true end it 'should reject comments on a remote post with only a creator sig' do - comment = Comment.new(:person => @person2, :text => "balls", :post => @remote_message) - comment.creator_signature = comment.send(:sign_with_key,@person2.encryption_key) + comment = Comment.new(:person => @user2.person, :text => "cats", :post => @remote_message) + comment.creator_signature = comment.send(:sign_with_key,@user2.encryption_key) comment.signature_valid?.should be true comment.verify_post_creator_signature.should be false end it 'should receive remote comments on a user post with a creator sig' do - comment = Comment.new(:person => @person2, :text => "balls", :post => @message) - comment.creator_signature = comment.send(:sign_with_key,@person2.encryption_key) + comment = Comment.new(:person => @user2.person, :text => "cats", :post => @message) + comment.creator_signature = comment.send(:sign_with_key,@user2.encryption_key) comment.signature_valid?.should be true comment.verify_post_creator_signature.should be false end diff --git a/test/performance/browsing_test.rb b/test/performance/browsing_test.rb deleted file mode 100644 index 74e8c942139d8d6fc8b7b32e8cc357ca89152df7..0000000000000000000000000000000000000000 --- a/test/performance/browsing_test.rb +++ /dev/null @@ -1,15 +0,0 @@ -# Copyright (c) 2010, Diaspora Inc. This file is -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - - - -require 'test_helper' -require 'rails/performance_test_help' - -# Profiling results for each test method are written to tmp/performance. -class BrowsingTest < ActionDispatch::PerformanceTest - def test_homepage - get '/' - end -end diff --git a/test/selenium/login_test.rb b/test/selenium/login_test.rb deleted file mode 100644 index 321d46e1deaa34eb05b98dec40f741bcfd156c1d..0000000000000000000000000000000000000000 --- a/test/selenium/login_test.rb +++ /dev/null @@ -1,13 +0,0 @@ -# Copyright (c) 2010, Diaspora Inc. This file is -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - - - -class SampleWebratTest < ActionController::IntegrationTest - - def test_widget - visit "/" - assert_contain "sign in" - end -end diff --git a/test/selenium/selenium_suite.rb b/test/selenium/selenium_suite.rb deleted file mode 100644 index d5362b1d7e3db7e8fc43e7b59c3708f8f8343d5f..0000000000000000000000000000000000000000 --- a/test/selenium/selenium_suite.rb +++ /dev/null @@ -1,17 +0,0 @@ -# Copyright (c) 2010, Diaspora Inc. This file is -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - - - -require File.expand_path(File.join(File.dirname(__FILE__), '..', 'test_helper')) -require 'test/unit/ui/console/testrunner' -require 'webrat' -require 'saucelabs_adapter' - -Webrat.configure do |config| - config.mode = :selenium - config.application_framework = :rack -end - -require File.join(File.dirname(__FILE__), 'sample_webrat_test') diff --git a/test/test_helper.rb b/test/test_helper.rb deleted file mode 100644 index d9742c1164f03aeae00cdfb42dbcc42d0119985f..0000000000000000000000000000000000000000 --- a/test/test_helper.rb +++ /dev/null @@ -1,19 +0,0 @@ -# Copyright (c) 2010, Diaspora Inc. This file is -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - - - -ENV["RAILS_ENV"] = "test" -require File.expand_path('../../config/environment', __FILE__) -require 'rails/test_help' - -class ActiveSupport::TestCase - # Setup all fixtures in test/fixtures/*.(yml|csv) for all tests in alphabetical order. - # - # Note: You'll currently still have to declare fixtures explicitly in integration tests - # -- they do not yet inherit this setting - #fixtures :all - - # Add more helper methods to be used by all tests here... -end diff --git a/ubuntu-setup.bash b/ubuntu-setup.bash old mode 100644 new mode 100755 index 67b602abee2b9c083a00d4c97441f601d70cdb52..95d2a96280f1e490f70f90c5b11931cb5396988e --- a/ubuntu-setup.bash +++ b/ubuntu-setup.bash @@ -1,26 +1,36 @@ #!/bin/bash # Author : hemanth.hm@gmail.com # Site : www.h3manth.com +# Contributions from: Mackenzie Morgan (maco) and Daniel Thomas (drt24) # This script helps to setup diaspora. # +# Copyright (c) 2010, Diaspora Inc. This file is +# licensed under the Affero General Public License version 3. See +# the COPYRIGHT file. -# Set extented globbing +# Set extented globbing shopt -s extglob # Check if the user has sudo privileges. -[[ $( id -u) ]] && echo "$(whoami) has no sudo permissions on this machine" && exit 1 +sudo -v >/dev/null 2>&1 || { echo $(whoami) has no sudo privileges ; exit 1; } -# Install build tools +# Check if universal repository is enabled +grep -i universe /etc/apt/sources.list > /dev/null || { echo "Please enable universe repository" ; exit 1 ; } + +# Check if wget is installed +test wget || echo "Installing wget.." && sudo apt-get install wget && echo "Installed wget.." + +# Install build tools echo "Installing build tools.." sudo apt-get -y --no-install-recommends install build-essential libxslt1.1 libxslt1-dev libxml2 echo "..Done installing build tools" -# Install Ruby 1.8.7 -echo "Installing ruby-full Ruby 1.8.7.." +# Install Ruby 1.8.7 +echo "Installing ruby-full Ruby 1.8.7.." sudo apt-get -y --no-install-recommends install ruby-full echo "..Done installing Ruby" -# Install Rake +# Install Rake echo "Installing rake.." sudo apt-get -y --no-install-recommends install rake echo "..Done installing rake" @@ -54,8 +64,21 @@ echo "Installed git-core.." # Setting up ruby gems echo "Fetching and installing ruby gems.." ( + RELEASE=$(lsb_release -c | cut -f2) + if [ RELEASE == "maverick" ] + then + sudo apt-get install --no-install-recommends -y rubygems + sudo ln -s /var/lib/gems/1.8/bin/bundle /usr/local/bin/bundle #for PATH + elif [ RELEASE == "lucid" ] + then + sudo add-apt-repository ppa:maco.m/ruby + sudo apt-get update + sudo apt-get install --no-install-recommends -y rubygems + sudo ln -s /var/lib/gems/1.8/bin/bundle /usr/local/bin/bundle #for PATH + else + # Old version echo "." - cd /tmp + cd /tmp wget http://production.cf.rubygems.org/rubygems/rubygems-1.3.7.tgz echo "." tar -xf rubygems-1.3.7.tgz @@ -64,33 +87,36 @@ echo "Fetching and installing ruby gems.." echo "." sudo ruby setup.rb echo "." - sudo ln -s /usr/bin/gem1.8 /usr/bin/gem - echo "." -) + sudo ln -s /usr/bin/gem1.8 /usr/bin/gem + echo "." + fi +) echo "Done installing the gems.." -# Install blunder -echo "Installing blunder.." +# Install bundler +echo "Installing bundler.." sudo gem install bundler -echo "Installed blunder.." +echo "Installed bundler.." # Take a clone of Diaspora ( -echo "Clone diaspora source.." -git clone http://github.com/diaspora/diaspora.git + +# Check if the user is already in a cloned source if not clone the source +[[ $( basename $PWD ) == "diaspora" ]] && echo "Already in diaspora directory" || git clone http://github.com/diaspora/diaspora.git ; cd diaspora echo "Cloned the source.." -# Install extra gems + +# Install extra gems cd diaspora echo "Installing more gems.." sudo bundle install echo "Installed." -# Install DB setup +# Install DB setup echo "Seting up DB.." rake db:seed:tom echo "DB ready. Login -> tom and password -> evankorth. More details ./diaspora/db/seeds/tom.rb." -# Run appserver +# Run appserver echo "Starting server" -bundle exec thin start +bundle exec thin start )