Merge branch 'master' of github.com:diaspora/diaspora into fb
Conflicts: app/views/layouts/application.html.haml app/views/shared/_publisher.haml app/views/shared/_sub_header.haml app/views/users/edit.html.haml config/deploy_config.yml config/routes.rb
This commit is contained in:
commit
08b9aa864a
249 changed files with 3439 additions and 1678 deletions
4
.gitignore
vendored
4
.gitignore
vendored
|
|
@ -13,4 +13,8 @@ gpg/diaspora-production/*.gpg
|
|||
gpg/*/random_seed
|
||||
public/uploads/*
|
||||
.rvmrc
|
||||
.DS_Store
|
||||
config/app_config.yml
|
||||
bin/*
|
||||
nbproject
|
||||
config/initializers/secret_token.rb
|
||||
|
|
|
|||
|
|
@ -16,8 +16,8 @@ including the two.
|
|||
|
||||
You must obey the GNU Affero General Public License V3 or later in all respects
|
||||
for all of the code used other than OpenSSL or the components mentioned
|
||||
above. If you modify file(s) with this exception, you may extend this
|
||||
exception to your version of the file(s), but you are not obligated to
|
||||
above. If you modify file(s) with this exception, you may extend this
|
||||
exception to your version of the file(s), but you are not obligated to
|
||||
do so. If you do not wish to do so, delete this exception statement from your
|
||||
version. If you delete this exception statement from all source files in the
|
||||
version. If you delete this exception statement from all source files in the
|
||||
program, then also delete it here.
|
||||
|
|
|
|||
2
Capfile
2
Capfile
|
|
@ -2,8 +2,6 @@
|
|||
# licensed under the Affero General Public License version 3. See
|
||||
# the COPYRIGHT file.
|
||||
|
||||
|
||||
|
||||
load 'deploy' if respond_to?(:namespace) # cap2 differentiator
|
||||
Dir['vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) }
|
||||
|
||||
|
|
|
|||
17
Gemfile
17
Gemfile
|
|
@ -3,13 +3,11 @@ source 'http://rubygems.org'
|
|||
gem 'rails', '3.0.0'
|
||||
gem 'bundler', '1.0.0'
|
||||
|
||||
|
||||
#Security
|
||||
gem 'devise', :git => 'http://github.com/BadMinus/devise.git'
|
||||
|
||||
#Mongo
|
||||
gem 'mongo_mapper', '0.8.4', :git => 'http://github.com/jnunemaker/mongomapper.git'
|
||||
gem 'jnunemaker-validatable', '1.8.4', :git => 'http://github.com/jnunemaker/validatable.git'
|
||||
gem 'mongo_mapper', :branch => 'rails3', :git => 'http://github.com/jnunemaker/mongomapper.git'
|
||||
gem 'bson_ext', '1.0.7'
|
||||
gem 'bson', '1.0.7'
|
||||
|
||||
|
|
@ -41,24 +39,23 @@ gem 'mini_magick'
|
|||
|
||||
group :test, :development do
|
||||
gem 'factory_girl_rails'
|
||||
gem 'ruby-debug' if RUBY_VERSION.include? "1.8"
|
||||
end
|
||||
|
||||
group :test do
|
||||
gem 'rspec', '>= 2.0.0.beta.17'
|
||||
gem 'rspec-rails', '2.0.0.beta.17'
|
||||
gem 'capybara', '~> 0.3.9'
|
||||
gem 'cucumber-rails', '0.3.2'
|
||||
gem 'rspec', '>= 2.0.0.beta.17'
|
||||
gem 'rspec-rails', '2.0.0.beta.17'
|
||||
gem 'mocha'
|
||||
gem 'webrat', '0.7.2.beta.1'
|
||||
gem 'redgreen'
|
||||
gem 'redgreen' if RUBY_VERSION.include? "1.8"
|
||||
gem 'autotest'
|
||||
gem 'database_cleaner'
|
||||
gem 'saucelabs-adapter', '= 0.8.12'
|
||||
gem 'selenium-rc'
|
||||
gem 'webmock'
|
||||
end
|
||||
|
||||
group :development do
|
||||
gem 'nifty-generators'
|
||||
gem 'ruby-debug'
|
||||
end
|
||||
|
||||
group :deployment do
|
||||
|
|
|
|||
62
Gemfile.lock
62
Gemfile.lock
|
|
@ -57,20 +57,14 @@ GIT
|
|||
|
||||
GIT
|
||||
remote: http://github.com/jnunemaker/mongomapper.git
|
||||
revision: 931dab779011aa7acf60c1a4c7ad19e1ba838345
|
||||
revision: b0eac421ef5b3bee782e15d391eca372a189d414
|
||||
branch: rails3
|
||||
specs:
|
||||
mongo_mapper (0.8.4)
|
||||
activesupport (>= 2.3.4)
|
||||
jnunemaker-validatable (~> 1.8.4)
|
||||
activemodel (~> 3.0.0)
|
||||
activesupport (~> 3.0.0)
|
||||
plucky (~> 0.3.5)
|
||||
|
||||
GIT
|
||||
remote: http://github.com/jnunemaker/validatable.git
|
||||
revision: 8d7c3ce14133760e748a0e34b99dfe6ec4d69153
|
||||
specs:
|
||||
jnunemaker-validatable (1.8.4)
|
||||
activesupport (>= 2.3.4)
|
||||
|
||||
GEM
|
||||
remote: http://rubygems.org/
|
||||
specs:
|
||||
|
|
@ -115,8 +109,24 @@ GEM
|
|||
net-sftp (>= 2.0.0)
|
||||
net-ssh (>= 2.0.14)
|
||||
net-ssh-gateway (>= 1.0.0)
|
||||
capybara (0.3.9)
|
||||
culerity (>= 0.2.4)
|
||||
mime-types (>= 1.16)
|
||||
nokogiri (>= 1.3.3)
|
||||
rack (>= 1.0.0)
|
||||
rack-test (>= 0.5.4)
|
||||
selenium-webdriver (>= 0.0.3)
|
||||
columnize (0.3.1)
|
||||
crack (0.1.8)
|
||||
cucumber (0.9.0)
|
||||
builder (~> 2.1.2)
|
||||
diff-lcs (~> 1.1.2)
|
||||
gherkin (~> 2.2.2)
|
||||
json (~> 1.4.6)
|
||||
term-ansicolor (~> 1.0.5)
|
||||
cucumber-rails (0.3.2)
|
||||
cucumber (>= 0.8.0)
|
||||
culerity (0.2.12)
|
||||
daemons (1.1.0)
|
||||
database_cleaner (0.5.2)
|
||||
diff-lcs (1.1.2)
|
||||
|
|
@ -130,13 +140,19 @@ GEM
|
|||
factory_girl_rails (1.0)
|
||||
factory_girl (~> 1.3)
|
||||
rails (>= 3.0.0.beta4)
|
||||
ffi (0.6.3)
|
||||
rake (>= 0.8.7)
|
||||
gherkin (2.2.4)
|
||||
json (~> 1.4.6)
|
||||
term-ansicolor (~> 1.0.5)
|
||||
trollop (~> 1.16.2)
|
||||
haml (3.0.18)
|
||||
hashie (0.4.0)
|
||||
highline (1.6.1)
|
||||
i18n (0.4.1)
|
||||
json (1.4.6)
|
||||
json_pure (1.4.6)
|
||||
linecache (0.43)
|
||||
lsof (0.3.0)
|
||||
mail (2.2.6.1)
|
||||
activesupport (>= 2.3.6)
|
||||
mime-types
|
||||
|
|
@ -206,16 +222,13 @@ GEM
|
|||
ruby-debug-base (~> 0.10.3.0)
|
||||
ruby-debug-base (0.10.3)
|
||||
linecache (>= 0.3)
|
||||
saucelabs-adapter (0.8.12)
|
||||
lsof (>= 0.3.0)
|
||||
net-ssh (>= 2.0.12)
|
||||
net-ssh-gateway (>= 1.0.1)
|
||||
rest-client (>= 1.2.0)
|
||||
selenium-client (>= 1.2.17)
|
||||
selenium-client (1.2.18)
|
||||
selenium-rc (2.2.4)
|
||||
selenium-client (>= 1.2.18)
|
||||
rubyzip (0.9.4)
|
||||
selenium-webdriver (0.0.28)
|
||||
ffi (>= 0.6.1)
|
||||
json_pure
|
||||
rubyzip
|
||||
subexec (0.0.4)
|
||||
term-ansicolor (1.0.5)
|
||||
thin (1.2.7)
|
||||
daemons (>= 1.0.9)
|
||||
eventmachine (>= 0.12.6)
|
||||
|
|
@ -223,6 +236,7 @@ GEM
|
|||
thor (0.14.0)
|
||||
treetop (1.4.8)
|
||||
polyglot (>= 0.3.1)
|
||||
trollop (1.16.2)
|
||||
tzinfo (0.3.23)
|
||||
uuidtools (2.1.1)
|
||||
warden (0.10.7)
|
||||
|
|
@ -245,20 +259,21 @@ DEPENDENCIES
|
|||
bson (= 1.0.7)
|
||||
bson_ext (= 1.0.7)
|
||||
bundler (= 1.0.0)
|
||||
capybara (~> 0.3.9)
|
||||
carrierwave!
|
||||
cucumber-rails (= 0.3.2)
|
||||
database_cleaner
|
||||
devise!
|
||||
em-http-request!
|
||||
em-websocket
|
||||
factory_girl_rails
|
||||
haml
|
||||
jnunemaker-validatable (= 1.8.4)!
|
||||
json
|
||||
magent!
|
||||
mini_fb
|
||||
mini_magick
|
||||
mocha
|
||||
mongo_mapper (= 0.8.4)!
|
||||
mongo_mapper!
|
||||
nifty-generators
|
||||
pubsubhubbub
|
||||
rails (= 3.0.0)
|
||||
|
|
@ -268,10 +283,7 @@ DEPENDENCIES
|
|||
rspec (>= 2.0.0.beta.17)
|
||||
rspec-rails (= 2.0.0.beta.17)
|
||||
ruby-debug
|
||||
saucelabs-adapter (= 0.8.12)
|
||||
selenium-rc
|
||||
sprinkle!
|
||||
thin
|
||||
webmock
|
||||
webrat (= 0.7.2.beta.1)
|
||||
will_paginate (= 3.0.pre2)
|
||||
|
|
|
|||
285
README.md
285
README.md
|
|
@ -26,288 +26,12 @@ network.
|
|||
**PLEASE, DO NOT RUN IN PRODUCTION. IT IS FUN TO GET RUNNING, BUT EXPECT THINGS
|
||||
TO BE BROKEN**
|
||||
|
||||
Some initial installation instructions are [here](http://github.com/diaspora/diaspora/wiki/Installing-and-Running-Diaspora).
|
||||
|
||||
We are continuing to build features and improve the code base.
|
||||
When we think it is ready for general use, we will post more detailed
|
||||
When we think it is ready for general use, we will post more final
|
||||
instructions.
|
||||
|
||||
## Notice
|
||||
|
||||
We currently run Diaspora with the [thin](http://code.macournoyer.com/thin/) as
|
||||
our webserver, behind [nginx](http://wiki.nginx.org/Main). Diaspora uses the
|
||||
asynchronous feature of [EventMachine](http://rubyeventmachine.com/) to send
|
||||
messages between seeds, using the power of the
|
||||
[Reactor](http://en.wikipedia.org/wiki/Reactor_pattern) pattern. If you use
|
||||
mod_rails, mongrel, or another non-eventmachine based application server,
|
||||
federation and/or websockets may not work.
|
||||
|
||||
If you don't like thin, you can always try
|
||||
[Rainbows!](http://rainbows.rubyforge.org/) We will try and fully support more
|
||||
webservers later, but that is what works for now.
|
||||
|
||||
These instructions are for machines running [Ubuntu](http://www.ubuntu.com/),
|
||||
[Fedora](http://www.fedoraproject.org) or Mac OS X. We are developing Diaspora
|
||||
for the latest and greatest browsers, so please update your Firefox, Chrome or
|
||||
Safari to the latest and greatest.
|
||||
|
||||
## Preparing your system
|
||||
|
||||
In order to run Diaspora, you will need to download the following dependencies
|
||||
(specific instructions follow):
|
||||
|
||||
- Build Tools - Packages needed to compile the components that follow.
|
||||
- [Ruby](http://www.ruby-lang.org) - The Ruby programming language.
|
||||
(We're using **1.8.7**. It comes preinstalled on Mac OS X.)
|
||||
- [MongoDB](http://www.mongodb.org) - A snappy noSQL database.
|
||||
- [OpenSSL](http://www.openssl.org/) - An encryption library.
|
||||
(It comes preinstalled on Mac OS X and Ubuntu.)
|
||||
- [ImageMagick](http://www.imagemagick.org/) - An Image processing library used
|
||||
to resize uploaded photos.
|
||||
- [Git](http://git-scm.com/) - The fast version control system.
|
||||
|
||||
After you have Ruby installed on your system, you will need to get RubyGems,
|
||||
then install Bundler:
|
||||
|
||||
- [RubyGems](http://rubygems.org/) - Source for Ruby gems.
|
||||
- [Bundler](http://gembundler.com/) - Gem management tool for Ruby projects.
|
||||
|
||||
**We suggest using a package management system to download these dependencies.
|
||||
Trust us, it's going to make your life a lot easier. If you're using Mac OS X,
|
||||
you can use [homebrew](http://mxcl.github.com/homebrew/); if you're using
|
||||
Ubuntu, just use [Synaptic](http://www.nongnu.org/synaptic/) (it comes
|
||||
pre-installed); if you're using Fedora simply use
|
||||
[yum](http://yum.baseurl.org/). The instructions below assume you have these
|
||||
installed.**
|
||||
|
||||
### Build Tools
|
||||
|
||||
To install build tools on **Ubuntu**, run the following (includes the gcc and
|
||||
xml parsing dependencies):
|
||||
|
||||
sudo apt-get install build-essential libxslt1.1 libxslt1-dev libxml2
|
||||
|
||||
To install build tools on **Fedora**, run the following:
|
||||
|
||||
sudo yum install libxslt libxslt-devel libxml2 libxml2-devel
|
||||
|
||||
To install build tools on **Mac OS X**, you need to download and install
|
||||
[Xcode](http://developer.apple.com/technologies/tools/xcode.html).
|
||||
|
||||
### Ruby
|
||||
|
||||
To install Ruby 1.8.7 on **Ubuntu**, run the following command:
|
||||
|
||||
sudo apt-get install ruby-full
|
||||
|
||||
Please note that you need to have Universe enabled in your
|
||||
/etc/apt/sources.list file to install ruby using apt-get.
|
||||
|
||||
At this time Fedora does not have Ruby 1.8.7. As a workaround it is possible to
|
||||
use [rvm](http://rvm.beginrescueend.com/) with a locally compiled Ruby
|
||||
installation. A semi automated method for doing this is available. It is
|
||||
highly recommended that you review the script before running it so you
|
||||
understand what will occur. The script can be executed by running the
|
||||
following command:
|
||||
|
||||
./script/bootstrap-fedora-diaspora.sh
|
||||
|
||||
After reviewing and executing the above script you will need to follow the
|
||||
"MongoDB" section and then you should skip all the way down to "Start Mongo".
|
||||
|
||||
If you're on **Mac OS X**, you already have Ruby on your system. Yay!
|
||||
|
||||
### MongoDB
|
||||
|
||||
To install MongoDB on **Ubuntu**, add the official MongoDB repository
|
||||
[here](http://www.mongodb.org/display/DOCS/Ubuntu+and+Debian+packages).
|
||||
|
||||
For Lucid, add the following line to your /etc/apt/sources.list (for other
|
||||
distros, see http://www.mongodb.org/display/DOCS/Ubuntu+and+Debian+packages):
|
||||
|
||||
deb http://downloads.mongodb.org/distros/ubuntu 10.4 10gen
|
||||
|
||||
Then run:
|
||||
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10
|
||||
sudo apt-get update
|
||||
sudo apt-get install mongodb-stable
|
||||
|
||||
You can also run the binary directly by doing the following:
|
||||
|
||||
If you're running a 32-bit system, run:
|
||||
|
||||
wget http://fastdl.mongodb.org/linux/mongodb-linux-i686-1.6.2.tgz
|
||||
|
||||
If you're running a 64-bit system, run:
|
||||
|
||||
wget http://fastdl.mongodb.org/linux/mongodb-linux-x86_64-1.6.2.tgz
|
||||
|
||||
Then run:
|
||||
|
||||
# extract
|
||||
tar xzf mongodb-linux-i686-1.4.0.tgz
|
||||
# create the required data directory
|
||||
sudo mkdir -p /data/db
|
||||
sudo chmod -Rv 777 /data/
|
||||
|
||||
|
||||
To install MongoDB on a x86_64 **Fedora** system, add the official MongoDB
|
||||
repository from MongoDB
|
||||
(http://www.mongodb.org/display/DOCS/CentOS+and+Fedora+Packages) into
|
||||
/etc/yum.repos.d/10gen.repo:
|
||||
|
||||
[10gen]
|
||||
name=10gen Repository
|
||||
baseurl=http://downloads.mongodb.org/distros/fedora/13/os/x86_64/
|
||||
gpgcheck=0
|
||||
enabled=1
|
||||
|
||||
Then use yum to install the packages:
|
||||
|
||||
sudo yum install mongo-stable mongo-stable-server
|
||||
|
||||
If you're running a 32-bit system, run `wget
|
||||
http://fastdl.mongodb.org/linux/mongodb-linux-i686-1.6.2.tgz`. If you're
|
||||
running a 64-bit system, run `wget
|
||||
http://fastdl.mongodb.org/linux/mongodb-linux-x86_64-1.6.2.tgz`.
|
||||
|
||||
# extract
|
||||
tar xzf mongodb-linux-i686-1.4.0.tgz
|
||||
# create the required data directory
|
||||
sudo mkdir -p /data/db
|
||||
sudo chmod -Rv 777 /data/
|
||||
|
||||
To install MongoDB on **Mac OS X**, run the following:
|
||||
|
||||
brew install mongo
|
||||
sudo mkdir -p /data/db
|
||||
sudo chmod -Rv 777 /data/
|
||||
|
||||
### OpenSSL
|
||||
|
||||
If you're running either **Ubuntu**, **Fedora** or **Mac OS X** you already
|
||||
have OpenSSL installed!
|
||||
|
||||
### ImageMagick
|
||||
|
||||
To install ImageMagick on **Ubuntu**, run the following:
|
||||
|
||||
sudo apt-get install imagemagick libmagick9-dev
|
||||
|
||||
To install ImageMagick on **Fedora**, run the following:
|
||||
|
||||
sudo yum install ImageMagick
|
||||
|
||||
To install ImageMagick on **Mac OS X**, run the following:
|
||||
|
||||
brew install imagemagick
|
||||
|
||||
### Git
|
||||
|
||||
To install Git on **Ubuntu**, run the following:
|
||||
|
||||
sudo apt-get install git-core
|
||||
|
||||
To install Git on **Fedora**, run the following:
|
||||
|
||||
sudo yum install git
|
||||
|
||||
|
||||
To install Git on **Mac OS X**, run the following:
|
||||
|
||||
brew install git
|
||||
|
||||
|
||||
### Rubygems
|
||||
|
||||
On **Ubuntu** 10.04, run the following:
|
||||
|
||||
sudo add-apt-repository ppa:maco.m/ruby
|
||||
sudo apt-get update
|
||||
sudo apt-get install rubygems
|
||||
|
||||
This PPA is maintained by an Ubuntu Developer. For Ubuntu 10.10, this version
|
||||
of rubygems is in the repositories.
|
||||
|
||||
On **Fedora**, run the following:
|
||||
|
||||
sudo yum install rubygems
|
||||
|
||||
On **Mac OS X**, RubyGems comes preinstalled; however, you might need to update
|
||||
it for use with the latest Bundler. To update RubyGems, run `sudo gem update
|
||||
--system`.
|
||||
|
||||
|
||||
### Bundler
|
||||
|
||||
After RubyGems is updated, simply run `sudo gem install bundler` to get
|
||||
Bundler. If you're using Ubuntu repository .debs, bundler is found at
|
||||
/var/lib/gems/1.8/bin/bundle
|
||||
|
||||
|
||||
## Getting Diaspora
|
||||
|
||||
git clone http://github.com/diaspora/diaspora.git
|
||||
|
||||
If you have never used github before, their
|
||||
[help desk](http://help.github.com/) has a pretty awesome guide on getting
|
||||
setup.
|
||||
|
||||
|
||||
## Running Diaspora
|
||||
|
||||
### Install required gems
|
||||
|
||||
To start the app server for the first time, you need to use Bundler to install
|
||||
Diaspora's gem depencencies. Run `bundle install` from Diaspora's root
|
||||
directory. Bundler will also warn you if there is a new dependency and you
|
||||
need to bundle install again.
|
||||
|
||||
### Start Mongo
|
||||
|
||||
If you installed the Ubuntu package, MongoDB should already be running (if not,
|
||||
run `service mongodb start`). If you installed the binary manually, run `sudo
|
||||
mongod` from where mongo is installed to start mongo.
|
||||
|
||||
If you installed the Fedora package, MongoDB will need to be started via
|
||||
`service mongodb start`. If you installed the binary manually, run `sudo
|
||||
mongod` from where Mongo is installed to start Mongo.
|
||||
|
||||
If you installed the OsX package through "brew", MongoDB will need to be
|
||||
started via `sudo launchctl load
|
||||
/Library/LaunchDaemons/org.mongodb.mongod.plist`. (before you have to go to
|
||||
/Library/LaunchDaemons and add a symlink to
|
||||
/usr/local/Cellar/mongodb/1.6.2-x86_64/org.mongodb.mongod.plist)
|
||||
|
||||
Diaspora will not run unless Mongo is running. Mongo will not run by default,
|
||||
and will need to be started every time you wish to use or run the test suite
|
||||
for Diaspora.
|
||||
|
||||
### Run the server
|
||||
|
||||
`./script/server` will start both thin and the websocket server. If you want
|
||||
to run a different app server, you will have to run them separately. See below
|
||||
for instructions.
|
||||
|
||||
### Run the app server
|
||||
|
||||
Once mongo is running and bundler has finished, run `bundle exec thin start`
|
||||
from the root Diaspora directory. This will start the app server in
|
||||
development mode[.](http://bit.ly/9mwtUw)
|
||||
|
||||
### Run the websocket server
|
||||
|
||||
run `bundle exec ruby ./script/websocket_server` to start the websocket server
|
||||
on port 8080. Change the port in config/app_config.yml.
|
||||
|
||||
### Logging in with a sample user
|
||||
|
||||
Run `rake db:seed:tom`, then login with user `tom` and password `evankorth`.
|
||||
More details in db/seeds/tom.rb.
|
||||
|
||||
### Testing
|
||||
|
||||
Diaspora's test suite uses [rspec](http://rspec.info/), a behavior driven
|
||||
testing framework. In order to run the tests, run `bundle exec rspec spec`.
|
||||
|
||||
## Resources
|
||||
|
||||
We are maintaining a
|
||||
|
|
@ -318,6 +42,7 @@ file [bug reports](https://github.com/diaspora/diaspora/issues) right here on
|
|||
github.
|
||||
|
||||
Ongoing discussion:
|
||||
|
||||
- [Diaspora Developer Google Group](http://groups.google.com/group/diaspora-dev)
|
||||
- [Diaspora Discussion Google Group](http://groups.google.com/group/diaspora-discuss)
|
||||
- [Diaspora Q&A site](http://diaspora.shapado.com/)
|
||||
|
|
@ -326,7 +51,7 @@ Ongoing discussion:
|
|||
|
||||
More general info and updates about the project can be found on:
|
||||
[Our blog](http://joindiaspora.com),
|
||||
[and on Twitter](http://twitter.com/joindiaspora).
|
||||
[and on Twitter](http://twitter.com/joindiaspora).
|
||||
Also, be sure to join the official [mailing list](http://http://eepurl.com/Vebk).
|
||||
|
||||
If you wish to contact us privately about any exploits in Diaspora you may
|
||||
|
|
|
|||
3
Rakefile
3
Rakefile
|
|
@ -2,12 +2,11 @@
|
|||
# licensed under the Affero General Public License version 3. See
|
||||
# the COPYRIGHT file.
|
||||
|
||||
|
||||
|
||||
# Add your own tasks in files placed in lib/tasks ending in .rake,
|
||||
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
|
||||
|
||||
require File.expand_path('../config/application', __FILE__)
|
||||
require 'rake'
|
||||
ENV['GNUPGHOME'] = File.expand_path("../../gpg/diaspora-#{Rails.env}/", __FILE__)
|
||||
|
||||
Diaspora::Application.load_tasks
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ class AlbumsController < ApplicationController
|
|||
data = clean_hash(params[:album])
|
||||
|
||||
@album = current_user.post(:album, data)
|
||||
flash[:notice] = "You've created an album called #{@album.name}."
|
||||
flash[:notice] = I18n.t 'albums.create.success', :name => @album.name
|
||||
redirect_to :action => :show, :id => @album.id, :aspect => aspect
|
||||
end
|
||||
|
||||
|
|
@ -31,7 +31,7 @@ class AlbumsController < ApplicationController
|
|||
def destroy
|
||||
@album = current_user.find_visible_post_by_id params[:id]
|
||||
@album.destroy
|
||||
flash[:notice] = "Album #{@album.name} deleted."
|
||||
flash[:notice] = I18n.t 'albums.destroy.success', :name => @album.name
|
||||
respond_with :location => albums_url
|
||||
end
|
||||
|
||||
|
|
@ -53,10 +53,10 @@ class AlbumsController < ApplicationController
|
|||
data = clean_hash(params[:album])
|
||||
|
||||
if current_user.update_post( @album, data )
|
||||
flash[:notice] = "Album #{@album.name} successfully edited."
|
||||
flash[:notice] = I18n.t 'albums.update.success', :name => @album.name
|
||||
respond_with @album
|
||||
else
|
||||
flash[:error] = "Failed to edit album #{@album.name}."
|
||||
flash[:error] = I18n.t 'albums.update.failure', :name => @album.name
|
||||
render :action => :edit
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
# licensed under the Affero General Public License version 3. See
|
||||
# the COPYRIGHT file.
|
||||
|
||||
|
||||
class ApplicationController < ActionController::Base
|
||||
|
||||
protect_from_forgery :except => :receive
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
# licensed under the Affero General Public License version 3. See
|
||||
# the COPYRIGHT file.
|
||||
|
||||
|
||||
class AspectsController < ApplicationController
|
||||
before_filter :authenticate_user!
|
||||
|
||||
|
|
@ -15,8 +14,12 @@ class AspectsController < ApplicationController
|
|||
end
|
||||
|
||||
def create
|
||||
@aspect = current_user.aspect params[:aspect]
|
||||
flash[:notice] = I18n.t('aspects.create.success')
|
||||
@aspect = current_user.aspect(params[:aspect])
|
||||
if @aspect.valid?
|
||||
flash[:notice] = I18n.t('aspects.create.success')
|
||||
else
|
||||
flash[:error] = I18n.t('aspects.create.failure')
|
||||
end
|
||||
respond_with :location => aspects_manage_path
|
||||
end
|
||||
|
||||
|
|
@ -29,8 +32,8 @@ class AspectsController < ApplicationController
|
|||
|
||||
begin
|
||||
current_user.drop_aspect @aspect
|
||||
flash[:notice] = "#{@aspect.name} was successfully removed."
|
||||
rescue RuntimeError => e
|
||||
flash[:notice] = i18n.t 'aspects.destroy.success',:name => @aspect.name
|
||||
rescue RuntimeError => e
|
||||
flash[:error] = e.message
|
||||
end
|
||||
|
||||
|
|
@ -64,7 +67,7 @@ class AspectsController < ApplicationController
|
|||
|
||||
data = clean_hash(params[:aspect])
|
||||
@aspect.update_attributes( data )
|
||||
flash[:notice] = "Your aspect, #{@aspect.name}, has been successfully edited."
|
||||
flash[:notice] = i18n.t 'aspects.update.success',:name => @aspect.name
|
||||
respond_with @aspect
|
||||
end
|
||||
|
||||
|
|
@ -72,25 +75,25 @@ class AspectsController < ApplicationController
|
|||
params[:moves].each{ |move|
|
||||
move = move[1]
|
||||
unless current_user.move_friend(move)
|
||||
flash[:error] = "Aspect editing failed for friend #{current_user.visible_person_by_id( move[:friend_id] ).real_name}."
|
||||
flash[:error] = i18n.t 'aspects.move_friends.failure', :real_name => Person.find_by_id( move[:friend_id] ).real_name
|
||||
redirect_to aspects_manage_path
|
||||
return
|
||||
end
|
||||
}
|
||||
|
||||
flash[:notice] = "Aspects edited successfully."
|
||||
flash[:notice] = i18n.t 'aspects.move_friends.success'
|
||||
redirect_to aspects_manage_path
|
||||
end
|
||||
|
||||
def move_friend
|
||||
unless current_user.move_friend( :friend_id => params[:friend_id], :from => params[:from], :to => params[:to][:to])
|
||||
flash[:error] = "didn't work #{params.inspect}"
|
||||
flash[:error] = I18n.t 'aspects.move_friend.error',:inspect => params.inspect
|
||||
end
|
||||
if aspect = current_user.aspect_by_id(params[:to][:to])
|
||||
flash[:notice] = "You are now showing your friend a different aspect of yourself."
|
||||
flash[:notice] = I18n.t 'aspects.move_friend.success'
|
||||
render :nothing => true
|
||||
else
|
||||
flash[:error] = "Invalid aspect id!"
|
||||
flash[:notice] = I18n.t 'aspects.move_friend.failure'
|
||||
render aspects_manage_path
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
# licensed under the Affero General Public License version 3. See
|
||||
# the COPYRIGHT file.
|
||||
|
||||
|
||||
class CommentsController < ApplicationController
|
||||
before_filter :authenticate_user!
|
||||
|
||||
|
|
@ -10,7 +9,7 @@ class CommentsController < ApplicationController
|
|||
respond_to :json, :only => :show
|
||||
|
||||
def create
|
||||
target = Post.find_by_id params[:comment][:post_id]
|
||||
target = current_user.find_visible_post_by_id params[:comment][:post_id]
|
||||
text = params[:comment][:text]
|
||||
|
||||
@comment = current_user.comment text, :on => target
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
# licensed under the Affero General Public License version 3. See
|
||||
# the COPYRIGHT file.
|
||||
|
||||
|
||||
class DevUtilitiesController < ApplicationController
|
||||
before_filter :authenticate_user!, :except => [:set_backer_number]
|
||||
include ApplicationHelper
|
||||
|
|
@ -16,7 +15,7 @@ class DevUtilitiesController < ApplicationController
|
|||
bkr_info.each do |backer|
|
||||
backer_email = "#{backer['username']}@#{backer['username']}.joindiaspora.com"
|
||||
rel_hash = relationship_flow(backer_email)
|
||||
logger.info "Zombefriending #{backer['given_name']} #{backer['family_name']}"
|
||||
logger.info "Zombiefriending #{backer['given_name']} #{backer['family_name']}"
|
||||
logger.info "Calling send_friend_request with #{rel_hash[:friend]} and #{current_user.aspects.first}"
|
||||
current_user.send_friend_request_to(rel_hash[:friend], current_user.aspects.first)
|
||||
end
|
||||
|
|
@ -30,11 +29,6 @@ class DevUtilitiesController < ApplicationController
|
|||
}
|
||||
end
|
||||
|
||||
def backer_info
|
||||
config = YAML.load_file(File.dirname(__FILE__) + '/../../config/deploy_config.yml')
|
||||
config['servers']['backer']
|
||||
end
|
||||
|
||||
def set_backer_number
|
||||
render :nothing => true
|
||||
seed_num_hash = {:seed_number => params[:number]}
|
||||
|
|
@ -44,7 +38,6 @@ class DevUtilitiesController < ApplicationController
|
|||
end
|
||||
|
||||
def set_profile_photo
|
||||
|
||||
render :nothing => true
|
||||
album = Album.create(:person => current_user.person, :name => "Profile Photos")
|
||||
current_user.raw_visible_posts << album
|
||||
|
|
@ -53,7 +46,7 @@ class DevUtilitiesController < ApplicationController
|
|||
backer_number = YAML.load_file(Rails.root.join('config','backer_number.yml'))[:seed_number].to_i
|
||||
username = backer_info[backer_number]['username'].gsub(/ /,'').downcase
|
||||
|
||||
@fixture_name = File.dirname(__FILE__) + "/../../public/images/user/#{username}.jpg"
|
||||
@fixture_name = File.join(File.dirname(__FILE__), "..", "..", "public", "images", "user", "#{username}.jpg")
|
||||
|
||||
photo = Photo.new(:person => current_user.person, :album => album)
|
||||
photo.image.store! File.open(@fixture_name)
|
||||
|
|
@ -63,7 +56,6 @@ class DevUtilitiesController < ApplicationController
|
|||
current_user.raw_visible_posts << photo
|
||||
current_user.save
|
||||
|
||||
|
||||
current_user.update_profile(:image_url => photo.url(:thumb_medium))
|
||||
current_user.save
|
||||
end
|
||||
|
|
@ -73,4 +65,11 @@ class DevUtilitiesController < ApplicationController
|
|||
|
||||
render "shared/log"
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
def backer_info
|
||||
config = YAML.load_file(File.join(File.dirname(__FILE__), "..", "..", "config", "deploy_config.yml"))
|
||||
config['servers']['backer']
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
# licensed under the Affero General Public License version 3. See
|
||||
# the COPYRIGHT file.
|
||||
|
||||
|
||||
class PeopleController < ApplicationController
|
||||
before_filter :authenticate_user!
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
# licensed under the Affero General Public License version 3. See
|
||||
# the COPYRIGHT file.
|
||||
|
||||
|
||||
class PhotosController < ApplicationController
|
||||
before_filter :authenticate_user!
|
||||
|
||||
|
|
@ -19,9 +18,15 @@ class PhotosController < ApplicationController
|
|||
# get file content type
|
||||
att_content_type = (request.content_type.to_s == "") ? "application/octet-stream" : request.content_type.to_s
|
||||
# create temporal file
|
||||
file = Tempfile.new(file_name)
|
||||
begin
|
||||
file = Tempfile.new(file_name, {:encoding => 'BINARY'})
|
||||
file.print request.raw_post.force_encoding('BINARY')
|
||||
rescue RuntimeError => e
|
||||
raise e unless e.message.include?('cannot generate tempfile')
|
||||
file = Tempfile.new(file_name) # Ruby 1.8 compatibility
|
||||
file.print request.raw_post
|
||||
end
|
||||
# put data into this file from raw post request
|
||||
file.print request.raw_post
|
||||
|
||||
# create several required methods for this temporal file
|
||||
Tempfile.send(:define_method, "content_type") {return att_content_type}
|
||||
|
|
@ -29,12 +34,10 @@ class PhotosController < ApplicationController
|
|||
|
||||
##############
|
||||
|
||||
|
||||
params[:user_file] = file
|
||||
|
||||
data = clean_hash(params)
|
||||
|
||||
|
||||
@photo = current_user.post(:photo, data)
|
||||
|
||||
respond_to do |format|
|
||||
|
|
@ -42,15 +45,15 @@ class PhotosController < ApplicationController
|
|||
end
|
||||
|
||||
rescue TypeError
|
||||
message = "Photo upload failed. Are you sure an image was added?"
|
||||
message = I18n.t 'photos.create.type_error'
|
||||
respond_with :location => album, :error => message
|
||||
|
||||
rescue CarrierWave::IntegrityError
|
||||
message = "Photo upload failed. Are you sure that was an image?"
|
||||
message = I18n.t 'photos.create.integrity_error'
|
||||
respond_with :location => album, :error => message
|
||||
|
||||
rescue RuntimeError => e
|
||||
message = "Photo upload failed. Are you sure that your seatbelt is fastened?"
|
||||
message = I18n.t 'photos.create.runtime_error'
|
||||
respond_with :location => album, :error => message
|
||||
raise e
|
||||
end
|
||||
|
|
@ -66,7 +69,7 @@ class PhotosController < ApplicationController
|
|||
@photo = current_user.find_visible_post_by_id params[:id]
|
||||
|
||||
@photo.destroy
|
||||
flash[:notice] = "Photo deleted."
|
||||
flash[:notice] = I18n.t 'photos.destroy.notice'
|
||||
respond_with :location => @photo.album
|
||||
end
|
||||
|
||||
|
|
@ -89,15 +92,14 @@ class PhotosController < ApplicationController
|
|||
data = clean_hash(params)
|
||||
|
||||
if current_user.update_post( @photo, data[:photo] )
|
||||
flash[:notice] = "Photo successfully updated."
|
||||
flash[:notice] = I18n.t 'photos.update.notice'
|
||||
respond_with @photo
|
||||
else
|
||||
flash[:error] = "Failed to edit photo."
|
||||
flash[:error] = I18n.t 'photos.update.error'
|
||||
render :action => :edit
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
private
|
||||
def clean_hash(params)
|
||||
if params[:photo]
|
||||
|
|
|
|||
|
|
@ -2,9 +2,8 @@
|
|||
# licensed under the Affero General Public License version 3. See
|
||||
# the COPYRIGHT file.
|
||||
|
||||
|
||||
class PublicsController < ApplicationController
|
||||
require 'lib/diaspora/parser'
|
||||
require File.expand_path('../../../lib/diaspora/parser', __FILE__)
|
||||
include Diaspora::Parser
|
||||
layout false
|
||||
|
||||
|
|
@ -20,7 +19,7 @@ class PublicsController < ApplicationController
|
|||
end
|
||||
|
||||
def webfinger
|
||||
@person = Person.by_webfinger(params[:q], :local => true)
|
||||
@person = Person.by_webfinger(params[:q], :local => true) if params[:q]
|
||||
unless @person.nil? || @person.owner.nil?
|
||||
render 'webfinger', :content_type => 'application/xrd+xml'
|
||||
else
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ class RegistrationsController < Devise::RegistrationsController
|
|||
flash[:error] = e.message
|
||||
end
|
||||
if user
|
||||
flash[:notice] = "You've joined Diaspora!"
|
||||
flash[:notice] = I18n.t 'registrations.create.success'
|
||||
sign_in_and_redirect(:user, user)
|
||||
else
|
||||
redirect_to new_user_registration_path
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
# licensed under the Affero General Public License version 3. See
|
||||
# the COPYRIGHT file.
|
||||
|
||||
|
||||
class RequestsController < ApplicationController
|
||||
before_filter :authenticate_user!
|
||||
include RequestsHelper
|
||||
|
|
@ -13,15 +12,15 @@ class RequestsController < ApplicationController
|
|||
if params[:accept]
|
||||
if params[:aspect_id]
|
||||
@friend = current_user.accept_and_respond( params[:id], params[:aspect_id])
|
||||
flash[:notice] = "You are now friends."
|
||||
flash[:notice] = I18n.t 'requests.destroy.success'
|
||||
respond_with :location => current_user.aspect_by_id(params[:aspect_id])
|
||||
else
|
||||
flash[:error] = "Please select an aspect!"
|
||||
flash[:error] = I18n.t 'requests.destroy.error'
|
||||
respond_with :location => requests_url
|
||||
end
|
||||
else
|
||||
current_user.ignore_friend_request params[:id]
|
||||
flash[:notice] = "Ignored friend request."
|
||||
flash[:notice] = I18n.t 'requests.destroy.ignore'
|
||||
respond_with :location => requests_url
|
||||
end
|
||||
end
|
||||
|
|
@ -37,27 +36,28 @@ class RequestsController < ApplicationController
|
|||
rel_hash = relationship_flow(params[:request][:destination_url])
|
||||
rescue Exception => e
|
||||
raise e unless e.message.include? "not found"
|
||||
flash[:error] = "No diaspora seed found with this email!"
|
||||
flash[:error] = I18n.t 'requests.create.error'
|
||||
respond_with :location => aspect
|
||||
return
|
||||
end
|
||||
|
||||
# rel_hash = {:friend => params[:friend_handle]}
|
||||
Rails.logger.debug("Sending request: #{rel_hash}")
|
||||
|
||||
begin
|
||||
@request = current_user.send_friend_request_to(rel_hash[:friend], aspect)
|
||||
rescue Exception => e
|
||||
raise e unless e.message.include? "already"
|
||||
flash[:notice] = "#{e.message} #{params[:request][:destination_url]}"
|
||||
flash[:notice] = I18n.t 'requests.create.already_friends', :destination_url => params[:request][:destination_url]
|
||||
respond_with :location => aspect
|
||||
return
|
||||
end
|
||||
|
||||
if @request
|
||||
flash[:notice] = "A friend request was sent to #{@request.destination_url}."
|
||||
flash[:notice] = I18n.t 'requests.create.success',:destination_url => @request.destination_url
|
||||
respond_with :location => aspect
|
||||
else
|
||||
flash[:error] = "Something went horribly wrong."
|
||||
flash[:error] = I18n.t 'requests.create.horribly_wrong'
|
||||
respond_with :location => aspect
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
# licensed under the Affero General Public License version 3. See
|
||||
# the COPYRIGHT file.
|
||||
|
||||
|
||||
class SocketsController < ApplicationController
|
||||
include ApplicationHelper
|
||||
include SocketsHelper
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
# licensed under the Affero General Public License version 3. See
|
||||
# the COPYRIGHT file.
|
||||
|
||||
|
||||
class StatusMessagesController < ApplicationController
|
||||
before_filter :authenticate_user!
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
# licensed under the Affero General Public License version 3. See
|
||||
# the COPYRIGHT file.
|
||||
|
||||
|
||||
class UsersController < ApplicationController
|
||||
before_filter :authenticate_user!, :except => [:new, :create]
|
||||
|
||||
|
|
@ -11,7 +10,7 @@ class UsersController < ApplicationController
|
|||
def edit
|
||||
@user = current_user
|
||||
@person = @user.person
|
||||
@profile = @user.profile
|
||||
@profile = @user.person.profile
|
||||
@photos = Photo.find_all_by_person_id(@person.id).paginate :page => params[:page], :order => 'created_at DESC'
|
||||
|
||||
@fb_access_url = MiniFB.oauth_url(FB_APP_ID, APP_CONFIG[:pod_url] + "services/create",
|
||||
|
|
@ -30,10 +29,15 @@ class UsersController < ApplicationController
|
|||
|
||||
private
|
||||
def prep_image_url(params)
|
||||
url = APP_CONFIG[:pod_url].chop if APP_CONFIG[:pod_url][-1,1] == '/'
|
||||
if params[:profile][:image_url].empty?
|
||||
params[:profile].delete(:image_url)
|
||||
else
|
||||
params[:profile][:image_url] = "http://" + request.host + ":" + request.port.to_s + params[:profile][:image_url]
|
||||
if /^http:\/\// =~ params[:profile][:image_url]
|
||||
params[:profile][:image_url] = params[:profile][:image_url]
|
||||
else
|
||||
params[:profile][:image_url] = url + params[:profile][:image_url]
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -2,21 +2,20 @@
|
|||
# licensed under the Affero General Public License version 3. See
|
||||
# the COPYRIGHT file.
|
||||
|
||||
|
||||
module AlbumsHelper
|
||||
def friends_albums_link
|
||||
if params[:friends]
|
||||
"Friends Albums"
|
||||
I18n.t('albums.helper.friends_albums')
|
||||
else
|
||||
link_to 'Friends Albums', albums_path({:friends => true})
|
||||
link_to I18n.t('albums.helper.friends_albums'), albums_path({:friends => true})
|
||||
end
|
||||
end
|
||||
|
||||
def your_albums_link
|
||||
if params[:friends]
|
||||
link_to 'Your Albums', albums_path
|
||||
link_to I18n.t('albums.helper.your_albums'), albums_path
|
||||
else
|
||||
'Your Albums'
|
||||
I18n.t('albums.helper.your_albums')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
# licensed under the Affero General Public License version 3. See
|
||||
# the COPYRIGHT file.
|
||||
|
||||
|
||||
module ApplicationHelper
|
||||
def current_aspect?(aspect)
|
||||
!@aspect.is_a?(Symbol) && @aspect.id == aspect.id
|
||||
|
|
@ -37,7 +36,7 @@ module ApplicationHelper
|
|||
when "Person"
|
||||
person_path(person)
|
||||
else
|
||||
"unknown person"
|
||||
I18n.t('application.helper.unknown_person')
|
||||
end
|
||||
end
|
||||
|
||||
|
|
@ -61,7 +60,7 @@ module ApplicationHelper
|
|||
end
|
||||
|
||||
def new_request(request_count)
|
||||
"new_requests" if request_count > 0
|
||||
I18n.t('application.helper.new_requests') if request_count > 0
|
||||
end
|
||||
|
||||
def post_yield_tag(post)
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
# licensed under the Affero General Public License version 3. See
|
||||
# the COPYRIGHT file.
|
||||
|
||||
|
||||
module AspectsHelper
|
||||
def link_for_aspect( aspect )
|
||||
link_to aspect.name, aspect
|
||||
|
|
@ -10,9 +9,9 @@ module AspectsHelper
|
|||
|
||||
def remove_link( aspect )
|
||||
if aspect.people.size == 0
|
||||
link_to "remove", aspect, :method => :delete
|
||||
link_to I18n.t('aspects.helper.remove'), aspect, :method => :delete
|
||||
else
|
||||
"<span class='grey' title='Aspect not empty'>remove</span>"
|
||||
"<span class='grey' title=#{I18n.t('aspects.helper.aspect_not_empty')}>#{I18n.t('aspects.helper.remove')}</span>"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -2,9 +2,8 @@
|
|||
# licensed under the Affero General Public License version 3. See
|
||||
# the COPYRIGHT file.
|
||||
|
||||
|
||||
module DashboardsHelper
|
||||
def title_for_page
|
||||
'home'
|
||||
I18n.t('dashboards.helper.home')
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -2,13 +2,12 @@
|
|||
# licensed under the Affero General Public License version 3. See
|
||||
# the COPYRIGHT file.
|
||||
|
||||
|
||||
module ErrorMessagesHelper
|
||||
# Render error messages for the given objects. The :message and :header_message options are allowed.
|
||||
def error_messages_for(*objects)
|
||||
options = objects.extract_options!
|
||||
options[:header_message] ||= "Invalid Fields"
|
||||
options[:message] ||= "Correct the following errors and try again."
|
||||
options[:header_message] ||= I18n.t('error_messages.helper.invalid_fields')
|
||||
options[:message] ||= I18n.t('error_messages.helper.correct_the_following_errors_and_try_again')
|
||||
messages = objects.compact.map { |o| o.errors.full_messages }.flatten
|
||||
unless messages.empty?
|
||||
content_tag(:div, :class => "error_messages") do
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
# licensed under the Affero General Public License version 3. See
|
||||
# the COPYRIGHT file.
|
||||
|
||||
|
||||
# These helper methods can be called in your template to set variables to be used in the layout
|
||||
# This module should be included in all views globally,
|
||||
# to do so you may need to add this line to your ApplicationController
|
||||
|
|
|
|||
|
|
@ -2,14 +2,13 @@
|
|||
# licensed under the Affero General Public License version 3. See
|
||||
# the COPYRIGHT file.
|
||||
|
||||
|
||||
module PeopleHelper
|
||||
|
||||
def search_or_index
|
||||
if params[:q]
|
||||
" results for #{params[:q]}"
|
||||
I18n.t 'people.helper.results_for',:params => params[:q]
|
||||
else
|
||||
" people on pod is aware of"
|
||||
I18n.t "people.helper.people_on_pod_are_aware_of"
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
# licensed under the Affero General Public License version 3. See
|
||||
# the COPYRIGHT file.
|
||||
|
||||
|
||||
module PhotosHelper
|
||||
def linked_scaled_photo(photo, album)
|
||||
link_to (image_tag photo.url(:scaled_full)), photo_path(album.next_photo(photo)), :rel => "prefetch"
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
# licensed under the Affero General Public License version 3. See
|
||||
# the COPYRIGHT file.
|
||||
|
||||
|
||||
module PublicsHelper
|
||||
def subscribe(opts = {})
|
||||
subscriber = Subscriber.first(:url => opts[:callback], :topic => opts[:topic])
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
# licensed under the Affero General Public License version 3. See
|
||||
# the COPYRIGHT file.
|
||||
|
||||
|
||||
module RequestsHelper
|
||||
def subscription_mode(profile)
|
||||
if diaspora?(profile)
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
# licensed under the Affero General Public License version 3. See
|
||||
# the COPYRIGHT file.
|
||||
|
||||
|
||||
module SocketsHelper
|
||||
include ApplicationHelper
|
||||
|
||||
|
|
|
|||
|
|
@ -2,13 +2,12 @@
|
|||
# licensed under the Affero General Public License version 3. See
|
||||
# the COPYRIGHT file.
|
||||
|
||||
|
||||
module StatusMessagesHelper
|
||||
def my_latest_message
|
||||
unless @latest_status_message.nil?
|
||||
return @latest_status_message.message
|
||||
else
|
||||
return "No message to display."
|
||||
return I18n.t('status_messages.helper.no_message_to_display')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
# licensed under the Affero General Public License version 3. See
|
||||
# the COPYRIGHT file.
|
||||
|
||||
|
||||
class Album < Post
|
||||
|
||||
xml_reader :name
|
||||
|
|
@ -17,7 +16,6 @@ class Album < Post
|
|||
|
||||
before_destroy :destroy_photos
|
||||
|
||||
|
||||
def self.mine_or_friends(friend_param, current_user)
|
||||
friend_param ? Album.find_all_by_person_id(current_user.friend_ids) : current_user.person.albums
|
||||
end
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
# licensed under the Affero General Public License version 3. See
|
||||
# the COPYRIGHT file.
|
||||
|
||||
|
||||
class Aspect
|
||||
include MongoMapper::Document
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
# licensed under the Affero General Public License version 3. See
|
||||
# the COPYRIGHT file.
|
||||
|
||||
|
||||
class Comment
|
||||
include MongoMapper::Document
|
||||
include ROXML
|
||||
|
|
@ -19,7 +18,6 @@ class Comment
|
|||
key :post_id, ObjectId
|
||||
key :person_id, ObjectId
|
||||
|
||||
|
||||
belongs_to :post, :class_name => "Post"
|
||||
belongs_to :person, :class_name => "Person"
|
||||
|
||||
|
|
|
|||
|
|
@ -2,8 +2,7 @@
|
|||
# licensed under the Affero General Public License version 3. See
|
||||
# the COPYRIGHT file.
|
||||
|
||||
|
||||
require 'lib/hcard'
|
||||
require File.expand_path('../../../lib/hcard', __FILE__)
|
||||
|
||||
class Person
|
||||
include MongoMapper::Document
|
||||
|
|
@ -18,7 +17,7 @@ class Person
|
|||
|
||||
key :url, String
|
||||
key :diaspora_handle, String, :unique => true
|
||||
key :serialized_key, String
|
||||
key :serialized_public_key, String
|
||||
|
||||
key :owner_id, ObjectId
|
||||
|
||||
|
|
@ -30,7 +29,7 @@ class Person
|
|||
|
||||
before_destroy :remove_all_traces
|
||||
before_validation :clean_url
|
||||
validates_presence_of :url, :profile, :serialized_key
|
||||
validates_presence_of :url, :profile, :serialized_public_key
|
||||
validates_format_of :url, :with =>
|
||||
/^(https?):\/\/[a-z0-9]+([\-\.]{1}[a-z0-9]+)*(\.[a-z]{2,5})?(:[0-9]{1,5})?(\/.*)?$/ix
|
||||
|
||||
|
|
@ -50,36 +49,28 @@ class Person
|
|||
"#{self.url}receive/users/#{self.id}/"
|
||||
end
|
||||
|
||||
def encryption_key
|
||||
OpenSSL::PKey::RSA.new( serialized_key )
|
||||
end
|
||||
|
||||
def encryption_key= new_key
|
||||
raise TypeError unless new_key.class == OpenSSL::PKey::RSA
|
||||
serialized_key = new_key.export
|
||||
end
|
||||
|
||||
def public_key_hash
|
||||
Base64.encode64 OpenSSL::Digest::SHA256.new(self.exported_key).to_s
|
||||
end
|
||||
|
||||
def public_key
|
||||
encryption_key.public_key
|
||||
OpenSSL::PKey::RSA.new( serialized_public_key )
|
||||
end
|
||||
|
||||
def exported_key
|
||||
encryption_key.public_key.export
|
||||
serialized_public_key
|
||||
end
|
||||
|
||||
def exported_key= new_key
|
||||
raise "Don't change a key" if serialized_key
|
||||
@serialized_key = new_key
|
||||
raise "Don't change a key" if serialized_public_key
|
||||
@serialized_public_key = new_key
|
||||
end
|
||||
|
||||
def self.by_webfinger( identifier, opts = {})
|
||||
#need to check if this is a valid email structure, maybe should do in JS
|
||||
local_person = Person.first(:diaspora_handle => identifier.gsub('acct:', '').to_s.downcase)
|
||||
|
||||
|
||||
if local_person
|
||||
Rails.logger.info("Do not need to webfinger, found a local person #{local_person.real_name}")
|
||||
local_person
|
||||
|
|
@ -101,9 +92,9 @@ class Person
|
|||
new_person = Person.new
|
||||
|
||||
public_key_entry = profile.links.select{|x| x.rel == 'diaspora-public-key'}
|
||||
|
||||
|
||||
return nil unless public_key_entry
|
||||
|
||||
|
||||
pubkey = public_key_entry.first.href
|
||||
new_person.exported_key = Base64.decode64 pubkey
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,13 @@
|
|||
# licensed under the Affero General Public License version 3. See
|
||||
# the COPYRIGHT file.
|
||||
|
||||
|
||||
class PhotoAlbumValidator < ActiveModel::Validator
|
||||
def validate(document)
|
||||
unless document.album.person_id == document.person_id
|
||||
document.errors[:base] << "You post photos to that album"
|
||||
end
|
||||
end
|
||||
end
|
||||
class Photo < Post
|
||||
require 'carrierwave/orm/mongomapper'
|
||||
include MongoMapper::Document
|
||||
|
|
@ -22,7 +28,7 @@ class Photo < Post
|
|||
timestamps!
|
||||
|
||||
validates_presence_of :album
|
||||
validates_true_for :album_id, :logic => lambda {self.validate_album_person}
|
||||
validates_with PhotoAlbumValidator
|
||||
|
||||
before_destroy :ensure_user_picture
|
||||
|
||||
|
|
@ -36,10 +42,6 @@ class Photo < Post
|
|||
photo
|
||||
end
|
||||
|
||||
def validate_album_person
|
||||
album.person_id == person_id
|
||||
end
|
||||
|
||||
def remote_photo
|
||||
image.url.nil? ? (remote_photo_path + '/' + remote_photo_name) : image.url
|
||||
end
|
||||
|
|
@ -70,3 +72,4 @@ class Photo < Post
|
|||
{:thumb_url => url(:thumb_medium), :id => id, :album_id => album_id}
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -2,10 +2,9 @@
|
|||
# licensed under the Affero General Public License version 3. See
|
||||
# the COPYRIGHT file.
|
||||
|
||||
|
||||
class Post
|
||||
require 'lib/diaspora/websocket'
|
||||
require 'lib/encryptable'
|
||||
require File.expand_path('../../../lib/encryptable', __FILE__)
|
||||
require File.expand_path('../../../lib/diaspora/websocket', __FILE__)
|
||||
include MongoMapper::Document
|
||||
include ApplicationHelper
|
||||
include ROXML
|
||||
|
|
@ -33,7 +32,6 @@ class Post
|
|||
self.create params.to_hash
|
||||
end
|
||||
|
||||
|
||||
def as_json(opts={})
|
||||
{
|
||||
:post => {
|
||||
|
|
|
|||
|
|
@ -2,10 +2,9 @@
|
|||
# licensed under the Affero General Public License version 3. See
|
||||
# the COPYRIGHT file.
|
||||
|
||||
|
||||
class Profile
|
||||
include MongoMapper::EmbeddedDocument
|
||||
require 'lib/diaspora/webhooks'
|
||||
require File.expand_path('../../../lib/diaspora/webhooks', __FILE__)
|
||||
include Diaspora::Webhooks
|
||||
include ROXML
|
||||
|
||||
|
|
|
|||
|
|
@ -2,9 +2,8 @@
|
|||
# licensed under the Affero General Public License version 3. See
|
||||
# the COPYRIGHT file.
|
||||
|
||||
|
||||
class Request
|
||||
require 'lib/diaspora/webhooks'
|
||||
require File.expand_path('../../../lib/diaspora/webhooks', __FILE__)
|
||||
include MongoMapper::Document
|
||||
include Diaspora::Webhooks
|
||||
include ROXML
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
# licensed under the Affero General Public License version 3. See
|
||||
# the COPYRIGHT file.
|
||||
|
||||
|
||||
class Retraction
|
||||
include ROXML
|
||||
include Diaspora::Webhooks
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
# licensed under the Affero General Public License version 3. See
|
||||
# the COPYRIGHT file.
|
||||
|
||||
|
||||
class StatusMessage < Post
|
||||
|
||||
xml_name :status_message
|
||||
|
|
@ -11,7 +10,6 @@ class StatusMessage < Post
|
|||
key :message, String
|
||||
validates_presence_of :message
|
||||
|
||||
|
||||
def to_activity
|
||||
<<-XML
|
||||
<entry>
|
||||
|
|
|
|||
|
|
@ -2,11 +2,10 @@
|
|||
# licensed under the Affero General Public License version 3. See
|
||||
# the COPYRIGHT file.
|
||||
|
||||
|
||||
require 'lib/diaspora/user/friending.rb'
|
||||
require 'lib/diaspora/user/querying.rb'
|
||||
require 'lib/diaspora/user/receiving.rb'
|
||||
require 'lib/salmon/salmon'
|
||||
require File.expand_path('../../../lib/diaspora/user/friending', __FILE__)
|
||||
require File.expand_path('../../../lib/diaspora/user/querying', __FILE__)
|
||||
require File.expand_path('../../../lib/diaspora/user/receiving', __FILE__)
|
||||
require File.expand_path('../../../lib/salmon/salmon', __FILE__)
|
||||
|
||||
class User
|
||||
include MongoMapper::Document
|
||||
|
|
@ -19,6 +18,7 @@ class User
|
|||
devise :database_authenticatable, :registerable,
|
||||
:recoverable, :rememberable, :trackable, :validatable
|
||||
key :username, :unique => true
|
||||
key :serialized_private_key, String
|
||||
|
||||
key :friend_ids, Array
|
||||
key :pending_request_ids, Array
|
||||
|
|
@ -36,7 +36,7 @@ class User
|
|||
|
||||
after_create :seed_aspects
|
||||
|
||||
before_validation_on_create :downcase_username
|
||||
before_validation :downcase_username, :on => :create
|
||||
|
||||
def self.find_for_authentication(conditions={})
|
||||
if conditions[:username] =~ /^([\w\.%\+\-]+)@([\w\-]+\.)+([\w]{2,})$/i # email regex
|
||||
|
|
@ -67,12 +67,11 @@ class User
|
|||
def drop_aspect( aspect )
|
||||
if aspect.people.size == 0
|
||||
aspect.destroy
|
||||
else
|
||||
else
|
||||
raise "Aspect not empty"
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
def move_friend( opts = {})
|
||||
return true if opts[:to] == opts[:from]
|
||||
friend = Person.first(:_id => opts[:friend_id])
|
||||
|
|
@ -108,12 +107,11 @@ class User
|
|||
intitial_post(class_name, aspect_ids, options)
|
||||
end
|
||||
|
||||
|
||||
def intitial_post(class_name, aspect_ids, options = {})
|
||||
def intitial_post(class_name, aspect_ids, options = {})
|
||||
post = build_post(class_name, options)
|
||||
post.socket_to_uid(id, :aspect_ids => aspect_ids) if post.respond_to?(:socket_to_uid)
|
||||
push_to_aspects(post, aspect_ids)
|
||||
post
|
||||
post
|
||||
end
|
||||
|
||||
def repost( post, options = {} )
|
||||
|
|
@ -129,16 +127,20 @@ class User
|
|||
end
|
||||
|
||||
def validate_aspect_permissions(aspect_ids)
|
||||
aspect_ids = [aspect_ids.to_s] if aspect_ids.is_a? BSON::ObjectId
|
||||
if aspect_ids == "all"
|
||||
return aspect_ids
|
||||
end
|
||||
|
||||
aspect_ids = [aspect_ids.to_s] unless aspect_ids.is_a? Array
|
||||
|
||||
if aspect_ids.nil? || aspect_ids.empty?
|
||||
raise ArgumentError.new("You must post to someone.")
|
||||
end
|
||||
|
||||
aspect_ids.each do |aspect_id|
|
||||
unless aspect_id == "all" || self.aspects.find(aspect_id)
|
||||
unless self.aspects.find(aspect_id)
|
||||
raise ArgumentError.new("Cannot post to an aspect you do not own.")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
aspect_ids
|
||||
|
|
@ -250,7 +252,9 @@ class User
|
|||
def self.instantiate!( opts = {} )
|
||||
opts[:person][:diaspora_handle] = "#{opts[:username]}@#{APP_CONFIG[:terse_pod_url]}"
|
||||
opts[:person][:url] = APP_CONFIG[:pod_url]
|
||||
opts[:person][:serialized_key] = generate_key
|
||||
|
||||
opts[:serialized_private_key] = generate_key
|
||||
opts[:person][:serialized_public_key] = opts[:serialized_private_key].public_key
|
||||
User.create(opts)
|
||||
end
|
||||
|
||||
|
|
@ -258,22 +262,15 @@ class User
|
|||
aspect(:name => "Family")
|
||||
aspect(:name => "Work")
|
||||
end
|
||||
|
||||
def terse_url
|
||||
terse = APP_CONFIG[:pod_url].gsub(/(https?:|www\.)\/\//, '')
|
||||
terse = terse.chop! if terse[-1, 1] == '/'
|
||||
terse
|
||||
end
|
||||
|
||||
def diaspora_handle
|
||||
"#{self.username}@#{self.terse_url}"
|
||||
"#{self.username}@#{APP_CONFIG[:terse_pod_url]}"
|
||||
end
|
||||
|
||||
def downcase_username
|
||||
username.downcase! if username
|
||||
end
|
||||
|
||||
|
||||
def as_json(opts={})
|
||||
{
|
||||
:user => {
|
||||
|
|
@ -284,7 +281,14 @@ class User
|
|||
}
|
||||
}
|
||||
end
|
||||
def self.generate_key
|
||||
OpenSSL::PKey::RSA::generate 4096
|
||||
end
|
||||
|
||||
|
||||
def self.generate_key
|
||||
OpenSSL::PKey::RSA::generate 4096
|
||||
end
|
||||
|
||||
def encryption_key
|
||||
OpenSSL::PKey::RSA.new( serialized_private_key )
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
# licensed under the Affero General Public License version 3. See
|
||||
# the COPYRIGHT file.
|
||||
|
||||
|
||||
class ImageUploader < CarrierWave::Uploader::Base
|
||||
include CarrierWave::MiniMagick
|
||||
|
||||
|
|
|
|||
|
|
@ -8,11 +8,11 @@
|
|||
|
||||
%div.time
|
||||
by
|
||||
= link_to ((current_user.person == post.person)? 'you' : post.person.real_name), person_path(post.person)
|
||||
= link_to ((current_user.person == post.person)? t('.you') : post.person.real_name), person_path(post.person)
|
||||
%br
|
||||
= link_to(how_long_ago(post), object_path(post, :aspect => @aspect))
|
||||
|
||||
%div.image_cycle
|
||||
- for photo in post.photos[0..3]
|
||||
= link_to (image_tag photo.url(:thumb_large)), album_path(post, :aspect => @aspect)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -2,8 +2,7 @@
|
|||
-# licensed under the Affero General Public License version 3. See
|
||||
-# the COPYRIGHT file.
|
||||
|
||||
|
||||
%h1 Add a new album
|
||||
%h1=t('.add_a_new_album')
|
||||
|
||||
= form_for Album.new do |f|
|
||||
= f.error_messages
|
||||
|
|
@ -11,4 +10,4 @@
|
|||
= f.label :name
|
||||
= f.text_field :name
|
||||
= f.hidden_field :to, :value => aspect
|
||||
= f.submit 'create', :class => 'button'
|
||||
= f.submit t('.create'), :class => 'button'
|
||||
|
|
|
|||
|
|
@ -2,14 +2,13 @@
|
|||
-# licensed under the Affero General Public License version 3. See
|
||||
-# the COPYRIGHT file.
|
||||
|
||||
|
||||
.back= link_to "⇧ #{@album.name}", @album
|
||||
%h1.big_text
|
||||
|
||||
= "Editing #{@album.name}"
|
||||
= "#{t('.editing')} #{@album.name}"
|
||||
|
||||
.sub_header
|
||||
="updated #{how_long_ago(@album)}"
|
||||
="#{t('.updated')} #{how_long_ago(@album)}"
|
||||
|
||||
- form_for @album do |a|
|
||||
= a.error_messages
|
||||
|
|
@ -21,12 +20,12 @@
|
|||
.photo_edit_block= image_tag photo.url(:thumb_medium)
|
||||
|
||||
#submit_block
|
||||
= link_to "Cancel", root_path
|
||||
= link_to t('.cancel'), root_path
|
||||
or
|
||||
= a.submit
|
||||
|
||||
.button.delete
|
||||
= link_to 'Delete Album', @album, :confirm => 'Are you sure?', :method => :delete
|
||||
= link_to t('.delete_album'), @album, :confirm => t('.are_you_sure'), :method => :delete
|
||||
|
||||
#content_bottom
|
||||
.back
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
-# licensed under the Affero General Public License version 3. See
|
||||
-# the COPYRIGHT file.
|
||||
|
||||
|
||||
- content_for :head do
|
||||
:javascript
|
||||
$(document).ready(function(){
|
||||
|
|
@ -10,7 +9,7 @@
|
|||
});
|
||||
|
||||
= content_for :page_title do
|
||||
= link_to "◂ Home", aspects_path, :aspect => params[:aspect]
|
||||
= link_to "◂ #{t('.home')}", aspects_path, :aspect => params[:aspect]
|
||||
|
||||
- content_for :left_pane do
|
||||
= render "shared/aspect_friends"
|
||||
|
|
@ -19,7 +18,7 @@
|
|||
%h1
|
||||
Albums
|
||||
.right
|
||||
= link_to 'New Album', '#new_album_pane', {:class => "button", :id => "add_album_button"}
|
||||
= link_to t('.new_album'), '#new_album_pane', {:class => "button", :id => "add_album_button"}
|
||||
|
||||
.yo{:style => "display:none;" }
|
||||
#new_album_pane
|
||||
|
|
@ -34,4 +33,4 @@
|
|||
|
||||
#content_bottom
|
||||
.back
|
||||
= link_to "⇧ home", root_path
|
||||
= link_to "⇧ #{t('.home')}", root_path
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
-# licensed under the Affero General Public License version 3. See
|
||||
-# the COPYRIGHT file.
|
||||
|
||||
|
||||
:javascript
|
||||
$(document).ready(function(){
|
||||
$(".image_thumb img").load( function() {
|
||||
|
|
@ -11,7 +10,7 @@
|
|||
});
|
||||
|
||||
= content_for :page_title do
|
||||
= link_to "◂ Albums", albums_path(:aspect => @aspect)
|
||||
= link_to "◂ #{t('.albums')}", albums_path(:aspect => @aspect)
|
||||
|
||||
- content_for :left_pane do
|
||||
= render "shared/aspect_friends"
|
||||
|
|
@ -20,17 +19,15 @@
|
|||
-if current_user.owns? @album
|
||||
.right
|
||||
=render 'photos/new_photo'
|
||||
= link_to 'Edit Album', edit_album_path(@album), :class => 'button'
|
||||
= link_to t('.edit_album'), edit_album_path(@album), :class => 'button'
|
||||
%h1
|
||||
= @album.name
|
||||
="updated #{how_long_ago(@album)}"
|
||||
|
||||
|
||||
="#{t('.updated')} #{how_long_ago(@album)}"
|
||||
|
||||
.album_id{:id => @album.id, :style => "display:hidden;"}
|
||||
|
||||
-unless current_user.owns? @album
|
||||
%h4= "by #{@album.person.real_name}"
|
||||
%h4= "#{t('.by')} #{@album.person.real_name}"
|
||||
|
||||
#thumbnails
|
||||
- for photo in @album_photos
|
||||
|
|
@ -39,5 +36,4 @@
|
|||
|
||||
#content_bottom
|
||||
.back
|
||||
= link_to "⇧ albums", albums_path
|
||||
|
||||
= link_to "⇧ #{t('.albums')}", albums_path
|
||||
|
|
|
|||
|
|
@ -2,11 +2,10 @@
|
|||
-# licensed under the Affero General Public License version 3. See
|
||||
-# the COPYRIGHT file.
|
||||
|
||||
|
||||
%h1=t('.add_a_new_aspect')
|
||||
= form_for Aspect.new do |f|
|
||||
= f.error_messages
|
||||
%p
|
||||
= f.label :name
|
||||
= f.text_field :name
|
||||
= f.submit 'create', :class => 'button'
|
||||
= f.submit t('.create'), :class => 'button'
|
||||
|
|
|
|||
|
|
@ -2,10 +2,8 @@
|
|||
-# licensed under the Affero General Public License version 3. See
|
||||
-# the COPYRIGHT file.
|
||||
|
||||
|
||||
- content_for :page_title do
|
||||
= link_to "photos", albums_path(:aspect => @aspect)
|
||||
|
||||
= link_to t('.photos'), albums_path(:aspect => @aspect)
|
||||
|
||||
- content_for :left_pane do
|
||||
= render "shared/aspect_friends"
|
||||
|
|
|
|||
|
|
@ -2,14 +2,12 @@
|
|||
-# licensed under the Affero General Public License version 3. See
|
||||
-# the COPYRIGHT file.
|
||||
|
||||
|
||||
- content_for :head do
|
||||
- content_for :head do
|
||||
= javascript_include_tag 'jquery-ui-1.8.4.custom.min.js'
|
||||
= javascript_include_tag 'aspect-edit.js'
|
||||
|
||||
- content_for :left_pane do
|
||||
%h1
|
||||
Requests
|
||||
%h1=t('.requests')
|
||||
|
||||
.requests
|
||||
%ul.dropzone
|
||||
|
|
@ -21,34 +19,31 @@
|
|||
= person_image_tag(request.person)
|
||||
.name
|
||||
= request.person.real_name
|
||||
%h1
|
||||
Ignore/Remove
|
||||
%h1=t('.ignore_remove')
|
||||
|
||||
%li.remove
|
||||
%ul.dropzone
|
||||
%li.grey Drag to ignore/remove
|
||||
|
||||
- content_for :publish do
|
||||
= link_to("add a new aspect", "#add_aspect_pane", :id => "add_aspect_button", :class => "new_aspect button", :title => "Add a new aspect")
|
||||
|
||||
|
||||
= link_to(t('.add_a_new_aspect'), "#add_aspect_pane", :id => "add_aspect_button", :class => "new_aspect button", :title => t('.add_a_new_aspect'))
|
||||
|
||||
%ul#aspect_list
|
||||
- for aspect in @aspects
|
||||
%li.aspect
|
||||
|
||||
|
||||
.aspect_name
|
||||
%span.edit_name_field
|
||||
%h1{:contenteditable => true}= aspect.name
|
||||
%span.tip click to edit
|
||||
|
||||
%ul.tools
|
||||
%li= link_to "add a new friend", "#add_request_pane_#{aspect.id}", :class => 'add_request_button'
|
||||
%li= link_to "show", aspect_path(aspect)
|
||||
%li= link_to t('.add_a_new_friend'), "#add_request_pane_#{aspect.id}", :class => 'add_request_button'
|
||||
%li= link_to t('.show'), aspect_path(aspect)
|
||||
%li!= remove_link(aspect)
|
||||
|
||||
|
||||
%ul.dropzone{:id => aspect.id}
|
||||
|
||||
|
||||
-if aspect.people.size < 1
|
||||
%li.grey Drag to add people
|
||||
|
||||
|
|
|
|||
|
|
@ -2,9 +2,8 @@
|
|||
-# licensed under the Affero General Public License version 3. See
|
||||
-# the COPYRIGHT file.
|
||||
|
||||
|
||||
- content_for :page_title do
|
||||
= link_to "photos", albums_path(:aspect => @aspect)
|
||||
= link_to t('.photos'), albums_path(:aspect => @aspect)
|
||||
|
||||
- content_for :left_pane do
|
||||
= render "shared/aspect_friends"
|
||||
|
|
|
|||
|
|
@ -2,8 +2,7 @@
|
|||
-# licensed under the Affero General Public License version 3. See
|
||||
-# the COPYRIGHT file.
|
||||
|
||||
|
||||
%li.comment{:id => post.id}
|
||||
%li.comment{:id => post.id}
|
||||
= person_image_tag(post.person)
|
||||
%span.from
|
||||
= link_to post.person.real_name, post.person
|
||||
|
|
|
|||
|
|
@ -2,11 +2,10 @@
|
|||
-# licensed under the Affero General Public License version 3. See
|
||||
-# the COPYRIGHT file.
|
||||
|
||||
|
||||
%div.comments
|
||||
%ul.comment_set{:id => post.id}
|
||||
- for comment in post.comments
|
||||
= render 'comments/comment', :post => comment
|
||||
%li.comment.show
|
||||
= render 'comments/new_comment', :post => post
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
-# licensed under the Affero General Public License version 3. See
|
||||
-# the COPYRIGHT file.
|
||||
|
||||
|
||||
= form_for Comment.new, :remote => true do |f|
|
||||
%p
|
||||
%label{:for => "comment_text_on_#{post.id}"} Comment
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
%h1
|
||||
This is a technology preview, do not provide any private information.
|
||||
%h3
|
||||
your account may be deleted until we move into a more stable development period.
|
||||
%h3
|
||||
your account may be deleted until we move into a more stable development period.
|
||||
%h3
|
||||
USE AT YOUR OWN RISK!!
|
||||
= form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f|
|
||||
|
|
@ -10,7 +10,7 @@
|
|||
= f.label :username
|
||||
= f.text_field :username
|
||||
%p.user_network
|
||||
="@#{APP_CONFIG[:pod_url]}"
|
||||
="@#{APP_CONFIG[:terse_pod_url]}"
|
||||
|
||||
%p
|
||||
= f.label :password
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
-# licensed under the Affero General Public License version 3. See
|
||||
-# the COPYRIGHT file.
|
||||
|
||||
|
||||
= javascript_include_tag 'FABridge', 'swfobject', 'web_socket'
|
||||
:javascript
|
||||
WebSocket.__swfLocation = "/javascripts/WebSocketMain.swf";
|
||||
|
|
@ -19,25 +18,23 @@
|
|||
|
||||
if (obj['class']=="retractions"){
|
||||
processRetraction(obj['post_id']);
|
||||
|
||||
|
||||
}else if (obj['class']=="comments"){
|
||||
processComment(obj['post_id'], obj['html'])
|
||||
|
||||
processComment(obj['post_id'], obj['html'])
|
||||
|
||||
}else if (obj['class']=='photos' && onPageForClass('albums')){
|
||||
processPhotoInAlbum(obj['photo_hash'])
|
||||
}else{
|
||||
processPost(obj['class'], obj['html'], obj['aspect_ids'])
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
};
|
||||
ws.onclose = function() { debug("socket closed"); };
|
||||
ws.onopen = function() {
|
||||
ws.send(location.pathname);
|
||||
debug("connected...");
|
||||
};
|
||||
|
||||
|
||||
});
|
||||
function processRetraction(post_id){
|
||||
$('#' + post_id ).fadeOut(500, function(){
|
||||
|
|
@ -66,7 +63,7 @@
|
|||
$(html).fadeIn("fast", function(){
|
||||
$("#stream label:first").inFieldLabels();
|
||||
})
|
||||
);
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -77,13 +74,13 @@
|
|||
html = "<div class=\'image_thumb\' id=\'"+photoHash['id']+"\' style=\'padding-right:3px;\'> \
|
||||
<a href=\"/photos/"+ photoHash['id'] +"\"> \
|
||||
<img alt=\"New thumbnail\" src=\""+ photoHash['thumb_url'] +"\" /> \
|
||||
</a> </div>"
|
||||
</a> </div>"
|
||||
$("#thumbnails").append( $(html) )
|
||||
$("#"+ photoHash['id'] + " img").load( function() {
|
||||
$(this).fadeIn("slow");
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function onPageForClass(className){
|
||||
return (location.href.indexOf(className) != -1 );
|
||||
}
|
||||
|
|
@ -100,9 +97,9 @@
|
|||
}
|
||||
|
||||
function onPageForAspect(aspectId){
|
||||
return (location.href.indexOf(aspectId) != -1 )
|
||||
return (location.href.indexOf(aspectId) != -1 )
|
||||
}
|
||||
|
||||
|
||||
function onPageOne() {
|
||||
var c = document.location.search.charAt(document.location.search.length-1);
|
||||
return ((c =='') || (c== '1'));
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
-# licensed under the Affero General Public License version 3. See
|
||||
-# the COPYRIGHT file.
|
||||
|
||||
|
||||
!!!
|
||||
%html
|
||||
%head
|
||||
|
|
@ -10,24 +9,24 @@
|
|||
= "#{current_user.real_name} | diaspora" if current_user
|
||||
|
||||
%meta{"http-equiv"=>"Content-Type", :content=>"text/html; charset=utf-8"}/
|
||||
|
||||
|
||||
= stylesheet_link_tag "blueprint/screen", :media => 'screen'
|
||||
= stylesheet_link_tag "application", "ui"
|
||||
|
||||
= stylesheet_link_tag "/../javascripts/fancybox/jquery.fancybox-1.3.1"
|
||||
= stylesheet_link_tag "fileuploader"
|
||||
= stylesheet_link_tag "/../javascripts/fancybox/jquery.fancybox-1.3.1"
|
||||
= stylesheet_link_tag "fileuploader"
|
||||
|
||||
/= javascript_include_tag "http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"
|
||||
= javascript_include_tag 'jquery-1.4.2.min', 'rails'
|
||||
= javascript_include_tag 'jquery.infieldlabel', 'jquery.cycle/jquery.cycle.min.js'
|
||||
|
||||
|
||||
= javascript_include_tag 'fancybox/jquery.fancybox-1.3.1.pack'
|
||||
= javascript_include_tag 'fileuploader'
|
||||
|
||||
= javascript_include_tag 'view', 'image_picker', 'stream'
|
||||
|
||||
= render 'js/websocket_js'
|
||||
|
||||
|
||||
= csrf_meta_tag
|
||||
= yield(:head)
|
||||
|
||||
|
|
@ -50,8 +49,8 @@
|
|||
= text_field_tag 'q'
|
||||
|
||||
%li= link_to current_user.real_name, current_user.person
|
||||
%li= link_to "settings", edit_user_path(current_user)
|
||||
%li= link_to "logout", destroy_user_session_path
|
||||
%li= link_to t('.edit_profile'), edit_user_path(current_user)
|
||||
%li= link_to t('.logout.'), destroy_user_session_path
|
||||
|
||||
= render "shared/aspect_nav"
|
||||
= render "shared/sub_header"
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
-# licensed under the Affero General Public License version 3. See
|
||||
-# the COPYRIGHT file.
|
||||
|
||||
|
||||
!!!
|
||||
%html
|
||||
%head
|
||||
|
|
@ -10,7 +9,7 @@
|
|||
DIASPORA | login
|
||||
%meta{"http-equiv"=>"Content-Type", :content=>"text/html; charset=utf-8"}/
|
||||
%meta{"http-equiv"=> "X-UA-Compatible", :content =>"chrome=1" }
|
||||
|
||||
|
||||
= stylesheet_link_tag "sessions"
|
||||
/= javascript_include_tag"http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"
|
||||
= javascript_include_tag 'jquery142'
|
||||
|
|
@ -18,10 +17,10 @@
|
|||
|
||||
:javascript
|
||||
$(document).ready(function(){
|
||||
$("#user_username").focus();
|
||||
$("#user_username").focus();
|
||||
$("label").inFieldLabels();
|
||||
});
|
||||
|
||||
|
||||
= csrf_meta_tag
|
||||
= yield(:head)
|
||||
|
||||
|
|
@ -44,11 +43,11 @@
|
|||
</div>
|
||||
</div>
|
||||
<![endif]-->
|
||||
|
||||
|
||||
- flash.each do |name, msg|
|
||||
= content_tag :div, msg, :id => "flash_#{name}"
|
||||
%div#huge_text
|
||||
DIASPORA*
|
||||
= yield
|
||||
|
||||
|
||||
/= link_to "signup", "/signup"
|
||||
|
|
|
|||
|
|
@ -19,9 +19,9 @@
|
|||
- elsif current_user.friends.include?(person)
|
||||
Already friends
|
||||
- elsif current_user.pending_requests.find_by_person_id(person.id)
|
||||
= link_to "pending request", aspects_manage_path
|
||||
= link_to =t('.pending_request'), aspects_manage_path
|
||||
- else
|
||||
= form_for Request.new do |f|
|
||||
= f.select(:aspect_id, @aspects_dropdown_array)
|
||||
= f.hidden_field :destination_url, :value => person.diaspora_handle
|
||||
= f.submit "add friend"
|
||||
= f.submit t('.add_friend')
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
-# licensed under the Affero General Public License version 3. See
|
||||
-# the COPYRIGHT file.
|
||||
|
||||
|
||||
- content_for :publish do
|
||||
%h1
|
||||
Search
|
||||
|
|
@ -21,5 +20,5 @@
|
|||
%ul#stream
|
||||
- for person in @people
|
||||
= render 'people/person', :person => person
|
||||
|
||||
|
||||
= will_paginate @people
|
||||
|
|
|
|||
|
|
@ -2,8 +2,7 @@
|
|||
-# licensed under the Affero General Public License version 3. See
|
||||
-# the COPYRIGHT file.
|
||||
|
||||
|
||||
- title "New Person"
|
||||
- title=t('.new_person')
|
||||
|
||||
= form_for @person do |f|
|
||||
= f.error_messages
|
||||
|
|
@ -15,18 +14,17 @@
|
|||
= f.label :url
|
||||
%br
|
||||
= f.text_field :url
|
||||
|
||||
|
||||
=f.fields_for :profile do |p|
|
||||
%p
|
||||
= p.label :first_name
|
||||
%br
|
||||
= p.text_field :first_name
|
||||
|
||||
|
||||
%p
|
||||
= p.label :last_name
|
||||
%br
|
||||
= p.text_field :last_name
|
||||
= f.submit
|
||||
|
||||
|
||||
%p= link_to "Back to List", people_path
|
||||
%p= link_to t('.back_to_list'), people_path
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
-# licensed under the Affero General Public License version 3. See
|
||||
-# the COPYRIGHT file.
|
||||
|
||||
|
||||
- content_for :page_title do
|
||||
profile
|
||||
|
||||
|
|
@ -13,22 +12,22 @@
|
|||
%ul
|
||||
-unless @posts.first.nil?
|
||||
%li
|
||||
%i= "last seen: #{how_long_ago(@posts.first)}"
|
||||
%i= t(".last_seen",:how_long_ago => how_long_ago(@posts.first))
|
||||
- if @person != current_user.person && current_user.friends.include?(@person)
|
||||
%li
|
||||
%i= "friends since: #{how_long_ago(@person)}"
|
||||
%i= t(".friends_since",:how_long_ago => how_long_ago(@person))
|
||||
%li
|
||||
= form_tag move_friend_path
|
||||
= select :to, :to, @aspects_dropdown_array, :selected => @aspects_with_person.first.id
|
||||
= hidden_field_tag :from, :from, :value => @aspects_with_person.first.id
|
||||
= hidden_field_tag :friend_id, :friend_id, :value => @person.id
|
||||
= submit_tag "save"
|
||||
= submit_tag t('.save')
|
||||
|
||||
- if @person != current_user.person && current_user.friends.include?(@person)
|
||||
= link_to 'remove friend', @person, :confirm => 'Are you sure?', :method => :delete, :class => "button"
|
||||
= link_to t('.remove_friend'), @person, :confirm => t('.are_you_sure'), :method => :delete, :class => "button"
|
||||
|
||||
.span-20.last
|
||||
|
||||
|
||||
.span-19.last
|
||||
- if @posts
|
||||
%ul#stream
|
||||
|
|
@ -36,4 +35,4 @@
|
|||
= render type_partial(post), :post => post unless post.class == Album
|
||||
= will_paginate @posts
|
||||
- else
|
||||
%h3 no posts to display!
|
||||
%h3=t('no posts to display!')
|
||||
|
|
|
|||
|
|
@ -2,16 +2,15 @@
|
|||
-# licensed under the Affero General Public License version 3. See
|
||||
-# the COPYRIGHT file.
|
||||
|
||||
|
||||
:javascript
|
||||
function createUploader(){
|
||||
function createUploader(){
|
||||
var uploader = new qq.FileUploader({
|
||||
element: document.getElementById('file-upload'),
|
||||
params: {'album_id' : "#{@album.id}"},
|
||||
allowedExtensions: ['jpg', 'jpeg', 'png'],
|
||||
allowedExtensions: ['jpg', 'jpeg', 'png', 'gif'],
|
||||
action: "#{photos_path}"
|
||||
});
|
||||
});
|
||||
}
|
||||
window.onload = createUploader;
|
||||
window.onload = createUploader;
|
||||
|
||||
#file-upload
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
-# licensed under the Affero General Public License version 3. See
|
||||
-# the COPYRIGHT file.
|
||||
|
||||
|
||||
%li.message{:id => post.id}
|
||||
|
||||
= person_image_tag(post.person)
|
||||
|
|
@ -11,15 +10,15 @@
|
|||
%span.from
|
||||
= link_to post.person.real_name, post.person
|
||||
%b
|
||||
posted a new photo to
|
||||
=t('.posted_a_new_photo_to')
|
||||
= link_to post.album.name, object_path(post.album)
|
||||
|
||||
%br
|
||||
= render "albums/album", :post => post.album, :current_user => current_user
|
||||
= link_to (image_tag post.url(:thumb_medium)), object_path(post)
|
||||
|
||||
|
||||
.info
|
||||
= link_to(how_long_ago(post), photo_path(post))
|
||||
\--
|
||||
= link_to "show comments (#{post.comments.count})", '#', :class => "show_post_comments"
|
||||
= render "comments/comments", :post => post
|
||||
= link_to "#{t('.show_comments')} (#{post.comments.count})", '#', :class => "show_post_comments"
|
||||
= render "comments/comments", :post => post
|
||||
|
|
|
|||
|
|
@ -2,11 +2,10 @@
|
|||
-# licensed under the Affero General Public License version 3. See
|
||||
-# the COPYRIGHT file.
|
||||
|
||||
|
||||
%h1.big_text
|
||||
.back
|
||||
= link_to "⇧ #{@album.name}", album_path(@album)
|
||||
= "Editing #{@photo.image}"
|
||||
= "#{t('.editing')} #{@photo.image}"
|
||||
|
||||
%div{:id => @photo.id}
|
||||
|
||||
|
|
@ -14,6 +13,7 @@
|
|||
= linked_scaled_photo @photo, @album
|
||||
|
||||
= form_for @photo do |p|
|
||||
= p.label :caption
|
||||
= p.text_field :caption, :value => @photo.caption
|
||||
= p.submit
|
||||
|
||||
|
|
@ -22,5 +22,5 @@
|
|||
= link_to "⇧ #{@album.name}", album_path(@album)
|
||||
-if current_user.owns? @album
|
||||
.button.right
|
||||
= link_to 'Delete Photo', @photo, :confirm => 'Are you sure?', :method => :delete
|
||||
= link_to t('.delete_photo'), @photo, :confirm => t('.are_you_sure'), :method => :delete
|
||||
|
||||
|
|
|
|||
|
|
@ -2,13 +2,12 @@
|
|||
-# licensed under the Affero General Public License version 3. See
|
||||
-# the COPYRIGHT file.
|
||||
|
||||
|
||||
- title "New Photo"
|
||||
- title t('.new_photo')
|
||||
|
||||
= form_for( @photo, :html => {:multipart => true}) do |f|
|
||||
= f.error_messages
|
||||
%p
|
||||
= f.file_field :image
|
||||
= f.submit 'post it!', :class => 'button'
|
||||
= f.submit t('.post_it'), :class => 'button'
|
||||
|
||||
%p= link_to "Back to List", photos_path
|
||||
%p= link_to t('.back_to_list'), photos_path
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
-# licensed under the Affero General Public License version 3. See
|
||||
-# the COPYRIGHT file.
|
||||
|
||||
|
||||
:javascript
|
||||
$(document).keydown(function(e){
|
||||
switch(e.keyCode) {
|
||||
|
|
@ -25,16 +24,15 @@
|
|||
%h1
|
||||
= @photo.image
|
||||
|
||||
= link_to "<< prev", url_to_prev(@photo, @album)
|
||||
= link_to "<< #{t('.prev')}", url_to_prev(@photo, @album)
|
||||
|
|
||||
= link_to "full size", @photo.url
|
||||
= link_to "#{t('.full_size')}", @photo.url
|
||||
|
|
||||
= link_to "next >>", url_to_next(@photo, @album)
|
||||
= link_to "#{t('.next')} >>", url_to_next(@photo, @album)
|
||||
|
||||
.right
|
||||
-if current_user.owns? @album
|
||||
= link_to 'Edit Photo', edit_photo_path(@photo), :class => "button"
|
||||
|
||||
= link_to t('.edit_photo'), edit_photo_path(@photo), :class => "button"
|
||||
|
||||
%div{:id => @photo.id}
|
||||
#show_photo
|
||||
|
|
@ -48,9 +46,9 @@
|
|||
|
||||
-if current_user.owns? @album
|
||||
.right
|
||||
= link_to 'Delete Photo', @photo, :confirm => 'Are you sure?', :method => :delete, :class => 'button'
|
||||
= link_to t('.delete_photo'), @photo, :confirm => t('.are_you_sure'), :method => :delete, :class => 'button'
|
||||
|
||||
%h4{:class => "show_post_comments"}
|
||||
= "comments (#{@photo.comments.count})"
|
||||
= "#{t('.comments')} (#{@photo.comments.count})"
|
||||
= render "comments/comments", :post => @photo
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
-# licensed under the Affero General Public License version 3. See
|
||||
-# the COPYRIGHT file.
|
||||
|
||||
|
||||
#debug_info
|
||||
%h5 DEBUG INFO
|
||||
#debug_more{ :style => "display:none;" }
|
||||
|
|
|
|||
|
|
@ -2,8 +2,7 @@
|
|||
-# licensed under the Affero General Public License version 3. See
|
||||
-# the COPYRIGHT file.
|
||||
|
||||
|
||||
%ul
|
||||
%h3= link_to post.class, object_path(post)
|
||||
%h3= link_to post.class, object_path(post)
|
||||
- for field in object_fields(post)
|
||||
%li= "#{field}: #{post.attributes[field]}"
|
||||
%li= "#{field}: #{post.attributes[field]}"
|
||||
|
|
|
|||
|
|
@ -1,42 +1,42 @@
|
|||
<div id="content">
|
||||
<h1><%=@person.real_name%></h1>
|
||||
<div id="content_inner">
|
||||
<div id="i" class="entity_profile vcard author">
|
||||
<h2>User profile</h2>
|
||||
<dl class="entity_nickname">
|
||||
<dt>Nickname</dt>
|
||||
<dd>
|
||||
<a href="<%=@person.url%>" rel="me" class="nickname url uid"><%= @person.real_name%></a>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="entity_given_name">
|
||||
<dt>Full name</dt>
|
||||
<dd>
|
||||
<span class="given_name" ><%= @person.profile.first_name %></span>
|
||||
</dd>
|
||||
<div id="content">
|
||||
<h1><%=@person.real_name%></h1>
|
||||
<div id="content_inner">
|
||||
<div id="i" class="entity_profile vcard author">
|
||||
<h2>User profile</h2>
|
||||
<dl class="entity_nickname">
|
||||
<dt>Nickname</dt>
|
||||
<dd>
|
||||
<a href="<%=@person.url%>" rel="me" class="nickname url uid"><%= @person.real_name%></a>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="entity_given_name">
|
||||
<dt>Full name</dt>
|
||||
<dd>
|
||||
<span class="given_name" ><%= @person.profile.first_name %></span>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="entity_family_name">
|
||||
<dt>Full name</dt>
|
||||
<dd>
|
||||
<span class="family_name" ><%= @person.profile.last_name %></span>
|
||||
</dd>
|
||||
<dl class="entity_family_name">
|
||||
<dt>Full name</dt>
|
||||
<dd>
|
||||
<span class="family_name" ><%= @person.profile.last_name %></span>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="entity_fn">
|
||||
<dt>Full name</dt>
|
||||
<dd>
|
||||
<span class="fn" ><%= @person.real_name %></span>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="entity_url">
|
||||
<dt>URL</dt>
|
||||
<dd>
|
||||
<a href="<%= @person.url%>" rel="me" id="pod_location" class="url"><%= @person.url%></a>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="entity_note">
|
||||
<dt>Note</dt>
|
||||
<dd class="note">Diaspora is awesome! vi is better than emacs!</dd>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<dl class="entity_fn">
|
||||
<dt>Full name</dt>
|
||||
<dd>
|
||||
<span class="fn" ><%= @person.real_name %></span>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="entity_url">
|
||||
<dt>URL</dt>
|
||||
<dd>
|
||||
<a href="<%= @person.url%>" rel="me" id="pod_location" class="url"><%= @person.url%></a>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="entity_note">
|
||||
<dt>Note</dt>
|
||||
<dd class="note">Diaspora is awesome! vi is better than emacs!</dd>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<XRD xmlns='http://docs.oasis-open.org/ns/xri/xrd-1.0'
|
||||
<XRD xmlns='http://docs.oasis-open.org/ns/xri/xrd-1.0'
|
||||
xmlns:hm='http://host-meta.net/xrd/1.0'>
|
||||
<hm:Host><%= terse_url(root_url) %></hm:Host>
|
||||
<Link rel='lrdd'
|
||||
<Link rel='lrdd'
|
||||
template='<%= root_url %>webfinger?q={uri}'>
|
||||
<Title>Resource Descriptor</Title>
|
||||
</Link>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
= image_tag "http://needcoffee.cachefly.net/needcoffee/uploads/2009/02/predator-arnold-schwarzenegger.jpg"
|
||||
|
||||
|
||||
= form_for(resource, :as => resource_name, :url => registration_path(resource_name)) do |f|
|
||||
%p
|
||||
= f.label :username
|
||||
|
|
@ -24,5 +23,5 @@
|
|||
= pr.label :last_name
|
||||
= pr.text_field :last_name
|
||||
|
||||
= f.submit "Sign up"
|
||||
= f.submit t('.sign_up')
|
||||
= render :partial => "devise/shared/links"
|
||||
|
|
|
|||
|
|
@ -2,20 +2,19 @@
|
|||
-# licensed under the Affero General Public License version 3. See
|
||||
-# the COPYRIGHT file.
|
||||
|
||||
|
||||
%h1
|
||||
Add a new friend to
|
||||
=t('.add_a_new_friend_to')
|
||||
%i= aspect.name
|
||||
|
||||
= form_for Request.new do |f|
|
||||
= f.error_messages
|
||||
|
||||
Enter a Diaspora username:
|
||||
=t('.enter_a_diaspora_username')
|
||||
%br
|
||||
%i= "Your Diaspora username is: #{current_user.diaspora_handle}"
|
||||
%i= t '.your_diaspora_username_is', :diaspora_handle => current_user.diaspora_handle
|
||||
|
||||
%p
|
||||
= f.label :destination_url, "Friend's username"
|
||||
= f.label :destination_url, t(".friends_username")
|
||||
= f.text_field :destination_url
|
||||
= f.hidden_field :aspect_id, :value => aspect.id
|
||||
= f.submit
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
-# licensed under the Affero General Public License version 3. See
|
||||
-# the COPYRIGHT file.
|
||||
|
||||
|
||||
#friend_pictures
|
||||
= owner_image_link
|
||||
- for friend in @friends
|
||||
|
|
@ -14,11 +13,11 @@
|
|||
= image_tag( "http://graph.facebook.com/#{friend[:id]}/picture" )
|
||||
-unless (@aspect == :all) || (@aspect == :public)
|
||||
= link_to (image_tag('add_friend_button.png', :height => "50px", :width => "50px")), "#add_request_pane", :id => 'add_request_button'
|
||||
|
||||
|
||||
.yo{:style => 'display:none'}
|
||||
#add_request_pane
|
||||
= render "requests/new_request", :aspect => @aspect
|
||||
= render "requests/new_request", :aspect => @aspect
|
||||
-else
|
||||
.clear
|
||||
= link_to "add friends", aspects_manage_path
|
||||
= link_to t('.add_friends'), aspects_manage_path
|
||||
|
||||
|
|
|
|||
|
|
@ -2,21 +2,20 @@
|
|||
-# licensed under the Affero General Public License version 3. See
|
||||
-# the COPYRIGHT file.
|
||||
|
||||
|
||||
#aspect_nav
|
||||
%ul
|
||||
- for aspect in @aspects
|
||||
%li{:class => ("selected" if current_aspect?(aspect))}
|
||||
= link_for_aspect aspect
|
||||
%li{:class => ("selected" if @aspect == :all)}
|
||||
= link_to "All Aspects", root_url
|
||||
= link_to t('.all_aspects'), root_url
|
||||
|
||||
%ul{ :style => "position:absolute;right:0;bottom:0.01em;"}
|
||||
%li{:class => ("selected" if @aspect == :public)}
|
||||
= link_to "Public", aspects_public_path
|
||||
|
||||
%li{ :style => "margin-right:0;", :class => ("selected" if @aspect == :manage)}
|
||||
= link_to ( (@request_count == 0)? "Manage Aspects" : "Manage Aspects (#{@request_count})"), {:controller => :aspects, :action => :manage}, :class => "edit_aspect_button", :class => new_request(@request_count), :title => "Manage your Aspects"
|
||||
= link_to ( (@request_count == 0)? t('.manage') : "#{t('.manage')} (#{@request_count})"), {:controller => :aspects, :action => :manage}, :class => "edit_aspect_button", :class => new_request(@request_count), :title => t('.manage_your_aspects')
|
||||
|
||||
.yo{ :style => "display:none;"}
|
||||
#add_aspect_pane
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
-# licensed under the Affero General Public License version 3. See
|
||||
-# the COPYRIGHT file.
|
||||
|
||||
|
||||
%li.message{:id => post.id, :class => ("mine" if current_user.owns?(post))}
|
||||
= person_image_link(post.person)
|
||||
= yield post_yield_tag(post)
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
-# licensed under the Affero General Public License version 3. See
|
||||
-# the COPYRIGHT file.
|
||||
|
||||
|
||||
#publisher
|
||||
= owner_image_tag
|
||||
|
||||
|
|
@ -20,6 +19,4 @@
|
|||
%li
|
||||
= check_box_tag("aspect_ids[]", aspect.id, @aspect == :public || @aspect == :all || current_aspect?(aspect) )
|
||||
= aspect.name
|
||||
|
||||
= f.submit "Share"
|
||||
|
||||
= f.submit t('.share')
|
||||
|
|
|
|||
|
|
@ -2,8 +2,6 @@
|
|||
-# licensed under the Affero General Public License version 3. See
|
||||
-# the COPYRIGHT file.
|
||||
|
||||
|
||||
|
||||
:javascript
|
||||
$(".reshare_button").toggle(function(e){
|
||||
e.preventDefault();
|
||||
|
|
@ -19,7 +17,7 @@
|
|||
|
||||
%ul.reshare_box
|
||||
- for aspect in current_user.aspects_with_post( post.id )
|
||||
|
||||
|
||||
%li.currently_sharing= aspect.name
|
||||
|
||||
- for aspect in current_user.aspects
|
||||
|
|
|
|||
|
|
@ -7,11 +7,11 @@
|
|||
- else
|
||||
%h1
|
||||
- if @aspect == :all
|
||||
= link_to "All Aspects", root_path
|
||||
- elsif @aspect == :manage
|
||||
= "Manage Aspects"
|
||||
= link_to t('.all_aspects'), root_path
|
||||
- elsif @aspect == :public
|
||||
= "Public"
|
||||
- elsif @aspect == :manage
|
||||
= link_to t('.manage_aspects'), root_path
|
||||
- else
|
||||
= link_to @aspect.name, @aspect
|
||||
|
||||
|
|
|
|||
|
|
@ -2,5 +2,4 @@
|
|||
-# licensed under the Affero General Public License version 3. See
|
||||
-# the COPYRIGHT file.
|
||||
|
||||
|
||||
= @log.to_s
|
||||
|
|
|
|||
|
|
@ -2,9 +2,8 @@
|
|||
-# licensed under the Affero General Public License version 3. See
|
||||
-# the COPYRIGHT file.
|
||||
|
||||
|
||||
= form_for StatusMessage.new, :remote => true do |f|
|
||||
= f.error_messages
|
||||
%p
|
||||
= f.text_field :message, :value => "tell me something good"
|
||||
= f.submit 'oh yeah!', :class => 'button'
|
||||
= f.text_field :message, :value => t('.tell_me_something_good')
|
||||
= f.submit t('.oh_yeah'), :class => 'button'
|
||||
|
|
|
|||
|
|
@ -2,25 +2,23 @@
|
|||
-# licensed under the Affero General Public License version 3. See
|
||||
-# the COPYRIGHT file.
|
||||
|
||||
|
||||
%li.message{:id => post.id, :class => ("mine" if current_user.owns?(post))}
|
||||
|
||||
= person_image_link(post.person)
|
||||
|
||||
.content
|
||||
%span.from
|
||||
= link_to post.person.real_name, post.person
|
||||
= link_to post.person.real_name, post.person
|
||||
= post.message
|
||||
|
||||
|
||||
.info
|
||||
%span.time= link_to(how_long_ago(post), object_path(post))
|
||||
\--
|
||||
= link_to "show comments (#{post.comments.count})", '#', :class => "show_post_comments"
|
||||
= link_to "#{t('.show_comments')} (#{post.comments.count})", '#', :class => "show_post_comments"
|
||||
|
||||
= render "comments/comments", :post => post
|
||||
= render "comments/comments", :post => post
|
||||
|
||||
- if current_user.owns?(post)
|
||||
.destroy_link
|
||||
= link_to 'Delete', status_message_path(post), :confirm => 'Are you sure?', :method => :delete, :remote => true, :class => "delete"
|
||||
= render "shared/reshare", :post => post, :current_user => current_user
|
||||
|
||||
= link_to t('.delete'), status_message_path(post), :confirm => t('.are_you_sure'), :method => :delete, :remote => true, :class => "delete"
|
||||
= render "shared/reshare", :post => post, :current_user => current_user
|
||||
|
|
|
|||
|
|
@ -2,11 +2,10 @@
|
|||
-# licensed under the Affero General Public License version 3. See
|
||||
-# the COPYRIGHT file.
|
||||
|
||||
|
||||
%h1.big_text status messages
|
||||
= render "status_messages/new_status_message", :status_message => @status_message
|
||||
%ul#stream
|
||||
|
||||
|
||||
- for status_message in @status_messages
|
||||
= render "status_message", :post => status_message
|
||||
#pagination
|
||||
|
|
|
|||
|
|
@ -2,15 +2,13 @@
|
|||
-# licensed under the Affero General Public License version 3. See
|
||||
-# the COPYRIGHT file.
|
||||
|
||||
|
||||
%h1
|
||||
= link_to @status_message.person.real_name, @status_message.person
|
||||
= @status_message.message
|
||||
|
||||
|
||||
%h4= "comments (#{@status_message.comments.count})"
|
||||
%h4= "#{t('.comments')} (#{@status_message.comments.count})"
|
||||
= render "comments/comments", :post => @status_message
|
||||
|
||||
%p
|
||||
- if current_user.owns? @status_message
|
||||
= link_to "Destroy", @status_message, :confirm => 'Are you sure?', :method => :delete
|
||||
= link_to t('.destroy'), @status_message, :confirm => t('are_you_sure?'), :method => :delete
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
= f.fields_for :profile do |p|
|
||||
|
||||
%h3 Picture
|
||||
%h3="#{t('.picture')}"
|
||||
%div#image_picker
|
||||
= p.hidden_field :image_url, :value => (@profile.image_url if @profile.image_url), :id => 'image_url_field'
|
||||
|
||||
|
|
@ -26,34 +26,34 @@
|
|||
= link_to image_tag(photo.url(:thumb_medium)), "#"
|
||||
|
||||
- else
|
||||
You don't have any photos! Go to the
|
||||
= link_to "albums", albums_path(:aspect => 'all')
|
||||
page to upload some.
|
||||
=t('.you_dont_have_any_photos')
|
||||
= link_to t('.albums'), albums_path(:aspect => 'all')
|
||||
=t('.page_to_upload_some')
|
||||
|
||||
=will_paginate @photos
|
||||
|
||||
%br
|
||||
|
||||
%h3 Info
|
||||
%h3="#{t('.info')}"
|
||||
|
||||
%p
|
||||
%b
|
||||
DIASPORA USERNAME:
|
||||
="#{t('.diaspora_username')}:"
|
||||
= @user.diaspora_handle
|
||||
|
||||
%p
|
||||
= p.label :first_name
|
||||
= p.text_field :first_name, :value => @profile.first_name
|
||||
%p
|
||||
= p.label :last_name
|
||||
= p.label :last_name
|
||||
= p.text_field :last_name, :value => @profile.last_name
|
||||
|
||||
#submit_block
|
||||
= link_to "Cancel", root_path
|
||||
= link_to t('.cancel'), root_path
|
||||
or
|
||||
= f.submit "Update Profile"
|
||||
= f.submit t('.update_profile')
|
||||
|
||||
#content_bottom
|
||||
.back
|
||||
= link_to "⇧ home", root_path
|
||||
= link_to "⇧ #{t('.home')}", root_path
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
-# licensed under the Affero General Public License version 3. See
|
||||
-# the COPYRIGHT file.
|
||||
|
||||
|
||||
:javascript
|
||||
$("#settings_nav li > a").click( function() {
|
||||
var target = "#"+$(this).attr('class');
|
||||
|
|
@ -15,8 +14,7 @@
|
|||
|
||||
|
||||
- content_for :publish do
|
||||
%h1
|
||||
Settings
|
||||
%h1="#{t('.editing_profile')}"
|
||||
|
||||
- content_for :left_pane do
|
||||
%ul#settings_nav
|
||||
|
|
@ -29,3 +27,4 @@
|
|||
#services.settings_pane
|
||||
= render 'users/services'
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,5 @@
|
|||
# licensed under the Affero General Public License version 3. See
|
||||
# the COPYRIGHT file.
|
||||
|
||||
|
||||
Autotest.add_discovery { "rails" }
|
||||
Autotest.add_discovery { "rspec2" }
|
||||
|
|
|
|||
|
|
@ -2,8 +2,6 @@
|
|||
# licensed under the Affero General Public License version 3. See
|
||||
# the COPYRIGHT file.
|
||||
|
||||
|
||||
|
||||
# This file is used by Rack-based servers to start the application.
|
||||
|
||||
require ::File.expand_path('../config/environment', __FILE__)
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
# licensed under the Affero General Public License version 3. See
|
||||
# the COPYRIGHT file.
|
||||
|
||||
|
||||
default:
|
||||
pod_url: "http://example.org/"
|
||||
debug: false
|
||||
|
|
@ -12,8 +11,8 @@ default:
|
|||
socket_collection_name: 'websocket'
|
||||
pubsub_server: 'https://pubsubhubbub.appspot.com/'
|
||||
mongo_host: 'localhost'
|
||||
mongo_post: 27017
|
||||
|
||||
mongo_port: 27017
|
||||
|
||||
development:
|
||||
|
||||
test:
|
||||
|
|
|
|||
|
|
@ -2,8 +2,6 @@
|
|||
# licensed under the Affero General Public License version 3. See
|
||||
# the COPYRIGHT file.
|
||||
|
||||
|
||||
|
||||
require File.expand_path('../boot', __FILE__)
|
||||
|
||||
require 'action_controller/railtie'
|
||||
|
|
@ -13,7 +11,7 @@ require 'active_resource/railtie'
|
|||
# you've limited to :test, :development, or :production.
|
||||
Bundler.require(:default, Rails.env) if defined?(Bundler)
|
||||
|
||||
require 'lib/mongo_mapper/bson_id'
|
||||
require File.expand_path('../../lib/mongo_mapper/bson_id', __FILE__)
|
||||
module Diaspora
|
||||
class Application < Rails::Application
|
||||
# Settings in config/environments/* take precedence over those specified here.
|
||||
|
|
|
|||
|
|
@ -2,8 +2,6 @@
|
|||
# licensed under the Affero General Public License version 3. See
|
||||
# the COPYRIGHT file.
|
||||
|
||||
|
||||
|
||||
require 'rubygems'
|
||||
|
||||
# Set up gems listed in the Gemfile.
|
||||
|
|
|
|||
8
config/cucumber.yml
Normal file
8
config/cucumber.yml
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
<%
|
||||
rerun = File.file?('rerun.txt') ? IO.read('rerun.txt') : ""
|
||||
rerun_opts = rerun.to_s.strip.empty? ? "--format #{ENV['CUCUMBER_FORMAT'] || 'progress'} features" : "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} #{rerun}"
|
||||
std_opts = "--format #{ENV['CUCUMBER_FORMAT'] || 'progress'} --strict --tags ~@wip"
|
||||
%>
|
||||
default: <%= std_opts %> features
|
||||
wip: --tags @wip:3 --wip features
|
||||
rerun: <%= rerun_opts %> --format rerun --out rerun.txt --strict --tags ~@wip
|
||||
|
|
@ -2,8 +2,6 @@
|
|||
# licensed under the Affero General Public License version 3. See
|
||||
# the COPYRIGHT file.
|
||||
|
||||
|
||||
|
||||
config = YAML.load_file(File.dirname(__FILE__) + '/deploy_config.yml')
|
||||
all = config['cross_server']
|
||||
|
||||
|
|
@ -108,7 +106,6 @@ namespace :deploy do
|
|||
run 'gem install bundler'
|
||||
end
|
||||
|
||||
|
||||
task :migrate do
|
||||
end
|
||||
end
|
||||
|
|
@ -153,7 +150,6 @@ namespace :db do
|
|||
deploy::restart
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
||||
after "deploy:symlink", "deploy:symlink_images", "deploy:symlink_bundle", 'deploy:symlink_config'
|
||||
|
|
|
|||
|
|
@ -2,8 +2,6 @@
|
|||
# licensed under the Affero General Public License version 3. See
|
||||
# the COPYRIGHT file.
|
||||
|
||||
|
||||
|
||||
cross_server:
|
||||
deploy_to: '/usr/local/app/diaspora'
|
||||
user: 'root'
|
||||
|
|
|
|||
|
|
@ -2,8 +2,6 @@
|
|||
# licensed under the Affero General Public License version 3. See
|
||||
# the COPYRIGHT file.
|
||||
|
||||
|
||||
|
||||
# Load the rails application
|
||||
require File.expand_path('../application', __FILE__)
|
||||
Haml::Template.options[:format] = :html5
|
||||
|
|
|
|||
|
|
@ -2,8 +2,7 @@
|
|||
# licensed under the Affero General Public License version 3. See
|
||||
# the COPYRIGHT file.
|
||||
|
||||
|
||||
require 'lib/mongo_mapper/clear_dev_memory'
|
||||
require File.expand_path('../../../lib/mongo_mapper/clear_dev_memory', __FILE__)
|
||||
Diaspora::Application.configure do
|
||||
# Settings specified here will take precedence over those in config/environment.rb
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
# licensed under the Affero General Public License version 3. See
|
||||
# the COPYRIGHT file.
|
||||
|
||||
|
||||
Diaspora::Application.configure do
|
||||
# Settings specified here will take precedence over those in config/environment.rb
|
||||
|
||||
|
|
@ -16,7 +15,7 @@ Diaspora::Application.configure do
|
|||
|
||||
# Specifies the header that your server uses for sending files
|
||||
#config.action_dispatch.x_sendfile_header = "X-Sendfile"
|
||||
|
||||
|
||||
config.active_support.deprecation = :notify
|
||||
|
||||
# For nginx:
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
# licensed under the Affero General Public License version 3. See
|
||||
# the COPYRIGHT file.
|
||||
|
||||
|
||||
Diaspora::Application.configure do
|
||||
# Settings specified here will take precedence over those in config/environment.rb
|
||||
|
||||
|
|
@ -32,13 +31,11 @@ Diaspora::Application.configure do
|
|||
config.active_support.deprecation = :stderr
|
||||
config.threadsafe!
|
||||
|
||||
|
||||
# Use SQL instead of Active Record's schema dumper when creating the test database.
|
||||
# This is necessary if your schema can't be completely dumped by the schema dumper,
|
||||
# like if you have constraints or database-specific column types
|
||||
# config.active_record.schema_format = :sql
|
||||
|
||||
|
||||
begin
|
||||
require 'database_cleaner'
|
||||
DatabaseCleaner.strategy = :truncation
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue