From c287043495466e24c8b95af0a4322d5040a9d123 Mon Sep 17 00:00:00 2001 From: Mahdi Yusuf Date: Fri, 6 Jan 2012 14:07:33 -0500 Subject: [PATCH 1/5] new repo for releases --- .epio-app | 1 + .gitignore | 4 + AUTHORS | 12 + HACKING | 9 + LICENSE.txt | 19 + README.rst | 25 + courtside/.gitignore | 2 + courtside/__init__.py | 0 courtside/fabfile.py | 10 + courtside/forms/__init__.py | 0 courtside/forms/forms.py | 129 + courtside/game/__init__.py | 0 courtside/game/admin.py | 8 + courtside/game/api.py | 61 + courtside/game/fixtures/initial_data.json | 210 + courtside/game/models.py | 28 + courtside/game/static/images/baseball.png | Bin 0 -> 453 bytes courtside/game/static/images/basketball.png | Bin 0 -> 458 bytes courtside/game/static/images/characters.png | Bin 0 -> 860 bytes courtside/game/static/images/comments.png | Bin 0 -> 355 bytes courtside/game/static/images/date.png | Bin 0 -> 397 bytes courtside/game/static/images/email.png | Bin 0 -> 416 bytes courtside/game/static/images/facebook.png | Bin 0 -> 194 bytes courtside/game/static/images/hockey.png | Bin 0 -> 316 bytes courtside/game/static/images/location.png | Bin 0 -> 392 bytes courtside/game/static/images/lock.png | Bin 0 -> 269 bytes courtside/game/static/images/logo.png | Bin 0 -> 3942 bytes courtside/game/static/images/players.png | Bin 0 -> 462 bytes courtside/game/static/images/restrictions.png | Bin 0 -> 305 bytes courtside/game/static/images/soccer.png | Bin 0 -> 487 bytes courtside/game/static/images/title.png | Bin 0 -> 295 bytes courtside/game/static/images/twitter.png | Bin 0 -> 306 bytes courtside/game/static/images/volleyball.png | Bin 0 -> 492 bytes courtside/game/static/images/x.png | Bin 0 -> 142 bytes courtside/game/static/js/gmaps.js | 76 + .../game/static/js/jquery.timePicker.min.js | 1 + .../game/static/js/libs/jquery-1.5.1.min.js | 16 + courtside/game/static/js/script.js | 26 + courtside/game/static/js/search.js | 9 + .../game/static/stylesheets/960_12_col.css | 357 + courtside/game/static/stylesheets/style.css | 300 + .../game/static/stylesheets/timePicker.css | 29 + courtside/game/tasks.py | 43 + courtside/game/tests.py | 16 + courtside/game/views.py | 139 + courtside/keys/__init__.py | 0 courtside/keys/keys.py | 25 + courtside/manage.py | 14 + courtside/production_settings.py | 3 + courtside/register/__init__.py | 0 courtside/register/admin.py | 13 + courtside/register/fixtures/register.json | 997 +++ courtside/register/models.py | 43 + courtside/register/register.json | 87 + courtside/register/tasks.py | 55 + courtside/register/tests.py | 29 + courtside/register/views.py | 400 ++ courtside/settings.py | 181 + courtside/static/admin/css/base.css | 772 ++ courtside/static/admin/css/changelists.css | 289 + courtside/static/admin/css/dashboard.css | 30 + courtside/static/admin/css/forms.css | 354 + courtside/static/admin/css/ie.css | 57 + courtside/static/admin/css/login.css | 54 + courtside/static/admin/css/rtl.css | 221 + courtside/static/admin/css/widgets.css | 514 ++ .../static/admin/img/admin/arrow-down.gif | Bin 0 -> 80 bytes courtside/static/admin/img/admin/arrow-up.gif | Bin 0 -> 838 bytes .../static/admin/img/admin/changelist-bg.gif | Bin 0 -> 58 bytes .../admin/img/admin/changelist-bg_rtl.gif | Bin 0 -> 75 bytes .../static/admin/img/admin/chooser-bg.gif | Bin 0 -> 199 bytes .../admin/img/admin/chooser_stacked-bg.gif | Bin 0 -> 212 bytes .../admin/img/admin/default-bg-reverse.gif | Bin 0 -> 843 bytes .../static/admin/img/admin/default-bg.gif | Bin 0 -> 844 bytes .../admin/img/admin/deleted-overlay.gif | Bin 0 -> 45 bytes courtside/static/admin/img/admin/icon-no.gif | Bin 0 -> 176 bytes .../static/admin/img/admin/icon-unknown.gif | Bin 0 -> 130 bytes courtside/static/admin/img/admin/icon-yes.gif | Bin 0 -> 299 bytes .../static/admin/img/admin/icon_addlink.gif | Bin 0 -> 119 bytes .../static/admin/img/admin/icon_alert.gif | Bin 0 -> 145 bytes .../static/admin/img/admin/icon_calendar.gif | Bin 0 -> 192 bytes .../admin/img/admin/icon_changelink.gif | Bin 0 -> 119 bytes .../static/admin/img/admin/icon_clock.gif | Bin 0 -> 390 bytes .../admin/img/admin/icon_deletelink.gif | Bin 0 -> 181 bytes .../static/admin/img/admin/icon_error.gif | Bin 0 -> 319 bytes .../static/admin/img/admin/icon_searchbox.png | Bin 0 -> 667 bytes .../static/admin/img/admin/icon_success.gif | Bin 0 -> 341 bytes .../admin/img/admin/inline-delete-8bit.png | Bin 0 -> 477 bytes .../static/admin/img/admin/inline-delete.png | Bin 0 -> 781 bytes .../admin/img/admin/inline-restore-8bit.png | Bin 0 -> 447 bytes .../static/admin/img/admin/inline-restore.png | Bin 0 -> 623 bytes .../admin/img/admin/inline-splitter-bg.gif | Bin 0 -> 102 bytes .../static/admin/img/admin/nav-bg-grabber.gif | Bin 0 -> 116 bytes .../static/admin/img/admin/nav-bg-reverse.gif | Bin 0 -> 186 bytes courtside/static/admin/img/admin/nav-bg.gif | Bin 0 -> 273 bytes .../static/admin/img/admin/selector-add.gif | Bin 0 -> 606 bytes .../admin/img/admin/selector-addall.gif | Bin 0 -> 358 bytes .../admin/img/admin/selector-remove.gif | Bin 0 -> 398 bytes .../admin/img/admin/selector-removeall.gif | Bin 0 -> 355 bytes .../admin/img/admin/selector-search.gif | Bin 0 -> 552 bytes .../admin/img/admin/selector_stacked-add.gif | Bin 0 -> 612 bytes .../img/admin/selector_stacked-remove.gif | Bin 0 -> 401 bytes .../static/admin/img/admin/tool-left.gif | Bin 0 -> 197 bytes .../static/admin/img/admin/tool-left_over.gif | Bin 0 -> 203 bytes .../static/admin/img/admin/tool-right.gif | Bin 0 -> 198 bytes .../admin/img/admin/tool-right_over.gif | Bin 0 -> 200 bytes .../static/admin/img/admin/tooltag-add.gif | Bin 0 -> 932 bytes .../admin/img/admin/tooltag-add_over.gif | Bin 0 -> 336 bytes .../admin/img/admin/tooltag-arrowright.gif | Bin 0 -> 351 bytes .../img/admin/tooltag-arrowright_over.gif | Bin 0 -> 354 bytes .../static/admin/img/gis/move_vertex_off.png | Bin 0 -> 711 bytes .../static/admin/img/gis/move_vertex_on.png | Bin 0 -> 506 bytes courtside/static/admin/js/LICENSE-JQUERY.txt | 20 + courtside/static/admin/js/SelectBox.js | 111 + courtside/static/admin/js/SelectFilter2.js | 130 + courtside/static/admin/js/actions.js | 139 + courtside/static/admin/js/actions.min.js | 7 + .../admin/js/admin/DateTimeShortcuts.js | 274 + .../admin/js/admin/RelatedObjectLookups.js | 96 + courtside/static/admin/js/admin/ordering.js | 137 + courtside/static/admin/js/calendar.js | 156 + courtside/static/admin/js/collapse.js | 27 + courtside/static/admin/js/collapse.min.js | 2 + courtside/static/admin/js/compress.py | 47 + courtside/static/admin/js/core.js | 221 + courtside/static/admin/js/dateparse.js | 239 + .../static/admin/js/getElementsBySelector.js | 167 + courtside/static/admin/js/inlines.js | 136 + courtside/static/admin/js/inlines.min.js | 5 + courtside/static/admin/js/jquery.init.js | 4 + courtside/static/admin/js/jquery.js | 6240 +++++++++++++++++ courtside/static/admin/js/jquery.min.js | 154 + courtside/static/admin/js/prepopulate.js | 34 + courtside/static/admin/js/prepopulate.min.js | 1 + courtside/static/admin/js/timeparse.js | 94 + courtside/static/admin/js/urlify.js | 140 + courtside/static/images/baseball.png | Bin 0 -> 453 bytes courtside/static/images/basketball.png | Bin 0 -> 458 bytes courtside/static/images/characters.png | Bin 0 -> 860 bytes courtside/static/images/comments.png | Bin 0 -> 355 bytes courtside/static/images/date.png | Bin 0 -> 397 bytes courtside/static/images/email.png | Bin 0 -> 416 bytes courtside/static/images/facebook.png | Bin 0 -> 194 bytes courtside/static/images/hockey.png | Bin 0 -> 316 bytes courtside/static/images/location.png | Bin 0 -> 392 bytes courtside/static/images/lock.png | Bin 0 -> 269 bytes courtside/static/images/logo.png | Bin 0 -> 3942 bytes courtside/static/images/players.png | Bin 0 -> 462 bytes courtside/static/images/restrictions.png | Bin 0 -> 305 bytes courtside/static/images/soccer.png | Bin 0 -> 487 bytes courtside/static/images/title.png | Bin 0 -> 295 bytes courtside/static/images/twitter.png | Bin 0 -> 306 bytes courtside/static/images/volleyball.png | Bin 0 -> 492 bytes courtside/static/images/x.png | Bin 0 -> 142 bytes courtside/static/js/gmaps.js | 76 + courtside/static/js/jquery.timePicker.min.js | 1 + courtside/static/js/libs/jquery-1.5.1.min.js | 16 + courtside/static/js/script.js | 26 + courtside/static/js/search.js | 9 + courtside/static/stylesheets/960_12_col.css | 357 + courtside/static/stylesheets/style.css | 300 + courtside/static/stylesheets/timePicker.css | 29 + courtside/templates/404.html | 16 + courtside/templates/500.html | 16 + courtside/templates/about.html | 47 + courtside/templates/base.html | 106 + courtside/templates/base_map.html | 225 + courtside/templates/create.html | 93 + courtside/templates/email_signup.html | 17 + courtside/templates/facebook_error.html | 21 + courtside/templates/game.html | 182 + courtside/templates/game_email.html | 20 + courtside/templates/index.html | 119 + courtside/templates/login.html | 35 + courtside/templates/new_register.html | 23 + courtside/templates/profile.html | 103 + courtside/templates/profile_edit.html | 32 + courtside/templates/register.html | 23 + courtside/templates/search.html | 260 + courtside/urls.py | 64 + epio.ini | 46 + requirements.txt | 25 + 182 files changed, 16536 insertions(+) create mode 100644 .epio-app create mode 100644 .gitignore create mode 100644 AUTHORS create mode 100644 HACKING create mode 100644 LICENSE.txt create mode 100644 README.rst create mode 100644 courtside/.gitignore create mode 100644 courtside/__init__.py create mode 100644 courtside/fabfile.py create mode 100644 courtside/forms/__init__.py create mode 100644 courtside/forms/forms.py create mode 100644 courtside/game/__init__.py create mode 100644 courtside/game/admin.py create mode 100644 courtside/game/api.py create mode 100644 courtside/game/fixtures/initial_data.json create mode 100644 courtside/game/models.py create mode 100644 courtside/game/static/images/baseball.png create mode 100644 courtside/game/static/images/basketball.png create mode 100644 courtside/game/static/images/characters.png create mode 100644 courtside/game/static/images/comments.png create mode 100644 courtside/game/static/images/date.png create mode 100644 courtside/game/static/images/email.png create mode 100644 courtside/game/static/images/facebook.png create mode 100644 courtside/game/static/images/hockey.png create mode 100644 courtside/game/static/images/location.png create mode 100644 courtside/game/static/images/lock.png create mode 100644 courtside/game/static/images/logo.png create mode 100644 courtside/game/static/images/players.png create mode 100644 courtside/game/static/images/restrictions.png create mode 100644 courtside/game/static/images/soccer.png create mode 100644 courtside/game/static/images/title.png create mode 100644 courtside/game/static/images/twitter.png create mode 100644 courtside/game/static/images/volleyball.png create mode 100644 courtside/game/static/images/x.png create mode 100644 courtside/game/static/js/gmaps.js create mode 100755 courtside/game/static/js/jquery.timePicker.min.js create mode 100644 courtside/game/static/js/libs/jquery-1.5.1.min.js create mode 100644 courtside/game/static/js/script.js create mode 100644 courtside/game/static/js/search.js create mode 100644 courtside/game/static/stylesheets/960_12_col.css create mode 100644 courtside/game/static/stylesheets/style.css create mode 100755 courtside/game/static/stylesheets/timePicker.css create mode 100644 courtside/game/tasks.py create mode 100644 courtside/game/tests.py create mode 100644 courtside/game/views.py create mode 100644 courtside/keys/__init__.py create mode 100644 courtside/keys/keys.py create mode 100755 courtside/manage.py create mode 100644 courtside/production_settings.py create mode 100644 courtside/register/__init__.py create mode 100644 courtside/register/admin.py create mode 100644 courtside/register/fixtures/register.json create mode 100644 courtside/register/models.py create mode 100644 courtside/register/register.json create mode 100644 courtside/register/tasks.py create mode 100644 courtside/register/tests.py create mode 100644 courtside/register/views.py create mode 100644 courtside/settings.py create mode 100644 courtside/static/admin/css/base.css create mode 100644 courtside/static/admin/css/changelists.css create mode 100644 courtside/static/admin/css/dashboard.css create mode 100644 courtside/static/admin/css/forms.css create mode 100644 courtside/static/admin/css/ie.css create mode 100644 courtside/static/admin/css/login.css create mode 100644 courtside/static/admin/css/rtl.css create mode 100644 courtside/static/admin/css/widgets.css create mode 100644 courtside/static/admin/img/admin/arrow-down.gif create mode 100644 courtside/static/admin/img/admin/arrow-up.gif create mode 100644 courtside/static/admin/img/admin/changelist-bg.gif create mode 100644 courtside/static/admin/img/admin/changelist-bg_rtl.gif create mode 100644 courtside/static/admin/img/admin/chooser-bg.gif create mode 100644 courtside/static/admin/img/admin/chooser_stacked-bg.gif create mode 100644 courtside/static/admin/img/admin/default-bg-reverse.gif create mode 100644 courtside/static/admin/img/admin/default-bg.gif create mode 100644 courtside/static/admin/img/admin/deleted-overlay.gif create mode 100644 courtside/static/admin/img/admin/icon-no.gif create mode 100644 courtside/static/admin/img/admin/icon-unknown.gif create mode 100644 courtside/static/admin/img/admin/icon-yes.gif create mode 100644 courtside/static/admin/img/admin/icon_addlink.gif create mode 100644 courtside/static/admin/img/admin/icon_alert.gif create mode 100644 courtside/static/admin/img/admin/icon_calendar.gif create mode 100644 courtside/static/admin/img/admin/icon_changelink.gif create mode 100644 courtside/static/admin/img/admin/icon_clock.gif create mode 100644 courtside/static/admin/img/admin/icon_deletelink.gif create mode 100644 courtside/static/admin/img/admin/icon_error.gif create mode 100644 courtside/static/admin/img/admin/icon_searchbox.png create mode 100644 courtside/static/admin/img/admin/icon_success.gif create mode 100644 courtside/static/admin/img/admin/inline-delete-8bit.png create mode 100644 courtside/static/admin/img/admin/inline-delete.png create mode 100644 courtside/static/admin/img/admin/inline-restore-8bit.png create mode 100644 courtside/static/admin/img/admin/inline-restore.png create mode 100644 courtside/static/admin/img/admin/inline-splitter-bg.gif create mode 100644 courtside/static/admin/img/admin/nav-bg-grabber.gif create mode 100644 courtside/static/admin/img/admin/nav-bg-reverse.gif create mode 100644 courtside/static/admin/img/admin/nav-bg.gif create mode 100644 courtside/static/admin/img/admin/selector-add.gif create mode 100644 courtside/static/admin/img/admin/selector-addall.gif create mode 100644 courtside/static/admin/img/admin/selector-remove.gif create mode 100644 courtside/static/admin/img/admin/selector-removeall.gif create mode 100644 courtside/static/admin/img/admin/selector-search.gif create mode 100644 courtside/static/admin/img/admin/selector_stacked-add.gif create mode 100644 courtside/static/admin/img/admin/selector_stacked-remove.gif create mode 100644 courtside/static/admin/img/admin/tool-left.gif create mode 100644 courtside/static/admin/img/admin/tool-left_over.gif create mode 100644 courtside/static/admin/img/admin/tool-right.gif create mode 100644 courtside/static/admin/img/admin/tool-right_over.gif create mode 100644 courtside/static/admin/img/admin/tooltag-add.gif create mode 100644 courtside/static/admin/img/admin/tooltag-add_over.gif create mode 100644 courtside/static/admin/img/admin/tooltag-arrowright.gif create mode 100644 courtside/static/admin/img/admin/tooltag-arrowright_over.gif create mode 100644 courtside/static/admin/img/gis/move_vertex_off.png create mode 100644 courtside/static/admin/img/gis/move_vertex_on.png create mode 100644 courtside/static/admin/js/LICENSE-JQUERY.txt create mode 100644 courtside/static/admin/js/SelectBox.js create mode 100644 courtside/static/admin/js/SelectFilter2.js create mode 100644 courtside/static/admin/js/actions.js create mode 100644 courtside/static/admin/js/actions.min.js create mode 100644 courtside/static/admin/js/admin/DateTimeShortcuts.js create mode 100644 courtside/static/admin/js/admin/RelatedObjectLookups.js create mode 100644 courtside/static/admin/js/admin/ordering.js create mode 100644 courtside/static/admin/js/calendar.js create mode 100644 courtside/static/admin/js/collapse.js create mode 100644 courtside/static/admin/js/collapse.min.js create mode 100644 courtside/static/admin/js/compress.py create mode 100644 courtside/static/admin/js/core.js create mode 100644 courtside/static/admin/js/dateparse.js create mode 100644 courtside/static/admin/js/getElementsBySelector.js create mode 100644 courtside/static/admin/js/inlines.js create mode 100644 courtside/static/admin/js/inlines.min.js create mode 100644 courtside/static/admin/js/jquery.init.js create mode 100644 courtside/static/admin/js/jquery.js create mode 100644 courtside/static/admin/js/jquery.min.js create mode 100644 courtside/static/admin/js/prepopulate.js create mode 100644 courtside/static/admin/js/prepopulate.min.js create mode 100644 courtside/static/admin/js/timeparse.js create mode 100644 courtside/static/admin/js/urlify.js create mode 100644 courtside/static/images/baseball.png create mode 100644 courtside/static/images/basketball.png create mode 100644 courtside/static/images/characters.png create mode 100644 courtside/static/images/comments.png create mode 100644 courtside/static/images/date.png create mode 100644 courtside/static/images/email.png create mode 100644 courtside/static/images/facebook.png create mode 100644 courtside/static/images/hockey.png create mode 100644 courtside/static/images/location.png create mode 100644 courtside/static/images/lock.png create mode 100644 courtside/static/images/logo.png create mode 100644 courtside/static/images/players.png create mode 100644 courtside/static/images/restrictions.png create mode 100644 courtside/static/images/soccer.png create mode 100644 courtside/static/images/title.png create mode 100644 courtside/static/images/twitter.png create mode 100644 courtside/static/images/volleyball.png create mode 100644 courtside/static/images/x.png create mode 100644 courtside/static/js/gmaps.js create mode 100755 courtside/static/js/jquery.timePicker.min.js create mode 100644 courtside/static/js/libs/jquery-1.5.1.min.js create mode 100644 courtside/static/js/script.js create mode 100644 courtside/static/js/search.js create mode 100644 courtside/static/stylesheets/960_12_col.css create mode 100644 courtside/static/stylesheets/style.css create mode 100755 courtside/static/stylesheets/timePicker.css create mode 100644 courtside/templates/404.html create mode 100644 courtside/templates/500.html create mode 100644 courtside/templates/about.html create mode 100644 courtside/templates/base.html create mode 100644 courtside/templates/base_map.html create mode 100644 courtside/templates/create.html create mode 100644 courtside/templates/email_signup.html create mode 100644 courtside/templates/facebook_error.html create mode 100644 courtside/templates/game.html create mode 100644 courtside/templates/game_email.html create mode 100644 courtside/templates/index.html create mode 100644 courtside/templates/login.html create mode 100644 courtside/templates/new_register.html create mode 100644 courtside/templates/profile.html create mode 100644 courtside/templates/profile_edit.html create mode 100644 courtside/templates/register.html create mode 100644 courtside/templates/search.html create mode 100644 courtside/urls.py create mode 100644 epio.ini create mode 100644 requirements.txt diff --git a/.epio-app b/.epio-app new file mode 100644 index 0000000..975edca --- /dev/null +++ b/.epio-app @@ -0,0 +1 @@ +tini diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..73d1be9 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +*.pyc +*.db +.DS_Store + diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 0000000..964ad05 --- /dev/null +++ b/AUTHORS @@ -0,0 +1,12 @@ +Courtside Me is written and designed by Coding in the Deep and +various contributors: + +Development Leads +````````````````` +- Serena Ngai - - http://twitter.com/serenangai +- Mahdi Yusuf - http://www.mahdiyusuf.com +- Omar Shammas - http://www.omarshammas.com + +Contributors +```````````` +Denis Zgonjanin - thanks for the coding environment! :D \ No newline at end of file diff --git a/HACKING b/HACKING new file mode 100644 index 0000000..376db7e --- /dev/null +++ b/HACKING @@ -0,0 +1,9 @@ +I probably don't do this anywhere, but this is where I would like it to go. :) + +- Document +- Strive for simplicity +- WIN + +Lastly, don't take yourself too seriously :) + +All this has not been applied during the development during the dash. diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000..fa00c51 --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,19 @@ +Copyright (C) 2011 by Coding in the Deep, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. \ No newline at end of file diff --git a/README.rst b/README.rst new file mode 100644 index 0000000..fd71125 --- /dev/null +++ b/README.rst @@ -0,0 +1,25 @@ +================================================== +Courtside: pick up sports app. +================================================== + +Make games plans and let all your friends know about it. + +============ +Installation +============ + +.. image:: http://i.imgur.com/Igf1i.png + +- To install requirements:: + + $ pip install -r requirements + +- You will need to create a keys file in the register app for the twitter and fb app keys + +.. image:: https://s3.amazonaws.com/screenshots.angel.co/ee/29287/ad7528fee77bb37dcbb4bea439dc5bae-original.png + +============= +Contributions +============= + +All software contributions are welcome and encouraged. \ No newline at end of file diff --git a/courtside/.gitignore b/courtside/.gitignore new file mode 100644 index 0000000..085c4fe --- /dev/null +++ b/courtside/.gitignore @@ -0,0 +1,2 @@ +*.pyc +*.db diff --git a/courtside/__init__.py b/courtside/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/courtside/fabfile.py b/courtside/fabfile.py new file mode 100644 index 0000000..e283d90 --- /dev/null +++ b/courtside/fabfile.py @@ -0,0 +1,10 @@ +from __future__ import with_statement +from fabric.api import local, settings, abort +from fabric.contrib.console import confirm + +def test(): + with settings(warn_only=True): + result = local("./manage.py test game", capture=True) + if result.failed and not confirm("Tests failed. Continue anyway?"): + abort("Abortin at user request.") + local("./manage.py test register") \ No newline at end of file diff --git a/courtside/forms/__init__.py b/courtside/forms/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/courtside/forms/forms.py b/courtside/forms/forms.py new file mode 100644 index 0000000..551b9be --- /dev/null +++ b/courtside/forms/forms.py @@ -0,0 +1,129 @@ +from django import forms +from django.contrib.localflavor.us.forms import USPhoneNumberField +from django.contrib.auth.models import User +from django.contrib.auth.models import AnonymousUser +from django.contrib.auth import authenticate, login, logout + +from register.models import Sport +from register.models import GENDER_CHOICES + +class PlayerForm(forms.Form): + username = forms.CharField(widget=forms.TextInput(attrs={'class':'input_text'}),max_length=50) + first_name = forms.CharField(widget=forms.TextInput(attrs={'class':'input_text'}),max_length=50) + last_name = forms.CharField(widget=forms.TextInput(attrs={'class':'input_text'}),max_length=50) + email = forms.EmailField() + sports = forms.ModelMultipleChoiceField(queryset=Sport.objects.all(), + widget=forms.CheckboxSelectMultiple(attrs={'class':'input_text'}), + label='Sports') + gender = forms.ChoiceField(choices=GENDER_CHOICES, + widget=forms.Select, + label='Gender', help_text='optional', required=False) + phone_number = USPhoneNumberField(help_text='optional', required=False) + + def clean_email(self): + email = self.cleaned_data['email'] + user = User.objects.filter(email=email) + if len(user) > 0: + raise forms.ValidationError('Email has been activated') + return self.cleaned_data['email'] + def clean_username(self): + username=self.cleaned_data['username'] + user = User.objects.filter(username=username) + if len(user) > 0: + raise forms.ValidationError('username has been already taken') + return self.cleaned_data['username'] + +class NewPlayerForm(forms.Form): + username = forms.CharField(widget=forms.TextInput(attrs={'class':'input_text'}),max_length=50) + first_name = forms.CharField(widget=forms.TextInput(attrs={'class':'input_text'}),max_length=50) + last_name = forms.CharField(widget=forms.TextInput(attrs={'class':'input_text'}),max_length=50) + password1 = forms.CharField(widget=forms.PasswordInput(attrs={'class':'input_text'}), label='Password') + password2 = forms.CharField(widget=forms.PasswordInput(attrs={'class':'input_text'}), label='Re-type Password') + email = forms.EmailField(widget=forms.TextInput(attrs={'class':'input_text'})) + sports = forms.ModelMultipleChoiceField(queryset=Sport.objects.all(), + widget=forms.CheckboxSelectMultiple(attrs={'class':'input_text'}), + label='Sports') + gender = forms.ChoiceField(choices=GENDER_CHOICES, + widget=forms.Select(attrs={'class':'input_text'}), + label='Gender', help_text='optional', required=False) + phone_number = USPhoneNumberField(widget=forms.TextInput(attrs={'class':'input_text'}),help_text='optional', required=False) + + def clean_password2(self): + if self.cleaned_data['password2'] != self.cleaned_data['password1']: + raise forms.ValidationError('passwords do not match!') + return self.cleaned_data['password2'] + + def clean_email(self): + email = self.cleaned_data['email'] + user = User.objects.filter(email=email) + if len(user) > 0: + raise forms.ValidationError('Email has been activated') + return self.cleaned_data['email'] + def clean_username(self): + username=self.cleaned_data['username'] + user = User.objects.filter(username=username) + if len(user) > 0: + raise forms.ValidationError('username has been already taken') + return self.cleaned_data['username'] + + + +class GameForm(forms.Form): + sport = forms.ModelChoiceField(queryset=Sport.objects.all(), widget=forms.Select, label='Sports') + start_date = forms.DateField() + start_time = forms.TimeField() + address = forms.CharField(max_length=50) + minimum_players = forms.IntegerField() + restrictions = forms.CharField(max_length=200, help_text='eg., 3 on 3, Women Only', required=False) + +class ProfileForm(forms.Form): + first_name = forms.CharField(widget=forms.TextInput(attrs={'class':'input_text'}),max_length=50) + last_name = forms.CharField(widget=forms.TextInput(attrs={'class':'input_text'}),max_length=50) + email = forms.EmailField() + sports = forms.ModelMultipleChoiceField(queryset=Sport.objects.all(), + widget=forms.CheckboxSelectMultiple, + label='Sports') + gender = forms.ChoiceField(choices=GENDER_CHOICES, + widget=forms.Select, + label='Gender', help_text='optional', required=False) + phone_number = USPhoneNumberField(help_text='optional', required=False) + + def clean_password2(self): + if self.cleaned_data['password2'] != self.cleaned_data['password1']: + raise forms.ValidationError('passwords do not match!') + return self.cleaned_data['password2'] + + def clean_email(self): + email = self.cleaned_data['email'] + user = User.objects.filter(email=email) + if len(user) > 1: + raise forms.ValidationError('Email has been activated') + return self.cleaned_data['email'] + +class PasswordForm(forms.Form): + password1 = forms.CharField(widget=forms.PasswordInput(attrs={'class':'input_text'}), label='Password') + password2 = forms.CharField(widget=forms.PasswordInput(attrs={'class':'input_text'}), label='Re-type Password') + + def clean_password2(self): + if self.cleaned_data['password2'] != self.cleaned_data['password1']: + raise forms.ValidationError('passwords do not match!') + return self.cleaned_data['password2'] + +class LoginForm(forms.Form): + email= forms.EmailField(widget=forms.TextInput(attrs={'class':'input_text', 'placeholder':'Your Email'}),label='Email') + password = forms.CharField(widget=forms.PasswordInput(attrs={'class':'input_text', 'placeholder':'Password'}), label='Password') + + def clean_password(self): + try: + email = self.cleaned_data['email'] + except: + raise forms.ValidationError('Invalid username password combo!') + password = self.cleaned_data['password'] + try: + user = User.objects.get(email=email) + except: + raise forms.ValidationError('Invalid username password combo!') + user = authenticate(username=user.username, password=password) + if user is None: + raise forms.ValidationError('Invalid username password combo!') + return self.cleaned_data['password'] diff --git a/courtside/game/__init__.py b/courtside/game/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/courtside/game/admin.py b/courtside/game/admin.py new file mode 100644 index 0000000..1f04a0d --- /dev/null +++ b/courtside/game/admin.py @@ -0,0 +1,8 @@ +from django.contrib import admin +from game.models import Game + + +class GameAdmin(admin.ModelAdmin): + pass + +admin.site.register(Game, GameAdmin) \ No newline at end of file diff --git a/courtside/game/api.py b/courtside/game/api.py new file mode 100644 index 0000000..e681ba2 --- /dev/null +++ b/courtside/game/api.py @@ -0,0 +1,61 @@ +from django.contrib.auth.models import User +from tastypie.resources import ModelResource,ALL, ALL_WITH_RELATIONS +from tastypie import fields + +from game.models import Game +from register.models import Sport, Player + +class SportResource(ModelResource): + class Meta: + queryset = Sport.objects.all() + resource_name = 'sport' + allowed_methods = ['get'] + include_resource_uri = False + excludes = ['id'] + filtering = { + 'sport': ('exact') + } + +class UserResource(ModelResource): + class Meta: + queryset = User.objects.all() + resource_name = 'user' + excludes = ['password', 'is_active', 'is_staff', 'is_superuser', 'id'] + allowed_methods = ['get'] + include_resource_uri = False + allowed_methods = ['get'] + filtering = { + 'username': ALL, + 'email': ALL + } + +class PlayerResource(ModelResource): + user = fields.ForeignKey(UserResource, 'user', full=True) + sports = fields.ManyToManyField(SportResource, 'sports', full=True) + class Meta: + include_resource_uri = False + queryset = Player.objects.all() + resource_name = 'player' + fields = ['sports', 'image_url', 'gender', 'user'] + allowed_methods = ['get'] + filtering = { + 'user': ALL_WITH_RELATIONS, + 'gender' : ALL, + 'sports' : ALL_WITH_RELATIONS, + } + +class GameResource(ModelResource): + sport = fields.ForeignKey(SportResource, 'sport', full=True) + owner = fields.ForeignKey(UserResource, 'owner', full=True) + players = fields.ManyToManyField(PlayerResource, 'players', full=True) + class Meta: + resource_name = 'game' + queryset = Game.objects.all() + include_resource_uri = False + allowed_methods = ['get'] + filtering = { + 'game': ALL_WITH_RELATIONS, + 'owner': ALL_WITH_RELATIONS, + 'players' : ALL_WITH_RELATIONS, + 'sport' : ALL_WITH_RELATIONS, + } diff --git a/courtside/game/fixtures/initial_data.json b/courtside/game/fixtures/initial_data.json new file mode 100644 index 0000000..86d62ae --- /dev/null +++ b/courtside/game/fixtures/initial_data.json @@ -0,0 +1,210 @@ +[ + { + "model" : "auth.User", + "pk": 2, + "fields": { + "username" : "iammale", + "first_name" : "I am", + "last_name" : "Male", + "email" : "iammale@gmail.com", + "password" : "test" + } + }, + { + "model" : "register.Player", + "pk": 2, + "fields": { + "user" : 2, + "gender" : "M", + "facebook_id" : "54645", + "image_url" : "http://www.gravatar.com/avatar/240f00368979a3327c854f560001c42e?s=250", + "sports" : [1, 2, 5] + } + }, + + { + "model" : "auth.User", + "pk": 3, + "fields": { + "username" : "iamfemale", + "first_name" : "I am", + "last_name" : "Female", + "email" : "iamfemale@gmail.com", + "password" : "test" + } + }, + { + "model" : "register.Player", + "pk": 3, + "fields": { + "user" : 3, + "gender" : "F", + "facebook_id" : "65465456", + "image_url" : "http://www.gravatar.com/avatar/240f00368979a3327c854f560001c42e?s=250", + "sports" : [3, 4, 5] + } + }, + + { + "model" : "auth.User", + "pk": 4, + "fields": { + "username" : "nogender", + "first_name" : "Qinta", + "last_name" : "Shanana", + "email" : "qinta@gmail.com", + "password" : "test" + } + }, + { + "model" : "register.Player", + "pk": 4, + "fields": { + "user" : 4, + "gender" : "Q", + "facebook_id" : "654354", + "image_url" : "http://www.gravatar.com/avatar/240f00368979a3327c854f560001c42e?s=250", + "sports" : [1, 4] + } + }, + + { + "model" : "game.Game", + "pk": 1, + "fields": { + "players" : [], + "sport" : 1, + "owner" : 2, + "address" : "1840 Lorraine Ave.", + "latitude" : "45.3811878", + "longitude" : "-75.6417002", + "start_date_and_time" : "2011-08-07 17:30:00", + "minimum_players" : 4, + "restrictions" : "", + "active" : "False" + } + }, + + { + "model" : "game.Game", + "pk": 2, + "fields": { + "players" : [2], + "sport" : 2, + "owner" : 3, + "address" : "Carleton University", + "latitude" : "45.3835317", + "longitude" : "-75.6975174", + "start_date_and_time" : "2011-08-08 17:30:00", + "minimum_players" : 10, + "restrictions" : "3 on 3", + "active" : "False" + } + }, + + { + "model" : "game.Game", + "pk": 3, + "fields": { + "players" : [2, 3], + "sport" : 2, + "owner" : 4, + "address" : "Riverside Dr.", + "latitude" : "45.3767126", + "longitude" : "-75.6818349", + "start_date_and_time" : "2011-08-09 16:30:00", + "minimum_players" : 7, + "restrictions" : "Womens Only", + "active" : "False" + } + }, + + { + "model" : "game.Game", + "pk": 4, + "fields": { + "players" : [2], + "sport" : 3, + "owner" : 4, + "address" : "Dup Riverside Dr.", + "latitude" : "45.3777126", + "longitude" : "-75.682", + "start_date_and_time" : "2011-08-10 16:30:00", + "minimum_players" : 10, + "restrictions" : "", + "active" : "False" + } + }, + + { + "model" : "game.Game", + "pk": 5, + "fields": { + "players" : [4], + "sport" : 4, + "owner" : 2, + "address" : "Dup Carleton University", + "latitude" : "45.3845317", + "longitude" : "-75.6775174", + "start_date_and_time" : "2011-08-11 17:30:00", + "minimum_players" : 2, + "restrictions" : "", + "active" : "False" + } + }, + + { + "model" : "game.Game", + "pk": 6, + "fields": { + "players" : [2, 4], + "sport" : 5, + "owner" : 3, + "address" : "Dup 1840 Lorraine Ave.", + "latitude" : "45.3841878", + "longitude" : "-75.6416002", + "start_date_and_time" : "2011-08-12 17:30:00", + "minimum_players" : 4, + "restrictions" : "", + "active" : "False" + }, + + + "model" : "register.Sport", + "pk": 1, + "fields": { + "sport" : "basketball" + } + }, + { + "model" : "register.Sport", + "pk": 2, + "fields": { + "sport" : "hockey" + } + }, + { + "model" : "register.Sport", + "pk": 3, + "fields": { + "sport" : "baseball" + } + }, + { + "model" : "register.Sport", + "pk": 4, + "fields": { + "sport" : "volleyball" + } + }, + { + "model" : "register.Sport", + "pk": 5, + "fields": { + "sport" : "soccer" + } + } + + + +] \ No newline at end of file diff --git a/courtside/game/models.py b/courtside/game/models.py new file mode 100644 index 0000000..7960df6 --- /dev/null +++ b/courtside/game/models.py @@ -0,0 +1,28 @@ +from datetime import datetime + +from django.db import models +from django.contrib.auth.models import User + +from register.models import Player, Sport + +class Game(models.Model): + """ This class represents the Game model. + """ + + players = models.ManyToManyField(Player) + owner = models.ForeignKey(User) + sport = models.ForeignKey(Sport) + start_date_and_time = models.DateTimeField() + latitude = models.DecimalField(max_digits=9, decimal_places=6) + longitude = models.DecimalField(max_digits=9, decimal_places=6) + address = models.CharField(max_length=50) + minimum_players = models.IntegerField() + restrictions = models.CharField(max_length=200, blank=True) + active = models.NullBooleanField() + + def __unicode__(self): + return "%s - %s at %s" % (self.sport.sport, self.start_date_and_time, self.address) + + class Meta: + verbose_name_plural = "Games" + \ No newline at end of file diff --git a/courtside/game/static/images/baseball.png b/courtside/game/static/images/baseball.png new file mode 100644 index 0000000000000000000000000000000000000000..1b43204e18d2997476403a75ccfb405824022e87 GIT binary patch literal 453 zcmeAS@N?(olHy`uVBq!ia0vp^(m*W5!3-n|!>%6!Qj#UE5hcO-X(i=}MX3yqDfvmM z3ZA)%>8U}fi7AzZCsS>Jii`t%LR^8g5{cmL`>m!xZ2~1he!&a^3I+}V2?Y)P^Vjb` zfB(I*R8toN10#>8i(`m{WbQ%EqQ?#bEE`|#JU{Qx|7_orOPqHrI#fN`rnlMc@9|p? zH*U65Z4aHCveH`T@_Z)kSAlbcOSJ>O9#m6*rF$sqm%#JH*>Psf`MNK3Z{++~_A= zNQK_lnIz?TzXU{>OpqG=zIcvxoqrdZ+?VbeV7eWP|ev@9!IAABOVeQeY zw{la``!&M0UrcV7o!aC)A;s@-_~~WSC9WS)ch;9Q6Z^t(a&B_f>p5%uWhdn^?|LaH zCh~V>LDi+BpBVao39yOBvs;|~vOeHCV~yD5x9o>r^D$j8DJTbq8H1;*pUXO@geCwu CIIna7 literal 0 HcmV?d00001 diff --git a/courtside/game/static/images/basketball.png b/courtside/game/static/images/basketball.png new file mode 100644 index 0000000000000000000000000000000000000000..662a22fc27e49961336b98f033a0d9b3893d7c09 GIT binary patch literal 458 zcmeAS@N?(olHy`uVBq!ia0vp^(m*W5!3-n|!>%6!Qj#UE5hcO-X(i=}MX3yqDfvmM z3ZA)%>8U}fi7AzZCsS>Jii`t%LR^8g5{cmL`>m!xZ2~1he!&a^3I+}V2?Y)P^Vjb` zfB(I*R8toN1EZj)i(`mJaO|YWrXva*E~;5Eiz2?;zuj=7Y}sq&jTIga!iU^9+Bk<4 z{|KG;qeFWyCokt#7v-gkPJeMNY|M}4;dNX1oqJ)+VW%UFCKrt#C7S%^{k|~iRI=PM z?{3dqmt;2aYb{>NnG?#rYuS{IGj*M|^rg`*z;(OSU(?`Bt}Q!`U6Zf@Q1tGS2QxOW5zgZGLl& zY02(QY3>u(+-Y4ZTzK=%Cac5w%N|cGoMFcO_oCmK*NM}2ywR?6_tyEAKe^%Rp~Oex zce3RV?AZ5P>Q7e8#G`4OZr=XsylsUSOZH3Qzg+)azaQ>$w|v6i$d literal 0 HcmV?d00001 diff --git a/courtside/game/static/images/characters.png b/courtside/game/static/images/characters.png new file mode 100644 index 0000000000000000000000000000000000000000..a382ab2d5d824ceda18fcefde0d670136a456b6b GIT binary patch literal 860 zcmeAS@N?(olHy`uVBq!ia0vp^jzFx;!3-q-h)!1nQj#UE5hcO-X(i=}MX3yqDfvmM z3ZA)%>8U}fi7AzZCsS>Jii`t%LR^8g5{cmL`>m!xZ2~1he!&a^3I+}V2?Y)P^Vjb` zfB(I*R8toN1Jhzp7sn6@$*Bh;lU`XcFdV#=6*+CqzWRybXGMR)reF%QeO80ja)bM#77 z5>^NoJ#ND0CCdxD3aEWCs`}!nkPRy)Zjj?C%q}+};P`7PPG}EDt6E7U* z?V8SDayBN(4=B4M^OCW<8p|&i2EUY0~Av=aahwrYjePZ~e6Fb!4T+>4WVi zvDHkE)=lN#y{j**C^Ik literal 0 HcmV?d00001 diff --git a/courtside/game/static/images/comments.png b/courtside/game/static/images/comments.png new file mode 100644 index 0000000000000000000000000000000000000000..1f715418bbec4c0efa592abbf47fd8ec4fd0d4ca GIT binary patch literal 355 zcmV-p0i6DcP)uSRVMn39ssemgI!d9(bd7NL=n8H!oNG^29tP<_eugjCEPY~0z3hG zgJK@`wGz$p0w6OePH?Yl?P&_P0x*qoK^WGE*{2RLgJKsu(TG>yl+nmeHtn_RX3D5% z>-r~ZoApoBBU)RP(ZEiY-{`K4CUy?_1UF@sP$ws9DkMIeq=cSrwDNCo<3)g{QA;H; z$rVqTL%^AGlcX1^@s6D=Y3@00040Nklgh2>|LGY5v*;&ywlBH=6-@_8ym!9*pMMS>r z`yMNI!-jcIiy3mFo$oKTES zpaGAHu)e4*@xpIuxmqJxfnsej#ShZFvq8oWh`_E&>8lb}d?qjzL9J*5vfXwL0k*C4 zc+l3~P$YN+fNA^+0oas&AdtE}5P)al2Lhq@!3w0m3+QixM}S*|F-~*{@Fx4=O?GZm z;Mt~*g9e-j4c9BbDme420@puT0YtpTnFB0P_;n2?*R_lbyIRHRdvK70uO9^vkb6%Y rPv$mkl#>a>i+>2~#J{y7BKHN2hhyANxSuUFACmxXUxIr04raR+ z3w`0G8TJbMc9!s&nXy8-`6EF5>nEU^S9(DE?`g-Y~J%37to-t>Vs+aS zVE;r44V5Dyh!Ii7$1r~B_Ieh@jb9g4X{>u`M03Z!_5GZ&g5eMS@T`9Nww=EK0000< KMNUMnLSTZzA+h8D literal 0 HcmV?d00001 diff --git a/courtside/game/static/images/facebook.png b/courtside/game/static/images/facebook.png new file mode 100644 index 0000000000000000000000000000000000000000..70c449bb01f48cc86fcc9c27238809c54ddb9eab GIT binary patch literal 194 zcmeAS@N?(olHy`uVBq!ia0vp^f^GxDs4dOTr^E=IAo6ea3ab9>3(;QaFf?mSlxp`L9qS zn-K0CM{=th(Sa??P{^%^s#0xF$pZ O0000DSr z1<%~X^wgl##FWaylc_d9MaBU>A+A8$g+yR?VWA;Vn?OmBUoeA!f`LOoLP10S{Pp|K z-+!+x)zk%)JMZb@7$PCbda$vvML~dN!NfQt$xpN;D+a<&oK<^=GMHQ zqkWQP%jCbzrjyyPoD61o`=m`>KkLlR3w~DNejlx??b1c-BhUC$vAw$aqbM?S4d*NA zJCc4An4X=EU&g}t#r6Cb)}0N%AL?KBdR*%`_uS<9GiSfP<9eHaUrdzUmeOnIdgt}d zmEUrYJB-aujG@Z!;B>|Vr&w&4GyMC+cyCX`>m|&uQW&hw8{++%t>YOBo@=}LF*i(& r)sgTe~DWM4fM!b@` literal 0 HcmV?d00001 diff --git a/courtside/game/static/images/lock.png b/courtside/game/static/images/lock.png new file mode 100644 index 0000000000000000000000000000000000000000..dfde8cd1218df2b121fe68518eb63539451e7203 GIT binary patch literal 269 zcmV+o0rLKdP)7=KntWLAt7PV)p=@6LPDDGk84ts|C=UU zeqaABF0>XDZQ^c^_Jw<)NYs(;b|^kwSNJQGF$#|K^Xx;Z{8K4|^-Z<@9TUa*{~!Mc z2VkiZ2LJ4HKpPvFkdRVQGcqx=aB}hS3kZse-Itb;m3yT8L__nbmYzP?$ix(4W^HSS zMA^S`bo20j?cW(|!GQA!@SPdJt$^r?H&DI9b|k~P<9Tc`KQQ0; z&Q5$Ug!|El`8kK7@b^`fQE_%vKXqVz#p)}w%`B&NdfuKxy&=*~rXeZ%k@;5QgTg+o zojfPmDO8>wEPf1)d-F_RbcG+M&YT&^e#9k3aWuAA#uvtDWsBg~Q*-YwluKAYqmp^p z1#a%EJezjz`%BeyvzXRA3!9jOEuxtLNSIN+dac8swQ!i>HA;5cGQ8eQ;UvOu-ES#gQKtmH)|{$9`OWy!;g49$lX)8ZuaI@rv)BNu`h#p(-jQ3EXDla-4+a zJK^dG(Ir_e077$9tGO-U&E$@HIFwxZ(fJcGG?&-d-v`r&&m@o z!Mghsd6FV*xO%m3rom-yt?A>dkNJktcP@jnE^n}6y-DzoLsC+AJ0xQpUh1(Gqya18 z0K)$BX@Oi?H0d7~THa>8MLrIY-}S==OI<0lC3voexNN#kpgzJ-@b$WGx0+qoLT<+5 zk^T)!dk8qP?_9*MJ;%I!)#(bis4g@!gy!|6QA>5u5S6!Lc#zfX5mWmGU^kZWk#*sN z4a=?RCOJ%EzJO*(uMI@u?}a`bdY+3U%*0Mw2A5sI0frga9>5S5+(jt%5NPm@2xuSjn zxoSj0z|OW|({kL(9;(1Jq@X61p-geLMLdUft77NY#)t|LnnROg9Mj4J?hFZ+=SF9a z7wfWUAZ<2va`VM?TX)Ze&tawB*VfvUn*ld1o;Hak&kZn-RQSqTC;3%av!fl2zIQ&Qf6EidzHeqgd#hfXdlE4R7dX1RXMxr4?T^*`!xG+pp6sA z+V+)N*W(`>gu|JzZYB1v0vIRdi6=2sneV8g2IP=glo)idqK*TzK{>h*^EQ4X>JT_u zdD|E*#{go(rYIy!E2J)a%36;=jzh@{IX!4B>v;K<*zjSJZ!!hlGW>Q6hp%^zmv}12 z*uBwH+U;>rt5CIZ)%7k(!>&9+30~{O@jt-FezBA3)r{8DLI?+>r`@Za{uiG(`lHxi z`DwBoDS%5D%DsLH*H0b^R5MT5p{rkSY7tq2dC)s~Fd75;#x%-QM|G34*5 z!QdQmrlKNYqo_E|o^?`6%d=5W`(@_MsfP1&ZZZh$o%YKxZRD$^91HW#kt;1J5HJ=I z8H%i2rKGbg0}(kowkW>qcp3`SjsNb&B5XOoQEAge>4*J(VnOsN#^X!$Ky|!l8ZBaD zql#ZcwPXCOyL)i&dYbI-(Z2#K#ut2}5xA|7^}o%n%A`x@9$j{O{qG>4H?t5y` zz?5IMxI}rcgZ0?xE(iiLj8v@s{$KDs;iy)kWnZISlUT{+3}Q|0Af|td59-3r4@Bov z!6@SGmFqT%I14j+*T=#h-PIxwO*fq7(g?rg_B4zyIb@7xY#^L9jL2QX5GopOL0;4f zzh$CRaZB6XTAg#>u66`T?azmVILcS;A<5&8wfLwJt0|A zNy#lIMVw2r>y-fFEoAc48{6cU1M5jB#OGypd0Fk^e?}Qc$Xzk@3nFwZab{fF=_ugB z`>^Pfjh~z8=MIMNm;(@yF!6SB*Q(HUPe4TQiia)e9uR|&s%J3oFz6*8Me0%$&?Ehkk1t zA5Sx@XgWC1QG91OnV3igxAPlfIS-_@eM5c`W2g%E)_%ESsPKp^Y#Ga7MhU9n{aV(s z!<`ZaV7$7fqMLHL3QR?9DM%va&H6X@&wl79g1_aANG}yDzq7O3!u!+j z5gq+9ws+qXi|J0j*r)7VHfdJkeJ#)5|K*G*clvorcJ7a9OE57jW&C`~puClEu=VGy zrp6s#oO^!y^8?>z|11PZ+Zf;mc>j3y3~`Zr{#s#)Dd{@-Nnp;(SbJHQ_Y01CrO2## zqq|jadxfVs$A27BdtVbudX6_Iw>GLpF{Sr|-Jl!K{4`C3fY=MmBEo|g+p6`gw-w{d zkMbqMrfP>4d4pnKrm-{m8xu#B2DbLnyf3W=yjEZbm1YY9uI5*&6YVb6!WEaN2dsZqn;NhJfM{s?hMA@}<#`wo6 zi-?h$dvkE4kP@;+zuArF=v$K9$~O16*>ez4i=(8@dVqJ2T|Tnjx|7wzDETDG8|>BU zbaTe2bWEzRtz7{k+<8!y%pj}EOA8s~S9AS_^STwdzSFexr_-$Qc9OzomD0*S?AHQ~ zvBi&YeN9U&5xe5phInyVpWLlhED;e=o%qA=+Og<{95PT8j4Y>Z{#WKmbhQkge$}uI F{U7bme%Js2 literal 0 HcmV?d00001 diff --git a/courtside/game/static/images/players.png b/courtside/game/static/images/players.png new file mode 100644 index 0000000000000000000000000000000000000000..d317144f68815d8112a7190e2e47267c1843764a GIT binary patch literal 462 zcmeAS@N?(olHy`uVBq!ia0vp^azHH0!3-q3s&wptlw^r(L`iUdT1k0gQ7VIDN`6wR zf@f}GdTLN=VoGJ<$y6JlBI5v`5LY0rL?U?meyb@^n?OmBUoeA!f`LOoLP10S{Pp|K z-+!+x)zrnnz$ohJ;uxY4Jav+HQHuc&>ur01hy~^UFQ+9M8%$oJRjK`ATaGtF|C76W z!|OabJuiLQ?7MLBRlVBP>rD?XGG>hZ?YfM|vn`W3qbSNFs{QOjizR8V7*^Y~p9{`n zn9+AcPyZ5=>K4CC%gt64mAx!@>7j2_W^Ej6n>$IRGOl#lmGn}nw_($3V#_r@sW7}* ztntjjD9F!+74A)qD&&dycG47O2nK z?!Ei3_wM<>cgwLfnAzPgd)>|8U}_w_&kX7UFtW19Xa8c>BE}$Q zok~gMS+9upM4+rkWR94!9ued9C!!&-^ooRgr%S|&`4!8Q8O1WaPXn1ZGHzu2$of^&T*7Te=|MFF%N%>Gfc-00000NkvXXu0mjf DVq}19 literal 0 HcmV?d00001 diff --git a/courtside/game/static/images/soccer.png b/courtside/game/static/images/soccer.png new file mode 100644 index 0000000000000000000000000000000000000000..d3d95a8f1110d5963285932c20cf583f084e083c GIT binary patch literal 487 zcmeAS@N?(olHy`uVBq!ia0vp^(jd&i3?z4Pv7`ej$r9IylHmNblJdl&R0hYC{G?O` z&)mfH)S%SFl*+=BsWw1G#sNMdu0UFeMDX_gR#Tuhfs!D-V3( z|6W&8DHfJnQkB`=@G7n-=FCIH9@VUEBfv-3{uN<_6jZ zlNrnAMK(q@{+tuC#b>5Cv0Vhi`{n3(lKDG;QKM@-6^J5njd~Q z%$q)$>CMIJ_d6SAp7LP6{ zefMk`-qw`geCcq0XYBIE*Cwf{j6F}j&XK+rP#(s3Ve;K){O>dOr-(6Jnfjz=?|YT! ptPD2$C##&S;$~oY7nRL=Kz?5`fAFT&zMyDi@O1TaS?83{1OO;|#T)hJ zu%+f`BSYrVatURJZEvmnl2|;H_dS+iywvet#jU~Qk#(=2!tHH8yZu4zZb60KA9_F~ zhf{kPGIw+dD)3%6WLhFNAIJf!<6RBZS0JwJAaxBW`p|Y7(~_6EAi}ha#pANK4v;7Y z5tA7*t3?!Y`I(lyjceGlmeu37SHqUO922&AGhW)#SF!Yo})Owi@ubO*G*2 zn8Bi=zzC$6AykX!jFye^&)GIzh-Ujesm(poUsLyWkeBY+wAZTj+9zh{E(x~2@N9$W zU5*_q8+mUgnN81Cc|3Cs>U@zgf7d$uf!zPly=V}KTe!I+D&aNbsNji|XA380hq`W>rloUf|Hb9sZ=HIlI&WgaH1lfZ@H43@^L8EG zA$}p^kNxWJn>$-g9hR4FwYo4RU7SI>bEdj-34`s#Z+8yzyG#HE0)wZkpUXO@geCyy CFn%!r literal 0 HcmV?d00001 diff --git a/courtside/game/static/images/volleyball.png b/courtside/game/static/images/volleyball.png new file mode 100644 index 0000000000000000000000000000000000000000..8b9664b7c06c7f5cdfe944a77ea92bab296babc9 GIT binary patch literal 492 zcmeAS@N?(olHy`uVBq!ia0vp^Qa~)t!3-orPvl1eDajJoh?3y^w370~qErUQl>DSr z1<%~X^wgl##FWaylc_d9MaBU>A+A7LiA3=B{Z><;Hi42LzhDLd1p|kGgo1|t`Rn(e zzyDrYs;P^CfzjC0#W6%eGWQ^NP>dmu>p|uJ^K&B0|F2F}6VT9l*(Ses>!JOpgsV>5 z{x}+QE4?@D_u|_>F9y}ehM(xwcRscE*6EscTe4a{x?g=+Gdn9H=iZxnyZpSk5Mnpgzt)?1N1Zs2?&H}{Syvs~@nH7$TU`3lvIR3&3QYdg za_?M$t;0#*Q1`n_cgI?*urkk`$*n(5- zxD#*RrpM+n**v}ntU1$BpCkZRl z7Fu3n*nMuw;jrdeyP{Op^Fz;FTkynm#meBM&zUE5On1N_>z9crdOUk) uP*uU((){PsKed!N?_~dfF-rT-4~8|tg4$E1KW_#GErX}4pUXO@geCy$c)%zC literal 0 HcmV?d00001 diff --git a/courtside/game/static/images/x.png b/courtside/game/static/images/x.png new file mode 100644 index 0000000000000000000000000000000000000000..35cf734e38d7930cd4a2af6c7914e7be9f3f8c92 GIT binary patch literal 142 zcmeAS@N?(olHy`uVBq!ia0vp^93afW1|*O0@9PFqp`I>|Ar-eu`vN%`6nI?34{EqY zDJx3=smPYkY?C`*9Q-Zu{ec<-*UTltoKqxL*72lNO|e$XYyI1`>%-(J9(ngV=f^Fb oJBgcDa__Te^D+YG+4Ba8alLq+`Qh(uTc8CDp00i_>zopr0BP+pFaQ7m literal 0 HcmV?d00001 diff --git a/courtside/game/static/js/gmaps.js b/courtside/game/static/js/gmaps.js new file mode 100644 index 0000000..05a84d1 --- /dev/null +++ b/courtside/game/static/js/gmaps.js @@ -0,0 +1,76 @@ +var initialLocation; +var ottawa = new google.maps.LatLng(45.411572, -75.698194); +var browserSupportFlag = new Boolean(); +var map; +var geocoder; + +$(function() { + + $(document).ready(function(){ + geocoder = new google.maps.Geocoder(); + var myOptions = { + center: ottawa, + zoom: 12, + mapTypeId: google.maps.MapTypeId.ROADMAP + }; + map = new google.maps.Map(document.getElementById("map"), myOptions); + + geolocateUser(); + }); + + var geolocateUser = function(){ + // Try W3C Geolocation method (Preferred) + if(navigator.geolocation) { + browserSupportFlag = true; + navigator.geolocation.getCurrentPosition(function(position) { + initialLocation = new google.maps.LatLng(position.coords.latitude,position.coords.longitude); + map.setCenter(initialLocation); + }, function() { + handleNoGeolocation(browserSupportFlag); + }); + } else if (google.gears) { + // Try Google Gears Geolocation + browserSupportFlag = true; + var geo = google.gears.factory.create('beta.geolocation'); + geo.getCurrentPosition(function(position) { + initialLocation = new google.maps.LatLng(position.latitude,position.longitude); + map.setCenter(initialLocation); + }, function() { + handleNoGeolocation(browserSupportFlag); + }); + } else { + // Browser doesn't support Geolocation + browserSupportFlag = false; + handleNoGeolocation(browserSupportFlag); + } + }; + + function handleNoGeolocation(errorFlag) { + if (errorFlag == true) { + initialLocation = null; + } + map.setCenter(ottawa); + } + +}); + +function codeAddress() { + $("#not_found").remove(); + var address = document.getElementById("search").value; + if (initialLocation) { + var latitude = initialLocation.lat(); + var longitude = initialLocation.lng(); + var lower = new google.maps.LatLng(latitude-0.05, longitude-0.05); + var upper = new google.maps.LatLng(latitude+0.05, longitude+0.05); + var bounds = new google.maps.LatLngBounds(lower, upper); + } else { + var bounds = null + } + geocoder.geocode( { 'address': address, 'bounds' : bounds }, function(results, status) { + if (status == google.maps.GeocoderStatus.OK) { + map.setCenter(results[0].geometry.location); + } else { + $("#search_map").append('

We could not find the specified address.

'); + } + }); +} \ No newline at end of file diff --git a/courtside/game/static/js/jquery.timePicker.min.js b/courtside/game/static/js/jquery.timePicker.min.js new file mode 100755 index 0000000..2e092fd --- /dev/null +++ b/courtside/game/static/js/jquery.timePicker.min.js @@ -0,0 +1 @@ +(function(a){function g(a){a.setFullYear(2001),a.setMonth(0),a.setDate(0);return a}function f(a,b){if(a){var c=a.split(b.separator),d=parseFloat(c[0]),e=parseFloat(c[1]);b.show24Hours||(d===12&&a.indexOf("AM")!==-1?d=0:d!==12&&a.indexOf("PM")!==-1&&(d+=12));var f=new Date(0,0,0,d,e,0);return g(f)}return null}function e(a,b){return typeof a=="object"?g(a):f(a,b)}function d(a){return(a<10?"0":"")+a}function c(a,b){var c=a.getHours(),e=b.show24Hours?c:(c+11)%12+1,f=a.getMinutes();return d(e)+b.separator+d(f)+(b.show24Hours?"":c<12?" AM":" PM")}function b(b,c,d,e){b.value=a(c).text(),a(b).change(),a.browser.msie||b.focus(),d.hide()}a.fn.timePicker=function(b){var c=a.extend({},a.fn.timePicker.defaults,b);return this.each(function(){a.timePicker(this,c)})},a.timePicker=function(b,c){var d=a(b)[0];return d.timePicker||(d.timePicker=new jQuery._timePicker(d,c))},a.timePicker.version="0.3",a._timePicker=function(d,h){var i=!1,j=!1,k=e(h.startTime,h),l=e(h.endTime,h),m="selected",n="li."+m;a(d).attr("autocomplete","OFF");var o=[],p=new Date(k);while(p<=l)o[o.length]=c(p,h),p=new Date(p.setMinutes(p.getMinutes()+h.step));var q=a('
'),r=a("
    ");for(var s=0;s"+o[s]+"");q.append(r),q.appendTo("body").hide(),q.mouseover(function(){i=!0}).mouseout(function(){i=!1}),a("li",r).mouseover(function(){j||(a(n,q).removeClass(m),a(this).addClass(m))}).mousedown(function(){i=!0}).click(function(){b(d,this,q,h),i=!1});var t=function(){if(q.is(":visible"))return!1;a("li",q).removeClass(m);var b=a(d).offset();q.css({top:b.top+d.offsetHeight,left:b.left}),q.show();var e=d.value?f(d.value,h):k,i=k.getHours()*60+k.getMinutes(),j=e.getHours()*60+e.getMinutes()-i,n=Math.round(j/h.step),o=g(new Date(0,0,0,0,n*h.step+i,0));o=kf+q[0].offsetHeight&&(q[0].scrollTop=f+i.offsetHeight)):(e.removeClass(m),i=a("li:first",r).addClass(m)[0],q[0].scrollTop=0);return!1;case 13:if(q.is(":visible")){var k=a(n,r)[0];b(d,k,q,h)}return!1;case 27:q.hide();return!1}return!0}),a(d).keyup(function(a){j=!1}),this.getTime=function(){return f(d.value,h)},this.setTime=function(b){d.value=c(e(b,h),h),a(d).change()}},a.fn.timePicker.defaults={step:30,startTime:new Date(0,0,0,0,0,0),endTime:new Date(0,0,0,23,30,0),separator:":",show24Hours:!0}})(jQuery) \ No newline at end of file diff --git a/courtside/game/static/js/libs/jquery-1.5.1.min.js b/courtside/game/static/js/libs/jquery-1.5.1.min.js new file mode 100644 index 0000000..14fd647 --- /dev/null +++ b/courtside/game/static/js/libs/jquery-1.5.1.min.js @@ -0,0 +1,16 @@ +/*! + * jQuery JavaScript Library v1.5.1 + * http://jquery.com/ + * + * Copyright 2011, John Resig + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * Includes Sizzle.js + * http://sizzlejs.com/ + * Copyright 2011, The Dojo Foundation + * Released under the MIT, BSD, and GPL Licenses. + * + * Date: Wed Feb 23 13:55:29 2011 -0500 + */ +(function(a,b){function cg(a){return d.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cd(a){if(!bZ[a]){var b=d("<"+a+">").appendTo("body"),c=b.css("display");b.remove();if(c==="none"||c==="")c="block";bZ[a]=c}return bZ[a]}function cc(a,b){var c={};d.each(cb.concat.apply([],cb.slice(0,b)),function(){c[this]=a});return c}function bY(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function bX(){try{return new a.XMLHttpRequest}catch(b){}}function bW(){d(a).unload(function(){for(var a in bU)bU[a](0,1)})}function bQ(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var e=a.dataTypes,f={},g,h,i=e.length,j,k=e[0],l,m,n,o,p;for(g=1;g=0===c})}function N(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function F(a,b){return(a&&a!=="*"?a+".":"")+b.replace(r,"`").replace(s,"&")}function E(a){var b,c,e,f,g,h,i,j,k,l,m,n,o,q=[],r=[],s=d._data(this,"events");if(a.liveFired!==this&&s&&s.live&&!a.target.disabled&&(!a.button||a.type!=="click")){a.namespace&&(n=new RegExp("(^|\\.)"+a.namespace.split(".").join("\\.(?:.*\\.)?")+"(\\.|$)")),a.liveFired=this;var t=s.live.slice(0);for(i=0;ic)break;a.currentTarget=f.elem,a.data=f.handleObj.data,a.handleObj=f.handleObj,o=f.handleObj.origHandler.apply(f.elem,arguments);if(o===!1||a.isPropagationStopped()){c=f.level,o===!1&&(b=!1);if(a.isImmediatePropagationStopped())break}}return b}}function C(a,c,e){var f=d.extend({},e[0]);f.type=a,f.originalEvent={},f.liveFired=b,d.event.handle.call(c,f),f.isDefaultPrevented()&&e[0].preventDefault()}function w(){return!0}function v(){return!1}function g(a){for(var b in a)if(b!=="toJSON")return!1;return!0}function f(a,c,f){if(f===b&&a.nodeType===1){f=a.getAttribute("data-"+c);if(typeof f==="string"){try{f=f==="true"?!0:f==="false"?!1:f==="null"?null:d.isNaN(f)?e.test(f)?d.parseJSON(f):f:parseFloat(f)}catch(g){}d.data(a,c,f)}else f=b}return f}var c=a.document,d=function(){function I(){if(!d.isReady){try{c.documentElement.doScroll("left")}catch(a){setTimeout(I,1);return}d.ready()}}var d=function(a,b){return new d.fn.init(a,b,g)},e=a.jQuery,f=a.$,g,h=/^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]+)$)/,i=/\S/,j=/^\s+/,k=/\s+$/,l=/\d/,m=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie) ([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,v=navigator.userAgent,w,x=!1,y,z="then done fail isResolved isRejected promise".split(" "),A,B=Object.prototype.toString,C=Object.prototype.hasOwnProperty,D=Array.prototype.push,E=Array.prototype.slice,F=String.prototype.trim,G=Array.prototype.indexOf,H={};d.fn=d.prototype={constructor:d,init:function(a,e,f){var g,i,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!e&&c.body){this.context=c,this[0]=c.body,this.selector="body",this.length=1;return this}if(typeof a==="string"){g=h.exec(a);if(!g||!g[1]&&e)return!e||e.jquery?(e||f).find(a):this.constructor(e).find(a);if(g[1]){e=e instanceof d?e[0]:e,k=e?e.ownerDocument||e:c,j=m.exec(a),j?d.isPlainObject(e)?(a=[c.createElement(j[1])],d.fn.attr.call(a,e,!0)):a=[k.createElement(j[1])]:(j=d.buildFragment([g[1]],[k]),a=(j.cacheable?d.clone(j.fragment):j.fragment).childNodes);return d.merge(this,a)}i=c.getElementById(g[2]);if(i&&i.parentNode){if(i.id!==g[2])return f.find(a);this.length=1,this[0]=i}this.context=c,this.selector=a;return this}if(d.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return d.makeArray(a,this)},selector:"",jquery:"1.5.1",length:0,size:function(){return this.length},toArray:function(){return E.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var e=this.constructor();d.isArray(a)?D.apply(e,a):d.merge(e,a),e.prevObject=this,e.context=this.context,b==="find"?e.selector=this.selector+(this.selector?" ":"")+c:b&&(e.selector=this.selector+"."+b+"("+c+")");return e},each:function(a,b){return d.each(this,a,b)},ready:function(a){d.bindReady(),y.done(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(E.apply(this,arguments),"slice",E.call(arguments).join(","))},map:function(a){return this.pushStack(d.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:D,sort:[].sort,splice:[].splice},d.fn.init.prototype=d.fn,d.extend=d.fn.extend=function(){var a,c,e,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i==="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!=="object"&&!d.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j0)return;y.resolveWith(c,[d]),d.fn.trigger&&d(c).trigger("ready").unbind("ready")}},bindReady:function(){if(!x){x=!0;if(c.readyState==="complete")return setTimeout(d.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",A,!1),a.addEventListener("load",d.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",A),a.attachEvent("onload",d.ready);var b=!1;try{b=a.frameElement==null}catch(e){}c.documentElement.doScroll&&b&&I()}}},isFunction:function(a){return d.type(a)==="function"},isArray:Array.isArray||function(a){return d.type(a)==="array"},isWindow:function(a){return a&&typeof a==="object"&&"setInterval"in a},isNaN:function(a){return a==null||!l.test(a)||isNaN(a)},type:function(a){return a==null?String(a):H[B.call(a)]||"object"},isPlainObject:function(a){if(!a||d.type(a)!=="object"||a.nodeType||d.isWindow(a))return!1;if(a.constructor&&!C.call(a,"constructor")&&!C.call(a.constructor.prototype,"isPrototypeOf"))return!1;var c;for(c in a){}return c===b||C.call(a,c)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw a},parseJSON:function(b){if(typeof b!=="string"||!b)return null;b=d.trim(b);if(n.test(b.replace(o,"@").replace(p,"]").replace(q,"")))return a.JSON&&a.JSON.parse?a.JSON.parse(b):(new Function("return "+b))();d.error("Invalid JSON: "+b)},parseXML:function(b,c,e){a.DOMParser?(e=new DOMParser,c=e.parseFromString(b,"text/xml")):(c=new ActiveXObject("Microsoft.XMLDOM"),c.async="false",c.loadXML(b)),e=c.documentElement,(!e||!e.nodeName||e.nodeName==="parsererror")&&d.error("Invalid XML: "+b);return c},noop:function(){},globalEval:function(a){if(a&&i.test(a)){var b=c.head||c.getElementsByTagName("head")[0]||c.documentElement,e=c.createElement("script");d.support.scriptEval()?e.appendChild(c.createTextNode(a)):e.text=a,b.insertBefore(e,b.firstChild),b.removeChild(e)}},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,e){var f,g=0,h=a.length,i=h===b||d.isFunction(a);if(e){if(i){for(f in a)if(c.apply(a[f],e)===!1)break}else for(;g1){var f=E.call(arguments,0),g=b,h=function(a){return function(b){f[a]=arguments.length>1?E.call(arguments,0):b,--g||c.resolveWith(e,f)}};while(b--)a=f[b],a&&d.isFunction(a.promise)?a.promise().then(h(b),c.reject):--g;g||c.resolveWith(e,f)}else c!==a&&c.resolve(a);return e},uaMatch:function(a){a=a.toLowerCase();var b=r.exec(a)||s.exec(a)||t.exec(a)||a.indexOf("compatible")<0&&u.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},sub:function(){function a(b,c){return new a.fn.init(b,c)}d.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.subclass=this.subclass,a.fn.init=function b(b,c){c&&c instanceof d&&!(c instanceof a)&&(c=a(c));return d.fn.init.call(this,b,c,e)},a.fn.init.prototype=a.fn;var e=a(c);return a},browser:{}}),y=d._Deferred(),d.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(a,b){H["[object "+b+"]"]=b.toLowerCase()}),w=d.uaMatch(v),w.browser&&(d.browser[w.browser]=!0,d.browser.version=w.version),d.browser.webkit&&(d.browser.safari=!0),G&&(d.inArray=function(a,b){return G.call(b,a)}),i.test(" ")&&(j=/^[\s\xA0]+/,k=/[\s\xA0]+$/),g=d(c),c.addEventListener?A=function(){c.removeEventListener("DOMContentLoaded",A,!1),d.ready()}:c.attachEvent&&(A=function(){c.readyState==="complete"&&(c.detachEvent("onreadystatechange",A),d.ready())});return d}();(function(){d.support={};var b=c.createElement("div");b.style.display="none",b.innerHTML="
    a";var e=b.getElementsByTagName("*"),f=b.getElementsByTagName("a")[0],g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=b.getElementsByTagName("input")[0];if(e&&e.length&&f){d.support={leadingWhitespace:b.firstChild.nodeType===3,tbody:!b.getElementsByTagName("tbody").length,htmlSerialize:!!b.getElementsByTagName("link").length,style:/red/.test(f.getAttribute("style")),hrefNormalized:f.getAttribute("href")==="/a",opacity:/^0.55$/.test(f.style.opacity),cssFloat:!!f.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,deleteExpando:!0,optDisabled:!1,checkClone:!1,noCloneEvent:!0,noCloneChecked:!0,boxModel:null,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableHiddenOffsets:!0},i.checked=!0,d.support.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,d.support.optDisabled=!h.disabled;var j=null;d.support.scriptEval=function(){if(j===null){var b=c.documentElement,e=c.createElement("script"),f="script"+d.now();try{e.appendChild(c.createTextNode("window."+f+"=1;"))}catch(g){}b.insertBefore(e,b.firstChild),a[f]?(j=!0,delete a[f]):j=!1,b.removeChild(e),b=e=f=null}return j};try{delete b.test}catch(k){d.support.deleteExpando=!1}!b.addEventListener&&b.attachEvent&&b.fireEvent&&(b.attachEvent("onclick",function l(){d.support.noCloneEvent=!1,b.detachEvent("onclick",l)}),b.cloneNode(!0).fireEvent("onclick")),b=c.createElement("div"),b.innerHTML="";var m=c.createDocumentFragment();m.appendChild(b.firstChild),d.support.checkClone=m.cloneNode(!0).cloneNode(!0).lastChild.checked,d(function(){var a=c.createElement("div"),b=c.getElementsByTagName("body")[0];if(b){a.style.width=a.style.paddingLeft="1px",b.appendChild(a),d.boxModel=d.support.boxModel=a.offsetWidth===2,"zoom"in a.style&&(a.style.display="inline",a.style.zoom=1,d.support.inlineBlockNeedsLayout=a.offsetWidth===2,a.style.display="",a.innerHTML="
    ",d.support.shrinkWrapBlocks=a.offsetWidth!==2),a.innerHTML="
    t
    ";var e=a.getElementsByTagName("td");d.support.reliableHiddenOffsets=e[0].offsetHeight===0,e[0].style.display="",e[1].style.display="none",d.support.reliableHiddenOffsets=d.support.reliableHiddenOffsets&&e[0].offsetHeight===0,a.innerHTML="",b.removeChild(a).style.display="none",a=e=null}});var n=function(a){var b=c.createElement("div");a="on"+a;if(!b.attachEvent)return!0;var d=a in b;d||(b.setAttribute(a,"return;"),d=typeof b[a]==="function"),b=null;return d};d.support.submitBubbles=n("submit"),d.support.changeBubbles=n("change"),b=e=f=null}})();var e=/^(?:\{.*\}|\[.*\])$/;d.extend({cache:{},uuid:0,expando:"jQuery"+(d.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?d.cache[a[d.expando]]:a[d.expando];return!!a&&!g(a)},data:function(a,c,e,f){if(d.acceptData(a)){var g=d.expando,h=typeof c==="string",i,j=a.nodeType,k=j?d.cache:a,l=j?a[d.expando]:a[d.expando]&&d.expando;if((!l||f&&l&&!k[l][g])&&h&&e===b)return;l||(j?a[d.expando]=l=++d.uuid:l=d.expando),k[l]||(k[l]={},j||(k[l].toJSON=d.noop));if(typeof c==="object"||typeof c==="function")f?k[l][g]=d.extend(k[l][g],c):k[l]=d.extend(k[l],c);i=k[l],f&&(i[g]||(i[g]={}),i=i[g]),e!==b&&(i[c]=e);if(c==="events"&&!i[c])return i[g]&&i[g].events;return h?i[c]:i}},removeData:function(b,c,e){if(d.acceptData(b)){var f=d.expando,h=b.nodeType,i=h?d.cache:b,j=h?b[d.expando]:d.expando;if(!i[j])return;if(c){var k=e?i[j][f]:i[j];if(k){delete k[c];if(!g(k))return}}if(e){delete i[j][f];if(!g(i[j]))return}var l=i[j][f];d.support.deleteExpando||i!=a?delete i[j]:i[j]=null,l?(i[j]={},h||(i[j].toJSON=d.noop),i[j][f]=l):h&&(d.support.deleteExpando?delete b[d.expando]:b.removeAttribute?b.removeAttribute(d.expando):b[d.expando]=null)}},_data:function(a,b,c){return d.data(a,b,c,!0)},acceptData:function(a){if(a.nodeName){var b=d.noData[a.nodeName.toLowerCase()];if(b)return b!==!0&&a.getAttribute("classid")===b}return!0}}),d.fn.extend({data:function(a,c){var e=null;if(typeof a==="undefined"){if(this.length){e=d.data(this[0]);if(this[0].nodeType===1){var g=this[0].attributes,h;for(var i=0,j=g.length;i-1)return!0;return!1},val:function(a){if(!arguments.length){var c=this[0];if(c){if(d.nodeName(c,"option")){var e=c.attributes.value;return!e||e.specified?c.value:c.text}if(d.nodeName(c,"select")){var f=c.selectedIndex,g=[],h=c.options,i=c.type==="select-one";if(f<0)return null;for(var k=i?f:0,l=i?f+1:h.length;k=0;else if(d.nodeName(this,"select")){var f=d.makeArray(e);d("option",this).each(function(){this.selected=d.inArray(d(this).val(),f)>=0}),f.length||(this.selectedIndex=-1)}else this.value=e}})}}),d.extend({attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,e,f){if(!a||a.nodeType===3||a.nodeType===8||a.nodeType===2)return b;if(f&&c in d.attrFn)return d(a)[c](e);var g=a.nodeType!==1||!d.isXMLDoc(a),h=e!==b;c=g&&d.props[c]||c;if(a.nodeType===1){var i=k.test(c);if(c==="selected"&&!d.support.optSelected){var j=a.parentNode;j&&(j.selectedIndex,j.parentNode&&j.parentNode.selectedIndex)}if((c in a||a[c]!==b)&&g&&!i){h&&(c==="type"&&l.test(a.nodeName)&&a.parentNode&&d.error("type property can't be changed"),e===null?a.nodeType===1&&a.removeAttribute(c):a[c]=e);if(d.nodeName(a,"form")&&a.getAttributeNode(c))return a.getAttributeNode(c).nodeValue;if(c==="tabIndex"){var o=a.getAttributeNode("tabIndex");return o&&o.specified?o.value:m.test(a.nodeName)||n.test(a.nodeName)&&a.href?0:b}return a[c]}if(!d.support.style&&g&&c==="style"){h&&(a.style.cssText=""+e);return a.style.cssText}h&&a.setAttribute(c,""+e);if(!a.attributes[c]&&(a.hasAttribute&&!a.hasAttribute(c)))return b;var p=!d.support.hrefNormalized&&g&&i?a.getAttribute(c,2):a.getAttribute(c);return p===null?b:p}h&&(a[c]=e);return a[c]}});var p=/\.(.*)$/,q=/^(?:textarea|input|select)$/i,r=/\./g,s=/ /g,t=/[^\w\s.|`]/g,u=function(a){return a.replace(t,"\\$&")};d.event={add:function(c,e,f,g){if(c.nodeType!==3&&c.nodeType!==8){try{d.isWindow(c)&&(c!==a&&!c.frameElement)&&(c=a)}catch(h){}if(f===!1)f=v;else if(!f)return;var i,j;f.handler&&(i=f,f=i.handler),f.guid||(f.guid=d.guid++);var k=d._data(c);if(!k)return;var l=k.events,m=k.handle;l||(k.events=l={}),m||(k.handle=m=function(){return typeof d!=="undefined"&&!d.event.triggered?d.event.handle.apply(m.elem,arguments):b}),m.elem=c,e=e.split(" ");var n,o=0,p;while(n=e[o++]){j=i?d.extend({},i):{handler:f,data:g},n.indexOf(".")>-1?(p=n.split("."),n=p.shift(),j.namespace=p.slice(0).sort().join(".")):(p=[],j.namespace=""),j.type=n,j.guid||(j.guid=f.guid);var q=l[n],r=d.event.special[n]||{};if(!q){q=l[n]=[];if(!r.setup||r.setup.call(c,g,p,m)===!1)c.addEventListener?c.addEventListener(n,m,!1):c.attachEvent&&c.attachEvent("on"+n,m)}r.add&&(r.add.call(c,j),j.handler.guid||(j.handler.guid=f.guid)),q.push(j),d.event.global[n]=!0}c=null}},global:{},remove:function(a,c,e,f){if(a.nodeType!==3&&a.nodeType!==8){e===!1&&(e=v);var g,h,i,j,k=0,l,m,n,o,p,q,r,s=d.hasData(a)&&d._data(a),t=s&&s.events;if(!s||!t)return;c&&c.type&&(e=c.handler,c=c.type);if(!c||typeof c==="string"&&c.charAt(0)==="."){c=c||"";for(h in t)d.event.remove(a,h+c);return}c=c.split(" ");while(h=c[k++]){r=h,q=null,l=h.indexOf(".")<0,m=[],l||(m=h.split("."),h=m.shift(),n=new RegExp("(^|\\.)"+d.map(m.slice(0).sort(),u).join("\\.(?:.*\\.)?")+"(\\.|$)")),p=t[h];if(!p)continue;if(!e){for(j=0;j=0&&(a.type=f=f.slice(0,-1),a.exclusive=!0),e||(a.stopPropagation(),d.event.global[f]&&d.each(d.cache,function(){var b=d.expando,e=this[b];e&&e.events&&e.events[f]&&d.event.trigger(a,c,e.handle.elem)}));if(!e||e.nodeType===3||e.nodeType===8)return b;a.result=b,a.target=e,c=d.makeArray(c),c.unshift(a)}a.currentTarget=e;var h=d._data(e,"handle");h&&h.apply(e,c);var i=e.parentNode||e.ownerDocument;try{e&&e.nodeName&&d.noData[e.nodeName.toLowerCase()]||e["on"+f]&&e["on"+f].apply(e,c)===!1&&(a.result=!1,a.preventDefault())}catch(j){}if(!a.isPropagationStopped()&&i)d.event.trigger(a,c,i,!0);else if(!a.isDefaultPrevented()){var k,l=a.target,m=f.replace(p,""),n=d.nodeName(l,"a")&&m==="click",o=d.event.special[m]||{};if((!o._default||o._default.call(e,a)===!1)&&!n&&!(l&&l.nodeName&&d.noData[l.nodeName.toLowerCase()])){try{l[m]&&(k=l["on"+m],k&&(l["on"+m]=null),d.event.triggered=!0,l[m]())}catch(q){}k&&(l["on"+m]=k),d.event.triggered=!1}}},handle:function(c){var e,f,g,h,i,j=[],k=d.makeArray(arguments);c=k[0]=d.event.fix(c||a.event),c.currentTarget=this,e=c.type.indexOf(".")<0&&!c.exclusive,e||(g=c.type.split("."),c.type=g.shift(),j=g.slice(0).sort(),h=new RegExp("(^|\\.)"+j.join("\\.(?:.*\\.)?")+"(\\.|$)")),c.namespace=c.namespace||j.join("."),i=d._data(this,"events"),f=(i||{})[c.type];if(i&&f){f=f.slice(0);for(var l=0,m=f.length;l-1?d.map(a.options,function(a){return a.selected}).join("-"):"":a.nodeName.toLowerCase()==="select"&&(c=a.selectedIndex);return c},B=function B(a){var c=a.target,e,f;if(q.test(c.nodeName)&&!c.readOnly){e=d._data(c,"_change_data"),f=A(c),(a.type!=="focusout"||c.type!=="radio")&&d._data(c,"_change_data",f);if(e===b||f===e)return;if(e!=null||f)a.type="change",a.liveFired=b,d.event.trigger(a,arguments[1],c)}};d.event.special.change={filters:{focusout:B,beforedeactivate:B,click:function(a){var b=a.target,c=b.type;(c==="radio"||c==="checkbox"||b.nodeName.toLowerCase()==="select")&&B.call(this,a)},keydown:function(a){var b=a.target,c=b.type;(a.keyCode===13&&b.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(c==="checkbox"||c==="radio")||c==="select-multiple")&&B.call(this,a)},beforeactivate:function(a){var b=a.target;d._data(b,"_change_data",A(b))}},setup:function(a,b){if(this.type==="file")return!1;for(var c in z)d.event.add(this,c+".specialChange",z[c]);return q.test(this.nodeName)},teardown:function(a){d.event.remove(this,".specialChange");return q.test(this.nodeName)}},z=d.event.special.change.filters,z.focus=z.beforeactivate}c.addEventListener&&d.each({focus:"focusin",blur:"focusout"},function(a,b){function c(a){a=d.event.fix(a),a.type=b;return d.event.handle.call(this,a)}d.event.special[b]={setup:function(){this.addEventListener(a,c,!0)},teardown:function(){this.removeEventListener(a,c,!0)}}}),d.each(["bind","one"],function(a,c){d.fn[c]=function(a,e,f){if(typeof a==="object"){for(var g in a)this[c](g,e,a[g],f);return this}if(d.isFunction(e)||e===!1)f=e,e=b;var h=c==="one"?d.proxy(f,function(a){d(this).unbind(a,h);return f.apply(this,arguments)}):f;if(a==="unload"&&c!=="one")this.one(a,e,f);else for(var i=0,j=this.length;i0?this.bind(b,a,c):this.trigger(b)},d.attrFn&&(d.attrFn[b]=!0)}),function(){function u(a,b,c,d,e,f){for(var g=0,h=d.length;g0){j=i;break}}i=i[a]}d[g]=j}}}function t(a,b,c,d,e,f){for(var g=0,h=d.length;g+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,e=0,f=Object.prototype.toString,g=!1,h=!0,i=/\\/g,j=/\W/;[0,0].sort(function(){h=!1;return 0});var k=function(b,d,e,g){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!=="string")return e;var i,j,n,o,q,r,s,t,u=!0,w=k.isXML(d),x=[],y=b;do{a.exec(""),i=a.exec(y);if(i){y=i[3],x.push(i[1]);if(i[2]){o=i[3];break}}}while(i);if(x.length>1&&m.exec(b))if(x.length===2&&l.relative[x[0]])j=v(x[0]+x[1],d);else{j=l.relative[x[0]]?[d]:k(x.shift(),d);while(x.length)b=x.shift(),l.relative[b]&&(b+=x.shift()),j=v(b,j)}else{!g&&x.length>1&&d.nodeType===9&&!w&&l.match.ID.test(x[0])&&!l.match.ID.test(x[x.length-1])&&(q=k.find(x.shift(),d,w),d=q.expr?k.filter(q.expr,q.set)[0]:q.set[0]);if(d){q=g?{expr:x.pop(),set:p(g)}:k.find(x.pop(),x.length===1&&(x[0]==="~"||x[0]==="+")&&d.parentNode?d.parentNode:d,w),j=q.expr?k.filter(q.expr,q.set):q.set,x.length>0?n=p(j):u=!1;while(x.length)r=x.pop(),s=r,l.relative[r]?s=x.pop():r="",s==null&&(s=d),l.relative[r](n,s,w)}else n=x=[]}n||(n=j),n||k.error(r||b);if(f.call(n)==="[object Array]")if(u)if(d&&d.nodeType===1)for(t=0;n[t]!=null;t++)n[t]&&(n[t]===!0||n[t].nodeType===1&&k.contains(d,n[t]))&&e.push(j[t]);else for(t=0;n[t]!=null;t++)n[t]&&n[t].nodeType===1&&e.push(j[t]);else e.push.apply(e,n);else p(n,e);o&&(k(o,h,e,g),k.uniqueSort(e));return e};k.uniqueSort=function(a){if(r){g=h,a.sort(r);if(g)for(var b=1;b0},k.find=function(a,b,c){var d;if(!a)return[];for(var e=0,f=l.order.length;e":function(a,b){var c,d=typeof b==="string",e=0,f=a.length;if(d&&!j.test(b)){b=b.toLowerCase();for(;e=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(i,"")},TAG:function(a,b){return a[1].replace(i,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||k.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&k.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(i,"");!f&&l.attrMap[g]&&(a[1]=l.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(i,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=k(b[3],null,null,c);else{var g=k.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(l.match.POS.test(b[0])||l.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!k(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){return"text"===a.getAttribute("type")},radio:function(a){return"radio"===a.type},checkbox:function(a){return"checkbox"===a.type},file:function(a){return"file"===a.type},password:function(a){return"password"===a.type},submit:function(a){return"submit"===a.type},image:function(a){return"image"===a.type},reset:function(a){return"reset"===a.type},button:function(a){return"button"===a.type||a.nodeName.toLowerCase()==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return bc[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=l.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||k.getText([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=l.attrHandle[c]?l.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=l.setFilters[e];if(f)return f(a,c,b,d)}}},m=l.match.POS,n=function(a,b){return"\\"+(b-0+1)};for(var o in l.match)l.match[o]=new RegExp(l.match[o].source+/(?![^\[]*\])(?![^\(]*\))/.source),l.leftMatch[o]=new RegExp(/(^(?:.|\r|\n)*?)/.source+l.match[o].source.replace(/\\(\d+)/g,n));var p=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(q){p=function(a,b){var c=0,d=b||[];if(f.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length==="number")for(var e=a.length;c",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(l.find.ID=function(a,c,d){if(typeof c.getElementById!=="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!=="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},l.filter.ID=function(a,b){var c=typeof a.getAttributeNode!=="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(l.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="",a.firstChild&&typeof a.firstChild.getAttribute!=="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(l.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=k,b=c.createElement("div"),d="__sizzle__";b.innerHTML="

    ";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){k=function(b,e,f,g){e=e||c;if(!g&&!k.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return p(e.getElementsByTagName(b),f);if(h[2]&&l.find.CLASS&&e.getElementsByClassName)return p(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return p([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return p([],f);if(i.id===h[3])return p([i],f)}try{return p(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var m=e,n=e.getAttribute("id"),o=n||d,q=e.parentNode,r=/^\s*[+~]/.test(b);n?o=o.replace(/'/g,"\\$&"):e.setAttribute("id",o),r&&q&&(e=e.parentNode);try{if(!r||q)return p(e.querySelectorAll("[id='"+o+"'] "+b),f)}catch(s){}finally{n||m.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)k[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector,d=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(e){d=!0}b&&(k.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!k.isXML(a))try{if(d||!l.match.PSEUDO.test(c)&&!/!=/.test(c))return b.call(a,c)}catch(e){}return k(c,null,null,[a]).length>0})}(),function(){var a=c.createElement("div");a.innerHTML="
    ";if(a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;l.order.splice(1,0,"CLASS"),l.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!=="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?k.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?k.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:k.contains=function(){return!1},k.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var v=function(a,b){var c,d=[],e="",f=b.nodeType?[b]:b;while(c=l.match.PSEUDO.exec(a))e+=c[0],a=a.replace(l.match.PSEUDO,"");a=l.relative[a]?a+"*":a;for(var g=0,h=f.length;g0)for(var g=c;g0},closest:function(a,b){var c=[],e,f,g=this[0];if(d.isArray(a)){var h,i,j={},k=1;if(g&&a.length){for(e=0,f=a.length;e-1:d(g).is(h))&&c.push({selector:i,elem:g,level:k});g=g.parentNode,k++}}return c}var l=L.test(a)?d(a,b||this.context):null;for(e=0,f=this.length;e-1:d.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b)break}}c=c.length>1?d.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a||typeof a==="string")return d.inArray(this[0],a?d(a):this.parent().children());return d.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a==="string"?d(a,b):d.makeArray(a),e=d.merge(this.get(),c);return this.pushStack(N(c[0])||N(e[0])?e:d.unique(e))},andSelf:function(){return this.add(this.prevObject)}}),d.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return d.dir(a,"parentNode")},parentsUntil:function(a,b,c){return d.dir(a,"parentNode",c)},next:function(a){return d.nth(a,2,"nextSibling")},prev:function(a){return d.nth(a,2,"previousSibling")},nextAll:function(a){return d.dir(a,"nextSibling")},prevAll:function(a){return d.dir(a,"previousSibling")},nextUntil:function(a,b,c){return d.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return d.dir(a,"previousSibling",c)},siblings:function(a){return d.sibling(a.parentNode.firstChild,a)},children:function(a){return d.sibling(a.firstChild)},contents:function(a){return d.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:d.makeArray(a.childNodes)}},function(a,b){d.fn[a]=function(c,e){var f=d.map(this,b,c),g=K.call(arguments);G.test(a)||(e=c),e&&typeof e==="string"&&(f=d.filter(e,f)),f=this.length>1&&!M[a]?d.unique(f):f,(this.length>1||I.test(e))&&H.test(a)&&(f=f.reverse());return this.pushStack(f,a,g.join(","))}}),d.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?d.find.matchesSelector(b[0],a)?[b[0]]:[]:d.find.matches(a,b)},dir:function(a,c,e){var f=[],g=a[c];while(g&&g.nodeType!==9&&(e===b||g.nodeType!==1||!d(g).is(e)))g.nodeType===1&&f.push(g),g=g[c];return f},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var P=/ jQuery\d+="(?:\d+|null)"/g,Q=/^\s+/,R=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,S=/<([\w:]+)/,T=/",""],legend:[1,"
    ","
    "],thead:[1,"","
    "],tr:[2,"","
    "],td:[3,"","
    "],col:[2,"","
    "],area:[1,"",""],_default:[0,"",""]};X.optgroup=X.option,X.tbody=X.tfoot=X.colgroup=X.caption=X.thead,X.th=X.td,d.support.htmlSerialize||(X._default=[1,"div
    ","
    "]),d.fn.extend({text:function(a){if(d.isFunction(a))return this.each(function(b){var c=d(this);c.text(a.call(this,b,c.text()))});if(typeof a!=="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return d.text(this)},wrapAll:function(a){if(d.isFunction(a))return this.each(function(b){d(this).wrapAll(a.call(this,b))});if(this[0]){var b=d(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(d.isFunction(a))return this.each(function(b){d(this).wrapInner(a.call(this,b))});return this.each(function(){var b=d(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){d(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){d.nodeName(this,"body")||d(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=d(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,d(arguments[0]).toArray());return a}},remove:function(a,b){for(var c=0,e;(e=this[c])!=null;c++)if(!a||d.filter(a,[e]).length)!b&&e.nodeType===1&&(d.cleanData(e.getElementsByTagName("*")),d.cleanData([e])),e.parentNode&&e.parentNode.removeChild(e);return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&d.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return d.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(P,""):null;if(typeof a!=="string"||V.test(a)||!d.support.leadingWhitespace&&Q.test(a)||X[(S.exec(a)||["",""])[1].toLowerCase()])d.isFunction(a)?this.each(function(b){var c=d(this);c.html(a.call(this,b,c.html()))}):this.empty().append(a);else{a=a.replace(R,"<$1>");try{for(var c=0,e=this.length;c1&&l0?this.clone(!0):this).get();d(f[h])[b](j),e=e.concat(j)}return this.pushStack(e,a,f.selector)}}),d.extend({clone:function(a,b,c){var e=a.cloneNode(!0),f,g,h;if((!d.support.noCloneEvent||!d.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!d.isXMLDoc(a)){$(a,e),f=_(a),g=_(e);for(h=0;f[h];++h)$(f[h],g[h])}if(b){Z(a,e);if(c){f=_(a),g=_(e);for(h=0;f[h];++h)Z(f[h],g[h])}}return e},clean:function(a,b,e,f){b=b||c,typeof b.createElement==="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var g=[];for(var h=0,i;(i=a[h])!=null;h++){typeof i==="number"&&(i+="");if(!i)continue;if(typeof i!=="string"||U.test(i)){if(typeof i==="string"){i=i.replace(R,"<$1>");var j=(S.exec(i)||["",""])[1].toLowerCase(),k=X[j]||X._default,l=k[0],m=b.createElement("div");m.innerHTML=k[1]+i+k[2];while(l--)m=m.lastChild;if(!d.support.tbody){var n=T.test(i),o=j==="table"&&!n?m.firstChild&&m.firstChild.childNodes:k[1]===""&&!n?m.childNodes:[];for(var p=o.length-1;p>=0;--p)d.nodeName(o[p],"tbody")&&!o[p].childNodes.length&&o[p].parentNode.removeChild(o[p])}!d.support.leadingWhitespace&&Q.test(i)&&m.insertBefore(b.createTextNode(Q.exec(i)[0]),m.firstChild),i=m.childNodes}}else i=b.createTextNode(i);i.nodeType?g.push(i):g=d.merge(g,i)}if(e)for(h=0;g[h];h++)!f||!d.nodeName(g[h],"script")||g[h].type&&g[h].type.toLowerCase()!=="text/javascript"?(g[h].nodeType===1&&g.splice.apply(g,[h+1,0].concat(d.makeArray(g[h].getElementsByTagName("script")))),e.appendChild(g[h])):f.push(g[h].parentNode?g[h].parentNode.removeChild(g[h]):g[h]);return g},cleanData:function(a){var b,c,e=d.cache,f=d.expando,g=d.event.special,h=d.support.deleteExpando;for(var i=0,j;(j=a[i])!=null;i++){if(j.nodeName&&d.noData[j.nodeName.toLowerCase()])continue;c=j[d.expando];if(c){b=e[c]&&e[c][f];if(b&&b.events){for(var k in b.events)g[k]?d.event.remove(j,k):d.removeEvent(j,k,b.handle);b.handle&&(b.handle.elem=null)}h?delete j[d.expando]:j.removeAttribute&&j.removeAttribute(d.expando),delete e[c]}}}});var bb=/alpha\([^)]*\)/i,bc=/opacity=([^)]*)/,bd=/-([a-z])/ig,be=/([A-Z])/g,bf=/^-?\d+(?:px)?$/i,bg=/^-?\d/,bh={position:"absolute",visibility:"hidden",display:"block"},bi=["Left","Right"],bj=["Top","Bottom"],bk,bl,bm,bn=function(a,b){return b.toUpperCase()};d.fn.css=function(a,c){if(arguments.length===2&&c===b)return this;return d.access(this,a,c,!0,function(a,c,e){return e!==b?d.style(a,c,e):d.css(a,c)})},d.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=bk(a,"opacity","opacity");return c===""?"1":c}return a.style.opacity}}},cssNumber:{zIndex:!0,fontWeight:!0,opacity:!0,zoom:!0,lineHeight:!0},cssProps:{"float":d.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,e,f){if(a&&a.nodeType!==3&&a.nodeType!==8&&a.style){var g,h=d.camelCase(c),i=a.style,j=d.cssHooks[h];c=d.cssProps[h]||h;if(e===b){if(j&&"get"in j&&(g=j.get(a,!1,f))!==b)return g;return i[c]}if(typeof e==="number"&&isNaN(e)||e==null)return;typeof e==="number"&&!d.cssNumber[h]&&(e+="px");if(!j||!("set"in j)||(e=j.set(a,e))!==b)try{i[c]=e}catch(k){}}},css:function(a,c,e){var f,g=d.camelCase(c),h=d.cssHooks[g];c=d.cssProps[g]||g;if(h&&"get"in h&&(f=h.get(a,!0,e))!==b)return f;if(bk)return bk(a,c,g)},swap:function(a,b,c){var d={};for(var e in b)d[e]=a.style[e],a.style[e]=b[e];c.call(a);for(e in b)a.style[e]=d[e]},camelCase:function(a){return a.replace(bd,bn)}}),d.curCSS=d.css,d.each(["height","width"],function(a,b){d.cssHooks[b]={get:function(a,c,e){var f;if(c){a.offsetWidth!==0?f=bo(a,b,e):d.swap(a,bh,function(){f=bo(a,b,e)});if(f<=0){f=bk(a,b,b),f==="0px"&&bm&&(f=bm(a,b,b));if(f!=null)return f===""||f==="auto"?"0px":f}if(f<0||f==null){f=a.style[b];return f===""||f==="auto"?"0px":f}return typeof f==="string"?f:f+"px"}},set:function(a,b){if(!bf.test(b))return b;b=parseFloat(b);if(b>=0)return b+"px"}}}),d.support.opacity||(d.cssHooks.opacity={get:function(a,b){return bc.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style;c.zoom=1;var e=d.isNaN(b)?"":"alpha(opacity="+b*100+")",f=c.filter||"";c.filter=bb.test(f)?f.replace(bb,e):c.filter+" "+e}}),c.defaultView&&c.defaultView.getComputedStyle&&(bl=function(a,c,e){var f,g,h;e=e.replace(be,"-$1").toLowerCase();if(!(g=a.ownerDocument.defaultView))return b;if(h=g.getComputedStyle(a,null))f=h.getPropertyValue(e),f===""&&!d.contains(a.ownerDocument.documentElement,a)&&(f=d.style(a,e));return f}),c.documentElement.currentStyle&&(bm=function(a,b){var c,d=a.currentStyle&&a.currentStyle[b],e=a.runtimeStyle&&a.runtimeStyle[b],f=a.style;!bf.test(d)&&bg.test(d)&&(c=f.left,e&&(a.runtimeStyle.left=a.currentStyle.left),f.left=b==="fontSize"?"1em":d||0,d=f.pixelLeft+"px",f.left=c,e&&(a.runtimeStyle.left=e));return d===""?"auto":d}),bk=bl||bm,d.expr&&d.expr.filters&&(d.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!d.support.reliableHiddenOffsets&&(a.style.display||d.css(a,"display"))==="none"},d.expr.filters.visible=function(a){return!d.expr.filters.hidden(a)});var bp=/%20/g,bq=/\[\]$/,br=/\r?\n/g,bs=/#.*$/,bt=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bu=/^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bv=/(?:^file|^widget|\-extension):$/,bw=/^(?:GET|HEAD)$/,bx=/^\/\//,by=/\?/,bz=/)<[^<]*)*<\/script>/gi,bA=/^(?:select|textarea)/i,bB=/\s+/,bC=/([?&])_=[^&]*/,bD=/(^|\-)([a-z])/g,bE=function(a,b,c){return b+c.toUpperCase()},bF=/^([\w\+\.\-]+:)\/\/([^\/?#:]*)(?::(\d+))?/,bG=d.fn.load,bH={},bI={},bJ,bK;try{bJ=c.location.href}catch(bL){bJ=c.createElement("a"),bJ.href="",bJ=bJ.href}bK=bF.exec(bJ.toLowerCase()),d.fn.extend({load:function(a,c,e){if(typeof a!=="string"&&bG)return bG.apply(this,arguments);if(!this.length)return this;var f=a.indexOf(" ");if(f>=0){var g=a.slice(f,a.length);a=a.slice(0,f)}var h="GET";c&&(d.isFunction(c)?(e=c,c=b):typeof c==="object"&&(c=d.param(c,d.ajaxSettings.traditional),h="POST"));var i=this;d.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?d("
    ").append(c.replace(bz,"")).find(g):c)),e&&i.each(e,[c,b,a])}});return this},serialize:function(){return d.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?d.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bA.test(this.nodeName)||bu.test(this.type))}).map(function(a,b){var c=d(this).val();return c==null?null:d.isArray(c)?d.map(c,function(a,c){return{name:b.name,value:a.replace(br,"\r\n")}}):{name:b.name,value:c.replace(br,"\r\n")}}).get()}}),d.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){d.fn[b]=function(a){return this.bind(b,a)}}),d.each(["get","post"],function(a,c){d[c]=function(a,e,f,g){d.isFunction(e)&&(g=g||f,f=e,e=b);return d.ajax({type:c,url:a,data:e,success:f,dataType:g})}}),d.extend({getScript:function(a,c){return d.get(a,b,c,"script")},getJSON:function(a,b,c){return d.get(a,b,c,"json")},ajaxSetup:function(a,b){b?d.extend(!0,a,d.ajaxSettings,b):(b=a,a=d.extend(!0,d.ajaxSettings,b));for(var c in {context:1,url:1})c in b?a[c]=b[c]:c in d.ajaxSettings&&(a[c]=d.ajaxSettings[c]);return a},ajaxSettings:{url:bJ,isLocal:bv.test(bK[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":"*/*"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":d.parseJSON,"text xml":d.parseXML}},ajaxPrefilter:bM(bH),ajaxTransport:bM(bI),ajax:function(a,c){function v(a,c,l,n){if(r!==2){r=2,p&&clearTimeout(p),o=b,m=n||"",u.readyState=a?4:0;var q,t,v,w=l?bP(e,u,l):b,x,y;if(a>=200&&a<300||a===304){if(e.ifModified){if(x=u.getResponseHeader("Last-Modified"))d.lastModified[k]=x;if(y=u.getResponseHeader("Etag"))d.etag[k]=y}if(a===304)c="notmodified",q=!0;else try{t=bQ(e,w),c="success",q=!0}catch(z){c="parsererror",v=z}}else{v=c;if(!c||a)c="error",a<0&&(a=0)}u.status=a,u.statusText=c,q?h.resolveWith(f,[t,c,u]):h.rejectWith(f,[u,c,v]),u.statusCode(j),j=b,s&&g.trigger("ajax"+(q?"Success":"Error"),[u,e,q?t:v]),i.resolveWith(f,[u,c]),s&&(g.trigger("ajaxComplete",[u,e]),--d.active||d.event.trigger("ajaxStop"))}}typeof a==="object"&&(c=a,a=b),c=c||{};var e=d.ajaxSetup({},c),f=e.context||e,g=f!==e&&(f.nodeType||f instanceof d)?d(f):d.event,h=d.Deferred(),i=d._Deferred(),j=e.statusCode||{},k,l={},m,n,o,p,q,r=0,s,t,u={readyState:0,setRequestHeader:function(a,b){r||(l[a.toLowerCase().replace(bD,bE)]=b);return this},getAllResponseHeaders:function(){return r===2?m:null},getResponseHeader:function(a){var c;if(r===2){if(!n){n={};while(c=bt.exec(m))n[c[1].toLowerCase()]=c[2]}c=n[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){r||(e.mimeType=a);return this},abort:function(a){a=a||"abort",o&&o.abort(a),v(0,a);return this}};h.promise(u),u.success=u.done,u.error=u.fail,u.complete=i.done,u.statusCode=function(a){if(a){var b;if(r<2)for(b in a)j[b]=[j[b],a[b]];else b=a[u.status],u.then(b,b)}return this},e.url=((a||e.url)+"").replace(bs,"").replace(bx,bK[1]+"//"),e.dataTypes=d.trim(e.dataType||"*").toLowerCase().split(bB),e.crossDomain||(q=bF.exec(e.url.toLowerCase()),e.crossDomain=q&&(q[1]!=bK[1]||q[2]!=bK[2]||(q[3]||(q[1]==="http:"?80:443))!=(bK[3]||(bK[1]==="http:"?80:443)))),e.data&&e.processData&&typeof e.data!=="string"&&(e.data=d.param(e.data,e.traditional)),bN(bH,e,c,u);if(r===2)return!1;s=e.global,e.type=e.type.toUpperCase(),e.hasContent=!bw.test(e.type),s&&d.active++===0&&d.event.trigger("ajaxStart");if(!e.hasContent){e.data&&(e.url+=(by.test(e.url)?"&":"?")+e.data),k=e.url;if(e.cache===!1){var w=d.now(),x=e.url.replace(bC,"$1_="+w);e.url=x+(x===e.url?(by.test(e.url)?"&":"?")+"_="+w:"")}}if(e.data&&e.hasContent&&e.contentType!==!1||c.contentType)l["Content-Type"]=e.contentType;e.ifModified&&(k=k||e.url,d.lastModified[k]&&(l["If-Modified-Since"]=d.lastModified[k]),d.etag[k]&&(l["If-None-Match"]=d.etag[k])),l.Accept=e.dataTypes[0]&&e.accepts[e.dataTypes[0]]?e.accepts[e.dataTypes[0]]+(e.dataTypes[0]!=="*"?", */*; q=0.01":""):e.accepts["*"];for(t in e.headers)u.setRequestHeader(t,e.headers[t]);if(e.beforeSend&&(e.beforeSend.call(f,u,e)===!1||r===2)){u.abort();return!1}for(t in {success:1,error:1,complete:1})u[t](e[t]);o=bN(bI,e,c,u);if(o){u.readyState=1,s&&g.trigger("ajaxSend",[u,e]),e.async&&e.timeout>0&&(p=setTimeout(function(){u.abort("timeout")},e.timeout));try{r=1,o.send(l,v)}catch(y){status<2?v(-1,y):d.error(y)}}else v(-1,"No Transport");return u},param:function(a,c){var e=[],f=function(a,b){b=d.isFunction(b)?b():b,e[e.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=d.ajaxSettings.traditional);if(d.isArray(a)||a.jquery&&!d.isPlainObject(a))d.each(a,function(){f(this.name,this.value)});else for(var g in a)bO(g,a[g],c,f);return e.join("&").replace(bp,"+")}}),d.extend({active:0,lastModified:{},etag:{}});var bR=d.now(),bS=/(\=)\?(&|$)|()\?\?()/i;d.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return d.expando+"_"+bR++}}),d.ajaxPrefilter("json jsonp",function(b,c,e){var f=typeof b.data==="string";if(b.dataTypes[0]==="jsonp"||c.jsonpCallback||c.jsonp!=null||b.jsonp!==!1&&(bS.test(b.url)||f&&bS.test(b.data))){var g,h=b.jsonpCallback=d.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2",m=function(){a[h]=i,g&&d.isFunction(i)&&a[h](g[0])};b.jsonp!==!1&&(j=j.replace(bS,l),b.url===j&&(f&&(k=k.replace(bS,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},e.then(m,m),b.converters["script json"]=function(){g||d.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),d.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){d.globalEval(a);return a}}}),d.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),d.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var bT=d.now(),bU,bV;d.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&bX()||bY()}:bX,bV=d.ajaxSettings.xhr(),d.support.ajax=!!bV,d.support.cors=bV&&"withCredentials"in bV,bV=b,d.support.ajax&&d.ajaxTransport(function(a){if(!a.crossDomain||d.support.cors){var c;return{send:function(e,f){var g=a.xhr(),h,i;a.username?g.open(a.type,a.url,a.async,a.username,a.password):g.open(a.type,a.url,a.async);if(a.xhrFields)for(i in a.xhrFields)g[i]=a.xhrFields[i];a.mimeType&&g.overrideMimeType&&g.overrideMimeType(a.mimeType),(!a.crossDomain||a.hasContent)&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(i in e)g.setRequestHeader(i,e[i])}catch(j){}g.send(a.hasContent&&a.data||null),c=function(e,i){var j,k,l,m,n;try{if(c&&(i||g.readyState===4)){c=b,h&&(g.onreadystatechange=d.noop,delete bU[h]);if(i)g.readyState!==4&&g.abort();else{j=g.status,l=g.getAllResponseHeaders(),m={},n=g.responseXML,n&&n.documentElement&&(m.xml=n),m.text=g.responseText;try{k=g.statusText}catch(o){k=""}j||!a.isLocal||a.crossDomain?j===1223&&(j=204):j=m.text?200:404}}}catch(p){i||f(-1,p)}m&&f(j,k,m,l)},a.async&&g.readyState!==4?(bU||(bU={},bW()),h=bT++,g.onreadystatechange=bU[h]=c):c()},abort:function(){c&&c(0,1)}}}});var bZ={},b$=/^(?:toggle|show|hide)$/,b_=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,ca,cb=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];d.fn.extend({show:function(a,b,c){var e,f;if(a||a===0)return this.animate(cc("show",3),a,b,c);for(var g=0,h=this.length;g=0;a--)c[a].elem===this&&(b&&c[a](!0),c.splice(a,1))}),b||this.dequeue();return this}}),d.each({slideDown:cc("show",1),slideUp:cc("hide",1),slideToggle:cc("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){d.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),d.extend({speed:function(a,b,c){var e=a&&typeof a==="object"?d.extend({},a):{complete:c||!c&&b||d.isFunction(a)&&a,duration:a,easing:c&&b||b&&!d.isFunction(b)&&b};e.duration=d.fx.off?0:typeof e.duration==="number"?e.duration:e.duration in d.fx.speeds?d.fx.speeds[e.duration]:d.fx.speeds._default,e.old=e.complete,e.complete=function(){e.queue!==!1&&d(this).dequeue(),d.isFunction(e.old)&&e.old.call(this)};return e},easing:{linear:function(a,b,c,d){return c+d*a},swing:function(a,b,c,d){return(-Math.cos(a*Math.PI)/2+.5)*d+c}},timers:[],fx:function(a,b,c){this.options=b,this.elem=a,this.prop=c,b.orig||(b.orig={})}}),d.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this),(d.fx.step[this.prop]||d.fx.step._default)(this)},cur:function(){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];var a,b=d.css(this.elem,this.prop);return isNaN(a=parseFloat(b))?!b||b==="auto"?0:b:a},custom:function(a,b,c){function g(a){return e.step(a)}var e=this,f=d.fx;this.startTime=d.now(),this.start=a,this.end=b,this.unit=c||this.unit||(d.cssNumber[this.prop]?"":"px"),this.now=this.start,this.pos=this.state=0,g.elem=this.elem,g()&&d.timers.push(g)&&!ca&&(ca=setInterval(f.tick,f.interval))},show:function(){this.options.orig[this.prop]=d.style(this.elem,this.prop),this.options.show=!0,this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur()),d(this.elem).show()},hide:function(){this.options.orig[this.prop]=d.style(this.elem,this.prop),this.options.hide=!0,this.custom(this.cur(),0)},step:function(a){var b=d.now(),c=!0;if(a||b>=this.options.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),this.options.curAnim[this.prop]=!0;for(var e in this.options.curAnim)this.options.curAnim[e]!==!0&&(c=!1);if(c){if(this.options.overflow!=null&&!d.support.shrinkWrapBlocks){var f=this.elem,g=this.options;d.each(["","X","Y"],function(a,b){f.style["overflow"+b]=g.overflow[a]})}this.options.hide&&d(this.elem).hide();if(this.options.hide||this.options.show)for(var h in this.options.curAnim)d.style(this.elem,h,this.options.orig[h]);this.options.complete.call(this.elem)}return!1}var i=b-this.startTime;this.state=i/this.options.duration;var j=this.options.specialEasing&&this.options.specialEasing[this.prop],k=this.options.easing||(d.easing.swing?"swing":"linear");this.pos=d.easing[j||k](this.state,i,0,1,this.options.duration),this.now=this.start+(this.end-this.start)*this.pos,this.update();return!0}},d.extend(d.fx,{tick:function(){var a=d.timers;for(var b=0;b
    ";d.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"}),b.innerHTML=j,a.insertBefore(b,a.firstChild),e=b.firstChild,f=e.firstChild,h=e.nextSibling.firstChild.firstChild,this.doesNotAddBorder=f.offsetTop!==5,this.doesAddBorderForTableAndCells=h.offsetTop===5,f.style.position="fixed",f.style.top="20px",this.supportsFixedPosition=f.offsetTop===20||f.offsetTop===15,f.style.position=f.style.top="",e.style.overflow="hidden",e.style.position="relative",this.subtractsBorderForOverflowNotVisible=f.offsetTop===-5,this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==i,a.removeChild(b),a=b=e=f=g=h=null,d.offset.initialize=d.noop},bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;d.offset.initialize(),d.offset.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(d.css(a,"marginTop"))||0,c+=parseFloat(d.css(a,"marginLeft"))||0);return{top:b,left:c}},setOffset:function(a,b,c){var e=d.css(a,"position");e==="static"&&(a.style.position="relative");var f=d(a),g=f.offset(),h=d.css(a,"top"),i=d.css(a,"left"),j=e==="absolute"&&d.inArray("auto",[h,i])>-1,k={},l={},m,n;j&&(l=f.position()),m=j?l.top:parseInt(h,10)||0,n=j?l.left:parseInt(i,10)||0,d.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):f.css(k)}},d.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),e=cf.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(d.css(a,"marginTop"))||0,c.left-=parseFloat(d.css(a,"marginLeft"))||0,e.top+=parseFloat(d.css(b[0],"borderTopWidth"))||0,e.left+=parseFloat(d.css(b[0],"borderLeftWidth"))||0;return{top:c.top-e.top,left:c.left-e.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&(!cf.test(a.nodeName)&&d.css(a,"position")==="static"))a=a.offsetParent;return a})}}),d.each(["Left","Top"],function(a,c){var e="scroll"+c;d.fn[e]=function(c){var f=this[0],g;if(!f)return null;if(c!==b)return this.each(function(){g=cg(this),g?g.scrollTo(a?d(g).scrollLeft():c,a?c:d(g).scrollTop()):this[e]=c});g=cg(f);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:d.support.boxModel&&g.document.documentElement[e]||g.document.body[e]:f[e]}}),d.each(["Height","Width"],function(a,c){var e=c.toLowerCase();d.fn["inner"+c]=function(){return this[0]?parseFloat(d.css(this[0],e,"padding")):null},d.fn["outer"+c]=function(a){return this[0]?parseFloat(d.css(this[0],e,a?"margin":"border")):null},d.fn[e]=function(a){var f=this[0];if(!f)return a==null?null:this;if(d.isFunction(a))return this.each(function(b){var c=d(this);c[e](a.call(this,b,c[e]()))});if(d.isWindow(f)){var g=f.document.documentElement["client"+c];return f.document.compatMode==="CSS1Compat"&&g||f.document.body["client"+c]||g}if(f.nodeType===9)return Math.max(f.documentElement["client"+c],f.body["scroll"+c],f.documentElement["scroll"+c],f.body["offset"+c],f.documentElement["offset"+c]);if(a===b){var h=d.css(f,e),i=parseFloat(h);return d.isNaN(i)?h:i}return this.css(e,typeof a==="string"?a:a+"px")}}),a.jQuery=a.$=d})(window); \ No newline at end of file diff --git a/courtside/game/static/js/script.js b/courtside/game/static/js/script.js new file mode 100644 index 0000000..750842e --- /dev/null +++ b/courtside/game/static/js/script.js @@ -0,0 +1,26 @@ +/* Author: + +*/ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/courtside/game/static/js/search.js b/courtside/game/static/js/search.js new file mode 100644 index 0000000..e4ecd20 --- /dev/null +++ b/courtside/game/static/js/search.js @@ -0,0 +1,9 @@ +$('#search_map').submit(function(e){ + e.preventDefault(); +}); + +$('#search').keyup(function(e) { + if (e.keyCode == 13) { + codeAddress(); + } +}); \ No newline at end of file diff --git a/courtside/game/static/stylesheets/960_12_col.css b/courtside/game/static/stylesheets/960_12_col.css new file mode 100644 index 0000000..48e86ee --- /dev/null +++ b/courtside/game/static/stylesheets/960_12_col.css @@ -0,0 +1,357 @@ +/* + 960 Grid System ~ Core CSS. + Learn more ~ http://960.gs/ + + Licensed under GPL and MIT. +*/ + +/* + Forces backgrounds to span full width, + even if there is horizontal scrolling. + Increase this if your layout is wider. + + Note: IE6 works fine without this fix. +*/ + +body { + min-width: 960px; +} + +/* `Container +----------------------------------------------------------------------------------------------------*/ + +.container_12 { + margin-left: auto; + margin-right: auto; + width: 960px; +} + +/* `Grid >> Global +----------------------------------------------------------------------------------------------------*/ + +.grid_1, +.grid_2, +.grid_3, +.grid_4, +.grid_5, +.grid_6, +.grid_7, +.grid_8, +.grid_9, +.grid_10, +.grid_11, +.grid_12 { + display: inline; + float: left; + margin-left: 10px; + margin-right: 10px; +} + +.push_1, .pull_1, +.push_2, .pull_2, +.push_3, .pull_3, +.push_4, .pull_4, +.push_5, .pull_5, +.push_6, .pull_6, +.push_7, .pull_7, +.push_8, .pull_8, +.push_9, .pull_9, +.push_10, .pull_10, +.push_11, .pull_11 { + position: relative; +} + +/* `Grid >> Children (Alpha ~ First, Omega ~ Last) +----------------------------------------------------------------------------------------------------*/ + +.alpha { + margin-left: 0; +} + +.omega { + margin-right: 0; +} + +/* `Grid >> 12 Columns +----------------------------------------------------------------------------------------------------*/ + +.container_12 .grid_1 { + width: 60px; +} + +.container_12 .grid_2 { + width: 140px; +} + +.container_12 .grid_3 { + width: 220px; +} + +.container_12 .grid_4 { + width: 300px; +} + +.container_12 .grid_5 { + width: 380px; +} + +.container_12 .grid_6 { + width: 460px; +} + +.container_12 .grid_7 { + width: 540px; +} + +.container_12 .grid_8 { + width: 620px; +} + +.container_12 .grid_9 { + width: 700px; +} + +.container_12 .grid_10 { + width: 780px; +} + +.container_12 .grid_11 { + width: 860px; +} + +.container_12 .grid_12 { + width: 940px; +} + +/* `Prefix Extra Space >> 12 Columns +----------------------------------------------------------------------------------------------------*/ + +.container_12 .prefix_1 { + padding-left: 80px; +} + +.container_12 .prefix_2 { + padding-left: 160px; +} + +.container_12 .prefix_3 { + padding-left: 240px; +} + +.container_12 .prefix_4 { + padding-left: 320px; +} + +.container_12 .prefix_5 { + padding-left: 400px; +} + +.container_12 .prefix_6 { + padding-left: 480px; +} + +.container_12 .prefix_7 { + padding-left: 560px; +} + +.container_12 .prefix_8 { + padding-left: 640px; +} + +.container_12 .prefix_9 { + padding-left: 720px; +} + +.container_12 .prefix_10 { + padding-left: 800px; +} + +.container_12 .prefix_11 { + padding-left: 880px; +} + +/* `Suffix Extra Space >> 12 Columns +----------------------------------------------------------------------------------------------------*/ + +.container_12 .suffix_1 { + padding-right: 80px; +} + +.container_12 .suffix_2 { + padding-right: 160px; +} + +.container_12 .suffix_3 { + padding-right: 240px; +} + +.container_12 .suffix_4 { + padding-right: 320px; +} + +.container_12 .suffix_5 { + padding-right: 400px; +} + +.container_12 .suffix_6 { + padding-right: 480px; +} + +.container_12 .suffix_7 { + padding-right: 560px; +} + +.container_12 .suffix_8 { + padding-right: 640px; +} + +.container_12 .suffix_9 { + padding-right: 720px; +} + +.container_12 .suffix_10 { + padding-right: 800px; +} + +.container_12 .suffix_11 { + padding-right: 880px; +} + +/* `Push Space >> 12 Columns +----------------------------------------------------------------------------------------------------*/ + +.container_12 .push_1 { + left: 80px; +} + +.container_12 .push_2 { + left: 160px; +} + +.container_12 .push_3 { + left: 240px; +} + +.container_12 .push_4 { + left: 320px; +} + +.container_12 .push_5 { + left: 400px; +} + +.container_12 .push_6 { + left: 480px; +} + +.container_12 .push_7 { + left: 560px; +} + +.container_12 .push_8 { + left: 640px; +} + +.container_12 .push_9 { + left: 720px; +} + +.container_12 .push_10 { + left: 800px; +} + +.container_12 .push_11 { + left: 880px; +} + +/* `Pull Space >> 12 Columns +----------------------------------------------------------------------------------------------------*/ + +.container_12 .pull_1 { + left: -80px; +} + +.container_12 .pull_2 { + left: -160px; +} + +.container_12 .pull_3 { + left: -240px; +} + +.container_12 .pull_4 { + left: -320px; +} + +.container_12 .pull_5 { + left: -400px; +} + +.container_12 .pull_6 { + left: -480px; +} + +.container_12 .pull_7 { + left: -560px; +} + +.container_12 .pull_8 { + left: -640px; +} + +.container_12 .pull_9 { + left: -720px; +} + +.container_12 .pull_10 { + left: -800px; +} + +.container_12 .pull_11 { + left: -880px; +} + +/* `Clear Floated Elements +----------------------------------------------------------------------------------------------------*/ + +/* http://sonspring.com/journal/clearing-floats */ + +.clear { + clear: both; + display: block; + overflow: hidden; + visibility: hidden; + width: 0; + height: 0; +} + +/* http://www.yuiblog.com/blog/2010/09/27/clearfix-reloaded-overflowhidden-demystified */ + +.clearfix:before, +.clearfix:after, +.container_12:before, +.container_12:after { + content: '.'; + display: block; + overflow: hidden; + visibility: hidden; + font-size: 0; + line-height: 0; + width: 0; + height: 0; +} + +.clearfix:after, +.container_12:after { + clear: both; +} + +/* + The following zoom:1 rule is specifically for IE6 + IE7. + Move to separate stylesheet if invalid CSS is a problem. +*/ + +.clearfix, +.container_12 { + zoom: 1; +} \ No newline at end of file diff --git a/courtside/game/static/stylesheets/style.css b/courtside/game/static/stylesheets/style.css new file mode 100644 index 0000000..b676fb9 --- /dev/null +++ b/courtside/game/static/stylesheets/style.css @@ -0,0 +1,300 @@ +/* HTML5 ✰ Boilerplate */ +html, body, div, span, object, iframe, +h1, h2, h3, h4, h5, h6, p, blockquote, pre, +abbr, address, cite, code, del, dfn, em, img, ins, kbd, q, samp, +small, strong, sub, sup, var, b, i, dl, dt, dd, ol, ul, li, +fieldset, form, label, legend, +table, caption, tbody, tfoot, thead, tr, th, td, +article, aside, canvas, details, figcaption, figure, +footer, header, hgroup, menu, nav, section, summary, +time, mark, audio, video { + margin: 0; + padding: 0; + border: 0; + font-size: 100%; + font: inherit; + vertical-align: baseline; +} +article, aside, details, figcaption, figure, +footer, header, hgroup, menu, nav, section { + display: block; +} +table { border-collapse: collapse; border-spacing: 0; } +input, select { vertical-align: middle; } +select, input, textarea, button { font:99% sans-serif; } +pre, code, kbd, samp { font-family: monospace, sans-serif; } +html { overflow-y: scroll; } +a:hover, a:active { outline: none; } +nav ul, nav li { margin: 0; list-style:none; list-style-image: none; } +small { font-size: 85%; } +strong, th { font-weight: bold; } +td { vertical-align: top; } +pre { + white-space: pre; white-space: pre-wrap; word-wrap: break-word; + padding: 15px; } +textarea { overflow: auto; } +.ie6 legend, .ie7 legend { margin-left: -7px; } +input[type="radio"] { vertical-align: text-bottom; } +input[type="checkbox"] { vertical-align: bottom; } +.ie7 input[type="checkbox"] { vertical-align: baseline; } +.ie6 input { vertical-align: text-bottom; } +label, input[type="button"], input[type="submit"], input[type="image"], button { cursor: pointer; } +button, input, select, textarea { margin: 0; } +input:valid, textarea:valid { } +input:invalid, textarea:invalid { + border-radius: 1px; -moz-box-shadow: 0px 0px 5px red; -webkit-box-shadow: 0px 0px 5px red; box-shadow: 0px 0px 5px red; } +.no-boxshadow input:invalid, .no-boxshadow textarea:invalid { background-color: #f0dddd; } +::-moz-selection{ background: #f02b21; color:#fff; text-shadow: none; } +::selection { background:#f02b21; color:#fff; text-shadow: none; } +a:link { -webkit-tap-highlight-color: #FF5E99; } +button { width: auto; overflow: visible; } + + +html, body, #wrapper { height: 100%; } +body > #wrapper { height: auto; min-height: 100%; } +body { background: #fdfdfd; } +body, select, input, textarea { + color: #444; + font-family: Georgia, serif; + font-size: 14px; +} + +h1, h2, h3, h4, h5, h6 { padding-bottom: 15px; } +h1 { font-size: 45px; } +h2 { font-size: 26px; } +h3 { font-size: 18px; } +h4 { font-size: 16px; } +a, a:active, a:visited { color: #f02b21; text-decoration: none; } +a:hover { color: #444; text-decoration: underline; } + +/** + * Primary styles + * Author: Serena Ngai + */ + +.baseball_icon { background: url("../images/baseball.png") left top no-repeat; } +.basketball_icon { background: url("../images/basketball.png") left top no-repeat; } +.hockey_icon { background: url("../images/hockey.png") left 5px no-repeat; } +.soccer_icon { background: url("../images/soccer.png") left top no-repeat; } +.volleyball_icon { background: url("../images/volleyball.png") left top no-repeat; } + +.button { margin-bottom: 5px; + -moz-border-radius: 2px; + -webkit-border-radius: 2px; + border-radius: 2px; } +.button, .button a { display: block; padding: 4px 0 4px 17px; } +.button a { color: #fff; font-family: 'Francois One', sans-serif; font-size: 18px; text-decoration: none; } +.button:hover { background: #444; } + .email { background: url("../images/email.png") 15px center no-repeat #f02b21; } + .email.button:hover { background: url("../images/email.png") 15px center no-repeat #444; } + .twitter { background: url("../images/twitter.png") 15px center no-repeat #f02b21; } + .twitter.button:hover { background: url("../images/twitter.png") 15px center no-repeat #444; } + .facebook { background: url("../images/facebook.png") 15px center no-repeat #f02b21; } + .facebook.button:hover { background: url("../images/facebook.png") 15px center no-repeat #444; } + +.helptext { color: #999; font-size: 12px; } +.info_label { border-bottom: 1px #ccc dashed; font-style: italic; margin: 25px 0 10px 0; padding-bottom: 10px;} + +.footer_contact .email, .footer_contact .twitter { padding-left: 35px; } + +.game_players { background: url("../images/players.png") left top no-repeat; margin-top: 30px; padding: 6px 0 0 40px; } +.game_title { font-family: 'Francois One', sans-serif; } + +.group { background-color: #ebe7e1; margin: 30px 0; padding: 30px 18px 18px; position: relative; } + +.headline { color: #f02b21; font-family: 'Francois One', sans-serif; } + +.input_text { border: 2px #ccc solid; padding: 5px; width: 207px; } +.input_button { background: #f02b21; border: none; color: #fff; font-family: 'Francois One', sans-serif; font-size: 18px; padding: 4px 17px; + -moz-border-radius: 2px; + -webkit-border-radius: 2px; + border-radius: 2px; } +.input_button:hover { background: #444; } + +.info { color: #aaa; font-size: 12px; font-style: italic; } + +.signup_heading { font-family: 'Francois One', sans-serif; padding-bottom: 0px; text-align: center; } + +.results_title { background: url("../images/title.png") top left no-repeat; color: #fff; font-family: 'Francois One', sans-serif; font-size: 23px; left: -10px; letter-spacing: 0.03em; padding: 1px 10px; position: absolute; text-transform: uppercase; top: -18px; width: 175px; } +.summary_list { list-style: none; } +.summary_list li { min-height: 26px; padding: 0 0 20px 35px; } + +.summary_list .game_title { font-family: Helvetica, Arial, sans-serif; } +.summary_list .game_title span { font-weight: bold; } +.summary_list .game_summary_detail { font-style: italic; font-size: 12px; } +.summary_list .view_more_games { font-style: italic; text-align: right; padding: 0; } + +.tags .baseball, .tags .baseball input { background-color: #ffb518; } +.tags .basketball, .tags .basketball input { background-color: #f0652a; } +.tags .hockey, .tags .hockey input { background-color: #01b0c5; } +.tags .soccer, .tags .soccer input { background-color: #08ab50; } +.tags .volleyball, .tags .volleyball input { background-color: #92278f; } + +.tags { border-bottom: 1px #ddd dashed; list-style: none; padding: 30px 0 25px; } +.tags li, .tags input { border: none; display: block; height: 30px; position: relative; + -moz-border-radius: 2px; + -webkit-border-radius: 2px; + border-radius: 2px; } +.tags li { display: inline-block; margin-bottom: 5px; } +.tags li.hide { background: #ddd; } +.tags a { color: #fff; } + + +.tags input:hover { background:url("../images/x.png") 90% 11px no-repeat #ddd; } +.tags input { background:url("../images/x.png") 90% 11px no-repeat; padding-right: 25px; } +.tags input, .tags a, .game_type { color: #fff; font-family: Helvetica, Arial, sans-serif; font-size: 14px; letter-spacing: 0.02em; text-decoration: none; } + +.user_detail { color: #999; font-size: 13px; } + + + + + +#about_courtside { border-right: 1px #ddd dashed; height: 600px; margin-right: 70px; padding-right: 70px; } +#about_courtside p { padding-bottom: 12px; } +#about_courtside, #about_contact, #about_team { margin-top: 40px; } +#about_contact .email, #about_contact .twitter { padding-left: 35px; } +#about_from_team { font-style: italic; } +#about_team ul { list-style: none; } +#about_team li { padding-bottom: 20px; } +#about_team h3 { font-family: 'Francois One', sans-serif; padding-bottom: 0; } +#about_team p { color: #999; font-style: italic; } + +#container { overflow: auto; margin-bottom: 50px; padding-bottom: 150px; } + +#footer { background-color: #ebe7e1; font-family: Helvetica, Arial, sans-serif; position: relative; margin-top: -150px; height: 150px; clear: both; } +#footer a { color: #777; } +#footer_container { padding-top: 20px; } +#footer ul { list-style: none; } +#footer li { padding-bottom: 5px; } +#footer_copyright { font-size: 11px; padding-top: 16px; text-align: center; } + +#game_info { margin-top: 25px; } +#game_col_left { margin-left: 30px; } +#game_col_left .game_type { display: inline-block; font-size: 16px; padding: 10px 0 0; text-transform: uppercase; + -moz-border-radius: 2px; + -webkit-border-radius: 2px; + border-radius: 2px; } +#game_col_left .game_type.baseball { color: #ffb518; } +#game_col_left .game_type.basketball { color: #f0652a; } +#game_col_left .game_type.hockey { color: #01b0c5; } +#game_col_left .game_type.soccer { color: #08ab50; } +#game_col_left .game_type.volleyball { color: #92278f; } + +#game_comments { background: url("../images/comments.png") left top no-repeat; margin-top: 25px; padding: 5px 0 0 40px; } +#game_comment_form .input_text { width: 100%; } +#game_comment_form .input_button { font-family: Helvetica, Arial, sans-serif; font-size: 14px; margin: 10px 0 0; } + +.game_heading { padding: 0 0 20px 35px; } +#game_location { background: url("../images/location.png") left top no-repeat; } +#game_date_time { background: url("../images/date.png") left top no-repeat; } +#game_restriction { background: url("../images/restrictions.png") left top no-repeat; } +#game_restriction li { padding-bottom: 10px; } + +#game_map { border: 10px #ebe7e1 solid; height: 250px; position: relative; } +#game_col_left .game_title { line-height: 26px; padding-left: 32px; } +#game_players_list, #game_comments_list { list-style: none; } +#game_players_list li { display: inline-block; float: left; margin-right: 10px; padding-bottom: 10px; } +#game_comments_list .info { margin-top: 5px; } +#game_players_list img { border: 1px #aaa solid; display: block; height: 50px; width: 50px; } +#game_comments_list li { border-bottom: 1px #ddd dotted; margin-bottom: 20px; padding-bottom: 20px; } + +#join_game, #leave_game { float: right; } +#join_game, #join_game a +#leave_game, #leave_game a { background: #f02b21; display: block; font-family: 'Francois One', sans-serif; font-size: 25px; text-align: center; + -moz-border-radius: 2px; + -webkit-border-radius: 2px; + border-radius: 2px; } +#join_game a, #leave_game a { color: #fff; display: inline-block; padding: 3px 0; width: 250px; } +#join_game a:hover, #leave_game a:hover { background: #444; text-decoration: none; } + +#leave_game, #leave_game a { background: #0092ff; } +#logo { padding: 0 20px 20px 0; position: relative; } +#logo p { color: #f02b21; font-family: 'Francois One', sans-serif; font-size: 15px; position: absolute; right: 0; top: 60px; } +#login_heading { font-family: 'Francois One', sans-serif; padding: 35px 0 15px; text-align: center; } +#login_email p { padding-bottom: 5px; text-align: right; } + +#map { border: 10px #ebe7e1 solid; height: 500px; position: relative; z-index: 1; } +#map_filter_time { padding-top: 30px; } +#map_filter_time h4 { font-family: Helvetica, Arial, sans-serif; } +#map_filter_time label { font-size: 12px; font-style: italic; } +#map_search { margin-left: 0; margin-right: 0; } +#map_heading { font-family: 'Francois One', sans-serif; line-height: 34px; } +#map:before { content: ""; display: block; position: absolute; z-index: -1; top: 0; left:0; right: 0; bottom: 0; border: 3px #fff solid; } + +#nav { font-family: Helvetica, Arial, sans-serif; list-style: none; font-weight: bold; padding: 100px 0 0; margin: 0; } +#nav li, #nav li a { display: inline-block; padding: 6px 8px; + -moz-border-radius: 2px; + -webkit-border-radius: 2px; + border-radius: 2px; } +#nav li a:hover { border-bottom: 3px #f02b21 solid; color: #f02b21; text-decoration: none; } +#nav .selected { border-bottom: 3px #f02b21 solid; color: #f02b21; } +#nav #login_button, #nav #logout_button { float: right; } +#nav #login_button a { background: url("../images/lock.png") 0 0 no-repeat; display: block; line-height: 15px; padding-left: 20px; } + +#logo_single { padding-top: 80px; } +#logo_register a, #logo_single a { text-align: center; } + +#oops { padding: 30px 0; text-align: center; } +#oops .error { border-right: 5px solid #f02b21; display: inline-block; font-size: 100px; margin-right: 30px; padding-right: 30px; } +#oops .message { font-size: 50px; } +.oops_message { font-style: italic; padding-bottom: 5px; text-align: center; } + +#profile_edit { padding-top: 10px; } +#profile_gravatar { border: 10px #ebe7e1 solid; height: 250px; width: 250px; } +#profile_greeting { font-family: 'Francois One', sans-serif; } +#profile_games_joined .results_title, #profile_more_upcoming .results_title { background: #F02B21; width: 268px; } + +#profile_user_details { list-style: none; padding-right: 20px; } +#profile_user_details .tags { border: 0; padding: 0; } +#profile_user_details .tags a { border: 0; padding: 0; } +#profile_user_details .tags a:before { background: none; } +#profile_user_details .tags li { height: 100%; padding: 5px 10px; margin: 0; } + +#profile_more_upcoming { margin-top: 45px; } + +#single_form_container { background-color: #ebe7e1; height: 550px; margin: 25px 0; position: relative; + -moz-border-radius: 5px; + -webkit-border-radius: 5px; + border-radius: 5px; } +#single_form_container label { display: inline-block; text-align: right; width: 124px; } +#single_form_container p { padding-bottom: 5px; } +#single_form_container ul { list-style: none; margin: 0 auto; padding-left: 30px; width: 116px; } +#single_form_container ul label { text-align: left; } +#single_form_container ul input[type="checkbox"] { float: left; margin-right: 10px; } +#single_form { font-style: italic; width: 450px; } +#login_email { padding: 0 20px 0 0; } + + +#search_map { border-bottom: 1px #ddd dashed; padding-bottom: 35px; } +#search_map label { background: url("../images/location.png") left top no-repeat; float: left; font-family: Helvetica, Arial, sans-serif; padding: 6px 0 12px 30px; text-transform: uppercase; } +#search_map .input_button { float: right; margin-top: 5px; } + +#search_results .results_title { background: #F02B21; width: 172px; } + +#signup_methods, #login_methods { text-align: center; margin: 0 auto; padding: 8px 0; width: 580px; } +#signup_email, #login_email { border-right: 1px #ccc solid; float: left; font-style: italic; padding: 10px 12px 0 0; width: 305px; } +#login_email { padding: 0 20px 0 0; } +#signup_email label, #login_email label, #register label { padding-right: 10px; } +#signup_email .input_button, #login_email .input_button { margin-top: 10px; width: 275px; } +#signup_thirdparty, #login_thirdparty { float: right; list-style: none; width: 233px; } + +#signup, #login { background-color: #ebe7e1; height: 252px; margin: 25px 0; position: relative; } +#signup:before, #login:before { content: ""; position: absolute; top: 0; left: 0; border-width: 125px; border-style: solid; border-color: transparent transparent transparent #fdfdfd; } +#signup:after, #login:after { content: ""; position: absolute; top: 0; right: 0; border-width: 125px; border-style: solid; border-color: transparent #fdfdfd transparent transparent; } +#signup h3 { padding-top: 25px; } +#signup h2 { background: url("../images/characters.png") 50% 45px no-repeat; padding-bottom: 45px; } + +#this_week { margin-right: 88px; } + + + + + +/* image replacement */ +.ir { display: block; text-indent: -999em; overflow: hidden; background-repeat: no-repeat; text-align: left; direction: ltr; } + +/* clearfix */ +.clearfix:before, .clearfix:after { content: "\0020"; display: block; height: 0; overflow: hidden; } +.clearfix:after { clear: both; } +.clearfix { zoom: 1; } \ No newline at end of file diff --git a/courtside/game/static/stylesheets/timePicker.css b/courtside/game/static/stylesheets/timePicker.css new file mode 100755 index 0000000..0b037e8 --- /dev/null +++ b/courtside/game/static/stylesheets/timePicker.css @@ -0,0 +1,29 @@ +div.time-picker { + position: absolute; + height: 191px; + width:8em; /* needed for IE */ + overflow: auto; + background: #fff; + border: 1px solid #aaa; + z-index: 99; + margin: 0; +} +div.time-picker-12hours { + width:6em; /* needed for IE */ +} + +div.time-picker ul { + list-style-type: none; + margin: 0; + padding: 0; +} +div.time-picker li { + cursor: pointer; + height: 10px; + font: 12px/1 Helvetica, Arial, sans-serif; + padding: 4px 3px; +} +div.time-picker li.selected { + background: #0063CE; + color: #fff; +} \ No newline at end of file diff --git a/courtside/game/tasks.py b/courtside/game/tasks.py new file mode 100644 index 0000000..5e1f465 --- /dev/null +++ b/courtside/game/tasks.py @@ -0,0 +1,43 @@ +from celery.task import Task +from celery.registry import tasks +from django.contrib.auth.models import User +from django.core.mail import EmailMultiAlternatives +from django.template.loader import render_to_string +from django.utils.html import strip_tags +from celery.task.schedules import crontab +from celery.decorators import periodic_task + + + + + +@periodic_task(run_every=crontab(hour="*", minute="*", day_of_week="*")) +def game_signup_summary(): + GameTask.delay() + + + +class GameTask(Task): + + def run(self): + """ This method is for emailing the user once a day for games digest + + Keyword arguments: + cwe -- that is being requested by the user + user -- the user that is driving this request + """ + + + email = user.email + user = user + subject, from_email, to = 'Welcome', 'games@courtside.me', email + html_content = render_to_string('email_signup.html', {'user':user.first_name}) + text_content = strip_tags(html_content) + # create the email, and attach the HTML version as well. + msg = EmailMultiAlternatives(subject, text_content, from_email, [to]) + msg.attach_alternative(html_content, "text/html") + msg.send() + + +# register the task with celery +tasks.register(GameTask) diff --git a/courtside/game/tests.py b/courtside/game/tests.py new file mode 100644 index 0000000..501deb7 --- /dev/null +++ b/courtside/game/tests.py @@ -0,0 +1,16 @@ +""" +This file demonstrates writing tests using the unittest module. These will pass +when you run "manage.py test". + +Replace this with more appropriate tests for your application. +""" + +from django.test import TestCase + + +class SimpleTest(TestCase): + def test_basic_addition(self): + """ + Tests that 1 + 1 always equals 2. + """ + self.assertEqual(1 + 1, 2) diff --git a/courtside/game/views.py b/courtside/game/views.py new file mode 100644 index 0000000..e233bf4 --- /dev/null +++ b/courtside/game/views.py @@ -0,0 +1,139 @@ +from datetime import datetime + +from django.contrib.auth import authenticate, login, logout +from django.contrib.auth.models import User +from django.contrib.auth.decorators import login_required +from django.shortcuts import render_to_response, render, redirect, get_object_or_404 +from django.http import HttpResponse, HttpResponseRedirect +from django.http import Http404 + +from register.tasks import GameSignUpTask +from models import Player, Sport, Game +from forms.forms import GameForm + + +def about(request): + return render(request, 'about.html') + +def home(request): + """ This method deals with the profile for the user who just signed in. + It will display upcoming games that the user is interested in and games they said they would be part of. + + I will also display some user info. + """ + if not request.user.is_authenticated(): + soccer = Game.objects.filter(sport=Sport.objects.get(sport="soccer"), active="true") + volleyball = Game.objects.filter(sport=Sport.objects.get(sport="volleyball"), active="true") + baseball = Game.objects.filter(sport=Sport.objects.get(sport="baseball"), active="true") + hockey = Game.objects.filter(sport=Sport.objects.get(sport="hockey"), active="true") + basketball = Game.objects.filter(sport=Sport.objects.get(sport="basketball"), active="true") + return render(request, 'index.html', {'soccer':soccer, 'hockey':hockey, 'basketball':basketball, 'baseball':baseball, 'volleyball':volleyball}) + + if request.user.is_staff: + return HttpResponseRedirect('/admin/') + + player = Player.objects.get(user = request.user) + sports = player.sports.all() + joined_games = player.game_set.all() + my_games = Game.objects.filter(owner=request.user) + profile_pic_url = player.image_url + return render(request, 'profile.html', {'player': player, 'profile_pic_url': profile_pic_url, 'sports':sports, 'games':my_games|joined_games}) + + + +@login_required(login_url='/login/') +def create(request): + """ User will can create games. + + Keyword arguments: + request - + """ + if request.method == 'POST': + form = GameForm(request.POST) + if form.is_valid(): + print form.cleaned_data + sport = Sport.objects.get(sport=form.cleaned_data['sport']) + player = Player.objects.get(user=request.user) + + game = Game() + game.sport = sport + game.owner = request.user + game.start_date_and_time = datetime.combine(form.cleaned_data['start_date'], form.cleaned_data['start_time']) + game.address = form.cleaned_data['address'] + game.minimum_players = form.cleaned_data['minimum_players'] + game.restrictions = form.cleaned_data['restrictions'] + game.active=True + + if request.POST['lng'] and request.POST['lat']: + game.longitude = request.POST['lng'] + game.latitude = request.POST['lat'] + game.save() + + return HttpResponseRedirect('/game/%s/' % game.id) + + else: + form = GameForm() + return render(request, 'create.html', {'form': form}) + + +def game(request, id): + game = get_object_or_404(Game, pk=id) + owner = Player.objects.get(user = game.owner) + players = game.players.all() + number_of_players = len(players) + 1 #+1 For the owner + joined = False + + if request.user.is_authenticated(): + current_player = Player.objects.get(user = request.user) + current_games = current_player.game_set.all() + if game in current_games: + joined = True + + else: + current_player = None + + game.sport.name = game.sport.sport.lower() + return render(request, 'game.html', {'game':game, 'players':players, 'current_player':current_player, 'joined':joined, 'number_of_players':number_of_players, 'owner':owner}) + +@login_required(login_url='/login/') +def join(request, id): + game = get_object_or_404(Game, pk=id) + player = Player.objects.get(user=request.user) + game.players.add(player) + user = player.user + GameSignUpTask.delay(user, game) + return HttpResponseRedirect('/game/%s/' % id) + +@login_required(login_url='/login/') +def leave(request, id): + game = get_object_or_404(Game, pk=id) + player = Player.objects.get(user=request.user) + game.players.remove(player) + return HttpResponseRedirect('/game/%s/' % id) + +@login_required(login_url='/login/') +def delete(request, id): + game = get_object_or_404(Game, pk=id) + + if request.user != game.owner: + return HttpResponseRedirect('/game/%s/' % id) + + game.players.clear() + game.delete() + + return HttpResponseRedirect('/') + +@login_required(login_url='/login/') +def search(request): + player = Player.objects.get(user = request.user) + sports = {} + for sport in player.sports.all(): + sports[sport.sport] = True; + print sports + games = {} + games['soccer'] = Game.objects.filter(sport=Sport.objects.get(sport="soccer"), active="true") + games['volleyball'] = Game.objects.filter(sport=Sport.objects.get(sport="volleyball"), active="true") + games['baseball'] = Game.objects.filter(sport=Sport.objects.get(sport="baseball"), active="true") + games['hockey'] = Game.objects.filter(sport=Sport.objects.get(sport="hockey"), active="true") + games['basketball'] = Game.objects.filter(sport=Sport.objects.get(sport="basketball"), active="true") + return render(request, 'search.html', {'games':games, 'sports':sports}) \ No newline at end of file diff --git a/courtside/keys/__init__.py b/courtside/keys/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/courtside/keys/keys.py b/courtside/keys/keys.py new file mode 100644 index 0000000..aca4059 --- /dev/null +++ b/courtside/keys/keys.py @@ -0,0 +1,25 @@ +from django.conf import settings + + +if settings.DEBUG is False: + #facebook information + FACEBOOK_APP_ID = '125675444184887' + FACEBOOK_API_KEY = '125675444184887' + FACEBOOK_APP_SECRET = '6ea513bf09efe971bdd533b8c853c82b' + + + #twitter information + CONSUMER_KEY = 'WSKcN7DBwH88GkZc2wT24g' + CONSUMER_SECRET = 'VF1eDbszUthnUrMy3693dU2iSWCK4qQBfvmreCXdhGU' + +else: + #facebook information + FACEBOOK_APP_ID = '202475996473036' + FACEBOOK_API_KEY = '202475996473036' + FACEBOOK_APP_SECRET = 'd379eb66ef57dca6714b81c8a4afd23f' + + #twitter information + CONSUMER_KEY = '8S4oIhhl7ap5lboUk6N8w' + CONSUMER_SECRET = '8rEgNAbwXXecrPweEPyaT5Oproxwj31ZAAb0qvgAuY' + +SUPPORT_PASSWORD = 'aew7Seey' \ No newline at end of file diff --git a/courtside/manage.py b/courtside/manage.py new file mode 100755 index 0000000..3e4eedc --- /dev/null +++ b/courtside/manage.py @@ -0,0 +1,14 @@ +#!/usr/bin/env python +from django.core.management import execute_manager +import imp +try: + imp.find_module('settings') # Assumed to be in the same directory. +except ImportError: + import sys + sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run django-admin.py, passing it your settings module.\n" % __file__) + sys.exit(1) + +import settings + +if __name__ == "__main__": + execute_manager(settings) diff --git a/courtside/production_settings.py b/courtside/production_settings.py new file mode 100644 index 0000000..be29685 --- /dev/null +++ b/courtside/production_settings.py @@ -0,0 +1,3 @@ +from settings import * + +DEBUG = False diff --git a/courtside/register/__init__.py b/courtside/register/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/courtside/register/admin.py b/courtside/register/admin.py new file mode 100644 index 0000000..ddc6c90 --- /dev/null +++ b/courtside/register/admin.py @@ -0,0 +1,13 @@ +from django.contrib import admin +from register.models import Player, Sport + + +class PlayerAdmin(admin.ModelAdmin): + pass + +class SportAdmin(admin.ModelAdmin): + pass + + +admin.site.register(Player, PlayerAdmin) +admin.site.register(Sport, SportAdmin) \ No newline at end of file diff --git a/courtside/register/fixtures/register.json b/courtside/register/fixtures/register.json new file mode 100644 index 0000000..5ced420 --- /dev/null +++ b/courtside/register/fixtures/register.json @@ -0,0 +1,997 @@ +[ + { + "pk": 12, + "model": "contenttypes.contenttype", + "fields": { + "model": "comments", + "name": "comments", + "app_label": "game" + } + }, + { + "pk": 5, + "model": "contenttypes.contenttype", + "fields": { + "model": "contenttype", + "name": "content type", + "app_label": "contenttypes" + } + }, + { + "pk": 16, + "model": "contenttypes.contenttype", + "fields": { + "model": "crontabschedule", + "name": "crontab", + "app_label": "djcelery" + } + }, + { + "pk": 11, + "model": "contenttypes.contenttype", + "fields": { + "model": "game", + "name": "game", + "app_label": "game" + } + }, + { + "pk": 2, + "model": "contenttypes.contenttype", + "fields": { + "model": "group", + "name": "group", + "app_label": "auth" + } + }, + { + "pk": 15, + "model": "contenttypes.contenttype", + "fields": { + "model": "intervalschedule", + "name": "interval", + "app_label": "djcelery" + } + }, + { + "pk": 8, + "model": "contenttypes.contenttype", + "fields": { + "model": "logentry", + "name": "log entry", + "app_label": "admin" + } + }, + { + "pk": 4, + "model": "contenttypes.contenttype", + "fields": { + "model": "message", + "name": "message", + "app_label": "auth" + } + }, + { + "pk": 18, + "model": "contenttypes.contenttype", + "fields": { + "model": "periodictask", + "name": "periodic task", + "app_label": "djcelery" + } + }, + { + "pk": 17, + "model": "contenttypes.contenttype", + "fields": { + "model": "periodictasks", + "name": "periodic tasks", + "app_label": "djcelery" + } + }, + { + "pk": 1, + "model": "contenttypes.contenttype", + "fields": { + "model": "permission", + "name": "permission", + "app_label": "auth" + } + }, + { + "pk": 10, + "model": "contenttypes.contenttype", + "fields": { + "model": "player", + "name": "player", + "app_label": "register" + } + }, + { + "pk": 6, + "model": "contenttypes.contenttype", + "fields": { + "model": "session", + "name": "session", + "app_label": "sessions" + } + }, + { + "pk": 7, + "model": "contenttypes.contenttype", + "fields": { + "model": "site", + "name": "site", + "app_label": "sites" + } + }, + { + "pk": 9, + "model": "contenttypes.contenttype", + "fields": { + "model": "sport", + "name": "sport", + "app_label": "register" + } + }, + { + "pk": 20, + "model": "contenttypes.contenttype", + "fields": { + "model": "taskstate", + "name": "task", + "app_label": "djcelery" + } + }, + { + "pk": 13, + "model": "contenttypes.contenttype", + "fields": { + "model": "taskmeta", + "name": "task meta", + "app_label": "djcelery" + } + }, + { + "pk": 14, + "model": "contenttypes.contenttype", + "fields": { + "model": "tasksetmeta", + "name": "taskset meta", + "app_label": "djcelery" + } + }, + { + "pk": 3, + "model": "contenttypes.contenttype", + "fields": { + "model": "user", + "name": "user", + "app_label": "auth" + } + }, + { + "pk": 19, + "model": "contenttypes.contenttype", + "fields": { + "model": "workerstate", + "name": "worker", + "app_label": "djcelery" + } + }, + { + "pk": "26b8e46e46b50a7ab8a218373eabda78", + "model": "sessions.session", + "fields": { + "expire_date": "2011-09-03 11:43:51", + "session_data": "ZTM2OGUxMmIxNGMzM2RhYjFlZjk2ZTIwZWExZjZmZjY3MjY1OGVmMjqAAn1xAShVEl9hdXRoX3Vz\nZXJfYmFja2VuZHECVSlkamFuZ28uY29udHJpYi5hdXRoLmJhY2tlbmRzLk1vZGVsQmFja2VuZHED\nVQ1fYXV0aF91c2VyX2lkcQRLAXUu\n" + } + }, + { + "pk": 1, + "model": "sites.site", + "fields": { + "domain": "example.com", + "name": "example.com" + } + }, + { + "pk": 1, + "model": "register.sport", + "fields": { + "name": "basketball" + } + }, + { + "pk": 2, + "model": "register.sport", + "fields": { + "name": "hockey" + } + }, + { + "pk": 3, + "model": "register.sport", + "fields": { + "name": "baseball" + } + }, + { + "pk": 4, + "model": "register.sport", + "fields": { + "name": "volleyball" + } + }, + { + "pk": 5, + "model": "register.sport", + "fields": { + "name": "soccer" + } + }, + { + "pk": 2, + "model": "register.player", + "fields": { + "gender": "M", + "facebook_oauth_token": "", + "sports": [ + 1, + 2, + 5 + ], + "twitter_oauth_secret": "", + "twitter_oauth_token": "", + "user": 2, + "image_url": "http://www.gravatar.com/avatar/240f00368979a3327c854f560001c42e?s=250" + } + }, + { + "pk": 3, + "model": "register.player", + "fields": { + "gender": "F", + "facebook_oauth_token": "", + "sports": [ + 3, + 4, + 5 + ], + "twitter_oauth_secret": "", + "twitter_oauth_token": "", + "user": 3, + "image_url": "http://www.gravatar.com/avatar/240f00368979a3327c854f560001c42e?s=250" + } + }, + { + "pk": 4, + "model": "register.player", + "fields": { + "gender": "Q", + "facebook_oauth_token": "", + "sports": [ + 1, + 4 + ], + "twitter_oauth_secret": "", + "twitter_oauth_token": "", + "user": 4, + "image_url": "http://www.gravatar.com/avatar/240f00368979a3327c854f560001c42e?s=250" + } + }, + { + "pk": 1, + "model": "game.game", + "fields": { + "restrictions": "", + "latitude": "45.381188", + "players": [], + "longitude": "-75.6417", + "start_date_and_time": "2011-08-07 17:30:00", + "address": "1840 Lorraine Ave.", + "owner": 2, + "minimum_players": 4, + "sport": 1 + } + }, + { + "pk": 2, + "model": "game.game", + "fields": { + "restrictions": "3 on 3", + "latitude": "45.383532", + "players": [ + 2 + ], + "longitude": "-75.697517", + "start_date_and_time": "2011-08-08 17:30:00", + "address": "Carleton University", + "owner": 3, + "minimum_players": 10, + "sport": 2 + } + }, + { + "pk": 3, + "model": "game.game", + "fields": { + "restrictions": "Womens Only", + "latitude": "45.376713", + "players": [ + 2, + 3 + ], + "longitude": "-75.681835", + "start_date_and_time": "2011-08-09 16:30:00", + "address": "Riverside Dr.", + "owner": 4, + "minimum_players": 7, + "sport": 2 + } + }, + { + "pk": 4, + "model": "game.game", + "fields": { + "restrictions": "", + "latitude": "45.377713", + "players": [ + 2 + ], + "longitude": "-75.682", + "start_date_and_time": "2011-08-10 16:30:00", + "address": "Dup Riverside Dr.", + "owner": 4, + "minimum_players": 10, + "sport": 3 + } + }, + { + "pk": 5, + "model": "game.game", + "fields": { + "restrictions": "", + "latitude": "45.384532", + "players": [ + 4 + ], + "longitude": "-75.677517", + "start_date_and_time": "2011-08-11 17:30:00", + "address": "Dup Carleton University", + "owner": 1, + "minimum_players": 2, + "sport": 4 + } + }, + { + "pk": 6, + "model": "game.game", + "fields": { + "restrictions": "", + "latitude": "45.384188", + "players": [ + 2, + 4 + ], + "longitude": "-75.6416", + "start_date_and_time": "2011-08-12 17:30:00", + "address": "Dup 1840 Lorraine Ave.", + "owner": 3, + "minimum_players": 4, + "sport": 5 + } + }, + { + "pk": 22, + "model": "auth.permission", + "fields": { + "codename": "add_logentry", + "name": "Can add log entry", + "content_type": 8 + } + }, + { + "pk": 23, + "model": "auth.permission", + "fields": { + "codename": "change_logentry", + "name": "Can change log entry", + "content_type": 8 + } + }, + { + "pk": 24, + "model": "auth.permission", + "fields": { + "codename": "delete_logentry", + "name": "Can delete log entry", + "content_type": 8 + } + }, + { + "pk": 4, + "model": "auth.permission", + "fields": { + "codename": "add_group", + "name": "Can add group", + "content_type": 2 + } + }, + { + "pk": 5, + "model": "auth.permission", + "fields": { + "codename": "change_group", + "name": "Can change group", + "content_type": 2 + } + }, + { + "pk": 6, + "model": "auth.permission", + "fields": { + "codename": "delete_group", + "name": "Can delete group", + "content_type": 2 + } + }, + { + "pk": 10, + "model": "auth.permission", + "fields": { + "codename": "add_message", + "name": "Can add message", + "content_type": 4 + } + }, + { + "pk": 11, + "model": "auth.permission", + "fields": { + "codename": "change_message", + "name": "Can change message", + "content_type": 4 + } + }, + { + "pk": 12, + "model": "auth.permission", + "fields": { + "codename": "delete_message", + "name": "Can delete message", + "content_type": 4 + } + }, + { + "pk": 1, + "model": "auth.permission", + "fields": { + "codename": "add_permission", + "name": "Can add permission", + "content_type": 1 + } + }, + { + "pk": 2, + "model": "auth.permission", + "fields": { + "codename": "change_permission", + "name": "Can change permission", + "content_type": 1 + } + }, + { + "pk": 3, + "model": "auth.permission", + "fields": { + "codename": "delete_permission", + "name": "Can delete permission", + "content_type": 1 + } + }, + { + "pk": 7, + "model": "auth.permission", + "fields": { + "codename": "add_user", + "name": "Can add user", + "content_type": 3 + } + }, + { + "pk": 8, + "model": "auth.permission", + "fields": { + "codename": "change_user", + "name": "Can change user", + "content_type": 3 + } + }, + { + "pk": 9, + "model": "auth.permission", + "fields": { + "codename": "delete_user", + "name": "Can delete user", + "content_type": 3 + } + }, + { + "pk": 13, + "model": "auth.permission", + "fields": { + "codename": "add_contenttype", + "name": "Can add content type", + "content_type": 5 + } + }, + { + "pk": 14, + "model": "auth.permission", + "fields": { + "codename": "change_contenttype", + "name": "Can change content type", + "content_type": 5 + } + }, + { + "pk": 15, + "model": "auth.permission", + "fields": { + "codename": "delete_contenttype", + "name": "Can delete content type", + "content_type": 5 + } + }, + { + "pk": 46, + "model": "auth.permission", + "fields": { + "codename": "add_crontabschedule", + "name": "Can add crontab", + "content_type": 16 + } + }, + { + "pk": 47, + "model": "auth.permission", + "fields": { + "codename": "change_crontabschedule", + "name": "Can change crontab", + "content_type": 16 + } + }, + { + "pk": 48, + "model": "auth.permission", + "fields": { + "codename": "delete_crontabschedule", + "name": "Can delete crontab", + "content_type": 16 + } + }, + { + "pk": 43, + "model": "auth.permission", + "fields": { + "codename": "add_intervalschedule", + "name": "Can add interval", + "content_type": 15 + } + }, + { + "pk": 44, + "model": "auth.permission", + "fields": { + "codename": "change_intervalschedule", + "name": "Can change interval", + "content_type": 15 + } + }, + { + "pk": 45, + "model": "auth.permission", + "fields": { + "codename": "delete_intervalschedule", + "name": "Can delete interval", + "content_type": 15 + } + }, + { + "pk": 52, + "model": "auth.permission", + "fields": { + "codename": "add_periodictask", + "name": "Can add periodic task", + "content_type": 18 + } + }, + { + "pk": 53, + "model": "auth.permission", + "fields": { + "codename": "change_periodictask", + "name": "Can change periodic task", + "content_type": 18 + } + }, + { + "pk": 54, + "model": "auth.permission", + "fields": { + "codename": "delete_periodictask", + "name": "Can delete periodic task", + "content_type": 18 + } + }, + { + "pk": 49, + "model": "auth.permission", + "fields": { + "codename": "add_periodictasks", + "name": "Can add periodic tasks", + "content_type": 17 + } + }, + { + "pk": 50, + "model": "auth.permission", + "fields": { + "codename": "change_periodictasks", + "name": "Can change periodic tasks", + "content_type": 17 + } + }, + { + "pk": 51, + "model": "auth.permission", + "fields": { + "codename": "delete_periodictasks", + "name": "Can delete periodic tasks", + "content_type": 17 + } + }, + { + "pk": 37, + "model": "auth.permission", + "fields": { + "codename": "add_taskmeta", + "name": "Can add task meta", + "content_type": 13 + } + }, + { + "pk": 38, + "model": "auth.permission", + "fields": { + "codename": "change_taskmeta", + "name": "Can change task meta", + "content_type": 13 + } + }, + { + "pk": 39, + "model": "auth.permission", + "fields": { + "codename": "delete_taskmeta", + "name": "Can delete task meta", + "content_type": 13 + } + }, + { + "pk": 40, + "model": "auth.permission", + "fields": { + "codename": "add_tasksetmeta", + "name": "Can add taskset meta", + "content_type": 14 + } + }, + { + "pk": 41, + "model": "auth.permission", + "fields": { + "codename": "change_tasksetmeta", + "name": "Can change taskset meta", + "content_type": 14 + } + }, + { + "pk": 42, + "model": "auth.permission", + "fields": { + "codename": "delete_tasksetmeta", + "name": "Can delete taskset meta", + "content_type": 14 + } + }, + { + "pk": 58, + "model": "auth.permission", + "fields": { + "codename": "add_taskstate", + "name": "Can add task", + "content_type": 20 + } + }, + { + "pk": 59, + "model": "auth.permission", + "fields": { + "codename": "change_taskstate", + "name": "Can change task", + "content_type": 20 + } + }, + { + "pk": 60, + "model": "auth.permission", + "fields": { + "codename": "delete_taskstate", + "name": "Can delete task", + "content_type": 20 + } + }, + { + "pk": 55, + "model": "auth.permission", + "fields": { + "codename": "add_workerstate", + "name": "Can add worker", + "content_type": 19 + } + }, + { + "pk": 56, + "model": "auth.permission", + "fields": { + "codename": "change_workerstate", + "name": "Can change worker", + "content_type": 19 + } + }, + { + "pk": 57, + "model": "auth.permission", + "fields": { + "codename": "delete_workerstate", + "name": "Can delete worker", + "content_type": 19 + } + }, + { + "pk": 34, + "model": "auth.permission", + "fields": { + "codename": "add_comments", + "name": "Can add comments", + "content_type": 12 + } + }, + { + "pk": 35, + "model": "auth.permission", + "fields": { + "codename": "change_comments", + "name": "Can change comments", + "content_type": 12 + } + }, + { + "pk": 36, + "model": "auth.permission", + "fields": { + "codename": "delete_comments", + "name": "Can delete comments", + "content_type": 12 + } + }, + { + "pk": 31, + "model": "auth.permission", + "fields": { + "codename": "add_game", + "name": "Can add game", + "content_type": 11 + } + }, + { + "pk": 32, + "model": "auth.permission", + "fields": { + "codename": "change_game", + "name": "Can change game", + "content_type": 11 + } + }, + { + "pk": 33, + "model": "auth.permission", + "fields": { + "codename": "delete_game", + "name": "Can delete game", + "content_type": 11 + } + }, + { + "pk": 28, + "model": "auth.permission", + "fields": { + "codename": "add_player", + "name": "Can add player", + "content_type": 10 + } + }, + { + "pk": 29, + "model": "auth.permission", + "fields": { + "codename": "change_player", + "name": "Can change player", + "content_type": 10 + } + }, + { + "pk": 30, + "model": "auth.permission", + "fields": { + "codename": "delete_player", + "name": "Can delete player", + "content_type": 10 + } + }, + { + "pk": 25, + "model": "auth.permission", + "fields": { + "codename": "add_sport", + "name": "Can add sport", + "content_type": 9 + } + }, + { + "pk": 26, + "model": "auth.permission", + "fields": { + "codename": "change_sport", + "name": "Can change sport", + "content_type": 9 + } + }, + { + "pk": 27, + "model": "auth.permission", + "fields": { + "codename": "delete_sport", + "name": "Can delete sport", + "content_type": 9 + } + }, + { + "pk": 16, + "model": "auth.permission", + "fields": { + "codename": "add_session", + "name": "Can add session", + "content_type": 6 + } + }, + { + "pk": 17, + "model": "auth.permission", + "fields": { + "codename": "change_session", + "name": "Can change session", + "content_type": 6 + } + }, + { + "pk": 18, + "model": "auth.permission", + "fields": { + "codename": "delete_session", + "name": "Can delete session", + "content_type": 6 + } + }, + { + "pk": 19, + "model": "auth.permission", + "fields": { + "codename": "add_site", + "name": "Can add site", + "content_type": 7 + } + }, + { + "pk": 20, + "model": "auth.permission", + "fields": { + "codename": "change_site", + "name": "Can change site", + "content_type": 7 + } + }, + { + "pk": 21, + "model": "auth.permission", + "fields": { + "codename": "delete_site", + "name": "Can delete site", + "content_type": 7 + } + }, + { + "pk": 1, + "model": "auth.user", + "fields": { + "username": "myusuf", + "first_name": "", + "last_name": "", + "is_active": true, + "is_superuser": true, + "is_staff": true, + "last_login": "2011-08-20 11:43:51", + "groups": [], + "user_permissions": [], + "password": "sha1$71b28$69f337af5069a5cbb8b45c8a01fce1c62a079f88", + "email": "yusuf.mahdi@gmail.com", + "date_joined": "2011-08-20 11:43:33" + } + }, + { + "pk": 2, + "model": "auth.user", + "fields": { + "username": "iammale", + "first_name": "I am", + "last_name": "Male", + "is_active": true, + "is_superuser": false, + "is_staff": false, + "last_login": "2011-08-20 11:43:40", + "groups": [], + "user_permissions": [], + "password": "test", + "email": "iammale@gmail.com", + "date_joined": "2011-08-20 11:43:40" + } + }, + { + "pk": 3, + "model": "auth.user", + "fields": { + "username": "iamfemale", + "first_name": "I am", + "last_name": "Female", + "is_active": true, + "is_superuser": false, + "is_staff": false, + "last_login": "2011-08-20 11:43:40", + "groups": [], + "user_permissions": [], + "password": "test", + "email": "iamfemale@gmail.com", + "date_joined": "2011-08-20 11:43:40" + } + }, + { + "pk": 4, + "model": "auth.user", + "fields": { + "username": "nogender", + "first_name": "Qinta", + "last_name": "Shanana", + "is_active": true, + "is_superuser": false, + "is_staff": false, + "last_login": "2011-08-20 11:43:40", + "groups": [], + "user_permissions": [], + "password": "test", + "email": "qinta@gmail.com", + "date_joined": "2011-08-20 11:43:40" + } + } +] \ No newline at end of file diff --git a/courtside/register/models.py b/courtside/register/models.py new file mode 100644 index 0000000..f004a42 --- /dev/null +++ b/courtside/register/models.py @@ -0,0 +1,43 @@ +from django.db import models +from django.contrib.auth.models import User + +GENDER_CHOICES = ( + (u'Q', u'Undisclosed'), + (u'M', u'Male'), + (u'F', u'Female'), + + ) + +class Sport(models.Model): + """ This will store the sport they are interested in playing in. + + """ + sport = models.CharField(max_length=30) + + def __unicode__(self): + return "%s" % self.sport + + class Meta: + verbose_name_plural = "Sports" + + +class Player(models.Model): + """ This class will respresent all the information associated with player. + + Keyword arguments: + + """ + user = models.ForeignKey(User, blank=True, null=True) + gender = models.CharField(max_length=2, choices=GENDER_CHOICES, blank=True) + sports = models.ManyToManyField('Sport') + twitter_oauth_token = models.CharField(max_length=150, blank=True) + twitter_oauth_secret = models.CharField(max_length=150, blank=True) + facebook_oauth_token = models.CharField(max_length=150, blank=True) + facebook_id = models.IntegerField(blank=True, null=True) + image_url = models.CharField(max_length=150, blank=True) + + def __unicode__(self): + return "%s player named %s" % (self.get_gender_display(), self.user.first_name) + + class Meta: + verbose_name_plural = "Players" \ No newline at end of file diff --git a/courtside/register/register.json b/courtside/register/register.json new file mode 100644 index 0000000..2cd3613 --- /dev/null +++ b/courtside/register/register.json @@ -0,0 +1,87 @@ +[ + { + "pk": 1, + "model": "register.sport", + "fields": { + "name": "basketball" + } + }, + { + "pk": 2, + "model": "register.sport", + "fields": { + "name": "hockey" + } + }, + { + "pk": 3, + "model": "register.sport", + "fields": { + "name": "baseball" + } + }, + { + "pk": 4, + "model": "register.sport", + "fields": { + "name": "volleyball" + } + }, + { + "pk": 5, + "model": "register.sport", + "fields": { + "name": "soccer" + } + }, + { + "pk": 2, + "model": "register.player", + "fields": { + "gender": "M", + "facebook_oauth_token": "", + "sports": [ + 1, + 2, + 5 + ], + "twitter_oauth_secret": "", + "twitter_oauth_token": "", + "user": 2, + "image_url": "http://www.gravatar.com/avatar/240f00368979a3327c854f560001c42e?s=250" + } + }, + { + "pk": 3, + "model": "register.player", + "fields": { + "gender": "F", + "facebook_oauth_token": "", + "sports": [ + 3, + 4, + 5 + ], + "twitter_oauth_secret": "", + "twitter_oauth_token": "", + "user": 3, + "image_url": "http://www.gravatar.com/avatar/240f00368979a3327c854f560001c42e?s=250" + } + }, + { + "pk": 4, + "model": "register.player", + "fields": { + "gender": "Q", + "facebook_oauth_token": "", + "sports": [ + 1, + 4 + ], + "twitter_oauth_secret": "", + "twitter_oauth_token": "", + "user": 4, + "image_url": "http://www.gravatar.com/avatar/240f00368979a3327c854f560001c42e?s=250" + } + } +] \ No newline at end of file diff --git a/courtside/register/tasks.py b/courtside/register/tasks.py new file mode 100644 index 0000000..7826757 --- /dev/null +++ b/courtside/register/tasks.py @@ -0,0 +1,55 @@ +from celery.task import Task +from celery.registry import tasks +from django.conf import settings +from django.contrib.auth.models import User +from django.core.mail import EmailMultiAlternatives +from django.template.loader import render_to_string +from django.utils.html import strip_tags + + +class GameSignUpTask(Task): + + def run(self, user, game): + """This method is responsible for asynchronously + sending welcome email to users when they sign up. + + Keyword agruments: + user- user object who just signed up + + """ + email = user.email + user = user + subject, from_email, to = 'Welcome', 'support@courtside.me', email + html_content = render_to_string('game_email.html', {'user':user.first_name, 'game': game}) + text_content = strip_tags(html_content) + # create the email, and attach the HTML version as well. + msg = EmailMultiAlternatives(subject, text_content, from_email, [to]) + msg.attach_alternative(html_content, "text/html") + msg.send() + + + + +class SignUpTask(Task): + + def run(self, user): + """This method is responsible for asynchronously + sending welcome email to users when they sign up. + + Keyword agruments: + user- user object who just signed up + + """ + email = user.email + user = user + subject, from_email, to = 'Welcome', 'support@courtside.me', email + html_content = render_to_string('email_signup.html', {'user':user.first_name}) + text_content = strip_tags(html_content) + # create the email, and attach the HTML version as well. + msg = EmailMultiAlternatives(subject, text_content, from_email, [to]) + msg.attach_alternative(html_content, "text/html") + msg.send() + + +# register the task with celery +tasks.register(SignUpTask) diff --git a/courtside/register/tests.py b/courtside/register/tests.py new file mode 100644 index 0000000..9a0ccd4 --- /dev/null +++ b/courtside/register/tests.py @@ -0,0 +1,29 @@ +""" +This file demonstrates writing tests using the unittest module. These will pass +when you run "manage.py test". + +Replace this with more appropriate tests for your application. +""" + +from django.test import TestCase +from django.test.client import Client +from django.core import mail +from django.contrib.auth.models import User +from django.conf import settings + + +class SimpleTest(TestCase): + + def setUp(self): + self.old_always_eager = settings.CELERY_ALWAYS_EAGER + settings.CELERY_ALWAYS_EAGER = True + self.client = Client() + result = self.client.login(username='myusuf3', password='123456') + self.assertTrue(result) + + def test_basic_addition(self): + """ + Tests that 1 + 1 always equals 2. + """ + self.assertEqual(1 + 1, 2) + diff --git a/courtside/register/views.py b/courtside/register/views.py new file mode 100644 index 0000000..5a3dbdc --- /dev/null +++ b/courtside/register/views.py @@ -0,0 +1,400 @@ +import urllib +import json +import hashlib + +from django.contrib.auth import authenticate, login, logout +from django.contrib.auth.models import User +from django.contrib.auth.decorators import login_required +from django.shortcuts import render_to_response, render, redirect +from django.http import HttpResponse, HttpResponseRedirect +from django.http import Http404 +from django import forms +from django.contrib.auth.decorators import login_required + +from twython import Twython as twitter + +from keys import keys +from models import Player +from tasks import SignUpTask +from forms.forms import PlayerForm, NewPlayerForm, ProfileForm, PasswordForm, LoginForm + + + +def get_gravatar(email, size=250): + """ This method returns the url to the gravatar that + corresponds to the email provided, at a default + size of 100. + + Keyword arguments + email - user's email address + size - the size of the gravatar + + """ + h = hashlib.md5(email.lower()).hexdigest() + image = "http://www.gravatar.com/avatar/%s?s=%s" % (h, size) + return image + + +def create_django_user(screen_name, twitter_oauth, email=None): + """ This method creates a user object with the password + set to the twitter oauth key. No email provided, twitter + api limitation. + + Attention this only returns unsaved user. + + Keyword arguments + screenname - twitter screenname + email - email for this user; default None + twitter_oauth - password for user using twitter key. + + """ + if email is None: + user = User(username=screen_name) + user.set_password(twitter_oauth) + else: + user = User.objects.create_user(screen_name, email, twitter_oauth) + return user + +def begin_twitter_oauth(request): + """ This view will begin the user authentication process. It requires the + consumer key and secret. link to the sign in with twitter. + + Keyword arguments: + request - + """ + twitter_conn = twitter( + twitter_token = keys.CONSUMER_KEY, + twitter_secret = keys.CONSUMER_SECRET + ) + + auth_prop = twitter_conn.get_authentication_tokens() + request.session['request_token'] = auth_prop + return HttpResponseRedirect(auth_prop['auth_url']) + +def twitter_callback(request): + """ This method deals with the callback needed by twitter, and creating the their user. + + """ + if 'denied' in request.GET: + return HttpResponseRedirect('/') + + twitter_conn = twitter( + twitter_token = keys.CONSUMER_KEY, + twitter_secret = keys.CONSUMER_SECRET, + oauth_token = request.session['request_token']['oauth_token'], + oauth_token_secret = request.session['request_token']['oauth_token_secret'] + ) + + auth_tokens = twitter_conn.get_authorized_tokens() + + try: + user = User.objects.get(username = auth_tokens['screen_name']) + except User.DoesNotExist: + user = create_django_user(auth_tokens['screen_name'], auth_tokens['oauth_token_secret']) + player = Player() + player.user = user + player.twitter_oauth_token = auth_tokens['oauth_token'] + player.twitter_oauth_secret = auth_tokens['oauth_token_secret'] + request.session['twitter'] = player + form = PlayerForm(initial={'username': player.user.username}) + return render(request, 'register.html', {'form': form}) + player = Player.objects.get(user=user) + user = authenticate(username=player.user.username, password=player.twitter_oauth_secret) + login(request, user) + return HttpResponseRedirect('/') + + +def complete_sign_up(request): + """ This will use form object will be referenced here + and used to fill in user data that is missing for twitter and facebook + data. + + Keyword arguments: + request - + """ + if 'twitter' in request.session: + if request.method == 'POST': + form = PlayerForm(request.POST) + if form.is_valid(): + player = request.session['twitter'] + user = player.user + first_name = form.cleaned_data['first_name'] + last_name = form.cleaned_data['last_name'] + username = form.cleaned_data['username'] + email = form.cleaned_data['email'] + phone_number = form.cleaned_data['phone_number'] + sports = form.cleaned_data['sports'] + gender = form.cleaned_data['gender'] + player.gender = gender + user.first_name = first_name + user.last_name = last_name + user.username = username + user.email = email + user.save() + player.user = user + player.image_url = get_gravatar(player.user.email) + player.save() + player.sports = sports + user1 = authenticate(username=player.user.username, password=player.twitter_oauth_secret) + login(request, user1) + SignUpTask.delay(user) + return HttpResponseRedirect('/') + else: + form = PlayerForm() + return render(request, 'register.html', {'form': form}) + + if 'facebook' in request.session: + if request.method == 'POST': + form = PlayerForm(request.POST) + if form.is_valid(): + player = request.session['facebook'] + user = player.user + first_name = form.cleaned_data['first_name'] + last_name = form.cleaned_data['last_name'] + username = form.cleaned_data['username'] + email = form.cleaned_data['email'] + phone_number = form.cleaned_data['phone_number'] + sports = form.cleaned_data['sports'] + gender = form.cleaned_data['gender'] + player.gender = gender + user.first_name = first_name + user.last_name = last_name + user.username = username + user.email = email + user.save() + player.user = user + player.image_url = get_gravatar(player.user.email) + player.save() + player.sports = sports + user = authenticate(username=player.user.username, password=player.facebook_oauth_token) + login(request, user) + print "SEND EMAIL" + SignUpTask.delay(user) + return HttpResponseRedirect('/') + else: + form = PlayerForm() + return render(request, 'register.html', {'form': form}) + + +def new_register(request): + """ This is for a new user who wishes to register independent of twitter and facebook; + we use gravatar for these users. + """ + if request.method == 'POST': + form = NewPlayerForm(request.POST) + if form.is_valid(): + first_name = form.cleaned_data['first_name'] + last_name = form.cleaned_data['last_name'] + username = form.cleaned_data['username'] + email = form.cleaned_data['email'] + phone_number = form.cleaned_data['phone_number'] + sports = form.cleaned_data['sports'] + gender = form.cleaned_data['gender'] + password1 = form.cleaned_data['password1'] + password2 = form.cleaned_data['password2'] + + user = User.objects.create_user(username=username, email=email, password=password1) + user.first_name = first_name + user.last_name = last_name + user.save() + player = Player() + player.gender = gender + player.user = user + player.phone_number = phone_number + player.image_url = get_gravatar(player.user.email) + player.save() + player.sports = sports + user = authenticate(username=player.user, password=password1) + login(request, user) + SignUpTask.delay(user) + return HttpResponseRedirect('/') + else: + if 'email' in request.GET: + form = NewPlayerForm(initial={'email': request.GET['email']}) + else: + form = NewPlayerForm() + return render(request, 'new_register.html', {'form': form}) + +def begin_facebook_oauth(request): + """ + This method creates a user object with the password + set to the facebook access_token. + + Keyword arguments + email - email for this user; default None + facebook_oauth - password for user using access_token + + """ + args = dict( + client_id = keys.FACEBOOK_APP_ID, + redirect_uri = 'http://tini.ep.io/facebook/callback', + scope = 'email' + ) + + url = 'http://www.facebook.com/dialog/oauth?' + urllib.urlencode(args) + + return HttpResponseRedirect(url) + +def get_gender_initial(gender): + """ This method given a facebook gender will convert it to form acceptable version. + + I am sure there is a better way to do this. + """ + if str(gender) == 'male': + return 'M' + elif str(gender) == 'female': + return 'F' + else: + return 'Q' + +def facebook_callback(request): + """ This method is responsible for the facebook callback and generating the facebook user. + """ + + if 'error' in request.GET: + return HttpResponseRedirect('/') + + code = request.GET["code"] + + args = dict( + client_id = keys.FACEBOOK_APP_ID, + redirect_uri = 'http://tini.ep.io/facebook/callback', + client_secret = keys.FACEBOOK_APP_SECRET, + code = code + ) + + + token_url = 'https://graph.facebook.com/oauth/access_token?' + urllib.urlencode(args) + file = urllib.urlopen(token_url) + response = file.read() + file.close() + + # print 'Token URL:' + token_url + # print 'Response:' + # print response + + try: + split = response.split('=') + access_token = split[1].strip('&expires') + expires = split[2] + + # print 'Access Token: ' + access_token + # print 'Expires: ' + expires + except: + error = json.loads(response) + return HttpResponseRedirect('/error') + + profile = json.load(urllib.urlopen('https://graph.facebook.com/me?' + urllib.urlencode(dict(access_token=access_token)))) + + + args = dict( + access_token = access_token + ) + + graph_url = 'https://graph.facebook.com/me?' + urllib.urlencode(args) + print graph_url + + response = urllib.urlopen(graph_url) + facebook_user = json.load(response) + + try: + name = facebook_user['username'] + except: + facebook_user['username'] = '' + + try: + gender = facebook_user['gender'] + except: + facebook_user['gender'] = '' + + try: + player = Player.objects.get(facebook_id = facebook_user['id']) + except: + user = User(username= facebook_user['username']) + user.set_password(access_token) + user.first_name = facebook_user['first_name'] + user.last_name = facebook_user['last_name'] + user.email = facebook_user['email'] + + player = Player() + player.user = user + player.gender = get_gender_initial(gender=facebook_user['gender']) + player.facebook_id = facebook_user['id'] + player.facebook_oauth_token = access_token + request.session['facebook'] = player + form = PlayerForm(initial={'username': player.user.username, 'first_name': user.first_name, 'last_name': user.last_name, 'email': player.user.email, 'gender': player.gender}) + return render(request, 'register.html', {'form': form}) + + # player = Player.objects.get(user=user) + # print player + user = authenticate(username=player.user.username, password=player.facebook_oauth_token) + login(request, user) + return HttpResponseRedirect('/') + +@login_required(login_url='/login/') +def profile_edit(request): + user = request.user + email = user.email + player = Player.objects.get(user=user) + if request.method == 'POST': + form = ProfileForm(request.POST) + if form.is_valid(): + # print form.cleaned_data + user.first_name = form.cleaned_data['first_name'] + user.last_name = form.cleaned_data['last_name'] + user.email = form.cleaned_data['email'] + player.gender = form.cleaned_data['gender'] + player.sports = form.cleaned_data['sports'] + player.phone_number = form.cleaned_data['phone_number'] + player.image_url = get_gravatar(user.email) + user.save() + player.save() + return HttpResponseRedirect('/') + else: + player = Player.objects.get(user=user) + # print player.sports.all() + form = ProfileForm(initial={'username': player.user.username, 'first_name': user.first_name, 'last_name': user.last_name, 'email': player.user.email, 'gender': player.gender, 'sports': player.sports.all()}) + return render(request, 'profile_edit.html', {'form': form}) + + +def login_bro(request): + if request.method == 'POST': + form = LoginForm(request.POST) + if form.is_valid(): + # print form.cleaned_data + password = form.cleaned_data['password'] + email = form.cleaned_data['email'] + user = User.objects.get(email=email) + user = authenticate(username=user.username, password=password) + # print user + login(request, user) + return HttpResponseRedirect('/') + else: + form = LoginForm() + return render(request, 'login.html', {'form':form}) + + +@login_required(login_url='/login/') +def password_edit(request): + user = request.user + email = user.email + player = Player.objects.get(user=user) + if request.method == 'POST': + form = PasswordForm(request.POST) + if form.is_valid(): + # print form.cleaned_data + password = form.cleaned_data['password'] + user.set_password() + user.save() + player.save() + return HttpResponseRedirect('/') + else: + player = Player.objects.get(user=user) + form = PasswordForm() + +def logout_bro(request): + """ + Standard logout view + """ + logout(request) + return HttpResponseRedirect('/') \ No newline at end of file diff --git a/courtside/settings.py b/courtside/settings.py new file mode 100644 index 0000000..472bd06 --- /dev/null +++ b/courtside/settings.py @@ -0,0 +1,181 @@ +# Django settings for courtside project. +import os + +import djcelery + +djcelery.setup_loader() + +#Broker Settings + +BROKER_HOST = "localhost" +BROKER_PORT = 5672 +BROKER_USER = "guest" +BROKER_PASSWORD = "guest" +BROKER_VHOST = "/" + +DEBUG = True +TEMPLATE_DEBUG = DEBUG + +EMAIL_USE_TLS = True +EMAIL_HOST = 'smtp.gmail.com' +EMAIL_HOST_USER = '' +EMAIL_HOST_PASSWORD = '' +EMAIL_PORT = 587 + +CELERY_ALWAYS_EAGER = False + +INTERNAL_IPS = ('127.0.0.1',) + +ADMINS = ( + ('Omar Shammas', 'omar@courtside.me'), + ('Mahdi Yusuf', 'yusuf@courtside.me'), + ('Serena Ngai', 'serena@courtside.me'), +) + +MANAGERS = ADMINS + +DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. + 'NAME': os.path.join(os.path.dirname(__file__), 'courtside.db').replace('\\','/'), # Or path to database file if using sqlite3. + 'USER': '', # Not used with sqlite3. + 'PASSWORD': '', # Not used with sqlite3. + 'HOST': '', # Set to empty string for localhost. Not used with sqlite3. + 'PORT': '', # Set to empty string for default. Not used with sqlite3. + } +} + +# Local time zone for this installation. Choices can be found here: +# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name +# although not all choices may be available on all operating systems. +# On Unix systems, a value of None will cause Django to use the same +# timezone as the operating system. +# If running in a Windows environment this must be set to the same as your +# system time zone. +TIME_ZONE = 'America/Chicago' + +# Language code for this installation. All choices can be found here: +# http://www.i18nguy.com/unicode/language-identifiers.html +LANGUAGE_CODE = 'en-us' + +SITE_ID = 1 + +# If you set this to False, Django will make some optimizations so as not +# to load the internationalization machinery. +USE_I18N = True + +# If you set this to False, Django will not format dates, numbers and +# calendars according to the current locale +USE_L10N = True + +# Absolute filesystem path to the directory that will hold user-uploaded files. +# Example: "/home/media/media.lawrence.com/media/" +MEDIA_ROOT = os.path.join(os.path.dirname(__file__), 'media').replace('\\','/') + +# URL that handles the media served from MEDIA_ROOT. Make sure to use a +# trailing slash. +# Examples: "http://media.lawrence.com/media/", "http://example.com/media/" +MEDIA_URL = '' + +# Absolute path to the directory static files should be collected to. +# Don't put anything in this directory yourself; store your static files +# in apps' "static/" subdirectories and in STATICFILES_DIRS. +# Example: "/home/media/media.lawrence.com/static/" + +STATIC_ROOT = os.path.join(os.path.dirname(__file__), 'static').replace('\\','/') + + +# URL prefix for static files. +# Example: "http://media.lawrence.com/static/" +STATIC_URL = '/static/' + +# URL prefix for admin static files -- CSS, JavaScript and images. +# Make sure to use a trailing slash. +# Examples: "http://foo.com/static/admin/", "/static/admin/". +ADMIN_MEDIA_PREFIX = '/static/admin/' + +# Additional locations of static files +STATICFILES_DIRS = ( + # Put strings here, like "/home/html/static" or "C:/www/django/static". + # Always use forward slashes, even on Windows. + # Don't forget to use absolute paths, not relative paths. +) + +# List of finder classes that know how to find static files in +# various locations. +STATICFILES_FINDERS = ( + 'django.contrib.staticfiles.finders.FileSystemFinder', + 'django.contrib.staticfiles.finders.AppDirectoriesFinder', +# 'django.contrib.staticfiles.finders.DefaultStorageFinder', +) + +# Make this unique, and don't share it with anybody. +SECRET_KEY = 'g)q*n5o_*$qfm%w9-274u=)!d*#6unky@of_p8-z1yfmd$zy-6' + +# List of callables that know how to import templates from various sources. +TEMPLATE_LOADERS = ( + 'django.template.loaders.filesystem.Loader', + 'django.template.loaders.app_directories.Loader', +# 'django.template.loaders.eggs.Loader', +) + +MIDDLEWARE_CLASSES = ( + 'django.middleware.common.CommonMiddleware', + 'django.contrib.sessions.middleware.SessionMiddleware', + 'django.middleware.csrf.CsrfViewMiddleware', + 'django.contrib.auth.middleware.AuthenticationMiddleware', + 'django.contrib.messages.middleware.MessageMiddleware', + 'debug_toolbar.middleware.DebugToolbarMiddleware', +) + +ROOT_URLCONF = 'courtside.urls' + +TEMPLATE_DIRS = ( + # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates". + # Always use forward slashes, even on Windows. + # Don't forget to use absolute paths, not relative paths. + os.path.join(os.path.dirname(__file__), 'templates').replace('\\','/'), +) + +INSTALLED_APPS = ( + 'django.contrib.auth', + 'django.contrib.contenttypes', + 'django.contrib.sessions', + 'django.contrib.sites', + 'django.contrib.messages', + 'django.contrib.staticfiles', + # Uncomment the next line to enable the admin: + 'django.contrib.admin', + # Uncomment the next line to enable admin documentation: + 'django.contrib.admindocs', + 'register', + 'game', + 'django.contrib.comments', + 'tastypie', + 'debug_toolbar', + 'djcelery', + 'south', +) + +# A sample logging configuration. The only tangible logging +# performed by this configuration is to send an email to +# the site admins on every HTTP 500 error. +# See http://docs.djangoproject.com/en/dev/topics/logging for +# more details on how to customize your logging configuration. +LOGGING = { + 'version': 1, + 'disable_existing_loggers': False, + 'handlers': { + 'mail_admins': { + 'level': 'ERROR', + 'class': 'django.utils.log.AdminEmailHandler' + } + }, + 'loggers': { + 'django.request': { + 'handlers': ['mail_admins'], + 'level': 'ERROR', + 'propagate': True, + }, + } +} diff --git a/courtside/static/admin/css/base.css b/courtside/static/admin/css/base.css new file mode 100644 index 0000000..c5e385d --- /dev/null +++ b/courtside/static/admin/css/base.css @@ -0,0 +1,772 @@ +/* + DJANGO Admin styles +*/ + +body { + margin: 0; + padding: 0; + font-size: 12px; + font-family: "Lucida Grande","DejaVu Sans","Bitstream Vera Sans",Verdana,Arial,sans-serif; + color: #333; + background: #fff; +} + +/* LINKS */ + +a:link, a:visited { + color: #5b80b2; + text-decoration: none; +} + +a:hover { + color: #036; +} + +a img { + border: none; +} + +a.section:link, a.section:visited { + color: white; + text-decoration: none; +} + +/* GLOBAL DEFAULTS */ + +p, ol, ul, dl { + margin: .2em 0 .8em 0; +} + +p { + padding: 0; + line-height: 140%; +} + +h1,h2,h3,h4,h5 { + font-weight: bold; +} + +h1 { + font-size: 18px; + color: #666; + padding: 0 6px 0 0; + margin: 0 0 .2em 0; +} + +h2 { + font-size: 16px; + margin: 1em 0 .5em 0; +} + +h2.subhead { + font-weight: normal; + margin-top: 0; +} + +h3 { + font-size: 14px; + margin: .8em 0 .3em 0; + color: #666; + font-weight: bold; +} + +h4 { + font-size: 12px; + margin: 1em 0 .8em 0; + padding-bottom: 3px; +} + +h5 { + font-size: 10px; + margin: 1.5em 0 .5em 0; + color: #666; + text-transform: uppercase; + letter-spacing: 1px; +} + +ul li { + list-style-type: square; + padding: 1px 0; +} + +ul.plainlist { + margin-left: 0 !important; +} + +ul.plainlist li { + list-style-type: none; +} + +li ul { + margin-bottom: 0; +} + +li, dt, dd { + font-size: 11px; + line-height: 14px; +} + +dt { + font-weight: bold; + margin-top: 4px; +} + +dd { + margin-left: 0; +} + +form { + margin: 0; + padding: 0; +} + +fieldset { + margin: 0; + padding: 0; +} + +blockquote { + font-size: 11px; + color: #777; + margin-left: 2px; + padding-left: 10px; + border-left: 5px solid #ddd; +} + +code, pre { + font-family: "Bitstream Vera Sans Mono", Monaco, "Courier New", Courier, monospace; + background: inherit; + color: #666; + font-size: 11px; +} + +pre.literal-block { + margin: 10px; + background: #eee; + padding: 6px 8px; +} + +code strong { + color: #930; +} + +hr { + clear: both; + color: #eee; + background-color: #eee; + height: 1px; + border: none; + margin: 0; + padding: 0; + font-size: 1px; + line-height: 1px; +} + +/* TEXT STYLES & MODIFIERS */ + +.small { + font-size: 11px; +} + +.tiny { + font-size: 10px; +} + +p.tiny { + margin-top: -2px; +} + +.mini { + font-size: 9px; +} + +p.mini { + margin-top: -3px; +} + +.help, p.help { + font-size: 10px !important; + color: #999; +} + +p img, h1 img, h2 img, h3 img, h4 img, td img { + vertical-align: middle; +} + +.quiet, a.quiet:link, a.quiet:visited { + color: #999 !important; + font-weight: normal !important; +} + +.quiet strong { + font-weight: bold !important; +} + +.float-right { + float: right; +} + +.float-left { + float: left; +} + +.clear { + clear: both; +} + +.align-left { + text-align: left; +} + +.align-right { + text-align: right; +} + +.example { + margin: 10px 0; + padding: 5px 10px; + background: #efefef; +} + +.nowrap { + white-space: nowrap; +} + +/* TABLES */ + +table { + border-collapse: collapse; + border-color: #ccc; +} + +td, th { + font-size: 11px; + line-height: 13px; + border-bottom: 1px solid #eee; + vertical-align: top; + padding: 5px; + font-family: "Lucida Grande", Verdana, Arial, sans-serif; +} + +th { + text-align: left; + font-size: 12px; + font-weight: bold; +} + +thead th, +tfoot td { + color: #666; + padding: 2px 5px; + font-size: 11px; + background: #e1e1e1 url(../img/admin/nav-bg.gif) top left repeat-x; + border-left: 1px solid #ddd; + border-bottom: 1px solid #ddd; +} + +tfoot td { + border-bottom: none; + border-top: 1px solid #ddd; +} + +thead th:first-child, +tfoot td:first-child { + border-left: none !important; +} + +thead th.optional { + font-weight: normal !important; +} + +fieldset table { + border-right: 1px solid #eee; +} + +tr.row-label td { + font-size: 9px; + padding-top: 2px; + padding-bottom: 0; + border-bottom: none; + color: #666; + margin-top: -1px; +} + +tr.alt { + background: #f6f6f6; +} + +.row1 { + background: #EDF3FE; +} + +.row2 { + background: white; +} + +/* SORTABLE TABLES */ + +thead th a:link, thead th a:visited { + color: #666; + display: block; +} + +table thead th.sorted { + background-position: bottom left !important; +} + +table thead th.sorted a { + padding-right: 13px; +} + +table thead th.ascending a { + background: url(../img/admin/arrow-up.gif) right .4em no-repeat; +} + +table thead th.descending a { + background: url(../img/admin/arrow-down.gif) right .4em no-repeat; +} + +/* ORDERABLE TABLES */ + +table.orderable tbody tr td:hover { + cursor: move; +} + +table.orderable tbody tr td:first-child { + padding-left: 14px; + background-image: url(../img/admin/nav-bg-grabber.gif); + background-repeat: repeat-y; +} + +table.orderable-initalized .order-cell, body>tr>td.order-cell { + display: none; +} + +/* FORM DEFAULTS */ + +input, textarea, select, .form-row p { + margin: 2px 0; + padding: 2px 3px; + vertical-align: middle; + font-family: "Lucida Grande", Verdana, Arial, sans-serif; + font-weight: normal; + font-size: 11px; +} + +textarea { + vertical-align: top !important; +} + +input[type=text], input[type=password], textarea, select, .vTextField { + border: 1px solid #ccc; +} + +/* FORM BUTTONS */ + +.button, input[type=submit], input[type=button], .submit-row input { + background: white url(../img/admin/nav-bg.gif) bottom repeat-x; + padding: 3px 5px; + color: black; + border: 1px solid #bbb; + border-color: #ddd #aaa #aaa #ddd; +} + +.button:active, input[type=submit]:active, input[type=button]:active { + background-image: url(../img/admin/nav-bg-reverse.gif); + background-position: top; +} + +.button[disabled], input[type=submit][disabled], input[type=button][disabled] { + background-image: url(../img/admin/nav-bg.gif); + background-position: bottom; + opacity: 0.4; +} + +.button.default, input[type=submit].default, .submit-row input.default { + border: 2px solid #5b80b2; + background: #7CA0C7 url(../img/admin/default-bg.gif) bottom repeat-x; + font-weight: bold; + color: white; + float: right; +} + +.button.default:active, input[type=submit].default:active { + background-image: url(../img/admin/default-bg-reverse.gif); + background-position: top; +} + +.button[disabled].default, input[type=submit][disabled].default, input[type=button][disabled].default { + background-image: url(../img/admin/default-bg.gif); + background-position: bottom; + opacity: 0.4; +} + + +/* MODULES */ + +.module { + border: 1px solid #ccc; + margin-bottom: 5px; + background: white; +} + +.module p, .module ul, .module h3, .module h4, .module dl, .module pre { + padding-left: 10px; + padding-right: 10px; +} + +.module blockquote { + margin-left: 12px; +} + +.module ul, .module ol { + margin-left: 1.5em; +} + +.module h3 { + margin-top: .6em; +} + +.module h2, .module caption, .inline-group h2 { + margin: 0; + padding: 2px 5px 3px 5px; + font-size: 11px; + text-align: left; + font-weight: bold; + background: #7CA0C7 url(../img/admin/default-bg.gif) top left repeat-x; + color: white; +} + +.module table { + border-collapse: collapse; +} + +/* MESSAGES & ERRORS */ + +ul.messagelist { + padding: 0 0 5px 0; + margin: 0; +} + +ul.messagelist li { + font-size: 12px; + display: block; + padding: 4px 5px 4px 25px; + margin: 0 0 3px 0; + border-bottom: 1px solid #ddd; + color: #666; + background: #ffc url(../img/admin/icon_success.gif) 5px .3em no-repeat; +} + +ul.messagelist li.warning{ + background-image: url(../img/admin/icon_alert.gif); +} + +ul.messagelist li.error{ + background-image: url(../img/admin/icon_error.gif); +} + +.errornote { + font-size: 12px !important; + display: block; + padding: 4px 5px 4px 25px; + margin: 0 0 3px 0; + border: 1px solid red; + color: red; + background: #ffc url(../img/admin/icon_error.gif) 5px .3em no-repeat; +} + +ul.errorlist { + margin: 0 !important; + padding: 0 !important; +} + +.errorlist li { + font-size: 12px !important; + display: block; + padding: 4px 5px 4px 25px; + margin: 0 0 3px 0; + border: 1px solid red; + color: white; + background: red url(../img/admin/icon_alert.gif) 5px .3em no-repeat; +} + +.errorlist li a { + color: white; + text-decoration: underline; +} + +td ul.errorlist { + margin: 0 !important; + padding: 0 !important; +} + +td ul.errorlist li { + margin: 0 !important; +} + +.errors { + background: #ffc; +} + +.errors input, .errors select, .errors textarea { + border: 1px solid red; +} + +div.system-message { + background: #ffc; + margin: 10px; + padding: 6px 8px; + font-size: .8em; +} + +div.system-message p.system-message-title { + padding: 4px 5px 4px 25px; + margin: 0; + color: red; + background: #ffc url(../img/admin/icon_error.gif) 5px .3em no-repeat; +} + +.description { + font-size: 12px; + padding: 5px 0 0 12px; +} + +/* BREADCRUMBS */ + +div.breadcrumbs { + background: white url(../img/admin/nav-bg-reverse.gif) 0 -10px repeat-x; + padding: 2px 8px 3px 8px; + font-size: 11px; + color: #999; + border-top: 1px solid white; + border-bottom: 1px solid #ccc; + text-align: left; +} + +/* ACTION ICONS */ + +.addlink { + padding-left: 12px; + background: url(../img/admin/icon_addlink.gif) 0 .2em no-repeat; +} + +.changelink { + padding-left: 12px; + background: url(../img/admin/icon_changelink.gif) 0 .2em no-repeat; +} + +.deletelink { + padding-left: 12px; + background: url(../img/admin/icon_deletelink.gif) 0 .25em no-repeat; +} + +a.deletelink:link, a.deletelink:visited { + color: #CC3434; +} + +a.deletelink:hover { + color: #993333; +} + +/* OBJECT TOOLS */ + +.object-tools { + font-size: 10px; + font-weight: bold; + font-family: Arial,Helvetica,sans-serif; + padding-left: 0; + float: right; + position: relative; + margin-top: -2.4em; + margin-bottom: -2em; +} + +.form-row .object-tools { + margin-top: 5px; + margin-bottom: 5px; + float: none; + height: 2em; + padding-left: 3.5em; +} + +.object-tools li { + display: block; + float: left; + background: url(../img/admin/tool-left.gif) 0 0 no-repeat; + padding: 0 0 0 8px; + margin-left: 2px; + height: 16px; +} + +.object-tools li:hover { + background: url(../img/admin/tool-left_over.gif) 0 0 no-repeat; +} + +.object-tools a:link, .object-tools a:visited { + display: block; + float: left; + color: white; + padding: .1em 14px .1em 8px; + height: 14px; + background: #999 url(../img/admin/tool-right.gif) 100% 0 no-repeat; +} + +.object-tools a:hover, .object-tools li:hover a { + background: #5b80b2 url(../img/admin/tool-right_over.gif) 100% 0 no-repeat; +} + +.object-tools a.viewsitelink, .object-tools a.golink { + background: #999 url(../img/admin/tooltag-arrowright.gif) top right no-repeat; + padding-right: 28px; +} + +.object-tools a.viewsitelink:hover, .object-tools a.golink:hover { + background: #5b80b2 url(../img/admin/tooltag-arrowright_over.gif) top right no-repeat; +} + +.object-tools a.addlink { + background: #999 url(../img/admin/tooltag-add.gif) top right no-repeat; + padding-right: 28px; +} + +.object-tools a.addlink:hover { + background: #5b80b2 url(../img/admin/tooltag-add_over.gif) top right no-repeat; +} + +/* OBJECT HISTORY */ + +table#change-history { + width: 100%; +} + +table#change-history tbody th { + width: 16em; +} + +/* PAGE STRUCTURE */ + +#container { + position: relative; + width: 100%; + min-width: 760px; + padding: 0; +} + +#content { + margin: 10px 15px; +} + +#header { + width: 100%; +} + +#content-main { + float: left; + width: 100%; +} + +#content-related { + float: right; + width: 18em; + position: relative; + margin-right: -19em; +} + +#footer { + clear: both; + padding: 10px; +} + +/* COLUMN TYPES */ + +.colMS { + margin-right: 20em !important; +} + +.colSM { + margin-left: 20em !important; +} + +.colSM #content-related { + float: left; + margin-right: 0; + margin-left: -19em; +} + +.colSM #content-main { + float: right; +} + +.popup .colM { + width: 95%; +} + +.subcol { + float: left; + width: 46%; + margin-right: 15px; +} + +.dashboard #content { + width: 500px; +} + +/* HEADER */ + +#header { + background: #417690; + color: #ffc; + overflow: hidden; +} + +#header a:link, #header a:visited { + color: white; +} + +#header a:hover { + text-decoration: underline; +} + +#branding h1 { + padding: 0 10px; + font-size: 18px; + margin: 8px 0; + font-weight: normal; + color: #f4f379; +} + +#branding h2 { + padding: 0 10px; + font-size: 14px; + margin: -8px 0 8px 0; + font-weight: normal; + color: #ffc; +} + +#user-tools { + position: absolute; + top: 0; + right: 0; + padding: 1.2em 10px; + font-size: 11px; + text-align: right; +} + +/* SIDEBAR */ + +#content-related h3 { + font-size: 12px; + color: #666; + margin-bottom: 3px; +} + +#content-related h4 { + font-size: 11px; +} + +#content-related .module h2 { + background: #eee url(../img/admin/nav-bg.gif) bottom left repeat-x; + color: #666; +} + diff --git a/courtside/static/admin/css/changelists.css b/courtside/static/admin/css/changelists.css new file mode 100644 index 0000000..315b8c7 --- /dev/null +++ b/courtside/static/admin/css/changelists.css @@ -0,0 +1,289 @@ +/* CHANGELISTS */ + +#changelist { + position: relative; + width: 100%; +} + +#changelist table { + width: 100%; +} + +.change-list .hiddenfields { display:none; } + +.change-list .filtered table { + border-right: 1px solid #ddd; +} + +.change-list .filtered { + min-height: 400px; +} + +.change-list .filtered { + background: white url(../img/admin/changelist-bg.gif) top right repeat-y !important; +} + +.change-list .filtered .results, .change-list .filtered .paginator, .filtered #toolbar, .filtered div.xfull { + margin-right: 160px !important; + width: auto !important; +} + +.change-list .filtered table tbody th { + padding-right: 1em; +} + +#changelist .toplinks { + border-bottom: 1px solid #ccc !important; +} + +#changelist .paginator { + color: #666; + border-top: 1px solid #eee; + border-bottom: 1px solid #eee; + background: white url(../img/admin/nav-bg.gif) 0 180% repeat-x; + overflow: hidden; +} + +.change-list .filtered .paginator { + border-right: 1px solid #ddd; +} + +/* CHANGELIST TABLES */ + +#changelist table thead th { + white-space: nowrap; + vertical-align: middle; +} + +#changelist table thead th.action-checkbox-column { + width: 1.5em; + text-align: center; +} + +#changelist table tbody td, #changelist table tbody th { + border-left: 1px solid #ddd; +} + +#changelist table tbody td:first-child, #changelist table tbody th:first-child { + border-left: 0; + border-right: 1px solid #ddd; +} + +#changelist table tbody td.action-checkbox { + text-align:center; +} + +#changelist table tfoot { + color: #666; +} + +/* TOOLBAR */ + +#changelist #toolbar { + padding: 3px; + border-bottom: 1px solid #ddd; + background: #e1e1e1 url(../img/admin/nav-bg.gif) top left repeat-x; + color: #666; +} + +#changelist #toolbar form input { + font-size: 11px; + padding: 1px 2px; +} + +#changelist #toolbar form #searchbar { + padding: 2px; +} + +#changelist #changelist-search img { + vertical-align: middle; +} + +/* FILTER COLUMN */ + +#changelist-filter { + position: absolute; + top: 0; + right: 0; + z-index: 1000; + width: 160px; + border-left: 1px solid #ddd; + background: #efefef; + margin: 0; +} + +#changelist-filter h2 { + font-size: 11px; + padding: 2px 5px; + border-bottom: 1px solid #ddd; +} + +#changelist-filter h3 { + font-size: 12px; + margin-bottom: 0; +} + +#changelist-filter ul { + padding-left: 0; + margin-left: 10px; +} + +#changelist-filter li { + list-style-type: none; + margin-left: 0; + padding-left: 0; +} + +#changelist-filter a { + color: #999; +} + +#changelist-filter a:hover { + color: #036; +} + +#changelist-filter li.selected { + border-left: 5px solid #ccc; + padding-left: 5px; + margin-left: -10px; +} + +#changelist-filter li.selected a { + color: #5b80b2 !important; +} + +/* DATE DRILLDOWN */ + +.change-list ul.toplinks { + display: block; + background: white url(../img/admin/nav-bg-reverse.gif) 0 -10px repeat-x; + border-top: 1px solid white; + float: left; + padding: 0 !important; + margin: 0 !important; + width: 100%; +} + +.change-list ul.toplinks li { + float: left; + width: 9em; + padding: 3px 6px; + font-weight: bold; + list-style-type: none; +} + +.change-list ul.toplinks .date-back a { + color: #999; +} + +.change-list ul.toplinks .date-back a:hover { + color: #036; +} + +/* PAGINATOR */ + +.paginator { + font-size: 11px; + padding-top: 10px; + padding-bottom: 10px; + line-height: 22px; + margin: 0; + border-top: 1px solid #ddd; +} + +.paginator a:link, .paginator a:visited { + padding: 2px 6px; + border: solid 1px #ccc; + background: white; + text-decoration: none; +} + +.paginator a.showall { + padding: 0 !important; + border: none !important; +} + +.paginator a.showall:hover { + color: #036 !important; + background: transparent !important; +} + +.paginator .end { + border-width: 2px !important; + margin-right: 6px; +} + +.paginator .this-page { + padding: 2px 6px; + font-weight: bold; + font-size: 13px; + vertical-align: top; +} + +.paginator a:hover { + color: white; + background: #5b80b2; + border-color: #036; +} + +/* ACTIONS */ + +.filtered .actions { + margin-right: 160px !important; + border-right: 1px solid #ddd; +} + +#changelist table input { + margin: 0; +} + +#changelist table tbody tr.selected { + background-color: #FFFFCC; +} + +#changelist .actions { + color: #999; + padding: 3px; + border-top: 1px solid #fff; + border-bottom: 1px solid #ddd; + background: white url(../img/admin/nav-bg-reverse.gif) 0 -10px repeat-x; +} + +#changelist .actions.selected { + background: #fffccf; + border-top: 1px solid #fffee8; + border-bottom: 1px solid #edecd6; +} + +#changelist .actions span.all, +#changelist .actions span.action-counter, +#changelist .actions span.clear, +#changelist .actions span.question { + font-size: 11px; + margin: 0 0.5em; + display: none; +} + +#changelist .actions:last-child { + border-bottom: none; +} + +#changelist .actions select { + border: 1px solid #aaa; + margin-left: 0.5em; + padding: 1px 2px; +} + +#changelist .actions label { + font-size: 11px; + margin-left: 0.5em; +} + +#changelist #action-toggle { + display: none; +} + +#changelist .actions .button { + font-size: 11px; + padding: 1px 2px; +} diff --git a/courtside/static/admin/css/dashboard.css b/courtside/static/admin/css/dashboard.css new file mode 100644 index 0000000..ceefe15 --- /dev/null +++ b/courtside/static/admin/css/dashboard.css @@ -0,0 +1,30 @@ +/* DASHBOARD */ + +.dashboard .module table th { + width: 100%; +} + +.dashboard .module table td { + white-space: nowrap; +} + +.dashboard .module table td a { + display: block; + padding-right: .6em; +} + +/* RECENT ACTIONS MODULE */ + +.module ul.actionlist { + margin-left: 0; +} + +ul.actionlist li { + list-style-type: none; +} + +ul.actionlist li.changelink { + overflow: hidden; + text-overflow: ellipsis; + -o-text-overflow: ellipsis; +} \ No newline at end of file diff --git a/courtside/static/admin/css/forms.css b/courtside/static/admin/css/forms.css new file mode 100644 index 0000000..35d0ed7 --- /dev/null +++ b/courtside/static/admin/css/forms.css @@ -0,0 +1,354 @@ +@import url('widgets.css'); + +/* FORM ROWS */ + +.form-row { + overflow: hidden; + padding: 8px 12px; + font-size: 11px; + border-bottom: 1px solid #eee; +} + +.form-row img, .form-row input { + vertical-align: middle; +} + +form .form-row p { + padding-left: 0; + font-size: 11px; +} + +/* FORM LABELS */ + +form h4 { + margin: 0 !important; + padding: 0 !important; + border: none !important; +} + +label { + font-weight: normal !important; + color: #666; + font-size: 12px; +} + +.required label, label.required { + font-weight: bold !important; + color: #333 !important; +} + +/* RADIO BUTTONS */ + +form ul.radiolist li { + list-style-type: none; +} + +form ul.radiolist label { + float: none; + display: inline; +} + +form ul.inline { + margin-left: 0; + padding: 0; +} + +form ul.inline li { + float: left; + padding-right: 7px; +} + +/* ALIGNED FIELDSETS */ + +.aligned label { + display: block; + padding: 3px 10px 0 0; + float: left; + width: 8em; +} + +.aligned ul label { + display: inline; + float: none; + width: auto; +} + +.colMS .aligned .vLargeTextField, .colMS .aligned .vXMLLargeTextField { + width: 350px; +} + +form .aligned p, form .aligned ul { + margin-left: 7em; + padding-left: 30px; +} + +form .aligned table p { + margin-left: 0; + padding-left: 0; +} + +form .aligned p.help { + padding-left: 38px; +} + +.aligned .vCheckboxLabel { + float: none !important; + display: inline; + padding-left: 4px; +} + +.colM .aligned .vLargeTextField, .colM .aligned .vXMLLargeTextField { + width: 610px; +} + +.checkbox-row p.help { + margin-left: 0; + padding-left: 0 !important; +} + +fieldset .field-box { + float: left; + margin-right: 20px; +} + +/* WIDE FIELDSETS */ + +.wide label { + width: 15em !important; +} + +form .wide p { + margin-left: 15em; +} + +form .wide p.help { + padding-left: 38px; +} + +.colM fieldset.wide .vLargeTextField, .colM fieldset.wide .vXMLLargeTextField { + width: 450px; +} + +/* COLLAPSED FIELDSETS */ + +fieldset.collapsed * { + display: none; +} + +fieldset.collapsed h2, fieldset.collapsed { + display: block !important; +} + +fieldset.collapsed h2 { + background-image: url(../img/admin/nav-bg.gif); + background-position: bottom left; + color: #999; +} + +fieldset.collapsed .collapse-toggle { + background: transparent; + display: inline !important; +} + +/* MONOSPACE TEXTAREAS */ + +fieldset.monospace textarea { + font-family: "Bitstream Vera Sans Mono",Monaco,"Courier New",Courier,monospace; +} + +/* SUBMIT ROW */ + +.submit-row { + padding: 5px 7px; + text-align: right; + background: white url(../img/admin/nav-bg.gif) 0 100% repeat-x; + border: 1px solid #ccc; + margin: 5px 0; + overflow: hidden; +} + +.submit-row input { + margin: 0 0 0 5px; +} + +.submit-row p { + margin: 0.3em; +} + +.submit-row p.deletelink-box { + float: left; +} + +.submit-row .deletelink { + background: url(../img/admin/icon_deletelink.gif) 0 50% no-repeat; + padding-left: 14px; +} + +/* CUSTOM FORM FIELDS */ + +.vSelectMultipleField { + vertical-align: top !important; +} + +.vCheckboxField { + border: none; +} + +.vDateField, .vTimeField { + margin-right: 2px; +} + +.vURLField { + width: 30em; +} + +.vLargeTextField, .vXMLLargeTextField { + width: 48em; +} + +.flatpages-flatpage #id_content { + height: 40.2em; +} + +.module table .vPositiveSmallIntegerField { + width: 2.2em; +} + +.vTextField { + width: 20em; +} + +.vIntegerField { + width: 5em; +} + +.vForeignKeyRawIdAdminField { + width: 5em; +} + +/* INLINES */ + +.inline-group { + padding: 0; + border: 1px solid #ccc; + margin: 10px 0; +} + +.inline-group .aligned label { + width: 8em; +} + +.inline-related { + position: relative; +} + +.inline-related h3 { + margin: 0; + color: #666; + padding: 3px 5px; + font-size: 11px; + background: #e1e1e1 url(../img/admin/nav-bg.gif) top left repeat-x; + border-bottom: 1px solid #ddd; +} + +.inline-related h3 span.delete { + float: right; +} + +.inline-related h3 span.delete label { + margin-left: 2px; + font-size: 11px; +} + +.inline-related fieldset { + margin: 0; + background: #fff; + border: none; +} + +.inline-related fieldset.module h3 { + margin: 0; + padding: 2px 5px 3px 5px; + font-size: 11px; + text-align: left; + font-weight: bold; + background: #bcd; + color: #fff; +} + +.inline-group .tabular fieldset.module { + border: none; + border-bottom: 1px solid #ddd; +} + +.inline-related.tabular fieldset.module table { + width: 100%; +} + +.last-related fieldset { + border: none; +} + +.inline-group .tabular tr.has_original td { + padding-top: 2em; +} + +.inline-group .tabular tr td.original { + padding: 2px 0 0 0; + width: 0; + _position: relative; +} + +.inline-group .tabular th.original { + width: 0px; + padding: 0; +} + +.inline-group .tabular td.original p { + position: absolute; + left: 0; + height: 1.1em; + padding: 2px 7px; + overflow: hidden; + font-size: 9px; + font-weight: bold; + color: #666; + _width: 700px; +} + +.inline-group ul.tools { + padding: 0; + margin: 0; + list-style: none; +} + +.inline-group ul.tools li { + display: inline; + padding: 0 5px; +} + +.inline-group div.add-row, +.inline-group .tabular tr.add-row td { + color: #666; + padding: 3px 5px; + border-bottom: 1px solid #ddd; + background: #e1e1e1 url(../img/admin/nav-bg.gif) top left repeat-x; +} + +.inline-group .tabular tr.add-row td { + padding: 4px 5px 3px; + border-bottom: none; +} + +.inline-group ul.tools a.add, +.inline-group div.add-row a, +.inline-group .tabular tr.add-row td a { + background: url(../img/admin/icon_addlink.gif) 0 50% no-repeat; + padding-left: 14px; + font-size: 11px; + outline: 0; /* Remove dotted border around link */ +} + +.empty-form { + display: none; +} diff --git a/courtside/static/admin/css/ie.css b/courtside/static/admin/css/ie.css new file mode 100644 index 0000000..5fd1ce3 --- /dev/null +++ b/courtside/static/admin/css/ie.css @@ -0,0 +1,57 @@ +/* IE 6 & 7 */ + +/* Proper fixed width for dashboard in IE6 */ + +.dashboard #content { + *width: 768px; +} + +.dashboard #content-main { + *width: 535px; +} + +/* IE 6 ONLY */ + +/* Keep header from flowing off the page */ + +#container { + _position: static; +} + +/* Put the right sidebars back on the page */ + +.colMS #content-related { + _margin-right: 0; + _margin-left: 10px; + _position: static; +} + +/* Put the left sidebars back on the page */ + +.colSM #content-related { + _margin-right: 10px; + _margin-left: -115px; + _position: static; +} + +.form-row { + _height: 1%; +} + +/* Fix right margin for changelist filters in IE6 */ + +#changelist-filter ul { + _margin-right: -10px; +} + +/* IE ignores min-height, but treats height as if it were min-height */ + +.change-list .filtered { + _height: 400px; +} + +/* IE doesn't know alpha transparency in PNGs */ + +.inline-deletelink { + background: transparent url(../img/admin/inline-delete-8bit.png) no-repeat; +} \ No newline at end of file diff --git a/courtside/static/admin/css/login.css b/courtside/static/admin/css/login.css new file mode 100644 index 0000000..8d90d12 --- /dev/null +++ b/courtside/static/admin/css/login.css @@ -0,0 +1,54 @@ +/* LOGIN FORM */ + +body.login { + background: #eee; +} + +.login #container { + background: white; + border: 1px solid #ccc; + width: 28em; + min-width: 300px; + margin-left: auto; + margin-right: auto; + margin-top: 100px; +} + +.login #content-main { + width: 100%; +} + +.login form { + margin-top: 1em; +} + +.login .form-row { + padding: 4px 0; + float: left; + width: 100%; +} + +.login .form-row label { + float: left; + width: 9em; + padding-right: 0.5em; + line-height: 2em; + text-align: right; + font-size: 1em; + color: #333; +} + +.login .form-row #id_username, .login .form-row #id_password { + width: 14em; +} + +.login span.help { + font-size: 10px; + display: block; +} + +.login .submit-row { + clear: both; + padding: 1em 0 0 9.4em; +} + diff --git a/courtside/static/admin/css/rtl.css b/courtside/static/admin/css/rtl.css new file mode 100644 index 0000000..b05537a --- /dev/null +++ b/courtside/static/admin/css/rtl.css @@ -0,0 +1,221 @@ +body { + direction: rtl; +} + +/* LOGIN */ + +.login .form-row { + float: right; +} + +.login .form-row label { + float: right; + padding-left: 0.5em; + padding-right: 0; + text-align: left; +} + +.login .submit-row { + clear: both; + padding: 1em 9.4em 0 0; +} + +/* GLOBAL */ + +th { + text-align: right; +} + +.module h2, .module caption { + text-align: right; +} + +.addlink, .changelink { + padding-left: 0px; + padding-right: 12px; + background-position: 100% 0.2em; +} + +.deletelink { + padding-left: 0px; + padding-right: 12px; + background-position: 100% 0.25em; +} + +.object-tools { + float: left; +} + +/* LAYOUT */ + +#user-tools { + right: auto; + left: 0; + text-align: left; +} + +div.breadcrumbs { + text-align: right; +} + +#content-main { + float: right; +} + +#content-related { + float: left; + margin-left: -19em; + margin-right: auto; +} + +.colMS { + margin-left: 20em !important; + margin-right: 10px !important; +} + +/* dashboard styles */ + +.dashboard .module table td a { + padding-left: .6em; + padding-right: 12px; +} + +/* changelists styles */ + +.change-list ul.toplinks li { + float: right; +} + +.change-list .filtered { + background: white url(../img/admin/changelist-bg_rtl.gif) top left repeat-y !important; +} + +.change-list .filtered table { + border-left: 1px solid #ddd; + border-right: 0px none; +} + +#changelist-filter { + right: auto; + left: 0; + border-left: 0px none; + border-right: 1px solid #ddd; +} + +.change-list .filtered table, .change-list .filtered .paginator, .filtered #toolbar, .filtered div.xfull { + margin-right: 0px !important; + margin-left: 160px !important; +} + +#changelist-filter li.selected { + border-left: 0px none; + padding-left: 0px; + margin-left: 0; + border-right: 5px solid #ccc; + padding-right: 5px; + margin-right: -10px; +} + +.filtered .actions { + border-left:1px solid #DDDDDD; + margin-left:160px !important; + border-right: 0 none; + margin-right:0 !important; +} + +/* FORMS */ + +.aligned label { + padding: 0 0 3px 1em; + float: right; +} + +.submit-row { + text-align: left +} + +.submit-row p.deletelink-box { + float: right; +} + +.submit-row .deletelink { + background: url(../img/admin/icon_deletelink.gif) 0 50% no-repeat; + padding-right: 14px; +} + +.vDateField, .vTimeField { + margin-left: 2px; +} + +form ul.inline li { + float: right; + padding-right: 0; + padding-left: 7px; +} + +input[type=submit].default, .submit-row input.default { + float: left; +} + +fieldset .field-box { + float: right; + margin-left: 20px; +} + +.errorlist li { + background-position: 100% .3em; + padding: 4px 25px 4px 5px; +} + +.errornote { + background-position: 100% .3em; + padding: 4px 25px 4px 5px; +} + +/* WIDGETS */ + +.calendarnav-previous { + top: 0; + left: auto; + right: 0; +} + +.calendarnav-next { + top: 0; + right: auto; + left: 0; +} + +.calendar caption, .calendarbox h2 { + text-align: center; +} + +.selector { + float: right; +} + +.selector .selector-filter { + text-align: right; +} + +.inline-deletelink { + float: left; +} + +/* MISC */ + +.inline-related h2, .inline-group h2 { + text-align: right +} + +.inline-related h3 span.delete { + padding-right: 20px; + padding-left: inherit; + left: 10px; + right: inherit; +} + +.inline-related h3 span.delete label { + margin-left: inherit; + margin-right: 2px; +} diff --git a/courtside/static/admin/css/widgets.css b/courtside/static/admin/css/widgets.css new file mode 100644 index 0000000..26400fa --- /dev/null +++ b/courtside/static/admin/css/widgets.css @@ -0,0 +1,514 @@ +/* SELECTOR (FILTER INTERFACE) */ + +.selector { + width: 580px; + float: left; +} + +.selector select { + width: 270px; + height: 17.2em; +} + +.selector-available, .selector-chosen { + float: left; + width: 270px; + text-align: center; + margin-bottom: 5px; +} + +.selector-available h2, .selector-chosen h2 { + border: 1px solid #ccc; +} + +.selector .selector-available h2 { + background: white url(../img/admin/nav-bg.gif) bottom left repeat-x; + color: #666; +} + +.selector .selector-filter { + background: white; + border: 1px solid #ccc; + border-width: 0 1px; + padding: 3px; + color: #999; + font-size: 10px; + margin: 0; + text-align: left; +} + +.selector .selector-chosen .selector-filter { + padding: 4px 5px; +} + +.selector .selector-available input { + width: 230px; +} + +.selector ul.selector-chooser { + float: left; + width: 22px; + height: 50px; + background: url(../img/admin/chooser-bg.gif) top center no-repeat; + margin: 8em 3px 0 3px; + padding: 0; +} + +.selector-chooser li { + margin: 0; + padding: 3px; + list-style-type: none; +} + +.selector select { + margin-bottom: 5px; + margin-top: 0; +} + +.selector-add, .selector-remove { + width: 16px; + height: 16px; + display: block; + text-indent: -3000px; + overflow: hidden; +} + +.selector-add { + background: url(../img/admin/selector-add.gif) top center no-repeat; + margin-bottom: 2px; +} + +.selector-remove { + background: url(../img/admin/selector-remove.gif) top center no-repeat; +} + +a.selector-chooseall, a.selector-clearall { + display: block; + width: 6em; + text-align: left; + margin-left: auto; + margin-right: auto; + font-weight: bold; + color: #666; + padding: 3px 0 3px 18px; +} + +a.selector-chooseall:hover, a.selector-clearall:hover { + color: #036; +} + +a.selector-chooseall { + width: 7em; + background: url(../img/admin/selector-addall.gif) left center no-repeat; +} + +a.selector-clearall { + background: url(../img/admin/selector-removeall.gif) left center no-repeat; +} + + +/* STACKED SELECTORS */ + +.stacked { + float: left; + width: 500px; +} + +.stacked select { + width: 480px; + height: 10.1em; +} + +.stacked .selector-available, .stacked .selector-chosen { + width: 480px; +} + +.stacked .selector-available { + margin-bottom: 0; +} + +.stacked .selector-available input { + width: 442px; +} + +.stacked ul.selector-chooser { + height: 22px; + width: 50px; + margin: 0 0 3px 40%; + background: url(../img/admin/chooser_stacked-bg.gif) top center no-repeat; +} + +.stacked .selector-chooser li { + float: left; + padding: 3px 3px 3px 5px; +} + +.stacked .selector-chooseall, .stacked .selector-clearall { + display: none; +} + +.stacked .selector-add { + background-image: url(../img/admin/selector_stacked-add.gif); +} + +.stacked .selector-remove { + background-image: url(../img/admin/selector_stacked-remove.gif); +} + + +/* DATE AND TIME */ + +p.datetime { + line-height: 20px; + margin: 0; + padding: 0; + color: #666; + font-size: 11px; + font-weight: bold; +} + +.datetime span { + font-size: 11px; + color: #ccc; + font-weight: normal; + white-space: nowrap; +} + +table p.datetime { + font-size: 10px; + margin-left: 0; + padding-left: 0; +} + +/* FILE UPLOADS */ + +p.file-upload { + line-height: 20px; + margin: 0; + padding: 0; + color: #666; + font-size: 11px; + font-weight: bold; +} + +.file-upload a { + font-weight: normal; +} + +.file-upload .deletelink { + margin-left: 5px; +} + +span.clearable-file-input label { + color: #333; + font-size: 11px; + display: inline; + float: none; +} + +/* CALENDARS & CLOCKS */ + +.calendarbox, .clockbox { + margin: 5px auto; + font-size: 11px; + width: 16em; + text-align: center; + background: white; + position: relative; +} + +.clockbox { + width: auto; +} + +.calendar { + margin: 0; + padding: 0; +} + +.calendar table { + margin: 0; + padding: 0; + border-collapse: collapse; + background: white; + width: 99%; +} + +.calendar caption, .calendarbox h2 { + margin: 0; + font-size: 11px; + text-align: center; + border-top: none; +} + +.calendar th { + font-size: 10px; + color: #666; + padding: 2px 3px; + text-align: center; + background: #e1e1e1 url(../img/admin/nav-bg.gif) 0 50% repeat-x; + border-bottom: 1px solid #ddd; +} + +.calendar td { + font-size: 11px; + text-align: center; + padding: 0; + border-top: 1px solid #eee; + border-bottom: none; +} + +.calendar td.selected a { + background: #C9DBED; +} + +.calendar td.nonday { + background: #efefef; +} + +.calendar td.today a { + background: #ffc; +} + +.calendar td a, .timelist a { + display: block; + font-weight: bold; + padding: 4px; + text-decoration: none; + color: #444; +} + +.calendar td a:hover, .timelist a:hover { + background: #5b80b2; + color: white; +} + +.calendar td a:active, .timelist a:active { + background: #036; + color: white; +} + +.calendarnav { + font-size: 10px; + text-align: center; + color: #ccc; + margin: 0; + padding: 1px 3px; +} + +.calendarnav a:link, #calendarnav a:visited, #calendarnav a:hover { + color: #999; +} + +.calendar-shortcuts { + background: white; + font-size: 10px; + line-height: 11px; + border-top: 1px solid #eee; + padding: 3px 0 4px; + color: #ccc; +} + +.calendarbox .calendarnav-previous, .calendarbox .calendarnav-next { + display: block; + position: absolute; + font-weight: bold; + font-size: 12px; + background: #C9DBED url(../img/admin/default-bg.gif) bottom left repeat-x; + padding: 1px 4px 2px 4px; + color: white; +} + +.calendarnav-previous:hover, .calendarnav-next:hover { + background: #036; +} + +.calendarnav-previous { + top: 0; + left: 0; +} + +.calendarnav-next { + top: 0; + right: 0; +} + +.calendar-cancel { + margin: 0 !important; + padding: 0; + font-size: 10px; + background: #e1e1e1 url(../img/admin/nav-bg.gif) 0 50% repeat-x; + border-top: 1px solid #ddd; +} + +.calendar-cancel a { + padding: 2px; + color: #999; +} + +ul.timelist, .timelist li { + list-style-type: none; + margin: 0; + padding: 0; +} + +.timelist a { + padding: 2px; +} + +/* INLINE ORDERER */ + +ul.orderer { + position: relative; + padding: 0 !important; + margin: 0 !important; + list-style-type: none; +} + +ul.orderer li { + list-style-type: none; + display: block; + padding: 0; + margin: 0; + border: 1px solid #bbb; + border-width: 0 1px 1px 0; + white-space: nowrap; + overflow: hidden; + background: #e2e2e2 url(../img/admin/nav-bg-grabber.gif) repeat-y; +} + +ul.orderer li:hover { + cursor: move; + background-color: #ddd; +} + +ul.orderer li a.selector { + margin-left: 12px; + overflow: hidden; + width: 83%; + font-size: 10px !important; + padding: 0.6em 0; +} + +ul.orderer li a:link, ul.orderer li a:visited { + color: #333; +} + +ul.orderer li .inline-deletelink { + position: absolute; + right: 4px; + margin-top: 0.6em; +} + +ul.orderer li.selected { + background-color: #f8f8f8; + border-right-color: #f8f8f8; +} + +ul.orderer li.deleted { + background: #bbb url(../img/admin/deleted-overlay.gif); +} + +ul.orderer li.deleted a:link, ul.orderer li.deleted a:visited { + color: #888; +} + +ul.orderer li.deleted .inline-deletelink { + background-image: url(../img/admin/inline-restore.png); +} + +ul.orderer li.deleted:hover, ul.orderer li.deleted a.selector:hover { + cursor: default; +} + +/* EDIT INLINE */ + +.inline-deletelink { + float: right; + text-indent: -9999px; + background: transparent url(../img/admin/inline-delete.png) no-repeat; + width: 15px; + height: 15px; + border: 0px none; + outline: 0; /* Remove dotted border around link */ +} + +.inline-deletelink:hover { + background-position: -15px 0; + cursor: pointer; +} + +.editinline button.addlink { + border: 0px none; + color: #5b80b2; + font-size: 100%; + cursor: pointer; +} + +.editinline button.addlink:hover { + color: #036; + cursor: pointer; +} + +.editinline table .help { + text-align: right; + float: right; + padding-left: 2em; +} + +.editinline tfoot .addlink { + white-space: nowrap; +} + +.editinline table thead th:last-child { + border-left: none; +} + +.editinline tr.deleted { + background: #ddd url(../img/admin/deleted-overlay.gif); +} + +.editinline tr.deleted .inline-deletelink { + background-image: url(../img/admin/inline-restore.png); +} + +.editinline tr.deleted td:hover { + cursor: default; +} + +.editinline tr.deleted td:first-child { + background-image: none !important; +} + +/* EDIT INLINE - STACKED */ + +.editinline-stacked { + min-width: 758px; +} + +.editinline-stacked .inline-object { + margin-left: 210px; + background: white; +} + +.editinline-stacked .inline-source { + float: left; + width: 200px; + background: #f8f8f8; +} + +.editinline-stacked .inline-splitter { + float: left; + width: 9px; + background: #f8f8f8 url(../img/admin/inline-splitter-bg.gif) 50% 50% no-repeat; + border-right: 1px solid #ccc; +} + +.editinline-stacked .controls { + clear: both; + background: #e1e1e1 url(../img/admin/nav-bg.gif) top left repeat-x; + padding: 3px 4px; + font-size: 11px; + border-top: 1px solid #ddd; +} + diff --git a/courtside/static/admin/img/admin/arrow-down.gif b/courtside/static/admin/img/admin/arrow-down.gif new file mode 100644 index 0000000000000000000000000000000000000000..a967b9fd5563a0fc2f5fde8ec0f7de3fc8fbc5a9 GIT binary patch literal 80 zcmZ?wbhEHb3wfn>L+1d2-{%jW1rjm^pLi|Ns9P7#I|PvM@3LmFNK3 i3?Q`(%%TyyyiA!oB04G)Te5yh$2@OMO7G-kum%ACMICAY literal 0 HcmV?d00001 diff --git a/courtside/static/admin/img/admin/arrow-up.gif b/courtside/static/admin/img/admin/arrow-up.gif new file mode 100644 index 0000000000000000000000000000000000000000..3fe4851399a37337891ccf5452ee5d59bbedeec7 GIT binary patch literal 838 zcmZ?wbhEHb3wfn>L+1d2-{%jW1rjm^pJM!zdUHfe{k|ia%Kx8GuSOX;Q=NFCLWFl0*@NH#f6pb?3n1_z+epkX4f1j literal 0 HcmV?d00001 diff --git a/courtside/static/admin/img/admin/changelist-bg.gif b/courtside/static/admin/img/admin/changelist-bg.gif new file mode 100644 index 0000000000000000000000000000000000000000..7f4699470adc8c021740023dcd4f0a1bd5f50b84 GIT binary patch literal 58 zcmZ?wbhEHbT*$!0(7?d({{8#Acke3xWMKdS9S{MMVPF#E>05dFE&t*vt?bv=6id7ONcO70{{r%8=U|E literal 0 HcmV?d00001 diff --git a/courtside/static/admin/img/admin/chooser-bg.gif b/courtside/static/admin/img/admin/chooser-bg.gif new file mode 100644 index 0000000000000000000000000000000000000000..30e83c2518b0e5ee5f4bda6ce790b47f6dbdbfbb GIT binary patch literal 199 zcmZ?wbhEHb6l2h5*v!E2@87@o@85s?`0?-Gzu&)q|NQy$j~_oiefsp_!-t2MMY9TZUv9~%Sp!>_)cW&ci3#* zUhC5m*S~nZz=*>R=VoO!-wlwA$Z`-01 q@~q#j3=%veq*@rvq^WHhU}-`1SSm{{H^+^Yi-p`uF$u@bK{c{r&s< z`||Sg^z`)c@$vTd_5c6?A^8LV00000EC2ui05AX-000DmFvuy15jgA3yCGB Oo}Zwd4gw#T5db^5xM#Bf literal 0 HcmV?d00001 diff --git a/courtside/static/admin/img/admin/default-bg-reverse.gif b/courtside/static/admin/img/admin/default-bg-reverse.gif new file mode 100644 index 0000000000000000000000000000000000000000..0873281e51bdcfd1e7eb5bbfbde3a09c4cbc943e GIT binary patch literal 843 zcmV-R1GM}{Nk%w1VG#fy0OkMyywd5g$>Wc((SfDPyV2;h%;kux&VHiEgQv@Yq{*Sa z+l{W!qQ2X>&*yuf#)zuThN#S(y4aey*L$GHimcC{yxF9{+^)ysgs01&yxO+S=DE=5 zq`=*$!rrpW%Ia#o)Ef<&3V-tHt57%Hx^1)~CYVyVB@=p~tMo;ew{h zv&!VG#o?8+)Qqmrnz+`6sm*|+$&#|ts>I*7&E~4Z;GetNkg(B_veJR3%8#$nw9VzU z&E=W6*PXi9oVwYCsLX|_%&NoRhN#WD(ddt_(zwp%xX$ON!QH9E;Dn~jv&-bS&gP%H z*|yE)hN;YZp~kn*=6s;Xx6kLIz1xql(y__nrNG^btIvL;$&0MdA^8LV00000EC2ui z01*Hm000O7fOifPgAR3s6N!Zm4lp*4BuykFJTOf*l}$X9EG!3~2cDpzoqh=-BB!UR zRtX8Ms!u=zUbD1M1G%=j2p9;zy>Gw17{$G1Xb@%)%w}{DRc2LX%n%O-*9O`T+}qs- z6yY>9I~3y-JAD*?=sPhn3-R$WM@RDTQ%3>JcA0syKJpvRw!9yxMc>2a`&3xzov zx=8UshKv*xrBwWoF@=l|HCC*s;bR3396o&D2#Io}gqKQ&P@xj@r5G_1lt>sdX2ggH z5q<(4L&hf=pb;u$$grh?Ql=T4R*EFeIr5KLGLmcd%i6bbUe36dy_8@~t=1<8vdNG`N! zQKH3#5}!MR)_mbYfB-X2r#`*swCdC*JV5b~Bz9~MxJ{UV0|gEkBL#wo0UoA+5ir4% zYY4HNd5A1o;>^)NJp}VL4YJ!gaiT$Y@80pSX|Q3#jTWc((SfDPyV2;h%;kux&VHiEgQv@Yq{*Sa z+l{W!qQ2X>&*yuf#)zuThN#S(y4aey*L$GHimcC{yxF9{+^)ysgs01&yxO+S=DE=5 zq`=*$!rrpW%Ia#o)Ef<&3V-tHt57%Hx^1)~CYVyVB@=p~tMo;ew{h zv&!VG#o?8+)Qqmrnz+`6sm*|+$&#|ts>I*7&E~4Z;GetNkg(B_veJR3%8#$nw9VzU z&E=W6*PXi9oVwYCsLX|_%&NoRhN#WD(ddt_(zwp%xX$ON!QH9E;Dn~jv&-bS&gP%H z*|yE)hN;YZp~kn*=6s;Xx6kLIz1xql(y__nrNG^btIvL;$&0MdA^8LV00000EC2ui z01*Hm000O7fB=GngoT0x1WZIsh=@c4X^)Hq8yhz_C@7YhmN%6fC~FO)b|)tdr>LlS zYz-PAudpFmS#fh3xFN7$Mg_iMy zEiEN27bWH6=HM3>ML{o4NKx(YFF{dAFGWZyZdf27DgX-9f+e7qGeUGM>CmP_hlM&i z=nx`A;t~!VesHj0A)^I895r&}pnw5`k|<3oSa~uJg9;fkY^eZKW(JxS@T~!jKv(R@CsZ0tXHsK5$_Dsx`$288T9sm2&pO z+7vRWKDg+SBgd5`H-TFR%!C^)o_GDj!gPtK1gc27Dv@$SQ0{~`FJvsmY literal 0 HcmV?d00001 diff --git a/courtside/static/admin/img/admin/icon-unknown.gif b/courtside/static/admin/img/admin/icon-unknown.gif new file mode 100644 index 0000000000000000000000000000000000000000..cfd2b02ad91b3677dbe59111faaf4f437c362cb8 GIT binary patch literal 130 zcmV-|0Db>QNk%w1VF~~W0J9GO^z`(anwr7E!O_vts;a8Fxw+ur;K|9!=;-Lh#l`#k z`?0aH)z#IOmX?c)i~s-sA^8LW000jFEC2ui015yK000Cp@IAI#TTH&>x=&LlD2fp{ kltU;-pbSpsb&B9v9)J|xHP4tFtdrsVKoW`tBZ&Y2J8`5w82|tP literal 0 HcmV?d00001 diff --git a/courtside/static/admin/img/admin/icon-yes.gif b/courtside/static/admin/img/admin/icon-yes.gif new file mode 100644 index 0000000000000000000000000000000000000000..73992827403791d6c1a75a079880e41dce7e0214 GIT binary patch literal 299 zcmZ?wbhEHbb?NhTQ$x_deWPc4O)NkN2|oXRf%p{M+wuUw(Z# z`TWGXJ8Mf07p=Or^7yl3mtJ2C+~V)C-fh~&DX}}E_C4PF@Y93ee}B)tGUw-?pC_Il zZ#vO%{oS?y|Nqw=uUUR`+4?){5_iQh&Q{xM6OkFieY2o T4)tf0@^WEj=4)bdWUvMRbX#E6 literal 0 HcmV?d00001 diff --git a/courtside/static/admin/img/admin/icon_addlink.gif b/courtside/static/admin/img/admin/icon_addlink.gif new file mode 100644 index 0000000000000000000000000000000000000000..ee70e1adba52480cc6aedbee650000c5d55b0088 GIT binary patch literal 119 zcmZ?wbhEHb(s)E@aY^3 F)&O8RB1ZrK literal 0 HcmV?d00001 diff --git a/courtside/static/admin/img/admin/icon_alert.gif b/courtside/static/admin/img/admin/icon_alert.gif new file mode 100644 index 0000000000000000000000000000000000000000..a1dde2625445b76d041ae02ccfcb83481ca63c5e GIT binary patch literal 145 zcmV;C0B-+BNk%w1VGsZi0J9GO|G@+Q!3O`;RR7pu|IkAJ%Ps%YPXF0v|INcdJ{u&=}=IXLDhr+J%S1nrq(gCL;wIgri4F* literal 0 HcmV?d00001 diff --git a/courtside/static/admin/img/admin/icon_calendar.gif b/courtside/static/admin/img/admin/icon_calendar.gif new file mode 100644 index 0000000000000000000000000000000000000000..7587b305a4ee702cbed3bee1ae17c78feb85d00b GIT binary patch literal 192 zcmV;x06+gnNk%w1VGsZi0J8u9nVFf2iHY^~_4)bv@bK{4+uQ&D|FN{U?d|Qf&F0D5 z?Wd=w{QUgs>FMX^=l}ozA^8LW000jFEC2ui01yBW000DS@X1N*1UPGamH(iU1QH+` z43ii};vPZqm~L$+una7G@AI)4YnU1cj)Wk=I*&Aa=g_Vl48 zmH)wj0Spv>vM@3*@G|Itcpx(vSX4HgyeYC&>*nrB_bxSQsBGn6*)YRRaLr}Q6>6LJ P$Rx*~-FRR+2ZJ>L#Kbnb literal 0 HcmV?d00001 diff --git a/courtside/static/admin/img/admin/icon_clock.gif b/courtside/static/admin/img/admin/icon_clock.gif new file mode 100644 index 0000000000000000000000000000000000000000..ff2d57e0a3b6373b7bd9540e688b1b4c71081cb7 GIT binary patch literal 390 zcmV;10eSvMNk%w1VGsZi0M$DH{QUg>{{H#-`S$kq$lLA4+3fD_?(*{T{{H>?`uXqg z@BaV(?CkCH^Yi-p`u6wt#Mtch_4dHk>iGEh^7Hca^z*{j>crRU`1twz{QT_e?DqEc z$J*@b>gvMQ>+|&V$lC14+wAM>>;3)w@9*%!*X#51^1;{Z`}_OH+U@-O`^ehu#MkWU z>FEFe{^{xI#n|ld@$l~N@5kBgv9!0z+wHW?=G)ubr>Cd?|NohpnY8A@0000000000 z00000A^8LW0027xEC2ui01yBW000J~z@2cXD;jmfB(YW_ga{xGQmJF&uGa!=Dy-IU zx$q)@gRrJva4tXt05Uks30VcZ5F=VbfDzy%IyZGW2r3RV4+8@cI5vSg1UL%-4ihvL z4F?pBk1IFOZ1vml&CJGE4FE})gH$(*xI2#8t kA}zwiLpm2FSXaY=R2~vG+}zkoL`Ox%;6gX&=t@BVI|kg>kN^Mx literal 0 HcmV?d00001 diff --git a/courtside/static/admin/img/admin/icon_deletelink.gif b/courtside/static/admin/img/admin/icon_deletelink.gif new file mode 100644 index 0000000000000000000000000000000000000000..72523e3a3ba1446c8f768c157cea642119a02741 GIT binary patch literal 181 zcmZ?wbhEHbc&kkH2hg{xUB9fxq8%JG(R5 zT3?Eao`!{eDJnj1U~tLY{9|s;X>G0VWo1vp!yowhEs~V{|NlP&4xspxg^__loIwX9 z53-Yi)#yQKi;S#{{sX6 zi;Dh#`0#&e>3>Vh|D2rv=gC*q|>i-WM_<#QV|C1;G zS5*8rF!=rZ_kUyK|3JV%TcG%pg^__lo4aiRnY%vG=3p{kB40{i-Of=+@`~3X;@bK{O@9+Kn{rLF!_xJbl@$pSfP5S!!_4W1n`T6YZ?B3qqPft(K z(9rAa>(gwwA^YilZ@=HrgUS3{FNlEth_IP-BSy@@<=jZ6? z=$e|EaBy(V&CR>JyVcdz;o;$EXlUQx-&9moTU%RKS68&OwCU;T!NJ+t*-}zc&)b92AH zzpJaOZfvlTPVlRhn*D zzYj!ubf8e2}%QyRfsr*SWe%Rb`=>R1ae%6%2~5|TAxeL zzADQysO81>*ZZYCyl6@$BdV$biI?uic&0bzMrFb%Aq1#ZUv-+v+w0VD#)3jAg-{rn zQK{SBuPmhC5$}W{D84q?yXp06=7SUzUxd5@c^_-Jtgg3OcgI0-bjam_F)Z9$Uf=5< z*hz6@lo{ZZu*P|f^TenPFmQjgIBP%6a@>yq0{~})9l-cU)g%A_002ovPDHLkV1oH8 BY;phq literal 0 HcmV?d00001 diff --git a/courtside/static/admin/img/admin/icon_success.gif b/courtside/static/admin/img/admin/icon_success.gif new file mode 100644 index 0000000000000000000000000000000000000000..5cf90a15aa6731798b025a238fa47a1658510fff GIT binary patch literal 341 zcmZ?wbhEHb6krfwxXJ(m|NsC0@cYBBf4?q$zBut-@A?;OHoRQB_4TGbZ+4yjc=Gy} zYu7$sefa&slkbn8{dih+uDI?}MdP*V#;eu+_qwJ$=-=~p=Y>z_u719puq!NScSPpF zg#4pv1xM2>&lOf*D6TwP`0>{VkG0l*8=OKmdxUNAj@;&(aUeGLNb=vme}Ptmoj^XJ z_>+Z^fkBHw2V?}uPYi5D4pR#}bfiS5bS&9qz$LFSv4l%VM0VNAuq7M$%x`OYevyni z6y)sQCFr(n`AWsDVxcXCnHqNfPZgaKf;1I5H8q8UQ?&$wdD=UoSe-bM`a7e(;ev*DhVUbne`_Q>RWHJ$m%u z!GnAE?%ld|>&A^6SFT*SV8MbJGiFSgGG)Sq2|YbM4Gj%I(@xu~L;ww!E(!7r26Ax# z26Yo|Q=l@=0*}aI1_rJVAk65r#$*OiP`<=9q9iy!t)x7$D3!rCF}Wx|H#H?QQNb;< zD78GlD7#p}Vr#~w3ZT-9o-U3d5>s0PZ;Q1kaJcNw6<2ol{`H?fR&lq@+fNPd=`slo zkNq2-l{wAX{kw31#NjUjI#s<#Uj@rXCa>o{s1qmoLR|UF+{q6*%d3Ul-XEy+RoY#| zkfg@p<7MzuzoD2R^0?fz%GC`Vt9o~eIX#}ba7TVWzqWIsT+0Qozj6zvZ?O^|iOvau45i`%PE+DBAs)9(WdP);)FE4qk(op#PgM^?h(mhZn$bMx7!ED!$ll-yWMuFR9Y9iY1q7x+Tho7W2RcIw$bnR z2Z2D~y5@l64y0TzH$=tFKLOu2^C00_)Ch$_LD)3MqdNl)v!b&k++3HA!8QF=ku#b%{yJ#wK~|XDwD}%Ih)Ns*K9MH z%(HYly{5CB)Ym{qon_8#Hk*fGCw9C2rdkss8}e+bO6J_@bS`v6TrSr|wI)OwBZmQm zHE@-oO(YTz5V;=1&QvJr=y6WMe@$|)b-+D_HXIJ8d%fN;>`aB04(d23;lD2}`^z_f zWD`6<7Ey3_>h*ewj@6o=j&q`$*PTb){4yf-uu`dfren1xsNE;uf~-qQ~+a-GFR@J$@b>Hh94o@B%i?F()B=ob5MjVEX~Af^TCZ zpt}o>$R?)bE~vB3v9|mNm(eM3QreV7{t3JXuf|(;ev*DhVUbne`_qeqV(Ja};L z-o0D5Zr!+XNxJHx&=ckpFCl;kL_$DS7<>#iRWF{)OWfrBD=NDxcD_CsJ zxKsgDy5G~qF+^f&>qJMfW(6J><{J?Kf>R&;&5u&^T)oP_O3;r=6p7) zlfNAI+AzN1yld9iPbOE?zDn^FWNWTzVg8q;tMyQH#xB2CjJMamULv=ffzPT{LG9m{ z3!RZZYz+J_R$O4Tn}6ZyW@b)?Zsy_zb<*cm_zc-z$!)fZ;AeP{VB3kMP1FLBYMl`sP8M=cy-s(-<#^LNPFbS VZ>oP-s}J-FgQu&X%Q~loCIHeD(U1TD literal 0 HcmV?d00001 diff --git a/courtside/static/admin/img/admin/inline-restore.png b/courtside/static/admin/img/admin/inline-restore.png new file mode 100644 index 0000000000000000000000000000000000000000..efdd92ac39d12c2f84fbd22d05d7b495e2206bf4 GIT binary patch literal 623 zcmV-#0+9WQP)V!KQp&Gv#VQ{rTw<)x~~1Dk?(c~!+vyQpqu`J3b+L~ zR`ZDG!5ruVF7OO4z$y5w^TqAKF*#fWUI*hZ;0T(M%?=EJb>Mf<-hn;vz<0pKoOhsG zlFpOKWZcFGeU*W=oyt4~z9F4M8?n(2flbiMCtYkj4Ls7hVHi$Z+y!QpxfL)doj1_- zgSEON5MRGa0deQ)bh_3T3I#0~42F6BfCG^m^!3}IjXPJgF{Y(F*a1(q;}n-rM^R@F=3jf=JWZqL?XfSLgqn_(8ii* zd0u$rK$hW~oS-1&G0<4f=kxiv+wJDZ_bU1_)5hd6(3oi>ingRCVUgFUx)angnT)37 zKv9fM@WF#BmfOQv#2a57-S&KT*C(G{DQl+NNW9y=`fHnu-v==- Ot=>b+CQo8uum%9*_Ae;_ literal 0 HcmV?d00001 diff --git a/courtside/static/admin/img/admin/nav-bg-reverse.gif b/courtside/static/admin/img/admin/nav-bg-reverse.gif new file mode 100644 index 0000000000000000000000000000000000000000..f11029f90fc965141b8815a78ac2651759099475 GIT binary patch literal 186 zcmV;r07d^tNk%w1VG#fy0J8u9|NsB^`1t<*{`U6v@$vEd`}^(f?dRv`;^N}{{r&3d z>hA9D(@t*9{u_A=gpfpKY#xG_U+rVXV3oq`}hC||i=Q&8(m$()z5YF*CjUEw001<4;4tjrTwH+&%FA_x~E6rskH`CdQ7= zuI>)uzWxal`(>Zw+Pr1!Chi?O LckSMx$Y2cs9wnNk literal 0 HcmV?d00001 diff --git a/courtside/static/admin/img/admin/selector-add.gif b/courtside/static/admin/img/admin/selector-add.gif new file mode 100644 index 0000000000000000000000000000000000000000..50132d1c439494a0a19e1d280385f03d3ac5599b GIT binary patch literal 606 zcmZ?wbhEHb6krfwcoxafw(@M}n)ChZFW!3c{`tGF)3#h)y!U$bf@7^KPS-6uzUAco zS0BDVc=>6^`De|`PR`nSyg_g{XjI&`ak@yUG` zo;EK(J#+ijhQ%lP*I%ezbo}9~&(pSE*?IQS;=MN)@4Gd3=e3%J$D5X(nz`fp(*3u$ zoqaNI*R}d3CpVpX{Q29jre&vU7apIr~bzW=sp-|cz3uWvc? zWa{QC$8Wq`dhpJqjhE{epV)Z(?&i~vr*FGDch`+I#~w`He7Swq*`){W^sT@6^~dl3 z|Nk@49Vq@}VPs&4WY7WG42ly5_T3GUO_4kje3Fi`Y|PEgg2Ei`p1iykJ|h0&z5Zgl z0rM9G$k+=tamfX*T&cAxSkXVyMZhv_>sB}KZDAbD#%4hW4zfg89~5H~^<`z%2RJ`V9$77#OFv^CvqjY0A7XSuxNk>&%VE4w{br3Jf1VK49#UQa3Uc3OT{Z NtIjEA%EiK94FJ;24lMux literal 0 HcmV?d00001 diff --git a/courtside/static/admin/img/admin/selector-addall.gif b/courtside/static/admin/img/admin/selector-addall.gif new file mode 100644 index 0000000000000000000000000000000000000000..d6e7c639bb2ec270122861f054289845281fae26 GIT binary patch literal 358 zcmZ?wbhEHb6krfwxN64GwdVYqV-FVYy|wM^)3z0-CvU#|?Z@x7m1n1IyE0+p#RUf* z*DpEQwCq&t%5&3q-kG-LYR}pWx1PLjUwNi;)tTmHr>AYX(!J*V^leu=SD$TPd3wsG zD~tDD-+uc3vi-Mqo_}`i`pffoUcPz%`N)+gC$B$Wu={53y7Nb`JiYSZ&EgJ2jU%oBgck}JXFNZEY-hSr6{b%p@TzI-@&-ELR-)%g8_xtzn|NsAIzzr0CvM@3* zm@(*plz{xiz}D;}e*)+h-yWNC)(RZyTq=rvah$l z-QC^j?C`?E!rI!}-rnBp>+8?Y&$F|$v%JQ(wzkK|$N2d8?d|R4>Fx3H@xZ{qud%ZB z_V&`!(&Fap*x1<3&CRj8!??J(+uPg8$;r;n&b76*)z#I=$jG<1x5UK6zrVlr`1}9= z{{R30A^8LW002G!EC2ui01yBW000K7K%dYz*=R~SmZ2~lJ~9pwN1*_@60%NHMxlAX zUK2qgWbklk^e2tm$$Y6>%tp5<1aBx~ID^{#HdGh3{RjW2`-1y|llXdIX?cBNZ+_`frSFT*Tbm`{Jn=f9xc=ztz_wV0- z|Ni~?^XIp2-MVq(#`*K-_wCzv>C&Zd-@aYHe*MaoE4y~>`t<43?%lh$ZQJ(v@#E#o zmmfcV{KtY3(LiF)@D4T0VKnCT(SA zX1)$*HBn6#jwS_7P0<=>4NmpN;)-mGISX90xU|;Ev8_pU4PxOI7UpJ&^3YJ@;Za-V LdE}_8BZD;nhnJNG literal 0 HcmV?d00001 diff --git a/courtside/static/admin/img/admin/selector-search.gif b/courtside/static/admin/img/admin/selector-search.gif new file mode 100644 index 0000000000000000000000000000000000000000..6d5f4c74923af2daba13baa484364380fb1614b9 GIT binary patch literal 552 zcmZ?wbhEHb6krfwc*ekR;r}fg8=Jp>|9X0Qe){yu!NI}X+uO&-$I8koH8s`3!otqZ z?(W^YSy@?TW@e{PpT2zg^6J&ABO)T)-Q5!s60Tjl=Ire3>gqaW%9PsL+PQP*Ha9mX zCnrZoN9W|^#K*^f{rYv@ym@clym|8E$=&V_@LPJBVtE(?uxDXW;RaaLxbLLEYd;7Mww%N01*VNRUKY#wgg9n+J znUg0^j*E-y=;*j{51X2rQc_ZG-@bkS{(VPBM~0yT6o0ZXf?TTuB0zD%z~0)x z(A3=0+M*~cF2*k1)@;Hotjo#FYS$;lCc@9cB5K1e*(T4%&$OJ0N1L&YotI^~f{vr% zn$~qnssdI5qW0Tb4Ak_r)E!)0jSnm~~hECZvY5o%BVqvfb0K*)eZU6uP literal 0 HcmV?d00001 diff --git a/courtside/static/admin/img/admin/selector_stacked-add.gif b/courtside/static/admin/img/admin/selector_stacked-add.gif new file mode 100644 index 0000000000000000000000000000000000000000..74261696522de5819780082d9d92d75f8ffdb4fc GIT binary patch literal 612 zcmZ?wbhEHb6krfwcoxdgw({()C+`>Uz23RzeCvwSk6wMQUT~~#(eW)O@4x%}qhZO( z=4B^W9lAAn)1{a1zimDJ=;PO)eQVFX`tbe1%TKd*UVs1P$KQYdUVr@FvFhyR6ZdwU ze>P#`rA;RvPThQ^Vacg^yRJ>!dS%hR+gr{&*>?76|N09vw_ojAb8ha=YxRpy&e(CS zX5q0dryguM`QY`3Zw-r2%-nIkdHLz4Wv6Nu9$&Km_M1=N`!`%%e(?6hjhE^cpICbE zPW_UT?JLi0J9WQr-Gy6EKkPjFXz{*VlQv#%T6(H>;qm&#Ct6mV*>vi0?V{s*E<9;p zb#~+NyGsw;*?ju(++8>N)?b{q|9^%71&Tje7#SEs z8FWCd0L2Ld`@x3LrchxXZVfp-CdTGwF-aChB`GOoO9?O0UN2rZpZN=XRJAypI8=gG zu3D|&6>7p|?7dlrpI>J4W)?;pTi^Y@;vpg82Yh*%1Red)_zN8tI_odX#vXkAI^SWw z8`quLnIE#U3LF+-wUd@+HWGAYV9+`IIYj*f0~?2-=O67a@_!~B5V-KDV{)@!9S?KU zg-$*<4i1Nz9ITzZT>%EXL7SAjj`z#?N@%FQnAjwxsS!|7=*eL;*Vos_$H(O9?cUzr!^6YN%ge8^vckf`>gwvV zyvDP$v)I_!vAV;~&d%H0+sMes)z#I>$;r33x4*x?xVX5rwY9{=#P#_5|Ns9000000 z00000A^8LW002AyEC2ui01yBW000KAK%S5naXdmc6(KMjYAO&AVzD@V4lqm;hLU-| z-jabLRNQE28e){D>0mrlZWF7McDqHrjtjIdGl3s?cnEyf&#j1HCpm1R^ds$Tu?y v2{Xwz1xyMMI@Q+KSVJ%eHQnCb7h_HpIV%Yq94R_BSxrJk53meNO+f%VqdU!B literal 0 HcmV?d00001 diff --git a/courtside/static/admin/img/admin/tool-left.gif b/courtside/static/admin/img/admin/tool-left.gif new file mode 100644 index 0000000000000000000000000000000000000000..011490ff3a0100bea63eca7d8a3f821edecf6d3f GIT binary patch literal 197 zcmV;$06PCiNk%w1VF>^d0K@+9+1 z>Fn(6>gwvFqods1+`_`bsi~>N#Kh<4=efDLot>Sks;aTEvEJU^(b3W4lL@fC0syEMTS%hy>Zm!0PcpEpJwG;hh<#5^Y_P4;QTzJF~^?;ZNVo;-~tj z3GxIURaQ?9NK-h~-O_%Ehr|6W>p_W03|&Y3moVBW-4OX{v_eKqd6L;=PDTc60DL-S AivR!s literal 0 HcmV?d00001 diff --git a/courtside/static/admin/img/admin/tool-right.gif b/courtside/static/admin/img/admin/tool-right.gif new file mode 100644 index 0000000000000000000000000000000000000000..cdc140cc590a56bf45ceef6eaeebf47e4a699ac3 GIT binary patch literal 198 zcmV;%06G6hNk%w1VF>^d0K@+9+1 z>Fn(6>gwvFqods1+`_`bsi~>N#Kh<4=efDLot>Sks;aTEvEJU^(b3W4R literal 0 HcmV?d00001 diff --git a/courtside/static/admin/img/admin/tool-right_over.gif b/courtside/static/admin/img/admin/tool-right_over.gif new file mode 100644 index 0000000000000000000000000000000000000000..4db977e838dd97ae4f59524a764cf8298f19ccc5 GIT binary patch literal 200 zcmZ?wbhEHblL@fC0syEMTS%hy>Zm!0M`SJhE@w+}Rz8zHMDu50@FVv!<=}o0a$2j_;|E wNJ^Lce8rW`28j}!f$kDtvUrX>)$-C{u;f$x#4um1{ZvBtsg!MMAsh_W0PS95AOHXW literal 0 HcmV?d00001 diff --git a/courtside/static/admin/img/admin/tooltag-add.gif b/courtside/static/admin/img/admin/tooltag-add.gif new file mode 100644 index 0000000000000000000000000000000000000000..8b53d49ae58dbc324ca7fb318198b187fc124c09 GIT binary patch literal 932 zcmZ?wbhEHb6lM@)_|Cxa`}glZfBv+zw0!^m{n4XG%aU|5d-nPB=MNq{xOeZ~wr$(``}?0g zdp3Xm{Fg6Zwzjt3y?giHzkgr9e*ORde?vn9!zdUHfx#C7ia%Mvj?w{lD0p`BHNuZH8`gv5jGtilW#8Ul-s@(Rm3u`n_%YH1afFWM53xbWyi0reSoZU`=F zW>B;|HRonfOG771<|UO1;}pj!{KgMbG6N3=Of=;-YN#}Nd4NeFEUKo%!I@!YFuRjN h0z*m|qaatng9}?1vhrtKUbNTY0V7A3A`=sXH2_xRgyR4J literal 0 HcmV?d00001 diff --git a/courtside/static/admin/img/admin/tooltag-add_over.gif b/courtside/static/admin/img/admin/tooltag-add_over.gif new file mode 100644 index 0000000000000000000000000000000000000000..bfc52f10de75998687154585752513a27a02e5c4 GIT binary patch literal 336 zcmZ?wbhEHb6lM@)xXQp_AKmol&!20zAN~IQ+b5;fJ+bBa>km(!zx7XVkIL_<>s=I* z-Fg4<%i9m06*kQ}fA#LqpFhjm=B8Ioc1vhpx_)m~&D4mz?loHv1!s0R#56sA{$|&q zv$L0NTfOzr<~=7olUmZNro(_t( z{<*|8FIl(u()IiQ|Npm*YGNP-DE?#tE7t*$AU`p%OuD z64&(xJYQ3LjTSFY75~+{EbMWTq?Tj+^`lM+ch;D9HZb0eJO28D|1uloD@pFe*-apJ^Hn>L+2d-m?#yFEQU|Ni~^ z`t|Go|Nk2r8W_k0ia%MvT6I7q$WIJxH4gmQ9x7=Hf&p1aV>r7mD6wA%agA(z(Y9-o zn{Z!7=F3()sh$@ap>8_^S=AZ45`|}1urBhDn)0zi%$1R$zCpXHxz#1VpeR78J1{*n zKx$GzLbz~Ucw``(R#|u;i#+q?x}l#o5$^*7-1rs_)vpOO{(vYlW{PgEasf C+m{mn literal 0 HcmV?d00001 diff --git a/courtside/static/admin/img/admin/tooltag-arrowright_over.gif b/courtside/static/admin/img/admin/tooltag-arrowright_over.gif new file mode 100644 index 0000000000000000000000000000000000000000..7163189604a638ee170f093cd042075a7da48c7a GIT binary patch literal 354 zcmZ?wbhEHb6lM@)xXQp_AKmol&!20zAN~IQ+b5;fJ+bBa>km(!zx7XVkIL_<>s=I* z-Fg4<%i9m06*kQ}fA#LqpFhjm=B8Ioc1vhpx_)m~&D4mz?loHv1!s0R#56sA{$|&q zv$L0NTfOzr<~=7olUmZNro(_t( z{<*|8FIl(u()IiQ|Npm*YGNP-DE?#tE7t*$AU`p%)jRO!c&Mb=iC%tqw1%_mf>OuD z64%5AjkaH#++@37WWH>5lj_LG3QgM?$)(Pyl_<=6_Sxb99hOrSl|Hhr49pEp`qi!N zF8KvT0m8k3>6rnFQvwpgW$MEt13C4|!UI|47?&<{5fc~Cj$Ol`%&8*1!G}pzckjNv NA{t6st9%_9tO2syk|zKF literal 0 HcmV?d00001 diff --git a/courtside/static/admin/img/gis/move_vertex_off.png b/courtside/static/admin/img/gis/move_vertex_off.png new file mode 100644 index 0000000000000000000000000000000000000000..296b2e29c970fca4222db7cb86e91deb56c5a7d6 GIT binary patch literal 711 zcmV;&0yzDNP)z~BMB}|@Q2`r zz!0M(GL*z*R@l?k*F|^NbkFEGAeD6Lr>o96_tdQ_$ug(M$DcUs_2^&rxr;JCKhN^= zGOMd=ghxm3IRAD|6i2K*dHVn8s@NajIqUTR2v1HTb!>_nqp27>`XK0!QyAbG8d0CA^F9Cx|8`Ux^7w#1hTk>)Z> z(jcFpXfa(;R1{={7MV5+3lFf?Vy&HYrCcdFs;KyOm=EBs5ygXBYq_}i>Vb?getdik z1axF^S%p;#RdeO?k9{10j>wELh)9l6DFO8@^|iIO1~iS#7=yKzIPTKvJS0t1(27OX zED#B9m7S%S$g~L?jj;#{HVN{sy_`*bwOnuSu)F(;!=n#WF@q^-d?WC=txYt`YI`}d z2t^e-aTlPLIkSRK-WXXWf($fM@8R|K&W*wM-t4jdY`u~wQq3Z~a_`|Sm6w7`<7)(N zm;x}jwK+A4Y2bAdf6y|d;Bv#1Ml-w-cwE`LQsme{%Sn7BN%F@irYVn1n{=2=V1=U# zEAT(0AgQYR^5Xdfcsfi#;r#0t!86r@QjICV%6p{_bOc97ED*c7B?{Ut#9L~0h(`w!0soRBa=!hZ`i3C(tMK-$w zq0zX*pg%xHYGQBoG7^Fp?f}pI6#xKNE*G6GrH2hC8gPGHzny?LP4i#C0l+j(@bfMu za~&je9lU;SE=0n!TuLi4l;uYlmIlMpLJ2Es7&hpF|OoMDi!f?u@=39aU~C_P=#aL^dh_Y z^LGv_IP*V9D>BBFd}#2i;VJgl&*=_EHTCD=-<4BqAQh@q7p&k5eY7C(@7f)D8DQ$7 zAQv>{)BVrv!0oKw@zG51AmyF|Q4~RQ;VNUzxj#fv1Xr)$IQmdWMruYncy8a%peRXj wVTV2;1d|B?Ap|@JEC~W)u~^{H-_Gvh3u9NM*1xcED*ylh07*qoM6N<$g2#E+6951J literal 0 HcmV?d00001 diff --git a/courtside/static/admin/js/LICENSE-JQUERY.txt b/courtside/static/admin/js/LICENSE-JQUERY.txt new file mode 100644 index 0000000..a4c5bd7 --- /dev/null +++ b/courtside/static/admin/js/LICENSE-JQUERY.txt @@ -0,0 +1,20 @@ +Copyright (c) 2010 John Resig, http://jquery.com/ + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/courtside/static/admin/js/SelectBox.js b/courtside/static/admin/js/SelectBox.js new file mode 100644 index 0000000..f28c861 --- /dev/null +++ b/courtside/static/admin/js/SelectBox.js @@ -0,0 +1,111 @@ +var SelectBox = { + cache: new Object(), + init: function(id) { + var box = document.getElementById(id); + var node; + SelectBox.cache[id] = new Array(); + var cache = SelectBox.cache[id]; + for (var i = 0; (node = box.options[i]); i++) { + cache.push({value: node.value, text: node.text, displayed: 1}); + } + }, + redisplay: function(id) { + // Repopulate HTML select box from cache + var box = document.getElementById(id); + box.options.length = 0; // clear all options + for (var i = 0, j = SelectBox.cache[id].length; i < j; i++) { + var node = SelectBox.cache[id][i]; + if (node.displayed) { + box.options[box.options.length] = new Option(node.text, node.value, false, false); + } + } + }, + filter: function(id, text) { + // Redisplay the HTML select box, displaying only the choices containing ALL + // the words in text. (It's an AND search.) + var tokens = text.toLowerCase().split(/\s+/); + var node, token; + for (var i = 0; (node = SelectBox.cache[id][i]); i++) { + node.displayed = 1; + for (var j = 0; (token = tokens[j]); j++) { + if (node.text.toLowerCase().indexOf(token) == -1) { + node.displayed = 0; + } + } + } + SelectBox.redisplay(id); + }, + delete_from_cache: function(id, value) { + var node, delete_index = null; + for (var i = 0; (node = SelectBox.cache[id][i]); i++) { + if (node.value == value) { + delete_index = i; + break; + } + } + var j = SelectBox.cache[id].length - 1; + for (var i = delete_index; i < j; i++) { + SelectBox.cache[id][i] = SelectBox.cache[id][i+1]; + } + SelectBox.cache[id].length--; + }, + add_to_cache: function(id, option) { + SelectBox.cache[id].push({value: option.value, text: option.text, displayed: 1}); + }, + cache_contains: function(id, value) { + // Check if an item is contained in the cache + var node; + for (var i = 0; (node = SelectBox.cache[id][i]); i++) { + if (node.value == value) { + return true; + } + } + return false; + }, + move: function(from, to) { + var from_box = document.getElementById(from); + var to_box = document.getElementById(to); + var option; + for (var i = 0; (option = from_box.options[i]); i++) { + if (option.selected && SelectBox.cache_contains(from, option.value)) { + SelectBox.add_to_cache(to, {value: option.value, text: option.text, displayed: 1}); + SelectBox.delete_from_cache(from, option.value); + } + } + SelectBox.redisplay(from); + SelectBox.redisplay(to); + }, + move_all: function(from, to) { + var from_box = document.getElementById(from); + var to_box = document.getElementById(to); + var option; + for (var i = 0; (option = from_box.options[i]); i++) { + if (SelectBox.cache_contains(from, option.value)) { + SelectBox.add_to_cache(to, {value: option.value, text: option.text, displayed: 1}); + SelectBox.delete_from_cache(from, option.value); + } + } + SelectBox.redisplay(from); + SelectBox.redisplay(to); + }, + sort: function(id) { + SelectBox.cache[id].sort( function(a, b) { + a = a.text.toLowerCase(); + b = b.text.toLowerCase(); + try { + if (a > b) return 1; + if (a < b) return -1; + } + catch (e) { + // silently fail on IE 'unknown' exception + } + return 0; + } ); + }, + select_all: function(id) { + var box = document.getElementById(id); + for (var i = 0; i < box.options.length; i++) { + box.options[i].selected = 'selected'; + } + } +} diff --git a/courtside/static/admin/js/SelectFilter2.js b/courtside/static/admin/js/SelectFilter2.js new file mode 100644 index 0000000..92eff2e --- /dev/null +++ b/courtside/static/admin/js/SelectFilter2.js @@ -0,0 +1,130 @@ +/* +SelectFilter2 - Turns a multiple-select box into a filter interface. + +Different than SelectFilter because this is coupled to the admin framework. + +Requires core.js, SelectBox.js and addevent.js. +*/ + +function findForm(node) { + // returns the node of the form containing the given node + if (node.tagName.toLowerCase() != 'form') { + return findForm(node.parentNode); + } + return node; +} + +var SelectFilter = { + init: function(field_id, field_name, is_stacked, admin_media_prefix) { + if (field_id.match(/__prefix__/)){ + // Don't intialize on empty forms. + return; + } + var from_box = document.getElementById(field_id); + from_box.id += '_from'; // change its ID + from_box.className = 'filtered'; + + var ps = from_box.parentNode.getElementsByTagName('p'); + for (var i=0; i, because it just gets in the way. + from_box.parentNode.removeChild(ps[i]); + } else if (ps[i].className.indexOf("help") != -1) { + // Move help text up to the top so it isn't below the select + // boxes or wrapped off on the side to the right of the add + // button: + from_box.parentNode.insertBefore(ps[i], from_box.parentNode.firstChild); + } + } + + //
    or
    + var selector_div = quickElement('div', from_box.parentNode); + selector_div.className = is_stacked ? 'selector stacked' : 'selector'; + + //
    + var selector_available = quickElement('div', selector_div, ''); + selector_available.className = 'selector-available'; + quickElement('h2', selector_available, interpolate(gettext('Available %s'), [field_name])); + var filter_p = quickElement('p', selector_available, ''); + filter_p.className = 'selector-filter'; + + var search_filter_label = quickElement('label', filter_p, '', 'for', field_id + "_input", 'style', 'width:16px;padding:2px'); + + var search_selector_img = quickElement('img', search_filter_label, '', 'src', admin_media_prefix + 'img/admin/selector-search.gif'); + search_selector_img.alt = gettext("Filter"); + + filter_p.appendChild(document.createTextNode(' ')); + + var filter_input = quickElement('input', filter_p, '', 'type', 'text'); + filter_input.id = field_id + '_input'; + selector_available.appendChild(from_box); + var choose_all = quickElement('a', selector_available, gettext('Choose all'), 'href', 'javascript: (function(){ SelectBox.move_all("' + field_id + '_from", "' + field_id + '_to"); })()'); + choose_all.className = 'selector-chooseall'; + + //
      + var selector_chooser = quickElement('ul', selector_div, ''); + selector_chooser.className = 'selector-chooser'; + var add_link = quickElement('a', quickElement('li', selector_chooser, ''), gettext('Add'), 'href', 'javascript: (function(){ SelectBox.move("' + field_id + '_from","' + field_id + '_to");})()'); + add_link.className = 'selector-add'; + var remove_link = quickElement('a', quickElement('li', selector_chooser, ''), gettext('Remove'), 'href', 'javascript: (function(){ SelectBox.move("' + field_id + '_to","' + field_id + '_from");})()'); + remove_link.className = 'selector-remove'; + + //
      + var selector_chosen = quickElement('div', selector_div, ''); + selector_chosen.className = 'selector-chosen'; + quickElement('h2', selector_chosen, interpolate(gettext('Chosen %s'), [field_name])); + var selector_filter = quickElement('p', selector_chosen, gettext('Select your choice(s) and click ')); + selector_filter.className = 'selector-filter'; + quickElement('img', selector_filter, '', 'src', admin_media_prefix + (is_stacked ? 'img/admin/selector_stacked-add.gif':'img/admin/selector-add.gif'), 'alt', 'Add'); + var to_box = quickElement('select', selector_chosen, '', 'id', field_id + '_to', 'multiple', 'multiple', 'size', from_box.size, 'name', from_box.getAttribute('name')); + to_box.className = 'filtered'; + var clear_all = quickElement('a', selector_chosen, gettext('Clear all'), 'href', 'javascript: (function() { SelectBox.move_all("' + field_id + '_to", "' + field_id + '_from");})()'); + clear_all.className = 'selector-clearall'; + + from_box.setAttribute('name', from_box.getAttribute('name') + '_old'); + + // Set up the JavaScript event handlers for the select box filter interface + addEvent(filter_input, 'keyup', function(e) { SelectFilter.filter_key_up(e, field_id); }); + addEvent(filter_input, 'keydown', function(e) { SelectFilter.filter_key_down(e, field_id); }); + addEvent(from_box, 'dblclick', function() { SelectBox.move(field_id + '_from', field_id + '_to'); }); + addEvent(to_box, 'dblclick', function() { SelectBox.move(field_id + '_to', field_id + '_from'); }); + addEvent(findForm(from_box), 'submit', function() { SelectBox.select_all(field_id + '_to'); }); + SelectBox.init(field_id + '_from'); + SelectBox.init(field_id + '_to'); + // Move selected from_box options to to_box + SelectBox.move(field_id + '_from', field_id + '_to'); + }, + filter_key_up: function(event, field_id) { + from = document.getElementById(field_id + '_from'); + // don't submit form if user pressed Enter + if ((event.which && event.which == 13) || (event.keyCode && event.keyCode == 13)) { + from.selectedIndex = 0; + SelectBox.move(field_id + '_from', field_id + '_to'); + from.selectedIndex = 0; + return false; + } + var temp = from.selectedIndex; + SelectBox.filter(field_id + '_from', document.getElementById(field_id + '_input').value); + from.selectedIndex = temp; + return true; + }, + filter_key_down: function(event, field_id) { + from = document.getElementById(field_id + '_from'); + // right arrow -- move across + if ((event.which && event.which == 39) || (event.keyCode && event.keyCode == 39)) { + var old_index = from.selectedIndex; + SelectBox.move(field_id + '_from', field_id + '_to'); + from.selectedIndex = (old_index == from.length) ? from.length - 1 : old_index; + return false; + } + // down arrow -- wrap around + if ((event.which && event.which == 40) || (event.keyCode && event.keyCode == 40)) { + from.selectedIndex = (from.length == from.selectedIndex + 1) ? 0 : from.selectedIndex + 1; + } + // up arrow -- wrap around + if ((event.which && event.which == 38) || (event.keyCode && event.keyCode == 38)) { + from.selectedIndex = (from.selectedIndex == 0) ? from.length - 1 : from.selectedIndex - 1; + } + return true; + } +} diff --git a/courtside/static/admin/js/actions.js b/courtside/static/admin/js/actions.js new file mode 100644 index 0000000..94aa6db --- /dev/null +++ b/courtside/static/admin/js/actions.js @@ -0,0 +1,139 @@ +(function($) { + $.fn.actions = function(opts) { + var options = $.extend({}, $.fn.actions.defaults, opts); + var actionCheckboxes = $(this); + var list_editable_changed = false; + checker = function(checked) { + if (checked) { + showQuestion(); + } else { + reset(); + } + $(actionCheckboxes).attr("checked", checked) + .parent().parent().toggleClass(options.selectedClass, checked); + } + updateCounter = function() { + var sel = $(actionCheckboxes).filter(":checked").length; + $(options.counterContainer).html(interpolate( + ngettext('%(sel)s of %(cnt)s selected', '%(sel)s of %(cnt)s selected', sel), { + sel: sel, + cnt: _actions_icnt + }, true)); + $(options.allToggle).attr("checked", function() { + if (sel == actionCheckboxes.length) { + value = true; + showQuestion(); + } else { + value = false; + clearAcross(); + } + return value; + }); + } + showQuestion = function() { + $(options.acrossClears).hide(); + $(options.acrossQuestions).show(); + $(options.allContainer).hide(); + } + showClear = function() { + $(options.acrossClears).show(); + $(options.acrossQuestions).hide(); + $(options.actionContainer).toggleClass(options.selectedClass); + $(options.allContainer).show(); + $(options.counterContainer).hide(); + } + reset = function() { + $(options.acrossClears).hide(); + $(options.acrossQuestions).hide(); + $(options.allContainer).hide(); + $(options.counterContainer).show(); + } + clearAcross = function() { + reset(); + $(options.acrossInput).val(0); + $(options.actionContainer).removeClass(options.selectedClass); + } + // Show counter by default + $(options.counterContainer).show(); + // Check state of checkboxes and reinit state if needed + $(this).filter(":checked").each(function(i) { + $(this).parent().parent().toggleClass(options.selectedClass); + updateCounter(); + if ($(options.acrossInput).val() == 1) { + showClear(); + } + }); + $(options.allToggle).show().click(function() { + checker($(this).attr("checked")); + updateCounter(); + }); + $("div.actions span.question a").click(function(event) { + event.preventDefault(); + $(options.acrossInput).val(1); + showClear(); + }); + $("div.actions span.clear a").click(function(event) { + event.preventDefault(); + $(options.allToggle).attr("checked", false); + clearAcross(); + checker(0); + updateCounter(); + }); + lastChecked = null; + $(actionCheckboxes).click(function(event) { + if (!event) { var event = window.event; } + var target = event.target ? event.target : event.srcElement; + if (lastChecked && $.data(lastChecked) != $.data(target) && event.shiftKey == true) { + var inrange = false; + $(lastChecked).attr("checked", target.checked) + .parent().parent().toggleClass(options.selectedClass, target.checked); + $(actionCheckboxes).each(function() { + if ($.data(this) == $.data(lastChecked) || $.data(this) == $.data(target)) { + inrange = (inrange) ? false : true; + } + if (inrange) { + $(this).attr("checked", target.checked) + .parent().parent().toggleClass(options.selectedClass, target.checked); + } + }); + } + $(target).parent().parent().toggleClass(options.selectedClass, target.checked); + lastChecked = target; + updateCounter(); + }); + $('form#changelist-form table#result_list tr').find('td:gt(0) :input').change(function() { + list_editable_changed = true; + }); + $('form#changelist-form button[name="index"]').click(function(event) { + if (list_editable_changed) { + return confirm(gettext("You have unsaved changes on individual editable fields. If you run an action, your unsaved changes will be lost.")); + } + }); + $('form#changelist-form input[name="_save"]').click(function(event) { + var action_changed = false; + $('div.actions select option:selected').each(function() { + if ($(this).val()) { + action_changed = true; + } + }); + if (action_changed) { + if (list_editable_changed) { + return confirm(gettext("You have selected an action, but you haven't saved your changes to individual fields yet. Please click OK to save. You'll need to re-run the action.")); + } else { + return confirm(gettext("You have selected an action, and you haven't made any changes on individual fields. You're probably looking for the Go button rather than the Save button.")); + } + } + }); + } + /* Setup plugin defaults */ + $.fn.actions.defaults = { + actionContainer: "div.actions", + counterContainer: "span.action-counter", + allContainer: "div.actions span.all", + acrossInput: "div.actions input.select-across", + acrossQuestions: "div.actions span.question", + acrossClears: "div.actions span.clear", + allToggle: "#action-toggle", + selectedClass: "selected" + } +})(django.jQuery); diff --git a/courtside/static/admin/js/actions.min.js b/courtside/static/admin/js/actions.min.js new file mode 100644 index 0000000..21f00cd --- /dev/null +++ b/courtside/static/admin/js/actions.min.js @@ -0,0 +1,7 @@ +(function(a){a.fn.actions=function(h){var b=a.extend({},a.fn.actions.defaults,h),e=a(this),f=false;checker=function(c){c?showQuestion():reset();a(e).attr("checked",c).parent().parent().toggleClass(b.selectedClass,c)};updateCounter=function(){var c=a(e).filter(":checked").length;a(b.counterContainer).html(interpolate(ngettext("%(sel)s of %(cnt)s selected","%(sel)s of %(cnt)s selected",c),{sel:c,cnt:_actions_icnt},true));a(b.allToggle).attr("checked",function(){if(c==e.length){value=true;showQuestion()}else{value= +false;clearAcross()}return value})};showQuestion=function(){a(b.acrossClears).hide();a(b.acrossQuestions).show();a(b.allContainer).hide()};showClear=function(){a(b.acrossClears).show();a(b.acrossQuestions).hide();a(b.actionContainer).toggleClass(b.selectedClass);a(b.allContainer).show();a(b.counterContainer).hide()};reset=function(){a(b.acrossClears).hide();a(b.acrossQuestions).hide();a(b.allContainer).hide();a(b.counterContainer).show()};clearAcross=function(){reset();a(b.acrossInput).val(0);a(b.actionContainer).removeClass(b.selectedClass)}; +a(b.counterContainer).show();a(this).filter(":checked").each(function(){a(this).parent().parent().toggleClass(b.selectedClass);updateCounter();a(b.acrossInput).val()==1&&showClear()});a(b.allToggle).show().click(function(){checker(a(this).attr("checked"));updateCounter()});a("div.actions span.question a").click(function(c){c.preventDefault();a(b.acrossInput).val(1);showClear()});a("div.actions span.clear a").click(function(c){c.preventDefault();a(b.allToggle).attr("checked",false);clearAcross();checker(0); +updateCounter()});lastChecked=null;a(e).click(function(c){if(!c)c=window.event;var d=c.target?c.target:c.srcElement;if(lastChecked&&a.data(lastChecked)!=a.data(d)&&c.shiftKey==true){var g=false;a(lastChecked).attr("checked",d.checked).parent().parent().toggleClass(b.selectedClass,d.checked);a(e).each(function(){if(a.data(this)==a.data(lastChecked)||a.data(this)==a.data(d))g=g?false:true;g&&a(this).attr("checked",d.checked).parent().parent().toggleClass(b.selectedClass,d.checked)})}a(d).parent().parent().toggleClass(b.selectedClass, +d.checked);lastChecked=d;updateCounter()});a("form#changelist-form table#result_list tr").find("td:gt(0) :input").change(function(){f=true});a('form#changelist-form button[name="index"]').click(function(){if(f)return confirm(gettext("You have unsaved changes on individual editable fields. If you run an action, your unsaved changes will be lost."))});a('form#changelist-form input[name="_save"]').click(function(){var c=false;a("div.actions select option:selected").each(function(){if(a(this).val())c= +true});if(c)return f?confirm(gettext("You have selected an action, but you haven't saved your changes to individual fields yet. Please click OK to save. You'll need to re-run the action.")):confirm(gettext("You have selected an action, and you haven't made any changes on individual fields. You're probably looking for the Go button rather than the Save button."))})};a.fn.actions.defaults={actionContainer:"div.actions",counterContainer:"span.action-counter",allContainer:"div.actions span.all",acrossInput:"div.actions input.select-across", +acrossQuestions:"div.actions span.question",acrossClears:"div.actions span.clear",allToggle:"#action-toggle",selectedClass:"selected"}})(django.jQuery); diff --git a/courtside/static/admin/js/admin/DateTimeShortcuts.js b/courtside/static/admin/js/admin/DateTimeShortcuts.js new file mode 100644 index 0000000..a4293b3 --- /dev/null +++ b/courtside/static/admin/js/admin/DateTimeShortcuts.js @@ -0,0 +1,274 @@ +// Inserts shortcut buttons after all of the following: +// +// + +var DateTimeShortcuts = { + calendars: [], + calendarInputs: [], + clockInputs: [], + calendarDivName1: 'calendarbox', // name of calendar
      that gets toggled + calendarDivName2: 'calendarin', // name of
      that contains calendar + calendarLinkName: 'calendarlink',// name of the link that is used to toggle + clockDivName: 'clockbox', // name of clock
      that gets toggled + clockLinkName: 'clocklink', // name of the link that is used to toggle + shortCutsClass: 'datetimeshortcuts', // class of the clock and cal shortcuts + admin_media_prefix: '', + init: function() { + // Get admin_media_prefix by grabbing it off the window object. It's + // set in the admin/base.html template, so if it's not there, someone's + // overridden the template. In that case, we'll set a clearly-invalid + // value in the hopes that someone will examine HTTP requests and see it. + if (window.__admin_media_prefix__ != undefined) { + DateTimeShortcuts.admin_media_prefix = window.__admin_media_prefix__; + } else { + DateTimeShortcuts.admin_media_prefix = '/missing-admin-media-prefix/'; + } + + var inputs = document.getElementsByTagName('input'); + for (i=0; i + //

      Choose a time

      + // + //

      Cancel

      + //
      + + var clock_box = document.createElement('div'); + clock_box.style.display = 'none'; + clock_box.style.position = 'absolute'; + clock_box.className = 'clockbox module'; + clock_box.setAttribute('id', DateTimeShortcuts.clockDivName + num); + document.body.appendChild(clock_box); + addEvent(clock_box, 'click', DateTimeShortcuts.cancelEventPropagation); + + quickElement('h2', clock_box, gettext('Choose a time')); + time_list = quickElement('ul', clock_box, ''); + time_list.className = 'timelist'; + time_format = get_format('TIME_INPUT_FORMATS')[0]; + quickElement("a", quickElement("li", time_list, ""), gettext("Now"), "href", "javascript:DateTimeShortcuts.handleClockQuicklink(" + num + ", new Date().strftime('" + time_format + "'));"); + quickElement("a", quickElement("li", time_list, ""), gettext("Midnight"), "href", "javascript:DateTimeShortcuts.handleClockQuicklink(" + num + ", new Date(1970,1,1,0,0,0,0).strftime('" + time_format + "'));"); + quickElement("a", quickElement("li", time_list, ""), gettext("6 a.m."), "href", "javascript:DateTimeShortcuts.handleClockQuicklink(" + num + ", new Date(1970,1,1,6,0,0,0).strftime('" + time_format + "'));"); + quickElement("a", quickElement("li", time_list, ""), gettext("Noon"), "href", "javascript:DateTimeShortcuts.handleClockQuicklink(" + num + ", new Date(1970,1,1,12,0,0,0).strftime('" + time_format + "'));"); + + cancel_p = quickElement('p', clock_box, ''); + cancel_p.className = 'calendar-cancel'; + quickElement('a', cancel_p, gettext('Cancel'), 'href', 'javascript:DateTimeShortcuts.dismissClock(' + num + ');'); + }, + openClock: function(num) { + var clock_box = document.getElementById(DateTimeShortcuts.clockDivName+num) + var clock_link = document.getElementById(DateTimeShortcuts.clockLinkName+num) + + // Recalculate the clockbox position + // is it left-to-right or right-to-left layout ? + if (getStyle(document.body,'direction')!='rtl') { + clock_box.style.left = findPosX(clock_link) + 17 + 'px'; + } + else { + // since style's width is in em, it'd be tough to calculate + // px value of it. let's use an estimated px for now + // TODO: IE returns wrong value for findPosX when in rtl mode + // (it returns as it was left aligned), needs to be fixed. + clock_box.style.left = findPosX(clock_link) - 110 + 'px'; + } + clock_box.style.top = Math.max(0, findPosY(clock_link) - 30) + 'px'; + + // Show the clock box + clock_box.style.display = 'block'; + addEvent(window.document, 'click', function() { DateTimeShortcuts.dismissClock(num); return true; }); + }, + dismissClock: function(num) { + document.getElementById(DateTimeShortcuts.clockDivName + num).style.display = 'none'; + window.document.onclick = null; + }, + handleClockQuicklink: function(num, val) { + DateTimeShortcuts.clockInputs[num].value = val; + DateTimeShortcuts.clockInputs[num].focus(); + DateTimeShortcuts.dismissClock(num); + }, + // Add calendar widget to a given field. + addCalendar: function(inp) { + var num = DateTimeShortcuts.calendars.length; + + DateTimeShortcuts.calendarInputs[num] = inp; + + // Shortcut links (calendar icon and "Today" link) + var shortcuts_span = document.createElement('span'); + shortcuts_span.className = DateTimeShortcuts.shortCutsClass; + inp.parentNode.insertBefore(shortcuts_span, inp.nextSibling); + var today_link = document.createElement('a'); + today_link.setAttribute('href', 'javascript:DateTimeShortcuts.handleCalendarQuickLink(' + num + ', 0);'); + today_link.appendChild(document.createTextNode(gettext('Today'))); + var cal_link = document.createElement('a'); + cal_link.setAttribute('href', 'javascript:DateTimeShortcuts.openCalendar(' + num + ');'); + cal_link.id = DateTimeShortcuts.calendarLinkName + num; + quickElement('img', cal_link, '', 'src', DateTimeShortcuts.admin_media_prefix + 'img/admin/icon_calendar.gif', 'alt', gettext('Calendar')); + shortcuts_span.appendChild(document.createTextNode('\240')); + shortcuts_span.appendChild(today_link); + shortcuts_span.appendChild(document.createTextNode('\240|\240')); + shortcuts_span.appendChild(cal_link); + + // Create calendarbox div. + // + // Markup looks like: + // + //
      + //

      + // + // February 2003 + //

      + //
      + // + //
      + //
      + // Yesterday | Today | Tomorrow + //
      + //

      Cancel

      + //
      + var cal_box = document.createElement('div'); + cal_box.style.display = 'none'; + cal_box.style.position = 'absolute'; + cal_box.className = 'calendarbox module'; + cal_box.setAttribute('id', DateTimeShortcuts.calendarDivName1 + num); + document.body.appendChild(cal_box); + addEvent(cal_box, 'click', DateTimeShortcuts.cancelEventPropagation); + + // next-prev links + var cal_nav = quickElement('div', cal_box, ''); + var cal_nav_prev = quickElement('a', cal_nav, '<', 'href', 'javascript:DateTimeShortcuts.drawPrev('+num+');'); + cal_nav_prev.className = 'calendarnav-previous'; + var cal_nav_next = quickElement('a', cal_nav, '>', 'href', 'javascript:DateTimeShortcuts.drawNext('+num+');'); + cal_nav_next.className = 'calendarnav-next'; + + // main box + var cal_main = quickElement('div', cal_box, '', 'id', DateTimeShortcuts.calendarDivName2 + num); + cal_main.className = 'calendar'; + DateTimeShortcuts.calendars[num] = new Calendar(DateTimeShortcuts.calendarDivName2 + num, DateTimeShortcuts.handleCalendarCallback(num)); + DateTimeShortcuts.calendars[num].drawCurrent(); + + // calendar shortcuts + var shortcuts = quickElement('div', cal_box, ''); + shortcuts.className = 'calendar-shortcuts'; + quickElement('a', shortcuts, gettext('Yesterday'), 'href', 'javascript:DateTimeShortcuts.handleCalendarQuickLink(' + num + ', -1);'); + shortcuts.appendChild(document.createTextNode('\240|\240')); + quickElement('a', shortcuts, gettext('Today'), 'href', 'javascript:DateTimeShortcuts.handleCalendarQuickLink(' + num + ', 0);'); + shortcuts.appendChild(document.createTextNode('\240|\240')); + quickElement('a', shortcuts, gettext('Tomorrow'), 'href', 'javascript:DateTimeShortcuts.handleCalendarQuickLink(' + num + ', +1);'); + + // cancel bar + var cancel_p = quickElement('p', cal_box, ''); + cancel_p.className = 'calendar-cancel'; + quickElement('a', cancel_p, gettext('Cancel'), 'href', 'javascript:DateTimeShortcuts.dismissCalendar(' + num + ');'); + }, + openCalendar: function(num) { + var cal_box = document.getElementById(DateTimeShortcuts.calendarDivName1+num) + var cal_link = document.getElementById(DateTimeShortcuts.calendarLinkName+num) + var inp = DateTimeShortcuts.calendarInputs[num]; + + // Determine if the current value in the input has a valid date. + // If so, draw the calendar with that date's year and month. + if (inp.value) { + var date_parts = inp.value.split('-'); + var year = date_parts[0]; + var month = parseFloat(date_parts[1]); + if (year.match(/\d\d\d\d/) && month >= 1 && month <= 12) { + DateTimeShortcuts.calendars[num].drawDate(month, year); + } + } + + // Recalculate the clockbox position + // is it left-to-right or right-to-left layout ? + if (getStyle(document.body,'direction')!='rtl') { + cal_box.style.left = findPosX(cal_link) + 17 + 'px'; + } + else { + // since style's width is in em, it'd be tough to calculate + // px value of it. let's use an estimated px for now + // TODO: IE returns wrong value for findPosX when in rtl mode + // (it returns as it was left aligned), needs to be fixed. + cal_box.style.left = findPosX(cal_link) - 180 + 'px'; + } + cal_box.style.top = Math.max(0, findPosY(cal_link) - 75) + 'px'; + + cal_box.style.display = 'block'; + addEvent(window.document, 'click', function() { DateTimeShortcuts.dismissCalendar(num); return true; }); + }, + dismissCalendar: function(num) { + document.getElementById(DateTimeShortcuts.calendarDivName1+num).style.display = 'none'; + window.document.onclick = null; + }, + drawPrev: function(num) { + DateTimeShortcuts.calendars[num].drawPreviousMonth(); + }, + drawNext: function(num) { + DateTimeShortcuts.calendars[num].drawNextMonth(); + }, + handleCalendarCallback: function(num) { + format = get_format('DATE_INPUT_FORMATS')[0]; + // the format needs to be escaped a little + format = format.replace('\\', '\\\\'); + format = format.replace('\r', '\\r'); + format = format.replace('\n', '\\n'); + format = format.replace('\t', '\\t'); + format = format.replace("'", "\\'"); + return ["function(y, m, d) { DateTimeShortcuts.calendarInputs[", + num, + "].value = new Date(y, m-1, d).strftime('", + format, + "');DateTimeShortcuts.calendarInputs[", + num, + "].focus();document.getElementById(DateTimeShortcuts.calendarDivName1+", + num, + ").style.display='none';}"].join(''); + }, + handleCalendarQuickLink: function(num, offset) { + var d = new Date(); + d.setDate(d.getDate() + offset) + DateTimeShortcuts.calendarInputs[num].value = d.strftime(get_format('DATE_INPUT_FORMATS')[0]); + DateTimeShortcuts.calendarInputs[num].focus(); + DateTimeShortcuts.dismissCalendar(num); + }, + cancelEventPropagation: function(e) { + if (!e) e = window.event; + e.cancelBubble = true; + if (e.stopPropagation) e.stopPropagation(); + } +} + +addEvent(window, 'load', DateTimeShortcuts.init); diff --git a/courtside/static/admin/js/admin/RelatedObjectLookups.js b/courtside/static/admin/js/admin/RelatedObjectLookups.js new file mode 100644 index 0000000..1bc78f8 --- /dev/null +++ b/courtside/static/admin/js/admin/RelatedObjectLookups.js @@ -0,0 +1,96 @@ +// Handles related-objects functionality: lookup link for raw_id_fields +// and Add Another links. + +function html_unescape(text) { + // Unescape a string that was escaped using django.utils.html.escape. + text = text.replace(/</g, '<'); + text = text.replace(/>/g, '>'); + text = text.replace(/"/g, '"'); + text = text.replace(/'/g, "'"); + text = text.replace(/&/g, '&'); + return text; +} + +// IE doesn't accept periods or dashes in the window name, but the element IDs +// we use to generate popup window names may contain them, therefore we map them +// to allowed characters in a reversible way so that we can locate the correct +// element when the popup window is dismissed. +function id_to_windowname(text) { + text = text.replace(/\./g, '__dot__'); + text = text.replace(/\-/g, '__dash__'); + return text; +} + +function windowname_to_id(text) { + text = text.replace(/__dot__/g, '.'); + text = text.replace(/__dash__/g, '-'); + return text; +} + +function showRelatedObjectLookupPopup(triggeringLink) { + var name = triggeringLink.id.replace(/^lookup_/, ''); + name = id_to_windowname(name); + var href; + if (triggeringLink.href.search(/\?/) >= 0) { + href = triggeringLink.href + '&pop=1'; + } else { + href = triggeringLink.href + '?pop=1'; + } + var win = window.open(href, name, 'height=500,width=800,resizable=yes,scrollbars=yes'); + win.focus(); + return false; +} + +function dismissRelatedLookupPopup(win, chosenId) { + var name = windowname_to_id(win.name); + var elem = document.getElementById(name); + if (elem.className.indexOf('vManyToManyRawIdAdminField') != -1 && elem.value) { + elem.value += ',' + chosenId; + } else { + document.getElementById(name).value = chosenId; + } + win.close(); +} + +function showAddAnotherPopup(triggeringLink) { + var name = triggeringLink.id.replace(/^add_/, ''); + name = id_to_windowname(name); + href = triggeringLink.href + if (href.indexOf('?') == -1) { + href += '?_popup=1'; + } else { + href += '&_popup=1'; + } + var win = window.open(href, name, 'height=500,width=800,resizable=yes,scrollbars=yes'); + win.focus(); + return false; +} + +function dismissAddAnotherPopup(win, newId, newRepr) { + // newId and newRepr are expected to have previously been escaped by + // django.utils.html.escape. + newId = html_unescape(newId); + newRepr = html_unescape(newRepr); + var name = windowname_to_id(win.name); + var elem = document.getElementById(name); + if (elem) { + if (elem.nodeName == 'SELECT') { + var o = new Option(newRepr, newId); + elem.options[elem.options.length] = o; + o.selected = true; + } else if (elem.nodeName == 'INPUT') { + if (elem.className.indexOf('vManyToManyRawIdAdminField') != -1 && elem.value) { + elem.value += ',' + newId; + } else { + elem.value = newId; + } + } + } else { + var toId = name + "_to"; + elem = document.getElementById(toId); + var o = new Option(newRepr, newId); + SelectBox.add_to_cache(toId, o); + SelectBox.redisplay(toId); + } + win.close(); +} diff --git a/courtside/static/admin/js/admin/ordering.js b/courtside/static/admin/js/admin/ordering.js new file mode 100644 index 0000000..53c42f3 --- /dev/null +++ b/courtside/static/admin/js/admin/ordering.js @@ -0,0 +1,137 @@ +addEvent(window, 'load', reorder_init); + +var lis; +var top = 0; +var left = 0; +var height = 30; + +function reorder_init() { + lis = document.getElementsBySelector('ul#orderthese li'); + var input = document.getElementsBySelector('input[name=order_]')[0]; + setOrder(input.value.split(',')); + input.disabled = true; + draw(); + // Now initialise the dragging behaviour + var limit = (lis.length - 1) * height; + for (var i = 0; i < lis.length; i++) { + var li = lis[i]; + var img = document.getElementById('handle'+li.id); + li.style.zIndex = 1; + Drag.init(img, li, left + 10, left + 10, top + 10, top + 10 + limit); + li.onDragStart = startDrag; + li.onDragEnd = endDrag; + img.style.cursor = 'move'; + } +} + +function submitOrderForm() { + var inputOrder = document.getElementsBySelector('input[name=order_]')[0]; + inputOrder.value = getOrder(); + inputOrder.disabled=false; +} + +function startDrag() { + this.style.zIndex = '10'; + this.className = 'dragging'; +} + +function endDrag(x, y) { + this.style.zIndex = '1'; + this.className = ''; + // Work out how far along it has been dropped, using x co-ordinate + var oldIndex = this.index; + var newIndex = Math.round((y - 10 - top) / height); + // 'Snap' to the correct position + this.style.top = (10 + top + newIndex * height) + 'px'; + this.index = newIndex; + moveItem(oldIndex, newIndex); +} + +function moveItem(oldIndex, newIndex) { + // Swaps two items, adjusts the index and left co-ord for all others + if (oldIndex == newIndex) { + return; // Nothing to swap; + } + var direction, lo, hi; + if (newIndex > oldIndex) { + lo = oldIndex; + hi = newIndex; + direction = -1; + } else { + direction = 1; + hi = oldIndex; + lo = newIndex; + } + var lis2 = new Array(); // We will build the new order in this array + for (var i = 0; i < lis.length; i++) { + if (i < lo || i > hi) { + // Position of items not between the indexes is unaffected + lis2[i] = lis[i]; + continue; + } else if (i == newIndex) { + lis2[i] = lis[oldIndex]; + continue; + } else { + // Item is between the two indexes - move it along 1 + lis2[i] = lis[i - direction]; + } + } + // Re-index everything + reIndex(lis2); + lis = lis2; + draw(); +// document.getElementById('hiddenOrder').value = getOrder(); + document.getElementsBySelector('input[name=order_]')[0].value = getOrder(); +} + +function reIndex(lis) { + for (var i = 0; i < lis.length; i++) { + lis[i].index = i; + } +} + +function draw() { + for (var i = 0; i < lis.length; i++) { + var li = lis[i]; + li.index = i; + li.style.position = 'absolute'; + li.style.left = (10 + left) + 'px'; + li.style.top = (10 + top + (i * height)) + 'px'; + } +} + +function getOrder() { + var order = new Array(lis.length); + for (var i = 0; i < lis.length; i++) { + order[i] = lis[i].id.substring(1, 100); + } + return order.join(','); +} + +function setOrder(id_list) { + /* Set the current order to match the lsit of IDs */ + var temp_lis = new Array(); + for (var i = 0; i < id_list.length; i++) { + var id = 'p' + id_list[i]; + temp_lis[temp_lis.length] = document.getElementById(id); + } + reIndex(temp_lis); + lis = temp_lis; + draw(); +} + +function addEvent(elm, evType, fn, useCapture) +// addEvent and removeEvent +// cross-browser event handling for IE5+, NS6 and Mozilla +// By Scott Andrew +{ + if (elm.addEventListener){ + elm.addEventListener(evType, fn, useCapture); + return true; + } else if (elm.attachEvent){ + var r = elm.attachEvent("on"+evType, fn); + return r; + } else { + elm['on'+evType] = fn; + } +} diff --git a/courtside/static/admin/js/calendar.js b/courtside/static/admin/js/calendar.js new file mode 100644 index 0000000..c95a95d --- /dev/null +++ b/courtside/static/admin/js/calendar.js @@ -0,0 +1,156 @@ +/* +calendar.js - Calendar functions by Adrian Holovaty +*/ + +function removeChildren(a) { // "a" is reference to an object + while (a.hasChildNodes()) a.removeChild(a.lastChild); +} + +// quickElement(tagType, parentReference, textInChildNode, [, attribute, attributeValue ...]); +function quickElement() { + var obj = document.createElement(arguments[0]); + if (arguments[2] != '' && arguments[2] != null) { + var textNode = document.createTextNode(arguments[2]); + obj.appendChild(textNode); + } + var len = arguments.length; + for (var i = 3; i < len; i += 2) { + obj.setAttribute(arguments[i], arguments[i+1]); + } + arguments[1].appendChild(obj); + return obj; +} + +// CalendarNamespace -- Provides a collection of HTML calendar-related helper functions +var CalendarNamespace = { + monthsOfYear: gettext('January February March April May June July August September October November December').split(' '), + daysOfWeek: gettext('S M T W T F S').split(' '), + firstDayOfWeek: parseInt(get_format('FIRST_DAY_OF_WEEK')), + isLeapYear: function(year) { + return (((year % 4)==0) && ((year % 100)!=0) || ((year % 400)==0)); + }, + getDaysInMonth: function(month,year) { + var days; + if (month==1 || month==3 || month==5 || month==7 || month==8 || month==10 || month==12) { + days = 31; + } + else if (month==4 || month==6 || month==9 || month==11) { + days = 30; + } + else if (month==2 && CalendarNamespace.isLeapYear(year)) { + days = 29; + } + else { + days = 28; + } + return days; + }, + draw: function(month, year, div_id, callback) { // month = 1-12, year = 1-9999 + var today = new Date(); + var todayDay = today.getDate(); + var todayMonth = today.getMonth()+1; + var todayYear = today.getFullYear(); + var todayClass = ''; + + month = parseInt(month); + year = parseInt(year); + var calDiv = document.getElementById(div_id); + removeChildren(calDiv); + var calTable = document.createElement('table'); + quickElement('caption', calTable, CalendarNamespace.monthsOfYear[month-1] + ' ' + year); + var tableBody = quickElement('tbody', calTable); + + // Draw days-of-week header + var tableRow = quickElement('tr', tableBody); + for (var i = 0; i < 7; i++) { + quickElement('th', tableRow, CalendarNamespace.daysOfWeek[(i + CalendarNamespace.firstDayOfWeek) % 7]); + } + + var startingPos = new Date(year, month-1, 1 - CalendarNamespace.firstDayOfWeek).getDay(); + var days = CalendarNamespace.getDaysInMonth(month, year); + + // Draw blanks before first of month + tableRow = quickElement('tr', tableBody); + for (var i = 0; i < startingPos; i++) { + var _cell = quickElement('td', tableRow, ' '); + _cell.style.backgroundColor = '#f3f3f3'; + } + + // Draw days of month + var currentDay = 1; + for (var i = startingPos; currentDay <= days; i++) { + if (i%7 == 0 && currentDay != 1) { + tableRow = quickElement('tr', tableBody); + } + if ((currentDay==todayDay) && (month==todayMonth) && (year==todayYear)) { + todayClass='today'; + } else { + todayClass=''; + } + var cell = quickElement('td', tableRow, '', 'class', todayClass); + + quickElement('a', cell, currentDay, 'href', 'javascript:void(' + callback + '('+year+','+month+','+currentDay+'));'); + currentDay++; + } + + // Draw blanks after end of month (optional, but makes for valid code) + while (tableRow.childNodes.length < 7) { + var _cell = quickElement('td', tableRow, ' '); + _cell.style.backgroundColor = '#f3f3f3'; + } + + calDiv.appendChild(calTable); + } +} + +// Calendar -- A calendar instance +function Calendar(div_id, callback) { + // div_id (string) is the ID of the element in which the calendar will + // be displayed + // callback (string) is the name of a JavaScript function that will be + // called with the parameters (year, month, day) when a day in the + // calendar is clicked + this.div_id = div_id; + this.callback = callback; + this.today = new Date(); + this.currentMonth = this.today.getMonth() + 1; + this.currentYear = this.today.getFullYear(); +} +Calendar.prototype = { + drawCurrent: function() { + CalendarNamespace.draw(this.currentMonth, this.currentYear, this.div_id, this.callback); + }, + drawDate: function(month, year) { + this.currentMonth = month; + this.currentYear = year; + this.drawCurrent(); + }, + drawPreviousMonth: function() { + if (this.currentMonth == 1) { + this.currentMonth = 12; + this.currentYear--; + } + else { + this.currentMonth--; + } + this.drawCurrent(); + }, + drawNextMonth: function() { + if (this.currentMonth == 12) { + this.currentMonth = 1; + this.currentYear++; + } + else { + this.currentMonth++; + } + this.drawCurrent(); + }, + drawPreviousYear: function() { + this.currentYear--; + this.drawCurrent(); + }, + drawNextYear: function() { + this.currentYear++; + this.drawCurrent(); + } +} diff --git a/courtside/static/admin/js/collapse.js b/courtside/static/admin/js/collapse.js new file mode 100644 index 0000000..0a1e2d8 --- /dev/null +++ b/courtside/static/admin/js/collapse.js @@ -0,0 +1,27 @@ +(function($) { + $(document).ready(function() { + // Add anchor tag for Show/Hide link + $("fieldset.collapse").each(function(i, elem) { + // Don't hide if fields in this fieldset have errors + if ( $(elem).find("div.errors").length == 0 ) { + $(elem).addClass("collapsed"); + $(elem).find("h2").first().append(' (' + gettext("Show") + + ')'); + } + }); + // Add toggle to anchor tag + $("fieldset.collapse a.collapse-toggle").toggle( + function() { // Show + $(this).text(gettext("Hide")); + $(this).closest("fieldset").removeClass("collapsed"); + return false; + }, + function() { // Hide + $(this).text(gettext("Show")); + $(this).closest("fieldset").addClass("collapsed"); + return false; + } + ); + }); +})(django.jQuery); diff --git a/courtside/static/admin/js/collapse.min.js b/courtside/static/admin/js/collapse.min.js new file mode 100644 index 0000000..428984e --- /dev/null +++ b/courtside/static/admin/js/collapse.min.js @@ -0,0 +1,2 @@ +(function(a){a(document).ready(function(){a("fieldset.collapse").each(function(c,b){if(a(b).find("div.errors").length==0){a(b).addClass("collapsed");a(b).find("h2").first().append(' ('+gettext("Show")+")")}});a("fieldset.collapse a.collapse-toggle").toggle(function(){a(this).text(gettext("Hide"));a(this).closest("fieldset").removeClass("collapsed");return false},function(){a(this).text(gettext("Show"));a(this).closest("fieldset").addClass("collapsed"); +return false})})})(django.jQuery); diff --git a/courtside/static/admin/js/compress.py b/courtside/static/admin/js/compress.py new file mode 100644 index 0000000..8d2caa2 --- /dev/null +++ b/courtside/static/admin/js/compress.py @@ -0,0 +1,47 @@ +#!/usr/bin/env python +import os +import optparse +import subprocess +import sys + +here = os.path.dirname(__file__) + +def main(): + usage = "usage: %prog [file1..fileN]" + description = """With no file paths given this script will automatically +compress all jQuery-based files of the admin app. Requires the Google Closure +Compiler library and Java version 6 or later.""" + parser = optparse.OptionParser(usage, description=description) + parser.add_option("-c", dest="compiler", default="~/bin/compiler.jar", + help="path to Closure Compiler jar file") + parser.add_option("-v", "--verbose", + action="store_true", dest="verbose") + parser.add_option("-q", "--quiet", + action="store_false", dest="verbose") + (options, args) = parser.parse_args() + + compiler = os.path.expanduser(options.compiler) + if not os.path.exists(compiler): + sys.exit("Google Closure compiler jar file %s not found. Please use the -c option to specify the path." % compiler) + + if not args: + if options.verbose: + sys.stdout.write("No filenames given; defaulting to admin scripts\n") + args = [os.path.join(here, f) for f in [ + "actions.js", "collapse.js", "inlines.js", "prepopulate.js"]] + + for arg in args: + if not arg.endswith(".js"): + arg = arg + ".js" + to_compress = os.path.expanduser(arg) + if os.path.exists(to_compress): + to_compress_min = "%s.min.js" % "".join(arg.rsplit(".js")) + cmd = "java -jar %s --js %s --js_output_file %s" % (compiler, to_compress, to_compress_min) + if options.verbose: + sys.stdout.write("Running: %s\n" % cmd) + subprocess.call(cmd.split()) + else: + sys.stdout.write("File %s not found. Sure it exists?\n" % to_compress) + +if __name__ == '__main__': + main() diff --git a/courtside/static/admin/js/core.js b/courtside/static/admin/js/core.js new file mode 100644 index 0000000..3ca8ad0 --- /dev/null +++ b/courtside/static/admin/js/core.js @@ -0,0 +1,221 @@ +// Core javascript helper functions + +// basic browser identification & version +var isOpera = (navigator.userAgent.indexOf("Opera")>=0) && parseFloat(navigator.appVersion); +var isIE = ((document.all) && (!isOpera)) && parseFloat(navigator.appVersion.split("MSIE ")[1].split(";")[0]); + +// Cross-browser event handlers. +function addEvent(obj, evType, fn) { + if (obj.addEventListener) { + obj.addEventListener(evType, fn, false); + return true; + } else if (obj.attachEvent) { + var r = obj.attachEvent("on" + evType, fn); + return r; + } else { + return false; + } +} + +function removeEvent(obj, evType, fn) { + if (obj.removeEventListener) { + obj.removeEventListener(evType, fn, false); + return true; + } else if (obj.detachEvent) { + obj.detachEvent("on" + evType, fn); + return true; + } else { + return false; + } +} + +// quickElement(tagType, parentReference, textInChildNode, [, attribute, attributeValue ...]); +function quickElement() { + var obj = document.createElement(arguments[0]); + if (arguments[2] != '' && arguments[2] != null) { + var textNode = document.createTextNode(arguments[2]); + obj.appendChild(textNode); + } + var len = arguments.length; + for (var i = 3; i < len; i += 2) { + obj.setAttribute(arguments[i], arguments[i+1]); + } + arguments[1].appendChild(obj); + return obj; +} + +// ---------------------------------------------------------------------------- +// Cross-browser xmlhttp object +// from http://jibbering.com/2002/4/httprequest.html +// ---------------------------------------------------------------------------- +var xmlhttp; +/*@cc_on @*/ +/*@if (@_jscript_version >= 5) + try { + xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); + } catch (e) { + try { + xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); + } catch (E) { + xmlhttp = false; + } + } +@else + xmlhttp = false; +@end @*/ +if (!xmlhttp && typeof XMLHttpRequest != 'undefined') { + xmlhttp = new XMLHttpRequest(); +} + +// ---------------------------------------------------------------------------- +// Find-position functions by PPK +// See http://www.quirksmode.org/js/findpos.html +// ---------------------------------------------------------------------------- +function findPosX(obj) { + var curleft = 0; + if (obj.offsetParent) { + while (obj.offsetParent) { + curleft += obj.offsetLeft - ((isOpera) ? 0 : obj.scrollLeft); + obj = obj.offsetParent; + } + // IE offsetParent does not include the top-level + if (isIE && obj.parentElement){ + curleft += obj.offsetLeft - obj.scrollLeft; + } + } else if (obj.x) { + curleft += obj.x; + } + return curleft; +} + +function findPosY(obj) { + var curtop = 0; + if (obj.offsetParent) { + while (obj.offsetParent) { + curtop += obj.offsetTop - ((isOpera) ? 0 : obj.scrollTop); + obj = obj.offsetParent; + } + // IE offsetParent does not include the top-level + if (isIE && obj.parentElement){ + curtop += obj.offsetTop - obj.scrollTop; + } + } else if (obj.y) { + curtop += obj.y; + } + return curtop; +} + +//----------------------------------------------------------------------------- +// Date object extensions +// ---------------------------------------------------------------------------- +Date.prototype.getCorrectYear = function() { + // Date.getYear() is unreliable -- + // see http://www.quirksmode.org/js/introdate.html#year + var y = this.getYear() % 100; + return (y < 38) ? y + 2000 : y + 1900; +} + +Date.prototype.getTwelveHours = function() { + hours = this.getHours(); + if (hours == 0) { + return 12; + } + else { + return hours <= 12 ? hours : hours-12 + } +} + +Date.prototype.getTwoDigitMonth = function() { + return (this.getMonth() < 9) ? '0' + (this.getMonth()+1) : (this.getMonth()+1); +} + +Date.prototype.getTwoDigitDate = function() { + return (this.getDate() < 10) ? '0' + this.getDate() : this.getDate(); +} + +Date.prototype.getTwoDigitTwelveHour = function() { + return (this.getTwelveHours() < 10) ? '0' + this.getTwelveHours() : this.getTwelveHours(); +} + +Date.prototype.getTwoDigitHour = function() { + return (this.getHours() < 10) ? '0' + this.getHours() : this.getHours(); +} + +Date.prototype.getTwoDigitMinute = function() { + return (this.getMinutes() < 10) ? '0' + this.getMinutes() : this.getMinutes(); +} + +Date.prototype.getTwoDigitSecond = function() { + return (this.getSeconds() < 10) ? '0' + this.getSeconds() : this.getSeconds(); +} + +Date.prototype.getISODate = function() { + return this.getCorrectYear() + '-' + this.getTwoDigitMonth() + '-' + this.getTwoDigitDate(); +} + +Date.prototype.getHourMinute = function() { + return this.getTwoDigitHour() + ':' + this.getTwoDigitMinute(); +} + +Date.prototype.getHourMinuteSecond = function() { + return this.getTwoDigitHour() + ':' + this.getTwoDigitMinute() + ':' + this.getTwoDigitSecond(); +} + +Date.prototype.strftime = function(format) { + var fields = { + c: this.toString(), + d: this.getTwoDigitDate(), + H: this.getTwoDigitHour(), + I: this.getTwoDigitTwelveHour(), + m: this.getTwoDigitMonth(), + M: this.getTwoDigitMinute(), + p: (this.getHours() >= 12) ? 'PM' : 'AM', + S: this.getTwoDigitSecond(), + w: '0' + this.getDay(), + x: this.toLocaleDateString(), + X: this.toLocaleTimeString(), + y: ('' + this.getFullYear()).substr(2, 4), + Y: '' + this.getFullYear(), + '%' : '%' + }; + var result = '', i = 0; + while (i < format.length) { + if (format.charAt(i) === '%') { + result = result + fields[format.charAt(i + 1)]; + ++i; + } + else { + result = result + format.charAt(i); + } + ++i; + } + return result; +} + +// ---------------------------------------------------------------------------- +// String object extensions +// ---------------------------------------------------------------------------- +String.prototype.pad_left = function(pad_length, pad_string) { + var new_string = this; + for (var i = 0; new_string.length < pad_length; i++) { + new_string = pad_string + new_string; + } + return new_string; +} + +// ---------------------------------------------------------------------------- +// Get the computed style for and element +// ---------------------------------------------------------------------------- +function getStyle(oElm, strCssRule){ + var strValue = ""; + if(document.defaultView && document.defaultView.getComputedStyle){ + strValue = document.defaultView.getComputedStyle(oElm, "").getPropertyValue(strCssRule); + } + else if(oElm.currentStyle){ + strCssRule = strCssRule.replace(/\-(\w)/g, function (strMatch, p1){ + return p1.toUpperCase(); + }); + strValue = oElm.currentStyle[strCssRule]; + } + return strValue; +} diff --git a/courtside/static/admin/js/dateparse.js b/courtside/static/admin/js/dateparse.js new file mode 100644 index 0000000..3cb82de --- /dev/null +++ b/courtside/static/admin/js/dateparse.js @@ -0,0 +1,239 @@ +/* 'Magic' date parsing, by Simon Willison (6th October 2003) + http://simon.incutio.com/archive/2003/10/06/betterDateInput + Adapted for 6newslawrence.com, 28th January 2004 +*/ + +/* Finds the index of the first occurence of item in the array, or -1 if not found */ +if (typeof Array.prototype.indexOf == 'undefined') { + Array.prototype.indexOf = function(item) { + var len = this.length; + for (var i = 0; i < len; i++) { + if (this[i] == item) { + return i; + } + } + return -1; + }; +} +/* Returns an array of items judged 'true' by the passed in test function */ +if (typeof Array.prototype.filter == 'undefined') { + Array.prototype.filter = function(test) { + var matches = []; + var len = this.length; + for (var i = 0; i < len; i++) { + if (test(this[i])) { + matches[matches.length] = this[i]; + } + } + return matches; + }; +} + +var monthNames = gettext("January February March April May June July August September October November December").split(" "); +var weekdayNames = gettext("Sunday Monday Tuesday Wednesday Thursday Friday Saturday").split(" "); + +/* Takes a string, returns the index of the month matching that string, throws + an error if 0 or more than 1 matches +*/ +function parseMonth(month) { + var matches = monthNames.filter(function(item) { + return new RegExp("^" + month, "i").test(item); + }); + if (matches.length == 0) { + throw new Error("Invalid month string"); + } + if (matches.length > 1) { + throw new Error("Ambiguous month"); + } + return monthNames.indexOf(matches[0]); +} +/* Same as parseMonth but for days of the week */ +function parseWeekday(weekday) { + var matches = weekdayNames.filter(function(item) { + return new RegExp("^" + weekday, "i").test(item); + }); + if (matches.length == 0) { + throw new Error("Invalid day string"); + } + if (matches.length > 1) { + throw new Error("Ambiguous weekday"); + } + return weekdayNames.indexOf(matches[0]); +} + +/* Array of objects, each has 're', a regular expression and 'handler', a + function for creating a date from something that matches the regular + expression. Handlers may throw errors if string is unparseable. +*/ +var dateParsePatterns = [ + // Today + { re: /^tod/i, + handler: function() { + return new Date(); + } + }, + // Tomorrow + { re: /^tom/i, + handler: function() { + var d = new Date(); + d.setDate(d.getDate() + 1); + return d; + } + }, + // Yesterday + { re: /^yes/i, + handler: function() { + var d = new Date(); + d.setDate(d.getDate() - 1); + return d; + } + }, + // 4th + { re: /^(\d{1,2})(st|nd|rd|th)?$/i, + handler: function(bits) { + var d = new Date(); + d.setDate(parseInt(bits[1], 10)); + return d; + } + }, + // 4th Jan + { re: /^(\d{1,2})(?:st|nd|rd|th)? (\w+)$/i, + handler: function(bits) { + var d = new Date(); + d.setDate(1); + d.setMonth(parseMonth(bits[2])); + d.setDate(parseInt(bits[1], 10)); + return d; + } + }, + // 4th Jan 2003 + { re: /^(\d{1,2})(?:st|nd|rd|th)? (\w+),? (\d{4})$/i, + handler: function(bits) { + var d = new Date(); + d.setDate(1); + d.setYear(bits[3]); + d.setMonth(parseMonth(bits[2])); + d.setDate(parseInt(bits[1], 10)); + return d; + } + }, + // Jan 4th + { re: /^(\w+) (\d{1,2})(?:st|nd|rd|th)?$/i, + handler: function(bits) { + var d = new Date(); + d.setDate(1); + d.setMonth(parseMonth(bits[1])); + d.setDate(parseInt(bits[2], 10)); + return d; + } + }, + // Jan 4th 2003 + { re: /^(\w+) (\d{1,2})(?:st|nd|rd|th)?,? (\d{4})$/i, + handler: function(bits) { + var d = new Date(); + d.setDate(1); + d.setYear(bits[3]); + d.setMonth(parseMonth(bits[1])); + d.setDate(parseInt(bits[2], 10)); + return d; + } + }, + // next Tuesday - this is suspect due to weird meaning of "next" + { re: /^next (\w+)$/i, + handler: function(bits) { + var d = new Date(); + var day = d.getDay(); + var newDay = parseWeekday(bits[1]); + var addDays = newDay - day; + if (newDay <= day) { + addDays += 7; + } + d.setDate(d.getDate() + addDays); + return d; + } + }, + // last Tuesday + { re: /^last (\w+)$/i, + handler: function(bits) { + throw new Error("Not yet implemented"); + } + }, + // mm/dd/yyyy (American style) + { re: /(\d{1,2})\/(\d{1,2})\/(\d{4})/, + handler: function(bits) { + var d = new Date(); + d.setDate(1); + d.setYear(bits[3]); + d.setMonth(parseInt(bits[1], 10) - 1); // Because months indexed from 0 + d.setDate(parseInt(bits[2], 10)); + return d; + } + }, + // yyyy-mm-dd (ISO style) + { re: /(\d{4})-(\d{1,2})-(\d{1,2})/, + handler: function(bits) { + var d = new Date(); + d.setDate(1); + d.setYear(parseInt(bits[1])); + d.setMonth(parseInt(bits[2], 10) - 1); + d.setDate(parseInt(bits[3], 10)); + return d; + } + }, +]; + +function parseDateString(s) { + for (var i = 0; i < dateParsePatterns.length; i++) { + var re = dateParsePatterns[i].re; + var handler = dateParsePatterns[i].handler; + var bits = re.exec(s); + if (bits) { + return handler(bits); + } + } + throw new Error("Invalid date string"); +} + +function fmt00(x) { + // fmt00: Tags leading zero onto numbers 0 - 9. + // Particularly useful for displaying results from Date methods. + // + if (Math.abs(parseInt(x)) < 10){ + x = "0"+ Math.abs(x); + } + return x; +} + +function parseDateStringISO(s) { + try { + var d = parseDateString(s); + return d.getFullYear() + '-' + (fmt00(d.getMonth() + 1)) + '-' + fmt00(d.getDate()) + } + catch (e) { return s; } +} +function magicDate(input) { + var messagespan = input.id + 'Msg'; + try { + var d = parseDateString(input.value); + input.value = d.getFullYear() + '-' + (fmt00(d.getMonth() + 1)) + '-' + + fmt00(d.getDate()); + input.className = ''; + // Human readable date + if (document.getElementById(messagespan)) { + document.getElementById(messagespan).firstChild.nodeValue = d.toDateString(); + document.getElementById(messagespan).className = 'normal'; + } + } + catch (e) { + input.className = 'error'; + var message = e.message; + // Fix for IE6 bug + if (message.indexOf('is null or not an object') > -1) { + message = 'Invalid date string'; + } + if (document.getElementById(messagespan)) { + document.getElementById(messagespan).firstChild.nodeValue = message; + document.getElementById(messagespan).className = 'error'; + } + } +} diff --git a/courtside/static/admin/js/getElementsBySelector.js b/courtside/static/admin/js/getElementsBySelector.js new file mode 100644 index 0000000..15b57a1 --- /dev/null +++ b/courtside/static/admin/js/getElementsBySelector.js @@ -0,0 +1,167 @@ +/* document.getElementsBySelector(selector) + - returns an array of element objects from the current document + matching the CSS selector. Selectors can contain element names, + class names and ids and can be nested. For example: + + elements = document.getElementsBySelect('div#main p a.external') + + Will return an array of all 'a' elements with 'external' in their + class attribute that are contained inside 'p' elements that are + contained inside the 'div' element which has id="main" + + New in version 0.4: Support for CSS2 and CSS3 attribute selectors: + See http://www.w3.org/TR/css3-selectors/#attribute-selectors + + Version 0.4 - Simon Willison, March 25th 2003 + -- Works in Phoenix 0.5, Mozilla 1.3, Opera 7, Internet Explorer 6, Internet Explorer 5 on Windows + -- Opera 7 fails +*/ + +function getAllChildren(e) { + // Returns all children of element. Workaround required for IE5/Windows. Ugh. + return e.all ? e.all : e.getElementsByTagName('*'); +} + +document.getElementsBySelector = function(selector) { + // Attempt to fail gracefully in lesser browsers + if (!document.getElementsByTagName) { + return new Array(); + } + // Split selector in to tokens + var tokens = selector.split(' '); + var currentContext = new Array(document); + for (var i = 0; i < tokens.length; i++) { + token = tokens[i].replace(/^\s+/,'').replace(/\s+$/,'');; + if (token.indexOf('#') > -1) { + // Token is an ID selector + var bits = token.split('#'); + var tagName = bits[0]; + var id = bits[1]; + var element = document.getElementById(id); + if (!element || (tagName && element.nodeName.toLowerCase() != tagName)) { + // ID not found or tag with that ID not found, return false. + return new Array(); + } + // Set currentContext to contain just this element + currentContext = new Array(element); + continue; // Skip to next token + } + if (token.indexOf('.') > -1) { + // Token contains a class selector + var bits = token.split('.'); + var tagName = bits[0]; + var className = bits[1]; + if (!tagName) { + tagName = '*'; + } + // Get elements matching tag, filter them for class selector + var found = new Array; + var foundCount = 0; + for (var h = 0; h < currentContext.length; h++) { + var elements; + if (tagName == '*') { + elements = getAllChildren(currentContext[h]); + } else { + try { + elements = currentContext[h].getElementsByTagName(tagName); + } + catch(e) { + elements = []; + } + } + for (var j = 0; j < elements.length; j++) { + found[foundCount++] = elements[j]; + } + } + currentContext = new Array; + var currentContextIndex = 0; + for (var k = 0; k < found.length; k++) { + if (found[k].className && found[k].className.match(new RegExp('\\b'+className+'\\b'))) { + currentContext[currentContextIndex++] = found[k]; + } + } + continue; // Skip to next token + } + // Code to deal with attribute selectors + if (token.match(/^(\w*)\[(\w+)([=~\|\^\$\*]?)=?"?([^\]"]*)"?\]$/)) { + var tagName = RegExp.$1; + var attrName = RegExp.$2; + var attrOperator = RegExp.$3; + var attrValue = RegExp.$4; + if (!tagName) { + tagName = '*'; + } + // Grab all of the tagName elements within current context + var found = new Array; + var foundCount = 0; + for (var h = 0; h < currentContext.length; h++) { + var elements; + if (tagName == '*') { + elements = getAllChildren(currentContext[h]); + } else { + elements = currentContext[h].getElementsByTagName(tagName); + } + for (var j = 0; j < elements.length; j++) { + found[foundCount++] = elements[j]; + } + } + currentContext = new Array; + var currentContextIndex = 0; + var checkFunction; // This function will be used to filter the elements + switch (attrOperator) { + case '=': // Equality + checkFunction = function(e) { return (e.getAttribute(attrName) == attrValue); }; + break; + case '~': // Match one of space seperated words + checkFunction = function(e) { return (e.getAttribute(attrName).match(new RegExp('\\b'+attrValue+'\\b'))); }; + break; + case '|': // Match start with value followed by optional hyphen + checkFunction = function(e) { return (e.getAttribute(attrName).match(new RegExp('^'+attrValue+'-?'))); }; + break; + case '^': // Match starts with value + checkFunction = function(e) { return (e.getAttribute(attrName).indexOf(attrValue) == 0); }; + break; + case '$': // Match ends with value - fails with "Warning" in Opera 7 + checkFunction = function(e) { return (e.getAttribute(attrName).lastIndexOf(attrValue) == e.getAttribute(attrName).length - attrValue.length); }; + break; + case '*': // Match ends with value + checkFunction = function(e) { return (e.getAttribute(attrName).indexOf(attrValue) > -1); }; + break; + default : + // Just test for existence of attribute + checkFunction = function(e) { return e.getAttribute(attrName); }; + } + currentContext = new Array; + var currentContextIndex = 0; + for (var k = 0; k < found.length; k++) { + if (checkFunction(found[k])) { + currentContext[currentContextIndex++] = found[k]; + } + } + // alert('Attribute Selector: '+tagName+' '+attrName+' '+attrOperator+' '+attrValue); + continue; // Skip to next token + } + // If we get here, token is JUST an element (not a class or ID selector) + tagName = token; + var found = new Array; + var foundCount = 0; + for (var h = 0; h < currentContext.length; h++) { + var elements = currentContext[h].getElementsByTagName(tagName); + for (var j = 0; j < elements.length; j++) { + found[foundCount++] = elements[j]; + } + } + currentContext = found; + } + return currentContext; +} + +/* That revolting regular expression explained +/^(\w+)\[(\w+)([=~\|\^\$\*]?)=?"?([^\]"]*)"?\]$/ + \---/ \---/\-------------/ \-------/ + | | | | + | | | The value + | | ~,|,^,$,* or = + | Attribute + Tag +*/ diff --git a/courtside/static/admin/js/inlines.js b/courtside/static/admin/js/inlines.js new file mode 100644 index 0000000..bddd6f7 --- /dev/null +++ b/courtside/static/admin/js/inlines.js @@ -0,0 +1,136 @@ +/** + * Django admin inlines + * + * Based on jQuery Formset 1.1 + * @author Stanislaus Madueke (stan DOT madueke AT gmail DOT com) + * @requires jQuery 1.2.6 or later + * + * Copyright (c) 2009, Stanislaus Madueke + * All rights reserved. + * + * Spiced up with Code from Zain Memon's GSoC project 2009 + * and modified for Django by Jannis Leidel + * + * Licensed under the New BSD License + * See: http://www.opensource.org/licenses/bsd-license.php + */ +(function($) { + $.fn.formset = function(opts) { + var options = $.extend({}, $.fn.formset.defaults, opts); + var updateElementIndex = function(el, prefix, ndx) { + var id_regex = new RegExp("(" + prefix + "-(\\d+|__prefix__))"); + var replacement = prefix + "-" + ndx; + if ($(el).attr("for")) { + $(el).attr("for", $(el).attr("for").replace(id_regex, replacement)); + } + if (el.id) { + el.id = el.id.replace(id_regex, replacement); + } + if (el.name) { + el.name = el.name.replace(id_regex, replacement); + } + }; + var totalForms = $("#id_" + options.prefix + "-TOTAL_FORMS").attr("autocomplete", "off"); + var nextIndex = parseInt(totalForms.val()); + var maxForms = $("#id_" + options.prefix + "-MAX_NUM_FORMS").attr("autocomplete", "off"); + // only show the add button if we are allowed to add more items, + // note that max_num = None translates to a blank string. + var showAddButton = maxForms.val() == '' || (maxForms.val()-totalForms.val()) > 0; + $(this).each(function(i) { + $(this).not("." + options.emptyCssClass).addClass(options.formCssClass); + }); + if ($(this).length && showAddButton) { + var addButton; + if ($(this).attr("tagName") == "TR") { + // If forms are laid out as table rows, insert the + // "add" button in a new table row: + var numCols = this.eq(0).children().length; + $(this).parent().append('' + options.addText + ""); + addButton = $(this).parent().find("tr:last a"); + } else { + // Otherwise, insert it immediately after the last form: + $(this).filter(":last").after('"); + addButton = $(this).filter(":last").next().find("a"); + } + addButton.click(function() { + var totalForms = $("#id_" + options.prefix + "-TOTAL_FORMS"); + var template = $("#" + options.prefix + "-empty"); + var row = template.clone(true); + row.removeClass(options.emptyCssClass) + .addClass(options.formCssClass) + .attr("id", options.prefix + "-" + nextIndex); + if (row.is("tr")) { + // If the forms are laid out in table rows, insert + // the remove button into the last table cell: + row.children(":last").append('"); + } else if (row.is("ul") || row.is("ol")) { + // If they're laid out as an ordered/unordered list, + // insert an
    • after the last list item: + row.append('
    • ' + options.deleteText + "
    • "); + } else { + // Otherwise, just insert the remove button as the + // last child element of the form's container: + row.children(":first").append('' + options.deleteText + ""); + } + row.find("*").each(function() { + updateElementIndex(this, options.prefix, totalForms.val()); + }); + // Insert the new form when it has been fully edited + row.insertBefore($(template)); + // Update number of total forms + $(totalForms).val(parseInt(totalForms.val()) + 1); + nextIndex += 1; + // Hide add button in case we've hit the max, except we want to add infinitely + if ((maxForms.val() != '') && (maxForms.val()-totalForms.val()) <= 0) { + addButton.parent().hide(); + } + // The delete button of each row triggers a bunch of other things + row.find("a." + options.deleteCssClass).click(function() { + // Remove the parent form containing this button: + var row = $(this).parents("." + options.formCssClass); + row.remove(); + nextIndex -= 1; + // If a post-delete callback was provided, call it with the deleted form: + if (options.removed) { + options.removed(row); + } + // Update the TOTAL_FORMS form count. + var forms = $("." + options.formCssClass); + $("#id_" + options.prefix + "-TOTAL_FORMS").val(forms.length); + // Show add button again once we drop below max + if ((maxForms.val() == '') || (maxForms.val()-forms.length) > 0) { + addButton.parent().show(); + } + // Also, update names and ids for all remaining form controls + // so they remain in sequence: + for (var i=0, formCount=forms.length; i0;b(this).each(function(){b(this).not("."+ +a.emptyCssClass).addClass(a.formCssClass)});if(b(this).length&&g){var j;if(b(this).attr("tagName")=="TR"){g=this.eq(0).children().length;b(this).parent().append(''+a.addText+"");j=b(this).parent().find("tr:last a")}else{b(this).filter(":last").after('");j=b(this).filter(":last").next().find("a")}j.click(function(){var c=b("#id_"+ +a.prefix+"-TOTAL_FORMS"),f=b("#"+a.prefix+"-empty"),d=f.clone(true);d.removeClass(a.emptyCssClass).addClass(a.formCssClass).attr("id",a.prefix+"-"+l);if(d.is("tr"))d.children(":last").append('");else d.is("ul")||d.is("ol")?d.append('
    • '+a.deleteText+"
    • "):d.children(":first").append(''+ +a.deleteText+"");d.find("*").each(function(){k(this,a.prefix,c.val())});d.insertBefore(b(f));b(c).val(parseInt(c.val())+1);l+=1;h.val()!=""&&h.val()-c.val()<=0&&j.parent().hide();d.find("a."+a.deleteCssClass).click(function(){var e=b(this).parents("."+a.formCssClass);e.remove();l-=1;a.removed&&a.removed(e);e=b("."+a.formCssClass);b("#id_"+a.prefix+"-TOTAL_FORMS").val(e.length);if(h.val()==""||h.val()-e.length>0)j.parent().show();for(var i=0,m=e.length;i)[^>]*$|^#([\w-]+)$/, + + // Is it a simple selector + isSimple = /^.[^:#\[\.,]*$/, + + // Check if a string has a non-whitespace character in it + rnotwhite = /\S/, + + // Used for trimming whitespace + rtrim = /^(\s|\u00A0)+|(\s|\u00A0)+$/g, + + // Match a standalone tag + rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>)?$/, + + // Keep a UserAgent string for use with jQuery.browser + userAgent = navigator.userAgent, + + // For matching the engine and version of the browser + browserMatch, + + // Has the ready events already been bound? + readyBound = false, + + // The functions to execute on DOM ready + readyList = [], + + // The ready event handler + DOMContentLoaded, + + // Save a reference to some core methods + toString = Object.prototype.toString, + hasOwnProperty = Object.prototype.hasOwnProperty, + push = Array.prototype.push, + slice = Array.prototype.slice, + indexOf = Array.prototype.indexOf; + +jQuery.fn = jQuery.prototype = { + init: function( selector, context ) { + var match, elem, ret, doc; + + // Handle $(""), $(null), or $(undefined) + if ( !selector ) { + return this; + } + + // Handle $(DOMElement) + if ( selector.nodeType ) { + this.context = this[0] = selector; + this.length = 1; + return this; + } + + // The body element only exists once, optimize finding it + if ( selector === "body" && !context ) { + this.context = document; + this[0] = document.body; + this.selector = "body"; + this.length = 1; + return this; + } + + // Handle HTML strings + if ( typeof selector === "string" ) { + // Are we dealing with HTML string or an ID? + match = quickExpr.exec( selector ); + + // Verify a match, and that no context was specified for #id + if ( match && (match[1] || !context) ) { + + // HANDLE: $(html) -> $(array) + if ( match[1] ) { + doc = (context ? context.ownerDocument || context : document); + + // If a single string is passed in and it's a single tag + // just do a createElement and skip the rest + ret = rsingleTag.exec( selector ); + + if ( ret ) { + if ( jQuery.isPlainObject( context ) ) { + selector = [ document.createElement( ret[1] ) ]; + jQuery.fn.attr.call( selector, context, true ); + + } else { + selector = [ doc.createElement( ret[1] ) ]; + } + + } else { + ret = buildFragment( [ match[1] ], [ doc ] ); + selector = (ret.cacheable ? ret.fragment.cloneNode(true) : ret.fragment).childNodes; + } + + return jQuery.merge( this, selector ); + + // HANDLE: $("#id") + } else { + elem = document.getElementById( match[2] ); + + if ( elem ) { + // Handle the case where IE and Opera return items + // by name instead of ID + if ( elem.id !== match[2] ) { + return rootjQuery.find( selector ); + } + + // Otherwise, we inject the element directly into the jQuery object + this.length = 1; + this[0] = elem; + } + + this.context = document; + this.selector = selector; + return this; + } + + // HANDLE: $("TAG") + } else if ( !context && /^\w+$/.test( selector ) ) { + this.selector = selector; + this.context = document; + selector = document.getElementsByTagName( selector ); + return jQuery.merge( this, selector ); + + // HANDLE: $(expr, $(...)) + } else if ( !context || context.jquery ) { + return (context || rootjQuery).find( selector ); + + // HANDLE: $(expr, context) + // (which is just equivalent to: $(context).find(expr) + } else { + return jQuery( context ).find( selector ); + } + + // HANDLE: $(function) + // Shortcut for document ready + } else if ( jQuery.isFunction( selector ) ) { + return rootjQuery.ready( selector ); + } + + if (selector.selector !== undefined) { + this.selector = selector.selector; + this.context = selector.context; + } + + return jQuery.makeArray( selector, this ); + }, + + // Start with an empty selector + selector: "", + + // The current version of jQuery being used + jquery: "1.4.2", + + // The default length of a jQuery object is 0 + length: 0, + + // The number of elements contained in the matched element set + size: function() { + return this.length; + }, + + toArray: function() { + return slice.call( this, 0 ); + }, + + // Get the Nth element in the matched element set OR + // Get the whole matched element set as a clean array + get: function( num ) { + return num == null ? + + // Return a 'clean' array + this.toArray() : + + // Return just the object + ( num < 0 ? this.slice(num)[ 0 ] : this[ num ] ); + }, + + // Take an array of elements and push it onto the stack + // (returning the new matched element set) + pushStack: function( elems, name, selector ) { + // Build a new jQuery matched element set + var ret = jQuery(); + + if ( jQuery.isArray( elems ) ) { + push.apply( ret, elems ); + + } else { + jQuery.merge( ret, elems ); + } + + // Add the old object onto the stack (as a reference) + ret.prevObject = this; + + ret.context = this.context; + + if ( name === "find" ) { + ret.selector = this.selector + (this.selector ? " " : "") + selector; + } else if ( name ) { + ret.selector = this.selector + "." + name + "(" + selector + ")"; + } + + // Return the newly-formed element set + return ret; + }, + + // Execute a callback for every element in the matched set. + // (You can seed the arguments with an array of args, but this is + // only used internally.) + each: function( callback, args ) { + return jQuery.each( this, callback, args ); + }, + + ready: function( fn ) { + // Attach the listeners + jQuery.bindReady(); + + // If the DOM is already ready + if ( jQuery.isReady ) { + // Execute the function immediately + fn.call( document, jQuery ); + + // Otherwise, remember the function for later + } else if ( readyList ) { + // Add the function to the wait list + readyList.push( fn ); + } + + return this; + }, + + eq: function( i ) { + return i === -1 ? + this.slice( i ) : + this.slice( i, +i + 1 ); + }, + + first: function() { + return this.eq( 0 ); + }, + + last: function() { + return this.eq( -1 ); + }, + + slice: function() { + return this.pushStack( slice.apply( this, arguments ), + "slice", slice.call(arguments).join(",") ); + }, + + map: function( callback ) { + return this.pushStack( jQuery.map(this, function( elem, i ) { + return callback.call( elem, i, elem ); + })); + }, + + end: function() { + return this.prevObject || jQuery(null); + }, + + // For internal use only. + // Behaves like an Array's method, not like a jQuery method. + push: push, + sort: [].sort, + splice: [].splice +}; + +// Give the init function the jQuery prototype for later instantiation +jQuery.fn.init.prototype = jQuery.fn; + +jQuery.extend = jQuery.fn.extend = function() { + // copy reference to target object + var target = arguments[0] || {}, i = 1, length = arguments.length, deep = false, options, name, src, copy; + + // Handle a deep copy situation + if ( typeof target === "boolean" ) { + deep = target; + target = arguments[1] || {}; + // skip the boolean and the target + i = 2; + } + + // Handle case when target is a string or something (possible in deep copy) + if ( typeof target !== "object" && !jQuery.isFunction(target) ) { + target = {}; + } + + // extend jQuery itself if only one argument is passed + if ( length === i ) { + target = this; + --i; + } + + for ( ; i < length; i++ ) { + // Only deal with non-null/undefined values + if ( (options = arguments[ i ]) != null ) { + // Extend the base object + for ( name in options ) { + src = target[ name ]; + copy = options[ name ]; + + // Prevent never-ending loop + if ( target === copy ) { + continue; + } + + // Recurse if we're merging object literal values or arrays + if ( deep && copy && ( jQuery.isPlainObject(copy) || jQuery.isArray(copy) ) ) { + var clone = src && ( jQuery.isPlainObject(src) || jQuery.isArray(src) ) ? src + : jQuery.isArray(copy) ? [] : {}; + + // Never move original objects, clone them + target[ name ] = jQuery.extend( deep, clone, copy ); + + // Don't bring in undefined values + } else if ( copy !== undefined ) { + target[ name ] = copy; + } + } + } + } + + // Return the modified object + return target; +}; + +jQuery.extend({ + noConflict: function( deep ) { + window.$ = _$; + + if ( deep ) { + window.jQuery = _jQuery; + } + + return jQuery; + }, + + // Is the DOM ready to be used? Set to true once it occurs. + isReady: false, + + // Handle when the DOM is ready + ready: function() { + // Make sure that the DOM is not already loaded + if ( !jQuery.isReady ) { + // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). + if ( !document.body ) { + return setTimeout( jQuery.ready, 13 ); + } + + // Remember that the DOM is ready + jQuery.isReady = true; + + // If there are functions bound, to execute + if ( readyList ) { + // Execute all of them + var fn, i = 0; + while ( (fn = readyList[ i++ ]) ) { + fn.call( document, jQuery ); + } + + // Reset the list of functions + readyList = null; + } + + // Trigger any bound ready events + if ( jQuery.fn.triggerHandler ) { + jQuery( document ).triggerHandler( "ready" ); + } + } + }, + + bindReady: function() { + if ( readyBound ) { + return; + } + + readyBound = true; + + // Catch cases where $(document).ready() is called after the + // browser event has already occurred. + if ( document.readyState === "complete" ) { + return jQuery.ready(); + } + + // Mozilla, Opera and webkit nightlies currently support this event + if ( document.addEventListener ) { + // Use the handy event callback + document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false ); + + // A fallback to window.onload, that will always work + window.addEventListener( "load", jQuery.ready, false ); + + // If IE event model is used + } else if ( document.attachEvent ) { + // ensure firing before onload, + // maybe late but safe also for iframes + document.attachEvent("onreadystatechange", DOMContentLoaded); + + // A fallback to window.onload, that will always work + window.attachEvent( "onload", jQuery.ready ); + + // If IE and not a frame + // continually check to see if the document is ready + var toplevel = false; + + try { + toplevel = window.frameElement == null; + } catch(e) {} + + if ( document.documentElement.doScroll && toplevel ) { + doScrollCheck(); + } + } + }, + + // See test/unit/core.js for details concerning isFunction. + // Since version 1.3, DOM methods and functions like alert + // aren't supported. They return false on IE (#2968). + isFunction: function( obj ) { + return toString.call(obj) === "[object Function]"; + }, + + isArray: function( obj ) { + return toString.call(obj) === "[object Array]"; + }, + + isPlainObject: function( obj ) { + // Must be an Object. + // Because of IE, we also have to check the presence of the constructor property. + // Make sure that DOM nodes and window objects don't pass through, as well + if ( !obj || toString.call(obj) !== "[object Object]" || obj.nodeType || obj.setInterval ) { + return false; + } + + // Not own constructor property must be Object + if ( obj.constructor + && !hasOwnProperty.call(obj, "constructor") + && !hasOwnProperty.call(obj.constructor.prototype, "isPrototypeOf") ) { + return false; + } + + // Own properties are enumerated firstly, so to speed up, + // if last one is own, then all properties are own. + + var key; + for ( key in obj ) {} + + return key === undefined || hasOwnProperty.call( obj, key ); + }, + + isEmptyObject: function( obj ) { + for ( var name in obj ) { + return false; + } + return true; + }, + + error: function( msg ) { + throw msg; + }, + + parseJSON: function( data ) { + if ( typeof data !== "string" || !data ) { + return null; + } + + // Make sure leading/trailing whitespace is removed (IE can't handle it) + data = jQuery.trim( data ); + + // Make sure the incoming data is actual JSON + // Logic borrowed from http://json.org/json2.js + if ( /^[\],:{}\s]*$/.test(data.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, "@") + .replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, "]") + .replace(/(?:^|:|,)(?:\s*\[)+/g, "")) ) { + + // Try to use the native JSON parser first + return window.JSON && window.JSON.parse ? + window.JSON.parse( data ) : + (new Function("return " + data))(); + + } else { + jQuery.error( "Invalid JSON: " + data ); + } + }, + + noop: function() {}, + + // Evalulates a script in a global context + globalEval: function( data ) { + if ( data && rnotwhite.test(data) ) { + // Inspired by code by Andrea Giammarchi + // http://webreflection.blogspot.com/2007/08/global-scope-evaluation-and-dom.html + var head = document.getElementsByTagName("head")[0] || document.documentElement, + script = document.createElement("script"); + + script.type = "text/javascript"; + + if ( jQuery.support.scriptEval ) { + script.appendChild( document.createTextNode( data ) ); + } else { + script.text = data; + } + + // Use insertBefore instead of appendChild to circumvent an IE6 bug. + // This arises when a base node is used (#2709). + head.insertBefore( script, head.firstChild ); + head.removeChild( script ); + } + }, + + nodeName: function( elem, name ) { + return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase(); + }, + + // args is for internal usage only + each: function( object, callback, args ) { + var name, i = 0, + length = object.length, + isObj = length === undefined || jQuery.isFunction(object); + + if ( args ) { + if ( isObj ) { + for ( name in object ) { + if ( callback.apply( object[ name ], args ) === false ) { + break; + } + } + } else { + for ( ; i < length; ) { + if ( callback.apply( object[ i++ ], args ) === false ) { + break; + } + } + } + + // A special, fast, case for the most common use of each + } else { + if ( isObj ) { + for ( name in object ) { + if ( callback.call( object[ name ], name, object[ name ] ) === false ) { + break; + } + } + } else { + for ( var value = object[0]; + i < length && callback.call( value, i, value ) !== false; value = object[++i] ) {} + } + } + + return object; + }, + + trim: function( text ) { + return (text || "").replace( rtrim, "" ); + }, + + // results is for internal usage only + makeArray: function( array, results ) { + var ret = results || []; + + if ( array != null ) { + // The window, strings (and functions) also have 'length' + // The extra typeof function check is to prevent crashes + // in Safari 2 (See: #3039) + if ( array.length == null || typeof array === "string" || jQuery.isFunction(array) || (typeof array !== "function" && array.setInterval) ) { + push.call( ret, array ); + } else { + jQuery.merge( ret, array ); + } + } + + return ret; + }, + + inArray: function( elem, array ) { + if ( array.indexOf ) { + return array.indexOf( elem ); + } + + for ( var i = 0, length = array.length; i < length; i++ ) { + if ( array[ i ] === elem ) { + return i; + } + } + + return -1; + }, + + merge: function( first, second ) { + var i = first.length, j = 0; + + if ( typeof second.length === "number" ) { + for ( var l = second.length; j < l; j++ ) { + first[ i++ ] = second[ j ]; + } + + } else { + while ( second[j] !== undefined ) { + first[ i++ ] = second[ j++ ]; + } + } + + first.length = i; + + return first; + }, + + grep: function( elems, callback, inv ) { + var ret = []; + + // Go through the array, only saving the items + // that pass the validator function + for ( var i = 0, length = elems.length; i < length; i++ ) { + if ( !inv !== !callback( elems[ i ], i ) ) { + ret.push( elems[ i ] ); + } + } + + return ret; + }, + + // arg is for internal usage only + map: function( elems, callback, arg ) { + var ret = [], value; + + // Go through the array, translating each of the items to their + // new value (or values). + for ( var i = 0, length = elems.length; i < length; i++ ) { + value = callback( elems[ i ], i, arg ); + + if ( value != null ) { + ret[ ret.length ] = value; + } + } + + return ret.concat.apply( [], ret ); + }, + + // A global GUID counter for objects + guid: 1, + + proxy: function( fn, proxy, thisObject ) { + if ( arguments.length === 2 ) { + if ( typeof proxy === "string" ) { + thisObject = fn; + fn = thisObject[ proxy ]; + proxy = undefined; + + } else if ( proxy && !jQuery.isFunction( proxy ) ) { + thisObject = proxy; + proxy = undefined; + } + } + + if ( !proxy && fn ) { + proxy = function() { + return fn.apply( thisObject || this, arguments ); + }; + } + + // Set the guid of unique handler to the same of original handler, so it can be removed + if ( fn ) { + proxy.guid = fn.guid = fn.guid || proxy.guid || jQuery.guid++; + } + + // So proxy can be declared as an argument + return proxy; + }, + + // Use of jQuery.browser is frowned upon. + // More details: http://docs.jquery.com/Utilities/jQuery.browser + uaMatch: function( ua ) { + ua = ua.toLowerCase(); + + var match = /(webkit)[ \/]([\w.]+)/.exec( ua ) || + /(opera)(?:.*version)?[ \/]([\w.]+)/.exec( ua ) || + /(msie) ([\w.]+)/.exec( ua ) || + !/compatible/.test( ua ) && /(mozilla)(?:.*? rv:([\w.]+))?/.exec( ua ) || + []; + + return { browser: match[1] || "", version: match[2] || "0" }; + }, + + browser: {} +}); + +browserMatch = jQuery.uaMatch( userAgent ); +if ( browserMatch.browser ) { + jQuery.browser[ browserMatch.browser ] = true; + jQuery.browser.version = browserMatch.version; +} + +// Deprecated, use jQuery.browser.webkit instead +if ( jQuery.browser.webkit ) { + jQuery.browser.safari = true; +} + +if ( indexOf ) { + jQuery.inArray = function( elem, array ) { + return indexOf.call( array, elem ); + }; +} + +// All jQuery objects should point back to these +rootjQuery = jQuery(document); + +// Cleanup functions for the document ready method +if ( document.addEventListener ) { + DOMContentLoaded = function() { + document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false ); + jQuery.ready(); + }; + +} else if ( document.attachEvent ) { + DOMContentLoaded = function() { + // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). + if ( document.readyState === "complete" ) { + document.detachEvent( "onreadystatechange", DOMContentLoaded ); + jQuery.ready(); + } + }; +} + +// The DOM ready check for Internet Explorer +function doScrollCheck() { + if ( jQuery.isReady ) { + return; + } + + try { + // If IE is used, use the trick by Diego Perini + // http://javascript.nwbox.com/IEContentLoaded/ + document.documentElement.doScroll("left"); + } catch( error ) { + setTimeout( doScrollCheck, 1 ); + return; + } + + // and execute any waiting functions + jQuery.ready(); +} + +function evalScript( i, elem ) { + if ( elem.src ) { + jQuery.ajax({ + url: elem.src, + async: false, + dataType: "script" + }); + } else { + jQuery.globalEval( elem.text || elem.textContent || elem.innerHTML || "" ); + } + + if ( elem.parentNode ) { + elem.parentNode.removeChild( elem ); + } +} + +// Mutifunctional method to get and set values to a collection +// The value/s can be optionally by executed if its a function +function access( elems, key, value, exec, fn, pass ) { + var length = elems.length; + + // Setting many attributes + if ( typeof key === "object" ) { + for ( var k in key ) { + access( elems, k, key[k], exec, fn, value ); + } + return elems; + } + + // Setting one attribute + if ( value !== undefined ) { + // Optionally, function values get executed if exec is true + exec = !pass && exec && jQuery.isFunction(value); + + for ( var i = 0; i < length; i++ ) { + fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass ); + } + + return elems; + } + + // Getting an attribute + return length ? fn( elems[0], key ) : undefined; +} + +function now() { + return (new Date).getTime(); +} +(function() { + + jQuery.support = {}; + + var root = document.documentElement, + script = document.createElement("script"), + div = document.createElement("div"), + id = "script" + now(); + + div.style.display = "none"; + div.innerHTML = "
      a"; + + var all = div.getElementsByTagName("*"), + a = div.getElementsByTagName("a")[0]; + + // Can't get basic test support + if ( !all || !all.length || !a ) { + return; + } + + jQuery.support = { + // IE strips leading whitespace when .innerHTML is used + leadingWhitespace: div.firstChild.nodeType === 3, + + // Make sure that tbody elements aren't automatically inserted + // IE will insert them into empty tables + tbody: !div.getElementsByTagName("tbody").length, + + // Make sure that link elements get serialized correctly by innerHTML + // This requires a wrapper element in IE + htmlSerialize: !!div.getElementsByTagName("link").length, + + // Get the style information from getAttribute + // (IE uses .cssText insted) + style: /red/.test( a.getAttribute("style") ), + + // Make sure that URLs aren't manipulated + // (IE normalizes it by default) + hrefNormalized: a.getAttribute("href") === "/a", + + // Make sure that element opacity exists + // (IE uses filter instead) + // Use a regex to work around a WebKit issue. See #5145 + opacity: /^0.55$/.test( a.style.opacity ), + + // Verify style float existence + // (IE uses styleFloat instead of cssFloat) + cssFloat: !!a.style.cssFloat, + + // Make sure that if no value is specified for a checkbox + // that it defaults to "on". + // (WebKit defaults to "" instead) + checkOn: div.getElementsByTagName("input")[0].value === "on", + + // Make sure that a selected-by-default option has a working selected property. + // (WebKit defaults to false instead of true, IE too, if it's in an optgroup) + optSelected: document.createElement("select").appendChild( document.createElement("option") ).selected, + + parentNode: div.removeChild( div.appendChild( document.createElement("div") ) ).parentNode === null, + + // Will be defined later + deleteExpando: true, + checkClone: false, + scriptEval: false, + noCloneEvent: true, + boxModel: null + }; + + script.type = "text/javascript"; + try { + script.appendChild( document.createTextNode( "window." + id + "=1;" ) ); + } catch(e) {} + + root.insertBefore( script, root.firstChild ); + + // Make sure that the execution of code works by injecting a script + // tag with appendChild/createTextNode + // (IE doesn't support this, fails, and uses .text instead) + if ( window[ id ] ) { + jQuery.support.scriptEval = true; + delete window[ id ]; + } + + // Test to see if it's possible to delete an expando from an element + // Fails in Internet Explorer + try { + delete script.test; + + } catch(e) { + jQuery.support.deleteExpando = false; + } + + root.removeChild( script ); + + if ( div.attachEvent && div.fireEvent ) { + div.attachEvent("onclick", function click() { + // Cloning a node shouldn't copy over any + // bound event handlers (IE does this) + jQuery.support.noCloneEvent = false; + div.detachEvent("onclick", click); + }); + div.cloneNode(true).fireEvent("onclick"); + } + + div = document.createElement("div"); + div.innerHTML = ""; + + var fragment = document.createDocumentFragment(); + fragment.appendChild( div.firstChild ); + + // WebKit doesn't clone checked state correctly in fragments + jQuery.support.checkClone = fragment.cloneNode(true).cloneNode(true).lastChild.checked; + + // Figure out if the W3C box model works as expected + // document.body must exist before we can do this + jQuery(function() { + var div = document.createElement("div"); + div.style.width = div.style.paddingLeft = "1px"; + + document.body.appendChild( div ); + jQuery.boxModel = jQuery.support.boxModel = div.offsetWidth === 2; + document.body.removeChild( div ).style.display = 'none'; + + div = null; + }); + + // Technique from Juriy Zaytsev + // http://thinkweb2.com/projects/prototype/detecting-event-support-without-browser-sniffing/ + var eventSupported = function( eventName ) { + var el = document.createElement("div"); + eventName = "on" + eventName; + + var isSupported = (eventName in el); + if ( !isSupported ) { + el.setAttribute(eventName, "return;"); + isSupported = typeof el[eventName] === "function"; + } + el = null; + + return isSupported; + }; + + jQuery.support.submitBubbles = eventSupported("submit"); + jQuery.support.changeBubbles = eventSupported("change"); + + // release memory in IE + root = script = div = all = a = null; +})(); + +jQuery.props = { + "for": "htmlFor", + "class": "className", + readonly: "readOnly", + maxlength: "maxLength", + cellspacing: "cellSpacing", + rowspan: "rowSpan", + colspan: "colSpan", + tabindex: "tabIndex", + usemap: "useMap", + frameborder: "frameBorder" +}; +var expando = "jQuery" + now(), uuid = 0, windowData = {}; + +jQuery.extend({ + cache: {}, + + expando:expando, + + // The following elements throw uncatchable exceptions if you + // attempt to add expando properties to them. + noData: { + "embed": true, + "object": true, + "applet": true + }, + + data: function( elem, name, data ) { + if ( elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()] ) { + return; + } + + elem = elem == window ? + windowData : + elem; + + var id = elem[ expando ], cache = jQuery.cache, thisCache; + + if ( !id && typeof name === "string" && data === undefined ) { + return null; + } + + // Compute a unique ID for the element + if ( !id ) { + id = ++uuid; + } + + // Avoid generating a new cache unless none exists and we + // want to manipulate it. + if ( typeof name === "object" ) { + elem[ expando ] = id; + thisCache = cache[ id ] = jQuery.extend(true, {}, name); + + } else if ( !cache[ id ] ) { + elem[ expando ] = id; + cache[ id ] = {}; + } + + thisCache = cache[ id ]; + + // Prevent overriding the named cache with undefined values + if ( data !== undefined ) { + thisCache[ name ] = data; + } + + return typeof name === "string" ? thisCache[ name ] : thisCache; + }, + + removeData: function( elem, name ) { + if ( elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()] ) { + return; + } + + elem = elem == window ? + windowData : + elem; + + var id = elem[ expando ], cache = jQuery.cache, thisCache = cache[ id ]; + + // If we want to remove a specific section of the element's data + if ( name ) { + if ( thisCache ) { + // Remove the section of cache data + delete thisCache[ name ]; + + // If we've removed all the data, remove the element's cache + if ( jQuery.isEmptyObject(thisCache) ) { + jQuery.removeData( elem ); + } + } + + // Otherwise, we want to remove all of the element's data + } else { + if ( jQuery.support.deleteExpando ) { + delete elem[ jQuery.expando ]; + + } else if ( elem.removeAttribute ) { + elem.removeAttribute( jQuery.expando ); + } + + // Completely remove the data cache + delete cache[ id ]; + } + } +}); + +jQuery.fn.extend({ + data: function( key, value ) { + if ( typeof key === "undefined" && this.length ) { + return jQuery.data( this[0] ); + + } else if ( typeof key === "object" ) { + return this.each(function() { + jQuery.data( this, key ); + }); + } + + var parts = key.split("."); + parts[1] = parts[1] ? "." + parts[1] : ""; + + if ( value === undefined ) { + var data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]); + + if ( data === undefined && this.length ) { + data = jQuery.data( this[0], key ); + } + return data === undefined && parts[1] ? + this.data( parts[0] ) : + data; + } else { + return this.trigger("setData" + parts[1] + "!", [parts[0], value]).each(function() { + jQuery.data( this, key, value ); + }); + } + }, + + removeData: function( key ) { + return this.each(function() { + jQuery.removeData( this, key ); + }); + } +}); +jQuery.extend({ + queue: function( elem, type, data ) { + if ( !elem ) { + return; + } + + type = (type || "fx") + "queue"; + var q = jQuery.data( elem, type ); + + // Speed up dequeue by getting out quickly if this is just a lookup + if ( !data ) { + return q || []; + } + + if ( !q || jQuery.isArray(data) ) { + q = jQuery.data( elem, type, jQuery.makeArray(data) ); + + } else { + q.push( data ); + } + + return q; + }, + + dequeue: function( elem, type ) { + type = type || "fx"; + + var queue = jQuery.queue( elem, type ), fn = queue.shift(); + + // If the fx queue is dequeued, always remove the progress sentinel + if ( fn === "inprogress" ) { + fn = queue.shift(); + } + + if ( fn ) { + // Add a progress sentinel to prevent the fx queue from being + // automatically dequeued + if ( type === "fx" ) { + queue.unshift("inprogress"); + } + + fn.call(elem, function() { + jQuery.dequeue(elem, type); + }); + } + } +}); + +jQuery.fn.extend({ + queue: function( type, data ) { + if ( typeof type !== "string" ) { + data = type; + type = "fx"; + } + + if ( data === undefined ) { + return jQuery.queue( this[0], type ); + } + return this.each(function( i, elem ) { + var queue = jQuery.queue( this, type, data ); + + if ( type === "fx" && queue[0] !== "inprogress" ) { + jQuery.dequeue( this, type ); + } + }); + }, + dequeue: function( type ) { + return this.each(function() { + jQuery.dequeue( this, type ); + }); + }, + + // Based off of the plugin by Clint Helfers, with permission. + // http://blindsignals.com/index.php/2009/07/jquery-delay/ + delay: function( time, type ) { + time = jQuery.fx ? jQuery.fx.speeds[time] || time : time; + type = type || "fx"; + + return this.queue( type, function() { + var elem = this; + setTimeout(function() { + jQuery.dequeue( elem, type ); + }, time ); + }); + }, + + clearQueue: function( type ) { + return this.queue( type || "fx", [] ); + } +}); +var rclass = /[\n\t]/g, + rspace = /\s+/, + rreturn = /\r/g, + rspecialurl = /href|src|style/, + rtype = /(button|input)/i, + rfocusable = /(button|input|object|select|textarea)/i, + rclickable = /^(a|area)$/i, + rradiocheck = /radio|checkbox/; + +jQuery.fn.extend({ + attr: function( name, value ) { + return access( this, name, value, true, jQuery.attr ); + }, + + removeAttr: function( name, fn ) { + return this.each(function(){ + jQuery.attr( this, name, "" ); + if ( this.nodeType === 1 ) { + this.removeAttribute( name ); + } + }); + }, + + addClass: function( value ) { + if ( jQuery.isFunction(value) ) { + return this.each(function(i) { + var self = jQuery(this); + self.addClass( value.call(this, i, self.attr("class")) ); + }); + } + + if ( value && typeof value === "string" ) { + var classNames = (value || "").split( rspace ); + + for ( var i = 0, l = this.length; i < l; i++ ) { + var elem = this[i]; + + if ( elem.nodeType === 1 ) { + if ( !elem.className ) { + elem.className = value; + + } else { + var className = " " + elem.className + " ", setClass = elem.className; + for ( var c = 0, cl = classNames.length; c < cl; c++ ) { + if ( className.indexOf( " " + classNames[c] + " " ) < 0 ) { + setClass += " " + classNames[c]; + } + } + elem.className = jQuery.trim( setClass ); + } + } + } + } + + return this; + }, + + removeClass: function( value ) { + if ( jQuery.isFunction(value) ) { + return this.each(function(i) { + var self = jQuery(this); + self.removeClass( value.call(this, i, self.attr("class")) ); + }); + } + + if ( (value && typeof value === "string") || value === undefined ) { + var classNames = (value || "").split(rspace); + + for ( var i = 0, l = this.length; i < l; i++ ) { + var elem = this[i]; + + if ( elem.nodeType === 1 && elem.className ) { + if ( value ) { + var className = (" " + elem.className + " ").replace(rclass, " "); + for ( var c = 0, cl = classNames.length; c < cl; c++ ) { + className = className.replace(" " + classNames[c] + " ", " "); + } + elem.className = jQuery.trim( className ); + + } else { + elem.className = ""; + } + } + } + } + + return this; + }, + + toggleClass: function( value, stateVal ) { + var type = typeof value, isBool = typeof stateVal === "boolean"; + + if ( jQuery.isFunction( value ) ) { + return this.each(function(i) { + var self = jQuery(this); + self.toggleClass( value.call(this, i, self.attr("class"), stateVal), stateVal ); + }); + } + + return this.each(function() { + if ( type === "string" ) { + // toggle individual class names + var className, i = 0, self = jQuery(this), + state = stateVal, + classNames = value.split( rspace ); + + while ( (className = classNames[ i++ ]) ) { + // check each className given, space seperated list + state = isBool ? state : !self.hasClass( className ); + self[ state ? "addClass" : "removeClass" ]( className ); + } + + } else if ( type === "undefined" || type === "boolean" ) { + if ( this.className ) { + // store className if set + jQuery.data( this, "__className__", this.className ); + } + + // toggle whole className + this.className = this.className || value === false ? "" : jQuery.data( this, "__className__" ) || ""; + } + }); + }, + + hasClass: function( selector ) { + var className = " " + selector + " "; + for ( var i = 0, l = this.length; i < l; i++ ) { + if ( (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) > -1 ) { + return true; + } + } + + return false; + }, + + val: function( value ) { + if ( value === undefined ) { + var elem = this[0]; + + if ( elem ) { + if ( jQuery.nodeName( elem, "option" ) ) { + return (elem.attributes.value || {}).specified ? elem.value : elem.text; + } + + // We need to handle select boxes special + if ( jQuery.nodeName( elem, "select" ) ) { + var index = elem.selectedIndex, + values = [], + options = elem.options, + one = elem.type === "select-one"; + + // Nothing was selected + if ( index < 0 ) { + return null; + } + + // Loop through all the selected options + for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) { + var option = options[ i ]; + + if ( option.selected ) { + // Get the specifc value for the option + value = jQuery(option).val(); + + // We don't need an array for one selects + if ( one ) { + return value; + } + + // Multi-Selects return an array + values.push( value ); + } + } + + return values; + } + + // Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified + if ( rradiocheck.test( elem.type ) && !jQuery.support.checkOn ) { + return elem.getAttribute("value") === null ? "on" : elem.value; + } + + + // Everything else, we just grab the value + return (elem.value || "").replace(rreturn, ""); + + } + + return undefined; + } + + var isFunction = jQuery.isFunction(value); + + return this.each(function(i) { + var self = jQuery(this), val = value; + + if ( this.nodeType !== 1 ) { + return; + } + + if ( isFunction ) { + val = value.call(this, i, self.val()); + } + + // Typecast each time if the value is a Function and the appended + // value is therefore different each time. + if ( typeof val === "number" ) { + val += ""; + } + + if ( jQuery.isArray(val) && rradiocheck.test( this.type ) ) { + this.checked = jQuery.inArray( self.val(), val ) >= 0; + + } else if ( jQuery.nodeName( this, "select" ) ) { + var values = jQuery.makeArray(val); + + jQuery( "option", this ).each(function() { + this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0; + }); + + if ( !values.length ) { + this.selectedIndex = -1; + } + + } else { + this.value = val; + } + }); + } +}); + +jQuery.extend({ + attrFn: { + val: true, + css: true, + html: true, + text: true, + data: true, + width: true, + height: true, + offset: true + }, + + attr: function( elem, name, value, pass ) { + // don't set attributes on text and comment nodes + if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 ) { + return undefined; + } + + if ( pass && name in jQuery.attrFn ) { + return jQuery(elem)[name](value); + } + + var notxml = elem.nodeType !== 1 || !jQuery.isXMLDoc( elem ), + // Whether we are setting (or getting) + set = value !== undefined; + + // Try to normalize/fix the name + name = notxml && jQuery.props[ name ] || name; + + // Only do all the following if this is a node (faster for style) + if ( elem.nodeType === 1 ) { + // These attributes require special treatment + var special = rspecialurl.test( name ); + + // Safari mis-reports the default selected property of an option + // Accessing the parent's selectedIndex property fixes it + if ( name === "selected" && !jQuery.support.optSelected ) { + var parent = elem.parentNode; + if ( parent ) { + parent.selectedIndex; + + // Make sure that it also works with optgroups, see #5701 + if ( parent.parentNode ) { + parent.parentNode.selectedIndex; + } + } + } + + // If applicable, access the attribute via the DOM 0 way + if ( name in elem && notxml && !special ) { + if ( set ) { + // We can't allow the type property to be changed (since it causes problems in IE) + if ( name === "type" && rtype.test( elem.nodeName ) && elem.parentNode ) { + jQuery.error( "type property can't be changed" ); + } + + elem[ name ] = value; + } + + // browsers index elements by id/name on forms, give priority to attributes. + if ( jQuery.nodeName( elem, "form" ) && elem.getAttributeNode(name) ) { + return elem.getAttributeNode( name ).nodeValue; + } + + // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set + // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ + if ( name === "tabIndex" ) { + var attributeNode = elem.getAttributeNode( "tabIndex" ); + + return attributeNode && attributeNode.specified ? + attributeNode.value : + rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ? + 0 : + undefined; + } + + return elem[ name ]; + } + + if ( !jQuery.support.style && notxml && name === "style" ) { + if ( set ) { + elem.style.cssText = "" + value; + } + + return elem.style.cssText; + } + + if ( set ) { + // convert the value to a string (all browsers do this but IE) see #1070 + elem.setAttribute( name, "" + value ); + } + + var attr = !jQuery.support.hrefNormalized && notxml && special ? + // Some attributes require a special call on IE + elem.getAttribute( name, 2 ) : + elem.getAttribute( name ); + + // Non-existent attributes return null, we normalize to undefined + return attr === null ? undefined : attr; + } + + // elem is actually elem.style ... set the style + // Using attr for specific style information is now deprecated. Use style instead. + return jQuery.style( elem, name, value ); + } +}); +var rnamespaces = /\.(.*)$/, + fcleanup = function( nm ) { + return nm.replace(/[^\w\s\.\|`]/g, function( ch ) { + return "\\" + ch; + }); + }; + +/* + * A number of helper functions used for managing events. + * Many of the ideas behind this code originated from + * Dean Edwards' addEvent library. + */ +jQuery.event = { + + // Bind an event to an element + // Original by Dean Edwards + add: function( elem, types, handler, data ) { + if ( elem.nodeType === 3 || elem.nodeType === 8 ) { + return; + } + + // For whatever reason, IE has trouble passing the window object + // around, causing it to be cloned in the process + if ( elem.setInterval && ( elem !== window && !elem.frameElement ) ) { + elem = window; + } + + var handleObjIn, handleObj; + + if ( handler.handler ) { + handleObjIn = handler; + handler = handleObjIn.handler; + } + + // Make sure that the function being executed has a unique ID + if ( !handler.guid ) { + handler.guid = jQuery.guid++; + } + + // Init the element's event structure + var elemData = jQuery.data( elem ); + + // If no elemData is found then we must be trying to bind to one of the + // banned noData elements + if ( !elemData ) { + return; + } + + var events = elemData.events = elemData.events || {}, + eventHandle = elemData.handle, eventHandle; + + if ( !eventHandle ) { + elemData.handle = eventHandle = function() { + // Handle the second event of a trigger and when + // an event is called after a page has unloaded + return typeof jQuery !== "undefined" && !jQuery.event.triggered ? + jQuery.event.handle.apply( eventHandle.elem, arguments ) : + undefined; + }; + } + + // Add elem as a property of the handle function + // This is to prevent a memory leak with non-native events in IE. + eventHandle.elem = elem; + + // Handle multiple events separated by a space + // jQuery(...).bind("mouseover mouseout", fn); + types = types.split(" "); + + var type, i = 0, namespaces; + + while ( (type = types[ i++ ]) ) { + handleObj = handleObjIn ? + jQuery.extend({}, handleObjIn) : + { handler: handler, data: data }; + + // Namespaced event handlers + if ( type.indexOf(".") > -1 ) { + namespaces = type.split("."); + type = namespaces.shift(); + handleObj.namespace = namespaces.slice(0).sort().join("."); + + } else { + namespaces = []; + handleObj.namespace = ""; + } + + handleObj.type = type; + handleObj.guid = handler.guid; + + // Get the current list of functions bound to this event + var handlers = events[ type ], + special = jQuery.event.special[ type ] || {}; + + // Init the event handler queue + if ( !handlers ) { + handlers = events[ type ] = []; + + // Check for a special event handler + // Only use addEventListener/attachEvent if the special + // events handler returns false + if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) { + // Bind the global event handler to the element + if ( elem.addEventListener ) { + elem.addEventListener( type, eventHandle, false ); + + } else if ( elem.attachEvent ) { + elem.attachEvent( "on" + type, eventHandle ); + } + } + } + + if ( special.add ) { + special.add.call( elem, handleObj ); + + if ( !handleObj.handler.guid ) { + handleObj.handler.guid = handler.guid; + } + } + + // Add the function to the element's handler list + handlers.push( handleObj ); + + // Keep track of which events have been used, for global triggering + jQuery.event.global[ type ] = true; + } + + // Nullify elem to prevent memory leaks in IE + elem = null; + }, + + global: {}, + + // Detach an event or set of events from an element + remove: function( elem, types, handler, pos ) { + // don't do events on text and comment nodes + if ( elem.nodeType === 3 || elem.nodeType === 8 ) { + return; + } + + var ret, type, fn, i = 0, all, namespaces, namespace, special, eventType, handleObj, origType, + elemData = jQuery.data( elem ), + events = elemData && elemData.events; + + if ( !elemData || !events ) { + return; + } + + // types is actually an event object here + if ( types && types.type ) { + handler = types.handler; + types = types.type; + } + + // Unbind all events for the element + if ( !types || typeof types === "string" && types.charAt(0) === "." ) { + types = types || ""; + + for ( type in events ) { + jQuery.event.remove( elem, type + types ); + } + + return; + } + + // Handle multiple events separated by a space + // jQuery(...).unbind("mouseover mouseout", fn); + types = types.split(" "); + + while ( (type = types[ i++ ]) ) { + origType = type; + handleObj = null; + all = type.indexOf(".") < 0; + namespaces = []; + + if ( !all ) { + // Namespaced event handlers + namespaces = type.split("."); + type = namespaces.shift(); + + namespace = new RegExp("(^|\\.)" + + jQuery.map( namespaces.slice(0).sort(), fcleanup ).join("\\.(?:.*\\.)?") + "(\\.|$)") + } + + eventType = events[ type ]; + + if ( !eventType ) { + continue; + } + + if ( !handler ) { + for ( var j = 0; j < eventType.length; j++ ) { + handleObj = eventType[ j ]; + + if ( all || namespace.test( handleObj.namespace ) ) { + jQuery.event.remove( elem, origType, handleObj.handler, j ); + eventType.splice( j--, 1 ); + } + } + + continue; + } + + special = jQuery.event.special[ type ] || {}; + + for ( var j = pos || 0; j < eventType.length; j++ ) { + handleObj = eventType[ j ]; + + if ( handler.guid === handleObj.guid ) { + // remove the given handler for the given type + if ( all || namespace.test( handleObj.namespace ) ) { + if ( pos == null ) { + eventType.splice( j--, 1 ); + } + + if ( special.remove ) { + special.remove.call( elem, handleObj ); + } + } + + if ( pos != null ) { + break; + } + } + } + + // remove generic event handler if no more handlers exist + if ( eventType.length === 0 || pos != null && eventType.length === 1 ) { + if ( !special.teardown || special.teardown.call( elem, namespaces ) === false ) { + removeEvent( elem, type, elemData.handle ); + } + + ret = null; + delete events[ type ]; + } + } + + // Remove the expando if it's no longer used + if ( jQuery.isEmptyObject( events ) ) { + var handle = elemData.handle; + if ( handle ) { + handle.elem = null; + } + + delete elemData.events; + delete elemData.handle; + + if ( jQuery.isEmptyObject( elemData ) ) { + jQuery.removeData( elem ); + } + } + }, + + // bubbling is internal + trigger: function( event, data, elem /*, bubbling */ ) { + // Event object or event type + var type = event.type || event, + bubbling = arguments[3]; + + if ( !bubbling ) { + event = typeof event === "object" ? + // jQuery.Event object + event[expando] ? event : + // Object literal + jQuery.extend( jQuery.Event(type), event ) : + // Just the event type (string) + jQuery.Event(type); + + if ( type.indexOf("!") >= 0 ) { + event.type = type = type.slice(0, -1); + event.exclusive = true; + } + + // Handle a global trigger + if ( !elem ) { + // Don't bubble custom events when global (to avoid too much overhead) + event.stopPropagation(); + + // Only trigger if we've ever bound an event for it + if ( jQuery.event.global[ type ] ) { + jQuery.each( jQuery.cache, function() { + if ( this.events && this.events[type] ) { + jQuery.event.trigger( event, data, this.handle.elem ); + } + }); + } + } + + // Handle triggering a single element + + // don't do events on text and comment nodes + if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 ) { + return undefined; + } + + // Clean up in case it is reused + event.result = undefined; + event.target = elem; + + // Clone the incoming data, if any + data = jQuery.makeArray( data ); + data.unshift( event ); + } + + event.currentTarget = elem; + + // Trigger the event, it is assumed that "handle" is a function + var handle = jQuery.data( elem, "handle" ); + if ( handle ) { + handle.apply( elem, data ); + } + + var parent = elem.parentNode || elem.ownerDocument; + + // Trigger an inline bound script + try { + if ( !(elem && elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()]) ) { + if ( elem[ "on" + type ] && elem[ "on" + type ].apply( elem, data ) === false ) { + event.result = false; + } + } + + // prevent IE from throwing an error for some elements with some event types, see #3533 + } catch (e) {} + + if ( !event.isPropagationStopped() && parent ) { + jQuery.event.trigger( event, data, parent, true ); + + } else if ( !event.isDefaultPrevented() ) { + var target = event.target, old, + isClick = jQuery.nodeName(target, "a") && type === "click", + special = jQuery.event.special[ type ] || {}; + + if ( (!special._default || special._default.call( elem, event ) === false) && + !isClick && !(target && target.nodeName && jQuery.noData[target.nodeName.toLowerCase()]) ) { + + try { + if ( target[ type ] ) { + // Make sure that we don't accidentally re-trigger the onFOO events + old = target[ "on" + type ]; + + if ( old ) { + target[ "on" + type ] = null; + } + + jQuery.event.triggered = true; + target[ type ](); + } + + // prevent IE from throwing an error for some elements with some event types, see #3533 + } catch (e) {} + + if ( old ) { + target[ "on" + type ] = old; + } + + jQuery.event.triggered = false; + } + } + }, + + handle: function( event ) { + var all, handlers, namespaces, namespace, events; + + event = arguments[0] = jQuery.event.fix( event || window.event ); + event.currentTarget = this; + + // Namespaced event handlers + all = event.type.indexOf(".") < 0 && !event.exclusive; + + if ( !all ) { + namespaces = event.type.split("."); + event.type = namespaces.shift(); + namespace = new RegExp("(^|\\.)" + namespaces.slice(0).sort().join("\\.(?:.*\\.)?") + "(\\.|$)"); + } + + var events = jQuery.data(this, "events"), handlers = events[ event.type ]; + + if ( events && handlers ) { + // Clone the handlers to prevent manipulation + handlers = handlers.slice(0); + + for ( var j = 0, l = handlers.length; j < l; j++ ) { + var handleObj = handlers[ j ]; + + // Filter the functions by class + if ( all || namespace.test( handleObj.namespace ) ) { + // Pass in a reference to the handler function itself + // So that we can later remove it + event.handler = handleObj.handler; + event.data = handleObj.data; + event.handleObj = handleObj; + + var ret = handleObj.handler.apply( this, arguments ); + + if ( ret !== undefined ) { + event.result = ret; + if ( ret === false ) { + event.preventDefault(); + event.stopPropagation(); + } + } + + if ( event.isImmediatePropagationStopped() ) { + break; + } + } + } + } + + return event.result; + }, + + props: "altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "), + + fix: function( event ) { + if ( event[ expando ] ) { + return event; + } + + // store a copy of the original event object + // and "clone" to set read-only properties + var originalEvent = event; + event = jQuery.Event( originalEvent ); + + for ( var i = this.props.length, prop; i; ) { + prop = this.props[ --i ]; + event[ prop ] = originalEvent[ prop ]; + } + + // Fix target property, if necessary + if ( !event.target ) { + event.target = event.srcElement || document; // Fixes #1925 where srcElement might not be defined either + } + + // check if target is a textnode (safari) + if ( event.target.nodeType === 3 ) { + event.target = event.target.parentNode; + } + + // Add relatedTarget, if necessary + if ( !event.relatedTarget && event.fromElement ) { + event.relatedTarget = event.fromElement === event.target ? event.toElement : event.fromElement; + } + + // Calculate pageX/Y if missing and clientX/Y available + if ( event.pageX == null && event.clientX != null ) { + var doc = document.documentElement, body = document.body; + event.pageX = event.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0); + event.pageY = event.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc && doc.clientTop || body && body.clientTop || 0); + } + + // Add which for key events + if ( !event.which && ((event.charCode || event.charCode === 0) ? event.charCode : event.keyCode) ) { + event.which = event.charCode || event.keyCode; + } + + // Add metaKey to non-Mac browsers (use ctrl for PC's and Meta for Macs) + if ( !event.metaKey && event.ctrlKey ) { + event.metaKey = event.ctrlKey; + } + + // Add which for click: 1 === left; 2 === middle; 3 === right + // Note: button is not normalized, so don't use it + if ( !event.which && event.button !== undefined ) { + event.which = (event.button & 1 ? 1 : ( event.button & 2 ? 3 : ( event.button & 4 ? 2 : 0 ) )); + } + + return event; + }, + + // Deprecated, use jQuery.guid instead + guid: 1E8, + + // Deprecated, use jQuery.proxy instead + proxy: jQuery.proxy, + + special: { + ready: { + // Make sure the ready event is setup + setup: jQuery.bindReady, + teardown: jQuery.noop + }, + + live: { + add: function( handleObj ) { + jQuery.event.add( this, handleObj.origType, jQuery.extend({}, handleObj, {handler: liveHandler}) ); + }, + + remove: function( handleObj ) { + var remove = true, + type = handleObj.origType.replace(rnamespaces, ""); + + jQuery.each( jQuery.data(this, "events").live || [], function() { + if ( type === this.origType.replace(rnamespaces, "") ) { + remove = false; + return false; + } + }); + + if ( remove ) { + jQuery.event.remove( this, handleObj.origType, liveHandler ); + } + } + + }, + + beforeunload: { + setup: function( data, namespaces, eventHandle ) { + // We only want to do this special case on windows + if ( this.setInterval ) { + this.onbeforeunload = eventHandle; + } + + return false; + }, + teardown: function( namespaces, eventHandle ) { + if ( this.onbeforeunload === eventHandle ) { + this.onbeforeunload = null; + } + } + } + } +}; + +var removeEvent = document.removeEventListener ? + function( elem, type, handle ) { + elem.removeEventListener( type, handle, false ); + } : + function( elem, type, handle ) { + elem.detachEvent( "on" + type, handle ); + }; + +jQuery.Event = function( src ) { + // Allow instantiation without the 'new' keyword + if ( !this.preventDefault ) { + return new jQuery.Event( src ); + } + + // Event object + if ( src && src.type ) { + this.originalEvent = src; + this.type = src.type; + // Event type + } else { + this.type = src; + } + + // timeStamp is buggy for some events on Firefox(#3843) + // So we won't rely on the native value + this.timeStamp = now(); + + // Mark it as fixed + this[ expando ] = true; +}; + +function returnFalse() { + return false; +} +function returnTrue() { + return true; +} + +// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding +// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html +jQuery.Event.prototype = { + preventDefault: function() { + this.isDefaultPrevented = returnTrue; + + var e = this.originalEvent; + if ( !e ) { + return; + } + + // if preventDefault exists run it on the original event + if ( e.preventDefault ) { + e.preventDefault(); + } + // otherwise set the returnValue property of the original event to false (IE) + e.returnValue = false; + }, + stopPropagation: function() { + this.isPropagationStopped = returnTrue; + + var e = this.originalEvent; + if ( !e ) { + return; + } + // if stopPropagation exists run it on the original event + if ( e.stopPropagation ) { + e.stopPropagation(); + } + // otherwise set the cancelBubble property of the original event to true (IE) + e.cancelBubble = true; + }, + stopImmediatePropagation: function() { + this.isImmediatePropagationStopped = returnTrue; + this.stopPropagation(); + }, + isDefaultPrevented: returnFalse, + isPropagationStopped: returnFalse, + isImmediatePropagationStopped: returnFalse +}; + +// Checks if an event happened on an element within another element +// Used in jQuery.event.special.mouseenter and mouseleave handlers +var withinElement = function( event ) { + // Check if mouse(over|out) are still within the same parent element + var parent = event.relatedTarget; + + // Firefox sometimes assigns relatedTarget a XUL element + // which we cannot access the parentNode property of + try { + // Traverse up the tree + while ( parent && parent !== this ) { + parent = parent.parentNode; + } + + if ( parent !== this ) { + // set the correct event type + event.type = event.data; + + // handle event if we actually just moused on to a non sub-element + jQuery.event.handle.apply( this, arguments ); + } + + // assuming we've left the element since we most likely mousedover a xul element + } catch(e) { } +}, + +// In case of event delegation, we only need to rename the event.type, +// liveHandler will take care of the rest. +delegate = function( event ) { + event.type = event.data; + jQuery.event.handle.apply( this, arguments ); +}; + +// Create mouseenter and mouseleave events +jQuery.each({ + mouseenter: "mouseover", + mouseleave: "mouseout" +}, function( orig, fix ) { + jQuery.event.special[ orig ] = { + setup: function( data ) { + jQuery.event.add( this, fix, data && data.selector ? delegate : withinElement, orig ); + }, + teardown: function( data ) { + jQuery.event.remove( this, fix, data && data.selector ? delegate : withinElement ); + } + }; +}); + +// submit delegation +if ( !jQuery.support.submitBubbles ) { + + jQuery.event.special.submit = { + setup: function( data, namespaces ) { + if ( this.nodeName.toLowerCase() !== "form" ) { + jQuery.event.add(this, "click.specialSubmit", function( e ) { + var elem = e.target, type = elem.type; + + if ( (type === "submit" || type === "image") && jQuery( elem ).closest("form").length ) { + return trigger( "submit", this, arguments ); + } + }); + + jQuery.event.add(this, "keypress.specialSubmit", function( e ) { + var elem = e.target, type = elem.type; + + if ( (type === "text" || type === "password") && jQuery( elem ).closest("form").length && e.keyCode === 13 ) { + return trigger( "submit", this, arguments ); + } + }); + + } else { + return false; + } + }, + + teardown: function( namespaces ) { + jQuery.event.remove( this, ".specialSubmit" ); + } + }; + +} + +// change delegation, happens here so we have bind. +if ( !jQuery.support.changeBubbles ) { + + var formElems = /textarea|input|select/i, + + changeFilters, + + getVal = function( elem ) { + var type = elem.type, val = elem.value; + + if ( type === "radio" || type === "checkbox" ) { + val = elem.checked; + + } else if ( type === "select-multiple" ) { + val = elem.selectedIndex > -1 ? + jQuery.map( elem.options, function( elem ) { + return elem.selected; + }).join("-") : + ""; + + } else if ( elem.nodeName.toLowerCase() === "select" ) { + val = elem.selectedIndex; + } + + return val; + }, + + testChange = function testChange( e ) { + var elem = e.target, data, val; + + if ( !formElems.test( elem.nodeName ) || elem.readOnly ) { + return; + } + + data = jQuery.data( elem, "_change_data" ); + val = getVal(elem); + + // the current data will be also retrieved by beforeactivate + if ( e.type !== "focusout" || elem.type !== "radio" ) { + jQuery.data( elem, "_change_data", val ); + } + + if ( data === undefined || val === data ) { + return; + } + + if ( data != null || val ) { + e.type = "change"; + return jQuery.event.trigger( e, arguments[1], elem ); + } + }; + + jQuery.event.special.change = { + filters: { + focusout: testChange, + + click: function( e ) { + var elem = e.target, type = elem.type; + + if ( type === "radio" || type === "checkbox" || elem.nodeName.toLowerCase() === "select" ) { + return testChange.call( this, e ); + } + }, + + // Change has to be called before submit + // Keydown will be called before keypress, which is used in submit-event delegation + keydown: function( e ) { + var elem = e.target, type = elem.type; + + if ( (e.keyCode === 13 && elem.nodeName.toLowerCase() !== "textarea") || + (e.keyCode === 32 && (type === "checkbox" || type === "radio")) || + type === "select-multiple" ) { + return testChange.call( this, e ); + } + }, + + // Beforeactivate happens also before the previous element is blurred + // with this event you can't trigger a change event, but you can store + // information/focus[in] is not needed anymore + beforeactivate: function( e ) { + var elem = e.target; + jQuery.data( elem, "_change_data", getVal(elem) ); + } + }, + + setup: function( data, namespaces ) { + if ( this.type === "file" ) { + return false; + } + + for ( var type in changeFilters ) { + jQuery.event.add( this, type + ".specialChange", changeFilters[type] ); + } + + return formElems.test( this.nodeName ); + }, + + teardown: function( namespaces ) { + jQuery.event.remove( this, ".specialChange" ); + + return formElems.test( this.nodeName ); + } + }; + + changeFilters = jQuery.event.special.change.filters; +} + +function trigger( type, elem, args ) { + args[0].type = type; + return jQuery.event.handle.apply( elem, args ); +} + +// Create "bubbling" focus and blur events +if ( document.addEventListener ) { + jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) { + jQuery.event.special[ fix ] = { + setup: function() { + this.addEventListener( orig, handler, true ); + }, + teardown: function() { + this.removeEventListener( orig, handler, true ); + } + }; + + function handler( e ) { + e = jQuery.event.fix( e ); + e.type = fix; + return jQuery.event.handle.call( this, e ); + } + }); +} + +jQuery.each(["bind", "one"], function( i, name ) { + jQuery.fn[ name ] = function( type, data, fn ) { + // Handle object literals + if ( typeof type === "object" ) { + for ( var key in type ) { + this[ name ](key, data, type[key], fn); + } + return this; + } + + if ( jQuery.isFunction( data ) ) { + fn = data; + data = undefined; + } + + var handler = name === "one" ? jQuery.proxy( fn, function( event ) { + jQuery( this ).unbind( event, handler ); + return fn.apply( this, arguments ); + }) : fn; + + if ( type === "unload" && name !== "one" ) { + this.one( type, data, fn ); + + } else { + for ( var i = 0, l = this.length; i < l; i++ ) { + jQuery.event.add( this[i], type, handler, data ); + } + } + + return this; + }; +}); + +jQuery.fn.extend({ + unbind: function( type, fn ) { + // Handle object literals + if ( typeof type === "object" && !type.preventDefault ) { + for ( var key in type ) { + this.unbind(key, type[key]); + } + + } else { + for ( var i = 0, l = this.length; i < l; i++ ) { + jQuery.event.remove( this[i], type, fn ); + } + } + + return this; + }, + + delegate: function( selector, types, data, fn ) { + return this.live( types, data, fn, selector ); + }, + + undelegate: function( selector, types, fn ) { + if ( arguments.length === 0 ) { + return this.unbind( "live" ); + + } else { + return this.die( types, null, fn, selector ); + } + }, + + trigger: function( type, data ) { + return this.each(function() { + jQuery.event.trigger( type, data, this ); + }); + }, + + triggerHandler: function( type, data ) { + if ( this[0] ) { + var event = jQuery.Event( type ); + event.preventDefault(); + event.stopPropagation(); + jQuery.event.trigger( event, data, this[0] ); + return event.result; + } + }, + + toggle: function( fn ) { + // Save reference to arguments for access in closure + var args = arguments, i = 1; + + // link all the functions, so any of them can unbind this click handler + while ( i < args.length ) { + jQuery.proxy( fn, args[ i++ ] ); + } + + return this.click( jQuery.proxy( fn, function( event ) { + // Figure out which function to execute + var lastToggle = ( jQuery.data( this, "lastToggle" + fn.guid ) || 0 ) % i; + jQuery.data( this, "lastToggle" + fn.guid, lastToggle + 1 ); + + // Make sure that clicks stop + event.preventDefault(); + + // and execute the function + return args[ lastToggle ].apply( this, arguments ) || false; + })); + }, + + hover: function( fnOver, fnOut ) { + return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver ); + } +}); + +var liveMap = { + focus: "focusin", + blur: "focusout", + mouseenter: "mouseover", + mouseleave: "mouseout" +}; + +jQuery.each(["live", "die"], function( i, name ) { + jQuery.fn[ name ] = function( types, data, fn, origSelector /* Internal Use Only */ ) { + var type, i = 0, match, namespaces, preType, + selector = origSelector || this.selector, + context = origSelector ? this : jQuery( this.context ); + + if ( jQuery.isFunction( data ) ) { + fn = data; + data = undefined; + } + + types = (types || "").split(" "); + + while ( (type = types[ i++ ]) != null ) { + match = rnamespaces.exec( type ); + namespaces = ""; + + if ( match ) { + namespaces = match[0]; + type = type.replace( rnamespaces, "" ); + } + + if ( type === "hover" ) { + types.push( "mouseenter" + namespaces, "mouseleave" + namespaces ); + continue; + } + + preType = type; + + if ( type === "focus" || type === "blur" ) { + types.push( liveMap[ type ] + namespaces ); + type = type + namespaces; + + } else { + type = (liveMap[ type ] || type) + namespaces; + } + + if ( name === "live" ) { + // bind live handler + context.each(function(){ + jQuery.event.add( this, liveConvert( type, selector ), + { data: data, selector: selector, handler: fn, origType: type, origHandler: fn, preType: preType } ); + }); + + } else { + // unbind live handler + context.unbind( liveConvert( type, selector ), fn ); + } + } + + return this; + } +}); + +function liveHandler( event ) { + var stop, elems = [], selectors = [], args = arguments, + related, match, handleObj, elem, j, i, l, data, + events = jQuery.data( this, "events" ); + + // Make sure we avoid non-left-click bubbling in Firefox (#3861) + if ( event.liveFired === this || !events || !events.live || event.button && event.type === "click" ) { + return; + } + + event.liveFired = this; + + var live = events.live.slice(0); + + for ( j = 0; j < live.length; j++ ) { + handleObj = live[j]; + + if ( handleObj.origType.replace( rnamespaces, "" ) === event.type ) { + selectors.push( handleObj.selector ); + + } else { + live.splice( j--, 1 ); + } + } + + match = jQuery( event.target ).closest( selectors, event.currentTarget ); + + for ( i = 0, l = match.length; i < l; i++ ) { + for ( j = 0; j < live.length; j++ ) { + handleObj = live[j]; + + if ( match[i].selector === handleObj.selector ) { + elem = match[i].elem; + related = null; + + // Those two events require additional checking + if ( handleObj.preType === "mouseenter" || handleObj.preType === "mouseleave" ) { + related = jQuery( event.relatedTarget ).closest( handleObj.selector )[0]; + } + + if ( !related || related !== elem ) { + elems.push({ elem: elem, handleObj: handleObj }); + } + } + } + } + + for ( i = 0, l = elems.length; i < l; i++ ) { + match = elems[i]; + event.currentTarget = match.elem; + event.data = match.handleObj.data; + event.handleObj = match.handleObj; + + if ( match.handleObj.origHandler.apply( match.elem, args ) === false ) { + stop = false; + break; + } + } + + return stop; +} + +function liveConvert( type, selector ) { + return "live." + (type && type !== "*" ? type + "." : "") + selector.replace(/\./g, "`").replace(/ /g, "&"); +} + +jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " + + "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + + "change select submit keydown keypress keyup error").split(" "), function( i, name ) { + + // Handle event binding + jQuery.fn[ name ] = function( fn ) { + return fn ? this.bind( name, fn ) : this.trigger( name ); + }; + + if ( jQuery.attrFn ) { + jQuery.attrFn[ name ] = true; + } +}); + +// Prevent memory leaks in IE +// Window isn't included so as not to unbind existing unload events +// More info: +// - http://isaacschlueter.com/2006/10/msie-memory-leaks/ +if ( window.attachEvent && !window.addEventListener ) { + window.attachEvent("onunload", function() { + for ( var id in jQuery.cache ) { + if ( jQuery.cache[ id ].handle ) { + // Try/Catch is to handle iframes being unloaded, see #4280 + try { + jQuery.event.remove( jQuery.cache[ id ].handle.elem ); + } catch(e) {} + } + } + }); +} +/*! + * Sizzle CSS Selector Engine - v1.0 + * Copyright 2009, The Dojo Foundation + * Released under the MIT, BSD, and GPL Licenses. + * More information: http://sizzlejs.com/ + */ +(function(){ + +var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g, + done = 0, + toString = Object.prototype.toString, + hasDuplicate = false, + baseHasDuplicate = true; + +// Here we check if the JavaScript engine is using some sort of +// optimization where it does not always call our comparision +// function. If that is the case, discard the hasDuplicate value. +// Thus far that includes Google Chrome. +[0, 0].sort(function(){ + baseHasDuplicate = false; + return 0; +}); + +var Sizzle = function(selector, context, results, seed) { + results = results || []; + var origContext = context = context || document; + + if ( context.nodeType !== 1 && context.nodeType !== 9 ) { + return []; + } + + if ( !selector || typeof selector !== "string" ) { + return results; + } + + var parts = [], m, set, checkSet, extra, prune = true, contextXML = isXML(context), + soFar = selector; + + // Reset the position of the chunker regexp (start from head) + while ( (chunker.exec(""), m = chunker.exec(soFar)) !== null ) { + soFar = m[3]; + + parts.push( m[1] ); + + if ( m[2] ) { + extra = m[3]; + break; + } + } + + if ( parts.length > 1 && origPOS.exec( selector ) ) { + if ( parts.length === 2 && Expr.relative[ parts[0] ] ) { + set = posProcess( parts[0] + parts[1], context ); + } else { + set = Expr.relative[ parts[0] ] ? + [ context ] : + Sizzle( parts.shift(), context ); + + while ( parts.length ) { + selector = parts.shift(); + + if ( Expr.relative[ selector ] ) { + selector += parts.shift(); + } + + set = posProcess( selector, set ); + } + } + } else { + // Take a shortcut and set the context if the root selector is an ID + // (but not if it'll be faster if the inner selector is an ID) + if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML && + Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) { + var ret = Sizzle.find( parts.shift(), context, contextXML ); + context = ret.expr ? Sizzle.filter( ret.expr, ret.set )[0] : ret.set[0]; + } + + if ( context ) { + var ret = seed ? + { expr: parts.pop(), set: makeArray(seed) } : + Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML ); + set = ret.expr ? Sizzle.filter( ret.expr, ret.set ) : ret.set; + + if ( parts.length > 0 ) { + checkSet = makeArray(set); + } else { + prune = false; + } + + while ( parts.length ) { + var cur = parts.pop(), pop = cur; + + if ( !Expr.relative[ cur ] ) { + cur = ""; + } else { + pop = parts.pop(); + } + + if ( pop == null ) { + pop = context; + } + + Expr.relative[ cur ]( checkSet, pop, contextXML ); + } + } else { + checkSet = parts = []; + } + } + + if ( !checkSet ) { + checkSet = set; + } + + if ( !checkSet ) { + Sizzle.error( cur || selector ); + } + + if ( toString.call(checkSet) === "[object Array]" ) { + if ( !prune ) { + results.push.apply( results, checkSet ); + } else if ( context && context.nodeType === 1 ) { + for ( var i = 0; checkSet[i] != null; i++ ) { + if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && contains(context, checkSet[i])) ) { + results.push( set[i] ); + } + } + } else { + for ( var i = 0; checkSet[i] != null; i++ ) { + if ( checkSet[i] && checkSet[i].nodeType === 1 ) { + results.push( set[i] ); + } + } + } + } else { + makeArray( checkSet, results ); + } + + if ( extra ) { + Sizzle( extra, origContext, results, seed ); + Sizzle.uniqueSort( results ); + } + + return results; +}; + +Sizzle.uniqueSort = function(results){ + if ( sortOrder ) { + hasDuplicate = baseHasDuplicate; + results.sort(sortOrder); + + if ( hasDuplicate ) { + for ( var i = 1; i < results.length; i++ ) { + if ( results[i] === results[i-1] ) { + results.splice(i--, 1); + } + } + } + } + + return results; +}; + +Sizzle.matches = function(expr, set){ + return Sizzle(expr, null, null, set); +}; + +Sizzle.find = function(expr, context, isXML){ + var set, match; + + if ( !expr ) { + return []; + } + + for ( var i = 0, l = Expr.order.length; i < l; i++ ) { + var type = Expr.order[i], match; + + if ( (match = Expr.leftMatch[ type ].exec( expr )) ) { + var left = match[1]; + match.splice(1,1); + + if ( left.substr( left.length - 1 ) !== "\\" ) { + match[1] = (match[1] || "").replace(/\\/g, ""); + set = Expr.find[ type ]( match, context, isXML ); + if ( set != null ) { + expr = expr.replace( Expr.match[ type ], "" ); + break; + } + } + } + } + + if ( !set ) { + set = context.getElementsByTagName("*"); + } + + return {set: set, expr: expr}; +}; + +Sizzle.filter = function(expr, set, inplace, not){ + var old = expr, result = [], curLoop = set, match, anyFound, + isXMLFilter = set && set[0] && isXML(set[0]); + + while ( expr && set.length ) { + for ( var type in Expr.filter ) { + if ( (match = Expr.leftMatch[ type ].exec( expr )) != null && match[2] ) { + var filter = Expr.filter[ type ], found, item, left = match[1]; + anyFound = false; + + match.splice(1,1); + + if ( left.substr( left.length - 1 ) === "\\" ) { + continue; + } + + if ( curLoop === result ) { + result = []; + } + + if ( Expr.preFilter[ type ] ) { + match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter ); + + if ( !match ) { + anyFound = found = true; + } else if ( match === true ) { + continue; + } + } + + if ( match ) { + for ( var i = 0; (item = curLoop[i]) != null; i++ ) { + if ( item ) { + found = filter( item, match, i, curLoop ); + var pass = not ^ !!found; + + if ( inplace && found != null ) { + if ( pass ) { + anyFound = true; + } else { + curLoop[i] = false; + } + } else if ( pass ) { + result.push( item ); + anyFound = true; + } + } + } + } + + if ( found !== undefined ) { + if ( !inplace ) { + curLoop = result; + } + + expr = expr.replace( Expr.match[ type ], "" ); + + if ( !anyFound ) { + return []; + } + + break; + } + } + } + + // Improper expression + if ( expr === old ) { + if ( anyFound == null ) { + Sizzle.error( expr ); + } else { + break; + } + } + + old = expr; + } + + return curLoop; +}; + +Sizzle.error = function( msg ) { + throw "Syntax error, unrecognized expression: " + msg; +}; + +var Expr = Sizzle.selectors = { + order: [ "ID", "NAME", "TAG" ], + match: { + ID: /#((?:[\w\u00c0-\uFFFF-]|\\.)+)/, + CLASS: /\.((?:[\w\u00c0-\uFFFF-]|\\.)+)/, + NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF-]|\\.)+)['"]*\]/, + ATTR: /\[\s*((?:[\w\u00c0-\uFFFF-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/, + TAG: /^((?:[\w\u00c0-\uFFFF\*-]|\\.)+)/, + CHILD: /:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/, + POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/, + PSEUDO: /:((?:[\w\u00c0-\uFFFF-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/ + }, + leftMatch: {}, + attrMap: { + "class": "className", + "for": "htmlFor" + }, + attrHandle: { + href: function(elem){ + return elem.getAttribute("href"); + } + }, + relative: { + "+": function(checkSet, part){ + var isPartStr = typeof part === "string", + isTag = isPartStr && !/\W/.test(part), + isPartStrNotTag = isPartStr && !isTag; + + if ( isTag ) { + part = part.toLowerCase(); + } + + for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) { + if ( (elem = checkSet[i]) ) { + while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {} + + checkSet[i] = isPartStrNotTag || elem && elem.nodeName.toLowerCase() === part ? + elem || false : + elem === part; + } + } + + if ( isPartStrNotTag ) { + Sizzle.filter( part, checkSet, true ); + } + }, + ">": function(checkSet, part){ + var isPartStr = typeof part === "string"; + + if ( isPartStr && !/\W/.test(part) ) { + part = part.toLowerCase(); + + for ( var i = 0, l = checkSet.length; i < l; i++ ) { + var elem = checkSet[i]; + if ( elem ) { + var parent = elem.parentNode; + checkSet[i] = parent.nodeName.toLowerCase() === part ? parent : false; + } + } + } else { + for ( var i = 0, l = checkSet.length; i < l; i++ ) { + var elem = checkSet[i]; + if ( elem ) { + checkSet[i] = isPartStr ? + elem.parentNode : + elem.parentNode === part; + } + } + + if ( isPartStr ) { + Sizzle.filter( part, checkSet, true ); + } + } + }, + "": function(checkSet, part, isXML){ + var doneName = done++, checkFn = dirCheck; + + if ( typeof part === "string" && !/\W/.test(part) ) { + var nodeCheck = part = part.toLowerCase(); + checkFn = dirNodeCheck; + } + + checkFn("parentNode", part, doneName, checkSet, nodeCheck, isXML); + }, + "~": function(checkSet, part, isXML){ + var doneName = done++, checkFn = dirCheck; + + if ( typeof part === "string" && !/\W/.test(part) ) { + var nodeCheck = part = part.toLowerCase(); + checkFn = dirNodeCheck; + } + + checkFn("previousSibling", part, doneName, checkSet, nodeCheck, isXML); + } + }, + find: { + ID: function(match, context, isXML){ + if ( typeof context.getElementById !== "undefined" && !isXML ) { + var m = context.getElementById(match[1]); + return m ? [m] : []; + } + }, + NAME: function(match, context){ + if ( typeof context.getElementsByName !== "undefined" ) { + var ret = [], results = context.getElementsByName(match[1]); + + for ( var i = 0, l = results.length; i < l; i++ ) { + if ( results[i].getAttribute("name") === match[1] ) { + ret.push( results[i] ); + } + } + + return ret.length === 0 ? null : ret; + } + }, + TAG: function(match, context){ + return context.getElementsByTagName(match[1]); + } + }, + preFilter: { + CLASS: function(match, curLoop, inplace, result, not, isXML){ + match = " " + match[1].replace(/\\/g, "") + " "; + + if ( isXML ) { + return match; + } + + for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) { + if ( elem ) { + if ( not ^ (elem.className && (" " + elem.className + " ").replace(/[\t\n]/g, " ").indexOf(match) >= 0) ) { + if ( !inplace ) { + result.push( elem ); + } + } else if ( inplace ) { + curLoop[i] = false; + } + } + } + + return false; + }, + ID: function(match){ + return match[1].replace(/\\/g, ""); + }, + TAG: function(match, curLoop){ + return match[1].toLowerCase(); + }, + CHILD: function(match){ + if ( match[1] === "nth" ) { + // parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6' + var test = /(-?)(\d*)n((?:\+|-)?\d*)/.exec( + match[2] === "even" && "2n" || match[2] === "odd" && "2n+1" || + !/\D/.test( match[2] ) && "0n+" + match[2] || match[2]); + + // calculate the numbers (first)n+(last) including if they are negative + match[2] = (test[1] + (test[2] || 1)) - 0; + match[3] = test[3] - 0; + } + + // TODO: Move to normal caching system + match[0] = done++; + + return match; + }, + ATTR: function(match, curLoop, inplace, result, not, isXML){ + var name = match[1].replace(/\\/g, ""); + + if ( !isXML && Expr.attrMap[name] ) { + match[1] = Expr.attrMap[name]; + } + + if ( match[2] === "~=" ) { + match[4] = " " + match[4] + " "; + } + + return match; + }, + PSEUDO: function(match, curLoop, inplace, result, not){ + if ( match[1] === "not" ) { + // If we're dealing with a complex expression, or a simple one + if ( ( chunker.exec(match[3]) || "" ).length > 1 || /^\w/.test(match[3]) ) { + match[3] = Sizzle(match[3], null, null, curLoop); + } else { + var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not); + if ( !inplace ) { + result.push.apply( result, ret ); + } + return false; + } + } else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) { + return true; + } + + return match; + }, + POS: function(match){ + match.unshift( true ); + return match; + } + }, + filters: { + enabled: function(elem){ + return elem.disabled === false && elem.type !== "hidden"; + }, + disabled: function(elem){ + return elem.disabled === true; + }, + checked: function(elem){ + return elem.checked === true; + }, + selected: function(elem){ + // Accessing this property makes selected-by-default + // options in Safari work properly + elem.parentNode.selectedIndex; + return elem.selected === true; + }, + parent: function(elem){ + return !!elem.firstChild; + }, + empty: function(elem){ + return !elem.firstChild; + }, + has: function(elem, i, match){ + return !!Sizzle( match[3], elem ).length; + }, + header: function(elem){ + return /h\d/i.test( elem.nodeName ); + }, + text: function(elem){ + return "text" === elem.type; + }, + radio: function(elem){ + return "radio" === elem.type; + }, + checkbox: function(elem){ + return "checkbox" === elem.type; + }, + file: function(elem){ + return "file" === elem.type; + }, + password: function(elem){ + return "password" === elem.type; + }, + submit: function(elem){ + return "submit" === elem.type; + }, + image: function(elem){ + return "image" === elem.type; + }, + reset: function(elem){ + return "reset" === elem.type; + }, + button: function(elem){ + return "button" === elem.type || elem.nodeName.toLowerCase() === "button"; + }, + input: function(elem){ + return /input|select|textarea|button/i.test(elem.nodeName); + } + }, + setFilters: { + first: function(elem, i){ + return i === 0; + }, + last: function(elem, i, match, array){ + return i === array.length - 1; + }, + even: function(elem, i){ + return i % 2 === 0; + }, + odd: function(elem, i){ + return i % 2 === 1; + }, + lt: function(elem, i, match){ + return i < match[3] - 0; + }, + gt: function(elem, i, match){ + return i > match[3] - 0; + }, + nth: function(elem, i, match){ + return match[3] - 0 === i; + }, + eq: function(elem, i, match){ + return match[3] - 0 === i; + } + }, + filter: { + PSEUDO: function(elem, match, i, array){ + var name = match[1], filter = Expr.filters[ name ]; + + if ( filter ) { + return filter( elem, i, match, array ); + } else if ( name === "contains" ) { + return (elem.textContent || elem.innerText || getText([ elem ]) || "").indexOf(match[3]) >= 0; + } else if ( name === "not" ) { + var not = match[3]; + + for ( var i = 0, l = not.length; i < l; i++ ) { + if ( not[i] === elem ) { + return false; + } + } + + return true; + } else { + Sizzle.error( "Syntax error, unrecognized expression: " + name ); + } + }, + CHILD: function(elem, match){ + var type = match[1], node = elem; + switch (type) { + case 'only': + case 'first': + while ( (node = node.previousSibling) ) { + if ( node.nodeType === 1 ) { + return false; + } + } + if ( type === "first" ) { + return true; + } + node = elem; + case 'last': + while ( (node = node.nextSibling) ) { + if ( node.nodeType === 1 ) { + return false; + } + } + return true; + case 'nth': + var first = match[2], last = match[3]; + + if ( first === 1 && last === 0 ) { + return true; + } + + var doneName = match[0], + parent = elem.parentNode; + + if ( parent && (parent.sizcache !== doneName || !elem.nodeIndex) ) { + var count = 0; + for ( node = parent.firstChild; node; node = node.nextSibling ) { + if ( node.nodeType === 1 ) { + node.nodeIndex = ++count; + } + } + parent.sizcache = doneName; + } + + var diff = elem.nodeIndex - last; + if ( first === 0 ) { + return diff === 0; + } else { + return ( diff % first === 0 && diff / first >= 0 ); + } + } + }, + ID: function(elem, match){ + return elem.nodeType === 1 && elem.getAttribute("id") === match; + }, + TAG: function(elem, match){ + return (match === "*" && elem.nodeType === 1) || elem.nodeName.toLowerCase() === match; + }, + CLASS: function(elem, match){ + return (" " + (elem.className || elem.getAttribute("class")) + " ") + .indexOf( match ) > -1; + }, + ATTR: function(elem, match){ + var name = match[1], + result = Expr.attrHandle[ name ] ? + Expr.attrHandle[ name ]( elem ) : + elem[ name ] != null ? + elem[ name ] : + elem.getAttribute( name ), + value = result + "", + type = match[2], + check = match[4]; + + return result == null ? + type === "!=" : + type === "=" ? + value === check : + type === "*=" ? + value.indexOf(check) >= 0 : + type === "~=" ? + (" " + value + " ").indexOf(check) >= 0 : + !check ? + value && result !== false : + type === "!=" ? + value !== check : + type === "^=" ? + value.indexOf(check) === 0 : + type === "$=" ? + value.substr(value.length - check.length) === check : + type === "|=" ? + value === check || value.substr(0, check.length + 1) === check + "-" : + false; + }, + POS: function(elem, match, i, array){ + var name = match[2], filter = Expr.setFilters[ name ]; + + if ( filter ) { + return filter( elem, i, match, array ); + } + } + } +}; + +var origPOS = Expr.match.POS; + +for ( var type in Expr.match ) { + Expr.match[ type ] = new RegExp( Expr.match[ type ].source + /(?![^\[]*\])(?![^\(]*\))/.source ); + Expr.leftMatch[ type ] = new RegExp( /(^(?:.|\r|\n)*?)/.source + Expr.match[ type ].source.replace(/\\(\d+)/g, function(all, num){ + return "\\" + (num - 0 + 1); + })); +} + +var makeArray = function(array, results) { + array = Array.prototype.slice.call( array, 0 ); + + if ( results ) { + results.push.apply( results, array ); + return results; + } + + return array; +}; + +// Perform a simple check to determine if the browser is capable of +// converting a NodeList to an array using builtin methods. +// Also verifies that the returned array holds DOM nodes +// (which is not the case in the Blackberry browser) +try { + Array.prototype.slice.call( document.documentElement.childNodes, 0 )[0].nodeType; + +// Provide a fallback method if it does not work +} catch(e){ + makeArray = function(array, results) { + var ret = results || []; + + if ( toString.call(array) === "[object Array]" ) { + Array.prototype.push.apply( ret, array ); + } else { + if ( typeof array.length === "number" ) { + for ( var i = 0, l = array.length; i < l; i++ ) { + ret.push( array[i] ); + } + } else { + for ( var i = 0; array[i]; i++ ) { + ret.push( array[i] ); + } + } + } + + return ret; + }; +} + +var sortOrder; + +if ( document.documentElement.compareDocumentPosition ) { + sortOrder = function( a, b ) { + if ( !a.compareDocumentPosition || !b.compareDocumentPosition ) { + if ( a == b ) { + hasDuplicate = true; + } + return a.compareDocumentPosition ? -1 : 1; + } + + var ret = a.compareDocumentPosition(b) & 4 ? -1 : a === b ? 0 : 1; + if ( ret === 0 ) { + hasDuplicate = true; + } + return ret; + }; +} else if ( "sourceIndex" in document.documentElement ) { + sortOrder = function( a, b ) { + if ( !a.sourceIndex || !b.sourceIndex ) { + if ( a == b ) { + hasDuplicate = true; + } + return a.sourceIndex ? -1 : 1; + } + + var ret = a.sourceIndex - b.sourceIndex; + if ( ret === 0 ) { + hasDuplicate = true; + } + return ret; + }; +} else if ( document.createRange ) { + sortOrder = function( a, b ) { + if ( !a.ownerDocument || !b.ownerDocument ) { + if ( a == b ) { + hasDuplicate = true; + } + return a.ownerDocument ? -1 : 1; + } + + var aRange = a.ownerDocument.createRange(), bRange = b.ownerDocument.createRange(); + aRange.setStart(a, 0); + aRange.setEnd(a, 0); + bRange.setStart(b, 0); + bRange.setEnd(b, 0); + var ret = aRange.compareBoundaryPoints(Range.START_TO_END, bRange); + if ( ret === 0 ) { + hasDuplicate = true; + } + return ret; + }; +} + +// Utility function for retreiving the text value of an array of DOM nodes +function getText( elems ) { + var ret = "", elem; + + for ( var i = 0; elems[i]; i++ ) { + elem = elems[i]; + + // Get the text from text nodes and CDATA nodes + if ( elem.nodeType === 3 || elem.nodeType === 4 ) { + ret += elem.nodeValue; + + // Traverse everything else, except comment nodes + } else if ( elem.nodeType !== 8 ) { + ret += getText( elem.childNodes ); + } + } + + return ret; +} + +// Check to see if the browser returns elements by name when +// querying by getElementById (and provide a workaround) +(function(){ + // We're going to inject a fake input element with a specified name + var form = document.createElement("div"), + id = "script" + (new Date).getTime(); + form.innerHTML = ""; + + // Inject it into the root element, check its status, and remove it quickly + var root = document.documentElement; + root.insertBefore( form, root.firstChild ); + + // The workaround has to do additional checks after a getElementById + // Which slows things down for other browsers (hence the branching) + if ( document.getElementById( id ) ) { + Expr.find.ID = function(match, context, isXML){ + if ( typeof context.getElementById !== "undefined" && !isXML ) { + var m = context.getElementById(match[1]); + return m ? m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ? [m] : undefined : []; + } + }; + + Expr.filter.ID = function(elem, match){ + var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id"); + return elem.nodeType === 1 && node && node.nodeValue === match; + }; + } + + root.removeChild( form ); + root = form = null; // release memory in IE +})(); + +(function(){ + // Check to see if the browser returns only elements + // when doing getElementsByTagName("*") + + // Create a fake element + var div = document.createElement("div"); + div.appendChild( document.createComment("") ); + + // Make sure no comments are found + if ( div.getElementsByTagName("*").length > 0 ) { + Expr.find.TAG = function(match, context){ + var results = context.getElementsByTagName(match[1]); + + // Filter out possible comments + if ( match[1] === "*" ) { + var tmp = []; + + for ( var i = 0; results[i]; i++ ) { + if ( results[i].nodeType === 1 ) { + tmp.push( results[i] ); + } + } + + results = tmp; + } + + return results; + }; + } + + // Check to see if an attribute returns normalized href attributes + div.innerHTML = ""; + if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" && + div.firstChild.getAttribute("href") !== "#" ) { + Expr.attrHandle.href = function(elem){ + return elem.getAttribute("href", 2); + }; + } + + div = null; // release memory in IE +})(); + +if ( document.querySelectorAll ) { + (function(){ + var oldSizzle = Sizzle, div = document.createElement("div"); + div.innerHTML = "

      "; + + // Safari can't handle uppercase or unicode characters when + // in quirks mode. + if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) { + return; + } + + Sizzle = function(query, context, extra, seed){ + context = context || document; + + // Only use querySelectorAll on non-XML documents + // (ID selectors don't work in non-HTML documents) + if ( !seed && context.nodeType === 9 && !isXML(context) ) { + try { + return makeArray( context.querySelectorAll(query), extra ); + } catch(e){} + } + + return oldSizzle(query, context, extra, seed); + }; + + for ( var prop in oldSizzle ) { + Sizzle[ prop ] = oldSizzle[ prop ]; + } + + div = null; // release memory in IE + })(); +} + +(function(){ + var div = document.createElement("div"); + + div.innerHTML = "
      "; + + // Opera can't find a second classname (in 9.6) + // Also, make sure that getElementsByClassName actually exists + if ( !div.getElementsByClassName || div.getElementsByClassName("e").length === 0 ) { + return; + } + + // Safari caches class attributes, doesn't catch changes (in 3.2) + div.lastChild.className = "e"; + + if ( div.getElementsByClassName("e").length === 1 ) { + return; + } + + Expr.order.splice(1, 0, "CLASS"); + Expr.find.CLASS = function(match, context, isXML) { + if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) { + return context.getElementsByClassName(match[1]); + } + }; + + div = null; // release memory in IE +})(); + +function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) { + for ( var i = 0, l = checkSet.length; i < l; i++ ) { + var elem = checkSet[i]; + if ( elem ) { + elem = elem[dir]; + var match = false; + + while ( elem ) { + if ( elem.sizcache === doneName ) { + match = checkSet[elem.sizset]; + break; + } + + if ( elem.nodeType === 1 && !isXML ){ + elem.sizcache = doneName; + elem.sizset = i; + } + + if ( elem.nodeName.toLowerCase() === cur ) { + match = elem; + break; + } + + elem = elem[dir]; + } + + checkSet[i] = match; + } + } +} + +function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) { + for ( var i = 0, l = checkSet.length; i < l; i++ ) { + var elem = checkSet[i]; + if ( elem ) { + elem = elem[dir]; + var match = false; + + while ( elem ) { + if ( elem.sizcache === doneName ) { + match = checkSet[elem.sizset]; + break; + } + + if ( elem.nodeType === 1 ) { + if ( !isXML ) { + elem.sizcache = doneName; + elem.sizset = i; + } + if ( typeof cur !== "string" ) { + if ( elem === cur ) { + match = true; + break; + } + + } else if ( Sizzle.filter( cur, [elem] ).length > 0 ) { + match = elem; + break; + } + } + + elem = elem[dir]; + } + + checkSet[i] = match; + } + } +} + +var contains = document.compareDocumentPosition ? function(a, b){ + return !!(a.compareDocumentPosition(b) & 16); +} : function(a, b){ + return a !== b && (a.contains ? a.contains(b) : true); +}; + +var isXML = function(elem){ + // documentElement is verified for cases where it doesn't yet exist + // (such as loading iframes in IE - #4833) + var documentElement = (elem ? elem.ownerDocument || elem : 0).documentElement; + return documentElement ? documentElement.nodeName !== "HTML" : false; +}; + +var posProcess = function(selector, context){ + var tmpSet = [], later = "", match, + root = context.nodeType ? [context] : context; + + // Position selectors must be done after the filter + // And so must :not(positional) so we move all PSEUDOs to the end + while ( (match = Expr.match.PSEUDO.exec( selector )) ) { + later += match[0]; + selector = selector.replace( Expr.match.PSEUDO, "" ); + } + + selector = Expr.relative[selector] ? selector + "*" : selector; + + for ( var i = 0, l = root.length; i < l; i++ ) { + Sizzle( selector, root[i], tmpSet ); + } + + return Sizzle.filter( later, tmpSet ); +}; + +// EXPOSE +jQuery.find = Sizzle; +jQuery.expr = Sizzle.selectors; +jQuery.expr[":"] = jQuery.expr.filters; +jQuery.unique = Sizzle.uniqueSort; +jQuery.text = getText; +jQuery.isXMLDoc = isXML; +jQuery.contains = contains; + +return; + +window.Sizzle = Sizzle; + +})(); +var runtil = /Until$/, + rparentsprev = /^(?:parents|prevUntil|prevAll)/, + // Note: This RegExp should be improved, or likely pulled from Sizzle + rmultiselector = /,/, + slice = Array.prototype.slice; + +// Implement the identical functionality for filter and not +var winnow = function( elements, qualifier, keep ) { + if ( jQuery.isFunction( qualifier ) ) { + return jQuery.grep(elements, function( elem, i ) { + return !!qualifier.call( elem, i, elem ) === keep; + }); + + } else if ( qualifier.nodeType ) { + return jQuery.grep(elements, function( elem, i ) { + return (elem === qualifier) === keep; + }); + + } else if ( typeof qualifier === "string" ) { + var filtered = jQuery.grep(elements, function( elem ) { + return elem.nodeType === 1; + }); + + if ( isSimple.test( qualifier ) ) { + return jQuery.filter(qualifier, filtered, !keep); + } else { + qualifier = jQuery.filter( qualifier, filtered ); + } + } + + return jQuery.grep(elements, function( elem, i ) { + return (jQuery.inArray( elem, qualifier ) >= 0) === keep; + }); +}; + +jQuery.fn.extend({ + find: function( selector ) { + var ret = this.pushStack( "", "find", selector ), length = 0; + + for ( var i = 0, l = this.length; i < l; i++ ) { + length = ret.length; + jQuery.find( selector, this[i], ret ); + + if ( i > 0 ) { + // Make sure that the results are unique + for ( var n = length; n < ret.length; n++ ) { + for ( var r = 0; r < length; r++ ) { + if ( ret[r] === ret[n] ) { + ret.splice(n--, 1); + break; + } + } + } + } + } + + return ret; + }, + + has: function( target ) { + var targets = jQuery( target ); + return this.filter(function() { + for ( var i = 0, l = targets.length; i < l; i++ ) { + if ( jQuery.contains( this, targets[i] ) ) { + return true; + } + } + }); + }, + + not: function( selector ) { + return this.pushStack( winnow(this, selector, false), "not", selector); + }, + + filter: function( selector ) { + return this.pushStack( winnow(this, selector, true), "filter", selector ); + }, + + is: function( selector ) { + return !!selector && jQuery.filter( selector, this ).length > 0; + }, + + closest: function( selectors, context ) { + if ( jQuery.isArray( selectors ) ) { + var ret = [], cur = this[0], match, matches = {}, selector; + + if ( cur && selectors.length ) { + for ( var i = 0, l = selectors.length; i < l; i++ ) { + selector = selectors[i]; + + if ( !matches[selector] ) { + matches[selector] = jQuery.expr.match.POS.test( selector ) ? + jQuery( selector, context || this.context ) : + selector; + } + } + + while ( cur && cur.ownerDocument && cur !== context ) { + for ( selector in matches ) { + match = matches[selector]; + + if ( match.jquery ? match.index(cur) > -1 : jQuery(cur).is(match) ) { + ret.push({ selector: selector, elem: cur }); + delete matches[selector]; + } + } + cur = cur.parentNode; + } + } + + return ret; + } + + var pos = jQuery.expr.match.POS.test( selectors ) ? + jQuery( selectors, context || this.context ) : null; + + return this.map(function( i, cur ) { + while ( cur && cur.ownerDocument && cur !== context ) { + if ( pos ? pos.index(cur) > -1 : jQuery(cur).is(selectors) ) { + return cur; + } + cur = cur.parentNode; + } + return null; + }); + }, + + // Determine the position of an element within + // the matched set of elements + index: function( elem ) { + if ( !elem || typeof elem === "string" ) { + return jQuery.inArray( this[0], + // If it receives a string, the selector is used + // If it receives nothing, the siblings are used + elem ? jQuery( elem ) : this.parent().children() ); + } + // Locate the position of the desired element + return jQuery.inArray( + // If it receives a jQuery object, the first element is used + elem.jquery ? elem[0] : elem, this ); + }, + + add: function( selector, context ) { + var set = typeof selector === "string" ? + jQuery( selector, context || this.context ) : + jQuery.makeArray( selector ), + all = jQuery.merge( this.get(), set ); + + return this.pushStack( isDisconnected( set[0] ) || isDisconnected( all[0] ) ? + all : + jQuery.unique( all ) ); + }, + + andSelf: function() { + return this.add( this.prevObject ); + } +}); + +// A painfully simple check to see if an element is disconnected +// from a document (should be improved, where feasible). +function isDisconnected( node ) { + return !node || !node.parentNode || node.parentNode.nodeType === 11; +} + +jQuery.each({ + parent: function( elem ) { + var parent = elem.parentNode; + return parent && parent.nodeType !== 11 ? parent : null; + }, + parents: function( elem ) { + return jQuery.dir( elem, "parentNode" ); + }, + parentsUntil: function( elem, i, until ) { + return jQuery.dir( elem, "parentNode", until ); + }, + next: function( elem ) { + return jQuery.nth( elem, 2, "nextSibling" ); + }, + prev: function( elem ) { + return jQuery.nth( elem, 2, "previousSibling" ); + }, + nextAll: function( elem ) { + return jQuery.dir( elem, "nextSibling" ); + }, + prevAll: function( elem ) { + return jQuery.dir( elem, "previousSibling" ); + }, + nextUntil: function( elem, i, until ) { + return jQuery.dir( elem, "nextSibling", until ); + }, + prevUntil: function( elem, i, until ) { + return jQuery.dir( elem, "previousSibling", until ); + }, + siblings: function( elem ) { + return jQuery.sibling( elem.parentNode.firstChild, elem ); + }, + children: function( elem ) { + return jQuery.sibling( elem.firstChild ); + }, + contents: function( elem ) { + return jQuery.nodeName( elem, "iframe" ) ? + elem.contentDocument || elem.contentWindow.document : + jQuery.makeArray( elem.childNodes ); + } +}, function( name, fn ) { + jQuery.fn[ name ] = function( until, selector ) { + var ret = jQuery.map( this, fn, until ); + + if ( !runtil.test( name ) ) { + selector = until; + } + + if ( selector && typeof selector === "string" ) { + ret = jQuery.filter( selector, ret ); + } + + ret = this.length > 1 ? jQuery.unique( ret ) : ret; + + if ( (this.length > 1 || rmultiselector.test( selector )) && rparentsprev.test( name ) ) { + ret = ret.reverse(); + } + + return this.pushStack( ret, name, slice.call(arguments).join(",") ); + }; +}); + +jQuery.extend({ + filter: function( expr, elems, not ) { + if ( not ) { + expr = ":not(" + expr + ")"; + } + + return jQuery.find.matches(expr, elems); + }, + + dir: function( elem, dir, until ) { + var matched = [], cur = elem[dir]; + while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) { + if ( cur.nodeType === 1 ) { + matched.push( cur ); + } + cur = cur[dir]; + } + return matched; + }, + + nth: function( cur, result, dir, elem ) { + result = result || 1; + var num = 0; + + for ( ; cur; cur = cur[dir] ) { + if ( cur.nodeType === 1 && ++num === result ) { + break; + } + } + + return cur; + }, + + sibling: function( n, elem ) { + var r = []; + + for ( ; n; n = n.nextSibling ) { + if ( n.nodeType === 1 && n !== elem ) { + r.push( n ); + } + } + + return r; + } +}); +var rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g, + rleadingWhitespace = /^\s+/, + rxhtmlTag = /(<([\w:]+)[^>]*?)\/>/g, + rselfClosing = /^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i, + rtagName = /<([\w:]+)/, + rtbody = /"; + }, + wrapMap = { + option: [ 1, "" ], + legend: [ 1, "
      ", "
      " ], + thead: [ 1, "", "
      " ], + tr: [ 2, "", "
      " ], + td: [ 3, "", "
      " ], + col: [ 2, "", "
      " ], + area: [ 1, "", "" ], + _default: [ 0, "", "" ] + }; + +wrapMap.optgroup = wrapMap.option; +wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; +wrapMap.th = wrapMap.td; + +// IE can't serialize and + + + + + + + + + + + + +
      +
      + +
      + + + +
      + + {% block content %}{% endblock %} + +
      +
      + + + + + + + {% block scripts %}{% endblock %} + + + diff --git a/courtside/templates/base_map.html b/courtside/templates/base_map.html new file mode 100644 index 0000000..0d51ae6 --- /dev/null +++ b/courtside/templates/base_map.html @@ -0,0 +1,225 @@ +{% extends "base.html" %} + +{% block scripts %} + + + + + +{% endblock %} \ No newline at end of file diff --git a/courtside/templates/create.html b/courtside/templates/create.html new file mode 100644 index 0000000..998a740 --- /dev/null +++ b/courtside/templates/create.html @@ -0,0 +1,93 @@ +{% extends "base.html" %} + +{% block title %}Create New Game{% endblock %} + +{% block stylesheets %} + + +{% endblock %} + +{% block nav %} + +{% endblock %} + +{% block content %} +
      +
      + +
      {% csrf_token %} + + {{ form.as_table }} +
      + + + +
      + +
      +{% endblock %} + +{% block scripts %} + + + + + + +{% endblock %} \ No newline at end of file diff --git a/courtside/templates/email_signup.html b/courtside/templates/email_signup.html new file mode 100644 index 0000000..c80344c --- /dev/null +++ b/courtside/templates/email_signup.html @@ -0,0 +1,17 @@ + + + + + +

      Hi {{ user }}!,

      + +

      You have just signed up for the experience of a lifetime. Do you have friends that can't commit to making it out to play ball? New to the city? Courtside can help with that and more.

      + +

      So get out there and get your game on!

      + + +Thanks, and we hope you enjoy using courtside.me + +

      - Courtside Team

      + + \ No newline at end of file diff --git a/courtside/templates/facebook_error.html b/courtside/templates/facebook_error.html new file mode 100644 index 0000000..0c56b7d --- /dev/null +++ b/courtside/templates/facebook_error.html @@ -0,0 +1,21 @@ +

      Sorry an error occured!

      + + + + + + + + + + + + + + +
      Error{{ error }}
      Reason{{ error_reason }}
      Description{{ error_description }}
      + +
      + +

      Try regsitering again?

      + Login with Facebook \ No newline at end of file diff --git a/courtside/templates/game.html b/courtside/templates/game.html new file mode 100644 index 0000000..6213256 --- /dev/null +++ b/courtside/templates/game.html @@ -0,0 +1,182 @@ +{% extends "base.html" %} +{% load comments %} + +{% block title %}{{game.sport}} game at {{game.start_date_and_time}} {{game.address}}{% endblock %} + +{% block nav %} + {% if current_player %} + + {% else %} + + {% endif %} +{% endblock %} + +{% block content %} +
      +
      + +
      +
      + +
      +

      Location

      +

      {{game.address}}

      +
      +
      +

      Date & Time

      +

      {{game.start_date_and_time}}

      +
      +
      +

      Capacity & Restrictions

      +
        +
      • Min # of players: {{ game.minimum_players}}
      • + {% if game.restrictions != "" %} +
      • {{ game.restrictions }}
      • + {% endif %} +
      +
      +
      + +
      +
      + {{game.sport}} + {% if owner == current_player %} + + {% else %} + {% if joined %} + + {% else %} + + {% endif%} + {% endif%} + +
      + {% if number_of_players > 1 %} +

      Players signed up ({{ number_of_players }} players)

      + {% else %} +

      Players signed up ({{ number_of_players }} player)

      + {% endif%} + +
        +
      • + {% for p in players %} +
      • + {% endfor %} +
      +
      +
      +

      Comments

      + + + + + + + + + + {% if user.is_authenticated %} + + +
        +
      • + {% get_comment_form for game as form %} +
        {% csrf_token %} + + {{ form.comment }} + {{ form.object_pk }} + {{ form.content_type }} + {{ form.content_object }} + {{ form.security_hash }} + + +
        + {{ form.honeypot }} +
        + {{ form.timestamp }} + + + +
      + {% else %} +
        +
      • + + + +
      • +
      + + {% endif %} +
        + + {% get_comment_list for game as comment_list %} + {% for comment in comment_list %} + +
      • +

        {{comment.comment }}

        +

        + {{comment.user_name}} + · {{comment.submit_date}} +

        +
      • + {% endfor %} +
      +
      +
      +
      +{% endblock %} + + + +{% block scripts %} + + +{% endblock %} \ No newline at end of file diff --git a/courtside/templates/game_email.html b/courtside/templates/game_email.html new file mode 100644 index 0000000..487b8bb --- /dev/null +++ b/courtside/templates/game_email.html @@ -0,0 +1,20 @@ + + + + + +

      Hi {{ user }}!,

      + +

      You have just signed up for the experience of a {{game.sport}} game at {{game.address}} which starts at {{game.start_date_and_time}}.

      + +

      Restrictions:

      +

      {{game.restrictions}}

      + +

      So get out there and get your game on!

      + + +Thanks, and we hope you enjoy using courtside.me + +

      - Courtside Team

      + + \ No newline at end of file diff --git a/courtside/templates/index.html b/courtside/templates/index.html new file mode 100644 index 0000000..9beff13 --- /dev/null +++ b/courtside/templates/index.html @@ -0,0 +1,119 @@ +{% extends "base_map.html" %} + +{% block content %} +
      +
      + +
      + +
      + + + +
      +
      + + + +
      + +
      +
      + +
      +
      This Week
      +

      Coming Soon!

      + +
      + +
      +
      Next Week
      +

      Coming Soon!

      + +
      +{% endblock %} \ No newline at end of file diff --git a/courtside/templates/login.html b/courtside/templates/login.html new file mode 100644 index 0000000..707984c --- /dev/null +++ b/courtside/templates/login.html @@ -0,0 +1,35 @@ +{% extends "base.html" %} + +{% block title %}Login{% endblock %} + +{% block nav %} + +{% endblock %} + +{% block content %} +
      +
      + +
      +

      Login to your Account

      + +
      +
      + {% csrf_token %} + + {{ form.as_table }} +
      + + +
      + + +
      +
      +{% endblock %} \ No newline at end of file diff --git a/courtside/templates/new_register.html b/courtside/templates/new_register.html new file mode 100644 index 0000000..b680d07 --- /dev/null +++ b/courtside/templates/new_register.html @@ -0,0 +1,23 @@ +{% extends "base.html" %} + +{% block title %}Sign Up{% endblock %} + +{% block nav %}{% endblock %} + +{% block content %} +
      +
      + +
      +

      Create your Account

      + +
      +
      + {% csrf_token %} + {{ form.as_p}} + +
      + +
      +
      +{% endblock %} \ No newline at end of file diff --git a/courtside/templates/profile.html b/courtside/templates/profile.html new file mode 100644 index 0000000..20fd2b0 --- /dev/null +++ b/courtside/templates/profile.html @@ -0,0 +1,103 @@ +{% extends "base.html" %} + +{% block title %}Profile{% endblock %} + +{% block nav %} + +{% endblock %} + +{% block content %} +
      +
      + +
      +
      + +
        +
      • Edit profile
      • + +
      • Username

      • +
      • {{ player.user.username }}
      • + +
      • Sports Interest

      • +
      • +
          + {% for s in sports %} +
        • {{s}}
        • + {% endfor %} +
        +
      • + +
      • Name

      • +
      • {{ player.user.first_name }} {{ player.user.last_name }}
      • + +
      • Email

      • +
      • {{ player.user.email }}
      • + + {% if player.gender != 'Q' %} +
      • Gender
      • + {% if player.gender == 'M' %} +
      • Male
      • + {% endif %} + {% if player.gender == 'F' %} +
      • Female
      • + {% endif %} + {% endif %} +
      + +
      + +
      + +

      Hello {{ player.user.first_name }}!

      + +
      +
      Games I've Joined
      + + {% if not games %} +

      Uh oh! You haven't joined any games yet. Well, what are you waitin' for? Search for Games in your area.

      + {% else %} +
        + {% for g in games %} +
      • + {{g.sport}} +

        {{g.start_date_and_time}} at {{ g.address }}

        +
      • + {% endfor %} +
      + {% endif %} +
      + +
      +
      More Upcoming Games
      + +

      Coming Soon!

      + + +
      + +
      +{% endblock %} \ No newline at end of file diff --git a/courtside/templates/profile_edit.html b/courtside/templates/profile_edit.html new file mode 100644 index 0000000..a8cc2b0 --- /dev/null +++ b/courtside/templates/profile_edit.html @@ -0,0 +1,32 @@ +{% extends "base.html" %} + +{% block title %}Edit Profile{% endblock %} + +{% block nav %} + +{% endblock %} + +{% block content %} +
      +
      + +
      +

      Edit Account Details

      + +
      +
      + + {% csrf_token %} + {{ form.as_p }} + + +
      + +
      +
      +{% endblock %} \ No newline at end of file diff --git a/courtside/templates/register.html b/courtside/templates/register.html new file mode 100644 index 0000000..06d03a3 --- /dev/null +++ b/courtside/templates/register.html @@ -0,0 +1,23 @@ +{% extends "base.html" %} + +{% block title %}Sign Up{% endblock %} + +{% block nav %}{% endblock %} + +{% block content %} +
      +
      + +
      +

      Create your Account

      + +
      +
      + {% csrf_token %} + {{ form.as_p}} + +
      + +
      +
      +{% endblock %} \ No newline at end of file diff --git a/courtside/templates/search.html b/courtside/templates/search.html new file mode 100644 index 0000000..0e49fe9 --- /dev/null +++ b/courtside/templates/search.html @@ -0,0 +1,260 @@ +{% extends "base.html" %} + +{% block title %}Search Games{% endblock %} + +{% block stylesheets %} + + +{% endblock %} + +{% block nav %} + +{% endblock %} + +{% block content %} +
      +
      + +
      + + +
      +
      Search Results
      +
        +
      +
      +{% endblock %} + +{% block scripts %} + + + + + + +{% endblock %} \ No newline at end of file diff --git a/courtside/urls.py b/courtside/urls.py new file mode 100644 index 0000000..444e246 --- /dev/null +++ b/courtside/urls.py @@ -0,0 +1,64 @@ +from django.conf.urls.defaults import patterns, include, url +from django.conf import settings +from django.contrib import admin +from tastypie.api import Api + +from game.api import (GameResource, UserResource, PlayerResource, +SportResource) + +v1_api = Api(api_name='v1') +v1_api.register(GameResource()) +v1_api.register(UserResource()) +v1_api.register(PlayerResource()) +v1_api.register(SportResource()) + + +admin.autodiscover() + +urlpatterns = patterns('', + # Examples: + # url(r'^$', 'courtside.views.home', name='home'), + url(r'^about/', 'game.views.about', name='about'), + + url(r'^$', 'game.views.home', name='home'), + + url(r'^admin/doc/', include('django.contrib.admindocs.urls')), + url(r'^admin/', include(admin.site.urls)), + + #regular signup + url(r'^login/signup/', 'register.views.new_register', name='regular_signup'), + + #login complete + url(r'^login/complete/', 'register.views.complete_sign_up'), + + #twitter stuff + url(r'^login/twitter/', 'register.views.begin_twitter_oauth', name='twitter_oauth'), + url(r'^twitter/callback/', 'register.views.twitter_callback'), + + #edit profile + url(r'^profile/edit/', 'register.views.profile_edit'), + + #facebook stuff + url(r'^login/facebook/', 'register.views.begin_facebook_oauth', name='facebook_oauth'), + url(r'^facebook/callback/', 'register.views.facebook_callback'), + + url(r'^logout/', 'register.views.logout_bro', name='logout'), + url(r'^login/', 'register.views.login_bro', name='logout'), + + + url(r'^create/', 'game.views.create', name='create'), + url(r'^search/', 'game.views.search', name='search'), + url(r'^game/(?P\d+)/$', 'game.views.game', name='game'), + url(r'^join/game/(?P\d+)/$', 'game.views.join', name='join'), + url(r'^leave/game/(?P\d+)/$', 'game.views.leave', name='leave'), + url(r'^delete/game/(?P\d+)/$', 'game.views.delete', name='delete'), + + # comments application + (r'^comments/', include('django.contrib.comments.urls')), + + #api endpoints + (r'^api/', include(v1_api.urls)), + +) + + diff --git a/epio.ini b/epio.ini new file mode 100644 index 0000000..2dd5f9b --- /dev/null +++ b/epio.ini @@ -0,0 +1,46 @@ +# This is an example epio.ini file. +# We suggest you edit it to fit your application's needs. +# Documentation for the options is available at www.ep.io/docs/epioini/ + +[wsgi] + +# Location of your requirements file +requirements = requirements.txt + +[services] +postgres = true + +[checkout] +# By default your code is put in a directory called 'app'. +# You can change that here. +directory_name = courtside + + +[env] +# Set any additional environment variables here. For example: +IN_PRODUCTION = true + + +[symlinks] +# Any symlinks you'd like to add. As an example, link 'config.py' to 'configs/epio.py' +# config.py = configs/epio.py + + +[celery] +djcelery = true +base = . + + +[django] +# # Path to your project root, relative to this directory. +base = courtside/ +append_settings = true + + +[static] +/static/admin = ../shortcuts/django-admin-media/ +/static = courtside/static + +[env] +# # Use a different settings module for ep.io (i.e. with DEBUG=False) +DJANGO_SETTINGS_MODULE = production_settings diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..c97c6fa --- /dev/null +++ b/requirements.txt @@ -0,0 +1,25 @@ +Django==1.3 +Fabric==1.2.2 +South==0.7.3 +amqplib==1.0.0 +anyjson==0.3.1 +celery==2.3.1 +django-celery==2.3.3 +django-debug-toolbar==0.8.5 +django-picklefield==0.1.9 +django-tastypie==0.9.9 +epio==0.2.8 +httplib2==0.6.0 +kombu==1.3.0 +mimeparse==0.1.3 +oauth2==1.5.170 +ordereddict==1.1 +paramiko==1.7.7.1 +pycrypto==2.3 +pyparsing==1.5.6 +python-dateutil==1.5 +python-digest==1.7 +simplejson==2.1.6 +twython==1.4.2 +wsgiref==0.1.2 +yolk==0.4.1 From 378fcbc97cd0c144adeb8c9243182d33d1cf95dc Mon Sep 17 00:00:00 2001 From: Daniel Nill Date: Fri, 6 Jan 2012 13:24:37 -0600 Subject: [PATCH 2/5] just a quick grammatical correction. --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index fd71125..f0e28aa 100644 --- a/README.rst +++ b/README.rst @@ -2,7 +2,7 @@ Courtside: pick up sports app. ================================================== -Make games plans and let all your friends know about it. +Make game plans and let all your friends know about it. ============ Installation From bf3038ad78615895abb83ccf3f08c2ae5b8dc367 Mon Sep 17 00:00:00 2001 From: Mahdi Yusuf Date: Fri, 6 Jan 2012 15:19:21 -0500 Subject: [PATCH 3/5] Update courtside/keys/keys.py --- courtside/keys/keys.py | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/courtside/keys/keys.py b/courtside/keys/keys.py index aca4059..3856ca2 100644 --- a/courtside/keys/keys.py +++ b/courtside/keys/keys.py @@ -10,16 +10,4 @@ #twitter information CONSUMER_KEY = 'WSKcN7DBwH88GkZc2wT24g' - CONSUMER_SECRET = 'VF1eDbszUthnUrMy3693dU2iSWCK4qQBfvmreCXdhGU' - -else: - #facebook information - FACEBOOK_APP_ID = '202475996473036' - FACEBOOK_API_KEY = '202475996473036' - FACEBOOK_APP_SECRET = 'd379eb66ef57dca6714b81c8a4afd23f' - - #twitter information - CONSUMER_KEY = '8S4oIhhl7ap5lboUk6N8w' - CONSUMER_SECRET = '8rEgNAbwXXecrPweEPyaT5Oproxwj31ZAAb0qvgAuY' - -SUPPORT_PASSWORD = 'aew7Seey' \ No newline at end of file + CONSUMER_SECRET = 'VF1eDbszUthnUrMy3693dU2iSWCK4qQBfvmreCXdhGU' \ No newline at end of file From 903ca648c704b6affaa5ac1a373cfd9bab07089c Mon Sep 17 00:00:00 2001 From: Mahdi Yusuf Date: Fri, 6 Jan 2012 15:28:55 -0500 Subject: [PATCH 4/5] updating for keys info. --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index f0e28aa..c6b9c68 100644 --- a/README.rst +++ b/README.rst @@ -14,7 +14,7 @@ Installation $ pip install -r requirements -- You will need to create a keys file in the register app for the twitter and fb app keys +- You will need to create a keys file in keys module for the twitter and fb app keys, ones there are old and note used. .. image:: https://s3.amazonaws.com/screenshots.angel.co/ee/29287/ad7528fee77bb37dcbb4bea439dc5bae-original.png From 1ca26459aebd5a7bebe15bcc594cfd1dfb63eebe Mon Sep 17 00:00:00 2001 From: Mahdi Yusuf Date: Fri, 6 Jan 2012 15:37:50 -0500 Subject: [PATCH 5/5] adding .txt to requirements file. --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index c6b9c68..db7bb23 100644 --- a/README.rst +++ b/README.rst @@ -12,7 +12,7 @@ Installation - To install requirements:: - $ pip install -r requirements + $ pip install -r requirements.txt - You will need to create a keys file in keys module for the twitter and fb app keys, ones there are old and note used.