diff --git a/.gitignore b/.gitignore index 4d98e16e9..b5a4be542 100644 --- a/.gitignore +++ b/.gitignore @@ -4,13 +4,9 @@ app/assets/images/custom/* # Configuration files -config/app_config.yml -config/app.yml -config/application.yml +config/diaspora.yml config/heroku.yml -config/script_server*.yml -config/fb_config.yml -config/oauth_keys.yml +config/script_server.yml config/initializers/secret_token.rb config/redis.conf config/deploy_config.yml diff --git a/.rspec b/.rspec index 7c9f24ab9..7b862b57b 100644 --- a/.rspec +++ b/.rspec @@ -3,4 +3,4 @@ --color --tag ~performance --order random ---drb \ No newline at end of file +--drb diff --git a/.rvmrc b/.rvmrc index 5bff212ea..59800542f 100644 --- a/.rvmrc +++ b/.rvmrc @@ -1,8 +1,6 @@ #!/bin/bash -rubygems_version="1.8.24" -ruby_version="1.9.3-p194" -gemset="diaspora" +source ./script/env/ruby_env if [ -e '.rvmrc.local' ]; then source .rvmrc.local; @@ -18,7 +16,4 @@ else fi fi - -if [ "$(gem --version)" != "$rubygems_version" ]; then - rvm rubygems "$rubygems_version" -fi +source ./script/env/ensure_right_rubygems diff --git a/.travis.yml b/.travis.yml index d3c842c2c..312977956 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,26 +1,26 @@ branches: only: - 'master' - + - 'develop' + language: ruby rvm: - 1.9.3 + env: - DB=postgres BUILD_TYPE=other - DB=mysql BUILD_TYPE=other - DB=postgres BUILD_TYPE=cucumber - DB=mysql BUILD_TYPE=cucumber -before_install: - - "./script/ci/before_install.sh" bundler_args: "--without development production heroku" -before_script: "./script/ci/before.sh" -script: "bundle exec rake travis" +before_install: "./script/ci/before_install.sh" +script: "./script/ci/build.sh" notifications: irc: channels: - - 'irc.freenode.org:6667#diaspora-dev' + - "irc.freenode.org:6667#diaspora-dev" diff --git a/Changelog.md b/Changelog.md new file mode 100644 index 000000000..72a3abf4d --- /dev/null +++ b/Changelog.md @@ -0,0 +1,69 @@ +# 0.0.1.0 + +## New configuration system! + +Copy over config/diaspora.yml.example to config/diaspora.yml and migrate your settings! An updated Heroku guide including basic hints on howto migrate is [here](https://github.com/diaspora/diaspora/wiki/Installing-on-heroku). + +The new configuration system allows all possible settings to be overriden by environment variables. This makes it possible to deploy heroku without checking any credentials into git. Read the top of `config/diaspora.yml.example` for an explanation on how to convert the setting names to environment variables. + +### Environment variable changes: + +#### deprectated + +* REDISTOGO_URL in favour of REDIS_URL or ENVIRONMENT_REDIS + +#### removed + +* application_yml - Obsolete, all settings are settable via environment variables now + +#### renamed + +* SINGLE_PROCESS_MODE -> ENVIRONMENT_SINGLE_PROCESS_MODE +* SINGLE_PROCESS -> ENVIRONMENT_SINGLE_PROCESS_MODE +* NO_SSL -> ENVIRONMENT_REQUIRE_SSL +* ASSET_HOST -> ENVIRONMENT_ASSETS_HOST + + +## Gem changes + +### Updated gems + +* omniauth-tumblr 1.0 -> 1.1 +* rails_admin git -> 0.1.1 +* activerecord-import 0.2.10 -> 0.2.11 +* fog 1.4.0 -> 1.6.0 +* asset_sync 0.4.2 -> 0.5.0 +* jquery-rails 2.0.2 -> 2.1.3 + +### Removed gems + +The following gems and their related files were removed as they aren't widely enough used to justify maintenance for them by the core developers. If you use them please maintain them in your fork. + +* airbrake +* newrelic_rpm +* rpm_contrib +* heroku_san + +The following gems were removed because their are neither used in daily development or are just CLI tools that aren't required to be loaded from the code: + +* heroku +* oink +* yard + + +## Publisher + +Refactoring of the JavaScript code; it is now completely rewritten to make use of Backbone.js. +This paves the way for future improvements such as post preview or edit toolbar/help. + + +## Removal of 'beta' code + +The feature-flag on users and all the code in connection with experimental UX changes got removed/reverted. Those are the parts that became Makr.io. +The single-post view will also be revamped/reverted, but that didn't make it into this release. + + +## JS lib updates + + +## Cleanup in maintenance scripts and automated build environment diff --git a/Gemfile b/Gemfile index 3b3bbe58f..7e8ff1b65 100644 --- a/Gemfile +++ b/Gemfile @@ -1,7 +1,6 @@ source 'http://rubygems.org' gem 'bundler', '> 1.1.0' -ruby '1.9.3' if ENV['HEROKU'] gem 'rails', '3.2.8' @@ -22,7 +21,7 @@ gem 'remotipart', '1.0.2' gem 'omniauth', '1.1.1' gem 'omniauth-facebook', '1.3.0' -gem 'omniauth-tumblr', '1.0' +gem 'omniauth-tumblr', '1.1' gem 'omniauth-twitter', '0.0.11' gem 'twitter', '2.0.2' @@ -31,12 +30,9 @@ gem 'twitter', '2.0.2' gem 'markerb', :git => 'https://github.com/plataformatec/markerb.git' gem 'messagebus_ruby_api', '1.0.3' -gem 'airbrake', '3.1.0' -gem 'newrelic_rpm', '3.3.5' -gem "rpm_contrib", '2.1.11' group :production do # we don't install these on travis to speed up test runs - gem 'rails_admin', :git => 'git://github.com/halida/rails_admin.git' + gem 'rails_admin', '0.1.1' gem 'fastercsv', '1.5.5', :require => false gem 'rack-ssl', '1.3.2', :require => 'rack/ssl' gem 'rack-rewrite', '1.2.1', :require => false @@ -44,19 +40,18 @@ group :production do # we don't install these on travis to speed up test runs # analytics gem 'rack-google-analytics', '0.11.0', :require => 'rack/google-analytics' gem 'rack-piwik', '0.1.3', :require => 'rack/piwik', :require => false + end # configuration group :heroku do - gem 'pg', '0.14.1' gem 'unicorn', '4.3.1', :require => false end -gem 'settingslogic', :git => 'https://github.com/binarylogic/settingslogic.git' # database -gem "activerecord-import", "0.2.10" +gem "activerecord-import", "0.2.11" gem 'foreigner', '1.2.1' gem 'mysql2', '0.3.11' if ENV['DB'].nil? || ENV['DB'] == 'all' || ENV['DB'] == 'mysql' gem 'pg', '0.14.1' if ENV['DB'] == 'all' || ENV['DB'] == 'postgres' @@ -65,7 +60,7 @@ gem 'sqlite3' if ENV['DB'] == 'all' || ENV['DB'] == 'sqlite' # file uploading gem 'carrierwave', '0.6.2' -gem 'fog', '1.4.0' +gem 'fog', '1.6.0' gem 'mini_magick', '3.4' # JSON and API @@ -76,7 +71,7 @@ gem 'acts_as_api', '0.4.1 ' # localization gem 'i18n-inflector-rails', '~> 1.0' -gem 'rails-i18n' +gem 'rails-i18n', :git => "https://github.com/svenfuchs/rails-i18n.git" # parsing @@ -125,11 +120,10 @@ group :assets do gem 'handlebars_assets', '0.6.5' gem 'uglifier', '1.3.0' - # asset_sync is required as needed by application.rb - gem "asset_sync", '0.4.2', :require => nil + gem "asset_sync", '0.5.0', :require => false end -gem 'jquery-rails', '2.0.2' +gem 'jquery-rails', '2.1.3' # web @@ -170,13 +164,7 @@ group :test, :development do end group :development do - gem 'heroku', '2.28.12' - gem 'heroku_san', '3.0.4' gem 'capistrano', '2.12.0', :require => false gem 'capistrano_colors', '0.5.5', :require => false gem 'capistrano-ext', '1.2.1', :require => false - gem 'yard', '0.8.2.1', :require => false - - # for tracing AR object instantiation and memory usage per request - gem 'oink', '0.9.3' end diff --git a/Gemfile.lock b/Gemfile.lock index df4642cb0..62c9a45d3 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,21 +1,3 @@ -GIT - remote: git://github.com/halida/rails_admin.git - revision: 590dceb10812a9207e42dbccecd5d1031715ae80 - specs: - rails_admin (0.0.3) - bbenezech-nested_form (~> 0.0.6) - bootstrap-sass (~> 2.0, >= 2.0.3) - builder (~> 3.0) - coffee-rails (~> 3.1) - haml (~> 3.1) - jquery-rails (>= 1.0.17) - jquery-ui-rails (~> 0.2.2) - kaminari (~> 0.12) - rack-pjax (~> 0.5) - rails (~> 3.1) - remotipart (~> 1.0) - sass-rails (~> 3.1) - GIT remote: https://github.com/Empact/roxml.git revision: 7ea9a9ffd2338aaef5b04cb792060ae8c98f346a @@ -25,12 +7,6 @@ GIT activesupport (>= 2.3.0) nokogiri (>= 1.3.3) -GIT - remote: https://github.com/binarylogic/settingslogic.git - revision: 4884d455bf18d92723cb8190cfd2dbf87f3aafd5 - specs: - settingslogic (2.0.8) - GIT remote: https://github.com/plataformatec/markerb.git revision: 93b1e8bea9b8fa89ef930f78ba562f596c022198 @@ -38,6 +14,13 @@ GIT markerb (1.0.0) redcarpet (>= 2.0) +GIT + remote: https://github.com/svenfuchs/rails-i18n.git + revision: 855edc0e265a6d36fe5f62a886b2f0de455dd92a + specs: + rails-i18n (0.6.6) + i18n (~> 0.5) + GEM remote: http://rubygems.org/ specs: @@ -62,7 +45,7 @@ GEM activesupport (= 3.2.8) arel (~> 3.0.2) tzinfo (~> 0.3.29) - activerecord-import (0.2.10) + activerecord-import (0.2.11) activerecord (~> 3.0) activerecord (~> 3.0) activeresource (3.2.8) @@ -78,14 +61,10 @@ GEM activesupport (>= 3.0.0) rack (>= 1.1.0) addressable (2.3.2) - airbrake (3.1.0) - activesupport - builder arel (3.0.2) - asset_sync (0.4.2) + asset_sync (0.5.0) activemodel fog - bbenezech-nested_form (0.0.6) bcrypt-ruby (3.0.1) bootstrap-sass (2.1.0.0) builder (3.0.3) @@ -146,7 +125,7 @@ GEM diff-lcs (1.1.3) erubis (2.7.0) eventmachine (0.12.10) - excon (0.14.3) + excon (0.16.2) execjs (1.4.0) multi_json (~> 1.0) factory_girl (4.1.0) @@ -163,9 +142,9 @@ GEM fixture_builder (0.3.4) activerecord (>= 2) activesupport (>= 2) - fog (1.4.0) + fog (1.6.0) builder - excon (~> 0.14.0) + excon (~> 0.14) formatador (~> 0.2.0) mime-types multi_json (~> 1.0) @@ -204,23 +183,8 @@ GEM sprockets (>= 2.0.3) tilt hashie (1.2.0) - heroku (2.28.12) - heroku-api (~> 0.2.8) - launchy (>= 0.3.2) - netrc (~> 0.7.5) - rest-client (~> 1.6.1) - rubyzip - heroku-api (0.2.8) - excon (~> 0.14.3) - heroku_san (3.0.4) - activesupport - heroku (>= 2) - heroku-api (>= 0.1.2) - rake highline (1.6.12) hike (1.2.1) - hodel_3000_compliant_logger (0.1.0) - hpricot (0.8.6) http_accept_language (1.0.2) httpauth (0.1) i18n (0.6.1) @@ -237,20 +201,18 @@ GEM selenium-webdriver (>= 0.1.3) jasmine-core (1.2.0) journey (1.0.4) - jquery-rails (2.0.2) - railties (>= 3.2.0, < 5.0) + jquery-rails (2.1.3) + railties (>= 3.1.0, < 5.0) thor (~> 0.14) - jquery-ui-rails (0.2.2) + jquery-ui-rails (2.0.1) jquery-rails railties (>= 3.1.0) + jruby-pageant (1.1.1) json (1.7.5) - kaminari (0.13.0) + kaminari (0.14.1) actionpack (>= 3.0.0) activesupport (>= 3.0.0) - railties (>= 3.0.0) kgio (2.7.4) - launchy (2.1.2) - addressable (~> 2.3) libwebsocket (0.1.5) listen (0.4.2) rb-fchange (~> 0.0.5) @@ -270,24 +232,21 @@ GEM multi_json (1.3.6) multipart-post (1.1.5) mysql2 (0.3.11) + nested_form (0.2.3) net-scp (1.0.4) net-ssh (>= 1.99.1) net-sftp (2.0.5) net-ssh (>= 2.0.9) - net-ssh (2.5.2) + net-ssh (2.6.0) + jruby-pageant (>= 1.1.1) net-ssh-gateway (1.1.0) net-ssh (>= 1.99.1) - netrc (0.7.7) - newrelic_rpm (3.3.5) nokogiri (1.5.5) oauth (0.4.6) oauth2 (0.6.1) faraday (~> 0.7) httpauth (~> 0.1) multi_json (~> 1.3) - oink (0.9.3) - activerecord - hodel_3000_compliant_logger omniauth (1.1.1) hashie (~> 1.2) rack @@ -299,13 +258,12 @@ GEM omniauth-oauth2 (1.0.2) oauth2 (~> 0.6.0) omniauth (~> 1.0) - omniauth-tumblr (1.0) + omniauth-tumblr (1.1) omniauth-oauth (~> 1.0) omniauth-twitter (0.0.11) multi_json (~> 1.3) omniauth-oauth (~> 1.0) orm_adapter (0.4.0) - pg (0.14.1) polyglot (0.3.3) rack (1.4.1) rack-cache (1.2) @@ -316,8 +274,8 @@ GEM rack-mobile-detect (0.4.0) rack rack-piwik (0.1.3) - rack-pjax (0.5.9) - hpricot (~> 0.8.6) + rack-pjax (0.6.0) + nokogiri (~> 1.5) rack (~> 1.3) rack-protection (1.2.0) rack @@ -334,8 +292,19 @@ GEM activesupport (= 3.2.8) bundler (~> 1.0) railties (= 3.2.8) - rails-i18n (0.6.6) - i18n (~> 0.5) + rails_admin (0.1.1) + bootstrap-sass (~> 2.0) + builder (~> 3.0) + coffee-rails (~> 3.1) + haml (~> 3.1) + jquery-rails (~> 2.0) + jquery-ui-rails (~> 2.0) + kaminari (~> 0.12) + nested_form (~> 0.2.3) + rack-pjax (~> 0.5) + rails (~> 3.1) + remotipart (~> 1.0) + sass-rails (~> 3.1) rails_autolink (1.0.9) rails (~> 3.1) railties (3.2.8) @@ -366,11 +335,6 @@ GEM vegas (~> 0.1.2) resque-timeout (1.0.0) resque (~> 1.0) - rest-client (1.6.7) - mime-types (>= 1.16) - rpm_contrib (2.1.11) - newrelic_rpm (>= 3.1.1) - newrelic_rpm (>= 3.1.1) rspec (2.11.0) rspec-core (~> 2.11.0) rspec-expectations (~> 2.11.0) @@ -445,18 +409,16 @@ GEM will_paginate (3.0.3) xpath (0.1.4) nokogiri (~> 1.3) - yard (0.8.2.1) PLATFORMS ruby DEPENDENCIES - activerecord-import (= 0.2.10) + activerecord-import (= 0.2.11) acts-as-taggable-on (= 2.3.3) acts_as_api (= 0.4.1) addressable (= 2.3.2) - airbrake (= 3.1.0) - asset_sync (= 0.4.2) + asset_sync (= 0.5.0) bootstrap-sass (= 2.1.0.0) bundler (> 1.1.0) capistrano (= 2.12.0) @@ -474,7 +436,7 @@ DEPENDENCIES faraday_middleware (= 0.8.8) fastercsv (= 1.5.5) fixture_builder (= 0.3.4) - fog (= 1.4.0) + fog (= 1.6.0) foreigner (= 1.2.1) foreman (= 0.59) fuubar (= 1.0.0) @@ -484,47 +446,40 @@ DEPENDENCIES guard-spork (= 0.8.0) haml (= 3.1.7) handlebars_assets (= 0.6.5) - heroku (= 2.28.12) - heroku_san (= 3.0.4) http_accept_language (= 1.0.2) i18n-inflector-rails (~> 1.0) jasmine (= 1.2.1) - jquery-rails (= 2.0.2) + jquery-rails (= 2.1.3) json (= 1.7.5) markerb! messagebus_ruby_api (= 1.0.3) mini_magick (= 3.4) mobile-fu (= 1.1.0) mysql2 (= 0.3.11) - newrelic_rpm (= 3.3.5) nokogiri (= 1.5.5) - oink (= 0.9.3) omniauth (= 1.1.1) omniauth-facebook (= 1.3.0) - omniauth-tumblr (= 1.0) + omniauth-tumblr (= 1.1) omniauth-twitter (= 0.0.11) - pg (= 0.14.1) rack-cors (= 0.2.7) rack-google-analytics (= 0.11.0) rack-piwik (= 0.1.3) rack-rewrite (= 1.2.1) rack-ssl (= 1.3.2) rails (= 3.2.8) - rails-i18n - rails_admin! + rails-i18n! + rails_admin (= 0.1.1) rails_autolink (= 1.0.9) redcarpet (= 2.1.1) remotipart (= 1.0.2) resque (= 1.22.0) resque-timeout (= 1.0.0) roxml! - rpm_contrib (= 2.1.11) rspec-instafail (= 0.2.4) rspec-rails (= 2.11.0) ruby-oembed (= 0.8.7) sass-rails (= 3.2.5) selenium-webdriver (= 2.25.0) - settingslogic! spork (= 1.0.0rc3) thin (= 1.4.1) timecop (= 0.5.1) @@ -534,4 +489,3 @@ DEPENDENCIES unicorn (= 4.3.1) webmock (= 1.8.10) will_paginate (= 3.0.3) - yard (= 0.8.2.1) diff --git a/Procfile b/Procfile index b859a2b56..1f59ec437 100644 --- a/Procfile +++ b/Procfile @@ -1,6 +1 @@ web: bundle exec unicorn -c config/unicorn.rb -p $PORT -redis: redis-server -catchall_worker: env QUEUE=* bundle exec rake resque:work -slow_worker: env QUEUES=socket_webfinger,photos,http_service,dispatch,receive_local,mail,receive,receive_salmon,http,delete_account bundle exec rake resque:work -priority_worker: env QUEUES=socket_webfinger,photos,http_service,dispatch,mail,delete_account bundle exec rake resque:work -super_slow_worker: env QUEUE=http,receive_salmon bundle exec rake resque:work \ No newline at end of file diff --git a/README.md b/README.md index 439ddb3b4..fb0b36e19 100644 --- a/README.md +++ b/README.md @@ -2,14 +2,11 @@ Diaspora* Diaspora is a privacy-aware, personally-controlled, do-it-all open source social network. Check out our [project site](http://diasporaproject.org). -[![Build Status](https://secure.travis-ci.org/diaspora/diaspora.png?branch=master)](http://travis-ci.org/diaspora/diaspora) -[![Dependency Status](https://gemnasium.com/diaspora/diaspora.png?travis)](https://gemnasium.com/diaspora/diaspora) -[![Code Climate](https://codeclimate.com/badge.png)](https://codeclimate.com/github/diaspora/diaspora) +* **master:** [![Build Status master](https://secure.travis-ci.org/diaspora/diaspora.png?branch=master)](http://travis-ci.org/diaspora/diaspora) +* **develop:** [![Build Status develop](https://secure.travis-ci.org/diaspora/diaspora.png?branch=develop)](http://travis-ci.org/diaspora/diaspora) +* [![Dependency Status](https://gemnasium.com/diaspora/diaspora.png?travis)](https://gemnasium.com/diaspora/diaspora) +* [![Code Climate](https://codeclimate.com/badge.png)](https://codeclimate.com/github/diaspora/diaspora) -************************ -Diaspora is currently going through a huge refactoring push, the code is changing fast! -If you want to do something big, reach out on IRC or the mailing list first, so you can contribute effectively <3333 -************************ With Diaspora you can: diff --git a/app/assets/javascripts/app/views/publisher/aspects_selector.js b/app/assets/javascripts/app/views/publisher/aspects_selector.js new file mode 100644 index 000000000..ecb2c5764 --- /dev/null +++ b/app/assets/javascripts/app/views/publisher/aspects_selector.js @@ -0,0 +1,62 @@ +/* Copyright (c) 2010-2012, Diaspora Inc. This file is + * licensed under the Affero General Public License version 3 or later. See + * the COPYRIGHT file. + */ + +(function(){ + // mixin-object, used in conjunction with the publisher to provide the + // functionality for selecting aspects + app.views.PublisherAspectsSelector = { + + // event handler for aspect selection + toggleAspect: function(evt) { + var el = $(evt.target); + var btn = el.parent('.dropdown').find('.button'); + + // visually toggle the aspect selection + if( el.is('.radio') ) { + AspectsDropdown.toggleRadio(el); + } else { + AspectsDropdown.toggleCheckbox(el); + } + + // update the selection summary + AspectsDropdown.updateNumber( + el.closest(".dropdown_list"), + null, + el.parent().find('li.selected').length, + '' + ); + + this._updateSelectedAspectIds(); + }, + + // take care of the form fields that will indicate the selected aspects + _updateSelectedAspectIds: function() { + var self = this; + + // remove previous selection + this.$('input[name="aspect_ids[]"]').remove(); + + // create fields for current selection + this.$('.dropdown .dropdown_list li.selected').each(function() { + var el = $(this); + var aspectId = el.data('aspect_id'); + + self._addHiddenAspectInput(aspectId); + + // close the dropdown when a radio item was selected + if( el.is('.radio') ) { + el.closest('.dropdown').removeClass('active'); + } + }); + }, + + _addHiddenAspectInput: function(id) { + var uid = _.uniqueId('aspect_ids_'); + this.$('.content_creation form').append( + '' + ); + } + }; +})(); \ No newline at end of file diff --git a/app/assets/javascripts/app/views/publisher/getting_started.js b/app/assets/javascripts/app/views/publisher/getting_started.js new file mode 100644 index 000000000..815f05585 --- /dev/null +++ b/app/assets/javascripts/app/views/publisher/getting_started.js @@ -0,0 +1,65 @@ +/* Copyright (c) 2010-2012, Diaspora Inc. This file is + * licensed under the Affero General Public License version 3 or later. See + * the COPYRIGHT file. + */ + +(function(){ + // mixin-object, used in conjunction with the publisher to provide the + // functionality for displaying 'getting-started' information + app.views.PublisherGettingStarted = { + + // initiate all the popover message boxes + triggerGettingStarted: function() { + this._addPopover(this.el_input, { + trigger: 'manual', + offset: 30, + id: 'first_message_explain', + placement: 'right', + html: true + }, 600); + this._addPopover(this.$('.dropdown'), { + trigger: 'manual', + offset: 10, + id: 'message_visibility_explain', + placement: 'bottom', + html: true + }, 1000); + this._addPopover($('#gs-shim'), { + trigger: 'manual', + offset: -5, + id: 'stream_explain', + placement: 'left', + html: true + }, 1400); + + // hide some popovers when a post is created + this.$('.button.creation').click(function() { + this.$('.dropdown').popover('hide'); + this.el_input.popover('hide'); + }); + }, + + _addPopover: function(el, opts, timeout) { + el.popover(opts); + el.click(function() { + el.popover('hide'); + }); + + // show the popover after the given timeout + setTimeout(function() { + el.popover('show'); + + // disable 'getting started' when the last popover is closed + var popup = el.data('popover').$tip[0]; + var close = $(popup).find('.close'); + + close.click(function() { + if( $('.popover').length==1 ) { + $.get('/getting_started_completed'); + } + el.popover('hide'); + }); + }, timeout); + } + }; +})(); \ No newline at end of file diff --git a/app/assets/javascripts/app/views/publisher/services.js b/app/assets/javascripts/app/views/publisher/services.js new file mode 100644 index 000000000..f8f250093 --- /dev/null +++ b/app/assets/javascripts/app/views/publisher/services.js @@ -0,0 +1,51 @@ +/* Copyright (c) 2010-2012, Diaspora Inc. This file is + * licensed under the Affero General Public License version 3 or later. See + * the COPYRIGHT file. + */ + +(function(){ + // mixin-object, used in conjunction with the publisher to provide the + // functionality for selecting services for cross-posting + app.views.PublisherServices = { + + // visually toggle the icon and kick-off all other actions for cross-posting + toggleService: function(evt) { + var el = $(evt.target); + var provider = el.attr('id'); + + el.toggleClass("dim"); + + this._createCounter(); + this._toggleServiceField(provider); + }, + + // keep track of character count + _createCounter: function() { + // remove obsolete counter + this.$('.counter').remove(); + + // create new counter + var min = 40000; + var a = this.$('.service_icon:not(.dim)'); + if(a.length > 0){ + $.each(a, function(index, value){ + var num = parseInt($(value).attr('maxchar')); + if (min > num) { min = num; } + }); + this.el_input.charCount({allowed: min, warning: min/10 }); + } + }, + + // add or remove the input containing the selected service + _toggleServiceField: function(provider) { + var hidden_field = this.$('input[name="services[]"][value="'+provider+'"]'); + if(hidden_field.length > 0){ + hidden_field.remove(); + } else { + var uid = _.uniqueId('services_'); + this.$(".content_creation form").append( + ''); + } + } + }; +})(); \ No newline at end of file diff --git a/app/assets/javascripts/app/views/publisher_view.js b/app/assets/javascripts/app/views/publisher_view.js index 24b61ff7f..c8c952f24 100644 --- a/app/assets/javascripts/app/views/publisher_view.js +++ b/app/assets/javascripts/app/views/publisher_view.js @@ -1,19 +1,57 @@ -//this file is the scary no-no-zone bad-touch of our backbone code. -//after re-writing/eliminating the existing Publisher let's re-write -//this with PANACHE! <333 Dennis +/* Copyright (c) 2010-2012, Diaspora Inc. This file is + * licensed under the Affero General Public License version 3 or later. See + * the COPYRIGHT file. + */ + +//= require ./publisher/services +//= require ./publisher/aspects_selector +//= require ./publisher/getting_started + +app.views.Publisher = Backbone.View.extend(_.extend( + app.views.PublisherServices, + app.views.PublisherAspectsSelector, + app.views.PublisherGettingStarted, { -app.views.Publisher = Backbone.View.extend({ - el : "#publisher", events : { "focus textarea" : "open", "click #hide_publisher" : "clear", - "submit form" : "createStatusMessage" + "submit form" : "createStatusMessage", + "click .service_icon": "toggleService", + "textchange #status_message_fake_text": "handleTextchange", + "click .dropdown .dropdown_list li": "toggleAspect" }, initialize : function(){ - this.collection = this.collection //takes a Posts collection + // init shortcut references to the various elements + this.el_input = this.$('#status_message_fake_text'); + this.el_hiddenInput = this.$('#status_message_text'); + this.el_wrapper = this.$('#publisher_textarea_wrapper'); + this.el_submit = this.$('input[type=submit]'); + this.el_photozone = this.$('#photodropzone'); + + // init mentions plugin + Mentions.initialize(this.el_input); + + // init autoresize plugin + this.el_input.autoResize({ 'extraSpace' : 10, 'maxHeight' : Infinity }); + + // sync textarea content + if( this.el_hiddenInput.val() == "" ) { + this.el_hiddenInput.val( this.el_input.val() ); + } + + // hide close button, in case publisher is standalone + // (e.g. bookmarklet, mentions popup) + if( this.options.standalone ) { + this.$('#hide_publisher').hide(); + } + + // this has to be here, otherwise for some reason the callback for the + // textchange event won't be called in Backbone... + this.el_input.bind('textchange', $.noop); + return this; }, @@ -49,36 +87,72 @@ app.views.Publisher = Backbone.View.extend({ }, clear : function() { - this.$('textarea').val(""); - this.$('#publisher_textarea_wrapper').removeClass("with_attachments"); + // clear text(s) + this.el_input.val(''); + this.el_hiddenInput.val(''); + + // remove mentions + this.el_input.mentionsInput('reset'); // remove photos - this.$("#photodropzone").find('li').remove(); + this.el_photozone.find('li').remove(); this.$("input[name='photos[]']").remove(); + this.el_wrapper.removeClass("with_attachments"); // close publishing area (CSS) this.close(); - Publisher.clear() + // disable submitting + this.checkSubmitAvailability(); return this; }, open : function() { - $(this.el).removeClass('closed'); - this.$("#publisher_textarea_wrapper").addClass('active'); + // visually 'open' the publisher + this.$el.removeClass('closed'); + this.el_wrapper.addClass('active'); + + // fetch contacts for mentioning + Mentions.fetchContacts(); return this; }, close : function() { $(this.el).addClass("closed"); - this.$("#publisher_textarea_wrapper").removeClass("active"); - this.$("textarea").css('height', ''); + this.el_wrapper.removeClass("active"); + this.el_input.css('height', ''); return this; + }, + + checkSubmitAvailability: function() { + if( this._submittable() ) { + this.el_submit.removeAttr('disabled'); + } else { + this.el_submit.attr('disabled','disabled'); + } + }, + + // determine submit availability + _submittable: function() { + var onlyWhitespaces = ($.trim(this.el_input.val()) === ''), + isPhotoAttached = (this.el_photozone.children().length > 0); + + return (!onlyWhitespaces || isPhotoAttached); + }, + + handleTextchange: function() { + var self = this; + + this.checkSubmitAvailability(); + this.el_input.mentionsInput("val", function(value){ + self.el_hiddenInput.val(value); + }); } -}); + +})); // jQuery helper for serializing a
into JSON $.fn.serializeObject = function() diff --git a/app/assets/javascripts/app/views/stream_post_views.js b/app/assets/javascripts/app/views/stream_post_views.js index b69632bbf..5a3c970ba 100644 --- a/app/assets/javascripts/app/views/stream_post_views.js +++ b/app/assets/javascripts/app/views/stream_post_views.js @@ -61,7 +61,7 @@ app.views.StreamPost = app.views.Post.extend({ blockUser: function(evt){ if(evt) { evt.preventDefault(); } - if(!confirm("Ignore this user?")) { return } + if(!confirm(Diaspora.I18n.t('ignore_user'))) { return } var personId = this.model.get("author").id; var block = new app.models.Block(); @@ -107,4 +107,4 @@ app.views.StreamPost = app.views.Post.extend({ return this; } -}) \ No newline at end of file +}) diff --git a/app/assets/javascripts/aspects-dropdown.js b/app/assets/javascripts/aspects-dropdown.js index 61f035d17..50ee48fab 100644 --- a/app/assets/javascripts/aspects-dropdown.js +++ b/app/assets/javascripts/aspects-dropdown.js @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2011, Diaspora Inc. This file is +// Copyright (c) 2010-2012, Diaspora Inc. This file is // licensed under the Affero General Public License version 3 or later. See // the COPYRIGHT file. diff --git a/app/assets/javascripts/home.js b/app/assets/javascripts/home.js index 7eb2db874..e53601da1 100644 --- a/app/assets/javascripts/home.js +++ b/app/assets/javascripts/home.js @@ -2,7 +2,7 @@ * licensed under the Affero General Public License version 3 or later. See * the COPYRIGHT file. */ -//= require publisher + //= require jquery.textchange //= require aspect-edit-pane //= require fileuploader-custom \ No newline at end of file diff --git a/app/assets/javascripts/publisher.js b/app/assets/javascripts/publisher.js deleted file mode 100644 index 40eeb4580..000000000 --- a/app/assets/javascripts/publisher.js +++ /dev/null @@ -1,221 +0,0 @@ -/* Copyright (c) 2010-2011, Diaspora Inc. This file is - * licensed under the Affero General Public License version 3 or later. See - * the COPYRIGHT file. - */ - -//TODO: make this a widget -var Publisher = { - bookmarklet : false, - - form: function(){ - return Publisher.cachedForm = Publisher.cachedForm || $('#publisher'); - }, - - input: function(){ - return Publisher.cachedInput = Publisher.cachedInput || Publisher.form().find('#status_message_fake_text'); - }, - - wrapper: function(){ - return Publisher.cachedWrapper = Publisher.cachedWrapper || Publisher.form().find('#publisher_textarea_wrapper'); - }, - - hiddenInput: function(){ - return Publisher.cachedHiddenInput= Publisher.cachedHiddenInput || Publisher.form().find('#status_message_text'); - }, - - submit: function(){ - return Publisher.cachedSubmit = Publisher.cachedSubmit || Publisher.form().find("input[type='submit']"); - }, - - determineSubmitAvailability: function(){ - var onlyWhitespaces = ($.trim(Publisher.input().val()) === ''), - isSubmitDisabled = Publisher.submit().attr('disabled'), - isPhotoAttached = ($("#photodropzone").children().length > 0); - - if ((onlyWhitespaces && !isPhotoAttached) && !isSubmitDisabled) { - Publisher.submit().attr('disabled', 'disabled'); - } else if ((!onlyWhitespaces || isPhotoAttached) && isSubmitDisabled) { - Publisher.submit().removeAttr('disabled'); - } - }, - - clear: function(){ - $("#photodropzone").find('li').remove(); - Publisher.input().mentionsInput("reset"); - Publisher.wrapper().removeClass("with_attachments"); - Publisher.hiddenInput().val(''); - Publisher.determineSubmitAvailability() - }, - - bindServiceIcons: function(){ - $(".service_icon").bind("click", function(evt){ - $(this).toggleClass("dim"); - Publisher.toggleServiceField($(this)); - }); - }, - - toggleServiceField: function(service){ - Publisher.createCounter(service); - - var provider = service.attr('id'); - var hidden_field = $('#publisher [name="services[]"][value="'+provider+'"]'); - if(hidden_field.length > 0){ - hidden_field.remove(); - } else { - $("#publisher .content_creation form").append( - ''); - } - }, - - isPublicPost: function(){ - return $('#publisher [name="aspect_ids[]"]').first().val() == "public"; - }, - - isToAllAspects: function(){ - return $('#publisher [name="aspect_ids[]"]').first().val() == "all_aspects"; - }, - - selectedAspectIds: function() { - var aspects = $('#publisher [name="aspect_ids[]"]'); - var aspectIds = []; - aspects.each(function() { aspectIds.push( parseInt($(this).attr('value'))); }); - return aspectIds; - }, - - removeRadioSelection: function(hiddenFields){ - $.each(hiddenFields, function(index, value){ - var el = $(value); - - if(el.val() == "all_aspects" || el.val() == "public") { - el.remove(); - } - }); - }, - - toggleAspectIds: function(li) { - var aspectId = li.attr('data-aspect_id'), - hiddenFields = $('#publisher [name="aspect_ids[]"]'), - appendId = function(){ - $("#publisher .content_creation form").append( - ''); - }; - - if(li.hasClass('radio')){ - $.each(hiddenFields, function(index, value){ - $(value).remove(); - }); - appendId(); - - // close dropdown after selecting a binary option - li.closest('.dropdown').removeClass('active'); - - } else { - var hiddenField = $('#publisher [name="aspect_ids[]"][value="'+aspectId+'"]'); - - // remove all radio selections - Publisher.removeRadioSelection(hiddenFields); - - if(hiddenField.length > 0){ - hiddenField.remove(); - } else { - appendId(); - } - } - }, - - createCounter: function(service){ - var counter = $("#publisher .counter"); - counter.remove(); - - var min = 40000; - var a = $('.service_icon:not(.dim)'); - if(a.length > 0){ - $.each(a, function(index, value){ - var num = parseInt($(value).attr('maxchar')); - if (min > num) { min = num; } - }); - $('#status_message_fake_text').charCount({allowed: min, warning: min/10 }); - } - }, - - bindAspectToggles: function() { - $('#publisher .dropdown .dropdown_list li').bind("click", function(evt){ - var li = $(this), - button = li.parent('.dropdown').find('.button'); - - if(li.hasClass('radio')){ - AspectsDropdown.toggleRadio(li); - } else { - AspectsDropdown.toggleCheckbox(li); - } - - AspectsDropdown.updateNumber(li.closest(".dropdown_list"), null, li.parent().find('li.selected').length, ''); - - Publisher.toggleAspectIds(li); - }); - }, - - textChange : function(){ - Publisher.determineSubmitAvailability(); - Publisher.input().mentionsInput("val", function(value) { - Publisher.hiddenInput().val(value); - }); - }, - - triggerGettingStarted: function(){ - Publisher.setUpPopovers("#publisher .dropdown", {trigger: 'manual', offset: 10, id: "message_visibility_explain", placement:'bottom', html:true}, 1000); - Publisher.setUpPopovers("#publisher #status_message_fake_text", {trigger: 'manual', placement: 'right', offset: 30, id: "first_message_explain", html:true}, 600); - Publisher.setUpPopovers("#gs-shim", {trigger: 'manual', placement: 'left', id:"stream_explain", offset: -5, html:true}, 1400); - - $("#publisher .button.creation").bind("click", function(){ - $("#publisher .dropdown").popover("hide"); - $("#publisher #status_message_fake_text").popover("hide"); - }); - }, - - setUpPopovers: function(selector, options, timeout){ - var selection = $(selector); - selection.popover(options); - selection.bind("click", function(){$(this).popover("hide")}); - - setTimeout(function(){ - selection.popover("show"); - - var popup = selection.data('popover').$tip[0], - closeIcon = $(popup).find(".close"); - - closeIcon.bind("click",function(){ - if($(".popover").length == 1){ - $.get("/getting_started_completed"); - }; - selection.popover("hide"); - }); - }, timeout); - }, - - initialize: function() { - Publisher.cachedForm = Publisher.cachedSubmit = - Publisher.cachedInput = Publisher.cachedHiddenInput = false; - - Publisher.bindServiceIcons(); - Publisher.bindAspectToggles(); - - Mentions.initialize(Publisher.input()); - - Publisher.input().bind("focus", function(){ - Mentions.fetchContacts(); - }) - - if(Publisher.hiddenInput().val() === "") { - Publisher.hiddenInput().val(Publisher.input().val()); - } - - Publisher.input().autoResize({ 'extraSpace' : 10, 'maxHeight' : Infinity }); - Publisher.input().bind('textchange', Publisher.textChange); - } -}; - -$(document).ready(function() { - Publisher.initialize(); - Diaspora.page.subscribe("stream/reloaded", Publisher.initialize); -}); diff --git a/app/assets/stylesheets/new_styles/_base.scss b/app/assets/stylesheets/new_styles/_base.scss index 3dc3432a8..ccca93cb6 100644 --- a/app/assets/stylesheets/new_styles/_base.scss +++ b/app/assets/stylesheets/new_styles/_base.scss @@ -319,6 +319,42 @@ $bring-dark-accent-forward-color: #DDD; } } +.profile-image-container { + border-radius: 140px; + border : 3px solid #fff; + box-shadow : 0 0 2px rgba(0,0,0,0.5), 0 0 10px rgba(0,0,0,0.6), inset 0 0 15px rgba(0,0,0,0.5), inset 0 -2px 4px rgba(255,255,255,0.3); + background-size: cover; + + height : 140px; + width : 140px; + background : { + position : center; + image : image-url('user/default.png'); + } + + display : inline-block; + + margin-bottom : 5px; + + &.small { + height : 40px; + width : 40px; + border : 2px solid #fff; + } + + &.smaller { + height : 34px; + width : 34px; + border : 2px solid #ccc; + } + + &.micro { + height : 24px; + width : 24px; + border : 2px solid #fff; + } +} + /* responsive */ @media (max-width: 767px) { body { diff --git a/app/assets/stylesheets/new_styles/_interactions.scss b/app/assets/stylesheets/new_styles/_interactions.scss index 93b97a031..c4d87c1a6 100644 --- a/app/assets/stylesheets/new_styles/_interactions.scss +++ b/app/assets/stylesheets/new_styles/_interactions.scss @@ -87,6 +87,7 @@ textarea{ height: 18px; width: 318px; + padding: 4px; } form { @@ -97,6 +98,9 @@ position: absolute; right: 10px; bottom: 10px; + font-size: 11px; + line-height: 16px; + padding: 5px 9px; } } } @@ -336,4 +340,4 @@ margin-top : 9px; margin-right : -5px; margin-left : 4px; -} \ No newline at end of file +} diff --git a/app/assets/stylesheets/ui.css.sass b/app/assets/stylesheets/ui.css.sass index 3fcfebeaf..feb3506f1 100644 --- a/app/assets/stylesheets/ui.css.sass +++ b/app/assets/stylesheets/ui.css.sass @@ -119,7 +119,7 @@ input.button > li :font-size 11px !important - :padding 3px 2px + :padding 6px 2px :left 24px :position relative :color #222 @@ -195,8 +195,8 @@ input.button :top 1px solid #444 :bottom 1px solid #444 :padding - :top 2px - :bottom 2px + :top 5px + :bottom 5px &.divider :padding diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index d583f0ceb..b6aaf97f8 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -8,7 +8,7 @@ class ApplicationController < ActionController::Base before_filter :ensure_http_referer_is_set before_filter :set_locale - before_filter :set_git_header if (AppConfig[:git_update] && AppConfig[:git_revision]) + before_filter :set_diaspora_header before_filter :set_grammatical_gender before_filter :mobile_switch @@ -61,9 +61,13 @@ class ApplicationController < ActionController::Base params[:page] = params[:page] ? params[:page].to_i : 1 end - def set_git_header - headers['X-Git-Update'] = AppConfig[:git_update] if AppConfig[:git_update].present? - headers['X-Git-Revision'] = AppConfig[:git_revision] if AppConfig[:git_revision].present? + def set_diaspora_header + headers['X-Diaspora-Version'] = AppConfig.version_string + + if AppConfig.git_available? + headers['X-Git-Update'] = AppConfig.git_update if AppConfig.git_update.present? + headers['X-Git-Revision'] = AppConfig.git_revision if AppConfig.git_revision.present? + end end def set_locale @@ -86,7 +90,7 @@ class ApplicationController < ActionController::Base def set_grammatical_gender if (user_signed_in? && I18n.inflector.inflected_locale?) - gender = current_user.profile.gender.to_s.tr('!()[]"\'`*=|/\#.,-:', '').downcase + gender = current_user.gender.to_s.tr('!()[]"\'`*=|/\#.,-:', '').downcase unless gender.empty? i_langs = I18n.inflector.inflected_locales(:gender) i_langs.delete I18n.locale diff --git a/app/controllers/conversations_controller.rb b/app/controllers/conversations_controller.rb index 998fddae6..c4eae4a5d 100644 --- a/app/controllers/conversations_controller.rb +++ b/app/controllers/conversations_controller.rb @@ -5,10 +5,10 @@ class ConversationsController < ApplicationController def index @conversations = Conversation.joins(:conversation_visibilities).where( - :conversation_visibilities => {:person_id => current_user.person.id}).paginate( + :conversation_visibilities => {:person_id => current_user.person_id}).paginate( :page => params[:page], :per_page => 15, :order => 'updated_at DESC') - @visibilities = ConversationVisibility.where(:person_id => current_user.person.id).paginate( + @visibilities = ConversationVisibility.where(:person_id => current_user.person_id).paginate( :page => params[:page], :per_page => 15, :order => 'updated_at DESC') @unread_counts = {} @@ -18,7 +18,7 @@ class ConversationsController < ApplicationController @conversations.each { |c| @authors[c.id] = c.last_author } @conversation = Conversation.joins(:conversation_visibilities).where( - :conversation_visibilities => {:person_id => current_user.person.id, :conversation_id => params[:conversation_id]}).first + :conversation_visibilities => {:person_id => current_user.person_id, :conversation_id => params[:conversation_id]}).first respond_with do |format| format.html @@ -31,7 +31,7 @@ class ConversationsController < ApplicationController contact.person_id end - params[:conversation][:participant_ids] = person_ids | [current_user.person.id] + params[:conversation][:participant_ids] = person_ids | [current_user.person_id] params[:conversation][:author] = current_user.person message_text = params[:conversation].delete(:text) params[:conversation][:messages_attributes] = [ {:author => current_user.person, :text => message_text }] @@ -52,7 +52,7 @@ class ConversationsController < ApplicationController def show if @conversation = Conversation.joins(:conversation_visibilities).where(:id => params[:id], - :conversation_visibilities => {:person_id => current_user.person.id}).first + :conversation_visibilities => {:person_id => current_user.person_id}).first if @visibility = ConversationVisibility.where(:conversation_id => params[:id], :person_id => current_user.person.id).first @visibility.unread = 0 @visibility.save diff --git a/app/controllers/invitations_controller.rb b/app/controllers/invitations_controller.rb index 2ea2e4c05..a73d7c5b1 100644 --- a/app/controllers/invitations_controller.rb +++ b/app/controllers/invitations_controller.rb @@ -55,7 +55,7 @@ class InvitationsController < ApplicationController end def check_if_invites_open - unless AppConfig[:open_invitations] + unless AppConfig.settings.invitations.open? flash[:error] = I18n.t 'invitations.create.no_more' redirect_to :back diff --git a/app/controllers/messages_controller.rb b/app/controllers/messages_controller.rb index e327fff48..5efed70d4 100644 --- a/app/controllers/messages_controller.rb +++ b/app/controllers/messages_controller.rb @@ -11,7 +11,7 @@ class MessagesController < ApplicationController def create cnv = Conversation.joins(:conversation_visibilities).where(:id => params[:conversation_id], - :conversation_visibilities => {:person_id => current_user.person.id}).first + :conversation_visibilities => {:person_id => current_user.person_id}).first if cnv message = Message.new(:conversation_id => cnv.id, :text => params[:message][:text], :author => current_user.person) diff --git a/app/controllers/people_controller.rb b/app/controllers/people_controller.rb index 7ba5e2790..750799a14 100644 --- a/app/controllers/people_controller.rb +++ b/app/controllers/people_controller.rb @@ -83,7 +83,7 @@ class PeopleController < ApplicationController def show @person = Person.find_from_guid_or_username(params) - raise(ActiveRecord::RecordNotFound) if remote_profile_with_no_user_session? + authenticate_user! if remote_profile_with_no_user_session? return redirect_to :back, :notice => t("people.show.closed_account") if @person.closed_account? @post_type = :all diff --git a/app/controllers/photos_controller.rb b/app/controllers/photos_controller.rb index a419bccb0..319bb5187 100644 --- a/app/controllers/photos_controller.rb +++ b/app/controllers/photos_controller.rb @@ -58,7 +58,7 @@ class PhotosController < ApplicationController end def make_profile_photo - author_id = current_user.person.id + author_id = current_user.person_id @photo = Photo.where(:id => params[:photo_id], :author_id => author_id).first if @photo diff --git a/app/controllers/profiles_controller.rb b/app/controllers/profiles_controller.rb index b83929ae6..3f8211f0c 100644 --- a/app/controllers/profiles_controller.rb +++ b/app/controllers/profiles_controller.rb @@ -42,7 +42,7 @@ class ProfilesController < ApplicationController @profile_attrs[:nsfw] ||= false if params[:photo_id] - @profile_attrs[:photo] = Photo.where(:author_id => current_user.person.id, :id => params[:photo_id]).first + @profile_attrs[:photo] = Photo.where(:author_id => current_user.person_id, :id => params[:photo_id]).first end if current_user.update_profile(@profile_attrs) diff --git a/app/controllers/publics_controller.rb b/app/controllers/publics_controller.rb index e1d22fd31..4ce1e044f 100644 --- a/app/controllers/publics_controller.rb +++ b/app/controllers/publics_controller.rb @@ -9,12 +9,6 @@ class PublicsController < ApplicationController require Rails.root.join('lib', 'postzord', 'receiver', 'private') include Diaspora::Parser - # We use newrelic_ignore to prevent artifical RPM bloat; however, - # I am commenting this line out for the time being to debug some apparent - # issues on Heroku. - # - # newrelic_ignore if EnvironmentConfiguration.using_new_relic? - skip_before_filter :set_header_data skip_before_filter :set_grammatical_gender before_filter :check_for_xml, :only => [:receive, :receive_public] diff --git a/app/controllers/registrations_controller.rb b/app/controllers/registrations_controller.rb index 76cef3be5..da18aeaa7 100644 --- a/app/controllers/registrations_controller.rb +++ b/app/controllers/registrations_controller.rb @@ -31,7 +31,7 @@ class RegistrationsController < Devise::RegistrationsController private def check_valid_invite! - return true unless AppConfig[:registrations_closed] #this sucks + return true if AppConfig.settings.enable_registrations? #this sucks return true if invite && invite.can_be_used? flash[:error] = t('registrations.invalid_invite') redirect_to new_user_session_path @@ -39,7 +39,7 @@ class RegistrationsController < Devise::RegistrationsController def check_registrations_open_or_vaild_invite! return true if invite.present? - if AppConfig[:registrations_closed] + unless AppConfig.settings.enable_registrations? flash[:error] = t('registrations.closed') redirect_to new_user_session_path end diff --git a/app/controllers/reshares_controller.rb b/app/controllers/reshares_controller.rb index 01bedc286..25ea951f3 100644 --- a/app/controllers/reshares_controller.rb +++ b/app/controllers/reshares_controller.rb @@ -6,7 +6,7 @@ class ResharesController < ApplicationController @reshare = current_user.build_post(:reshare, :root_guid => params[:root_guid]) if @reshare.save current_user.add_to_streams(@reshare, current_user.aspects) - current_user.dispatch_post(@reshare, :url => post_url(@reshare), :additional_subscribers => @reshare.root.author) + current_user.dispatch_post(@reshare, :url => post_url(@reshare), :additional_subscribers => @reshare.root_author) end render :json => ExtremePostPresenter.new(@reshare, current_user), :status => 201 diff --git a/app/controllers/services_controller.rb b/app/controllers/services_controller.rb index ff96d36b0..84c097b12 100644 --- a/app/controllers/services_controller.rb +++ b/app/controllers/services_controller.rb @@ -33,9 +33,9 @@ class ServicesController < ApplicationController current_user.services << service if service.persisted? - fetch_photo = current_user.person.profile[:image_url].blank? + fetch_photo = current_user.profile[:image_url].blank? - current_user.update_profile(current_user.person.profile.from_omniauth_hash(user)) + current_user.update_profile(current_user.profile.from_omniauth_hash(user)) Resque.enqueue(Jobs::FetchProfilePhoto, current_user.id, service.id, user["image"]) if fetch_photo flash[:notice] = I18n.t 'services.create.success' @@ -44,7 +44,7 @@ class ServicesController < ApplicationController if existing_service = Service.where(:type => service.type.to_s, :uid => service.uid).first flash[:error] << I18n.t('services.create.already_authorized', - :diaspora_id => existing_service.user.person.profile.diaspora_handle, + :diaspora_id => existing_service.user.profile.diaspora_handle, :service_name => provider.camelize ) end end @@ -65,4 +65,4 @@ class ServicesController < ApplicationController redirect_to services_url end -end \ No newline at end of file +end diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index fecdfb1d3..fe25b7717 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -101,7 +101,7 @@ class UsersController < ApplicationController if @user = User.find_by_username(params[:username]) respond_to do |format| format.atom do - @posts = StatusMessage.where(:author_id => @user.person.id, :public => true).order('created_at DESC').limit(25) + @posts = StatusMessage.where(:author_id => @user.person_id, :public => true).order('created_at DESC').limit(25) end format.any { redirect_to person_path(@user.person) } @@ -140,7 +140,7 @@ class UsersController < ApplicationController username = params[:username].split('@')[0] user = User.find_by_username(username) if user.present? - redirect_to user.profile.image_url + redirect_to user.image_url else render :nothing => true, :status => 404 end diff --git a/app/helpers/analytics_helper.rb b/app/helpers/analytics_helper.rb index f49d3331f..1a17d3c9c 100644 --- a/app/helpers/analytics_helper.rb +++ b/app/helpers/analytics_helper.rb @@ -9,7 +9,7 @@ module AnalyticsHelper <<-JS.html_safe (function(d,c){var a,b,g,e;a=d.createElement('script');a.type='text/javascript';a.async=!0;a.src=('https:'===d.location.protocol?'https:':'http:')+'//api.mixpanel.com/site_media/js/api/mixpanel.2.js';b=d.getElementsByTagName('script')[0];b.parentNode.insertBefore(a,b);c._i=[];c.init=function(a,d,f){var b=c;'undefined'!==typeof f?b=c[f]=[]:f='mixpanel';g='disable track track_pageview track_links track_forms register register_once unregister identify name_tag set_config'.split(' '); for(e=0;e 'destroy', :id => 42, :aspect_id => @aspect.id, - :person_id => contact.person.id + :person_id => contact.person_id }, - :title => t('.remove_person_from_aspect', :person_name => contact.person.first_name, :aspect_name => @aspect.name), + :title => t('.remove_person_from_aspect', :person_name => contact.person_first_name, :aspect_name => @aspect.name), :method => 'delete') else @@ -17,4 +17,4 @@ module ContactsHelper :current_user => current_user } end end -end \ No newline at end of file +end diff --git a/app/helpers/invitation_codes_helper.rb b/app/helpers/invitation_codes_helper.rb index cb7c93cbf..d4bf88abb 100644 --- a/app/helpers/invitation_codes_helper.rb +++ b/app/helpers/invitation_codes_helper.rb @@ -4,7 +4,7 @@ module InvitationCodesHelper content_tag(:div, :class => 'media well') do person_image_link(invite.user.person, :class => 'img') + content_tag(:div, :class => 'bd') do - I18n.translate('invitation_codes.excited', :name => invite.user.name) + I18n.translate('invitation_codes.excited', :name => invite.user_name) end end end diff --git a/app/helpers/layout_helper.rb b/app/helpers/layout_helper.rb index 8eb325fdd..8e6983ce1 100644 --- a/app/helpers/layout_helper.rb +++ b/app/helpers/layout_helper.rb @@ -20,7 +20,7 @@ module LayoutHelper end def set_asset_host - path = ENV['ASSET_HOST'].to_s + '/assets/' + path = AppConfig.environment.assets.host.to_s + '/assets/' content_tag(:script) do <<-JS.html_safe if(window.app) app.baseImageUrl("#{path}") diff --git a/app/helpers/mobile_helper.rb b/app/helpers/mobile_helper.rb index eb58f2fbb..439410481 100644 --- a/app/helpers/mobile_helper.rb +++ b/app/helpers/mobile_helper.rb @@ -8,11 +8,11 @@ module MobileHelper if (post.public? || reshare?(post)) && (user_signed_in? && post.author != current_user.person) root = reshare?(post) ? post.root : post - if root.author != current_user.person.id - reshare = Reshare.where(:author_id => current_user.person.id, + if root.author != current_user.person_id + reshare = Reshare.where(:author_id => current_user.person_id, :root_guid => root.guid).first klass = reshare.present? ? "active" : "inactive" - link_to '', reshares_path(:root_guid => root.guid), :title => t('reshares.reshare.reshare_confirmation', :author => root.author.name), :class => "image_link reshare_action #{klass}" + link_to '', reshares_path(:root_guid => root.guid), :title => t('reshares.reshare.reshare_confirmation', :author => root.author_name), :class => "image_link reshare_action #{klass}" end end end diff --git a/app/helpers/notifications_helper.rb b/app/helpers/notifications_helper.rb index 6f25e8cc8..6f69ac3be 100644 --- a/app/helpers/notifications_helper.rb +++ b/app/helpers/notifications_helper.rb @@ -13,7 +13,7 @@ module NotificationsHelper end elsif note.instance_of?(Notifications::CommentOnPost) || note.instance_of?(Notifications::AlsoCommented) || note.instance_of?(Notifications::Reshared) || note.instance_of?(Notifications::Liked) if post = note.linked_object - translation(target_type, :actors => actors, :count => actors_count, :post_author => h(post.author.name), :post_link => link_to(t('notifications.post'), post_path(post), 'data-ref' => post.id, :class => 'hard_object_link').html_safe) + translation(target_type, :actors => actors, :count => actors_count, :post_author => h(post.author_name), :post_link => link_to(t('notifications.post'), post_path(post), 'data-ref' => post.id, :class => 'hard_object_link').html_safe) else t(note.deleted_translation_key, :actors => actors, :count => actors_count).html_safe end diff --git a/app/helpers/open_graph_helper.rb b/app/helpers/open_graph_helper.rb index f9e3f3b1d..a9fd791a2 100644 --- a/app/helpers/open_graph_helper.rb +++ b/app/helpers/open_graph_helper.rb @@ -30,7 +30,7 @@ module OpenGraphHelper end def og_namespace(object) - namespace = AppConfig[:open_graph_namespace].present? ? AppConfig[:open_graph_namespace] : 'joindiaspora' + namespace = AppConfig.services.facebook.open_graph_namespace.present? ? AppConfig.services.facebook.open_graph_namespace : 'joindiaspora' "#{namespace}:frame" end @@ -54,4 +54,4 @@ module OpenGraphHelper "#{root_url.chop}#{image_path('asterisk.png')}" end end -end \ No newline at end of file +end diff --git a/app/helpers/people_helper.rb b/app/helpers/people_helper.rb index 6767ee12c..c698a1ea6 100644 --- a/app/helpers/people_helper.rb +++ b/app/helpers/people_helper.rb @@ -73,7 +73,7 @@ module PeopleHelper # Rails.application.routes.url_helpers is needed since this is indirectly called from a model def local_or_remote_person_path(person, opts={}) - opts.merge!(:protocol => AppConfig[:pod_uri].scheme, :host => AppConfig[:pod_uri].authority) + opts.merge!(:protocol => AppConfig.pod_uri.scheme, :host => AppConfig.pod_uri.authority) absolute = opts.delete(:absolute) if person.local? diff --git a/app/helpers/posts_helper.rb b/app/helpers/posts_helper.rb index f8dc9f40e..efd741df3 100644 --- a/app/helpers/posts_helper.rb +++ b/app/helpers/posts_helper.rb @@ -5,14 +5,14 @@ module PostsHelper def post_page_title(post, opts={}) if post.is_a?(Photo) - I18n.t "posts.show.photos_by", :count => 1, :author => post.status_message.author.name + I18n.t "posts.show.photos_by", :count => 1, :author => post.status_message_author_name elsif post.is_a?(Reshare) - I18n.t "posts.show.reshare_by", :author => post.author.name + I18n.t "posts.show.reshare_by", :author => post.author_name else if post.text.present? truncate(post.text(:plain_text => true), :length => opts.fetch(:length, 20)) elsif post.respond_to?(:photos) && post.photos.present? - I18n.t "posts.show.photos_by", :count => post.photos.size, :author => post.author.name + I18n.t "posts.show.photos_by", :count => post.photos.size, :author => post.author_name end end end @@ -20,7 +20,7 @@ module PostsHelper def post_iframe_url(post_id, opts={}) opts[:width] ||= 516 opts[:height] ||= 315 - host = AppConfig[:pod_uri].site + host = AppConfig.pod_uri.site "".html_safe end end diff --git a/app/helpers/sessions_helper.rb b/app/helpers/sessions_helper.rb index ecef50181..2c5056e16 100644 --- a/app/helpers/sessions_helper.rb +++ b/app/helpers/sessions_helper.rb @@ -9,7 +9,7 @@ module SessionsHelper end def display_registration_link? - !AppConfig[:registrations_closed] && devise_mapping.registerable? && controller_name != 'registrations' + !AppConfig.settings.enable_registrations? && devise_mapping.registerable? && controller_name != 'registrations' end def display_password_reset_link? diff --git a/app/mailers/diaspora_devise_mailer.rb b/app/mailers/diaspora_devise_mailer.rb index c74f86ab2..9a18ffb38 100644 --- a/app/mailers/diaspora_devise_mailer.rb +++ b/app/mailers/diaspora_devise_mailer.rb @@ -1,5 +1,5 @@ class DiasporaDeviseMailer < Devise::Mailer - default :from => AppConfig[:smtp_sender_address] + default :from => AppConfig.mail.sender_address def self.mailer_name "devise/mailer" diff --git a/app/mailers/notification_mailers/also_commented.rb b/app/mailers/notification_mailers/also_commented.rb index 73ed95389..786a16e8a 100644 --- a/app/mailers/notification_mailers/also_commented.rb +++ b/app/mailers/notification_mailers/also_commented.rb @@ -3,13 +3,14 @@ module NotificationMailers include ActionView::Helpers::TextHelper attr_accessor :comment + delegate :post, to: :comment, prefix: true def set_headers(comment_id) @comment = Comment.find_by_id(comment_id) if mail? - @headers[:from] = "\"#{@comment.author.name} (Diaspora*)\" <#{AppConfig[:smtp_sender_address]}>" - @headers[:subject] = truncate(@comment.parent.comment_email_subject, :length => TRUNCATION_LEN) + @headers[:from] = "\"#{@comment.author_name} (Diaspora*)\" <#{AppConfig.mail.sender_address}>" + @headers[:subject] = truncate(@comment.comment_email_subject, :length => TRUNCATION_LEN) @headers[:subject] = "Re: #{@headers[:subject]}" end end diff --git a/app/mailers/notification_mailers/base.rb b/app/mailers/notification_mailers/base.rb index 58f55ddc4..980f70e51 100644 --- a/app/mailers/notification_mailers/base.rb +++ b/app/mailers/notification_mailers/base.rb @@ -3,6 +3,10 @@ module NotificationMailers class Base attr_accessor :recipient, :sender + + delegate :unconfirmed_email, :confirm_email_token, + :first_name, to: :recipient, prefix: true + delegate :first_name, :name, :sender, to: :sender, prefix: true def initialize(recipient_id, sender_id=nil, *args) @headers = {} @@ -29,12 +33,12 @@ module NotificationMailers private def default_headers headers = { - :from => AppConfig[:smtp_sender_address], - :host => "#{AppConfig[:pod_uri]}", + :from => AppConfig.mail.sender_address.get, + :host => "#{AppConfig.pod_uri.host}", :to => name_and_address(@recipient.name, @recipient.email) } - headers[:from] = "\"#{@sender.name} (Diaspora*)\" <#{AppConfig[:smtp_sender_address]}>" if @sender.present? + headers[:from] = "\"#{@sender.name} (Diaspora*)\" <#{AppConfig.mail.sender_address}>" if @sender.present? headers end diff --git a/app/mailers/notification_mailers/comment_on_post.rb b/app/mailers/notification_mailers/comment_on_post.rb index eb3626466..d7735a887 100644 --- a/app/mailers/notification_mailers/comment_on_post.rb +++ b/app/mailers/notification_mailers/comment_on_post.rb @@ -7,8 +7,8 @@ module NotificationMailers def set_headers(comment_id) @comment = Comment.find(comment_id) - @headers[:from] = "\"#{@comment.author.name} (Diaspora*)\" <#{AppConfig[:smtp_sender_address]}>" - @headers[:subject] = truncate(@comment.parent.comment_email_subject, :length => TRUNCATION_LEN) + @headers[:from] = "\"#{@comment.author_name} (Diaspora*)\" <#{AppConfig.mail.sender_address}>" + @headers[:subject] = truncate(@comment.comment_email_subject, :length => TRUNCATION_LEN) @headers[:subject] = "Re: #{@headers[:subject]}" end end diff --git a/app/mailers/notification_mailers/confirm_email.rb b/app/mailers/notification_mailers/confirm_email.rb index ea5fdecca..3a6256f73 100644 --- a/app/mailers/notification_mailers/confirm_email.rb +++ b/app/mailers/notification_mailers/confirm_email.rb @@ -1,7 +1,7 @@ module NotificationMailers class ConfirmEmail < NotificationMailers::Base def set_headers - @headers[:to] = name_and_address(@recipient.profile.first_name, @recipient.unconfirmed_email) + @headers[:to] = name_and_address(@recipient.first_name, @recipient.unconfirmed_email) @headers[:subject] = I18n.t('notifier.confirm_email.subject', :unconfirmed_email => @recipient.unconfirmed_email) end end diff --git a/app/mailers/notification_mailers/liked.rb b/app/mailers/notification_mailers/liked.rb index 243e018e4..54e89ef90 100644 --- a/app/mailers/notification_mailers/liked.rb +++ b/app/mailers/notification_mailers/liked.rb @@ -1,6 +1,7 @@ module NotificationMailers class Liked < NotificationMailers::Base attr_accessor :like + delegate :target, to: :like, prefix: true def set_headers(like_id) @like = Like.find(like_id) @@ -8,4 +9,4 @@ module NotificationMailers @headers[:subject] = I18n.t('notifier.liked.liked', :name => @sender.name) end end -end \ No newline at end of file +end diff --git a/app/mailers/notification_mailers/mentioned.rb b/app/mailers/notification_mailers/mentioned.rb index 2d0b5cd60..dc64f65b0 100644 --- a/app/mailers/notification_mailers/mentioned.rb +++ b/app/mailers/notification_mailers/mentioned.rb @@ -1,6 +1,7 @@ module NotificationMailers class Mentioned < NotificationMailers::Base attr_accessor :post + delegate :author_name, to: :post, prefix: true def set_headers(target_id) @post = Mention.find_by_id(target_id).post @@ -8,4 +9,4 @@ module NotificationMailers @headers[:subject] = I18n.t('notifier.mentioned.subject', :name => @sender.name) end end -end \ No newline at end of file +end diff --git a/app/mailers/notification_mailers/private_message.rb b/app/mailers/notification_mailers/private_message.rb index b258ab563..e39632b7d 100644 --- a/app/mailers/notification_mailers/private_message.rb +++ b/app/mailers/notification_mailers/private_message.rb @@ -7,7 +7,7 @@ module NotificationMailers @conversation = @message.conversation @participants = @conversation.participants - @headers[:from] = "\"#{@message.author.name} (Diaspora*)\" <#{AppConfig[:smtp_sender_address]}>" + @headers[:from] = "\"#{@message.author_name} (Diaspora*)\" <#{AppConfig.mail.sender_address}>" @headers[:subject] = @conversation.subject.strip @headers[:subject] = "Re: #{@headers[:subject]}" if @conversation.messages.size > 1 end diff --git a/app/mailers/notification_mailers/reshared.rb b/app/mailers/notification_mailers/reshared.rb index c8287dd27..4ea24e13d 100644 --- a/app/mailers/notification_mailers/reshared.rb +++ b/app/mailers/notification_mailers/reshared.rb @@ -1,6 +1,8 @@ module NotificationMailers class Reshared < NotificationMailers::Base attr_accessor :reshare + + delegate :root, to: :reshare, prefix: true def set_headers(reshare_id) @reshare = Reshare.find(reshare_id) @@ -8,4 +10,4 @@ module NotificationMailers @headers[:subject] = I18n.t('notifier.reshared.reshared', :name => @sender.name) end end -end \ No newline at end of file +end diff --git a/app/mailers/notifier.rb b/app/mailers/notifier.rb index 1fc4f232c..c922f2744 100644 --- a/app/mailers/notifier.rb +++ b/app/mailers/notifier.rb @@ -24,8 +24,8 @@ class Notifier < ActionMailer::Base end default_opts = {:to => @receiver.email, - :from => AppConfig[:smtp_sender_address], - :subject => I18n.t('notifier.single_admin.subject'), :host => AppConfig[:pod_uri].host} + :from => AppConfig.mail.sender_address, + :subject => I18n.t('notifier.single_admin.subject'), :host => AppConfig.pod_uri.host} default_opts.merge!(opts) @@ -42,9 +42,9 @@ class Notifier < ActionMailer::Base @locale = locale @invitation_code = invitation_code - mail_opts = {:to => email, :from => AppConfig[:smtp_sender_address], - :subject => I18n.t('notifier.invited_you', :name => @inviter.person.name), - :host => AppConfig[:pod_uri].host} + mail_opts = {:to => email, :from => AppConfig.mail.sender_address, + :subject => I18n.t('notifier.invited_you', :name => @inviter.name), + :host => AppConfig.pod_uri.host} I18n.with_locale(locale) do mail(mail_opts) do |format| diff --git a/app/models/app_config.rb b/app/models/app_config.rb deleted file mode 100644 index a2b8e1091..000000000 --- a/app/models/app_config.rb +++ /dev/null @@ -1,193 +0,0 @@ -# Copyright (c) 2010-2011, Diaspora Inc. This file is -# licensed under the Affero General Public License version 3 or later. See -# the COPYRIGHT file. - -require 'uri' -require Rails.root.join('lib', 'environment_configuration') - -class AppConfig < Settingslogic - def self.source_file_name - if ENV['application_yml'].present? - puts "using remote application.yml" - return ENV['application_yml'] - end - config_file = Rails.root.join("config", "application.yml") - if !File.exists?(config_file) && (Rails.env == 'test' || Rails.env.include?("integration") || EnvironmentConfiguration.heroku?) - config_file = Rails.root.join("config", "application.yml.example") - end - config_file - end - source source_file_name - namespace Rails.env - - def self.load! - unless EnvironmentConfiguration.heroku? - if no_config_file? && !have_old_config_file? - $stderr.puts <<-HELP -******** You haven't set up your Diaspora settings file. ********** -Please do the following: -1. Copy config/application.yml.example to config/application.yml. -2. Have a look at the settings in that file. It has sensible defaults for development, which (we hope) -work without modification. However, it's always good to know what's available to change later. -3. Restart Diaspora! -******** Thanks for being an alpha tester! ********** - HELP - Process.exit(1) - end - - if ((no_config_file? && have_old_config_file?) || config_file_is_old_style?) - $stderr.puts <<-HELP -******** The Diaspora configuration file format has changed. ********** -Please do the following: -1. Copy config/application.yml.example to config/application.yml. -2. Make any changes in config/application.yml that you previously made in config/app.yml or config/app_config.yml. -3. Delete config/app.yml and config/app_config.yml. Don't worry if they don't exist, though. -4. Restart Diaspora! -******** Thanks for being an alpha tester! ********** - HELP - Process.exit(1) - end - end - - begin - super - rescue TypeError - puts "Couldn't find section ''#{self.namespace}' in config/application.yml." - puts "Double check it's there and that you haven't set RAILS_ENV to something weired (check it for typos)" - Process.exit(1) - end - - if !EnvironmentConfiguration.heroku? && no_cert_file_in_prod? - $stderr.puts <<-HELP -******** Diaspora does not know where your SSL-CA-Certificates file is. ********** - Please add the root certificate bundle (this is operating system specific) to application.yml. Defaults: - CentOS: '/etc/pki/tls/certs/ca-bundle.crt' - Debian: '/etc/ssl/certs/ca-certificates.crt' - - Example: - ca_file: '/etc/ssl/certs/ca-certificates.crt' -******** Thanks for being secure! ********** -HELP - Process.exit(1) - end - end - - def self.setup! - normalize_pod_url - normalize_admins - normalize_pod_services - deprecate_hoptoad_api_key - end - - def self.configured_services - self['configured_services'] || [] - end - - def self.config_file_is_old_style? - !(File.read(@source) =~ /^defaults: &defaults/) - end - - def self.no_config_file? - !File.exists?(@source) - end - - def self.no_cert_file_in_prod? - (Rails.env == "production") && (self[:ca_file].blank? || !File.exists?(self[:ca_file])) - end - - def self.have_old_config_file? - File.exists?(Rails.root.join("config", "app.yml")) || (File.exists?(Rails.root.join("config", "app_config.yml"))) - end - - def self.new_relic_app_name - self[:new_relic_app_name] || self[:pod_uri].host - end - - def self.normalize_pod_url - unless self[:pod_url] =~ /^(https?:\/\/)/ # starts with http:// or https:// - self[:pod_url] = "http://#{self[:pod_url]}" - end - unless self[:pod_url] =~ /\/$/ # ends with slash - self[:pod_url] = "#{self[:pod_url]}/" - end - end - - def self.bare_pod_uri - self[:pod_uri].authority.gsub('www.', '') - end - - def self.normalize_admins - self[:admins] ||= [] - self[:admins].collect! { |username| username.downcase } - end - - def self.normalize_pod_services - self['configured_services'] = [] - if defined?(SERVICES) - SERVICES.keys.each do |service| - unless SERVICES[service].keys.any?{|service_key| SERVICES[service][service_key].blank?} - self['configured_services'] << service - end - end - end - end - - def deprecate_hoptoad_api_key - if self[:hoptoad_api_key].present? - $stderr.puts "WARNING: Please change hoptoad_api_key to airbrake_api_key in your application.yml" - self[:airbrake_api_key] = self[:hoptoad_api_key] - end - end - - load! - - def self.[] (key) - return self.pod_uri if key == :pod_uri - super - end - - def self.[]= (key, value) - super - if key.to_sym == :pod_url - @@pod_uri = nil - normalize_pod_url - end - end - - cattr_accessor :pod_uri - - def self.pod_uri - if @@pod_uri.nil? - begin - @@pod_uri = Addressable::URI.parse(self[:pod_url]) - rescue - puts "WARNING: pod url " + self[:pod_url] + " is not a legal URI" - end - end - return @@pod_uri - end - - def self.single_process_mode? - (ENV['SINGLE_PROCESS'] == "true" || ENV['SINGLE_PROCESS_MODE'] == "true" || self[:single_process_mode]) ? true : false - end - - def self.get_redis_instance - if ENV["REDISTOGO_URL"].present? - puts "WARNING: using the REDISTOGO_URL environment variable is deprecated, please use REDIS_URL now." - ENV['REDIS_URL'] = ENV["REDISTOGO_URL"] - end - - redis_options = {} - - if ENV['REDIS_URL'].present? - redis_options = { :url => ENV['REDIS_URL'] } - elsif ENV['RAILS_ENV']== 'integration2' - redis_options = { :host => 'localhost', :port => 6380 } - elsif self[:redis_url].present? - puts "WARNING: You're redis_url doesn't start with redis://" unless self[:redis_url].start_with?("redis://") - redis_options = { :url => self[:redis_url] } - end - - Redis.new(redis_options.merge(:thread_safe => true)) - end -end diff --git a/app/models/block.rb b/app/models/block.rb index 2409a9d3b..1eba8f4c8 100644 --- a/app/models/block.rb +++ b/app/models/block.rb @@ -2,6 +2,8 @@ class Block < ActiveRecord::Base belongs_to :person belongs_to :user + delegate :name, to: :person, prefix: true + validates :user_id, :presence => true validates :person_id, :presence => true, :uniqueness => { :scope => :user_id } @@ -12,4 +14,4 @@ class Block < ActiveRecord::Base errors[:person_id] << "stop blocking yourself!" end end -end \ No newline at end of file +end diff --git a/app/models/comment.rb b/app/models/comment.rb index 21faf3994..25fa5a790 100644 --- a/app/models/comment.rb +++ b/app/models/comment.rb @@ -22,6 +22,10 @@ class Comment < ActiveRecord::Base belongs_to :commentable, :touch => true, :polymorphic => true alias_attribute :post, :commentable belongs_to :author, :class_name => 'Person' + + delegate :name, to: :author, prefix: true + delegate :comment_email_subject, to: :parent + delegate :author_name, to: :parent, prefix: true validates :text, :presence => true, :length => {:maximum => 65535} validates :parent, :presence => true #should be in relayable (pending on fixing Message) diff --git a/app/models/contact.rb b/app/models/contact.rb index 4a39d2a90..f064ad929 100644 --- a/app/models/contact.rb +++ b/app/models/contact.rb @@ -7,6 +7,9 @@ class Contact < ActiveRecord::Base belongs_to :person validates :person, :presence => true + + delegate :name, :diaspora_handle, :guid, :first_name, + to: :person, prefix: true has_many :aspect_memberships has_many :aspects, :through => :aspect_memberships @@ -72,7 +75,7 @@ class Contact < ActiveRecord::Base incoming_aspects = Aspect.where( :user_id => self.person.owner_id, :contacts_visible => true).joins(:contacts).where( - :contacts => {:person_id => self.user.person.id}).select('aspects.id') + :contacts => {:person_id => self.user.person_id}).select('aspects.id') incoming_aspect_ids = incoming_aspects.map{|a| a.id} similar_contacts = Person.joins(:contacts => :aspect_memberships).where( :aspect_memberships => {:aspect_id => incoming_aspect_ids}).where(people[:id].not_eq(self.user.person.id)).select('DISTINCT people.*') diff --git a/app/models/invitation_code.rb b/app/models/invitation_code.rb index 48a710fd0..35fa80d49 100644 --- a/app/models/invitation_code.rb +++ b/app/models/invitation_code.rb @@ -5,6 +5,8 @@ class InvitationCode < ActiveRecord::Base before_create :generate_token, :set_default_invite_count + delegate :name, to: :user, prefix: true + def to_param token end @@ -28,14 +30,14 @@ class InvitationCode < ActiveRecord::Base end def self.default_inviter_or(user) - if AppConfig[:admin_account].present? - inviter = User.find_by_username(AppConfig[:admin_account]) + if AppConfig.admins.account.present? + inviter = User.find_by_username(AppConfig.admins.account.get) end inviter ||= user inviter end def set_default_invite_count - self.count = AppConfig[:invite_count] || 25 + self.count = AppConfig['settings.invitations.count'] || 25 end end diff --git a/app/models/jobs/publish_to_hub.rb b/app/models/jobs/publish_to_hub.rb index 1899c6b9d..80858984a 100644 --- a/app/models/jobs/publish_to_hub.rb +++ b/app/models/jobs/publish_to_hub.rb @@ -9,7 +9,7 @@ module Jobs def self.perform(sender_public_url) require Rails.root.join('lib', 'pubsubhubbub') atom_url = sender_public_url + '.atom' - Pubsubhubbub.new(AppConfig[:pubsub_server]).publish(atom_url) + Pubsubhubbub.new(AppConfig.environment.pubsub_server.get).publish(atom_url) end end end diff --git a/app/models/message.rb b/app/models/message.rb index 699bbb934..dec6fb492 100644 --- a/app/models/message.rb +++ b/app/models/message.rb @@ -11,6 +11,8 @@ class Message < ActiveRecord::Base belongs_to :author, :class_name => 'Person' belongs_to :conversation, :touch => true + + delegate :name, to: :author, prefix: true validates :text, :presence => true validate :participant_of_parent_conversation diff --git a/app/models/person.rb b/app/models/person.rb index 5e7fa9db2..0ed354f88 100644 --- a/app/models/person.rb +++ b/app/models/person.rb @@ -32,7 +32,9 @@ class Person < ActiveRecord::Base xml_attr :exported_key has_one :profile, :dependent => :destroy - delegate :last_name, :image_url, :to => :profile + delegate :last_name, :image_url, :tag_string, :bio, :location, + :gender, :birthday, :formatted_birthday, :tags, :searchable, + to: :profile accepts_nested_attributes_for :profile before_validation :downcase_diaspora_handle diff --git a/app/models/photo.rb b/app/models/photo.rb index 9dabd2ac5..ce666b5d1 100644 --- a/app/models/photo.rb +++ b/app/models/photo.rb @@ -41,6 +41,7 @@ class Photo < ActiveRecord::Base belongs_to :status_message, :foreign_key => :status_message_guid, :primary_key => :guid validates_associated :status_message + delegate :author_name, to: :status_message, prefix: true attr_accessible :text, :pending validate :ownership_of_status_message @@ -98,9 +99,7 @@ class Photo < ActiveRecord::Base def update_remote_path unless self.unprocessed_image.url.match(/^https?:\/\//) - pod_url = AppConfig[:pod_url].dup - pod_url.chop! if AppConfig[:pod_url][-1,1] == '/' - remote_path = "#{pod_url}#{self.unprocessed_image.url}" + remote_path = "#{AppConfig.pod_uri.to_s.chomp("/")}#{self.unprocessed_image.url}" else remote_path = self.unprocessed_image.url end diff --git a/app/models/profile.rb b/app/models/profile.rb index bf41aa31b..5a8073d3b 100644 --- a/app/models/profile.rb +++ b/app/models/profile.rb @@ -185,8 +185,6 @@ class Profile < ActiveRecord::Base end def absolutify_local_url url - pod_url = AppConfig[:pod_url].dup - pod_url.chop! if AppConfig[:pod_url][-1,1] == '/' - "#{pod_url}#{url}" + "#{AppConfig.pod_uri.to_s.chomp("/")}#{url}" end end diff --git a/app/models/reshare.rb b/app/models/reshare.rb index 713df96fb..e5bdba9b9 100644 --- a/app/models/reshare.rb +++ b/app/models/reshare.rb @@ -9,6 +9,7 @@ class Reshare < Post attr_accessible :root_guid, :public validates_presence_of :root, :on => :create validates_uniqueness_of :root_guid, :scope => :author_id + delegate :author, to: :root, prefix: true xml_attr :root_diaspora_id xml_attr :root_guid @@ -58,7 +59,7 @@ class Reshare < Post end def comment_email_subject - I18n.t('reshares.comment_email_subject', :resharer => author.name, :author => root.author.name) + I18n.t('reshares.comment_email_subject', :resharer => author.name, :author => root.author_name) end def notification_type(user, person) diff --git a/app/models/role.rb b/app/models/role.rb index 5fc0782f8..965044cf4 100644 --- a/app/models/role.rb +++ b/app/models/role.rb @@ -13,20 +13,4 @@ class Role < ActiveRecord::Base def self.add_spotlight(person) find_or_create_by_person_id_and_name(person.id, 'spotlight') end - - def self.load_admins - admins = AppConfig[:admins] || [] - admins.each do |username| - u = User.find_by_username(username) - find_or_create_by_person_id_and_name(u.person.id, 'admin') - end - end - - def self.load_spotlight - spotlighters = AppConfig[:community_spotlight] || [] - spotlighters.each do |diaspora_handle| - person = Person.find_by_diaspora_handle(diaspora_handle) - find_or_create_by_person_id_and_name(person.id, 'spotlight') - end - end end diff --git a/app/models/service.rb b/app/models/service.rb index 4720b1141..f44d5df13 100644 --- a/app/models/service.rb +++ b/app/models/service.rb @@ -14,7 +14,7 @@ class Service < ActiveRecord::Base def public_message(post, length, url = "") Rails.logger.info("Posting out to #{self.class}") - url = Rails.application.routes.url_helpers.short_post_url(post, :protocol => AppConfig[:pod_uri].scheme, :host => AppConfig[:pod_uri].authority) + url = Rails.application.routes.url_helpers.short_post_url(post, :protocol => AppConfig.pod_uri.scheme, :host => AppConfig.pod_uri.authority) space_for_url = 21 + 1 truncated = truncate(post.text(:plain_text => true), :length => (length - space_for_url)) truncated = "#{truncated} #{url}" diff --git a/app/models/services/facebook.rb b/app/models/services/facebook.rb index 4d8121d32..39d2b1086 100644 --- a/app/models/services/facebook.rb +++ b/app/models/services/facebook.rb @@ -23,7 +23,7 @@ class Services::Facebook < Service end def create_open_graph_params(post) - {:post => "#{AppConfig[:pod_url]}#{short_post_path(post)}", :access_token => self.access_token} + {:post => "#{AppConfig.pod_uri.to_s}#{short_post_path(post)}", :access_token => self.access_token} end def create_post_params(post) @@ -38,4 +38,4 @@ class Services::Facebook < Service def profile_photo_url "https://graph.facebook.com/#{self.uid}/picture?type=large&access_token=#{URI.escape(self.access_token)}" end -end \ No newline at end of file +end diff --git a/app/models/services/tumblr.rb b/app/models/services/tumblr.rb index 010ac96f3..ab964b6ea 100644 --- a/app/models/services/tumblr.rb +++ b/app/models/services/tumblr.rb @@ -9,11 +9,11 @@ class Services::Tumblr < Service end def consumer_key - SERVICES['tumblr']['consumer_key'] + AppConfig.services.tumblr.key end def consumer_secret - SERVICES['tumblr']['consumer_secret'] + AppConfig.services.tumblr.secret end def post(post, url='') diff --git a/app/models/services/twitter.rb b/app/models/services/twitter.rb index c3b409697..a4730b6e8 100644 --- a/app/models/services/twitter.rb +++ b/app/models/services/twitter.rb @@ -35,8 +35,8 @@ class Services::Twitter < Service private def configure_twitter - twitter_key = SERVICES['twitter']['consumer_key'] - twitter_consumer_secret = SERVICES['twitter']['consumer_secret'] + twitter_key = AppConfig.services.twitter.key + twitter_consumer_secret = AppConfig.services.twitter.secret if twitter_key.blank? || twitter_consumer_secret.blank? Rails.logger.info "you have a blank twitter key or secret.... you should look into that" diff --git a/app/models/status_message.rb b/app/models/status_message.rb index da708531d..e4adc4f0a 100644 --- a/app/models/status_message.rb +++ b/app/models/status_message.rb @@ -146,6 +146,10 @@ class StatusMessage < Post formatted_message(:plain_text => true) end + def first_photo_url(*args) + photos.first.url(*args) + end + def text_and_photos_blank? self.text.blank? && self.photos.blank? end diff --git a/app/models/user.rb b/app/models/user.rb index e2070fde4..f37457d07 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -11,6 +11,11 @@ class User < ActiveRecord::Base include Querying include SocialActions + scope :logged_in_since, lambda { |time| where('last_sign_in_at > ?', time) } + scope :monthly_actives, lambda { |time = Time.now| logged_in_since(time - 1.month) } + scope :daily_actives, lambda { |time = Time.now| logged_in_since(time - 1.day) } + scope :yearly_actives, lambda { |time = Time.now| logged_in_since(time - 1.year) } + devise :database_authenticatable, :registerable, :recoverable, :rememberable, :trackable, :validatable, :timeoutable, :token_authenticatable, :lockable, @@ -33,7 +38,10 @@ class User < ActiveRecord::Base serialize :hidden_shareables, Hash has_one :person, :foreign_key => :owner_id - delegate :guid, :public_key, :posts, :photos, :owns?, :diaspora_handle, :name, :public_url, :profile, :first_name, :last_name, :participations, :to => :person + delegate :guid, :public_key, :posts, :photos, :owns?, :image_url, + :diaspora_handle, :name, :public_url, :profile, :url, + :first_name, :last_name, :gender, :participations, to: :person + delegate :id, :guid, to: :person, prefix: true has_many :invitations_from_me, :class_name => 'Invitation', :foreign_key => :sender_id has_many :invitations_to_me, :class_name => 'Invitation', :foreign_key => :recipient_id @@ -82,22 +90,6 @@ class User < ActiveRecord::Base User.joins(:contacts).where(:contacts => {:person_id => person.id}) end - def self.monthly_actives(start_day = Time.now) - logged_in_since(start_day - 1.month) - end - - def self.yearly_actives(start_day = Time.now) - logged_in_since(start_day - 1.year) - end - - def self.daily_actives(start_day = Time.now) - logged_in_since(start_day - 1.day) - end - - def self.logged_in_since(time) - where('last_sign_in_at > ?', time) - end - def unread_notifications notifications.where(:unread => true) end @@ -372,7 +364,7 @@ class User < ActiveRecord::Base params[:image_url_small] = photo.url(:thumb_small) end - if self.person.profile.update_attributes(params) + if self.profile.update_attributes(params) Postzord::Dispatcher.build(self, profile).post true else @@ -403,7 +395,7 @@ class User < ActiveRecord::Base end def set_person(person) - person.url = AppConfig[:pod_url] + person.url = AppConfig.pod_uri.to_s person.diaspora_handle = "#{self.username}#{User.diaspora_id_host}" self.person = person end @@ -418,7 +410,7 @@ class User < ActiveRecord::Base self.aspects.create(:name => I18n.t('aspects.seed.work')) aq = self.aspects.create(:name => I18n.t('aspects.seed.acquaintances')) - unless AppConfig[:no_follow_diasporahq] + unless AppConfig.settings.follow_diasporahq default_account = Webfinger.new('diasporahq@joindiaspora.com').fetch self.share_with(default_account, aq) if default_account end diff --git a/app/presenters/o_embed_presenter.rb b/app/presenters/o_embed_presenter.rb index 0723b7df9..c8baf4752 100644 --- a/app/presenters/o_embed_presenter.rb +++ b/app/presenters/o_embed_presenter.rb @@ -15,7 +15,7 @@ class OEmbedPresenter def as_json(opts={}) { :provider_name => "Diaspora", - :provider_url => AppConfig[:pod_url], + :provider_url => AppConfig.pod_uri.to_s, :type => 'rich', :version => '1.0', :title => post_title, @@ -36,14 +36,14 @@ class OEmbedPresenter end def post_author - @post.author.name + @post.author_name end def post_author_url - Rails.application.routes.url_helpers.person_url(@post.author, :host => AppConfig[:pod_uri].host) + Rails.application.routes.url_helpers.person_url(@post.author, :host => AppConfig.pod_uri.host) end def iframe_html post_iframe_url(@post.id, :height => @opts[:maxheight], :width => @opts[:maxwidth]) end -end \ No newline at end of file +end diff --git a/app/presenters/person_presenter.rb b/app/presenters/person_presenter.rb index 37bea78ec..7b635125a 100644 --- a/app/presenters/person_presenter.rb +++ b/app/presenters/person_presenter.rb @@ -12,9 +12,9 @@ class PersonPresenter if is_own_profile || person_is_following_current_user attrs.merge!({ - :location => @person.profile.location, - :birthday => @person.profile.formatted_birthday, - :bio => @person.profile.bio + :location => @person.location, + :birthday => @person.formatted_birthday, + :bio => @person.bio }) end @@ -30,4 +30,4 @@ class PersonPresenter def person_is_following_current_user @person.shares_with(@current_user) end -end \ No newline at end of file +end diff --git a/app/presenters/post_presenter.rb b/app/presenters/post_presenter.rb index 059183139..a5619a0d4 100644 --- a/app/presenters/post_presenter.rb +++ b/app/presenters/post_presenter.rb @@ -55,7 +55,7 @@ class PostPresenter end def title - @post.text.present? ? @post.text(:plain_text => true) : I18n.translate('posts.presenter.title', :name => @post.author.name) + @post.text.present? ? @post.text(:plain_text => true) : I18n.translate('posts.presenter.title', :name => @post.author_name) end def template_name #kill me, lol, I should be client side diff --git a/app/views/admins/_admin_bar.haml b/app/views/admins/_admin_bar.haml index 70ab909f0..0f2577dc7 100644 --- a/app/views/admins/_admin_bar.haml +++ b/app/views/admins/_admin_bar.haml @@ -6,6 +6,6 @@ %li= link_to t('.weekly_user_stats'), weekly_user_stats_path %li= link_to t('.pod_stats'), pod_stats_path %li= link_to t('.correlations'), correlations_path - - if AppConfig[:mount_resque_web] + - if AppConfig.admins.inline_resque_web? %li= link_to t('.resque_overview'), resque_web_path diff --git a/app/views/community_spotlight/_user.html.haml b/app/views/community_spotlight/_user.html.haml index 32ed238f9..3b7ae837d 100644 --- a/app/views/community_spotlight/_user.html.haml +++ b/app/views/community_spotlight/_user.html.haml @@ -4,7 +4,7 @@ = person.name .tags - - person.profile.tags.each do |tag| + - person.tags.each do |tag| = link_to "##{tag}", tag_path(:name => tag.name) .add_user_to_aspect diff --git a/app/views/contacts/index.html.haml b/app/views/contacts/index.html.haml index 5c7d89386..57f8232d1 100644 --- a/app/views/contacts/index.html.haml +++ b/app/views/contacts/index.html.haml @@ -29,7 +29,7 @@ - if @contacts.size > 0 - for contact in @contacts - .stream_element{:id => contact.person.id} + .stream_element{:id => contact.person_id} .float-right = contact_aspect_dropdown(contact) @@ -41,7 +41,7 @@ .bd = person_link(contact.person) .info - = contact.person.diaspora_handle + = contact.person_diaspora_handle = will_paginate @contacts - else diff --git a/app/views/contacts/sharing.haml b/app/views/contacts/sharing.haml index 1ca5d0e27..7b1f24c9c 100644 --- a/app/views/contacts/sharing.haml +++ b/app/views/contacts/sharing.haml @@ -18,9 +18,9 @@ %li{:data=>{:contact_id=>contact.id}} = person_image_tag contact.person %h4.name - = link_to contact.person.name, contact.person + = link_to contact.person_name, contact.person .description - = contact.person.diaspora_handle + = contact.person_diaspora_handle .right = aspect_membership_dropdown(contact, contact.person, 'right') diff --git a/app/views/contacts/spotlight.haml b/app/views/contacts/spotlight.haml index 3c5eb9d20..da61f96e4 100644 --- a/app/views/contacts/spotlight.haml +++ b/app/views/contacts/spotlight.haml @@ -16,9 +16,9 @@ .span-18.last{:style => "position:relative;"} - - if AppConfig[:spotlight_suggest_email].present? + - if AppConfig.settings.community_spotlight.suggest_email.present? .right - = link_to "Suggest a member", "mailto:#{AppConfig[:spotlight_suggest_email]}", :class => "button" + = link_to "Suggest a member", "mailto:#{AppConfig.settings.community_spotlight.suggest_email}", :class => "button" %h3 = t('contacts.spotlight.community_spotlight') diff --git a/app/views/devise/shared/_links.haml b/app/views/devise/shared/_links.haml index 101d43567..4c37c1ed5 100644 --- a/app/views/devise/shared/_links.haml +++ b/app/views/devise/shared/_links.haml @@ -1,7 +1,7 @@ - if controller_name != 'sessions' = link_to t('.sign_in'), new_session_path(resource_name) %br/ -- if !AppConfig[:registrations_closed] && devise_mapping.registerable? && controller_name != 'registrations' +- if AppConfig.settings.enable_registrations? && devise_mapping.registerable? && controller_name != 'registrations' = link_to t('.sign_up'), new_registration_path(resource_name) %br/ - else diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index 61b6d6161..af2d720fc 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -6,7 +6,6 @@ %html{:lang => I18n.locale.to_s, :dir => (rtl?) ? 'rtl' : 'ltr'} %head %meta{:charset => 'utf-8'} - %meta{'http-equiv' => 'X-UA-Compatible', :content => 'IE=edge,chrome=1'} %meta{"http-equiv"=>"Content-Type", :content=>"text/html; charset=utf-8"} %meta{:name => "description", :content => "Diaspora*"} diff --git a/app/views/layouts/blank.haml b/app/views/layouts/blank.haml index b9e7d816d..0ed9927ab 100644 --- a/app/views/layouts/blank.haml +++ b/app/views/layouts/blank.haml @@ -6,7 +6,6 @@ %html{:lang => I18n.locale.to_s, :dir => (rtl?) ? 'rtl' : 'ltr'} %head %meta{:charset => 'utf-8'} - %meta{'http-equiv' => 'X-UA-Compatible', :content => 'IE=edge,chrome=1'} %meta{"http-equiv"=>"Content-Type", :content=>"text/html; charset=utf-8"} = csrf_meta_tag diff --git a/app/views/layouts/notifier.html.erb b/app/views/layouts/notifier.html.erb index 816ecb34b..ddc0a59f6 100644 --- a/app/views/layouts/notifier.html.erb +++ b/app/views/layouts/notifier.html.erb @@ -28,7 +28,7 @@
- DIASPORA* + DIASPORA*
diff --git a/app/views/layouts/post.haml b/app/views/layouts/post.haml index f0ef05e04..4d10bb287 100644 --- a/app/views/layouts/post.haml +++ b/app/views/layouts/post.haml @@ -6,7 +6,6 @@ %html{:lang => I18n.locale.to_s, :dir => (rtl?) ? 'rtl' : 'ltr'} %head %meta{:charset => 'utf-8'} - %meta{'http-equiv' => 'X-UA-Compatible', :content => 'IE=edge,chrome=1'} %meta{"http-equiv"=>"Content-Type", :content=>"text/html; charset=utf-8"} %meta{:name => "description", :content => "Diaspora*"} diff --git a/app/views/notifications/_notify_popup_item.haml b/app/views/notifications/_notify_popup_item.haml index 92a75d7bc..e2c30fa27 100644 --- a/app/views/notifications/_notify_popup_item.haml +++ b/app/views/notifications/_notify_popup_item.haml @@ -1,5 +1,5 @@ .notification_element{:data=>{:guid => n.id},:class => (n.unread ? "unread" : "read")} - %img{:src => n.actors.first.profile.image_url(:thumb_medium)} + %img{:src => n.actors.first.image_url(:thumb_medium)} = notification_message_for(n) %br/ %abbr.timeago{:title=>n.created_at.iso8601} diff --git a/app/views/notifier/also_commented.markerb b/app/views/notifier/also_commented.markerb index ff2c9b944..255978ef7 100644 --- a/app/views/notifier/also_commented.markerb +++ b/app/views/notifier/also_commented.markerb @@ -1,5 +1,5 @@ <%= comment_message(@notification.comment, :process_newlines => true) %> -[<%= t('notifier.comment_on_post.reply', :name => @notification.comment.post.author.first_name) %>][1] +[<%= t('notifier.comment_on_post.reply', :name => @notification.comment_post.author_first_name) %>][1] -[1]: <%= post_url(@notification.comment.post) %> +[1]: <%= post_url(@notification.comment_post) %> diff --git a/app/views/notifier/comment_on_post.markerb b/app/views/notifier/comment_on_post.markerb index c0f52aa2e..aef5d049f 100644 --- a/app/views/notifier/comment_on_post.markerb +++ b/app/views/notifier/comment_on_post.markerb @@ -1,5 +1,5 @@ <%= comment_message(@notification.comment, :process_newlines => true) %> -[<%= t('notifier.comment_on_post.reply', :name => @notification.comment.post.author.name) %>][1] +[<%= t('notifier.comment_on_post.reply', :name => @notification.comment.parent_author_name) %>][1] [1]: <%= post_url(@notification.comment.post) %> diff --git a/app/views/notifier/confirm_email.markerb b/app/views/notifier/confirm_email.markerb index b24469264..6b32bfa0a 100644 --- a/app/views/notifier/confirm_email.markerb +++ b/app/views/notifier/confirm_email.markerb @@ -1,5 +1,5 @@ -<%= t('notifier.hello', :name => @notification.recipient.profile.first_name) %> +<%= t('notifier.hello', :name => @notification.recipient_first_name) %> -<%= t('notifier.confirm_email.click_link', :unconfirmed_email => @notification.recipient.unconfirmed_email) %> +<%= t('notifier.confirm_email.click_link', :unconfirmed_email => @notification.recipient_unconfirmed_email) %> -<<%= confirm_email_url(:token => @notification.recipient.confirm_email_token) %>> +<<%= confirm_email_url(:token => @notification.recipient_confirm_email_token) %>> diff --git a/app/views/notifier/liked.markerb b/app/views/notifier/liked.markerb index 10d1fba10..cec7b37d6 100644 --- a/app/views/notifier/liked.markerb +++ b/app/views/notifier/liked.markerb @@ -1,7 +1,7 @@ -<%= "#{t('.liked', :name => "#{@notification.sender.name}")}:" %> +<%= "#{t('.liked', :name => "#{@notification.sender_name}")}:" %> -<%= post_message(@notification.like.target, :process_newlines => true) %> +<%= post_message(@notification.like_target, :process_newlines => true) %> [<%= t('.view_post') %>][1] -[1]: <%= post_url(@notification.like.target) %> +[1]: <%= post_url(@notification.like_target) %> diff --git a/app/views/notifier/mentioned.markerb b/app/views/notifier/mentioned.markerb index 7f790fd0a..9be69b95a 100644 --- a/app/views/notifier/mentioned.markerb +++ b/app/views/notifier/mentioned.markerb @@ -1,5 +1,5 @@ <%= post_message(@notification.post, :process_newlines => true, :length => 600) %> -[<%= t('notifier.comment_on_post.reply', :name => @notification.post.author.name) %>][1] +[<%= t('notifier.comment_on_post.reply', :name => @notification.post_author_name) %>][1] [1]: <%= post_url(@notification.post) %> diff --git a/app/views/notifier/reshared.markerb b/app/views/notifier/reshared.markerb index 36c3e3798..a1c43c6a1 100644 --- a/app/views/notifier/reshared.markerb +++ b/app/views/notifier/reshared.markerb @@ -1,6 +1,6 @@ -<%= "#{t('.reshared', :name => "#{@notification.sender.name}")}:" %> +<%= "#{t('.reshared', :name => "#{@notification.sender_name}")}:" %> -<%= post_message(@notification.reshare.root, :process_newlines => true) %> +<%= post_message(@notification.reshare_root, :process_newlines => true) %> [<%= t('.view_post') %>][1] diff --git a/app/views/notifier/started_sharing.markerb b/app/views/notifier/started_sharing.markerb index c2f09e842..d5e16d74c 100644 --- a/app/views/notifier/started_sharing.markerb +++ b/app/views/notifier/started_sharing.markerb @@ -1,5 +1,5 @@ -<%= @notification.sender.name %> <%= t('.sharing') %> +<%= @notification.sender_name %> <%= t('.sharing') %> -[<%= t('.view_profile', :name => @notification.sender.first_name) %>][1] +[<%= t('.view_profile', :name => @notification.sender_first_name) %>][1] [1]: <%= local_or_remote_person_path(@notification.sender, :absolute => true) %> diff --git a/app/views/people/_profile_sidebar.html.haml b/app/views/people/_profile_sidebar.html.haml index b3c5a7739..10bb9764f 100644 --- a/app/views/people/_profile_sidebar.html.haml +++ b/app/views/people/_profile_sidebar.html.haml @@ -17,30 +17,30 @@ %br -if contact.sharing? || person == current_user.person %ul#profile_information - - unless person.profile.bio.blank? + - unless person.bio.blank? %li %h4 =t('.bio') - %div{ :class => direction_for(person.profile.bio) } + %div{ :class => direction_for(person.bio) } = markdownify(person.profile.bio, :oembed => true, :newlines => true) - unless person.profile.location.blank? %li %h4 =t('.location') - %div{ :class => direction_for(person.profile.location) } - = markdownify(person.profile.location, :oembed => true, :newlines => true) + %div{ :class => direction_for(person.location) } + = markdownify(person.location, :oembed => true, :newlines => true) %li - - unless person.profile.gender.blank? + - unless person.gender.blank? %h4 =t('.gender') - = person.profile.gender + = person.gender %li - - unless person.profile.birthday.blank? + - unless person.birthday.blank? %h4 =t('.born') - = birthday_format(person.profile.birthday) + = birthday_format(person.birthday) %br %br diff --git a/app/views/people/_sub_header.html.haml b/app/views/people/_sub_header.html.haml index 987f198e1..1ad0a048d 100644 --- a/app/views/people/_sub_header.html.haml +++ b/app/views/people/_sub_header.html.haml @@ -18,7 +18,7 @@ = last_post_link person .description - - if !person.profile.tag_string.blank? && user_signed_in? + - if !person.tag_string.blank? && user_signed_in? = Diaspora::Taggable.format_tags(person.profile.tag_string) - if user_signed_in? && person == current_user.person %span.hover_edit diff --git a/app/views/photos/_new_photo.haml b/app/views/photos/_new_photo.haml index b5f418f2f..b4aec04b3 100644 --- a/app/views/photos/_new_photo.haml +++ b/app/views/photos/_new_photo.haml @@ -29,7 +29,7 @@ $('#file-upload').addClass("loading"); $('#publisher').find("input[type='submit']").attr('disabled','disabled'); - Publisher.wrapper().addClass("with_attachments"); + app.publisher.el_wrapper.addClass("with_attachments"); $('#photodropzone').append( "
  • " + "#{escape_javascript(image_tag('ajax-loader2.gif'))}" + @@ -43,7 +43,7 @@ url = responseJSON.data.photo.unprocessed_image.url, currentPlaceholder = $('li.loading').first(); - Publisher.wrapper().addClass("with_attachments"); + app.publisher.el_wrapper.addClass("with_attachments"); $('#new_status_message').append(""); // replace image placeholders @@ -70,7 +70,7 @@ photo.fadeOut(400, function(){ photo.remove(); if ( $('.publisher_photo').length == 0){ - Publisher.wrapper().removeClass("with_attachments"); + app.publisher.el_wrapper.removeClass("with_attachments"); } }); } diff --git a/app/views/photos/_photo.haml b/app/views/photos/_photo.haml index 4f96a6037..1971e5c3c 100644 --- a/app/views/photos/_photo.haml +++ b/app/views/photos/_photo.haml @@ -10,5 +10,5 @@ %p.photo_description = post.text -= link_to t('.view_all', :name => post.author.name), person_photos_path(post.author), :class => "small_text" += link_to t('.view_all', :name => post.author_name), person_photos_path(post.author), :class => "small_text" diff --git a/app/views/posts/_photo.html.haml b/app/views/posts/_photo.html.haml index f9158a3e8..9ee149c97 100644 --- a/app/views/posts/_photo.html.haml +++ b/app/views/posts/_photo.html.haml @@ -9,7 +9,7 @@ = person_image_link(post.author) .from %h2 - = post.author.name + = post.author_name #show_photo{:data=>{:guid=>post.id}} = image_tag post.url(:scaled_full) diff --git a/app/views/publics/hcard.haml b/app/views/publics/hcard.haml index ca0194e3d..f19bffb35 100644 --- a/app/views/publics/hcard.haml +++ b/app/views/publics/hcard.haml @@ -17,7 +17,7 @@ %dl.entity_family_name %dt Family name %dd - %span.family_name= @person.profile.last_name + %span.family_name= @person.last_name %dl.entity_fn %dt Full name @@ -32,19 +32,19 @@ %dl.entity_photo %dt Photo %dd - %img.photo.avatar{:src=>@person.profile.image_url, :width=>'300px', :height=>'300px'} + %img.photo.avatar{:src=>@person.image_url, :width=>'300px', :height=>'300px'} %dl.entity_photo_medium %dt Photo %dd - %img.photo.avatar{:src=>@person.profile.image_url(:thumb_medium), :width=>'100px', :height=>'100px'} + %img.photo.avatar{:src=>@person.image_url(:thumb_medium), :width=>'100px', :height=>'100px'} %dl.entity_photo_small %dt Photo %dd - %img.photo.avatar{:src=>@person.profile.image_url(:thumb_small), :width=>'50px', :height=>'50px'} + %img.photo.avatar{:src=>@person.image_url(:thumb_small), :width=>'50px', :height=>'50px'} %dl.entity_searchable %dt Searchable %dd - %span.searchable= @person.profile.searchable + %span.searchable= @person.searchable diff --git a/app/views/publics/host_meta.erb b/app/views/publics/host_meta.erb index a37801b67..f5efcab11 100644 --- a/app/views/publics/host_meta.erb +++ b/app/views/publics/host_meta.erb @@ -5,6 +5,6 @@ + template='<%= AppConfig.pod_uri.to_s %>webfinger?q={uri}' /> diff --git a/app/views/sessions/new.html.erb b/app/views/sessions/new.html.erb index 0738df8fb..a31d736b7 100644 --- a/app/views/sessions/new.html.erb +++ b/app/views/sessions/new.html.erb @@ -1,10 +1,10 @@ <% content_for :page_title do %> - <%= "#{AppConfig[:pod_name]} / #{t('devise.sessions.new.sign_in')}" %> + <%= "#{AppConfig.settings.pod_name} / #{t('devise.sessions.new.sign_in')}" %> <% end %>

    - <%= AppConfig[:pod_name] %> + <%= AppConfig.settings.pod_name %>

    <%= form_for(resource, :as => resource_name, :url => session_path(resource_name), :html => {:class => "form-horizontal block-form"}, :autocomplete => 'off') do |f| %> diff --git a/app/views/shared/_contact_sidebar.html.haml b/app/views/shared/_contact_sidebar.html.haml index 9e024a774..85106b36b 100644 --- a/app/views/shared/_contact_sidebar.html.haml +++ b/app/views/shared/_contact_sidebar.html.haml @@ -8,6 +8,6 @@ %hr %ul.left_nav - - if AppConfig[:community_spotlight] + - if AppConfig.settings.community_spotlight.enable? %li{:class => ("active" if @spotlight)} = link_to t('contacts.spotlight.community_spotlight'), community_spotlight_path, :class => "element_selector" diff --git a/app/views/shared/_donatepod.html.haml b/app/views/shared/_donatepod.html.haml index 38a04b6a6..1281ff602 100644 --- a/app/views/shared/_donatepod.html.haml +++ b/app/views/shared/_donatepod.html.haml @@ -1,6 +1,6 @@ %form{:action => "https://www.paypal.com/cgi-bin/webscr", :method => "post"} %input{:name => "cmd", :type => "hidden", :value => "_s-xclick"} - %input{:name => "hosted_button_id", :type => "hidden", :value => AppConfig[:paypal_hosted_button_id]} + %input{:name => "hosted_button_id", :type => "hidden", :value => AppConfig.settings.paypal_hosted_button_id} %input{:name => "on0", :type => "hidden", :value => "Type"} %input{:name => "modify", :type => "hidden", :value => "2"} %select{:name => "os0"} diff --git a/app/views/shared/_photo_area.mobile.haml b/app/views/shared/_photo_area.mobile.haml index 0ba6126d5..ea5c4bf79 100644 --- a/app/views/shared/_photo_area.mobile.haml +++ b/app/views/shared/_photo_area.mobile.haml @@ -9,7 +9,7 @@ - if post.photos.size > 1 .additional_photo_count = "+ #{post.photos.size-1}" - = image_tag post.photos.first.url(:thumb_large), :class => "stream-photo big-stream-photo" + = image_tag post.first_photo_url(:thumb_large), :class => "stream-photo big-stream-photo" - elsif post.activity_streams? = image_tag post.image_url diff --git a/app/views/shared/_publisher.html.haml b/app/views/shared/_publisher.html.haml index 4c8d86094..617783965 100644 --- a/app/views/shared/_publisher.html.haml +++ b/app/views/shared/_publisher.html.haml @@ -5,7 +5,7 @@ -if publisher_explain :javascript $(document).ready(function() { - Publisher.triggerGettingStarted(); + if( app.publisher ) app.publisher.triggerGettingStarted(); }); #publisher{:class => ((aspect == :profile || publisher_open) ? "mention_popup" : "closed")} @@ -61,7 +61,7 @@ %li.public.radio{"data-aspect_id" => "public", :class => ("selected" if publisher_public)} = t('public') - %li.divider.all_aspects.radio{:style => "border-bottom: 1px solid #ddd;", "data-aspect_id" => "all_aspects", :class => ("selected" if (!publisher_public && all_aspects_selected?(selected_aspects)))} + %li.divider.all_aspects.radio{:style => "padding-bottom: 5px; border-bottom: 1px solid #ddd;", "data-aspect_id" => "all_aspects", :class => ("selected" if (!publisher_public && all_aspects_selected?(selected_aspects)))} = t('all_aspects') - for aspect in all_aspects diff --git a/app/views/shared/_right_sections.html.haml b/app/views/shared/_right_sections.html.haml index d0a0cd5b0..565e15dcd 100644 --- a/app/views/shared/_right_sections.html.haml +++ b/app/views/shared/_right_sections.html.haml @@ -3,7 +3,7 @@ -# the COPYRIGHT file. -- if AppConfig[:open_invitations] +- if AppConfig.settings.invitations.open? .section .title = image_tag('icons/plus.png') @@ -73,8 +73,8 @@ %h5 = t('aspects.index.donate') .content - - if AppConfig[:paypal_hosted_button_id].present? - = t('aspects.index.keep_pod_running', :pod => URI.parse(AppConfig[:pod_url]).host) + - if AppConfig.settings.paypal_hosted_button_id.present? + = t('aspects.index.keep_pod_running', :pod => AppConfig.pod_uri.host) %br = render 'shared/donatepod' - else diff --git a/app/views/shared/_stream_element.mobile.haml b/app/views/shared/_stream_element.mobile.haml index 89253cd61..1796df185 100644 --- a/app/views/shared/_stream_element.mobile.haml +++ b/app/views/shared/_stream_element.mobile.haml @@ -12,7 +12,7 @@ - if post.is_a?(Reshare) - = render 'reshares/reshare', :reshare => post, :post => post.root + = render 'reshares/reshare', :reshare => post, :post => post.absolute_root = render 'shared/photo_area', :post => post diff --git a/app/views/status_messages/_status_message.mobile.haml b/app/views/status_messages/_status_message.mobile.haml index 00d743ed2..f28f9bc04 100644 --- a/app/views/status_messages/_status_message.mobile.haml +++ b/app/views/status_messages/_status_message.mobile.haml @@ -10,7 +10,7 @@ - if post.photos.size > 1 .additional_photo_count = "+ #{post.photos.size-1}" - = image_tag post.photos.first.url(:thumb_large), :class => "stream-photo big-stream-photo" + = image_tag post.first_photo_url(:thumb_large), :class => "stream-photo big-stream-photo" - elsif post.activity_streams? = image_tag post.image_url diff --git a/app/views/status_messages/bookmarklet.html.haml b/app/views/status_messages/bookmarklet.html.haml index b1e7e2c36..992da8686 100644 --- a/app/views/status_messages/bookmarklet.html.haml +++ b/app/views/status_messages/bookmarklet.html.haml @@ -9,8 +9,9 @@ = render :partial => 'shared/publisher', :locals => { :aspect => :profile, :selected_aspects => @aspects, :aspect_ids => @aspect_ids } :javascript - Publisher.bookmarklet = true; - app.publisher = new app.views.Publisher(); + app.publisher = new app.views.Publisher({ + standalone: true + }); var contents = "#{escape_javascript params[:title]} - #{escape_javascript params[:url]}"; var notes = "#{escape_javascript params[:notes]}"; diff --git a/app/views/status_messages/new.html.haml b/app/views/status_messages/new.html.haml index 53185ce11..fb87afa89 100644 --- a/app/views/status_messages/new.html.haml +++ b/app/views/status_messages/new.html.haml @@ -1,13 +1,8 @@ -# Copyright (c) 2010-2011, Diaspora Inc. This file is -# licensed under the Affero General Public License version 3 or later. See -# the COPYRIGHT file. -= javascript_include_tag 'jquery.textchange.js', "publisher.js" -:javascript - $(function() { - $("#publisher").bind('ajax:success', function(){ location.reload(); }); - Publisher.bookmarklet = true; - }); += javascript_include_tag :home #new_status_message_pane .span-15.last @@ -17,3 +12,10 @@ = render :partial => 'shared/publisher', :locals => { :aspect => @aspect, :aspect_ids => @aspect_ids, :selected_aspects => @aspects_with_person, :person => @person} +:javascript + $(function() { + app.publisher = new app.views.Publisher({ + standalone: true + }); + $("#publisher").bind('ajax:success', function(){ location.reload(); }); + }); \ No newline at end of file diff --git a/app/views/users/getting_started.haml b/app/views/users/getting_started.haml index 15d9428b1..66659f417 100644 --- a/app/views/users/getting_started.haml +++ b/app/views/users/getting_started.haml @@ -38,7 +38,7 @@ .clearfix = label_tag 'profile[first_name]', t('profiles.edit.your_name'), :class => "bootstrapped" .input - = text_field_tag 'profile[first_name]', current_user.person.profile.first_name + = text_field_tag 'profile[first_name]', current_user.first_name = image_tag 'ajax-loader.gif', :id => "gs-name-form-spinner", :class => "hidden" %span.saved{:class => "hidden"} diff --git a/app/views/users/privacy_settings.html.haml b/app/views/users/privacy_settings.html.haml index 7fd59f8a0..c404ed816 100644 --- a/app/views/users/privacy_settings.html.haml +++ b/app/views/users/privacy_settings.html.haml @@ -15,7 +15,7 @@ = t('.ignored_users') - @blocks.each do |block| - = block.person.name + = block.person_name \- = link_to t('.stop_ignoring'), block_path(block), :method => :delete diff --git a/app/views/users/public.atom.builder b/app/views/users/public.atom.builder index a4d4ee035..3c5fb21a7 100644 --- a/app/views/users/public.atom.builder +++ b/app/views/users/public.atom.builder @@ -8,14 +8,14 @@ atom_feed({'xmlns:thr' => 'http://purl.org/syndication/thread/1.0', :id => "#{@user.public_url}.atom", :root_url => "#{@user.public_url}"}) do |feed| - feed.tag! :generator, 'Diaspora', :uri => "#{AppConfig[:pod_url]}" + feed.tag! :generator, 'Diaspora', :uri => "#{AppConfig.pod_uri.to_s}" feed.title "#{@user.name}'s Public Feed" feed.subtitle "Updates from #{@user.name} on Diaspora" - feed.logo "#{@user.person.profile.image_url(:thumb_small)}" + feed.logo "#{@user.image_url(:thumb_small)}" feed.updated @posts[0].created_at if @posts.length > 0 feed.tag! :link, :rel => 'avatar', :type => 'image/jpeg', 'media:width' => '100', - 'media:height' => '100', :href => "#{@user.profile.image_url}" - feed.tag! :link, :href => "#{AppConfig[:pubsub_server]}", :rel => 'hub' + 'media:height' => '100', :href => "#{@user.image_url}" + feed.tag! :link, :href => "#{AppConfig.environment.pubsub_server}", :rel => 'hub' feed.author do |author| author.name @user.name @@ -23,13 +23,13 @@ atom_feed({'xmlns:thr' => 'http://purl.org/syndication/thread/1.0', author.tag! 'activity:object-type', 'http://activitystrea.ms/schema/1.0/person' author.tag! 'poco:preferredUsername', @user.username - author.tag! 'poco:displayName', @user.person.name + author.tag! 'poco:displayName', @user.name end @posts.each do |post| - feed.entry post, :url => "#{@user.person.url}p/#{post.id}", - :id => "#{@user.person.url}p/#{post.id}" do |entry| + feed.entry post, :url => "#{@user.url}p/#{post.id}", + :id => "#{@user.url}p/#{post.id}" do |entry| entry.title truncate(post.formatted_message(:plain_text => true), :length => 50) entry.content auto_link(post.formatted_message(:plain_text => true)), :type => 'html' diff --git a/config/application.rb b/config/application.rb index 0101be8b4..2292ce01f 100644 --- a/config/application.rb +++ b/config/application.rb @@ -24,7 +24,6 @@ if defined?(Bundler) # Bundler.require(:default, :assets, Rails.env) end - module Diaspora class Application < Rails::Application # Settings in config/environments/* take precedence over those specified here. @@ -73,7 +72,6 @@ module Diaspora # Enable the asset pipeline config.assets.enabled = true - # Do not load whole env on precompile config.assets.initialize_on_precompile = false # Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added) @@ -99,8 +97,3 @@ module Diaspora end end - -# Only load asset_sync if S3 is configured -if RAILS_GROUPS.include?(:assets) && ENV['AWS_ACCESS_KEY_ID'] - require 'asset_sync' -end diff --git a/config/application.yml.example b/config/application.yml.example deleted file mode 100644 index 6c1c8f47b..000000000 --- a/config/application.yml.example +++ /dev/null @@ -1,280 +0,0 @@ -# Copyright (c) 2010-2011, Diaspora Inc. This file is -# licensed under the Affero General Public License version 3 or later. See -# the COPYRIGHT file. - -defaults: &defaults - - ###################################################### - # Environment Configuration - ###################################################### - - ## Set the hostname of the machine you're running Diaspora on, as seen - ## from the internet. This should be the URL you want to use to - ## access the pod. So if you plan to reverse proxy it, it should be - ## the URL the proxy listens on. - ## DO NOT CHNANGE THIS AFTER INITIAL SETUP - ## UNLESS YOU KNOW WHAT YOU'RE DOING! - ## However changing http to https is okay and has no consquences. - ## If you do change it you have to start over as it's hardcoded into - ## the database. - pod_url: "http://localhost:3000/" - - ## Setting the bundle of certificate authorities (CA) certificates. - ## This is operating system specific. - ## Examples, uncomment one or add your own: - ca_file: '/etc/pki/tls/certs/ca-bundle.crt' - - ## Redis URL for a remote redis. - ## Don't forget to restrict IP access! - ## Leave it empty for the default ('redis://localhost:6379/0') - ## You can specify a username and password in it, for example - ## redis://user:password@remote_host:6379/0 - ## You can also specify a unix socket URL like unix://tmp/redis.sock - redis_url: - - ## Serve static assets via the appserver. - ## This is highly not recommended for production use, - ## let your reverse proxy/webserver do it by serving the files - ## under public/ directly. - serve_static_assets: false - - ## Disable SSL requirement - #when set, your pod will not force you to use https in production - #NOTE: not all features of Diaspora work without SSL, and you may have trouble federating - # with other pods - circumvent_ssl_requirement: false - - # If set to true Diaspora will work with just the appserver, thin by default, - # running, however this makes it quite slow as all the time intensive jobs - # must be run inside the request cycle. Also the live updates from the Websocket - # will be disabled. - single_process_mode: true - - ## Use Amazon S3 instead of your local filesystem - ## to handle uploaded pictures. - # s3 config - if set, carrierwave will store your photos on s3. Otherwise they're on the filesystem. - #s3_key: 'key' - #s3_secret: 'secret' - #s3_bucket: 'my_photos' - s3_region: 'us-east-1' - - ## Related to S3 you can set a url to redirect all requests to uploaded - ## images to another host. If you for example set - ## https://images.example.org here, all requests made to - ## pictures under /uploads/images will be redirected to - ## https://images.example.org/uploads/images/... - image_redirect_url: '' - - ## Diaspora is only tested against this default pubsub server. - ## You probably don't want to change this. - pubsub_server: 'https://pubsubhubbub.appspot.com/' - - ## Include jQuery from Google's CDN - ## This potentially saves you some traffic and speeds up - ## load time since most clients already have this one cached - jquery_cdn: false - - ## Provide a key to enable tracking by Google Analytics - google_a_site: false - - ## Piwik Tracking - ## Provide a site ID and the host piwik is running on to enable - ## tracking through Piwik. - # piwik integration - if not set, no javascript included - piwik_id: - # the site url in raw format (e.g. pikwik.examplehost.com) - piwik_url: - - ## Chartbeat tracking - chartbeat_uid: - - ## Mixpanel event tracking - mixpanel_uid: - - - ###################################################### - # General Pod Settings - ###################################################### - - ## Name of your pod - pod_name: "Diaspora*" - - ## Set this to true to prevent people from signing up for your pod - ## without an invitation. Note that this needs to be true even for - ## the first registration (you). - registrations_closed: false - - ## Set this to true if you don't want your users to follow the - ## diasporahq@joindiaspora.com account on account creation. - ## The diasporahq account helps users start with some activity in - ## their stream and get news about Diaspora, but if you want - ## your server to contact joindiaspora.com, set this to false: - no_follow_diasporahq: false - - ## the 'admin' account for your pod... ie for jd.com, this is diasporahq. - ## (This is not about privileges, but e.g. to determine the sender for - ## emails sent from the admin panel. If you want to configure an actual - ## admin accout, use roles instead. See - ## https://github.com/diaspora/diaspora/wiki/FAQ-for-Pod-Maintainers - ## "What are roles and how do I use them?") - admin_account: '' - - ## Settings about invitations - - # Set this to true if you want users to invite as many people as they want - open_invitations: true - - #the default amount of invitiations for an invite link - invite_count: 25 - - ## Paypal donations - ## You can provide the ID of a hosted Paypal button here to kindly ask - ## your users for donations to run their pod. If you leave this out - ## we kindly ask your users to donate to the Diaspora Foundation :) - paypal_hosted_button_id: "" - - - ## Community Spotlight - ## The community spotlight gives new users a starting point on who - ## could be interesting Diasporas community. - ## -------- - ## DEPRECATED - use roles instead, see - ## https://github.com/diaspora/diaspora/wiki/FAQ-for-Pod-Maintainers - ## "What are roles and how do I use them?" - ## -------- - #community_spotlight: - #list: - #- 'diasporahq@joindiaspora.com' - #- 'me@example.org' - - ## E-Mail address users can make suggestions about who should be - ## in the spotlight to. - spotlight_suggest_email: '' - - ###################################################### - # Email Configuration - ###################################################### - - ## First you need to enable it ;) - mailer_on: false - - ## Sender address used in mail send by Diaspora - #sender_address: 'no-reply@example.org' - - ## This selects which mailer should be used. Take 'smtp' for a smtp - ## connection, 'sendmail' to use the sendmail binary or - ## 'messagebus' to use the messagebus service. - mailer_method: 'smtp' - - # Address/port to smtp server handling outgoing mail. - smtp_address: 'smtp.example.com' - smtp_port: '587' - - #API key if you are using message bus - message_bus_api_key: '' - - # The path to the sendmail binary. Ignored if mailer_method is not set to sendmail - sendmail_location: '/usr/sbin/sendmail' - - # Set this to true if you want to use exim and sendmail - sendmail_exim_fix: false - - # Authentication required to send mail. Use one of 'plain', - # 'login' or 'cram_md5'. Use 'none' if server does not support - # authentication - smtp_authentication: 'plain' - - # Automatically enable TLS? Ignored if smtp_authentication is set to none - smtp_starttls_auto: true - - # OpenSSL verify mode used when connecting to a SMTP server with TLS. - # Set this to none if you have a self signed certificate, keep it empty (not '') for the default - # Possible values: none, peer, client_once, fail_if_no_peer_cert - smtp_openssl_verify_mode: - - # Domain of smtp server. - # This should match the common name of the certificate - # the SMTP server sends. If he sends one - smtp_domain: 'example.com' - - # Credentials to log in to the SMTP server - may be necessary if - # smtp_authentication is not 'none' - smtp_username: 'smtp_username' - smtp_password: 'secret' - - # Sender address in Diaspora's outgoing mail. - smtp_sender_address: 'no-reply@joindiaspora.com' - - ###################################################### - # Social Service Configuration - ###################################################### - - ## OAuth credentials for Facebook: - facebook_app_id: '' - facebook_app_secret: '' - - #this will be the namespace for your object, it should be configured in your FB app - open_graph_namespace: '' - - - ## OAuth credentials for Twitter: - twitter_consumer_key: '' - twitter_consumer_secret: '' - - ## OAuth credentials for Tumblr - tumblr_consumer_key: '' - tumblr_consumer_secret: '' - - - ###################################################### - # Debugging Service Tool Integration - ###################################################### - - ## Resque is the background processing sysem used by Diaspora - ## Resque web is an admin tool for it. This settings decides wheter - ## or not to inline it into Diaspora. - mount_resque_web: true - - ## If you use Airbrake provide your API key here: - airbrake_api_key: '' - - ## If you use NewRelic provide your credentials here: - NEW_RELIC_LICENSE_KEY: '' - new_relic_app_name: '' - -###################################################### -# Overrides -###################################################### - -development: - <<: *defaults - serve_static_assets: true - no_follow_diasporahq: true - -production: - <<: *defaults - jquery_cdn: true - -################################################## -# FEDERATION LOGGER ############################## -# Do not touch unless you know what you're doing!# -################################################## - -test: - <<: *defaults - pod_url: "http://localhost:9887/" - socket_port: 8081 - open_invitations: true - no_follow_diasporahq: true - serve_static_assets: true - mailer_on: true - -integration1: - <<: *defaults - pod_url: "http://localhost:3001/" - serve_static_assets: true - -integration2: - <<: *defaults - pod_url: "http://localhost:3002/" - serve_static_assets: true diff --git a/config/boot.rb b/config/boot.rb index a5ba1b160..d9ac11c52 100644 --- a/config/boot.rb +++ b/config/boot.rb @@ -19,4 +19,4 @@ rescue Bundler::GemNotFound => e STDERR.puts e.message STDERR.puts "Try running `bundle install`." exit! -end if File.exist?(gemfile) \ No newline at end of file +end if File.exist?(gemfile) diff --git a/config/database.yml.example b/config/database.yml.example index 858d998a7..ddda09fea 100644 --- a/config/database.yml.example +++ b/config/database.yml.example @@ -16,20 +16,24 @@ postgres: &postgres password: encoding: unicode -# You can ignore this -postgres_travis: &postgres_travis - adapter: postgresql - username: postgres - # Comment the the mysql line and uncomment the postgres line # if you want to use postgres -common: &common +choose: &choose # Choose one of the following <<: *mysql #<<: *postgres - + +################################################## +#### CONFIGURE ABOVE ############################# +################################################## # Normally you don't need to touch anything here + +postgres_travis: &postgres_travis + adapter: postgresql + username: postgres +common: &common + <<: *choose development: <<: *common database: diaspora_development @@ -38,7 +42,7 @@ production: database: diaspora_production test: <<: *common - database: "diaspora_test<%= ENV['TEST_ENV_NUMBER'] %>" + database: "diaspora_test" integration1: <<: *common database: diaspora_integration1 diff --git a/config/defaults.yml b/config/defaults.yml new file mode 100644 index 000000000..d1f9932a6 --- /dev/null +++ b/config/defaults.yml @@ -0,0 +1,124 @@ +####################################################################### +############### DO NOT TOUCH ANYTHING BELOW THIS ###################### +####################################################################### + +defaults: + version: + number: "0.0.1.0" + release: false # Do not touch unless in a merge conflict on doing a release, master should have a commit setting this to true which is not backported to the develop branch. + heroku: false + environment: + url: "http://localhost:3000/" + certificate_authorities: + redis: + require_ssl: true + single_process_mode: false + s3: + enable: false + key: + secret: + bucket: + region: + image_redirect_url: + assets: + serve: false + upload: false + host: + pubsub_server: 'https://pubsubhubbub.appspot.com/' + unicorn: + embed_resque_worker: false + privacy: + jquery_cdn: true + google_analytics_key: + piwik: + enable: false + host: + site_id: + mixpanel_uid: + chartbeat_uid: + settings: + pod_name: "Diaspora*" + enable_registrations: true + follow_diasporahq: true + invitations: + open: true + count: 25 + paypal_hosted_button_id: + community_spotlight: + enable: false + suggest_email: + services: + facebook: + enable: false + app_id: + secret: + open_graph_namespace: 'joindiaspora' + twitter: + enable: false + key: + secret: + tumblr: + enable: false + key: + secret: + mail: + enable: false + sender_address: 'no-reply@example.org' + method: 'smtp' + smtp: + host: 'localhost' + port: 587 + authentication: 'plain' + username: + password: + starttls_auto: true + openssl_verify_mode: + domain: + sendmail: + location: '/usr/sbin/sendmail' + exim_fix: false + message_bus_api_key: + admins: + account: + inline_resque_web: true + +development: + environment: + assets: + serve: true + single_process_mode: true + require_ssl: false + settings: + follow_diasporahq: false +production: + i_am_a_dummy: # Remove if you add an actual override +test: + environment: + url: "http://localhost:9887/" + single_process_mode: true + require_ssl: false + assets: + serve: true + settings: + follow_diasporahq: false + invitations: + open: true + services: + facebook: + enable: true + app_id: 'fake' + secret: 'sdoigjosdfijg' + mail: + enable: true +integration1: + environment: + url: "http://localhost:45789/" + assets: + serve: true + require_ssl: false +integration2: + environment: + url: "http://localhost:34658/" + assets: + serve: true + require_ssl: false diff --git a/config/deploy.rb b/config/deploy.rb index 85ca3525c..44521a727 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -32,8 +32,7 @@ end namespace :deploy do task :symlink_config_files do run "ln -s -f #{shared_path}/config/database.yml #{current_path}/config/database.yml" - run "ln -s -f #{shared_path}/config/application.yml #{current_path}/config/application.yml" - run "ln -s -f #{shared_path}/config/oauth_keys.yml #{current_path}/config/oauth_keys.yml" + run "ln -s -f #{shared_path}/config/diaspora.yml #{current_path}/config/diaspora.yml" end task :symlink_cookie_secret do diff --git a/config/diaspora.yml.example b/config/diaspora.yml.example new file mode 100644 index 000000000..7c765147b --- /dev/null +++ b/config/diaspora.yml.example @@ -0,0 +1,279 @@ +## Some notes about this file: +## - All comments start with a double # +## - All settings are by default commented out with a single # +## You need to uncomment them in order to work. +## - Take care to keep proper indentation, that is keeping the indentation +## of the original #, with no additional space before the settings +## name. +## - Take care to keep proper quoting. All ' should have a matching ' at +## the end of the same line. Same goes for " +## - Lines containing "## Section" are sections, categories or however you +## like to name them. Do not edit those! +## - Lists need the space after the - +## - true, false and numbers should have no quoting. +## Single words could have none, but doesn't do any harm to them. +## +## You can set and/or override all this settings through environment variables +## with the following conversion rules: +## - Strip the top level namespace (configuration, production, etc.) +## - Build the path to the setting, for example environment.s3.enable +## - Replace the dots with underscores: environment_s3_enable +## - Upcase everything: ENVIRONMENT_S3_ENABLE +## - Specify lists/arrays as comma separated values + +configuration: ## Section + + ## Settings you need to change or at least review + ## in order for your pod to basically work + environment: ## Section + + ## Set the hostname of the machine you're running Diaspora on, as seen + ## from the internet. This should be the URL you want to use to + ## access the pod. So if you plan to reverse proxy it, it should be + ## the URL the proxy listens on. + ## DO NOT CHNANGE THIS AFTER INITIAL SETUP + ## UNLESS YOU KNOW WHAT YOU'RE DOING! + ## However changing http to https is okay and has no consequences. + ## If you do change it you have to start over as it's hardcoded into + ## the database. + #url: "https://example.org/" + + ## Setting the bundle of certificate authorities (CA) certificates. + ## This is operating system specific. + ## Examples, uncomment one or add your own: + ## Debian, Ubuntu, Archlinux (package ca-certificates) + #certificate_authorities: '/etc/ssl/certs/ca-certificates.crt' + ## CentOS + #certificate_authorities: '/etc/pki/tls/certs/ca-bundle.crt' + ## Gentoo + #certificate_authorities: '/etc/ssl/certs/ca-certificates.crt' + + ## URL for a remote redis. + ## Don't forget to restrict the IP access! + ## Leave it commented out for the default (localhost) + #redis: 'redis://exmaple_host' + #redis: 'redis://username:password@host:6379/0' + #redis: 'unix:///tmp/redis.sock' + + ## Require SSL, default true. + ## When set, your pod will force you to use https in production. + ## Since OAuth2 requires SSL Diasporas future API might not work if you're not + ## on SSL. Also no gurantee that posting to services is given if SSL + ## is disabled. + #require_ssl: true + + ## Single process mode + ## If set to true Diaspora will work with just the appserver, + ## thin by default, running, however this makes it quite slow as + ## all the time intensive jobs must be run inside the request cycle. + ## So this is higly unrecommended for production setups. + #single_process_mode: true + + ## Use Amazon S3 instead of your local filesystem + ## to handle uploaded pictures. + s3: ## Section + #enable: true + #key: 'changeme' + #secret: 'changeme' + #bucket: 'my_photos' + #region: 'us-east-1' + + ## Related to S3 you can set a url to redirect all requests to uploaded + ## images to another host. If you for example set + ## https://images.example.org here, all requests made to + ## pictures under /uploads/images will be redirected to + ## https://images.example.org/uploads/images/... + #image_redirect_url: 'https://images.example.org' + + assets: ## Section + ## Serve static assets via the appserver. + ## This is highly discouraged for production use, + ## let your reverse proxy/webserver do it by serving the files + ## under public/ directly. + #serve: true + + ## Upload your assets to S3 + #upload: true + + ## Specify an asset host. Ensure it does not have a trailing slash (/). + #host: http://cdn.example.org/diaspora + + ## Diaspora is only tested against this default pubsub server. + ## You likely don't want to change this. + #pubsub_server: 'https://pubsubhubbub.appspot.com/' + + unicorn: ## Section + ## Embed a resque worker inside the unicorn process, useful for + ## minimal Heroku setups + #embed_resque_worker: true + + ## Settings probably affecting the privacy of your users + privacy: ## Section + + ## Include jQuery from Google's CDN + ## This potentially saves you some traffic and speeds up + ## load time since most clients already have this one cached + #jquery_cdn: true + + ## Provide a key to enable tracking by Google Analytics + #google_analytics_key: + + ## Piwik Tracking + ## Provide a site ID and the host piwik is running on to enable + ## tracking through Piwik. + piwik: ## Section + #enable: true + #host: 'stats.example.org' + #site_id: 1 + + ## Mixpanel event tracking + #mixpanel_uid: + + ## Chartbeat tracking + #chartbeat_uid: + + ## General settings + settings: ## Section + + ## The name of your pod displayed in various locations, + ## including the header. + #pod_name: "Diaspora*" + + ## Set this to false to prevent people from signing up for your pod + ## without an invitation. Note that this needs to be true even for + ## the first registration (you). + #enable_registrations: true + + ## Set this to false if you don't want your users to follow the + ## diasporahq@joindiaspora.com account on account creation. + ## The diasporahq account helps users start with some activity in + ## their stream and get news about Diaspora, but if you don't want + ## your server to contact joindiaspora.com, set this to false: + #follow_diasporahq: false + + ## Settings about invitations + invitations: ## Section + + ## Set this to true if you want users to invite as many + ## people as they want. + #open: true + + ## The default amount of invitiations an invite link has. + ## Every user has such a link. Only counts if open is false. + #count: 25 + + ## Paypal donations + ## You can provide the ID of a hosted Paypal button here to kindly ask + ## your users for donations to run their pod. If you leave this out + ## we kindly ask your users to donate to the Diaspora Foundation :) + #paypal_hosted_button_id: "" + + ## Community Spotlight + ## The community spotlight gives new users a starting point on who + ## could be interesting Diasporas community. To add a person + ## to the spotlight add the 'spotlight' role to it. + community_spotlight: ## Section + #enable: false + ## E-Mail address users can make suggestions about who should be + ## in the spotlight to. + #suggest_email: 'admin@example.org' + + ## Setup E-Mail + mail: ## Section + + ## First you need to enable it ;) + #enable: true + + ## Sender address used in mail send by Diaspora + #sender_address: 'no-reply@example.org' + + ## This selects which mailer should be used. Take 'smtp' for a smtp + ## connection, 'sendmail' to use the sendmail binary or + ## 'messagebus' to use the messagebus service. + #method: 'smtp' + + ## Ignore if method isn't 'smtp' + smtp: ## Section + ## Host and port of the smtp server handling outgoing mail. + ## This should match the common name of the certificate + ## the SMTP server sends. If he sends one. + #host: 'smtp.example.org' + #port: 587 + + ## Authentication required to send mail. Use one of 'plain', + ## 'login' or 'cram_md5'. Use 'none' if server does not support + ## authentication + #authentication: 'plain' + + ## Credentials to log in to the SMTP server - may be necessary if + ## authentication is not 'none' + #username: 'changeme' + #password: 'changeme' + + ## Automatically enable TLS? Ignored if authentication is set to none + #starttls_auto: true + + ## The domain for the HELO command if needed + #domain: 'smtp.example.org' + + ## OpenSSL verify mode used when connecting to a + ## SMTP server with TLS. Set this to none if you have + ## a self signed certificate. Possible values: + ## 'none', 'peer', 'client_once', 'fail_if_no_peer_cert' + #openssl_verify_mode: 'none' + + ## Ignore if method isn't 'sendmail' + sendmail: ## Section + ## The path to the sendmail binary. + #location: '/usr/sbin/sendmail' + + ## Set this to true if you want to use exim and sendmail + #exim_fix: true + + ## Ignore if method isn't 'messagebus' + #message_bus_api_key: 'abcdef' + + ## Settings around Diasporas capabilities to post to services + services: ## Section + ## OAuth credentials for Facebook: + facebook: ## Section + #enable: true + #app_id: 'abcdef' + #secret: 'changeme' + ## this will be the namespace for your object, + ## it should be configured in your FB app + #open_graph_namespace: + + ## OAuth credentials for Twitter: + twitter: ## Section + #enable: true + #key: 'abcdef' + #secret: 'changeme' + + ## OAuth credentials for Tumblr + tumblr: ## Section + #enable: true + #key: 'abcdef' + #secret: 'changeme' + + ## Settings relevant to administrators + admins: ## Section + + ## Set the admin account. + ## This doesn't make the user an admin but is used when a generic + ## admin contact is neeeded, much like the postmaster role in mail + ## systems. Set only the username, NOT the full ID. + #account: "podmaster" + + ## Resque is the background processing system used by Diaspora + ## Resque web is an admin tool for it. This settings decides whether + ## or not to inline it into Diaspora. + #inline_resque_web: true + +## Here you can make overides to settings defined above if you need +## to have them different in different environments. +production: ## Section + +development: ## Section + environment: ## Section + #redis_url: 'redis://production.example.org:6379' diff --git a/config/environment.rb b/config/environment.rb index c55253105..07256b9f7 100644 --- a/config/environment.rb +++ b/config/environment.rb @@ -13,7 +13,10 @@ end # Load the rails application require File.expand_path('../application', __FILE__) -require File.join(Rails.root, "lib", "exceptions") +require Rails.root.join("lib", "exceptions") + +# Load configuration system early +require Rails.root.join('config', 'load_config') Haml::Template.options[:format] = :html5 Haml::Template.options[:escape_html] = true diff --git a/config/environments/production.rb b/config/environments/production.rb index f4dc824f9..052bded5d 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -37,12 +37,6 @@ Diaspora::Application.configure do # In production, Apache or nginx will already do this config.serve_static_assets = false - - # Enable serving of images, stylesheets, and javascripts from an asset server - if ENV['ASSET_HOST'] - config.action_controller.asset_host = ENV['ASSET_HOST'] - end - # Disable delivery errors, bad email addresses will be ignored # config.action_mailer.raise_delivery_errors = false @@ -55,6 +49,10 @@ Diaspora::Application.configure do # Generate digests for assets URLs config.assets.digest = true + if defined?(AppConfig) && AppConfig.environment.assets.host.present? + config.action_controller.asset_host = AppConfig.environment.assets.host.get + end + config.threadsafe! end diff --git a/config/heroku.yml.example b/config/heroku.yml.example deleted file mode 100644 index f069a6668..000000000 --- a/config/heroku.yml.example +++ /dev/null @@ -1,17 +0,0 @@ -defaults: &defaults - HEROKU: true - application_yml: <%= '../' + '../' +'config/' + 'application.yml.example' %> -production: - app: production - stack: cedar - config: - <<: *defaults - BUNDLE_WITHOUT: "development:test" - HOME_FILE: 'app/views/home/_show.html.haml' -staging: - app: staging - stack: cedar - config: - <<: *defaults - BUNDLE_WITHOUT: "development:test" - HOME_FILE: 'app/views/home/_show.html.haml' diff --git a/config/initializers/1_intialize_app_config.rb b/config/initializers/1_intialize_app_config.rb deleted file mode 100644 index ccda76cc9..000000000 --- a/config/initializers/1_intialize_app_config.rb +++ /dev/null @@ -1,5 +0,0 @@ -# Copyright (c) 2010-2011, Diaspora Inc. This file is -# licensed under the Affero General Public License version 3 or later. See -# the COPYRIGHT file. - -require Rails.root.join('app', 'models', 'app_config') \ No newline at end of file diff --git a/config/initializers/2_before_load_services.rb b/config/initializers/2_before_load_services.rb deleted file mode 100644 index 48f2a23f3..000000000 --- a/config/initializers/2_before_load_services.rb +++ /dev/null @@ -1,18 +0,0 @@ -# Copyright (c) 2010-2011, Diaspora Inc. This file is -# licensed under the Affero General Public License version 3 or later. See -# the COPYRIGHT file. - -def load_config_yaml filename - YAML.load(ERB.new(File.read(filename)).result) -end - -oauth_keys_file = Rails.root.join('config', 'oauth_keys.yml').to_s - - -SERVICES = load_config_yaml("#{oauth_keys_file}.example") - -#this is to be backwards compatible with current production setups -if File.exist? oauth_keys_file - ActiveSupport::Deprecation.warn("01/05/2012 keys in oauth_keys.yml should be moved into application.yml. SEE application.yml.example for updated key names") - SERVICES.deep_merge!(load_config_yaml(oauth_keys_file)) -end diff --git a/config/initializers/3_setup_app_config.rb b/config/initializers/3_setup_app_config.rb deleted file mode 100644 index 7125cb588..000000000 --- a/config/initializers/3_setup_app_config.rb +++ /dev/null @@ -1 +0,0 @@ -AppConfig.setup! diff --git a/config/initializers/airbrake.rb b/config/initializers/airbrake.rb deleted file mode 100644 index 5d7a680f8..000000000 --- a/config/initializers/airbrake.rb +++ /dev/null @@ -1,12 +0,0 @@ -# Copyright (c) 2012, Diaspora Inc. This file is -# licensed under the Affero General Public License version 3 or later. See -# the COPYRIGHT file. - -Airbrake.configure do |config| - if AppConfig[:airbrake_api_key].present? - config.api_key = AppConfig[:airbrake_api_key] - else - # creative way to disable Airbrake, should be replaced once the gem provides a proper way - config.development_environments << Rails.env - end -end diff --git a/config/initializers/asset_sync.rb b/config/initializers/asset_sync.rb new file mode 100644 index 000000000..227cde492 --- /dev/null +++ b/config/initializers/asset_sync.rb @@ -0,0 +1,28 @@ + +if AppConfig.environment.assets.upload? && AppConfig.environment.s3.enable? + require 'asset_sync' + AssetSync.configure do |config| + config.enabled = true + + config.fog_provider = 'AWS' + config.aws_access_key_id = AppConfig.environment.s3.key.get + config.aws_secret_access_key = AppConfig.environment.s3.secret.get + config.fog_directory = AppConfig.environment.s3.bucket.get + + # Increase upload performance by configuring your region + config.fog_region = AppConfig.environment.s3.region.get + # + # Don't delete files from the store + # config.existing_remote_files = "keep" + # + # Automatically replace files with their equivalent gzip compressed version + # config.gzip_compression = true + # + # Use the Rails generated 'manifest.yml' file to produce the list of files to + # upload instead of searching the assets directory. + # config.manifest = true + # + # Fail silently. Useful for environments such as Heroku + # config.fail_silently = true + end +end diff --git a/config/initializers/static_assets.rb b/config/initializers/assets.rb similarity index 74% rename from config/initializers/static_assets.rb rename to config/initializers/assets.rb index 4284e185d..246e2771e 100644 --- a/config/initializers/static_assets.rb +++ b/config/initializers/assets.rb @@ -3,6 +3,6 @@ # the COPYRIGHT file. Diaspora::Application.configure do - config.serve_static_assets = AppConfig[:serve_static_assets] unless AppConfig[:serve_static_assets].nil? + config.serve_static_assets = AppConfig.environment.assets.serve? # config.static_cache_control = "public, max-age=3600" if AppConfig[:serve_static_assets].to_s == 'true' end diff --git a/config/initializers/carrierwave.rb b/config/initializers/carrierwave.rb index 148e3aab5..9782335ef 100644 --- a/config/initializers/carrierwave.rb +++ b/config/initializers/carrierwave.rb @@ -3,18 +3,18 @@ # the COPYRIGHT file. #Excon needs to see the CA Cert Bundle file -ENV["SSL_CERT_FILE"] = AppConfig[:ca_file] +ENV['SSL_CERT_FILE'] = AppConfig.environment.certificate_authorities.get CarrierWave.configure do |config| - if !Rails.env.test? && AppConfig[:s3_key] && AppConfig[:s3_secret] && AppConfig[:s3_bucket] && AppConfig[:s3_region] + if !Rails.env.test? && AppConfig.environment.s3.enable? config.storage = :fog config.cache_dir = Rails.root.join('tmp', 'uploads').to_s config.fog_credentials = { - :provider => 'AWS', - :aws_access_key_id => AppConfig[:s3_key], - :aws_secret_access_key => AppConfig[:s3_secret], - :region => AppConfig[:s3_region] + :provider => 'AWS', + :aws_access_key_id => AppConfig.environment.s3.key.get, + :aws_secret_access_key => AppConfig.environment.s3.secret.get, + :region => AppConfig.environment.s3.region.get } - config.fog_directory = AppConfig[:s3_bucket] + config.fog_directory = AppConfig.environment.s3.bucket.get else config.storage = :file end diff --git a/config/initializers/check_session_secret.rb b/config/initializers/check_session_secret.rb index 87e385c7e..563143dcf 100644 --- a/config/initializers/check_session_secret.rb +++ b/config/initializers/check_session_secret.rb @@ -1 +1,6 @@ -EnvironmentConfiguration.ensure_secret_token! \ No newline at end of file +if AppConfig.heroku? + Rails.application.config.secret_token = AppConfig.secret_token +elsif !File.exists?( Rails.root.join('config', 'initializers', 'secret_token.rb')) + `bundle exec rake generate:secret_token` + require Rails.root.join('config', 'initializers', 'secret_token.rb') +end diff --git a/config/initializers/devise.rb b/config/initializers/devise.rb index 5e5ec0313..8f6c83204 100644 --- a/config/initializers/devise.rb +++ b/config/initializers/devise.rb @@ -21,9 +21,9 @@ Devise.setup do |config| require 'devise/orm/active_record' #mail setup - if AppConfig[:smtp_sender_address] - config.mailer_sender = AppConfig[:smtp_sender_address] - else + if AppConfig.mail.sender_address.present? + config.mailer_sender = AppConfig.mail.sender_address + elsif AppcConfig.mail.enable? unless Rails.env == 'test' Rails.logger.warn("No smtp sender address set, mail may fail.") puts "WARNING: No smtp sender address set, mail may fail." diff --git a/config/initializers/enforce_ssl.rb b/config/initializers/enforce_ssl.rb index 80f2bc97d..65a9951c1 100644 --- a/config/initializers/enforce_ssl.rb +++ b/config/initializers/enforce_ssl.rb @@ -2,7 +2,7 @@ # licensed under the Affero General Public License version 3 or later. See # the COPYRIGHT file. -if EnvironmentConfiguration.enforce_ssl? +if AppConfig.environment.require_ssl? Rails.application.config.middleware.insert_before 0, Rack::SSL puts "Rack::SSL is enabled" end diff --git a/config/initializers/faraday.rb b/config/initializers/faraday.rb index cd96e1c28..30b827fcb 100644 --- a/config/initializers/faraday.rb +++ b/config/initializers/faraday.rb @@ -3,7 +3,7 @@ # the COPYRIGHT file. options = {:timeout => 25} -options[:ssl] = {:ca_file => EnvironmentConfiguration.ca_cert_file_location} +options[:ssl] = {:ca_file => AppConfig.environment.certificate_authorities} Faraday.default_connection = Faraday::Connection.new(options) do |b| b.use FaradayMiddleware::FollowRedirects b.adapter Faraday.default_adapter diff --git a/config/initializers/fetch_featured_users.rb b/config/initializers/fetch_featured_users.rb deleted file mode 100644 index b09c0b1d0..000000000 --- a/config/initializers/fetch_featured_users.rb +++ /dev/null @@ -1,15 +0,0 @@ -#this breaks seed scripts - -if AppConfig[:featured_users].present? && AppConfig[:community_spotlight].blank? - AppConfig[:community_spotlight] = AppConfig[:featured_users] - puts "DEPRICATION WARNING (10/21/11): Please change `featured_users` in your application.yml to `community_spotlight`. Thanks!" -end - -unless EnvironmentConfiguration.prevent_fetching_community_spotlight? - print "Fetching community spotlight users from remote servers" - AppConfig[:community_spotlight].each do |x| - Webfinger.new(x).fetch - print "." - end - puts " done!" -end diff --git a/config/initializers/ignore_ssl_in_development.rb b/config/initializers/ignore_ssl_in_development.rb index bf962fcb2..9ec8a2d9c 100644 --- a/config/initializers/ignore_ssl_in_development.rb +++ b/config/initializers/ignore_ssl_in_development.rb @@ -2,7 +2,7 @@ # licensed under the Affero General Public License version 3 or later. See # the COPYRIGHT file. -if AppConfig[:ca_file].blank? && (Rails.env == "development") +if AppConfig.environment.certificate_authorities.blank? && (Rails.env == "development") module OpenSSL module SSL remove_const :VERIFY_PEER diff --git a/config/initializers/load_analyitics.rb b/config/initializers/load_analyitics.rb index 338cd3c73..f8731f9d3 100644 --- a/config/initializers/load_analyitics.rb +++ b/config/initializers/load_analyitics.rb @@ -5,15 +5,16 @@ if Rails.env == 'production' Diaspora::Application.configure do - if AppConfig[:google_a_site].present? + if AppConfig.privacy.google_analytics_key.present? config.gem 'rack-google-analytics', :lib => 'rack/google-analytics' - config.middleware.use Rack::GoogleAnalytics, :tracker => AppConfig[:google_a_site] + config.middleware.use Rack::GoogleAnalytics, :tracker => AppConfig.privacy.google_analytics_key.get end - if AppConfig[:piwik_url].present? + if AppConfig.privacy.piwik.enable? require 'rack/piwik' config.gem 'rack-piwik', :lib => 'rack/piwik' - config.middleware.use Rack::Piwik, :piwik_url => AppConfig[:piwik_url], :piwik_id => AppConfig[:piwik_id] + config.middleware.use Rack::Piwik, :piwik_url => AppConfig.privacy.piwik.host.get, + :piwik_id => AppConfig.privacy.piwik.site_id.get end end end diff --git a/config/initializers/mailer_config.rb b/config/initializers/mailer_config.rb index b8b818c5d..6cd89dd87 100644 --- a/config/initializers/mailer_config.rb +++ b/config/initializers/mailer_config.rb @@ -4,51 +4,49 @@ require Rails.root.join('lib', 'messagebus', 'mailer') Diaspora::Application.configure do - config.action_mailer.default_url_options = {:protocol => AppConfig[:pod_uri].scheme, - :host => AppConfig[:pod_uri].authority } - config.action_mailer.asset_host = AppConfig[:pod_uri].to_s - config.action_mailer.perform_deliveries = AppConfig[:mailer_on] + config.action_mailer.default_url_options = {:protocol => AppConfig.pod_uri.scheme, + :host => AppConfig.pod_uri.authority } + config.action_mailer.asset_host = AppConfig.pod_uri.to_s + config.action_mailer.perform_deliveries = AppConfig.mail.enable? - unless Rails.env == 'test' || AppConfig[:mailer_on] != true - if AppConfig[:mailer_method] == 'messagebus' + unless Rails.env == 'test' || !AppConfig.mail.enable? + if AppConfig.mail.method == 'messagebus' - if AppConfig[:message_bus_api_key].present? - - config.action_mailer.delivery_method = Messagebus::Mailer.new(AppConfig[:message_bus_api_key]) + if AppConfig.mail.message_bus_api_key.present? + config.action_mailer.delivery_method = Messagebus::Mailer.new(AppConfig.mail.message_bus_api_key.get) config.action_mailer.raise_delivery_errors = true else puts "You need to set your messagebus api key if you are going to use the message bus service. no mailer is now configured" end - elsif AppConfig[:mailer_method] == "sendmail" + elsif AppConfig.mail.method == "sendmail" config.action_mailer.delivery_method = :sendmail sendmail_settings = { - :location => AppConfig[:sendmail_location] + :location => AppConfig.mail.sendmail.location.get } - sendmail_settings[:arguments] = "-i" if AppConfig[:sendmail_exim_fix] + sendmail_settings[:arguments] = "-i" if AppConfig.mail.sendmail.exim_fix? config.action_mailer.sendmail_settings = sendmail_settings - else + elsif AppConfig.mail.method == "smtp" config.action_mailer.delivery_method = :smtp - if AppConfig[:smtp_authentication] == "none" - config.action_mailer.smtp_settings = { - :address => AppConfig[:smtp_address], - :port => AppConfig[:smtp_port], - :domain => AppConfig[:smtp_domain], - :enable_starttls_auto => false, - :openssl_verify_mode => AppConfig[:smtp_openssl_verify_mode] - } - else - config.action_mailer.smtp_settings = { - :address => AppConfig[:smtp_address], - :port => AppConfig[:smtp_port], - :domain => AppConfig[:smtp_domain], - :authentication => AppConfig[:smtp_authentication].gsub('-', '_').to_sym, - :user_name => AppConfig[:smtp_username], - :password => AppConfig[:smtp_password], - :enable_starttls_auto => AppConfig[:smtp_starttls_auto], - :openssl_verify_mode => AppConfig[:smtp_openssl_verify_mode] - } + smtp_settings = { + :address => AppConfig.mail.smtp.host.get, + :port => AppConfig.mail.smtp.port.to_i, + :domain => AppConfig.mail.smtp.domain.get, + :enable_starttls_auto => false, + :openssl_verify_mode => AppConfig.mail.smtp.openssl_verify_mode.get + } + + if AppConfig.mail.smtp.authentication != "none" + smtp_settings.merge!({ + :authentication => AppConfig.mail.smtp.authentication.gsub('-', '_').to_sym, + :user_name => AppConfig.mail.smtp.username.get, + :password => AppConfig.mail.smtp.password.get, + :enable_starttls_auto => AppConfig.mail.smtp.starttls_auto? + }) end + + config.action_mailer.smtp_settings = smtp_settings + else + $stderr.puts "WARNING: Mailer turned on with unknown method #{AppConfig.mail.method}. Mail won't work." end end - end diff --git a/config/initializers/newrelic.rb b/config/initializers/newrelic.rb deleted file mode 100644 index 5a7d107e8..000000000 --- a/config/initializers/newrelic.rb +++ /dev/null @@ -1,7 +0,0 @@ -# Copyright (c) 2012, Diaspora Inc. This file is -# licensed under the Affero General Public License version 3 or later. See -# the COPYRIGHT file. - -if EnvironmentConfiguration.using_new_relic? - require 'newrelic_rpm' -end diff --git a/config/initializers/oink.rb b/config/initializers/oink.rb deleted file mode 100644 index dda457787..000000000 --- a/config/initializers/oink.rb +++ /dev/null @@ -1,12 +0,0 @@ -if Rails.env == 'development' - if defined?(Oink) - Rails.application.middleware.use(Oink::Middleware, :logger => Rails.logger) - else - $stderr.puts "WARNING:" - $stderr.puts " You run in development but Oink isn't available in your gems." - $stderr.puts " That most likely means you copied the bundle command from the installation guide" - $stderr.puts " and didn't removed development from the --without parameter while having" - $stderr.puts " the intention to run under development mode. To fix this either switch to" - $stderr.puts " production mode or do a rm .bundle/config and run bundle install --without heroku" - end -end diff --git a/config/initializers/omniauth.rb b/config/initializers/omniauth.rb index 6049dee4d..32e390b5b 100644 --- a/config/initializers/omniauth.rb +++ b/config/initializers/omniauth.rb @@ -3,14 +3,15 @@ # the COPYRIGHT file. Rails.application.config.middleware.use OmniAuth::Builder do - if SERVICES['twitter'] && SERVICES['twitter']['consumer_key'] && SERVICES['twitter']['consumer_secret'] - provider :twitter, SERVICES['twitter']['consumer_key'], SERVICES['twitter']['consumer_secret'] + if AppConfig.services.twitter.enable? + provider :twitter, AppConfig.services.twitter.key, AppConfig.services.twitter.secret end - if SERVICES['tumblr'] && SERVICES['tumblr']['consumer_key'] && SERVICES['tumblr']['consumer_secret'] - provider :tumblr, SERVICES['tumblr']['consumer_key'], SERVICES['tumblr']['consumer_secret'] + if AppConfig.services.tumblr.enable? + provider :tumblr, AppConfig.services.tumblr.key, AppConfig.services.tumblr.secret end - if SERVICES['facebook'] && SERVICES['facebook']['app_id'] && SERVICES['facebook']['app_secret'] - provider :facebook, SERVICES['facebook']['app_id'], SERVICES['facebook']['app_secret'], { :display => "popup", :scope => "publish_actions,publish_stream,offline_access", - :client_options => {:ssl => {:ca_file => EnvironmentConfiguration.ca_cert_file_location}}} + if AppConfig.services.facebook.enable? + provider :facebook, AppConfig.services.facebook.app_id, AppConfig.services.facebook.secret, + { :display => "popup", :scope => "publish_actions,publish_stream,offline_access", + :client_options => {:ssl => {:ca_file => AppConfig.environment.certificate_authorities }}} end end diff --git a/config/initializers/resque.rb b/config/initializers/resque.rb index c89f86723..1ed9eaf0f 100644 --- a/config/initializers/resque.rb +++ b/config/initializers/resque.rb @@ -2,26 +2,26 @@ require 'resque' Resque::Plugins::Timeout.timeout = 300 -if !AppConfig.single_process_mode? +if !AppConfig.environment.single_process_mode? Resque.redis = AppConfig.get_redis_instance end # Single process-mode hooks using Resque.inline -if AppConfig.single_process_mode? +if AppConfig.environment.single_process_mode? if Rails.env == 'production' puts "WARNING: You are running Diaspora in production without Resque" puts " workers turned on. Please set single_process_mode to false in" - puts " config/application.yml." + puts " config/diaspora.yml." end Resque.inline = true end -if AppConfig[:airbrake_api_key].present? +if AppConfig.admins.monitoring.airbrake_api_key.present? require 'resque/failure/multiple' require 'resque/failure/airbrake' require 'resque/failure/redis' Resque::Failure::Airbrake.configure do |config| - config.api_key = AppConfig[:airbrake_api_key] + config.api_key = AppConfig.admins.monitoring.airbrake_api_key config.secure = true end Resque::Failure::Multiple.classes = [Resque::Failure::Redis, Resque::Failure::Airbrake] @@ -29,7 +29,7 @@ if AppConfig[:airbrake_api_key].present? end -if AppConfig[:mount_resque_web] +if AppConfig.admins.inline_resque_web? require 'resque/server' require Rails.root.join('lib', 'admin_rack') Resque::Server.use AdminRack diff --git a/config/initializers/set_up_image_redirects.rb b/config/initializers/set_up_image_redirects.rb index 94d4d90d9..64126a620 100644 --- a/config/initializers/set_up_image_redirects.rb +++ b/config/initializers/set_up_image_redirects.rb @@ -1,8 +1,8 @@ -if AppConfig[:image_redirect_url].present? +if AppConfig.environment.image_redirect_url.present? require 'rack-rewrite' Rails.application.config.middleware.insert(0, Rack::Rewrite) do - r301 %r{/uploads/images/(.*)}, "#{AppConfig[:image_redirect_url]}/uploads/images/$1" - r301 %r{/landing/(.*)}, "#{AppConfig[:image_redirect_url]}/landing/$1" + r301 %r{/uploads/images/(.*)}, "#{AppConfig.environment.image_redirect_url}/uploads/images/$1" + r301 %r{/landing/(.*)}, "#{AppConfig.environment.image_redirect_url}/landing/$1" end -end \ No newline at end of file +end diff --git a/config/initializers/version_header.rb b/config/initializers/version_header.rb index d9215a556..9d3eaf294 100644 --- a/config/initializers/version_header.rb +++ b/config/initializers/version_header.rb @@ -2,12 +2,4 @@ # licensed under the Affero General Public License version 3 or later. See # the COPYRIGHT file. - -if EnvironmentConfiguration.cache_git_version? - git_cmd = `git log -1 --pretty="format:%H %ci"` - if git_cmd =~ /^([\d\w]+?)\s(.+)$/ - AppConfig[:git_revision] = $1 - AppConfig[:git_update] = $2.strip - ENV["RAILS_ASSET_ID"] = AppConfig[:git_revision][0..8] if Rails.env.production? - end -end \ No newline at end of file +ENV["RAILS_ASSET_ID"] = AppConfig.rails_asset_id if Rails.env.production? && ! AppConfig.heroku? diff --git a/config/load_config.rb b/config/load_config.rb new file mode 100644 index 000000000..1e7cfd5ba --- /dev/null +++ b/config/load_config.rb @@ -0,0 +1,41 @@ +require Rails.root.join('lib', 'configuration') +require Rails.root.join('lib', 'configuration', 'methods') + +config_dir = Rails.root.join("config") + +if File.exists?(config_dir.join("application.yml")) + $stderr.puts "ATTENTION: There's a new configuration system, please remove your" + $stderr.puts " application.yml and migrate your settings." +end + + +AppConfig ||= Configuration::Settings.create do + add_provider Configuration::Provider::Dynamic + add_provider Configuration::Provider::Env + + unless heroku? || Rails.env == "test" || File.exists?(config_dir.join("diaspora.yml")) + $stderr.puts "FATAL: Configuration not found. Copy over diaspora.yml.example" + $stderr.puts " to diaspora.yml and edit it to your needs." + Process.exit(1) + end + + add_provider Configuration::Provider::YAML, + config_dir.join("diaspora.yml"), + namespace: Rails.env, required: false + add_provider Configuration::Provider::YAML, + config_dir.join("diaspora.yml"), + namespace: "configuration", required: false + add_provider Configuration::Provider::YAML, + config_dir.join("defaults.yml"), + namespace: Rails.env + add_provider Configuration::Provider::YAML, + config_dir.join("defaults.yml"), + namespace: "defaults" + + extend Configuration::Methods + + if Rails.env == "production" && (environment.certificate_authorities.blank? || !File.exists?(environment.certificate_authorities.get)) + $stderr.puts "FATAL: Diaspora doesn't know where your certificate authorities are. Please ensure they are set to a valid path in diaspora.yml" + Process.exit(1) + end +end diff --git a/config/locale_settings.yml b/config/locale_settings.yml index b15f7e09f..057a589de 100644 --- a/config/locale_settings.yml +++ b/config/locale_settings.yml @@ -32,6 +32,7 @@ available: gl: "Galego" he: "עברית" hu: "magyar nyelv" + hy: "հայերեն" ia: "Interlingua" id: "Bahasa Indonesia" is: "íslenska" diff --git a/config/locales/cldr/plurals.rb b/config/locales/cldr/plurals.rb index 38384586a..039afc521 100644 --- a/config/locales/cldr/plurals.rb +++ b/config/locales/cldr/plurals.rb @@ -1,7 +1,7 @@ { :'art-nvi' => { :i18n => {:plural => { :keys => [:zero, :one, :two, :few, :other], :rule => lambda { |n| n == 0 ? :zero : n == 1 ? :one : n == 2 ? :two : n == 3 ? :few : :other }, :js_rule => 'function (n) { return n == 0 ? "zero" : n == 1 ? "one" : n == 2 ? "two" : n == 3 ? "few" : "other" }' } } }, :ar => { :i18n => {:plural => { :keys => [:zero, :one, :two, :few, :many, :other], :rule => lambda { |n| n == 0 ? :zero : n == 1 ? :one : n == 2 ? :two : [3, 4, 5, 6, 7, 8, 9, 10].include?(n % 100) ? :few : [11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99].include?(n % 100) ? :many : :other }, :js_rule => 'function (n) { return n == 0 ? "zero" : n == 1 ? "one" : n == 2 ? "two" : jQuery.inArray(n % 100, [3, 4, 5, 6, 7, 8, 9, 10]) != -1 ? "few" : jQuery.inArray(n % 100, [11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99]) != -1 ? "many" : "other" }' } } }, :bg => { :i18n => {:plural => { :keys => [:one, :other], :rule => lambda { |n| n == 1 ? :one : :other }, :js_rule => 'function (n) { return n == 1 ? "one" : "other" }' } } }, - :br => { :i18n => {:plural => { :keys => [:one, :two, :few, :many, :other], :rule => lambda { |n| n % 10 == 1 && n ? :one : n % 10 == 2 && n ? :two : [3, 4].include?(n % 10) && ![10, 11, 12, 13, 14, 15, 16, 17, 18, 19].include?(n % 100) ? :few : n % 1000000 == 0 && n != 0 ? :many : :other }, :js_rule => 'function (n) { return n % 10 == 1 && n ? "one" : n % 10 == 2 && n ? "two" : jQuery.inArray(n % 10, [3, 4]) != -1 && !jQuery.inArray(n % 100, [10, 11, 12, 13, 14, 15, 16, 17, 18, 19]) != -1 ? "few" : n % 1000000 == 0 && n != 0 ? "many" : "other" }' } } }, + :br => { :i18n => {:plural => { :keys => [:one, :two, :few, :many, :other], :rule => lambda { |n| n % 10 == 1 && n ? :one : n % 10 == 2 && n ? :two : [3, 4].include?(n % 10) && ![10, 11, 12, 13, 14, 15, 16, 17, 18, 19].include?(n % 100) ? :few : n != 0 && n % 1000000 == 0 ? :many : :other }, :js_rule => 'function (n) { return n % 10 == 1 && n ? "one" : n % 10 == 2 && n ? "two" : jQuery.inArray(n % 10, [3, 4]) != -1 && !jQuery.inArray(n % 100, [10, 11, 12, 13, 14, 15, 16, 17, 18, 19]) != -1 ? "few" : n != 0 && n % 1000000 == 0 ? "many" : "other" }' } } }, :ca => { :i18n => {:plural => { :keys => [:one, :other], :rule => lambda { |n| n == 1 ? :one : :other }, :js_rule => 'function (n) { return n == 1 ? "one" : "other" }' } } }, :cs => { :i18n => {:plural => { :keys => [:one, :few, :other], :rule => lambda { |n| n == 1 ? :one : [2, 3, 4].include?(n) ? :few : :other }, :js_rule => 'function (n) { return n == 1 ? "one" : jQuery.inArray(n, [2, 3, 4]) != -1 ? "few" : "other" }' } } }, :cy => { :i18n => {:plural => { :keys => [:zero, :one, :two, :few, :many, :other], :rule => lambda { |n| n == 0 ? :zero : n == 1 ? :one : n == 2 ? :two : n == 3 ? :few : n == 6 ? :many : :other }, :js_rule => 'function (n) { return n == 0 ? "zero" : n == 1 ? "one" : n == 2 ? "two" : n == 3 ? "few" : n == 6 ? "many" : "other" }' } } }, @@ -14,10 +14,11 @@ :et => { :i18n => {:plural => { :keys => [:one, :other], :rule => lambda { |n| n == 1 ? :one : :other }, :js_rule => 'function (n) { return n == 1 ? "one" : "other" }' } } }, :eu => { :i18n => {:plural => { :keys => [:one, :other], :rule => lambda { |n| n == 1 ? :one : :other }, :js_rule => 'function (n) { return n == 1 ? "one" : "other" }' } } }, :fi => { :i18n => {:plural => { :keys => [:one, :other], :rule => lambda { |n| n == 1 ? :one : :other }, :js_rule => 'function (n) { return n == 1 ? "one" : "other" }' } } }, - :fr => { :i18n => {:plural => { :keys => [:one, :other], :rule => lambda { |n| n && n != 2 ? :one : :other }, :js_rule => 'function (n) { return n && n != 2 ? "one" : "other" }' } } }, + :fil => { :i18n => {:plural => { :keys => [:one, :other], :rule => lambda { |n| [0, 1].include?(n) ? :one : :other }, :js_rule => 'function (n) { return jQuery.inArray(n, [0, 1]) != -1 ? "one" : "other" }' } } }, + :fr => { :i18n => {:plural => { :keys => [:one, :other], :rule => lambda { |n| n.between?(0, 2) && n != 2 ? :one : :other }, :js_rule => 'function (n) { return n.between?(0, 2) && n != 2 ? "one" : "other" }' } } }, :ga => { :i18n => {:plural => { :keys => [:one, :two, :few, :many, :other], :rule => lambda { |n| n == 1 ? :one : n == 2 ? :two : [3, 4, 5, 6].include?(n) ? :few : [7, 8, 9, 10].include?(n) ? :many : :other }, :js_rule => 'function (n) { return n == 1 ? "one" : n == 2 ? "two" : jQuery.inArray(n, [3, 4, 5, 6]) != -1 ? "few" : jQuery.inArray(n, [7, 8, 9, 10]) != -1 ? "many" : "other" }' } } }, :gl => { :i18n => {:plural => { :keys => [:one, :other], :rule => lambda { |n| n == 1 ? :one : :other }, :js_rule => 'function (n) { return n == 1 ? "one" : "other" }' } } }, - :he => { :i18n => {:plural => { :keys => [:one, :other], :rule => lambda { |n| n == 1 ? :one : :other }, :js_rule => 'function (n) { return n == 1 ? "one" : "other" }' } } }, + :he => { :i18n => {:plural => { :keys => [:one, :two, :many, :other], :rule => lambda { |n| n == 1 ? :one : n == 2 ? :two : n != 0 ? :many : :other }, :js_rule => 'function (n) { return n == 1 ? "one" : n == 2 ? "two" : n != 0 ? "many" : "other" }' } } }, :hu => { :i18n => {:plural => { :keys => [:other], :rule => lambda { |n| :other }, :js_rule => 'function (n) { return "other" }' } } }, :id => { :i18n => {:plural => { :keys => [:other], :rule => lambda { |n| :other }, :js_rule => 'function (n) { return "other" }' } } }, :is => { :i18n => {:plural => { :keys => [:one, :other], :rule => lambda { |n| n == 1 ? :one : :other }, :js_rule => 'function (n) { return n == 1 ? "one" : "other" }' } } }, @@ -40,6 +41,7 @@ :sk => { :i18n => {:plural => { :keys => [:one, :few, :other], :rule => lambda { |n| n == 1 ? :one : [2, 3, 4].include?(n) ? :few : :other }, :js_rule => 'function (n) { return n == 1 ? "one" : jQuery.inArray(n, [2, 3, 4]) != -1 ? "few" : "other" }' } } }, :sl => { :i18n => {:plural => { :keys => [:one, :two, :few, :other], :rule => lambda { |n| n % 100 == 1 ? :one : n % 100 == 2 ? :two : [3, 4].include?(n % 100) ? :few : :other }, :js_rule => 'function (n) { return n % 100 == 1 ? "one" : n % 100 == 2 ? "two" : jQuery.inArray(n % 100, [3, 4]) != -1 ? "few" : "other" }' } } }, :sq => { :i18n => {:plural => { :keys => [:one, :other], :rule => lambda { |n| n == 1 ? :one : :other }, :js_rule => 'function (n) { return n == 1 ? "one" : "other" }' } } }, + :sr => { :i18n => {:plural => { :keys => [:one, :few, :many, :other], :rule => lambda { |n| n % 10 == 1 && n % 100 != 11 ? :one : [2, 3, 4].include?(n % 10) && ![12, 13, 14].include?(n % 100) ? :few : n % 10 == 0 || [5, 6, 7, 8, 9].include?(n % 10) || [11, 12, 13, 14].include?(n % 100) ? :many : :other }, :js_rule => 'function (n) { return n % 10 == 1 && n % 100 != 11 ? "one" : jQuery.inArray(n % 10, [2, 3, 4]) != -1 && !jQuery.inArray(n % 100, [12, 13, 14]) != -1 ? "few" : n % 10 == 0 || jQuery.inArray(n % 10, [5, 6, 7, 8, 9]) != -1 || jQuery.inArray(n % 100, [11, 12, 13, 14]) != -1 ? "many" : "other" }' } } }, :sv => { :i18n => {:plural => { :keys => [:one, :other], :rule => lambda { |n| n == 1 ? :one : :other }, :js_rule => 'function (n) { return n == 1 ? "one" : "other" }' } } }, :te => { :i18n => {:plural => { :keys => [:one, :other], :rule => lambda { |n| n == 1 ? :one : :other }, :js_rule => 'function (n) { return n == 1 ? "one" : "other" }' } } }, :tr => { :i18n => {:plural => { :keys => [:other], :rule => lambda { |n| :other }, :js_rule => 'function (n) { return "other" }' } } }, diff --git a/config/locales/devise/devise.hy.yml b/config/locales/devise/devise.hy.yml index 03c4c9692..a662e0550 100644 --- a/config/locales/devise/devise.hy.yml +++ b/config/locales/devise/devise.hy.yml @@ -6,42 +6,104 @@ hy: devise: + confirmations: + confirmed: "Հաշիվդ հաջողությամբ հաստատվեց։ Այժմ արդեն համակարգում ես։" + new: + resend_confirmation: "Կրկին ուղարկել հաստատման ցուցումները" + send_instructions: "Րոպեների ընթացքում նամակ կստանաս՝ հաշիվդ հաստատելու ցուցումներով։" failure: - inactive: "Քո հաշիվը դեռ չի ակտիվացվել:" - invalid: "Սխալ գորժանուն կամ ծածկագիր:" - invalid_token: "Սխալ իսկությունը ստուգելու նշան:" - locked: "Ձեր հաշիվը կողպված է:" - timeout: "Ձեր նիստի ժամկետն անցել է, խնդրում ենք կրկին մուտք գործեք որ շարունակեք:" - unauthenticated: "Դուք պետք է մուտք գործեք կամ գրանցվեք մինչև շարունակելը:" - unconfirmed: "Դուք պետք է հաստատեք ձեր հաշիվը մինչև շարունակելը:" + inactive: "Քո հաշիվը դեռ ակտիվացված չէ։" + invalid: "Սխալ օգտանուն կամ գաղտնաբառ։" + invalid_token: "Նույնականացման սխալ։" + locked: "Քո հաշիվը արգելափակված է։" + timeout: "Ձեր նիստի ժամկետն անցել է, խնդրում ենք կրկին մուտք գործեք, որ շարունակեք։" + unauthenticated: "Շարունակելուց առաջ պետք է կա՛մ մուտք գործես, կա՛մ գրանցվես։" + unconfirmed: "Շարունակելուց առաջ պետք է հաստատես հաշիվդ։" invitations: - send_instructions: "Քո հրավերը ուղարկված է:" + invitation_token_invalid: "Ներողություն, բայց այս հրավերը գործող չէ ։( ։" + send_instructions: "Հրավերդ ուղարկված է։" + updated: "Գաղտնաբառդ հաջողությամբ մուտքագրվեց։ Այժմ համակարգում ես։" mailer: confirmation_instructions: - confirm: "Հաստատել իմ հաշիվը:" - hello: "Ողջույն %{email}" + confirm: "Հաստատել իմ հաշիվը" + subject: "Հաստատման ցուցումներ" + you_can_confirm: "Կարող ես հաշիվդ հաստատել հետևյալ հղմամբ՝" + hello: "Ողջու՜յն %{email}" invitation_instructions: + accept: "Ընդունել հրավերը" + arrived: "Այն սոցիալական ցանցը, որին այդքան սպասում էինք ու որն այդքան պակասում էր, վերջապես հայտնվեց։ Ավելի հավես, ավելի ապահով ու լրիվ նոր ձևով %{strong_diaspora}-ն պատրաստ է օգնել քեզ կիսվելու ու բացահայտելու ցանցը՝ բոլորովին այլ կերպ։" + be_yourself_paragraph: "Համացանցը ստեղծել է ինքներս մեզ արտահայտելու եզակի նոր ճանապարհներ։ %{strong_diaspora}-ն թույլ է տալիս քեզ մնալ այնպիսին, ինչպիսին կաս և կիսվել ինչպես դու կուզես՝ քո իրական կամ ոչ իրական անունով։" + cubbies: "Cubbi․es" + displaying_correctly: "Նամակը ընթեռնելի չէ՞։ Ահա՝ %{link}" + email_address: "questions@joindiaspora.com" + email_us: "Diaspora-ի հետ կապված ընդհանուր հարցերի կամ օգնության համար՝ նամակիր մեզ՝ %{email}։" + finally: "Վերջապե՜ս։ Սա հասավ քեզ։" + friends_saying: "Ի՞նչ են ասում ընկերներդ..." + get_connected: "Մնացեք կապի մեջ" + have_fun: "Զվարճացի՛ր" + have_fun_paragraph: "%{strong_diaspora}-ն առցանց հավես մարդկանց ու բովանդակություն բացահայտելու մասին է։ %{link}-ը՝ աշխարհում առաջին %{strong_diaspora} ծրագիրը, միայն սկիզբն է։ Վերցրու ցանցից ու կիսվիր դրանով՝ իր ամենահավես դրսևորումներում։" + help_fund: "օգնիր Diaspora հիմնադրամին" + here: "այստեղ" + ignore: "Եթե չես ուզում ընդունել հրավերը, ապա պարզապես արհամարհիր այս նամակը։" + join_team: "Միացի՛ր մեզ" + love: "Սիրով," + made_by_people: "%{strong_diaspora}-ն ստեղծվել է մարդկանց կողմից, որ համացանցը քո չափ սիրում են։ %{jointeam} կամ %{helpfund}։" + more_people: "Ավելի շատ մարդ է հուզված տեսնել քեզ։" + no_account_till: "Քո հաշիվը չի ստեղծվի, քանի դեռ ներքոհիշյալ հղմամբ չես անցել։" or: "կամ" + sign_up_now: "Գրանցվի՛ր հիմա →" + subject: "Դու հրավիրված ես՝ միանալու Diaspora-ին։" + team_diaspora: "Diaspora-ի թիմ" + view_in: "Դիտիր սա քո զննիչում։" + inviter: + accept_at: "%{url} հասցեով, որը կարող եք հաստատել ստորև բերված հղման միջոցով։" + has_invited_you: "%{name}" + have_invited_you: "Դուք %{names}-ից հրավեր եք ստացել՝ միանալու Diaspora-ին։" reset_password_instructions: - change: "Փոխել գաղտնաբառը:" - welcome: "Բարի գալուստ %{email}" + change: "Փոխել գաղտնաբառը" + ignore: "" + someone_requested: "Ինչ-որ մեկը հղում է պահանջել գաղտնաբառդ փոխելու համար։ Կարող ես դա անել հետևյալ հղման միջոցով։" + subject: "Գաղտնաբառը փոխելու ցուցումներ" + welcome: "Բարի գալու՜ստ %{email}" passwords: edit: - change_password: "Փոխել գաղտնաբառը:" + change_password: "Փոխել իմ գաղտնաբառը։" new: - forgot_password: "Մոռացե՞լ ես գաղտնաբառդ:" - send_instructions: "Դուք կստանաք ցուցումներով էլ.նամակ, թե ինչպես վերականգնել Ձեր գաղտնաբառը մի քանի րոպեների ընթացքում:" + forgot_password: "Մոռացե՞լ ես գաղտնաբառդ։" + no_account: "Այս էլ.հասցեով հաշիվ չկա։  Եթե հրավերի ես սպասում, մենք փորձում ենք դրանք հնարավորինս արագ աչքի անցկացնել։" + send_password_instructions: "Ուղարկեք ինձ գաղտնաբառը փոխելու ցուցումները։" + send_instructions: "Րոպեների ընթացքում նամակ կստանաս՝ գաղտնաբառդ վերականգնելու ցուցումներով։" + updated: "Գաղտաբառդ հաջողությամբ փոխվեց։ Հիմա արդեն համակարգում ես։" + registrations: + destroyed: "Ց՜։ Քո հաշիվը բարեհաջող փակվեց։ Հուսով եմ շուտով կրկին կհանդիպենք։" + signed_up: "Բարեհաջող գրանցվեցիր։ Միացված լինելու դեպքում, քո էլփոստով հաստատման նամակ կստանաս։" + updated: "Հաշիվդ հաջողությամբ թարմացվեց։" sessions: new: - login: "Մուտք գործել" - password: "Ծածկագիր" - remember_me: "Հիշիր ինձ" + alpha_software: "Ծրագրի Ալֆա տարբերակը օգտագործելու ուղու վրա ես։" + bugs_and_feedback: "Զգո՛ն եղիր, խոտանների կհանդիպես։  Խորհուրդ ենք տալիս, որ օգտագործես զննիչիդ աջ կողմում գտնվող Հետադարձ կապի կոճակը՝ ցանկացած փռշտոցի մասին տեղեկացնելու համար։  Մենք կաշխատենք հնարավորինս արագ լուծել քո տեղեկացրած խնդիրները։" + bugs_and_feedback_mobile: "Զգո՛ն եղիր, խոտանների կհանդիպես։  Խորհուրդ ենք տալիս ցանկացած խնդրի մասին տեղեկացնել մեզ։  Կաշխատենք հնարավորինս արագ լուծել բոլոր խնդիրները։" + login: "Մտնել" + modern_browsers: "աշխատում է միայն ժամանակակից զննիչներում։" + password: "Գաղտնաբառ" + remember_me: "Հիշել ինձ" sign_in: "Մուտք գործել" - username: "Գորժանուն" - signed_in: "Հաջող մուտք գործեցիք:" - signed_out: "Հաջող ելք գործեցիք:" + username: "Օգտանուն" + signed_in: "Բարեհաջող մուտք գործեցիր։" + signed_out: "Բարեհաջող դուրս եկար։" + shared: + links: + forgot_your_password: "Մոռացե՞լ ես գաղտնաբառդ։" + receive_confirmation: "Չե՞ս ստացել հաստատման ցուցումներ" + sign_in: "Մուտք գործել" + sign_up: "Գրանցվել" + sign_up_closed: "Այս պահին բաց գրանցումները հասանելի չեն։" + mail_signup_form: + sign_up_for_an_invite: "Գրանցվի՛ր հրավերի համար։" + unlocks: + send_instructions: "Րոպեների ընթացքում նամակ կստանաս՝ հաշիվդ արգելափակումից հանելու ցուցումներով։" errors: messages: already_confirmed: "արդեն հաստատվել է" - not_found: "չգտնվեց" - not_locked: "կողպված չե" \ No newline at end of file + not_found: "չի գտնվել" + not_locked: "կողպված չէ" \ No newline at end of file diff --git a/config/locales/devise/devise.lt.yml b/config/locales/devise/devise.lt.yml index 7705a990c..04a33e05c 100644 --- a/config/locales/devise/devise.lt.yml +++ b/config/locales/devise/devise.lt.yml @@ -20,18 +20,48 @@ lt: unauthenticated: "Norint tęsti, reikia prisijungti arba susikurti paskyrą." unconfirmed: "Norint prisijungti, reikia patvirtinti savo paskyrą." invitations: - invitation_token_invalid: "Neteisingas pakvietimo raktas!" + invitation_token_invalid: "Atsiprašome, bet jūsų įvestas pakvietimo raktas - neteisingas!" send_instructions: "Pakvietimas išsiųstas." - updated: "Slaptažodis pakeistas sėkmingai. Prisijungta." + updated: "Slaptažodis sėkmingai pakeistas. Prisijungta." mailer: confirmation_instructions: confirm: "Patvirtinti paskyrą" - subject: "Patvirtinimo nurodymai" - you_can_confirm: "Paskyrą galima patvirtinti žemiau pateikta nuoroda:" + subject: "Nurodymai, kaip patvirtinti paskyrą" + you_can_confirm: "Paskyrą galite patvirtinti paspaudę nuorodą pateiktą žemiau:" hello: "Labas, %{email}!" invitation_instructions: - displaying_correctly: "Email not displaying correctly? %{link} in your browser" - view_in: "View in" + accept: "Priimti kvietimą" + arrived: "Socialinis tinklapis, kurio Jūs taip laukėte - jau čia! Pataisytas, saugesnis ir daug įdomesnis, %{strong_diaspora} tinklapis pasiruošęs padėti Jums dalintis ir atrasti internetą nauju būdu." + be_yourself: "Išlik savimi!" + be_yourself_paragraph: "Internetas sukūrė naujus saviraiškos būdus. %{strong_diaspora} leidžia tau išlikti savimi ir bendrauti tiek tikru, tiek išgalvotu vardu." + cubbies: "Internetinė nuotraukų saugykla Cubbi.es" + displaying_correctly: "Negalite perskaityti laiško? Spauskite čia %{link}" + email_address: "klausimai@tapkdiasporanariu.lt" + email_us: "Jei turite klausimų arba reikia pagalbos naudojantis Diaspora paskyra, rašykite mums el. laišką %{email}." + finally: "Pagaliau jis čia!" + friends_saying: "Apie ką kalba tavo draugai..." + get_connected: "Prisijunk!" + get_connected_paragraph: "Tarptautinio judėjimo, kurį vienija bendra idėja apie geresnį internetą, %{strong_diaspora} esminis išskirtinumas yra tinklapio bendruomenė. Susipažink su naujais žmonėmis, susisiek su draugais, prisijunk prie linksmybių." + have_fun: "Pajausk malonumą" + have_fun_paragraph: "%{strong_diaspora} suteikia galimybę susipažinti su įvairiausiomis naujienomis ir žmonėmis internete. %{link}, pirma pasaulyje %{strong_diaspora} programa yra tik pradžia. Kaupk ir dalinkis tinklu visame jo gražume." + help_fund: "Diaspora pagalba" + here: "čia" + ignore: "Jei atsisakote priimti kvietimą, tiesiog nekreipkite dėmesio į šį el. laišką." + join_team: "Prisijunk prie mūsų komandos" + love: "Su meile," + made_by_people: "%{strong_diaspora} sukurta žmonių mylinčių internetą taip, kaip tu. %{jointeam}, arba %{helpfund}!" + more_people: "Dar daugiau žmonių džiaugiasi tave matydami!" + no_account_till: "Jūsų paskyra bus patvirtinta po to, kai prisiregistruosite paspaudę nuorodą aukščiau." + or: "arba" + sign_up_now: "Prisijungti dabar →" + subject: "Jūs gavote kvietimą prisijungti prie Diaspora komandos!" + team_diaspora: "Diaspora komanda" + unsubscribe: "Jei nebenorite gauti naujienų, spauskite čia %{link}" + view_in: "Atidaryti naršyklėje." + inviter: + accept_at: "priimti kvietimą galite paspaudę nuorodą žemiau %{url}" + has_invited_you: "" + have_invited_you: "%{names} pakvietė Jus prisijungti prie Diaspora tinklapio" reset_password_instructions: change: "Keisti slaptažodį" ignore: "Jei tu to neprašei, nekreipk dėmesio į šį laišką." @@ -49,10 +79,10 @@ lt: change_password: "Keisti mano slaptažodį" new: forgot_password: "Pamiršai slaptažodį?" - no_account: "No account with this email exsists. If you are waiting for an invite, we are rolling them out as soon as possible" + no_account: "Tokio el. pašto mūsų sistemoje nėra užregistruota. Laukiančius pakvietimo įspėjame, kad išsiųsime juos kai tik galėsime." send_password_instructions: "Siųsti nurodymus, kaip atstatyti slaptažodį" send_instructions: "Netrukus gausite el. laišką su nurodymais, kaip atstatyti slaptažodį." - updated: "Slaptažodis pakeistas sėkmingai. Prisijungta." + updated: "Slaptažodis sėkmingai pakeistas. Prisijungta." registrations: destroyed: "Paskyra sėkmingai atšaukta. Iki pasimatymo!" signed_up: "Prisijungta sėkmingai. Jei nustatyta, patvirtinimas nusiųstas į el. paštą." @@ -61,27 +91,30 @@ lt: new: alpha_software: "Ši programinė įranga nėra pilnai užbaigta." bugs_and_feedback: "Naudojantis gali pasitaikyti klaidų. Apie pasitaikiusius nesklandumus galima praneštis naudojantis mygtuku naršyklės dešinėje. Klaidas stengsimės ištaisyti kuo skubiau." + bugs_and_feedback_mobile: "Naudojantis gali pasitaikyti klaidų. Ačiū, kad informuojate mus apie iškilusius nesklandumus! Klaidas stengsimės ištaisyti kuo skubiau." login: "Prisijungti" modern_browsers: "palaiko tik modernias naršykles." password: "Slaptažodis" - remember_me: "Prisiminti" + remember_me: "Prisiminti mane šiame kompiuteryje" sign_in: "Prisijungti" username: "Vartotojo vardas" signed_in: "Sėkmingai prisijungta." signed_out: "Sėkmingai atsijungta." shared: links: - forgot_your_password: "Pamiršai slaptažodį?" - receive_confirmation: "Negavai nurodymų, kaip patvirtinti paskyrą?" - receive_unlock: "Negavai nurodymų, kaip atrakinti paskyrą?" + forgot_your_password: "Pamiršote savo slaptažodį?" + receive_confirmation: "Negavote nurodymų, kaip patvirtinti paskyrą?" + receive_unlock: "Negavote nurodymų, kaip atrakinti paskyrą?" sign_in: "Prisijungti" sign_up: "Registruotis" - sign_up_closed: "Atviri prisijungimai šiuo metu uždaryti." + sign_up_closed: "Prisijungimai be kvietimų šiuo metu neleidžiami." + mail_signup_form: + sign_up_for_an_invite: "Užsiregistruoti kvietimui gauti!" unlocks: new: - resend_unlock: "Siųsti nurodymus, kaip atrakinti, iš naujo" + resend_unlock: "Dar kartą išsiųsti nurodymus, kaip atrakinti paskyrą." send_instructions: "Netrukus bus išsiųstas el. laiškas su nurodymais, kaip atrakinti paskyrą." - unlocked: "Paskyra atrakinta. Prisijungta." + unlocked: "Paskyra sėkmingai atrakinta. Prisijungta." errors: messages: already_confirmed: "jau patvirtinta" diff --git a/config/locales/devise/devise.vi.yml b/config/locales/devise/devise.vi.yml index a7bc1a5fa..f5d34c77b 100644 --- a/config/locales/devise/devise.vi.yml +++ b/config/locales/devise/devise.vi.yml @@ -15,7 +15,7 @@ vi: inactive: "Tài khoản của bạn chưa được kích hoạt." invalid: "Tên người dùng hoặc mật khẩu không đúng." invalid_token: "Khoá xác thực không hợp lệ." - locked: "Tài khoản của bạn bị khoá." + locked: "Tài khoản của bạn đã bị khoá." timeout: "Phiên đăng nhập đã hết hạn, hãy đăng nhập lại để tiếp tục." unauthenticated: "Bạn cần đăng nhập hoặc đăng kí để tiếp tục." unconfirmed: "Bạn cần phải xác nhận tài khoản trước khi tiếp tục." @@ -90,7 +90,7 @@ vi: sessions: new: alpha_software: "Bạn sẽ sử dụng phần mềm không ổn định." - bugs_and_feedback: "Có thể bạn sẽ phát hiện lỗi. Chúng tôi sử dụng nút Phản hồi ở phía bên phải trình duyệt để bạn báo lỗi hoặc vấn đề nào khác. Chúng tôi sẽ giải quyết vấn đề một cách nhanh nhất có thể." + bugs_and_feedback: "Có thể bạn sẽ phát hiện lỗi. Chúng tôi sử dụng nút Phản hồi ở phía bên phải trình duyệt để bạn báo lỗi hoặc vấn đề khác. Chúng tôi sẽ giải quyết vấn đề một cách nhanh nhất có thể." bugs_and_feedback_mobile: "Có thể bạn sẽ phát hiện lỗi. Bạn nên báo lỗi hoặc bất kì vấn đề nào khác. Chúng tôi sẽ giải quyết vấn đề một cách nhanh nhất có thể." login: "Đăng nhập" modern_browsers: "chỉ hỗ trợ những trình duyệt hiện đại." diff --git a/config/locales/diaspora/hu.yml b/config/locales/diaspora/hu.yml index 7f3dbd4e9..dff43e5f7 100644 --- a/config/locales/diaspora/hu.yml +++ b/config/locales/diaspora/hu.yml @@ -224,7 +224,7 @@ hu: back: "Vissza" blocks: create: - failure: "Nem tudtam figyelmen kívül hagyni azt a felhasználót. #elkerülés" + failure: "Nem sikerült figyelmen kívül hagyni a felhasználót. #megkerülés" success: "Többet nem látod azt a felhasználót a hírfolyamban. #némítás!" destroy: failure: "Nem tudtam kikapcsolni annak a felhasználónak a figyelmen kívül hagyását. #elkerülés" @@ -588,7 +588,7 @@ hu: return_to_aspects: "Menj vissza a csoportokhoz" see_all: "Összes" start_sharing: "Megosztás indítása" - to_accept_or_ignore: "hogy elfogadd vagy elutasítsd." + to_accept_or_ignore: "hogy elfogadd vagy figyelmen kívül hagyd." sub_header: add_some: "adj hozzá néhányat" edit: "szerkesztés" @@ -709,7 +709,7 @@ hu: sent: "%{name} megosztásra kért(ek) fel. A következő belépésük alkalmával láthatják a megosztásaid." destroy: error: "Kérlek válassz egy csoportot!" - ignore: "Elutasított kapcsolati felkérés." + ignore: "Kapcsolati felkérés figyelmen kívül hagyva." success: "Mostantól ismerősök vagytok." helper: new_requests: @@ -847,7 +847,7 @@ hu: dislike: "Nem tetszik" hide_and_mute: "Bejegyzés elrejtése és némítása" ignore_user: "Mellőz: %{name}" - ignore_user_description: "A felhasználó eltávolítása és mellőzése az összes körből?" + ignore_user_description: "A felhasználó mellőzése és eltávolítása az összes csoportból?" like: "Tetszik" nsfw: "Ez a bejegyzés \"nem biztonságos\" jelölést kapott a szerzőjétől. %{link}" shared_with: "Megosztva vele: %{aspect_names}" diff --git a/config/locales/diaspora/hy.yml b/config/locales/diaspora/hy.yml index b1d481c3e..7d85eb567 100644 --- a/config/locales/diaspora/hy.yml +++ b/config/locales/diaspora/hy.yml @@ -5,9 +5,697 @@ hy: + _applications: "Հավելվածներ" + _comments: "Մեկնաբանություններ" + _contacts: "Ընկերներ" + _home: "Գլխավոր էջ" + _photos: "նկարներ" + _services: "Ծառայություններ" + account: "Հաշիվ" + activerecord: + errors: + models: + person: + attributes: + diaspora_handle: + taken: "արդեն օգտագործվում է։" + reshare: + attributes: + root_guid: + taken: "Էսքան լավնա՞։   Արդեն կիսվել ես այս գրառմամբ։" + user: + attributes: + email: + taken: "արդեն օգտագործվում է։" + person: + invalid: "անվավեր է" + username: + invalid: "անվավեր է։ Թույլատրվում են միայն տառեր, թվեր և _։" + taken: "արդեն զբաղված է" + admins: + admin_bar: + pages: "Էջեր" + pod_stats: "Փոդի վիճակագրություն" + user_search: "Օգտատերի որոնում" + weekly_user_stats: "Օգտատերերի շաբաթական վիճակագրություն" + stats: + 2weeks: "2 շաբաթ" + 50_most: "Ամենատարածված 50 պիտակները" + comments: + one: "%{count} մեկնաբանություն" + other: "%{count} մեկնաբանություն" + zero: "%{count} մեկնաբանություն" + daily: "Ամենօրյա" + go: "առա՛ջ" + month: "Ամիս" + posts: + one: "%{count} գրառում" + other: "%{count} գրառում" + zero: "%{count} գրառում" + tag_name: "Պիտակ՝ %{name_tag}, քանակը՝ %{count_tag}" + usage_statistic: "Օգտագործման վիճակագրություն" + users: + one: "%{count} օգատատեր" + other: "%{count} օգատատեր" + zero: "%{count} օգատատեր" + week: "Շաբաթ" + user_search: + add_invites: "ավելացնել հրավերներ" + email_to: "Հրավիրել նամակով" + users: + one: "%{count} օգտատեր գտնվեց" + other: "%{count} օգտատեր գտնվեց" + zero: "%{count} օգտատեր գտնվեց" + you_currently: "ներկա պահին դու ունես %{user_invitation} հրավեր ուղարկելու հնարավորություն. %{link}" + weekly_user_stats: + amount_of: + one: "այս շաբաթվա նոր օգտատերերի քանակը՝ %{count}" + other: "այս շաբաթվա նոր օգտատերերի քանակը՝ %{count}" + zero: "այս շաբաթվա նոր օգտատերերի քանակը՝ 0" + ago: "%{time} առաջ" + all_aspects: "Բոլոր խմբերը" + application: + helper: + diaspora_alpha: "DIASPORA* ALPHA" + unknown_person: "անհայտ անձ" + are_you_sure: "Համոզվա՞ծ ես" + are_you_sure_delete_account: "Համոզվա՞ծ ես, որ ուզում ես փակել հաշիվդ։ Այն վերականգնել չի լինի։" + aspect_memberships: + destroy: + success: "Անձը հաջողությամբ հեռացված է խմբից" aspects: + aspect_contacts: + done_editing: "պատրաստ է" + aspect_listings: + add_an_aspect: "+ Ստեղծել նոր խումբ" + deselect_all: "Ապանշել ամբողջը" + edit_aspect: "Փոխել %{name}" + select_all: "Նշել ամբողջը" + aspect_stream: + stay_updated_explanation: "Քո լրահոսը հեղեղված է ընկերներիդ գործողություններով, պիտակներով, որոնց հետևում ես, և համայնքի որոշ կրեատիվ անդամների գրառումներով։" + contacts_not_visible: "Այս խմբի ընկերներդ տեսանելի չեն միմյանց համար։" + contacts_visible: "Այս խմբի ընկերները կկարողանան իրար տեսնել։" + create: + failure: "Չհաջողվեց ստեղծել խումբը։" + success: "Քո նոր %{name} խումբը պատրաստ է" + destroy: + failure: "%{name} -ը դատարկ չէ և չի կարող ջնջվել։" + success: "%{name} բարեհաջող ջնջվեց։" + edit: + aspect_list_is_not_visible: "Խմբի ցուցակը տեսանելի չէ նրա անդամներին" + aspect_list_is_visible: "Խմբի ցուցակը տեսանելի է նրա անդամներին" + confirm_remove_aspect: "Վստա՞հ ես, որ ուզում ես ջնջել այս խումբը։" + done: "Պատրաստ է" + make_aspect_list_visible: "այս խմբի անդամներին դարձնե՞լ տեսանելի միմյանց համար։" + remove_aspect: "Ջնջել այս խումբը" + rename: "վերանվանել" + update: "թարմացնել" + updating: "թարմացվում է" + few: "%{count} խմբեր" + helper: + are_you_sure: "Վստա՞հ ես, որ ուզում ես ջնջել այս խումբը։" + aspect_not_empty: "Խումբը դատարկ չէ" + remove: "հեռացնել" index: + cubbies: + heading: "Միանալ Cubbi․es-ին" + learn_more: "Իմանալ ավելին" + diaspora_id: + content_1: "Քո Diaspora ID-ն՝" + content_2: "Հաղորդիր սա որևիցե մեկին, և նա կկարողանա գտնել քեզ Diaspora-ում։" + heading: "Diaspora ID" + donate: "Նվիրաբերել" + handle_explanation: "Սա քո Diaspora ID-ն է։ Մարդիկ կարող են գտնել քեզ ինչպես քո էլ. հասցեով, այնպես էլ քո Diaspora ID-ով։" help: - email_link: "Էլ. հասցե" + do_you: "Դու." + email_feedback: "Կարող ես նաև %{link} ուղարկել քո կարծիքը։" + email_link: "նամակով" + feature_suggestion: "… %{link} ունե՞ք։" + find_a_bug: "… %{link} ե՞ք գտել։" + have_a_question: "… %{link} ունե՞ք։" + here_to_help: "Համայնքն այստե՜ղ է։" + need_help: "Օգնությու՞ն" + tag_bug: "բա՞գ" + tag_feature: "առաջարկությու՞ն" + tag_question: "հա՞րց" + introduce_yourself: "Սա քո լրահոսն է։ Ընկղմվիր և ներկայացրու քեզ։" + keep_diaspora_running: "Օգնիր Diaspora-ի արագ զարգացմանը ամսական նվիրատվությամբ։" + new_here: + follow: "Հետևիր %{link}-ին և ողջունիր Diaspora*-ի նոր օգտատերերին։" + learn_more: "Իմանալ ավելին" + title: "Ողջունի՛ր նորեկներին" + no_contacts: "Ընկերներ չկան" + no_tags: "+ Հետևելու պիտակ գտնել" + people_sharing_with_you: "Քեզ հետ կիսվող մարդիկ" + services: + content: "Կարող ես հետևյալ ծառայությունները միացնել Diaspora-ին՝" + heading: "Միացնել ծառայությունները" + unfollow_tag: "Դադարել հետևել #%{tag}ին" + welcome_to_diaspora: "Բարի գալուստ Diaspora*, %{name} ջան։" + many: "%{count} խմբեր" + move_contact: + failure: "չի աշխատում %{inspect}" + success: "Անձը տեղափոխվեց նոր խումբ։" + new: + create: "Ստեղծել" + name: "Անունը (միայն քեզ է տեսանելի)" + no_contacts_message: + try_adding_some_more_contacts: "Կարող ես ևս ընկերներ փնտրել կամ հրավիրել նրանց։" + you_should_add_some_more_contacts: "Լավ կլինի՝ մի քանի ընկեր ավելացնես։" + no_posts_message: + start_talking: "Ոչ ոք բան չի ասել դեռևս։" + one: "1 խումբ" + other: "%{count} խմբեր" + seed: + acquaintances: "Ծանոթներ" + family: "Ընտանիք" + friends: "Ընկերներ" + work: "Աշխատանք" + selected_contacts: + manage_your_aspects: "Կարգավորել խմբերը" + no_contacts: "Դու դեռ ոչ մի ընկեր չունես։" + show: + edit_aspect: "փոփոխել խումբը" + two: "%{count} խմբեր" + update: + failure: "Քո՝ %{name} խմբի անունը շատ երկար է և չի կարող պահպանվել։" + success: "Քո՝ %{name} խումբը հաջողությամբ փոփոխվեց։" + zero: "խմբեր չկան" + authorizations: + new: + nope: "Ոչ" + back: "Ետ" + blocks: + create: + success: "Բարի, այլևս չես տեսնի այդ օգտատերին քո լրահոսում։ #silencio!" + destroy: + success: "Եկ տեսնենք՝ ինչ ունեն նրանք ասելու։ #sayhello" + bookmarklet: + post_something: "Գրառել Diaspora-ում" + cancel: "Չեղարկել" + comments: + few: "%{count} մեկնաբանություն" + many: "%{count} մենկնաբանություններ" + new_comment: + comment: "Մեկնաբանել" + commenting: "Մեկնաբանվում է…" + one: "1 մեկնաբանություն" + other: "%{count} մեկնաբանություններ" + two: "%{count} մեկնաբանություն" + zero: "մեկնաբանություն չկա" + contacts: + index: + add_a_new_aspect: "Նոր խումբ ավելացնել" + add_to_aspect_link: "Ընկերներ ավելացնել %{name} -ին" + all_contacts: "Բոլոր ընկերները" + my_contacts: "Իմ ընկերները" + no_contacts: "Երևում է՝ նոր ընկերների կարիք ունես։" + no_contacts_message: "Ստուգել %{community_spotlight}" + only_sharing_with_me: "Միայն ինձ հետ կիսվողները" + remove_person_from_aspect: "Հեռացնել %{person_name} -ին %{aspect_name} -ից" + start_a_conversation: "Խոսակցություն սկսիր" + title: "Ընկերներ" + your_contacts: "Քո ընկերները" + one: "1 ընկեր" + sharing: + people_sharing: "Քեզ հետ կիսվող մարդիկ" + zero: "ընկերներ" + conversations: + create: + sent: "Նամակն ուղարկված է" + destroy: + success: "Զրույցը հաջողությամբ ջնջվեց" + helper: + new_messages: + one: "1 նոր նամակ" + other: "%{count} նոր նամակներ" + zero: "Նոր նամակ չկա" + index: + create_a_new_message: "նոր նամակ գրել" + new_message: "Նոր նամակ" + no_messages: "նամակ չկա" + new: + send: "Ուղարկել" + sending: "Ուղարկվում է․․․" + subject: "թեմա" + to: "" + show: + reply: "պատասխանել" + replying: "Պատասխանը ուղարկվում է..." delete: "Ջնջել" - hide: "Թաքցնել" \ No newline at end of file + email: "Էլփոստ" + error_messages: + helper: + correct_the_following_errors_and_try_again: "Ուղղիր հետևյալ վրիպակները և կրկին փորձիր։" + invalid_fields: "Անվավեր դաշտեր" + post_not_public: "Գրառումը, որ փորձում ես դիտել, հրապարակային չէ։" + fill_me_out: "Լրացրու ամբողջովին" + find_people: "Գտնել մարդկանց կամ #պիտակներ" + hide: "Թաքցնել" + invitations: + a_facebook_user: "Facebook-յան օգտատեր" + create: + already_sent: "Այս մարդուն արդեն հրավիրել ես։" + no_more: "Այլևս հրավեր ուղարկելու իրավունք չունես։" + own_address: "Դու չես կարող հրավեր ուղարկել քո սեփական հասցեին։" + rejected: "Հետևյալ էլ.հասցեների հետ կապված խնդիրներ կան՝ " + sent: "Հրավերներ ուղարկվեցին հետևյալ անձանց՝ " + edit: + accept_your_invitation: "Ընդունի՛ր հրավերդ" + your_account_awaits: "Հաշիվդ քեզ է սպասում։" + new: + already_invited: "Հետևյալ մարդիկ չեն ընդունել հրավերդ՝" + aspect: "Խումբ" + codes_left: + one: "Այս հղումը գործող է մեկ հրավերի համար։" + other: "Այս հղումը գործող է %{count} հրավերի համար։" + zero: "Այս հղմամբ հրավիրել այլևս հնարավոր չէ։" + comma_separated_plz: "Կարող ես մուտքագրել մի քանի էլ.հասցե՝ բաժանելով դրանք ստորակետներով։" + invite_someone_to_join: "Հրավիրիր որևիցե մեկին՝ միանալու Diaspora-ին։" + language: "Լեզու" + paste_link: "Կիսվիր այս հղումով ընկերներիդ հետ, որպեսզի հրավիրես նրանց Diaspora*, կամ ուղարկիր այն անմիջապես նրանց էլ.հասցեներին։" + personal_message: "Անձնական նամակ" + resend: "Կրկին ուղարկել" + send_an_invitation: "Հրավեր ուղարկել" + send_invitation: "Հրավեր ուղարկել" + layouts: + application: + back_to_top: "Թռնել վերև" + whats_new: "ի՞նչ կա" + your_aspects: "քո խմբերը" + header: + blog: "բլոգ" + code: "ծածկագիր" + login: "մտնել" + logout: "Դուրս գալ" + profile: "Անձնական էջ" + recent_notifications: "Վերջին ծանուցումներ" + settings: "Կարգավորումներ" + view_all: "Դիտել ամբողջը" + likes: + likes: + people_like_this: + one: "%{count} հավանում" + other: "%{count} հավանումներ" + zero: "հավանում չկա" + people_like_this_comment: + one: "%{count} հավանում" + other: "%{count} հավանումներ" + zero: "հավանում չկա" + limited: "Սահմանափակ" + more: "Ավելի՜ն" + next: "հաջորդ" + no_results: "Ոչինչ չգտնվեց ։(" + notifications: + helper: + new_notifications: + one: "1 նոր ծանուցում" + other: "%{count} նոր ծանուցումներ" + zero: "Նոր ծանուցում չկա" + index: + and: "և" + and_others: + one: "ևս մեկը" + other: "ևս %{count}ը" + zero: "այլևս ոչ ոք" + mark_all_as_read: "Նշել ամբողջը որպես ընթերցված" + mark_unread: "Նշել որպես չկարդացված" + notifications: "Ծանուցումներ" + post: "Գրառում" + notifier: + a_post_you_shared: "գրառումը․" + accept_invite: "Ընդունի՛ր քո՝ Diaspora*-ի հրավերը։" + click_here: "սեղմի՛ր այստեղ" + hello: "Ողջու՜յն, %{name}։" + invite: + message: |- + Ողջու՛յն։ + + Քեզ հրավիրել են՝ միանալու Diaspora*-ին։ + + Անցիր այս հղումով՝ սկսելու համար՝ + + [%{invite_url}][1] + + + Սիրով՝ + + Diaspora*-ի էլ.փոստային ռոբոտ։ + + [1]: %{invite_url} + invited_you: "%{name}-ն է հրավիրել քեզ Diaspora*" + reshared: + view_post: "Նայել գրառումը" + single_admin: + subject: "Նամակ՝ Diaspora-ի հաշվիդ մասին։" + started_sharing: + sharing: "սկսեց կիսվել քո հետ։" + subject: "%{name}-ը սկսեց կիսվել քո հետ Diaspora*-ում" + thanks: "Շնորհակալություն," + to_change_your_notification_settings: "ծանուցումների կարգավորումները փոխելու համար" + ok: "Լավ" + or: "կամ" + password: "Գաղտնաբառ" + password_confirmation: "Գաղտնաբառի հաստատում" + people: + add_contact: + invited_by: "քեզ հրավիրել է" + few: "%{count} մարդ" + helper: + results_for: " արդյունքներ %{params}-ի համար" + index: + couldnt_find_them_send_invite: "Չե՞ս գտնում նրանց։ Հրավե՛ր ուղարկիր։" + looking_for: "%{tag_link} պիտակո՞վ գրառումներ ես փնտրում։" + no_one_found: "...և ոչ ոք չգտնվեց։" + results_for: "Որոնման արդյունքները" + searching: "փնտրվում է, խնդրում ենք լինել համբերատար..." + last_post: "Վերջին Գրառում" + many: "%{count} մարդ" + one: "1 հոգի" + other: "%{count} մարդ" + person: + add_contact: "Ընդլայնել կապերը:" + thats_you: "Դա դու՛ ես։" + profile_sidebar: + bio: "կենսագրություն" + born: "ծննդյան ամսաթիվ" + edit_my_profile: "Խմբագրել իմ անձնական էջը" + gender: "սեռ" + in_aspects: "խմբերում" + location: "տեղակայություն" + show: + closed_account: "Այս հաշիվը փակված է։" + ignoring: "Դու արհամարհում ես %{name}-ի բոլոր գրառումները։" + message: "Հաղորդագրություն" + recent_posts: "Վերջին գրառումները" + recent_public_posts: "Վերջին հրապարակային գրառումները" + see_all: "Տեսնել բոլորին" + start_sharing: "սկսիր կիսվել:" + sub_header: + edit: "խմբագրել" + you_have_no_tags: "դու չունես որևէ պիտակ:" + two: "%{count} մարդ" + zero: "մարդ չկա" + photos: + comment_email_subject: "%{name}-ի նկարները" + create: + type_error: "Նկարի վերբեռնումը տապալվեց։ Համոզված ե՞ս, որ հենց նկար էիր ավելացրել։" + destroy: + notice: "Լուսանկարը ջնջված է։" + edit: + editing: "Փոփոխվում է" + new: + back_to_list: "Ետ՝ ցուցակին" + new_photo: "Նոր լուսանկար" + post_it: "հրապարակի՛ր սա" + new_photo: + size_error: "{file} չափից դուրս մեծ է, հնարավոր առավելագույն չափն է՝ {sizeLimit}:" + new_profile_photo: + or_select_one_existing: "կամ ընտրիր արդեն գոյություն ունեցող նկարներից մեկը՝ %{photos}" + upload: "Նոր նկար վերբեռնի՛ր" + photo: + view_all: "դիտել %{name}-ի բոլոր նկարները" + show: + delete_photo: "Ջնջել լուսանկարը" + edit: "խմբագրել" + edit_delete_photo: "Փոխել նկարի նկարագրությունը կամ ջնջել նկարը" + make_profile_photo: "դարձնել գլխավոր նկար" + show_original_post: "Ցույց տալ սկզբնական գրառումը" + update_photo: "Փոխել նկարը" + update: + error: "Չհաջողվեց խմբագրել նկարը։" + notice: "Նկարդ հաջողությամբ փոխվեց։" + posts: + presenter: + title: "%{name}-ի գրառումը" + show: + destroy: "Ջնջել" + not_found: "Ցավում ենք, չստացվեց գտնել այդ գրառումը։" + photos_by: + one: "1 լուսանկար %{author}-ից" + other: "%{count} լուսանկարներ %{author}-ից" + zero: "Ոչ մի լուսանկար %{author}-ից" + previous: "նախորդ" + privacy: "Անձնական" + privacy_policy: "Անձնական քաղաքականություն" + profile: "Անձնական էջ" + profiles: + edit: + allow_search: "Թույլատրել մարդկանց փնտրել քեզ Diaspora-ի սահմաններում" + edit_profile: "Խմբագրել անձնական էջը" + first_name: "Անուն" + last_name: "Ազգանուն" + update_profile: "Թարմացրու անձնական էջդ:" + your_bio: "Կենսագրություն" + your_birthday: "Ծննդյան ամսաթիվ" + your_gender: "Սեռ" + your_location: "Որտե՞ղ ես" + your_name: "Անուն" + your_photo: "Քո նկարը" + your_public_profile: "Քո հրապարակային Էջը" + your_tags: "Նկարագրիր քեզ 5 բառով" + your_tags_placeholder: "օրինակ՝ #կինոնկար #կատուներ #ճանապարհորդություն #ուսուցիչ #Երևան" + update: + failed: "Չհաջողվեց թարմացնել էջդ" + updated: "Էջդ թարմացվեց" + public: "Հրապարակային" + registrations: + closed: "Գրանցումները հասանելի չեն Diaspora-ի այս փոդում։" + create: + success: "Դու միացար Diaspora-ին։" + edit: + cancel_my_account: "Փակել հաշիվս" + edit: "Փոփոխել %{name}ը" + password_to_confirm: "(փոփոխությունները հաստատելու համար հարկավոր է քո ներկայիս գաղտնաբառը)" + unhappy: "Տխու՞ր ես։" + update: "Թարմացնել" + new: + continue: "Շարունակել" + create_my_account: "Ստեղծե՜լ իմ հաշիվը:" + diaspora: "<3 Diaspora*" + email: "ԷԼ.ՀԱՍՑԵ" + enter_email: "Մուտքագրիր էլ.հասցե" + enter_password: "Մուտքագրիր գաղտնաբառ (առնվազն վեց նիշ)" + enter_password_again: "Մուտքագրիր նույն գաղտնաբառը" + enter_username: "Ընտրիր օգտանուն (միայն տառեր, թվեր և _)" + hey_make: "Հե՜յ,
    ՍՏԵՂԾԻ՛Ր
    ՄԻ ԲԱՆ" + join_the_movement: "Միանա՜լ շարժմանը" + password: "ԳԱՂՏՆԱԲԱՌ" + sign_up: "ԳՐԱՆՑՎԵԼ" + sign_up_message: "♥-ով լի սոցիալական ցանց" + username: "ՕԳՏԱՆՈՒՆ" + requests: + create: + sending: "Ուղարկվում է" + sent: "%{name}-ին առաջարկել ես կիսվել: Նրանք առաջարկը կտեսնեն, երբ հաջորդ անգամ Diaspora մուտք գործեն:" + helper: + new_requests: + one: "Նոր հայտ!" + other: "%{count} նոր հայտեր!" + zero: "Ոչ մի նոր հայտ" + manage_aspect_contacts: + existing: "Գոյություն ունեցող ընկերները" + new_request_to_person: + sent: "ուղարկվեց" + reshares: + reshare: + deleted: "Օրիգինալ գրառումը ջնջվել է հեղինակի կողմից։" + reshare_confirmation: "Տարածե՞լ %{author}-ի գրառումը։" + show_original: "Ցույց տալ բնօրինակը" + search: "Որոնում" + services: + finder: + no_friends: "Facebook-ից ընկերներ չգտնվեցին:" + index: + connect_to_facebook: "Միացնել Facebook-ին" + connect_to_tumblr: "Միացնել Tumblr-ին" + connect_to_twitter: "Միացնել Twitter-ին" + disconnect: "Անջատել" + edit_services: "Փոփոխել ծառայությունները" + logged_in_as: "մուտք է գործվել որպես" + no_services: "Որևիցե ծառայություն չեք միացրել դեռևս:" + really_disconnect: "Անջատե՞լ %{service}-ը" + inviter: + click_link_to_accept_invitation: "Անցիր այս հղումով, որ ընդունես քո հրավերը" + join_me_on_diaspora: "Միացի՛ր ինձ DIASPORA*-ում" + remote_friend: + invite: "հրավիրել" + not_on_diaspora: "Դեռ Diaspora-ում չկա" + resend: "Կրկին ուղարկել:" + settings: "Կարգավորումներ" + share_visibilites: + update: + post_hidden_and_muted: "%{name}-ի գրառումը թաքցվել է, իսկ ծանուցումները՝ անջատվել։" + see_it_on_their_profile: "Եթե ուզում ես այս գրառման հետ կապված նորությունները տեսնել, այցելիր %{name}-ի անձնական էջը։" + shared: + add_contact: + create_request: "Գտնել Diaspora ID-ի միջոցով" + enter_a_diaspora_username: "Մուտքագրիր Diaspora օգտանուն" + know_email: "Գիտես նրանց էլ.հասցենե՞րը։ Կարող ես հրավիրել նրանց։" + your_diaspora_username_is: "Քո Diaspora-ի օգտանունն է %{diaspora_handle}" + aspect_dropdown: + add_to_aspect: "Ընդլայնել կապերը:" + contact_list: + all_contacts: "Բոլոր ընկերները:" + footer: + your_aspects: "քո խմբերը" + invitations: + by_email: "Էլ.հասցեով" + dont_have_now: "Այլևս հրավիրելու իրավունք չունես, բայց շուտով կգան նոր հնարավորություններ։" + from_facebook: "Facebook-ից" + invitations_left: "մնաց %{count} հատ" + invite_someone: "Հրավիրել որևէ մեկին" + invite_your_friends: "Կանչի՛ր ընկերներիդ" + invites: "Հրավերներ" + invites_closed: "Ներկայից պահին հրավերները հասանելի չեն Diaspora-յի այս փոդում։" + share_this: "Տարածի՛ր այս հղումը էլ.հասցեի, բլոգի կամ սիրելի սոցիալական ցանցի միջոցով։" + notification: + new: "Նոր %{type} %{from}-ից" + public_explain: + new_user_welcome_message: "Օգտագործիր #hashպիտակները՝ գրառումներդ դասակարգելու և հետաքրքրություններդ կիսող մարդկանց գտնելու համար։ Նշիր ընկերներիդ՝ օգտագործելով @Հիշատակել" + share: "Կիսվել" + publisher: + all: "բոլորը" + make_public: "Դարձնել հանրամատչելի" + new_user_prefill: + hello: "Ողջու՛յն, ժողովուրդ, #%{new_user_tag}։ " + i_like: "Իմ հետաքրքրություններն են՝ %{tags}։ " + invited_by: "Շնորհակալություն հրավերի համար, " + newhere: "ԵսՆորեկԵմ" + share: "Կիսվել:" + upload_photos: "Վերբեռնել լուսանկարները" + whats_on_your_mind: "Ի՞նչ կա մտքիդ։" + reshare: + reshare: "Տարածել" + stream_element: + currently_unavailable: "մեկնաբանումները այս պահին հասանելի չեն" + dislike: "Ապահավանել" + hide_and_mute: "Թաքցնել և անջատել գրառումը" + ignore_user: "Արհամարհել %{name}-ին" + like: "Հավանել" + show: "Ցուցադրել" + unlike: "Ապահավանել" + via_mobile: "հեռախոսով" + viewable_to_anyone: "Այս գրառումը տեսանելի է համացանցում ամենքին" + status_messages: + destroy: + failure: "Չհաջողվեց ջնջել գրառումը" + stream_helper: + hide_comments: "Թաքցնել բոլոր մեկնաբանությունները" + show_comments: + one: "Ցուցադրել ևս մեկ մեկնաբանություն" + other: "Ցուցադրել ևս %{count} մեկնաբանություն" + zero: "Այլևս մեկնաբանություն չկա" + streams: + activity: + title: "Իմ գործունեությունը:" + aspects: + title: "Իմ խմբերը" + aspects_stream: "Խմբեր" + comment_stream: + contacts_title: "Մարդիկ, ում գրառումները դու մեկնաբանել ես" + title: "Մեկնաբանված Գրառումներ" + followed_tag: + add_a_tag: "Ավելացնել պիտակ" + contacts_title: "Մարդիկ, ովքեր հայթայթել են այս պիտակները" + follow: "Հետևել" + title: "#Հետևվող Պիտակներ" + followed_tags_stream: "#Հետևվող Պիտակներ" + like_stream: + contacts_title: "Մարդիկ, ում գրառումները դու հավանել ես" + mentioned_stream: "@Հիշատակումներ" + mentions: + contacts_title: "Մարդիկ, ովքեր հիշատակել են քեզ" + title: "@Հիշատակումներ" + multi: + contacts_title: "Լրահոսիդ ժողովուրդը" + title: "Լրահոս" + public: + title: "Հանրային ակտիվություն" + tags: + contacts_title: "Մարդիկ, ովքեր հայթայթել են այս պիտակը" + tag_followings: + create: + failure: "Չստացվեց հետևել #%{name}-ին... Գուցե արդեն հետևու՞մ ես դրան։" + none: "Դու չես կարող դատարկ պիտակ հետևել։" + success: "Հեհեե՜յ։ Սկսեցիր հետևել #%{name}-ին։" + destroy: + success: "Սատանան տանի՜։ Դու այլևս չես հետևում #%{name} պիտակին։" + tags: + show: + follow: "Հետևել #%{tag}" + followed_by: "հետևում են" + following: "Հետևում ես #%{tag}-ին" + nobody_talking: "Դեռ ոչ ոք չի խոսում %{tag}-ի մասին" + none: "Դատարկ պիտակ գոյություն չունի։" + people_tagged_with: "%{tag}-ով պիտակավորված մարդիկ" + posts_tagged_with: "Գրառումը պիտակավորված է #%{tag}-ով" + stop_following: "Դադարել հետևել #%{tag}-ին" + tokens: + show: + connect_to_cubbies: "Միանալ Cubbi․es-ին" + daniels_account: "Դանիելի Diaspora հաշիվը" + love_to_try: "Ուրախ կլինեինք, եթե փորձարկեիր դա։" + sign_up_today: "Գրանցվի՛ր այսօր։" + undo: "Չեղարկե՞լ" + username: "Օգտանուն" + users: + confirm_email: + email_confirmed: "%{email} էլ․ փոստը ակտիվացված է" + email_not_confirmed: "Էլ․ փոստը չի կարող ակտիվացվել։ Միգուցե հղումը սխա՞լ է" + destroy: + no_password: "Հաշիվդ փակելու համար մուտքագրիր ներկայիս գաղտնաբառդ։" + wrong_password: "Մուտքագրված գաղտնաբառը չի համապատասխանում ներկայիս գաղտնաբառին։" + edit: + change: "Փոփոխություն:" + change_email: "Փոխել էլ.հասցեն" + change_language: "Փոխել լեզուն" + change_password: "Փոխել գաղտնաբառը" + character_minimum_expl: "պետք է առնվազն վեց նիշանի լինի" + close_account: + dont_go: "Հեե՜յ, մի հեռացիր, այստեղ լավ է։" + if_you_want_this: "Եթե իրոք վստահ ես, ապա ստորև մուտքագրիր գաղտնաբառդ և սեղմիր \"Փակել հաշիվս\"" + lock_username: "Արդյունքում ներկայիս օգտանունդ արգելափակվելու է, եթե որոշես հետագայում ետ գրանցվել։" + make_diaspora_better: "Կուզենայինք, որ օգնեիր դարձնել Diaspora-ն առավել լավ, այնպես որ հեռանալու փոխարեն լավ կլիներ, որ օգնեիր մեզ այդ հարցում։ Բայց եթե որոշել ես գնալ, ապա ծանոթացիր, թե ինչ կլինի դրա արդյունքում՝" + mr_wiggles: "Պրն. Փիսոն կտխրի, եթե դու գնաս" + close_account_text: "Փակել հաշիվս" + comment_on_post: "...որևէ մեկը մեկնաբանում է քո գրառման տա՞կ։" + current_password: "Ներկայիս գաղտնաբառ" + download_photos: "ներբեռնել իմ նկարները" + download_xml: "ներբեռնել իմ xml-ը" + edit_account: "Խմբագրել հաշիվը" + following: "Հետևելու կարգավորումներ" + getting_started: "Նոր օգտատերի արտոնությունները" + liked: "...որևէ մեկը հավանել է քո գրառու՞մը։" + mentioned: "...քեզ հիշատակել են գրառման մե՞ջ։" + new_password: "Նոր գաղտնաբառ" + private_message: "...անձնական նամա՞կ ես ստանում։" + receive_email_notifications: "Ստանալ ծանուցումներ էլ.հասցեին, երբ..." + reshared: "...որևէ մեկը տարածում է քո գրառու՞մը։" + started_sharing: "...որևէ մեկը սկսում է կիսվե՞լ քեզ հետ։" + your_email: "Էլ.հասցեն" + your_handle: "Diaspora ID-ն" + getting_started: + awesome_take_me_to_diaspora: "Զիլ է! Տար ինձ Diaspora*" + community_welcome: "Diaspora-ի համայնքը ուրախ է տեսնել քեզ այստեղ։" + hashtag_suggestions: "Փորձիր հետևել պիտակներ, ինչպիսիք են #արվեստ #կինոնկար #gif և այլն։" + saved: "Պահված է!" + well_hello_there: "Դե ինչ, ողջու՜յն։" + what_are_you_in_to: "Ինչո՞վ ես հետաքրքրված։" + who_are_you: "Ո՞վ ես դու։" + privacy_settings: + ignored_users: "Արհամարհված օգտատերեր" + public: + does_not_exist: "%{username} օգտատերը գոյություն չունի!" + update: + language_changed: "Լեզուն փոխված է։" + language_not_changed: "Լեզվի փոփխումը ձախողվեց" + password_changed: "Գաղտնաբառը փոխված է։ Այժմ կարող ես մուտք գործել քո նոր գաղտնաբառով։" + password_not_changed: "Գաղտնաբառի փոփոխումը ձախողվեց" + settings_not_updated: "Կարգավորումների թարմացումը ձախոխվեց:" + settings_updated: "Կարգավորումները թարմացված են" + unconfirmed_email_changed: "Էլ.հասցեն փոխված է և ակտիվացնելու կարիք ունի։" + welcome: "Բարի գալու՜ստ։" + will_paginate: + next_label: "հաջորդ »" + previous_label: "« նախորդ" \ No newline at end of file diff --git a/config/locales/diaspora/ia.yml b/config/locales/diaspora/ia.yml index 322a32e17..764237d7f 100644 --- a/config/locales/diaspora/ia.yml +++ b/config/locales/diaspora/ia.yml @@ -164,7 +164,85 @@ ia: success: "Tu aspecto, %{name}, ha essite modificate con successo." zero: "nulle aspecto" back: "Retornar" + bookmarklet: + explanation: "Invia cosas a Diaspora ab ubique con iste ligamine: %{link}" + post_something: "Inviar a Diaspora" + post_success: "Inviate! Claudente!" cancel: "Cancellar" + comments: + few: "%{count} commentos" + many: "%{count} commentos" + new_comment: + comment: "Commentar" + commenting: "Commenta…" + one: "1 commento" + other: "%{count} commentos" + two: "%{count} commentos" + zero: "nulle commento" + contacts: + create: + failure: "Creation de contacto fallite" + few: "%{count} contactos" + index: + add_a_new_aspect: "Adder un nove aspecto" + add_to_aspect: "adder contactos a %{name}" + add_to_aspect_link: "adder contactos a %{name}" + all_contacts: "Tote le contactos" + community_spotlight: "Usatores in evidentia" + many_people_are_you_sure: "Es tu secur de voler initiar un conversation private con plus de %{suggested_limit} contactos? Publicar un message in iste aspecto pote esser un melior maniera de contactar les." + my_contacts: "Mi contactos" + no_contacts: "Il pare que tu debe adder alcun contactos!" + no_contacts_message: "Visita %{community_spotlight}" + no_contacts_message_with_aspect: "Visita %{community_spotlight} o %{add_to_aspect_link}" + only_sharing_with_me: "Solmente qui divide con me" + remove_person_from_aspect: "Remover %{person_name} de \"%{aspect_name}\"" + start_a_conversation: "Initiar un conversation" + title: "Contactos" + your_contacts: "Tu contactos" + many: "%{count} contactos" + one: "1 contacto" + other: "%{count} contactos" + sharing: + people_sharing: "Personas qui divide con te:" + spotlight: + community_spotlight: "Usatores in evidentia" + two: "%{count} contactos" + zero: "contactos" + conversations: + create: + fail: "Message invalide" + sent: "Message inviate" + destroy: + success: "Conversation removite con successo" + helper: + new_messages: + human: "Nulle nove message" + po: "1 nove message" + yml: "%{count} nove messages" + index: + create_a_new_message: "crear un nove message" + inbox: "Cassa de entrata" + message_inbox: "Cassa de entrata de messages" + new_message: "Nove message" + no_conversation_selected: "nulle conversation seligite" + no_messages: "nulle message" + new: + abandon_changes: "Abandonar modificationes?" + send: "Inviar" + sending: "Invia…" + subject: "subjecto" + to: "a" + new_message: + fail: "Message invalide" + show: + delete: "deler e blocar conversation" + reply: "responder" + replying: "Responde…" + date: + formats: + birthday: "le %d de %B" + birthday_with_year: "le %d de %B %Y" + fullmonth_day: "le %d de %B" delete: "Deler" email: "E-mail" error_messages: @@ -174,21 +252,371 @@ ia: fill_me_out: "Plena me" find_people: "Cercar personas o #etiquettas" hide: "Celar" + invitations: + a_facebook_user: "Un usator de Facebook" + check_token: + not_found: "Indicio de invitation non trovate" + create: + already_contacts: "Tu es jam connectite con iste persona." + already_sent: "Tu ha jam invitate iste persona." + no_more: "Tu non ha altere invitationes." + own_address: "Non es possibile inviar un invitation a tu proprie adresse." + rejected: "Le sequente adresses de e-mail habeva problemas: " + sent: "Invitationes ha essite inviate a: " + edit: + accept_your_invitation: "Acceptar tu invitation" + your_account_awaits: "Un conto te attende!" + new: + already_invited: "Le sequente personas non ha acceptate tu invitation:" + aspect: "Aspecto" + check_out_diaspora: "Discoperi Diaspora!" + if_they_accept_info: "si iste persona accepta, illa essera addite al aspecto in le qual tu la invitava." + invite_someone_to_join: "Invita qualcuno a unir se a Diaspora!" + language: "Lingua" + personal_message: "Message personal" + resend: "Reinviar" + send_an_invitation: "Inviar un invitation" + send_invitation: "Inviar invitation" + to: "A" + layouts: + application: + back_to_top: "Initio del pagina" + powered_by: "ACTIONATE PER DIASPORA*" + public_feed: "Fluxo public de Diaspora pro %{name}" + toggle: "(dis)activar mobile" + whats_new: "que es nove?" + your_aspects: "tu aspectos" + header: + admin: "admin" + blog: "blog" + code: "codice" + login: "aperir session" + logout: "Clauder session" + profile: "Profilo" + recent_notifications: "Notificationes recente" + settings: "Configuration" + view_all: "Vider totes" + likes: + likes: + people_dislike_this: + human: "nulle antipathia" + po: "%{count} antipathia" + yml: "%{count} antipathias" + people_like_this: + human: "nulle appreciation" + po: "%{count} appreciation" + yml: "%{count} appreciationes" + people_like_this_comment: + human: "nulle appreciation" + po: "%{count} appreciation" + yml: "%{count} appreciationes" limited: "Limitate" more: "Plus" next: "sequente" no_results: "Nulle resultato trovate" + notifications: + also_commented: + human: "%{actors} commentava anque le %{post_link} de %{post_author}." + po: "%{actors} commentava anque le %{post_link} de %{post_author}." + yml: "%{actors} commentava anque le %{post_link} de %{post_author}." + also_commented_deleted: + human: "%{actors} commentava un entrata delite." + po: "%{actors} commentava un entrata delite." + yml: "%{actors} commentava un entrata delite." + comment_on_post: + human: "%{actors} commentava tu %{post_link}." + po: "%{actors} commentava tu %{post_link}." + yml: "%{actors} commentava tu %{post_link}." + helper: + new_notifications: + human: "Nulle nove notification" + po: "1 nove notification" + yml: "%{count} nove notificationes" + index: + and: "e" + and_others: + human: "e nemo altere" + po: "e un altere" + yml: "e %{count} alteres" + mark_all_as_read: "Marcar totes como legite" + notifications: "Notificationes" + liked: + human: "%{actors} ha appreciate tu %{post_link}." + po: "%{actors} ha appreciate tu %{post_link}." + yml: "%{actors} ha appreciate tu %{post_link}." + liked_post_deleted: + human: "%{actors} appreciava tu entrata delite." + po: "%{actors} appreciava tu entrata delite." + yml: "%{actors} appreciava tu entrata delite." + mentioned: + human: "%{actors} te ha mentionate in un %{post_link}." + po: "%{actors} te ha mentionate in un %{post_link}." + yml: "%{actors} te ha mentionate in un %{post_link}." + mentioned_deleted: + human: "%{actors} te mentionava in un entrata delite." + po: "%{actors} te mentionava in un entrata delite." + yml: "%{actors} te mentionava in un entrata delite." + post: "entrata" + private_message: + human: "%{actors} te inviava un message." + po: "%{actors} te inviava un message." + yml: "%{actors} te inviava un message." + reshared: + human: "%{actors} ha repetite tu %{post_link}." + po: "%{actors} ha repetite tu %{post_link}." + yml: "%{actors} ha repetite tu %{post_link}." + reshared_post_deleted: + human: "%{actors} repeteva tu entrata delite." + po: "%{actors} repeteva tu entrata delite." + yml: "%{actors} repeteva tu entrata delite." + started_sharing: + human: "%{actors} comenciava a divider con te." + po: "%{actors} comenciava a divider con te." + yml: "%{actors} comenciava a divider con te." + notifier: + a_post_you_shared: "un entrata." + click_here: "clicca hic" + comment_on_post: + reply: "Responde o lege le message de %{name} >" + confirm_email: + click_link: "Pro activar tu nove adresse de e-mail %{unconfirmed_email}, per favor seque iste ligamine:" + subject: "Per favor activa tu nove adresse de e-mail %{unconfirmed_email}" + email_sent_by_diaspora: "Iste message ha essite inviate per %{pod_name}. Si tu non vole reciper altere e-mail como iste," + hello: "Salute %{name}!" + liked: + liked: "%{name} apprecia tu entrata" + view_post: "Vider entrata >" + mentioned: + mentioned: "te mentionava in un message:" + subject: "%{name} te ha mentionate in Diaspora*" + private_message: + reply_to_or_view: "Responde o lege iste conversation >" + reshared: + reshared: "%{name} ha repetite tu entrata" + view_post: "Vider entrata >" + single_admin: + admin: "Tu administrator de Diaspora" + subject: "Un message concernente tu conto de Diaspora:" + started_sharing: + sharing: "ha comenciate a divider con te!" + subject: "%{name} comenciava a divider con te in Diaspora*" + view_profile: "Vider le profilo de %{name}" + thanks: "Gratias," + to_change_your_notification_settings: "pro cambiar tu configuration de notificationes" ok: "OK" or: "o" password: "Contrasigno" password_confirmation: "Confirmation del contrasigno" + people: + add_contact_small: + add_contact_from_tag: "adder contacto ab etiquetta" + aspect_list: + edit_membership: "modificar membrato del aspecto" + few: "%{count} personas" + helper: + people_on_pod_are_aware_of: " personas in iste pod es conscie de" + results_for: " resultatos pro %{params}" + index: + couldnt_find_them_send_invite: "Non trovate? Invia un invitation!" + looking_for: "Cerca entratas con le etiquetta %{tag_link}?" + no_one_found: "…e nemo ha essite trovate." + no_results: "Un momento! Tu debe cercar qualcosa." + results_for: "cercar resultatos pro" + many: "%{count} personas" + one: "1 persona" + other: "%{count} personas" + person: + add_contact: "adder contacto" + already_connected: "Jam connectite" + pending_request: "Requesta pendente" + thats_you: "Es tu!" + profile_sidebar: + bio: "bio" + born: "data de nascentia" + edit_my_profile: "Modificar mi profilo" + gender: "sexo" + in_aspects: "in aspectos" + location: "loco" + remove_contact: "remover contacto" + remove_from: "Remover %{name} de %{aspect}?" + show: + closed_account: "Iste conto ha essite claudite." + does_not_exist: "Iste persona non existe!" + has_not_shared_with_you_yet: "%{name} non ha ancora dividite alcun cosa con te!" + ignoring: "Tu ignora tote le entratas de %{name}." + incoming_request: "%{name} vole divider con te" + mention: "Mention" + message: "Message" + not_connected: "Tu non divide con iste persona" + recent_posts: "Entratas recente" + recent_public_posts: "Entratas public recente" + return_to_aspects: "Retornar a tu pagina de aspectos" + see_all: "Vider totes" + start_sharing: "comenciar a divider" + to_accept_or_ignore: "pro acceptar o ignorar lo." + sub_header: + add_some: "adder alcunes" + edit: "modificar" + you_have_no_tags: "tu non ha etiquettas!" + two: "%{count} personas" + webfinger: + fail: "%{handle} non ha essite trovate." + zero: "nemo" + photos: + comment_email_subject: "Photo de %{name}" + create: + integrity_error: "Le incargamento del photo ha fallite. Es tu secur que iste file contine un imagine?" + runtime_error: "Le incargamento del photo ha fallite a causa de un problema interne." + type_error: "Le incargamento del photo ha fallite. Es tu secur que un imagine ha essite addite?" + destroy: + notice: "Photo delite." + edit: + editing: "Sub modification" + new: + back_to_list: "Retornar al lista" + new_photo: "Nove photo" + post_it: "inviar lo!" + new_photo: + empty: "{file} es vacue. Per favor re-selige le files sin iste." + invalid_ext: "{file} ha un extension inadmissibile. Solmente {extensions} es permittite." + size_error: "{file} es troppo grande. Le dimension maxime es {sizeLimit}." + new_profile_photo: + or_select_one_existing: "o selige un de tu %{photos} jam existente" + upload: "Incargar un nove photo de profilo!" + photo: + view_all: "vider tote le photos de %{name}" + show: + collection_permalink: "permaligamine al collection" + delete_photo: "Deler photo" + edit: "modificar" + edit_delete_photo: "Modificar description del photo / deler photo" + make_profile_photo: "facer photo de profilo" + show_original_post: "Monstrar entrata original" + update_photo: "Actualisar photo" + update: + error: "Le modification del photo ha fallite." + notice: "Photo actualisate con successo." + posts: + show: + destroy: "Deler" + not_found: "Impossibile trovar iste entrata." + permalink: "permaligamine" + photos_by: + human: "Nulle photo per %{author}" + po: "Un photo per %{author}" + yml: "%{count} photos per %{author}" + reshare_by: "Repetite per %{author}" previous: "precedente" privacy: "Confidentialitate" privacy_policy: "Politica de confidentialitate" profile: "Profilo" + profiles: + edit: + allow_search: "Permitter que on te cerca in Diaspora" + edit_profile: "Modificar profilo" + first_name: "Prenomine" + last_name: "Nomine de familia" + update_profile: "Actualisar profilo" + you_are_nsfw: "Tu te ha marcate como non secur pro le travalio. Tu contento non essera revelate a personas qui ha blocate le fluxos con material censurabile." + you_are_safe_for_work: "Tu te ha marcate como secur pro le travalio. Isto significa que tu promitte que tu entratas essera conforme al directivas del communitate." + your_bio: "Tu bio" + your_birthday: "Tu data de nascentia" + your_gender: "Tu sexo" + your_location: "Tu loco" + your_name: "Tu nomine" + your_photo: "Tu photo" + your_private_profile: "Tu profilo private" + your_public_profile: "Tu profilo public" + your_tags: "Describe te in 5 parolas" + your_tags_placeholder: "p.ex. #films #cattones #viages #docente #interlingua" + update: + failed: "Le actualisation del profilo ha fallite" + updated: "Profilo actualisate" public: "Public" + reactions: + human: "0 responsas" + po: "1 responsa" + yml: "%{count} responsas" + registrations: + closed: "Le creation de contos es claudite in iste pod de Diaspora." + create: + success: "Tu ha adherite a Diaspora!" + edit: + cancel_my_account: "Cancellar mi conto" + edit: "Modificar %{name}" + leave_blank: "(lassa isto vacue si tu non vole cambiar lo)" + password_to_confirm: "(nos require tu contrasigno actual pro confirmar le cambiamentos)" + unhappy: "Non felice?" + update: "Actualisar" + new: + create_my_account: "Crear mi conto!" + enter_email: "Specifica adresse de e-mail" + enter_password: "Elige un contrasigno (de sex characteres al minimo)" + enter_password_again: "Repete le contrasigno" + enter_username: "Elige un nomine de usator (usa solmente litteras, numeros e tractos de sublineamento)" + join_the_movement: "Adhere al movimento!" + sign_up_message: "Rete social con ♥" + requests: + create: + sending: "Invio in curso" + sent: "Tu ha demandate de divider con %{name}. Iste persona lo videra le proxime vice que illa aperira session in Diaspora." + destroy: + error: "Per favor selige un aspecto!" + ignore: "Demanda de contacto ignorate." + success: "Tu ha comenciate a divider." + helper: + new_requests: + human: "nulle nove requesta" + po: "nove requesta!" + yml: "%{count} nove requestas!" + manage_aspect_contacts: + existing: "Contactos existente" + manage_within: "Gerer contactos intra" + new_request_to_person: + sent: "inviate!" + reshares: + comment_email_subject: "Repetition de %{resharer} del entrata de %{author}" + create: + failure: "Un error occurreva durante le repetition de iste entrata." + reshare: + deleted: "Le entrata original ha essite delite per le autor." + reshare: + human: "Repeter" + po: "1 repetition" + yml: "%{count} repetitiones" + reshare_confirmation: "Repeter iste entrata de %{author}?" + reshare_original: "Repeter le original" + reshared_via: "repetite via" + show_original: "Monstrar le original" search: "Cercar" + services: + create: + already_authorized: "Un usator con le ID de Diaspora \"%{diaspora_id}\" ha jam autorisate iste conto de %{service_name}." + failure: "Authentication fallite." + success: "Authentication succedite." + destroy: + success: "Authentication delite con successo." + failure: + error: "un error occurreva durante le connexion a iste servicio" + finder: + fetching_contacts: "Diaspora obtene presentemente tu amicos de %{service}. Per favor reveni in alcun pauc minutas." + index: + connect_to_facebook: "Connecter a Facebook" + connect_to_tumblr: "Connecter a Tumblr" + connect_to_twitter: "Connecter a Twitter" + disconnect: "disconnecter" + edit_services: "Modificar servicios" + logged_in_as: "identificate como" + no_services: "Tu non ha ancora connectite alcun servicio." + really_disconnect: "disconnecter %{service}?" + inviter: + click_link_to_accept_invitation: "Seque iste ligamine pro acceptar tu invitation" + join_me_on_diaspora: "Uni te a me in DIASPORA*" settings: "Configuration" + share_visibilites: + update: + post_hidden_and_muted: "Le entrata de %{name} ha essite celate, e le notificationes ha essite silentiate." + see_it_on_their_profile: "Si tu vole vider actualisationes sur iste entrata, visita le profilo de %{name}." terms_and_conditions: "Terminos e conditiones" undo: "Disfacer?" username: "Nomine de usator" diff --git a/config/locales/diaspora/lt.yml b/config/locales/diaspora/lt.yml index ae944c3a7..e8878c2de 100644 --- a/config/locales/diaspora/lt.yml +++ b/config/locales/diaspora/lt.yml @@ -5,7 +5,9 @@ lt: + _applications: "Programos" _comments: "Komentarai" + _contacts: "Kontaktai" _home: "Pradžia" _photos: "Nuotraukos" _services: "Paslaugos" @@ -13,254 +15,449 @@ lt: activerecord: errors: models: + contact: + attributes: + person_id: + taken: "Negali dubliuotis tarp šio vartotojo kontaktų" + person: + attributes: + diaspora_handle: + taken: "Užimtas" + request: + attributes: + from_id: + taken: "Šis reikalavimas kartojasi" reshare: attributes: root_guid: - taken: "You've already reshared that post!" + taken: "Šitas geras, ne? Jūs jau dalijotės šiuo įrašu!" user: attributes: + email: + taken: "Užimtas" + person: + invalid: "Neteisingas" username: - invalid: "is invalid. We only allow letters, numbers, and underscores" + invalid: "Neteisingas. Galima naudoti tik raides, skaičius ir apatinį brūkšnelį_" + taken: "Užimtas" ago: "%{time} prieš" - all_aspects: "All aspects" + all_aspects: "Visos kategorijos" application: helper: - unknown_person: "nežinomas asmuo" + diaspora_alpha: "DIASPORA* PRADŽIA" + unknown_person: "Nežinomas asmuo" + video_title: + unknown: "Netinkamas video įrašo tipas." are_you_sure: "Ar jūs įsitikinęs?" + are_you_sure_delete_account: "Ar Jūs įsitikinęs, kad norite ištrinti savo paskyrą? Šio veiksmo negalėsite atšaukti!" + aspect_memberships: + destroy: + failure: "Nepavyko ištrinti kontakto iš kategorijos" + no_membership: "Nepavyko rasti kontakto šioje kategorijoje" + success: "Kontaktas sėkmingai pašalintas iš kategorijos" aspects: add_to_aspect: - failure: "Nepavyko pridėti draugo į aspektą." - success: "Draugas į aspektą pridėtas sėkmingai." + failure: "Nepavyko priskirti kontakto kategorijai." + success: "Kontaktas sėkmingai priskirtas kategorijai." + aspect_contacts: + done_editing: "Pakeista" + aspect_listings: + add_an_aspect: "Pridėti kategoriją" + deselect_all: "Nepasirinkti nieko" + edit_aspect: "Redaguoti %{name}" + select_all: "Pasirinkti viską" + aspect_stream: + stay_updated: "Sekite naujienas" + stay_updated_explanation: "Jūsų pagrindiniame sraute galite rasti visus savo kontaktus, Jūsų sekamas žymes, ir išradingų bendruomenės narių įrašus." + contacts_not_visible: "Šios kategorijos kontaktai negalės matyti vienas kito." + contacts_visible: "Šios kategorijos kontaktai galės matyti vienas kitą." create: - failure: "Aspekto sukurti nepavyko." - success: "Spustelk pliusą kairėje ir nurodyk, kas Diasporoje gali matyti tavo naują aspektą." + failure: "Kategorijos sukurti nepavyko." + success: "Nauja kategorija %{name} sukurta." destroy: + failure: "%{name} negali būti pašalintas, nes nėra tuščias." success: "%{name} sėkmingai pašalintas." edit: - make_aspect_list_visible: "make aspect list visible?" - few: "%{count} aspects" + add_existing: "Pridėti egzistuojantį kontaktą" + aspect_list_is_not_visible: "Kategorijų sąrašo nemato kiti esantys šioje kategorijoje" + aspect_list_is_visible: "Kategorijų sąrašas matomas kietiems esantiems šioje kategorijoje" + confirm_remove_aspect: "Ar tikrai norite ištrinti šią kategoriją?" + done: "Atlikta" + make_aspect_list_visible: "Ar leisti šios kategorijos kontaktams matyti vienas kitą?" + remove_aspect: "Ištrinti kategoriją" + rename: "Pervardinti" + update: "Atnaujinti" + updating: "Atnaujinama..." + few: "%{count} kategorijų" helper: - aspect_not_empty: "Aspektas netuščias" + are_you_sure: "Ar tikrai norite ištrinti šią kategoriją?" + aspect_not_empty: "Kategorijoje nėra kontaktų" remove: "šalinti" index: - handle_explanation: "Tai tavo identifikatorius Diaspora tinkle. Jis, kaip ir el. pašto adresas, leidžia kitiems žmonėms susisiekti su jumis." + cubbies: + explanation: "Cubbi.es yra pirmojo tinklapio Diaspora kuriama programa." + heading: "Prisijungti prie internetinės nuotraukų saugyklos Cubbi.es" + learn_more: "Sužinoti daugiau" + diaspora_id: + content_1: "Jūsų unikalus Diaspora ID:" + content_2: "Jo pagalba Jus galima surasti Diaspora tinkle." + heading: "Unikalus Diaspora ID" + donate: "Aukoti dabar" + handle_explanation: "Tai tavo unikalus numeris Diaspora tinkle. Jis, kaip ir el. pašto adresas, leidžia kitiems žmonėms surasti Jus tinkle." help: - here_to_help: "Diaspora community is here to help!" - tag_bug: "#bug" - tag_feature: "#feature" - tag_question: "#question" + do_you: "Ar:" + email_feedback: "%{link} Jūsų atsiliepimai" + feature_suggestion: "... galite pasiūlyti %{link}?" + find_a_bug: "...randate %{link}?" + have_a_question: "... turite %{link}?" + here_to_help: "Diaspora bendruomenė tau gali padėti!" + need_help: "Reikia pagalbos?" + tag_bug: "nesklandumų" + tag_feature: "ypatybė" + tag_question: "klausimų" + tutorials_wiki_and_forum: "%{tutorial} & %{wiki} & %{forum}: Bendruomenės pagalba, kaip padaryti klausimai ir naujienos" + introduce_yourself: "Tai Jūsų srautas. Užeikite ir prisistatykite." + new_here: + follow: "Sekti %{link} ir pasveikinti naujus tinklapio Diaspora* vartotojus!" + learn_more: "Sužinoti daugiau" + title: "Pasveikinkite naujus vartotojus" + no_contacts: "Kontaktų nėra" no_tags: "No tags" - many: "%{count} aspects" + people_sharing_with_you: "Žmonės dalijasi su jumis" + post_a_message: "Parašyti žinutę" + services: + content: "Jūs galite prijungti šias paslaugas prie savo Diaspora tinklapio:" + heading: "Prijungti paslaugas" + unfollow_tag: "Sustabdyti sekimą #%{tag}" + welcome_to_diaspora: "Sveiki atvykę į tinklapį Diaspora, %{name}!" + many: "%{count} kategorijų" move_contact: error: "Klaida perkeliant kontaktą: %{inspect}" - failure: "nepavyko %{inspect}" - success: "Kontaktas perkeltas į aspektą" + failure: "Nepavyko %{inspect}" + success: "Kontaktas perkeltas į kitą kategoriją" new: - name: "Name" + create: "Sukurti" + name: "Vardas (matomas tik Jums)" no_contacts_message: - try_adding_some_more_contacts: "You can search (top) or invite (right) more contacts." + community_spotlight: "Bendruomenės dėmesio centre" + or_spotlight: "Arba galite dalintis su %{link}" + try_adding_some_more_contacts: "Jūs galite ieškoti arba pakviesti daugiau žmonių." + you_should_add_some_more_contacts: "Pridėkite daugiau kontaktų!" no_posts_message: - start_talking: "Dar niekas nepasisakė. Pradėk pokalbį pats!" - one: "1 aspect" - other: "%{count} aspects" + start_talking: "Dar niekas nepasisakė. Pradėkite pokalbį pats!" + one: "1 kategorija" + other: "%{count} kategorijų" seed: + acquaintances: "Pažintys" family: "Šeima" + friends: "Draugai" work: "Darbas" + selected_contacts: + manage_your_aspects: "Tvarkyti savo kategorijas." + no_contacts: "Kol kas neturite nei vieno kontakto." + view_all_community_spotlight: "Matyti viską kas yra bendruomenės dėmesio centre" + view_all_contacts: "Rodyti visus kontaktus" show: - edit_aspect: "keisti aspektą" - two: "%{count} aspects" + edit_aspect: "Keisti kategoriją" + two: "%{count} kategorijos" update: - success: "Aspektas \"%{name}\" pakeistas sėkmingai." - zero: "no aspects" + failure: "Kategorijos %{name} pavadinimas yra per ilgas." + success: "Kategorija %{name} sėkmingai pakeista." + zero: "Nėra kategorijų" back: "Atgal" bookmarklet: - explanation: "%{link} from anywhere by bookmarking this link." - heading: "Diaspora Bookmarklet" + explanation: "Paskelbkite tinkle Diaspora %{link} paspausdami šią nuorodą => %{link}" + heading: "Diaspora žymelės" + post_something: "Paskelbti Diaspora" + post_success: "Įrašas išsiųstas!" cancel: "Atšaukti" comments: - few: "%{count} comments" - many: "%{count} comments" + few: "%{count} komentarų" + many: "%{count} komentarų" new_comment: comment: "Komentuoti" commenting: "Siunčiamas komentaras..." + one: "1 komentaras" + other: "%{count} komentarų" + two: "%{count} komentarai" + zero: "Komentarų nėra" contacts: - few: "%{count} contacts" + create: + failure: "Nepavyko sukurti kontakto" + few: "%{count} kontaktų" index: - add_to_aspect: "Add contacts to %{name}" - no_contacts: "No contacts." + add_a_new_aspect: "Sukurti kategoriją" + add_to_aspect: "Pridėti kontaktus į kategoriją %{name}" + add_to_aspect_link: "Pridėti kontaktus į kategoriją %{name}" + all_contacts: "Visi kontaktai" + community_spotlight: "Bendruomenės dėmesio centre" + many_people_are_you_sure: "Ar tikrai norite pradėti privatų pokalbį su daugiau nei %{suggested_limit} kontaktų? Paskelbti įrašą šioje kategorijoje gali būti geresnis būdas." + my_contacts: "Mano kontaktai" + no_contacts: "Pridėkite daugiau kontaktų!" + no_contacts_message: "Peržiūrėti %{community_spotlight}" + no_contacts_message_with_aspect: "Peržiūrėti %{community_spotlight} arba %{add_to_aspect_link}" + only_sharing_with_me: "Tik tie, kurie su manimi dalijasi" + remove_person_from_aspect: "Ištrinti %{person_name} iš kategorijos \"%{aspect_name}\"" + start_a_conversation: "Pradėti pokalbį" + title: "Kontaktai" + your_contacts: "Jūsų kontaktai" + many: "%{count} kontaktų" + one: "1 kontaktas" + other: "%{count} kontaktų" + sharing: + people_sharing: "Žmonės dalijasi su jumis:" + spotlight: + community_spotlight: "Bendruomenės dėmesio centre" + two: "%{count} kontaktai" + zero: "kontaktai" conversations: + create: + fail: "Netinkamas pranešimas" + sent: "Pranešimas išsiųstas" + destroy: + success: "Pokalbis sėkmingai ištrintas" helper: new_messages: - few: "%{count} new messages" + few: "%{count} nauji pranešimai" many: "%{count} new messages" one: "1 naujas pranešimas" - other: "%{count} new messages" + other: "%{count} naujų pranešimų" two: "%{count} new messages" zero: "Nėra naujų pranešimų" + index: + create_a_new_message: "Sukurti naują pranešimą" + inbox: "Gauta" + message_inbox: "Gauti pranešimai" + new_message: "Naujas pranešimas" + no_conversation_selected: "Nepasirinktas joks pokalbis" + no_messages: "Nėra pranešimų" + new: + abandon_changes: "Atsisakyti pakeitimų?" + send: "Siųsti" + sending: "Siunčiama..." + subject: "Tema" + to: "" + new_message: + fail: "Netinkamas pranešimas" + show: + delete: "Ištrinti ir užblokuoti pokalbį" + reply: "Atrašyti" + replying: "Siunčiamas atsakymas..." + date: + formats: + birthday: "" + birthday_with_year: "" + fullmonth_day: "" delete: "Šalinti" email: "El. paštas" error_messages: helper: - correct_the_following_errors_and_try_again: "Ištaisyk šias klaidas ir bandyk vėl." - invalid_fields: "Neteisingi laukai" - fill_me_out: "Užpildyk" - find_people: "Find people" + correct_the_following_errors_and_try_again: "Ištaisykite šias klaidas ir bandykite vėl." + invalid_fields: "Neteisingai suvesta" + fill_me_out: "Užpildykite" + find_people: "Rasti žmones arba žymes" + hide: "Slėpti" invitations: + a_facebook_user: "Facebook vartotojas" check_token: not_found: "Pakvietimo raktas nerastas" create: + already_contacts: "Šis žmogus jau yra jūsų kontaktuose" + already_sent: "Šiam žmogui pakvietimą jau siuntėte" no_more: "Daugiau pakvietimų neturi." + own_address: "Jūs negalite siųsti pakvietimo sau." rejected: "Šie el. pašto adresai neveikė: " sent: "Pakvietimas išsiųstas." + edit: + accept_your_invitation: "Patvirtinti kvietimą" + your_account_awaits: "Jūsų paskyra tikrinama!" new: already_invited: "Already invited" + aspect: "Kategorija" + check_out_diaspora: "Užeik į tinklą Diaspora!" + if_they_accept_info: "Kvietimus priėmę žmonės bus pridėti prie kategorijos į kurią kvietėte." invite_someone_to_join: "Pakviesk ką nors prisijungti prie Diasporos!" + language: "Kalba" personal_message: "Asmeninė žinutė" + resend: "Siųsti dar kartą" send_an_invitation: "Nusiųsk kvietimą" send_invitation: "Siųsti kvietimą" to: "Kam" layouts: application: + back_to_top: "Į viršų" powered_by: "TINKLAPĮ LEIDŽIA DIASPORA*" + public_feed: "Viešas atsiliepimas apie Diaspora %{name}" toggle: "toggle mobile site" + whats_new: "Kas naujo?" + your_aspects: "Jūsų kategorijos" header: + admin: "Administruoti" blog: "blog'as" + code: "kodas" login: "prisijungti" logout: "atsijungti" profile: "profile" + recent_notifications: "Siųsti įspėjimą dar kartą" settings: "settings" + view_all: "Rodyti viską" likes: likes: people_dislike_this: - few: "%{count} people disliked this" + few: "%{count} žmonės nemėgsta" many: "%{count} people disliked this" - one: "1 person disliked this" - other: "%{count} people disliked this" + one: "1 žmogus nemėgsta" + other: "%{count} žmonių nemėgsta" two: "%{count} dislikes" - zero: "no people disliked this" + zero: "Nėra nemėgstančių" people_like_this: - few: "%{count} people liked this" + few: "%{count} žmonių mėgta" many: "%{count} people liked this" - one: "1 person liked this" - other: "%{count} people liked this" + one: "1 žmogus mėgsta" + other: "%{count} žmonių mėgsta" two: "%{count} likes" - zero: "no people liked this" + zero: "Niekam nepatiko" people_like_this_comment: - few: "%{count} likes" + few: "%{count} mėgsta" many: "%{count} likes" - one: "%{count} like" - other: "%{count} likes" + one: "%{count} mėgsta" + other: "%{count} mėgsta" two: "%{count} likes" - zero: "no likes" + zero: "niekas nemėgsta" + limited: "Ribotas" + more: "Daugiau" + next: "Sekantis" + no_results: "Nieko nerasta" notifications: also_commented: - few: "%{actors} also commented on %{post_author}'s %{post_link}." + few: "%{actors} taip pat pakomentavo %{post_author}'s %{post_link}." many: "%{actors} also commented on %{post_author}'s %{post_link}." - one: "%{actors} also commented on %{post_author}'s %{post_link}." - other: "%{actors} also commented on %{post_author}'s %{post_link}." + one: "%{actors} taip pat pakomentavo %{post_author}'s %{post_link}." + other: "%{actors} taip pat pakomentavo %{post_author}'s %{post_link}." two: "%{actors} also commented on %{post_author}'s %{post_link}." - zero: "%{actors} also commented on %{post_author}'s %{post_link}." + zero: "%{actors} taip pat pakomentavo %{post_author}'s %{post_link}." also_commented_deleted: - few: "%{actors} commented on a deleted post." + few: "%{actors} pakomentavo ištrintą įrašą." many: "%{actors} commented on a deleted post." - one: "%{actors} commented on a deleted post." - other: "%{actors} commented on a deleted post." + one: "%{actors} pakomentavo ištrintą įrašą." + other: "%{actors} pakomentavo ištrintą įrašą." two: "%{actors} commented on a deleted post." - zero: "%{actors} commented on a deleted post." + zero: "%{actors} pakomentavo ištrintą įrašą." comment_on_post: - few: "%{actors} commented on your %{post_link}." + few: "%{actors} pakomentavo Jūsų %{post_link}." many: "%{actors} commented on your %{post_link}." - one: "%{actors} commented on your %{post_link}." - other: "%{actors} commented on your %{post_link}." + one: "%{actors} pakomentavo Jūsų %{post_link}." + other: "%{actors} pakomentavo Jūsų %{post_link}." two: "%{actors} commented on your %{post_link}." - zero: "%{actors} commented on your %{post_link}." + zero: "%{actors} pakomentavo Jūsų %{post_link}." helper: new_notifications: - few: "%{count} new notifications" + few: "%{count} nauji įspėjimai" many: "%{count} new notifications" - one: "1 new notifications" - other: "%{count} new notifications" + one: "1 naujas įspėjimas" + other: "%{count} naujų įspėjimų" two: "%{count} new notifications" - zero: "no new notifications" + zero: "nėra naujų įspėjimų" index: + and: "ir" and_others: - few: "and %{count} others" + few: "ir %{count} kitus" many: "and %{count} others" - one: "and one more" - other: "and %{count} others" + one: "pridėti dar vieną" + other: "ir %{count} kitų" two: "and %{count} others" - zero: "and nobody else" + zero: "ir daugiau nieko" + mark_all_as_read: "Pažymėti viską kaip skaitytą" + notifications: "Įspėjimai" liked: - few: "%{actors} has just liked your %{post_link}." + few: "%{actors} pamėgo Jūsų įrašą %{post_link}." many: "%{actors} has just liked your %{post_link}." - one: "%{actors} has just liked your %{post_link}." - other: "%{actors} has just liked your %{post_link}." + one: "%{actors} pamėgo Jūsų įrašą %{post_link}." + other: "%{actors} pamėgo Jūsų įrašą %{post_link}." two: "%{actors} has just liked your %{post_link}." - zero: "%{actors} has just liked your %{post_link}." + zero: "%{actors} pamėgo Jūsų įrašą %{post_link}." liked_post_deleted: - few: "%{actors} liked your deleted post." + few: "%{actors} pamėgo Jūsų ištrintą įrašą." many: "%{actors} liked your deleted post." - one: "%{actors} liked your deleted post." - other: "%{actors} liked your deleted post." + one: "%{actors} pamėgo Jūsų ištrintą įrašą." + other: "%{actors} pamėgo Jūsų ištrintą įrašą." two: "%{actors} liked your deleted post." - zero: "%{actors} liked your deleted post." + zero: "%{actors} pamėgo Jūsų ištrintą įrašą." mentioned: - few: "%{actors} has mentioned you in a %{post_link}." + few: "%{actors} paminėjo Jus įraše %{post_link}." many: "%{actors} has mentioned you in a %{post_link}." - one: "%{actors} has mentioned you in a %{post_link}." - other: "%{actors} has mentioned you in a %{post_link}." + one: "%{actors} paminėjo Jus įraše %{post_link}." + other: "%{actors} paminėjo Jus įraše %{post_link}." two: "%{actors} has mentioned you in a %{post_link}." - zero: "%{actors} has mentioned you in a %{post_link}." + zero: "%{actors} paminėjo Jus įraše %{post_link}." mentioned_deleted: - few: "%{actors} mentioned you in a deleted post." + few: "%{actors} paminėjo Jus ištrintame įraše." many: "%{actors} mentioned you in a deleted post." - one: "%{actors} mentioned you in a deleted post." - other: "%{actors} mentioned you in a deleted post." + one: "%{actors} paminėjo Jus ištrintame įraše." + other: "%{actors} paminėjo Jus ištrintame įraše." two: "%{actors} mentioned you in a deleted post." - zero: "%{actors} mentioned you in a deleted post." + zero: "%{actors} paminėjo Jus ištrintame įraše." + post: "Siųsti" private_message: - few: "%{actors} sent you a message." + few: "Atsiuntė %{actors} pranešimus" many: "%{actors} sent you a message." - one: "%{actors} sent you a message." - other: "%{actors} sent you a message." + one: "Atsiuntė %{actors} pranešimą" + other: "Atsiuntė %{actors} pranešimų" two: "%{actors} sent you a message." - zero: "%{actors} sent you a message." + zero: "Atsiuntė %{actors} pranešimų" reshared: - few: "%{actors} has reshared your %{post_link}." + few: "%{actors} pasidalijo Jūsų įrašu %{post_link}." many: "%{actors} has reshared your %{post_link}." - one: "%{actors} has reshared your %{post_link}." - other: "%{actors} has reshared your %{post_link}." + one: "%{actors} pasidalijo Jūsų įrašu %{post_link}." + other: "%{actors} pasidalijo Jūsų įrašu %{post_link}." two: "%{actors} has reshared your %{post_link}." - zero: "%{actors} has reshared your %{post_link}." + zero: "%{actors} pasidalijo Jūsų įrašu %{post_link}." reshared_post_deleted: - few: "%{actors} reshared your deleted post." + few: "%{actors} pasidalijo Jūsų ištrintu įrašu." many: "%{actors} reshared your deleted post." - one: "%{actors} reshared your deleted post." - other: "%{actors} reshared your deleted post." + one: "%{actors} pasidalijo Jūsų ištrintu įrašu." + other: "%{actors} pasidalijo Jūsų ištrintu įrašu." two: "%{actors} reshared your deleted post." - zero: "%{actors} reshared your deleted post." + zero: "%{actors} pasidalijo Jūsų ištrintu įrašu." started_sharing: - few: "%{actors} started sharing with you." + few: "%{actors} pradėjo su Jumis dalintis." many: "%{actors} started sharing with you." - one: "%{actors} started sharing with you." - other: "%{actors} started sharing with you." + one: "%{actors} pradėjo su Jumis dalintis." + other: "%{actors} pradėjo su Jumis dalintis." two: "%{actors} started sharing with you." - zero: "%{actors} started sharing with you." + zero: "%{actors} pradėjo su Jumis dalintis." notifier: + a_post_you_shared: "įrašas." + click_here: "Spauskite čia" + comment_on_post: + reply: "Atrašyti arba parodyti %{name} įrašą" confirm_email: click_link: "To activate your new e-mail address %{unconfirmed_email}, please click this link:" subject: "Please activate your new e-mail address %{unconfirmed_email}" + email_sent_by_diaspora: "Šį el.laišką Jums atsiuntė %{pod_name}. Jei nebenorite gauti panašių pranešimų," hello: "Labas, %{name}!" liked: liked: "%{name} has just liked your post: " + view_post: "parodyti įrašą" + mentioned: + mentioned: "paminėjo Jus įraše:" + subject: "%{name} paminėjo Jus Diaspora* tinkle" + private_message: + reply_to_or_view: "Atrašyti arba parodyti pokalbį" reshared: reshared: "%{name} just reshared your post" + view_post: "parodyti įrašą" single_admin: admin: "Jūsų Diaspora tinklo administratorius" subject: "A message from your Diaspora administrator:" started_sharing: + sharing: "Pradėjo su jumis dalintis" subject: "%{name} has started sharing with you on Diaspora*" - ok: "gerai" + view_profile: "Rodyti %{name} anketą" + thanks: "Dėkojame" + to_change_your_notification_settings: "kad pakeisti savo įspėjimų nustatymus" + nsfw: "Nesaugus" + ok: "Gerai" or: "arba" password: "Slaptažodis" password_confirmation: "Slaptažodžio patvirtinimas" @@ -270,6 +467,9 @@ lt: people_on_pod_are_aware_of: " žmonės serveryje žino" results_for: " \"%{params}\" rezultatai" index: + couldnt_find_them_send_invite: "Negalite surasti? Nusiųskite pakvietimą!" + no_one_found: "... ir nieko nepavyko rasti." + no_results: "Labas! Nieko nerasta." results_for: "ieškoti rezultatų pagal" many: "%{count} people" one: "1 person" @@ -322,24 +522,28 @@ lt: posts: show: photos_by: - few: "%{count} photos by %{author}" + few: "%{count} %{author} nuotraukos" many: "%{count} photos by %{author}" - one: "One photo by %{author}" - other: "%{count} photos by %{author}" + one: "%{author} nuotrauka" + other: "%{count} %{author} nuotraukų" two: "Two photos by %{author}" - zero: "No photos by %{author}" - profile: "Profilis" + zero: "Nėra %{author} nuotraukų" + previous: "Ankstesnis" + privacy: "Privatumas" + privacy_policy: "Privatumo politika" + profile: "Anketa" profiles: edit: your_tags: "You: in 5 #tags" your_tags_placeholder: "i.e. #diaspora #ironing #kittens #music" + public: "Viešas" reactions: - few: "%{count} reactions" + few: "%{count} reakcijos" many: "%{count} reactions" - one: "1 reaction" - other: "%{count} reactions" + one: "1 reakcija" + other: "%{count} reakcijų" two: "%{count} reactions" - zero: "0 reactions" + zero: "0 reakcijų" registrations: closed: "Naujų paskyrų kūrimas šiame Diasporos serveryje yra uždarytas." create: @@ -367,12 +571,12 @@ lt: success: "Susidraugavai." helper: new_requests: - few: "%{count} new requests!" + few: "%{count} nauji prašymai!" many: "%{count} new requests!" one: "naujas prašymas!" - other: "%{count} new requests!" + other: "%{count} naujų prašymų!" two: "%{count} new requests!" - zero: "no new requests" + zero: "nėra naujų prašymų" manage_aspect_contacts: existing: "Egzistuojantys kontaktai" manage_within: "Valdyti kontaktus ties" @@ -381,12 +585,12 @@ lt: reshares: reshare: reshare: - few: "%{count} Reshares" + few: "%{count} pasidalino" many: "%{count} Reshares" - one: "1 Reshare" - other: "%{count} Reshares" + one: "1 pasidalino" + other: "%{count} pasidalino" two: "%{count} reshares" - zero: "Reshare" + zero: "Niekas nepasidalino" reshare_confirmation: "Reshare %{author} - %{text}?" reshare_original: "Reshare orignial" show_original: "Show Original" @@ -414,12 +618,12 @@ lt: aspect_dropdown: add_to_aspect: "Add to aspect" toggle: - few: "In %{count} aspects" + few: "%{count} kategorijose" many: "In %{count} aspects" - one: "In %{count} aspect" - other: "In %{count} aspects" + one: "%{count} kategorijoje" + other: "%{count} kategorijų" two: "In %{count} aspects" - zero: "Add to aspect" + zero: "Pridėti kontaktą prie kategorijos" contact_list: all_contacts: "Visi kontaktai" invitations: @@ -456,21 +660,21 @@ lt: helper: no_message_to_display: "Žinučių nėra." too_long: - few: "please make your status messages less than %{count} characters" + few: "Sutrumpinkite savo statuso pranešimą %{count} ženklais" many: "please make your status messages less than %{count} characters" - one: "please make your status messages less than %{count} character" - other: "please make your status messages less than %{count} characters" + one: "Sutrumpinkite savo statuso pranešimą %{count} ženklu" + other: "Sutrumpinkite savo statuso pranešimą %{count} ženklų" two: "please make your status messages less than %{count} characters" - zero: "please make your status messages less than %{count} characters" + zero: "Sutrumpinkite savo statuso pranešimą %{count} ženklų" stream_helper: hide_comments: "Slėpti visus komentarus" show_comments: - few: "Show %{count} more comments" + few: "Rodyti dar %{count} komentarus" many: "Show %{count} more comments" - one: "Show one more comment" - other: "Show %{count} more comments" + one: "Rodyti dar vieną komentarą" + other: "Rodyti dar %{count} komentarų" two: "Show two more comments" - zero: "No more comments" + zero: "Daugiau komentarų nėra" streams: aspects: title: "Your Aspects" @@ -485,9 +689,11 @@ lt: destroy: failure: "Failed to stop following: #%{name}" success: "Successfully stopped following: #%{name}" + terms_and_conditions: "Nuostatos ir sąlygos" tokens: show: connecting_is_simple: "Connecting your Diaspora account is as simple as filling out two fields on your Cubbi.es account page." + undo: "Atšaukti" username: "Vartotojo vardas" users: confirm_email: @@ -521,4 +727,5 @@ lt: unconfirmed_email_changed: "E-Mail Changed. Needs activation." unconfirmed_email_not_changed: "E-Mail Change Failed" webfinger: - hcard_fetch_failed: "there was a problem fetching the hcard for #{@account}" \ No newline at end of file + hcard_fetch_failed: "there was a problem fetching the hcard for #{@account}" + welcome: "Sveiki atvykę!" \ No newline at end of file diff --git a/config/locales/diaspora/nl.yml b/config/locales/diaspora/nl.yml index b29c8ac69..e6ffb6609 100644 --- a/config/locales/diaspora/nl.yml +++ b/config/locales/diaspora/nl.yml @@ -708,7 +708,7 @@ nl: password: "WACHTWOORD" sign_up: "AANMELDEN" sign_up_message: "Social Networking met een ♥" - username: "GEBRUIKERSNAAM" + username: "GEBRUIKER" requests: create: sending: "Versturen..." diff --git a/config/locales/diaspora/pt-BR.yml b/config/locales/diaspora/pt-BR.yml index d8f4dd377..8f8031232 100644 --- a/config/locales/diaspora/pt-BR.yml +++ b/config/locales/diaspora/pt-BR.yml @@ -81,7 +81,7 @@ pt-BR: add_invites: "enviar convites" email_to: "Email para convite" users: - one: "%{count} usuários encontrados" + one: "%{count} usuário encontrado" other: "%{count} usuários encontrados" zero: "%{count} usuário encontrado." you_currently: "você atualmente tem %{user_invitation} convites para enviar %{link}" @@ -390,7 +390,7 @@ pt-BR: one: "1 não curtiu." other: "%{count} não curtiram." two: "%{count} não curtiram" - zero: "ninguém curtiu." + zero: "ninguém não curtiu." people_like_this: few: "%{count} curtiram" many: "%{count} curtiram" @@ -414,21 +414,21 @@ pt-BR: few: "%{actors} também comentou sobre %{post_author}'s %{post_link}." many: "%{actors} também comentou sobre %{post_author}'s %{post_link}." one: "%{actors} também comentou sobre %{post_author}'s %{post_link}." - other: "%{actors} também comentou sobre %{post_author}'s %{post_link}." + other: "%{actors} também comentaram sobre %{post_author}'s %{post_link}." two: "%{actors} também comentou em %{post_author}'s %{post_link}." zero: "%{actors} também comentou sobre %{post_author}'s %{post_link}." also_commented_deleted: few: "%{actors}, comentou em uma postagem deletada." many: "%{actors}, comentou em uma postagem deletada." one: "%{actors}, comentou em uma postagem deletada." - other: "%{actors}, comentou em uma postagem deletada." + other: "%{actors}, comentaram em uma postagem deletada." two: "%{actors} comentou em uma postagem deletada." zero: "%{actors}, comentou em uma postagem deletada." comment_on_post: few: "%{actors}, comentou sua postagem %{post_link}." many: "%{actors}, comentou sua postagem %{post_link}." one: "%{actors}, comentou sua postagem %{post_link}." - other: "%{actors}, comentou sua postagem %{post_link}." + other: "%{actors}, comentaram sua postagem %{post_link}." two: "%{actors} comentou em seu %{post_link}." zero: "%{actors}, comentou sua postagem %{post_link}." helper: @@ -457,12 +457,12 @@ pt-BR: one: "%{actors} curtiu sua postagem %{post_link}." other: "%{actors} curtiram sua postagem %{post_link}." two: "%{actors} acabou de curtir o seu %{post_link}." - zero: "%{actors} curtiram sua postagem %{post_link}." + zero: "%{actors} curtiu sua postagem %{post_link}." liked_post_deleted: few: "%{actors}, curtiu sua postagem deletada." many: "%{actors}, curtiu sua postagem deletada." one: "%{actors}, curtiu sua postagem deletada." - other: "%{actors}, curtiu sua postagem deletada." + other: "%{actors}, curtiram sua postagem deletada." two: "%{actors} gostaram da sua postagem deletada." zero: "%{actors}, curtiu sua postagem deletada." mentioned: @@ -471,12 +471,12 @@ pt-BR: one: "%{actors} mencionou você em %{post_link}." other: "%{actors} mencionaram você em %{post_link}." two: "%{actors} mencionou você em um %{post_link}." - zero: "%{actors} mencionaram você em %{post_link}." + zero: "%{actors} mencionou você em %{post_link}." mentioned_deleted: few: "%{actors} mencionou você numa postagem deletada." many: "%{actors} mencionou você numa postagem deletada." one: "%{actors} mencionou você numa postagem deletada." - other: "%{actors} mencionou você numa postagem deletada." + other: "%{actors} mencionaram você numa postagem deletada." two: "%{actors} mencionaram você em uma postagem apagada." zero: "%{actors} mencionou você numa postagem deletada." post: "postagem" @@ -491,14 +491,14 @@ pt-BR: few: "%{actors} compartilhou o seu %{post_link}." many: "%{actors} compartilhou o seu %{post_link}." one: "%{actors}, compartilhou o seu %{post_link}." - other: "%{actors} compartilhou o seu %{post_link}." + other: "%{actors} compartilharam o seu %{post_link}." two: "%{actors} compartilhou seu %{post_link}." zero: "%{actors} compartilhou o seu %{post_link}." reshared_post_deleted: few: "%{actors}, compartilhou sua postagem deletada." many: "%{actors}, compartilhou sua postagem deletada." one: "%{actors}, compartilhou sua postagem deletada." - other: "%{actors}, compartilhou sua postagem deletada." + other: "%{actors}, compartilharam sua postagem deletada." two: "%{actors} recompartilharam sua postagem deletada." zero: "%{actors}, compartilhou sua postagem deletada." started_sharing: @@ -663,10 +663,10 @@ pt-BR: photos_by: few: "%{count} photos by %{author}" many: "%{count} photos by %{author}" - one: "One photo by %{author}" - other: "%{count} photos by %{author}" + one: "Uma foto de %{author}" + other: "%{count} fotos de %{author}" two: "Two photos by %{author}" - zero: "No photos by %{author}" + zero: "Não há fotos de %{author}" reshare_by: "Recompartilhado por %{author}" previous: "Anterior" privacy: "Privacidade" @@ -720,7 +720,7 @@ pt-BR: diaspora: "<3 Diaspora*" email: "E-MAIL" enter_email: "Digite teu email" - enter_password: "Digite tua senha" + enter_password: "Digite a senha (seis caracteres no mínimo)" enter_password_again: "Digite novamente a tua senha" enter_username: "Escolha um nome de usuário (use somente letras, números e sublinhados)" hey_make: "HEY,
    FAÇA
    ALGO." @@ -995,7 +995,7 @@ pt-BR: no_turning_back: "Atualmente, não tem volta." what_we_delete: "Vamos deletar todos os seus posts e informações do perfil assim que possível. Seus comentários ainda ficarão, mas serão associados ao seu Diaspora Handle." close_account_text: "Cancelar Conta" - comment_on_post: "...alguém comentou em sua postagem?" + comment_on_post: "...alguém comentar em sua postagem?" current_password: "Senha Atual" current_password_expl: "o que você usa atualmente..." download_photos: "Baixar minhas fotos" @@ -1014,7 +1014,7 @@ pt-BR: reshared: "...alguém compartilhar a sua postagem?" show_community_spotlight: "Mostrar foco de comunidade no seu Fluxo?" show_getting_started: "Reativar Introdução" - started_sharing: "...alguém começou a compartilhar com você?" + started_sharing: "...alguém começar a compartilhar com você?" stream_preferences: "Preferências de Fluxos" your_email: "Seu Email" your_handle: "Seu Diaspora ID" diff --git a/config/locales/diaspora/sk.yml b/config/locales/diaspora/sk.yml index 1302daea5..06debf11a 100644 --- a/config/locales/diaspora/sk.yml +++ b/config/locales/diaspora/sk.yml @@ -272,7 +272,7 @@ sk: no_contacts: "Zdá sa, že potrebuješ pridať pár kontaktov!" no_contacts_message: "Pozri si %{community_spotlight}" no_contacts_message_with_aspect: "Pozri si %{community_spotlight} alebo %{add_to_aspect_link}" - only_sharing_with_me: "Tí, ktorí majú v kontaktoch iba mňa" + only_sharing_with_me: "Ľudia, ktorí majú v kontaktoch iba mňa" remove_person_from_aspect: "Odstrániť použ. %{person_name} z kategórie %{aspect_name}" start_a_conversation: "Začať rozhovor" title: "Kontakty" @@ -488,7 +488,7 @@ sk: notifier: a_post_you_shared: "príspevok." accept_invite: "Prijmi svoju pozvánku na Diasporu!" - click_here: "Klikni sem" + click_here: "klikni sem" comment_on_post: reply: "Zobraziť príspevok použ. %{name} alebo naň odpovedať >" confirm_email: @@ -532,7 +532,7 @@ sk: subject: "%{name} si ťa pridal(a) do kontaktov na Diaspore*" view_profile: "Zobraziť profil použ. %{name}" thanks: "Vďaka," - to_change_your_notification_settings: "ak chceš zmeniť nastavenie oznamov" + to_change_your_notification_settings: "a budeš môcť zmeniť nastavenia oznamov" nsfw: "Nevhodné v práci" ok: "OK" or: "alebo" @@ -787,10 +787,10 @@ sk: aspect_dropdown: add_to_aspect: "Pridať kontakt" toggle: - few: "V %{count} kategóriách" + few: "V(o) %{count} kategóriách" one: "V %{count} kategórii" other: "V(o) %{count} kategóriách" - zero: "Pridajte kontakt" + zero: "Pridať kontakt" contact_list: all_contacts: "Všetky kontakty" footer: diff --git a/config/locales/diaspora/sl.yml b/config/locales/diaspora/sl.yml index 713e7da38..7cd36c1ba 100644 --- a/config/locales/diaspora/sl.yml +++ b/config/locales/diaspora/sl.yml @@ -381,6 +381,7 @@ sl: back_to_top: "Na vrh" powered_by: "STRAN POGANJA DIASPORA*" public_feed: "Javni vir Diaspore za %{name}" + source_package: "" toggle: "preklop mobilne strani" whats_new: "kaj je novega?" your_aspects: "vaši vidiki" diff --git a/config/locales/diaspora/vi.yml b/config/locales/diaspora/vi.yml index 6d77838ba..e848f8af1 100644 --- a/config/locales/diaspora/vi.yml +++ b/config/locales/diaspora/vi.yml @@ -59,6 +59,7 @@ vi: shares: other: "%{count} lượt chia sẻ" zero: "Không có ai chia sẻ" + usage_statistic: "Thống kê mức sử dụng" users: other: "%{count} người dùng" zero: "Không có người dùng" @@ -95,11 +96,11 @@ vi: failure: "Thất bại khi thêm liên lạc vào mối quan hệ." success: "Đã thêm liên lạc vào mối quan hệ." aspect_contacts: - done_editing: "đã chỉnh sửa xong" + done_editing: "đã cập nhật xong" aspect_listings: add_an_aspect: "+ Thêm mối quan hệ" deselect_all: "Bỏ chọn tất cả" - edit_aspect: "Sửa %{name}" + edit_aspect: "Cập nhật %{name}" select_all: "Chọn tất cả" aspect_stream: stay_updated: "Vẫn còn cập nhật" @@ -115,7 +116,7 @@ vi: edit: add_existing: "Thêm một liên lạc đang có" aspect_list_is_not_visible: "danh sách mối quan hệ bị ẩn với người khác trong mối quan hệ" - aspect_list_is_visible: "danh sách mối quan hệ hiện với người khác trong mối quan hệ" + aspect_list_is_visible: "những người trong mối quan hệ này nhìn thấy nhau" confirm_remove_aspect: "Bạn có chắc là muốn xoá mối quan hệ này không?" done: "Xong" make_aspect_list_visible: "các liên lạc trong mối quan hệ này có thể thấy nhau?" @@ -143,11 +144,11 @@ vi: do_you: "Bạn:" email_feedback: "%{link} phản hồi hoặc góp ý" email_link: "Thư điện tử" - feature_suggestion: "... có một đề nghị %{link}?" - find_a_bug: "... tìm thấy lỗi %{link}?" - have_a_question: "... có một %{link}?" + feature_suggestion: "... đề nghị tính năng %{link}?" + find_a_bug: "... báo lỗi %{link}?" + have_a_question: "... gửi câu hỏi %{link}?" here_to_help: "Cộng đồng Diaspora!" - need_help: "Cần giúp đỡ?" + need_help: "Trợ giúp" tag_bug: "#bug" tag_feature: "#feature" tag_question: "#question" @@ -158,7 +159,7 @@ vi: new_here: follow: "Theo dõi %{link} và chào đón người dùng mới đến với Diaspora*!" learn_more: "Tìm hiểu thêm" - title: "Chào mừng người dùng mới" + title: "Chào đón người dùng mới" no_contacts: "Không có liên lạc" no_tags: "+ Tìm thẻ để theo dõi" people_sharing_with_you: "Đang chia sẻ với bạn" @@ -179,7 +180,7 @@ vi: no_contacts_message: community_spotlight: "nổi bật từ cộng đồng" or_spotlight: "Hoặc bạn có thể chia sẻ với %{link}" - try_adding_some_more_contacts: "Bạn có thể tìm kiếm hoặc mời thêm bạn." + try_adding_some_more_contacts: "Bạn có thể tìm hoặc mời thêm bạn." you_should_add_some_more_contacts: "Bạn có thể thêm một vài liên lạc!" no_posts_message: start_talking: "Chưa có ai nói gì!" @@ -196,7 +197,7 @@ vi: view_all_community_spotlight: "Xem tất cả những người nổi bật trong cộng đồng" view_all_contacts: "Xem tất cả liên lạc" show: - edit_aspect: "chỉnh sửa mối quan hệ" + edit_aspect: "cập nhật mối quan hệ" two: "%{count} mối quan hệ" update: failure: "Mối quan hệ %{name} có tên quá dài, không thể lưu." @@ -289,7 +290,7 @@ vi: send: "Gửi" sending: "Đang gửi..." subject: "tựa đề" - to: "đến" + to: "người nhận" new_message: fail: "Tin nhắn không hợp lệ" show: @@ -308,6 +309,7 @@ vi: correct_the_following_errors_and_try_again: "Sửa những lỗi sau và thử lại." invalid_fields: "Trường không hợp lệ" login_try_again: "Vui lòng đăng nhập và thử lại." + post_not_public: "Bài đăng bạn muốn xem không được công khai!" fill_me_out: "Điền đầy đủ" find_people: "Tìm người hoặc #tags" hide: "Ẩn" @@ -349,6 +351,7 @@ vi: back_to_top: "Cuộn lên trên" powered_by: "ĐƯỢC HỖ TRỢ BỞI DIASPORA*" public_feed: "Nguồn tin Diaspora công khai cho %{name}" + source_package: "tải về gói mã nguồn" toggle: "bật/tắt di động" whats_new: "có gì mới?" your_aspects: "các mối quan hệ" @@ -378,7 +381,7 @@ vi: other: "%{count} người thích" zero: "không có ai thích" limited: "Giới hạn" - more: "Thêm nữa" + more: "Xem thêm" next: "tiếp theo" no_results: "Không có kết quả" notifications: @@ -491,7 +494,7 @@ vi: ok: "OK" or: "hoặc" password: "Mật khẩu" - password_confirmation: "Xác nhận mật khẩu" + password_confirmation: "Xác nhận mật khẩu mới" people: add_contact: invited_by: "bạn được mời bởi" @@ -519,7 +522,7 @@ vi: profile_sidebar: bio: "Tiểu sử" born: "ngày sinh" - edit_my_profile: "Chỉnh sửa hồ sơ của tôi" + edit_my_profile: "Chỉnh sửa hồ sơ" gender: "Giới tính" in_aspects: "trong mối quan hệ" location: "Nơi ở" @@ -542,7 +545,7 @@ vi: to_accept_or_ignore: "để chấp nhận hoặc từ chối." sub_header: add_some: "thêm" - edit: "chỉnh sửa" + edit: "sửa" you_have_no_tags: "bạn không có thẻ nào!" two: "%{count} người" webfinger: @@ -574,7 +577,7 @@ vi: show: collection_permalink: "đường dẫn của bộ sưu tập" delete_photo: "Xoá ảnh" - edit: "chỉnh sửa" + edit: "sửa" edit_delete_photo: "Sửa mô tả/xoá ảnh" make_profile_photo: "làm ảnh hồ sơ" show_original_post: "Xem bài đăng gốc" @@ -603,7 +606,7 @@ vi: profile: "Hồ sơ" profiles: edit: - allow_search: "Cho phép người khác trong Diaspora tìm thấy bạn" + allow_search: "Cho phép người khác trong Diaspora tìm thấy tôi" edit_profile: "Chỉnh sửa hồ sơ" first_name: "Tên" last_name: "Họ" @@ -628,6 +631,7 @@ vi: other: "%{count} phản hồi" zero: "Không có phản hồi" registrations: + closed: "Pod DIASPORA này không cho đăng kí nữa." create: success: "Bạn đã tham gia vào Diaspora!" edit: @@ -680,9 +684,9 @@ vi: zero: "Không có ai chia sẻ lại" reshare_confirmation: "Chia sẻ lại bài đăng của %{author}?" reshare_original: "Chia sẻ lại bài gốc" - reshared_via: "chia sẻ lại bởi" + reshared_via: "được chia sẻ lại bởi" show_original: "Hiện bài đăng gốc" - search: "Tìm" + search: "Tìm kiếm" services: create: already_authorized: "Một người dùng với id diaspora %{diaspora_id} đã xác thực với tài khoản %{service_name}." @@ -707,6 +711,7 @@ vi: really_disconnect: "ngắt kết nối với %{service}?" inviter: click_link_to_accept_invitation: "Theo dõi liên kết này để chấp nhận lời mời của bạn" + join_me_on_diaspora: "Tham gia DIASPORA*" remote_friend: invite: "mời" not_on_diaspora: "Chưa có trên Diaspora" @@ -742,11 +747,17 @@ vi: invite_someone: "Mời vài người" invite_your_friends: "Mời bạn" invites: "Mời" + invites_closed: "Pod DIASPORA này không còn thư mời nữa" share_this: "Chia sẻ liên kết này qua thư, blog, hay mạng xã hội!" + notification: + new: "%{type} mới từ %{from}" public_explain: atom_feed: "Nguồn tin" + control_your_audience: "Kiểm soát phạm vi chia sẻ" logged_in: "đã đăng nhập vào %{service}" manage: "quản lí các dịch vụ đã được kết nối" + new_user_welcome_message: "Sử dụng dấu thăng (#hashtags) để phân loại bài đăng và tìm người dùng khác." + outside: "Công khai bài đăng để mọi người ở ngoài Diaspora đều được thấy." share: "Chia sẻ" title: "Cài đặt các dịch vụ đã được kết nối" visibility_dropdown: "Dùng nút thả xuống này để ẩn/hiện bài đăng của bạn. (Bạn nên công khai bài đăng đầu tiên.)" @@ -822,9 +833,10 @@ vi: like_stream: contacts_title: "Những người có bài đăng mà bạn thích" title: "Luồng thích" + mentioned_stream: "@Nhắc đến tôi" mentions: contacts_title: "Người đã nhắc đến bạn" - title: "Tin của bạn" + title: "@Nhắc đến tôi" multi: contacts_title: "Người trong luồng của bạn" title: "Luồng" @@ -876,22 +888,24 @@ vi: success: "Tài khoản của bạn đã bị khoá. Có thể mất 20 phút để đóng tài khoản của bạn. Cám ơn vì đã dùng Diaspora." wrong_password: "Mật khẩu đã nhập không khớp với mật khẩu hiện tại." edit: - also_commented: "...ai đó bình luận vào bài đăng trong liên lạc của bạn?" + also_commented: "...có người bình luận vào bài đăng của người quen?" auto_follow_aspect: "Đặt người đó vào mối quan hệ:" auto_follow_back: "Tự động theo dõi lại người theo dõi bạn" change: "Thay đổi" change_email: "Đổi địa chỉ thư điện tử" change_language: "Đổi ngôn ngữ" change_password: "Đổi mật khẩu" - character_minimum_expl: "ít nhất phải có sáu kí tự" + character_minimum_expl: "ít nhất sáu kí tự" close_account: dont_go: "Đừng đi!" if_you_want_this: "Nếu bạn muốn, nhập mật khẩu và nhấn 'Đóng tài khoản'" + lock_username: "Tên đăng nhập của bạn sẽ bị khoá nếu bạn quyết định đăng kí lại." locked_out: "Bạn sẽ bị đăng xuất và khoá tài khoản." make_diaspora_better: "Chúng tôi muốn bạn cùng phát triển Diaspora tốt hơn, vì vậy bạn nên giúp đỡ thay vì rời đi. Nếu bạn không muốn ở lại, chúng tôi muốn biết chuyện gì sẽ xảy ra tiếp theo." + no_turning_back: "Hiện tại chưa có ai quay lại." what_we_delete: "We delete all of your posts, profile data, as soon as humanly possible. Your comments will hang around, but be associated with your Diaspora Handle." close_account_text: "Đóng tài khoản" - comment_on_post: "...ai đó bình luận vào bài đăng của bạn?" + comment_on_post: "...có người bình luận vào bài đăng của tôi?" current_password: "Mật khẩu hiện tại" current_password_expl: "bạn dùng để đăng nhập..." download_photos: "tải ảnh của tôi" @@ -901,22 +915,23 @@ vi: export_data: "Xuất dữ liệu" following: "Thiết lập theo dõi" getting_started: "Tuỳ chỉnh người dùng mới" - liked: "...ai đó thích bài đăng của bạn?" + liked: "...có người thích bài đăng của tôi?" mentioned: "...bạn được nhắc đến trong một bài đăng?" new_password: "Mật khẩu mới" photo_export_unavailable: "Chức năng xuất ảnh hiện chưa hoạt động" private_message: "...bạn nhận được một tin nhắn cá nhân?" receive_email_notifications: "Nhận thư điện tử thông báo khi..." - reshared: "...ai đó chia sẻ lại tin của bạn?" + reshared: "...có người chia sẻ lại bài đăng của tôi?" show_community_spotlight: "Hiện những tin từ cộng đồng?" show_getting_started: "Bật lại hướng dẫn cho người dùng mới" - started_sharing: "...ai đó bắt đầu chia sẻ với bạn?" + started_sharing: "...có người bắt đầu chia sẻ với tôi?" stream_preferences: "Tuỳ chỉnh luồng" - your_email: "Thư điện tử của bạn" + your_email: "Thư điện tử" your_handle: "ID Diaspora của bạn" getting_started: awesome_take_me_to_diaspora: "Tuyệt vời! Đưa tối đến Diaspora*" community_welcome: "Cộng đồng Diaspora hân hạnh được chào đón bạn!" + hashtag_explanation: "Thẻ cho phép bạn trò chuyện và theo dõi những gì bạn quan tâm. Chúng cũng giúp bạn tìm bạn mới trên Diaspora." hashtag_suggestions: "Thử theo dõi các thẻ như #art, #movies, #gif, v.v..." hooking_up_fb: "kết nối với tài khoản Facebook của bạn" saved: "Đã lưu!" @@ -940,8 +955,12 @@ vi: password_not_changed: "Đổi mật khẩu thất bại" settings_not_updated: "Cập nhật thiết lập thất bại" settings_updated: "Đã cập nhật thiết lập" - unconfirmed_email_changed: "Đã đổi thư điện tử. Cần kích hoạt ngay." - unconfirmed_email_not_changed: "Đổi thư điện tử thất bại" + unconfirmed_email_changed: "Đã đổi địa chỉ thư điện tử. Cần kích hoạt ngay." + unconfirmed_email_not_changed: "Đổi địa chỉ thư điện tử thất bại" + webfinger: + hcard_fetch_failed: "có vấn đề khi tải hcard cho %{account}" + no_person_constructed: "Không đọc được thông tin từ hcard này." + xrd_fetch_failed: "có lỗi khi lấy xrd từ tài khoản %{account}" welcome: "Chào mừng!" will_paginate: next_label: "sau »" diff --git a/config/locales/javascript/javascript.br.yml b/config/locales/javascript/javascript.br.yml index 21338d64a..8a86e838d 100644 --- a/config/locales/javascript/javascript.br.yml +++ b/config/locales/javascript/javascript.br.yml @@ -65,29 +65,20 @@ br: hide_nsfw_posts: "Kuzhat ar c'hemennadennoù #nsfw" like: "Plijout a ra din" likes: - few: "<%= count %> Likes" - many: "<%= count %> Likes" one: "<%= count %> Plijet" other: "<%= count %> Plijet" - two: "<%= count %> Likes" zero: "<%= count %> Plijet" limited: "Bevennet" more_comments: - few: "Show <%= count %> more comments" - many: "Show <%= count %> more comments" one: "Diskwel <%= count %> evezhiadenn ouzhpenn" other: "Diskwel <%= count %> evezhiadenn ouzhpenn" - two: "Show <%= count %> more comments" zero: "Diskwel <%= count %> evezhiadenn ouzhpenn" original_post_deleted: "Dilamet eo bet ar gemennadenn orin gant hec'h aozer." public: "Boutin" reshare: "Rannañ en-dro" reshares: - few: "<%= count %> Reshares" - many: "<%= count %> Reshares" one: "<%= count %> Adrannerezh" other: "<%= count %> Adrannerezh" - two: "<%= count %> Reshares" zero: "<%= count %> Adrannerezh" show_nsfw_post: "Diskouez ar gemennadenn" show_nsfw_posts: "Diskouez pep tra" diff --git a/config/locales/javascript/javascript.el.yml b/config/locales/javascript/javascript.el.yml index d1c2ce063..09182ca5b 100644 --- a/config/locales/javascript/javascript.el.yml +++ b/config/locales/javascript/javascript.el.yml @@ -14,11 +14,8 @@ el: started_sharing_with: "Ξεκινήσατε να διαμοιράζεστε με τον χρήστη <%= name %>!" stopped_sharing_with: "Σταματήσατε να διαμοιράζεστε με τον χρήστη <%= name %>." toggle: - few: "Σε {{count}} πτυχές" - many: "Σε {{count}} πτυχές" one: "Σε <%= count %> πτυχή" other: "Σε <%= count %> πτυχές" - two: "Σε {{count}} πτυχές" zero: "Επιλέξτε πτυχές" aspect_navigation: deselect_all: "Εξαίρεση όλων" @@ -51,6 +48,7 @@ el: settings: "Ρυθμίσεις" view_all: "Προβολή όλων" ignore: "Αγνόησε" + ignore_user: "Να αγνοηθεί αυτός ο χρήστης;" infinite_scroll: no_more: "Δεν υπάρχουν άλλες δημοσιεύσεις." my_activity: "Η δραστηριότητα μου" @@ -76,29 +74,20 @@ el: hide_nsfw_posts: "Απόκριψη των \"μη ασφαλών για εργασία\" δημοσιεύσεων" like: "Μου αρέσει" likes: - few: "<%= count %> Likes" - many: "<%= count %> Likes" one: "<%= count %> Μου αρέσει" other: "<%= count %> Μου αρέσει" - two: "<%= count %> Likes" zero: "<%= count %> Μου αρέσει" limited: "Περιορισμένο" more_comments: - few: "Show <%= count %> more comments" - many: "Show <%= count %> more comments" one: "Δες <%= count %> περισσότερα σχόλια" other: "Δες <%= count %> περισσότερα σχόλια" - two: "Show <%= count %> more comments" zero: "Δες <%= count %> περισσότερα σχόλια" original_post_deleted: "Η αρχική δημοσίευση διαγράφτηκε από τον δημιουργό της." public: "Δημόσιο" reshare: "ξαναμοίρασε" reshares: - few: "<%= count %> Reshares" - many: "<%= count %> Reshares" one: "<%= count %> Αναδημοσίευση" other: "<%= count %> Αναδημοσίευση" - two: "<%= count %> Reshares" zero: "<%= count %> Αναδημοσίευση" show_nsfw_post: "Προβολή δημοσίευσης" show_nsfw_posts: "Προβολή όλων" diff --git a/config/locales/javascript/javascript.en.yml b/config/locales/javascript/javascript.en.yml index 2c3279902..851f5236d 100644 --- a/config/locales/javascript/javascript.en.yml +++ b/config/locales/javascript/javascript.en.yml @@ -8,6 +8,7 @@ en: confirm_dialog: "Are you sure?" delete: "Delete" ignore: "Ignore" + ignore_user: "Ignore this user?" timeago: prefixAgo: "" prefixFromNow: "" diff --git a/config/locales/javascript/javascript.es-AR.yml b/config/locales/javascript/javascript.es-AR.yml index ce383ed7a..956601259 100644 --- a/config/locales/javascript/javascript.es-AR.yml +++ b/config/locales/javascript/javascript.es-AR.yml @@ -48,6 +48,7 @@ es-AR: settings: "Opciones" view_all: "Ver todo" ignore: "Ignorar" + ignore_user: "¿Ignorar a este usuario?" infinite_scroll: no_more: "No hay más publicaciones." my_activity: "Mi actividad" diff --git a/config/locales/javascript/javascript.es-MX.yml b/config/locales/javascript/javascript.es-MX.yml index 85fe6b115..9c44ae181 100644 --- a/config/locales/javascript/javascript.es-MX.yml +++ b/config/locales/javascript/javascript.es-MX.yml @@ -48,6 +48,7 @@ es-MX: settings: "Preferencias" view_all: "Ver todo" ignore: "Ignorar" + ignore_user: "¿Ignorar a este usuario?" infinite_scroll: no_more: "No hay más publicaciones." my_activity: "Mi actividad" diff --git a/config/locales/javascript/javascript.es.yml b/config/locales/javascript/javascript.es.yml index e01864a5b..93c1f8d35 100644 --- a/config/locales/javascript/javascript.es.yml +++ b/config/locales/javascript/javascript.es.yml @@ -14,11 +14,8 @@ es: started_sharing_with: "¡Has empezado a compartir con <%= name %>!" stopped_sharing_with: "Ya no compartes más con <%= name %>." toggle: - few: "En <%= count %> aspectos" - many: "En <%= count %> aspectos" one: "En <%= count %> aspecto" other: "En <%= count %> aspectos" - two: "En <%= count %> aspectos" zero: "Elige los aspectos" aspect_navigation: deselect_all: "Desmarcar todos" @@ -51,6 +48,7 @@ es: settings: "Ajustes" view_all: "Ver todo" ignore: "Ignorar" + ignore_user: "¿Ignorar a este usuario?" infinite_scroll: no_more: "No hay más publicaciones." my_activity: "Mi Actividad" diff --git a/config/locales/javascript/javascript.eu.yml b/config/locales/javascript/javascript.eu.yml index 03796b460..9ecc36456 100644 --- a/config/locales/javascript/javascript.eu.yml +++ b/config/locales/javascript/javascript.eu.yml @@ -14,11 +14,8 @@ eu: started_sharing_with: "<%= name %>(r)ekin harremanetan hasi zara!" stopped_sharing_with: "Jada ez zaude <%= name %>(r)ekin harremanetan." toggle: - few: "<%= count %> arlotan" - many: "<%= count %> arlotan" one: "Arlo <%= count %>ean" other: "<%= count %> arlotan" - two: "<%= count %> arlotan" zero: "Arloak hautatu" aspect_navigation: deselect_all: "Guztiak deshautatu" diff --git a/config/locales/javascript/javascript.fr.yml b/config/locales/javascript/javascript.fr.yml index 147496e24..620540b4c 100644 --- a/config/locales/javascript/javascript.fr.yml +++ b/config/locales/javascript/javascript.fr.yml @@ -84,11 +84,8 @@ fr: zero: "<%= count %> J'aime" limited: "Limité" more_comments: - few: "Montrer <%= count %> commentaires en plus" - many: "Montrer <%= count %> commentaires en plus" one: "Montrer <%= count %> commentaire supplémentaire" other: "Montrer <%= count %> commentaires supplémentaires" - two: "Montrer <%= count %> commentaires en plus" zero: "Montrer <%= count %> commentaires supplémentaires" original_post_deleted: "Le message original a été effacé par son auteur." public: "Public" diff --git a/config/locales/javascript/javascript.hu.yml b/config/locales/javascript/javascript.hu.yml index 820d1714e..fd83d6897 100644 --- a/config/locales/javascript/javascript.hu.yml +++ b/config/locales/javascript/javascript.hu.yml @@ -50,7 +50,8 @@ hu: search: "Keresés" settings: "Beállítások" view_all: "Összes" - ignore: "Elutasít" + ignore: "Mellőzés" + ignore_user: "Felhasználó mellőzése?" infinite_scroll: no_more: "Nincs több bejegyzés." my_activity: "Tevékenységeim" @@ -76,11 +77,7 @@ hu: hide_nsfw_posts: "#nsfw bejegyzések rejtése" like: "Tetszik" likes: - few: "<%= count %> kedveli" - many: "<%= count %> kedveli" - one: "<%= count %> kedveli" other: "<%= count %> ember kedveli" - two: "<%= count %> kedveli" zero: "<%= count %> kedveli" limited: "Korlátozott" more_comments: diff --git a/config/locales/javascript/javascript.hy.yml b/config/locales/javascript/javascript.hy.yml index 53c120a3b..9fcdbf492 100644 --- a/config/locales/javascript/javascript.hy.yml +++ b/config/locales/javascript/javascript.hy.yml @@ -6,22 +6,115 @@ hy: javascripts: + aspect_dropdown: + add_to_aspect: "Ընդլայնել կապերը" + all_aspects: "Բոլոր խմբերը" + error: "Չի ստացվում սկսել կիսվել <%= name %>-ի հետ:   Արհամարհու՞մ ես նրանց։" + select_aspects: "Ընտրիր խմբերը" + started_sharing_with: "Սկսեցիր կիսվել <%= name %>-ի հետ։" + stopped_sharing_with: "Դու այլևս չես կիսվում <%= name %>-ի հետ։" + toggle: + one: "<%= count %> խմբում" + other: "<%= count %> խմբերում" + zero: "Ընտրիր խումբը" aspect_navigation: - deselect_all: "Ջնջել ամբողջը" + deselect_all: "Ապանշել ամբողջը" + no_aspects: "Ոչ մի խումբ ընտրված չէ" select_all: "Նշել ամբողջը" + comments: + hide: "թաքցնել մեկնաբանությունները" + show: "ցույց տալ բոլոր մեկնաբանությունները" + confirm_dialog: "Համոզվա՞ծ ես։" + delete: "Ջնջել" + failed_to_like: "Չհաջողվեց հավանել" + failed_to_post_message: "Չհաջողվեց գրառում կատարել" + getting_started: + alright_ill_wait: "Լավ, ես կսպասեմ։" + hey: "Հե՜յ , <%= name %> ։" + no_tags: "Հե՜յ, հետևելու ոչ մի պիտակ չնշեցիր։ Շարունակե՞լ։" + preparing_your_stream: "Նախապատրաստում ենք քո անհատական լրահոսը..." header: - mark_all_as_read: "Նշել ամբողջը ինչպես կարդացած" + admin: "Ղեկավար" + close: "թաքցնել" + contacts: "Կապեր" + home: "Գլխավոր էջ" + log_out: "Ելք" + mark_all_as_read: "Նշել ամբողջը որպես ընթերցված։" messages: "Նամակներ" - search: "Որոնել" + notifications: "Ծանուցումներ" + profile: "Անձնական էջ" + recent_notifications: "Վերջին ծանուցումներ" + search: "Որոնում" + settings: "Կարգավորումներ" view_all: "Ցույցադրել ամբողջը" + ignore: "Արհամարհել" + ignore_user: "Արհամարհե՞լ այս օգտատիրոջը։" + infinite_scroll: + no_more: "Գրառումներ էլ չկան։" + my_activity: "Իմ գործունեությունը" + my_stream: "Լրահոս" + people: + not_found: "և ոչ ոք չգտնվեց..." + photo_uploader: + looking_good: "Օ՜, աստվածներ, հիանալի տեսք ունես։" + publisher: + at_least_one_aspect: "Գրառումդ պետք է տեսանելի լինի առնվազն մեկ խմբի։" + limited: "Սահմանափակ. սա նշանակում է, որ գրառումդ տեսանլի կլինի միայն այն մարդկանց, ում հետ կիսվում ես։" + public: "Հրապարակային. սա նշանակում է, որ գրառումդ տեսանելի կլինի բոլորին և հասանելի կլինի փնտրող համակարգերի համար։" + reshares: + duplicate: "Օհ, այդքան լա՞վն է... Արդեն տարածել ես սա։" + post: "Տարածե՞լ <%= name %>-ի գրառումը։" + successful: "Այս գրառումը հաջողությամբ տարածվեց։" + search_for: "Փնտրել <%= name %>" + show_more: "ցույց տալ ավելին" stream: - comment: "Մեկնաբանություն" + comment: "Մեկնաբանել" + follow: "Հետևել" hide: "Թաքցնել" + hide_nsfw_posts: "Թաքցնել #nsfw գրառումները" like: "Հավանել" + likes: + one: "<%= count %> հավանում" + other: "<%= count %> հավանումներ" + zero: "<%= count %> հավանում" + limited: "Սահմանափակ" + more_comments: + one: "Ցույց տալ ևս <%= count %> մեկնաբանություն" + other: "Ցույց տալ ևս <%= count %> մեկնաբանություն" + zero: "Ցույց տալ ևս <%= count %> մեկնաբանություն" + original_post_deleted: "Հեղինակը ջնջել է բնօրինակը:" + public: "Հրապարակային" + reshare: "Տարածել" + show_nsfw_post: "Ցուցադրել գրառումը" + show_nsfw_posts: "Ցուցադրել ամբողջը" + unfollow: "Դադարել հետևել" + unlike: "Ապահավանել" + tags: + wasnt_that_interesting: "Լավ, ենթադրում եմ, որ #<%= tagName %>-ը էդքան էլ հետքրքիր չէր..." timeago: + day: "մեկ օր" + days: "%d օր" + hour: "մոտ մեկ ժամ" + hours: "մոտ %d ժամ" + minute: "մոտ մեկ րոպե" + minutes: "%d րոպե" + month: "մոտ մեկ ամիս" + months: "%d ամիս" prefixAgo: "" prefixFromNow: "" - suffixAgo: "" - suffixFromNow: "" + seconds: "վայրկյաններ" + suffixAgo: "առաջ" + suffixFromNow: "հիմիկվանից սկսած" + year: "մոտ մեկ տարի" + years: "%d տարի" videos: - watch: "Ակնդրի այս հոլովակը <%= provider %>ում" \ No newline at end of file + unknown: "Տեսահոլովակի անհայտ տեսակ։" + watch: "Դիտել այս տեսահոլովակը <%= provider %> կայքում" + viewer: + comment: "Մեկնաբանել" + follow_post: "Հետևել գրառմանը" + home: "Գլխավոր էջ" + like: "Հավանել" + reshare: "Տարածել" + stop_following_post: "Դադարեցնել գրառմանը հետևելը" + unlike: "Ապահավանել" \ No newline at end of file diff --git a/config/locales/javascript/javascript.id.yml b/config/locales/javascript/javascript.id.yml index 52a406cf4..b1de63a7e 100644 --- a/config/locales/javascript/javascript.id.yml +++ b/config/locales/javascript/javascript.id.yml @@ -14,11 +14,7 @@ id: started_sharing_with: "Anda mulai berbagi dengan <%= name %> !" stopped_sharing_with: "Anda berhenti berbagi dengan <%= name %>" toggle: - few: "In {{count}} aspects" - many: "In {{count}} aspects" - one: "In {{count}} aspect" other: "Dalam <%= count %> Hal" - two: "In <%= count %> aspects" zero: "Dalam <%= count %> Hal" aspect_navigation: deselect_all: "Batalkan semua pilihan" @@ -68,11 +64,7 @@ id: zero: "<%= count %> Likes" limited: "Terbatas" more_comments: - few: "Show <%= count %> more comments" - many: "Show <%= count %> more comments" - one: "Show <%= count %> more comment" other: "Tampilkan <%= count %> komentar" - two: "Show <%= count %> more comments" zero: "Tampilkan <%= count %> komentar" original_post_deleted: "Posting asli di hapus oleh penulis." public: "Publik" diff --git a/config/locales/javascript/javascript.ko.yml b/config/locales/javascript/javascript.ko.yml index 4265081dc..0baa6c1fb 100644 --- a/config/locales/javascript/javascript.ko.yml +++ b/config/locales/javascript/javascript.ko.yml @@ -84,21 +84,13 @@ ko: zero: "<%= count %>명이 좋아합니다" limited: "제한됨" more_comments: - few: "댓글 <%= count %>개 더 보기" - many: "댓글 <%= count %>개 더 보기" - one: "댓글 한 개 더 보기" other: "댓글 <%= count %>개 더 보기" - two: "댓글 <%= count %>개 더 보기" zero: "댓글 <%= count %>개 더 보기" original_post_deleted: "작성자가 원본을 지웠습니다." public: "공개" reshare: "재공유" reshares: - few: "<%= count %>명이 재공유했습니다." - many: "<%= count %>명이 재공유했습니다." - one: "한 명이 재공유했습니다." other: "재공유 <%= count %>번" - two: "<%= count %>명이 재공유했습니다" zero: "재공유 <%= count %>번" show_nsfw_post: "게시물 보기" show_nsfw_posts: "모두 보기" diff --git a/config/locales/javascript/javascript.lt.yml b/config/locales/javascript/javascript.lt.yml new file mode 100644 index 000000000..eca2c01a0 --- /dev/null +++ b/config/locales/javascript/javascript.lt.yml @@ -0,0 +1,114 @@ +# Copyright (c) 2010-2012, Diaspora Inc. This file is +# licensed under the Affero General Public License version 3 or later. See +# the COPYRIGHT file. + + + +lt: + javascripts: + aspect_dropdown: + add_to_aspect: "Pridėti prie kontaktų" + all_aspects: "Visos kategorijos" + error: "Negalima pradėti dalijimosi su <%= name %>. Gal įjungtas ignoravimas?" + select_aspects: "Pasirinkti kategorijas" + started_sharing_with: "Jūs pradėjote dalijimąsi su <%= name %>!" + stopped_sharing_with: "Jūs sustabdėte dalijimąsi su <%= name %>" + toggle: + few: "<%= count %> kategorijose" + one: "<%= count %> kategorijoje" + other: "<%= count %> kategorijų" + zero: "Pasirinkite kategorijas" + aspect_navigation: + deselect_all: "Nesirinkti nieko" + no_aspects: "Nepasirinkta nei viena kategorija" + select_all: "Pasirinkti viską" + comments: + hide: "Slėpti komentarus" + show: "Rodyti visus komentarus" + confirm_dialog: "Ar Jūs tuo įsitikinęs?" + delete: "Ištrinti" + failed_to_like: "Nepavyko pamėgti!" + failed_to_post_message: "Nepavyko išsiųsti žinutės!" + getting_started: + alright_ill_wait: "Suprantama, aš galiu palaukti!" + hey: "Sveiki, <%= name %>!" + no_tags: "Labas, Jūs nieko nesekate! Visitiek tęsti?" + preparing_your_stream: "Ruošiamas Jūsų Srautas..." + header: + admin: "Administruoti" + contacts: "Kontaktai" + home: "Pradžia" + log_out: "Atsijungti" + mark_all_as_read: "Pažymėti viską kaip skaitytą" + messages: "Pranešimai" + notifications: "Įspėjimai" + profile: "Anketa" + recent_notifications: "Naujausi įspėjimai" + search: "Paieška" + settings: "Nustatymai" + view_all: "Rodyti viską" + ignore: "Ignoruoti" + infinite_scroll: + no_more: "Įrašų nėra." + my_activity: "Mano veikla" + my_stream: "Srautas" + photo_uploader: + looking_good: "Wow, Jūs atrodote nuostabiai!" + publisher: + at_least_one_aspect: "Jums reikia paviešinti bent vieną kategoriją" + limited: "Ribotas - Jūsų įrašą galės peržiūrėti tik žmonės, su kuriais Jūs dalijatės" + public: "Viešas - Jūsų įrašus galės peržiūrėti visi, taip pat jie bus randami paieškos sistemose." + reshares: + duplicate: "Šitas geras, ne? Jūs jau dalijotės šiuo įrašu!" + search_for: "Ieškoti <%= name %>" + show_more: "Rodyti daugiau" + stream: + comment: "Komentuoti" + follow: "Sekti" + hide: "Slėpti" + hide_nsfw_posts: "Slėpti #nsfw įrašus" + like: "Mėgti" + likes: + few: "<%= count %> mėgstantys" + one: "<%= count %> mėgstantis" + other: "<%= count %> mėgstančių" + zero: "<%= count %> mėgstančių" + limited: "Ribotas" + more_comments: + few: "Rodyti dar <%= count %> komentarus" + one: "Rodyti dar <%= count %> komentarą" + other: "Rodyti dar <%= count %> komentarų" + zero: "Rodyti <%= count %> komentarų" + original_post_deleted: "Įrašą ištrynė jo autorius." + public: "viešas" + reshare: "Pasidalinti" + reshares: + few: "Dalijasi <%= count %>" + one: "Dalijasi <%= count %>" + other: "Dalijasi <%= count %>" + zero: "Dalijasi <%= count %>" + show_nsfw_post: "Rodyti įrašą" + show_nsfw_posts: "Rodyti viską" + unfollow: "Nesekti" + unlike: "Nemėgti" + tags: + wasnt_that_interesting: "Na gerai, greičiausiai #<%= tagName%> tai nebuvo taip įdomu..." + timeago: + day: "1 d." + days: "%d d." + hour: "maždaug1 val." + hours: "maždaug %d val." + minute: "maždaug 1 min." + minutes: "%d min." + month: "maždaug 1 mėn." + months: "%d mėn." + prefixAgo: "" + prefixFromNow: "" + seconds: "mažiau nei 1 min." + suffixAgo: "prieš" + suffixFromNow: "nuo dabar" + year: "maždaug 1 m." + years: "%d m." + videos: + unknown: "Netinkamas video įrašo tipas." + watch: "Žiūrėkite video įrašą čia <%=provider %>" \ No newline at end of file diff --git a/config/locales/javascript/javascript.nb.yml b/config/locales/javascript/javascript.nb.yml index fc626e5b6..cff2f3e22 100644 --- a/config/locales/javascript/javascript.nb.yml +++ b/config/locales/javascript/javascript.nb.yml @@ -72,29 +72,20 @@ nb: hide_nsfw_posts: "Gjem #nsfw-posts" like: "Liker" likes: - few: "<%= count %> Likes" - many: "<%= count %> Likes" one: "<%= count %> liker dette" other: "<%= count %> liker dette" - two: "<%= count %> Likes" zero: "<%= count %> liker dette" limited: "Begrenset" more_comments: - few: "Show <%= count %> more comments" - many: "Show <%= count %> more comments" one: "Vis <%= count %> kommentar til" other: "Vis <%= count %> komentarer til" - two: "Show <%= count %> more comments" zero: "Ikke flere kommentarer" original_post_deleted: "Den opprinnelige posten er slettet av forfatteren." public: "Offentlig" reshare: "Del" reshares: - few: "<%= count %> Reshares" - many: "<%= count %> Reshares" one: "<%= count %> deling" other: "<%= count %> delinger" - two: "<%= count %> Reshares" zero: "<%= count %> delinger" show_nsfw_post: "Vis innlegg" show_nsfw_posts: "Vis alle" diff --git a/config/locales/javascript/javascript.nl.yml b/config/locales/javascript/javascript.nl.yml index c0db552fe..d7dcfcd34 100644 --- a/config/locales/javascript/javascript.nl.yml +++ b/config/locales/javascript/javascript.nl.yml @@ -81,11 +81,8 @@ nl: zero: "<%= count %> mensen vinden dit leuk" limited: "Beperkt zichtbaar" more_comments: - few: "Toon nog <%= count %> reacties" - many: "Toon nog <%= count %> reacties" one: "Toon nog <%= count %> reactie" other: "Toon nog <%= count %> reacties" - two: "Toon nog <%= count %> reacties" zero: "Toon nog <%= count %> reacties" original_post_deleted: "Originele bericht verwijderd door de auteur." public: "Openbaar" diff --git a/config/locales/javascript/javascript.nn.yml b/config/locales/javascript/javascript.nn.yml index d45c87f91..b782a6084 100644 --- a/config/locales/javascript/javascript.nn.yml +++ b/config/locales/javascript/javascript.nn.yml @@ -73,29 +73,20 @@ nn: hide_nsfw_posts: "Gøym innlegg merka med #nsfw" like: "Lik" likes: - few: "<%= count %> Likes" - many: "<%= count %> Likes" one: "<%= count %> likar dette" other: "<%= count %> likar dette" - two: "<%= count %> Likes" zero: "<%= count %> likar dette" limited: "Avgrensa" more_comments: - few: "Show <%= count %> more comments" - many: "Show <%= count %> more comments" one: "Syn <%= count %> kommentar meir" other: "Syn <%= count %> fleire kommentarar" - two: "Show <%= count %> more comments" zero: "Syn <%= count %> fleire kommentarar" original_post_deleted: "Det opprinnelege innlegget er sletta av forfattaren." public: "Offentleg" reshare: "Del" reshares: - few: "<%= count %> Reshares" - many: "<%= count %> Reshares" one: "<%= count %> deling" other: "<%= count %> delingar" - two: "<%= count %> Reshares" zero: "<%= count %> delingar" show_nsfw_post: "Syn innlegg" show_nsfw_posts: "Syn alt" diff --git a/config/locales/javascript/javascript.pl.yml b/config/locales/javascript/javascript.pl.yml index 1de0dbb60..7a76531e3 100644 --- a/config/locales/javascript/javascript.pl.yml +++ b/config/locales/javascript/javascript.pl.yml @@ -51,6 +51,7 @@ pl: settings: "Ustawienia" view_all: "Wyświetl wszystko" ignore: "Ignoruj" + ignore_user: "Zignorować tego użytkownika?" infinite_scroll: no_more: "Nie ma więcej wpisów." my_activity: "Moja aktywność" @@ -85,10 +86,8 @@ pl: limited: "Ograniczone" more_comments: few: "Wyświetl <%= count %> komentarze więcej" - many: "Wyświetl <%= count %> więcej komentarzy" one: "Wyświetl <%= count %> komentarz więcej" other: "Wyświetl <%= count %> komentarzy więcej" - two: "Wyświetl <%= count %> komentarze więcej" zero: "Wyświetl <%= count %> komentarzy więcej" original_post_deleted: "Oryginalny wpis został usunięty przez autora." public: "Publiczny" diff --git a/config/locales/javascript/javascript.pt-BR.yml b/config/locales/javascript/javascript.pt-BR.yml index c09072b39..46352c459 100644 --- a/config/locales/javascript/javascript.pt-BR.yml +++ b/config/locales/javascript/javascript.pt-BR.yml @@ -48,6 +48,7 @@ pt-BR: settings: "Configurações" view_all: "Ver todas" ignore: "Ignorar" + ignore_user: "Ignorar este usuário?" infinite_scroll: no_more: "Não há mais postagem." my_activity: "Minhas Atividades" @@ -73,29 +74,20 @@ pt-BR: hide_nsfw_posts: "Esconder posts não recomendáveis para serem visualizados no escritório." like: "Curtir" likes: - few: "<%= count %> Likes" - many: "<%= count %> Likes" one: "<%= count %> gostei" other: "<%= count %> gostei" - two: "<%= count %> Likes" zero: "<%= count %> gostei" limited: "Limitado" more_comments: - few: "Show <%= count %> more comments" - many: "Show <%= count %> more comments" one: "Mostre mais <%= count %> comentário" other: "Mostre mais <%= count %> comentários" - two: "Show <%= count %> more comments" - zero: "Mostre mais <%= count %> comentário" + zero: "Mostre mais <%= count %> comentário" original_post_deleted: "A postagem original foi deletada pelo autor." public: "Público" reshare: "Recompartilhar" reshares: - few: "<%= count %> Reshares" - many: "<%= count %> Reshares" one: "<%= count %> Recompartilhamento" other: "<%= count %> Recompartilhamentos" - two: "<%= count %> Reshares" zero: "<%= count %> Recompartilhamento" show_nsfw_post: "Mostrar post" show_nsfw_posts: "Mostrar tudo" diff --git a/config/locales/javascript/javascript.pt-PT.yml b/config/locales/javascript/javascript.pt-PT.yml index 44f45565a..3f9b99a84 100644 --- a/config/locales/javascript/javascript.pt-PT.yml +++ b/config/locales/javascript/javascript.pt-PT.yml @@ -11,7 +11,7 @@ pt-PT: all_aspects: "Todos os grupos" error: "Não foi possível começar a partilhar com {{name}}. Você está a ignorá-los?" select_aspects: "Selecionar grupos" - started_sharing_with: "Começou a partilhar com {{name}}!" + started_sharing_with: "Começou a partilhar com <%= name %>!" stopped_sharing_with: "Deixou de partilhar com {{name}}." toggle: one: "Em <%=count %> grupo" @@ -48,6 +48,7 @@ pt-PT: settings: "Definições" view_all: "Ver tudo" ignore: "Ignorar" + ignore_user: "Ignorar este utilizador?" infinite_scroll: no_more: "Não há mais publicações." my_activity: "Minha atividade" @@ -80,10 +81,10 @@ pt-PT: more_comments: few: "Mostrar <%= count %> mais comentários" many: "Mostrar <%= count %> mais comentários" - one: "Mostras <%= count %> mais comentários" - other: "Mostrar <%= count %> mais comentários" + one: "Mostrar mais <%= count %> comentário" + other: "Mostrar mais <%= count %> comentários" two: "Mostrar <%= count %> mais comentários" - zero: "Mostrar <%= count %> mais comentários" + zero: "Mostrar mais <%= count %> comentários" original_post_deleted: "Publicação original eliminada pelo autor." public: "Público" reshare: "Partilhar" diff --git a/config/locales/javascript/javascript.ru.yml b/config/locales/javascript/javascript.ru.yml index 0932b335c..ff40d7a56 100644 --- a/config/locales/javascript/javascript.ru.yml +++ b/config/locales/javascript/javascript.ru.yml @@ -88,7 +88,6 @@ ru: many: "Еще <%= count %> комментариев" one: "Еще <%= count %> комментарий" other: "Еще <%= count %> комментариев" - two: "Остальные комментарии (<%= count %>)" zero: "Еще <%= count %> комментариев" original_post_deleted: "Исходная запись удалена автором." public: "Публичная" diff --git a/config/locales/javascript/javascript.sk.yml b/config/locales/javascript/javascript.sk.yml index c5830cb85..376894c7a 100644 --- a/config/locales/javascript/javascript.sk.yml +++ b/config/locales/javascript/javascript.sk.yml @@ -15,10 +15,8 @@ sk: stopped_sharing_with: "<%= name %> bol(a) vymazaný (-á) z tvojich kontaktov." toggle: few: "V <%= count %> kategóriách" - many: "V(o) <%= count %> kategóriách" one: "V <%= count %> kategórii" other: "V(o) <%= count %>kategóriách" - two: "V(o) <%= count %> kategóriách" zero: "Vyber si kategórie" aspect_navigation: deselect_all: "Odznačiť všetky" diff --git a/config/locales/javascript/javascript.sl.yml b/config/locales/javascript/javascript.sl.yml index 1f038a812..87194bf25 100644 --- a/config/locales/javascript/javascript.sl.yml +++ b/config/locales/javascript/javascript.sl.yml @@ -15,7 +15,6 @@ sl: stopped_sharing_with: "Prenehali ste deliti z <%= name %>." toggle: few: "V <%= count %> vidikih" - many: "V {{count}} pogledih" one: "V <%= count %> vidiku" other: "V <%= count %> vidikih" two: "V <%= count %> vidikih" @@ -77,7 +76,6 @@ sl: like: "Všeč mi je" likes: few: "<%= count %> je to všeč" - many: "<%= count %> Likes" one: "<%= count %> je to všeč" other: "<%= count %> je to všeč" two: "<%= count %> je to všeč" @@ -85,7 +83,6 @@ sl: limited: "Omejeno" more_comments: few: "Prikaži <%= count %> mnenja" - many: "Show <%= count %> more comments" one: "Prikaži <%= count %> mnenje" other: "Prikaži <%= count %> mnenj" two: "Prikaži <%= count %> mnenji" @@ -95,7 +92,6 @@ sl: reshare: "Ponovno deli" reshares: few: "<%= count %> ponovna deljenja" - many: "<%= count %> Reshares" one: "<%= count %> ponovno deljenje" other: "<%= count %> ponovnih deljenj" two: "<%= count %> ponovni deljenji" diff --git a/config/locales/javascript/javascript.sv.yml b/config/locales/javascript/javascript.sv.yml index 5f9bf9709..7d26a35fd 100644 --- a/config/locales/javascript/javascript.sv.yml +++ b/config/locales/javascript/javascript.sv.yml @@ -51,6 +51,7 @@ sv: settings: "Inställningar" view_all: "Visa alla" ignore: "Ignorera" + ignore_user: "Vill du ignorera den här användaren?" infinite_scroll: no_more: "Inga fler inlägg." my_activity: "Min aktivitet" @@ -76,19 +77,13 @@ sv: hide_nsfw_posts: "Dölj #nsfw-inlägg" like: "Gilla" likes: - few: "<%= count %> gillar" - many: "<%= count %> gillar" one: "En gillar" other: "<%= count %> gillar" - two: "<%= count %> gillar" zero: "Ingen gillar" limited: "Begränsad" more_comments: - few: "Visa <%= count %> till kommentarer" - many: "Visa <%= count %> till kommentarer" one: "Visa en kommentar till" other: "Visa <%= count %> kommentarer till" - two: "Visa <%= count %> till kommentarer" zero: "Visa inga fler kommentarer" original_post_deleted: "Det ursprungliga inlägget har blivit borttaget av författaren." public: "Publik" diff --git a/config/locales/javascript/javascript.te.yml b/config/locales/javascript/javascript.te.yml index 06cc84642..b89817f51 100644 --- a/config/locales/javascript/javascript.te.yml +++ b/config/locales/javascript/javascript.te.yml @@ -57,11 +57,8 @@ te: hide: "దాచు" like: "ఇష్టం" likes: - few: "<%= count %> Likes" - many: "<%= count %> Likes" one: "<%= count %> ఇష్టం" other: "<%= count %> ఇష్టాలు" - two: "<%= count %> Likes" zero: "<%= count %> ఇష్టాలు" limited: "పరిమితం" more_comments: diff --git a/config/locales/javascript/javascript.tr.yml b/config/locales/javascript/javascript.tr.yml index a89b4e29d..d21334008 100644 --- a/config/locales/javascript/javascript.tr.yml +++ b/config/locales/javascript/javascript.tr.yml @@ -76,29 +76,17 @@ tr: hide_nsfw_posts: "#nsfw gönderilerin gizle" like: "Beğen" likes: - few: "<%= count %> Likes" - many: "<%= count %> Likes" - one: "<%= count %> Like" other: "<%= count %> Beğeni" - two: "<%= count %> Likes" zero: "<%= count %> Beğeni" limited: "Sınırlı" more_comments: - few: "Show <%= count %> more comments" - many: "Show <%= count %> more comments" - one: "Show <%= count %> more comment" other: "Diğer <%= count %> yorum gör" - two: "Show <%= count %> more comments" zero: "Diğer <%= count %> yorumu gör" original_post_deleted: "İleti yazarı tarafından silindi." public: "Genel" reshare: "Yeniden paylaş" reshares: - few: "<%= count %> Reshares" - many: "<%= count %> Reshares" - one: "<%= count %> Reshare" other: "<%= count %> Yeniden paylaşma" - two: "<%= count %> Reshares" zero: "<%= count %> Yeniden paylaşma" show_nsfw_post: "İletiyi görüntüle" show_nsfw_posts: "Tümünü göster" diff --git a/config/locales/javascript/javascript.vi.yml b/config/locales/javascript/javascript.vi.yml index c83df2f8a..040e70ee5 100644 --- a/config/locales/javascript/javascript.vi.yml +++ b/config/locales/javascript/javascript.vi.yml @@ -47,6 +47,7 @@ vi: settings: "Thiết lập" view_all: "Xem tất cả" ignore: "Bỏ qua" + ignore_user: "Bỏ qua người này?" infinite_scroll: no_more: "Không còn bài đăng nào nữa." my_activity: "Hoạt động của tôi" @@ -57,7 +58,7 @@ vi: looking_good: "Ôi, trông bạn thật tuyệt!" publisher: at_least_one_aspect: "Bạn phải công khai ít nhất một mối quan hệ" - limited: "Giới hạn - tin của bạn được những người chỉ định nhìn thấy" + limited: "Giới hạn - bài đăng của bạn được những người chỉ định nhìn thấy" public: "Công khai - bài đăng của bạn được mọi người và máy tìm kiếm nhìn thấy" reshares: duplicate: "Bạn đã chia sẻ lại tin đó!" diff --git a/config/locales/javascript/javascript.zh-CN.yml b/config/locales/javascript/javascript.zh-CN.yml index 47c84a28d..8975bf1dd 100644 --- a/config/locales/javascript/javascript.zh-CN.yml +++ b/config/locales/javascript/javascript.zh-CN.yml @@ -14,11 +14,7 @@ zh-CN: started_sharing_with: "您已开始与 <%= name %> 共享内容。" stopped_sharing_with: "您已停止与 <%= name %> 共享内容。" toggle: - few: "在{{count}}个视图中" - many: "在{{count}}个视图中" - one: "在{{count}}个视图中" other: "在 <%= count %> 个分组中" - two: "In <%= count %> aspects" zero: "添加到分组" aspect_navigation: deselect_all: "清空选择" @@ -51,6 +47,7 @@ zh-CN: settings: "设置" view_all: "查看所有" ignore: "忽略" + ignore_user: "忽略此用户?" infinite_scroll: no_more: "暂无更多的内容。" my_activity: "我的活动" @@ -76,29 +73,17 @@ zh-CN: hide_nsfw_posts: "隐藏 #nsfw (工作不宜)的内容" like: "赞" likes: - few: "<%= count %> Likes" - many: "<%= count %> Likes" - one: "<%= count %> Like" other: "<%= count %> 个赞" - two: "<%= count %> Likes" zero: "<%= count %> 个赞" limited: "限制" more_comments: - few: "Show <%= count %> more comments" - many: "Show <%= count %> more comments" - one: "Show <%= count %> more comment" other: "显示剩余的 <%= count %> 个评论" - two: "Show <%= count %> more comments" zero: "显示剩余的 <%= count %> 个评论" original_post_deleted: "原内容已被作者删除。" public: "公开" reshare: "转发" reshares: - few: "<%= count %> Reshares" - many: "<%= count %> Reshares" - one: "<%= count %> Reshare" other: "<%= count %> 次转发" - two: "<%= count %> Reshares" zero: "<%= count %> 次转发" show_nsfw_post: "显示内容" show_nsfw_posts: "全部显示" diff --git a/config/newrelic.yml b/config/newrelic.yml deleted file mode 100644 index a254b0457..000000000 --- a/config/newrelic.yml +++ /dev/null @@ -1,227 +0,0 @@ -# -# This file configures the New Relic Agent. New Relic monitors -# Ruby, Java, .NET, PHP, and Python applications with deep visibility and low overhead. -# For more information, visit www.newrelic.com. -# -# Generated January 05, 2012 -# -# This configuration file is custom generated for Diaspora, Inc. - -# Here are the settings that are common to all environments: -common: &default_settings - # ============================== LICENSE KEY =============================== - - # You must specify the license key associated with your New Relic - # account. This key binds your Agent's data to your account in the - # New Relic service. - license_key: <%= AppConfig['NEW_RELIC_LICENSE_KEY'] %> - - # Agent Enabled (Ruby/Rails Only) - # Use this setting to force the agent to run or not run. - # Default is 'auto' which means the agent will install and run only - # if a valid dispatcher such as Mongrel is running. This prevents - # it from running with Rake or the console. Set to false to - # completely turn the agent off regardless of the other settings. - # Valid values are true, false and auto. - # agent_enabled: auto - - # Application Name - # Set this to be the name of your application as you'd like it show - # up in New Relic. New Relic will then auto-map instances of your application - # into a New Relic "application" on your home dashboard page. If you want - # to map this instance into multiple apps, like "AJAX Requests" and - # "All UI" then specify a semicolon-separated list of up to three - # distinct names. If you comment this out, it defaults to the - # capitalized RAILS_ENV (i.e., Production, Staging, etc) - app_name: <%= AppConfig.new_relic_app_name %> - - # When "true", the agent collects performance data about your - # application and reports this data to the New Relic service at - # newrelic.com. This global switch is normally overridden for each - # environment below. (formerly called 'enabled') - monitor_mode: true - - # Developer mode should be off in every environment but - # development as it has very high overhead in memory. - developer_mode: false - - # The newrelic agent generates its own log file to keep its logging - # information separate from that of your application. Specify its - # log level here. - log_level: info - - # The newrelic agent communicates with the New Relic service via http by - # default. If you want to communicate via https to increase - # security, then turn on SSL by setting this value to true. Note, - # this will result in increased CPU overhead to perform the - # encryption involved in SSL communication, but this work is done - # asynchronously to the threads that process your application code, - # so it should not impact response times. - ssl: true - - # EXPERIMENTAL: enable verification of the SSL certificate sent by - # the server. This setting has no effect unless SSL is enabled - # above. This may block your application. Only enable it if the data - # you send us needs end-to-end verified certificates. - # - # This means we cannot cache the DNS lookup, so each request to the - # New Relic service will perform a lookup. It also means that we cannot - # use a non-blocking lookup, so in a worst case, if you have DNS - # problems, your app may block indefinitely. - # verify_certificate: true - - # Set your application's Apdex threshold value with the 'apdex_t' - # setting, in seconds. The apdex_t value determines the buckets used - # to compute your overall Apdex score. - # Requests that take less than apdex_t seconds to process will be - # classified as Satisfying transactions; more than apdex_t seconds - # as Tolerating transactions; and more than four times the apdex_t - # value as Frustrating transactions. - # For more about the Apdex standard, see - # http://newrelic.com/docs/general/apdex - apdex_t: 0.5 - - # Proxy settings for connecting to the New Relic server. - # - # If a proxy is used, the host setting is required. Other settings - # are optional. Default port is 8080. - # - # proxy_host: hostname - # proxy_port: 8080 - # proxy_user: - # proxy_pass: - - # Tells transaction tracer and error collector (when enabled) - # whether or not to capture HTTP params. When true, frameworks can - # exclude HTTP parameters from being captured. - # Rails: the RoR filter_parameter_logging excludes parameters - # Java: create a config setting called "ignored_params" and set it to - # a comma separated list of HTTP parameter names. - # ex: ignored_params: credit_card, ssn, password - capture_params: false - - # Transaction tracer captures deep information about slow - # transactions and sends this to the New Relic service once a - # minute. Included in the transaction is the exact call sequence of - # the transactions including any SQL statements issued. - transaction_tracer: - - # Transaction tracer is enabled by default. Set this to false to - # turn it off. This feature is only available at the Professional - # product level. - enabled: true - - # Threshold in seconds for when to collect a transaction - # trace. When the response time of a controller action exceeds - # this threshold, a transaction trace will be recorded and sent to - # New Relic. Valid values are any float value, or (default) "apdex_f", - # which will use the threshold for an dissatisfying Apdex - # controller action - four times the Apdex T value. - transaction_threshold: apdex_f - - # When transaction tracer is on, SQL statements can optionally be - # recorded. The recorder has three modes, "off" which sends no - # SQL, "raw" which sends the SQL statement in its original form, - # and "obfuscated", which strips out numeric and string literals. - record_sql: obfuscated - - # Threshold in seconds for when to collect stack trace for a SQL - # call. In other words, when SQL statements exceed this threshold, - # then capture and send to New Relic the current stack trace. This is - # helpful for pinpointing where long SQL calls originate from. - stack_trace_threshold: 0.500 - - # Determines whether the agent will capture query plans for slow - # SQL queries. Only supported in mysql and postgres. Should be - # set to false when using other adapters. - # explain_enabled: true - - # Threshold for query execution time below which query plans will not - # not be captured. Relevant only when `explain_enabled` is true. - # explain_threshold: 0.5 - - # Error collector captures information about uncaught exceptions and - # sends them to New Relic for viewing - error_collector: - - # Error collector is enabled by default. Set this to false to turn - # it off. This feature is only available at the Professional - # product level. - enabled: true - - # Rails Only - tells error collector whether or not to capture a - # source snippet around the place of the error when errors are View - # related. - capture_source: true - - # To stop specific errors from reporting to New Relic, set this property - # to comma-separated values. Default is to ignore routing errors, - # which are how 404's get triggered. - ignore_errors: ActionController::RoutingError - - # (Advanced) Uncomment this to ensure the CPU and memory samplers - # won't run. Useful when you are using the agent to monitor an - # external resource - # disable_samplers: true - - # If you aren't interested in visibility in these areas, you can - # disable the instrumentation to reduce overhead. - # - # disable_view_instrumentation: true - # disable_activerecord_instrumentation: true - # disable_memcache_instrumentation: true - # disable_dj: true - - # Certain types of instrumentation such as GC stats will not work if - # you are running multi-threaded. Please let us know. - # multi_threaded = false - -# Application Environments -# ------------------------------------------ -# Environment-specific settings are in this section. -# For Rails applications, RAILS_ENV is used to determine the environment. -# For Java applications, pass -Dnewrelic.environment to set -# the environment. - -# NOTE if your application has other named environments, you should -# provide newrelic configuration settings for these environments here. - -development: - <<: *default_settings - # Turn off communication to New Relic service in development mode (also - # 'enabled'). - # NOTE: for initial evaluation purposes, you may want to temporarily - # turn agent communication on in development mode. - monitor_mode: false - - # Rails Only - when running in Developer Mode, the New Relic Agent will - # present performance information on the last 100 transactions you have - # executed since starting the app server. - # NOTE: There is substantial overhead when running in developer mode. - # Do not use for production or load testing. - developer_mode: true - - # Enable textmate links - # textmate: true - -test: - <<: *default_settings - # It almost never makes sense to turn on the agent when running - # unit, functional or integration tests or the like. - monitor_mode: false - -# Turn on the agent in production for 24x7 monitoring. New Relic -# testing shows an average performance impact of < 5 ms per -# transaction, so you can leave this on all the time without -# incurring any user-visible performance degradation. -production: - <<: *default_settings - monitor_mode: true - -# Many applications have a staging environment which behaves -# identically to production. Support for that environment is provided -# here. By default, the staging environment has the agent turned on. -staging: - <<: *default_settings - monitor_mode: true - app_name: My Application (Staging) diff --git a/config/oauth_keys.yml.example b/config/oauth_keys.yml.example deleted file mode 100644 index 4bbeb2d14..000000000 --- a/config/oauth_keys.yml.example +++ /dev/null @@ -1,9 +0,0 @@ -twitter: - consumer_key: <%= AppConfig['twitter_consumer_key'] %> - consumer_secret: <%= AppConfig['twitter_consumer_secret'] %> -facebook: - app_id: <%=AppConfig['facebook_app_id'] %> - app_secret: <%= AppConfig['facebook_app_secret'] %> -tumblr: - consumer_key: <%= AppConfig['tumblr_consumer_key'] %> - consumer_secret: <%= AppConfig['tumblr_consumer_secret'] %> diff --git a/config/routes.rb b/config/routes.rb index 564a6b2b6..6ae77aca4 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -181,13 +181,6 @@ Diaspora::Application.routes.draw do # External - resources :authorizations, :only => [:index, :destroy] - scope "/oauth", :controller => :authorizations, :as => "oauth" do - get "authorize" => :new - post "authorize" => :create - post :token - end - resources :services, :only => [:index, :destroy] controller :services do scope "/auth", :as => "auth" do @@ -220,7 +213,7 @@ Diaspora::Application.routes.draw do get 'protocol' => redirect("https://github.com/diaspora/diaspora/wiki/Diaspora%27s-federation-protocol") # Resque web - if AppConfig[:mount_resque_web] + if AppConfig.admins.inline_resque_web? mount Resque::Server.new, :at => '/resque-jobs', :as => "resque_web" end diff --git a/config/unicorn.rb b/config/unicorn.rb index 7c6810b7e..0f998c028 100644 --- a/config/unicorn.rb +++ b/config/unicorn.rb @@ -12,6 +12,8 @@ preload_app true # How long to wait before killing an unresponsive worker timeout 30 +@resque_pid = nil + #pid '/var/run/diaspora/diaspora.pid' #listen '/var/run/diaspora/diaspora.sock', :backlog => 2048 @@ -29,6 +31,12 @@ before_fork do |server, worker| if !AppConfig.single_process_mode? Resque.redis.client.disconnect end + + if AppConfig.environment.unicorn.embed_resque_worker? + # Clean up Resque workers killed by previous deploys/restarts + Resque.workers.each { |w| w.unregister_worker } + @resque_pid ||= spawn('bundle exec rake resque:work QUEUES=*') + end old_pid = '/var/run/diaspora/diaspora.pid.oldbin' if File.exists?(old_pid) && server.pid != old_pid @@ -46,7 +54,7 @@ after_fork do |server, worker| ActiveRecord::Base.establish_connection # copy pasta from resque.rb because i'm a bad person - if !AppConfig.single_process_mode? + if !AppConfig.environment.single_process_mode? Resque.redis = AppConfig.get_redis_instance end diff --git a/db/seeds.rb b/db/seeds.rb index 1867dd828..0aaedf48c 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -15,9 +15,9 @@ require 'factory_girl_rails' require Rails.root.join('spec', 'helper_methods') include HelperMethods -alice = Factory(:user_with_aspect, :username => "alice", :password => 'evankorth') -bob = Factory(:user_with_aspect, :username => "bob", :password => 'evankorth') -eve = Factory(:user_with_aspect, :username => "eve", :password => 'evankorth') +alice = FactoryGirl.create(:user_with_aspect, :username => "alice", :password => 'evankorth') +bob = FactoryGirl.create(:user_with_aspect, :username => "bob", :password => 'evankorth') +eve = FactoryGirl.create(:user_with_aspect, :username => "eve", :password => 'evankorth') def url_hash(name) image_url = "/assets/user/#{name}.jpg" @@ -41,8 +41,7 @@ connect_users(bob, bob.aspects.first, alice, alice.aspects.first) connect_users(bob, bob.aspects.first, eve, eve.aspects.first) puts "done!" -print "making Bob an admin and beta... " -Role.add_beta(bob.person) +print "making Bob an admin... " Role.add_admin(bob.person) puts "done!" @@ -58,9 +57,9 @@ time_interval = 1000 if(n%3==1) post = u.post :status_message, :text => "#{u.username} - #{n} - #seeded", :to => u.aspects.first.id elsif(n%3==2) - post =u.post(:reshare, :root_guid => Factory(:status_message, :public => true).guid, :to => 'all') + post = u.post(:reshare, :root_guid => FactoryGirl.create(:status_message, :public => true).guid, :to => 'all') else - post = Factory(:activity_streams_photo, :public => true, :author => u.person) + post = FactoryGirl.create(:activity_streams_photo, :public => true, :author => u.person) u.add_to_streams(post, u.aspects) end @@ -73,4 +72,4 @@ end puts " done!" puts "Successfully seeded the db with users eve, bob, and alice (password: 'evankorth')" -puts "" \ No newline at end of file +puts "" diff --git a/features/mentions_from_profile_page.feature b/features/mentions_from_profile_page.feature index a3b86c3d7..be8e5d113 100644 --- a/features/mentions_from_profile_page.feature +++ b/features/mentions_from_profile_page.feature @@ -24,8 +24,7 @@ Feature: mentioning a contact from their profile page Scenario: mentioning while posting to all aspects Given I am on "alice@alice.alice"'s page And I have turned off jQuery effects - And I click "Mention" button - And I expand the publisher in the modal window + And I want to mention her from the profile And I append "I am eating a yogurt" to the publisher And I press "Share" in the modal window And I wait for the ajax to finish @@ -42,9 +41,7 @@ Feature: mentioning a contact from their profile page Scenario: mentioning while posting to just one aspect Given I am on "alice@alice.alice"'s page And I have turned off jQuery effects - And I click "Mention" button - And I wait for the ajax to finish - And I expand the publisher in the modal window + And I want to mention her from the profile And I append "I am eating a yogurt" to the publisher And I press the aspect dropdown in the modal window And I toggle the aspect "NotPostingThingsHere" in the modal window diff --git a/features/step_definitions/custom_web_steps.rb b/features/step_definitions/custom_web_steps.rb index 67b95e7eb..6942655d0 100644 --- a/features/step_definitions/custom_web_steps.rb +++ b/features/step_definitions/custom_web_steps.rb @@ -46,10 +46,18 @@ end When /^I append "([^"]*)" to the publisher$/ do |stuff| elem = find('#status_message_fake_text') - elem.native.send_keys ' ' + stuff + elem.native.send_keys(' ' + stuff) wait_until do - page.find("#status_message_text").value.match(/#{stuff}/) + find('#status_message_text').value.include?(stuff) + end +end + +And /^I want to mention (?:him|her) from the profile$/ do + click_link("Mention") + wait_for_ajax_to_finish + within('#facebox') do + click_publisher end end diff --git a/features/step_definitions/uri-step.rb b/features/step_definitions/uri-step.rb index 4928be63e..a37d737fa 100644 --- a/features/step_definitions/uri-step.rb +++ b/features/step_definitions/uri-step.rb @@ -1,10 +1,3 @@ -Given /^configuration parameter (\w+) is ([^ ]+)$/ do |key, value| - require Rails.root.join('config', "initializers", "_load_app_config.rb") - app_value = AppConfig[key.to_sym] - assert_equal value, app_value, - "You must set #{key} to #{value} and kill running server" -end - When /^I visit url ([^ ]+)$/ do |url| visit( url) end diff --git a/features/support/env.rb b/features/support/env.rb index 7d5258e2f..78533829a 100644 --- a/features/support/env.rb +++ b/features/support/env.rb @@ -56,11 +56,6 @@ Spork.prefork do # require 'webmock/cucumber' # WebMock.disable_net_connect!(:allow_localhost => true) - silence_warnings do - SERVICES['facebook'] = {'app_id' => :fake, 'app_secret' => 'sdoigjosdfijg'} - AppConfig[:configured_services] << 'facebook' - end - require Rails.root.join('spec', 'support', 'fake_resque') require File.join(File.dirname(__FILE__), 'run_resque_in_process') @@ -75,14 +70,11 @@ end Spork.each_run do Before do - @no_follow_diaspora_hq_setting = AppConfig[:no_follow_diasporahq] - AppConfig[:no_follow_diasporahq] = true DatabaseCleaner.clean Devise.mailer.deliveries = [] end After do - AppConfig[:no_follow_diasporahq] = @no_follow_diaspora_hq_setting if Capybara.current_session.driver.respond_to?(:browser) Capybara.reset_sessions! # Capybara.current_session.driver.browser.manage.delete_all_cookies diff --git a/features/support/publishing_cuke_helpers.rb b/features/support/publishing_cuke_helpers.rb index 6bfa7a290..de447cc7a 100644 --- a/features/support/publishing_cuke_helpers.rb +++ b/features/support/publishing_cuke_helpers.rb @@ -13,7 +13,7 @@ module PublishingCukeHelpers def click_publisher page.execute_script(' $("#publisher").removeClass("closed"); - $("#publisher").find("textarea").focus(); + $("#publisher").find("#status_message_fake_text").focus(); ') end @@ -79,7 +79,7 @@ module PublishingCukeHelpers end def comment_on_show_page(comment_text) - within("#post-interactions") do + within("#post-interactions") do focus_comment_box(".label.comment") make_comment(comment_text, "new-comment-text") end diff --git a/vendor/assets/javascripts/jquery.autoresize.js b/lib/assets/javascripts/jquery.autoresize.js similarity index 100% rename from vendor/assets/javascripts/jquery.autoresize.js rename to lib/assets/javascripts/jquery.autoresize.js diff --git a/lib/collect_user_photos.rb b/lib/collect_user_photos.rb index 4d1317e12..8ea909a64 100644 --- a/lib/collect_user_photos.rb +++ b/lib/collect_user_photos.rb @@ -5,7 +5,7 @@ module PhotoMover FileUtils::mkdir_p temp_dir Dir.chdir 'tmp/exports' - photos = user.visible_shareables(Post).where(:author_id => user.person.id, :type => 'Photo') + photos = user.visible_shareables(Post).where(:author_id => user.person_id, :type => 'Photo') photos_dir = "#{user.id}/photos" FileUtils::mkdir_p photos_dir diff --git a/lib/configuration.rb b/lib/configuration.rb new file mode 100644 index 000000000..c691b4940 --- /dev/null +++ b/lib/configuration.rb @@ -0,0 +1,69 @@ + +require Rails.root.join('lib', 'configuration', 'lookup_chain') +require Rails.root.join('lib', 'configuration', 'provider') +require Rails.root.join('lib', 'configuration', 'proxy') + + +# A flexible and extendable configuration system. +# The calling logic is isolated from the lookup logic +# through configuration providers, which only requirement +# is to define the +#lookup+ method and show a certain behavior on that. +# The providers are asked in the order they were added until one provides +# a response. This allows to even add multiple providers of the same type, +# you never easier defined your default configuration parameters. +# There are no class methods used, you can have an unlimited amount of +# independent configuration sources at the same time. +# +# See {Settings} for a quick start. +module Configuration + # This is your main entry point. Instead of lengthy explanations + # let an example demonstrate its usage: + # + # require Rails.root.join('lib', 'configuration') + # + # AppSettings = Configuration::Settings.create do + # add_provider Configuration::Provider::Env + # add_provider Configuration::Provider::YAML, '/etc/app_settings.yml', + # namespace: Rails.env, required: false + # add_provider Configuration::Provider::YAML, 'config/default_settings.yml' + # + # extend YourConfigurationMethods + # end + # + # AppSettings.setup_something if AppSettings.something.enable? + # + # Please also read the note at {Proxy}! + class Settings + + attr_reader :lookup_chain + + undef_method :method # Remove possible conflicts with common setting names + + # @!method lookup(setting) + # (see LookupChain#lookup) + # @!method add_provider(provider, *args) + # (see LookupChain#add_provider) + # @!method [](setting) + # (see LookupChain#[]) + def method_missing(method, *args, &block) + return @lookup_chain.send(method, *args, &block) if [:lookup, :add_provider, :[]].include?(method) + + Proxy.new(@lookup_chain).send(method, *args, &block) + end + + def initialize + @lookup_chain = LookupChain.new + $stderr.puts "Warning you called Configuration::Settings.new with a block, you really meant to call #create" if block_given? + end + + # Create a new configuration object + # @yield the given block will be evaluated in the context of the new object + def self.create(&block) + config = self.new + config.instance_eval(&block) if block_given? + config + end + end + + class SettingNotFoundError < RuntimeError; end +end diff --git a/lib/configuration/lookup_chain.rb b/lib/configuration/lookup_chain.rb new file mode 100644 index 000000000..803a86610 --- /dev/null +++ b/lib/configuration/lookup_chain.rb @@ -0,0 +1,65 @@ +module Configuration + # This object builds a chain of configuration providers to try to find + # a setting. + class LookupChain + def initialize + @provider = [] + end + + # Add a provider to the chain. Providers are tried in the order + # they are added, so the order is important. + # + # @param provider [#lookup] + # @param *args the arguments passed to the providers constructor + # @raise [ArgumentError] if an invalid provider is given + # @return [void] + def add_provider(provider, *args) + unless provider.instance_method_names.include?("lookup") + raise ArgumentError, "the given provider does not respond to lookup" + end + + @provider << provider.new(*args) + end + + + # Tries all providers in the order they were added to provide a response + # for setting. + # + # @param setting [#to_s] settings should be underscore_case, + # nested settings should be separated by a dot + # @param *args further args passed to the provider + # @return [Array,String,Boolean,nil] whatever the provider provides + # is casted to a {String}, except for some special values + def lookup(setting, *args) + setting = setting.to_s + + @provider.each do |provider| + begin + return special_value_or_string(provider.lookup(setting, *args)) + rescue SettingNotFoundError; end + end + + nil + end + alias_method :[], :lookup + + private + + def special_value_or_string(value) + if [TrueClass, FalseClass, NilClass, Array, Hash].include?(value.class) + return value + elsif value.is_a?(String) + return case value.strip + when "true" then true + when "false" then false + when "", "nil" then nil + else value + end + elsif value.respond_to?(:to_s) + return value.to_s + else + return value + end + end + end +end diff --git a/lib/configuration/methods.rb b/lib/configuration/methods.rb new file mode 100644 index 000000000..6b58967ca --- /dev/null +++ b/lib/configuration/methods.rb @@ -0,0 +1,115 @@ +module Configuration + module Methods + def pod_uri + return @pod_uri unless @pod_uri.nil? + + url = environment.url.get + url = "http://#{url}" unless url =~ /^(https?:\/\/)/ + url << "/" unless url.end_with?("/") + + begin + @pod_url = Addressable::URI.parse(url) + rescue + puts "WARNING: pod url #{url} is not a legal URI" + end + + @pod_url + end + + def bare_pod_uri + pod_uri.authority.gsub('www.', '') + end + + def configured_services + return @configured_services unless @configured_services.nil? + + @configured_services = [] + [:twitter, :tumblr, :facebook].each do |service| + @configured_services << service if services.send(service).enable? + end + + @configured_services + end + attr_writer :configured_services + + def secret_token + return ENV['SECRET_TOKEN'] if ENV['SECRET_TOKEN'] + $stderr.puts "FATAL: Running on Heroku with SECRET_TOKEN unset" + $stderr.puts " Run heroku config:add SECRET_TOKEN=#{SecureRandom.hex(40)}" + Process.exit(1) + end + + def version_string + return @version_string unless @version_string.nil? + @version_string = version.number.to_s + @version_string << "pre" unless version.release? + @version_string << "-p#{git_revision[0..7]}" if git_available? + @version_string + end + + def git_available? + return @git_available unless @git_available.nil? + + if heroku? + @git_available = false + else + `which git` + @git_available = $?.success? + end + end + + def git_revision + get_git_info if git_available? + @git_revision + end + attr_writer :git_revision + + def git_update + get_git_info if git_available? + @git_update + end + attr_writer :git_update + + def rails_asset_id + (git_revision || version)[0..8] + end + + def get_redis_instance + if redistogo_url.present? + $stderr.puts "WARNING: using the REDISTOGO_URL environment variable is deprecated, please use REDIS_URL now." + ENV['REDIS_URL'] = redistogo_url + end + + redis_options = {} + + redis_url = ENV['REDIS_URL'] || environment.redis.get + + if ENV['RAILS_ENV']== 'integration2' + redis_options = { :host => 'localhost', :port => 6380 } + elsif redis_url.present? + unless redis_url.start_with?("redis://") || redis_url.start_with?("unix:///") + $stderr.puts "WARNING: Your redis url (#{redis_url}) doesn't start with redis:// or unix:///" + end + redis_options = { :url => redis_url } + end + + Redis.new(redis_options.merge(:thread_safe => true)) + end + + private + + def get_git_info + return if git_info_present? || !git_available? + + git_cmd = `git log -1 --pretty="format:%H %ci"` + if git_cmd =~ /^([\d\w]+?)\s(.+)$/ + @git_revision = $1 + @git_update = $2.strip + end + end + + def git_info_present? + @git_revision || @git_update + end + end +end diff --git a/lib/configuration/provider.rb b/lib/configuration/provider.rb new file mode 100644 index 000000000..cb8bc82a1 --- /dev/null +++ b/lib/configuration/provider.rb @@ -0,0 +1,19 @@ +module Configuration::Provider + # This provides a basic {#lookup} method for other providers to build + # upon. Childs are expected to define +lookup_path(path, *args)+ where + # +path+ will be passed an array of settings generated by splitting the + # called setting at the dots. The method should return nil if the setting + # wasn't found and {#lookup} will raise an {SettingNotFoundError} in that + # case. + class Base + def lookup(setting, *args) + result = lookup_path(setting.split("."), *args) + return result unless result.nil? + raise Configuration::SettingNotFoundError, "The setting #{setting} was not found" + end + end +end + +require Rails.root.join("lib", "configuration", "provider", "yaml") +require Rails.root.join("lib", "configuration", "provider", "env") +require Rails.root.join("lib", "configuration", "provider", "dynamic") diff --git a/lib/configuration/provider/dynamic.rb b/lib/configuration/provider/dynamic.rb new file mode 100644 index 000000000..245f76a9a --- /dev/null +++ b/lib/configuration/provider/dynamic.rb @@ -0,0 +1,24 @@ +module Configuration::Provider + # This provider knows nothing upon initialization, however if you access + # a setting ending with +=+ and give one argument to that call it remembers + # that setting, stripping the +=+ and will return it on the next call + # without +=+. + class Dynamic < Base + def initialize + @settings = {} + end + + def lookup_path(settings_path, *args) + key = settings_path.join(".") + + if key.end_with?("=") && args.length > 0 + key = key.chomp("=") + value = args.first + value = value.get if value.respond_to?(:_proxy?) && value._proxy? + @settings[key] = value + end + + @settings[key] + end + end +end diff --git a/lib/configuration/provider/env.rb b/lib/configuration/provider/env.rb new file mode 100644 index 000000000..ea17f694e --- /dev/null +++ b/lib/configuration/provider/env.rb @@ -0,0 +1,14 @@ +module Configuration::Provider + # This provider looks for settings in the environment. + # For the setting +foo.bar_baz+ this provider will look for an + # environment variable +FOO_BAR_BAZ+, replacing all dots in the setting + # and upcasing the result. If an value contains +,+ it's split at them + # and returned as array. + class Env < Base + def lookup_path(settings_path, *args) + value = ENV[settings_path.join("_").upcase] + value = value.split(",") if value && value.include?(",") + value + end + end +end diff --git a/lib/configuration/provider/yaml.rb b/lib/configuration/provider/yaml.rb new file mode 100644 index 000000000..635e179d6 --- /dev/null +++ b/lib/configuration/provider/yaml.rb @@ -0,0 +1,52 @@ +require 'yaml' + +module Configuration::Provider + # This provider tries to open a YAML file and does in nested lookups + # in it. + class YAML < Base + # @param file [String] the path to the file + # @param opts [Hash] + # @option opts [String] :namespace optionally set this as the root + # @option opts [Boolean] :required wheter or not to raise an error if + # the file or the namespace, if given, is not found. Defaults to +true+. + # @raise [ArgumentError] if the namespace isn't found in the file + # @raise [Errno:ENOENT] if the file isn't found + def initialize(file, opts = {}) + @settings = {} + required = opts.has_key?(:required) ? opts.delete(:required) : true + + @settings = ::YAML.load_file(file) + + namespace = opts.delete(:namespace) + unless namespace.nil? + actual_settings = lookup_in_hash(namespace.split("."), @settings) + unless actual_settings.nil? + @settings = actual_settings + else + raise ArgumentError, "Namespace #{namespace} not found in #{file}" if required + end + end + rescue Errno::ENOENT => e + $stderr.puts "WARNING: configuration file #{file} not found, ensure it's present" + raise e if required + end + + + def lookup_path(settings_path, *args) + lookup_in_hash(settings_path, @settings) + end + + private + + def lookup_in_hash(setting_path, hash) + setting = setting_path.shift + if hash.has_key?(setting) + if setting_path.length > 0 && hash[setting].is_a?(Hash) + return lookup_in_hash(setting_path, hash[setting]) if setting.length > 1 + else + return hash[setting] + end + end + end + end +end diff --git a/lib/configuration/proxy.rb b/lib/configuration/proxy.rb new file mode 100644 index 000000000..4acbbcc00 --- /dev/null +++ b/lib/configuration/proxy.rb @@ -0,0 +1,76 @@ +module Configuration + # Proxy object to support nested settings + # Cavehat: Since this is always true, adding a ? at the end + # returns the value, if found, instead of the proxy object. + # So instead of +if settings.foo.bar+ use +if settings.foo.bar?+ + # to check for boolean values, +if settings.foo.bar.nil?+ to + # check for nil values, +if settings.foo.bar.present?+ to check for + # empty values if you're in Rails and call {#get} to actually return the value, + # commonly when doing +settings.foo.bar.get || 'default'+. If a setting + # ends with +=+ is too called directly, just like with +?+. + class Proxy < BasicObject + COMMON_KEY_NAMES = [:key, :method] + + # @param lookup_chain [#lookup] + def initialize(lookup_chain) + @lookup_chain = lookup_chain + @setting = "" + end + + def ! + !self.get + end + + def !=(other) + self.get != other + end + + def ==(other) + self.get == other + end + + def _proxy? + true + end + + def respond_to?(method, include_private=false) + method == :_proxy? || self.get.respond_to?(method, include_private) + end + + def send(*args, &block) + self.__send__(*args, &block) + end + + def method_missing(setting, *args, &block) + unless COMMON_KEY_NAMES.include? setting + target = self.get + if !(target.respond_to?(:_proxy?) && target._proxy?) && target.respond_to?(setting) + return target.send(setting, *args, &block) + end + end + + setting = setting.to_s + + self.append_setting(setting) + + return self.get(*args) if setting.end_with?("?") || setting.end_with?("=") + + self + end + + # Get the setting at the current path, if found. + # (see LookupChain#lookup) + def get(*args) + setting = @setting[1..-1] + return unless setting + val = @lookup_chain.lookup(setting.chomp("?"), *args) + val + end + + protected + def append_setting(setting) + @setting << "." + @setting << setting + end + end +end diff --git a/lib/diaspora/exporter.rb b/lib/diaspora/exporter.rb index 1f84f1431..46d3fa3f8 100644 --- a/lib/diaspora/exporter.rb +++ b/lib/diaspora/exporter.rb @@ -14,7 +14,7 @@ module Diaspora module XML def execute(user) builder = Nokogiri::XML::Builder.new do |xml| - user_person_id = user.person.id + user_person_id = user.person_id xml.export { xml.user { xml.username user.username @@ -50,7 +50,7 @@ module Diaspora xml.contact { xml.user_id contact.user_id xml.person_id contact.person_id - xml.person_guid contact.person.guid + xml.person_guid contact.person_guid xml.aspects { contact.aspects.each do |aspect| diff --git a/lib/diaspora/relayable.rb b/lib/diaspora/relayable.rb index d98b244c3..4a853f62b 100644 --- a/lib/diaspora/relayable.rb +++ b/lib/diaspora/relayable.rb @@ -17,7 +17,8 @@ module Diaspora validates :author, :presence => true validate :author_is_not_ignored - delegate :public?, :to => :parent + delegate :public?, to: :parent + delegate :author, :diaspora_handle, to: :parent, prefix: true after_create do parent.touch(:interacted_at) if parent.respond_to?(:interacted_at) @@ -68,7 +69,7 @@ module Diaspora comment_or_like = self.class.where(:guid => self.guid).first || self # Check to make sure the signature of the comment or like comes from the person claiming to author it - unless comment_or_like.parent.author == user.person || comment_or_like.verify_parent_author_signature + unless comment_or_like.parent_author == user.person || comment_or_like.verify_parent_author_signature Rails.logger.info("event=receive status=abort reason='object signature not valid' recipient=#{user.diaspora_handle} sender=#{self.parent.author.diaspora_handle} payload_type=#{self.class} parent_id=#{self.parent.id}") return end diff --git a/lib/diaspora/shareable.rb b/lib/diaspora/shareable.rb index 759020825..6603a45b8 100644 --- a/lib/diaspora/shareable.rb +++ b/lib/diaspora/shareable.rb @@ -16,6 +16,7 @@ module Diaspora belongs_to :author, :class_name => 'Person' + delegate :id, :name, :first_name, to: :author, prefix: true #scopes scope :all_public, where(:public => true, :pending => false) @@ -26,7 +27,7 @@ module Diaspora where( Contact.arel_table[:user_id].eq(user.id).or( self.arel_table[:public].eq(true).or( - self.arel_table[:author_id].eq(user.person.id) + self.arel_table[:author_id].eq(user.person_id) ) ) ). diff --git a/lib/email_inviter.rb b/lib/email_inviter.rb index 298379c81..aa1c4d08b 100644 --- a/lib/email_inviter.rb +++ b/lib/email_inviter.rb @@ -27,4 +27,4 @@ class EmailInviter def mail(email) Notifier.invite(email, message, inviter, invitation_code, locale).deliver! end -end \ No newline at end of file +end diff --git a/lib/environment_configuration.rb b/lib/environment_configuration.rb deleted file mode 100644 index c1b254ab5..000000000 --- a/lib/environment_configuration.rb +++ /dev/null @@ -1,54 +0,0 @@ -# Copyright (c) 2010-2011, Diaspora Inc. This file is -# licensed under the Affero General Public License version 3 or later. See -# the COPYRIGHT file. - -module EnvironmentConfiguration - - def self.heroku? - ENV['HEROKU'] - end - - def self.secret_token_initializer_is_not_present? - !File.exists?( Rails.root.join('config', 'initializers', 'secret_token.rb')) - end - - def self.prevent_fetching_community_spotlight? - return true if heroku? - !ActiveRecord::Base.connection.table_exists?('people') || Rails.env == 'test' || AppConfig[:community_spotlight].nil? || AppConfig[:community_spotlight].count - end - - def self.cache_git_version? - !self.heroku? - end - - def self.ensure_secret_token! - if heroku? - puts 'heroku app detected; using session secret from config vars...' - Rails.application.config.secret_token = ENV['SECRET_TOKEN'] - elsif secret_token_initializer_is_not_present? - `rake generate:secret_token` - require Rails.root.join('config', 'initializers', 'secret_token.rb') - else - #do nothing - end - end - - def self.enforce_ssl? - return false unless Rails.env == 'production' - return false if ENV['NO_SSL'] - return false if AppConfig[:circumvent_ssl_requirement].present? - true - end - - def self.ca_cert_file_location - if self.heroku? - "/usr/lib/ssl/certs/ca-certificates.crt" - else - AppConfig[:ca_file] - end - end - - def self.using_new_relic? - defined?(NewRelic) && AppConfig['NEW_RELIC_LICENSE_KEY'].present? - end -end diff --git a/lib/messagebus/mailer.rb b/lib/messagebus/mailer.rb index 5b3d52e34..7593ab705 100644 --- a/lib/messagebus/mailer.rb +++ b/lib/messagebus/mailer.rb @@ -20,7 +20,7 @@ module Messagebus end def deliver!(message) - msg = {:toEmail => message.to.first, :subject => message.subject, :fromEmail => AppConfig[:smtp_sender_address], :fromName => from_header_parse(message[:from].to_s)} + msg = {:toEmail => message.to.first, :subject => message.subject, :fromEmail => AppConfig.mail.sender_address, :fromName => from_header_parse(message[:from].to_s)} if message.multipart? msg[:plaintextBody] = message.text_part.body.to_s if message.text_part diff --git a/lib/postzord/dispatcher.rb b/lib/postzord/dispatcher.rb index abdc52c6f..7aacf9d86 100644 --- a/lib/postzord/dispatcher.rb +++ b/lib/postzord/dispatcher.rb @@ -118,8 +118,8 @@ class Postzord::Dispatcher batch_deliver_to_local(people) else people.each do |person| - Rails.logger.info("event=push route=local sender=#{@sender.person.diaspora_handle} recipient=#{person.diaspora_handle} payload_type=#{@object.class}") - Resque.enqueue(Jobs::Receive, person.owner_id, @xml, @sender.person.id) + Rails.logger.info("event=push route=local sender=#{@sender.diaspora_handle} recipient=#{person.diaspora_handle} payload_type=#{@object.class}") + Resque.enqueue(Jobs::Receive, person.owner_id, @xml, @sender.person_id) end end end @@ -128,7 +128,7 @@ class Postzord::Dispatcher def batch_deliver_to_local(people) ids = people.map{ |p| p.owner_id } Resque.enqueue(Jobs::ReceiveLocalBatch, @object.class.to_s, @object.id, ids) - Rails.logger.info("event=push route=local sender=#{@sender.person.diaspora_handle} recipients=#{ids.join(',')} payload_type=#{@object.class}") + Rails.logger.info("event=push route=local sender=#{@sender.diaspora_handle} recipients=#{ids.join(',')} payload_type=#{@object.class}") end def deliver_to_hub diff --git a/lib/postzord/receiver/local_batch.rb b/lib/postzord/receiver/local_batch.rb index f7bc5811f..9acf0cc92 100644 --- a/lib/postzord/receiver/local_batch.rb +++ b/lib/postzord/receiver/local_batch.rb @@ -32,9 +32,9 @@ class Postzord::Receiver::LocalBatch < Postzord::Receiver # NOTE(copied over from receiver public) # @return [Object] def receive_relayable - if @object.parent.author.local? + if @object.parent_author.local? # receive relayable object only for the owner of the parent object - @object.receive(@object.parent.author.owner) + @object.receive(@object.parent_author.owner) end @object end diff --git a/lib/postzord/receiver/private.rb b/lib/postzord/receiver/private.rb index 6215e0476..e966dae18 100644 --- a/lib/postzord/receiver/private.rb +++ b/lib/postzord/receiver/private.rb @@ -76,7 +76,7 @@ class Postzord::Receiver::Private < Postzord::Receiver def xml_author if @object.respond_to?(:relayable?) #if A and B are friends, and A sends B a comment from C, we delegate the validation to the owner of the post being commented on - xml_author = @user.owns?(@object.parent) ? @object.diaspora_handle : @object.parent.author.diaspora_handle + xml_author = @user.owns?(@object.parent) ? @object.diaspora_handle : @object.parent_author.diaspora_handle @author = Webfinger.new(@object.diaspora_handle).fetch if @object.author else xml_author = @object.diaspora_handle diff --git a/lib/postzord/receiver/public.rb b/lib/postzord/receiver/public.rb index 834f8e2ab..374f8af93 100644 --- a/lib/postzord/receiver/public.rb +++ b/lib/postzord/receiver/public.rb @@ -38,9 +38,9 @@ class Postzord::Receiver::Public < Postzord::Receiver # @return [Object] def receive_relayable - if @object.parent.author.local? + if @object.parent_author.local? # receive relayable object only for the owner of the parent object - @object.receive(@object.parent.author.owner, @author) + @object.receive(@object.parent_author.owner, @author) end # notify everyone who can see the parent object receiver = Postzord::Receiver::LocalBatch.new(@object, self.recipient_user_ids) @@ -64,7 +64,7 @@ class Postzord::Receiver::Public < Postzord::Receiver def xml_author if @object.respond_to?(:relayable?) #this is public, so it would only be owners sending us other people comments etc - @object.parent.author.local? ? @object.diaspora_handle : @object.parent.diaspora_handle + @object.parent_author.local? ? @object.diaspora_handle : @object.parent_diaspora_handle else @object.diaspora_handle end diff --git a/lib/rack/chrome_frame.rb b/lib/rack/chrome_frame.rb index 81f438d6d..de7234dd1 100644 --- a/lib/rack/chrome_frame.rb +++ b/lib/rack/chrome_frame.rb @@ -29,7 +29,7 @@ module Rack
    - + HTML diff --git a/lib/rake_helpers.rb b/lib/rake_helpers.rb index f7a075277..47cd7aed6 100644 --- a/lib/rake_helpers.rb +++ b/lib/rake_helpers.rb @@ -26,8 +26,8 @@ module RakeHelpers possible_invite = Invitation.find_by_identifier(backer_email) possible_user ||= possible_invite.recipient if possible_invite.present? - admin_account = User.find_by_username(AppConfig[:admin_account]) - raise "no admin_account in application.yml" unless admin_account.present? + admin_account = User.find_by_username(AppConfig.admins.account.get) + raise "no admin account in diaspora.yml" unless admin_account.present? admin_account.invitation_code.count += num_to_process admin_account.invitation_code.save diff --git a/lib/stream/base.rb b/lib/stream/base.rb index 8cbdb2b78..f8dd3f4ab 100644 --- a/lib/stream/base.rb +++ b/lib/stream/base.rb @@ -100,7 +100,7 @@ class Stream::Base def like_posts_for_stream!(posts) return posts unless @user - likes = Like.where(:author_id => @user.person.id, :target_id => posts.map(&:id), :target_type => "Post") + likes = Like.where(:author_id => @user.person_id, :target_id => posts.map(&:id), :target_type => "Post") like_hash = likes.inject({}) do |hash, like| hash[like.target_id] = like @@ -124,16 +124,12 @@ class Stream::Base @contacts_in_stream ||= Contact.where(:user_id => user.id, :person_id => people.map{|x| x.id}).all end - def spotlight_diaspora_id - @spotlight_diaspora_id ||= AppConfig[:community_spotlight].try(:sample, 1) - end - # @param post [Post] # @return [Boolean] def post_is_from_contact?(post) @can_comment_cache ||= {} @can_comment_cache[post.id] ||= contacts_in_stream.find{|contact| contact.person_id == post.author.id}.present? - @can_comment_cache[post.id] ||= (user.person.id == post.author.id) + @can_comment_cache[post.id] ||= (user.person_id == post.author_id) @can_comment_cache[post.id] end end diff --git a/lib/stream/multi.rb b/lib/stream/multi.rb index d6264da4c..319f726c9 100644 --- a/lib/stream/multi.rb +++ b/lib/stream/multi.rb @@ -77,6 +77,6 @@ class Stream::Multi < Stream::Base # @return [Boolean] def include_community_spotlight? - AppConfig[:community_spotlight].present? && user.show_community_spotlight_in_stream? + AppConfig.environment.community_spotlight.enable? && user.show_community_spotlight_in_stream? end end diff --git a/lib/tasks/after_deploy.rake b/lib/tasks/after_deploy.rake deleted file mode 100644 index 9a8684a34..000000000 --- a/lib/tasks/after_deploy.rake +++ /dev/null @@ -1,14 +0,0 @@ -desc "revert custom landing page commit after heroku san deploys" -task :after_deploy => :environment do - - # Perform this task only if custom landing page is not present in app/views/home/_show.html.haml - if (File.exist?(Rails.root.join("app", "views", "home", "_show.html.erb")) || File.exist?(Rails.root.join("app", "views", "home", "_show.mobile.erb"))) && system("git log | head -5 | grep 'custom\ landing\ page(s)'") - puts "-----> resetting HEAD before custom landing page commit" - - system("git reset HEAD^") ? true : fail - system("git stash pop") unless @did_not_stash - - puts "-----> done" - end - -end diff --git a/lib/tasks/before_deploy.rake b/lib/tasks/before_deploy.rake deleted file mode 100644 index d56f1f55f..000000000 --- a/lib/tasks/before_deploy.rake +++ /dev/null @@ -1,21 +0,0 @@ -desc "include custom landing page before heroku san deploys" -task :before_deploy => :environment do - - each_heroku_app do |stage| - desktop_home_file = stage.config['HOME_FILE_DESKTOP'] - mobile_home_file = stage.config['HOME_FILE_MOBILE'] - # Perform this task only if custom landing page is not present in app/views/home/_show.html.haml - if desktop_home_file.present? || mobile_home_file.present? - puts "-----> custom landing page(s) detected..." - puts "-----> including custom landing page(s) in a temp commit" - - @did_not_stash = system("git stash| grep 'No local changes to save'") - system("git add #{desktop_home_file} -f") ? true : fail - system("git add #{mobile_home_file} -f") ? true : fail - system("git commit -m 'adding custom landing page(s) for heroku'") ? true : fail - - puts "-----> done" - end - end - -end diff --git a/lib/tasks/ci.rake b/lib/tasks/ci.rake index 882690f66..5bfd81970 100644 --- a/lib/tasks/ci.rake +++ b/lib/tasks/ci.rake @@ -1,45 +1,12 @@ namespace :ci do - - desc "Run tests in the cloud. ZOMG!" - task :travis do - if ENV['BUILD_TYPE'] == 'cucumber' - puts "Running cucumber features..." - system("export DISPLAY=:99.0 && bundle exec rake cucumber") - raise "Cucumber failed!" unless $?.exitstatus == 0 - else - ["rake generate_fixtures", "rake spec"].each do |cmd| - puts "Running bundle exec #{cmd}..." - system("bundle exec #{cmd}") - raise "#{cmd} failed!" unless $?.exitstatus == 0 - end - ["rake jasmine:ci"].each do |cmd| - puts "Running bundle exec #{cmd}..." - system("export DISPLAY=:99.0 && GROUP=oauth bundle exec #{cmd}") - raise "#{cmd} failed!" unless $?.exitstatus == 0 - end - end - end - - desc "Run tests that can't run on travis" - task :hard_things => [:environment, :'ci:migrate'] do - puts "Starting virtual display..." - `sh -e /etc/init.d/xvfb start` - puts "Starting specs..." - system('export DISPLAY=:99.0 && CI=true bundle exec rake cucumber') - exit_status = $?.exitstatus - puts "Stopping virtual display..." - `sh -e /etc/init.d/xvfb stop` - puts "Cleaning up..." - FileUtils.rm_rf(Rails.root.join('public', 'uploads', 'images')) - FileUtils.rm_rf(Rails.root.join('public', 'uploads', 'tmp')) - raise "tests failed!" unless exit_status == 0 - puts "All tests passed!" - end - - task :migrate => ['db:drop', 'db:create', 'db:schema:load'] do - system('bundle exec rake db:test:prepare') - raise "migration failed!" unless $?.exitstatus == 0 + namespace :travis do + desc "Run everyhting except cucumber" + task :other => [ :prepare_db, :generate_fixtures, :spec, "jasmine:ci" ] + + desc "Run cucumber" + task :cucumber => [ :prepare_db, "rake:cucumber" ] + + desc "Prepare db" + task :prepare_db => [ "db:create", "db:test:load"] end end - -task :travis => "ci:travis" diff --git a/lib/tasks/db.rake b/lib/tasks/db.rake index e2d90b969..d91a6123b 100644 --- a/lib/tasks/db.rake +++ b/lib/tasks/db.rake @@ -70,7 +70,7 @@ namespace :db do require File.join(File.dirname(__FILE__), '..', '..', 'config', 'environment') Person.where(:url => 'example.org').all.each{|person| if person.owner - person.url = AppConfig[:pod_url] + person.url = AppConfig.pod_uri.to_s person.diaspora_handle = person.owner.diaspora_handle person.save end diff --git a/lib/tasks/heroku.rake b/lib/tasks/heroku.rake deleted file mode 100644 index 174654ed2..000000000 --- a/lib/tasks/heroku.rake +++ /dev/null @@ -1,36 +0,0 @@ - #Copyright (c) 2012, Diaspora Inc. This file is - #licensed under the Affero General Public License version 3 or later. See - #the COPYRIGHT file. - -require Rails.root.join('lib', 'environment_configuration') - -namespace :heroku do - HEROKU_CONFIG_ADD_COMMAND = "heroku config:add" - - task :generate_secret_token do - puts "Generating and setting a new secret token" - token = SecureRandom.hex(40) #reloads secret token every time you reload vars.... this expires cookies, and kinda sucks - command = "#{HEROKU_CONFIG_ADD_COMMAND} SECRET_TOKEN=#{token}" - puts command - system command - end - - task :install_requirements do - system 'heroku addons:remove logging:basic' - system 'heroku addons:add logging:expanded' - system 'heroku addons:add redistogo:nano' - end - - task :set_up_s3_sync => [:environment] do - fog_provider = "FOG_PROVIDER=AWS" - aws_access_key_id = "AWS_ACCESS_KEY_ID=#{AppConfig[:s3_key]}" - aws_secret_access_key = "AWS_SECRET_ACCESS_KEY=#{AppConfig[:s3_secret]}" - fog = "FOG_DIRECTORY=#{AppConfig[:s3_bucket]}" - asset_host = "ASSET_HOST=https://#{AppConfig[:s3_bucket]}.s3.amazonaws.com" - - each_heroku_app do |stage| - system("heroku labs:enable user_env_compile -a #{stage.app}") - stage.run('config:add', "#{fog} #{fog_provider} #{aws_secret_access_key} #{aws_access_key_id} ASSET_HOST=#{asset_host}") - end - end -end \ No newline at end of file diff --git a/lib/tasks/migrations.rake b/lib/tasks/migrations.rake index be1acc84f..f0b8498d0 100644 --- a/lib/tasks/migrations.rake +++ b/lib/tasks/migrations.rake @@ -49,10 +49,10 @@ namespace :migrations do task :upload_photos_to_s3 do require File.join(File.dirname(__FILE__), '..', '..', 'config', 'environment') - puts AppConfig[:s3_key] + puts AppConfig.environment.s3.key - connection = Aws::S3.new( AppConfig[:s3_key], AppConfig[:s3_secret]) - bucket = connection.bucket('joindiaspora') + connection = Aws::S3.new( AppConfig.environment.s3.key, AppConfig.environment.s3.secret) + bucket = connection.bucket(AppConfig.environment.s3.bucket) dir_name = File.dirname(__FILE__) + "/../../public/uploads/images/" count = Dir.foreach(dir_name).count diff --git a/lib/tasks/stats.rake b/lib/tasks/stats.rake deleted file mode 100644 index 506b35484..000000000 --- a/lib/tasks/stats.rake +++ /dev/null @@ -1,40 +0,0 @@ -require Rails.root.join('lib', 'statistics' ) - -namespace :stats do - desc 'Emails recent engagement statistics the admins' - task :save_retention => :environment do - require Rails.root.join('app', 'mailers', 'notifier' ) - - return unless AppConfig[:admins].present? - - admins = User.find_all_by_username( AppConfig[:admins]) - - require 'fastercsv' - - string = FasterCSV.generate do |csv| - (0..32).each do |i| - csv << [i.to_s, Statistics.new.retention(i)] - end - end - - File.open(Rails.root.join("tmp", "retention_stats_#{Time.now.strftime("%Y-%m-%d-%H:%M:%S-%Z")}.txt"), "w") do |file| - file << string - end - end - - task :top_actives => :environment do - - require 'fastercsv' - - string = FasterCSV.generate do |csv| - (0..32).each do |i| - actives = ActiveRecord::Base.connection.select_all(Statistics.new.top_active_users(i).to_sql) - actives.each do |a| - csv << [i.to_s, a['email'], a['username'], a['first_name'], a['sign_in_count']] - end - end - end - - File.open(Rails.root.join('tmp', 'top_actives.csv'), 'w') {|f| f.write(string) } - end -end diff --git a/script/ci/before.sh b/script/ci/before.sh deleted file mode 100755 index e447c2432..000000000 --- a/script/ci/before.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/bash - -# Install firefox & Xvfb, in preparation for cucumber & jasmine - -#echo "Installing Firefox and Xvfb" -#sudo aptitude --quiet=2 --without-recommends --assume-yes install firefox xvfb -#sudo cp script/ci/xvfb /etc/init.d/xvfb -echo "Start Xvfb" -sh -e /etc/init.d/xvfb start - -# Regenerate css files -#echo "Regenerating CSS files" -#bundle exec sass -q --update public/stylesheets/sass/:public/stylesheets/ - -# setup swapfile -#echo "creating a swapfile" -#sudo dd if=/dev/zero of=swapfile bs=1M count=96 -#sudo mkswap swapfile -#sudo swapon swapfile -#sudo sysctl vm.swappiness=100 - -# Create a database.yml for the right database -echo "Setting up database.yml for $DB" -cp config/database.yml.example config/database.yml -if [ "$DB" = "postgres" ]; then - sed -i 's/*mysql/*postgres_travis/' config/database.yml -fi - -# Set up database -echo "Creating databases for $DB and loading schema" -bundle exec rake db:create --trace -bundle exec rake db:schema:load --trace diff --git a/script/ci/before_install.sh b/script/ci/before_install.sh index 859cebf9c..8d49a3ced 100755 --- a/script/ci/before_install.sh +++ b/script/ci/before_install.sh @@ -1,15 +1,6 @@ #!/bin/bash -# Workaround dependency issues -if ([ "$DB" == "postgres" -a "$TRAVIS_RUBY_VERSION" == "ree" ]); then - echo "Rebuild Gemfile.lock to get rid of diaspora-clients 1.9 dependencies" - bundle update diaspora-client -fi - - # Ensure known RubyGems version -if [ "$(gem --version)" != "1.8.17" ]; then - echo "RubyGems version is $(gem --version). Changing..." - rvm rubygems 1.8.17 - echo "Changed RubyGems version to $(gem --version)." -fi +envdir="$(readlink -e $(dirname $0))/../env" +source "$envdir/ruby_env" +source "$envdir/ensure_right_rubygems" diff --git a/script/ci/build.sh b/script/ci/build.sh new file mode 100755 index 000000000..263199deb --- /dev/null +++ b/script/ci/build.sh @@ -0,0 +1,13 @@ +#!/bin/bash + + +# Create a database.yml for the right database +echo "Setting up database.yml for $DB" +cp config/database.yml.example config/database.yml +if [ "$DB" = "postgres" ]; then + sed -i 's/*choose/*postgres_travis/' config/database.yml +fi + +command="bundle exec rake --trace ci:travis:${BUILD_TYPE}" + +exec xvfb-run --auto-servernum --server-num=1 --server-args="-screen 0 1280x1024x8" $command diff --git a/script/ci/xvfb b/script/ci/xvfb deleted file mode 100755 index 97be37b90..000000000 --- a/script/ci/xvfb +++ /dev/null @@ -1,28 +0,0 @@ -# Copyright (c) 2010, Diaspora Inc. This file is -# licensed under the Affero General Public License version 3 or later. See -# the COPYRIGHT file. - -XVFB=/usr/bin/Xvfb -XVFBARGS=":99 -ac -screen 0 1024x768x16" -PIDFILE=/tmp/cucumber_xvfb_99.pid -case "$1" in - start) - echo -n "Starting virtual X frame buffer: Xvfb" - /sbin/start-stop-daemon --start --quiet --pidfile $PIDFILE --make-pidfile --background --exec $XVFB -- $XVFBARGS - echo "." - ;; - stop) - echo -n "Stopping virtual X frame buffer: Xvfb" - /sbin/start-stop-daemon --stop --quiet --pidfile $PIDFILE - rm -f $PIDFILE - echo "." - ;; - restart) - $0 stop - $0 start - ;; - *) - echo "Usage: /etc/init.d/xvfb {start|stop|restart}" - exit 1 -esac -exit 0 \ No newline at end of file diff --git a/script/env/ensure_right_rubygems b/script/env/ensure_right_rubygems new file mode 100644 index 000000000..ae7967217 --- /dev/null +++ b/script/env/ensure_right_rubygems @@ -0,0 +1,3 @@ +if [ "$(gem --version)" != "$rubygems_version" ]; then + rvm rubygems "$rubygems_version" +fi diff --git a/script/env/ruby_env b/script/env/ruby_env new file mode 100644 index 000000000..40ce85acc --- /dev/null +++ b/script/env/ruby_env @@ -0,0 +1,3 @@ +rubygems_version="1.8.24" +ruby_version="1.9.3-p194" +gemset="diaspora" diff --git a/script/get_config.rb b/script/get_config.rb index d194ddfa4..51d5021e3 100755 --- a/script/get_config.rb +++ b/script/get_config.rb @@ -19,6 +19,7 @@ class Rails end end + if ARGV.length >= 1 setting_name = ARGV[0] if Rails.env == 'script_server' # load from the special script_server_config.yml file @@ -34,17 +35,13 @@ if ARGV.length >= 1 else # load from the general diaspora settings file require 'active_support/core_ext/class/attribute_accessors' require 'active_support/core_ext/object/blank' - require 'settingslogic' - require Rails.root.join('app', 'models', 'app_config') - setting_name = setting_name.to_sym - if (!AppConfig.respond_to?(setting_name) || AppConfig.send(setting_name).nil?) && AppConfig[setting_name].nil? - $stderr.puts "Could not find setting #{ARGV[0]} for environment #{Rails.env}." - Process.exit(1) - elsif AppConfig.respond_to?(setting_name) - print AppConfig.send(setting_name) - else - print AppConfig[setting_name] - end + require 'active_support/core_ext/module/delegation' + require 'active_support/core_ext/module/method_names' + require Rails.root.join("config/load_config") + + setting = AppConfig.send(setting_name) + setting = setting.get if setting.is_a?(Configuration::Proxy) + print setting end else $stderr.puts "Usage: ./script/get_config.rb option [section]" diff --git a/script/install.sh b/script/install.sh index 98aaa4ab6..95192b0eb 100755 --- a/script/install.sh +++ b/script/install.sh @@ -32,7 +32,14 @@ other ideas what we could do # # #### #### -BINARIES="git ruby gem bundle sed mktemp" # required programs +# required programs +declare -A BINARIES +BINARIES["git"]="git" +BINARIES["ruby"]="ruby" +BINARIES["rubygems"]="gem" +BINARIES["bundler"]="bundle" +BINARIES["sed"]="sed" +BINARIES["mktemp"]="mktemp" D_GIT_CLONE_PATH="/srv/diaspora" # path for diaspora @@ -54,7 +61,8 @@ D_DB_USER="diaspora" D_DB_PASS="diaspora" -D_RUBY_VERSION="1.9.3-p125" +# TODO: read this from ./script/env/ruby_env +D_RUBY_VERSION="1.9.3-p194" #### INTERNAL VARS #### @@ -70,7 +78,7 @@ JS_RUNTIME_DETECTED=false #... could be put in a separate file and sourced here # heredoc for variables - very readable, http://stackoverflow.com/a/8088167 -# use like this: +# use like this: # define VAR <<'EOF' # somecontent # EOF @@ -125,11 +133,11 @@ interactive_check() { # check if all necessary binaries are available binaries_check() { - for exe in $BINARIES; do + for exe in "${!BINARIES[@]}"; do echo -n "checking for $exe... " - which "$exe" + which "${BINARIES[$exe]}" if [ $? -ne 0 ]; then - error "you are missing $exe"; + error "you are missing the '${BINARIES[$exe]}' command, please install '$exe'"; fi done echo "" @@ -190,7 +198,7 @@ install_or_use_ruby() { # trust and load rvmrc # do this in a directory that has a .rvmrc, only :) load_rvmrc() { - if ! $RVM_DETECTED ; then + if ! $RVM_DETECTED || [[ ! -s ".rvmrc" ]] ; then return fi @@ -202,11 +210,11 @@ load_rvmrc() { # load .rvmrc echo -n "loading .rvmrc ... " - source .rvmrc + source ".rvmrc" #rvm rvmrc load if [ $? -eq 0 ] ; then echo "ok" - else + else echo "not ok" fi echo "" @@ -215,7 +223,7 @@ load_rvmrc() { # rvm doesn't need sudo, otherwise we do have to use it :( rvm_or_sudo() { if $RVM_DETECTED ; then - run_or_error "$1" + run_or_error "$1" else eval "$1" if [ $? -ne 0 ] ; then @@ -247,13 +255,13 @@ js_runtime_check() { fi # TheRubyRacer - gem which v8 >/dev/null 2>&1 + (echo "require 'v8'" | ruby) >/dev/null 2>&1 if [ $? -eq 0 ] ; then JS_RUNTIME_DETECTED=true fi ## - # add your favourite js runtime here... + # add a check for your favourite js runtime here... ## if $JS_RUNTIME_DETECTED ; then @@ -403,8 +411,8 @@ prepare_install_env database_setup -echo "copying application.yml.example to application.yml" -run_or_error "cp config/application.yml.example config/application.yml" +echo "copying diaspora.yml.example to diaspora.yml" +run_or_error "cp config/diaspora.yml.example config/diaspora.yml" echo "" @@ -413,10 +421,10 @@ prepare_gem_bundle echo "creating the default database specified in config/database.yml. please wait..." -run_or_error "bundle exec rake db:schema:load_if_ruby db:structure:load_if_sql --trace" +run_or_error "bundle exec rake db:schema:load_if_ruby --trace" echo "" -define GOODBYE_MSG <<'EOT' +define GOODBYE_MSG <&2 +if [ ! -e 'config/diaspora.yml' ]; then + echo 'FATAL: config/diaspora.yml is missing! Copy over config/diaspora.yml.example to config/diaspora.yml and edit it properly!' >&2 exit 70 fi @@ -91,19 +91,19 @@ if [ ! -e public/source.tar.gz ]; then fi -# Jammit notice if [ ! -e 'public/assets/default.css' ]; then if [ "$RAILS_ENV" == 'production' ]; then - echo "INFO: If you want further performance improvements," >&2 - echo "after each git pull before you restart the application, run:" >&2 + echo "FATAL: You're running in production mode without having assets precompiled." >&2 + echo "Now and after each git pull before you restart the application, run:" >&2 echo "bundle exec rake assets:precompile" >&2 + exit 71 fi fi # Start Diaspora -if [ "$(bundle exec ruby ./script/get_config.rb 'single_process_mode?')" != "true" ]; then +if [ "$(bundle exec ruby ./script/get_config.rb 'environment.single_process_mode?')" != "true" ]; then QUEUE=* bundle exec rake resque:work& fi diff --git a/spec/controllers/application_controller_spec.rb b/spec/controllers/application_controller_spec.rb index cad61acf6..39003b0ab 100644 --- a/spec/controllers/application_controller_spec.rb +++ b/spec/controllers/application_controller_spec.rb @@ -19,14 +19,20 @@ describe ApplicationController do end end - describe '#set_git_headers' do + describe '#set_diaspora_headers' do + it 'sets the version header' do + get :index + response.headers['X-Diaspora-Version'].should include AppConfig.version.number.get + end + context 'with git info' do before do - AppConfig[:git_update] = 'yesterday' - AppConfig[:git_revision] = '02395' + AppConfig.stub(:git_available?).and_return(true) + AppConfig.stub(:git_update).and_return('yesterday') + AppConfig.stub(:git_revision).and_return('02395') end - it 'sets the git header if there is git info' do + it 'sets the git header' do get :index response.headers['X-Git-Update'].should == 'yesterday' response.headers['X-Git-Revision'].should == '02395' diff --git a/spec/controllers/invitations_controller_spec.rb b/spec/controllers/invitations_controller_spec.rb index 300ab78af..413bbe822 100644 --- a/spec/controllers/invitations_controller_spec.rb +++ b/spec/controllers/invitations_controller_spec.rb @@ -7,7 +7,7 @@ require 'spec_helper' describe InvitationsController do before do - AppConfig[:open_invitations] = true + AppConfig.settings.invitations.open = true @user = alice @invite = {'email_inviter' => {'message' => "test", 'emails' => "abc@example.com"}} end @@ -27,12 +27,12 @@ describe InvitationsController do end it "redirects if invitations are closed" do - open_bit = AppConfig[:open_invitations] - AppConfig[:open_invitations] = false + open_bit = AppConfig.settings.invitations.open? + AppConfig.settings.invitations.open = false post :create, @invite response.should be_redirect - AppConfig[:open_invitations] = open_bit + AppConfig.settings.invitations.open = open_bit end it 'returns to the previous page on success' do diff --git a/spec/controllers/people_controller_spec.rb b/spec/controllers/people_controller_spec.rb index ecbe70e4f..5e85421a3 100644 --- a/spec/controllers/people_controller_spec.rb +++ b/spec/controllers/people_controller_spec.rb @@ -287,11 +287,12 @@ describe PeopleController do end end - it 'throws 404 if the person is remote' do + it 'forces to sign in if the person is remote' do p = FactoryGirl.create(:person) get :show, :id => p.to_param - response.status.should == 404 + response.should be_redirect + response.should redirect_to new_user_session_path end end diff --git a/spec/controllers/registrations_controller_spec.rb b/spec/controllers/registrations_controller_spec.rb index d809d3c58..524aef41e 100644 --- a/spec/controllers/registrations_controller_spec.rb +++ b/spec/controllers/registrations_controller_spec.rb @@ -21,11 +21,11 @@ describe RegistrationsController do describe '#check_registrations_open!' do before do - AppConfig[:registrations_closed] = true + AppConfig.settings.enable_registrations = false end after do - AppConfig[:registrations_closed] = false + AppConfig.settings.enable_registrations = true end it 'redirects #new to the login page' do @@ -57,7 +57,7 @@ describe RegistrationsController do describe "#create" do context "with valid parameters" do before do - AppConfig[:registrations_closed] = false + AppConfig.settings.enable_registrations = true end before do diff --git a/spec/controllers/streams_controller_spec.rb b/spec/controllers/streams_controller_spec.rb index 7b1cdef12..e6735f4a5 100644 --- a/spec/controllers/streams_controller_spec.rb +++ b/spec/controllers/streams_controller_spec.rb @@ -17,29 +17,13 @@ describe StreamsController do end it 'will redirect if not' do - AppConfig[:admins] = [] get :public response.should be_redirect end end describe '#multi' do - before do - @old_spotlight_value = AppConfig[:community_spotlight] - end - - after do - AppConfig[:community_spotlight] = @old_spotlight_value - end - it 'succeeds' do - AppConfig[:community_spotlight] = [bob.person.diaspora_handle] - get :multi - response.should be_success - end - - it 'succeeds without AppConfig[:community_spotlight]' do - AppConfig[:community_spotlight] = nil get :multi response.should be_success end diff --git a/spec/factories.rb b/spec/factories.rb index 9130f3259..d814ae7aa 100644 --- a/spec/factories.rb +++ b/spec/factories.rb @@ -28,7 +28,7 @@ FactoryGirl.define do factory :person do sequence(:diaspora_handle) { |n| "bob-person-#{n}#{r_str}@example.net" } - sequence(:url) { |n| AppConfig[:pod_url] } + url AppConfig.pod_uri.to_s serialized_public_key OpenSSL::PKey::RSA.generate(1024).public_key.export after(:build) do |person| person.profile = FactoryGirl.build(:profile, :person => person) unless person.profile.first_name.present? @@ -170,7 +170,7 @@ FactoryGirl.define do factory(:activity_streams_photo, :class => ActivityStreams::Photo) do association(:author, :factory => :person) - image_url "#{AppConfig[:pod_url]}/assets/asterisk.png" + image_url "#{AppConfig.environments.url}/assets/asterisk.png" image_height 154 image_width 154 object_url "http://example.com/awesome_things.gif" diff --git a/spec/fixtures/config/old_style_app.yml b/spec/fixtures/config/old_style_app.yml deleted file mode 100644 index f2ca7c172..000000000 --- a/spec/fixtures/config/old_style_app.yml +++ /dev/null @@ -1,108 +0,0 @@ -# Copyright (c) 2010-2011, Diaspora Inc. This file is -# licensed under the Affero General Public License version 3 or later. See -# the COPYRIGHT file. - -default: - - # Hostname of this host, as seen from the internet. - pod_url: "http://localhost:3000" - - # Set this to true in order to close signups. Users will still be - # able to invite other people to join. - registrations_closed: false - - # Enable extensive logging to log/{development,test,production}.log - debug: false - - # Diaspora is only tested against this default pubsub server. - pubsub_server: 'https://pubsubhubbub.appspot.com/' - - # Setting this to true enables diaspora's "send email" functionality - # requiring meaningful smtp_* settings. These are options for RoR's - # ActionMailer class. - mailer_on: false - - # This chooses which mailer should be used. 'smtp' for a smtp - # connection or 'sendmail' to use the sendmail binary. - mailer_method: 'smtp' - - # Address/port to smtp server handing outgoing mail. - smtp_address: 'smtp.example.com' - smtp_port: '587' - - # Domain administered of smtp server. - smtp_domain: 'example.com' - - # Sender address in diaspora's outgoing mail. - smtp_sender_address: 'no-reply@joindiaspora.com' - - # Authentication required to send mail. Use one of 'none','plain', - # 'login' or 'cram-md5'. Use 'none' if server does not support - # authentication - smtp_authentication: 'plain' - - # Automatically enable TLS? Ignored if smtp_authentication is set to none - smtp_starttls_auto: true - - # Credentails possibly required to log in to SMTP server if - # smtp_authentication != 'none' - smtp_username: 'smtp_username' - smtp_password: 'secret' - - # The path to the sendmail binary. - sendmail_location: '/usr/sbin/sendmail' - - #google analytics key, if false, it won't include the javascript - google_a_site: false - - #piwik integration if not set, no javascript included - piwik_id: - # the site url in raw format (e.g. pikwik.examplehost.com) - piwik_url: - - - #cloudfiles username and api-key, used for backups - cloudfiles_username: 'example' - cloudfiles_api_key: 'abc123' - invites_off: false - - #list of users who have admin privileges - admins: - - 'example_user1dsioaioedfhgoiesajdigtoearogjaidofgjo' - - #s3 config, if set, carrierwave will store your photos on s3 - #s3_key: 'key' - #s3_secret: 'secret' - #s3_bucket: 'my_photos' - s3_region: 'us-east-1' - - # If you want normal Rails logs, set this to false in the appropriate environment. - # It is false by default in development and test. - enable_splunk_logging: true - - # Process jobs in process? - single_process_mode: true - -# Use this sections to overide settings from default in the specific environments -development: - enable_splunk_logging: false - -production: - single_process_mode: false - -# Do not touch unless you know what you're doing -test: - pod_url: "http://example.org/" - enable_splunk_logging: false - - -# This section is special, you cannot overide settings from here in the above sections -script_server: - # Port on which thin should listen - thin_port: 3000 - - # customize thins startup - default_thin_args: "-p $THIN_PORT -e $RAILS_ENV" - - # Possibilties are development, production - rails_env: "development" diff --git a/spec/helper_methods.rb b/spec/helper_methods.rb index 471526452..494f15407 100644 --- a/spec/helper_methods.rb +++ b/spec/helper_methods.rb @@ -72,4 +72,11 @@ module HelperMethods Conversation.create!(create_hash) end + + def get_response_for_user_agent(app, userAgent) + env = Rack::MockRequest.env_for('/', "HTTP_USER_AGENT" => userAgent) + status, headers, body = app.call(env) + body.close if body.respond_to?(:close) # avoids deadlock after 3 tests + ActionDispatch::TestResponse.new(status, headers, body) + end end diff --git a/spec/helpers/application_helper_spec.rb b/spec/helpers/application_helper_spec.rb index 4697feea4..9980a48e6 100644 --- a/spec/helpers/application_helper_spec.rb +++ b/spec/helpers/application_helper_spec.rb @@ -30,13 +30,18 @@ describe ApplicationHelper do describe "#all_services_connected?" do before do - AppConfig[:configured_services] = [1, 2, 3] + @old_configured_services = AppConfig.configured_services + AppConfig.configured_services = [1, 2, 3] def current_user @current_user end @current_user = alice end + + after do + AppConfig.configured_services = @old_configured_services + end it 'returns true if all networks are connected' do 3.times { |t| @current_user.services << FactoryGirl.build(:service) } @@ -52,7 +57,7 @@ describe ApplicationHelper do describe "#jquery_include_tag" do describe "with google cdn" do before do - AppConfig[:jquery_cdn] = true + AppConfig.privacy.jquery_cdn = true end it 'inclues jquery.js from google cdn' do @@ -66,7 +71,7 @@ describe ApplicationHelper do describe "without google cdn" do before do - AppConfig[:jquery_cdn] = false + AppConfig.privacy.jquery_cdn = false end it 'includes jquery.js from asset pipeline' do @@ -89,11 +94,11 @@ describe ApplicationHelper do pod_name.should match /DIASPORA/i end - it 'displays the supplied AppConfig[:pod_name] if it is set' do - old_name = AppConfig[:pod_name] - AppConfig[:pod_name] = "Catspora" + it 'displays the supplied pod_name if it is set' do + old_name = AppConfig.settings.pod_name.get + AppConfig.settings.pod_name = "Catspora" pod_name.should == "Catspora" - AppConfig[:pod_name] = old_name + AppConfig.settings.pod_name = old_name end end end diff --git a/spec/helpers/people_helper_spec.rb b/spec/helpers/people_helper_spec.rb index 59a40f14b..98f461a8c 100644 --- a/spec/helpers/people_helper_spec.rb +++ b/spec/helpers/people_helper_spec.rb @@ -98,7 +98,7 @@ describe PeopleHelper do @user.username = "invalid.username" @user.save(:validate => false).should == true person = @user.person - person.diaspora_handle = "#{@user.username}@#{AppConfig[:pod_uri].authority}" + person.diaspora_handle = "#{@user.username}@#{AppConfig.pod_uri.authority}" person.save! local_or_remote_person_path(@user.person).should == person_path(@user.person) diff --git a/spec/javascripts/app/views/publisher_view_spec.js b/spec/javascripts/app/views/publisher_view_spec.js index c18408a9f..0e301847c 100644 --- a/spec/javascripts/app/views/publisher_view_spec.js +++ b/spec/javascripts/app/views/publisher_view_spec.js @@ -1,76 +1,268 @@ +/* Copyright (c) 2010-2012, Diaspora Inc. This file is + * licensed under the Affero General Public License version 3 or later. See + * the COPYRIGHT file. + */ + describe("app.views.Publisher", function() { - beforeEach(function() { - // should be jasmine helper - loginAs({name: "alice", avatar : {small : "http://avatar.com/photo.jpg"}}); - - spec.loadFixture("aspects_index"); - this.view = new app.views.Publisher(); - }); - - describe("#open", function() { - it("removes the 'closed' class from the publisher element", function() { - expect($(this.view.el)).toHaveClass("closed"); - this.view.open($.Event()); - expect($(this.view.el)).not.toHaveClass("closed"); - }); - }); - - describe("#close", function() { + describe("standalone", function() { beforeEach(function() { - this.view.open($.Event()); + // should be jasmine helper + loginAs({name: "alice", avatar : {small : "http://avatar.com/photo.jpg"}}); + + spec.loadFixture("aspects_index"); + this.view = new app.views.Publisher({ + standalone: true + }); }); - it("removes the 'active' class from the publisher element", function(){ - this.view.close($.Event()); - expect($(this.view.el)).toHaveClass("closed"); - }) - - it("resets the element's height", function() { - $(this.view.el).find("#status_message_fake_text").height(100); - this.view.close($.Event()); - expect($(this.view.el).find("#status_message_fake_text").attr("style")).not.toContain("height"); + it("hides the close button in standalone mode", function() { + expect(this.view.$('#hide_publisher').is(':visible')).toBeFalsy(); }); }); - describe("#clear", function() { - it("calls close", function(){ - spyOn(this.view, "close"); + context("plain publisher", function() { + beforeEach(function() { + // should be jasmine helper + loginAs({name: "alice", avatar : {small : "http://avatar.com/photo.jpg"}}); - this.view.clear($.Event()); - expect(this.view.close); - }) + spec.loadFixture("aspects_index"); + this.view = new app.views.Publisher(); + }); - it("clears all textareas", function(){ - _.each(this.view.$("textarea"), function(element){ - $(element).val('this is some stuff'); - expect($(element).val()).not.toBe(""); + describe("#open", function() { + it("removes the 'closed' class from the publisher element", function() { + expect($(this.view.el)).toHaveClass("closed"); + this.view.open($.Event()); + expect($(this.view.el)).not.toHaveClass("closed"); + }); + }); + + describe("#close", function() { + beforeEach(function() { + this.view.open($.Event()); }); - this.view.clear($.Event()); + it("removes the 'active' class from the publisher element", function(){ + this.view.close($.Event()); + expect($(this.view.el)).toHaveClass("closed"); + }) - _.each(this.view.$("textarea"), function(element){ - expect($(element).val()).toBe(""); + it("resets the element's height", function() { + $(this.view.el).find("#status_message_fake_text").height(100); + this.view.close($.Event()); + expect($(this.view.el).find("#status_message_fake_text").attr("style")).not.toContain("height"); }); - }) + }); - it("removes all photos from the dropzone area", function(){ - var self = this; - _.times(3, function(){ - self.view.$("#photodropzone").append($("
  • ")) + describe("#clear", function() { + it("calls close", function(){ + spyOn(this.view, "close"); + + this.view.clear($.Event()); + expect(this.view.close).toHaveBeenCalled(); + }) + + it("clears all textareas", function(){ + _.each(this.view.$("textarea"), function(element){ + $(element).val('this is some stuff'); + expect($(element).val()).not.toBe(""); + }); + + this.view.clear($.Event()); + + _.each(this.view.$("textarea"), function(element){ + expect($(element).val()).toBe(""); + }); + }) + + it("removes all photos from the dropzone area", function(){ + var self = this; + _.times(3, function(){ + self.view.el_photozone.append($("
  • ")) + }); + + expect(this.view.el_photozone.html()).not.toBe(""); + this.view.clear($.Event()); + expect(this.view.el_photozone.html()).toBe(""); + }) + + it("removes all photo values appended by the photo uploader", function(){ + $(this.view.el).prepend("") + var photoValuesInput = this.view.$("input[name='photos[]']"); + + photoValuesInput.val("3") + this.view.clear($.Event()); + expect(this.view.$("input[name='photos[]']").length).toBe(0); + }) + }); + }); + + context("#toggleService", function(){ + beforeEach( function(){ + spec.loadFixture('aspects_index_services'); + this.view = new app.views.Publisher(); + }); + + it("toggles the 'dim' class on a clicked item", function() { + var first = $(".service_icon").eq(0); + var second = $(".service_icon").eq(1); + + expect(first.hasClass('dim')).toBeTruthy(); + expect(second.hasClass('dim')).toBeTruthy(); + + first.trigger('click'); + + expect(first.hasClass('dim')).toBeFalsy(); + expect(second.hasClass('dim')).toBeTruthy(); + + first.trigger('click'); + + expect(first.hasClass('dim')).toBeTruthy(); + expect(second.hasClass('dim')).toBeTruthy(); + }); + + describe("#_createCounter", function() { + it("gets called in when you toggle service icons", function(){ + spyOn(this.view, '_createCounter'); + $(".service_icon").first().trigger('click'); + expect(this.view._createCounter).toHaveBeenCalled(); }); - expect(this.view.$("#photodropzone").html()).not.toBe(""); - this.view.clear($.Event()); - expect(this.view.$("#photodropzone").html()).toBe(""); - }) + it("removes the 'old' .counter span", function(){ + spyOn($.fn, "remove"); + $(".service_icon").first().trigger('click'); + expect($.fn.remove).toHaveBeenCalled(); + }); + }); - it("removes all photo values appended by the photo uploader", function(){ - $(this.view.el).prepend("") - var photoValuesInput = this.view.$("input[name='photos[]']"); + describe("#_toggleServiceField", function() { + it("gets called when you toggle service icons", function(){ + spyOn(this.view, '_toggleServiceField'); + $(".service_icon").first().trigger('click'); + expect(this.view._toggleServiceField).toHaveBeenCalled(); + }); - photoValuesInput.val("3") - this.view.clear($.Event()); - expect(this.view.$("input[name='photos[]']").length).toBe(0); - }) + it("toggles the hidden input field", function(){ + expect($('input[name="services[]"]').length).toBe(0); + $(".service_icon").first().trigger('click'); + expect($('input[name="services[]"]').length).toBe(1); + $(".service_icon").first().trigger('click'); + expect($('input[name="services[]"]').length).toBe(0); + }); + + it("toggles the correct input", function() { + var first = $(".service_icon").eq(0); + var second = $(".service_icon").eq(1); + + first.trigger('click'); + second.trigger('click'); + + expect($('input[name="services[]"]').length).toBe(2); + + first.trigger('click'); + + var prov1 = first.attr('id'); + var prov2 = second.attr('id'); + + expect($('input[name="services[]"][value="'+prov1+'"]').length).toBe(0); + expect($('input[name="services[]"][value="'+prov2+'"]').length).toBe(1); + }); + }); + }); + + context("aspect selection", function(){ + beforeEach( function(){ + spec.loadFixture('status_message_new'); + + this.radio_els = $('#publisher .dropdown li.radio'); + this.check_els = $('#publisher .dropdown li.aspect_selector'); + + this.view = new app.views.Publisher(); + this.view.open(); + }); + + it("initializes with 'all_aspects'", function(){ + expect(this.radio_els.first().hasClass('selected')).toBeFalsy(); + expect(this.radio_els.last().hasClass('selected')).toBeTruthy(); + + _.each(this.check_els, function(el){ + expect($(el).hasClass('selected')).toBeFalsy(); + }); + }); + + it("toggles the selected entry visually", function(){ + this.check_els.last().trigger('click'); + + _.each(this.radio_els, function(el){ + expect($(el).hasClass('selected')).toBeFalsy(); + }); + + expect(this.check_els.first().hasClass('selected')).toBeFalsy(); + expect(this.check_els.last().hasClass('selected')).toBeTruthy(); + }); + + describe("#_updateSelectedAspectIds", function(){ + beforeEach(function(){ + this.li = $('
  • '); + this.view.$('.dropdown_list').append(this.li); + }); + + it("gets called when aspects are selected", function(){ + spyOn(this.view, "_updateSelectedAspectIds"); + this.check_els.last().trigger('click'); + expect(this.view._updateSelectedAspectIds).toHaveBeenCalled(); + }); + + it("removes a previous selection and inserts the current one", function() { + var selected = this.view.$('input[name="aspect_ids[]"]'); + expect(selected.length).toBe(1); + expect(selected.first().val()).toBe('all_aspects'); + + this.li.trigger('click'); + + selected = this.view.$('input[name="aspect_ids[]"]'); + expect(selected.length).toBe(1); + expect(selected.first().val()).toBe('42'); + }); + + it("toggles the same item", function() { + expect(this.view.$('input[name="aspect_ids[]"]').length).toBe(1); + + this.li.trigger('click'); + expect(this.view.$('input[name="aspect_ids[]"]').length).toBe(1); + + this.li.trigger('click'); + expect(this.view.$('input[name="aspect_ids[]"]').length).toBe(0); + }); + + it("keeps other fields with different values", function() { + var li2 = $("
  • "); + this.view.$('.dropdown_list').append(li2); + + this.li.trigger('click'); + expect(this.view.$('input[name="aspect_ids[]"]').length).toBe(1); + + li2.trigger('click'); + expect(this.view.$('input[name="aspect_ids[]"]').length).toBe(2); + }); + }); + + describe("#_addHiddenAspectInput", function(){ + it("gets called when aspects are selected", function(){ + spyOn(this.view, "_addHiddenAspectInput"); + this.check_els.last().trigger('click'); + expect(this.view._addHiddenAspectInput).toHaveBeenCalled(); + }); + + it("adds a hidden input to the form", function(){ + var id = 42; + + this.view._addHiddenAspectInput(id); + var input = this.view.$('input[name="aspect_ids[]"][value="'+id+'"]'); + + expect(input.length).toBe(1); + expect(input.val()).toBe('42'); + }); + }); }); }); diff --git a/spec/javascripts/bookmarklet-spec.js b/spec/javascripts/bookmarklet-spec.js index c776b9e1a..fee57d0e7 100644 --- a/spec/javascripts/bookmarklet-spec.js +++ b/spec/javascripts/bookmarklet-spec.js @@ -11,11 +11,12 @@ describe("bookmarklet", function() { }); it('verifies the publisher is loaded', function(){ - expect(typeof Publisher === "object").toBeTruthy(); + expect(typeof app.publisher === "object").toBeTruthy(); }); it('verifies we are using the bookmarklet', function(){ - expect(Publisher.bookmarklet).toBeTruthy(); + expect(app.publisher.options.standalone).toBeTruthy(); + expect(app.publisher.$('#hide_publisher').is(':visible')).toBeFalsy(); }); }); diff --git a/spec/javascripts/publisher-spec.js b/spec/javascripts/publisher-spec.js deleted file mode 100644 index af84eeb39..000000000 --- a/spec/javascripts/publisher-spec.js +++ /dev/null @@ -1,177 +0,0 @@ -/* Copyright (c) 2010-2011, Diaspora Inc. This file is -* licensed under the Affero General Public License version 3 or later. See -* the COPYRIGHT file. -*/ - -describe("Publisher", function() { - - Publisher.open = function(){ this.form().removeClass("closed"); } - - describe("toggleCounter", function(){ - beforeEach( function(){ - spec.loadFixture('aspects_index_services'); - }); - - it("gets called in when you toggle service icons", function(){ - spyOn(Publisher, 'createCounter'); - Publisher.toggleServiceField($(".service_icon").first()); - expect(Publisher.createCounter).toHaveBeenCalled(); - }); - - it("removes the .counter span", function(){ - spyOn($.fn, "remove"); - Publisher.createCounter($(".service_icon").first()); - expect($.fn.remove).toHaveBeenCalled(); - }); - }); - - describe("bindAspectToggles", function() { - beforeEach( function(){ - spec.loadFixture('status_message_new'); - Publisher.open(); - }); - - it('gets called on initialize', function(){ - spyOn(Publisher, 'bindAspectToggles'); - Publisher.initialize(); - expect(Publisher.bindAspectToggles).toHaveBeenCalled(); - }); - - it('correctly initializes an all_aspects state', function(){ - Publisher.initialize(); - - expect($("#publisher .dropdown .dropdown_list li.radio").first().hasClass("selected")).toBeFalsy(); - expect($("#publisher .dropdown .dropdown_list li.radio").last().hasClass("selected")).toBeTruthy(); - - $.each($("#publihser .dropdown .dropdown_list li.aspect_selector"), function(index, element){ - expect($(element).hasClass("selected")).toBeFalsy(); - }); - }); - - it('toggles selected only on the clicked icon', function(){ - Publisher.initialize(); - - $("#publisher .dropdown .dropdown_list li.aspect_selector").last().click(); - - $.each($("#publisher .dropdown .dropdown_list li.radio"), function(index, element){ - expect($(element).hasClass("selected")).toBeFalsy(); - }); - - expect($("#publisher .dropdown .dropdown_list li.aspect_selector").first().hasClass("selected")).toBeFalsy(); - expect($("#publisher .dropdown .dropdown_list li.aspect_selector").last().hasClass("selected")).toBeTruthy(); - }); - - it('calls toggleAspectIds with the clicked element', function(){ - spyOn(Publisher, 'toggleAspectIds'); - Publisher.bindAspectToggles(); - var aspectBadge = $("#publisher .dropdown .dropdown_list li").last(); - aspectBadge.click(); - expect(Publisher.toggleAspectIds.mostRecentCall.args[0].get(0)).toEqual(aspectBadge.get(0)); - }); - }); - - describe('toggleAspectIds', function(){ - beforeEach( function(){ - spec.loadFixture('status_message_new'); - li = $("
  • "); - }); - - it('adds a hidden field to the form if there is not one already', function(){ - expect($('#publisher [name="aspect_ids[]"]').length).toBe(1); - expect($('#publisher [name="aspect_ids[]"]').last().attr('value')).toBe('all_aspects'); - Publisher.toggleAspectIds(li); - expect($('#publisher [name="aspect_ids[]"]').length).toBe(1); - expect($('#publisher [name="aspect_ids[]"]').last().attr('value')).toBe('42'); - }); - - it('removes the hidden field if its already there', function() { - expect($('#publisher [name="aspect_ids[]"]').length).toBe(1); - - Publisher.toggleAspectIds(li); - expect($('#publisher [name="aspect_ids[]"]').length).toBe(1); - - Publisher.toggleAspectIds(li); - expect($('#publisher [name="aspect_ids[]"]').length).toBe(0); - }); - - it('does not remove a hidden field with a different value', function() { - var li2 = $("
  • "); - - Publisher.toggleAspectIds(li); - expect($('#publisher [name="aspect_ids[]"]').length).toBe(1); - - Publisher.toggleAspectIds(li2); - expect($('#publisher [name="aspect_ids[]"]').length).toBe(2); - }); - }); - - describe("bindServiceIcons", function() { - beforeEach( function(){ - spec.loadFixture('aspects_index_services'); - }); - - it('gets called on initialize', function(){ - spyOn(Publisher, 'bindServiceIcons'); - Publisher.initialize(); - expect(Publisher.bindServiceIcons).toHaveBeenCalled(); - }); - - it('toggles dim only on the clicked icon', function(){ - expect($(".service_icon#facebook").hasClass("dim")).toBeTruthy(); - expect($(".service_icon#twitter").hasClass("dim")).toBeTruthy(); - - Publisher.bindServiceIcons(); - $(".service_icon#facebook").click(); - - expect($(".service_icon#facebook").hasClass("dim")).toBeFalsy(); - expect($(".service_icon#twitter").hasClass("dim")).toBeTruthy(); - }); - - it('binds to the services icons and toggles the hidden field', function(){ - spyOn(Publisher, 'toggleServiceField'); - Publisher.bindServiceIcons(); - $(".service_icon#facebook").click(); - - expect(Publisher.toggleServiceField).toHaveBeenCalled(); - }); - }); - - describe('toggleServiceField', function(){ - beforeEach( function(){ - spec.loadFixture('aspects_index_services'); - }); - - it('adds a hidden field to the form if there is not one already', function(){ - expect($('#publisher [name="services[]"]').length).toBe(0); - Publisher.toggleServiceField($(".service_icon#facebook").first()); - expect($('#publisher [name="services[]"]').length).toBe(1); - expect($('#publisher [name="services[]"]').attr('value')).toBe("facebook"); - }); - - it('removes the hidden field if its already there', function() { - Publisher.toggleServiceField($(".service_icon#facebook").first()); - expect($('#publisher [name="services[]"]').length).toBe(1); - - Publisher.toggleServiceField($(".service_icon#facebook").first()); - expect($('#publisher [name="services[]"]').length).toBe(0); - }); - - it('does not remove a hidden field with a different value', function() { - Publisher.toggleServiceField($(".service_icon#facebook").first()); - expect($('#publisher [name="services[]"]').length).toBe(1); - - Publisher.toggleServiceField($(".service_icon#twitter").first()); - expect($('#publisher [name="services[]"]').length).toBe(2); - }); - }); - - describe("input", function(){ - beforeEach(function(){ - spec.loadFixture('aspects_index_prefill'); - }); - it("returns the status_message_fake_text textarea", function(){ - expect(Publisher.input()[0].id).toBe('status_message_fake_text'); - expect(Publisher.input().length).toBe(1); - }); - }); -}); diff --git a/spec/lib/configuration/lookup_chain_spec.rb b/spec/lib/configuration/lookup_chain_spec.rb new file mode 100644 index 000000000..272106dc3 --- /dev/null +++ b/spec/lib/configuration/lookup_chain_spec.rb @@ -0,0 +1,67 @@ +require 'spec_helper' + +class InvalidConfigurationProvider; end +class ValidConfigurationProvider + def lookup(setting, *args); end +end + +describe Configuration::LookupChain do + subject { described_class.new } + + describe "#add_provider" do + it "adds a valid provider" do + expect { + subject.add_provider ValidConfigurationProvider + }.to change { subject.instance_variable_get(:@provider).size }.by 1 + end + + it "doesn't add an invalid provider" do + expect { + subject.add_provider InvalidConfigurationProvider + }.to raise_error ArgumentError + end + + it "passes extra args to the provider" do + ValidConfigurationProvider.should_receive(:new).with(:extra) + subject.add_provider ValidConfigurationProvider, :extra + end + end + + describe "#lookup" do + before(:all) do + subject.add_provider ValidConfigurationProvider + subject.add_provider ValidConfigurationProvider + @provider = subject.instance_variable_get(:@provider) + end + + it "it tries all providers" do + setting = "some.setting" + @provider.each do |provider| + provider.should_receive(:lookup).with(setting).and_raise(Configuration::SettingNotFoundError) + end + + subject.lookup(setting) + end + + it "stops if a value is found" do + @provider[0].should_receive(:lookup).and_return("something") + @provider[1].should_not_receive(:lookup) + subject.lookup("bla") + end + + it "converts numbers to strings" do + @provider[0].stub(:lookup).and_return(5) + subject.lookup("foo").should == "5" + end + + it "does not convert false to a string" do + @provider[0].stub(:lookup).and_return(false) + subject.lookup("enable").should be_false + end + + it "returns nil if no value is found" do + @provider.each { |p| p.stub(:lookup).and_raise(Configuration::SettingNotFoundError) } + subject.lookup("not.me").should be_nil + end + end +end diff --git a/spec/lib/configuration/methods_spec.rb b/spec/lib/configuration/methods_spec.rb new file mode 100644 index 000000000..1ec0b7520 --- /dev/null +++ b/spec/lib/configuration/methods_spec.rb @@ -0,0 +1,166 @@ +require 'spec_helper' + +describe Configuration::Methods do + before(:all) do + @settings = Configuration::Settings.create do + add_provider Configuration::Provider::Dynamic + add_provider Configuration::Provider::Env + extend Configuration::Methods + end + end + + describe "#pod_uri" do + before do + @settings.environment.url = nil + @settings.instance_variable_set(:@pod_uri, nil) + end + + it "properly parses the pod url" do + @settings.environment.url = "http://example.org/" + @settings.pod_uri.scheme.should == "http" + @settings.pod_uri.host.should == "example.org" + end + + it "adds a trailing slash if there isn't one" do + @settings.environment.url = "http://example.org" + @settings.pod_uri.to_s.should == "http://example.org/" + end + + it "does not add an extra trailing slash" do + @settings.environment.url = "http://example.org/" + @settings.pod_uri.to_s.should == "http://example.org/" + end + + it "adds http:// on the front if it's missing" do + @settings.environment.url = "example.org/" + @settings.pod_uri.to_s.should == "http://example.org/" + end + + it "does not add a prefix if there already is https:// on the front" do + @settings.environment.url = "https://example.org/" + @settings.pod_uri.to_s.should == "https://example.org/" + end + end + + describe "#bare_pod_uri" do + it 'is #pod_uri.authority stripping www.' do + pod_uri = mock + @settings.stub(:pod_uri).and_return(pod_uri) + pod_uri.should_receive(:authority).and_return("www.example.org") + @settings.bare_pod_uri.should == 'example.org' + end + end + + describe "#configured_services" do + it "includes the enabled services only" do + services = mock + enabled = mock + enabled.stub(:enable?).and_return(true) + disabled = mock + disabled.stub(:enable?).and_return(false) + services.stub(:twitter).and_return(enabled) + services.stub(:tumblr).and_return(enabled) + services.stub(:facebook).and_return(disabled) + @settings.stub(:services).and_return(services) + @settings.configured_services.should include :twitter + @settings.configured_services.should include :tumblr + @settings.configured_services.should_not include :facebook + end + end + + describe "#version_string" do + before do + @version = mock + @version.stub(:number).and_return("0.0.0.0") + @version.stub(:release?).and_return(true) + @settings.stub(:version).and_return(@version) + @settings.stub(:git_available?).and_return(false) + @settings.instance_variable_set(:@version_string, nil) + end + + it "includes the version" do + @settings.version_string.should include @version.number + end + + context "on a non release" do + before do + @version.stub(:release?).and_return(false) + end + + it "includes pre" do + @settings.version_string.should include "pre" + end + end + + context "with git available" do + before do + @settings.stub(:git_available?).and_return(true) + @settings.stub(:git_revision).and_return("1234567890") + end + + it "includes the 'patchlevel'" do + @settings.version_string.should include "-p#{@settings.git_revision[0..7]}" + @settings.version_string.should_not include @settings.git_revision[0..8] + end + end + end + + describe "#get_redis_instance" do + context "with REDISTOGO_URL set" do + before do + ENV["REDISTOGO_URL"] = "redis://myserver" + end + + it "uses that" do + @settings.get_redis_instance.client.host.should == "myserver" + end + end + + context "with REDIS_URL set" do + before do + ENV["REDISTOGO_URL"] = nil + ENV["REDIS_URL"] = "redis://yourserver" + end + + it "uses that" do + @settings.get_redis_instance.client.host.should == "yourserver" + end + end + + context "with redis set" do + before do + ENV["REDISTOGO_URL"] = nil + ENV["REDIS_URL"] = nil + @settings.environment.redis = "redis://ourserver" + end + + it "uses that" do + @settings.get_redis_instance.client.host.should == "ourserver" + end + end + + context "with nothing set" do + before do + @settings.environment.redis = nil + ENV["REDISTOGO_URL"] = nil + ENV["REDIS_URL"] = nil + end + + it "uses localhost" do + @settings.get_redis_instance.client.host.should == "127.0.0.1" + end + end + + context "with a unix socket set" do + before do + ENV["REDISTOGO_URL"] = nil + ENV["REDIS_URL"] = nil + @settings.environment.redis = "unix:///tmp/redis.sock" + end + + it "uses that" do + @settings.get_redis_instance.client.path.should == "/tmp/redis.sock" + end + end + end +end diff --git a/spec/lib/configuration/provider/dynamic_spec.rb b/spec/lib/configuration/provider/dynamic_spec.rb new file mode 100644 index 000000000..937dd00e2 --- /dev/null +++ b/spec/lib/configuration/provider/dynamic_spec.rb @@ -0,0 +1,23 @@ +require 'spec_helper' + +describe Configuration::Provider::Dynamic do + subject { described_class.new } + describe "#lookup_path" do + it "returns nil if the setting was never set" do + subject.lookup_path(["not_me"]).should be_nil + end + + it "remembers the setting if it ends with =" do + subject.lookup_path(["find_me", "later="], "there") + subject.lookup_path(["find_me", "later"]).should == "there" + end + + it "calls .get on the argument if a proxy object is given" do + proxy = mock + proxy.stub(:respond_to?).and_return(true) + proxy.stub(:_proxy?).and_return(true) + proxy.should_receive(:get) + subject.lookup_path(["bla="], proxy) + end + end +end diff --git a/spec/lib/configuration/provider/env_spec.rb b/spec/lib/configuration/provider/env_spec.rb new file mode 100644 index 000000000..0bc5eaa56 --- /dev/null +++ b/spec/lib/configuration/provider/env_spec.rb @@ -0,0 +1,32 @@ +require 'spec_helper' + +describe Configuration::Provider::Env do + subject { described_class.new } + let(:existing_path) { ['existing', 'setting']} + let(:not_existing_path) { ['not', 'existing', 'path']} + let(:array_path) { ['array'] } + before(:all) do + ENV['EXISTING_SETTING'] = "there" + ENV['ARRAY'] = "foo,bar,baz" + end + + after(:all) do + ENV['EXISTING_SETTING'] = nil + ENV['ARRAY'] = nil + end + + describe '#lookup_path' do + it "joins and upcases the path" do + ENV.should_receive(:[]).with("EXISTING_SETTING") + subject.lookup_path(existing_path) + end + + it "returns nil if the setting isn't available" do + subject.lookup_path(not_existing_path).should be_nil + end + + it "makes an array out of comma separated values" do + subject.lookup_path(array_path).should == ["foo", "bar", "baz"] + end + end +end diff --git a/spec/lib/configuration/provider/yaml_spec.rb b/spec/lib/configuration/provider/yaml_spec.rb new file mode 100644 index 000000000..ea4da964d --- /dev/null +++ b/spec/lib/configuration/provider/yaml_spec.rb @@ -0,0 +1,72 @@ +require 'spec_helper' + +describe Configuration::Provider::YAML do + let(:settings) { {"toplevel" => "bar", + "some" => { + "nested" => { "some" => "lala", "setting" => "foo"} + } + } } + + describe "#initialize" do + it "loads the file" do + file = "foobar.yml" + ::YAML.should_receive(:load_file).with(file).and_return({}) + described_class.new file + end + + it "raises if the file is not found" do + ::YAML.stub(:load_file).and_raise(Errno::ENOENT) + expect { + described_class.new "foo" + }.to raise_error Errno::ENOENT + end + + + context "with a namespace" do + it "looks in the file for that namespace" do + namespace = "some" + ::YAML.stub(:load_file).and_return(settings) + provider = described_class.new 'bla', namespace: namespace + provider.instance_variable_get(:@settings).should == settings[namespace] + end + + it "raises if the namespace isn't found" do + ::YAML.stub(:load_file).and_return({}) + expect { + described_class.new 'bla', namespace: "foo" + }.to raise_error ArgumentError + end + end + + context "with required set to false" do + it "doesn't raise if a file isn't found" do + ::YAML.stub(:load_file).and_raise(Errno::ENOENT) + expect { + described_class.new "not_me", required: false + }.not_to raise_error Errno::ENOENT + end + + it "doesn't raise if a namespace isn't found" do + ::YAML.stub(:load_file).and_return({}) + expect { + described_class.new 'bla', namespace: "foo", required: false + }.not_to raise_error ArgumentError + end + end + end + + describe "#lookup_path" do + before do + ::YAML.stub(:load_file).and_return(settings) + @provider = described_class.new 'dummy' + end + + it "looks up the whole nesting" do + @provider.lookup_path(["some", "nested", "some"]).should == settings["some"]["nested"]["some"] + end + + it "returns nil if no setting is found" do + @provider.lookup_path(["not_me"]).should be_nil + end + end +end diff --git a/spec/lib/configuration/provider_spec.rb b/spec/lib/configuration/provider_spec.rb new file mode 100644 index 000000000..12cba2491 --- /dev/null +++ b/spec/lib/configuration/provider_spec.rb @@ -0,0 +1,18 @@ +require 'spec_helper' + +describe Configuration::Provider::Base do + subject { described_class.new } + describe "#lookup" do + it "calls #lookup_path with the setting as array" do + subject.should_receive(:lookup_path).with(["foo", "bar"]).and_return("something") + subject.lookup("foo.bar").should == "something" + end + + it "raises SettingNotFoundError if the #lookup_path returns nil" do + subject.should_receive(:lookup_path).and_return(nil) + expect { + subject.lookup("bla") + }.to raise_error Configuration::SettingNotFoundError + end + end +end diff --git a/spec/lib/configuration/proxy_spec.rb b/spec/lib/configuration/proxy_spec.rb new file mode 100644 index 000000000..950112d2f --- /dev/null +++ b/spec/lib/configuration/proxy_spec.rb @@ -0,0 +1,56 @@ +require 'spec_helper' + +describe Configuration::Proxy do + let(:lookup_chain) { mock } + before do + lookup_chain.stub(:lookup).and_return("something") + end + + describe "#method_missing" do + it "calls #get if the method ends with a ?" do + lookup_chain.should_receive(:lookup).with("enable").and_return(false) + described_class.new(lookup_chain).method_missing(:enable?) + end + + it "calls #get if the method ends with a =" do + lookup_chain.should_receive(:lookup).with("url=").and_return(false) + described_class.new(lookup_chain).method_missing(:url=) + end + end + + describe "#get" do + [:to_str, :to_s, :to_xml, :respond_to?, :present?, :!=, + :each, :try, :size, :length, :count, :==, :=~, :gsub, :blank?, :chop, + :start_with?, :end_with?].each do |method| + it "is called for accessing #{method} on the proxy" do + target = mock + lookup_chain.should_receive(:lookup).and_return(target) + target.should_receive(method).and_return("something") + described_class.new(lookup_chain).something.__send__(method, mock) + end + end + + described_class::COMMON_KEY_NAMES.each do |method| + it "is not called for accessing #{method} on the proxy" do + target = mock + lookup_chain.should_not_receive(:lookup).and_return(target) + target.should_not_receive(method).and_return("something") + described_class.new(lookup_chain).something.__send__(method, mock) + end + end + + it "strips leading dots" do + lookup_chain.should_receive(:lookup).with("foo.bar").and_return("something") + described_class.new(lookup_chain).foo.bar.get + end + + it "returns nil if no setting is given" do + described_class.new(lookup_chain).get.should be_nil + end + + it "strips ? at the end" do + lookup_chain.should_receive(:lookup).with("foo.bar").and_return("something") + described_class.new(lookup_chain).foo.bar? + end + end +end diff --git a/spec/lib/configuration_spec.rb b/spec/lib/configuration_spec.rb new file mode 100644 index 000000000..f75619541 --- /dev/null +++ b/spec/lib/configuration_spec.rb @@ -0,0 +1,25 @@ +require 'spec_helper' + +describe Configuration::Settings do + describe "#method_missing" do + subject { described_class.create } + + it "delegates the call to a new proxy object" do + proxy = mock + Configuration::Proxy.should_receive(:new).and_return(proxy) + proxy.should_receive(:method_missing).with(:some_setting).and_return("foo") + subject.some_setting + end + end + + [:lookup, :add_provider, :[]].each do |method| + describe "#{method}" do + subject { described_class.create } + + it "delegates the call to #lookup_chain" do + subject.lookup_chain.should_receive(method) + subject.send(method) + end + end + end +end diff --git a/spec/lib/rack/chrome_frame_spec.rb b/spec/lib/rack/chrome_frame_spec.rb new file mode 100644 index 000000000..12643a95c --- /dev/null +++ b/spec/lib/rack/chrome_frame_spec.rb @@ -0,0 +1,47 @@ +# Copyright (c) 2010-2011, Diaspora Inc. This file is +# licensed under the Affero General Public License version 3 or later. See +# the COPYRIGHT file. +require 'spec_helper' + +describe Rack::ChromeFrame do + + before :all do + @app = Rack::Builder.parse_file(Rails.root.join('config.ru').to_s).first + end + + before :each do + @response = get_response_for_user_agent(@app, ua_string); + end + + subject { @response } + + context "non-IE browser" do + let(:ua_string) { "another browser chromeframe" } + + its(:body) { should_not =~ /chrome=1/ } + its(:body) { should_not =~ /Diaspora doesn't support your version of Internet Explorer/ } + end + + context "IE8 without chromeframe" do + let(:ua_string) { "MSIE 8" } + + its(:body) { should_not =~ /chrome=1/ } + its(:body) { should_not =~ /Diaspora doesn't support your version of Internet Explorer/ } + end + + context "IE7 without chromeframe" do + let(:ua_string) { "MSIE 7" } + + its(:body) { should_not =~ /chrome=1/ } + its(:body) { should =~ /Diaspora doesn't support your version of Internet Explorer/ } + specify {@response.headers["Content-Length"].should == @response.body.length.to_s} + end + + context "any IE with chromeframe" do + let(:ua_string) { "MSIE number chromeframe" } + + its(:body) { should =~ /chrome=1/ } + its(:body) { should_not =~ /Diaspora doesn't support your version of Internet Explorer/ } + specify {@response.headers["Content-Length"].should == @response.body.length.to_s} + end +end diff --git a/spec/lib/rake_helper_spec.rb b/spec/lib/rake_helper_spec.rb index 430fe17ef..77fd6e198 100644 --- a/spec/lib/rake_helper_spec.rb +++ b/spec/lib/rake_helper_spec.rb @@ -12,12 +12,12 @@ describe RakeHelpers do describe '#process_emails' do before do Devise.mailer.deliveries = [] - @old_admin = AppConfig[:admin_account] - AppConfig[:admin_account] = FactoryGirl.create(:user).username + @old_admin = AppConfig.admins.account.get + AppConfig.admins.account = FactoryGirl.create(:user).username end after do - AppConfig[:admin_account] = @old_admin + AppConfig.admins.account = @old_admin end it 'should send emails to each email' do diff --git a/spec/lib/webfinger_spec.rb b/spec/lib/webfinger_spec.rb index b8a7dfe89..34cac08f9 100644 --- a/spec/lib/webfinger_spec.rb +++ b/spec/lib/webfinger_spec.rb @@ -11,7 +11,7 @@ describe Webfinger do let(:account){'foo@bar.com'} let(:account_in_fixtures){"alice@localhost:9887"} let(:finger){Webfinger.new(account)} - let(:host_meta_url){"http://#{AppConfig[:pod_uri].authority}/webfinger?q="} + let(:host_meta_url){"http://#{AppConfig.pod_uri.authority}/webfinger?q="} describe '#intialize' do it 'sets account ' do diff --git a/spec/mailers/notifier_spec.rb b/spec/mailers/notifier_spec.rb index 98da0cc6d..fab09a643 100644 --- a/spec/mailers/notifier_spec.rb +++ b/spec/mailers/notifier_spec.rb @@ -190,7 +190,7 @@ describe Notifier do end it "FROM: contains the sender's name" do - @mail["From"].to_s.should == "\"#{@cnv.author.name} (Diaspora*)\" <#{AppConfig[:smtp_sender_address]}>" + @mail["From"].to_s.should == "\"#{@cnv.author.name} (Diaspora*)\" <#{AppConfig.mail.sender_address}>" end it 'SUBJECT: has a snippet of the post contents' do @@ -225,7 +225,7 @@ describe Notifier do end it "FROM: contains the sender's name" do - comment_mail["From"].to_s.should == "\"#{eve.name} (Diaspora*)\" <#{AppConfig[:smtp_sender_address]}>" + comment_mail["From"].to_s.should == "\"#{eve.name} (Diaspora*)\" <#{AppConfig.mail.sender_address}>" end it 'SUBJECT: has a snippet of the post contents' do @@ -266,7 +266,7 @@ describe Notifier do end it 'FROM: has the name of person commenting as the sender' do - comment_mail["From"].to_s.should == "\"#{eve.name} (Diaspora*)\" <#{AppConfig[:smtp_sender_address]}>" + comment_mail["From"].to_s.should == "\"#{eve.name} (Diaspora*)\" <#{AppConfig.mail.sender_address}>" end it 'SUBJECT: has a snippet of the post contents' do diff --git a/spec/models/app_config_spec.rb b/spec/models/app_config_spec.rb deleted file mode 100644 index 792fd84cb..000000000 --- a/spec/models/app_config_spec.rb +++ /dev/null @@ -1,257 +0,0 @@ -# Copyright (c) 2010-2011, Diaspora Inc. This file is -# licensed under the Affero General Public License version 3 or later. See -# the COPYRIGHT file. - -require 'spec_helper' - -describe AppConfig do - - after do - AppConfig.reload! - AppConfig.setup! - end - - describe ".load!" do - context "error conditions" do - before do - @original_stderr = $stderr - $stderr = StringIO.new - end - after do - $stderr = @original_stderr - end - - context "with old-style application.yml" do - before do - @original_source = AppConfig.source - AppConfig.source(Rails.root.join("spec", "fixtures", "config", "old_style_app.yml")) - end - after do - AppConfig.source(@original_source) - end - it "prints an error message and exits" do - expect { - AppConfig.load! - }.to raise_error SystemExit - - $stderr.rewind - $stderr.string.chomp.should_not be_blank - end - end - - context "when source config file (i.e. config/application.yml) does not exist" do - before do - application_yml = AppConfig.source_file_name - @app_yml = Rails.root.join("config", "app.yml") - @app_config_yml = Rails.root.join("config", "app_config.yml") - File.should_receive(:exists?).with(application_yml).at_least(:once).and_return(false) - end - after do - File.instance_eval { alias :exists? :obfuscated_by_rspec_mocks__exists? } # unmock exists? so that the AppConfig.reload! in the top-level after block can run - AppConfig.source(AppConfig.source_file_name) - end - context "and there are no old-style config files around" do - it "prints an error message with instructions for setting up application.yml and exits" do - File.should_receive(:exists?).with(@app_yml).at_least(:once).and_return(false) - File.should_receive(:exists?).with(@app_config_yml).at_least(:once).and_return(false) - - expect { - AppConfig.load! - }.to raise_error SystemExit - - $stderr.rewind - $stderr.string.should include("haven't set up") - end - end - context "and there is an old-style app.yml" do - it "prints an error message with instructions for converting an old-style file and exits" do - File.should_receive(:exists?).with(@app_yml).at_least(:once).and_return(true) - - expect { - AppConfig.load! - }.to raise_error SystemExit - - $stderr.rewind - $stderr.string.should include("file format has changed") - end - end - context "and there is an old-style app_config.yml" do - it "prints an error message with instructions for converting an old-style file and exits" do - File.should_receive(:exists?).with(@app_yml).at_least(:once).and_return(false) - File.should_receive(:exists?).with(@app_config_yml).at_least(:once).and_return(true) - - expect { - AppConfig.load! - }.to raise_error SystemExit - - $stderr.rewind - $stderr.string.should include("file format has changed") - end - end - end - end - end - - describe '.setup!' do - it "calls normalize_pod_url" do - AppConfig.should_receive(:normalize_pod_url).twice - AppConfig.setup! - end - it "calls normalize_admins" do - AppConfig.should_receive(:normalize_admins).twice - AppConfig.setup! - end - end - - describe ".normalize_admins" do - it "downcases the user names that are set as admins" do - AppConfig[:admins] = ["UPPERCASE", "MiXeDCaSe", "lowercase"] - AppConfig.normalize_admins - AppConfig[:admins].should == ["uppercase", "mixedcase", "lowercase"] - end - it "sets admins to an empty array if no admins were specified" do - AppConfig[:admins] = nil - AppConfig.normalize_admins - AppConfig[:admins].should == [] - end - end - - describe ".normalize_pod_url" do - it "adds a trailing slash if there isn't one" do - AppConfig[:pod_url] = "http://example.org" - AppConfig.normalize_pod_url - AppConfig[:pod_url].should == "http://example.org/" - end - it "does not add an extra trailing slash" do - AppConfig[:pod_url] = "http://example.org/" - AppConfig.normalize_pod_url - AppConfig[:pod_url].should == "http://example.org/" - end - it "adds http:// on the front if it's missing" do - AppConfig[:pod_url] = "example.org/" - AppConfig.normalize_pod_url - AppConfig[:pod_url].should == "http://example.org/" - end - it "does not add a prefix if there already is http:// on the front" do - AppConfig[:pod_url] = "http://example.org/" - AppConfig.normalize_pod_url - AppConfig[:pod_url].should == "http://example.org/" - end - it "does not add a prefix if there already is https:// on the front" do - AppConfig[:pod_url] = "https://example.org/" - AppConfig.normalize_pod_url - AppConfig[:pod_url].should == "https://example.org/" - end - - end - - describe '.bare_pod_uri' do - it 'is AppConfig[:pod_uri].authority stripping www.' do - AppConfig[:pod_url] = "https://www.example.org/" - AppConfig.bare_pod_uri.should == 'example.org' - end - end - - describe ".pod_uri" do - it "properly parses the pod_url" do - AppConfig.pod_uri = nil - AppConfig[:pod_url] = "http://example.org" - pod_uri = AppConfig[:pod_uri] - pod_uri.scheme.should == "http" - pod_uri.host.should == "example.org" - end - end - - describe '.normalize_services' do - before do - @services = SERVICES - Object.send(:remove_const, :SERVICES) - end - - after do - SERVICES = @services - end - - it 'sets configured_services to an empty array if SERVICES is not defined' do - AppConfig.normalize_pod_services - AppConfig.configured_services.should == [] - end - end - - describe ".get_redis_instance" do - context "with REDISTOGO_URL set" do - before do - ENV["REDISTOGO_URL"] = "redis://myserver" - end - - after do - ENV["REDISTOGO_URL"] = nil - end - - it "uses that" do - AppConfig.get_redis_instance.client.host.should == "myserver" - end - end - - context "with REDIS_URL set" do - before do - ENV["REDIS_URL"] = "redis://yourserver" - end - - after do - ENV["REDIS_URL"] = nil - end - - it "uses that" do - AppConfig.get_redis_instance.client.host.should == "yourserver" - end - end - - context "with redis_url set" do - before do - AppConfig[:redis_url] = "redis://ourserver" - end - - after do - AppConfig[:redis_url] = "" - end - - it "uses that" do - AppConfig.get_redis_instance.client.host.should == "ourserver" - end - end - - context "with nothing set" do - it "uses localhost" do - AppConfig.get_redis_instance.client.host.should == "127.0.0.1" - end - end - end - - describe ".[]=" do - describe "when setting pod_url" do - context "with a symbol" do - it "clears the cached pod_uri" do - AppConfig[:pod_uri].host.should_not == "joindiaspora.com" - AppConfig[:pod_url] = "http://joindiaspora.com" - AppConfig[:pod_uri].host.should == "joindiaspora.com" - end - it "calls normalize_pod_url" do - AppConfig.should_receive(:normalize_pod_url).twice - AppConfig[:pod_url] = "http://joindiaspora.com" - end - end - context "with a string" do - it "clears the cached pod_uri" do - AppConfig[:pod_uri].host.should_not == "joindiaspora.com" - AppConfig['pod_url'] = "http://joindiaspora.com" - AppConfig[:pod_uri].host.should == "joindiaspora.com" - end - it "calls normalize_pod_url" do - AppConfig.should_receive(:normalize_pod_url).twice - AppConfig['pod_url'] = "http://joindiaspora.com" - end - end - end - end -end diff --git a/spec/models/invitation_code_spec.rb b/spec/models/invitation_code_spec.rb index 1466189b1..9596952dd 100644 --- a/spec/models/invitation_code_spec.rb +++ b/spec/models/invitation_code_spec.rb @@ -22,12 +22,12 @@ describe InvitationCode do describe '.default_inviter_or' do before do - @old_account = AppConfig[:admin_account] - AppConfig[:admin_account] = 'bob' + @old_account = AppConfig.admins.account.get + AppConfig.admins.account = 'bob' end after do - AppConfig[:admin_account] = @old_account + AppConfig.admins.account = @old_account end it 'grabs the set admin account for the pod...' do @@ -35,7 +35,7 @@ describe InvitationCode do end it '..or the given user' do - AppConfig[:admin_account] = '' + AppConfig.admins.account = '' InvitationCode.default_inviter_or(alice).username.should == 'alice' end end diff --git a/spec/models/jobs/publish_to_hub_spec.rb b/spec/models/jobs/publish_to_hub_spec.rb index 3b5b274d0..38e5e622c 100644 --- a/spec/models/jobs/publish_to_hub_spec.rb +++ b/spec/models/jobs/publish_to_hub_spec.rb @@ -12,7 +12,7 @@ describe Jobs::PublishToHub do m = mock() m.should_receive(:publish).with(url+'.atom') - Pubsubhubbub.should_receive(:new).with(AppConfig[:pubsub_server]).and_return(m) + Pubsubhubbub.should_receive(:new).with(AppConfig.environment.pubsub_server).and_return(m) Jobs::PublishToHub.perform(url) end end diff --git a/spec/models/person_spec.rb b/spec/models/person_spec.rb index 835ce945a..c5104ae54 100644 --- a/spec/models/person_spec.rb +++ b/spec/models/person_spec.rb @@ -132,17 +132,15 @@ describe Person do end it 'does not include www if it is set in app config' do - old_url = AppConfig[:pod_url] - AppConfig[:pod_url] = 'https://www.foobar.com/' + AppConfig.stub(:pod_uri).and_return(Addressable::URI.parse('https://www.foobar.com/')) new_person = User.build(:username => "foo123", :email => "foo123@example.com", :password => "password", :password_confirmation => "password").person new_person.diaspora_handle.should == "foo123@foobar.com" - AppConfig[:pod_url] = old_url end end context 'remote people' do it 'stores the diaspora_handle in the database' do - @person.diaspora_handle.include?(AppConfig[:pod_uri].host).should be false + @person.diaspora_handle.include?(AppConfig.pod_uri.host).should be false end end diff --git a/spec/models/profile_spec.rb b/spec/models/profile_spec.rb index 8657b8efd..4d152589d 100644 --- a/spec/models/profile_spec.rb +++ b/spec/models/profile_spec.rb @@ -116,7 +116,7 @@ describe Profile do before do @profile = FactoryGirl.build(:profile) @profile.image_url = "http://tom.joindiaspora.com/images/user/tom.jpg" - @pod_url = (AppConfig[:pod_url][-1,1] == '/' ? AppConfig[:pod_url].chop : AppConfig[:pod_url]) + @pod_url = AppConfig.pod_uri.to_s.chomp("/") end it 'ignores an empty string' do diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index 5d72fdbd6..18d994566 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -22,6 +22,54 @@ describe User do end end + describe 'yearly_actives' do + it 'returns list which includes users who latest signed in within last year' do + user = FactoryGirl.build(:user) + user.last_sign_in_at = Time.now - 1.month + user.save + User.yearly_actives.should include user + end + + it 'returns list which does not include users who did not sign in within last year' do + user = FactoryGirl.build(:user) + user.last_sign_in_at = Time.now - 2.year + user.save + User.yearly_actives.should_not include user + end + end + + describe 'monthly_actives' do + it 'returns list which includes users who latest signed in within last month' do + user = FactoryGirl.build(:user) + user.last_sign_in_at = Time.now - 1.day + user.save + User.monthly_actives.should include user + end + + it 'returns list which does not include users who did not sign in within last month' do + user = FactoryGirl.build(:user) + user.last_sign_in_at = Time.now - 2.month + user.save + User.monthly_actives.should_not include user + end + end + + describe 'daily_actives' do + it 'returns list which includes users who latest signed in within last day' do + user = FactoryGirl.build(:user) + user.last_sign_in_at = Time.now - 1.hour + user.save + User.daily_actives.should include(user) + end + + it 'returns list which does not include users who did not sign in within last day' do + user = FactoryGirl.build(:user) + user.last_sign_in_at = Time.now - 2.day + user.save + User.daily_actives.should_not include(user) + end + end + context 'callbacks' do describe '#save_person!' do it 'saves the corresponding user if it has changed' do diff --git a/spec/parallel_spec.opts b/spec/parallel_spec.opts deleted file mode 100644 index 85b0f161e..000000000 --- a/spec/parallel_spec.opts +++ /dev/null @@ -1,2 +0,0 @@ ---format progress ---format ParallelSpecs::SpecSummaryLogger --out tmp/spec_summary.log diff --git a/spec/presenters/post_presenter_spec.rb b/spec/presenters/post_presenter_spec.rb index 530e694cb..f23b848f6 100644 --- a/spec/presenters/post_presenter_spec.rb +++ b/spec/presenters/post_presenter_spec.rb @@ -75,7 +75,7 @@ describe PostPresenter do context 'with posts without text' do it ' displays a messaage with the post class' do - @sm = stub(:text => "", :author => bob.person) + @sm = stub(:text => "", :author => bob.person, :author_name => bob.person.name) @presenter.post = @sm @presenter.title.should == "A post from #{@sm.author.name}" end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 9d3772fd0..c58952587 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -98,12 +98,6 @@ Spork.prefork do end end -Spork.each_run do - # This code will be run each time you run your specs. - AppConfig.load! - AppConfig.setup! -end - # https://makandracards.com/makandra/950-speed-up-rspec-by-deferring-garbage-collection RSpec.configure do |config| config.before(:all) do diff --git a/spec/support/user_methods.rb b/spec/support/user_methods.rb index d74e8640d..6d167f342 100644 --- a/spec/support/user_methods.rb +++ b/spec/support/user_methods.rb @@ -1,7 +1,7 @@ class User include Rails.application.routes.url_helpers def default_url_options - {:host => AppConfig[:pod_url]} + {:host => AppConfig.pod_uri.host} end alias_method :share_with_original, :share_with