mirror of
https://github.com/wahyd4/ocelots.git
synced 2026-08-09 21:16:18 +10:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4df0903ae4 | ||
|
|
60ddc673bc | ||
|
|
aaa56385da | ||
|
|
70cec97aee | ||
|
|
837762975d | ||
|
|
fe56839528 | ||
|
|
7df18c049f | ||
|
|
3e40ad643d | ||
|
|
c4502d8035 | ||
|
|
0fbc1744af | ||
|
|
c9e7dde516 | ||
|
|
5e76ffe879 | ||
|
|
7a1241c218 | ||
|
|
de6a8445bc | ||
|
|
b5d5da0c7c | ||
|
|
8891d66c22 | ||
|
|
9f2fd47e0f | ||
|
|
a6bfd8bd59 | ||
|
|
0fb83bf919 | ||
|
|
61626c118b | ||
|
|
7ee206ea87 | ||
|
|
ad2fbe8b43 | ||
|
|
324bb3a186 | ||
|
|
120abe5666 | ||
|
|
ca3162b631 | ||
|
|
1cc624c10b | ||
|
|
3709e9206d | ||
|
|
706699a4b8 | ||
|
|
c2078f3ca2 | ||
|
|
7cf845153a | ||
|
|
1376cc92fc | ||
|
|
a4f546210c | ||
|
|
92e3156740 | ||
|
|
a70a948f97 | ||
|
|
ec6b5b4bb2 | ||
|
|
490476cca2 | ||
|
|
1e009425f7 | ||
|
|
1fd6d145b4 | ||
|
|
0ac6202372 | ||
|
|
eb95b7fc13 | ||
|
|
3995c7e239 | ||
|
|
b1cd590a63 | ||
|
|
c1e4d4ff18 | ||
|
|
b6dc5e4e32 | ||
|
|
68afb37c29 | ||
|
|
d40596ef06 | ||
|
|
f37d88d84a | ||
|
|
46c4fd5081 | ||
|
|
661882f409 | ||
|
|
4bd724079f | ||
|
|
709fbe1a1c | ||
|
|
a365c0f436 | ||
|
|
9315f2ad96 | ||
|
|
686fc27126 | ||
|
|
51ba3907d8 | ||
|
|
ea1d27c0ff | ||
|
|
72a4102090 | ||
|
|
721c552ce4 | ||
|
|
408c45f8bf | ||
|
|
f79ad1cc53 | ||
|
|
70f89d3d47 | ||
|
|
f277ab8b9c | ||
|
|
5c0bf3bd1f | ||
|
|
9e0899e6b4 | ||
|
|
7c737fb2f8 | ||
|
|
317cb03aff | ||
|
|
5ae31a5046 | ||
|
|
1c31cd4618 | ||
|
|
9ed0a1d780 | ||
|
|
7230c11ab1 | ||
|
|
03dce270e5 | ||
|
|
8bdbb5caa8 | ||
|
|
1c3d9c246a | ||
|
|
b57c4e92bc | ||
|
|
f068ce3eea | ||
|
|
cf3f915488 | ||
|
|
d7245ac9a4 | ||
|
|
0025dabc9a | ||
|
|
89ae1532d1 | ||
|
|
f2610e8b42 | ||
|
|
a1aaf56959 | ||
|
|
409e7e3b20 | ||
|
|
10e41d315f | ||
|
|
11f1f8c7a1 | ||
|
|
ef78a8fe99 | ||
|
|
39f0d2e1df | ||
|
|
383b6164b4 | ||
|
|
03ad1f5809 | ||
|
|
11a791e261 | ||
|
|
6ac344ddfa | ||
|
|
6f1f983c13 | ||
|
|
cb8d2ca7f4 | ||
|
|
c1b49254ee | ||
|
|
4ee3aa1215 | ||
|
|
ddc96613b2 | ||
|
|
db7dbd6e67 | ||
|
|
fa05b3db73 | ||
|
|
da5c63d75e | ||
|
|
fcfb53b57c | ||
|
|
5f546d98a5 | ||
|
|
ece31349d1 | ||
|
|
a42e7ffb28 | ||
|
|
f73932f9a8 | ||
|
|
32180e0db5 | ||
|
|
0592347620 | ||
|
|
85492000f5 |
@@ -4,6 +4,8 @@
|
|||||||
# or operating system, you probably want to add a global ignore instead:
|
# or operating system, you probably want to add a global ignore instead:
|
||||||
# git config --global core.excludesfile ~/.gitignore_global
|
# git config --global core.excludesfile ~/.gitignore_global
|
||||||
|
|
||||||
|
.DS_Store
|
||||||
|
|
||||||
# Ignore bundler config
|
# Ignore bundler config
|
||||||
/.bundle
|
/.bundle
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
language: ruby
|
||||||
|
rvm:
|
||||||
|
- 1.9.3
|
||||||
|
env:
|
||||||
|
- DB=postgresql
|
||||||
|
script:
|
||||||
|
- RAILS_ENV=test bundle exec rake ci --trace db:migrate
|
||||||
|
before_script:
|
||||||
|
- psql -c 'create database ocelots_test' -U postgres
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
source 'https://rubygems.org'
|
source 'https://rubygems.org'
|
||||||
|
|
||||||
gem 'rails', '3.2.9'
|
gem 'rails', '3.2.11'
|
||||||
gem 'slim'
|
gem 'slim'
|
||||||
gem 'paperclip'
|
gem 'paperclip'
|
||||||
gem 'aws-sdk'
|
gem 'aws-sdk'
|
||||||
@@ -14,6 +14,8 @@ gem 'therubyracer'
|
|||||||
gem 'google-api-client'
|
gem 'google-api-client'
|
||||||
gem 'gravtastic'
|
gem 'gravtastic'
|
||||||
gem 'rdiscount'
|
gem 'rdiscount'
|
||||||
|
gem 'thin'
|
||||||
|
gem 'pusher'
|
||||||
|
|
||||||
group :assets do
|
group :assets do
|
||||||
gem 'sass-rails', '~> 3.2.3'
|
gem 'sass-rails', '~> 3.2.3'
|
||||||
@@ -22,15 +24,15 @@ group :assets do
|
|||||||
end
|
end
|
||||||
|
|
||||||
group :development, :test do
|
group :development, :test do
|
||||||
|
gem 'rspec-rails'
|
||||||
gem 'github'
|
gem 'github'
|
||||||
gem 'tddium'
|
gem 'tddium'
|
||||||
gem "rails_best_practices", "~> 1.11.1"
|
gem "rails_best_practices", "~> 1.11.1"
|
||||||
gem "flay"
|
gem "flay"
|
||||||
gem 'rspec-rails'
|
|
||||||
gem 'simplecov'
|
gem 'simplecov'
|
||||||
gem 'machinist'
|
gem 'machinist'
|
||||||
gem 'cucumber-rails' , :require => false
|
gem 'cucumber-rails' , :require => false
|
||||||
gem 'capybara'
|
gem 'capybara'
|
||||||
gem 'database_cleaner'
|
gem 'database_cleaner'
|
||||||
gem 'selenium-webdriver'
|
gem 'selenium-webdriver'
|
||||||
end
|
end
|
||||||
|
|||||||
+42
-30
@@ -1,12 +1,12 @@
|
|||||||
GEM
|
GEM
|
||||||
remote: https://rubygems.org/
|
remote: https://rubygems.org/
|
||||||
specs:
|
specs:
|
||||||
actionmailer (3.2.9)
|
actionmailer (3.2.11)
|
||||||
actionpack (= 3.2.9)
|
actionpack (= 3.2.11)
|
||||||
mail (~> 2.4.4)
|
mail (~> 2.4.4)
|
||||||
actionpack (3.2.9)
|
actionpack (3.2.11)
|
||||||
activemodel (= 3.2.9)
|
activemodel (= 3.2.11)
|
||||||
activesupport (= 3.2.9)
|
activesupport (= 3.2.11)
|
||||||
builder (~> 3.0.0)
|
builder (~> 3.0.0)
|
||||||
erubis (~> 2.7.0)
|
erubis (~> 2.7.0)
|
||||||
journey (~> 1.0.4)
|
journey (~> 1.0.4)
|
||||||
@@ -14,18 +14,18 @@ GEM
|
|||||||
rack-cache (~> 1.2)
|
rack-cache (~> 1.2)
|
||||||
rack-test (~> 0.6.1)
|
rack-test (~> 0.6.1)
|
||||||
sprockets (~> 2.2.1)
|
sprockets (~> 2.2.1)
|
||||||
activemodel (3.2.9)
|
activemodel (3.2.11)
|
||||||
activesupport (= 3.2.9)
|
activesupport (= 3.2.11)
|
||||||
builder (~> 3.0.0)
|
builder (~> 3.0.0)
|
||||||
activerecord (3.2.9)
|
activerecord (3.2.11)
|
||||||
activemodel (= 3.2.9)
|
activemodel (= 3.2.11)
|
||||||
activesupport (= 3.2.9)
|
activesupport (= 3.2.11)
|
||||||
arel (~> 3.0.2)
|
arel (~> 3.0.2)
|
||||||
tzinfo (~> 0.3.29)
|
tzinfo (~> 0.3.29)
|
||||||
activeresource (3.2.9)
|
activeresource (3.2.11)
|
||||||
activemodel (= 3.2.9)
|
activemodel (= 3.2.11)
|
||||||
activesupport (= 3.2.9)
|
activesupport (= 3.2.11)
|
||||||
activesupport (3.2.9)
|
activesupport (3.2.11)
|
||||||
i18n (~> 0.6)
|
i18n (~> 0.6)
|
||||||
multi_json (~> 1.0)
|
multi_json (~> 1.0)
|
||||||
addressable (2.3.2)
|
addressable (2.3.2)
|
||||||
@@ -71,9 +71,11 @@ GEM
|
|||||||
capybara (>= 1.1.2)
|
capybara (>= 1.1.2)
|
||||||
cucumber (>= 1.1.8)
|
cucumber (>= 1.1.8)
|
||||||
nokogiri (>= 1.5.0)
|
nokogiri (>= 1.5.0)
|
||||||
|
daemons (1.1.9)
|
||||||
database_cleaner (0.9.1)
|
database_cleaner (0.9.1)
|
||||||
diff-lcs (1.1.3)
|
diff-lcs (1.1.3)
|
||||||
erubis (2.7.0)
|
erubis (2.7.0)
|
||||||
|
eventmachine (1.0.0)
|
||||||
execjs (1.4.0)
|
execjs (1.4.0)
|
||||||
multi_json (~> 1.0)
|
multi_json (~> 1.0)
|
||||||
extlib (0.9.15)
|
extlib (0.9.15)
|
||||||
@@ -109,7 +111,7 @@ GEM
|
|||||||
jquery-rails (2.1.1)
|
jquery-rails (2.1.1)
|
||||||
railties (>= 3.1.0, < 5.0)
|
railties (>= 3.1.0, < 5.0)
|
||||||
thor (~> 0.14)
|
thor (~> 0.14)
|
||||||
json (1.7.5)
|
json (1.7.6)
|
||||||
jwt (0.1.5)
|
jwt (0.1.5)
|
||||||
multi_json (>= 1.0)
|
multi_json (>= 1.0)
|
||||||
launchy (2.1.2)
|
launchy (2.1.2)
|
||||||
@@ -123,7 +125,7 @@ GEM
|
|||||||
mime-types (~> 1.16)
|
mime-types (~> 1.16)
|
||||||
treetop (~> 1.4.8)
|
treetop (~> 1.4.8)
|
||||||
mime-types (1.19)
|
mime-types (1.19)
|
||||||
multi_json (1.3.7)
|
multi_json (1.5.0)
|
||||||
multi_xml (0.5.1)
|
multi_xml (0.5.1)
|
||||||
multipart-post (1.1.5)
|
multipart-post (1.1.5)
|
||||||
nokogiri (1.5.5)
|
nokogiri (1.5.5)
|
||||||
@@ -136,21 +138,24 @@ GEM
|
|||||||
pg (0.14.1)
|
pg (0.14.1)
|
||||||
polyglot (0.3.3)
|
polyglot (0.3.3)
|
||||||
progressbar (0.11.0)
|
progressbar (0.11.0)
|
||||||
rack (1.4.1)
|
pusher (0.11.1)
|
||||||
|
multi_json (~> 1.0)
|
||||||
|
signature (~> 0.1.6)
|
||||||
|
rack (1.4.3)
|
||||||
rack-cache (1.2)
|
rack-cache (1.2)
|
||||||
rack (>= 0.4)
|
rack (>= 0.4)
|
||||||
rack-ssl (1.3.2)
|
rack-ssl (1.3.2)
|
||||||
rack
|
rack
|
||||||
rack-test (0.6.2)
|
rack-test (0.6.2)
|
||||||
rack (>= 1.0)
|
rack (>= 1.0)
|
||||||
rails (3.2.9)
|
rails (3.2.11)
|
||||||
actionmailer (= 3.2.9)
|
actionmailer (= 3.2.11)
|
||||||
actionpack (= 3.2.9)
|
actionpack (= 3.2.11)
|
||||||
activerecord (= 3.2.9)
|
activerecord (= 3.2.11)
|
||||||
activeresource (= 3.2.9)
|
activeresource (= 3.2.11)
|
||||||
activesupport (= 3.2.9)
|
activesupport (= 3.2.11)
|
||||||
bundler (~> 1.0)
|
bundler (~> 1.0)
|
||||||
railties (= 3.2.9)
|
railties (= 3.2.11)
|
||||||
rails_best_practices (1.11.1)
|
rails_best_practices (1.11.1)
|
||||||
activesupport
|
activesupport
|
||||||
awesome_print
|
awesome_print
|
||||||
@@ -159,14 +164,14 @@ GEM
|
|||||||
erubis
|
erubis
|
||||||
i18n
|
i18n
|
||||||
progressbar
|
progressbar
|
||||||
railties (3.2.9)
|
railties (3.2.11)
|
||||||
actionpack (= 3.2.9)
|
actionpack (= 3.2.11)
|
||||||
activesupport (= 3.2.9)
|
activesupport (= 3.2.11)
|
||||||
rack-ssl (~> 1.3.2)
|
rack-ssl (~> 1.3.2)
|
||||||
rake (>= 0.8.7)
|
rake (>= 0.8.7)
|
||||||
rdoc (~> 3.4)
|
rdoc (~> 3.4)
|
||||||
thor (>= 0.14.6, < 2.0)
|
thor (>= 0.14.6, < 2.0)
|
||||||
rake (10.0.1)
|
rake (10.0.3)
|
||||||
rdiscount (1.6.8)
|
rdiscount (1.6.8)
|
||||||
rdoc (3.12)
|
rdoc (3.12)
|
||||||
json (~> 1.4)
|
json (~> 1.4)
|
||||||
@@ -197,6 +202,7 @@ GEM
|
|||||||
multi_json (~> 1.0)
|
multi_json (~> 1.0)
|
||||||
rubyzip
|
rubyzip
|
||||||
sexp_processor (4.1.2)
|
sexp_processor (4.1.2)
|
||||||
|
signature (0.1.6)
|
||||||
signet (0.4.3)
|
signet (0.4.3)
|
||||||
addressable (>= 2.2.3)
|
addressable (>= 2.2.3)
|
||||||
faraday (~> 0.8.1)
|
faraday (~> 0.8.1)
|
||||||
@@ -209,7 +215,7 @@ GEM
|
|||||||
slim (1.3.0)
|
slim (1.3.0)
|
||||||
temple (~> 0.4.1)
|
temple (~> 0.4.1)
|
||||||
tilt (~> 1.3.3)
|
tilt (~> 1.3.3)
|
||||||
sprockets (2.2.1)
|
sprockets (2.2.2)
|
||||||
hike (~> 1.2)
|
hike (~> 1.2)
|
||||||
multi_json (~> 1.0)
|
multi_json (~> 1.0)
|
||||||
rack (~> 1.0)
|
rack (~> 1.0)
|
||||||
@@ -226,6 +232,10 @@ GEM
|
|||||||
temple (0.4.1)
|
temple (0.4.1)
|
||||||
therubyracer (0.10.2)
|
therubyracer (0.10.2)
|
||||||
libv8 (~> 3.3.10)
|
libv8 (~> 3.3.10)
|
||||||
|
thin (1.5.0)
|
||||||
|
daemons (>= 1.0.9)
|
||||||
|
eventmachine (>= 0.12.6)
|
||||||
|
rack (>= 1.0.0)
|
||||||
thor (0.16.0)
|
thor (0.16.0)
|
||||||
tilt (1.3.3)
|
tilt (1.3.3)
|
||||||
treetop (1.4.12)
|
treetop (1.4.12)
|
||||||
@@ -259,7 +269,8 @@ DEPENDENCIES
|
|||||||
machinist
|
machinist
|
||||||
paperclip
|
paperclip
|
||||||
pg
|
pg
|
||||||
rails (= 3.2.9)
|
pusher
|
||||||
|
rails (= 3.2.11)
|
||||||
rails_best_practices (~> 1.11.1)
|
rails_best_practices (~> 1.11.1)
|
||||||
rdiscount
|
rdiscount
|
||||||
rspec-rails
|
rspec-rails
|
||||||
@@ -269,5 +280,6 @@ DEPENDENCIES
|
|||||||
slim
|
slim
|
||||||
tddium
|
tddium
|
||||||
therubyracer
|
therubyracer
|
||||||
|
thin
|
||||||
uglifier (>= 1.0.3)
|
uglifier (>= 1.0.3)
|
||||||
uuidtools
|
uuidtools
|
||||||
|
|||||||
@@ -1,10 +1,37 @@
|
|||||||
# Ocelots
|
# Ocelots
|
||||||
|
[](https://travis-ci.org/wahyd4/ocelots)
|
||||||
|
[](https://codeclimate.com/github/wahyd4/ocelots)
|
||||||
|
|
||||||
|
## Screenshots
|
||||||
|

|
||||||
|
|
||||||
This is an application to allow members of a team to get to know each other.
|
This is an application to allow members of a team to get to know each other.
|
||||||
|
You can log in using a mozilla persona or Google account id (linked to your email address) and then you'll be presented with the list of groups you belong to (which will be none initially).You can now create a team and invite new members to join by entering their email address (including yourself - you can administer a team without being a member).
|
||||||
|
|
||||||
You log in using a mozilla persona id (linked to your email address) and then you'll be presented with the list of groups you belong to (which will be none initially).
|
In Ocelots every team is private,and it's only accessible by the people who belong to the same organisation with team creator.Once someone in the team invite someone else to join in,the team will be accessible to the organisation which the invitee belongs to.
|
||||||
|
If invitee doesn't belong to any organisation,the team's viewable people will only add invitee himself.
|
||||||
|
In Ocelots we have a important defination is "Organisation". Organisation should be created by manually in 'script/create_default_organisations.rb'.
|
||||||
|
|
||||||
You can now create a team and invite new members to join by entering their email address (including yourself - you can administer a team without being a member).
|
You can modify it and run it by 'rails runner script/create_default_organisations.rb' at any time.
|
||||||
|
|
||||||
|
eg:
|
||||||
|
Organisation.create!(:name => 'ThoughtWorks', :domains => 'thoughtworks.com')
|
||||||
|
so if anyone use xx@thoughtworks.com will automatically belongs to Thoughtworks.
|
||||||
|
|
||||||
|
Everyone can try it through <http://iocelots.com>
|
||||||
|
|
||||||
|
# Install and run Ocelots
|
||||||
|
|
||||||
|
## Install Ocelots on your computer
|
||||||
|
|
||||||
|
* At first you need apply for Google oauth token and Pusher API key ,then put them into /install_ocelots.sh
|
||||||
|
* Next, run 'chmod +x install_ocelots.sh' to make this script executable.
|
||||||
|
* Then, modify 'script/create_default_organisations.rb' and run it to create Organisation.
|
||||||
|
* Finally,run 'rails server' to run the server.
|
||||||
|
|
||||||
|
*Notice: you may need to run the install script when you closed the terminal every time if you need to use login page and Pusher.*
|
||||||
|
|
||||||
|
## Install Ocelots on heroku
|
||||||
|
|
||||||
To setup your own instance on heroku:
|
To setup your own instance on heroku:
|
||||||
|
|
||||||
@@ -46,6 +73,20 @@ To use google maps, you will need to provide a google api key
|
|||||||
|
|
||||||
heroku config:add GOOGLE_API=your_api_key
|
heroku config:add GOOGLE_API=your_api_key
|
||||||
|
|
||||||
|
To use Pusher to auto-fresh messages,you need to add Pusher addon on heroku,and config it like:
|
||||||
|
|
||||||
|
heroku config:add PUSHER_APP_ID=your_pusher_app_id
|
||||||
|
heroku config:add PUSHER_KEY='your_pusher_key'
|
||||||
|
heroku config:add PUSHER_SECRET='your_pusher_secret'
|
||||||
|
|
||||||
|
### Google OAuth API Config
|
||||||
|
You should apply for the API token from [Google API console][2],then set it.
|
||||||
|
|
||||||
|
heroku config:add GOOGLE_OAUTH_CLIENT_ID=yourid --app ocelots
|
||||||
|
heroku config:add GOOGLE_OAUTH_CLIENT_SECRET=yourSecret
|
||||||
|
heroku config:add GOOGLE_OAUTH_REDIRECT=http://replace to your domain/home/verify_g_callback
|
||||||
|
|
||||||
|
|
||||||
## API
|
## API
|
||||||
|
|
||||||
You can experiment with the API from the command line
|
You can experiment with the API from the command line
|
||||||
@@ -86,4 +127,6 @@ To request the message contents of the antechamber for a team (with an optional
|
|||||||
To add a new message:
|
To add a new message:
|
||||||
|
|
||||||
export TEAM_SLUG=ateam
|
export TEAM_SLUG=ateam
|
||||||
curl -H 'Content-Type: application/json' -d '{"content":"message"}' "$OCELOTS_URL/api/antechamber/$TEAM_SLUG?auth_token=$OCELOTS_AUTH_TOKEN"
|
curl -H 'Content-Type: application/json' -d '{"content":"message"}' "$OCELOTS_URL/api/antechamber/$TEAM_SLUG?auth_token=$OCELOTS_AUTH_TOKEN"
|
||||||
|
|
||||||
|
[2]: https://code.google.com/apis/console#access "Google API console"
|
||||||
@@ -6,4 +6,4 @@ require File.expand_path('../config/application', __FILE__)
|
|||||||
|
|
||||||
Ocelots::Application.load_tasks
|
Ocelots::Application.load_tasks
|
||||||
|
|
||||||
task :ci => %w(db:migrate db:test:prepare analyzer:flay analyzer:rails_best_practices simplecov stats)
|
task :ci => %w(db:migrate db:test:prepare analyzer:flay analyzer:rails_best_practices simplecov stats)
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.8 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 14 KiB |
@@ -5,8 +5,11 @@ $ ->
|
|||||||
beforeSubmit: ->
|
beforeSubmit: ->
|
||||||
if $('.message-body').val().replace(/\s+/, "") == ""
|
if $('.message-body').val().replace(/\s+/, "") == ""
|
||||||
false
|
false
|
||||||
success: (data) ->
|
|
||||||
$('.message-list').prepend(data)
|
|
||||||
|
|
||||||
$('.submit-mess').click ->
|
$('.submit-mess').click ->
|
||||||
$('.form-inline').ajaxSubmit options
|
$('.form-inline').ajaxSubmit options
|
||||||
|
|
||||||
|
pusher = new Pusher $('#pusher_key').val()
|
||||||
|
channel = pusher.subscribe $('#team_slug').val()
|
||||||
|
channel.bind 'new_message', (data) ->
|
||||||
|
$('.message-list').prepend(data.content).show('slow')
|
||||||
|
|||||||
@@ -18,46 +18,4 @@ $ ->
|
|||||||
|
|
||||||
$('.fancybox').fancybox()
|
$('.fancybox').fancybox()
|
||||||
|
|
||||||
$('#view_map').each ->
|
|
||||||
lat = $(this).data('lat')
|
|
||||||
lng = $(this).data('lng')
|
|
||||||
|
|
||||||
map_options = {
|
|
||||||
center: new google.maps.LatLng(lat, lng),
|
|
||||||
zoom: 8,
|
|
||||||
mapTypeId: google.maps.MapTypeId.ROADMAP
|
|
||||||
}
|
|
||||||
|
|
||||||
map = new google.maps.Map(this, map_options)
|
|
||||||
|
|
||||||
marker_options = {
|
|
||||||
position: new google.maps.LatLng(lat, lng),
|
|
||||||
map: map
|
|
||||||
}
|
|
||||||
marker = new google.maps.Marker(marker_options)
|
|
||||||
|
|
||||||
$("#map_canvas").each ->
|
|
||||||
lat = parseFloat($('#person_lat').val()) || -34.397
|
|
||||||
lng = parseFloat($('#person_lng').val()) || 150.644
|
|
||||||
|
|
||||||
map_options = {
|
|
||||||
center: new google.maps.LatLng(lat, lng),
|
|
||||||
zoom: 8,
|
|
||||||
mapTypeId: google.maps.MapTypeId.ROADMAP
|
|
||||||
}
|
|
||||||
|
|
||||||
map = new google.maps.Map(this, map_options)
|
|
||||||
|
|
||||||
marker_options = {
|
|
||||||
draggable: true,
|
|
||||||
position: new google.maps.LatLng(lat, lng),
|
|
||||||
map: map
|
|
||||||
}
|
|
||||||
marker = new google.maps.Marker(marker_options)
|
|
||||||
|
|
||||||
google.maps.event.addListener marker, 'dragend', (event) ->
|
|
||||||
point = marker.getPosition()
|
|
||||||
$('#person_lat').val point.lat()
|
|
||||||
$('#person_lng').val point.lng()
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,43 @@
|
|||||||
|
$ ->
|
||||||
|
geocoder = null
|
||||||
|
map = null
|
||||||
|
marker = null
|
||||||
|
|
||||||
|
$("#map_canvas").each ->
|
||||||
|
geocoder = new google.maps.Geocoder()
|
||||||
|
lat = parseFloat($('#person_lat').val()) || -34.397
|
||||||
|
lng = parseFloat($('#person_lng').val()) || 150.644
|
||||||
|
latlng = new google.maps.LatLng(lat, lng)
|
||||||
|
mapOptions = {
|
||||||
|
zoom: 8
|
||||||
|
center: latlng
|
||||||
|
mapTypeId: google.maps.MapTypeId.ROADMAP
|
||||||
|
}
|
||||||
|
map = new google.maps.Map(document.getElementById("map_canvas"), mapOptions);
|
||||||
|
marker_options = {
|
||||||
|
draggable: true,
|
||||||
|
position: new google.maps.LatLng(lat, lng),
|
||||||
|
map: map
|
||||||
|
}
|
||||||
|
marker = new google.maps.Marker(marker_options)
|
||||||
|
google.maps.event.addListener marker, 'dragend', (event) ->
|
||||||
|
point = marker.getPosition()
|
||||||
|
$('#person_lat').val point.lat()
|
||||||
|
$('#person_lng').val point.lng()
|
||||||
|
|
||||||
|
$("#address_btn").live "click", (e) ->
|
||||||
|
address = $("#address").val()
|
||||||
|
geocoder.geocode { 'address': address}, (results, status) ->
|
||||||
|
if (status == google.maps.GeocoderStatus.OK)
|
||||||
|
map.setCenter(results[0].geometry.location)
|
||||||
|
marker.setMap null
|
||||||
|
marker = new google.maps.Marker {
|
||||||
|
map: map,
|
||||||
|
position: results[0].geometry.location
|
||||||
|
}
|
||||||
|
$('#person_lat').val(results[0].geometry.location.$a)
|
||||||
|
$('#person_lng').val(results[0].geometry.location.ab)
|
||||||
|
$('.error_maps').addClass 'hidden'
|
||||||
|
else
|
||||||
|
$('.error_maps').removeClass 'hidden'
|
||||||
|
false
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
$ ->
|
||||||
|
$('#view_map').each ->
|
||||||
|
lat = $(this).data('lat')
|
||||||
|
lng = $(this).data('lng')
|
||||||
|
|
||||||
|
map_options = {
|
||||||
|
center: new google.maps.LatLng(lat, lng),
|
||||||
|
zoom: 8,
|
||||||
|
mapTypeId: google.maps.MapTypeId.ROADMAP
|
||||||
|
}
|
||||||
|
|
||||||
|
map = new google.maps.Map(this, map_options)
|
||||||
|
|
||||||
|
marker_options = {
|
||||||
|
position: new google.maps.LatLng(lat, lng),
|
||||||
|
map: map
|
||||||
|
}
|
||||||
|
marker = new google.maps.Marker(marker_options)
|
||||||
@@ -0,0 +1,72 @@
|
|||||||
|
$ ->
|
||||||
|
getCallback = () ->
|
||||||
|
switch (window.location.hostname)
|
||||||
|
when "127.0.0.1" then "http://127.0.0.1:3000/soundcloud_oauth_callback.html"
|
||||||
|
when "ocelots-staging.herokuapp.com" then "http://ocelots-staging.herokuapp.com/soundcloud_oauth_callback.html"
|
||||||
|
when "iocelots.com" then "http://iocelots.com/soundcloud_oauth_callback.html"
|
||||||
|
|
||||||
|
getClientID = () ->
|
||||||
|
switch (window.location.hostname)
|
||||||
|
when "127.0.0.1" then "ee3d987c0fa30e22edd251a7bd046851"
|
||||||
|
when "ocelots-staging.herokuapp.com" then "40d2c306162dcea94436672679aa6c25"
|
||||||
|
when "iocelots.com" then "bdb756070f00205c76a9563eafe8ca09"
|
||||||
|
|
||||||
|
SC.initialize {
|
||||||
|
client_id: getClientID()
|
||||||
|
redirect_uri: getCallback()
|
||||||
|
}
|
||||||
|
|
||||||
|
$("#recorderUI.reset #controlButton").live "click", (e) ->
|
||||||
|
updateTimer 0
|
||||||
|
SC.record {
|
||||||
|
start:() ->
|
||||||
|
setRecorderUIState("recording")
|
||||||
|
$('#timer').removeClass("hidden")
|
||||||
|
progress: (ms, avgPeak) ->
|
||||||
|
updateTimer ms
|
||||||
|
}
|
||||||
|
e.preventDefault
|
||||||
|
|
||||||
|
$("#recorderUI.recording #controlButton, #recorderUI.playing #controlButton").live "click", (e) ->
|
||||||
|
setRecorderUIState "recorded"
|
||||||
|
SC.recordStop()
|
||||||
|
e.preventDefault
|
||||||
|
|
||||||
|
$("#recorderUI.recorded #controlButton").live "click", (e) ->
|
||||||
|
updateTimer 0
|
||||||
|
setRecorderUIState "playing"
|
||||||
|
SC.recordPlay {
|
||||||
|
progress: (ms) ->
|
||||||
|
updateTimer ms
|
||||||
|
finished: () ->
|
||||||
|
setRecorderUIState "recorded"
|
||||||
|
}
|
||||||
|
e.preventDefault
|
||||||
|
|
||||||
|
$("#reset").live "click", (e) ->
|
||||||
|
SC.recordStop
|
||||||
|
setRecorderUIState "reset"
|
||||||
|
e.preventDefault
|
||||||
|
|
||||||
|
$("#upload").live "click", (e) ->
|
||||||
|
setRecorderUIState "uploading"
|
||||||
|
SC.connect {
|
||||||
|
connected: () ->
|
||||||
|
$("#uploadStatus").html "Uploading..."
|
||||||
|
SC.recordUpload {
|
||||||
|
track: {
|
||||||
|
title: $('#full_name').val() + ".voice",
|
||||||
|
sharing: "public"
|
||||||
|
}
|
||||||
|
}, (track) ->
|
||||||
|
$("#uploadStatus").html("Upload Success!<br>Please update your profile");
|
||||||
|
$('#track').val(track.id)
|
||||||
|
$('#secret').val(track.secret_token)
|
||||||
|
}
|
||||||
|
e.preventDefault
|
||||||
|
|
||||||
|
updateTimer = (ms) ->
|
||||||
|
$("#timer").text(SC.Helper.millisecondsToHMS(ms))
|
||||||
|
|
||||||
|
setRecorderUIState = (state) ->
|
||||||
|
$("#recorderUI").attr("class", state)
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
$ ->
|
||||||
|
$('#show-filter').keyup (event) ->
|
||||||
|
switch event.which
|
||||||
|
when 27 then $('#show-filter').val('')
|
||||||
|
toggle_hidden_by_search($('#show-filter').val())
|
||||||
|
|
||||||
|
toggle_hidden_by_search = (str) ->
|
||||||
|
reg = new RegExp(str, 'i')
|
||||||
|
$('.team_name').each (j, v)->
|
||||||
|
if $(v).text().search(reg) + 1
|
||||||
|
$(v).parent().parent().parent().parent().removeClass("hidden")
|
||||||
|
else
|
||||||
|
$(v).parent().parent().parent().parent().addClass("hidden")
|
||||||
|
|
||||||
|
$('#show-filter').keydown (event) ->
|
||||||
|
|
||||||
|
event.preventDefault() if event.which == 13
|
||||||
@@ -4,6 +4,7 @@ $ ->
|
|||||||
$(selector).removeClass("hidden")
|
$(selector).removeClass("hidden")
|
||||||
else
|
else
|
||||||
$(selector).addClass("hidden")
|
$(selector).addClass("hidden")
|
||||||
|
toggle_hidden_by_search($('#show-filter').val())
|
||||||
|
|
||||||
$('#show-past').change -> toggle_hidden(this.checked, '.past')
|
$('#show-past').change -> toggle_hidden(this.checked, '.past')
|
||||||
$('#show-current').change -> toggle_hidden(this.checked, '.current')
|
$('#show-current').change -> toggle_hidden(this.checked, '.current')
|
||||||
@@ -13,8 +14,20 @@ $ ->
|
|||||||
$('#show-filter').keyup (event) ->
|
$('#show-filter').keyup (event) ->
|
||||||
switch event.which
|
switch event.which
|
||||||
when 27 then $('#show-filter').val('')
|
when 27 then $('#show-filter').val('')
|
||||||
|
toggle_hidden_by_search($('#show-filter').val())
|
||||||
|
|
||||||
$('#show-filter').keydown (event) -> event.preventDefault() if event.which == 13
|
toggle_hidden_by_search = (str) ->
|
||||||
|
reg = new RegExp(str, 'i')
|
||||||
|
$('.team-fliter input:checked').next().each (i, e) ->
|
||||||
|
$('.' + $(e).text() + ' .full-name').each (j, v)->
|
||||||
|
if $(v).text().search(reg) + 1
|
||||||
|
$(v).parent().parent().parent().removeClass("hidden")
|
||||||
|
else
|
||||||
|
$(v).parent().parent().parent().addClass("hidden")
|
||||||
|
|
||||||
|
$('#show-filter').keydown (event) ->
|
||||||
|
|
||||||
|
event.preventDefault() if event.which == 13
|
||||||
|
|
||||||
$('#add_new').click ->
|
$('#add_new').click ->
|
||||||
$('.team-content').hide 'slow'
|
$('.team-content').hide 'slow'
|
||||||
@@ -40,6 +53,11 @@ $ ->
|
|||||||
setTimeout ()->
|
setTimeout ()->
|
||||||
node.hide('slow').remove()
|
node.hide('slow').remove()
|
||||||
,4000
|
,4000
|
||||||
|
error: ->
|
||||||
|
node = $('<div></div>').addClass('alert').addClass('alert-error').text 'Sorry,there are some errors occured.'
|
||||||
|
node.insertBefore('p.alert.alert-info')
|
||||||
|
setTimeout ()->
|
||||||
|
node.hide('slow').remove()
|
||||||
|
,4000
|
||||||
$('.do-add').click ->
|
$('.do-add').click ->
|
||||||
$('.add-member-form').ajaxSubmit options
|
$('.add-member-form').ajaxSubmit options
|
||||||
@@ -1,22 +1,11 @@
|
|||||||
body {
|
body {
|
||||||
//background:url('/assets/paper.jpg');
|
background:url('/assets/paper.jpg');
|
||||||
padding-top: 60px;
|
padding-top: 60px;
|
||||||
padding-bottom: 40px;
|
padding-bottom: 40px;
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
text-shadow: white 0 1px 0;
|
||||||
.highlight {
|
font-weight: 100;
|
||||||
-webkit-transition: all 1s ease;
|
|
||||||
-moz-transition: all 1s ease;
|
|
||||||
-o-transition: all 1s ease;
|
|
||||||
color: #333;
|
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
|
|
||||||
//.highlight:hover {
|
|
||||||
// background: #ccc;
|
|
||||||
// text-decoration: none;
|
|
||||||
//}
|
|
||||||
|
|
||||||
.correct {
|
.correct {
|
||||||
background: #090 !important;
|
background: #090 !important;
|
||||||
@@ -77,4 +66,81 @@ body {
|
|||||||
.url-font{
|
.url-font{
|
||||||
color:#777;
|
color:#777;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.avatar-image{
|
||||||
|
border-radius: 150px;
|
||||||
|
box-shadow: 0 0 15px #333;
|
||||||
|
transition:transform 2s;
|
||||||
|
-moz-transition:-moz-transform 2s;
|
||||||
|
-webkit-transition:-webkit-transform 2s;
|
||||||
|
-o-transition:-o-transform 2s;
|
||||||
|
}
|
||||||
|
.avatar-image:hover{
|
||||||
|
transform:rotate(36deg);
|
||||||
|
-moz-transform:rotate(360deg);
|
||||||
|
-webkit-transform:rotate(360deg);
|
||||||
|
-o-transform:rotate(360deg);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.join-status-button{
|
||||||
|
float: left;
|
||||||
|
margin-left: 36px;
|
||||||
|
margin-top: 17px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.team-fliter{
|
||||||
|
margin-left: -29px;
|
||||||
|
}
|
||||||
|
.full-name{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.sexy-bg{
|
||||||
|
background: rgba(255,255,255,0.13);
|
||||||
|
-webkit-box-shadow: 0 0 15px rgba(8, 8, 8, 0.7);
|
||||||
|
}
|
||||||
|
.image-gray{
|
||||||
|
filter: url(filters.svg#grayscale);
|
||||||
|
filter: gray;
|
||||||
|
-webkit-filter: grayscale(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.avatar-img{
|
||||||
|
margin-right:8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.panel{
|
||||||
|
background: #f2f2f2;
|
||||||
|
border: solid 1px #e6e6e6;
|
||||||
|
margin: 0 0 22px 0;
|
||||||
|
padding: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.avatar-hover{
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
top: 0;
|
||||||
|
display: none;
|
||||||
|
border-radius: 150px;
|
||||||
|
text-align: center;
|
||||||
|
background: rgba(14, 238, 112, 0.61);
|
||||||
|
width: 300px;
|
||||||
|
height: 300px;
|
||||||
|
|
||||||
|
}
|
||||||
|
.avatar-info:hover + .avatar-hover{
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.con4avatar{
|
||||||
|
width: 330px;
|
||||||
|
position: relative;
|
||||||
|
float: left;
|
||||||
|
margin-left: 2em;
|
||||||
|
margin-bottom: 2em;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,94 @@
|
|||||||
|
.exampleSource {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#left, #right {
|
||||||
|
width: 45%;
|
||||||
|
float: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
#right {
|
||||||
|
width: 40%;
|
||||||
|
padding-left: 30px;
|
||||||
|
margin-left: 30px;
|
||||||
|
border-left: 1px solid #eee;
|
||||||
|
}
|
||||||
|
|
||||||
|
#right pre {
|
||||||
|
overflow: scroll;
|
||||||
|
}
|
||||||
|
|
||||||
|
.example {
|
||||||
|
border-top: 1px solid #eee;
|
||||||
|
padding-top: 30px;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.big.button {
|
||||||
|
width: 100%;
|
||||||
|
margin-bottom: 30px;
|
||||||
|
padding: 0 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fullWidth {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tab-ui a {
|
||||||
|
color: black;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tab-ui li.current a {
|
||||||
|
color: #F60;
|
||||||
|
}
|
||||||
|
|
||||||
|
#recorderUI {
|
||||||
|
width: 182px;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#recorderUI #timer {
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 10px;
|
||||||
|
color: #333;
|
||||||
|
line-height: 60px;
|
||||||
|
width: 100%;
|
||||||
|
text-align: center;
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#recorderUI.recording #timer, #recorderUI.playing #timer {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#recorderUI #otherControls {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#recorderUI.playing #otherControls, #recorderUI.recorded #otherControls {
|
||||||
|
display: block;
|
||||||
|
margin-left: 38px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#reset, #upload {
|
||||||
|
width: 50px;
|
||||||
|
margin: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#otherControls {
|
||||||
|
clear: both;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#controlButton { margin: auto !important; padding: 0 !important; border: 0 !important; -moz-border-radius: 0; -webkit-border-radius: 0; -o-border-radius: 0; -ms-border-radius: 0; border-radius: 0; -webkit-transition: none; -moz-transition: none; -o-transition: none; transition: none; display: block; width: 60px; height: 60px; background-color: transparent !important; background-image: url(rec_button_large.png) !important; background-position: 0 0; }
|
||||||
|
|
||||||
|
#recorderUI.recording #controlButton, #recorderUI.playing #controlButton {
|
||||||
|
background-position: 0 -60px;
|
||||||
|
}
|
||||||
|
#recorderUI.recorded #controlButton { background-position: 0 -120px; }
|
||||||
|
|
||||||
|
|
||||||
|
#controlButton.pause { background-position: 0 -180px; }
|
||||||
|
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
require 'team_filter'
|
require 'team_filter'
|
||||||
|
require 'pusher'
|
||||||
|
|
||||||
class AntechamberController < ApplicationController
|
class AntechamberController < ApplicationController
|
||||||
include TeamFilter
|
include TeamFilter
|
||||||
@@ -12,7 +13,10 @@ class AntechamberController < ApplicationController
|
|||||||
def create
|
def create
|
||||||
with_team do |team|
|
with_team do |team|
|
||||||
message = Message.create team: team, person: current_person, content: params[:content]
|
message = Message.create team: team, person: current_person, content: params[:content]
|
||||||
render partial: 'shared/one_message', locals: {message: message}
|
|
||||||
|
Pusher.trigger(team.slug, 'new_message',{content:render_to_string( partial: 'shared/one_message', locals: {message: message})})
|
||||||
|
|
||||||
|
render text:'ok'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,8 @@ class HomeController < ApplicationController
|
|||||||
session[:initial_url] = nil
|
session[:initial_url] = nil
|
||||||
redirect_to redirect_url
|
redirect_to redirect_url
|
||||||
else
|
else
|
||||||
@people = Person.find(:all, :conditions => ["show_avatar=true"], :order => "RANDOM()", :limit => 4)
|
#@people = Person.find(:all, :conditions => ["show_avatar=true"], :order => "RANDOM()", :limit => 4)
|
||||||
|
@people = Person.where(show_avatar:true).order("RANDOM()").limit(4)
|
||||||
@google_login = google_oauth_url
|
@google_login = google_oauth_url
|
||||||
render layout: 'landing'
|
render layout: 'landing'
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
require 'soundcloud'
|
require 'soundcloudvalidate'
|
||||||
|
|
||||||
class MembershipController < ApplicationController
|
class MembershipController < ApplicationController
|
||||||
include Soundcloud
|
include Soundcloudvalidate
|
||||||
|
|
||||||
def accept_invitation
|
def accept_invitation
|
||||||
membership = Membership.find_by_pending_approval_token params[:token]
|
membership = Membership.find_by_pending_approval_token params[:token]
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
require 'soundcloud'
|
require 'soundcloudvalidate'
|
||||||
|
|
||||||
class ProfileController < ApplicationController
|
class ProfileController < ApplicationController
|
||||||
include Soundcloud
|
include Soundcloudvalidate
|
||||||
before_filter :current_person
|
before_filter :current_person
|
||||||
|
|
||||||
def update
|
def update
|
||||||
|
|||||||
@@ -5,13 +5,18 @@ class TeamsController < ApplicationController
|
|||||||
include TeamFilter
|
include TeamFilter
|
||||||
|
|
||||||
def index
|
def index
|
||||||
@memberships = current_person.memberships.select { |membership| membership.ended==nil }
|
@memberships = current_person.memberships.select { |membership| membership.ended==nil }.sort_by {|mem| mem.team_name.downcase}
|
||||||
|
@view_membership = current_person.viewable_teams.sort_by {|team| team.name.downcase}
|
||||||
|
if params[:sortby]== 'CreateDate'
|
||||||
|
@memberships = @memberships.sort_by {|mem| mem.id}
|
||||||
|
@view_membership = @view_membership.sort_by {|team| team.id}
|
||||||
|
@sortby = params[:sortby]
|
||||||
|
end
|
||||||
@team = Team.new
|
@team = Team.new
|
||||||
@organisations = Organisation.find(:all)
|
@organisations = Organisation.find(:all)
|
||||||
end
|
end
|
||||||
|
|
||||||
def create
|
def create
|
||||||
|
|
||||||
@teams = current_person.teams
|
@teams = current_person.teams
|
||||||
@team = Team.new params[:team].merge creator: current_person
|
@team = Team.new params[:team].merge creator: current_person
|
||||||
if @team.save
|
if @team.save
|
||||||
@@ -23,6 +28,8 @@ class TeamsController < ApplicationController
|
|||||||
|
|
||||||
redirect_to "/teams/#{@team.slug}"
|
redirect_to "/teams/#{@team.slug}"
|
||||||
else
|
else
|
||||||
|
@memberships = current_person.memberships
|
||||||
|
@view_membership = current_person.viewable_teams
|
||||||
render :index
|
render :index
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -55,9 +62,13 @@ class TeamsController < ApplicationController
|
|||||||
def quiz
|
def quiz
|
||||||
with_team do |team|
|
with_team do |team|
|
||||||
@people = team.people.sample 5
|
@people = team.people.sample 5
|
||||||
@person = @people.sample
|
@person = team.people.select {|person| !person.facts.empty?}.sample
|
||||||
@facts = @person.facts.sample 3
|
if @person
|
||||||
render :quiz
|
@facts = @person.facts.sample 3
|
||||||
|
render :quiz
|
||||||
|
else
|
||||||
|
render :nofacts
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,9 @@
|
|||||||
module ApplicationHelper
|
module ApplicationHelper
|
||||||
def image_for person
|
def image_for person
|
||||||
|
image_tag person.photo? ? person.photo.url(:square) : person.gravatar_url ,class:'avatar-image'
|
||||||
|
end
|
||||||
|
|
||||||
|
def image_for_without_radius person
|
||||||
image_tag person.photo? ? person.photo.url(:square) : person.gravatar_url
|
image_tag person.photo? ? person.photo.url(:square) : person.gravatar_url
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -6,14 +6,15 @@ class Person < ActiveRecord::Base
|
|||||||
extend UuidGenerator
|
extend UuidGenerator
|
||||||
include Gravtastic ,UuidGenerator
|
include Gravtastic ,UuidGenerator
|
||||||
gravtastic :secure => false,
|
gravtastic :secure => false,
|
||||||
:size => 300
|
:size => 300,
|
||||||
|
:default=> "retro"
|
||||||
|
|
||||||
attr_accessible :email, :persona_id, :account, :auth_token
|
attr_accessible :email, :persona_id, :account, :auth_token
|
||||||
attr_accessible :full_name, :chinese_name, :pinyin_name, :preferred_name
|
attr_accessible :full_name, :chinese_name, :pinyin_name, :preferred_name
|
||||||
attr_accessible :photo, :phone
|
attr_accessible :photo, :phone
|
||||||
attr_accessible :url, :twitter, :facebook, :weibo, :appnet, :github ,:flickr
|
attr_accessible :url, :twitter, :facebook, :weibo, :appnet, :github ,:flickr
|
||||||
attr_accessible :lat, :lng
|
attr_accessible :lat, :lng
|
||||||
attr_accessible :show_avatar
|
attr_accessible :job_title, :track, :secret, :show_avatar
|
||||||
|
|
||||||
|
|
||||||
validates_uniqueness_of :account
|
validates_uniqueness_of :account
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ class Team < ActiveRecord::Base
|
|||||||
validates_presence_of :name
|
validates_presence_of :name
|
||||||
validates_presence_of :slug
|
validates_presence_of :slug
|
||||||
validates_uniqueness_of :slug
|
validates_uniqueness_of :slug
|
||||||
|
validate :format_slug ,:on => :create
|
||||||
|
|
||||||
has_many :memberships
|
has_many :memberships
|
||||||
has_many :people, through: :memberships
|
has_many :people, through: :memberships
|
||||||
@@ -26,4 +27,10 @@ class Team < ActiveRecord::Base
|
|||||||
def add_to (organisation)
|
def add_to (organisation)
|
||||||
organisations << organisation if organisation
|
organisations << organisation if organisation
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def format_slug
|
||||||
|
|
||||||
|
slug.gsub!(/ /, "_") if slug
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
@@ -1,11 +1,15 @@
|
|||||||
- content_for :javascript_includes do
|
- content_for :javascript_includes do
|
||||||
= javascript_include_tag 'antechamber'
|
|
||||||
= javascript_include_tag '/jquery.form.js'
|
= javascript_include_tag '/jquery.form.js'
|
||||||
|
= javascript_include_tag 'http://js.pusher.com/1.12/pusher.min.js'
|
||||||
|
= javascript_include_tag 'antechamber'
|
||||||
|
|
||||||
= render partial: 'shared/team_menu_items'
|
= render partial: 'shared/team_menu_items'
|
||||||
|
|
||||||
h1 = @team.name
|
h1 = @team.name
|
||||||
form.form-inline action="/antechamber/#{@team.slug}"
|
form.form-inline action="/antechamber/#{@team.slug}"
|
||||||
p #{text_area_tag :content, nil, placeholder: 'Enter Message', rows: 4,class:'message-body'}
|
input type="hidden" id="pusher_key" value="#{ENV['PUSHER_KEY']}"
|
||||||
|
input type="hidden" id="team_slug" value="#{@team.slug}"
|
||||||
|
p #{text_area_tag :content, nil, placeholder: 'Enter Message', rows: 4 ,class:'message-body',style:"width:30%"}
|
||||||
a.btn.submit-mess Send
|
a.btn.submit-mess Send
|
||||||
|
|
||||||
div.message-list
|
div.message-list
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ footer
|
|||||||
li
|
li
|
||||||
a href="https://github.com/ocelots/ocelots/graphs/contributors" Development Team
|
a href="https://github.com/ocelots/ocelots/graphs/contributors" Development Team
|
||||||
p.copyright
|
p.copyright
|
||||||
span © 2012
|
span © 2013
|
||||||
span style="font-family: Trebuchet MS, sans-serif;"
|
span style="font-family: Trebuchet MS, sans-serif;"
|
||||||
strong Thought
|
strong Thought
|
||||||
span Works
|
span Works
|
||||||
@@ -9,6 +9,7 @@ html
|
|||||||
= stylesheet_link_tag '/fancyapps-fancyBox-2bb0da9/source/jquery.fancybox.css'
|
= stylesheet_link_tag '/fancyapps-fancyBox-2bb0da9/source/jquery.fancybox.css'
|
||||||
= csrf_meta_tags
|
= csrf_meta_tags
|
||||||
= javascript_include_tag '/ga.js'
|
= javascript_include_tag '/ga.js'
|
||||||
|
= yield :style_includes
|
||||||
|
|
||||||
body
|
body
|
||||||
|
|
||||||
@@ -31,6 +32,5 @@ html
|
|||||||
= javascript_include_tag 'application'
|
= javascript_include_tag 'application'
|
||||||
= javascript_include_tag '/bootstrap/js/bootstrap.min.js'
|
= javascript_include_tag '/bootstrap/js/bootstrap.min.js'
|
||||||
= javascript_include_tag '/fancyapps-fancyBox-2bb0da9/source/jquery.fancybox.pack.js'
|
= javascript_include_tag '/fancyapps-fancyBox-2bb0da9/source/jquery.fancybox.pack.js'
|
||||||
= javascript_include_tag "http://maps.googleapis.com/maps/api/js?key=#{ENV['GOOGLE_API']}&sensor=false"
|
|
||||||
= yield :javascript_includes
|
= yield :javascript_includes
|
||||||
= javascript_include_tag '/uservoice.js'
|
= javascript_include_tag '/uservoice.js'
|
||||||
|
|||||||
@@ -1,7 +1,13 @@
|
|||||||
- content_for :javascript_includes do
|
- content_for :javascript_includes do
|
||||||
= javascript_include_tag 'profile'
|
= javascript_include_tag 'profile'
|
||||||
|
= javascript_include_tag 'soundcloud'
|
||||||
|
= javascript_include_tag 'https://connect.soundcloud.com/sdk.js'
|
||||||
|
= javascript_include_tag "http://maps.googleapis.com/maps/api/js?key=#{ENV['GOOGLE_API']}&sensor=false"
|
||||||
|
= javascript_include_tag 'google_map'
|
||||||
|
- content_for :style_includes do
|
||||||
|
= stylesheet_link_tag 'soundcloud'
|
||||||
|
|
||||||
div.hero-unit.highlight
|
div.hero-unit.highlight.sexy-bg
|
||||||
div.row
|
div.row
|
||||||
div.span4
|
div.span4
|
||||||
a href="/profiles/#{@current_person.account}"
|
a href="/profiles/#{@current_person.account}"
|
||||||
@@ -34,6 +40,10 @@ h1 Edit
|
|||||||
label.control-label for="photo" Photo
|
label.control-label for="photo" Photo
|
||||||
div.controls
|
div.controls
|
||||||
= form.file_field :photo
|
= form.file_field :photo
|
||||||
|
div.controls style="margin-top:8px;"
|
||||||
|
span Or Set Your
|
||||||
|
span
|
||||||
|
a href="http://en.gravatar.com/" target="_blank" Gravatar
|
||||||
div.control-group
|
div.control-group
|
||||||
label.control-label for="person_account" Profile
|
label.control-label for="person_account" Profile
|
||||||
div.controls
|
div.controls
|
||||||
@@ -45,7 +55,7 @@ h1 Edit
|
|||||||
div.control-group
|
div.control-group
|
||||||
label.control-label for="person_full_name" Full Name
|
label.control-label for="person_full_name" Full Name
|
||||||
div.controls
|
div.controls
|
||||||
= form.text_field :full_name
|
= form.text_field :full_name, id: "full_name"
|
||||||
div.control-group
|
div.control-group
|
||||||
label.control-label for="person_chinese_name" Chinese Name
|
label.control-label for="person_chinese_name" Chinese Name
|
||||||
div.controls
|
div.controls
|
||||||
@@ -59,17 +69,29 @@ h1 Edit
|
|||||||
div.controls
|
div.controls
|
||||||
= form.text_field :preferred_name
|
= form.text_field :preferred_name
|
||||||
div.control-group
|
div.control-group
|
||||||
label.control-label for="person_sc_embed_code" Soundcloud embed code
|
label.control-label for="person_sc_embed_code" Record Your Voice
|
||||||
div.controls
|
div.controls
|
||||||
= text_field_tag :sc_embed_code, nil
|
= form.text_field :track, id:'track', type:'hidden'
|
||||||
|
= form.text_field :secret, id:'secret', type:'hidden'
|
||||||
|
div id="recorderUI" class="reset"
|
||||||
|
a href="#" id="controlButton" class="record"
|
||||||
|
span id="timer" class="hidden" 0:00
|
||||||
|
div id="otherControls"
|
||||||
|
a href="#" id="reset" class="button" Reset
|
||||||
|
a href="#" id="upload" class="button" Upload
|
||||||
|
div id="uploadStatus"
|
||||||
div.control-group
|
div.control-group
|
||||||
label.control-label for="person_phone" Phone
|
label.control-label for="person_phone" Phone
|
||||||
div.controls
|
div.controls
|
||||||
= form.text_field :phone
|
= form.text_field :phone
|
||||||
|
div.control-group
|
||||||
|
label.control-label for="person_phone" Job Title
|
||||||
|
div.controls
|
||||||
|
= form.text_field :job_title
|
||||||
div.control-group
|
div.control-group
|
||||||
label.control-label for="person_url" Personal site
|
label.control-label for="person_url" Personal site
|
||||||
div.controls
|
div.controls
|
||||||
p #{form.text_field :url,placeholder:'Need http://'}
|
p #{form.text_field :url,placeholder:'Without http://'}
|
||||||
div.control-group
|
div.control-group
|
||||||
label.control-label for="person_twitter" Twitter
|
label.control-label for="person_twitter" Twitter
|
||||||
div.controls
|
div.controls
|
||||||
@@ -104,7 +126,7 @@ h1 Edit
|
|||||||
div.control-group
|
div.control-group
|
||||||
label.control-label for="person_appnet" Appnet Preview
|
label.control-label for="person_appnet" Appnet Preview
|
||||||
div.controls.url-font
|
div.controls.url-font
|
||||||
span http://alpha.appnet.com/
|
span http://alpha.app.net/
|
||||||
span.appnet-preview #{@current_person.appnet}
|
span.appnet-preview #{@current_person.appnet}
|
||||||
div.control-group
|
div.control-group
|
||||||
label.control-label for="person_github" Github
|
label.control-label for="person_github" Github
|
||||||
@@ -122,14 +144,16 @@ h1 Edit
|
|||||||
div.control-group
|
div.control-group
|
||||||
label.control-label for="person_flickr" Flickr Preview
|
label.control-label for="person_flickr" Flickr Preview
|
||||||
div.controls.url-font
|
div.controls.url-font
|
||||||
span http://flickr.com/
|
span http://flickr.com/photos/
|
||||||
span.flickr-preview #{@current_person.flickr}
|
span.flickr-preview #{@current_person.flickr}
|
||||||
div.control-group
|
div.control-group
|
||||||
label.control-label for="lat" Birthplace
|
label.control-label for="lat" Location
|
||||||
div.controls
|
div.controls
|
||||||
div.label.label-info Please move the pin to choose your location.
|
input#address type="text"
|
||||||
p #{form.text_field :lat,:type => 'hidden'} #{form.text_field :lng,:type=> 'hidden'}
|
button#address_btn style='margin-left:1em' Search
|
||||||
div id="map_canvas" style="width: 600px; height: 300px;"
|
p #{form.text_field :lat,:type => 'hidden', :id => 'person_lat'} #{form.text_field :lng,:type=> 'hidden', :id => 'person_lng'}
|
||||||
|
div.error_maps.alert.alert-error.hidden style="color:red;margin-left: 13em" The place you just searched does not exist.
|
||||||
|
div id="map_canvas" style="width: 600px; height: 300px;margin-left: 13em"
|
||||||
div.form-actions
|
div.form-actions
|
||||||
= form.submit 'Update Profile', class: 'btn btn-primary'
|
= form.submit 'Update Profile', class: 'btn btn-primary'
|
||||||
div.control-group
|
div.control-group
|
||||||
|
|||||||
@@ -1,20 +1,22 @@
|
|||||||
div.hero-unit
|
- content_for :javascript_includes do
|
||||||
|
= javascript_include_tag "http://maps.googleapis.com/maps/api/js?key=#{ENV['GOOGLE_API']}&sensor=false"
|
||||||
|
= javascript_include_tag "profiles"
|
||||||
|
div.hero-unit.sexy-bg
|
||||||
div.row.person
|
div.row.person
|
||||||
div.span4
|
div.span4
|
||||||
=image_for @person
|
=image_for @person
|
||||||
div.span4
|
div.span4 style="margin-top:0px"
|
||||||
= render partial: 'shared/person', locals: {person: @person}
|
= render partial: 'shared/person', locals: {person: @person}
|
||||||
|
|
||||||
p
|
p
|
||||||
= phone_link_to @person.phone
|
= phone_link_to @person.phone
|
||||||
|
|
||||||
= render partial: 'shared/person_social_media', locals: {person: @person}
|
= render partial: 'shared/person_social_media', locals: {person: @person}
|
||||||
|
div.span2
|
||||||
blockquote
|
h2 Facts:
|
||||||
ul.unstyled
|
ul
|
||||||
- @person.facts.each do |fact|
|
- @person.facts.each do |fact|
|
||||||
li
|
li
|
||||||
p I #{fact.content}
|
p I #{fact.content}
|
||||||
|
|
||||||
- if @person.lat and @person.lng
|
- if @person.lat and @person.lng
|
||||||
div.row
|
div.row
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
h1 = person.full_name
|
h1.full-name = person.full_name
|
||||||
|
|
||||||
- if person.chinese_name
|
- if person.chinese_name
|
||||||
h1 = person.chinese_name
|
h1 = person.chinese_name
|
||||||
@@ -10,4 +10,5 @@ h1 = person.full_name
|
|||||||
h2
|
h2
|
||||||
i = person.preferred_name
|
i = person.preferred_name
|
||||||
|
|
||||||
|
i style="font-size:1.2em" = person.job_title
|
||||||
p = person.email
|
p = person.email
|
||||||
@@ -1,22 +1,39 @@
|
|||||||
div.social_media
|
div.social_media
|
||||||
- unless person.url.blank?
|
|
||||||
a href="http://#{person.url}"
|
- if person.url.blank?
|
||||||
img src='/assets/url.png'
|
img.image-gray.avatar-img src='/assets/url.png'
|
||||||
- unless person.twitter.blank?
|
- else
|
||||||
a href="http://twitter.com/#{person.twitter}"
|
a href="http://#{person.url}"
|
||||||
img src='/assets/twitter.png'
|
img.avatar-img src='/assets/url.png'
|
||||||
- unless person.facebook.blank?
|
- if person.twitter.blank?
|
||||||
a href="http://www.facebook.com/#{person.facebook}"
|
img.image-gray.avatar-img src='/assets/twitter.png'
|
||||||
img src='/assets/facebook.png'
|
-else
|
||||||
- unless person.weibo.blank?
|
a href="http://twitter.com/#{person.twitter}"
|
||||||
a href="http://weibo.com/#{person.weibo}"
|
img.avatar-img src='/assets/twitter.png'
|
||||||
img src='/assets/weibo-1.png'
|
- if person.facebook.blank?
|
||||||
- unless person.appnet.blank?
|
img.image-gray.avatar-img src='/assets/facebook.png'
|
||||||
a href="http://alpha.app.net/#{person.appnet}"
|
-else
|
||||||
img src='/assets/appnet.png'
|
a href="http://www.facebook.com/#{person.facebook}"
|
||||||
- unless person.github.blank?
|
img.avatar-img src='/assets/facebook.png'
|
||||||
a href="http://github.com/#{person.github}"
|
- if person.weibo.blank?
|
||||||
img src='/assets/github.png'
|
img.image-gray src='/assets/weibo-1.png'
|
||||||
- unless person.flickr.blank?
|
-else
|
||||||
a href="http://flickr.com/photos/#{person.flickr}"
|
a href="http://weibo.com/#{person.weibo}"
|
||||||
img src='/assets/flickr.png'
|
img.avatar-img src='/assets/weibo-1.png'
|
||||||
|
- if person.appnet.blank?
|
||||||
|
img.image-gray.avatar-img src='/assets/appnet.png'
|
||||||
|
-else
|
||||||
|
a href="http://alpha.app.net/#{person.appnet}"
|
||||||
|
img.avatar-img src='/assets/appnet.png'
|
||||||
|
- if person.github.blank?
|
||||||
|
img.image-gray.avatar-img src='/assets/github.png'
|
||||||
|
-else
|
||||||
|
a href="http://github.com/#{person.github}"
|
||||||
|
img.avatar-img src='/assets/github.png'
|
||||||
|
- if person.flickr.blank?
|
||||||
|
img.image-gray.avatar-img src='/assets/flickr.png'
|
||||||
|
-else
|
||||||
|
a href="http://flickr.com/photos/#{person.flickr}"
|
||||||
|
img.avatar-img src='/assets/flickr.png'
|
||||||
|
div.clear
|
||||||
|
p
|
||||||
@@ -1 +1 @@
|
|||||||
iframe height="166" scrolling="no" frameborder="no" src="http://w.soundcloud.com/player/?url=http%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F#{object.track}%3F#{object.secret ? "secret_token%3D#{object.secret}" : ''}&auto_play=false&show_artwork=false&color=ff7700"
|
iframe height="166" scrolling="no" frameborder="no" src="https://w.soundcloud.com/player/?url=http%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F#{object.track}%3F#{object.secret ? "secret_token%3D#{object.secret}" : ''}&auto_play=false&show_artwork=false&color=ff7700"
|
||||||
@@ -1,11 +1,9 @@
|
|||||||
div.hero-unit.highlight class="#{membership.status}"
|
div.highlight.con4avatar class="#{membership.status}"
|
||||||
div.row
|
div.avatar-info
|
||||||
div.span4
|
=image_for membership.person
|
||||||
a href="/profiles/#{membership.account}"
|
div.avatar-hover
|
||||||
=image_for membership.person
|
a href="/profiles/#{membership.account}"
|
||||||
div.span4
|
h1 style="margin-top:3.5em" = membership.person.full_name
|
||||||
= render partial: 'shared/person', locals: {person: membership.person}
|
|
||||||
= render partial: 'shared/membership', locals: {membership: membership}
|
|
||||||
-if membership.person == @current_person
|
-if membership.person == @current_person
|
||||||
= link_to 'edit membership', '#add_sc', class: 'fancybox btn btn-primary'
|
= link_to 'edit membership', '#add_sc', class: 'fancybox btn btn-primary'
|
||||||
div id="add_sc" style="display:none;"
|
div id="add_sc" style="display:none;"
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
div.hero-unit.pending.hidden
|
div.con4avatar.pending.hidden
|
||||||
div.row.person
|
div.avatar-info
|
||||||
div.span4
|
img.avatar-image src="/assets/silhouette.png" width=300
|
||||||
img src="/assets/silhouette.png" width=300
|
div.avatar-hover
|
||||||
div.span4
|
h3 style="margin-top:4em" = membership.email
|
||||||
p = membership.email
|
i (membership pending)
|
||||||
i (membership pending)
|
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
- @team.people.each do |person|
|
- @team.people.each do |person|
|
||||||
div.avatar
|
div.avatar
|
||||||
=image_for person
|
a href="/profiles/#{person.account}" target="_blank"
|
||||||
h2 #{person.full_name}
|
=image_for_without_radius person
|
||||||
- if person.preferred_name
|
h2 #{person.full_name}
|
||||||
p #{person.preferred_name}
|
- if person.job_title
|
||||||
|
i #{person.job_title}
|
||||||
@@ -1,3 +1,5 @@
|
|||||||
|
- content_for :javascript_includes do
|
||||||
|
= javascript_include_tag 'teams'
|
||||||
- content_for :menu_items do
|
- content_for :menu_items do
|
||||||
li
|
li
|
||||||
= link_to 'add team', '#add_new', class: 'fancybox'
|
= link_to 'add team', '#add_new', class: 'fancybox'
|
||||||
@@ -16,6 +18,16 @@ div id="add_new" style="display:none;"
|
|||||||
|
|
||||||
div.form-actions
|
div.form-actions
|
||||||
= form.submit 'Create', class: 'btn'
|
= form.submit 'Create', class: 'btn'
|
||||||
|
div style="overflow:hidden;margin-bottom:1em"
|
||||||
|
div.btn-group style="float:left;"
|
||||||
|
-if @sortby
|
||||||
|
a.btn href='/teams' Team Name
|
||||||
|
a.btn.btn-primary href='/teams?sortby=CreateDate' Create Date
|
||||||
|
-else
|
||||||
|
a.btn.btn-primary href='/teams' Team Name
|
||||||
|
a.btn href='/teams?sortby=CreateDate' Create Date
|
||||||
|
div.btn-group style="float:right;"
|
||||||
|
input.span2.search-query id="show-filter" type="text" placeholder="search"
|
||||||
|
|
||||||
- @memberships.each do |membership|
|
- @memberships.each do |membership|
|
||||||
a href="/teams/#{membership.team_slug}"
|
a href="/teams/#{membership.team_slug}"
|
||||||
@@ -24,7 +36,7 @@ div id="add_new" style="display:none;"
|
|||||||
div.span4
|
div.span4
|
||||||
img src="/assets/team.png"
|
img src="/assets/team.png"
|
||||||
div.span4
|
div.span4
|
||||||
h1 = membership.team_name
|
h1.team_name = membership.team_name
|
||||||
p = membership.team_description
|
p = membership.team_description
|
||||||
div.span1
|
div.span1
|
||||||
- if membership.pending?
|
- if membership.pending?
|
||||||
@@ -41,14 +53,14 @@ div.clearfix
|
|||||||
div style="margin-top:-30px"
|
div style="margin-top:-30px"
|
||||||
h3 style="text-align:center" Viewable Teams
|
h3 style="text-align:center" Viewable Teams
|
||||||
hr style="margin-top:-30px"
|
hr style="margin-top:-30px"
|
||||||
- current_person.viewable_teams.each do |team|
|
- @view_membership.each do |team|
|
||||||
a href="/teams/#{team.slug}"
|
a href="/teams/#{team.slug}"
|
||||||
div.hero-unit.highlight.viewable-team
|
div.hero-unit.highlight.viewable-team
|
||||||
div.row
|
div.row
|
||||||
div.span4
|
div.span4
|
||||||
img src="/assets/team.png"
|
img src="/assets/team.png"
|
||||||
div.span4
|
div.span4
|
||||||
h1 = team.name
|
h1.team_name = team.name
|
||||||
p = team.description
|
p = team.description
|
||||||
div.span1
|
div.span1
|
||||||
div.span1 style="margin:60px 0 0 65px"
|
div.span1 style="margin:60px 0 0 65px"
|
||||||
|
|||||||
@@ -0,0 +1,7 @@
|
|||||||
|
= render partial: 'shared/team_menu_items'
|
||||||
|
|
||||||
|
div.row
|
||||||
|
div.span4.offset4
|
||||||
|
div.alert.alert-block
|
||||||
|
strong Sorry!
|
||||||
|
p The people of this team do not seem to have a fact
|
||||||
@@ -1,11 +1,12 @@
|
|||||||
= render partial: 'shared/team_menu_items'
|
= render partial: 'shared/team_menu_items'
|
||||||
|
|
||||||
|
h1 I have some facts:
|
||||||
ul
|
ul
|
||||||
- @facts.each do |fact|
|
- @facts.each do |fact|
|
||||||
li
|
li
|
||||||
h3 = 'I ' + fact.content
|
h3 = 'I ' + fact.content
|
||||||
|
|
||||||
h1 am i ...
|
h1 Guess who am I ...
|
||||||
|
|
||||||
- @people.each do |person|
|
- @people.each do |person|
|
||||||
a.quiz href="#" data-correct="#{person == @person ? 'true' : 'false'}"
|
a.quiz href="#" data-correct="#{person == @person ? 'true' : 'false'}"
|
||||||
|
|||||||
@@ -15,16 +15,18 @@
|
|||||||
|
|
||||||
div.team-content
|
div.team-content
|
||||||
|
|
||||||
h1 = @team.name
|
h1 style="float:left;" = @team.name
|
||||||
|
|
||||||
- if current_person.approved_teams.include? @team
|
div.join-status-button
|
||||||
=form_tag "/teams/#{@team.slug}/quit" do
|
- if current_person.approved_teams.include? @team
|
||||||
=submit_tag 'Quit Team',id:"join-team",class:"btn btn-danger "
|
=form_tag "/teams/#{@team.slug}/quit" do
|
||||||
-else
|
=submit_tag 'Quit Team',id:"join-team",class:"btn btn-danger "
|
||||||
=form_tag "/teams/#{@team.slug}/join" do
|
-else
|
||||||
=submit_tag 'Join Team',id:"join-team",class:"btn btn-primary "
|
=form_tag "/teams/#{@team.slug}/join" do
|
||||||
|
=submit_tag 'Join Team',id:"join-team",class:"btn btn-primary "
|
||||||
p
|
p
|
||||||
form.form-inline
|
div.clear
|
||||||
|
form.form-inline.team-fliter
|
||||||
label.span1.checkbox
|
label.span1.checkbox
|
||||||
input type="checkbox" id="show-past"
|
input type="checkbox" id="show-past"
|
||||||
span past
|
span past
|
||||||
@@ -37,9 +39,12 @@ div.team-content
|
|||||||
label.span1.checkbox
|
label.span1.checkbox
|
||||||
input type="checkbox" id="show-pending"
|
input type="checkbox" id="show-pending"
|
||||||
span pending
|
span pending
|
||||||
input.span2.search-query id="show-filter" type="text" placeholder="search"
|
input.span2.search-query id="show-filter" type="text" placeholder="search" style="float:right;margin-bottom: 10px;margin-right: 10px;"
|
||||||
- @team.memberships.each do |membership|
|
|
||||||
= render partial: membership_partial(membership), locals: {membership: membership, current_person: @current_person}
|
div.clear
|
||||||
|
div.row-fluid
|
||||||
|
- @team.memberships.each do |membership|
|
||||||
|
= render partial: membership_partial(membership), locals: {membership: membership, current_person: @current_person}
|
||||||
|
|
||||||
div#new-content style="display:none;"
|
div#new-content style="display:none;"
|
||||||
p.lead Add new team members
|
p.lead Add new team members
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
require 'pusher'
|
||||||
|
|
||||||
Ocelots::Application.configure do
|
Ocelots::Application.configure do
|
||||||
# Settings specified here will take precedence over those in config/application.rb
|
# Settings specified here will take precedence over those in config/application.rb
|
||||||
|
|
||||||
@@ -34,6 +36,7 @@ Ocelots::Application.configure do
|
|||||||
|
|
||||||
# Expands the lines which load the assets
|
# Expands the lines which load the assets
|
||||||
config.assets.debug = true
|
config.assets.debug = true
|
||||||
|
|
||||||
# paperclip will save to public/system/[object] when running local
|
# paperclip will save to public/system/[object] when running local
|
||||||
if(ENV['S3_BUCKET'].nil?)
|
if(ENV['S3_BUCKET'].nil?)
|
||||||
config.paperclip_storage_options = {}
|
config.paperclip_storage_options = {}
|
||||||
@@ -49,4 +52,8 @@ Ocelots::Application.configure do
|
|||||||
path: "/development/:persona_id/photos/:style/:basename.:extension"
|
path: "/development/:persona_id/photos/:style/:basename.:extension"
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Pusher.app_id = ENV['PUSHER_APP_ID']
|
||||||
|
Pusher.key = ENV['PUSHER_KEY']
|
||||||
|
Pusher.secret = ENV['PUSHER_SECRET']
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -20,6 +20,9 @@ Ocelots::Application.configure do
|
|||||||
# Generate digests for assets URLs
|
# Generate digests for assets URLs
|
||||||
config.assets.digest = true
|
config.assets.digest = true
|
||||||
|
|
||||||
|
|
||||||
|
#config.static_cache_control = "public, max-age=3600"
|
||||||
|
|
||||||
# Defaults to nil and saved in location specified by config.assets.prefix
|
# Defaults to nil and saved in location specified by config.assets.prefix
|
||||||
# config.assets.manifest = YOUR_PATH
|
# config.assets.manifest = YOUR_PATH
|
||||||
|
|
||||||
@@ -47,7 +50,7 @@ Ocelots::Application.configure do
|
|||||||
|
|
||||||
# Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
|
# Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
|
||||||
config.assets.precompile << '*.js'
|
config.assets.precompile << '*.js'
|
||||||
config.assets.precompile += %w( style.css )
|
config.assets.precompile << '*.css'
|
||||||
|
|
||||||
# Disable delivery errors, bad email addresses will be ignored
|
# Disable delivery errors, bad email addresses will be ignored
|
||||||
# config.action_mailer.raise_delivery_errors = false
|
# config.action_mailer.raise_delivery_errors = false
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
class AddJobTitleToPeople < ActiveRecord::Migration
|
||||||
|
def change
|
||||||
|
add_column :people ,:job_title , :string
|
||||||
|
end
|
||||||
|
end
|
||||||
+2
-1
@@ -11,7 +11,7 @@
|
|||||||
#
|
#
|
||||||
# It's strongly recommended to check this file into your version control system.
|
# It's strongly recommended to check this file into your version control system.
|
||||||
|
|
||||||
ActiveRecord::Schema.define(:version => 20121121081226) do
|
ActiveRecord::Schema.define(:version => 20121204070333) do
|
||||||
|
|
||||||
create_table "engagements", :force => true do |t|
|
create_table "engagements", :force => true do |t|
|
||||||
t.integer "organisation_id"
|
t.integer "organisation_id"
|
||||||
@@ -81,6 +81,7 @@ ActiveRecord::Schema.define(:version => 20121121081226) do
|
|||||||
t.float "lng"
|
t.float "lng"
|
||||||
t.boolean "show_avatar", :default => true
|
t.boolean "show_avatar", :default => true
|
||||||
t.string "flickr"
|
t.string "flickr"
|
||||||
|
t.string "job_title"
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "teams", :force => true do |t|
|
create_table "teams", :force => true do |t|
|
||||||
|
|||||||
Executable
+19
@@ -0,0 +1,19 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# export google oauth variables
|
||||||
|
# sign up keys from: https://code.google.com/apis/console#access
|
||||||
|
|
||||||
|
export GOOGLE_OAUTH_CLIENT_ID="replace_it"
|
||||||
|
export GOOGLE_OAUTH_CLIENT_SECRET="replace_it"
|
||||||
|
export GOOGLE_OAUTH_REDIRECT="replace_it"
|
||||||
|
|
||||||
|
# export Pusher variables
|
||||||
|
# at fisrt you need add pusher addon in heroku,and then get the access variables from pusher config page on heroku
|
||||||
|
|
||||||
|
export PUSHER_APP_ID= replace_it
|
||||||
|
export PUSHER_KEY='replace_it'
|
||||||
|
export PUSHER_SECRET='replace_it'
|
||||||
|
|
||||||
|
echo 'Install done,now please run rails server'
|
||||||
|
|
||||||
|
exec $SHELL -i
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
module Soundcloud
|
module Soundcloudvalidate
|
||||||
def process_sc_embed_code object, owner
|
def process_sc_embed_code object, owner
|
||||||
return unless object
|
return unless object
|
||||||
return unless owner == current_person
|
return unless owner == current_person
|
||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
module TeamFilter
|
module TeamFilter
|
||||||
def with_team
|
def with_team
|
||||||
@team = Team.find_by_slug params[:slug]
|
@team = Team.find_by_slug params[:slug]
|
||||||
unless current_person.allowed_to_view_team?(@team)
|
unless current_person.allowed_to_view_team?(@team)
|
||||||
@team = nil
|
@team = nil
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head><meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
|
<title>Connect with SoundCloud</title>
|
||||||
|
</head>
|
||||||
|
<body onload="window.opener.setTimeout(window.opener.SC.connectCallback, 1)">
|
||||||
|
<b style="width: 100%; text-align: center;">This popup should automatically close in a few seconds</b>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -11,15 +11,25 @@ describe TeamsController do
|
|||||||
|
|
||||||
describe :index do
|
describe :index do
|
||||||
it 'fetches all organisations' do
|
it 'fetches all organisations' do
|
||||||
|
@person.teams.create(name: 'IBM', slug: 'IBM')
|
||||||
get :index
|
get :index
|
||||||
all_organisations = assigns[:organisations]
|
all_organisations = assigns[:organisations]
|
||||||
all_organisations.should_not be_nil
|
all_organisations.should_not be_nil
|
||||||
all_organisations.should_not be_empty
|
all_organisations.should_not be_empty
|
||||||
|
all_memberships = assigns[:memberships]
|
||||||
|
all_memberships[0].team_name.should <= all_memberships[1].team_name
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'fetches teams which sort by create date' do
|
||||||
|
@person.teams.create(name: 'IBM', slug: 'ibm')
|
||||||
|
get :index, sortby: 'CreateDate'
|
||||||
|
all_memberships = assigns[:memberships]
|
||||||
|
all_memberships[0].team_name.should_not <= all_memberships[1].team_name
|
||||||
|
assigns[:sortby].should == 'CreateDate'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
describe :show do
|
describe :show do
|
||||||
|
|
||||||
it 'shows selected team' do
|
it 'shows selected team' do
|
||||||
get :show, :slug => @team.slug
|
get :show, :slug => @team.slug
|
||||||
response.should be_success
|
response.should be_success
|
||||||
@@ -54,6 +64,22 @@ describe TeamsController do
|
|||||||
new_team.name.should == 'CDI'
|
new_team.name.should == 'CDI'
|
||||||
new_team.organisations.first.should == @organisation
|
new_team.organisations.first.should == @organisation
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it 'not create team with null name' do
|
||||||
|
lambda do
|
||||||
|
post :create, team: {name: nil, slug: 'cdi'}, org_ids: [@organisation.id.to_s]
|
||||||
|
end.should_not change(Team, :count)
|
||||||
|
assigns(:memberships).should_not be_nil
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'not create team with null slug' do
|
||||||
|
lambda do
|
||||||
|
post :create, team: {name: 'CDI', slug: nil}, org_ids: [@organisation.id.to_s]
|
||||||
|
end.should_not change(Team, :count)
|
||||||
|
assigns(:memberships).should_not be_nil
|
||||||
|
assigns[:view_membership].should_not be_nil
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
describe :join do
|
describe :join do
|
||||||
@@ -131,4 +157,19 @@ describe TeamsController do
|
|||||||
response.body.should be_include('failed')
|
response.body.should be_include('failed')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
describe :quiz do
|
||||||
|
it 'ensure select a person with facts' do
|
||||||
|
@person.facts.create(content: "I like food")
|
||||||
|
get :quiz, :slug => @team.slug
|
||||||
|
response.should render_template('quiz')
|
||||||
|
assigns(:people).should_not be_empty
|
||||||
|
assigns(:facts).should_not be_empty
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'ensure show nofacts page when people who in a team have not a fact' do
|
||||||
|
get :quiz, :slug => @team.slug
|
||||||
|
response.should render_template('nofacts')
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
@@ -29,7 +29,7 @@ describe Membership do
|
|||||||
end.should change(Membership, :count).by(1)
|
end.should change(Membership, :count).by(1)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'ensure do not invite someone who has a pending membership with a team' do
|
it 'ensure do not invite someone who joined that team' do
|
||||||
@invitee.teams << @team
|
@invitee.teams << @team
|
||||||
lambda do
|
lambda do
|
||||||
Membership.create_pending_membership(@inviter, @invitee, @team)
|
Membership.create_pending_membership(@inviter, @invitee, @team)
|
||||||
@@ -41,5 +41,12 @@ describe Membership do
|
|||||||
Membership.create_pending_membership(@inviter, @inviter, @team)
|
Membership.create_pending_membership(@inviter, @inviter, @team)
|
||||||
end.should_not change(Membership, :count)
|
end.should_not change(Membership, :count)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it 'ensure do not invite someone more than once' do
|
||||||
|
Membership.create team: @team, person: @invitee,pending_approval_token: uuid
|
||||||
|
lambda do
|
||||||
|
Membership.create_pending_membership(@inviter, @invitee, @team)
|
||||||
|
end.should_not change(Membership, :count)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -103,12 +103,6 @@ describe Person do
|
|||||||
person.organisation.name.should == tw.name
|
person.organisation.name.should == tw.name
|
||||||
end
|
end
|
||||||
|
|
||||||
#it 'ensure return the accurate orgisation by email when some orgisation has several domains' do
|
|
||||||
# tw = Organisation.create(name: 'ThoughtWorks',domains:'thoughtworks.com,tw.com')
|
|
||||||
# person = Person.create_for_email('test@thoughtworks.com')
|
|
||||||
# person.get_organisation_by_email.name.should == tw.name
|
|
||||||
#end
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
describe :refresh_auth_token do
|
describe :refresh_auth_token do
|
||||||
|
|||||||
@@ -19,4 +19,14 @@ describe Team do
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
describe 'create team' do
|
||||||
|
|
||||||
|
it 'ensure when create a team,if team"s slug has blanks, it will be format to url string "' do
|
||||||
|
@person = Person.create_for_email 'test@thoughworks.com'
|
||||||
|
@team = @person.teams.create(name: 'LSP', slug: 'l s p')
|
||||||
|
@team.slug.should == 'l_s_p'
|
||||||
|
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
Reference in New Issue
Block a user