106 Commits
Author SHA1 Message Date
junv 4df0903ae4 try to modify default avatar to reto 2013-02-05 11:41:48 +08:00
junv 60ddc673bc change avatar default image 2013-02-05 11:38:24 +08:00
junv aaa56385da fix 2013-02-05 11:19:30 +08:00
junv 70cec97aee fix team members display bug 2013-02-05 11:15:29 +08:00
junv 837762975d modify past person display of a team 2013-02-05 09:35:28 +08:00
junv fe56839528 disable gzip under development environment 2013-02-05 09:25:19 +08:00
junv 7df18c049f remove gzip expires time temporary 2013-02-04 15:50:20 +08:00
junv 3e40ad643d ux experience improved 2013-02-04 15:18:32 +08:00
junv c4502d8035 modify gzip expires time 2013-02-04 11:57:37 +08:00
junv 0fbc1744af add cache expires time 2013-02-04 11:24:45 +08:00
junv c9e7dde516 fix google oauth2 error 2013-02-04 11:16:51 +08:00
junv 5e76ffe879 Merge branch 'master' of heroku.com:ocelots-staging 2013-02-04 11:12:52 +08:00
junv 7a1241c218 add gzip support to get a better performance 2013-02-04 11:04:13 +08:00
junv de6a8445bc update copyright 2013-02-04 10:29:29 +08:00
junv b5d5da0c7c fix 2013-02-04 10:07:02 +08:00
junv 8891d66c22 add screenshots to readme 2013-02-04 10:05:53 +08:00
junv 9f2fd47e0f update rails version 2013-01-11 09:33:50 +08:00
junv a6bfd8bd59 update readme 2012-12-25 10:58:24 +08:00
junv 0fb83bf919 update readme 2012-12-07 15:03:58 +08:00
junv 61626c118b update readme 2012-12-07 15:02:18 +08:00
junv 7ee206ea87 update readme 2012-12-07 15:00:05 +08:00
junv ad2fbe8b43 update readme 2012-12-07 14:57:47 +08:00
szpyxlwoni 324bb3a186 fix show maps in profiles/show 2012-12-07 12:18:46 +08:00
szpyxlwoni 120abe5666 add sort list of team to viewed team 2012-12-06 17:49:18 +08:00
junv ca3162b631 fix readme 2012-12-06 16:11:31 +08:00
Jeff Xiong 1cc624c10b fix a typo 2012-12-06 14:44:21 +08:00
szpyxlwoni 3709e9206d Merge branch 'master' of https://github.com/wahyd4/ocelots 2012-12-06 14:33:57 +08:00
szpyxlwoni 706699a4b8 add team search 2012-12-06 14:33:30 +08:00
junv c2078f3ca2 Merge branch 'master' of https://github.com/wahyd4/ocelots 2012-12-06 14:24:20 +08:00
szpyxlwoni 7cf845153a Merge remote-tracking branch 'heroku/master' 2012-12-06 14:24:13 +08:00
szpyxlwoni 1376cc92fc fix a bug 2012-12-06 14:23:15 +08:00
junv a4f546210c fix pusher channel 2012-12-06 14:19:41 +08:00
szpyxlwoni 92e3156740 Merge branch 'master' of https://github.com/wahyd4/ocelots 2012-12-06 14:17:46 +08:00
szpyxlwoni a70a948f97 add team search input 2012-12-06 14:17:21 +08:00
junv ec6b5b4bb2 filter blanks of slug when create a team 2012-12-06 14:12:21 +08:00
szpyxlwoni 490476cca2 Merge remote-tracking branch 'heroku/master' 2012-12-06 14:08:35 +08:00
szpyxlwoni 1e009425f7 fix google maps error message and make list of team sort by team name 2012-12-06 14:07:22 +08:00
junv 1fd6d145b4 fix pusher channel bug 2012-12-06 13:00:41 +08:00
junv 0ac6202372 fix readme display bug 2012-12-06 12:19:56 +08:00
junv eb95b7fc13 update readme.md for pusher config 2012-12-06 11:35:58 +08:00
junv 3995c7e239 Merge branch 'master' of https://github.com/wahyd4/ocelots 2012-12-06 11:24:29 +08:00
junv b1cd590a63 change push message to pusher ,before use it we should config it at localhost and heroku 2012-12-06 11:16:41 +08:00
szpyxlwoni c1e4d4ff18 Merge remote-tracking branch 'heroku/master' 2012-12-06 11:15:00 +08:00
szpyxlwoni b6dc5e4e32 Merge branch 'master' of https://github.com/wahyd4/ocelots 2012-12-06 11:12:07 +08:00
szpyxlwoni 68afb37c29 add search people in a team 2012-12-06 11:11:56 +08:00
junv d40596ef06 trying 2012-12-06 09:54:42 +08:00
junv f37d88d84a ddd 2012-12-06 09:30:36 +08:00
junv 46c4fd5081 try to fix 2012-12-06 08:54:38 +08:00
junv 661882f409 try to fix 2012-12-05 18:16:24 +08:00
junv 4bd724079f try to fix 2012-12-05 18:11:58 +08:00
junv 709fbe1a1c try to fix address bug 2012-12-05 18:04:12 +08:00
junv a365c0f436 try 2012-12-05 17:59:31 +08:00
junv 9315f2ad96 fix web socket address port 2012-12-05 17:54:08 +08:00
junv 686fc27126 fix web socket address bind bug 2012-12-05 17:48:30 +08:00
junv 51ba3907d8 Merge branch 'master' of https://github.com/wahyd4/ocelots 2012-12-05 17:15:48 +08:00
junv ea1d27c0ff add antechamber auto-refresh based web-socket,but right now can;t be auto recoverd 2012-12-05 17:15:41 +08:00
szpyxlwoni 72a4102090 Merge remote-tracking branch 'heroku/master' 2012-12-05 16:39:37 +08:00
szpyxlwoni 721c552ce4 add sort of list of teams 2012-12-05 16:36:42 +08:00
junv 408c45f8bf .. 2012-12-05 14:29:32 +08:00
junv f79ad1cc53 qMerge branch 'master' of https://github.com/wahyd4/ocelots 2012-12-05 14:28:56 +08:00
junv 70f89d3d47 add experiment websocket feature 2012-12-05 14:27:34 +08:00
szpyxlwoni f277ab8b9c fix a bug that person add a team with nil name 2012-12-05 11:30:33 +08:00
szpyxlwoni 5c0bf3bd1f Merge branch 'master' of https://github.com/wahyd4/ocelots 2012-12-05 11:04:24 +08:00
szpyxlwoni 9e0899e6b4 add google search to find loction of person\ 2012-12-05 11:04:09 +08:00
junv 7c737fb2f8 modify server to thin 2012-12-05 11:03:40 +08:00
junv 317cb03aff fix bug; 2012-12-05 10:45:51 +08:00
junv 5ae31a5046 add travis config; 2012-12-05 10:40:56 +08:00
junv 1c31cd4618 add dfault task 2012-12-05 10:21:42 +08:00
junv 9ed0a1d780 modify gemfile.lock; 2012-12-05 10:15:06 +08:00
junv 7230c11ab1 add travis 2012-12-05 10:06:53 +08:00
junv 03dce270e5 add code climate 2012-12-05 09:58:28 +08:00
junv 8bdbb5caa8 fix git personal website 2012-12-05 08:53:34 +08:00
szpyxlwoni 1c3d9c246a modify quiz 2012-12-04 17:22:06 +08:00
szpyxlwoni b57c4e92bc select person with facts in quiz page 2012-12-04 17:09:22 +08:00
junv f068ce3eea remove google map js from some unused pages 2012-12-04 16:46:31 +08:00
junv cf3f915488 fix profile page flickr dispaly bug 2012-12-04 15:51:50 +08:00
junv d7245ac9a4 add job title to avatars print page 2012-12-04 15:29:53 +08:00
szpyxlwoni 0025dabc9a add job title to people 2012-12-04 15:17:38 +08:00
szpyxlwoni 89ae1532d1 add job title to people 2012-12-04 15:14:10 +08:00
szpyxlwoni f2610e8b42 Merge branch 'master' of https://github.com/wahyd4/ocelots 2012-12-04 13:36:51 +08:00
szpyxlwoni a1aaf56959 fix a soundcloud bug 2012-12-04 13:36:22 +08:00
junv 409e7e3b20 fix social media display bug 2012-12-04 13:23:17 +08:00
junv 10e41d315f fix readme 2012-11-29 14:01:51 +08:00
junv 11f1f8c7a1 update readme 2012-11-29 14:00:46 +08:00
junv ef78a8fe99 modify readme.md 2012-11-29 13:53:32 +08:00
junv 39f0d2e1df Merge remote-tracking branch 'heroku/master' 2012-11-29 11:15:27 +08:00
szpyxlwoni 383b6164b4 fix soundcloud 2012-11-29 11:13:20 +08:00
szpyxlwoni 03ad1f5809 fix soundcloud 2012-11-29 11:06:15 +08:00
junv 11a791e261 Merge remote-tracking branch 'heroku/master' 2012-11-29 11:04:55 +08:00
szpyxlwoni 6ac344ddfa fix soundcloud 2012-11-29 10:47:03 +08:00
szpyxlwoni 6f1f983c13 fix soundcloud 2012-11-29 10:41:51 +08:00
junv cb8d2ca7f4 avatar ux improved 2012-11-29 10:01:59 +08:00
szpyxlwoni c1b49254ee Merge branch 'master' of https://github.com/wahyd4/ocelots 2012-11-29 09:54:43 +08:00
szpyxlwoni 4ee3aa1215 config soundcloud in diff host 2012-11-29 09:53:09 +08:00
junv ddc96613b2 add css precompile 2012-11-29 09:18:56 +08:00
szpyxlwoni db7dbd6e67 Merge branch 'master' of https://github.com/wahyd4/ocelots 2012-11-28 17:43:04 +08:00
szpyxlwoni fa05b3db73 add local uservoice record 2012-11-28 17:42:28 +08:00
junv da5c63d75e a litte ui improved 2012-11-28 15:05:23 +08:00
junv fcfb53b57c social media ux improved 2012-11-28 10:36:17 +08:00
junv 5f546d98a5 fix app.net url 2012-11-28 09:58:28 +08:00
junv ece31349d1 team member list page ui changed 2012-11-27 17:31:08 +08:00
junv a42e7ffb28 add error message when invite people failed 2012-11-27 15:37:11 +08:00
junv f73932f9a8 fix 2012-11-27 14:45:04 +08:00
junv 32180e0db5 Merge branch 'master' of https://github.com/wahyd4/ocelots 2012-11-27 14:32:21 +08:00
junv 0592347620 a little ux improved 2012-11-27 14:32:00 +08:00
szpyxlwoni 85492000f5 add a test for ensure do not invite someone more than once 2012-11-27 13:53:06 +08:00
53 changed files with 756 additions and 204 deletions
+2
View File
@@ -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
+9
View File
@@ -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
+4 -2
View File
@@ -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,11 +24,11 @@ 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
+42 -30
View File
@@ -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
+45 -2
View File
@@ -1,10 +1,37 @@
# Ocelots # Ocelots
[![Build Status](https://secure.travis-ci.org/wahyd4/ocelots.png)](https://travis-ci.org/wahyd4/ocelots)
[![Code Climate](https://codeclimate.com/badge.png)](https://codeclimate.com/github/wahyd4/ocelots)
## Screenshots
![Home page](home.jpg)
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
@@ -87,3 +128,5 @@ 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"
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 -2
View File
@@ -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
+18
View File
@@ -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)
+17
View File
@@ -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
+20 -2
View File
@@ -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
+80 -14
View File
@@ -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;
@@ -78,3 +67,80 @@ body {
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;
}
+94
View File
@@ -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; }
+5 -1
View File
@@ -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
+2 -1
View File
@@ -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
+2 -2
View File
@@ -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]
+2 -2
View File
@@ -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
+14 -3
View File
@@ -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
if @person
@facts = @person.facts.sample 3 @facts = @person.facts.sample 3
render :quiz render :quiz
else
render :nofacts
end
end end
end end
+4
View File
@@ -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
+3 -2
View File
@@ -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
+7
View File
@@ -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
+6 -2
View File
@@ -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
+1 -1
View File
@@ -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 &copy; 2012&nbsp; span &copy; 2013&nbsp;
span style="font-family: Trebuchet MS, sans-serif;" span style="font-family: Trebuchet MS, sans-serif;"
strong Thought strong Thought
span Works span Works
+1 -1
View File
@@ -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'
+35 -11
View File
@@ -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 &nbsp;
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
+8 -6
View File
@@ -1,17 +1,19 @@
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}
+2 -1
View File
@@ -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
+31 -14
View File
@@ -1,22 +1,39 @@
div.social_media div.social_media
- unless person.url.blank?
- if person.url.blank?
img.image-gray.avatar-img src='/assets/url.png'
- else
a href="http://#{person.url}" a href="http://#{person.url}"
img src='/assets/url.png' img.avatar-img src='/assets/url.png'
- unless person.twitter.blank? - if person.twitter.blank?
img.image-gray.avatar-img src='/assets/twitter.png'
-else
a href="http://twitter.com/#{person.twitter}" a href="http://twitter.com/#{person.twitter}"
img src='/assets/twitter.png' img.avatar-img src='/assets/twitter.png'
- unless person.facebook.blank? - if person.facebook.blank?
img.image-gray.avatar-img src='/assets/facebook.png'
-else
a href="http://www.facebook.com/#{person.facebook}" a href="http://www.facebook.com/#{person.facebook}"
img src='/assets/facebook.png' img.avatar-img src='/assets/facebook.png'
- unless person.weibo.blank? - if person.weibo.blank?
img.image-gray src='/assets/weibo-1.png'
-else
a href="http://weibo.com/#{person.weibo}" a href="http://weibo.com/#{person.weibo}"
img src='/assets/weibo-1.png' img.avatar-img src='/assets/weibo-1.png'
- unless person.appnet.blank? - if person.appnet.blank?
img.image-gray.avatar-img src='/assets/appnet.png'
-else
a href="http://alpha.app.net/#{person.appnet}" a href="http://alpha.app.net/#{person.appnet}"
img src='/assets/appnet.png' img.avatar-img src='/assets/appnet.png'
- unless person.github.blank? - if person.github.blank?
img.image-gray.avatar-img src='/assets/github.png'
-else
a href="http://github.com/#{person.github}" a href="http://github.com/#{person.github}"
img src='/assets/github.png' img.avatar-img src='/assets/github.png'
- unless person.flickr.blank? - if person.flickr.blank?
img.image-gray.avatar-img src='/assets/flickr.png'
-else
a href="http://flickr.com/photos/#{person.flickr}" a href="http://flickr.com/photos/#{person.flickr}"
img src='/assets/flickr.png' 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}" : ''}&amp;auto_play=false&amp;show_artwork=false&amp;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}" : ''}&amp;auto_play=false&amp;show_artwork=false&amp;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
a href="/profiles/#{membership.account}"
=image_for membership.person =image_for membership.person
div.span4 div.avatar-hover
= render partial: 'shared/person', locals: {person: membership.person} a href="/profiles/#{membership.account}"
= render partial: 'shared/membership', locals: {membership: membership} h1 style="margin-top:3.5em" = membership.person.full_name
-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)
+4 -3
View File
@@ -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"
=image_for_without_radius person
h2 #{person.full_name} h2 #{person.full_name}
- if person.preferred_name - if person.job_title
p #{person.preferred_name} i #{person.job_title}
+15 -3
View File
@@ -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"
+7
View File
@@ -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
+2 -1
View File
@@ -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'}"
+8 -3
View File
@@ -15,8 +15,9 @@
div.team-content div.team-content
h1 = @team.name h1 style="float:left;" = @team.name
div.join-status-button
- if current_person.approved_teams.include? @team - if current_person.approved_teams.include? @team
=form_tag "/teams/#{@team.slug}/quit" do =form_tag "/teams/#{@team.slug}/quit" do
=submit_tag 'Quit Team',id:"join-team",class:"btn btn-danger " =submit_tag 'Quit Team',id:"join-team",class:"btn btn-danger "
@@ -24,7 +25,8 @@ div.team-content
=form_tag "/teams/#{@team.slug}/join" do =form_tag "/teams/#{@team.slug}/join" do
=submit_tag 'Join Team',id:"join-team",class:"btn btn-primary " =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,7 +39,10 @@ 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;"
div.clear
div.row-fluid
- @team.memberships.each do |membership| - @team.memberships.each do |membership|
= render partial: membership_partial(membership), locals: {membership: membership, current_person: @current_person} = render partial: membership_partial(membership), locals: {membership: membership, current_person: @current_person}
+7
View File
@@ -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
+4 -1
View File
@@ -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
View File
@@ -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|
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 274 KiB

+19
View File
@@ -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
+9
View File
@@ -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>
+42 -1
View File
@@ -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
+8 -1
View File
@@ -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
-6
View File
@@ -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
+10
View File
@@ -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