Skip to content
Snippets Groups Projects
Commit 39343266 authored by Nadja Geisler's avatar Nadja Geisler :sunny:
Browse files

Merge branch 'submission_form' into 'master'

Submission form

See merge request !4
parents 1dc17247 8c77e29f
No related branches found
No related tags found
1 merge request!4Submission form
......@@ -10,9 +10,16 @@ urlpatterns = [
include([
path('', views.SubmissionOverviewView.as_view(), name='submission_overview'),
path('ak/<int:pk>', views.AKDetailView.as_view(), name='ak_detail'),
path('ak/<int:pk>/edit/', views.AKEditView.as_view(), name='ak_edit'),
path('aks/', views.AKListView.as_view(), name='ak_list'),
path('aks/category/<int:category_pk>', views.AKListByCategoryView.as_view(), name='ak_list_by_category'),
path('aks/tag/<int:tag_pk>', views.AKListByTagView.as_view(), name='ak_list_by_tag'),
path('owner/', views.AKOwnerCreateView.as_view(), name='akowner_create'),
path('new/', views.AKOwnerSelectDispatchView.as_view(), name='akowner_select'),
path('owner/edit/', views.AKOwnerEditDispatchView.as_view(), name='akowner_edit_dispatch'),
path('<slug:slug>/edit/', views.AKOwnerEditView.as_view(), name='akowner_edit'),
path('<slug:owner_slug>/new/', views.AKSubmissionView.as_view(), name='submit_ak'),
path('new_wish/', views.AKWishSubmissionView.as_view(), name='submit_ak_wish'),
])
),
]
from django.http import Http404
from django.contrib import messages
from django.http import Http404, HttpResponseRedirect
from django.shortcuts import get_object_or_404
from django.urls import reverse_lazy
from django.utils.translation import gettext_lazy as _
from django.views.generic import ListView, DetailView
from django.views import View
from django.views.generic import ListView, DetailView, CreateView, UpdateView
from AKModel.models import AK, AKCategory, AKTag
from AKModel.models import AK, AKCategory, AKTag, AKOwner, AKSlot
from AKModel.models import Event
from AKModel.views import EventSlugMixin
from AKModel.views import FilterByEventSlugMixin
from AKSubmission.forms import AKForm, AKWishForm, AKOwnerForm, AKEditForm, AKSubmissionForm
from django.conf import settings
......@@ -35,6 +44,9 @@ class SubmissionOverviewView(FilterByEventSlugMixin, ListView):
categories.append(({"name":_("Wishes"), "pk": "wish", "description": _("AKs one would like to have")}, ak_wishes))
context["categories"] = categories
# Get list of existing owners for event (for AK submission start)
context["existingOwners"] = AKOwner.objects.filter(event=self.event)
return context
......@@ -82,3 +94,134 @@ class AKListByTagView(AKListView):
except AKTag.DoesNotExist:
raise Http404
return super().get_queryset().filter(tags=self.tag)
class AKAndAKWishSubmissionView(EventSlugMixin, CreateView):
model = AK
template_name = 'AKSubmission/submit_new.html'
form_class = AKSubmissionForm
def get_success_url(self):
messages.add_message(self.request, messages.SUCCESS, _("AK successfully created"))
return reverse_lazy('submit:ak_detail', kwargs={'event_slug': self.kwargs['event_slug'], 'pk': self.object.pk})
def form_valid(self, form):
super_form_valid = super().form_valid(form)
# Generate wiki link
self.object.link = form.cleaned_data["event"].base_url + form.cleaned_data["name"].replace(" ", "_")
self.object.save()
# Set tags (and generate them if necessary)
for tag_name in form.cleaned_data["tag_names"]:
tag, _ = AKTag.objects.get_or_create(name=tag_name)
self.object.tags.add(tag)
# Generate slot(s)
for duration in form.cleaned_data["durations"]:
new_slot = AKSlot(ak=self.object, duration=duration, event=self.object.event)
new_slot.save()
return super_form_valid
class AKSubmissionView(AKAndAKWishSubmissionView):
def get_initial(self):
initials = super(AKAndAKWishSubmissionView, self).get_initial()
initials['owners'] = [AKOwner.get_by_slug(self.kwargs['owner_slug'])]
initials['event'] = self.event
return initials
def get_context_data(self, *, object_list=None, **kwargs):
context = super().get_context_data(object_list=object_list, **kwargs)
context['owner'] = get_object_or_404(AKOwner, slug=self.kwargs['owner_slug'])
return context
class AKWishSubmissionView(AKAndAKWishSubmissionView):
template_name = 'AKSubmission/submit_new_wish.html'
form_class = AKWishForm
class AKEditView(EventSlugMixin, UpdateView):
model = AK
template_name = 'AKSubmission/ak_edit.html'
form_class = AKEditForm
def get_success_url(self):
messages.add_message(self.request, messages.SUCCESS, _("AK successfully updated"))
return reverse_lazy('submit:ak_detail', kwargs={'event_slug': self.kwargs['event_slug'], 'pk': self.object.pk})
def form_valid(self, form):
super_form_valid = super().form_valid(form)
# Detach existing tags
self.object.tags.clear()
# Set tags (and generate them if necessary)
for tag_name in form.cleaned_data["tag_names"]:
tag, _ = AKTag.objects.get_or_create(name=tag_name)
self.object.tags.add(tag)
return super_form_valid
class AKOwnerCreateView(EventSlugMixin, CreateView):
model = AKOwner
template_name = 'AKSubmission/akowner_create_update.html'
form_class = AKOwnerForm
def get_success_url(self):
return reverse_lazy('submit:submit_ak',
kwargs={'event_slug': self.kwargs['event_slug'], 'owner_slug': self.object.slug})
def form_valid(self, form):
instance = form.save(commit=False)
# Set event
instance.event = Event.get_by_slug(self.kwargs["event_slug"])
return super().form_valid(form)
class AKOwnerSelectDispatchView(EventSlugMixin, View):
"""
This view only serves as redirect to prepopulate the owners field in submission create view
"""
def post(self, request, *args, **kwargs):
owner_id = request.POST["owner_id"]
if owner_id == "-1":
return HttpResponseRedirect(
reverse_lazy('submit:akowner_create', kwargs={'event_slug': kwargs['event_slug']}))
owner = get_object_or_404(AKOwner, pk=request.POST["owner_id"])
return HttpResponseRedirect(
reverse_lazy('submit:submit_ak', kwargs={'event_slug': kwargs['event_slug'], 'owner_slug': owner.slug}))
class AKOwnerEditView(EventSlugMixin, UpdateView):
model = AKOwner
template_name = "AKSubmission/akowner_create_update.html"
form_class = AKOwnerForm
def get_success_url(self):
messages.add_message(self.request, messages.SUCCESS, _("Person Info successfully updated"))
return reverse_lazy('submit:submission_overview', kwargs={'event_slug': self.kwargs['event_slug']})
class AKOwnerEditDispatchView(EventSlugMixin, View):
"""
This view only serves as redirect choose the correct edit view
"""
def post(self, request, *args, **kwargs):
owner_id = request.POST["owner_id"]
if owner_id == "-1":
messages.add_message(self.request, messages.WARNING, _("No user selected"))
return HttpResponseRedirect(
reverse_lazy('submit:submission_overview', kwargs={'event_slug': kwargs['event_slug']}))
owner = get_object_or_404(AKOwner, pk=request.POST["owner_id"])
return HttpResponseRedirect(
reverse_lazy('submit:akowner_edit', kwargs={'event_slug': kwargs['event_slug'], 'slug': owner.slug}))
.chosen-select {
width: 100%;
}
.chosen-select-deselect {
width: 100%;
}
.chosen-container {
display: inline-block;
font-size: 14px;
position: relative;
vertical-align: middle;
}
.chosen-container .chosen-drop {
background: #ffffff;
border: 1px solid #cccccc;
border-bottom-right-radius: 4px;
border-bottom-left-radius: 4px;
-webkit-box-shadow: 0 8px 8px rgba(0, 0, 0, .25);
box-shadow: 0 8px 8px rgba(0, 0, 0, .25);
margin-top: -1px;
position: absolute;
top: 100%;
left: -9000px;
z-index: 1060;
}
.chosen-container.chosen-with-drop .chosen-drop {
left: 0;
right: 0;
}
.chosen-container .chosen-results {
color: #555555;
margin: 0 4px 4px 0;
max-height: 240px;
padding: 0 0 0 4px;
position: relative;
overflow-x: hidden;
overflow-y: auto;
-webkit-overflow-scrolling: touch;
}
.chosen-container .chosen-results li {
display: none;
line-height: 1.42857143;
list-style: none;
margin: 0;
padding: 5px 6px;
}
.chosen-container .chosen-results li em {
background: #feffde;
font-style: normal;
}
.chosen-container .chosen-results li.group-result {
display: list-item;
cursor: default;
color: #999;
font-weight: bold;
}
.chosen-container .chosen-results li.group-option {
padding-left: 15px;
}
.chosen-container .chosen-results li.active-result {
cursor: pointer;
display: list-item;
}
.chosen-container .chosen-results li.highlighted {
background-color: #428bca;
background-image: none;
color: white;
}
.chosen-container .chosen-results li.highlighted em {
background: transparent;
}
.chosen-container .chosen-results li.disabled-result {
display: list-item;
color: #777777;
}
.chosen-container .chosen-results .no-results {
background: #eeeeee;
display: list-item;
}
.chosen-container .chosen-results-scroll {
background: white;
margin: 0 4px;
position: absolute;
text-align: center;
width: 321px;
z-index: 1;
}
.chosen-container .chosen-results-scroll span {
display: inline-block;
height: 1.42857143;
text-indent: -5000px;
width: 9px;
}
.chosen-container .chosen-results-scroll-down {
bottom: 0;
}
.chosen-container .chosen-results-scroll-down span {
background: url("chosen-sprite.png") no-repeat -4px -3px;
}
.chosen-container .chosen-results-scroll-up span {
background: url("chosen-sprite.png") no-repeat -22px -3px;
}
.chosen-container-single .chosen-single {
background-color: #ffffff;
-webkit-background-clip: padding-box;
-moz-background-clip: padding;
background-clip: padding-box;
border: 1px solid #cccccc;
border-top-right-radius: 4px;
border-top-left-radius: 4px;
border-bottom-right-radius: 4px;
border-bottom-left-radius: 4px;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
color: #555555;
display: block;
height: 34px;
overflow: hidden;
line-height: 34px;
padding: 0 0 0 8px;
position: relative;
text-decoration: none;
white-space: nowrap;
}
.chosen-container-single .chosen-single span {
display: block;
margin-right: 26px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.chosen-container-single .chosen-single abbr {
background: url("chosen-sprite.png") right top no-repeat;
display: block;
font-size: 1px;
height: 10px;
position: absolute;
right: 26px;
top: 12px;
width: 12px;
}
.chosen-container-single .chosen-single abbr:hover {
background-position: right -11px;
}
.chosen-container-single .chosen-single.chosen-disabled .chosen-single abbr:hover {
background-position: right 2px;
}
.chosen-container-single .chosen-single div {
display: block;
height: 100%;
position: absolute;
top: 0;
right: 0;
width: 18px;
}
.chosen-container-single .chosen-single div b {
background: url("chosen-sprite.png") no-repeat 0 7px;
display: block;
height: 100%;
width: 100%;
}
.chosen-container-single .chosen-default {
color: #777777;
}
.chosen-container-single .chosen-search {
margin: 0;
padding: 3px 4px;
position: relative;
white-space: nowrap;
z-index: 1000;
}
.chosen-container-single .chosen-search input[type="text"] {
background: url("chosen-sprite.png") no-repeat 100% -20px, #ffffff;
border: 1px solid #cccccc;
border-top-right-radius: 4px;
border-top-left-radius: 4px;
border-bottom-right-radius: 4px;
border-bottom-left-radius: 4px;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
margin: 1px 0;
padding: 4px 20px 4px 4px;
width: 100%;
}
.chosen-container-single .chosen-drop {
margin-top: -1px;
border-bottom-right-radius: 4px;
border-bottom-left-radius: 4px;
-webkit-background-clip: padding-box;
-moz-background-clip: padding;
background-clip: padding-box;
}
.chosen-container-single-nosearch .chosen-search input {
position: absolute;
left: -9000px;
}
.chosen-container-multi .chosen-choices {
background-color: #ffffff;
border: 1px solid #cccccc;
border-top-right-radius: 4px;
border-top-left-radius: 4px;
border-bottom-right-radius: 4px;
border-bottom-left-radius: 4px;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
cursor: text;
height: auto !important;
height: 1%;
margin: 0;
overflow: hidden;
padding: 0;
position: relative;
}
.chosen-container-multi .chosen-choices li {
float: left;
list-style: none;
}
.chosen-container-multi .chosen-choices .search-field {
margin: 0;
padding: 0;
white-space: nowrap;
}
.chosen-container-multi .chosen-choices .search-field input[type="text"] {
background: transparent !important;
border: 0 !important;
-webkit-box-shadow: none;
box-shadow: none;
color: #555555;
height: 32px;
margin: 0;
padding: 4px;
outline: 0;
}
.chosen-container-multi .chosen-choices .search-field .default {
color: #999;
}
.chosen-container-multi .chosen-choices .search-choice {
-webkit-background-clip: padding-box;
-moz-background-clip: padding;
background-clip: padding-box;
background-color: #eeeeee;
border: 1px solid #cccccc;
border-top-right-radius: 4px;
border-top-left-radius: 4px;
border-bottom-right-radius: 4px;
border-bottom-left-radius: 4px;
background-image: -webkit-linear-gradient(top, #ffffff 0%, #eeeeee 100%);
background-image: -o-linear-gradient(top, #ffffff 0%, #eeeeee 100%);
background-image: linear-gradient(to bottom, #ffffff 0%, #eeeeee 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffeeeeee', GradientType=0);
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
color: #333333;
cursor: default;
line-height: 13px;
margin: 6px 0 3px 5px;
padding: 3px 20px 3px 5px;
position: relative;
}
.chosen-container-multi .chosen-choices .search-choice .search-choice-close {
background: url("chosen-sprite.png") right top no-repeat;
display: block;
font-size: 1px;
height: 10px;
position: absolute;
right: 4px;
top: 5px;
width: 12px;
cursor: pointer;
}
.chosen-container-multi .chosen-choices .search-choice .search-choice-close:hover {
background-position: right -11px;
}
.chosen-container-multi .chosen-choices .search-choice-focus {
background: #d4d4d4;
}
.chosen-container-multi .chosen-choices .search-choice-focus .search-choice-close {
background-position: right -11px;
}
.chosen-container-multi .chosen-results {
margin: 0 0 0 0;
padding: 0;
}
.chosen-container-multi .chosen-drop .result-selected {
display: none;
}
.chosen-container-active .chosen-single {
border: 1px solid #66afe9;
-webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, .075) inset, 0 0 8px rgba(82, 168, 236, .6);
box-shadow: 0 1px 1px rgba(0, 0, 0, .075) inset, 0 0 8px rgba(82, 168, 236, .6);
-webkit-transition: border linear .2s, box-shadow linear .2s;
-o-transition: border linear .2s, box-shadow linear .2s;
transition: border linear .2s, box-shadow linear .2s;
}
.chosen-container-active.chosen-with-drop .chosen-single {
background-color: #ffffff;
border: 1px solid #66afe9;
border-bottom-right-radius: 0;
border-bottom-left-radius: 0;
-webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, .075) inset, 0 0 8px rgba(82, 168, 236, .6);
box-shadow: 0 1px 1px rgba(0, 0, 0, .075) inset, 0 0 8px rgba(82, 168, 236, .6);
-webkit-transition: border linear .2s, box-shadow linear .2s;
-o-transition: border linear .2s, box-shadow linear .2s;
transition: border linear .2s, box-shadow linear .2s;
}
.chosen-container-active.chosen-with-drop .chosen-single div {
background: transparent;
border-left: none;
}
.chosen-container-active.chosen-with-drop .chosen-single div b {
background-position: -18px 7px;
}
.chosen-container-active .chosen-choices {
border: 1px solid #66afe9;
border-bottom-right-radius: 0;
border-bottom-left-radius: 0;
-webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, .075) inset, 0 0 8px rgba(82, 168, 236, .6);
box-shadow: 0 1px 1px rgba(0, 0, 0, .075) inset, 0 0 8px rgba(82, 168, 236, .6);
-webkit-transition: border linear .2s, box-shadow linear .2s;
-o-transition: border linear .2s, box-shadow linear .2s;
transition: border linear .2s, box-shadow linear .2s;
}
.chosen-container-active .chosen-choices .search-field input[type="text"] {
color: #111 !important;
}
.chosen-container-active.chosen-with-drop .chosen-choices {
border-bottom-right-radius: 0;
border-bottom-left-radius: 0;
}
.chosen-disabled {
cursor: default;
opacity: 0.5 !important;
}
.chosen-disabled .chosen-single {
cursor: default;
}
.chosen-disabled .chosen-choices .search-choice .search-choice-close {
cursor: default;
}
.chosen-rtl {
text-align: right;
}
.chosen-rtl .chosen-single {
padding: 0 8px 0 0;
overflow: visible;
}
.chosen-rtl .chosen-single span {
margin-left: 26px;
margin-right: 0;
direction: rtl;
}
.chosen-rtl .chosen-single div {
left: 7px;
right: auto;
}
.chosen-rtl .chosen-single abbr {
left: 26px;
right: auto;
}
.chosen-rtl .chosen-choices .search-field input[type="text"] {
direction: rtl;
}
.chosen-rtl .chosen-choices li {
float: right;
}
.chosen-rtl .chosen-choices .search-choice {
margin: 6px 5px 3px 0;
padding: 3px 5px 3px 19px;
}
.chosen-rtl .chosen-choices .search-choice .search-choice-close {
background-position: right top;
left: 4px;
right: auto;
}
.chosen-rtl.chosen-container-single .chosen-results {
margin: 0 0 4px 4px;
padding: 0 4px 0 0;
}
.chosen-rtl .chosen-results .group-option {
padding-left: 0;
padding-right: 15px;
}
.chosen-rtl.chosen-container-active.chosen-with-drop .chosen-single div {
border-right: none;
}
.chosen-rtl .chosen-search input[type="text"] {
background: url("chosen-sprite.png") no-repeat -28px -20px, #ffffff;
direction: rtl;
padding: 4px 5px 4px 20px;
}
@media only screen and (-webkit-min-device-pixel-ratio: 2), only screen and (min-resolution: 144dpi) {
.chosen-rtl .chosen-search input[type="text"],
.chosen-container-single .chosen-single abbr,
.chosen-container-single .chosen-single div b,
.chosen-container-single .chosen-search input[type="text"],
.chosen-container-multi .chosen-choices .search-choice .search-choice-close,
.chosen-container .chosen-results-scroll-down span,
.chosen-container .chosen-results-scroll-up span {
background-image: url("chosen-sprite@2x.png") !important;
background-size: 52px 37px !important;
background-repeat: no-repeat !important;
}
}
# Chosen
Chosen is a library for making long, unwieldy select boxes more user friendly.
- jQuery support: 1.4+
- Prototype support: 1.7+
For **documentation**, usage, and examples, see:
http://harvesthq.github.io/chosen/
For **downloads**, see:
https://github.com/harvesthq/chosen/releases/
### Package managers
Chosen is available through [Bower](https://bower.io/) and [npm](https://www.npmjs.com),
_however, the package names are not the same_.
To install with Bower:
```
bower install chosen
```
To install with npm:
```
npm install chosen-js
```
The compiled files for these packages are automatically generated and stored in a [2nd Chosen repository](https://github.com/harvesthq/chosen-package). No pull requests will be accepted to that repository.
### Contributing to this project
We welcome all to participate in making Chosen the best software it can be. The repository is maintained by only a few people, but has accepted contributions from over 50 authors after reviewing hundreds of pull requests related to thousands of issues. You can help reduce the maintainers' workload (and increase your chance of having an accepted contribution to Chosen) by following the
[guidelines for contributing](contributing.md).
* [Bug reports](contributing.md#bugs)
* [Feature requests](contributing.md#features)
* [Pull requests](contributing.md#pull-requests)
### Chosen Credits
- Concept and development by [Patrick Filler](http://patrickfiller.com) for [Harvest](http://getharvest.com/).
- Design and CSS by [Matthew Lettini](http://matthewlettini.com/)
- Repository maintained by [@pfiller](http://github.com/pfiller), [@kenearley](http://github.com/kenearley), [@stof](http://github.com/stof), [@koenpunt](http://github.com/koenpunt), and [@tjschuck](http://github.com/tjschuck).
- Chosen includes [contributions by many fine folks](https://github.com/harvesthq/chosen/contributors).
static_common/common/vendor/chosen-js/chosen-sprite.png

538 B

static_common/common/vendor/chosen-js/chosen-sprite@2x.png

738 B

/*!
Chosen, a Select Box Enhancer for jQuery and Prototype
by Patrick Filler for Harvest, http://getharvest.com
Version 1.7.0
Full source at https://github.com/harvesthq/chosen
Copyright (c) 2011-2017 Harvest http://getharvest.com
MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md
This file is generated by `grunt build`, do not edit it by hand.
*/
/* @group Base */
.chosen-container {
position: relative;
display: inline-block;
vertical-align: middle;
font-size: 13px;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.chosen-container * {
box-sizing: border-box;
}
.chosen-container .chosen-drop {
position: absolute;
top: 100%;
z-index: 1010;
width: 100%;
border: 1px solid #aaa;
border-top: 0;
background: #fff;
box-shadow: 0 4px 5px rgba(0, 0, 0, 0.15);
clip: rect(0, 0, 0, 0);
}
.chosen-container.chosen-with-drop .chosen-drop {
clip: auto;
}
.chosen-container a {
cursor: pointer;
}
.chosen-container .search-choice .group-name, .chosen-container .chosen-single .group-name {
margin-right: 4px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
font-weight: normal;
color: #999999;
}
.chosen-container .search-choice .group-name:after, .chosen-container .chosen-single .group-name:after {
content: ":";
padding-left: 2px;
vertical-align: top;
}
/* @end */
/* @group Single Chosen */
.chosen-container-single .chosen-single {
position: relative;
display: block;
overflow: hidden;
padding: 0 0 0 8px;
height: 25px;
border: 1px solid #aaa;
border-radius: 5px;
background-color: #fff;
background: linear-gradient(#fff 20%, #f6f6f6 50%, #eee 52%, #f4f4f4 100%);
background-clip: padding-box;
box-shadow: 0 0 3px #fff inset, 0 1px 1px rgba(0, 0, 0, 0.1);
color: #444;
text-decoration: none;
white-space: nowrap;
line-height: 24px;
}
.chosen-container-single .chosen-default {
color: #999;
}
.chosen-container-single .chosen-single span {
display: block;
overflow: hidden;
margin-right: 26px;
text-overflow: ellipsis;
white-space: nowrap;
}
.chosen-container-single .chosen-single-with-deselect span {
margin-right: 38px;
}
.chosen-container-single .chosen-single abbr {
position: absolute;
top: 6px;
right: 26px;
display: block;
width: 12px;
height: 12px;
background: url("chosen-sprite.png") -42px 1px no-repeat;
font-size: 1px;
}
.chosen-container-single .chosen-single abbr:hover {
background-position: -42px -10px;
}
.chosen-container-single.chosen-disabled .chosen-single abbr:hover {
background-position: -42px -10px;
}
.chosen-container-single .chosen-single div {
position: absolute;
top: 0;
right: 0;
display: block;
width: 18px;
height: 100%;
}
.chosen-container-single .chosen-single div b {
display: block;
width: 100%;
height: 100%;
background: url("chosen-sprite.png") no-repeat 0px 2px;
}
.chosen-container-single .chosen-search {
position: relative;
z-index: 1010;
margin: 0;
padding: 3px 4px;
white-space: nowrap;
}
.chosen-container-single .chosen-search input[type="text"] {
margin: 1px 0;
padding: 4px 20px 4px 5px;
width: 100%;
height: auto;
outline: 0;
border: 1px solid #aaa;
background: url("chosen-sprite.png") no-repeat 100% -20px;
font-size: 1em;
font-family: sans-serif;
line-height: normal;
border-radius: 0;
}
.chosen-container-single .chosen-drop {
margin-top: -1px;
border-radius: 0 0 4px 4px;
background-clip: padding-box;
}
.chosen-container-single.chosen-container-single-nosearch .chosen-search {
position: absolute;
clip: rect(0, 0, 0, 0);
}
/* @end */
/* @group Results */
.chosen-container .chosen-results {
color: #444;
position: relative;
overflow-x: hidden;
overflow-y: auto;
margin: 0 4px 4px 0;
padding: 0 0 0 4px;
max-height: 240px;
-webkit-overflow-scrolling: touch;
}
.chosen-container .chosen-results li {
display: none;
margin: 0;
padding: 5px 6px;
list-style: none;
line-height: 15px;
word-wrap: break-word;
-webkit-touch-callout: none;
}
.chosen-container .chosen-results li.active-result {
display: list-item;
cursor: pointer;
}
.chosen-container .chosen-results li.disabled-result {
display: list-item;
color: #ccc;
cursor: default;
}
.chosen-container .chosen-results li.highlighted {
background-color: #3875d7;
background-image: linear-gradient(#3875d7 20%, #2a62bc 90%);
color: #fff;
}
.chosen-container .chosen-results li.no-results {
color: #777;
display: list-item;
background: #f4f4f4;
}
.chosen-container .chosen-results li.group-result {
display: list-item;
font-weight: bold;
cursor: default;
}
.chosen-container .chosen-results li.group-option {
padding-left: 15px;
}
.chosen-container .chosen-results li em {
font-style: normal;
text-decoration: underline;
}
/* @end */
/* @group Multi Chosen */
.chosen-container-multi .chosen-choices {
position: relative;
overflow: hidden;
margin: 0;
padding: 0 5px;
width: 100%;
height: auto;
border: 1px solid #aaa;
background-color: #fff;
background-image: linear-gradient(#eee 1%, #fff 15%);
cursor: text;
}
.chosen-container-multi .chosen-choices li {
float: left;
list-style: none;
}
.chosen-container-multi .chosen-choices li.search-field {
margin: 0;
padding: 0;
white-space: nowrap;
}
.chosen-container-multi .chosen-choices li.search-field input[type="text"] {
margin: 1px 0;
padding: 0;
height: 25px;
outline: 0;
border: 0 !important;
background: transparent !important;
box-shadow: none;
color: #999;
font-size: 100%;
font-family: sans-serif;
line-height: normal;
border-radius: 0;
width: 25px;
}
.chosen-container-multi .chosen-choices li.search-choice {
position: relative;
margin: 3px 5px 3px 0;
padding: 3px 20px 3px 5px;
border: 1px solid #aaa;
max-width: 100%;
border-radius: 3px;
background-color: #eeeeee;
background-image: linear-gradient(#f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eee 100%);
background-size: 100% 19px;
background-repeat: repeat-x;
background-clip: padding-box;
box-shadow: 0 0 2px #fff inset, 0 1px 0 rgba(0, 0, 0, 0.05);
color: #333;
line-height: 13px;
cursor: default;
}
.chosen-container-multi .chosen-choices li.search-choice span {
word-wrap: break-word;
}
.chosen-container-multi .chosen-choices li.search-choice .search-choice-close {
position: absolute;
top: 4px;
right: 3px;
display: block;
width: 12px;
height: 12px;
background: url("chosen-sprite.png") -42px 1px no-repeat;
font-size: 1px;
}
.chosen-container-multi .chosen-choices li.search-choice .search-choice-close:hover {
background-position: -42px -10px;
}
.chosen-container-multi .chosen-choices li.search-choice-disabled {
padding-right: 5px;
border: 1px solid #ccc;
background-color: #e4e4e4;
background-image: linear-gradient(#f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eee 100%);
color: #666;
}
.chosen-container-multi .chosen-choices li.search-choice-focus {
background: #d4d4d4;
}
.chosen-container-multi .chosen-choices li.search-choice-focus .search-choice-close {
background-position: -42px -10px;
}
.chosen-container-multi .chosen-results {
margin: 0;
padding: 0;
}
.chosen-container-multi .chosen-drop .result-selected {
display: list-item;
color: #ccc;
cursor: default;
}
/* @end */
/* @group Active */
.chosen-container-active .chosen-single {
border: 1px solid #5897fb;
box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
}
.chosen-container-active.chosen-with-drop .chosen-single {
border: 1px solid #aaa;
border-bottom-right-radius: 0;
border-bottom-left-radius: 0;
background-image: linear-gradient(#eee 20%, #fff 80%);
box-shadow: 0 1px 0 #fff inset;
}
.chosen-container-active.chosen-with-drop .chosen-single div {
border-left: none;
background: transparent;
}
.chosen-container-active.chosen-with-drop .chosen-single div b {
background-position: -18px 2px;
}
.chosen-container-active .chosen-choices {
border: 1px solid #5897fb;
box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
}
.chosen-container-active .chosen-choices li.search-field input[type="text"] {
color: #222 !important;
}
/* @end */
/* @group Disabled Support */
.chosen-disabled {
opacity: 0.5 !important;
cursor: default;
}
.chosen-disabled .chosen-single {
cursor: default;
}
.chosen-disabled .chosen-choices .search-choice .search-choice-close {
cursor: default;
}
/* @end */
/* @group Right to Left */
.chosen-rtl {
text-align: right;
}
.chosen-rtl .chosen-single {
overflow: visible;
padding: 0 8px 0 0;
}
.chosen-rtl .chosen-single span {
margin-right: 0;
margin-left: 26px;
direction: rtl;
}
.chosen-rtl .chosen-single-with-deselect span {
margin-left: 38px;
}
.chosen-rtl .chosen-single div {
right: auto;
left: 3px;
}
.chosen-rtl .chosen-single abbr {
right: auto;
left: 26px;
}
.chosen-rtl .chosen-choices li {
float: right;
}
.chosen-rtl .chosen-choices li.search-field input[type="text"] {
direction: rtl;
}
.chosen-rtl .chosen-choices li.search-choice {
margin: 3px 5px 3px 0;
padding: 3px 5px 3px 19px;
}
.chosen-rtl .chosen-choices li.search-choice .search-choice-close {
right: auto;
left: 4px;
}
.chosen-rtl.chosen-container-single .chosen-results {
margin: 0 0 4px 4px;
padding: 0 4px 0 0;
}
.chosen-rtl .chosen-results li.group-option {
padding-right: 15px;
padding-left: 0;
}
.chosen-rtl.chosen-container-active.chosen-with-drop .chosen-single div {
border-right: none;
}
.chosen-rtl .chosen-search input[type="text"] {
padding: 4px 5px 4px 20px;
background: url("chosen-sprite.png") no-repeat -30px -20px;
direction: rtl;
}
.chosen-rtl.chosen-container-single .chosen-single div b {
background-position: 6px 2px;
}
.chosen-rtl.chosen-container-single.chosen-with-drop .chosen-single div b {
background-position: -12px 2px;
}
/* @end */
/* @group Retina compatibility */
@media only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (min-resolution: 144dpi), only screen and (min-resolution: 1.5dppx) {
.chosen-rtl .chosen-search input[type="text"],
.chosen-container-single .chosen-single abbr,
.chosen-container-single .chosen-single div b,
.chosen-container-single .chosen-search input[type="text"],
.chosen-container-multi .chosen-choices .search-choice .search-choice-close,
.chosen-container .chosen-results-scroll-down span,
.chosen-container .chosen-results-scroll-up span {
background-image: url("chosen-sprite@2x.png") !important;
background-size: 52px 37px !important;
background-repeat: no-repeat !important;
}
}
/* @end */
This diff is collapsed.
{
"_args": [
[
{
"raw": "chosen-js@~1.7.0",
"scope": null,
"escapedName": "chosen-js",
"name": "chosen-js",
"rawSpec": "~1.7.0",
"spec": ">=1.7.0 <1.8.0",
"type": "range"
},
"/mnt/d/repo/pyophase"
]
],
"_from": "chosen-js@>=1.7.0 <1.8.0",
"_id": "chosen-js@1.7.0",
"_inCache": true,
"_location": "/chosen-js",
"_nodeVersion": "7.7.4",
"_npmOperationalInternal": {
"host": "packages-18-east.internal.npmjs.com",
"tmp": "tmp/chosen-js-1.7.0.tgz_1490389234489_0.23706221161410213"
},
"_npmUser": {
"name": "chosenjs",
"email": "chosenjs@getharvest.com"
},
"_npmVersion": "4.1.2",
"_phantomChildren": {},
"_requested": {
"raw": "chosen-js@~1.7.0",
"scope": null,
"escapedName": "chosen-js",
"name": "chosen-js",
"rawSpec": "~1.7.0",
"spec": ">=1.7.0 <1.8.0",
"type": "range"
},
"_requiredBy": [
"/"
],
"_resolved": "https://registry.npmjs.org/chosen-js/-/chosen-js-1.7.0.tgz",
"_shasum": "8ceb2e929e2a072886edd384d78989dfbffa58c3",
"_shrinkwrap": null,
"_spec": "chosen-js@~1.7.0",
"_where": "/mnt/d/repo/pyophase",
"bugs": {
"url": "https://github.com/harvesthq/chosen/issues"
},
"contributors": [
{
"name": "Patrick Filler",
"url": "https://github.com/pfiller"
},
{
"name": "Christophe Coevoet",
"url": "https://github.com/stof"
},
{
"name": "Ken Earley",
"url": "https://github.com/kenearley"
},
{
"name": "Koen Punt",
"url": "https://github.com/koenpunt"
}
],
"dependencies": {},
"description": "Chosen is a JavaScript plugin that makes select boxes user-friendly. It is currently available in both jQuery and Prototype flavors.",
"devDependencies": {},
"directories": {},
"dist": {
"shasum": "8ceb2e929e2a072886edd384d78989dfbffa58c3",
"tarball": "https://registry.npmjs.org/chosen-js/-/chosen-js-1.7.0.tgz"
},
"files": [
"chosen.jquery.js",
"chosen.css",
"chosen-sprite@2x.png",
"chosen-sprite.png"
],
"gitHead": "20457c69249226af89fda0b357591622b922b36a",
"homepage": "https://harvesthq.github.io/chosen/",
"keywords": [
"select",
"multiselect",
"dropdown",
"form",
"input",
"ui"
],
"license": "MIT",
"main": "chosen.jquery.js",
"maintainers": [
{
"name": "chosenjs",
"email": "chosenjs@getharvest.com"
}
],
"name": "chosen-js",
"optionalDependencies": {},
"readme": "ERROR: No README data found!",
"repository": {
"type": "git",
"url": "git+https://github.com/harvesthq/chosen.git"
},
"scripts": {},
"version": "1.7.0"
}
......@@ -14,6 +14,7 @@
{% bootstrap_javascript jquery='slim' %}
{% fontawesome_stylesheet %}
{% block imports %}{% endblock %}
</head>
<body>
{% block language-switcher %}
......@@ -60,5 +61,7 @@
{% endblock %}
</div>
{% block bottom_script %}{% endblock %}
</body>
</html>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment