From 2c509a8d23a074aeacbdf00c7dee89cc32024677 Mon Sep 17 00:00:00 2001 From: Chad Whitacre Date: Sun, 14 Apr 2013 12:55:44 -0400 Subject: [PATCH] UI for open groups is MVP; #449 Trusted users can answer the question "Who is Gittip?" and we compute a percentage split for the pot based on those answers. The rest is details. Or faucets and fixtures. ;-) --- branch.sql | 17 ++- configure-aspen.py | 2 + default_local.env | 1 + default_tests.env | 1 + gittip/models/participant.py | 48 ++++++++- gittip/wireup.py | 4 + templates/gittip.scss | 33 ++---- templates/identifications.html | 80 -------------- templates/open-group-members.html | 92 ++++++++++++++++ www/%username/index.html | 4 +- .../{identifications.json => members.json} | 33 +++--- www/assets/%version/gittip.css | 2 +- www/assets/%version/open_group.js | 100 ++++++++++++++++++ www/assets/%version/openco.js | 51 --------- 14 files changed, 289 insertions(+), 179 deletions(-) delete mode 100644 templates/identifications.html create mode 100644 templates/open-group-members.html rename www/%username/{identifications.json => members.json} (60%) create mode 100644 www/assets/%version/open_group.js delete mode 100644 www/assets/%version/openco.js diff --git a/branch.sql b/branch.sql index b3a7db1e24..e523ac5ffb 100644 --- a/branch.sql +++ b/branch.sql @@ -9,7 +9,7 @@ BEGIN; CREATE TYPE participant_type AS ENUM ( 'individual' , 'group' - , 'open company' + , 'open group' ); CREATE TABLE log_participant_type @@ -40,6 +40,8 @@ BEGIN; , NEW.type ); + UPDATE participants SET type='open group' WHERE username_lower='gittip'; + ------------------ -- identifications @@ -53,7 +55,7 @@ BEGIN; ON DELETE RESTRICT ON UPDATE CASCADE , "group" text NOT NULL REFERENCES participants ON DELETE RESTRICT ON UPDATE CASCADE - , weight numeric DEFAULT 0.1 + , weight int NOT NULL DEFAULT 0 , identified_by text NOT NULL REFERENCES participants ON DELETE RESTRICT ON UPDATE CASCADE , CONSTRAINT no_member_of_self CHECK (member != "group") @@ -61,4 +63,15 @@ BEGIN; , CONSTRAINT no_stacking_the_deck CHECK ("group" != "identified_by") ); + + CREATE VIEW current_identifications AS + SELECT DISTINCT ON (member, "group", identified_by) * + FROM identifications + JOIN participants p ON p.username = identified_by + WHERE p.is_suspicious IS FALSE + ORDER BY member + , "group" + , identified_by + , mtime DESC; + END; diff --git a/configure-aspen.py b/configure-aspen.py index f0cf8ccb02..8724cf57c6 100644 --- a/configure-aspen.py +++ b/configure-aspen.py @@ -5,6 +5,7 @@ import gittip.authentication import gittip.orm import gittip.csrf +import gittip.models.participant gittip.wireup.canonical() @@ -13,6 +14,7 @@ gittip.wireup.username_restrictions(website) gittip.wireup.sentry(website) gittip.wireup.mixpanel(website) +gittip.wireup.nanswers() website.bitbucket_consumer_key = os.environ['BITBUCKET_CONSUMER_KEY'].decode('ASCII') diff --git a/default_local.env b/default_local.env index f5abdb8697..1f1121a3d8 100644 --- a/default_local.env +++ b/default_local.env @@ -15,3 +15,4 @@ TWITTER_CONSUMER_KEY=QBB9vEhxO4DFiieRF68zTA TWITTER_CONSUMER_SECRET=mUymh1hVMiQdMQbduQFYRi79EYYVeOZGrhj27H59H78 TWITTER_CALLBACK=http://127.0.0.1:8537/on/twitter/associate MIXPANEL_TOKEN=cb9dec68ac0ee57071f0be39f164a417 +NANSWERS_THRESHOLD=2 diff --git a/default_tests.env b/default_tests.env index 1d512a16b5..205f1e28cc 100644 --- a/default_tests.env +++ b/default_tests.env @@ -15,3 +15,4 @@ TWITTER_CONSUMER_KEY=QBB9vEhxO4DFiieRF68zTA TWITTER_CONSUMER_SECRET=mUymh1hVMiQdMQbduQFYRi79EYYVeOZGrhj27H59H78 TWITTER_CALLBACK=http://127.0.0.1:8537/on/twitter/associate MIXPANEL_TOKEN=cb9dec68ac0ee57071f0be39f164a417 +NANSWERS_THRESHOLD=2 diff --git a/gittip/models/participant.py b/gittip/models/participant.py index 55c2af1f1f..2350b1b228 100644 --- a/gittip/models/participant.py +++ b/gittip/models/participant.py @@ -2,6 +2,7 @@ import datetime import os +from collections import defaultdict from decimal import Decimal import pytz @@ -23,6 +24,7 @@ "abcdefghijklmnopqrstuvwxyz" "ABCDEFGHIJKLMNOPQRSTUVWXYZ" ".,-_;:@ ") +NANSWERS_THRESHOLD = 0 # configured in wireup.py class Participant(db.Model): __tablename__ = "participants" @@ -51,7 +53,7 @@ class Participant(db.Model): balanced_account_uri = Column(Text) last_ach_result = Column(Text) is_suspicious = Column(Boolean) - type = Column(Enum('individual', 'group', 'open company', nullable=False)) + type = Column(Enum('individual', 'group', 'open group', nullable=False)) ### Relations ### accounts_elsewhere = relationship( "Elsewhere" @@ -273,10 +275,50 @@ def get_age_in_seconds(self): out = (now - self.claimed_time).total_seconds() return out + def allowed_to_answer(self): + return self.is_suspicious is False \ + and len(self.exchanges) > 1 + def compute_split(self): - if self.type != 'open company': + if self.type != 'open group': return [{"username": self.username, "weight": "1.0"}] - pass + + nanswers = gittip.db.fetchone(""" + + SELECT count(*) + FROM ( SELECT identified_by + FROM current_identifications + WHERE "group"=%s + AND weight > 0 + GROUP BY identified_by + ) AS anon + + """, (self.username,))['count'] + + split = [] + if nanswers >= NANSWERS_THRESHOLD: + rows = gittip.db.fetchall(""" + + SELECT * + FROM current_identifications + WHERE "group"=%s + AND weight > 0 + + """, (self.username,)) + + splitmap = defaultdict(int) + total = 0 + for row in rows: + splitmap[row['member']] += row['weight'] + total += row['weight'] + + total = float(total) + for username, weight in splitmap.items(): + split.append({"username": username, "weight": weight / total}) + + split.sort(key=lambda r: r['weight'], reverse=True) + + return (nanswers, NANSWERS_THRESHOLD, split) # TODO: Move these queries into this class. diff --git a/gittip/wireup.py b/gittip/wireup.py index e15ac4a8c5..f34494799c 100644 --- a/gittip/wireup.py +++ b/gittip/wireup.py @@ -65,3 +65,7 @@ def tell_sentry(request): def mixpanel(website): website.mixpanel_token = os.environ['MIXPANEL_TOKEN'] gittip.mixpanel.MIXPANEL_TOKEN = os.environ['MIXPANEL_TOKEN'] + +def nanswers(): + from gittip.models import participant + participant.NANSWERS_THRESHOLD = int(os.environ['NANSWERS_THRESHOLD']) diff --git a/templates/gittip.scss b/templates/gittip.scss index e575e44395..8a427eb606 100644 --- a/templates/gittip.scss +++ b/templates/gittip.scss @@ -969,41 +969,18 @@ button.selected:hover { } } -#openco { +#open_group { .fine { font: normal 10px $Helvetica; text-transform: uppercase; } - #weeks { - margin-top: 10px; - - #this-week { - width: 220px; - float: left; - text-align: left; - .amount { - font: bold 56px $Helvetica; - } - } - - #last-week { - width: 220px; - float: right; - text-align: right; - - .account { - padding: 5px 0; - } - } - } - TD { padding-right: 0.5em; } - #my-identifications { + #identifications { width: 250px; float: right; position: relative; @@ -1063,9 +1040,13 @@ button.selected:hover { } } - #crowd { + #split { width: 180px; float: left; + + .percentage { + text-align: right; + } } } diff --git a/templates/identifications.html b/templates/identifications.html deleted file mode 100644 index 5ab63031cc..0000000000 --- a/templates/identifications.html +++ /dev/null @@ -1,80 +0,0 @@ - - - - -
- -
-
- {% set nbackers = participant.get_number_of_backers() %} -

This Week

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

Last Week

-
Gittip received $24 from
- - -
-
- -
-
-

Who does the most work?

- -

This info is private.

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

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/templates/open-group-members.html b/templates/open-group-members.html new file mode 100644 index 0000000000..5f25c736ec --- /dev/null +++ b/templates/open-group-members.html @@ -0,0 +1,92 @@ + + + + +
+ +
+
+

Where it Goes.

+ + {% if user.allowed_to_answer() %} +

This info is + public.

+ {% end %} + +

Money given to + {{ participant.username }} is split as follows, based on everyone's + answer to, “Who is {{ participant.username }}?”

+ +

We need + + + + to answer “Who is {{ participant.username }}?” + before we'll start distributing money collected for + {{ participant.username }}.

+ + + + + + +
{{ participant.username }}{{ participant.weight * 100 | currency:"" }}%
+
+ +
+

Who is {{ participant.username }}?

+ + {% if user.allowed_to_answer() %} +

Your answer is private.

+ +

Whom do you associate with + {{ participant.username }}, and how strongly?

+ + + + + + + + +
{{ participant.username }} + +
+
+
+    +
+
    +
  • + {{ participant.username }} +
  • +
+
+ {% else %} + +

Once you have successfully moved money into or out + of Gittip, you will be able to give your own answer to “Who + is {{ participant.username }}?”

+ + {% end %} +
+
+ +
diff --git a/www/%username/index.html b/www/%username/index.html index e450209b6f..6e0cb27175 100644 --- a/www/%username/index.html +++ b/www/%username/index.html @@ -67,8 +67,8 @@

Statement

{% end %} - {% if participant.type == 'open company' %} - {% include "templates/identifications.html %} + {% if participant.type == 'open group' %} + {% include "templates/open-group-members.html %} {% end %}

Funding Goal

diff --git a/www/%username/identifications.json b/www/%username/members.json similarity index 60% rename from www/%username/identifications.json rename to www/%username/members.json index d6048045e4..60dd49b060 100644 --- a/www/%username/identifications.json +++ b/www/%username/members.json @@ -7,15 +7,19 @@ from gittip.utils import get_participant # ================= ^L request.allow('GET', 'POST') -participant = get_participant(request) +if user.ANON: + raise Response(404) +participant = get_participant(request, restrict=False) if user == participant: raise Response(400) -if not participant.type == 'open company': +if not participant.type == 'open group': raise Response(400) group = participant.username if POST: + if not user.allowed_to_answer(): + raise Response(400) member = body['member'] weight = body['weight'] db.execute(""" @@ -36,20 +40,21 @@ if POST: """, (member, group, member, group, weight, user.username)) -identifications = db.fetchall(""" +if user.allowed_to_answer(): + identifications = list(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 + SELECT member AS username + , weight + FROM current_identifications + WHERE "group"=%s + AND identified_by=%s + AND weight > 0 + ORDER BY weight DESC, username -""", (group, user.username)) + """, (group, user.username))) +else: + identifications = [] -response.body = { "identifications": list(identifications) +response.body = { "identifications": identifications , "split": participant.compute_split() } diff --git a/www/assets/%version/gittip.css b/www/assets/%version/gittip.css index c65b5d8b7c..173dfdd839 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}#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%}} +@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}#open_group .fine{font:normal 10px "Helvetica Neue",Helvetica,Arial,"Liberation Sans",FreeSans,sans-serif;text-transform:uppercase}#open_group TD{padding-right:0.5em}#open_group #identifications{width:250px;float:right;position:relative}#open_group #identifications ::-webkit-input-placeholder{color:#b2a196}#open_group #identifications ::-moz-placeholder{color:#b2a196}#open_group #identifications :-ms-input-placeholder{color:#b2a196}#open_group #identifications input:-moz-placeholder{color:#b2a196}#open_group #identifications #query{width:170px;padding:2px 5px;z-index:1;position:relative;top:1px;outline:none;border:none}#open_group #identifications .weight{background:#2a8f79;display:inline-block}#open_group #identifications .weight.a{height:24px;width:24px}#open_group #identifications .weight.b{height:12px;width:12px}#open_group #identifications .weight.c{height:6px;width:6px}#open_group #identifications .weight.d{height:3px;width:3px}#open_group #identifications .weight.e{height:1px;width:1px}#open_group #identifications .weight.f{height:0.25px;width:0.25px}#open_group #identifications .weight.g{background:red;width:1px;height:1px}#open_group #identifications #lookup-container{position:relative;vertical-align:middle}#open_group #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}#open_group #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}#open_group #split{width:180px;float:left}#open_group #split .percentage{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%}} diff --git a/www/assets/%version/open_group.js b/www/assets/%version/open_group.js new file mode 100644 index 0000000000..5fd3cb51e3 --- /dev/null +++ b/www/assets/%version/open_group.js @@ -0,0 +1,100 @@ +Gittip.open_group = angular.module('Gittip.open_group', []); + +Gittip.open_group.IdentificationsCtrl = function($scope, $http) +{ + $scope.weights = [0, 1, 6, 12, 25, 50, 100]; + + function updateMembers(data) + { + $scope.identifications = data.identifications; + var split = data.split; + $scope.nanswers = split[0]; + $scope.nanswers_threshold = split[1]; + $scope.nanswers_needed = split[1] - split[0]; + $scope.split = split[2]; + } + + $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}, $scope.weights[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("members.json", data, config) + .success(updateMembers); + }; + + $http.get("members.json").success(updateMembers); + + // No good way in Angular yet: + // http://stackoverflow.com/questions/14833326/ + jQuery('#query').focus(); +}; + + +// :cry: Conditionals are a third-party thing. :/ +// http://stackoverflow.com/questions/14077471/ +// https://github.com/angular-ui/angular-ui/blob/31f82eaec5f07224b2a57607089ce8f8acffd48c/modules/directives/if/if.js + +/* + * Defines the ui-if tag. This removes/adds an element from the dom depending on a condition + * Originally created by @tigbro, for the @jquery-mobile-angular-adapter + * https://github.com/tigbro/jquery-mobile-angular-adapter + */ + +Gittip.open_group.directive('uiIf', [function () { + return { + transclude: 'element', + priority: 1000, + terminal: true, + restrict: 'A', + compile: function (element, attr, transclude) { + return function (scope, element, attr) { + + var childElement; + var childScope; + + scope.$watch(attr['uiIf'], function (newValue) { + if (childElement) { + childElement.remove(); + childElement = undefined; + } + if (childScope) { + childScope.$destroy(); + childScope = undefined; + } + + if (newValue) { + childScope = scope.$new(); + transclude(childScope, function (clone) { + childElement = clone; + element.after(clone); + }); + } + }); + }; + } + }; +}]); diff --git a/www/assets/%version/openco.js b/www/assets/%version/openco.js deleted file mode 100644 index e190e8f5c7..0000000000 --- a/www/assets/%version/openco.js +++ /dev/null @@ -1,51 +0,0 @@ -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(); -};