From 6fe538f2d986a72c1d80df1c39f979c0c527380c Mon Sep 17 00:00:00 2001 From: Chad Whitacre Date: Sun, 14 Apr 2013 08:34:08 -0400 Subject: [PATCH] Rough in UI for identifications; #449 --- branch.sql | 7 +- gittip/csrf.py | 1 + gittip/models/participant.py | 5 ++ templates/gittip.scss | 68 ++++++++++++++------ templates/identifications.html | 100 ++++++++++++++++------------- www/%username/identifications.json | 55 ++++++++++++++++ www/%username/index.html | 6 +- www/%username/split.json | 8 +++ www/assets/%version/for.js | 17 ----- www/assets/%version/gittip.css | 2 +- www/assets/%version/gittip.js | 36 ++++++----- www/assets/%version/openco.js | 51 +++++++++++++++ 12 files changed, 253 insertions(+), 103 deletions(-) create mode 100644 www/%username/identifications.json create mode 100644 www/%username/split.json delete mode 100644 www/assets/%version/for.js create mode 100644 www/assets/%version/openco.js diff --git a/branch.sql b/branch.sql index a4e361cd87..b3a7db1e24 100644 --- a/branch.sql +++ b/branch.sql @@ -49,13 +49,16 @@ BEGIN; , ctime timestamp with time zone NOT NULL , mtime timestamp with time zone NOT NULL DEFAULT CURRENT_TIMESTAMP - , individual text NOT NULL REFERENCES participants + , member text NOT NULL REFERENCES participants ON DELETE RESTRICT ON UPDATE CASCADE , "group" text NOT NULL REFERENCES participants ON DELETE RESTRICT ON UPDATE CASCADE - , weight numeric(17, 16) NOT NULL + , weight numeric DEFAULT 0.1 , identified_by text NOT NULL REFERENCES participants ON DELETE RESTRICT ON UPDATE CASCADE + , CONSTRAINT no_member_of_self CHECK (member != "group") + , CONSTRAINT no_self_nomination CHECK (member != "identified_by") + , CONSTRAINT no_stacking_the_deck CHECK ("group" != "identified_by") ); END; diff --git a/gittip/csrf.py b/gittip/csrf.py index 204d76eb10..bac346ea3e 100644 --- a/gittip/csrf.py +++ b/gittip/csrf.py @@ -144,6 +144,7 @@ def inbound(request): request_csrf_token = request.headers.get('X-CSRF-TOKEN', '') if not constant_time_compare(request_csrf_token, csrf_token): + import ipdb; ipdb.set_trace() raise Response(403, REASON_BAD_TOKEN) diff --git a/gittip/models/participant.py b/gittip/models/participant.py index 1ca5dbb111..55c2af1f1f 100644 --- a/gittip/models/participant.py +++ b/gittip/models/participant.py @@ -273,6 +273,11 @@ def get_age_in_seconds(self): out = (now - self.claimed_time).total_seconds() return out + def compute_split(self): + if self.type != 'open company': + return [{"username": self.username, "weight": "1.0"}] + pass + # TODO: Move these queries into this class. diff --git a/templates/gittip.scss b/templates/gittip.scss index 0dd604b7f0..e575e44395 100644 --- a/templates/gittip.scss +++ b/templates/gittip.scss @@ -969,16 +969,16 @@ button.selected:hover { } } -#for { +#openco { + + .fine { + font: normal 10px $Helvetica; + text-transform: uppercase; + } #weeks { margin-top: 10px; - .fine { - font: normal 10px $Helvetica; - text-transform: uppercase; - } - #this-week { width: 220px; float: left; @@ -999,35 +999,64 @@ button.selected:hover { } } - #deserts { - width: 220px; - float: left; + TD { + padding-right: 0.5em; + } + + #my-identifications { + width: 250px; + float: right; + position: relative; + + ::-webkit-input-placeholder { color: $light-brown; } + ::-moz-placeholder { color: $light-brown; } /* firefox 19+ */ + :-ms-input-placeholder { color: $light-brown; } /* ie */ + input:-moz-placeholder { color: $light-brown; } #query { - width: 110px; + width: 170px; padding: 2px 5px; + z-index: 1; + position: relative; + top: 1px; + outline: none; + border: none; } - #lookup-results-container { + .weight { + background: $green; + display: inline-block; + } + .weight.a { height: 24px; width: 24px; } + .weight.b { height: 12px; width: 12px; } + .weight.c { height: 6px; width: 6px } + .weight.d { height: 3px; width: 3px; } + .weight.e { height: 1px; width: 1px; } + .weight.f { height: 0.25px; width: 0.25px; } + .weight.g { background: red; width: 1px; height: 1px; } + + #lookup-container { position: relative; + vertical-align: middle; #lookup-results { - width: 120px; + width: 188px; + min-height: 30px; position: absolute; - bottom: 0px; - left: -128px; + bottom: -1px; + left: -4px; background: white; - border: 2px solid black; margin: 0; - padding: 5px; + padding: 2px 0; border: 4px solid rgba($brown, 0.5); + color: $light-brown; @include border-radius(3px); li { font: normal 16px/16px $Helvetica; white-space: nowrap; margin: 0; - padding: 3px 0; + padding: 3px 5px; overflow: hidden; } } @@ -1035,9 +1064,8 @@ button.selected:hover { } #crowd { - width: 220px; - float: right; - text-align: right; + width: 180px; + float: left; } } diff --git a/templates/identifications.html b/templates/identifications.html index 103b89b087..5ab63031cc 100644 --- a/templates/identifications.html +++ b/templates/identifications.html @@ -1,15 +1,16 @@ - + -
+
+ {% set nbackers = participant.get_number_of_backers() %}

This Week

Gittip will receive about
-
$100.00
-
from about 20 patrons
+
${{ participant.get_dollars_receiving() }}
+
from {{ nbackers }} patron{{ '' if nbackers == 1 else 's' }}

Last Week

@@ -19,53 +20,60 @@

Last Week

-
-
-

Who deserves it?

+
+
+

Who does the most work?

-
- - - - - - - - - -
{{ participant.username }} - - - - - -
-
- -
-
-   - +

This info is private.

-
    -
  • - {{ participant.username }} -
  • -
-
-
+ + + + + + + +
{{ participant.username }} + +
+
+
+    +
+
    +
  • + {{ participant.username }} +
  • +
+
-

Current split

+

Where it Goes.

+ +

This info is public.

+ +

This is how the money is split. It is based on + everyone's vote for who does the most work.

+ + + + + + +
{{ participant.username }}{{ participant.weight}}
diff --git a/www/%username/identifications.json b/www/%username/identifications.json new file mode 100644 index 0000000000..d6048045e4 --- /dev/null +++ b/www/%username/identifications.json @@ -0,0 +1,55 @@ +"""Endpoint to record identifications +""" +from aspen import Response +from gittip import db +from gittip.utils import get_participant + +# ================= ^L + +request.allow('GET', 'POST') +participant = get_participant(request) +if user == participant: + raise Response(400) +if not participant.type == 'open company': + raise Response(400) + +group = participant.username + +if POST: + member = body['member'] + weight = body['weight'] + db.execute(""" + + INSERT + INTO identifications (ctime, member, "group", weight, identified_by) + VALUES ( COALESCE (( SELECT ctime + FROM identifications + WHERE member=%s + AND "group"=%s + LIMIT 1 + ), CURRENT_TIMESTAMP) + , %s + , %s + , %s + , %s + ); + + """, (member, group, member, group, weight, user.username)) + +identifications = db.fetchall(""" + +SELECT * FROM ( + SELECT DISTINCT ON (member, "group", identified_by) + member AS username + , weight + FROM identifications + WHERE "group"=%s + AND identified_by=%s + ORDER BY member, "group", identified_by, mtime DESC +) AS anon WHERE weight > 0 ORDER BY weight DESC, username + +""", (group, user.username)) + +response.body = { "identifications": list(identifications) + , "split": participant.compute_split() + } diff --git a/www/%username/index.html b/www/%username/index.html index f9445017da..e450209b6f 100644 --- a/www/%username/index.html +++ b/www/%username/index.html @@ -8,7 +8,7 @@ from gittip import AMOUNTS from gittip.utils import get_participant, wrap -MAKING = "I am making the world better by" +MAKING = "making the world better by" LONG_STATEMENT = 256 def _clip(text, n): @@ -28,6 +28,10 @@ # pages github_account, twitter_account, bitbucket_account = participant.get_accounts_elsewhere() long_statement = len(participant.statement) > LONG_STATEMENT +if participant.type == 'individual': + MAKING = "I am " + MAKING +else: + MAKING = "We are " + MAKING # ========================================================================== ^L {% extends templates/profile.html %} diff --git a/www/%username/split.json b/www/%username/split.json new file mode 100644 index 0000000000..4320a6b6a6 --- /dev/null +++ b/www/%username/split.json @@ -0,0 +1,8 @@ +"""Endpoint to record identifications +""" +from gittip.utils import get_participant + +# ================= ^L + +participant = get_participant(request, restrict=False) +response.body = participant.compute_split() diff --git a/www/assets/%version/for.js b/www/assets/%version/for.js deleted file mode 100644 index 1dadd2e5a2..0000000000 --- a/www/assets/%version/for.js +++ /dev/null @@ -1,17 +0,0 @@ -Gittip.for = angular.module('Gittip.for', []); - -Gittip.for.DesertsCtrl = function($scope, $http) -{ - $scope.fetch = function() - { - if ($scope.query == '') - $scope.lookup = []; - else - $http.get("/lookup.json", {params: {query: $scope.query}}) - .success(function(data) { $scope.lookup = data }); - }; - - // No good way in Angular yet: - // http://stackoverflow.com/questions/14833326/ - jQuery('#query').focus(); -}; diff --git a/www/assets/%version/gittip.css b/www/assets/%version/gittip.css index 81c114c885..c65b5d8b7c 100644 --- a/www/assets/%version/gittip.css +++ b/www/assets/%version/gittip.css @@ -1 +1 @@ -@font-face{font-family:'Mensch';src:url("../fonts/mensch.eot");src:url("../fonts/mensch.eot?#iefix") format("embedded-opentype"),url("../fonts/mensch.woff") format("woff"),url("../fonts/mensch.ttf") format("truetype"),url("../fonts/mensch.svg#Mensch") format("svg");font-weight:normal;font-style:normal}html,body{background:#FFF}body{color:#231f20;font:normal 16px "Helvetica Neue",Helvetica,Arial,"Liberation Sans",FreeSans,sans-serif;text-rendering:optimizeLegibility}.main-padding{width:960px;margin:0 auto;position:relative}*{box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box}a{color:#2a8f79;text-decoration:none;font-weight:bold}a img{border:0}p,dd{margin:0;padding:0 0 1em;line-height:130%}dt{font-weight:bold;margin:1em 0 0.25em}pre{font:9pt/13pt monospace;margin:0 0 1em 1em;padding:0;overflow:auto}li{margin:0;margin:0 0 1em 1.5em}ol{margin:1em 0 0}ol li{list-style:outside decimal}.group:after{content:".";display:block;height:0;clear:both;visibility:hidden}.hidden{display:none}input{box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box}.clear{clear:both}.centered{margin:0 auto}.highlight{background:#FFFE26}.mini-user{background:white;display:block;float:left;width:100%;overflow:hidden;border:4px solid #dee0e0;-webkit-background-clip:padding-box;-webkit-border-radius:3px;-moz-background-clip:padding-box;-moz-border-radius:3px;border-radius:3px;background-clip:padding-box}.mini-user span.inner{border:1px solid #b6b7b9;display:block;min-height:50px;padding:5px}.mini-user span.inner span.avatar{background:transparent url("avatar-default.gif") center center no-repeat;background-size:cover;display:block;min-height:70px;position:relative}.mini-user span.inner span.avatar span.rank{background:#614c3e;bottom:4px;color:white;display:block;font:normal 12px "Mensch","Helvetica Neue",Helvetica,Arial,"Liberation Sans",FreeSans,sans-serif;left:4px;padding:3px 5px 3px 6px;position:absolute;text-align:center;-webkit-background-clip:padding-box;-webkit-border-radius:2px;-moz-background-clip:padding-box;-moz-border-radius:2px;border-radius:2px;background-clip:padding-box}.mini-user span.inner span.age,.mini-user span.inner span.money{color:#231f20;display:block;font:bold 18px "Helvetica Neue",Helvetica,Arial,"Liberation Sans",FreeSans,sans-serif;margin:7px 0 5px 0}.mini-user span.inner span.age span.unit,.mini-user span.inner span.money span.unit{font:normal 11px "Helvetica Neue",Helvetica,Arial,"Liberation Sans",FreeSans,sans-serif}.mini-user span.inner span.name{display:block;font:normal 11px "Helvetica Neue",Helvetica,Arial,"Liberation Sans",FreeSans,sans-serif;margin:3px 0;white-space:nowrap}.mini-user.anonymous{opacity:0.33}a.mini-user span.name{color:#2a8f79}span.mini-user{border-color:white}span.mini-user span.name{color:#231f20}a.mini-user:hover{border:4px solid #b2a196;text-decoration:none}a.mini-user:hover span.inner{border-color:#614c3e}button{background:#58595b;border:3px solid rgba(88,89,91,0.33);color:white;font:bold 11px "Helvetica Neue",Helvetica,Arial,"Liberation Sans",FreeSans,sans-serif;letter-spacing:1px;margin:0 0 0 1px;padding:4px 10px;text-transform:uppercase;-webkit-background-clip:padding-box;-webkit-border-radius:3px;-moz-background-clip:padding-box;-moz-border-radius:3px;border-radius:3px;background-clip:padding-box;cursor:pointer;display:inline}button:hover{border-color:#58595b;background:#e6e6e6;color:#58595b}button.selected{border-color:rgba(255,255,255,0.9);background:#2a8f79;color:white}button.selected:hover{border-color:rgba(42,143,121,0.5);background:#e6e6e6;color:#58595b}#header{background:white;padding:10px 0;position:relative}#header td{text-align:center;vertical-align:middle}#header h1{line-height:100%}#header .logo{padding-right:18px}#header .motto{border-left:2px solid #d0d2d3;font:bold 10px "Helvetica Neue",Helvetica,Arial,"Liberation Sans",FreeSans,sans-serif;letter-spacing:1px;text-transform:uppercase;padding-left:18px;text-align:left}#header div.login{padding-top:18px;position:absolute;top:0;right:0;font:normal 13px "Helvetica Neue",Helvetica,Arial,"Liberation Sans",FreeSans,sans-serif}#hero{background:transparent url("hero-bg.png") top left repeat;border:1px solid #d0d2d3;border-style:solid none;padding-bottom:100px;text-align:center;position:relative;z-index:1}#hero .main-padding{color:#231f20}#hero h2 span{background:transparent url("hero-bg.png") top left repeat;display:inline-block;padding:0 10px}#hero p{padding:0 20%}#hero h2.top{letter-spacing:-2px;font:normal 35px "Mensch","Helvetica Neue",Helvetica,Arial,"Liberation Sans",FreeSans,sans-serif;padding:50px 0 35px 0}#hero h2.top span{background:transparent url("hero-bg.png") top left repeat;display:inline-block;padding:0 10px}#hero h2.top:after{background:#231f20;content:"";display:block;height:1px;margin-top:-17px}#hero h1{letter-spacing:-3px;font:normal 64px/64px "Mensch","Helvetica Neue",Helvetica,Arial,"Liberation Sans",FreeSans,sans-serif;padding-bottom:20px}#hero h2.bottom{padding-bottom:20px}#hero h2.bottom span.button-container{display:inline-block;padding:0 10px}#hero h2.bottom span.button-container button{font-size:14px}#hero h2.bottom:after{background:#231f20;content:"";display:block;height:1px;margin-top:-16px}#box{text-align:center;background:white;margin:-80px auto 0;border:5px solid rgba(97,76,62,0.5);width:480px;min-width:240px;-webkit-background-clip:padding-box;-webkit-border-radius:3px;-moz-background-clip:padding-box;-moz-border-radius:3px;border-radius:3px;background-clip:padding-box;position:relative;z-index:2}#box h1{font:bold 22px "Helvetica Neue",Helvetica,Arial,"Liberation Sans",FreeSans,sans-serif;color:#614c3e}#box h2{font:bold 14px "Helvetica Neue",Helvetica,Arial,"Liberation Sans",FreeSans,sans-serif;text-transform:uppercase;color:#614c3e}#box .help{font:normal 14px/18px "Helvetica Neue",Helvetica,Arial,"Liberation Sans",FreeSans,sans-serif;color:#231f20}#box .help.with-padding{padding:10px}#box .as-content{padding:20px}#box .as-content.left{text-align:left}#box .as-content h1{padding-bottom:15px}#box .as-content input{width:8em}#box .is-suspicious-indicator{display:block;position:absolute;top:5px;right:5px;font:normal 10px "Helvetica Neue",Helvetica,Arial,"Liberation Sans",FreeSans,sans-serif;text-transform:uppercase;color:#231f20}#box label.is-suspicious-knob{display:block;position:absolute;top:2px;right:5px;font:normal 9px "Helvetica Neue",Helvetica,Arial,"Liberation Sans",FreeSans,sans-serif;text-transform:uppercase;color:#231f20}#box label.is-suspicious-knob input{position:relative;top:3px}#box .ready{padding-left:15px}#box .number{font:bold 56px "Helvetica Neue",Helvetica,Arial,"Liberation Sans",FreeSans,sans-serif}#box .unit{font:normal 12px "Helvetica Neue",Helvetica,Arial,"Liberation Sans",FreeSans,sans-serif}#box .on-elsewhere{width:100%}#box .on-elsewhere .offset{width:138px;height:138px}#box .on-elsewhere .picture{width:138px;height:138px}#box .on-elsewhere .picture img{width:128px;height:128px;display:block;margin:5px}#box .on-profile{width:100%}#box .on-profile.is-suspicious{background:#f99}#box .on-profile .picture{width:138px;height:138px}#box .on-profile .picture img{width:128px;height:128px;display:block;margin:5px}#box .on-profile td{text-align:left}#box .on-profile .pad-sign{padding-left:36px}#box .nav{padding:5px}#box .nav h2{color:#231f20;font:bold 10px "Helvetica Neue",Helvetica,Arial,"Liberation Sans",FreeSans,sans-serif;letter-spacing:1px;text-transform:uppercase;margin:0 0 3px}#box .nav button.larger{font-size:14px}#box .nav.level-1{border-top:1px solid rgba(97,76,62,0.2);background:#e6e6e6}#box .nav.level-1 #payment-prompt{display:none;margin:10px 0 5px}#box .nav.level-1 #payment-prompt.needed{display:block}#box .nav.level-1 #payment-prompt.really-needed{display:block}#box .nav.level-2{border-top:1px solid rgba(97,76,62,0.5);background:#d0d2d3}#box .nav.level-3{background:black;text-align:center;padding:5px;color:white}#box .nav.level-3 a{display:block;color:white}#box .on-confirm{padding:35px 0 0}#box .on-confirm h2{font:bold 14px "Helvetica Neue",Helvetica,Arial,"Liberation Sans",FreeSans,sans-serif;text-transform:uppercase;margin:35px 0 8px}#box .on-confirm .nav{margin:35px 0 0}#box .on-confirm .nav h2{margin:8px 0}#box .on-confirm .scenario{margin:0 auto}#box .on-confirm .scenario TD{padding:6pt;width:33%}#box .on-confirm #nix{position:absolute;top:50%;left:50%;margin:-16px 0 0 -16px}#box .on-confirm .participant{position:relative;width:96pt;display:inline-block;border:2px solid #614c3e;border-radius:6pt;font:normal 12px "Helvetica Neue",Helvetica,Arial,"Liberation Sans",FreeSans,sans-serif;color:#614c3e;background:#fff url("/assets/clipped-heart.gif") bottom right no-repeat;text-align:left;overflow:hidden}#box .on-confirm .participant-padding{display:block;padding:6pt 0 6pt 9pt}#box .on-confirm .participant IMG,#box .on-confirm IMG.platform-icon{margin-bottom:-1pt}#box .on-confirm .participant B{font-size:11pt}#box .on-confirm .participant TD{padding:0}#box .on-confirm .participant TH{font-weight:normal}#box .on-confirm .other,#box .on-confirm .abandoned{font:normal 10px "Helvetica Neue",Helvetica,Arial,"Liberation Sans",FreeSans,sans-serif}#box .on-confirm .abandoned{text-align:center;overflow:hidden}#box .on-confirm .nix{border-color:#b2a196}#box .on-confirm .other B{font-size:9pt}#box .on-form{text-align:left}#box .on-form .constrain-width{margin:0 auto 35px;width:300px}#box .on-form form h2{font:bold 14px "Helvetica Neue",Helvetica,Arial,"Liberation Sans",FreeSans,sans-serif;text-transform:uppercase;margin:35px 0 8px}#box .on-form .half{width:150px}#box .on-form .full{clear:both;text-align:right;padding-top:5px}#box .on-form #other{font:normal 9pt/14pt Arial,sans-serif;color:#00E;cursor:pointer;margin-right:1em}#box .on-form #other:hover{text-decoration:underline}#box .on-form .left{float:left}#box .on-form .right{float:left}#box .on-form LABEL{display:block;font:normal 10px "Helvetica Neue",Helvetica,Arial,"Liberation Sans",FreeSans,sans-serif;margin:8px 0 0;padding:0;text-transform:uppercase}#box .on-form INPUT{font:normal 11pt/14pt "Helvetica Neue",Helvetica,Arial,"Liberation Sans",FreeSans,sans-serif;width:292px;margin:0;padding:3px;border:1px solid #b2a196;outline:none}#box .on-form INPUT.disabled{color:#b2a196}#box .on-form .half INPUT{width:137px}#box .on-form .right.half LABEL,#box .on-form .right.half INPUT{margin-left:5px}#box .on-form INPUT:focus{border-color:#2a8f79}#box .on-form .float{float:left}#box .on-form .city INPUT{width:137px}#box .on-form .state INPUT{width:43px}#box .on-form .zip INPUT{width:75px}#box .on-form .card_number INPUT{width:137px}#box .on-form .cvv INPUT{width:43px}#box .on-form INPUT.expiration_month{width:24px}#box .on-form INPUT.expiration_year{width:39px;margin-left:1px !important}#box .on-form .not-first LABEL,#box .on-form .not-first INPUT{margin-left:10px}#box .on-form .nav{text-align:center}#box .on-form #feedback .details li{margin:0;padding:0 0 0 2em;text-indent:-2em;font:normal 12px "Helvetica Neue",Helvetica,Arial,"Liberation Sans",FreeSans,sans-serif}.payment-footer{font:normal 12px "Helvetica Neue",Helvetica,Arial,"Liberation Sans",FreeSans,sans-serif;text-align:center}#page #leaderboard ul{margin:0 0 20px 0}#page #leaderboard ul li{display:block;float:left;margin:0;min-width:90px;padding:2px;width:10%}#page{padding:20px 0 0;background:white}#page h1{color:#2a8f79;font:normal 35px "Mensch","Helvetica Neue",Helvetica,Arial,"Liberation Sans",FreeSans,sans-serif;letter-spacing:-2px;margin:35px 0 20px 0;text-transform:uppercase}#page h2{color:#614c3e;font:bold 14px "Helvetica Neue",Helvetica,Arial,"Liberation Sans",FreeSans,sans-serif;letter-spacing:1px;text-transform:uppercase;margin:35px 0 8px}#page .col{width:auto;margin:0 auto}#page .col0{width:460px;margin:0 auto}#page .col1{width:460px;float:left}#page .col2{width:460px;float:right}#footer{margin:4em 0 1em;border-top:1px solid #231f20;padding:0.5em 0 0;text-align:right;font:normal 12px/16px "Helvetica Neue",Helvetica,Arial,"Liberation Sans",FreeSans,sans-serif}#footer .social{float:left}#accounts{margin-bottom:12pt}#accounts td{text-align:left;vertical-align:middle;line-height:100%}#accounts td.account-type{border-right:1pt solid #b2a196;padding:6pt 6pt 6pt 0}#accounts td.account-type IMG{width:36pt;height:36pt}#accounts DIV.account-type{font-size:x-small;clear:both;color:#b2a196}#accounts .account-details{padding-left:6pt}#accounts IMG.avatar{width:24pt;height:24pt;float:left;margin-right:3pt}#members{list-style:none;margin-bottom:12pt;margin:0 auto}#members TD{padding:0 0 0.5em 0;text-align:left}#members IMG{width:18pt;height:18pt;margin-right:6pt;float:left}.tip-distribution .dollar-sign{padding:0 2pt 0 24pt;text-align:right}.tip-distribution .amount{padding:0 6pt 0 0;text-align:right}.tip-distribution .amount-change{padding:6pt 0 6pt 24pt;text-align:left}.tip-distribution .count{text-align:left;white-space:nowrap}.tip-distribution .count SPAN.number{font-size:8pt}.tip-distribution .count SPAN.bar{background:#b2a196;display:inline-block;margin-right:3pt;height:9pt}.tip-distribution .count SPAN.bar.green{background:#2a8f79}#profile-edit BUTTON.save,#profile-edit BUTTON.cancel{display:none}#profile-edit .username INPUT{width:6em;display:none}#profile-edit .username .warning{margin-top:5px;display:block;color:red;display:none}#profile-edit .statement DIV.edit{display:none}#profile-edit .statement TEXTAREA{width:98%;height:126pt;padding:1%}#profile-edit .statement .help{font:normal 12px/12px "Helvetica Neue",Helvetica,Arial,"Liberation Sans",FreeSans,sans-serif}#profile-edit .goal TABLE.edit{display:none}#profile-edit .goal TD{text-align:left}#profile-edit .goal #goal-custom{text-align:right;width:6pc}#profile-edit .goal LI{margin-bottom:1em}#history th{padding:0 3pt}#history th b{font-weight:300;font-size:9pt}#history td{padding:1pt 3pt;font-size:9pt;line-height:10pt;text-align:right}#history td h2{text-align:left}#history .head td{font-size:9pt;white-space:normal;text-align:left;border-bottom:1px solid #614c3e}#history td.card,#history td.fees,#history td.debits{color:red}#history .head td.card,#history .head td.fees,#history .head td.debits{color:#614c3e}#history td.notes{text-align:left}#history .fees{border-right:1px solid #614c3e;text-align:right}#history .outside{border-right:1px solid #614c3e;text-align:right !important}#for #weeks{margin-top:10px}#for #weeks .fine{font:normal 10px "Helvetica Neue",Helvetica,Arial,"Liberation Sans",FreeSans,sans-serif;text-transform:uppercase}#for #weeks #this-week{width:220px;float:left;text-align:left}#for #weeks #this-week .amount{font:bold 56px "Helvetica Neue",Helvetica,Arial,"Liberation Sans",FreeSans,sans-serif}#for #weeks #last-week{width:220px;float:right;text-align:right}#for #weeks #last-week .account{padding:5px 0}#for #deserts{width:220px;float:left}#for #deserts #query{width:110px;padding:2px 5px}#for #deserts #lookup-results-container{position:relative}#for #deserts #lookup-results-container #lookup-results{width:120px;position:absolute;bottom:0px;left:-128px;background:white;border:2px solid #000;margin:0;padding:5px;border:4px solid rgba(97,76,62,0.5);-webkit-background-clip:padding-box;-webkit-border-radius:3px;-moz-background-clip:padding-box;-moz-border-radius:3px;border-radius:3px;background-clip:padding-box}#for #deserts #lookup-results-container #lookup-results li{font:normal 16px/16px "Helvetica Neue",Helvetica,Arial,"Liberation Sans",FreeSans,sans-serif;white-space:nowrap;margin:0;padding:3px 0;overflow:hidden}#for #crowd{width:220px;float:right;text-align:right}@media (max-width: 1029px){.main-padding{width:auto;padding:0 35px}#page .col,#page .col1,#page .col2{width:460px;float:none;margin:0 auto}}@media (max-width: 670px){.main-padding{padding:0 34px}}@media (max-width: 660px){.main-padding{padding:0 32px}}@media (max-width: 640px){.main-padding{padding:0 30px}}@media (max-width: 620px){.main-padding{padding:0 28px}}@media (max-width: 600px){.main-padding{padding:0 26px}}@media (max-width: 580px){.main-padding{padding:0 24px}}@media (max-width: 560px){.main-padding{padding:0 22px}}@media (max-width: 540px){.main-padding{padding:0 20px}#page #leaderboard ul li.luxury{display:none}body{font:normal 14px "Helvetica Neue",Helvetica,Arial,"Liberation Sans",FreeSans,sans-serif}#header div.login{font:normal 12px "Helvetica Neue",Helvetica,Arial,"Liberation Sans",FreeSans,sans-serif}}@media (max-width: 530px){.main-padding{padding:0 18px}}@media (max-width: 520px){.main-padding{padding:0 16px}}@media (max-width: 510px){.main-padding{padding:0 14px}}@media (max-width: 500px){.main-padding{padding:0 12px}}@media (max-width: 494px){#box{width:auto}}@media (max-width: 490px){.main-padding{padding:0 10px}}@media (max-width: 480px){.main-padding{padding:0 8px}#header{text-align:center}#header div.login{position:static}#header table{margin:0 auto}body{font:normal 13px "Helvetica Neue",Helvetica,Arial,"Liberation Sans",FreeSans,sans-serif}#box #jump .luxury{display:none}#page .col,#page .col0,#page .col1,#page .col2{width:auto}}@media (max-width: 470px){.main-padding{padding:0 6px}}@media (max-width: 460px){.main-padding{padding:0 4px}}@media (max-width: 600px){#hero h2.top{font-size:35px;line-height:35px;padding:50px 0 35px}#hero h2.top:after{margin-top:-17px}#hero h1{font-size:64px;line-height:64px;letter-spacing:-3px;padding:0 0 20px}}@media (max-width: 550px){#hero h2.top{font-size:31px;line-height:31px;padding:43px 0 29px}#hero h2.top:after{margin-top:-9px}#hero h1{font-size:57px;line-height:57px;letter-spacing:-1px;padding:0 0 15px}}@media (max-width: 500px){#hero h2.top{font-size:27px;line-height:27px;padding:36px 0 23px}#hero h2.top:after{margin-top:-9px}#hero h1{font-size:50px;line-height:50px;letter-spacing:-1px;padding:0 0 10px}}@media (max-width: 450px){#hero h2.top{font-size:23px;line-height:23px;padding:29px 0 17px}#hero h2.top:after{margin-top:-9px}#hero h1{font-size:43px;line-height:43px;letter-spacing:-1px;padding:0 0 5px}}@media (max-width: 400px){#hero h2.top{font-size:19px;line-height:19px;padding:22px 0 11px}#hero h2.top:after{margin-top:-9px}#hero h1{font-size:36px;line-height:36px;letter-spacing:-1px;padding:0}}@media (max-width: 350px){#hero h2.top{font-size:15px;line-height:15px;padding:15px 0 5px}#hero h2.top:after{margin-top:-9px}#hero h1{font-size:29px;line-height:29px;letter-spacing:0px;padding:0}}@media (max-width: 360px){#box{border-radius:0;border-left-width:1px;border-right-width:1px}}@media (max-width: 460px){#box table h2{font-size:14px;line-height:14px}#box table .pad-sign{padding-left:36px !important}#box table .number{font-size:56px;line-height:56px}#box table .unit{font-size:12px;line-height:12px}}@media (max-width: 420px){#box table h2{font-size:13px;line-height:13px}#box table .pad-sign{padding-left:30px !important}#box table .number{font-size:48px;line-height:48px}#box table .unit{font-size:11px;line-height:11px}}@media (max-width: 380px){#box table h2{font-size:13px;line-height:12px}#box table .pad-sign{padding-left:24px !important}#box table .number{font-size:40px;line-height:40px}}@media (max-width: 340px){#box table h2{font-size:11px;line-height:11px}#box table .pad-sign{padding-left:18px !important}#box table .number{font-size:32px;line-height:32px}#box table .unit{font-size:10px;line-height:10px}}@media (max-width: 300px){#box table h2{font-size:10px;line-height:10px}#box table .pad-sign{padding-left:12px !important}#box table .number{font-size:24px;line-height:24px}#box table .unit{font-size:9px;line-height:9px}}@media (max-width: 320px){body{font:normal 13px "Helvetica Neue",Helvetica,Arial,"Liberation Sans",FreeSans,sans-serif}}@media (max-width: 240px){#header .logo{padding-right:0}#header .motto.luxury{display:none}#header .login .luxury{display:none}}@media (max-width: 200px){#box #jump input{width:80%}} +@font-face{font-family:'Mensch';src:url("../fonts/mensch.eot");src:url("../fonts/mensch.eot?#iefix") format("embedded-opentype"),url("../fonts/mensch.woff") format("woff"),url("../fonts/mensch.ttf") format("truetype"),url("../fonts/mensch.svg#Mensch") format("svg");font-weight:normal;font-style:normal}html,body{background:#FFF}body{color:#231f20;font:normal 16px "Helvetica Neue",Helvetica,Arial,"Liberation Sans",FreeSans,sans-serif;text-rendering:optimizeLegibility}.main-padding{width:960px;margin:0 auto;position:relative}*{box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box}a{color:#2a8f79;text-decoration:none;font-weight:bold}a img{border:0}p,dd{margin:0;padding:0 0 1em;line-height:130%}dt{font-weight:bold;margin:1em 0 0.25em}pre{font:9pt/13pt monospace;margin:0 0 1em 1em;padding:0;overflow:auto}li{margin:0;margin:0 0 1em 1.5em}ol{margin:1em 0 0}ol li{list-style:outside decimal}.group:after{content:".";display:block;height:0;clear:both;visibility:hidden}.hidden{display:none}input{box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box}.clear{clear:both}.centered{margin:0 auto}.highlight{background:#FFFE26}.mini-user{background:white;display:block;float:left;width:100%;overflow:hidden;border:4px solid #dee0e0;-webkit-background-clip:padding-box;-webkit-border-radius:3px;-moz-background-clip:padding-box;-moz-border-radius:3px;border-radius:3px;background-clip:padding-box}.mini-user span.inner{border:1px solid #b6b7b9;display:block;min-height:50px;padding:5px}.mini-user span.inner span.avatar{background:transparent url("avatar-default.gif") center center no-repeat;background-size:cover;display:block;min-height:70px;position:relative}.mini-user span.inner span.avatar span.rank{background:#614c3e;bottom:4px;color:white;display:block;font:normal 12px "Mensch","Helvetica Neue",Helvetica,Arial,"Liberation Sans",FreeSans,sans-serif;left:4px;padding:3px 5px 3px 6px;position:absolute;text-align:center;-webkit-background-clip:padding-box;-webkit-border-radius:2px;-moz-background-clip:padding-box;-moz-border-radius:2px;border-radius:2px;background-clip:padding-box}.mini-user span.inner span.age,.mini-user span.inner span.money{color:#231f20;display:block;font:bold 18px "Helvetica Neue",Helvetica,Arial,"Liberation Sans",FreeSans,sans-serif;margin:7px 0 5px 0}.mini-user span.inner span.age span.unit,.mini-user span.inner span.money span.unit{font:normal 11px "Helvetica Neue",Helvetica,Arial,"Liberation Sans",FreeSans,sans-serif}.mini-user span.inner span.name{display:block;font:normal 11px "Helvetica Neue",Helvetica,Arial,"Liberation Sans",FreeSans,sans-serif;margin:3px 0;white-space:nowrap}.mini-user.anonymous{opacity:0.33}a.mini-user span.name{color:#2a8f79}span.mini-user{border-color:white}span.mini-user span.name{color:#231f20}a.mini-user:hover{border:4px solid #b2a196;text-decoration:none}a.mini-user:hover span.inner{border-color:#614c3e}button{background:#58595b;border:3px solid rgba(88,89,91,0.33);color:white;font:bold 11px "Helvetica Neue",Helvetica,Arial,"Liberation Sans",FreeSans,sans-serif;letter-spacing:1px;margin:0 0 0 1px;padding:4px 10px;text-transform:uppercase;-webkit-background-clip:padding-box;-webkit-border-radius:3px;-moz-background-clip:padding-box;-moz-border-radius:3px;border-radius:3px;background-clip:padding-box;cursor:pointer;display:inline}button:hover{border-color:#58595b;background:#e6e6e6;color:#58595b}button.selected{border-color:rgba(255,255,255,0.9);background:#2a8f79;color:white}button.selected:hover{border-color:rgba(42,143,121,0.5);background:#e6e6e6;color:#58595b}#header{background:white;padding:10px 0;position:relative}#header td{text-align:center;vertical-align:middle}#header h1{line-height:100%}#header .logo{padding-right:18px}#header .motto{border-left:2px solid #d0d2d3;font:bold 10px "Helvetica Neue",Helvetica,Arial,"Liberation Sans",FreeSans,sans-serif;letter-spacing:1px;text-transform:uppercase;padding-left:18px;text-align:left}#header div.login{padding-top:18px;position:absolute;top:0;right:0;font:normal 13px "Helvetica Neue",Helvetica,Arial,"Liberation Sans",FreeSans,sans-serif}#hero{background:transparent url("hero-bg.png") top left repeat;border:1px solid #d0d2d3;border-style:solid none;padding-bottom:100px;text-align:center;position:relative;z-index:1}#hero .main-padding{color:#231f20}#hero h2 span{background:transparent url("hero-bg.png") top left repeat;display:inline-block;padding:0 10px}#hero p{padding:0 20%}#hero h2.top{letter-spacing:-2px;font:normal 35px "Mensch","Helvetica Neue",Helvetica,Arial,"Liberation Sans",FreeSans,sans-serif;padding:50px 0 35px 0}#hero h2.top span{background:transparent url("hero-bg.png") top left repeat;display:inline-block;padding:0 10px}#hero h2.top:after{background:#231f20;content:"";display:block;height:1px;margin-top:-17px}#hero h1{letter-spacing:-3px;font:normal 64px/64px "Mensch","Helvetica Neue",Helvetica,Arial,"Liberation Sans",FreeSans,sans-serif;padding-bottom:20px}#hero h2.bottom{padding-bottom:20px}#hero h2.bottom span.button-container{display:inline-block;padding:0 10px}#hero h2.bottom span.button-container button{font-size:14px}#hero h2.bottom:after{background:#231f20;content:"";display:block;height:1px;margin-top:-16px}#box{text-align:center;background:white;margin:-80px auto 0;border:5px solid rgba(97,76,62,0.5);width:480px;min-width:240px;-webkit-background-clip:padding-box;-webkit-border-radius:3px;-moz-background-clip:padding-box;-moz-border-radius:3px;border-radius:3px;background-clip:padding-box;position:relative;z-index:2}#box h1{font:bold 22px "Helvetica Neue",Helvetica,Arial,"Liberation Sans",FreeSans,sans-serif;color:#614c3e}#box h2{font:bold 14px "Helvetica Neue",Helvetica,Arial,"Liberation Sans",FreeSans,sans-serif;text-transform:uppercase;color:#614c3e}#box .help{font:normal 14px/18px "Helvetica Neue",Helvetica,Arial,"Liberation Sans",FreeSans,sans-serif;color:#231f20}#box .help.with-padding{padding:10px}#box .as-content{padding:20px}#box .as-content.left{text-align:left}#box .as-content h1{padding-bottom:15px}#box .as-content input{width:8em}#box .is-suspicious-indicator{display:block;position:absolute;top:5px;right:5px;font:normal 10px "Helvetica Neue",Helvetica,Arial,"Liberation Sans",FreeSans,sans-serif;text-transform:uppercase;color:#231f20}#box label.is-suspicious-knob{display:block;position:absolute;top:2px;right:5px;font:normal 9px "Helvetica Neue",Helvetica,Arial,"Liberation Sans",FreeSans,sans-serif;text-transform:uppercase;color:#231f20}#box label.is-suspicious-knob input{position:relative;top:3px}#box .ready{padding-left:15px}#box .number{font:bold 56px "Helvetica Neue",Helvetica,Arial,"Liberation Sans",FreeSans,sans-serif}#box .unit{font:normal 12px "Helvetica Neue",Helvetica,Arial,"Liberation Sans",FreeSans,sans-serif}#box .on-elsewhere{width:100%}#box .on-elsewhere .offset{width:138px;height:138px}#box .on-elsewhere .picture{width:138px;height:138px}#box .on-elsewhere .picture img{width:128px;height:128px;display:block;margin:5px}#box .on-profile{width:100%}#box .on-profile.is-suspicious{background:#f99}#box .on-profile .picture{width:138px;height:138px}#box .on-profile .picture img{width:128px;height:128px;display:block;margin:5px}#box .on-profile td{text-align:left}#box .on-profile .pad-sign{padding-left:36px}#box .nav{padding:5px}#box .nav h2{color:#231f20;font:bold 10px "Helvetica Neue",Helvetica,Arial,"Liberation Sans",FreeSans,sans-serif;letter-spacing:1px;text-transform:uppercase;margin:0 0 3px}#box .nav button.larger{font-size:14px}#box .nav.level-1{border-top:1px solid rgba(97,76,62,0.2);background:#e6e6e6}#box .nav.level-1 #payment-prompt{display:none;margin:10px 0 5px}#box .nav.level-1 #payment-prompt.needed{display:block}#box .nav.level-1 #payment-prompt.really-needed{display:block}#box .nav.level-2{border-top:1px solid rgba(97,76,62,0.5);background:#d0d2d3}#box .nav.level-3{background:black;text-align:center;padding:5px;color:white}#box .nav.level-3 a{display:block;color:white}#box .on-confirm{padding:35px 0 0}#box .on-confirm h2{font:bold 14px "Helvetica Neue",Helvetica,Arial,"Liberation Sans",FreeSans,sans-serif;text-transform:uppercase;margin:35px 0 8px}#box .on-confirm .nav{margin:35px 0 0}#box .on-confirm .nav h2{margin:8px 0}#box .on-confirm .scenario{margin:0 auto}#box .on-confirm .scenario TD{padding:6pt;width:33%}#box .on-confirm #nix{position:absolute;top:50%;left:50%;margin:-16px 0 0 -16px}#box .on-confirm .participant{position:relative;width:96pt;display:inline-block;border:2px solid #614c3e;border-radius:6pt;font:normal 12px "Helvetica Neue",Helvetica,Arial,"Liberation Sans",FreeSans,sans-serif;color:#614c3e;background:#fff url("/assets/clipped-heart.gif") bottom right no-repeat;text-align:left;overflow:hidden}#box .on-confirm .participant-padding{display:block;padding:6pt 0 6pt 9pt}#box .on-confirm .participant IMG,#box .on-confirm IMG.platform-icon{margin-bottom:-1pt}#box .on-confirm .participant B{font-size:11pt}#box .on-confirm .participant TD{padding:0}#box .on-confirm .participant TH{font-weight:normal}#box .on-confirm .other,#box .on-confirm .abandoned{font:normal 10px "Helvetica Neue",Helvetica,Arial,"Liberation Sans",FreeSans,sans-serif}#box .on-confirm .abandoned{text-align:center;overflow:hidden}#box .on-confirm .nix{border-color:#b2a196}#box .on-confirm .other B{font-size:9pt}#box .on-form{text-align:left}#box .on-form .constrain-width{margin:0 auto 35px;width:300px}#box .on-form form h2{font:bold 14px "Helvetica Neue",Helvetica,Arial,"Liberation Sans",FreeSans,sans-serif;text-transform:uppercase;margin:35px 0 8px}#box .on-form .half{width:150px}#box .on-form .full{clear:both;text-align:right;padding-top:5px}#box .on-form #other{font:normal 9pt/14pt Arial,sans-serif;color:#00E;cursor:pointer;margin-right:1em}#box .on-form #other:hover{text-decoration:underline}#box .on-form .left{float:left}#box .on-form .right{float:left}#box .on-form LABEL{display:block;font:normal 10px "Helvetica Neue",Helvetica,Arial,"Liberation Sans",FreeSans,sans-serif;margin:8px 0 0;padding:0;text-transform:uppercase}#box .on-form INPUT{font:normal 11pt/14pt "Helvetica Neue",Helvetica,Arial,"Liberation Sans",FreeSans,sans-serif;width:292px;margin:0;padding:3px;border:1px solid #b2a196;outline:none}#box .on-form INPUT.disabled{color:#b2a196}#box .on-form .half INPUT{width:137px}#box .on-form .right.half LABEL,#box .on-form .right.half INPUT{margin-left:5px}#box .on-form INPUT:focus{border-color:#2a8f79}#box .on-form .float{float:left}#box .on-form .city INPUT{width:137px}#box .on-form .state INPUT{width:43px}#box .on-form .zip INPUT{width:75px}#box .on-form .card_number INPUT{width:137px}#box .on-form .cvv INPUT{width:43px}#box .on-form INPUT.expiration_month{width:24px}#box .on-form INPUT.expiration_year{width:39px;margin-left:1px !important}#box .on-form .not-first LABEL,#box .on-form .not-first INPUT{margin-left:10px}#box .on-form .nav{text-align:center}#box .on-form #feedback .details li{margin:0;padding:0 0 0 2em;text-indent:-2em;font:normal 12px "Helvetica Neue",Helvetica,Arial,"Liberation Sans",FreeSans,sans-serif}.payment-footer{font:normal 12px "Helvetica Neue",Helvetica,Arial,"Liberation Sans",FreeSans,sans-serif;text-align:center}#page #leaderboard ul{margin:0 0 20px 0}#page #leaderboard ul li{display:block;float:left;margin:0;min-width:90px;padding:2px;width:10%}#page{padding:20px 0 0;background:white}#page h1{color:#2a8f79;font:normal 35px "Mensch","Helvetica Neue",Helvetica,Arial,"Liberation Sans",FreeSans,sans-serif;letter-spacing:-2px;margin:35px 0 20px 0;text-transform:uppercase}#page h2{color:#614c3e;font:bold 14px "Helvetica Neue",Helvetica,Arial,"Liberation Sans",FreeSans,sans-serif;letter-spacing:1px;text-transform:uppercase;margin:35px 0 8px}#page .col{width:auto;margin:0 auto}#page .col0{width:460px;margin:0 auto}#page .col1{width:460px;float:left}#page .col2{width:460px;float:right}#footer{margin:4em 0 1em;border-top:1px solid #231f20;padding:0.5em 0 0;text-align:right;font:normal 12px/16px "Helvetica Neue",Helvetica,Arial,"Liberation Sans",FreeSans,sans-serif}#footer .social{float:left}#accounts{margin-bottom:12pt}#accounts td{text-align:left;vertical-align:middle;line-height:100%}#accounts td.account-type{border-right:1pt solid #b2a196;padding:6pt 6pt 6pt 0}#accounts td.account-type IMG{width:36pt;height:36pt}#accounts DIV.account-type{font-size:x-small;clear:both;color:#b2a196}#accounts .account-details{padding-left:6pt}#accounts IMG.avatar{width:24pt;height:24pt;float:left;margin-right:3pt}#members{list-style:none;margin-bottom:12pt;margin:0 auto}#members TD{padding:0 0 0.5em 0;text-align:left}#members IMG{width:18pt;height:18pt;margin-right:6pt;float:left}.tip-distribution .dollar-sign{padding:0 2pt 0 24pt;text-align:right}.tip-distribution .amount{padding:0 6pt 0 0;text-align:right}.tip-distribution .amount-change{padding:6pt 0 6pt 24pt;text-align:left}.tip-distribution .count{text-align:left;white-space:nowrap}.tip-distribution .count SPAN.number{font-size:8pt}.tip-distribution .count SPAN.bar{background:#b2a196;display:inline-block;margin-right:3pt;height:9pt}.tip-distribution .count SPAN.bar.green{background:#2a8f79}#profile-edit BUTTON.save,#profile-edit BUTTON.cancel{display:none}#profile-edit .username INPUT{width:6em;display:none}#profile-edit .username .warning{margin-top:5px;display:block;color:red;display:none}#profile-edit .statement DIV.edit{display:none}#profile-edit .statement TEXTAREA{width:98%;height:126pt;padding:1%}#profile-edit .statement .help{font:normal 12px/12px "Helvetica Neue",Helvetica,Arial,"Liberation Sans",FreeSans,sans-serif}#profile-edit .goal TABLE.edit{display:none}#profile-edit .goal TD{text-align:left}#profile-edit .goal #goal-custom{text-align:right;width:6pc}#profile-edit .goal LI{margin-bottom:1em}#history th{padding:0 3pt}#history th b{font-weight:300;font-size:9pt}#history td{padding:1pt 3pt;font-size:9pt;line-height:10pt;text-align:right}#history td h2{text-align:left}#history .head td{font-size:9pt;white-space:normal;text-align:left;border-bottom:1px solid #614c3e}#history td.card,#history td.fees,#history td.debits{color:red}#history .head td.card,#history .head td.fees,#history .head td.debits{color:#614c3e}#history td.notes{text-align:left}#history .fees{border-right:1px solid #614c3e;text-align:right}#history .outside{border-right:1px solid #614c3e;text-align:right !important}#openco .fine{font:normal 10px "Helvetica Neue",Helvetica,Arial,"Liberation Sans",FreeSans,sans-serif;text-transform:uppercase}#openco #weeks{margin-top:10px}#openco #weeks #this-week{width:220px;float:left;text-align:left}#openco #weeks #this-week .amount{font:bold 56px "Helvetica Neue",Helvetica,Arial,"Liberation Sans",FreeSans,sans-serif}#openco #weeks #last-week{width:220px;float:right;text-align:right}#openco #weeks #last-week .account{padding:5px 0}#openco TD{padding-right:0.5em}#openco #my-identifications{width:250px;float:right;position:relative}#openco #my-identifications ::-webkit-input-placeholder{color:#b2a196}#openco #my-identifications ::-moz-placeholder{color:#b2a196}#openco #my-identifications :-ms-input-placeholder{color:#b2a196}#openco #my-identifications input:-moz-placeholder{color:#b2a196}#openco #my-identifications #query{width:170px;padding:2px 5px;z-index:1;position:relative;top:1px;outline:none;border:none}#openco #my-identifications .weight{background:#2a8f79;display:inline-block}#openco #my-identifications .weight.a{height:24px;width:24px}#openco #my-identifications .weight.b{height:12px;width:12px}#openco #my-identifications .weight.c{height:6px;width:6px}#openco #my-identifications .weight.d{height:3px;width:3px}#openco #my-identifications .weight.e{height:1px;width:1px}#openco #my-identifications .weight.f{height:0.25px;width:0.25px}#openco #my-identifications .weight.g{background:red;width:1px;height:1px}#openco #my-identifications #lookup-container{position:relative;vertical-align:middle}#openco #my-identifications #lookup-container #lookup-results{width:188px;min-height:30px;position:absolute;bottom:-1px;left:-4px;background:white;margin:0;padding:2px 0;border:4px solid rgba(97,76,62,0.5);color:#b2a196;-webkit-background-clip:padding-box;-webkit-border-radius:3px;-moz-background-clip:padding-box;-moz-border-radius:3px;border-radius:3px;background-clip:padding-box}#openco #my-identifications #lookup-container #lookup-results li{font:normal 16px/16px "Helvetica Neue",Helvetica,Arial,"Liberation Sans",FreeSans,sans-serif;white-space:nowrap;margin:0;padding:3px 5px;overflow:hidden}#openco #crowd{width:180px;float:left}@media (max-width: 1029px){.main-padding{width:auto;padding:0 35px}#page .col,#page .col1,#page .col2{width:460px;float:none;margin:0 auto}}@media (max-width: 670px){.main-padding{padding:0 34px}}@media (max-width: 660px){.main-padding{padding:0 32px}}@media (max-width: 640px){.main-padding{padding:0 30px}}@media (max-width: 620px){.main-padding{padding:0 28px}}@media (max-width: 600px){.main-padding{padding:0 26px}}@media (max-width: 580px){.main-padding{padding:0 24px}}@media (max-width: 560px){.main-padding{padding:0 22px}}@media (max-width: 540px){.main-padding{padding:0 20px}#page #leaderboard ul li.luxury{display:none}body{font:normal 14px "Helvetica Neue",Helvetica,Arial,"Liberation Sans",FreeSans,sans-serif}#header div.login{font:normal 12px "Helvetica Neue",Helvetica,Arial,"Liberation Sans",FreeSans,sans-serif}}@media (max-width: 530px){.main-padding{padding:0 18px}}@media (max-width: 520px){.main-padding{padding:0 16px}}@media (max-width: 510px){.main-padding{padding:0 14px}}@media (max-width: 500px){.main-padding{padding:0 12px}}@media (max-width: 494px){#box{width:auto}}@media (max-width: 490px){.main-padding{padding:0 10px}}@media (max-width: 480px){.main-padding{padding:0 8px}#header{text-align:center}#header div.login{position:static}#header table{margin:0 auto}body{font:normal 13px "Helvetica Neue",Helvetica,Arial,"Liberation Sans",FreeSans,sans-serif}#box #jump .luxury{display:none}#page .col,#page .col0,#page .col1,#page .col2{width:auto}}@media (max-width: 470px){.main-padding{padding:0 6px}}@media (max-width: 460px){.main-padding{padding:0 4px}}@media (max-width: 600px){#hero h2.top{font-size:35px;line-height:35px;padding:50px 0 35px}#hero h2.top:after{margin-top:-17px}#hero h1{font-size:64px;line-height:64px;letter-spacing:-3px;padding:0 0 20px}}@media (max-width: 550px){#hero h2.top{font-size:31px;line-height:31px;padding:43px 0 29px}#hero h2.top:after{margin-top:-9px}#hero h1{font-size:57px;line-height:57px;letter-spacing:-1px;padding:0 0 15px}}@media (max-width: 500px){#hero h2.top{font-size:27px;line-height:27px;padding:36px 0 23px}#hero h2.top:after{margin-top:-9px}#hero h1{font-size:50px;line-height:50px;letter-spacing:-1px;padding:0 0 10px}}@media (max-width: 450px){#hero h2.top{font-size:23px;line-height:23px;padding:29px 0 17px}#hero h2.top:after{margin-top:-9px}#hero h1{font-size:43px;line-height:43px;letter-spacing:-1px;padding:0 0 5px}}@media (max-width: 400px){#hero h2.top{font-size:19px;line-height:19px;padding:22px 0 11px}#hero h2.top:after{margin-top:-9px}#hero h1{font-size:36px;line-height:36px;letter-spacing:-1px;padding:0}}@media (max-width: 350px){#hero h2.top{font-size:15px;line-height:15px;padding:15px 0 5px}#hero h2.top:after{margin-top:-9px}#hero h1{font-size:29px;line-height:29px;letter-spacing:0px;padding:0}}@media (max-width: 360px){#box{border-radius:0;border-left-width:1px;border-right-width:1px}}@media (max-width: 460px){#box table h2{font-size:14px;line-height:14px}#box table .pad-sign{padding-left:36px !important}#box table .number{font-size:56px;line-height:56px}#box table .unit{font-size:12px;line-height:12px}}@media (max-width: 420px){#box table h2{font-size:13px;line-height:13px}#box table .pad-sign{padding-left:30px !important}#box table .number{font-size:48px;line-height:48px}#box table .unit{font-size:11px;line-height:11px}}@media (max-width: 380px){#box table h2{font-size:13px;line-height:12px}#box table .pad-sign{padding-left:24px !important}#box table .number{font-size:40px;line-height:40px}}@media (max-width: 340px){#box table h2{font-size:11px;line-height:11px}#box table .pad-sign{padding-left:18px !important}#box table .number{font-size:32px;line-height:32px}#box table .unit{font-size:10px;line-height:10px}}@media (max-width: 300px){#box table h2{font-size:10px;line-height:10px}#box table .pad-sign{padding-left:12px !important}#box table .number{font-size:24px;line-height:24px}#box table .unit{font-size:9px;line-height:9px}}@media (max-width: 320px){body{font:normal 13px "Helvetica Neue",Helvetica,Arial,"Liberation Sans",FreeSans,sans-serif}}@media (max-width: 240px){#header .logo{padding-right:0}#header .motto.luxury{display:none}#header .login .luxury{display:none}}@media (max-width: 200px){#box #jump input{width:80%}} diff --git a/www/assets/%version/gittip.js b/www/assets/%version/gittip.js index f4cce94b4f..0bab245887 100644 --- a/www/assets/%version/gittip.js +++ b/www/assets/%version/gittip.js @@ -549,24 +549,26 @@ Gittip.initPayout = function(balanced_uri, participantId) }); }; +Gittip.getCookie = function(name) +{ + var cookieValue = null; + if (document.cookie && document.cookie != '') { + var cookies = document.cookie.split(';'); + for (var i = 0; i < cookies.length; i++) { + var cookie = jQuery.trim(cookies[i]); + // Does this cookie string begin with the name we want? + if (cookie.substring(0, name.length + 1) == (name + '=')) { + cookieValue = decodeURIComponent(cookie.substring(name.length + 1)); + break; + } + } + } + return cookieValue; +}; + Gittip.initCSRF = function() { // https://docs.djangoproject.com/en/dev/ref/contrib/csrf/#ajax jQuery(document).ajaxSend(function(event, xhr, settings) { - function getCookie(name) { - var cookieValue = null; - if (document.cookie && document.cookie != '') { - var cookies = document.cookie.split(';'); - for (var i = 0; i < cookies.length; i++) { - var cookie = jQuery.trim(cookies[i]); - // Does this cookie string begin with the name we want? - if (cookie.substring(0, name.length + 1) == (name + '=')) { - cookieValue = decodeURIComponent(cookie.substring(name.length + 1)); - break; - } - } - } - return cookieValue; - } function sameOrigin(url) { // url could be relative or scheme relative or absolute var host = document.location.host; // host + port @@ -584,7 +586,9 @@ Gittip.initCSRF = function() } if (!safeMethod(settings.type) && sameOrigin(settings.url)) { - xhr.setRequestHeader("X-CSRF-TOKEN", getCookie('csrf_token')); + xhr.setRequestHeader( "X-CSRF-TOKEN" + , Gittip.getCookie('csrf_token') + ); } }); }; diff --git a/www/assets/%version/openco.js b/www/assets/%version/openco.js new file mode 100644 index 0000000000..e190e8f5c7 --- /dev/null +++ b/www/assets/%version/openco.js @@ -0,0 +1,51 @@ +Gittip.openco = angular.module('Gittip.openco', []); + + +Gittip.openco.IdentificationsCtrl = function($scope, $http) +{ + $scope.weights = [0, 0.1, 1, 2, 4, 8, 16]; + + function updateIdentifications(data) + { + $scope.identifications = data.identifications; + $scope.split = data.split; + } + + $scope.doLookup = function() + { + if ($scope.query == '') + $scope.lookup = []; + else + $http.get("/lookup.json", {params: {query: $scope.query}}) + .success(function(data) { $scope.lookup = data; }); + }; + + $scope.doAdd = function() + { + $scope.change({'username': $scope.query}, 0.1); + $scope.lookup = []; + $scope.query = ''; + jQuery('#query').focus(); + }; + + $scope.change = function(participant, weight) + { + console.log("changing", participant.username, "to", weight); + var data = { member: participant.username + , weight: weight + , csrf_token: Gittip.getCookie('csrf_token') + }; + // http://stackoverflow.com/questions/12190166/ + data = jQuery.param(data); + var content_type = 'application/x-www-form-urlencoded; charset=UTF-8'; + var config = {headers: {'Content-Type': content_type}}; + $http.post("identifications.json", data, config) + .success(updateIdentifications); + }; + + $http.get("identifications.json").success(updateIdentifications); + + // No good way in Angular yet: + // http://stackoverflow.com/questions/14833326/ + jQuery('#query').focus(); +};