mirror of
https://github.com/wahyd4/ocelots.git
synced 2026-08-10 05:27:03 +10:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
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 |
@@ -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
|
||||||
@@ -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'
|
||||||
|
|||||||
+13
-1
@@ -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)
|
||||||
@@ -136,6 +138,9 @@ 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)
|
||||||
|
pusher (0.11.1)
|
||||||
|
multi_json (~> 1.0)
|
||||||
|
signature (~> 0.1.6)
|
||||||
rack (1.4.1)
|
rack (1.4.1)
|
||||||
rack-cache (1.2)
|
rack-cache (1.2)
|
||||||
rack (>= 0.4)
|
rack (>= 0.4)
|
||||||
@@ -166,7 +171,7 @@ GEM
|
|||||||
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.2)
|
||||||
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)
|
||||||
@@ -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,6 +269,7 @@ DEPENDENCIES
|
|||||||
machinist
|
machinist
|
||||||
paperclip
|
paperclip
|
||||||
pg
|
pg
|
||||||
|
pusher
|
||||||
rails (= 3.2.9)
|
rails (= 3.2.9)
|
||||||
rails_best_practices (~> 1.11.1)
|
rails_best_practices (~> 1.11.1)
|
||||||
rdiscount
|
rdiscount
|
||||||
@@ -269,5 +280,6 @@ DEPENDENCIES
|
|||||||
slim
|
slim
|
||||||
tddium
|
tddium
|
||||||
therubyracer
|
therubyracer
|
||||||
|
thin
|
||||||
uglifier (>= 1.0.3)
|
uglifier (>= 1.0.3)
|
||||||
uuidtools
|
uuidtools
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
# Ocelots
|
# Ocelots
|
||||||
|
[](https://travis-ci.org/wahyd4/ocelots)
|
||||||
|
[](https://codeclimate.com/github/wahyd4/ocelots)
|
||||||
|
|
||||||
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.
|
||||||
|
|
||||||
@@ -6,6 +8,8 @@ You log in using a mozilla persona id (linked to your email address) and then yo
|
|||||||
|
|
||||||
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 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).
|
||||||
|
|
||||||
|
Everyone can try it [iocelots.com][1]
|
||||||
|
|
||||||
To setup your own instance on heroku:
|
To setup your own instance on heroku:
|
||||||
|
|
||||||
heroku apps:create
|
heroku apps:create
|
||||||
@@ -46,6 +50,18 @@ 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'
|
||||||
|
|
||||||
|
To use it in local you need config it like following:
|
||||||
|
|
||||||
|
export PUSHER_APP_ID=your_pusher_app_id
|
||||||
|
export PUSHER_KEY='your_pusher_key'
|
||||||
|
export PUSHER_SECRET='your_pusher_secret'
|
||||||
|
|
||||||
## API
|
## API
|
||||||
|
|
||||||
You can experiment with the API from the command line
|
You can experiment with the API from the command line
|
||||||
@@ -55,6 +71,18 @@ First, set a couple of environment variables:
|
|||||||
export OCELOTS_URL=http://localhost:3000
|
export OCELOTS_URL=http://localhost:3000
|
||||||
export OCELOTS_AUTH_TOKEN=f1ac4214-5426-4597-9b74-ea63167f4750
|
export OCELOTS_AUTH_TOKEN=f1ac4214-5426-4597-9b74-ea63167f4750
|
||||||
|
|
||||||
|
### 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
|
||||||
|
|
||||||
|
To use it in local, you need export variables:
|
||||||
|
export GOOGLE_OAUTH_CLIENT_ID=yourid --app ocelots
|
||||||
|
export GOOGLE_OAUTH_CLIENT_SECRET=yourSecret
|
||||||
|
export GOOGLE_OAUTH_REDIRECT=http://replace to your domain/home/verify_g_callback
|
||||||
|
|
||||||
### Membership Details
|
### Membership Details
|
||||||
|
|
||||||
To request information on all the teams you are a member of:
|
To request information on all the teams you are a member of:
|
||||||
@@ -86,4 +114,7 @@ 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"
|
||||||
|
|
||||||
|
[1]: http://iocelots.com 'iocelots'
|
||||||
|
[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,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,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,50 @@ 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;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
||||||
|
|
||||||
|
|||||||
@@ -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,17 @@ 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}
|
||||||
|
if params[:sortby]== 'CreateDate'
|
||||||
|
@memberships = @memberships.sort_by {|mem| mem.id}
|
||||||
|
@sortby = params[:sortby]
|
||||||
|
end
|
||||||
@team = Team.new
|
@team = Team.new
|
||||||
@organisations = Organisation.find(:all)
|
@organisations = Organisation.find(:all)
|
||||||
|
@view_membership = current_person.viewable_teams
|
||||||
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 +27,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 +61,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,6 +1,6 @@
|
|||||||
module ApplicationHelper
|
module ApplicationHelper
|
||||||
def image_for person
|
def image_for person
|
||||||
image_tag person.photo? ? person.photo.url(:square) : person.gravatar_url
|
image_tag person.photo? ? person.photo.url(:square) : person.gravatar_url ,class:'avatar-image'
|
||||||
end
|
end
|
||||||
|
|
||||||
def phone_link_to phone
|
def phone_link_to phone
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ class Person < ActiveRecord::Base
|
|||||||
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
|
||||||
|
|||||||
@@ -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,21 @@
|
|||||||
div.hero-unit
|
- content_for :javascript_includes do
|
||||||
|
= javascript_include_tag "http://maps.googleapis.com/maps/api/js?key=#{ENV['GOOGLE_API']}&sensor=false"
|
||||||
|
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,4 +1,4 @@
|
|||||||
div.hero-unit.highlight class="#{membership.status}"
|
div.hero-unit.highlight.sexy-bg class="#{membership.status}"
|
||||||
div.row
|
div.row
|
||||||
div.span4
|
div.span4
|
||||||
a href="/profiles/#{membership.account}"
|
a href="/profiles/#{membership.account}"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
div.hero-unit.pending.hidden
|
div.hero-unit.pending.hidden.sexy-bg
|
||||||
div.row.person
|
div.row.person
|
||||||
div.span4
|
div.span4
|
||||||
img src="/assets/silhouette.png" width=300
|
img src="/assets/silhouette.png" width=300
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
- @team.people.each do |person|
|
- @team.people.each do |person|
|
||||||
div.avatar
|
div.avatar
|
||||||
|
a href="/profiles/#{person.account}" target="_blank"
|
||||||
=image_for person
|
=image_for 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}
|
||||||
@@ -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,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
|
||||||
|
|
||||||
- @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}
|
||||||
|
|
||||||
|
|||||||
@@ -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,10 @@ 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
|
||||||
|
|
||||||
|
#config.threadsafe! enables allow_concurrency, cache_classes, dependency_loading and preload_frameworks to make the application threadsafe.
|
||||||
|
config.threadsafe!
|
||||||
|
|
||||||
# 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 +55,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
|
||||||
|
|||||||
@@ -47,7 +47,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
|
||||||
@@ -62,6 +62,9 @@ Ocelots::Application.configure do
|
|||||||
# Send deprecation notices to registered listeners
|
# Send deprecation notices to registered listeners
|
||||||
config.active_support.deprecation = :notify
|
config.active_support.deprecation = :notify
|
||||||
|
|
||||||
|
#config.threadsafe! enables allow_concurrency, cache_classes, dependency_loading and preload_frameworks to make the application threadsafe.
|
||||||
|
config.threadsafe!
|
||||||
|
|
||||||
# Log the query plan for queries taking more than this (works
|
# Log the query plan for queries taking more than this (works
|
||||||
# with SQLite, MySQL, and PostgreSQL)
|
# with SQLite, MySQL, and PostgreSQL)
|
||||||
# config.active_record.auto_explain_threshold_in_seconds = 0.5
|
# config.active_record.auto_explain_threshold_in_seconds = 0.5
|
||||||
|
|||||||
@@ -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|
|
||||||
|
|||||||
@@ -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 name' 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