Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Convert owner and team member project form fields to autocomplete.

add django-selectable
Fix bug 746387.
  • Loading branch information...
commit 1aa8411c22dee7fb24190f85c3ba8ecba20621c2 1 parent 4702110
@pmclanahan pmclanahan authored
Showing with 3,711 additions and 15 deletions.
  1. +5 −0 apps/projects/forms.py
  2. +9 −0 apps/projects/templates/projects/edit.html
  3. +7 −7 apps/projects/tests.py
  4. +28 −0 apps/users/lookups.py
  5. BIN  media/css/jq-ui-smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png
  6. BIN  media/css/jq-ui-smoothness/images/ui-bg_flat_75_ffffff_40x100.png
  7. BIN  media/css/jq-ui-smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png
  8. BIN  media/css/jq-ui-smoothness/images/ui-bg_glass_65_ffffff_1x400.png
  9. BIN  media/css/jq-ui-smoothness/images/ui-bg_glass_75_dadada_1x400.png
  10. BIN  media/css/jq-ui-smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png
  11. BIN  media/css/jq-ui-smoothness/images/ui-bg_glass_95_fef1ec_1x400.png
  12. BIN  media/css/jq-ui-smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png
  13. BIN  media/css/jq-ui-smoothness/images/ui-icons_222222_256x240.png
  14. BIN  media/css/jq-ui-smoothness/images/ui-icons_2e83ff_256x240.png
  15. BIN  media/css/jq-ui-smoothness/images/ui-icons_454545_256x240.png
  16. BIN  media/css/jq-ui-smoothness/images/ui-icons_888888_256x240.png
  17. BIN  media/css/jq-ui-smoothness/images/ui-icons_cd0a0a_256x240.png
  18. +564 −0 media/css/jq-ui-smoothness/jquery-ui-1.8.19.custom.css
  19. +13 −0 media/css/main.less
  20. +125 −0 media/js/libs/jquery-ui-1.8.19.custom.min.js
  21. +37 −0 media/selectable/css/dj.selectable.css
  22. +325 −0 media/selectable/js/jquery.dj.selectable.js
  23. +1 −0  requirements/prod.txt
  24. +12 −1 settings.py
  25. +1 −7 urls.py
  26. +84 −0 vendor-local/lib/python/django_selectable-0.4.1-py2.7.egg-info/PKG-INFO
  27. +44 −0 vendor-local/lib/python/django_selectable-0.4.1-py2.7.egg-info/SOURCES.txt
  28. +1 −0  vendor-local/lib/python/django_selectable-0.4.1-py2.7.egg-info/dependency_links.txt
  29. +64 −0 vendor-local/lib/python/django_selectable-0.4.1-py2.7.egg-info/installed-files.txt
  30. +1 −0  vendor-local/lib/python/django_selectable-0.4.1-py2.7.egg-info/not-zip-safe
  31. +2 −0  vendor-local/lib/python/django_selectable-0.4.1-py2.7.egg-info/top_level.txt
  32. 0  vendor-local/lib/python/example/core/__init__.py
  33. +53 −0 vendor-local/lib/python/example/core/admin.py
  34. +91 −0 vendor-local/lib/python/example/core/forms.py
  35. +39 −0 vendor-local/lib/python/example/core/lookups.py
  36. +26 −0 vendor-local/lib/python/example/core/models.py
  37. +23 −0 vendor-local/lib/python/example/core/tests.py
  38. +8 −0 vendor-local/lib/python/example/core/urls.py
  39. +43 −0 vendor-local/lib/python/example/core/views.py
  40. +24 −0 vendor-local/lib/python/selectable/__init__.py
  41. +138 −0 vendor-local/lib/python/selectable/base.py
  42. +10 −0 vendor-local/lib/python/selectable/exceptions.py
  43. +3 −0  vendor-local/lib/python/selectable/forms/__init__.py
  44. +19 −0 vendor-local/lib/python/selectable/forms/base.py
  45. +92 −0 vendor-local/lib/python/selectable/forms/fields.py
  46. +237 −0 vendor-local/lib/python/selectable/forms/widgets.py
  47. +3 −0  vendor-local/lib/python/selectable/models.py
  48. +69 −0 vendor-local/lib/python/selectable/registry.py
  49. +37 −0 vendor-local/lib/python/selectable/static/selectable/css/dj.selectable.css
  50. +325 −0 vendor-local/lib/python/selectable/static/selectable/js/jquery.dj.selectable.js
  51. +44 −0 vendor-local/lib/python/selectable/tests/__init__.py
  52. +121 −0 vendor-local/lib/python/selectable/tests/base.py
  53. +122 −0 vendor-local/lib/python/selectable/tests/fields.py
  54. +86 −0 vendor-local/lib/python/selectable/tests/forms.py
  55. +220 −0 vendor-local/lib/python/selectable/tests/functests.py
  56. +45 −0 vendor-local/lib/python/selectable/tests/runtests.py
  57. +8 −0 vendor-local/lib/python/selectable/tests/urls.py
  58. +97 −0 vendor-local/lib/python/selectable/tests/views.py
  59. +379 −0 vendor-local/lib/python/selectable/tests/widgets.py
  60. +10 −0 vendor-local/lib/python/selectable/urls.py
  61. +16 −0 vendor-local/lib/python/selectable/views.py
View
5 apps/projects/forms.py
@@ -2,10 +2,15 @@
from django import forms
+from selectable.forms import AutoCompleteSelectMultipleField
+
from .models import Project, Link
+from users.lookups import ProfileLookup
class ProjectForm(forms.ModelForm):
+ owners = AutoCompleteSelectMultipleField(ProfileLookup)
+ team_members = AutoCompleteSelectMultipleField(ProfileLookup)
class Meta:
model = Project
View
9 apps/projects/templates/projects/edit.html
@@ -8,6 +8,15 @@
{% block page_id %}project_edit{% endblock %}
{% block section_class %}projects{% endblock %}
+{% block extrahead %}
+ {{ css('selectable') }}
+ {{ form.media.css }}
+{% endblock %}
+
+{% block js %}
+ {{ js('selectable') }}
+{% endblock %}
+
{% block breadcrumbs -%}
{{ breadcrumbs(
(url('projects_all'), _('Projects')),
View
14 apps/projects/tests.py
@@ -163,8 +163,8 @@ def test_owner_can_update_project(self):
'description': 'All The Dude ever wanted... was his rug back.',
'long_description': new_desc,
'topics': [self.topic.id],
- 'team_members': [self.profile.pk],
- 'owners': [self.owner_profile.pk],
+ 'team_members_1': [self.profile.pk],
+ 'owners_1': [self.owner_profile.pk],
})
proj = Project.objects.get(pk=self.project.pk)
self.assertEqual(proj.name, new_name)
@@ -186,8 +186,8 @@ def test_updating_project_members(self):
'description': self.project.description,
'long_description': self.project.long_description,
'topics': [self.topic.id],
- 'team_members': [self.profile.pk, self.owner_profile.pk],
- 'owners': [self.owner_profile.pk],
+ 'team_members_1': [self.profile.pk, self.owner_profile.pk],
+ 'owners_1': [self.owner_profile.pk],
})
self.assertTrue(self.owner_profile in self.project.team_members.all())
self.assertTrue(self.profile in self.project.team_members.all())
@@ -201,7 +201,7 @@ def test_owner_cannot_inject_xss(self):
self.client.post('/en-US' + self.project_xss.get_edit_url(), {
'topics': [self.topic.id],
'team_members': [self.profile.pk],
- 'owners': [self.owner_profile.pk],
+ 'owners_1': [self.owner_profile.pk],
})
proj = Project.objects.get(pk=self.project_xss.pk)
self.assertEqual(proj.long_description, "alert('i am evil');")
@@ -221,8 +221,8 @@ def test_non_owner_cannot_update_project(self):
'description': 'All The Dude ever wanted... was his rug back.',
'long_description': new_desc,
'topics': [self.topic.id],
- 'team_members': [self.profile.pk],
- 'owners': [self.owner_profile.pk],
+ 'team_members_1': [self.profile.pk],
+ 'owners_1': [self.owner_profile.pk],
})
proj = Project.objects.get(pk=self.project.pk)
self.assertEqual(proj.name, self.project.name)
View
28 apps/users/lookups.py
@@ -0,0 +1,28 @@
+from selectable.base import ModelLookup
+from selectable.registry import registry
+
+from users.models import Profile
+
+
+class ProfileLookup(ModelLookup):
+ model = Profile
+ search_fields = (
+ 'name__icontains',
+ 'user__email__icontains',
+ )
+
+ def get_item_value(self, item):
+ """Display for currently selected item"""
+ return item.display_name
+
+ def get_item_label(self, item):
+ """Display for choice listings"""
+ return item.display_name
+
+ def get_queryset(self):
+ qs = super(ProfileLookup, self).get_queryset()
+ qs.order_by('name')
+ return qs
+
+
+registry.register(ProfileLookup)
View
BIN  media/css/jq-ui-smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  media/css/jq-ui-smoothness/images/ui-bg_flat_75_ffffff_40x100.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  media/css/jq-ui-smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  media/css/jq-ui-smoothness/images/ui-bg_glass_65_ffffff_1x400.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  media/css/jq-ui-smoothness/images/ui-bg_glass_75_dadada_1x400.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  media/css/jq-ui-smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  media/css/jq-ui-smoothness/images/ui-bg_glass_95_fef1ec_1x400.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  media/css/jq-ui-smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  media/css/jq-ui-smoothness/images/ui-icons_222222_256x240.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  media/css/jq-ui-smoothness/images/ui-icons_2e83ff_256x240.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  media/css/jq-ui-smoothness/images/ui-icons_454545_256x240.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  media/css/jq-ui-smoothness/images/ui-icons_888888_256x240.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  media/css/jq-ui-smoothness/images/ui-icons_cd0a0a_256x240.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
564 media/css/jq-ui-smoothness/jquery-ui-1.8.19.custom.css
@@ -0,0 +1,564 @@
+/*!
+ * jQuery UI CSS Framework 1.8.19
+ *
+ * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Theming/API
+ */
+
+/* Layout helpers
+----------------------------------*/
+.ui-helper-hidden { display: none; }
+.ui-helper-hidden-accessible { position: absolute !important; clip: rect(1px 1px 1px 1px); clip: rect(1px,1px,1px,1px); }
+.ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; }
+.ui-helper-clearfix:before, .ui-helper-clearfix:after { content: ""; display: table; }
+.ui-helper-clearfix:after { clear: both; }
+.ui-helper-clearfix { zoom: 1; }
+.ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); }
+
+
+/* Interaction Cues
+----------------------------------*/
+.ui-state-disabled { cursor: default !important; }
+
+
+/* Icons
+----------------------------------*/
+
+/* states and images */
+.ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; }
+
+
+/* Misc visuals
+----------------------------------*/
+
+/* Overlays */
+.ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
+
+
+/*!
+ * jQuery UI CSS Framework 1.8.19
+ *
+ * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Theming/API
+ *
+ * To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Verdana,Arial,sans-serif&fwDefault=normal&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=cccccc&bgTextureHeader=03_highlight_soft.png&bgImgOpacityHeader=75&borderColorHeader=aaaaaa&fcHeader=222222&iconColorHeader=222222&bgColorContent=ffffff&bgTextureContent=01_flat.png&bgImgOpacityContent=75&borderColorContent=aaaaaa&fcContent=222222&iconColorContent=222222&bgColorDefault=e6e6e6&bgTextureDefault=02_glass.png&bgImgOpacityDefault=75&borderColorDefault=d3d3d3&fcDefault=555555&iconColorDefault=888888&bgColorHover=dadada&bgTextureHover=02_glass.png&bgImgOpacityHover=75&borderColorHover=999999&fcHover=212121&iconColorHover=454545&bgColorActive=ffffff&bgTextureActive=02_glass.png&bgImgOpacityActive=65&borderColorActive=aaaaaa&fcActive=212121&iconColorActive=454545&bgColorHighlight=fbf9ee&bgTextureHighlight=02_glass.png&bgImgOpacityHighlight=55&borderColorHighlight=fcefa1&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=fef1ec&bgTextureError=02_glass.png&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=aaaaaa&bgTextureOverlay=01_flat.png&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=01_flat.png&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px
+ */
+
+
+/* Component containers
+----------------------------------*/
+.ui-widget .ui-widget { font-size: 1em; }
+.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Verdana,Arial,sans-serif; font-size: 1em; }
+.ui-widget-content { border: 1px solid #aaaaaa; background: #ffffff url(images/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x; color: #222222; }
+.ui-widget-content a { color: #222222; }
+.ui-widget-header { border: 1px solid #aaaaaa; background: #cccccc url(images/ui-bg_highlight-soft_75_cccccc_1x100.png) 50% 50% repeat-x; color: #222222; font-weight: bold; }
+.ui-widget-header a { color: #222222; }
+
+/* Interaction states
+----------------------------------*/
+.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #d3d3d3; background: #e6e6e6 url(images/ui-bg_glass_75_e6e6e6_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #555555; }
+.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #555555; text-decoration: none; }
+.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #999999; background: #dadada url(images/ui-bg_glass_75_dadada_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; }
+.ui-state-hover a, .ui-state-hover a:hover { color: #212121; text-decoration: none; }
+.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #aaaaaa; background: #ffffff url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; }
+.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #212121; text-decoration: none; }
+.ui-widget :active { outline: none; }
+
+/* Interaction Cues
+----------------------------------*/
+.ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {border: 1px solid #fcefa1; background: #fbf9ee url(images/ui-bg_glass_55_fbf9ee_1x400.png) 50% 50% repeat-x; color: #363636; }
+.ui-state-highlight a, .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a { color: #363636; }
+.ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {border: 1px solid #cd0a0a; background: #fef1ec url(images/ui-bg_glass_95_fef1ec_1x400.png) 50% 50% repeat-x; color: #cd0a0a; }
+.ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { color: #cd0a0a; }
+.ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text { color: #cd0a0a; }
+.ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: bold; }
+.ui-priority-secondary, .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; }
+.ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; }
+
+/* Icons
+----------------------------------*/
+
+/* states and images */
+.ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_222222_256x240.png); }
+.ui-widget-content .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); }
+.ui-widget-header .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); }
+.ui-state-default .ui-icon { background-image: url(images/ui-icons_888888_256x240.png); }
+.ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_454545_256x240.png); }
+.ui-state-active .ui-icon {background-image: url(images/ui-icons_454545_256x240.png); }
+.ui-state-highlight .ui-icon {background-image: url(images/ui-icons_2e83ff_256x240.png); }
+.ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_cd0a0a_256x240.png); }
+
+/* positioning */
+.ui-icon-carat-1-n { background-position: 0 0; }
+.ui-icon-carat-1-ne { background-position: -16px 0; }
+.ui-icon-carat-1-e { background-position: -32px 0; }
+.ui-icon-carat-1-se { background-position: -48px 0; }
+.ui-icon-carat-1-s { background-position: -64px 0; }
+.ui-icon-carat-1-sw { background-position: -80px 0; }
+.ui-icon-carat-1-w { background-position: -96px 0; }
+.ui-icon-carat-1-nw { background-position: -112px 0; }
+.ui-icon-carat-2-n-s { background-position: -128px 0; }
+.ui-icon-carat-2-e-w { background-position: -144px 0; }
+.ui-icon-triangle-1-n { background-position: 0 -16px; }
+.ui-icon-triangle-1-ne { background-position: -16px -16px; }
+.ui-icon-triangle-1-e { background-position: -32px -16px; }
+.ui-icon-triangle-1-se { background-position: -48px -16px; }
+.ui-icon-triangle-1-s { background-position: -64px -16px; }
+.ui-icon-triangle-1-sw { background-position: -80px -16px; }
+.ui-icon-triangle-1-w { background-position: -96px -16px; }
+.ui-icon-triangle-1-nw { background-position: -112px -16px; }
+.ui-icon-triangle-2-n-s { background-position: -128px -16px; }
+.ui-icon-triangle-2-e-w { background-position: -144px -16px; }
+.ui-icon-arrow-1-n { background-position: 0 -32px; }
+.ui-icon-arrow-1-ne { background-position: -16px -32px; }
+.ui-icon-arrow-1-e { background-position: -32px -32px; }
+.ui-icon-arrow-1-se { background-position: -48px -32px; }
+.ui-icon-arrow-1-s { background-position: -64px -32px; }
+.ui-icon-arrow-1-sw { background-position: -80px -32px; }
+.ui-icon-arrow-1-w { background-position: -96px -32px; }
+.ui-icon-arrow-1-nw { background-position: -112px -32px; }
+.ui-icon-arrow-2-n-s { background-position: -128px -32px; }
+.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; }
+.ui-icon-arrow-2-e-w { background-position: -160px -32px; }
+.ui-icon-arrow-2-se-nw { background-position: -176px -32px; }
+.ui-icon-arrowstop-1-n { background-position: -192px -32px; }
+.ui-icon-arrowstop-1-e { background-position: -208px -32px; }
+.ui-icon-arrowstop-1-s { background-position: -224px -32px; }
+.ui-icon-arrowstop-1-w { background-position: -240px -32px; }
+.ui-icon-arrowthick-1-n { background-position: 0 -48px; }
+.ui-icon-arrowthick-1-ne { background-position: -16px -48px; }
+.ui-icon-arrowthick-1-e { background-position: -32px -48px; }
+.ui-icon-arrowthick-1-se { background-position: -48px -48px; }
+.ui-icon-arrowthick-1-s { background-position: -64px -48px; }
+.ui-icon-arrowthick-1-sw { background-position: -80px -48px; }
+.ui-icon-arrowthick-1-w { background-position: -96px -48px; }
+.ui-icon-arrowthick-1-nw { background-position: -112px -48px; }
+.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; }
+.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; }
+.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; }
+.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; }
+.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; }
+.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; }
+.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; }
+.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; }
+.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; }
+.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; }
+.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; }
+.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; }
+.ui-icon-arrowreturn-1-w { background-position: -64px -64px; }
+.ui-icon-arrowreturn-1-n { background-position: -80px -64px; }
+.ui-icon-arrowreturn-1-e { background-position: -96px -64px; }
+.ui-icon-arrowreturn-1-s { background-position: -112px -64px; }
+.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; }
+.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; }
+.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; }
+.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; }
+.ui-icon-arrow-4 { background-position: 0 -80px; }
+.ui-icon-arrow-4-diag { background-position: -16px -80px; }
+.ui-icon-extlink { background-position: -32px -80px; }
+.ui-icon-newwin { background-position: -48px -80px; }
+.ui-icon-refresh { background-position: -64px -80px; }
+.ui-icon-shuffle { background-position: -80px -80px; }
+.ui-icon-transfer-e-w { background-position: -96px -80px; }
+.ui-icon-transferthick-e-w { background-position: -112px -80px; }
+.ui-icon-folder-collapsed { background-position: 0 -96px; }
+.ui-icon-folder-open { background-position: -16px -96px; }
+.ui-icon-document { background-position: -32px -96px; }
+.ui-icon-document-b { background-position: -48px -96px; }
+.ui-icon-note { background-position: -64px -96px; }
+.ui-icon-mail-closed { background-position: -80px -96px; }
+.ui-icon-mail-open { background-position: -96px -96px; }
+.ui-icon-suitcase { background-position: -112px -96px; }
+.ui-icon-comment { background-position: -128px -96px; }
+.ui-icon-person { background-position: -144px -96px; }
+.ui-icon-print { background-position: -160px -96px; }
+.ui-icon-trash { background-position: -176px -96px; }
+.ui-icon-locked { background-position: -192px -96px; }
+.ui-icon-unlocked { background-position: -208px -96px; }
+.ui-icon-bookmark { background-position: -224px -96px; }
+.ui-icon-tag { background-position: -240px -96px; }
+.ui-icon-home { background-position: 0 -112px; }
+.ui-icon-flag { background-position: -16px -112px; }
+.ui-icon-calendar { background-position: -32px -112px; }
+.ui-icon-cart { background-position: -48px -112px; }
+.ui-icon-pencil { background-position: -64px -112px; }
+.ui-icon-clock { background-position: -80px -112px; }
+.ui-icon-disk { background-position: -96px -112px; }
+.ui-icon-calculator { background-position: -112px -112px; }
+.ui-icon-zoomin { background-position: -128px -112px; }
+.ui-icon-zoomout { background-position: -144px -112px; }
+.ui-icon-search { background-position: -160px -112px; }
+.ui-icon-wrench { background-position: -176px -112px; }
+.ui-icon-gear { background-position: -192px -112px; }
+.ui-icon-heart { background-position: -208px -112px; }
+.ui-icon-star { background-position: -224px -112px; }
+.ui-icon-link { background-position: -240px -112px; }
+.ui-icon-cancel { background-position: 0 -128px; }
+.ui-icon-plus { background-position: -16px -128px; }
+.ui-icon-plusthick { background-position: -32px -128px; }
+.ui-icon-minus { background-position: -48px -128px; }
+.ui-icon-minusthick { background-position: -64px -128px; }
+.ui-icon-close { background-position: -80px -128px; }
+.ui-icon-closethick { background-position: -96px -128px; }
+.ui-icon-key { background-position: -112px -128px; }
+.ui-icon-lightbulb { background-position: -128px -128px; }
+.ui-icon-scissors { background-position: -144px -128px; }
+.ui-icon-clipboard { background-position: -160px -128px; }
+.ui-icon-copy { background-position: -176px -128px; }
+.ui-icon-contact { background-position: -192px -128px; }
+.ui-icon-image { background-position: -208px -128px; }
+.ui-icon-video { background-position: -224px -128px; }
+.ui-icon-script { background-position: -240px -128px; }
+.ui-icon-alert { background-position: 0 -144px; }
+.ui-icon-info { background-position: -16px -144px; }
+.ui-icon-notice { background-position: -32px -144px; }
+.ui-icon-help { background-position: -48px -144px; }
+.ui-icon-check { background-position: -64px -144px; }
+.ui-icon-bullet { background-position: -80px -144px; }
+.ui-icon-radio-off { background-position: -96px -144px; }
+.ui-icon-radio-on { background-position: -112px -144px; }
+.ui-icon-pin-w { background-position: -128px -144px; }
+.ui-icon-pin-s { background-position: -144px -144px; }
+.ui-icon-play { background-position: 0 -160px; }
+.ui-icon-pause { background-position: -16px -160px; }
+.ui-icon-seek-next { background-position: -32px -160px; }
+.ui-icon-seek-prev { background-position: -48px -160px; }
+.ui-icon-seek-end { background-position: -64px -160px; }
+.ui-icon-seek-start { background-position: -80px -160px; }
+/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */
+.ui-icon-seek-first { background-position: -80px -160px; }
+.ui-icon-stop { background-position: -96px -160px; }
+.ui-icon-eject { background-position: -112px -160px; }
+.ui-icon-volume-off { background-position: -128px -160px; }
+.ui-icon-volume-on { background-position: -144px -160px; }
+.ui-icon-power { background-position: 0 -176px; }
+.ui-icon-signal-diag { background-position: -16px -176px; }
+.ui-icon-signal { background-position: -32px -176px; }
+.ui-icon-battery-0 { background-position: -48px -176px; }
+.ui-icon-battery-1 { background-position: -64px -176px; }
+.ui-icon-battery-2 { background-position: -80px -176px; }
+.ui-icon-battery-3 { background-position: -96px -176px; }
+.ui-icon-circle-plus { background-position: 0 -192px; }
+.ui-icon-circle-minus { background-position: -16px -192px; }
+.ui-icon-circle-close { background-position: -32px -192px; }
+.ui-icon-circle-triangle-e { background-position: -48px -192px; }
+.ui-icon-circle-triangle-s { background-position: -64px -192px; }
+.ui-icon-circle-triangle-w { background-position: -80px -192px; }
+.ui-icon-circle-triangle-n { background-position: -96px -192px; }
+.ui-icon-circle-arrow-e { background-position: -112px -192px; }
+.ui-icon-circle-arrow-s { background-position: -128px -192px; }
+.ui-icon-circle-arrow-w { background-position: -144px -192px; }
+.ui-icon-circle-arrow-n { background-position: -160px -192px; }
+.ui-icon-circle-zoomin { background-position: -176px -192px; }
+.ui-icon-circle-zoomout { background-position: -192px -192px; }
+.ui-icon-circle-check { background-position: -208px -192px; }
+.ui-icon-circlesmall-plus { background-position: 0 -208px; }
+.ui-icon-circlesmall-minus { background-position: -16px -208px; }
+.ui-icon-circlesmall-close { background-position: -32px -208px; }
+.ui-icon-squaresmall-plus { background-position: -48px -208px; }
+.ui-icon-squaresmall-minus { background-position: -64px -208px; }
+.ui-icon-squaresmall-close { background-position: -80px -208px; }
+.ui-icon-grip-dotted-vertical { background-position: 0 -224px; }
+.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; }
+.ui-icon-grip-solid-vertical { background-position: -32px -224px; }
+.ui-icon-grip-solid-horizontal { background-position: -48px -224px; }
+.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; }
+.ui-icon-grip-diagonal-se { background-position: -80px -224px; }
+
+
+/* Misc visuals
+----------------------------------*/
+
+/* Corner radius */
+.ui-corner-all, .ui-corner-top, .ui-corner-left, .ui-corner-tl { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; -khtml-border-top-left-radius: 4px; border-top-left-radius: 4px; }
+.ui-corner-all, .ui-corner-top, .ui-corner-right, .ui-corner-tr { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; -khtml-border-top-right-radius: 4px; border-top-right-radius: 4px; }
+.ui-corner-all, .ui-corner-bottom, .ui-corner-left, .ui-corner-bl { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; -khtml-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; }
+.ui-corner-all, .ui-corner-bottom, .ui-corner-right, .ui-corner-br { -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; -khtml-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; }
+
+/* Overlays */
+.ui-widget-overlay { background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); }
+.ui-widget-shadow { margin: -8px 0 0 -8px; padding: 8px; background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); -moz-border-radius: 8px; -khtml-border-radius: 8px; -webkit-border-radius: 8px; border-radius: 8px; }/*!
+ * jQuery UI Resizable 1.8.19
+ *
+ * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Resizable#theming
+ */
+.ui-resizable { position: relative;}
+.ui-resizable-handle { position: absolute;font-size: 0.1px;z-index: 99999; display: block; }
+.ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; }
+.ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0; }
+.ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0; }
+.ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0; height: 100%; }
+.ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0; height: 100%; }
+.ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; }
+.ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; }
+.ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; }
+.ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;}/*!
+ * jQuery UI Selectable 1.8.19
+ *
+ * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Selectable#theming
+ */
+.ui-selectable-helper { position: absolute; z-index: 100; border:1px dotted black; }
+/*!
+ * jQuery UI Accordion 1.8.19
+ *
+ * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Accordion#theming
+ */
+/* IE/Win - Fix animation bug - #4615 */
+.ui-accordion { width: 100%; }
+.ui-accordion .ui-accordion-header { cursor: pointer; position: relative; margin-top: 1px; zoom: 1; }
+.ui-accordion .ui-accordion-li-fix { display: inline; }
+.ui-accordion .ui-accordion-header-active { border-bottom: 0 !important; }
+.ui-accordion .ui-accordion-header a { display: block; font-size: 1em; padding: .5em .5em .5em .7em; }
+.ui-accordion-icons .ui-accordion-header a { padding-left: 2.2em; }
+.ui-accordion .ui-accordion-header .ui-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; }
+.ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; margin-top: -2px; position: relative; top: 1px; margin-bottom: 2px; overflow: auto; display: none; zoom: 1; }
+.ui-accordion .ui-accordion-content-active { display: block; }
+/*!
+ * jQuery UI Autocomplete 1.8.19
+ *
+ * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Autocomplete#theming
+ */
+.ui-autocomplete { position: absolute; cursor: default; }
+
+/* workarounds */
+* html .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */
+
+/*
+ * jQuery UI Menu @VERSION
+ *
+ * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Menu#theming
+ */
+.ui-menu {
+ list-style:none;
+ padding: 2px;
+ margin: 0;
+ display:block;
+ float: left;
+}
+.ui-menu .ui-menu {
+ margin-top: -3px;
+}
+.ui-menu .ui-menu-item {
+ margin:0;
+ padding: 0;
+ zoom: 1;
+ float: left;
+ clear: left;
+ width: 100%;
+}
+.ui-menu .ui-menu-item a {
+ text-decoration:none;
+ display:block;
+ padding:.2em .4em;
+ line-height:1.5;
+ zoom:1;
+}
+.ui-menu .ui-menu-item a.ui-state-hover,
+.ui-menu .ui-menu-item a.ui-state-active {
+ font-weight: normal;
+ margin: -1px;
+}
+/*!
+ * jQuery UI Button 1.8.19
+ *
+ * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Button#theming
+ */
+.ui-button { display: inline-block; position: relative; padding: 0; margin-right: .1em; text-decoration: none !important; cursor: pointer; text-align: center; zoom: 1; overflow: visible; } /* the overflow property removes extra width in IE */
+.ui-button-icon-only { width: 2.2em; } /* to make room for the icon, a width needs to be set here */
+button.ui-button-icon-only { width: 2.4em; } /* button elements seem to need a little more width */
+.ui-button-icons-only { width: 3.4em; }
+button.ui-button-icons-only { width: 3.7em; }
+
+/*button text element */
+.ui-button .ui-button-text { display: block; line-height: 1.4; }
+.ui-button-text-only .ui-button-text { padding: .4em 1em; }
+.ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text { padding: .4em; text-indent: -9999999px; }
+.ui-button-text-icon-primary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 1em .4em 2.1em; }
+.ui-button-text-icon-secondary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 2.1em .4em 1em; }
+.ui-button-text-icons .ui-button-text { padding-left: 2.1em; padding-right: 2.1em; }
+/* no icon support for input elements, provide padding by default */
+input.ui-button { padding: .4em 1em; }
+
+/*button icon element(s) */
+.ui-button-icon-only .ui-icon, .ui-button-text-icon-primary .ui-icon, .ui-button-text-icon-secondary .ui-icon, .ui-button-text-icons .ui-icon, .ui-button-icons-only .ui-icon { position: absolute; top: 50%; margin-top: -8px; }
+.ui-button-icon-only .ui-icon { left: 50%; margin-left: -8px; }
+.ui-button-text-icon-primary .ui-button-icon-primary, .ui-button-text-icons .ui-button-icon-primary, .ui-button-icons-only .ui-button-icon-primary { left: .5em; }
+.ui-button-text-icon-secondary .ui-button-icon-secondary, .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; }
+.ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; }
+
+/*button sets*/
+.ui-buttonset { margin-right: 7px; }
+.ui-buttonset .ui-button { margin-left: 0; margin-right: -.3em; }
+
+/* workarounds */
+button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra padding in Firefox */
+/*!
+ * jQuery UI Dialog 1.8.19
+ *
+ * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Dialog#theming
+ */
+.ui-dialog { position: absolute; padding: .2em; width: 300px; overflow: hidden; }
+.ui-dialog .ui-dialog-titlebar { padding: .4em 1em; position: relative; }
+.ui-dialog .ui-dialog-title { float: left; margin: .1em 16px .1em 0; }
+.ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; }
+.ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; }
+.ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; }
+.ui-dialog .ui-dialog-content { position: relative; border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; }
+.ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; }
+.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { float: right; }
+.ui-dialog .ui-dialog-buttonpane button { margin: .5em .4em .5em 0; cursor: pointer; }
+.ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; }
+.ui-draggable .ui-dialog-titlebar { cursor: move; }
+/*!
+ * jQuery UI Slider 1.8.19
+ *
+ * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Slider#theming
+ */
+.ui-slider { position: relative; text-align: left; }
+.ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; }
+.ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; background-position: 0 0; }
+
+.ui-slider-horizontal { height: .8em; }
+.ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; }
+.ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; }
+.ui-slider-horizontal .ui-slider-range-min { left: 0; }
+.ui-slider-horizontal .ui-slider-range-max { right: 0; }
+
+.ui-slider-vertical { width: .8em; height: 100px; }
+.ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; }
+.ui-slider-vertical .ui-slider-range { left: 0; width: 100%; }
+.ui-slider-vertical .ui-slider-range-min { bottom: 0; }
+.ui-slider-vertical .ui-slider-range-max { top: 0; }/*!
+ * jQuery UI Tabs 1.8.19
+ *
+ * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Tabs#theming
+ */
+.ui-tabs { position: relative; padding: .2em; zoom: 1; } /* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */
+.ui-tabs .ui-tabs-nav { margin: 0; padding: .2em .2em 0; }
+.ui-tabs .ui-tabs-nav li { list-style: none; float: left; position: relative; top: 1px; margin: 0 .2em 1px 0; border-bottom: 0 !important; padding: 0; white-space: nowrap; }
+.ui-tabs .ui-tabs-nav li a { float: left; padding: .5em 1em; text-decoration: none; }
+.ui-tabs .ui-tabs-nav li.ui-tabs-selected { margin-bottom: 0; padding-bottom: 1px; }
+.ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { cursor: text; }
+.ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */
+.ui-tabs .ui-tabs-panel { display: block; border-width: 0; padding: 1em 1.4em; background: none; }
+.ui-tabs .ui-tabs-hide { display: none !important; }
+/*!
+ * jQuery UI Datepicker 1.8.19
+ *
+ * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Datepicker#theming
+ */
+.ui-datepicker { width: 17em; padding: .2em .2em 0; display: none; }
+.ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; }
+.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; }
+.ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; }
+.ui-datepicker .ui-datepicker-prev { left:2px; }
+.ui-datepicker .ui-datepicker-next { right:2px; }
+.ui-datepicker .ui-datepicker-prev-hover { left:1px; }
+.ui-datepicker .ui-datepicker-next-hover { right:1px; }
+.ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; }
+.ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; }
+.ui-datepicker .ui-datepicker-title select { font-size:1em; margin:1px 0; }
+.ui-datepicker select.ui-datepicker-month-year {width: 100%;}
+.ui-datepicker select.ui-datepicker-month,
+.ui-datepicker select.ui-datepicker-year { width: 49%;}
+.ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; }
+.ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; }
+.ui-datepicker td { border: 0; padding: 1px; }
+.ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; }
+.ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; }
+.ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; }
+.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; }
+
+/* with multiple calendars */
+.ui-datepicker.ui-datepicker-multi { width:auto; }
+.ui-datepicker-multi .ui-datepicker-group { float:left; }
+.ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; }
+.ui-datepicker-multi-2 .ui-datepicker-group { width:50%; }
+.ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; }
+.ui-datepicker-multi-4 .ui-datepicker-group { width:25%; }
+.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; }
+.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; }
+.ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; }
+.ui-datepicker-row-break { clear:both; width:100%; font-size:0em; }
+
+/* RTL support */
+.ui-datepicker-rtl { direction: rtl; }
+.ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; }
+.ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; }
+.ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; }
+.ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; }
+.ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; }
+.ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; }
+.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; }
+.ui-datepicker-rtl .ui-datepicker-group { float:right; }
+.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
+.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
+
+/* IE6 IFRAME FIX (taken from datepicker 1.5.3 */
+.ui-datepicker-cover {
+ display: none; /*sorry for IE5*/
+ display/**/: block; /*sorry for IE5*/
+ position: absolute; /*must have*/
+ z-index: -1; /*must have*/
+ filter: mask(); /*must have*/
+ top: -4px; /*must have*/
+ left: -4px; /*must have*/
+ width: 200px; /*must have*/
+ height: 200px; /*must have*/
+}/*!
+ * jQuery UI Progressbar 1.8.19
+ *
+ * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Progressbar#theming
+ */
+.ui-progressbar { height:2em; text-align: left; overflow: hidden; }
+.ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; }
View
13 media/css/main.less
@@ -705,3 +705,16 @@ p.inactive {
opacity: 0.9;
}
}
+// Autocomplete
+ul.selectable-deck {
+ border-top: 1px solid rgba(0,0,0,0.1);
+ width: 75%;
+ margin: 5px;
+ li {
+ border-bottom: 1px solid rgba(0,0,0,0.1);
+ overflow: hidden;
+ text-overflow: ellipsis;
+ background-color: white;
+ padding: 3px 5px;
+ }
+}
View
125 media/js/libs/jquery-ui-1.8.19.custom.min.js
125 additions, 0 deletions not shown
View
37 media/selectable/css/dj.selectable.css
@@ -0,0 +1,37 @@
+/*
+ * django-selectable UI widget CSS
+ * Source: https://bitbucket.org/mlavin/django-selectable
+ * Docs: http://django-selectable.readthedocs.org/
+ *
+ * Copyright 2010-2012, Mark Lavin
+ * BSD License
+ *
+*/
+ul.selectable-deck, ul.ui-autocomplete {
+ list-style: none outside none;
+}
+ul.selectable-deck li.selectable-deck-item,
+ul.ui-autocomplete li.ui-menu-item {
+ margin: 0;
+ list-style-type: none;
+}
+ul.selectable-deck li.selectable-deck-item .selectable-deck-remove {
+ float: right;
+}
+ul.selectable-deck-bottom-inline,
+ul.selectable-deck-top-inline {
+ padding: 0;
+}
+ul.selectable-deck-bottom-inline li.selectable-deck-item,
+ul.selectable-deck-top-inline li.selectable-deck-item {
+ display: inline;
+}
+ul.selectable-deck-bottom-inline li.selectable-deck-item .selectable-deck-remove,
+ul.selectable-deck-top-inline li.selectable-deck-item .selectable-deck-remove {
+ margin-left: 0.4em;
+ display: inline;
+ float: none;
+}
+ul.ui-autocomplete li.ui-menu-item span.highlight {
+ font-weight: bold;
+}
View
325 media/selectable/js/jquery.dj.selectable.js
@@ -0,0 +1,325 @@
+/*
+ * django-selectable UI widget
+ * Source: https://bitbucket.org/mlavin/django-selectable
+ * Docs: http://django-selectable.readthedocs.org/
+ *
+ * Depends:
+ * - jQuery 1.4.3+
+ * - jQuery UI 1.8 widget factory
+ *
+ * Copyright 2010-2012, Mark Lavin
+ * BSD License
+ *
+*/
+(function($) {
+
+ $.widget("ui.djselectable", {
+
+ options: {
+ removeIcon: "ui-icon-close",
+ comboboxIcon: "ui-icon-triangle-1-s",
+ prepareQuery: null,
+ highlightMatch: true,
+ formatLabel: null
+ },
+
+ _initDeck: function() {
+ /* Create list display for currently selected items for multi-select */
+ var self = this;
+ var data = $(this.element).data();
+ var style = data.selectablePosition || data['selectable-position'] || 'bottom';
+ this.deck = $('<ul>').addClass('ui-widget selectable-deck selectable-deck-' + style);
+ if (style === 'bottom' || style === 'bottom-inline') {
+ $(this.element).after(this.deck);
+ } else {
+ $(this.element).before(this.deck);
+ }
+ $(self.hiddenMultipleSelector).each(function(i, input) {
+ self._addDeckItem(input);
+ });
+ },
+
+ _addDeckItem: function(input) {
+ /* Add new deck list item from a given hidden input */
+ var self = this;
+ $('<li>')
+ .text($(input).attr('title'))
+ .addClass('selectable-deck-item')
+ .appendTo(this.deck)
+ .append(
+ $('<div>')
+ .addClass('selectable-deck-remove')
+ .append(
+ $('<a>')
+ .attr('href', '#')
+ .button({
+ icons: {
+ primary: self.options.removeIcon
+ },
+ text: false
+ })
+ .click(function() {
+ $(input).remove();
+ $(this).closest('li').remove();
+ return false;
+ })
+ )
+ );
+ },
+
+ select: function(item) {
+ /* Trigger selection of a given item.
+ Item should contain two properties: id and value */
+ var self = this,
+ input = this.element;
+ $(input).removeClass('ui-state-error');
+ if (item) {
+ if (self.allowMultiple) {
+ $(input).val("");
+ $(input).data("autocomplete").term = "";
+ if ($(self.hiddenMultipleSelector + '[value=' + item.id + ']').length === 0) {
+ var newInput = $('<input />', {
+ 'type': 'hidden',
+ 'name': self.hiddenName,
+ 'value': item.id,
+ 'title': item.value,
+ 'data-selectable-type': 'hidden-multiple'
+ });
+ $(input).after(newInput);
+ self._addDeckItem(newInput);
+ return false;
+ }
+ } else {
+ $(input).val(item.value);
+ var ui = {item: item};
+ $(input).trigger('autocompleteselect', [ui ]);
+ }
+ }
+ },
+
+ _create: function() {
+ /* Initialize a new selectable widget */
+ var self = this,
+ input = this.element,
+ data = $(input).data();
+ self.allowNew = data.selectableAllowNew || data['selectable-allow-new'];
+ self.allowMultiple = data.selectableMultiple || data['selectable-multiple'];
+ self.textName = $(input).attr('name');
+ self.hiddenName = self.textName.replace('_0', '_1');
+ self.hiddenSelector = ':input[data-selectable-type=hidden][name=' + self.hiddenName + ']';
+ self.hiddenMultipleSelector = ':input[data-selectable-type=hidden-multiple][name=' + self.hiddenName + ']';
+ if (self.allowMultiple) {
+ self.allowNew = false;
+ $(input).val("");
+ this._initDeck();
+ }
+
+ function dataSource(request, response) {
+ /* Custom data source to uses the lookup url with pagination
+ Adds hook for adjusting query parameters.
+ Includes timestamp to prevent browser caching the lookup. */
+ var url = data.selectableUrl || data['selectable-url'];
+ var now = new Date().getTime();
+ var query = {term: request.term, timestamp: now};
+ if (self.options.prepareQuery) {
+ self.options.prepareQuery(query);
+ }
+ var page = $(input).data("page");
+ if (page) {
+ query.page = page;
+ }
+ $.getJSON(url, query, response);
+ }
+ // Create base auto-complete lookup
+ $(input).autocomplete({
+ source: dataSource,
+ change: function(event, ui) {
+ $(input).removeClass('ui-state-error');
+ if ($(input).val() && !ui.item) {
+ if (!self.allowNew) {
+ $(input).addClass('ui-state-error');
+ }
+ }
+ if (self.allowMultiple && !$(input).hasClass('ui-state-error')) {
+ $(input).val("");
+ $(input).data("autocomplete").term = "";
+ }
+ },
+ select: function(event, ui) {
+ $(input).removeClass('ui-state-error');
+ if (ui.item && ui.item.page) {
+ // Set current page value
+ $(input).data("page", ui.tem.page);
+ $('.selectable-paginator', self.menu).remove();
+ // Search for next page of results
+ $(input).autocomplete("search");
+ return false;
+ }
+ self.select(ui.item);
+ }
+ }).addClass("ui-widget ui-widget-content ui-corner-all");
+ // Override the default auto-complete render.
+ $(input).data("autocomplete")._renderItem = function(ul, item) {
+ /* Adds hook for additional formatting, allows HTML in the label,
+ highlights term matches and handles pagination. */
+ var label = item.label;
+ if (self.options.formatLabel) {
+ label = self.options.formatLabel(label, item);
+ }
+ if (self.options.highlightMatch) {
+ var re = new RegExp("(?![^&;]+;)(?!<[^<>]*)(" +
+ $.ui.autocomplete.escapeRegex(this.term) +
+ ")(?![^<>]*>)(?![^&;]+;)", "gi");
+ label = label.replace(re, "<span class='highlight'>$1</span>");
+ }
+ var li = $("<li></li>")
+ .data("item.autocomplete", item)
+ .append($("<a></a>").append(label))
+ .appendTo(ul);
+ if (item.page) {
+ li.addClass('selectable-paginator');
+ }
+ return li;
+ };
+ // Override the default auto-complete suggest.
+ $(input).data("autocomplete")._suggest = function(items) {
+ /* Needed for handling pagination links */
+ var page = $(input).data('page');
+ var ul = this.menu.element;
+ if (!page) {
+ ul.empty();
+ }
+ $(input).data('page', null);
+ ul.zIndex(this.element.zIndex() + 1);
+ this._renderMenu(ul, items);
+ this.menu.deactivate();
+ this.menu.refresh();
+ // size and position menu
+ ul.show();
+ this._resizeMenu();
+ ul.position($.extend({of: this.element}, this.options.position));
+ if (this.options.autoFocus) {
+ this.menu.next(new $.Event("mouseover"));
+ }
+ };
+ // Additional work for combobox widgets
+ var selectableType = data.selectableType || data['selectable-type'];
+ if (selectableType === 'combobox') {
+ // Change auto-complete options
+ $(input).autocomplete("option", {
+ delay: 0,
+ minLength: 0
+ })
+ .removeClass("ui-corner-all")
+ .addClass("ui-corner-left ui-combo-input");
+ // Add show all items button
+ $("<button>&nbsp;</button>").attr("tabIndex", -1).attr("title", "Show All Items")
+ .insertAfter($(input))
+ .button({
+ icons: {
+ primary: self.options.comboboxIcon
+ },
+ text: false
+ })
+ .removeClass("ui-corner-all")
+ .addClass("ui-corner-right ui-button-icon ui-combo-button")
+ .click(function() {
+ // close if already visible
+ if ($(input).autocomplete("widget").is(":visible")) {
+ $(input).autocomplete("close");
+ return false;
+ }
+ // pass empty string as value to search for, displaying all results
+ $(input).autocomplete("search", "");
+ $(input).focus();
+ return false;
+ });
+ }
+ }
+ });
+})(jQuery);
+
+function bindSelectables(context) {
+ /* Bind all selectable widgets in a given context.
+ Automatically called on document.ready.
+ Additional calls can be made for dynamically added widgets.
+ */
+ $(":input[data-selectable-type=text]", context).djselectable();
+ $(":input[data-selectable-type=combobox]", context).djselectable();
+ $(":input[data-selectable-type=hidden]", context).each(function(i, elem) {
+ var hiddenName = $(elem).attr('name');
+ var textName = hiddenName.replace('_1', '_0');
+ $(":input[name=" + textName + "][data-selectable-url]").bind(
+ "autocompletechange autocompleteselect",
+ function(event, ui) {
+ if (ui.item && ui.item.id) {
+ $(elem).val(ui.item.id);
+ } else {
+ $(elem).val("");
+ }
+ }
+ );
+ });
+}
+
+/* Monkey-patch Django's dynamic formset, if defined */
+if (typeof(django) !== "undefined" && typeof(django.jQuery) !== "undefined") {
+ if (django.jQuery.fn.formset) {
+ var oldformset = django.jQuery.fn.formset;
+ django.jQuery.fn.formset = function(opts) {
+ var options = $.extend({}, opts);
+ var addedevent = function(row) {
+ bindSelectables($(row));
+ };
+ var added = null;
+ if (options.added) {
+ // Wrap previous added function and include call to bindSelectables
+ var oldadded = options.added;
+ added = function(row) { oldadded(row); addedevent(row); };
+ }
+ options.added = added || addedevent;
+ return oldformset.call(this, options);
+ };
+ }
+}
+
+/* Monkey-patch Django's dismissAddAnotherPopup(), if defined */
+if (typeof(dismissAddAnotherPopup) !== "undefined" && typeof(windowname_to_id) !== "undefined" && typeof(html_unescape) !== "undefined") {
+ var django_dismissAddAnotherPopup = dismissAddAnotherPopup;
+ dismissAddAnotherPopup = function(win, newId, newRepr) {
+ /* See if the popup came from a selectable field.
+ If not, pass control to Django's code.
+ If so, handle it. */
+ var fieldName = windowname_to_id(win.name); /* e.g. "id_fieldname" */
+ var field = $('#' + fieldName);
+ var multiField = $('#' + fieldName + '_0');
+ /* Check for bound selectable */
+ var singleWidget = field.data('djselectable');
+ var multiWidget = multiField.data('djselectable');
+ if (singleWidget || multiWidget) {
+ // newId and newRepr are expected to have previously been escaped by
+ // django.utils.html.escape.
+ var item = {
+ id: html_unescape(newId),
+ value: html_unescape(newRepr)
+ };
+ if (singleWidget) {
+ field.djselectable('select', item);
+ }
+ if (multiWidget) {
+ multiField.djselectable('select', item);
+ }
+ win.close();
+ } else {
+ /* Not ours, pass on to original function. */
+ return django_dismissAddAnotherPopup(win, newId, newRepr);
+ }
+ };
+}
+
+$(document).ready(function() {
+ // Bind existing widgets on document ready
+ if (typeof(djselectableAutoLoad) === "undefined" || djselectableAutoLoad) {
+ bindSelectables('body');
+ }
+});
View
1  requirements/prod.txt
@@ -1,5 +1,6 @@
# Django stuff
-e git://github.com/django/django@36c82ac8#egg=django
+django-selectable==0.4.1
# Templates
-e git://github.com/jbalogh/jingo.git#egg=jingo
View
13 settings.py
@@ -63,7 +63,7 @@ def __new__(self):
LANGUAGES = lazy(LazyLangs, dict)()
# Paths that don't require a locale code in the URL.
-SUPPORTED_NONLOCALES = ['media', 'push']
+SUPPORTED_NONLOCALES = ['media', 'push', 'selectable']
## Media and templates.
@@ -141,6 +141,10 @@ def JINJA_CONFIG():
'common': (
'css/main.less',
),
+ 'selectable': (
+ 'css/jq-ui-smoothness/jquery-ui-1.8.19.custom.css',
+ 'selectable/css/dj.selectable.css',
+ ),
},
'js': {
'common': (
@@ -148,6 +152,10 @@ def JINJA_CONFIG():
'js/libs/jquery.isotope.min.js',
'js/functions.js',
),
+ 'selectable': (
+ 'js/libs/jquery-ui-1.8.19.custom.min.js',
+ 'selectable/js/jquery.dj.selectable.js',
+ ),
}
}
@@ -228,6 +236,9 @@ def JINJA_CONFIG():
# Command running
'cronjobs',
+ # Autocomplete
+ 'selectable',
+
# Betafarm specific
'innovate',
'users',
View
8 urls.py
@@ -16,6 +16,7 @@
(r'', include('innovate.urls')),
(r'', include('users.urls')),
(r'', include('projects.urls')),
+ (r'^selectable/', include('selectable.urls')),
)
## In DEBUG mode, serve media files through Django.
@@ -26,10 +27,3 @@
(r'^%s/(?P<path>.*)$' % media_url, 'django.views.static.serve',
{'document_root': settings.MEDIA_ROOT}),
)
-
-urlpatterns += patterns('',
- (r'^mockups/(?P<path>.*)$', 'django.views.static.serve', {
- 'document_root': 'mockups',
- 'show_indexes': True,
- })
-)
View
84 vendor-local/lib/python/django_selectable-0.4.1-py2.7.egg-info/PKG-INFO
@@ -0,0 +1,84 @@
+Metadata-Version: 1.0
+Name: django-selectable
+Version: 0.4.1
+Summary: django-selectable is a collection of tools and widgets for using/creating auto-complete selection widgets using Django and jQuery UI.
+Home-page: http://bitbucket.org/mlavin/django-selectable
+Author: Mark Lavin
+Author-email: markdlavin@gmail.com
+License: BSD
+Description: django-selectable
+ ===================
+
+ Tools and widgets for using/creating auto-complete selection widgets using Django and jQuery UI.
+
+ Features
+ -----------------------------------
+
+ - Works with the latest jQuery UI Autocomplete library
+ - Auto-discovery/registration pattern for defining lookups
+
+
+ Installation Requirements
+ -----------------------------------
+
+ - `Django <http://www.djangoproject.com/>`_ >= 1.2
+ - `jQuery <http://jquery.com/>`_ >= 1.4.3
+ - `jQuery UI <http://jqueryui.com/>`_ >= 1.8
+
+ Optional (but recommended)
+
+ - `django-staticfiles <https://github.com/jezdez/django-staticfiles>`_
+
+ To install::
+
+ pip install django-selectable
+
+ If you are using `django-staticfiles` (or `django.contrib.staticfiles` in Django 1.3) then
+ add `selectable` to your `INSTALLED_APPS` to include the related css/js.
+
+ The jQuery and jQuery UI libraries are not included in the distribution but must be included
+ in your templates. See the example project for an example using these libraries from the
+ Google CDN.
+
+ Once installed you should add the urls to your root url patterns::
+
+ urlpatterns = patterns('',
+ # Other patterns go here
+ (r'^selectable/', include('selectable.urls')),
+ )
+
+
+ Documentation
+ -----------------------------------
+
+ Documentation for django-selectable is available on
+ `Read The Docs <http://readthedocs.org/>`_:
+
+ - `Dev <http://readthedocs.org/docs/django-selectable/en/latest/>`_
+ - `v0.4.1 <http://readthedocs.org/docs/django-selectable/en/version-0.4.1/>`_
+ - `v0.3.1 <http://readthedocs.org/docs/django-selectable/en/version-0.3.1/>`_
+ - `v0.2.0 <http://readthedocs.org/docs/django-selectable/en/version-0.2.0/>`_
+ - `v0.1.2 <http://readthedocs.org/docs/django-selectable/en/version-0.1.2/>`_
+
+
+ Additional Help/Support
+ -----------------------------------
+
+ You can find additional help or support on the mailing list: http://groups.google.com/group/django-selectable
+
+
+ Contributing
+ --------------------------------------
+
+ If you think you've found a bug or are interested in contributing to this project
+ check out our `contributing guide <http://readthedocs.org/docs/django-selectable/en/latest/contribute.html>`_.
+
+
+Platform: UNKNOWN
+Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
+Classifier: Intended Audience :: Developers
+Classifier: License :: OSI Approved :: BSD License
+Classifier: Programming Language :: Python
+Classifier: Topic :: Software Development :: Libraries :: Python Modules
+Classifier: Development Status :: 4 - Beta
+Classifier: Operating System :: OS Independent
View
44 vendor-local/lib/python/django_selectable-0.4.1-py2.7.egg-info/SOURCES.txt
@@ -0,0 +1,44 @@
+LICENSE.txt
+MANIFEST.in
+README.rst
+setup.cfg
+setup.py
+django_selectable.egg-info/PKG-INFO
+django_selectable.egg-info/SOURCES.txt
+django_selectable.egg-info/dependency_links.txt
+django_selectable.egg-info/not-zip-safe
+django_selectable.egg-info/top_level.txt
+example/__init__.py
+example/manage.py
+example/settings.py
+example/urls.py
+example/core/__init__.py
+example/core/admin.py
+example/core/forms.py
+example/core/lookups.py
+example/core/models.py
+example/core/tests.py
+example/core/urls.py
+example/core/views.py
+selectable/__init__.py
+selectable/base.py
+selectable/exceptions.py
+selectable/models.py
+selectable/registry.py
+selectable/urls.py
+selectable/views.py
+selectable/forms/__init__.py
+selectable/forms/base.py
+selectable/forms/fields.py
+selectable/forms/widgets.py
+selectable/static/selectable/css/dj.selectable.css
+selectable/static/selectable/js/jquery.dj.selectable.js
+selectable/tests/__init__.py
+selectable/tests/base.py
+selectable/tests/fields.py
+selectable/tests/forms.py
+selectable/tests/functests.py
+selectable/tests/runtests.py
+selectable/tests/urls.py
+selectable/tests/views.py
+selectable/tests/widgets.py
View
1  vendor-local/lib/python/django_selectable-0.4.1-py2.7.egg-info/dependency_links.txt
@@ -0,0 +1 @@
+
View
64 vendor-local/lib/python/django_selectable-0.4.1-py2.7.egg-info/installed-files.txt
@@ -0,0 +1,64 @@
+../selectable/__init__.py
+../selectable/base.py
+../selectable/exceptions.py
+../selectable/models.py
+../selectable/registry.py
+../selectable/urls.py
+../selectable/views.py
+../example/core/__init__.py
+../example/core/admin.py
+../example/core/forms.py
+../example/core/lookups.py
+../example/core/models.py
+../example/core/tests.py
+../example/core/urls.py
+../example/core/views.py
+../selectable/forms/__init__.py
+../selectable/forms/base.py
+../selectable/forms/fields.py
+../selectable/forms/widgets.py
+../selectable/tests/__init__.py
+../selectable/tests/base.py
+../selectable/tests/fields.py
+../selectable/tests/forms.py
+../selectable/tests/functests.py
+../selectable/tests/runtests.py
+../selectable/tests/urls.py
+../selectable/tests/views.py
+../selectable/tests/widgets.py
+../selectable/static/selectable/css/dj.selectable.css
+../selectable/static/selectable/js/jquery.dj.selectable.js
+../selectable/__init__.pyc
+../selectable/base.pyc
+../selectable/exceptions.pyc
+../selectable/models.pyc
+../selectable/registry.pyc
+../selectable/urls.pyc
+../selectable/views.pyc
+../example/core/__init__.pyc
+../example/core/admin.pyc
+../example/core/forms.pyc
+../example/core/lookups.pyc
+../example/core/models.pyc
+../example/core/tests.pyc
+../example/core/urls.pyc
+../example/core/views.pyc
+../selectable/forms/__init__.pyc
+../selectable/forms/base.pyc
+../selectable/forms/fields.pyc
+../selectable/forms/widgets.pyc
+../selectable/tests/__init__.pyc
+../selectable/tests/base.pyc
+../selectable/tests/fields.pyc
+../selectable/tests/forms.pyc
+../selectable/tests/functests.pyc
+../selectable/tests/runtests.pyc
+../selectable/tests/urls.pyc
+../selectable/tests/views.pyc
+../selectable/tests/widgets.pyc
+./
+dependency_links.txt
+not-zip-safe
+PKG-INFO
+SOURCES.txt
+top_level.txt
View
1  vendor-local/lib/python/django_selectable-0.4.1-py2.7.egg-info/not-zip-safe
@@ -0,0 +1 @@
+
View
2  vendor-local/lib/python/django_selectable-0.4.1-py2.7.egg-info/top_level.txt
@@ -0,0 +1,2 @@
+selectable
+example
View
0  vendor-local/lib/python/example/core/__init__.py
No changes.
View
53 vendor-local/lib/python/example/core/admin.py
@@ -0,0 +1,53 @@
+from django.contrib import admin
+from django.contrib.auth.admin import UserAdmin
+from django.contrib.auth.models import User
+from django import forms
+
+import selectable.forms as selectable
+
+from example.core.models import Fruit, Farm
+from example.core.lookups import FruitLookup, OwnerLookup
+
+
+class FarmAdminForm(forms.ModelForm):
+ owner = selectable.AutoComboboxSelectField(lookup_class=OwnerLookup, allow_new=True)
+
+ class Meta(object):
+ model = Farm
+ widgets = {
+ 'fruit': selectable.AutoCompleteSelectMultipleWidget(lookup_class=FruitLookup),
+ }
+ exclude = ('owner', )
+
+ def __init__(self, *args, **kwargs):
+ super(FarmAdminForm, self).__init__(*args, **kwargs)
+ if self.instance and self.instance.pk and self.instance.owner:
+ self.initial['owner'] = self.instance.owner
+
+ def save(self, *args, **kwargs):
+ owner = self.cleaned_data['owner']
+ if owner and not owner.pk:
+ owner = User.objects.create_user(username=owner.username, email='')
+ self.instance.owner = owner
+ return super(FarmAdminForm, self).save(*args, **kwargs)
+
+
+class FarmAdmin(admin.ModelAdmin):
+ form = FarmAdminForm
+
+
+class FarmInline(admin.TabularInline):
+ model = Farm
+ form = FarmAdminForm
+
+
+class NewUserAdmin(UserAdmin):
+ inlines = [
+ FarmInline,
+ ]
+
+
+admin.site.unregister(User)
+admin.site.register(User, NewUserAdmin)
+admin.site.register(Fruit)
+admin.site.register(Farm, FarmAdmin)
View
91 vendor-local/lib/python/example/core/forms.py
@@ -0,0 +1,91 @@
+from django import forms
+from django.forms.models import modelformset_factory
+from django.contrib.localflavor.us.forms import USStateField, USStateSelect
+
+import selectable.forms as selectable
+
+from example.core.lookups import FruitLookup, CityLookup
+from example.core.models import Farm
+
+
+class FruitForm(forms.Form):
+ autocomplete = forms.CharField(
+ label='Type the name of a fruit (AutoCompleteWidget)',
+ widget=selectable.AutoCompleteWidget(FruitLookup),
+ required=False,
+ )
+ newautocomplete = forms.CharField(
+ label='Type the name of a fruit (AutoCompleteWidget which allows new items)',
+ widget=selectable.AutoCompleteWidget(FruitLookup, allow_new=True),
+ required=False,
+ )
+ combobox = forms.CharField(
+ label='Type/select the name of a fruit (AutoComboboxWidget)',
+ widget=selectable.AutoComboboxWidget(FruitLookup),
+ required=False,
+ )
+ newcombobox = forms.CharField(
+ label='Type/select the name of a fruit (AutoComboboxWidget which allows new items)',
+ widget=selectable.AutoComboboxWidget(FruitLookup, allow_new=True),
+ required=False,
+ )
+ # AutoCompleteSelectField (no new items)
+ autocompleteselect = selectable.AutoCompleteSelectField(
+ lookup_class=FruitLookup,
+ label='Select a fruit (AutoCompleteField)',
+ required=False,
+ )
+ # AutoCompleteSelectField (allows new items)
+ newautocompleteselect = selectable.AutoCompleteSelectField(
+ lookup_class=FruitLookup,
+ allow_new=True,
+ label='Select a fruit (AutoCompleteField which allows new items)',
+ required=False,
+ )
+ # AutoComboboxSelectField (no new items)
+ comboboxselect = selectable.AutoComboboxSelectField(
+ lookup_class=FruitLookup,
+ label='Select a fruit (AutoComboboxSelectField)',
+ required=False,
+ )
+ # AutoComboboxSelectField (allows new items)
+ newcomboboxselect = selectable.AutoComboboxSelectField(
+ lookup_class=FruitLookup,
+ allow_new=True,
+ label='Select a fruit (AutoComboboxSelectField which allows new items)',
+ required=False,
+ )
+ # AutoCompleteSelectMultipleField
+ multiautocompleteselect = selectable.AutoCompleteSelectMultipleField(
+ lookup_class=FruitLookup,
+ label='Select a fruit (AutoCompleteSelectMultipleField)',
+ required=False,
+ )
+ # AutoComboboxSelectMultipleField
+ multicomboboxselect = selectable.AutoComboboxSelectMultipleField(
+ lookup_class=FruitLookup,
+ label='Select a fruit (AutoComboboxSelectMultipleField)',
+ required=False,
+ )
+
+
+class ChainedForm(forms.Form):
+ city = selectable.AutoComboboxSelectField(
+ lookup_class=CityLookup,
+ label='City',
+ required=False,
+ )
+ state = USStateField(widget=USStateSelect, required=False)
+
+
+class FarmForm(forms.ModelForm):
+
+ class Meta(object):
+ model = Farm
+ widgets = {
+ 'fruit': selectable.AutoCompleteSelectMultipleWidget(lookup_class=FruitLookup),
+ }
+
+
+FarmFormset = modelformset_factory(Farm, FarmForm)
+
View
39 vendor-local/lib/python/example/core/lookups.py
@@ -0,0 +1,39 @@
+from django.contrib.auth.models import User
+
+from selectable.base import ModelLookup
+from selectable.registry import registry
+
+from example.core.models import Fruit, City
+
+
+class FruitLookup(ModelLookup):
+ model = Fruit
+ search_fields = ('name__icontains', )
+
+registry.register(FruitLookup)
+
+
+class OwnerLookup(ModelLookup):
+ model = User
+ search_fields = ('username__icontains', )
+
+
+registry.register(OwnerLookup)
+
+
+class CityLookup(ModelLookup):
+ model = City
+ search_fields = ('name__icontains', )
+
+ def get_query(self, request, term):
+ results = super(CityLookup, self).get_query(request, term)
+ state = request.GET.get('state', '')
+ if state:
+ results = results.filter(state=state)
+ return results
+
+ def get_item_label(self, item):
+ return u"%s, %s" % (item.name, item.state)
+
+
+registry.register(CityLookup)
View
26 vendor-local/lib/python/example/core/models.py
@@ -0,0 +1,26 @@
+from django.contrib.localflavor.us.models import USStateField
+from django.db import models
+
+
+class Fruit(models.Model):
+ name = models.CharField(max_length=200)
+
+ def __unicode__(self):
+ return self.name
+
+
+class Farm(models.Model):
+ name = models.CharField(max_length=200)
+ owner = models.ForeignKey('auth.User', related_name='farms')
+ fruit = models.ManyToManyField(Fruit)
+
+ def __unicode__(self):
+ return u"%s's Farm: %s" % (self.owner.username, self.name)
+
+
+class City(models.Model):
+ name = models.CharField(max_length=200)
+ state = USStateField()
+
+ def __unicode__(self):
+ return self.name
View
23 vendor-local/lib/python/example/core/tests.py
@@ -0,0 +1,23 @@
+"""
+This file demonstrates two different styles of tests (one doctest and one
+unittest). These will both pass when you run "manage.py test".
+
+Replace these 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.failUnlessEqual(1 + 1, 2)
+
+__test__ = {"doctest": """
+Another way to test that 1 + 1 is equal to 2.
+
+>>> 1 + 1 == 2
+True
+"""}
+
View
8 vendor-local/lib/python/example/core/urls.py
@@ -0,0 +1,8 @@
+from django.conf.urls.defaults import *
+
+
+urlpatterns = patterns('example.core.views',
+ url(r'^formset/', 'formset', name='example-formset'),
+ url(r'^advanced/', 'advanced', name='example-advanced'),
+ url(r'^', 'index', name='example-index'),
+)
View
43 vendor-local/lib/python/example/core/views.py
@@ -0,0 +1,43 @@
+from django.shortcuts import render_to_response
+from django.template import RequestContext
+
+from example.core.forms import FruitForm, ChainedForm, FarmFormset
+
+
+def index(request):
+
+ if request.method == 'POST':
+ form = FruitForm(request.POST)
+ else:
+ if request.GET:
+ form = FruitForm(initial=request.GET)
+ else:
+ form = FruitForm()
+
+ return render_to_response('base.html', {'form': form}, context_instance=RequestContext(request))
+
+
+def advanced(request):
+
+ if request.method == 'POST':
+ form = ChainedForm(request.POST)
+ else:
+ if request.GET:
+ form = ChainedForm(initial=request.GET)
+ else:
+ form = ChainedForm()
+
+ return render_to_response('advanced.html', {'form': form}, context_instance=RequestContext(request))
+
+
+def formset(request):
+
+ if request.method == 'POST':
+ formset = FarmFormset(request.POST)
+ else:
+ if request.GET:
+ formset = FarmFormset(initial=request.GET)
+ else:
+ formset = FarmFormset()
+
+ return render_to_response('formset.html', {'formset': formset}, context_instance=RequestContext(request))
View
24 vendor-local/lib/python/selectable/__init__.py
@@ -0,0 +1,24 @@
+"""
+django-selectable is a collection of tools and widgets for using/creating auto-complete selection widgets using Django and jQuery UI.
+"""
+
+__version_info__ = {
+ 'major': 0,
+ 'minor': 4,
+ 'micro': 1,
+ 'releaselevel': 'final',
+}
+
+def get_version():
+ """
+ Return the formatted version information
+ """
+ vers = ["%(major)i.%(minor)i" % __version_info__, ]
+
+ if __version_info__['micro']:
+ vers.append(".%(micro)i" % __version_info__)
+ if __version_info__['releaselevel'] != 'final':
+ vers.append('%(releaselevel)s' % __version_info__)
+ return ''.join(vers)
+
+__version__ = get_version()
View
138 vendor-local/lib/python/selectable/base.py
@@ -0,0 +1,138 @@
+import operator
+import re
+
+from django.conf import settings
+from django.core.paginator import Paginator, InvalidPage, EmptyPage
+from django.core.urlresolvers import reverse
+from django.core.serializers.json import DjangoJSONEncoder
+from django.db.models import Q
+from django.http import HttpResponse
+from django.utils import simplejson as json
+from django.utils.encoding import smart_unicode
+from django.utils.translation import ugettext as _
+
+from selectable.forms import BaseLookupForm
+
+
+__all__ = (
+ 'LookupBase',
+ 'ModelLookup',
+)
+
+
+class LookupBase(object):
+ form = BaseLookupForm
+
+ def _name(cls):
+ app_name = cls.__module__.split('.')[-2].lower()
+ class_name = cls.__name__.lower()
+ name = u'%s-%s' % (app_name, class_name)
+ return name
+ name = classmethod(_name)
+
+ def _url(cls):
+ return reverse('selectable-lookup', args=[cls.name()])
+ url = classmethod(_url)
+
+ def get_query(self, request, term):
+ return []
+
+ def get_item_label(self, item):
+ return smart_unicode(item)
+
+ def get_item_id(self, item):
+ return smart_unicode(item)
+
+ def get_item_value(self, item):
+ return smart_unicode(item)
+
+ def get_item(self, value):
+ return value
+
+ def create_item(self, value):
+ raise NotImplemented()
+
+ def format_item(self, item):
+ return {
+ 'id': self.get_item_id(item),
+ 'value': self.get_item_value(item),
+ 'label': self.get_item_label(item)
+ }
+
+ def paginate_results(self, request, results, limit):
+ paginator = Paginator(results, limit)
+ try:
+ page = int(request.GET.get('page', '1'))
+ except ValueError:
+ page = 1
+ try:
+ results = paginator.page(page)
+ except (EmptyPage, InvalidPage):
+ results = paginator.page(paginator.num_pages)
+ return results
+
+ def results(self, request):
+ data = []
+ form = self.form(request.GET)
+ if form.is_valid():
+ term = form.cleaned_data.get('term', '')
+ limit = form.cleaned_data.get('limit', None)
+ raw_data = self.get_query(request, term)
+ page_data = None
+ if limit:
+ page_data = self.paginate_results(request, raw_data, limit)
+ raw_data = page_data.object_list
+ for item in raw_data:
+ data.append(self.format_item(item))
+ if page_data and hasattr(page_data, 'has_next') and page_data.has_next():
+ data.append({
+ 'id': '',
+ 'value': '',
+ 'label': _('Show more results'),
+ 'page': page_data.next_page_number()
+ })
+ content = json.dumps(data, cls=DjangoJSONEncoder, ensure_ascii=False)
+ return HttpResponse(content, content_type='application/json')
+
+
+class ModelLookup(LookupBase):
+ model = None
+ filters = {}
+ search_fields = ()
+
+ def get_query(self, request, term):
+ qs = self.get_queryset()
+ if term:
+ search_filters = []
+ if self.search_fields:
+ for field in self.search_fields:
+ search_filters.append(Q(**{field: term}))
+ qs = qs.filter(reduce(operator.or_, search_filters))
+ return qs
+
+ def get_queryset(self):
+ qs = self.model._default_manager.get_query_set()
+ if self.filters:
+ qs = qs.filter(**self.filters)
+ return qs
+
+ def get_item_id(self, item):
+ return item.pk
+
+ def get_item(self, value):
+ item = None
+ if value:
+ try:
+ item = self.get_queryset().filter(pk=value)[0]
+ except IndexError:
+ pass
+ return item
+
+ def create_item(self, value):
+ data = {}
+ if self.search_fields:
+ field_name = re.sub(r'__\w+$', '', self.search_fields[0])
+ if field_name:
+ data = {field_name: value}
+ return self.model(**data)
+
View
10 vendor-local/lib/python/selectable/exceptions.py
@@ -0,0 +1,10 @@
+class LookupAlreadyRegistered(Exception):
+ "Exception when trying to register a lookup which is already registered."
+
+
+class LookupNotRegistered(Exception):
+ "Exception when trying use a lookup which is not registered."
+
+
+class LookupInvalid(Exception):
+ "Exception when register an invalid lookup class."
View
3  vendor-local/lib/python/selectable/forms/__init__.py
@@ -0,0 +1,3 @@
+from selectable.forms.base import *
+from selectable.forms.fields import *
+from selectable.forms.widgets import *
View
19 vendor-local/lib/python/selectable/forms/base.py
@@ -0,0 +1,19 @@
+from django import forms
+from django.conf import settings
+
+
+__all__ = ('BaseLookupForm', )
+
+
+class BaseLookupForm(forms.Form):
+ term = forms.CharField(required=False)
+ limit = forms.IntegerField(required=False, min_value=1)
+
+ def clean_limit(self):
+ "Ensure given limit is less than default if defined"
+ DEFAULT_LIMIT = getattr(settings, 'SELECTABLE_MAX_LIMIT', 25)
+ limit = self.cleaned_data.get('limit', None)
+ if DEFAULT_LIMIT and (not limit or limit > DEFAULT_LIMIT):
+ limit = DEFAULT_LIMIT
+ return limit
+
View
92 vendor-local/lib/python/selectable/forms/fields.py
@@ -0,0 +1,92 @@
+from django import forms
+from django.core.exceptions import ValidationError
+from django.core.validators import EMPTY_VALUES
+from django.utils.translation import ugettext as _
+
+from selectable.forms.widgets import AutoCompleteSelectWidget, AutoComboboxSelectWidget
+from selectable.forms.widgets import AutoCompleteSelectMultipleWidget, AutoComboboxSelectMultipleWidget
+
+__all__ = (
+ 'AutoCompleteSelectField',
+ 'AutoComboboxSelectField',
+ 'AutoCompleteSelectMultipleField',
+ 'AutoComboboxSelectMultipleField',
+)
+
+
+class AutoCompleteSelectField(forms.Field):
+ widget = AutoCompleteSelectWidget
+
+ default_error_messages = {
+ 'invalid_choice': _(u'Select a valid choice. That choice is not one of the available choices.'),
+ }
+
+ def __init__(self, lookup_class, *args, **kwargs):
+ self.lookup_class = lookup_class
+ self.allow_new = kwargs.pop('allow_new', False)
+ self.limit = kwargs.pop('limit', None)
+ kwargs['widget'] = self.widget(lookup_class, allow_new=self.allow_new, limit=self.limit)
+ super(AutoCompleteSelectField, self).__init__(*args, **kwargs)
+
+
+ def to_python(self, value):
+ if value in EMPTY_VALUES:
+ return None
+ lookup =self.lookup_class()
+ if isinstance(value, list):
+ # Input comes from an AutoComplete widget. It's two
+ # components: text and id
+ if len(value) != 2:
+ raise ValidationError(self.error_messages['invalid_choice'])
+ if value[1] in EMPTY_VALUES:
+ if not self.allow_new:
+ if value[0]:
+ raise ValidationError(self.error_messages['invalid_choice'])
+ else:
+ return None
+ value = lookup.create_item(value[0])
+ else:
+ value = lookup.get_item(value[1])
+ if value is None:
+ raise ValidationError(self.error_messages['invalid_choice'])
+ else:
+ value = lookup.get_item(value)
+ if value is None:
+ raise ValidationError(self.error_messages['invalid_choice'])
+ return value
+
+
+class AutoComboboxSelectField(AutoCompleteSelectField):
+ widget = AutoComboboxSelectWidget
+
+
+class AutoCompleteSelectMultipleField(forms.Field):
+ widget = AutoCompleteSelectMultipleWidget
+
+ default_error_messages = {
+ 'invalid_choice': _(u'Select a valid choice. That choice is not one of the available choices.'),
+ }
+
+ def __init__(self, lookup_class, *args, **kwargs):
+ self.lookup_class = lookup_class
+ self.limit = kwargs.pop('limit', None)
+ kwargs['widget'] = self.widget(lookup_class, limit=self.limit)
+ super(AutoCompleteSelectMultipleField, self).__init__(*args, **kwargs)
+
+ def to_python(self, value):
+ if value in EMPTY_VALUES:
+ return []
+ lookup = self.lookup_class()
+ items = []
+ for v in value:
+ if v not in EMPTY_VALUES:
+ item = lookup.get_item(v)
+ if item is None:
+ raise ValidationError(self.error_messages['invalid_choice'])
+ items.append(item)
+ return items
+
+
+class AutoComboboxSelectMultipleField(AutoCompleteSelectMultipleField):
+ widget = AutoComboboxSelectMultipleWidget
+
View
237 vendor-local/lib/python/selectable/forms/widgets.py
@@ -0,0 +1,237 @@
+from django import forms
+from django.conf import settings
+from django.forms.util import flatatt
+from django.utils.http import urlencode
+from django.utils.encoding import force_unicode
+from django.utils.safestring import mark_safe
+
+
+__all__ = (
+ 'AutoCompleteWidget',
+ 'AutoCompleteSelectWidget',
+ 'AutoComboboxWidget',
+ 'AutoComboboxSelectWidget',
+ 'AutoCompleteSelectMultipleWidget',
+ 'AutoComboboxSelectMultipleWidget',
+)
+
+
+MEDIA_URL = settings.MEDIA_URL
+STATIC_URL = getattr(settings, 'STATIC_URL', u'')
+MEDIA_PREFIX = u'%sselectable/' % (STATIC_URL or MEDIA_URL)
+
+
+class SelectableMediaMixin(object):
+
+ class Media(object):
+ css = {
+ 'all': (u'%scss/dj.selectable.css'