diff --git a/Eshop/__init__.py b/Eshop/__init__.py new file mode 100644 index 0000000..c61f40e --- /dev/null +++ b/Eshop/__init__.py @@ -0,0 +1 @@ +from .celery import app as celery_app \ No newline at end of file diff --git a/Eshop/celery.py b/Eshop/celery.py new file mode 100644 index 0000000..f35a775 --- /dev/null +++ b/Eshop/celery.py @@ -0,0 +1,10 @@ +import os +from celery import Celery +from django.conf import settings + +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'Eshop.settings') + +app = Celery('Eshop') + +app.config_from_object('django.conf:settings') +app.autodiscover_tasks(lambda: settings.INSTALLED_APPS) \ No newline at end of file diff --git a/Eshop/settings.py b/Eshop/settings.py new file mode 100644 index 0000000..71ec9fc --- /dev/null +++ b/Eshop/settings.py @@ -0,0 +1,215 @@ +""" +Django settings for Eshop project. + +Generated by 'django-admin startproject' using Django 1.10.6. + +For more information on this file, see +https://docs.djangoproject.com/en/1.10/topics/settings/ + +For the full list of settings and their values, see +https://docs.djangoproject.com/en/1.10/ref/settings/ +""" + +import os + +# Build paths inside the project like this: os.path.join(BASE_DIR, ...) +BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) + + +# Quick-start development settings - unsuitable for production +# See https://docs.djangoproject.com/en/1.10/howto/deployment/checklist/ + +# SECURITY WARNING: keep the secret key used in production secret! +# SECRET_KEY = '5bad1g&sjplz#xd@kz0d=ej%xw(n&_6ng#)()np9(vl)lw_h8u' +SECRET_KEY = os.environ.get('SOME_SECRET_KEY', '5bad1g&sjplz#xd@kz0d=ej%xw(n&_6ng#)()np9(vl)lw_h8u') + +# SECURITY WARNING: don't run with debug turned on in production! +DEBUG = eval(os.environ.get('DEBUG_MODE', 'True')) + +TEMPLATE_DEBUG = DEBUG + +ALLOWED_HOSTS = [] if DEBUG else ['78.155.219.170'] + + +# Application definition + +INSTALLED_APPS = [ + 'suit', + 'django.contrib.admin', + 'django.contrib.auth', + 'django.contrib.contenttypes', + 'django.contrib.sessions', + 'django.contrib.messages', + 'django.contrib.staticfiles', + 'django.contrib.postgres', + + 'import_export', + 'djcelery_email', + 'mptt', + 'landing', + 'orders', + 'loginsys', + 'userprofile', + # 'haystack', + 'products', + 'cart', + # 'paypal.standard.ipn', + # 'payment', + 'discount', + +] + +MIDDLEWARE = [ + 'django.middleware.security.SecurityMiddleware', + 'django.contrib.sessions.middleware.SessionMiddleware', + 'django.middleware.common.CommonMiddleware', + 'django.middleware.csrf.CsrfViewMiddleware', + 'django.contrib.auth.middleware.AuthenticationMiddleware', + 'django.contrib.messages.middleware.MessageMiddleware', + 'django.middleware.clickjacking.XFrameOptionsMiddleware', +] + +ROOT_URLCONF = 'Eshop.urls' + +TEMPLATES = [ + { + 'BACKEND': 'django.template.backends.django.DjangoTemplates', + 'DIRS': [os.path.join(BASE_DIR, 'templates')], + 'APP_DIRS': True, + 'OPTIONS': { + 'context_processors': [ + 'django.template.context_processors.debug', + 'django.template.context_processors.request', + 'django.contrib.auth.context_processors.auth', + 'django.contrib.messages.context_processors.messages', + 'cart.context_processors.cart', + # 'orders.context_processors.getting_basket_info', + ], + }, + }, +] + +WSGI_APPLICATION = 'Eshop.wsgi.application' + +MPTT_ADMIN_LEVEL_INDENT = 20 +# Database +# https://docs.djangoproject.com/en/1.10/ref/settings/#databases + + +if DEBUG: + DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.postgresql_psycopg2', + 'NAME': 'eshop_db', + 'USER': 'denis', + 'PASSWORD': '12345678', + 'HOST': 'localhost', + 'PORT': '', + } + } +else: + DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.postgresql_psycopg2', + 'NAME': 'db1', + 'USER': 'django_shop', + 'PASSWORD': 'django_shop12345', + 'HOST': 'localhost', + 'PORT': '', + } + } + + +# Password validation +# https://docs.djangoproject.com/en/1.10/ref/settings/#auth-password-validators + +AUTH_PASSWORD_VALIDATORS = [ + { + 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', + }, +] + + +# Internationalization +# https://docs.djangoproject.com/en/1.10/topics/i18n/ + +LANGUAGE_CODE = 'ru-RU' + +DATE_FORMAT = 'd E Y' + +TIME_ZONE = 'UTC' + +USE_I18N = True + +USE_L10N = True + +USE_TZ = True + + +# Static files (CSS, JavaScript, Images) +# https://docs.djangoproject.com/en/1.10/howto/static-files/ + +STATIC_URL = '/static/' + +STATICFILES_DIRS = ( + os.path.join(BASE_DIR, "static", "static_dev"), +) + +STATIC_ROOT = os.path.join(BASE_DIR, "static/")#, "static_dev") + +MEDIA_URL = '/media/' + +MEDIA_ROOT = os.path.join(BASE_DIR, "static", "media") + +AUTH_PROFILE_MODULE = 'userprofile.UserProfile' + +CART_SESSION_ID = 'cart' + +# Email +ADMINS = ( + ('Denis Balyasnikov', 'bda2291@mail.ru'), +) + +MANAGERS = ADMINS + +EMAIL_USE_TLS = True +EMAIL_HOST = 'smtp.gmail.com' +EMAIL_PORT = 587 +EMAIL_HOST_USER = 'balyasnikovdenis22@gmail.com' +EMAIL_HOST_PASSWORD = 'ltybcbrhbcnbyf22' + +FROM_EMAIL = 'notreply@russianprograms' +EMAIL_BACKEND = 'djcelery_email.backends.CeleryEmailBackend' + +# for import-export excel data +IMPORT_EXPORT_USE_TRANSACTIONS = True + +# WHOOSH_INDEX = os.path.join(os.path.dirname(__file__), "whoosh/") + +# Uncomment for elasticsearch + +# HAYSTACK_SIGNAL_PROCESSOR = 'haystack.signals.RealtimeSignalProcessor' +# HAYSTACK_SEARCH_RESULTS_PER_PAGE = 12 +# HAYSTACK_CONNECTIONS = { +# 'default': { +# 'ENGINE': 'haystack.backends.elasticsearch_backend.ElasticsearchSearchEngine', +# 'URL': 'http://127.0.0.1:9200', +# 'INDEX_NAME': 'haystack', +# # 'INCLUDE_SPELLING': True, +# }, +# } + +import dj_database_url +db_from_env = dj_database_url.config(conn_max_age=500) +DATABASES['default'].update(db_from_env) + +#STATICFILES_STORAGE = 'whitenoise.django.GzipManifestStaticFilesStorage' \ No newline at end of file diff --git a/Eshop/urls.py b/Eshop/urls.py new file mode 100644 index 0000000..6444404 --- /dev/null +++ b/Eshop/urls.py @@ -0,0 +1,36 @@ +"""Eshop URL Configuration + +The `urlpatterns` list routes URLs to views. For more information please see: + https://docs.djangoproject.com/en/1.10/topics/http/urls/ +Examples: +Function views + 1. Add an import: from my_app import views + 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') +Class-based views + 1. Add an import: from other_app.views import Home + 2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home') +Including another URLconf + 1. Import the include() function: from django.conf.urls import url, include + 2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls')) +""" +from django.conf.urls import url, include +from django.contrib import admin +from django.conf import settings +from django.conf.urls.static import static + +admin.autodiscover() + +urlpatterns = [ + url(r'^admin/', admin.site.urls), + url(r'^auth/', include('loginsys.urls', namespace='auth')), + url(r'^accounts/', include('userprofile.urls', namespace='profile')), + url(r'^cart/', include('cart.urls', namespace='cart')), + url(r'^order/', include('orders.urls', namespace='orders')), + url(r'^discount/', include('discount.urls', namespace='discount')), + url(r'^search/', include('products.urls', namespace='products_search')), + url(r'^', include('products.urls', namespace='products')), + url(r'^', include('landing.urls')), + url(r'^', include('orders.urls')), +]\ + + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT) \ + + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) diff --git a/Eshop/wsgi.py b/Eshop/wsgi.py new file mode 100644 index 0000000..d3d6fe9 --- /dev/null +++ b/Eshop/wsgi.py @@ -0,0 +1,18 @@ +""" +WSGI config for Eshop project. + +It exposes the WSGI callable as a module-level variable named ``application``. + +For more information on this file, see +https://docs.djangoproject.com/en/1.10/howto/deployment/wsgi/ +""" + +import os + +from django.core.wsgi import get_wsgi_application +# from whitenoise.django import DjangoWhiteNoise + +os.environ.setdefault("DJANGO_SETTINGS_MODULE", "Eshop.settings") + +application = get_wsgi_application() +# application = DjangoWhiteNoise(application) diff --git a/Offer-2017-09-04.xls b/Offer-2017-09-04.xls new file mode 100644 index 0000000..513ce4d Binary files /dev/null and b/Offer-2017-09-04.xls differ diff --git a/Procfile b/Procfile new file mode 100644 index 0000000..47a27c0 --- /dev/null +++ b/Procfile @@ -0,0 +1 @@ +web: gunicorn gettingstarted.wsgi --log-file - diff --git a/Product-2017-09-05.xls b/Product-2017-09-05.xls new file mode 100644 index 0000000..ca19b77 Binary files /dev/null and b/Product-2017-09-05.xls differ diff --git a/cart/__init__.py b/cart/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/cart/admin.py b/cart/admin.py new file mode 100644 index 0000000..8c38f3f --- /dev/null +++ b/cart/admin.py @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/cart/apps.py b/cart/apps.py new file mode 100644 index 0000000..7cc6ec1 --- /dev/null +++ b/cart/apps.py @@ -0,0 +1,5 @@ +from django.apps import AppConfig + + +class CartConfig(AppConfig): + name = 'cart' diff --git a/cart/cart.py b/cart/cart.py new file mode 100644 index 0000000..de39a08 --- /dev/null +++ b/cart/cart.py @@ -0,0 +1,86 @@ +from decimal import Decimal +from django.conf import settings +from django.contrib import auth +from products.models import Product, Offer +# from discount.models import Discount + +class Cart(object): + def __init__(self, request): + self.session = request.session + self.discount_id = self.session.get('discount_id') + if request.user.is_authenticated(): + self.points = self.session.get('points') + self.points_quant = auth.get_user(request).profile.user_points + cart = self.session.get(settings.CART_SESSION_ID) + if not cart: + request.session['points'] = False + cart = self.session[settings.CART_SESSION_ID] = {} + self.cart = cart + + def add(self, offer, price_per_itom, quantity=1, update_quantity=False): + offer_slug = offer.slug + if offer_slug not in self.cart: + self.cart[offer_slug] = {'quantity': 0, + 'price': str(price_per_itom)} + if update_quantity: + self.cart[offer_slug]['quantity'] = int(quantity) + else: + self.cart[offer_slug]['quantity'] += int(quantity) + self.save() + + def save(self): + self.session[settings.CART_SESSION_ID] = self.cart + self.session.modified = True + + def remove(self, offer_slug): + # product_id = str(product.id) + if offer_slug in self.cart: + del self.cart[offer_slug] + self.save() + + def __iter__(self): + offers_ids = self.cart.keys() + offers = Offer.objects.filter(slug__in=offers_ids) + + for offer in offers: + self.cart[str(offer.slug)]['offer'] = offer + + for item in self.cart.values(): + item['price'] = Decimal(item['price']) + item['total_price'] = item['price'] * item['quantity'] + yield item + + def __len__(self): + return sum(item['quantity'] for item in self.cart.values()) + + def get_total_price(self): + return sum(Decimal(item['price']) * item['quantity'] for item in self.cart.values()) + + def clear(self): + del self.session[settings.CART_SESSION_ID] + self.session.modified = True + + # @property + # def discount(self): + # if self.discount_id: + # return Discount.objects.get(id=self.discount_id) + # return None + + # def get_discount(self): + # if self.discount: + # return (self.discount.discount / Decimal('100')) * self.get_total_price() + # return Decimal('0') + + # def get_total_price_after_discount(self): + # return self.get_total_price() - self.get_discount() + + def get_total_deduct_points(self): + total_price = self.get_total_price() + print(total_price, self.points_quant) + if total_price <= self.points_quant: + print('Less') + self.points_quant = self.points_quant - total_price + 1 + return 1 + print('More') + return total_price - self.points_quant + diff --git a/cart/context_processors.py b/cart/context_processors.py new file mode 100644 index 0000000..c6dba27 --- /dev/null +++ b/cart/context_processors.py @@ -0,0 +1,6 @@ +from .cart import Cart + + +def cart(request): + return {'cart': Cart(request)} + diff --git a/cart/forms.py b/cart/forms.py new file mode 100644 index 0000000..41528a6 --- /dev/null +++ b/cart/forms.py @@ -0,0 +1,22 @@ +from django import forms + +#PRODUCT_QUANTITY_CHOICES = [(i, str(i)) for i in range(1, 21)] + +class CartAddProductForm(forms.Form): + #quantity = forms.TypedChoiceField(choices=PRODUCT_QUANTITY_CHOICES, coerce=int) + quantity = forms.CharField(required=True, widget=forms.TextInput(attrs={ + 'id': 'quantity', + 'name': 'quantity', + 'type': 'number', + 'value': '0', + 'onchange': 'calculate()'})) + product_slug = forms.CharField(label="product_slug", widget=forms.TextInput(attrs={ + 'id': 'product_slug', + 'name': 'product_slug', + 'type': 'hidden'})) + price_per_itom = forms.IntegerField(label="price_per_itom", widget=forms.TextInput(attrs={ + 'id': 'price_per_itom', + 'name': 'price_per_itom', + 'type': 'hidden'})) + update = forms.BooleanField(required=False, initial=False, widget=forms.HiddenInput) + diff --git a/cart/models.py b/cart/models.py new file mode 100644 index 0000000..71a8362 --- /dev/null +++ b/cart/models.py @@ -0,0 +1,3 @@ +from django.db import models + +# Create your models here. diff --git a/cart/tests.py b/cart/tests.py new file mode 100644 index 0000000..7ce503c --- /dev/null +++ b/cart/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/cart/urls.py b/cart/urls.py new file mode 100644 index 0000000..e3886ce --- /dev/null +++ b/cart/urls.py @@ -0,0 +1,8 @@ +from django.conf.urls import url +from . import views + +urlpatterns = [ + url(r'^$', views.CartDetail, name='CartDetail'), + url(r'^remove/(?P[-\w]+)/$', views.CartRemove, name='CartRemove'), + url(r'^add/$', views.CartAdd, name='CartAdd'), +] \ No newline at end of file diff --git a/cart/views.py b/cart/views.py new file mode 100644 index 0000000..d8a9b45 --- /dev/null +++ b/cart/views.py @@ -0,0 +1,41 @@ +from django.shortcuts import render, redirect, get_object_or_404 +from django.views.decorators.http import require_POST +from django.views.decorators.csrf import csrf_exempt +from django.contrib import auth +from products.models import Product, Offer +from .cart import Cart +from .forms import CartAddProductForm +# from discount.forms import DiscountApllyForm + +@csrf_exempt +@require_POST +def CartAdd(request): + cart = Cart(request) + form = CartAddProductForm(request.POST) + if form.is_valid(): + cd = form.cleaned_data + offer = get_object_or_404(Offer, slug=cd['product_slug']) + cart.add(offer=offer, price_per_itom=cd['price_per_itom'], quantity=cd['quantity'], + update_quantity=cd['update']) + return redirect('cart:CartDetail') + +def CartRemove(request, offer_slug): + cart = Cart(request) + # offer = get_object_or_404(Offer, slug=offer_slug) + cart.remove(offer_slug) + return redirect('cart:CartDetail') + +def CartDetail(request, points=False): + user = auth.get_user(request) + cart = Cart(request) + for item in cart: + item['update_quantity_form'] = CartAddProductForm( + initial={ + 'quantity': item['quantity'], + 'product_slug': item['offer'].slug, + 'price_per_itom': item['price'], + 'update': True + }) + # discount_apply_form = DiscountApllyForm() + return render(request, 'cart/detail.html', {'username': user.username, 'points': points}) + # 'discount_apply_form': discount_apply_form}) diff --git a/discount/__init__.py b/discount/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/discount/admin.py b/discount/admin.py new file mode 100644 index 0000000..e4d7462 --- /dev/null +++ b/discount/admin.py @@ -0,0 +1,10 @@ +from django.contrib import admin +from .models import Discount + + +class DiscountAdmin(admin.ModelAdmin): + list_display = ['code', 'valid_from', 'valid_to', 'discount', 'active'] + list_filter = ['valid_from', 'valid_to', 'active'] + search_field = ['code'] + +admin.site.register(Discount, DiscountAdmin) diff --git a/discount/apps.py b/discount/apps.py new file mode 100644 index 0000000..3633dc9 --- /dev/null +++ b/discount/apps.py @@ -0,0 +1,5 @@ +from django.apps import AppConfig + + +class DiscountConfig(AppConfig): + name = 'discount' diff --git a/discount/forms.py b/discount/forms.py new file mode 100644 index 0000000..0f236ac --- /dev/null +++ b/discount/forms.py @@ -0,0 +1,4 @@ +from django import forms + +class DiscountApllyForm(forms.Form): + code = forms.CharField() diff --git a/discount/models.py b/discount/models.py new file mode 100644 index 0000000..0f6e807 --- /dev/null +++ b/discount/models.py @@ -0,0 +1,26 @@ +from django.db import models +import uuid +from django.db.models.signals import post_save +from datetime import datetime, timedelta +from django.core.validators import MinValueValidator, MaxValueValidator +from django.contrib.auth.models import User + +class Discount(models.Model): + user = models.OneToOneField(User, on_delete=models.CASCADE, null=True) + code = models.CharField(max_length=50, blank=True, unique=True, default=str(uuid.uuid4())) + valid_from = models.DateTimeField(default=datetime.now, blank=True) + valid_to = models.DateTimeField(default=datetime.now()+timedelta(days=7), blank=True) + discount = models.IntegerField(validators=[MinValueValidator(0), MaxValueValidator(100)], default=10) + active = models.BooleanField(default=True) + + def __str__(self): + return self.code + +def create_discount(sender, **kwargs): + if kwargs['created']: + user_discount = Discount.objects.create(user=kwargs['instance']) + +# post_save.connect(create_discount, sender=User) + +User.discount = property(lambda u: Discount.objects.get_or_create(user=u)[0]) + diff --git a/discount/tests.py b/discount/tests.py new file mode 100644 index 0000000..7ce503c --- /dev/null +++ b/discount/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/discount/urls.py b/discount/urls.py new file mode 100644 index 0000000..55725a2 --- /dev/null +++ b/discount/urls.py @@ -0,0 +1,9 @@ +from django.conf.urls import url +from . import views + + +urlpatterns = [ + url(r'^apply', views.DiscountApply, name='apply'), + url(r'^create', views.CreateDiscount, name='create'), + url(r'^points', views.PointsApply, name='points') +] \ No newline at end of file diff --git a/discount/views.py b/discount/views.py new file mode 100644 index 0000000..d67e384 --- /dev/null +++ b/discount/views.py @@ -0,0 +1,47 @@ +import uuid +from datetime import datetime +from django.shortcuts import render, redirect +from django.views.decorators.csrf import csrf_exempt +from datetime import datetime, timedelta +from django.contrib import auth +from django.views.decorators.http import require_POST +from django.contrib.auth.decorators import login_required +from .models import Discount +from .forms import DiscountApllyForm + +@login_required +@require_POST +@csrf_exempt +def PointsApply(request): + # request.session['points'] = True + return redirect('cart:CartDetail', points=True) + +@require_POST +def DiscountApply(request): + now = datetime.now() + form = DiscountApllyForm(request.POST) + if form.is_valid(): + code = form.cleaned_data['code'] + try: + discount = Discount.objects.get(code__iexact=code, + valid_from__lte=now, + valid_to__gte=now, + active=True) + request.session['discount_id'] = discount.id + except Discount.DoesNotExist: + request.session['discount_id'] = None + + return redirect('cart:CartDetail') + +@login_required +@require_POST +@csrf_exempt +def CreateDiscount(request): + user = auth.get_user(request) + Discount.objects.update_or_create(user=user, defaults={'code': str(uuid.uuid4()), 'valid_from': datetime.now(), + 'valid_to': datetime.now()+timedelta(days=7), 'active': True}) + return redirect('profile:user_profile') + + + + diff --git a/elasticsearch-1.7.6/LICENSE.txt b/elasticsearch-1.7.6/LICENSE.txt new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/elasticsearch-1.7.6/LICENSE.txt @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/elasticsearch-1.7.6/NOTICE.txt b/elasticsearch-1.7.6/NOTICE.txt new file mode 100644 index 0000000..23cae9e --- /dev/null +++ b/elasticsearch-1.7.6/NOTICE.txt @@ -0,0 +1,5 @@ +Elasticsearch +Copyright 2009-2015 Elasticsearch + +This product includes software developed by The Apache Software +Foundation (http://www.apache.org/). diff --git a/elasticsearch-1.7.6/README.textile b/elasticsearch-1.7.6/README.textile new file mode 100644 index 0000000..720f357 --- /dev/null +++ b/elasticsearch-1.7.6/README.textile @@ -0,0 +1,235 @@ +h1. Elasticsearch + +h2. A Distributed RESTful Search Engine + +h3. "https://www.elastic.co/products/elasticsearch":https://www.elastic.co/products/elasticsearch + +Elasticsearch is a distributed RESTful search engine built for the cloud. Features include: + +* Distributed and Highly Available Search Engine. +** Each index is fully sharded with a configurable number of shards. +** Each shard can have one or more replicas. +** Read / Search operations performed on either one of the replica shard. +* Multi Tenant with Multi Types. +** Support for more than one index. +** Support for more than one type per index. +** Index level configuration (number of shards, index storage, ...). +* Various set of APIs +** HTTP RESTful API +** Native Java API. +** All APIs perform automatic node operation rerouting. +* Document oriented +** No need for upfront schema definition. +** Schema can be defined per type for customization of the indexing process. +* Reliable, Asynchronous Write Behind for long term persistency. +* (Near) Real Time Search. +* Built on top of Lucene +** Each shard is a fully functional Lucene index +** All the power of Lucene easily exposed through simple configuration / plugins. +* Per operation consistency +** Single document level operations are atomic, consistent, isolated and durable. +* Open Source under the Apache License, version 2 ("ALv2") + +h2. Getting Started + +First of all, DON'T PANIC. It will take 5 minutes to get the gist of what Elasticsearch is all about. + +h3. Requirements + +You need to have a recent version of Java installed. See the "Setup":http://www.elastic.co/guide/en/elasticsearch/reference/current/setup.html#jvm-version page for more information. + +h3. Installation + +* "Download":https://www.elastic.co/downloads/elasticsearch and unzip the Elasticsearch official distribution. +* Run @bin/elasticsearch@ on unix, or @bin\elasticsearch.bat@ on windows. +* Run @curl -X GET http://localhost:9200/@. +* Start more servers ... + +h3. Indexing + +Let's try and index some twitter like information. First, let's create a twitter user, and add some tweets (the @twitter@ index will be created automatically): + +
+curl -XPUT 'http://localhost:9200/twitter/user/kimchy' -d '{ "name" : "Shay Banon" }'
+
+curl -XPUT 'http://localhost:9200/twitter/tweet/1' -d '
+{
+    "user": "kimchy",
+    "postDate": "2009-11-15T13:12:00",
+    "message": "Trying out Elasticsearch, so far so good?"
+}'
+
+curl -XPUT 'http://localhost:9200/twitter/tweet/2' -d '
+{
+    "user": "kimchy",
+    "postDate": "2009-11-15T14:12:12",
+    "message": "Another tweet, will it be indexed?"
+}'
+
+ +Now, let's see if the information was added by GETting it: + +
+curl -XGET 'http://localhost:9200/twitter/user/kimchy?pretty=true'
+curl -XGET 'http://localhost:9200/twitter/tweet/1?pretty=true'
+curl -XGET 'http://localhost:9200/twitter/tweet/2?pretty=true'
+
+ +h3. Searching + +Mmm search..., shouldn't it be elastic? +Let's find all the tweets that @kimchy@ posted: + +
+curl -XGET 'http://localhost:9200/twitter/tweet/_search?q=user:kimchy&pretty=true'
+
+ +We can also use the JSON query language Elasticsearch provides instead of a query string: + +
+curl -XGET 'http://localhost:9200/twitter/tweet/_search?pretty=true' -d '
+{
+    "query" : {
+        "match" : { "user": "kimchy" }
+    }
+}'
+
+ +Just for kicks, let's get all the documents stored (we should see the user as well): + +
+curl -XGET 'http://localhost:9200/twitter/_search?pretty=true' -d '
+{
+    "query" : {
+        "matchAll" : {}
+    }
+}'
+
+ +We can also do range search (the @postDate@ was automatically identified as date) + +
+curl -XGET 'http://localhost:9200/twitter/_search?pretty=true' -d '
+{
+    "query" : {
+        "range" : {
+            "postDate" : { "from" : "2009-11-15T13:00:00", "to" : "2009-11-15T14:00:00" }
+        }
+    }
+}'
+
+ +There are many more options to perform search, after all, it's a search product no? All the familiar Lucene queries are available through the JSON query language, or through the query parser. + +h3. Multi Tenant - Indices and Types + +Maan, that twitter index might get big (in this case, index size == valuation). Let's see if we can structure our twitter system a bit differently in order to support such large amounts of data. + +Elasticsearch supports multiple indices, as well as multiple types per index. In the previous example we used an index called @twitter@, with two types, @user@ and @tweet@. + +Another way to define our simple twitter system is to have a different index per user (note, though that each index has an overhead). Here is the indexing curl's in this case: + +
+curl -XPUT 'http://localhost:9200/kimchy/info/1' -d '{ "name" : "Shay Banon" }'
+
+curl -XPUT 'http://localhost:9200/kimchy/tweet/1' -d '
+{
+    "user": "kimchy",
+    "postDate": "2009-11-15T13:12:00",
+    "message": "Trying out Elasticsearch, so far so good?"
+}'
+
+curl -XPUT 'http://localhost:9200/kimchy/tweet/2' -d '
+{
+    "user": "kimchy",
+    "postDate": "2009-11-15T14:12:12",
+    "message": "Another tweet, will it be indexed?"
+}'
+
+ +The above will index information into the @kimchy@ index, with two types, @info@ and @tweet@. Each user will get his own special index. + +Complete control on the index level is allowed. As an example, in the above case, we would want to change from the default 5 shards with 1 replica per index, to only 1 shard with 1 replica per index (== per twitter user). Here is how this can be done (the configuration can be in yaml as well): + +
+curl -XPUT http://localhost:9200/another_user/ -d '
+{
+    "index" : {
+        "numberOfShards" : 1,
+        "numberOfReplicas" : 1
+    }
+}'
+
+ +Search (and similar operations) are multi index aware. This means that we can easily search on more than one +index (twitter user), for example: + +
+curl -XGET 'http://localhost:9200/kimchy,another_user/_search?pretty=true' -d '
+{
+    "query" : {
+        "matchAll" : {}
+    }
+}'
+
+ +Or on all the indices: + +
+curl -XGET 'http://localhost:9200/_search?pretty=true' -d '
+{
+    "query" : {
+        "matchAll" : {}
+    }
+}'
+
+ +{One liner teaser}: And the cool part about that? You can easily search on multiple twitter users (indices), with different boost levels per user (index), making social search so much simpler (results from my friends rank higher than results from friends of my friends). + +h3. Distributed, Highly Available + +Let's face it, things will fail.... + +Elasticsearch is a highly available and distributed search engine. Each index is broken down into shards, and each shard can have one or more replica. By default, an index is created with 5 shards and 1 replica per shard (5/1). There are many topologies that can be used, including 1/10 (improve search performance), or 20/1 (improve indexing performance, with search executed in a map reduce fashion across shards). + +In order to play with the distributed nature of Elasticsearch, simply bring more nodes up and shut down nodes. The system will continue to serve requests (make sure you use the correct http port) with the latest data indexed. + +h3. Where to go from here? + +We have just covered a very small portion of what Elasticsearch is all about. For more information, please refer to the "elastic.co":http://www.elastic.co/products/elasticsearch website. + +h3. Building from Source + +Elasticsearch uses "Maven":http://maven.apache.org for its build system. + +In order to create a distribution, simply run the @mvn clean package +-DskipTests@ command in the cloned directory. + +The distribution will be created under @target/releases@. + +See the "TESTING":TESTING.asciidoc file for more information about +running the Elasticsearch test suite. + +h3. Upgrading to Elasticsearch 1.x? + +In order to ensure a smooth upgrade process from earlier versions of Elasticsearch (< 1.0.0), it is recommended to perform a full cluster restart. Please see the "setup reference":https://www.elastic.co/guide/en/elasticsearch/reference/current/setup-upgrade.html for more details on the upgrade process. + +h1. License + +
+This software is licensed under the Apache License, version 2 ("ALv2"), quoted below.
+
+Copyright 2009-2015 Elasticsearch 
+
+Licensed under the Apache License, Version 2.0 (the "License"); you may not
+use this file except in compliance with the License. You may obtain a copy of
+the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+License for the specific language governing permissions and limitations under
+the License.
+
diff --git a/elasticsearch-1.7.6/bin/elasticsearch b/elasticsearch-1.7.6/bin/elasticsearch new file mode 100644 index 0000000..9cf443f --- /dev/null +++ b/elasticsearch-1.7.6/bin/elasticsearch @@ -0,0 +1,251 @@ +#!/bin/sh + +# OPTIONS: +# -d daemonize (run in background) +# -p pidfile write PID to +# -h +# --help print command line options +# -v print elasticsearch version, then exit +# -D prop set JAVA system property +# -X prop set non-standard JAVA system property +# --prop=val +# --prop val set elasticsearch property (i.e. -Des.=) + +# CONTROLLING STARTUP: +# +# This script relies on few environment variables to determine startup +# behavior, those variables are: +# +# ES_CLASSPATH -- A Java classpath containing everything necessary to run. +# JAVA_OPTS -- Additional arguments to the JVM for heap size, etc +# ES_JAVA_OPTS -- External Java Opts on top of the defaults set +# +# +# Optionally, exact memory values can be set using the following values, note, +# they can still be set using the `ES_JAVA_OPTS`. Sample format include "512m", and "10g". +# +# ES_HEAP_SIZE -- Sets both the minimum and maximum memory to allocate (recommended) +# +# As a convenience, a fragment of shell is sourced in order to set one or +# more of these variables. This so-called `include' can be placed in a +# number of locations and will be searched for in order. The lowest +# priority search path is the same directory as the startup script, and +# since this is the location of the sample in the project tree, it should +# almost work Out Of The Box. +# +# Any serious use-case though will likely require customization of the +# include. For production installations, it is recommended that you copy +# the sample to one of /usr/share/elasticsearch/elasticsearch.in.sh, +# /usr/local/share/elasticsearch/elasticsearch.in.sh, or +# /opt/elasticsearch/elasticsearch.in.sh and make your modifications there. +# +# Another option is to specify the full path to the include file in the +# environment. For example: +# +# $ ES_INCLUDE=/path/to/in.sh elasticsearch -p /var/run/es.pid +# +# Note: This is particularly handy for running multiple instances on a +# single installation, or for quick tests. +# +# If you would rather configure startup entirely from the environment, you +# can disable the include by exporting an empty ES_INCLUDE, or by +# ensuring that no include files exist in the aforementioned search list. +# Be aware that you will be entirely responsible for populating the needed +# environment variables. + + +# Maven will replace the project.name with elasticsearch below. If that +# hasn't been done, we assume that this is not a packaged version and the +# user has forgotten to run Maven to create a package. +IS_PACKAGED_VERSION='elasticsearch' +if [ "$IS_PACKAGED_VERSION" != "elasticsearch" ]; then + cat >&2 << EOF +Error: You must build the project with Maven or download a pre-built package +before you can run Elasticsearch. See 'Building from Source' in README.textile +or visit http://www.elasticsearch.org/download to get a pre-built package. +EOF + exit 1 +fi + +CDPATH="" +SCRIPT="$0" + +# SCRIPT may be an arbitrarily deep series of symlinks. Loop until we have the concrete path. +while [ -h "$SCRIPT" ] ; do + ls=`ls -ld "$SCRIPT"` + # Drop everything prior to -> + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + SCRIPT="$link" + else + SCRIPT=`dirname "$SCRIPT"`/"$link" + fi +done + +# determine elasticsearch home +ES_HOME=`dirname "$SCRIPT"`/.. + +# make ELASTICSEARCH_HOME absolute +ES_HOME=`cd "$ES_HOME"; pwd` + + +# If an include wasn't specified in the environment, then search for one... +if [ "x$ES_INCLUDE" = "x" ]; then + # Locations (in order) to use when searching for an include file. + for include in /usr/share/elasticsearch/elasticsearch.in.sh \ + /usr/local/share/elasticsearch/elasticsearch.in.sh \ + /opt/elasticsearch/elasticsearch.in.sh \ + ~/.elasticsearch.in.sh \ + $ES_HOME/bin/elasticsearch.in.sh \ + "`dirname "$0"`"/elasticsearch.in.sh; do + if [ -r "$include" ]; then + . "$include" + break + fi + done +# ...otherwise, source the specified include. +elif [ -r "$ES_INCLUDE" ]; then + . "$ES_INCLUDE" +fi + +if [ -x "$JAVA_HOME/bin/java" ]; then + JAVA="$JAVA_HOME/bin/java" +else + JAVA=`which java` +fi + +if [ ! -x "$JAVA" ]; then + echo "Could not find any executable java binary. Please install java in your PATH or set JAVA_HOME" + exit 1 +fi + +if [ -z "$ES_CLASSPATH" ]; then + echo "You must set the ES_CLASSPATH var" >&2 + exit 1 +fi + +# Special-case path variables. +case `uname` in + CYGWIN*) + ES_CLASSPATH=`cygpath -p -w "$ES_CLASSPATH"` + ES_HOME=`cygpath -p -w "$ES_HOME"` + ;; +esac + +launch_service() +{ + pidpath=$1 + daemonized=$2 + props=$3 + es_parms="-Delasticsearch" + + if [ "x$pidpath" != "x" ]; then + es_parms="$es_parms -Des.pidfile=$pidpath" + fi + + # Make sure we dont use any predefined locale, as we check some exception message strings and rely on english language + # As those strings are created by the OS, they are dependant on the configured locale + LANG=en_US.UTF-8 + LC_ALL=en_US.UTF-8 + + export HOSTNAME=`hostname -s` + + # The es-foreground option will tell Elasticsearch not to close stdout/stderr, but it's up to us not to daemonize. + if [ "x$daemonized" = "x" ]; then + es_parms="$es_parms -Des.foreground=yes" + exec "$JAVA" $JAVA_OPTS $ES_JAVA_OPTS $es_parms -Des.path.home="$ES_HOME" -cp "$ES_CLASSPATH" $props \ + org.elasticsearch.bootstrap.Elasticsearch + # exec without running it in the background, makes it replace this shell, we'll never get here... + # no need to return something + else + # Startup Elasticsearch, background it, and write the pid. + exec "$JAVA" $JAVA_OPTS $ES_JAVA_OPTS $es_parms -Des.path.home="$ES_HOME" -cp "$ES_CLASSPATH" $props \ + org.elasticsearch.bootstrap.Elasticsearch <&- & + return $? + fi +} + +# Print command line usage / help +usage() { + echo "Usage: $0 [-vdh] [-p pidfile] [-D prop] [-X prop]" + echo "Start elasticsearch." + echo " -d daemonize (run in background)" + echo " -p pidfile write PID to " + echo " -h" + echo " --help print command line options" + echo " -v print elasticsearch version, then exit" + echo " -D prop set JAVA system property" + echo " -X prop set non-standard JAVA system property" + echo " --prop=val" + echo " --prop val set elasticsearch property (i.e. -Des.=)" +} + +# Parse any long getopt options and put them into properties before calling getopt below +# Be dash compatible to make sure running under ubuntu works +ARGV="" +while [ $# -gt 0 ] +do + case $1 in + --help) ARGV="$ARGV -h"; shift;; + --*=*) properties="$properties -Des.${1#--}" + shift 1 + ;; + --*) [ $# -le 1 ] && { + echo "Option requires an argument: '$1'." + shift + continue + } + properties="$properties -Des.${1#--}=$2" + shift 2 + ;; + *) ARGV="$ARGV $1" ; shift + esac +done + +# Parse any command line options. +args=`getopt vdhp:D:X: $ARGV` +eval set -- "$args" + +while true; do + case $1 in + -v) + "$JAVA" $JAVA_OPTS $ES_JAVA_OPTS $es_parms -Des.path.home="$ES_HOME" -cp "$ES_CLASSPATH" $props \ + org.elasticsearch.Version + exit 0 + ;; + -p) + pidfile="$2" + shift 2 + ;; + -d) + daemonized="yes" + shift + ;; + -h) + usage + exit 0 + ;; + -D) + properties="$properties -D$2" + shift 2 + ;; + -X) + properties="$properties -X$2" + shift 2 + ;; + --) + shift + break + ;; + *) + echo "Error parsing argument $1!" >&2 + usage + exit 1 + ;; + esac +done + +# Start up the service +launch_service "$pidfile" "$daemonized" "$properties" + +exit $? \ No newline at end of file diff --git a/elasticsearch-1.7.6/bin/elasticsearch-service-mgr.exe b/elasticsearch-1.7.6/bin/elasticsearch-service-mgr.exe new file mode 100644 index 0000000..e69de29 diff --git a/elasticsearch-1.7.6/bin/elasticsearch-service-x64.exe b/elasticsearch-1.7.6/bin/elasticsearch-service-x64.exe new file mode 100644 index 0000000..e69de29 diff --git a/elasticsearch-1.7.6/bin/elasticsearch-service-x86.exe b/elasticsearch-1.7.6/bin/elasticsearch-service-x86.exe new file mode 100644 index 0000000..e69de29 diff --git a/elasticsearch-1.7.6/bin/elasticsearch.bat b/elasticsearch-1.7.6/bin/elasticsearch.bat new file mode 100644 index 0000000..0981f62 --- /dev/null +++ b/elasticsearch-1.7.6/bin/elasticsearch.bat @@ -0,0 +1,48 @@ +@echo off + +SETLOCAL enabledelayedexpansion +TITLE Elasticsearch 1.7.6 + +SET params='%*' + +:loop +FOR /F "usebackq tokens=1* delims= " %%A IN (!params!) DO ( + SET current=%%A + SET params='%%B' + SET silent=N + + IF "!current!" == "-s" ( + SET silent=Y + ) + IF "!current!" == "--silent" ( + SET silent=Y + ) + + IF "!silent!" == "Y" ( + SET nopauseonerror=Y + ) ELSE ( + IF "x!newparams!" NEQ "x" ( + SET newparams=!newparams! !current! + ) ELSE ( + SET newparams=!current! + ) + ) + + IF "x!params!" NEQ "x" ( + GOTO loop + ) +) + +SET HOSTNAME=%COMPUTERNAME% + +CALL "%~dp0elasticsearch.in.bat" +IF ERRORLEVEL 1 ( + IF NOT DEFINED nopauseonerror ( + PAUSE + ) + EXIT /B %ERRORLEVEL% +) + +"%JAVA_HOME%\bin\java" %JAVA_OPTS% %ES_JAVA_OPTS% %ES_PARAMS% !newparams! -cp "%ES_CLASSPATH%" "org.elasticsearch.bootstrap.Elasticsearch" + +ENDLOCAL \ No newline at end of file diff --git a/elasticsearch-1.7.6/bin/elasticsearch.in.bat b/elasticsearch-1.7.6/bin/elasticsearch.in.bat new file mode 100644 index 0000000..56b2ed9 --- /dev/null +++ b/elasticsearch-1.7.6/bin/elasticsearch.in.bat @@ -0,0 +1,83 @@ +@echo off + +if DEFINED JAVA_HOME goto cont + +:err +ECHO JAVA_HOME environment variable must be set! 1>&2 +EXIT /B 1 + +:cont +set SCRIPT_DIR=%~dp0 +for %%I in ("%SCRIPT_DIR%..") do set ES_HOME=%%~dpfI + + +REM ***** JAVA options ***** + +if "%ES_MIN_MEM%" == "" ( +set ES_MIN_MEM=256m +) + +if "%ES_MAX_MEM%" == "" ( +set ES_MAX_MEM=1g +) + +if NOT "%ES_HEAP_SIZE%" == "" ( +set ES_MIN_MEM=%ES_HEAP_SIZE% +set ES_MAX_MEM=%ES_HEAP_SIZE% +) + +REM min and max heap sizes should be set to the same value to avoid +REM stop-the-world GC pauses during resize, and so that we can lock the +REM heap in memory on startup to prevent any of it from being swapped +REM out. +set JAVA_OPTS=%JAVA_OPTS% -Xms%ES_MIN_MEM% -Xmx%ES_MAX_MEM% + +REM new generation +if NOT "%ES_HEAP_NEWSIZE%" == "" ( +set JAVA_OPTS=%JAVA_OPTS% -Xmn%ES_HEAP_NEWSIZE% +) + +REM max direct memory +if NOT "%ES_DIRECT_SIZE%" == "" ( +set JAVA_OPTS=%JAVA_OPTS% -XX:MaxDirectMemorySize=%ES_DIRECT_SIZE% +) + +REM set to headless, just in case +set JAVA_OPTS=%JAVA_OPTS% -Djava.awt.headless=true + +REM Force the JVM to use IPv4 stack +if NOT "%ES_USE_IPV4%" == "" ( +set JAVA_OPTS=%JAVA_OPTS% -Djava.net.preferIPv4Stack=true +) + +set JAVA_OPTS=%JAVA_OPTS% -XX:+UseParNewGC +set JAVA_OPTS=%JAVA_OPTS% -XX:+UseConcMarkSweepGC + +set JAVA_OPTS=%JAVA_OPTS% -XX:CMSInitiatingOccupancyFraction=75 +set JAVA_OPTS=%JAVA_OPTS% -XX:+UseCMSInitiatingOccupancyOnly + +REM When running under Java 7 +REM JAVA_OPTS=%JAVA_OPTS% -XX:+UseCondCardMark + +if NOT "%ES_USE_GC_LOGGING%" == "" set JAVA_OPTS=%JAVA_OPTS% -XX:+PrintGCDetails +if NOT "%ES_USE_GC_LOGGING%" == "" set JAVA_OPTS=%JAVA_OPTS% -XX:+PrintGCTimeStamps +if NOT "%ES_USE_GC_LOGGING%" == "" set JAVA_OPTS=%JAVA_OPTS% -XX:+PrintGCDateStamps +if NOT "%ES_USE_GC_LOGGING%" == "" set JAVA_OPTS=%JAVA_OPTS% -XX:+PrintClassHistogram +if NOT "%ES_USE_GC_LOGGING%" == "" set JAVA_OPTS=%JAVA_OPTS% -XX:+PrintTenuringDistribution +if NOT "%ES_USE_GC_LOGGING%" == "" set JAVA_OPTS=%JAVA_OPTS% -XX:+PrintGCApplicationStoppedTime +if NOT "%ES_USE_GC_LOGGING%" == "" set JAVA_OPTS=%JAVA_OPTS% -Xloggc:%ES_HOME%/logs/gc.log + +REM Causes the JVM to dump its heap on OutOfMemory. +set JAVA_OPTS=%JAVA_OPTS% -XX:+HeapDumpOnOutOfMemoryError +REM The path to the heap dump location, note directory must exists and have enough +REM space for a full heap dump. +REM JAVA_OPTS=%JAVA_OPTS% -XX:HeapDumpPath=$ES_HOME/logs/heapdump.hprof + +REM Disables explicit GC +set JAVA_OPTS=%JAVA_OPTS% -XX:+DisableExplicitGC + +REM Ensure UTF-8 encoding by default (e.g. filenames) +set JAVA_OPTS=%JAVA_OPTS% -Dfile.encoding=UTF-8 + +set ES_CLASSPATH=%ES_CLASSPATH%;%ES_HOME%/lib/elasticsearch-1.7.6.jar;%ES_HOME%/lib/*;%ES_HOME%/lib/sigar/* +set ES_PARAMS=-Delasticsearch -Des-foreground=yes -Des.path.home="%ES_HOME%" \ No newline at end of file diff --git a/elasticsearch-1.7.6/bin/elasticsearch.in.sh b/elasticsearch-1.7.6/bin/elasticsearch.in.sh new file mode 100644 index 0000000..6ca8f97 --- /dev/null +++ b/elasticsearch-1.7.6/bin/elasticsearch.in.sh @@ -0,0 +1,68 @@ +#!/bin/sh + +ES_CLASSPATH=$ES_CLASSPATH:$ES_HOME/lib/elasticsearch-1.7.6.jar:$ES_HOME/lib/*:$ES_HOME/lib/sigar/* + +if [ "x$ES_MIN_MEM" = "x" ]; then + ES_MIN_MEM=256m +fi +if [ "x$ES_MAX_MEM" = "x" ]; then + ES_MAX_MEM=1g +fi +if [ "x$ES_HEAP_SIZE" != "x" ]; then + ES_MIN_MEM=$ES_HEAP_SIZE + ES_MAX_MEM=$ES_HEAP_SIZE +fi + +# min and max heap sizes should be set to the same value to avoid +# stop-the-world GC pauses during resize, and so that we can lock the +# heap in memory on startup to prevent any of it from being swapped +# out. +JAVA_OPTS="$JAVA_OPTS -Xms${ES_MIN_MEM}" +JAVA_OPTS="$JAVA_OPTS -Xmx${ES_MAX_MEM}" + +# new generation +if [ "x$ES_HEAP_NEWSIZE" != "x" ]; then + JAVA_OPTS="$JAVA_OPTS -Xmn${ES_HEAP_NEWSIZE}" +fi + +# max direct memory +if [ "x$ES_DIRECT_SIZE" != "x" ]; then + JAVA_OPTS="$JAVA_OPTS -XX:MaxDirectMemorySize=${ES_DIRECT_SIZE}" +fi + +# set to headless, just in case +JAVA_OPTS="$JAVA_OPTS -Djava.awt.headless=true" + +# Force the JVM to use IPv4 stack +if [ "x$ES_USE_IPV4" != "x" ]; then + JAVA_OPTS="$JAVA_OPTS -Djava.net.preferIPv4Stack=true" +fi + +JAVA_OPTS="$JAVA_OPTS -XX:+UseParNewGC" +JAVA_OPTS="$JAVA_OPTS -XX:+UseConcMarkSweepGC" + +JAVA_OPTS="$JAVA_OPTS -XX:CMSInitiatingOccupancyFraction=75" +JAVA_OPTS="$JAVA_OPTS -XX:+UseCMSInitiatingOccupancyOnly" + +# GC logging options +if [ "x$ES_USE_GC_LOGGING" != "x" ]; then + JAVA_OPTS="$JAVA_OPTS -XX:+PrintGCDetails" + JAVA_OPTS="$JAVA_OPTS -XX:+PrintGCTimeStamps" + JAVA_OPTS="$JAVA_OPTS -XX:+PrintGCDateStamps" + JAVA_OPTS="$JAVA_OPTS -XX:+PrintClassHistogram" + JAVA_OPTS="$JAVA_OPTS -XX:+PrintTenuringDistribution" + JAVA_OPTS="$JAVA_OPTS -XX:+PrintGCApplicationStoppedTime" + JAVA_OPTS="$JAVA_OPTS -Xloggc:/var/log/elasticsearch/gc.log" +fi + +# Causes the JVM to dump its heap on OutOfMemory. +JAVA_OPTS="$JAVA_OPTS -XX:+HeapDumpOnOutOfMemoryError" +# The path to the heap dump location, note directory must exists and have enough +# space for a full heap dump. +#JAVA_OPTS="$JAVA_OPTS -XX:HeapDumpPath=$ES_HOME/logs/heapdump.hprof" + +# Disables explicit GC +JAVA_OPTS="$JAVA_OPTS -XX:+DisableExplicitGC" + +# Ensure UTF-8 encoding by default (e.g. filenames) +JAVA_OPTS="$JAVA_OPTS -Dfile.encoding=UTF-8" \ No newline at end of file diff --git a/elasticsearch-1.7.6/bin/plugin b/elasticsearch-1.7.6/bin/plugin new file mode 100644 index 0000000..2204457 --- /dev/null +++ b/elasticsearch-1.7.6/bin/plugin @@ -0,0 +1,108 @@ +#!/bin/sh + +CDPATH="" +SCRIPT="$0" + +# SCRIPT may be an arbitrarily deep series of symlinks. Loop until we have the concrete path. +while [ -h "$SCRIPT" ] ; do + ls=`ls -ld "$SCRIPT"` + # Drop everything prior to -> + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + SCRIPT="$link" + else + SCRIPT=`dirname "$SCRIPT"`/"$link" + fi +done + +# determine elasticsearch home +ES_HOME=`dirname "$SCRIPT"`/.. + +# make ELASTICSEARCH_HOME absolute +ES_HOME=`cd "$ES_HOME"; pwd` + +# Sets the default values for elasticsearch variables used in this script +if [ -z "$CONF_DIR" ]; then + CONF_DIR="$ES_HOME/config" + + if [ -z "$CONF_FILE" ]; then + CONF_FILE="$CONF_DIR/elasticsearch.yml" + fi +fi + +if [ -z "$CONF_FILE" ]; then + CONF_FILE="$ES_HOME/config/elasticsearch.yml" +fi + +# The default env file is defined at building/packaging time. +# For a tar.gz package, the value is "". +ES_ENV_FILE="" + +# If an include is specified with the ES_INCLUDE environment variable, use it +if [ -n "$ES_INCLUDE" ]; then + ES_ENV_FILE="$ES_INCLUDE" +fi + +# Source the environment file +if [ -n "$ES_ENV_FILE" ]; then + + # If the ES_ENV_FILE is not found, try to resolve the path + # against the ES_HOME directory + if [ ! -f "$ES_ENV_FILE" ]; then + ES_ENV_FILE="$ELASTIC_HOME/$ES_ENV_FILE" + fi + + . "$ES_ENV_FILE" + if [ $? -ne 0 ]; then + echo "Unable to source environment file: $ES_ENV_FILE" >&2 + exit 1 + fi +fi + +if [ -x "$JAVA_HOME/bin/java" ]; then + JAVA=$JAVA_HOME/bin/java +else + JAVA=`which java` +fi + +# real getopt cannot be used because we need to hand options over to the PluginManager +while [ $# -gt 0 ]; do + case $1 in + -D*=*) + properties="$properties \"$1\"" + ;; + -D*) + var=$1 + shift + properties="$properties \"$var\"=\"$1\"" + ;; + *) + args="$args \"$1\"" + esac + shift +done + +# check if properties already has a config file or config dir +if [ -e "$CONF_DIR" ]; then + case "$properties" in + *-Des.default.path.conf=*|*-Des.path.conf=*) + ;; + *) + properties="$properties -Des.default.path.conf=\"$CONF_DIR\"" + ;; + esac +fi + +if [ -e "$CONF_FILE" ]; then + case "$properties" in + *-Des.default.config=*|*-Des.config=*) + ;; + *) + properties="$properties -Des.default.config=\"$CONF_FILE\"" + ;; + esac +fi + +export HOSTNAME=`hostname -s` + +eval "$JAVA" $JAVA_OPTS $ES_JAVA_OPTS -Xmx64m -Xms16m -Delasticsearch -Des.path.home=\""$ES_HOME"\" $properties -cp \""$ES_HOME/lib/*"\" org.elasticsearch.plugins.PluginManager $args \ No newline at end of file diff --git a/elasticsearch-1.7.6/bin/plugin.bat b/elasticsearch-1.7.6/bin/plugin.bat new file mode 100644 index 0000000..5c51e3f --- /dev/null +++ b/elasticsearch-1.7.6/bin/plugin.bat @@ -0,0 +1,25 @@ +@echo off + +SETLOCAL + +if NOT DEFINED JAVA_HOME goto err + +set SCRIPT_DIR=%~dp0 +for %%I in ("%SCRIPT_DIR%..") do set ES_HOME=%%~dpfI + +TITLE Elasticsearch Plugin Manager 1.7.6 + +SET HOSTNAME=%COMPUTERNAME% + +"%JAVA_HOME%\bin\java" %JAVA_OPTS% %ES_JAVA_OPTS% -Xmx64m -Xms16m -Des.path.home="%ES_HOME%" -cp "%ES_HOME%/lib/*;" "org.elasticsearch.plugins.PluginManager" %* +goto finally + + +:err +echo JAVA_HOME environment variable must be set! +pause + + +:finally + +ENDLOCAL \ No newline at end of file diff --git a/elasticsearch-1.7.6/bin/service.bat b/elasticsearch-1.7.6/bin/service.bat new file mode 100644 index 0000000..04dfcba --- /dev/null +++ b/elasticsearch-1.7.6/bin/service.bat @@ -0,0 +1,204 @@ +@echo off +SETLOCAL + +TITLE Elasticsearch Service 1.7.6 + +if NOT DEFINED JAVA_HOME goto err + +set SCRIPT_DIR=%~dp0 +for %%I in ("%SCRIPT_DIR%..") do set ES_HOME=%%~dpfI + +rem Detect JVM version to figure out appropriate executable to use +if not exist "%JAVA_HOME%\bin\java.exe" ( +echo JAVA_HOME points to an invalid Java installation (no java.exe found in "%JAVA_HOME%"^). Exiting... +goto:eof +) +"%JAVA_HOME%\bin\java" -version 2>&1 | "%windir%\System32\find" "64-Bit" >nul: + +if errorlevel 1 goto x86 +set EXECUTABLE=%ES_HOME%\bin\elasticsearch-service-x64.exe +set SERVICE_ID=elasticsearch-service-x64 +set ARCH=64-bit +goto checkExe + +:x86 +set EXECUTABLE=%ES_HOME%\bin\elasticsearch-service-x86.exe +set SERVICE_ID=elasticsearch-service-x86 +set ARCH=32-bit + +:checkExe +if EXIST "%EXECUTABLE%" goto okExe +echo elasticsearch-service-(x86|x64).exe was not found... + +:okExe +set ES_VERSION=1.7.6 + +if "%LOG_DIR%" == "" set LOG_DIR=%ES_HOME%\logs + +if "x%1x" == "xx" goto displayUsage +set SERVICE_CMD=%1 +shift +if "x%1x" == "xx" goto checkServiceCmd +set SERVICE_ID=%1 + +:checkServiceCmd + +if "%LOG_OPTS%" == "" set LOG_OPTS=--LogPath "%LOG_DIR%" --LogPrefix "%SERVICE_ID%" --StdError auto --StdOutput auto + +if /i %SERVICE_CMD% == install goto doInstall +if /i %SERVICE_CMD% == remove goto doRemove +if /i %SERVICE_CMD% == start goto doStart +if /i %SERVICE_CMD% == stop goto doStop +if /i %SERVICE_CMD% == manager goto doManagment +echo Unknown option "%SERVICE_CMD%" + +:displayUsage +echo. +echo Usage: service.bat install^|remove^|start^|stop^|manager [SERVICE_ID] +goto:eof + +:doStart +"%EXECUTABLE%" //ES//%SERVICE_ID% %LOG_OPTS% +if not errorlevel 1 goto started +echo Failed starting '%SERVICE_ID%' service +goto:eof +:started +echo The service '%SERVICE_ID%' has been started +goto:eof + +:doStop +"%EXECUTABLE%" //SS//%SERVICE_ID% %LOG_OPTS% +if not errorlevel 1 goto stopped +echo Failed stopping '%SERVICE_ID%' service +goto:eof +:stopped +echo The service '%SERVICE_ID%' has been stopped +goto:eof + +:doManagment +set EXECUTABLE_MGR=%ES_HOME%\bin\elasticsearch-service-mgr.exe +"%EXECUTABLE_MGR%" //ES//%SERVICE_ID% +if not errorlevel 1 goto managed +echo Failed starting service manager for '%SERVICE_ID%' +goto:eof +:managed +echo Succesfully started service manager for '%SERVICE_ID%'. +goto:eof + +:doRemove +rem Remove the service +"%EXECUTABLE%" //DS//%SERVICE_ID% %LOG_OPTS% +if not errorlevel 1 goto removed +echo Failed removing '%SERVICE_ID%' service +goto:eof +:removed +echo The service '%SERVICE_ID%' has been removed +goto:eof + +:doInstall +echo Installing service : "%SERVICE_ID%" +echo Using JAVA_HOME (%ARCH%): "%JAVA_HOME%" + +rem Check JVM server dll first +set JVM_DLL=%JAVA_HOME%\jre\bin\server\jvm.dll +if exist "%JVM_DLL%" goto foundJVM + +rem Check 'server' JRE (JRE installed on Windows Server) +set JVM_DLL=%JAVA_HOME%\bin\server\jvm.dll +if exist "%JVM_DLL%" goto foundJVM + +rem Fallback to 'client' JRE +set JVM_DLL=%JAVA_HOME%\bin\client\jvm.dll + +if exist "%JVM_DLL%" ( +echo Warning: JAVA_HOME points to a JRE and not JDK installation; a client (not a server^) JVM will be used... +) else ( +echo JAVA_HOME points to an invalid Java installation (no jvm.dll found in "%JAVA_HOME%"^). Existing... +goto:eof +) + +:foundJVM +if "%ES_MIN_MEM%" == "" set ES_MIN_MEM=256m +if "%ES_MAX_MEM%" == "" set ES_MAX_MEM=1g + +if NOT "%ES_HEAP_SIZE%" == "" set ES_MIN_MEM=%ES_HEAP_SIZE% +if NOT "%ES_HEAP_SIZE%" == "" set ES_MAX_MEM=%ES_HEAP_SIZE% + +call:convertxm %ES_MIN_MEM% JVM_XMS +call:convertxm %ES_MAX_MEM% JVM_XMX + +REM java_opts might be empty - init to avoid tripping commons daemon (if the command starts with ;) +if "%JAVA_OPTS%" == "" set JAVA_OPTS=-XX:+UseParNewGC + +CALL "%ES_HOME%\bin\elasticsearch.in.bat" + +rem thread stack size +set JVM_SS=256 + +if "%DATA_DIR%" == "" set DATA_DIR=%ES_HOME%\data + +if "%WORK_DIR%" == "" set WORK_DIR=%ES_HOME% + +if "%CONF_DIR%" == "" set CONF_DIR=%ES_HOME%\config + +if "%CONF_FILE%" == "" set CONF_FILE=%ES_HOME%\config\elasticsearch.yml + +set ES_PARAMS=-Delasticsearch;-Des.path.home="%ES_HOME%";-Des.default.config="%CONF_FILE%";-Des.default.path.home="%ES_HOME%";-Des.default.path.logs="%LOG_DIR%";-Des.default.path.data="%DATA_DIR%";-Des.default.path.work="%WORK_DIR%";-Des.default.path.conf="%CONF_DIR%" + +set JVM_OPTS=%JAVA_OPTS: =;% + +if not "%ES_JAVA_OPTS%" == "" set JVM_ES_JAVA_OPTS=%ES_JAVA_OPTS: =#% +if not "%ES_JAVA_OPTS%" == "" set JVM_OPTS=%JVM_OPTS%;%JVM_ES_JAVA_OPTS% + +if "%ES_START_TYPE%" == "" set ES_START_TYPE=manual +if "%ES_STOP_TIMEOUT%" == "" set ES_STOP_TIMEOUT=0 + +"%EXECUTABLE%" //IS//%SERVICE_ID% --Startup %ES_START_TYPE% --StopTimeout %ES_STOP_TIMEOUT% --StartClass org.elasticsearch.bootstrap.Elasticsearch --StopClass org.elasticsearch.bootstrap.Elasticsearch --StartMethod main --StopMethod close --Classpath "%ES_CLASSPATH%" --JvmSs %JVM_SS% --JvmMs %JVM_XMS% --JvmMx %JVM_XMX% --JvmOptions %JVM_OPTS% ++JvmOptions %ES_PARAMS% %LOG_OPTS% --PidFile "%SERVICE_ID%.pid" --DisplayName "Elasticsearch %ES_VERSION% (%SERVICE_ID%)" --Description "Elasticsearch %ES_VERSION% Windows Service - http://elasticsearch.org" --Jvm "%JVM_DLL%" --StartMode jvm --StopMode jvm --StartPath "%ES_HOME%" + + +if not errorlevel 1 goto installed +echo Failed installing '%SERVICE_ID%' service +goto:eof + +:installed +echo The service '%SERVICE_ID%' has been installed. +goto:eof + +:err +echo JAVA_HOME environment variable must be set! +pause +goto:eof + +rem --- +rem Function for converting Xm[s|x] values into MB which Commons Daemon accepts +rem --- +:convertxm +set value=%~1 +rem extract last char (unit) +set unit=%value:~-1% +rem assume the unit is specified +set conv=%value:~0,-1% + +if "%unit%" == "k" goto kilo +if "%unit%" == "K" goto kilo +if "%unit%" == "m" goto mega +if "%unit%" == "M" goto mega +if "%unit%" == "g" goto giga +if "%unit%" == "G" goto giga + +rem no unit found, must be bytes; consider the whole value +set conv=%value% +rem convert to KB +set /a conv=%conv% / 1024 +:kilo +rem convert to MB +set /a conv=%conv% / 1024 +goto mega +:giga +rem convert to MB +set /a conv=%conv% * 1024 +:mega +set "%~2=%conv%" +goto:eof + +ENDLOCAL \ No newline at end of file diff --git a/elasticsearch-1.7.6/config/elasticsearch.yml b/elasticsearch-1.7.6/config/elasticsearch.yml new file mode 100644 index 0000000..b4fe1af --- /dev/null +++ b/elasticsearch-1.7.6/config/elasticsearch.yml @@ -0,0 +1,385 @@ +##################### Elasticsearch Configuration Example ##################### + +# This file contains an overview of various configuration settings, +# targeted at operations staff. Application developers should +# consult the guide at . +# +# The installation procedure is covered at +# . +# +# Elasticsearch comes with reasonable defaults for most settings, +# so you can try it out without bothering with configuration. +# +# Most of the time, these defaults are just fine for running a production +# cluster. If you're fine-tuning your cluster, or wondering about the +# effect of certain configuration option, please _do ask_ on the +# mailing list or IRC channel [http://elasticsearch.org/community]. + +# Any element in the configuration can be replaced with environment variables +# by placing them in ${...} notation. For example: +# +#node.rack: ${RACK_ENV_VAR} + +# For information on supported formats and syntax for the config file, see +# + + +################################### Cluster ################################### + +# Cluster name identifies your cluster for auto-discovery. If you're running +# multiple clusters on the same network, make sure you're using unique names. +# +#cluster.name: elasticsearch + + +#################################### Node ##################################### + +# Node names are generated dynamically on startup, so you're relieved +# from configuring them manually. You can tie this node to a specific name: +# +#node.name: "Franz Kafka" + +# Every node can be configured to allow or deny being eligible as the master, +# and to allow or deny to store the data. +# +# Allow this node to be eligible as a master node (enabled by default): +# +#node.master: true +# +# Allow this node to store data (enabled by default): +# +#node.data: true + +# You can exploit these settings to design advanced cluster topologies. +# +# 1. You want this node to never become a master node, only to hold data. +# This will be the "workhorse" of your cluster. +# +#node.master: false +#node.data: true +# +# 2. You want this node to only serve as a master: to not store any data and +# to have free resources. This will be the "coordinator" of your cluster. +# +#node.master: true +#node.data: false +# +# 3. You want this node to be neither master nor data node, but +# to act as a "search load balancer" (fetching data from nodes, +# aggregating results, etc.) +# +#node.master: false +#node.data: false + +# Use the Cluster Health API [http://localhost:9200/_cluster/health], the +# Node Info API [http://localhost:9200/_nodes] or GUI tools +# such as , +# , +# and +# to inspect the cluster state. + +# A node can have generic attributes associated with it, which can later be used +# for customized shard allocation filtering, or allocation awareness. An attribute +# is a simple key value pair, similar to node.key: value, here is an example: +# +#node.rack: rack314 + +# By default, multiple nodes are allowed to start from the same installation location +# to disable it, set the following: +#node.max_local_storage_nodes: 1 + + +#################################### Index #################################### + +# You can set a number of options (such as shard/replica options, mapping +# or analyzer definitions, translog settings, ...) for indices globally, +# in this file. +# +# Note, that it makes more sense to configure index settings specifically for +# a certain index, either when creating it or by using the index templates API. +# +# See and +# +# for more information. + +# Set the number of shards (splits) of an index (5 by default): +# +#index.number_of_shards: 5 + +# Set the number of replicas (additional copies) of an index (1 by default): +# +#index.number_of_replicas: 1 + +# Note, that for development on a local machine, with small indices, it usually +# makes sense to "disable" the distributed features: +# +#index.number_of_shards: 1 +#index.number_of_replicas: 0 + +# These settings directly affect the performance of index and search operations +# in your cluster. Assuming you have enough machines to hold shards and +# replicas, the rule of thumb is: +# +# 1. Having more *shards* enhances the _indexing_ performance and allows to +# _distribute_ a big index across machines. +# 2. Having more *replicas* enhances the _search_ performance and improves the +# cluster _availability_. +# +# The "number_of_shards" is a one-time setting for an index. +# +# The "number_of_replicas" can be increased or decreased anytime, +# by using the Index Update Settings API. +# +# Elasticsearch takes care about load balancing, relocating, gathering the +# results from nodes, etc. Experiment with different settings to fine-tune +# your setup. + +# Use the Index Status API () to inspect +# the index status. + + +#################################### Paths #################################### + +# Path to directory containing configuration (this file and logging.yml): +# +#path.conf: /path/to/conf + +# Path to directory where to store index data allocated for this node. +# +#path.data: /path/to/data +# +# Can optionally include more than one location, causing data to be striped across +# the locations (a la RAID 0) on a file level, favouring locations with most free +# space on creation. For example: +# +#path.data: /path/to/data1,/path/to/data2 + +# Path to temporary files: +# +#path.work: /path/to/work + +# Path to log files: +# +#path.logs: /path/to/logs + +# Path to where plugins are installed: +# +#path.plugins: /path/to/plugins + + +#################################### Plugin ################################### + +# If a plugin listed here is not installed for current node, the node will not start. +# +#plugin.mandatory: mapper-attachments,lang-groovy + + +################################### Memory #################################### + +# Elasticsearch performs poorly when JVM starts swapping: you should ensure that +# it _never_ swaps. +# +# Set this property to true to lock the memory: +# +#bootstrap.mlockall: true + +# Make sure that the ES_MIN_MEM and ES_MAX_MEM environment variables are set +# to the same value, and that the machine has enough memory to allocate +# for Elasticsearch, leaving enough memory for the operating system itself. +# +# You should also make sure that the Elasticsearch process is allowed to lock +# the memory, eg. by using `ulimit -l unlimited`. + + +############################## Network And HTTP ############################### + +# Elasticsearch, by default, binds itself to the 0.0.0.0 address, and listens +# on port [9200-9300] for HTTP traffic and on port [9300-9400] for node-to-node +# communication. (the range means that if the port is busy, it will automatically +# try the next port). + +# Set the bind address specifically (IPv4 or IPv6): +# +#network.bind_host: 192.168.0.1 + +# Set the address other nodes will use to communicate with this node. If not +# set, it is automatically derived. It must point to an actual IP address. +# +#network.publish_host: 192.168.0.1 + +# Set both 'bind_host' and 'publish_host': +# +#network.host: 192.168.0.1 + +# Set a custom port for the node to node communication (9300 by default): +# +#transport.tcp.port: 9300 + +# Enable compression for all communication between nodes (disabled by default): +# +#transport.tcp.compress: true + +# Set a custom port to listen for HTTP traffic: +# +#http.port: 9200 + +# Set a custom allowed content length: +# +#http.max_content_length: 100mb + +# Disable HTTP completely: +# +#http.enabled: false + + +################################### Gateway ################################### + +# The gateway allows for persisting the cluster state between full cluster +# restarts. Every change to the state (such as adding an index) will be stored +# in the gateway, and when the cluster starts up for the first time, +# it will read its state from the gateway. + +# There are several types of gateway implementations. For more information, see +# . + +# The default gateway type is the "local" gateway (recommended): +# +#gateway.type: local + +# Settings below control how and when to start the initial recovery process on +# a full cluster restart (to reuse as much local data as possible when using shared +# gateway). + +# Allow recovery process after N nodes in a cluster are up: +# +#gateway.recover_after_nodes: 1 + +# Set the timeout to initiate the recovery process, once the N nodes +# from previous setting are up (accepts time value): +# +#gateway.recover_after_time: 5m + +# Set how many nodes are expected in this cluster. Once these N nodes +# are up (and recover_after_nodes is met), begin recovery process immediately +# (without waiting for recover_after_time to expire): +# +#gateway.expected_nodes: 2 + + +############################# Recovery Throttling ############################# + +# These settings allow to control the process of shards allocation between +# nodes during initial recovery, replica allocation, rebalancing, +# or when adding and removing nodes. + +# Set the number of concurrent recoveries happening on a node: +# +# 1. During the initial recovery +# +#cluster.routing.allocation.node_initial_primaries_recoveries: 4 +# +# 2. During adding/removing nodes, rebalancing, etc +# +#cluster.routing.allocation.node_concurrent_recoveries: 2 + +# Set to throttle throughput when recovering (eg. 100mb, by default 20mb): +# +#indices.recovery.max_bytes_per_sec: 20mb + +# Set to limit the number of open concurrent streams when +# recovering a shard from a peer: +# +#indices.recovery.concurrent_streams: 5 + + +################################## Discovery ################################## + +# Discovery infrastructure ensures nodes can be found within a cluster +# and master node is elected. Multicast discovery is the default. + +# Set to ensure a node sees N other master eligible nodes to be considered +# operational within the cluster. This should be set to a quorum/majority of +# the master-eligible nodes in the cluster. +# +#discovery.zen.minimum_master_nodes: 1 + +# Set the time to wait for ping responses from other nodes when discovering. +# Set this option to a higher value on a slow or congested network +# to minimize discovery failures: +# +#discovery.zen.ping.timeout: 3s + +# For more information, see +# + +# Unicast discovery allows to explicitly control which nodes will be used +# to discover the cluster. It can be used when multicast is not present, +# or to restrict the cluster communication-wise. +# +# 1. Disable multicast discovery (enabled by default): +# +#discovery.zen.ping.multicast.enabled: false +# +# 2. Configure an initial list of master nodes in the cluster +# to perform discovery when new nodes (master or data) are started: +# +#discovery.zen.ping.unicast.hosts: ["host1", "host2:port"] + +# EC2 discovery allows to use AWS EC2 API in order to perform discovery. +# +# You have to install the cloud-aws plugin for enabling the EC2 discovery. +# +# For more information, see +# +# +# See +# for a step-by-step tutorial. + +# GCE discovery allows to use Google Compute Engine API in order to perform discovery. +# +# You have to install the cloud-gce plugin for enabling the GCE discovery. +# +# For more information, see . + +# Azure discovery allows to use Azure API in order to perform discovery. +# +# You have to install the cloud-azure plugin for enabling the Azure discovery. +# +# For more information, see . + +################################## Slow Log ################################## + +# Shard level query and fetch threshold logging. + +#index.search.slowlog.threshold.query.warn: 10s +#index.search.slowlog.threshold.query.info: 5s +#index.search.slowlog.threshold.query.debug: 2s +#index.search.slowlog.threshold.query.trace: 500ms + +#index.search.slowlog.threshold.fetch.warn: 1s +#index.search.slowlog.threshold.fetch.info: 800ms +#index.search.slowlog.threshold.fetch.debug: 500ms +#index.search.slowlog.threshold.fetch.trace: 200ms + +#index.indexing.slowlog.threshold.index.warn: 10s +#index.indexing.slowlog.threshold.index.info: 5s +#index.indexing.slowlog.threshold.index.debug: 2s +#index.indexing.slowlog.threshold.index.trace: 500ms + +################################## GC Logging ################################ + +#monitor.jvm.gc.young.warn: 1000ms +#monitor.jvm.gc.young.info: 700ms +#monitor.jvm.gc.young.debug: 400ms + +#monitor.jvm.gc.old.warn: 10s +#monitor.jvm.gc.old.info: 5s +#monitor.jvm.gc.old.debug: 2s + +################################## Security ################################ + +# Uncomment if you want to enable JSONP as a valid return transport on the +# http server. With this enabled, it may pose a security risk, so disabling +# it unless you need it is recommended (it is disabled by default). +# +#http.jsonp.enable: true diff --git a/elasticsearch-1.7.6/config/logging.yml b/elasticsearch-1.7.6/config/logging.yml new file mode 100644 index 0000000..f0cd602 --- /dev/null +++ b/elasticsearch-1.7.6/config/logging.yml @@ -0,0 +1,68 @@ +# you can override this using by setting a system property, for example -Des.logger.level=DEBUG +es.logger.level: INFO +rootLogger: ${es.logger.level}, console, file +logger: + # log action execution errors for easier debugging + action: DEBUG + # reduce the logging for aws, too much is logged under the default INFO + com.amazonaws: WARN + org.apache.http: INFO + + # gateway + #gateway: DEBUG + #index.gateway: DEBUG + + # peer shard recovery + #indices.recovery: DEBUG + + # discovery + #discovery: TRACE + + index.search.slowlog: TRACE, index_search_slow_log_file + index.indexing.slowlog: TRACE, index_indexing_slow_log_file + +additivity: + index.search.slowlog: false + index.indexing.slowlog: false + +appender: + console: + type: console + layout: + type: consolePattern + conversionPattern: "[%d{ISO8601}][%-5p][%-25c] %m%n" + + file: + type: dailyRollingFile + file: ${path.logs}/${cluster.name}.log + datePattern: "'.'yyyy-MM-dd" + layout: + type: pattern + conversionPattern: "[%d{ISO8601}][%-5p][%-25c] %m%n" + + # Use the following log4j-extras RollingFileAppender to enable gzip compression of log files. + # For more information see https://logging.apache.org/log4j/extras/apidocs/org/apache/log4j/rolling/RollingFileAppender.html + #file: + #type: extrasRollingFile + #file: ${path.logs}/${cluster.name}.log + #rollingPolicy: timeBased + #rollingPolicy.FileNamePattern: ${path.logs}/${cluster.name}.log.%d{yyyy-MM-dd}.gz + #layout: + #type: pattern + #conversionPattern: "[%d{ISO8601}][%-5p][%-25c] %m%n" + + index_search_slow_log_file: + type: dailyRollingFile + file: ${path.logs}/${cluster.name}_index_search_slowlog.log + datePattern: "'.'yyyy-MM-dd" + layout: + type: pattern + conversionPattern: "[%d{ISO8601}][%-5p][%-25c] %m%n" + + index_indexing_slow_log_file: + type: dailyRollingFile + file: ${path.logs}/${cluster.name}_index_indexing_slowlog.log + datePattern: "'.'yyyy-MM-dd" + layout: + type: pattern + conversionPattern: "[%d{ISO8601}][%-5p][%-25c] %m%n" diff --git a/elasticsearch-1.7.6/data/elasticsearch/nodes/0/_state/global-14.st b/elasticsearch-1.7.6/data/elasticsearch/nodes/0/_state/global-14.st new file mode 100644 index 0000000..e69de29 diff --git a/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/0/_state/state-14.st b/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/0/_state/state-14.st new file mode 100644 index 0000000..e69de29 diff --git a/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/0/index/_1.cfe b/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/0/index/_1.cfe new file mode 100644 index 0000000..e69de29 diff --git a/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/0/index/_1.cfs b/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/0/index/_1.cfs new file mode 100644 index 0000000..e69de29 diff --git a/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/0/index/_1.si b/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/0/index/_1.si new file mode 100644 index 0000000..e69de29 diff --git a/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/0/index/_1z.cfe b/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/0/index/_1z.cfe new file mode 100644 index 0000000..e69de29 diff --git a/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/0/index/_1z.cfs b/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/0/index/_1z.cfs new file mode 100644 index 0000000..e69de29 diff --git a/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/0/index/_1z.si b/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/0/index/_1z.si new file mode 100644 index 0000000..e69de29 diff --git a/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/0/index/_20.cfe b/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/0/index/_20.cfe new file mode 100644 index 0000000..e69de29 diff --git a/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/0/index/_20.cfs b/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/0/index/_20.cfs new file mode 100644 index 0000000..e69de29 diff --git a/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/0/index/_20.si b/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/0/index/_20.si new file mode 100644 index 0000000..e69de29 diff --git a/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/0/index/segments.gen b/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/0/index/segments.gen new file mode 100644 index 0000000..e69de29 diff --git a/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/0/index/segments_20 b/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/0/index/segments_20 new file mode 100644 index 0000000..e69de29 diff --git a/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/0/index/write.lock b/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/0/index/write.lock new file mode 100644 index 0000000..e69de29 diff --git a/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/0/translog/translog-1495799468774 b/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/0/translog/translog-1495799468774 new file mode 100644 index 0000000..e69de29 diff --git a/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/1/_state/state-14.st b/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/1/_state/state-14.st new file mode 100644 index 0000000..e69de29 diff --git a/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/1/index/_1.cfe b/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/1/index/_1.cfe new file mode 100644 index 0000000..e69de29 diff --git a/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/1/index/_1.cfs b/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/1/index/_1.cfs new file mode 100644 index 0000000..e69de29 diff --git a/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/1/index/_1.si b/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/1/index/_1.si new file mode 100644 index 0000000..e69de29 diff --git a/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/1/index/_1s.cfe b/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/1/index/_1s.cfe new file mode 100644 index 0000000..e69de29 diff --git a/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/1/index/_1s.cfs b/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/1/index/_1s.cfs new file mode 100644 index 0000000..e69de29 diff --git a/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/1/index/_1s.si b/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/1/index/_1s.si new file mode 100644 index 0000000..e69de29 diff --git a/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/1/index/_1t.cfe b/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/1/index/_1t.cfe new file mode 100644 index 0000000..e69de29 diff --git a/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/1/index/_1t.cfs b/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/1/index/_1t.cfs new file mode 100644 index 0000000..e69de29 diff --git a/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/1/index/_1t.si b/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/1/index/_1t.si new file mode 100644 index 0000000..e69de29 diff --git a/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/1/index/_2.cfe b/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/1/index/_2.cfe new file mode 100644 index 0000000..e69de29 diff --git a/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/1/index/_2.cfs b/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/1/index/_2.cfs new file mode 100644 index 0000000..e69de29 diff --git a/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/1/index/_2.si b/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/1/index/_2.si new file mode 100644 index 0000000..e69de29 diff --git a/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/1/index/segments.gen b/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/1/index/segments.gen new file mode 100644 index 0000000..e69de29 diff --git a/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/1/index/segments_1n b/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/1/index/segments_1n new file mode 100644 index 0000000..e69de29 diff --git a/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/1/index/write.lock b/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/1/index/write.lock new file mode 100644 index 0000000..e69de29 diff --git a/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/1/translog/translog-1495799468843 b/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/1/translog/translog-1495799468843 new file mode 100644 index 0000000..e69de29 diff --git a/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/2/_state/state-14.st b/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/2/_state/state-14.st new file mode 100644 index 0000000..e69de29 diff --git a/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/2/index/_1.cfe b/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/2/index/_1.cfe new file mode 100644 index 0000000..e69de29 diff --git a/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/2/index/_1.cfs b/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/2/index/_1.cfs new file mode 100644 index 0000000..e69de29 diff --git a/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/2/index/_1.si b/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/2/index/_1.si new file mode 100644 index 0000000..e69de29 diff --git a/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/2/index/_2.cfe b/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/2/index/_2.cfe new file mode 100644 index 0000000..e69de29 diff --git a/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/2/index/_2.cfs b/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/2/index/_2.cfs new file mode 100644 index 0000000..e69de29 diff --git a/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/2/index/_2.si b/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/2/index/_2.si new file mode 100644 index 0000000..e69de29 diff --git a/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/2/index/_q.cfe b/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/2/index/_q.cfe new file mode 100644 index 0000000..e69de29 diff --git a/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/2/index/_q.cfs b/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/2/index/_q.cfs new file mode 100644 index 0000000..e69de29 diff --git a/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/2/index/_q.si b/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/2/index/_q.si new file mode 100644 index 0000000..e69de29 diff --git a/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/2/index/segments.gen b/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/2/index/segments.gen new file mode 100644 index 0000000..e69de29 diff --git a/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/2/index/segments_19 b/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/2/index/segments_19 new file mode 100644 index 0000000..e69de29 diff --git a/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/2/index/write.lock b/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/2/index/write.lock new file mode 100644 index 0000000..e69de29 diff --git a/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/2/translog/translog-1495799468862 b/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/2/translog/translog-1495799468862 new file mode 100644 index 0000000..e69de29 diff --git a/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/3/_state/state-14.st b/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/3/_state/state-14.st new file mode 100644 index 0000000..e69de29 diff --git a/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/3/index/_1.cfe b/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/3/index/_1.cfe new file mode 100644 index 0000000..e69de29 diff --git a/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/3/index/_1.cfs b/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/3/index/_1.cfs new file mode 100644 index 0000000..e69de29 diff --git a/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/3/index/_1.si b/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/3/index/_1.si new file mode 100644 index 0000000..e69de29 diff --git a/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/3/index/segments.gen b/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/3/index/segments.gen new file mode 100644 index 0000000..e69de29 diff --git a/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/3/index/segments_j b/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/3/index/segments_j new file mode 100644 index 0000000..e69de29 diff --git a/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/3/index/write.lock b/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/3/index/write.lock new file mode 100644 index 0000000..e69de29 diff --git a/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/3/translog/translog-1495799468778 b/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/3/translog/translog-1495799468778 new file mode 100644 index 0000000..e69de29 diff --git a/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/4/_state/state-14.st b/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/4/_state/state-14.st new file mode 100644 index 0000000..e69de29 diff --git a/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/4/index/_1.cfe b/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/4/index/_1.cfe new file mode 100644 index 0000000..e69de29 diff --git a/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/4/index/_1.cfs b/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/4/index/_1.cfs new file mode 100644 index 0000000..e69de29 diff --git a/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/4/index/_1.si b/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/4/index/_1.si new file mode 100644 index 0000000..e69de29 diff --git a/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/4/index/segments.gen b/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/4/index/segments.gen new file mode 100644 index 0000000..e69de29 diff --git a/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/4/index/segments_n b/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/4/index/segments_n new file mode 100644 index 0000000..e69de29 diff --git a/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/4/index/write.lock b/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/4/index/write.lock new file mode 100644 index 0000000..e69de29 diff --git a/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/4/translog/translog-1495799468906 b/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/4/translog/translog-1495799468906 new file mode 100644 index 0000000..e69de29 diff --git a/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/_state/state-2.st b/elasticsearch-1.7.6/data/elasticsearch/nodes/0/indices/haystack/_state/state-2.st new file mode 100644 index 0000000..e69de29 diff --git a/elasticsearch-1.7.6/data/elasticsearch/nodes/0/node.lock b/elasticsearch-1.7.6/data/elasticsearch/nodes/0/node.lock new file mode 100644 index 0000000..e69de29 diff --git a/elasticsearch-1.7.6/logs/elasticsearch.log.2017-05-26 b/elasticsearch-1.7.6/logs/elasticsearch.log.2017-05-26 new file mode 100644 index 0000000..a69e8b2 --- /dev/null +++ b/elasticsearch-1.7.6/logs/elasticsearch.log.2017-05-26 @@ -0,0 +1,19 @@ +[2017-05-26 12:47:37,459][INFO ][node ] [Arclight] version[1.7.6], pid[20177], build[c730b59/2016-11-18T15:21:16Z] +[2017-05-26 12:47:37,460][INFO ][node ] [Arclight] initializing ... +[2017-05-26 12:47:37,727][INFO ][plugins ] [Arclight] loaded [], sites [] +[2017-05-26 12:47:37,946][INFO ][env ] [Arclight] using [1] data paths, mounts [[/ (/dev/sda1)]], net usable_space [9.4gb], net total_space [15.6gb], types [ext4] +[2017-05-26 12:47:45,422][INFO ][node ] [Arclight] initialized +[2017-05-26 12:47:45,423][INFO ][node ] [Arclight] starting ... +[2017-05-26 12:47:45,908][INFO ][transport ] [Arclight] bound_address {inet[/0:0:0:0:0:0:0:0:9300]}, publish_address {inet[/10.0.2.15:9300]} +[2017-05-26 12:47:46,128][INFO ][discovery ] [Arclight] elasticsearch/8dGBD5QkRIixHI9QPyxgvA +[2017-05-26 12:47:50,020][INFO ][cluster.service ] [Arclight] new_master [Arclight][8dGBD5QkRIixHI9QPyxgvA][denis-VirtualBox][inet[/10.0.2.15:9300]], reason: zen-disco-join (elected_as_master) +[2017-05-26 12:47:50,098][INFO ][http ] [Arclight] bound_address {inet[/0:0:0:0:0:0:0:0:9200]}, publish_address {inet[/10.0.2.15:9200]} +[2017-05-26 12:47:50,099][INFO ][node ] [Arclight] started +[2017-05-26 12:47:50,255][INFO ][gateway ] [Arclight] recovered [0] indices into cluster_state +[2017-05-26 12:51:25,957][INFO ][cluster.metadata ] [Arclight] [haystack] creating index, cause [api], templates [], shards [5]/[1], mappings [] +[2017-05-26 12:51:28,548][INFO ][cluster.metadata ] [Arclight] [haystack] create_mapping [modelresult] +[2017-05-26 12:51:29,477][INFO ][cluster.metadata ] [Arclight] [haystack] update_mapping [modelresult] (dynamic) +[2017-05-26 14:51:08,029][INFO ][cluster.metadata ] [Arclight] [haystack] deleting index +[2017-05-26 14:51:08,528][INFO ][cluster.metadata ] [Arclight] [haystack] creating index, cause [api], templates [], shards [5]/[1], mappings [] +[2017-05-26 14:51:09,024][INFO ][cluster.metadata ] [Arclight] [haystack] create_mapping [modelresult] +[2017-05-26 14:51:09,223][INFO ][cluster.metadata ] [Arclight] [haystack] update_mapping [modelresult] (dynamic) diff --git a/elasticsearch-1.7.6/logs/elasticsearch.log.2017-06-17 b/elasticsearch-1.7.6/logs/elasticsearch.log.2017-06-17 new file mode 100644 index 0000000..7ae3599 --- /dev/null +++ b/elasticsearch-1.7.6/logs/elasticsearch.log.2017-06-17 @@ -0,0 +1,4 @@ +[2017-06-17 20:50:55,204][INFO ][node ] [Arclight] stopping ... +[2017-06-17 20:50:55,614][INFO ][node ] [Arclight] stopped +[2017-06-17 20:50:55,615][INFO ][node ] [Arclight] closing ... +[2017-06-17 20:50:55,696][INFO ][node ] [Arclight] closed diff --git a/elasticsearch-1.7.6/logs/elasticsearch.log.2017-07-07 b/elasticsearch-1.7.6/logs/elasticsearch.log.2017-07-07 new file mode 100644 index 0000000..d6801fd --- /dev/null +++ b/elasticsearch-1.7.6/logs/elasticsearch.log.2017-07-07 @@ -0,0 +1,12 @@ +[2017-07-07 11:58:51,311][INFO ][node ] [Bentley Wittman] version[1.7.6], pid[20877], build[c730b59/2016-11-18T15:21:16Z] +[2017-07-07 11:58:51,315][INFO ][node ] [Bentley Wittman] initializing ... +[2017-07-07 11:58:51,868][INFO ][plugins ] [Bentley Wittman] loaded [], sites [] +[2017-07-07 11:58:52,228][INFO ][env ] [Bentley Wittman] using [1] data paths, mounts [[/ (/dev/sda1)]], net usable_space [9.2gb], net total_space [15.6gb], types [ext4] +[2017-07-07 11:59:07,933][INFO ][node ] [Bentley Wittman] initialized +[2017-07-07 11:59:07,935][INFO ][node ] [Bentley Wittman] starting ... +[2017-07-07 11:59:09,450][INFO ][transport ] [Bentley Wittman] bound_address {inet[/0:0:0:0:0:0:0:0:9300]}, publish_address {inet[/10.0.2.15:9300]} +[2017-07-07 11:59:09,673][INFO ][discovery ] [Bentley Wittman] elasticsearch/6JSNOrSOQ5u-Tj8SGLxJSw +[2017-07-07 11:59:13,693][INFO ][cluster.service ] [Bentley Wittman] new_master [Bentley Wittman][6JSNOrSOQ5u-Tj8SGLxJSw][denis-VirtualBox][inet[/10.0.2.15:9300]], reason: zen-disco-join (elected_as_master) +[2017-07-07 11:59:13,874][INFO ][http ] [Bentley Wittman] bound_address {inet[/0:0:0:0:0:0:0:0:9200]}, publish_address {inet[/10.0.2.15:9200]} +[2017-07-07 11:59:13,877][INFO ][node ] [Bentley Wittman] started +[2017-07-07 11:59:14,214][INFO ][gateway ] [Bentley Wittman] recovered [1] indices into cluster_state diff --git a/elasticsearch-1.7.6/logs/elasticsearch.log.2017-07-19 b/elasticsearch-1.7.6/logs/elasticsearch.log.2017-07-19 new file mode 100644 index 0000000..57dbafa --- /dev/null +++ b/elasticsearch-1.7.6/logs/elasticsearch.log.2017-07-19 @@ -0,0 +1 @@ +[2017-07-19 15:29:29,020][WARN ][monitor.jvm ] [Bentley Wittman] [gc][young][14006][5] duration [1s], collections [1]/[2.3s], total [1s]/[1.4s], memory [97.9mb]->[32.6mb]/[1015.6mb], all_pools {[young] [66.5mb]->[572.3kb]/[66.5mb]}{[survivor] [6.3mb]->[3.6mb]/[8.3mb]}{[old] [25mb]->[28.4mb]/[940.8mb]} diff --git a/elasticsearch-1.7.6/logs/elasticsearch.log.2017-07-28 b/elasticsearch-1.7.6/logs/elasticsearch.log.2017-07-28 new file mode 100644 index 0000000..d73100d --- /dev/null +++ b/elasticsearch-1.7.6/logs/elasticsearch.log.2017-07-28 @@ -0,0 +1,4 @@ +[2017-07-28 15:03:10,357][INFO ][node ] [Bentley Wittman] stopping ... +[2017-07-28 15:03:11,735][INFO ][node ] [Bentley Wittman] stopped +[2017-07-28 15:03:11,736][INFO ][node ] [Bentley Wittman] closing ... +[2017-07-28 15:03:11,813][INFO ][node ] [Bentley Wittman] closed diff --git a/elasticsearch-1.7.6/logs/elasticsearch.log.2017-08-15 b/elasticsearch-1.7.6/logs/elasticsearch.log.2017-08-15 new file mode 100644 index 0000000..6a44fd7 --- /dev/null +++ b/elasticsearch-1.7.6/logs/elasticsearch.log.2017-08-15 @@ -0,0 +1,32 @@ +[2017-08-15 13:38:51,674][INFO ][node ] [Quentin Beck] version[1.7.6], pid[28446], build[c730b59/2016-11-18T15:21:16Z] +[2017-08-15 13:38:51,678][INFO ][node ] [Quentin Beck] initializing ... +[2017-08-15 13:38:52,206][INFO ][plugins ] [Quentin Beck] loaded [], sites [] +[2017-08-15 13:38:52,559][INFO ][env ] [Quentin Beck] using [1] data paths, mounts [[/ (/dev/sda1)]], net usable_space [9.2gb], net total_space [15.6gb], types [ext4] +[2017-08-15 13:39:14,039][INFO ][node ] [Quentin Beck] initialized +[2017-08-15 13:39:14,045][INFO ][node ] [Quentin Beck] starting ... +[2017-08-15 13:39:14,881][INFO ][transport ] [Quentin Beck] bound_address {inet[/0:0:0:0:0:0:0:0:9300]}, publish_address {inet[/10.0.2.15:9300]} +[2017-08-15 13:39:15,158][INFO ][discovery ] [Quentin Beck] elasticsearch/HhNRRNq4RQGxhQtyerTtJg +[2017-08-15 13:39:19,157][INFO ][cluster.service ] [Quentin Beck] new_master [Quentin Beck][HhNRRNq4RQGxhQtyerTtJg][denis-VirtualBox][inet[/10.0.2.15:9300]], reason: zen-disco-join (elected_as_master) +[2017-08-15 13:39:19,336][INFO ][http ] [Quentin Beck] bound_address {inet[/0:0:0:0:0:0:0:0:9200]}, publish_address {inet[/10.0.2.15:9200]} +[2017-08-15 13:39:19,339][INFO ][node ] [Quentin Beck] started +[2017-08-15 13:39:19,771][INFO ][gateway ] [Quentin Beck] recovered [1] indices into cluster_state +[2017-08-15 13:40:43,547][INFO ][node ] [Quentin Beck] stopping ... +[2017-08-15 13:40:43,809][INFO ][node ] [Quentin Beck] stopped +[2017-08-15 13:40:43,810][INFO ][node ] [Quentin Beck] closing ... +[2017-08-15 13:40:43,849][INFO ][node ] [Quentin Beck] closed +[2017-08-15 14:56:57,495][INFO ][node ] [Quincy Harker] version[1.7.6], pid[29345], build[c730b59/2016-11-18T15:21:16Z] +[2017-08-15 14:56:57,504][INFO ][node ] [Quincy Harker] initializing ... +[2017-08-15 14:56:58,011][INFO ][plugins ] [Quincy Harker] loaded [], sites [] +[2017-08-15 14:56:58,312][INFO ][env ] [Quincy Harker] using [1] data paths, mounts [[/ (/dev/sda1)]], net usable_space [9.2gb], net total_space [15.6gb], types [ext4] +[2017-08-15 14:57:21,644][INFO ][node ] [Quincy Harker] initialized +[2017-08-15 14:57:21,645][INFO ][node ] [Quincy Harker] starting ... +[2017-08-15 14:57:22,543][INFO ][transport ] [Quincy Harker] bound_address {inet[/0:0:0:0:0:0:0:0:9300]}, publish_address {inet[/10.0.2.15:9300]} +[2017-08-15 14:57:22,768][INFO ][discovery ] [Quincy Harker] elasticsearch/6iS2w1EOSjKeYUdStM2r9A +[2017-08-15 14:57:26,751][INFO ][cluster.service ] [Quincy Harker] new_master [Quincy Harker][6iS2w1EOSjKeYUdStM2r9A][denis-VirtualBox][inet[/10.0.2.15:9300]], reason: zen-disco-join (elected_as_master) +[2017-08-15 14:57:26,980][INFO ][http ] [Quincy Harker] bound_address {inet[/0:0:0:0:0:0:0:0:9200]}, publish_address {inet[/10.0.2.15:9200]} +[2017-08-15 14:57:26,989][INFO ][node ] [Quincy Harker] started +[2017-08-15 14:57:27,546][INFO ][gateway ] [Quincy Harker] recovered [1] indices into cluster_state +[2017-08-15 21:49:55,880][INFO ][node ] [Quincy Harker] stopping ... +[2017-08-15 21:49:56,205][INFO ][node ] [Quincy Harker] stopped +[2017-08-15 21:49:56,207][INFO ][node ] [Quincy Harker] closing ... +[2017-08-15 21:49:56,257][INFO ][node ] [Quincy Harker] closed diff --git a/elasticsearch-1.7.6/logs/elasticsearch.log.2017-08-16 b/elasticsearch-1.7.6/logs/elasticsearch.log.2017-08-16 new file mode 100644 index 0000000..a5584d5 --- /dev/null +++ b/elasticsearch-1.7.6/logs/elasticsearch.log.2017-08-16 @@ -0,0 +1,16 @@ +[2017-08-16 17:32:58,036][INFO ][node ] [Mass Master] version[1.7.6], pid[4428], build[c730b59/2016-11-18T15:21:16Z] +[2017-08-16 17:32:58,038][INFO ][node ] [Mass Master] initializing ... +[2017-08-16 17:32:58,489][INFO ][plugins ] [Mass Master] loaded [], sites [] +[2017-08-16 17:32:58,724][INFO ][env ] [Mass Master] using [1] data paths, mounts [[/ (/dev/sda1)]], net usable_space [9.1gb], net total_space [15.6gb], types [ext4] +[2017-08-16 17:33:08,102][INFO ][node ] [Mass Master] initialized +[2017-08-16 17:33:08,107][INFO ][node ] [Mass Master] starting ... +[2017-08-16 17:33:08,665][INFO ][transport ] [Mass Master] bound_address {inet[/0:0:0:0:0:0:0:0:9300]}, publish_address {inet[/10.0.2.15:9300]} +[2017-08-16 17:33:08,925][INFO ][discovery ] [Mass Master] elasticsearch/RyELkcIZQWew44bd7iKbbg +[2017-08-16 17:33:13,026][INFO ][cluster.service ] [Mass Master] new_master [Mass Master][RyELkcIZQWew44bd7iKbbg][denis-VirtualBox][inet[/10.0.2.15:9300]], reason: zen-disco-join (elected_as_master) +[2017-08-16 17:33:13,228][INFO ][http ] [Mass Master] bound_address {inet[/0:0:0:0:0:0:0:0:9200]}, publish_address {inet[/10.0.2.15:9200]} +[2017-08-16 17:33:13,230][INFO ][node ] [Mass Master] started +[2017-08-16 17:33:13,539][INFO ][gateway ] [Mass Master] recovered [1] indices into cluster_state +[2017-08-16 22:06:00,926][INFO ][node ] [Mass Master] stopping ... +[2017-08-16 22:06:01,233][INFO ][node ] [Mass Master] stopped +[2017-08-16 22:06:01,234][INFO ][node ] [Mass Master] closing ... +[2017-08-16 22:06:01,303][INFO ][node ] [Mass Master] closed diff --git a/elasticsearch-1.7.6/logs/elasticsearch.log.2017-08-17 b/elasticsearch-1.7.6/logs/elasticsearch.log.2017-08-17 new file mode 100644 index 0000000..5c6acb8 --- /dev/null +++ b/elasticsearch-1.7.6/logs/elasticsearch.log.2017-08-17 @@ -0,0 +1,16 @@ +[2017-08-17 13:50:21,513][INFO ][node ] [Wraith] version[1.7.6], pid[9679], build[c730b59/2016-11-18T15:21:16Z] +[2017-08-17 13:50:21,522][INFO ][node ] [Wraith] initializing ... +[2017-08-17 13:50:22,320][INFO ][plugins ] [Wraith] loaded [], sites [] +[2017-08-17 13:50:22,670][INFO ][env ] [Wraith] using [1] data paths, mounts [[/ (/dev/sda1)]], net usable_space [9.1gb], net total_space [15.6gb], types [ext4] +[2017-08-17 13:50:42,180][INFO ][node ] [Wraith] initialized +[2017-08-17 13:50:42,194][INFO ][node ] [Wraith] starting ... +[2017-08-17 13:50:43,313][INFO ][transport ] [Wraith] bound_address {inet[/0:0:0:0:0:0:0:0:9300]}, publish_address {inet[/10.0.2.15:9300]} +[2017-08-17 13:50:43,558][INFO ][discovery ] [Wraith] elasticsearch/LDs7nq_zQeeUYQnix3pQ3g +[2017-08-17 13:50:47,595][INFO ][cluster.service ] [Wraith] new_master [Wraith][LDs7nq_zQeeUYQnix3pQ3g][denis-VirtualBox][inet[/10.0.2.15:9300]], reason: zen-disco-join (elected_as_master) +[2017-08-17 13:50:47,909][INFO ][http ] [Wraith] bound_address {inet[/0:0:0:0:0:0:0:0:9200]}, publish_address {inet[/10.0.2.15:9200]} +[2017-08-17 13:50:47,913][INFO ][node ] [Wraith] started +[2017-08-17 13:50:48,453][INFO ][gateway ] [Wraith] recovered [1] indices into cluster_state +[2017-08-17 21:56:52,733][INFO ][node ] [Wraith] stopping ... +[2017-08-17 21:56:53,608][INFO ][node ] [Wraith] stopped +[2017-08-17 21:56:53,609][INFO ][node ] [Wraith] closing ... +[2017-08-17 21:56:53,654][INFO ][node ] [Wraith] closed diff --git a/elasticsearch-1.7.6/logs/elasticsearch.log.2017-08-22 b/elasticsearch-1.7.6/logs/elasticsearch.log.2017-08-22 new file mode 100644 index 0000000..c8c2e14 --- /dev/null +++ b/elasticsearch-1.7.6/logs/elasticsearch.log.2017-08-22 @@ -0,0 +1,16 @@ +[2017-08-22 15:54:04,779][INFO ][node ] [Lord Chaos] version[1.7.6], pid[23013], build[c730b59/2016-11-18T15:21:16Z] +[2017-08-22 15:54:04,830][INFO ][node ] [Lord Chaos] initializing ... +[2017-08-22 15:54:05,462][INFO ][plugins ] [Lord Chaos] loaded [], sites [] +[2017-08-22 15:54:05,838][INFO ][env ] [Lord Chaos] using [1] data paths, mounts [[/ (/dev/sda1)]], net usable_space [9.1gb], net total_space [15.6gb], types [ext4] +[2017-08-22 15:54:25,606][INFO ][node ] [Lord Chaos] initialized +[2017-08-22 15:54:25,607][INFO ][node ] [Lord Chaos] starting ... +[2017-08-22 15:54:26,709][INFO ][transport ] [Lord Chaos] bound_address {inet[/0:0:0:0:0:0:0:0:9300]}, publish_address {inet[/10.0.2.15:9300]} +[2017-08-22 15:54:27,074][INFO ][discovery ] [Lord Chaos] elasticsearch/XWPyXk-qTQWalGlghc48xA +[2017-08-22 15:54:31,031][INFO ][cluster.service ] [Lord Chaos] new_master [Lord Chaos][XWPyXk-qTQWalGlghc48xA][denis-VirtualBox][inet[/10.0.2.15:9300]], reason: zen-disco-join (elected_as_master) +[2017-08-22 15:54:31,261][INFO ][http ] [Lord Chaos] bound_address {inet[/0:0:0:0:0:0:0:0:9200]}, publish_address {inet[/10.0.2.15:9200]} +[2017-08-22 15:54:31,262][INFO ][node ] [Lord Chaos] started +[2017-08-22 15:54:31,806][INFO ][gateway ] [Lord Chaos] recovered [1] indices into cluster_state +[2017-08-22 22:12:57,358][INFO ][node ] [Lord Chaos] stopping ... +[2017-08-22 22:12:57,742][INFO ][node ] [Lord Chaos] stopped +[2017-08-22 22:12:57,745][INFO ][node ] [Lord Chaos] closing ... +[2017-08-22 22:12:57,800][INFO ][node ] [Lord Chaos] closed diff --git a/elasticsearch-1.7.6/logs/elasticsearch.log.2017-08-23 b/elasticsearch-1.7.6/logs/elasticsearch.log.2017-08-23 new file mode 100644 index 0000000..9152bb2 --- /dev/null +++ b/elasticsearch-1.7.6/logs/elasticsearch.log.2017-08-23 @@ -0,0 +1,16 @@ +[2017-08-23 08:49:52,348][INFO ][node ] [Al MacKenzie] version[1.7.6], pid[27703], build[c730b59/2016-11-18T15:21:16Z] +[2017-08-23 08:49:52,355][INFO ][node ] [Al MacKenzie] initializing ... +[2017-08-23 08:49:53,361][INFO ][plugins ] [Al MacKenzie] loaded [], sites [] +[2017-08-23 08:49:53,968][INFO ][env ] [Al MacKenzie] using [1] data paths, mounts [[/ (/dev/sda1)]], net usable_space [9.1gb], net total_space [15.6gb], types [ext4] +[2017-08-23 08:50:34,920][INFO ][node ] [Al MacKenzie] initialized +[2017-08-23 08:50:34,921][INFO ][node ] [Al MacKenzie] starting ... +[2017-08-23 08:50:36,244][INFO ][transport ] [Al MacKenzie] bound_address {inet[/0:0:0:0:0:0:0:0:9300]}, publish_address {inet[/10.0.2.15:9300]} +[2017-08-23 08:50:36,682][INFO ][discovery ] [Al MacKenzie] elasticsearch/yZpEcrFeR8WdLtPOqnhytA +[2017-08-23 08:50:40,853][INFO ][cluster.service ] [Al MacKenzie] new_master [Al MacKenzie][yZpEcrFeR8WdLtPOqnhytA][denis-VirtualBox][inet[/10.0.2.15:9300]], reason: zen-disco-join (elected_as_master) +[2017-08-23 08:50:41,203][INFO ][http ] [Al MacKenzie] bound_address {inet[/0:0:0:0:0:0:0:0:9200]}, publish_address {inet[/10.0.2.15:9200]} +[2017-08-23 08:50:41,207][INFO ][node ] [Al MacKenzie] started +[2017-08-23 08:50:41,686][INFO ][gateway ] [Al MacKenzie] recovered [1] indices into cluster_state +[2017-08-23 20:41:57,691][INFO ][node ] [Al MacKenzie] stopping ... +[2017-08-23 20:41:58,153][INFO ][node ] [Al MacKenzie] stopped +[2017-08-23 20:41:58,154][INFO ][node ] [Al MacKenzie] closing ... +[2017-08-23 20:41:58,218][INFO ][node ] [Al MacKenzie] closed diff --git a/elasticsearch-1.7.6/logs/elasticsearch.log.2017-08-29 b/elasticsearch-1.7.6/logs/elasticsearch.log.2017-08-29 new file mode 100644 index 0000000..45e8300 --- /dev/null +++ b/elasticsearch-1.7.6/logs/elasticsearch.log.2017-08-29 @@ -0,0 +1,16 @@ +[2017-08-29 13:15:17,274][INFO ][node ] [Spyder] version[1.7.6], pid[13540], build[c730b59/2016-11-18T15:21:16Z] +[2017-08-29 13:15:17,307][INFO ][node ] [Spyder] initializing ... +[2017-08-29 13:15:17,867][INFO ][plugins ] [Spyder] loaded [], sites [] +[2017-08-29 13:15:18,165][INFO ][env ] [Spyder] using [1] data paths, mounts [[/ (/dev/sda1)]], net usable_space [9gb], net total_space [15.6gb], types [ext4] +[2017-08-29 13:15:32,716][INFO ][node ] [Spyder] initialized +[2017-08-29 13:15:32,723][INFO ][node ] [Spyder] starting ... +[2017-08-29 13:15:33,326][INFO ][transport ] [Spyder] bound_address {inet[/0:0:0:0:0:0:0:0:9300]}, publish_address {inet[/10.0.2.15:9300]} +[2017-08-29 13:15:33,617][INFO ][discovery ] [Spyder] elasticsearch/sRG0USqaQ3mkWahLBTfHPA +[2017-08-29 13:15:37,560][INFO ][cluster.service ] [Spyder] new_master [Spyder][sRG0USqaQ3mkWahLBTfHPA][denis-VirtualBox][inet[/10.0.2.15:9300]], reason: zen-disco-join (elected_as_master) +[2017-08-29 13:15:37,749][INFO ][http ] [Spyder] bound_address {inet[/0:0:0:0:0:0:0:0:9200]}, publish_address {inet[/10.0.2.15:9200]} +[2017-08-29 13:15:37,757][INFO ][node ] [Spyder] started +[2017-08-29 13:15:38,148][INFO ][gateway ] [Spyder] recovered [1] indices into cluster_state +[2017-08-29 21:54:24,432][INFO ][node ] [Spyder] stopping ... +[2017-08-29 21:54:25,124][INFO ][node ] [Spyder] stopped +[2017-08-29 21:54:25,125][INFO ][node ] [Spyder] closing ... +[2017-08-29 21:54:25,202][INFO ][node ] [Spyder] closed diff --git a/elasticsearch-1.7.6/logs/elasticsearch.log.2017-08-30 b/elasticsearch-1.7.6/logs/elasticsearch.log.2017-08-30 new file mode 100644 index 0000000..8b09e83 --- /dev/null +++ b/elasticsearch-1.7.6/logs/elasticsearch.log.2017-08-30 @@ -0,0 +1,16 @@ +[2017-08-30 10:57:02,860][INFO ][node ] [Letha] version[1.7.6], pid[17344], build[c730b59/2016-11-18T15:21:16Z] +[2017-08-30 10:57:02,897][INFO ][node ] [Letha] initializing ... +[2017-08-30 10:57:03,683][INFO ][plugins ] [Letha] loaded [], sites [] +[2017-08-30 10:57:04,116][INFO ][env ] [Letha] using [1] data paths, mounts [[/ (/dev/sda1)]], net usable_space [8.9gb], net total_space [15.6gb], types [ext4] +[2017-08-30 10:57:21,785][INFO ][node ] [Letha] initialized +[2017-08-30 10:57:21,792][INFO ][node ] [Letha] starting ... +[2017-08-30 10:57:22,658][INFO ][transport ] [Letha] bound_address {inet[/0:0:0:0:0:0:0:0:9300]}, publish_address {inet[/10.0.2.15:9300]} +[2017-08-30 10:57:22,905][INFO ][discovery ] [Letha] elasticsearch/iBVu0AsHS5-1ZCU1c1io1w +[2017-08-30 10:57:26,871][INFO ][cluster.service ] [Letha] new_master [Letha][iBVu0AsHS5-1ZCU1c1io1w][denis-VirtualBox][inet[/10.0.2.15:9300]], reason: zen-disco-join (elected_as_master) +[2017-08-30 10:57:27,060][INFO ][http ] [Letha] bound_address {inet[/0:0:0:0:0:0:0:0:9200]}, publish_address {inet[/10.0.2.15:9200]} +[2017-08-30 10:57:27,061][INFO ][node ] [Letha] started +[2017-08-30 10:57:27,700][INFO ][gateway ] [Letha] recovered [1] indices into cluster_state +[2017-08-30 17:33:36,181][INFO ][node ] [Letha] stopping ... +[2017-08-30 17:33:39,847][INFO ][node ] [Letha] stopped +[2017-08-30 17:33:39,848][INFO ][node ] [Letha] closing ... +[2017-08-30 17:33:40,057][INFO ][node ] [Letha] closed diff --git a/elasticsearch-1.7.6/logs/elasticsearch.log.2017-08-31 b/elasticsearch-1.7.6/logs/elasticsearch.log.2017-08-31 new file mode 100644 index 0000000..8835c2d --- /dev/null +++ b/elasticsearch-1.7.6/logs/elasticsearch.log.2017-08-31 @@ -0,0 +1,12 @@ +[2017-08-31 18:11:19,877][INFO ][node ] [Conrad Josten] version[1.7.6], pid[2484], build[c730b59/2016-11-18T15:21:16Z] +[2017-08-31 18:11:19,879][INFO ][node ] [Conrad Josten] initializing ... +[2017-08-31 18:11:20,629][INFO ][plugins ] [Conrad Josten] loaded [], sites [] +[2017-08-31 18:11:20,959][INFO ][env ] [Conrad Josten] using [1] data paths, mounts [[/ (/dev/sda1)]], net usable_space [8.7gb], net total_space [15.6gb], types [ext4] +[2017-08-31 18:11:39,557][INFO ][node ] [Conrad Josten] initialized +[2017-08-31 18:11:39,570][INFO ][node ] [Conrad Josten] starting ... +[2017-08-31 18:11:40,276][INFO ][transport ] [Conrad Josten] bound_address {inet[/0:0:0:0:0:0:0:0:9300]}, publish_address {inet[/10.0.2.15:9300]} +[2017-08-31 18:11:40,466][INFO ][discovery ] [Conrad Josten] elasticsearch/YJkKc29eRMyPIbQUSuqj6g +[2017-08-31 18:11:44,385][INFO ][cluster.service ] [Conrad Josten] new_master [Conrad Josten][YJkKc29eRMyPIbQUSuqj6g][denis-VirtualBox][inet[/10.0.2.15:9300]], reason: zen-disco-join (elected_as_master) +[2017-08-31 18:11:44,579][INFO ][http ] [Conrad Josten] bound_address {inet[/0:0:0:0:0:0:0:0:9200]}, publish_address {inet[/10.0.2.15:9200]} +[2017-08-31 18:11:44,598][INFO ][node ] [Conrad Josten] started +[2017-08-31 18:11:45,045][INFO ][gateway ] [Conrad Josten] recovered [1] indices into cluster_state diff --git a/elasticsearch-1.7.6/logs/elasticsearch.log.2017-09-01 b/elasticsearch-1.7.6/logs/elasticsearch.log.2017-09-01 new file mode 100644 index 0000000..3559492 --- /dev/null +++ b/elasticsearch-1.7.6/logs/elasticsearch.log.2017-09-01 @@ -0,0 +1,4 @@ +[2017-09-01 22:46:46,882][INFO ][node ] [Conrad Josten] stopping ... +[2017-09-01 22:46:47,120][INFO ][node ] [Conrad Josten] stopped +[2017-09-01 22:46:47,121][INFO ][node ] [Conrad Josten] closing ... +[2017-09-01 22:46:47,159][INFO ][node ] [Conrad Josten] closed diff --git a/elasticsearch-1.7.6/logs/elasticsearch.log.2017-09-02 b/elasticsearch-1.7.6/logs/elasticsearch.log.2017-09-02 new file mode 100644 index 0000000..2afc383 --- /dev/null +++ b/elasticsearch-1.7.6/logs/elasticsearch.log.2017-09-02 @@ -0,0 +1,12 @@ +[2017-09-02 09:40:46,310][INFO ][node ] [Deborah Ritter] version[1.7.6], pid[20471], build[c730b59/2016-11-18T15:21:16Z] +[2017-09-02 09:40:46,317][INFO ][node ] [Deborah Ritter] initializing ... +[2017-09-02 09:40:46,778][INFO ][plugins ] [Deborah Ritter] loaded [], sites [] +[2017-09-02 09:40:47,002][INFO ][env ] [Deborah Ritter] using [1] data paths, mounts [[/ (/dev/sda1)]], net usable_space [8.7gb], net total_space [15.6gb], types [ext4] +[2017-09-02 09:41:02,184][INFO ][node ] [Deborah Ritter] initialized +[2017-09-02 09:41:02,194][INFO ][node ] [Deborah Ritter] starting ... +[2017-09-02 09:41:03,023][INFO ][transport ] [Deborah Ritter] bound_address {inet[/0:0:0:0:0:0:0:0:9300]}, publish_address {inet[/10.0.2.15:9300]} +[2017-09-02 09:41:03,294][INFO ][discovery ] [Deborah Ritter] elasticsearch/BDgYqKwgQaiWDjCyPvQypA +[2017-09-02 09:41:07,327][INFO ][cluster.service ] [Deborah Ritter] new_master [Deborah Ritter][BDgYqKwgQaiWDjCyPvQypA][denis-VirtualBox][inet[/10.0.2.15:9300]], reason: zen-disco-join (elected_as_master) +[2017-09-02 09:41:07,561][INFO ][http ] [Deborah Ritter] bound_address {inet[/0:0:0:0:0:0:0:0:9200]}, publish_address {inet[/10.0.2.15:9200]} +[2017-09-02 09:41:07,574][INFO ][node ] [Deborah Ritter] started +[2017-09-02 09:41:08,085][INFO ][gateway ] [Deborah Ritter] recovered [1] indices into cluster_state diff --git a/elasticsearch-1.7.6/logs/elasticsearch.log.2017-09-06 b/elasticsearch-1.7.6/logs/elasticsearch.log.2017-09-06 new file mode 100644 index 0000000..bc9e720 --- /dev/null +++ b/elasticsearch-1.7.6/logs/elasticsearch.log.2017-09-06 @@ -0,0 +1,4 @@ +[2017-09-06 10:28:30,431][INFO ][node ] [Deborah Ritter] stopping ... +[2017-09-06 10:28:30,821][INFO ][node ] [Deborah Ritter] stopped +[2017-09-06 10:28:30,822][INFO ][node ] [Deborah Ritter] closing ... +[2017-09-06 10:28:30,893][INFO ][node ] [Deborah Ritter] closed diff --git a/elasticsearch-1.7.6/logs/elasticsearch.log.2017-09-07 b/elasticsearch-1.7.6/logs/elasticsearch.log.2017-09-07 new file mode 100644 index 0000000..b10fe21 --- /dev/null +++ b/elasticsearch-1.7.6/logs/elasticsearch.log.2017-09-07 @@ -0,0 +1,16 @@ +[2017-09-07 09:37:35,115][INFO ][node ] [Crystal] version[1.7.6], pid[18821], build[c730b59/2016-11-18T15:21:16Z] +[2017-09-07 09:37:35,206][INFO ][node ] [Crystal] initializing ... +[2017-09-07 09:37:36,131][INFO ][plugins ] [Crystal] loaded [], sites [] +[2017-09-07 09:37:36,576][INFO ][env ] [Crystal] using [1] data paths, mounts [[/ (/dev/sda1)]], net usable_space [8.7gb], net total_space [15.6gb], types [ext4] +[2017-09-07 09:38:10,529][INFO ][node ] [Crystal] initialized +[2017-09-07 09:38:10,544][INFO ][node ] [Crystal] starting ... +[2017-09-07 09:38:11,801][INFO ][transport ] [Crystal] bound_address {inet[/0:0:0:0:0:0:0:0:9300]}, publish_address {inet[/10.0.2.15:9300]} +[2017-09-07 09:38:12,255][INFO ][discovery ] [Crystal] elasticsearch/ODWveRO0QriOYfQF_0rTWg +[2017-09-07 09:38:16,625][INFO ][cluster.service ] [Crystal] new_master [Crystal][ODWveRO0QriOYfQF_0rTWg][denis-VirtualBox][inet[/10.0.2.15:9300]], reason: zen-disco-join (elected_as_master) +[2017-09-07 09:38:17,080][INFO ][http ] [Crystal] bound_address {inet[/0:0:0:0:0:0:0:0:9200]}, publish_address {inet[/10.0.2.15:9200]} +[2017-09-07 09:38:17,112][INFO ][node ] [Crystal] started +[2017-09-07 09:38:17,962][INFO ][gateway ] [Crystal] recovered [1] indices into cluster_state +[2017-09-07 18:40:50,244][INFO ][node ] [Crystal] stopping ... +[2017-09-07 18:40:50,546][INFO ][node ] [Crystal] stopped +[2017-09-07 18:40:50,547][INFO ][node ] [Crystal] closing ... +[2017-09-07 18:40:50,589][INFO ][node ] [Crystal] closed diff --git a/elasticsearch-1.7.6/logs/elasticsearch.log.2017-09-14 b/elasticsearch-1.7.6/logs/elasticsearch.log.2017-09-14 new file mode 100644 index 0000000..e23116f --- /dev/null +++ b/elasticsearch-1.7.6/logs/elasticsearch.log.2017-09-14 @@ -0,0 +1,16 @@ +[2017-09-14 15:29:07,156][INFO ][node ] [Johnny Ohm] version[1.7.6], pid[8639], build[c730b59/2016-11-18T15:21:16Z] +[2017-09-14 15:29:07,161][INFO ][node ] [Johnny Ohm] initializing ... +[2017-09-14 15:29:07,804][INFO ][plugins ] [Johnny Ohm] loaded [], sites [] +[2017-09-14 15:29:08,089][INFO ][env ] [Johnny Ohm] using [1] data paths, mounts [[/ (/dev/sda1)]], net usable_space [8.7gb], net total_space [15.6gb], types [ext4] +[2017-09-14 15:29:21,936][INFO ][node ] [Johnny Ohm] initialized +[2017-09-14 15:29:21,942][INFO ][node ] [Johnny Ohm] starting ... +[2017-09-14 15:29:22,444][INFO ][transport ] [Johnny Ohm] bound_address {inet[/0:0:0:0:0:0:0:0:9300]}, publish_address {inet[/10.0.2.15:9300]} +[2017-09-14 15:29:22,689][INFO ][discovery ] [Johnny Ohm] elasticsearch/gZuvvXmBQ8CQGnZ3krxemA +[2017-09-14 15:29:26,807][INFO ][cluster.service ] [Johnny Ohm] new_master [Johnny Ohm][gZuvvXmBQ8CQGnZ3krxemA][denis-VirtualBox][inet[/10.0.2.15:9300]], reason: zen-disco-join (elected_as_master) +[2017-09-14 15:29:27,204][INFO ][http ] [Johnny Ohm] bound_address {inet[/0:0:0:0:0:0:0:0:9200]}, publish_address {inet[/10.0.2.15:9200]} +[2017-09-14 15:29:27,211][INFO ][node ] [Johnny Ohm] started +[2017-09-14 15:29:27,977][INFO ][gateway ] [Johnny Ohm] recovered [1] indices into cluster_state +[2017-09-14 21:17:18,254][INFO ][node ] [Johnny Ohm] stopping ... +[2017-09-14 21:17:18,564][INFO ][node ] [Johnny Ohm] stopped +[2017-09-14 21:17:18,565][INFO ][node ] [Johnny Ohm] closing ... +[2017-09-14 21:17:18,611][INFO ][node ] [Johnny Ohm] closed diff --git a/initial_data.json b/initial_data.json new file mode 100644 index 0000000..b323a6a --- /dev/null +++ b/initial_data.json @@ -0,0 +1,3049 @@ +[ +{ + "model": "contenttypes.contenttype", + "pk": 1, + "fields": { + "app_label": "admin", + "model": "logentry" + } +}, +{ + "model": "contenttypes.contenttype", + "pk": 2, + "fields": { + "app_label": "auth", + "model": "group" + } +}, +{ + "model": "contenttypes.contenttype", + "pk": 3, + "fields": { + "app_label": "auth", + "model": "permission" + } +}, +{ + "model": "contenttypes.contenttype", + "pk": 4, + "fields": { + "app_label": "auth", + "model": "user" + } +}, +{ + "model": "contenttypes.contenttype", + "pk": 5, + "fields": { + "app_label": "contenttypes", + "model": "contenttype" + } +}, +{ + "model": "contenttypes.contenttype", + "pk": 6, + "fields": { + "app_label": "sessions", + "model": "session" + } +}, +{ + "model": "contenttypes.contenttype", + "pk": 7, + "fields": { + "app_label": "landing", + "model": "subscriber" + } +}, +{ + "model": "contenttypes.contenttype", + "pk": 8, + "fields": { + "app_label": "orders", + "model": "order" + } +}, +{ + "model": "contenttypes.contenttype", + "pk": 9, + "fields": { + "app_label": "orders", + "model": "productsinbasket" + } +}, +{ + "model": "contenttypes.contenttype", + "pk": 10, + "fields": { + "app_label": "orders", + "model": "status" + } +}, +{ + "model": "contenttypes.contenttype", + "pk": 11, + "fields": { + "app_label": "orders", + "model": "productsinorder" + } +}, +{ + "model": "contenttypes.contenttype", + "pk": 12, + "fields": { + "app_label": "userprofile", + "model": "userprofile" + } +}, +{ + "model": "contenttypes.contenttype", + "pk": 13, + "fields": { + "app_label": "products", + "model": "productclass" + } +}, +{ + "model": "contenttypes.contenttype", + "pk": 14, + "fields": { + "app_label": "products", + "model": "productcategory" + } +}, +{ + "model": "contenttypes.contenttype", + "pk": 15, + "fields": { + "app_label": "products", + "model": "product" + } +}, +{ + "model": "contenttypes.contenttype", + "pk": 16, + "fields": { + "app_label": "products", + "model": "productimage" + } +}, +{ + "model": "contenttypes.contenttype", + "pk": 17, + "fields": { + "app_label": "products", + "model": "productattribute" + } +}, +{ + "model": "contenttypes.contenttype", + "pk": 18, + "fields": { + "app_label": "products", + "model": "offer" + } +}, +{ + "model": "contenttypes.contenttype", + "pk": 19, + "fields": { + "app_label": "products", + "model": "attributechoicevalue" + } +}, +{ + "model": "contenttypes.contenttype", + "pk": 20, + "fields": { + "app_label": "ipn", + "model": "paypalipn" + } +}, +{ + "model": "contenttypes.contenttype", + "pk": 21, + "fields": { + "app_label": "discount", + "model": "discount" + } +}, +{ + "model": "contenttypes.contenttype", + "pk": 22, + "fields": { + "app_label": "userprofile", + "model": "pickuprequest" + } +}, +{ + "model": "sessions.session", + "pk": "063ey0w5az1fjuypx5jbh1ydim3mdwb6", + "fields": { + "session_data": "ZmViZmEyN2E4ZjRlZDBkYTI0ZGMwOGJmMDc5NjcyNjY5YzE5YTRmODp7ImNhcnQiOnt9fQ==", + "expire_date": "2017-07-19T11:54:11.258Z" + } +}, +{ + "model": "sessions.session", + "pk": "06y4p54ygrhn38k7lz3ypszddfs84lws", + "fields": { + "session_data": "ZmViZmEyN2E4ZjRlZDBkYTI0ZGMwOGJmMDc5NjcyNjY5YzE5YTRmODp7ImNhcnQiOnt9fQ==", + "expire_date": "2017-07-19T12:18:18.279Z" + } +}, +{ + "model": "sessions.session", + "pk": "0r92tzipxxbt0tfjwwk46yjd92vpjehf", + "fields": { + "session_data": "ZmViZmEyN2E4ZjRlZDBkYTI0ZGMwOGJmMDc5NjcyNjY5YzE5YTRmODp7ImNhcnQiOnt9fQ==", + "expire_date": "2017-07-21T08:19:38.623Z" + } +}, +{ + "model": "sessions.session", + "pk": "1wnvppnj4e35fmd3vopiq4e9tlb8xcof", + "fields": { + "session_data": "MDYzN2U2YjYyMzYzNWFjYTI3ZWU0OTA4YjY2MmQ0MGRkMGVjMWYzOTp7fQ==", + "expire_date": "2017-07-19T12:58:18.261Z" + } +}, +{ + "model": "sessions.session", + "pk": "7ft90w0kgbcwgk102syng168rn290a4u", + "fields": { + "session_data": "ZmViZmEyN2E4ZjRlZDBkYTI0ZGMwOGJmMDc5NjcyNjY5YzE5YTRmODp7ImNhcnQiOnt9fQ==", + "expire_date": "2017-07-19T13:05:37.447Z" + } +}, +{ + "model": "sessions.session", + "pk": "aaq2aw999ecxz5wo9pk3ffwesh2jw79h", + "fields": { + "session_data": "ZmViZmEyN2E4ZjRlZDBkYTI0ZGMwOGJmMDc5NjcyNjY5YzE5YTRmODp7ImNhcnQiOnt9fQ==", + "expire_date": "2017-07-19T12:56:31.003Z" + } +}, +{ + "model": "sessions.session", + "pk": "ieri4ourpmlgbvjexo25wyo59fv442st", + "fields": { + "session_data": "ZmViZmEyN2E4ZjRlZDBkYTI0ZGMwOGJmMDc5NjcyNjY5YzE5YTRmODp7ImNhcnQiOnt9fQ==", + "expire_date": "2017-07-19T11:53:35.792Z" + } +}, +{ + "model": "sessions.session", + "pk": "inlddywd0g1m1vilflojgzegsns46574", + "fields": { + "session_data": "YTI0MDgxYWZmZWI5MmExOGEyZjY1MmE3OGIwNWZiMjU2ZDdmMTdjZjp7ImNhcnQiOnt9LCJfYXV0aF91c2VyX2hhc2giOiJhMTRhZTM0YmIxZWRhOTI5NzQxMTU1OGMxZGUwMGVlYzA0YzMyOTMwIiwiX2F1dGhfdXNlcl9iYWNrZW5kIjoiZGphbmdvLmNvbnRyaWIuYXV0aC5iYWNrZW5kcy5Nb2RlbEJhY2tlbmQiLCJfYXV0aF91c2VyX2lkIjoiMzMifQ==", + "expire_date": "2017-08-02T12:57:14.247Z" + } +}, +{ + "model": "sessions.session", + "pk": "la83kxf4z1precuh0wjup6rzpaazlhzk", + "fields": { + "session_data": "ZmViZmEyN2E4ZjRlZDBkYTI0ZGMwOGJmMDc5NjcyNjY5YzE5YTRmODp7ImNhcnQiOnt9fQ==", + "expire_date": "2017-07-19T11:46:07.405Z" + } +}, +{ + "model": "sessions.session", + "pk": "mdogjb3qh8oj8hbs6m067olqtlgeh30k", + "fields": { + "session_data": "ZmViZmEyN2E4ZjRlZDBkYTI0ZGMwOGJmMDc5NjcyNjY5YzE5YTRmODp7ImNhcnQiOnt9fQ==", + "expire_date": "2017-07-19T11:52:12.475Z" + } +}, +{ + "model": "sessions.session", + "pk": "pyy7sbff9jtob5y0nij126d7xs94hfty", + "fields": { + "session_data": "ZmViZmEyN2E4ZjRlZDBkYTI0ZGMwOGJmMDc5NjcyNjY5YzE5YTRmODp7ImNhcnQiOnt9fQ==", + "expire_date": "2017-07-19T13:00:12.610Z" + } +}, +{ + "model": "sessions.session", + "pk": "s3i511xzmywc520quuiljd7b16b83ydt", + "fields": { + "session_data": "ZGE0Mjg0NmYwMzM0ZDMyODBkYTk2Y2FlNDQ0MDM5YWE2NGFhNzcwMDp7Il9hdXRoX3VzZXJfaGFzaCI6IjkxMjk2YmQyNDEwMTNmYzEzYWM1NWQ1ZTllNTJmZDc1YzNjMjlhOWYiLCJfYXV0aF91c2VyX2lkIjoiMiIsImNhcnQiOnt9LCJfYXV0aF91c2VyX2JhY2tlbmQiOiJkamFuZ28uY29udHJpYi5hdXRoLmJhY2tlbmRzLk1vZGVsQmFja2VuZCJ9", + "expire_date": "2017-06-09T12:57:47.119Z" + } +}, +{ + "model": "sessions.session", + "pk": "s4nz10rttkex8r5tobdb661r0u6v7ell", + "fields": { + "session_data": "ZmViZmEyN2E4ZjRlZDBkYTI0ZGMwOGJmMDc5NjcyNjY5YzE5YTRmODp7ImNhcnQiOnt9fQ==", + "expire_date": "2017-07-19T12:10:22.764Z" + } +}, +{ + "model": "sessions.session", + "pk": "uqx9vs678eqhyhuysl80w9gl53bdrt7u", + "fields": { + "session_data": "OGRkZGE3ODAzZDNhMDYzNjMyYTQ1YTBiOTg4MDk3OTRlOTVkYmZkYTp7Il9hdXRoX3VzZXJfYmFja2VuZCI6ImRqYW5nby5jb250cmliLmF1dGguYmFja2VuZHMuTW9kZWxCYWNrZW5kIiwiX2F1dGhfdXNlcl9pZCI6IjEiLCJfYXV0aF91c2VyX2hhc2giOiJjZjdmNTJmYzBhZWM2MTgyOTgxMzk5MzYyODUzNDY2MTdlYjE1NDMwIiwiY2FydCI6eyI4NSI6eyJxdWFudGl0eSI6MiwicHJpY2UiOiIxNzMwLjAwIn19fQ==", + "expire_date": "2017-07-01T16:22:46.192Z" + } +}, +{ + "model": "sessions.session", + "pk": "zi87qs272zaylwy8r5hyt0gdz5gf1qfi", + "fields": { + "session_data": "MDYzN2U2YjYyMzYzNWFjYTI3ZWU0OTA4YjY2MmQ0MGRkMGVjMWYzOTp7fQ==", + "expire_date": "2017-07-19T12:59:11.710Z" + } +}, +{ + "model": "products.productcategory", + "pk": 1, + "fields": { + "name": "Information security", + "slug": "information-security", + "is_active": true, + "parent": null, + "lft": 1, + "rght": 6, + "tree_id": 2, + "level": 0 + } +}, +{ + "model": "products.productcategory", + "pk": 2, + "fields": { + "name": "Document manipulation", + "slug": "document-manipulation", + "is_active": true, + "parent": null, + "lft": 1, + "rght": 4, + "tree_id": 1, + "level": 0 + } +}, +{ + "model": "products.productcategory", + "pk": 3, + "fields": { + "name": "System software", + "slug": "system-software", + "is_active": true, + "parent": null, + "lft": 1, + "rght": 6, + "tree_id": 3, + "level": 0 + } +}, +{ + "model": "products.productcategory", + "pk": 4, + "fields": { + "name": "Anti-virus software", + "slug": "anti-virus-software", + "is_active": true, + "parent": 1, + "lft": 2, + "rght": 3, + "tree_id": 2, + "level": 1 + } +}, +{ + "model": "products.productcategory", + "pk": 5, + "fields": { + "name": "Data recovery", + "slug": "data-recovery", + "is_active": true, + "parent": 1, + "lft": 4, + "rght": 5, + "tree_id": 2, + "level": 1 + } +}, +{ + "model": "products.productcategory", + "pk": 6, + "fields": { + "name": "OS", + "slug": "os", + "is_active": true, + "parent": 3, + "lft": 4, + "rght": 5, + "tree_id": 3, + "level": 1 + } +}, +{ + "model": "products.productcategory", + "pk": 7, + "fields": { + "name": "DB", + "slug": "db", + "is_active": true, + "parent": 3, + "lft": 2, + "rght": 3, + "tree_id": 3, + "level": 1 + } +}, +{ + "model": "products.productcategory", + "pk": 8, + "fields": { + "name": "Microsoft Office", + "slug": "microsoft-office", + "is_active": true, + "parent": 2, + "lft": 2, + "rght": 3, + "tree_id": 1, + "level": 1 + } +}, +{ + "model": "products.productattribute", + "pk": 1, + "fields": { + "name": "License type", + "slug": "license-type" + } +}, +{ + "model": "products.productattribute", + "pk": 2, + "fields": { + "name": "License term", + "slug": "license-term" + } +}, +{ + "model": "products.productattribute", + "pk": 3, + "fields": { + "name": "Technical support", + "slug": "technical-support" + } +}, +{ + "model": "products.productattribute", + "pk": 4, + "fields": { + "name": "Number users", + "slug": "number-users" + } +}, +{ + "model": "products.productattribute", + "pk": 5, + "fields": { + "name": "Type of organization", + "slug": "type-organization" + } +}, +{ + "model": "products.attributechoicevalue", + "pk": 1, + "fields": { + "name": "New", + "slug": "new", + "attribute": 1 + } +}, +{ + "model": "products.attributechoicevalue", + "pk": 2, + "fields": { + "name": "Prolongation", + "slug": "prolongation", + "attribute": 1 + } +}, +{ + "model": "products.attributechoicevalue", + "pk": 3, + "fields": { + "name": "Migration", + "slug": "migration", + "attribute": 1 + } +}, +{ + "model": "products.attributechoicevalue", + "pk": 4, + "fields": { + "name": "One year", + "slug": "one-year", + "attribute": 2 + } +}, +{ + "model": "products.attributechoicevalue", + "pk": 5, + "fields": { + "name": "Two years", + "slug": "two-years", + "attribute": 2 + } +}, +{ + "model": "products.attributechoicevalue", + "pk": 6, + "fields": { + "name": "Standard AAS", + "slug": "standard-aas", + "attribute": 3 + } +}, +{ + "model": "products.attributechoicevalue", + "pk": 7, + "fields": { + "name": "Extended AAP", + "slug": "extended-aap", + "attribute": 3 + } +}, +{ + "model": "products.attributechoicevalue", + "pk": 8, + "fields": { + "name": "from 1 to 49", + "slug": "1-49", + "attribute": 4 + } +}, +{ + "model": "products.attributechoicevalue", + "pk": 9, + "fields": { + "name": "from 50 to 99", + "slug": "50-99", + "attribute": 4 + } +}, +{ + "model": "products.attributechoicevalue", + "pk": 10, + "fields": { + "name": "from 100 to 299", + "slug": "100-299", + "attribute": 4 + } +}, +{ + "model": "products.attributechoicevalue", + "pk": 11, + "fields": { + "name": "Version Upgrade", + "slug": "version-upgrade", + "attribute": 1 + } +}, +{ + "model": "products.attributechoicevalue", + "pk": 12, + "fields": { + "name": "commercial", + "slug": "commercial", + "attribute": 5 + } +}, +{ + "model": "products.attributechoicevalue", + "pk": 13, + "fields": { + "name": "educational", + "slug": "educational", + "attribute": 5 + } +}, +{ + "model": "products.productclass", + "pk": 1, + "fields": { + "name": "Antivirus software class", + "has_variants": true, + "variant_attributes": [ + 2, + 1, + 5 + ] + } +}, +{ + "model": "products.productclass", + "pk": 2, + "fields": { + "name": "Data recovery class", + "has_variants": true, + "variant_attributes": [ + 1, + 3 + ] + } +}, +{ + "model": "products.productclass", + "pk": 3, + "fields": { + "name": "Document manipulation class", + "has_variants": true, + "variant_attributes": [] + } +}, +{ + "model": "products.productclass", + "pk": 4, + "fields": { + "name": "DB class", + "has_variants": true, + "variant_attributes": [ + 2, + 4 + ] + } +}, +{ + "model": "products.productclass", + "pk": 5, + "fields": { + "name": "OS class", + "has_variants": true, + "variant_attributes": [ + 5 + ] + } +}, +{ + "model": "products.product", + "pk": 85, + "fields": { + "name": "Kaspersky Endpoint Security \u0434\u043b\u044f \u0431\u0438\u0437\u043d\u0435\u0441\u0430 CLOUD", + "slug": "kaspersky-endpoint-security-dlya-biznesa-cloud", + "price": "1730.00", + "points": "173.00", + "description": "Kaspersky Endpoint Security Cloud \u2013 \u044d\u0442\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u043f\u043e\u0442\u0440\u0435\u0431\u043d\u043e\u0441\u0442\u044f\u043c \u043c\u0430\u043b\u043e\u0433\u043e \u0431\u0438\u0437\u043d\u0435\u0441\u0430 \u0438 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u043d\u0430\u0434\u0435\u0436\u043d\u0443\u044e \u0437\u0430\u0449\u0438\u0442\u0443 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u043e\u0432, \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0445 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432 \u0438 \u0444\u0430\u0439\u043b\u043e\u0432\u044b\u0445 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432 \u0438\u0437 \u043e\u0431\u043b\u0430\u0447\u043d\u043e\u0439 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f. \u0420\u0435\u0448\u0435\u043d\u0438\u0435 \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043f\u043e\u043a\u0443\u043f\u043a\u0438 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u043e\u0431\u043e\u0440\u0443\u0434\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0441\u0438\u0441\u0442\u0435\u043c\u043e\u0439 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 \u0441 \u043b\u044e\u0431\u043e\u0433\u043e \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430, \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u043e\u0433\u043e \u043a \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0443.", + "short_description": "", + "producer": "Kaspersky", + "image": "products/2017/05/26/thumb_1473758588.png", + "discount": 0, + "stock": 10, + "category": 4, + "product_class": 1, + "is_active": true, + "is_hit": false, + "is_new": false, + "created": "2017-05-26", + "updated": "2017-07-07" + } +}, +{ + "model": "products.product", + "pk": 86, + "fields": { + "name": "ESET NOD32 Antivirus Business Edition", + "slug": "eset-nod32-antivirus-business-edition", + "price": "2400.00", + "points": "240.00", + "description": "ESET Endpoint Antivirus \u2013 \u043d\u043e\u0432\u043e\u0435 \u0441\u043b\u043e\u0432\u043e \u0432 \u043f\u0440\u043e\u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0439 \u0437\u0430\u0449\u0438\u0442\u0435 \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u0438\u0445 \u0440\u0430\u0431\u043e\u0447\u0438\u0445 \u0441\u0442\u0430\u043d\u0446\u0438\u0439 \u043e\u0442 \u043b\u044e\u0431\u043e\u0433\u043e \u0438\u0437 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u0432\u0440\u0435\u0434\u043e\u043d\u043e\u0441\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u0433\u043e \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u044f. \u041f\u0440\u043e\u0434\u0443\u043a\u0442 \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u043d \u043d\u0430 \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0443 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439, \u0437\u0430\u043f\u0440\u0435\u0449\u0435\u043d\u043d\u044b\u0445 \u0432 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u0445, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u043a\u043e\u043d\u0444\u0438\u0434\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438. \u0421\u043e\u0447\u0435\u0442\u0430\u043d\u0438\u0435 \u0437\u0430\u043f\u0430\u0442\u0435\u043d\u0442\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430 \u044d\u0432\u0440\u0438\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u0438 \u043d\u043e\u0432\u0435\u0439\u0448\u0438\u0445 \u0438\u043d\u0442\u0435\u043b\u043b\u0435\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0439 \u043e\u0431\u043b\u0430\u0447\u043d\u043e\u0433\u043e \u0442\u0438\u043f\u0430 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e \u0441\u043a\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 \u0442\u0438\u043f\u044b \u0443\u0433\u0440\u043e\u0437, \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u0443\u044f \u043c\u043e\u043c\u0435\u043d\u0442\u0430\u043b\u044c\u043d\u043e\u0435 \u0440\u0435\u0430\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043d\u0430 \u043f\u043e\u043f\u044b\u0442\u043a\u0438 \u0432\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u044f \u0432\u0440\u0435\u0434\u043e\u043d\u043e\u0441\u043d\u043e\u0433\u043e \u041f\u041e \u0432 \u043a\u043e\u0440\u043f\u043e\u0440\u0430\u0442\u0438\u0432\u043d\u0443\u044e \u0441\u0435\u0442\u044c.", + "short_description": "", + "producer": "Eset", + "image": "products/2017/05/26/thumb_1381486034.jpg", + "discount": 0, + "stock": 10, + "category": 4, + "product_class": 1, + "is_active": true, + "is_hit": false, + "is_new": false, + "created": "2017-05-26", + "updated": "2017-07-07" + } +}, +{ + "model": "products.product", + "pk": 87, + "fields": { + "name": "Acronis Backup 12 Workstation License", + "slug": "acronis-backup-12-workstation-license", + "price": "3190.00", + "points": "319.00", + "description": "\u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438\r\n\r\n\u0411\u044b\u0441\u0442\u0440\u043e\u0435 \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c, \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439, \u0444\u0430\u0439\u043b\u043e\u0432 \u0438 \u0434\u0430\u043d\u043d\u044b\u0445\r\n\r\n \u0411\u044b\u0441\u0442\u0440\u043e\u0435 \u0438 \u043f\u0440\u043e\u0441\u0442\u043e\u0435 \u0440\u0435\u0437\u0435\u0440\u0432\u043d\u043e\u0435 \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0438 \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u043d\u043e\u0433\u043e \u043e\u0431\u0440\u0430\u0437\u0430 \u0434\u0438\u0441\u043a\u0430\r\n \u0423\u0434\u043e\u0431\u043d\u043e\u0435 \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \"\u043d\u0430 \u0433\u043e\u043b\u043e\u0435 \u0436\u0435\u043b\u0435\u0437\u043e\" \u043d\u0430 \u0442\u043e\u043c \u0436\u0435 \u0438\u043b\u0438 \u043e\u0442\u043b\u0438\u0447\u0430\u044e\u0449\u0435\u043c\u0441\u044f \u043e\u0431\u043e\u0440\u0443\u0434\u043e\u0432\u0430\u043d\u0438\u0438, \u043b\u0438\u0431\u043e \u043d\u0430 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u0435\r\n \u0420\u0435\u0437\u0435\u0440\u0432\u043d\u043e\u0435 \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0438 \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0445 \u043f\u0430\u043f\u043e\u043a \u043d\u0430 \u0434\u0438\u0441\u043a\u0435 \u0438\u043b\u0438 \u0441\u0435\u0442\u0435\u0432\u044b\u0445 \u043f\u0430\u043f\u043e\u043a \u043e\u0431\u0449\u0435\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f\r\n \u0412\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432 \u0438 \u043f\u0430\u043f\u043e\u043a \u0438\u0437 \u0440\u0435\u0437\u0435\u0440\u0432\u043d\u043e\u0439 \u043a\u043e\u043f\u0438\u0438 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043e\u0431\u0440\u0430\u0437\u0430\r\n \u041f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0440\u0435\u0437\u0435\u0440\u0432\u043d\u044b\u0445 \u043a\u043e\u043f\u0438\u0439 \u0432 \u0444\u043e\u0440\u043c\u0430\u0442 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u043c\u0430\u0448\u0438\u043d", + "short_description": "", + "producer": "Acronis", + "image": "products/2017/05/26/thumb_1384933473.jpg", + "discount": 0, + "stock": 10, + "category": 5, + "product_class": 2, + "is_active": true, + "is_hit": false, + "is_new": false, + "created": "2017-05-26", + "updated": "2017-07-07" + } +}, +{ + "model": "products.product", + "pk": 88, + "fields": { + "name": "Symantec System Recovery Desktop", + "slug": "symantec-system-recovery-desktop", + "price": "3830.00", + "points": "383.00", + "description": "Symantec System Recovery 2013 \u2013 \u044d\u0442\u043e \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0440\u0435\u0437\u0435\u0440\u0432\u043d\u044b\u0445 \u043a\u043e\u043f\u0438\u0439 \u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0440\u0430\u0431\u043e\u0447\u0438\u0445 \u0441\u0442\u0430\u043d\u0446\u0438\u0439 \u0438 \u043d\u043e\u0443\u0442\u0431\u0443\u043a\u043e\u0432 \u0432 \u0430\u0432\u0430\u0440\u0438\u0439\u043d\u044b\u0445 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f\u0445, \u0447\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043c\u0438\u043d\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u0440\u0435\u043c\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u044f \u0438 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u0431\u044b\u0441\u0442\u0440\u043e \u0432\u0435\u0440\u043d\u0443\u0442\u044c\u0441\u044f \u043a \u0440\u0435\u0448\u0435\u043d\u0438\u044e \u0440\u0430\u0431\u043e\u0447\u0438\u0445 \u0437\u0430\u0434\u0430\u0447.\r\n\r\n\u0422\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u044f Restore Anyware, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0430\u044f \u0432 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u0435, \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u043c \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0430\u043c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e \u0440\u0435\u0448\u0430\u0442\u044c \u0432\u043e\u043f\u0440\u043e\u0441 \u043e \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0438 \u0442\u043e\u0433\u043e, \u0447\u0435\u0433\u043e \u043d\u0443\u0436\u043d\u043e, \u0432 \u043d\u0443\u0436\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0438 \u0432 \u043d\u0443\u0436\u043d\u043e\u043c \u043c\u0435\u0441\u0442\u0435. \u0414\u0430\u043d\u043d\u0430\u044f \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u044f \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0444\u0430\u0439\u043b\u044b, \u043f\u0430\u043f\u043a\u0438 \u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439, \u043d\u043e \u0438 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440 \u0446\u0435\u043b\u0438\u043a\u043e\u043c, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0442\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435 \u0438\u043b\u0438 \u043d\u043e\u0432\u043e\u0435 \u043e\u0431\u043e\u0440\u0443\u0434\u043e\u0432\u0430\u043d\u0438\u0435.", + "short_description": "", + "producer": "Symantec", + "image": "products/2017/05/26/thumb_1401701995.png", + "discount": 0, + "stock": 5, + "category": 5, + "product_class": 2, + "is_active": true, + "is_hit": false, + "is_new": false, + "created": "2017-05-26", + "updated": "2017-07-07" + } +}, +{ + "model": "products.product", + "pk": 89, + "fields": { + "name": "Microsoft Windows 10 Professional GetGenuine", + "slug": "microsoft-windows-10-professional-getgenuine", + "price": "12300.00", + "points": "1230.00", + "description": "Get Gunuine Windows Agreement GGWA \u2013 \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0434\u043b\u044f \u043b\u0438\u0446\u0435\u043d\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043a\u043e\u043f\u0438\u0439 \u041e\u0421 Windows, \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0445 \u0440\u0430\u043d\u0435\u0435 \u0431\u0435\u0437 \u043b\u0438\u0446\u0435\u043d\u0437\u0438\u0438. \u0421\u0438\u0441\u0442\u0435\u043c\u0430 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442 \u043e\u0442 5 \u0438 \u0431\u043e\u043b\u0435\u0435 \u043b\u0438\u0446\u0435\u043d\u0437\u0438\u0439 \u0438 \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u043d\u0430 \u043d\u0430 \u043a\u043e\u0440\u043f\u043e\u0440\u0430\u0442\u0438\u0432\u043d\u044b\u0445 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439.", + "short_description": "", + "producer": "Microsoft", + "image": "products/2017/05/26/thumb_1438765887.jpg", + "discount": 0, + "stock": 2, + "category": 6, + "product_class": 5, + "is_active": true, + "is_hit": false, + "is_new": false, + "created": "2017-05-26", + "updated": "2017-07-07" + } +}, +{ + "model": "products.product", + "pk": 90, + "fields": { + "name": "PERFEXPERT", + "slug": "perfexpert", + "price": "50000.00", + "points": "5000.00", + "description": "\u041a\u043e\u043c\u043f\u043b\u0435\u043a\u0441\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433\u0430, \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044f, \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0438 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 24\u04257. \u041e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0435 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0432\u0441\u0435\u043c\u0438 \u0438\u043d\u0446\u0438\u0434\u0435\u043d\u0442\u0430\u043c\u0438 \u0431\u0438\u0437\u043d\u0435\u0441 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043f\u0440\u0435\u0434\u043f\u0440\u0438\u044f\u0442\u0438\u044f, \u0438 \u0442\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0437\u0430\u0434\u0430\u0447\u0430\u043c\u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0438 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0431\u0438\u0437\u043d\u0435\u0441 \u0441\u0438\u0441\u0442\u0435\u043c\u044b. PERFEXPERT \u043d\u043e\u0432\u044b\u0439 \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0430 \u043e\u0431\u0441\u043b\u0443\u0436\u0438\u0432\u0430\u043d\u0438\u044f \u0432\u0441\u0435\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0431\u0438\u0437\u043d\u0435\u0441 \u0441\u0438\u0441\u0442\u0435\u043c\u044b.", + "short_description": "", + "producer": "SOFTPOINT", + "image": "products/2017/05/26/thumb_1424247372.png", + "discount": 0, + "stock": 5, + "category": 7, + "product_class": 4, + "is_active": true, + "is_hit": false, + "is_new": false, + "created": "2017-05-26", + "updated": "2017-07-07" + } +}, +{ + "model": "products.product", + "pk": 91, + "fields": { + "name": "Office 365 Business Open", + "slug": "office-365-business-open", + "price": "5700.00", + "points": "570.00", + "description": "\u041f\u043b\u0430\u043d Office 365 \u0411\u0438\u0437\u043d\u0435\u0441 \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0432 \u0441\u0435\u0431\u044f \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0438 \u0446\u0435\u043d\u043e\u0432\u044b\u0435 \u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u044b, \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u0443\u0434\u043e\u0432\u043b\u0435\u0442\u0432\u043e\u0440\u0435\u043d\u0438\u044f \u043f\u043e\u0442\u0440\u0435\u0431\u043d\u043e\u0441\u0442\u0435\u0439 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432 \u043c\u0430\u043b\u043e\u0433\u043e \u0438 \u0441\u0440\u0435\u0434\u043d\u0435\u0433\u043e \u0431\u0438\u0437\u043d\u0435\u0441\u0430 \u2013 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0439 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u043c \u043e\u0442 1 \u0434\u043e 300 \u0441\u043e\u0442\u0440\u0443\u0434\u043d\u0438\u043a\u043e\u0432.", + "short_description": "", + "producer": "Microsoft", + "image": "products/2017/05/26/office.png", + "discount": 5, + "stock": 13, + "category": 8, + "product_class": 3, + "is_active": true, + "is_hit": false, + "is_new": false, + "created": "2017-05-26", + "updated": "2017-07-07" + } +}, +{ + "model": "products.offer", + "pk": 30, + "fields": { + "product": 85, + "name": "Kaspersky-New-One-year", + "price": "1730.00", + "points": "0.00", + "attributes": "{\"License type\": \"New\", \"License term\": \"One year\"}" + } +}, +{ + "model": "products.offer", + "pk": 31, + "fields": { + "product": 85, + "name": "Kaspersky-New-One-year", + "price": "2600.00", + "points": "0.00", + "attributes": "{\"License type\": \"New\", \"License term\": \"Two years\"}" + } +}, +{ + "model": "products.offer", + "pk": 32, + "fields": { + "product": 85, + "name": "Kaspersky-Prolongation-One-year", + "price": "1200.00", + "points": "0.00", + "attributes": "{\"License type\": \"Prolongation\", \"License term\": \"One year\"}" + } +}, +{ + "model": "products.offer", + "pk": 33, + "fields": { + "product": 85, + "name": "Kaspersky-Migration-One-year", + "price": "1900.00", + "points": "0.00", + "attributes": "{\"License type\": \"Migration\", \"License term\": \"One year\"}" + } +}, +{ + "model": "auth.permission", + "pk": 1, + "fields": { + "name": "Can add log entry", + "content_type": 1, + "codename": "add_logentry" + } +}, +{ + "model": "auth.permission", + "pk": 2, + "fields": { + "name": "Can change log entry", + "content_type": 1, + "codename": "change_logentry" + } +}, +{ + "model": "auth.permission", + "pk": 3, + "fields": { + "name": "Can delete log entry", + "content_type": 1, + "codename": "delete_logentry" + } +}, +{ + "model": "auth.permission", + "pk": 4, + "fields": { + "name": "Can add group", + "content_type": 2, + "codename": "add_group" + } +}, +{ + "model": "auth.permission", + "pk": 5, + "fields": { + "name": "Can change group", + "content_type": 2, + "codename": "change_group" + } +}, +{ + "model": "auth.permission", + "pk": 6, + "fields": { + "name": "Can delete group", + "content_type": 2, + "codename": "delete_group" + } +}, +{ + "model": "auth.permission", + "pk": 7, + "fields": { + "name": "Can add permission", + "content_type": 3, + "codename": "add_permission" + } +}, +{ + "model": "auth.permission", + "pk": 8, + "fields": { + "name": "Can change permission", + "content_type": 3, + "codename": "change_permission" + } +}, +{ + "model": "auth.permission", + "pk": 9, + "fields": { + "name": "Can delete permission", + "content_type": 3, + "codename": "delete_permission" + } +}, +{ + "model": "auth.permission", + "pk": 10, + "fields": { + "name": "Can add user", + "content_type": 4, + "codename": "add_user" + } +}, +{ + "model": "auth.permission", + "pk": 11, + "fields": { + "name": "Can change user", + "content_type": 4, + "codename": "change_user" + } +}, +{ + "model": "auth.permission", + "pk": 12, + "fields": { + "name": "Can delete user", + "content_type": 4, + "codename": "delete_user" + } +}, +{ + "model": "auth.permission", + "pk": 13, + "fields": { + "name": "Can add content type", + "content_type": 5, + "codename": "add_contenttype" + } +}, +{ + "model": "auth.permission", + "pk": 14, + "fields": { + "name": "Can change content type", + "content_type": 5, + "codename": "change_contenttype" + } +}, +{ + "model": "auth.permission", + "pk": 15, + "fields": { + "name": "Can delete content type", + "content_type": 5, + "codename": "delete_contenttype" + } +}, +{ + "model": "auth.permission", + "pk": 16, + "fields": { + "name": "Can add session", + "content_type": 6, + "codename": "add_session" + } +}, +{ + "model": "auth.permission", + "pk": 17, + "fields": { + "name": "Can change session", + "content_type": 6, + "codename": "change_session" + } +}, +{ + "model": "auth.permission", + "pk": 18, + "fields": { + "name": "Can delete session", + "content_type": 6, + "codename": "delete_session" + } +}, +{ + "model": "auth.permission", + "pk": 19, + "fields": { + "name": "Can add MySubsciber", + "content_type": 7, + "codename": "add_subscriber" + } +}, +{ + "model": "auth.permission", + "pk": 20, + "fields": { + "name": "Can change MySubsciber", + "content_type": 7, + "codename": "change_subscriber" + } +}, +{ + "model": "auth.permission", + "pk": 21, + "fields": { + "name": "Can delete MySubsciber", + "content_type": 7, + "codename": "delete_subscriber" + } +}, +{ + "model": "auth.permission", + "pk": 22, + "fields": { + "name": "Can add Order", + "content_type": 8, + "codename": "add_order" + } +}, +{ + "model": "auth.permission", + "pk": 23, + "fields": { + "name": "Can change Order", + "content_type": 8, + "codename": "change_order" + } +}, +{ + "model": "auth.permission", + "pk": 24, + "fields": { + "name": "Can delete Order", + "content_type": 8, + "codename": "delete_order" + } +}, +{ + "model": "auth.permission", + "pk": 25, + "fields": { + "name": "Can add Product in Cart", + "content_type": 9, + "codename": "add_productsinbasket" + } +}, +{ + "model": "auth.permission", + "pk": 26, + "fields": { + "name": "Can change Product in Cart", + "content_type": 9, + "codename": "change_productsinbasket" + } +}, +{ + "model": "auth.permission", + "pk": 27, + "fields": { + "name": "Can delete Product in Cart", + "content_type": 9, + "codename": "delete_productsinbasket" + } +}, +{ + "model": "auth.permission", + "pk": 28, + "fields": { + "name": "Can add State of order", + "content_type": 10, + "codename": "add_status" + } +}, +{ + "model": "auth.permission", + "pk": 29, + "fields": { + "name": "Can change State of order", + "content_type": 10, + "codename": "change_status" + } +}, +{ + "model": "auth.permission", + "pk": 30, + "fields": { + "name": "Can delete State of order", + "content_type": 10, + "codename": "delete_status" + } +}, +{ + "model": "auth.permission", + "pk": 31, + "fields": { + "name": "Can add Product in Order", + "content_type": 11, + "codename": "add_productsinorder" + } +}, +{ + "model": "auth.permission", + "pk": 32, + "fields": { + "name": "Can change Product in Order", + "content_type": 11, + "codename": "change_productsinorder" + } +}, +{ + "model": "auth.permission", + "pk": 33, + "fields": { + "name": "Can delete Product in Order", + "content_type": 11, + "codename": "delete_productsinorder" + } +}, +{ + "model": "auth.permission", + "pk": 34, + "fields": { + "name": "Can add user profile", + "content_type": 12, + "codename": "add_userprofile" + } +}, +{ + "model": "auth.permission", + "pk": 35, + "fields": { + "name": "Can change user profile", + "content_type": 12, + "codename": "change_userprofile" + } +}, +{ + "model": "auth.permission", + "pk": 36, + "fields": { + "name": "Can delete user profile", + "content_type": 12, + "codename": "delete_userprofile" + } +}, +{ + "model": "auth.permission", + "pk": 37, + "fields": { + "name": "Can add product class", + "content_type": 13, + "codename": "add_productclass" + } +}, +{ + "model": "auth.permission", + "pk": 38, + "fields": { + "name": "Can change product class", + "content_type": 13, + "codename": "change_productclass" + } +}, +{ + "model": "auth.permission", + "pk": 39, + "fields": { + "name": "Can delete product class", + "content_type": 13, + "codename": "delete_productclass" + } +}, +{ + "model": "auth.permission", + "pk": 40, + "fields": { + "name": "Can add Products category", + "content_type": 14, + "codename": "add_productcategory" + } +}, +{ + "model": "auth.permission", + "pk": 41, + "fields": { + "name": "Can change Products category", + "content_type": 14, + "codename": "change_productcategory" + } +}, +{ + "model": "auth.permission", + "pk": 42, + "fields": { + "name": "Can delete Products category", + "content_type": 14, + "codename": "delete_productcategory" + } +}, +{ + "model": "auth.permission", + "pk": 43, + "fields": { + "name": "Can add Product", + "content_type": 15, + "codename": "add_product" + } +}, +{ + "model": "auth.permission", + "pk": 44, + "fields": { + "name": "Can change Product", + "content_type": 15, + "codename": "change_product" + } +}, +{ + "model": "auth.permission", + "pk": 45, + "fields": { + "name": "Can delete Product", + "content_type": 15, + "codename": "delete_product" + } +}, +{ + "model": "auth.permission", + "pk": 46, + "fields": { + "name": "Can add Photo", + "content_type": 16, + "codename": "add_productimage" + } +}, +{ + "model": "auth.permission", + "pk": 47, + "fields": { + "name": "Can change Photo", + "content_type": 16, + "codename": "change_productimage" + } +}, +{ + "model": "auth.permission", + "pk": 48, + "fields": { + "name": "Can delete Photo", + "content_type": 16, + "codename": "delete_productimage" + } +}, +{ + "model": "auth.permission", + "pk": 49, + "fields": { + "name": "Can add Product attribute", + "content_type": 17, + "codename": "add_productattribute" + } +}, +{ + "model": "auth.permission", + "pk": 50, + "fields": { + "name": "Can change Product attribute", + "content_type": 17, + "codename": "change_productattribute" + } +}, +{ + "model": "auth.permission", + "pk": 51, + "fields": { + "name": "Can delete Product attribute", + "content_type": 17, + "codename": "delete_productattribute" + } +}, +{ + "model": "auth.permission", + "pk": 52, + "fields": { + "name": "Can add Offer", + "content_type": 18, + "codename": "add_offer" + } +}, +{ + "model": "auth.permission", + "pk": 53, + "fields": { + "name": "Can change Offer", + "content_type": 18, + "codename": "change_offer" + } +}, +{ + "model": "auth.permission", + "pk": 54, + "fields": { + "name": "Can delete Offer", + "content_type": 18, + "codename": "delete_offer" + } +}, +{ + "model": "auth.permission", + "pk": 55, + "fields": { + "name": "Can add attribute choices value", + "content_type": 19, + "codename": "add_attributechoicevalue" + } +}, +{ + "model": "auth.permission", + "pk": 56, + "fields": { + "name": "Can change attribute choices value", + "content_type": 19, + "codename": "change_attributechoicevalue" + } +}, +{ + "model": "auth.permission", + "pk": 57, + "fields": { + "name": "Can delete attribute choices value", + "content_type": 19, + "codename": "delete_attributechoicevalue" + } +}, +{ + "model": "auth.permission", + "pk": 58, + "fields": { + "name": "Can add PayPal IPN", + "content_type": 20, + "codename": "add_paypalipn" + } +}, +{ + "model": "auth.permission", + "pk": 59, + "fields": { + "name": "Can change PayPal IPN", + "content_type": 20, + "codename": "change_paypalipn" + } +}, +{ + "model": "auth.permission", + "pk": 60, + "fields": { + "name": "Can delete PayPal IPN", + "content_type": 20, + "codename": "delete_paypalipn" + } +}, +{ + "model": "auth.permission", + "pk": 61, + "fields": { + "name": "Can add discount", + "content_type": 21, + "codename": "add_discount" + } +}, +{ + "model": "auth.permission", + "pk": 62, + "fields": { + "name": "Can change discount", + "content_type": 21, + "codename": "change_discount" + } +}, +{ + "model": "auth.permission", + "pk": 63, + "fields": { + "name": "Can delete discount", + "content_type": 21, + "codename": "delete_discount" + } +}, +{ + "model": "auth.permission", + "pk": 64, + "fields": { + "name": "Can add PickUpRequest", + "content_type": 22, + "codename": "add_pickuprequest" + } +}, +{ + "model": "auth.permission", + "pk": 65, + "fields": { + "name": "Can change PickUpRequest", + "content_type": 22, + "codename": "change_pickuprequest" + } +}, +{ + "model": "auth.permission", + "pk": 66, + "fields": { + "name": "Can delete PickUpRequest", + "content_type": 22, + "codename": "delete_pickuprequest" + } +}, +{ + "model": "auth.user", + "pk": 1, + "fields": { + "password": "pbkdf2_sha256$30000$ZEsyRnfJTqPV$Gszx4riOl4npoc0USa2ECMgMejhu1C1gErFJsM4JdBI=", + "last_login": "2017-07-19T12:48:00.647Z", + "is_superuser": true, + "username": "admin", + "first_name": "", + "last_name": "", + "email": "bda2291@mail.ru", + "is_staff": true, + "is_active": true, + "date_joined": "2017-05-26T07:03:30.087Z", + "groups": [], + "user_permissions": [] + } +}, +{ + "model": "auth.user", + "pk": 2, + "fields": { + "password": "pbkdf2_sha256$30000$xjHRaa2j9tiU$MUPQThfblXHcYb03MuIixPherJx41Rz6Nrd6k+x0zeM=", + "last_login": "2017-07-06T17:28:00.936Z", + "is_superuser": false, + "username": "Denis", + "first_name": "", + "last_name": "", + "email": "bda2291@mail.ru", + "is_staff": false, + "is_active": true, + "date_joined": "2017-05-26T11:54:35.780Z", + "groups": [], + "user_permissions": [] + } +}, +{ + "model": "auth.user", + "pk": 33, + "fields": { + "password": "pbkdf2_sha256$30000$DGbPnhSYnrtW$LwO9H3g7knLeeZ6YG6yjBzcjXI62bV5KRUfz/iLaVhM=", + "last_login": "2017-07-19T12:49:18.673Z", + "is_superuser": false, + "username": "Boba", + "first_name": "", + "last_name": "", + "email": "boba@mail.ru", + "is_staff": false, + "is_active": true, + "date_joined": "2017-07-05T13:09:24.524Z", + "groups": [], + "user_permissions": [] + } +}, +{ + "model": "userprofile.userprofile", + "pk": 1, + "fields": { + "user": 1, + "description": "", + "city": "", + "phone": "+NoneNone", + "user_points": "0.00", + "parent": null + } +}, +{ + "model": "userprofile.userprofile", + "pk": 2, + "fields": { + "user": 2, + "description": "Hello World!", + "city": "Moscow", + "phone": "+79255311852", + "user_points": "0.00", + "parent": null + } +}, +{ + "model": "userprofile.userprofile", + "pk": 29, + "fields": { + "user": 33, + "description": "Hello World!", + "city": "Moscow", + "phone": "", + "user_points": "0.00", + "parent": 2 + } +}, +{ + "model": "userprofile.pickuprequest", + "pk": 9, + "fields": { + "user": 33, + "points": "100.00", + "requisites": "12" + } +}, +{ + "model": "userprofile.pickuprequest", + "pk": 10, + "fields": { + "user": 33, + "points": "100.00", + "requisites": "12345" + } +}, +{ + "model": "discount.discount", + "pk": 1, + "fields": { + "user": 1, + "code": "fe49e4b1-3e38-4b36-b981-c91076b9ca9b", + "valid_from": "2017-07-04T15:38:02.197Z", + "valid_to": "2017-07-11T15:38:02.197Z", + "discount": 10, + "active": true + } +}, +{ + "model": "discount.discount", + "pk": 2, + "fields": { + "user": 2, + "code": "496963d9-ddc4-4333-98cf-17a3d3a3128a", + "valid_from": "2017-05-26T11:54:52.120Z", + "valid_to": "2017-06-02T11:54:52.120Z", + "discount": 10, + "active": true + } +}, +{ + "model": "discount.discount", + "pk": 33, + "fields": { + "user": 33, + "code": "73af9d3e-6d1a-4f41-9081-5f2a0b3b59dd", + "valid_from": "2017-07-06T11:26:58.021Z", + "valid_to": "2017-07-13T11:26:58.021Z", + "discount": 10, + "active": true + } +}, +{ + "model": "admin.logentry", + "pk": 1, + "fields": { + "action_time": "2017-05-26T08:15:07.530Z", + "user": 1, + "content_type": 14, + "object_id": "1", + "object_repr": "Information security", + "action_flag": 1, + "change_message": "[{\"added\": {}}]" + } +}, +{ + "model": "admin.logentry", + "pk": 2, + "fields": { + "action_time": "2017-05-26T08:16:18.843Z", + "user": 1, + "content_type": 14, + "object_id": "2", + "object_repr": "Document manipulation", + "action_flag": 1, + "change_message": "[{\"added\": {}}]" + } +}, +{ + "model": "admin.logentry", + "pk": 3, + "fields": { + "action_time": "2017-05-26T08:16:45.606Z", + "user": 1, + "content_type": 14, + "object_id": "3", + "object_repr": "System software", + "action_flag": 1, + "change_message": "[{\"added\": {}}]" + } +}, +{ + "model": "admin.logentry", + "pk": 4, + "fields": { + "action_time": "2017-05-26T08:17:29.603Z", + "user": 1, + "content_type": 14, + "object_id": "4", + "object_repr": "Anti-virus software", + "action_flag": 1, + "change_message": "[{\"added\": {}}]" + } +}, +{ + "model": "admin.logentry", + "pk": 5, + "fields": { + "action_time": "2017-05-26T08:18:04.909Z", + "user": 1, + "content_type": 14, + "object_id": "5", + "object_repr": "Data recovery", + "action_flag": 1, + "change_message": "[{\"added\": {}}]" + } +}, +{ + "model": "admin.logentry", + "pk": 6, + "fields": { + "action_time": "2017-05-26T08:18:31.462Z", + "user": 1, + "content_type": 14, + "object_id": "6", + "object_repr": "OS", + "action_flag": 1, + "change_message": "[{\"added\": {}}]" + } +}, +{ + "model": "admin.logentry", + "pk": 7, + "fields": { + "action_time": "2017-05-26T08:18:51.627Z", + "user": 1, + "content_type": 14, + "object_id": "7", + "object_repr": "DB", + "action_flag": 1, + "change_message": "[{\"added\": {}}]" + } +}, +{ + "model": "admin.logentry", + "pk": 8, + "fields": { + "action_time": "2017-05-26T08:19:22.030Z", + "user": 1, + "content_type": 14, + "object_id": "8", + "object_repr": "Microsoft Office", + "action_flag": 1, + "change_message": "[{\"added\": {}}]" + } +}, +{ + "model": "admin.logentry", + "pk": 9, + "fields": { + "action_time": "2017-05-26T08:22:13.343Z", + "user": 1, + "content_type": 17, + "object_id": "1", + "object_repr": "License type", + "action_flag": 1, + "change_message": "[{\"added\": {}}, {\"added\": {\"name\": \"attribute choices value\", \"object\": \"New\"}}, {\"added\": {\"name\": \"attribute choices value\", \"object\": \"Prolongation\"}}, {\"added\": {\"name\": \"attribute choices value\", \"object\": \"Migration\"}}]" + } +}, +{ + "model": "admin.logentry", + "pk": 10, + "fields": { + "action_time": "2017-05-26T08:23:29.521Z", + "user": 1, + "content_type": 17, + "object_id": "2", + "object_repr": "License term", + "action_flag": 1, + "change_message": "[{\"added\": {}}, {\"added\": {\"name\": \"attribute choices value\", \"object\": \"One year\"}}, {\"added\": {\"name\": \"attribute choices value\", \"object\": \"Two years\"}}]" + } +}, +{ + "model": "admin.logentry", + "pk": 11, + "fields": { + "action_time": "2017-05-26T08:25:46.448Z", + "user": 1, + "content_type": 17, + "object_id": "3", + "object_repr": "technical support", + "action_flag": 1, + "change_message": "[{\"added\": {}}, {\"added\": {\"name\": \"attribute choices value\", \"object\": \"Standard AAS\"}}, {\"added\": {\"name\": \"attribute choices value\", \"object\": \"Extended AAP\"}}]" + } +}, +{ + "model": "admin.logentry", + "pk": 12, + "fields": { + "action_time": "2017-05-26T08:28:53.880Z", + "user": 1, + "content_type": 17, + "object_id": "4", + "object_repr": "Number users", + "action_flag": 1, + "change_message": "[{\"added\": {}}, {\"added\": {\"name\": \"attribute choices value\", \"object\": \"from 1 to 49\"}}, {\"added\": {\"name\": \"attribute choices value\", \"object\": \"from 50 to 99\"}}, {\"added\": {\"name\": \"attribute choices value\", \"object\": \"from 100 to 299\"}}]" + } +}, +{ + "model": "admin.logentry", + "pk": 13, + "fields": { + "action_time": "2017-05-26T08:29:39.956Z", + "user": 1, + "content_type": 17, + "object_id": "1", + "object_repr": "License type", + "action_flag": 2, + "change_message": "[{\"added\": {\"name\": \"attribute choices value\", \"object\": \"Version Upgrade\"}}]" + } +}, +{ + "model": "admin.logentry", + "pk": 14, + "fields": { + "action_time": "2017-05-26T08:31:53.037Z", + "user": 1, + "content_type": 17, + "object_id": "5", + "object_repr": "Type of organization", + "action_flag": 1, + "change_message": "[{\"added\": {}}, {\"added\": {\"name\": \"attribute choices value\", \"object\": \"commercial\"}}, {\"added\": {\"name\": \"attribute choices value\", \"object\": \"educational\"}}]" + } +}, +{ + "model": "admin.logentry", + "pk": 15, + "fields": { + "action_time": "2017-05-26T08:32:06.851Z", + "user": 1, + "content_type": 17, + "object_id": "3", + "object_repr": "Technical support", + "action_flag": 2, + "change_message": "[{\"changed\": {\"fields\": [\"name\"]}}]" + } +}, +{ + "model": "admin.logentry", + "pk": 16, + "fields": { + "action_time": "2017-05-26T08:33:59.088Z", + "user": 1, + "content_type": 13, + "object_id": "1", + "object_repr": "Antivirus software", + "action_flag": 1, + "change_message": "[{\"added\": {}}]" + } +}, +{ + "model": "admin.logentry", + "pk": 17, + "fields": { + "action_time": "2017-05-26T08:35:12.007Z", + "user": 1, + "content_type": 13, + "object_id": "1", + "object_repr": "Antivirus software class", + "action_flag": 2, + "change_message": "[{\"changed\": {\"fields\": [\"name\"]}}]" + } +}, +{ + "model": "admin.logentry", + "pk": 18, + "fields": { + "action_time": "2017-05-26T08:36:11.118Z", + "user": 1, + "content_type": 13, + "object_id": "2", + "object_repr": "Data recovery class", + "action_flag": 1, + "change_message": "[{\"added\": {}}]" + } +}, +{ + "model": "admin.logentry", + "pk": 19, + "fields": { + "action_time": "2017-05-26T08:36:45.061Z", + "user": 1, + "content_type": 13, + "object_id": "3", + "object_repr": "Document manipulation class", + "action_flag": 1, + "change_message": "[{\"added\": {}}]" + } +}, +{ + "model": "admin.logentry", + "pk": 20, + "fields": { + "action_time": "2017-05-26T08:37:17.314Z", + "user": 1, + "content_type": 13, + "object_id": "4", + "object_repr": "DB class", + "action_flag": 1, + "change_message": "[{\"added\": {}}]" + } +}, +{ + "model": "admin.logentry", + "pk": 21, + "fields": { + "action_time": "2017-05-26T08:37:41.879Z", + "user": 1, + "content_type": 13, + "object_id": "5", + "object_repr": "OS class", + "action_flag": 1, + "change_message": "[{\"added\": {}}]" + } +}, +{ + "model": "admin.logentry", + "pk": 22, + "fields": { + "action_time": "2017-05-26T09:52:12.904Z", + "user": 1, + "content_type": 15, + "object_id": "85", + "object_repr": "Kaspersky Endpoint Security \u0434\u043b\u044f \u0431\u0438\u0437\u043d\u0435\u0441\u0430 CLOUD", + "action_flag": 1, + "change_message": "new through import_export" + } +}, +{ + "model": "admin.logentry", + "pk": 23, + "fields": { + "action_time": "2017-05-26T09:52:12.976Z", + "user": 1, + "content_type": 15, + "object_id": "86", + "object_repr": "ESET NOD32 Antivirus Business Edition", + "action_flag": 1, + "change_message": "new through import_export" + } +}, +{ + "model": "admin.logentry", + "pk": 24, + "fields": { + "action_time": "2017-05-26T09:52:13.137Z", + "user": 1, + "content_type": 15, + "object_id": "87", + "object_repr": "Acronis Backup 12 Workstation License", + "action_flag": 1, + "change_message": "new through import_export" + } +}, +{ + "model": "admin.logentry", + "pk": 25, + "fields": { + "action_time": "2017-05-26T09:52:13.278Z", + "user": 1, + "content_type": 15, + "object_id": "88", + "object_repr": "Symantec System Recovery Desktop", + "action_flag": 1, + "change_message": "new through import_export" + } +}, +{ + "model": "admin.logentry", + "pk": 26, + "fields": { + "action_time": "2017-05-26T09:52:13.562Z", + "user": 1, + "content_type": 15, + "object_id": "89", + "object_repr": "Microsoft Windows 10 Professional GetGenuine", + "action_flag": 1, + "change_message": "new through import_export" + } +}, +{ + "model": "admin.logentry", + "pk": 27, + "fields": { + "action_time": "2017-05-26T09:52:13.600Z", + "user": 1, + "content_type": 15, + "object_id": "90", + "object_repr": "PERFEXPERT", + "action_flag": 1, + "change_message": "new through import_export" + } +}, +{ + "model": "admin.logentry", + "pk": 28, + "fields": { + "action_time": "2017-05-26T09:52:13.625Z", + "user": 1, + "content_type": 15, + "object_id": "91", + "object_repr": "Office 365 Business Open", + "action_flag": 1, + "change_message": "new through import_export" + } +}, +{ + "model": "admin.logentry", + "pk": 29, + "fields": { + "action_time": "2017-05-26T09:55:06.073Z", + "user": 1, + "content_type": 15, + "object_id": "85", + "object_repr": "Kaspersky Endpoint Security \u0434\u043b\u044f \u0431\u0438\u0437\u043d\u0435\u0441\u0430 CLOUD", + "action_flag": 2, + "change_message": "[{\"changed\": {\"fields\": [\"slug\", \"product_class\"]}}]" + } +}, +{ + "model": "admin.logentry", + "pk": 30, + "fields": { + "action_time": "2017-05-26T09:55:31.258Z", + "user": 1, + "content_type": 15, + "object_id": "86", + "object_repr": "ESET NOD32 Antivirus Business Edition", + "action_flag": 2, + "change_message": "[{\"changed\": {\"fields\": [\"slug\", \"product_class\"]}}]" + } +}, +{ + "model": "admin.logentry", + "pk": 31, + "fields": { + "action_time": "2017-05-26T09:55:48.017Z", + "user": 1, + "content_type": 15, + "object_id": "87", + "object_repr": "Acronis Backup 12 Workstation License", + "action_flag": 2, + "change_message": "[{\"changed\": {\"fields\": [\"slug\", \"description\", \"product_class\"]}}]" + } +}, +{ + "model": "admin.logentry", + "pk": 32, + "fields": { + "action_time": "2017-05-26T09:56:13.147Z", + "user": 1, + "content_type": 15, + "object_id": "88", + "object_repr": "Symantec System Recovery Desktop", + "action_flag": 2, + "change_message": "[{\"changed\": {\"fields\": [\"slug\", \"description\", \"product_class\"]}}]" + } +}, +{ + "model": "admin.logentry", + "pk": 33, + "fields": { + "action_time": "2017-05-26T09:56:35.778Z", + "user": 1, + "content_type": 15, + "object_id": "89", + "object_repr": "Microsoft Windows 10 Professional GetGenuine", + "action_flag": 2, + "change_message": "[{\"changed\": {\"fields\": [\"slug\", \"product_class\"]}}]" + } +}, +{ + "model": "admin.logentry", + "pk": 34, + "fields": { + "action_time": "2017-05-26T09:57:12.477Z", + "user": 1, + "content_type": 15, + "object_id": "90", + "object_repr": "PERFEXPERT", + "action_flag": 2, + "change_message": "[{\"changed\": {\"fields\": [\"slug\", \"product_class\"]}}]" + } +}, +{ + "model": "admin.logentry", + "pk": 35, + "fields": { + "action_time": "2017-05-26T09:57:29.585Z", + "user": 1, + "content_type": 15, + "object_id": "91", + "object_repr": "Office 365 Business Open", + "action_flag": 2, + "change_message": "[{\"changed\": {\"fields\": [\"slug\", \"product_class\"]}}]" + } +}, +{ + "model": "admin.logentry", + "pk": 36, + "fields": { + "action_time": "2017-05-26T09:59:44.396Z", + "user": 1, + "content_type": 15, + "object_id": "85", + "object_repr": "Kaspersky Endpoint Security \u0434\u043b\u044f \u0431\u0438\u0437\u043d\u0435\u0441\u0430 CLOUD", + "action_flag": 2, + "change_message": "[]" + } +}, +{ + "model": "admin.logentry", + "pk": 37, + "fields": { + "action_time": "2017-05-26T11:43:14.056Z", + "user": 1, + "content_type": 15, + "object_id": "85", + "object_repr": "Kaspersky Endpoint Security \u0434\u043b\u044f \u0431\u0438\u0437\u043d\u0435\u0441\u0430 CLOUD", + "action_flag": 2, + "change_message": "[{\"changed\": {\"fields\": [\"image\"]}}, {\"added\": {\"name\": \"Offer\", \"object\": \"Kaspersky-New-One-year\"}}, {\"added\": {\"name\": \"Offer\", \"object\": \"Kaspersky-New-One-year\"}}, {\"added\": {\"name\": \"Offer\", \"object\": \"Kaspersky-Prolongation-One-year\"}}, {\"added\": {\"name\": \"Offer\", \"object\": \"Kaspersky-Migration-One-year\"}}]" + } +}, +{ + "model": "admin.logentry", + "pk": 38, + "fields": { + "action_time": "2017-05-26T11:43:35.828Z", + "user": 1, + "content_type": 15, + "object_id": "86", + "object_repr": "ESET NOD32 Antivirus Business Edition", + "action_flag": 2, + "change_message": "[{\"changed\": {\"fields\": [\"image\"]}}]" + } +}, +{ + "model": "admin.logentry", + "pk": 39, + "fields": { + "action_time": "2017-05-26T11:43:59.323Z", + "user": 1, + "content_type": 15, + "object_id": "87", + "object_repr": "Acronis Backup 12 Workstation License", + "action_flag": 2, + "change_message": "[{\"changed\": {\"fields\": [\"image\"]}}]" + } +}, +{ + "model": "admin.logentry", + "pk": 40, + "fields": { + "action_time": "2017-05-26T11:44:16.241Z", + "user": 1, + "content_type": 15, + "object_id": "88", + "object_repr": "Symantec System Recovery Desktop", + "action_flag": 2, + "change_message": "[{\"changed\": {\"fields\": [\"image\"]}}]" + } +}, +{ + "model": "admin.logentry", + "pk": 41, + "fields": { + "action_time": "2017-05-26T11:44:34.651Z", + "user": 1, + "content_type": 15, + "object_id": "89", + "object_repr": "Microsoft Windows 10 Professional GetGenuine", + "action_flag": 2, + "change_message": "[{\"changed\": {\"fields\": [\"image\"]}}]" + } +}, +{ + "model": "admin.logentry", + "pk": 42, + "fields": { + "action_time": "2017-05-26T11:45:20.186Z", + "user": 1, + "content_type": 15, + "object_id": "90", + "object_repr": "PERFEXPERT", + "action_flag": 2, + "change_message": "[{\"changed\": {\"fields\": [\"image\"]}}]" + } +}, +{ + "model": "admin.logentry", + "pk": 43, + "fields": { + "action_time": "2017-05-26T11:45:35.494Z", + "user": 1, + "content_type": 15, + "object_id": "91", + "object_repr": "Office 365 Business Open", + "action_flag": 2, + "change_message": "[{\"changed\": {\"fields\": [\"image\"]}}]" + } +}, +{ + "model": "admin.logentry", + "pk": 44, + "fields": { + "action_time": "2017-05-26T11:48:12.658Z", + "user": 1, + "content_type": 15, + "object_id": "85", + "object_repr": "Kaspersky Endpoint Security \u0434\u043b\u044f \u0431\u0438\u0437\u043d\u0435\u0441\u0430 CLOUD", + "action_flag": 2, + "change_message": "[{\"changed\": {\"name\": \"Offer\", \"object\": \"Kaspersky-New-One-year\", \"fields\": [\"price\"]}}, {\"changed\": {\"name\": \"Offer\", \"object\": \"Kaspersky-New-One-year\", \"fields\": [\"price\"]}}, {\"changed\": {\"name\": \"Offer\", \"object\": \"Kaspersky-Prolongation-One-year\", \"fields\": [\"price\"]}}, {\"changed\": {\"name\": \"Offer\", \"object\": \"Kaspersky-Migration-One-year\", \"fields\": [\"price\"]}}]" + } +}, +{ + "model": "admin.logentry", + "pk": 45, + "fields": { + "action_time": "2017-07-04T18:56:48.426Z", + "user": 1, + "content_type": 12, + "object_id": "5", + "object_repr": "test2", + "action_flag": 3, + "change_message": "" + } +}, +{ + "model": "admin.logentry", + "pk": 46, + "fields": { + "action_time": "2017-07-04T18:56:48.481Z", + "user": 1, + "content_type": 12, + "object_id": "4", + "object_repr": "Boba", + "action_flag": 3, + "change_message": "" + } +}, +{ + "model": "admin.logentry", + "pk": 47, + "fields": { + "action_time": "2017-07-04T18:56:48.494Z", + "user": 1, + "content_type": 12, + "object_id": "3", + "object_repr": "test", + "action_flag": 3, + "change_message": "" + } +}, +{ + "model": "admin.logentry", + "pk": 48, + "fields": { + "action_time": "2017-07-05T08:07:12.532Z", + "user": 1, + "content_type": 4, + "object_id": "4", + "object_repr": "Boba", + "action_flag": 3, + "change_message": "" + } +}, +{ + "model": "admin.logentry", + "pk": 49, + "fields": { + "action_time": "2017-07-05T08:07:12.586Z", + "user": 1, + "content_type": 4, + "object_id": "3", + "object_repr": "test", + "action_flag": 3, + "change_message": "" + } +}, +{ + "model": "admin.logentry", + "pk": 50, + "fields": { + "action_time": "2017-07-05T08:07:12.599Z", + "user": 1, + "content_type": 4, + "object_id": "5", + "object_repr": "test2", + "action_flag": 3, + "change_message": "" + } +}, +{ + "model": "admin.logentry", + "pk": 51, + "fields": { + "action_time": "2017-07-05T08:12:04.423Z", + "user": 1, + "content_type": 4, + "object_id": "6", + "object_repr": "Boba", + "action_flag": 3, + "change_message": "" + } +}, +{ + "model": "admin.logentry", + "pk": 52, + "fields": { + "action_time": "2017-07-05T08:18:58.523Z", + "user": 1, + "content_type": 4, + "object_id": "7", + "object_repr": "Boba", + "action_flag": 3, + "change_message": "" + } +}, +{ + "model": "admin.logentry", + "pk": 53, + "fields": { + "action_time": "2017-07-05T10:10:59.779Z", + "user": 1, + "content_type": 4, + "object_id": "8", + "object_repr": "Boba", + "action_flag": 3, + "change_message": "" + } +}, +{ + "model": "admin.logentry", + "pk": 54, + "fields": { + "action_time": "2017-07-05T10:26:24.997Z", + "user": 1, + "content_type": 4, + "object_id": "9", + "object_repr": "Boba", + "action_flag": 3, + "change_message": "" + } +}, +{ + "model": "admin.logentry", + "pk": 55, + "fields": { + "action_time": "2017-07-05T10:32:52.034Z", + "user": 1, + "content_type": 12, + "object_id": "10", + "object_repr": "Boba", + "action_flag": 2, + "change_message": "[{\"changed\": {\"fields\": [\"description\", \"city\", \"parent\"]}}]" + } +}, +{ + "model": "admin.logentry", + "pk": 56, + "fields": { + "action_time": "2017-07-05T10:33:10.841Z", + "user": 1, + "content_type": 4, + "object_id": "10", + "object_repr": "Boba", + "action_flag": 3, + "change_message": "" + } +}, +{ + "model": "admin.logentry", + "pk": 57, + "fields": { + "action_time": "2017-07-05T10:34:38.964Z", + "user": 1, + "content_type": 12, + "object_id": "11", + "object_repr": "Boba", + "action_flag": 2, + "change_message": "[{\"changed\": {\"fields\": [\"description\", \"city\", \"parent\"]}}]" + } +}, +{ + "model": "admin.logentry", + "pk": 58, + "fields": { + "action_time": "2017-07-05T10:36:30.607Z", + "user": 1, + "content_type": 4, + "object_id": "11", + "object_repr": "Boba", + "action_flag": 3, + "change_message": "" + } +}, +{ + "model": "admin.logentry", + "pk": 59, + "fields": { + "action_time": "2017-07-05T10:55:27.985Z", + "user": 1, + "content_type": 4, + "object_id": "12", + "object_repr": "Boba", + "action_flag": 3, + "change_message": "" + } +}, +{ + "model": "admin.logentry", + "pk": 60, + "fields": { + "action_time": "2017-07-05T11:21:59.350Z", + "user": 1, + "content_type": 4, + "object_id": "13", + "object_repr": "Boba", + "action_flag": 3, + "change_message": "" + } +}, +{ + "model": "admin.logentry", + "pk": 61, + "fields": { + "action_time": "2017-07-05T11:21:59.403Z", + "user": 1, + "content_type": 4, + "object_id": "14", + "object_repr": "test", + "action_flag": 3, + "change_message": "" + } +}, +{ + "model": "admin.logentry", + "pk": 62, + "fields": { + "action_time": "2017-07-05T11:48:01.640Z", + "user": 1, + "content_type": 4, + "object_id": "15", + "object_repr": "Boba", + "action_flag": 3, + "change_message": "" + } +}, +{ + "model": "admin.logentry", + "pk": 63, + "fields": { + "action_time": "2017-07-05T11:48:01.667Z", + "user": 1, + "content_type": 4, + "object_id": "16", + "object_repr": "test", + "action_flag": 3, + "change_message": "" + } +}, +{ + "model": "admin.logentry", + "pk": 64, + "fields": { + "action_time": "2017-07-05T11:48:01.676Z", + "user": 1, + "content_type": 4, + "object_id": "17", + "object_repr": "test2", + "action_flag": 3, + "change_message": "" + } +}, +{ + "model": "admin.logentry", + "pk": 65, + "fields": { + "action_time": "2017-07-05T11:55:43.299Z", + "user": 1, + "content_type": 4, + "object_id": "18", + "object_repr": "Boba", + "action_flag": 3, + "change_message": "" + } +}, +{ + "model": "admin.logentry", + "pk": 66, + "fields": { + "action_time": "2017-07-05T11:55:43.327Z", + "user": 1, + "content_type": 4, + "object_id": "19", + "object_repr": "test", + "action_flag": 3, + "change_message": "" + } +}, +{ + "model": "admin.logentry", + "pk": 67, + "fields": { + "action_time": "2017-07-05T11:55:43.335Z", + "user": 1, + "content_type": 4, + "object_id": "20", + "object_repr": "test2", + "action_flag": 3, + "change_message": "" + } +}, +{ + "model": "admin.logentry", + "pk": 68, + "fields": { + "action_time": "2017-07-05T12:19:43.274Z", + "user": 1, + "content_type": 4, + "object_id": "21", + "object_repr": "Boba", + "action_flag": 3, + "change_message": "" + } +}, +{ + "model": "admin.logentry", + "pk": 69, + "fields": { + "action_time": "2017-07-05T12:19:43.345Z", + "user": 1, + "content_type": 4, + "object_id": "22", + "object_repr": "test", + "action_flag": 3, + "change_message": "" + } +}, +{ + "model": "admin.logentry", + "pk": 70, + "fields": { + "action_time": "2017-07-05T12:19:43.382Z", + "user": 1, + "content_type": 4, + "object_id": "23", + "object_repr": "test2", + "action_flag": 3, + "change_message": "" + } +}, +{ + "model": "admin.logentry", + "pk": 71, + "fields": { + "action_time": "2017-07-05T12:19:43.401Z", + "user": 1, + "content_type": 4, + "object_id": "24", + "object_repr": "test3", + "action_flag": 3, + "change_message": "" + } +}, +{ + "model": "admin.logentry", + "pk": 72, + "fields": { + "action_time": "2017-07-05T12:19:43.410Z", + "user": 1, + "content_type": 4, + "object_id": "25", + "object_repr": "test4", + "action_flag": 3, + "change_message": "" + } +}, +{ + "model": "admin.logentry", + "pk": 73, + "fields": { + "action_time": "2017-07-05T12:19:43.414Z", + "user": 1, + "content_type": 4, + "object_id": "26", + "object_repr": "test5", + "action_flag": 3, + "change_message": "" + } +}, +{ + "model": "admin.logentry", + "pk": 74, + "fields": { + "action_time": "2017-07-05T13:06:56.577Z", + "user": 1, + "content_type": 4, + "object_id": "27", + "object_repr": "Boba", + "action_flag": 3, + "change_message": "" + } +}, +{ + "model": "admin.logentry", + "pk": 75, + "fields": { + "action_time": "2017-07-05T13:06:56.654Z", + "user": 1, + "content_type": 4, + "object_id": "28", + "object_repr": "test", + "action_flag": 3, + "change_message": "" + } +}, +{ + "model": "admin.logentry", + "pk": 76, + "fields": { + "action_time": "2017-07-05T13:06:56.664Z", + "user": 1, + "content_type": 4, + "object_id": "29", + "object_repr": "test2", + "action_flag": 3, + "change_message": "" + } +}, +{ + "model": "admin.logentry", + "pk": 77, + "fields": { + "action_time": "2017-07-05T13:06:56.668Z", + "user": 1, + "content_type": 4, + "object_id": "30", + "object_repr": "test3", + "action_flag": 3, + "change_message": "" + } +}, +{ + "model": "admin.logentry", + "pk": 78, + "fields": { + "action_time": "2017-07-05T13:06:56.673Z", + "user": 1, + "content_type": 4, + "object_id": "31", + "object_repr": "test4", + "action_flag": 3, + "change_message": "" + } +}, +{ + "model": "admin.logentry", + "pk": 79, + "fields": { + "action_time": "2017-07-05T13:06:56.677Z", + "user": 1, + "content_type": 4, + "object_id": "32", + "object_repr": "test5", + "action_flag": 3, + "change_message": "" + } +}, +{ + "model": "admin.logentry", + "pk": 80, + "fields": { + "action_time": "2017-07-05T18:22:28.862Z", + "user": 1, + "content_type": 12, + "object_id": "29", + "object_repr": "Boba", + "action_flag": 2, + "change_message": "[{\"changed\": {\"fields\": [\"description\", \"city\", \"user_points\"]}}]" + } +}, +{ + "model": "admin.logentry", + "pk": 81, + "fields": { + "action_time": "2017-07-06T17:27:25.464Z", + "user": 1, + "content_type": 8, + "object_id": "15", + "object_repr": "Order 15 has status None: ", + "action_flag": 3, + "change_message": "" + } +}, +{ + "model": "admin.logentry", + "pk": 82, + "fields": { + "action_time": "2017-07-06T17:27:25.533Z", + "user": 1, + "content_type": 8, + "object_id": "14", + "object_repr": "Order 14 has status None: ", + "action_flag": 3, + "change_message": "" + } +}, +{ + "model": "admin.logentry", + "pk": 83, + "fields": { + "action_time": "2017-07-06T17:27:25.548Z", + "user": 1, + "content_type": 8, + "object_id": "13", + "object_repr": "Order 13 has status None: ", + "action_flag": 3, + "change_message": "" + } +}, +{ + "model": "admin.logentry", + "pk": 84, + "fields": { + "action_time": "2017-07-06T17:27:25.556Z", + "user": 1, + "content_type": 8, + "object_id": "12", + "object_repr": "Order 12 has status None: ", + "action_flag": 3, + "change_message": "" + } +}, +{ + "model": "admin.logentry", + "pk": 85, + "fields": { + "action_time": "2017-07-06T17:27:25.565Z", + "user": 1, + "content_type": 8, + "object_id": "11", + "object_repr": "Order 11 has status None: ", + "action_flag": 3, + "change_message": "" + } +}, +{ + "model": "admin.logentry", + "pk": 86, + "fields": { + "action_time": "2017-07-06T17:27:25.570Z", + "user": 1, + "content_type": 8, + "object_id": "10", + "object_repr": "Order 10 has status None: ", + "action_flag": 3, + "change_message": "" + } +}, +{ + "model": "admin.logentry", + "pk": 87, + "fields": { + "action_time": "2017-07-06T17:27:25.576Z", + "user": 1, + "content_type": 8, + "object_id": "9", + "object_repr": "Order 9 has status None: ", + "action_flag": 3, + "change_message": "" + } +}, +{ + "model": "admin.logentry", + "pk": 88, + "fields": { + "action_time": "2017-07-06T17:27:25.585Z", + "user": 1, + "content_type": 8, + "object_id": "8", + "object_repr": "Order 8 has status None: ", + "action_flag": 3, + "change_message": "" + } +}, +{ + "model": "admin.logentry", + "pk": 89, + "fields": { + "action_time": "2017-07-06T17:27:25.589Z", + "user": 1, + "content_type": 8, + "object_id": "7", + "object_repr": "Order 7 has status None: ", + "action_flag": 3, + "change_message": "" + } +}, +{ + "model": "admin.logentry", + "pk": 90, + "fields": { + "action_time": "2017-07-06T17:27:25.593Z", + "user": 1, + "content_type": 8, + "object_id": "6", + "object_repr": "Order 6 has status None: ", + "action_flag": 3, + "change_message": "" + } +}, +{ + "model": "admin.logentry", + "pk": 91, + "fields": { + "action_time": "2017-07-06T17:27:25.600Z", + "user": 1, + "content_type": 8, + "object_id": "5", + "object_repr": "Order 5 has status None: ", + "action_flag": 3, + "change_message": "" + } +}, +{ + "model": "admin.logentry", + "pk": 92, + "fields": { + "action_time": "2017-07-06T17:27:25.609Z", + "user": 1, + "content_type": 8, + "object_id": "4", + "object_repr": "Order 4 has status None: ", + "action_flag": 3, + "change_message": "" + } +}, +{ + "model": "admin.logentry", + "pk": 93, + "fields": { + "action_time": "2017-07-06T17:27:25.617Z", + "user": 1, + "content_type": 8, + "object_id": "3", + "object_repr": "Order 3 has status None: ", + "action_flag": 3, + "change_message": "" + } +}, +{ + "model": "admin.logentry", + "pk": 94, + "fields": { + "action_time": "2017-07-06T17:27:25.626Z", + "user": 1, + "content_type": 8, + "object_id": "2", + "object_repr": "Order 2 has status None: ", + "action_flag": 3, + "change_message": "" + } +}, +{ + "model": "admin.logentry", + "pk": 95, + "fields": { + "action_time": "2017-07-06T17:27:25.635Z", + "user": 1, + "content_type": 8, + "object_id": "1", + "object_repr": "Order 1 has status None: ", + "action_flag": 3, + "change_message": "" + } +}, +{ + "model": "admin.logentry", + "pk": 96, + "fields": { + "action_time": "2017-07-06T18:24:06.928Z", + "user": 1, + "content_type": 8, + "object_id": "18", + "object_repr": "Order 18 has status None: ", + "action_flag": 3, + "change_message": "" + } +}, +{ + "model": "admin.logentry", + "pk": 97, + "fields": { + "action_time": "2017-07-06T18:24:06.944Z", + "user": 1, + "content_type": 8, + "object_id": "17", + "object_repr": "Order 17 has status None: ", + "action_flag": 3, + "change_message": "" + } +}, +{ + "model": "admin.logentry", + "pk": 98, + "fields": { + "action_time": "2017-07-06T18:24:06.950Z", + "user": 1, + "content_type": 8, + "object_id": "16", + "object_repr": "Order 16 has status None: ", + "action_flag": 3, + "change_message": "" + } +}, +{ + "model": "admin.logentry", + "pk": 99, + "fields": { + "action_time": "2017-07-07T09:00:09.727Z", + "user": 1, + "content_type": 15, + "object_id": "85", + "object_repr": "Kaspersky Endpoint Security \u0434\u043b\u044f \u0431\u0438\u0437\u043d\u0435\u0441\u0430 CLOUD", + "action_flag": 2, + "change_message": "[]" + } +}, +{ + "model": "admin.logentry", + "pk": 100, + "fields": { + "action_time": "2017-07-07T09:00:44.562Z", + "user": 1, + "content_type": 15, + "object_id": "86", + "object_repr": "ESET NOD32 Antivirus Business Edition", + "action_flag": 2, + "change_message": "[]" + } +}, +{ + "model": "admin.logentry", + "pk": 101, + "fields": { + "action_time": "2017-07-07T09:00:57.193Z", + "user": 1, + "content_type": 15, + "object_id": "87", + "object_repr": "Acronis Backup 12 Workstation License", + "action_flag": 2, + "change_message": "[]" + } +}, +{ + "model": "admin.logentry", + "pk": 102, + "fields": { + "action_time": "2017-07-07T09:01:09.669Z", + "user": 1, + "content_type": 15, + "object_id": "88", + "object_repr": "Symantec System Recovery Desktop", + "action_flag": 2, + "change_message": "[]" + } +}, +{ + "model": "admin.logentry", + "pk": 103, + "fields": { + "action_time": "2017-07-07T09:01:22.992Z", + "user": 1, + "content_type": 15, + "object_id": "89", + "object_repr": "Microsoft Windows 10 Professional GetGenuine", + "action_flag": 2, + "change_message": "[]" + } +}, +{ + "model": "admin.logentry", + "pk": 104, + "fields": { + "action_time": "2017-07-07T09:01:36.288Z", + "user": 1, + "content_type": 15, + "object_id": "90", + "object_repr": "PERFEXPERT", + "action_flag": 2, + "change_message": "[]" + } +}, +{ + "model": "admin.logentry", + "pk": 105, + "fields": { + "action_time": "2017-07-07T09:01:48.206Z", + "user": 1, + "content_type": 15, + "object_id": "91", + "object_repr": "Office 365 Business Open", + "action_flag": 2, + "change_message": "[]" + } +}, +{ + "model": "admin.logentry", + "pk": 106, + "fields": { + "action_time": "2017-07-19T12:34:44.614Z", + "user": 1, + "content_type": 22, + "object_id": "4", + "object_repr": "33", + "action_flag": 3, + "change_message": "" + } +}, +{ + "model": "admin.logentry", + "pk": 107, + "fields": { + "action_time": "2017-07-19T12:34:44.649Z", + "user": 1, + "content_type": 22, + "object_id": "3", + "object_repr": "33", + "action_flag": 3, + "change_message": "" + } +}, +{ + "model": "admin.logentry", + "pk": 108, + "fields": { + "action_time": "2017-07-19T12:34:44.659Z", + "user": 1, + "content_type": 22, + "object_id": "2", + "object_repr": "33", + "action_flag": 3, + "change_message": "" + } +}, +{ + "model": "admin.logentry", + "pk": 109, + "fields": { + "action_time": "2017-07-19T12:34:44.663Z", + "user": 1, + "content_type": 22, + "object_id": "1", + "object_repr": "33", + "action_flag": 3, + "change_message": "" + } +}, +{ + "model": "admin.logentry", + "pk": 110, + "fields": { + "action_time": "2017-07-19T12:48:20.278Z", + "user": 1, + "content_type": 22, + "object_id": "8", + "object_repr": "33", + "action_flag": 3, + "change_message": "" + } +}, +{ + "model": "admin.logentry", + "pk": 111, + "fields": { + "action_time": "2017-07-19T12:48:20.300Z", + "user": 1, + "content_type": 22, + "object_id": "7", + "object_repr": "33", + "action_flag": 3, + "change_message": "" + } +}, +{ + "model": "admin.logentry", + "pk": 112, + "fields": { + "action_time": "2017-07-19T12:48:20.306Z", + "user": 1, + "content_type": 22, + "object_id": "6", + "object_repr": "33", + "action_flag": 3, + "change_message": "" + } +}, +{ + "model": "admin.logentry", + "pk": 113, + "fields": { + "action_time": "2017-07-19T12:48:20.311Z", + "user": 1, + "content_type": 22, + "object_id": "5", + "object_repr": "33", + "action_flag": 3, + "change_message": "" + } +}, +{ + "model": "admin.logentry", + "pk": 114, + "fields": { + "action_time": "2017-07-19T12:48:38.927Z", + "user": 1, + "content_type": 12, + "object_id": "29", + "object_repr": "Boba", + "action_flag": 2, + "change_message": "[{\"changed\": {\"fields\": [\"user_points\"]}}]" + } +} +] diff --git a/landing/__init__.py b/landing/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/landing/admin.py b/landing/admin.py new file mode 100644 index 0000000..0f35232 --- /dev/null +++ b/landing/admin.py @@ -0,0 +1,15 @@ +from django.contrib import admin +from .models import * + +# Register your models here. + +class SubscriberAdmin(admin.ModelAdmin): + + list_display = [field.name for field in Subscriber._meta.fields] + list_filter = ['name'] + search_fields = ['name', 'email'] + + class Meta: + model = Subscriber + +admin.site.register(Subscriber, SubscriberAdmin) \ No newline at end of file diff --git a/landing/apps.py b/landing/apps.py new file mode 100644 index 0000000..2572f92 --- /dev/null +++ b/landing/apps.py @@ -0,0 +1,5 @@ +from django.apps import AppConfig + + +class LandingConfig(AppConfig): + name = 'landing' diff --git a/landing/forms.py b/landing/forms.py new file mode 100644 index 0000000..3c87991 --- /dev/null +++ b/landing/forms.py @@ -0,0 +1,8 @@ +from django import forms +from .models import * + +class SubscriberForm(forms.ModelForm): + + class Meta: + model = Subscriber + exclude = [""] \ No newline at end of file diff --git a/landing/models.py b/landing/models.py new file mode 100644 index 0000000..a395b1d --- /dev/null +++ b/landing/models.py @@ -0,0 +1,16 @@ +from django.db import models + +# Create your models here. +class Subscriber(models.Model): + email = models.EmailField() + name = models.CharField(max_length=128) + + class Meta: + verbose_name = 'MySubsciber' + verbose_name_plural = 'List of Subscribers' + + def __str__(self): + try: + return self.name + except: + return '{0!s}'.format(self.id) \ No newline at end of file diff --git a/landing/tests.py b/landing/tests.py new file mode 100644 index 0000000..7ce503c --- /dev/null +++ b/landing/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/landing/urls.py b/landing/urls.py new file mode 100644 index 0000000..07af835 --- /dev/null +++ b/landing/urls.py @@ -0,0 +1,7 @@ +from django.conf.urls import url +from . import views + +urlpatterns = [ + url(r'^landing/', views.landing, name='landing'), + #url(r'^$', views.home, name='home'), +] \ No newline at end of file diff --git a/landing/views.py b/landing/views.py new file mode 100644 index 0000000..e2c7bd4 --- /dev/null +++ b/landing/views.py @@ -0,0 +1,21 @@ +from django.shortcuts import render +from .forms import SubscriberForm +from django.contrib import auth +from products.models import * + +def landing(request): + form = SubscriberForm(request.POST or None) + + if request.method == "POST" and form.is_valid(): + print(form.cleaned_data) + form.save() + + return render(request, 'landing/landing.html', locals()) + + +def home(request): + product_images = ProductImage.objects.filter(is_active=True, is_main=True, product__is_active=True) + product_images_phones = product_images.filter(product__category__id=1) + product_images_watches = product_images.filter(product__category__id=2) + username = auth.get_user(request).username + return render(request, 'landing/home.html', locals()) diff --git a/loginsys/__init__.py b/loginsys/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/loginsys/admin.py b/loginsys/admin.py new file mode 100644 index 0000000..8c38f3f --- /dev/null +++ b/loginsys/admin.py @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/loginsys/apps.py b/loginsys/apps.py new file mode 100644 index 0000000..ff9b2ab --- /dev/null +++ b/loginsys/apps.py @@ -0,0 +1,5 @@ +from django.apps import AppConfig + + +class LoginsysConfig(AppConfig): + name = 'loginsys' diff --git a/loginsys/forms.py b/loginsys/forms.py new file mode 100644 index 0000000..5f84159 --- /dev/null +++ b/loginsys/forms.py @@ -0,0 +1,23 @@ +from django import forms +from django.contrib.auth.models import User +from django.contrib.auth.forms import UserCreationForm + +class RegistrationForm(UserCreationForm): + email = forms.EmailField(required=True) + parent = forms.CharField(required = False) + + class Meta: + model = User + fields = ('username', 'email', 'password1', 'password2', 'parent') + + def save(self, commit=True): + user = super(UserCreationForm, self).save(commit=False) + user.email = self.cleaned_data['email'] + if self.cleaned_data.get('parent'): + user.parent = User.objects.get(username=self.cleaned_data['parent']) + user.set_password(self.cleaned_data['password1']) + + if commit: + user.save() + + return user \ No newline at end of file diff --git a/loginsys/models.py b/loginsys/models.py new file mode 100644 index 0000000..beeb308 --- /dev/null +++ b/loginsys/models.py @@ -0,0 +1,2 @@ +from django.db import models + diff --git a/loginsys/tests.py b/loginsys/tests.py new file mode 100644 index 0000000..7ce503c --- /dev/null +++ b/loginsys/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/loginsys/urls.py b/loginsys/urls.py new file mode 100644 index 0000000..3f1d863 --- /dev/null +++ b/loginsys/urls.py @@ -0,0 +1,24 @@ +"""Eshop URL Configuration + +The `urlpatterns` list routes URLs to views. For more information please see: + https://docs.djangoproject.com/en/1.10/topics/http/urls/ +Examples: +Function views + 1. Add an import: from my_app import views + 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') +Class-based views + 1. Add an import: from other_app.views import Home + 2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home') +Including another URLconf + 1. Import the include() function: from django.conf.urls import url, include + 2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls')) +""" +from django.conf.urls import url +from . import views + + +urlpatterns = [ + url(r'^login/', views.login, name='login'), + url(r'^logout/', views.logout, name='logout'), + url(r'^register/', views.register, name='register'), +] diff --git a/loginsys/views.py b/loginsys/views.py new file mode 100644 index 0000000..b8a1f95 --- /dev/null +++ b/loginsys/views.py @@ -0,0 +1,44 @@ +from django.shortcuts import render_to_response, redirect +from django.contrib import auth +from django.views.decorators.csrf import csrf_exempt +from .forms import RegistrationForm + +@csrf_exempt +def login(request): + args = {} + if request.POST: + username = request.POST.get('username', '') + password = request.POST.get('password', '') + user = auth.authenticate(username=username, password=password) + if user is not None: + auth.login(request, user) + return redirect('/') + else: + args['login_error'] = "User is not found" + return render_to_response('login/login.html', args) + + else: + return render_to_response('login/login.html', args) + +def logout(request): + auth.logout(request) + return redirect('/') + +@csrf_exempt +def register(request): + args= {} + args['form'] = RegistrationForm() + if request.POST: + newuser_form = RegistrationForm(request.POST) + if newuser_form.is_valid(): + newuser_form.save() + newuser = auth.authenticate(username=newuser_form.cleaned_data['username'], + password=newuser_form.cleaned_data['password1']) + auth.login(request, newuser) + return redirect('/') + else: + args['form'] = newuser_form + return render_to_response('login/register.html', args) + + + diff --git a/manage.py b/manage.py new file mode 100755 index 0000000..321efb5 --- /dev/null +++ b/manage.py @@ -0,0 +1,22 @@ +#!/usr/bin/env python +import os +import sys + +if __name__ == "__main__": + os.environ.setdefault("DJANGO_SETTINGS_MODULE", "Eshop.settings") + try: + from django.core.management import execute_from_command_line + except ImportError: + # The above import may fail for some other reason. Ensure that the + # issue is really that Django is missing to avoid masking other + # exceptions on Python 2. + try: + import django + except ImportError: + raise ImportError( + "Couldn't import Django. Are you sure it's installed and " + "available on your PYTHONPATH environment variable? Did you " + "forget to activate a virtual environment?" + ) + raise + execute_from_command_line(sys.argv) diff --git a/orders/__init__.py b/orders/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/orders/admin.py b/orders/admin.py new file mode 100644 index 0000000..0782cf1 --- /dev/null +++ b/orders/admin.py @@ -0,0 +1,95 @@ +from django.contrib import admin +from django.http import HttpResponse +from django.core.urlresolvers import reverse +from django.utils.html import format_html +from decimal import Decimal +import csv +import datetime +from django.contrib.auth.models import User +from userprofile.models import UserProfile +from .models import * + +def OrderDetail(obj): + return format_html('View'.format( + reverse('orders:AdminOrderDetail', args=[obj.id]) + )) + +def ExportToCSV(modeladmin, request, queryset): + opts = modeladmin.model._meta + response = HttpResponse(content_type='text/csv') + response['Content-Disposition'] = 'attachment; filename=Orders-{}.csv'.format(datetime.datetime.now().strftime("%d/%m/%Y")) + writer = csv.writer(response) + + fields = [field for field in opts.get_fields() if not field.many_to_many and not field.one_to_many] + + writer.writerow([field.verbose_name for field in fields]) + + for obj in queryset: + data_row = [] + for field in fields: + value = getattr(obj, field.name) + if isinstance(value, datetime.datetime): + value = value.strftime('%d/%m/%Y') + + data_row.append(value) + writer.writerow(data_row) + return response + ExportToCSV.short_description = 'Export CSV' + +def OrderPDF(obj): + return format_html('PDF'.format( + reverse('orders:AdminOrderPDF', args=[obj.id]) + )) +OrderPDF.short_description = 'In PDF format' + +class ProductsInOrderInline(admin.TabularInline): + model = ProductsInOrder + extra = 0 + +class StatusAdmin(admin.ModelAdmin): + list_display = [field.name for field in Status._meta.fields] + + class Meta: + model = Status + +def delete_model(modeladmin, request, queryset): + for obj in queryset: + print(obj.user) + user_profile = obj.user.profile + parent_profile = user_profile.parent.profile + parent_profile.user_points += round(obj.total_price * Decimal(0.05)) + parent_profile.save() + obj.delete() +delete_model.short_description = "Удалить как завершенные" + +class OrderAdmin (admin.ModelAdmin): + list_display = ['id', 'customer_name', 'customer_email', 'customer_phone', 'city', 'customer_address', + 'paid', 'status', 'created', 'updated', OrderDetail, OrderPDF] + + list_filter = ['paid', 'created', 'updated'] + inlines = [ProductsInOrderInline] + actions = [ExportToCSV, delete_model] + + class Meta: + model = Order + +class ProductsInOrderAdmin(admin.ModelAdmin): + list_display = [field.name for field in ProductsInOrder._meta.fields] + + class Meta: + model = ProductsInOrder + +class ProductsInBasketAdmin(admin.ModelAdmin): + list_display = [field.name for field in ProductsInBasket._meta.fields] + + class Meta: + model = ProductsInBasket + + + + + +admin.site.register(Status, StatusAdmin) +admin.site.register(Order, OrderAdmin) +admin.site.register(ProductsInOrder, ProductsInOrderAdmin) +admin.site.register(ProductsInBasket, ProductsInBasketAdmin) \ No newline at end of file diff --git a/orders/apps.py b/orders/apps.py new file mode 100644 index 0000000..384ab43 --- /dev/null +++ b/orders/apps.py @@ -0,0 +1,5 @@ +from django.apps import AppConfig + + +class OrdersConfig(AppConfig): + name = 'orders' diff --git a/orders/context_processors.py b/orders/context_processors.py new file mode 100644 index 0000000..544136b --- /dev/null +++ b/orders/context_processors.py @@ -0,0 +1,11 @@ +from .models import ProductsInBasket + +def getting_basket_info(request): + session_key = request.session.session_key + if not session_key: + request.session.cycle_key() + + products_in_basket = ProductsInBasket.objects.filter(session_key=session_key, is_active=True) + products_total_nmb = products_in_basket.count() + + return locals() \ No newline at end of file diff --git a/orders/forms.py b/orders/forms.py new file mode 100644 index 0000000..46e7ecd --- /dev/null +++ b/orders/forms.py @@ -0,0 +1,15 @@ +from django import forms +from phonenumber_field.formfields import PhoneNumberField +from .models import Order + +class OrderCreateForm(forms.ModelForm): + + customer_name = forms.CharField(max_length=64, required=True, help_text='Введите Ваше полное Ф.И.О') + customer_phone = PhoneNumberField(required=True, help_text='Введите Ваш номер телефона') + customer_email = forms.EmailField(required=True, help_text='Введите Ваш e-mail') + city = forms.CharField(max_length=100, help_text='Введите Ваш город') + + class Meta: + model = Order + fields = ['customer_name', 'customer_email', 'customer_phone', 'city'] + diff --git a/orders/models.py b/orders/models.py new file mode 100644 index 0000000..ed10ec8 --- /dev/null +++ b/orders/models.py @@ -0,0 +1,112 @@ +from django.db import models +from django.db.models.signals import post_save +from django.contrib.auth.models import User +from django.dispatch import receiver +from phonenumber_field.modelfields import PhoneNumberField +# from discount.models import Discount +from decimal import Decimal +from django.core.validators import MinValueValidator, MaxValueValidator +from products.models import Product, Offer + + +class Status(models.Model): + name = models.CharField(max_length=16, blank=True, null=True, default=None) + is_active = models.BooleanField(default=True) + created = models.DateField(auto_now_add=True, auto_now=False) + updated = models.DateField(auto_now_add=False, auto_now=True) + + + def __str__(self): + return self.name + + class Meta: + verbose_name = 'State of order' + verbose_name_plural = 'States' + +class Order(models.Model): + user = models.ForeignKey(User, blank=True, null=True, default=None) + total_price = models.DecimalField(max_digits=10, decimal_places=2, default=0) + customer_name = models.CharField(max_length=64, blank=True, null=True, default=None) + customer_email = models.EmailField(blank=True, null=True, default=None) + customer_phone = PhoneNumberField(blank=True, null=True, default=None) + city = models.CharField(max_length=100, blank=True, null=True, default=None) + customer_address = models.CharField(max_length=128, blank=True, null=True, default=None) + comment = models.TextField(blank=True, null=True, default=None) + status = models.ForeignKey(Status, blank=True, null=True, default=None) + created = models.DateField(auto_now_add=True, auto_now=False) + updated = models.DateField(auto_now_add=False, auto_now=True) + paid = models.BooleanField(default=False) + # discount = models.ForeignKey(Discount, related_name='orders', null=True, blank=True) + # discount_value = models.IntegerField(default=0, validators=[MinValueValidator(0), MaxValueValidator(100)]) + points_quant = models.IntegerField(default=0) + + def __str__(self): + return "Order {!s} has status {}: ".format(self.id, self.status) + + class Meta: + ordering = ('-created',) + verbose_name = 'Order' + verbose_name_plural = 'Orders' + + def save(self, *args, **kwargs): + super(Order, self).save(*args, **kwargs) + + +class ProductsInOrder(models.Model): + order = models.ForeignKey(Order, blank=True, null=True, default=None, related_name='items') + product = models.ForeignKey(Offer, blank=True, null=True, default=None) + number = models.PositiveIntegerField(default=1) + price_per_itom = models.DecimalField(max_digits=10, decimal_places=2, default=0) + total_price = models.DecimalField(max_digits=10, decimal_places=2, default=0) + is_active = models.BooleanField(default=True) + created = models.DateField(auto_now_add=True, auto_now=False) + updated = models.DateField(auto_now_add=False, auto_now=True) + + def __str__(self): + return self.product.name + + class Meta: + verbose_name = 'Product in Order' + verbose_name_plural = 'Products in Order' + + def save(self, *args, **kwargs): + # self.price_per_itom = self.product.price + self.total_price = self.number * self.price_per_itom + super(ProductsInOrder, self).save(*args, **kwargs) + +class ProductsInBasket(models.Model): + session_key = models.CharField(max_length=128, blank=True, null=True, default=None) + order = models.ForeignKey(Order, blank=True, null=True, default=None) + product = models.ForeignKey(Product, blank=True, null=True, default=None) + number = models.IntegerField(default=1) + price_per_itom = models.DecimalField(max_digits=10, decimal_places=2, default=0) + total_price = models.DecimalField(max_digits=10, decimal_places=2, default=0) + is_active = models.BooleanField(default=True) + created = models.DateField(auto_now_add=True, auto_now=False) + updated = models.DateField(auto_now_add=False, auto_now=True) + + def __str__(self): + return self.product.name + + class Meta: + verbose_name = 'Product in Cart' + verbose_name_plural = 'Products in Cart' + + def save(self, *args, **kwargs): + self.price_per_itom = self.product.price + self.total_price = int(self.number) * self.price_per_itom + super(ProductsInBasket, self).save(*args, **kwargs) + +@receiver(post_save, sender=ProductsInOrder) +def product_in_order_post_save(instance,**kwargs): + order = instance.order + all_products_in_order = ProductsInOrder.objects.filter(order=order, is_active=True) + + order_total_price = sum(item.total_price for item in all_products_in_order) + # if order.discount: + # order.total_price = order_total_price * (order.discount_value / Decimal('100')) + if order.points_quant: + order.total_price = order_total_price - order.points_quant + else: + order.total_price = order_total_price + order.save(force_update=True) diff --git a/orders/tasks.py b/orders/tasks.py new file mode 100644 index 0000000..e10608f --- /dev/null +++ b/orders/tasks.py @@ -0,0 +1,43 @@ +from django.conf import settings +from celery import task +from django.template.loader import render_to_string +from django.core.mail import send_mail, EmailMessage +from io import BytesIO +import weasyprint +import pytils +from .models import Order + +SUPPLIER_INFO = '''ООО "Русские Программы", ИНН 7713409230, КПП 771301001, + 127411, Москва г, Дмитровское ш., дом № 157, корпус 7, тел.: +74957258950''' + +requisites = {'name': 'ООО "Русские Программы"', 'bank': 'АО "СМП БАНК" Г. МОСКВА', 'INN': '7713409230', + 'KPP': '771301001', 'BIK': '44525503', 'bank_acc': '30101810545250000503', 'acc': '40702810300750000177', + 'sup_info': SUPPLIER_INFO} + +@task +def OrderCreated(order_id): + """ + Sending Email of order creating + """ + order = Order.objects.get(id=order_id) + verb_price = pytils.numeral.in_words(round(order.total_price)) + verb_cur = pytils.numeral.choose_plural(round(order.total_price), ("рубль", "рубля", "рублей")) + subject = 'Order {}'.format(order.id) + message = 'Dear, {}, You have successfully placed an order.\ + Your order number {}'.format(order.customer_name, order.id) + mail_send = EmailMessage(subject, message, 'admin@myshop.ru', [order.customer_email, 'bda2291@mail.ru']) + + # html = render_to_string('orders:AdminOrderPDF', args=[order_id]) + + html = render_to_string('orders/pdf.html', {**requisites, 'order': order, + 'verb_cur': verb_cur, 'verb_price': verb_price}) + rendered_html = html.encode(encoding="UTF-8") + out = BytesIO() + weasyprint.HTML(string=rendered_html).write_pdf(out, + stylesheets=[weasyprint.CSS(settings.STATIC_ROOT + 'css/bootstrap.min.css')]) + + # weasyprint.HTML(string=rendered_html, base_url=request.build_absolute_uri()).write_pdf(response, + # stylesheets=[weasyprint.CSS(settings.STATIC_ROOT + '/css/bootstrap.min.css')]) + mail_send.attach('order_{}.pdf'.format(order_id), out.getvalue(), 'application/pdf') + mail_send.send() + return mail_send \ No newline at end of file diff --git a/orders/tests.py b/orders/tests.py new file mode 100644 index 0000000..7ce503c --- /dev/null +++ b/orders/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/orders/urls.py b/orders/urls.py new file mode 100644 index 0000000..f82ccd9 --- /dev/null +++ b/orders/urls.py @@ -0,0 +1,25 @@ +"""Eshop URL Configuration + +The `urlpatterns` list routes URLs to views. For more information please see: + https://docs.djangoproject.com/en/1.10/topics/http/urls/ +Examples: +Function views + 1. Add an import: from my_app import views + 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') +Class-based views + 1. Add an import: from other_app.views import Home + 2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home') +Including another URLconf + 1. Import the include() function: from django.conf.urls import url, include + 2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls')) +""" +from django.conf.urls import url +from . import views + + +urlpatterns = [ + url(r'^basket_adding/', views.basket_adding, name='basket_adding'), + url(r'^create/$', views.OrderCreate, name='OrderCreate'), + url(r'^admin/order/(?P\d+)/$', views.AdminOrderDetail, name='AdminOrderDetail'), + url(r'^admin/order/(?P\d+)/pdf/$', views.AdminOrderPDF, name='AdminOrderPDF') +] diff --git a/orders/views.py b/orders/views.py new file mode 100644 index 0000000..09c7821 --- /dev/null +++ b/orders/views.py @@ -0,0 +1,117 @@ +from django.shortcuts import render, redirect, get_object_or_404, render_to_response +from django.conf import settings +from django.contrib import auth +from django.http import HttpResponse +from django.template.loader import render_to_string, get_template +import weasyprint +import pytils +from django.core.urlresolvers import reverse +from django.http import JsonResponse +from django.contrib.admin.views.decorators import staff_member_required +from .models import ProductsInBasket, ProductsInOrder, Order +from .forms import OrderCreateForm +from .tasks import OrderCreated +from cart.cart import Cart + +SUPPLIER_INFO = '''ООО "Русские Программы", ИНН 7713409230, КПП 771301001, + 127411, Москва г, Дмитровское ш., дом № 157, корпус 7, тел.: +74957258950''' + +requisites = {'name': 'ООО "Русские Программы"', 'bank': 'АО "СМП БАНК" Г. МОСКВА', 'INN': '7713409230', + 'KPP': '771301001', 'BIK': '44525503', 'bank_acc': '30101810545250000503', 'acc': '40702810300750000177', + 'sup_info': SUPPLIER_INFO} + +def basket_adding(request): + return_dict = {} + session_key = request.session.session_key + data = request.POST + product_id = data.get("product_id") + nmb = data.get("nmb") + + new_product, created = ProductsInBasket.objects.get_or_create(session_key=session_key, product_id=product_id, defaults={'number':nmb}) + if not created: + new_product.number += int(nmb) + new_product.save(force_update=True) + + products_in_basket = ProductsInBasket.objects.filter(session_key=session_key, is_active=True) + products_total_nmb = products_in_basket.count() + return_dict["products_total_nmb"] = products_total_nmb + return_dict["products"] = [] + + for item in products_in_basket: + product_dict = {} + product_dict["id"] = item.id + product_dict["name"] = item.product.name + product_dict["price_per_item"] = item.price_per_itom + product_dict["nmb"] = item.number + return_dict["products"].append(product_dict) + + return JsonResponse(return_dict) + + +def basket_remove(request): + return_dict = {} + session_key = request.session.session_key + data = request.POST + product_id = data.get("product_id") + + +def OrderCreate(request): + cart = Cart(request) + user = auth.get_user(request) + profile = user.profile + if not user.username: + return redirect('auth:login') + if request.method == 'POST': + form = OrderCreateForm(request.POST) + if form.is_valid(): + order = form.save(commit=False) + order.user = user + # if cart.discount: + # order.discount = cart.discount + # order.discount_value = cart.discount.discount + + if cart.points: + print(cart.points_quant) + order.points_quant = cart.points_quant + profile.user_points -= cart.points_quant + profile.save() + order.save() + + for item in cart: + ProductsInOrder.objects.create(order=order, product=item['offer'], + price_per_itom=item['price'], + number=item['quantity']) + cart.clear() + + # Asinc mail sending + OrderCreated.delay(order.id) + request.session['order_id'] = order.id + + # return redirect(reverse('payment:process')) + return render(request, 'orders/created.html', {'username': user.username, 'order': order}) + else: + return render('orders/create.html', {'username': user.username, 'cart': cart, 'form': form}) + + form = OrderCreateForm(instance=profile) + return render(request, 'orders/create.html', {'username': user.username, 'cart': cart, 'form': form}) + + +@staff_member_required +def AdminOrderDetail(request, order_id): + order = get_object_or_404(Order, id=order_id) + return render(request, 'admin/orders/detail.html', {'order': order}) + + +@staff_member_required +def AdminOrderPDF(request, order_id): + order = get_object_or_404(Order, id=order_id) + verb_price = pytils.numeral.in_words(round(order.total_price)) + verb_cur = pytils.numeral.choose_plural(round(order.total_price), ("рубль", "рубля", "рублей")) + html = render_to_string('orders/pdf.html', {**requisites, 'order': order, + 'verb_cur': verb_cur, 'verb_price': verb_price}) + rendered_html = html.encode(encoding="UTF-8") + response = HttpResponse(content_type='application/pdf') + response['Content-Disposition'] = 'filename=order_{}.pdf'.format(order.id) + weasyprint.HTML(string=rendered_html, base_url=request.build_absolute_uri()).write_pdf(response, + stylesheets=[weasyprint.CSS(settings.STATIC_ROOT + '/css/bootstrap.min.css')]) + return response \ No newline at end of file diff --git a/package.json b/package.json new file mode 100644 index 0000000..722cc46 --- /dev/null +++ b/package.json @@ -0,0 +1,5 @@ +{ + "dependencies": { + "bower": "latest" + } +} \ No newline at end of file diff --git a/products/__init__.py b/products/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/products/admin.py b/products/admin.py new file mode 100644 index 0000000..3a6b98b --- /dev/null +++ b/products/admin.py @@ -0,0 +1,206 @@ +from django.contrib import admin +# from mptt.admin import MPTTModelAdmin +from import_export import resources, fields, widgets +from import_export.admin import ImportExportModelAdmin +from .models import * + +class CustomModelResource(resources.ModelResource): + def before_import_row(self, row, **kwargs): + """ + Override to add additional logic. Does nothing by default. + """ + try: + row['attributes'] = eval(row['attributes']) + except: + try: + row['discount_policy'] = eval(row['discount_policy']) + except: + pass + +class CustomManyToManyWidget(widgets.ManyToManyWidget): + def clean(self, value, row=None, *args, **kwargs): + t1 = super(CustomManyToManyWidget, self).clean(value) + return self.model.objects.get(name=t1) if t1 else None + + +# class CustomForeignKeyWidget(widgets.ForeignKeyWidget): +# def clean(self, value, row=None, *args, **kwargs): +# return self.model.objects.get_or_create(name=value)[0] + +# class ProductImageInline(admin.TabularInline): +# model = ProductImage +# extra = 0 + +# class ProductAttributeInline(admin.TabularInline): +# model = ProductAttribute +# extra = 1 +# verbose_name_plural = 'ProductAttribute' +# suit_classes = 'suit-tab suit-tab-PA' +# +class AttributeChoiceValueInline(admin.TabularInline): + model = AttributeChoiceValue + # prepopulated_fields = {'slug': ('name',)} + extra = 1 + verbose_name_plural = 'AttributeChoiceValue' + suit_classes = 'suit-tab suit-tab-ACV' +# +class OfferInline(admin.TabularInline): + model = Offer + extra = 1 + verbose_name_plural = 'Offers' + suit_classes = 'suit-tab suit-tab-offers' + +class ProductCategoryAdmin(admin.ModelAdmin): + list_display = [field.name for field in ProductCategory._meta.fields] + + class Meta: + model = ProductCategory + +# class AttributeChoiceValueAdmin(admin.ModelAdmin): +# list_display = [field.name for field in ProductCategory._meta.fields] +# +# class Meta: +# model = AttributeChoiceValue +# +# admin.site.register(AttributeChoiceValue, AttributeChoiceValueAdmin) + +class ProductAttributeAdmin(admin.ModelAdmin): + list_display = [field.name for field in ProductAttribute._meta.fields] + inlines = [AttributeChoiceValueInline] + # prepopulated_fields = {'slug': ('name',)} + + suit_form_tabs = (('general', 'General'), + ('ACV', 'AttributeValues'),) + + class Meta: + model = ProductAttribute + +admin.site.register(ProductAttribute, ProductAttributeAdmin) + +class ProducerAdmin(admin.ModelAdmin): + list_display = [field.name for field in Producer._meta.fields] + + class Meta: + model = Producer + +admin.site.register(Producer, ProducerAdmin) + +class ProductResource(CustomModelResource): + # id = fields.Field(default=generate_Jid(prefix='J'), + # readonly=True, + # widget=widgets.CharWidget(), + # ) + + name = fields.Field(column_name='name', attribute='name', + default=None, + widget=widgets.CharWidget(), + ) + # price = fields.Field(column_name='price', attribute='price', + # default=0, + # widget=widgets.DecimalWidget(), + # ) + description = fields.Field(column_name='description', attribute='description', + default=None, + widget=widgets.CharWidget(), + ) + + # producer = fields.Field(column_name='producer', attribute='producer', + # default=None, + # widget=widgets.CharWidget(), + # ) + + category = fields.Field(column_name='category', attribute='category', + default=None, + widget=widgets.ForeignKeyWidget(ProductCategory, field='name'), + ) + producer = fields.Field(column_name='producer', attribute='producer', + default=None, + widget=widgets.ForeignKeyWidget(Producer, field='name'), + ) + attributes = fields.Field(column_name='attributes', attribute='attributes', + default=None, + widget=CustomManyToManyWidget(ProductAttribute, field="name"), + ) + is_active = fields.Field(column_name='is_active', attribute='is_active', + default=1, + widget=widgets.BooleanWidget()) + + discount_policy = fields.Field(column_name='discount_policy', attribute='discount_policy', + default={}, + widget=widgets.CharWidget()) + + # delete = fields.Field(column_name='delete', attribute='delete', + # default=0, + # widget=widgets.BooleanWidget()) + + # def for_delete(self, row, instance): + # return self.fields['delete'].clean(row) + + class Meta: + model = Product + fields = ('id', 'name', 'description', 'producer', 'category', 'is_active', 'attributes', 'discount_policy') + export_order = ('id', 'name', 'producer', 'is_active', 'category', 'attributes', 'description', 'discount_policy') + # import_id_fields = ('name',) + + def dehydrate_str_choices(self, obj): + if obj.id: + return obj.str_choices() + +class ProductAdmin(ImportExportModelAdmin): + list_display = ['id', 'name', 'category', 'producer', 'is_active'] + inlines = [OfferInline] + list_filter = ['is_active', 'created', 'updated', 'category'] + list_editable = ['is_active'] + # prepopulated_fields = {'slug': ('name',)} + search_fields = ['name', 'id'] + + suit_form_tabs = (('general', 'General'), + ('offers', 'Offers'),) + + resource_class = ProductResource + + # class Meta: + # model = Product + +class OfferResource(CustomModelResource): + name = fields.Field(column_name='name', attribute='name', + default=None, + widget=widgets.CharWidget(), + ) + + price = fields.Field(column_name='price', attribute='price', + default=0, + widget=widgets.DecimalWidget(), + ) + + product = fields.Field(column_name='product', attribute='product', + widget=widgets.ForeignKeyWidget(Product, field='name'), + ) + + is_active = fields.Field(column_name='is_active', attribute='is_active', + default=1, + widget=widgets.BooleanWidget()) + + attributes = fields.Field(column_name='attributes', attribute='attributes', + default={}, + widget=widgets.CharWidget()) + + class Meta: + model = Offer + fields = ('name', 'product', 'price', 'is_active', 'attributes') + export_order = ('name', 'product', 'attributes', 'is_active', 'price') + import_id_fields = ('name',) + +class OfferAdmin(ImportExportModelAdmin): + list_display = ['id', 'name', 'product', 'price', 'is_active', 'attributes'] + resource_class = OfferResource +# class ProductImageAdmin(admin.ModelAdmin): +# list_display = [field.name for field in ProductImage._meta.fields] +# +# class Meta: +# model = ProductImage + +# admin.site.register(ProductImage, ProductImageAdmin) +admin.site.register(ProductCategory, ProductCategoryAdmin) +admin.site.register(Product, ProductAdmin) +admin.site.register(Offer, OfferAdmin) diff --git a/products/apps.py b/products/apps.py new file mode 100644 index 0000000..864c43e --- /dev/null +++ b/products/apps.py @@ -0,0 +1,5 @@ +from django.apps import AppConfig + + +class ProductsConfig(AppConfig): + name = 'products' diff --git a/products/forms.py b/products/forms.py new file mode 100644 index 0000000..eb428d3 --- /dev/null +++ b/products/forms.py @@ -0,0 +1,31 @@ +from haystack.forms import FacetedSearchForm + + +class FacetedProductSearchForm(FacetedSearchForm): + def __init__(self, *args, **kwargs): + data = dict(kwargs.get("data", [])) + self.categories = data.get('category', []) + self.producers = data.get('producer', []) + super(FacetedProductSearchForm, self).__init__(*args, **kwargs) + + def search(self): + sqs = super(FacetedProductSearchForm, self).search() + if self.categories: + query = None + for category in self.categories: + if query: + query += u' OR ' + else: + query = u'' + query += u'"%s"' % sqs.query.clean(category) + sqs = sqs.narrow(u'category_exact:%s' % query) + if self.producers: + query = None + for producer in self.producers: + if query: + query += u' OR ' + else: + query = u'' + query += u'"%s"' % sqs.query.clean(producer) + sqs = sqs.narrow(u'brand_exact:%s' % query) + return sqs \ No newline at end of file diff --git a/products/models.py b/products/models.py new file mode 100644 index 0000000..c19142a --- /dev/null +++ b/products/models.py @@ -0,0 +1,169 @@ +from django.db import models +from django.core.urlresolvers import reverse +from django.contrib.postgres.fields import HStoreField +from autoslug import AutoSlugField +import mptt +import decimal +from mptt.models import MPTTModel, TreeForeignKey + + +class ProductAttribute(models.Model): + name = models.CharField(max_length=64, blank=True, null=True, default=None) + slug = AutoSlugField(populate_from='name') + + def __str__(self): + return self.name + + class Meta: + ordering = ('slug',) + verbose_name = 'Product attribute' + verbose_name_plural = 'Product attributes' + +class AttributeChoiceValue(models.Model): + name = models.CharField(max_length=64, blank=True, null=True, default=None) + slug = AutoSlugField(populate_from='name') + attribute = models.ForeignKey(ProductAttribute, on_delete=models.CASCADE, related_name='values') + + def __str__(self): + return self.name + + class Meta: + unique_together = ('name', 'attribute') + verbose_name = 'attribute choices value' + verbose_name_plural = 'attribute choices values' + +class Producer(models.Model): + name = models.CharField(max_length=64, blank=True, null=True, default=None) + slug = AutoSlugField(populate_from='name') + image = models.ImageField(upload_to='producers/%Y/%m/%d/', blank=True, verbose_name="image of producer") + is_active = models.BooleanField(default=True) + + def __str__(self): + return self.name + + def get_absolute_url(self): + return reverse('products:CategoriesListByProducer', args=[self.slug]) + + class Meta: + verbose_name = 'Producer' + verbose_name_plural = 'Producers' + +class ProductCategory(MPTTModel): + name = models.CharField(db_index=True, unique=True, max_length=64, blank=True, null=True, default=None) + slug = AutoSlugField(populate_from='name') + is_active = models.BooleanField(default=True) + producer = models.ForeignKey(Producer, null=True, blank=True, related_name='categories') + parent = TreeForeignKey('self', null=True, blank=True, related_name='children') + image = models.ImageField(upload_to='categories/%Y/%m/%d/', blank=True, verbose_name="image of category") + # category_attributes = models.ManyToManyField(ProductAttribute, related_name='categories', blank=True) + + def __str__(self): + return self.name + + class Meta: + verbose_name = 'Product''s category' + verbose_name_plural = 'Category of products' + ordering = ('tree_id', 'level') + + class MPTTMeta: + order_insertion_by = ['name'] + + def get_absolute_url(self): + return reverse('products:ProductListByCategory', args=[self.producer.slug, self.slug]) + +mptt.register(ProductCategory, order_insertion_py=['name']) + +# class ProductClass(models.Model): +# name = models.CharField(max_length=64, blank=True, null=True, default=None) +# has_variants = models.BooleanField(default=True) +# # product_attributes = models.ManyToManyField(ProductAttribute, related_name='products_class', blank=True) +# variant_attributes = models.ManyToManyField(ProductAttribute, related_name='variants_class', blank=True) +# +# def __str__(self): +# return self.name +# +# class Meta: +# verbose_name = 'product class' +# verbose_name_plural = 'product classes' + +class Product(models.Model): + name = models.CharField(max_length=64, db_index=True, blank=True, null=True, default=None) + slug = AutoSlugField(populate_from='name') + price = models.DecimalField(max_digits=10, decimal_places=2, default=0.00) + # points = models.DecimalField(max_digits=8, decimal_places=2, null=True, default=0.00) + description = models.TextField(db_index=True, blank=True, null=True, default=None) + # short_description = models.TextField(blank=True, null=True, default=None) + producer = models.ForeignKey(Producer, on_delete=models.CASCADE, related_name='products') + image = models.ImageField(upload_to='products/%Y/%m/%d/', blank=True, verbose_name="image of product") + discount = models.IntegerField(blank=True, null=True, default=0) + stock = models.PositiveIntegerField(blank=True, null=True, default=0, verbose_name="In stock") + # category = TreeForeignKey(ProductCategory, blank=True, null=True, default=None, related_name='products') + category = models.ForeignKey(ProductCategory, default=None, related_name='products') + attributes = models.ManyToManyField(ProductAttribute, related_name='categories', blank=True) + discount_policy = HStoreField(blank=True, null=True, default={}) + is_active = models.BooleanField(default=True) + # is_hit = models.BooleanField(default=False) + # is_new = models.BooleanField(default=False) + created = models.DateField(auto_now_add=True, auto_now=False) + updated = models.DateField(auto_now_add=False, auto_now=True) + + def __str__(self): + return self.name + + class Meta: + ordering = ['id'] + index_together = [ + ['id', 'slug'] + ] + verbose_name = 'Product' + verbose_name_plural = 'Products' + + def get_absolute_url(self): + return reverse('products:Product', args=[self.slug]) + + # def save(self, *args, **kwargs): + # if self.category: + # super(Product, self).save(*args, **kwargs) + # + # for cp in ProductClass.objects.filter(category=self.product_class): + # pp = ProductProperty.objects.filter(category_property=cp, + # product=self) + # if not pp: + # pp = ProductProperty(category_property=cp, product=self, value="--") + # pp.save() + +# class ProductImage(models.Model): +# product = models.ForeignKey(Product, on_delete=models.CASCADE, blank=True, null=True, default=None) +# image = models.ImageField(upload_to='products_images') +# is_main = models.BooleanField(default=False) +# is_active = models.BooleanField(default=True) +# created = models.DateField(auto_now_add=True, auto_now=False) +# updated = models.DateField(auto_now_add=False, auto_now=True) +# +# def __str__(self): +# return "{!s}".format(self.id) +# +# class Meta: +# verbose_name = 'Photo' +# verbose_name_plural = 'Photos' + +class Offer(models.Model): + name = models.CharField(max_length=64, blank=True, null=True, default=None) + slug = AutoSlugField(populate_from='name') + price = models.DecimalField(max_digits=8, decimal_places=2, null=True, default=0.00) + # points = models.DecimalField(max_digits=8, decimal_places=2, null=True, default=0.00) + product = models.ForeignKey(Product, on_delete=models.CASCADE, blank=True, null=True, default=None, + related_name='variants') + is_active = models.BooleanField(default=True) + attributes = HStoreField(blank=True, null=True, default={}) + + def __str__(self): + return self.name + + class Meta: + verbose_name = 'Offer' + verbose_name_plural = 'Offers' + + def save(self, *args, **kwargs): + self.points = self.price * decimal.Decimal('0.1') + super(Offer, self).save(*args, **kwargs) diff --git a/products/search_indexes.py b/products/search_indexes.py new file mode 100644 index 0000000..78bc4eb --- /dev/null +++ b/products/search_indexes.py @@ -0,0 +1,20 @@ +import datetime +from haystack import indexes +from .models import * + +class ProductIndex(indexes.SearchIndex, indexes.Indexable): + text = indexes.EdgeNgramField(document=True, use_template=True, template_name="search/product_text.txt") + name = indexes.EdgeNgramField(model_attr='name') + description = indexes.EdgeNgramField(model_attr='description') + category = indexes.CharField(model_attr='category', faceted=True) + producer = indexes.CharField(model_attr='producer', faceted=True) + + content_auto = indexes.EdgeNgramField(model_attr='name') + + suggestions = indexes.FacetCharField() + + def get_model(self): + return Product + + def index_queryset(self, using=None): + return self.get_model().objects.all() \ No newline at end of file diff --git a/products/tests.py b/products/tests.py new file mode 100644 index 0000000..7ce503c --- /dev/null +++ b/products/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/products/urls.py b/products/urls.py new file mode 100644 index 0000000..185c4be --- /dev/null +++ b/products/urls.py @@ -0,0 +1,33 @@ +"""Eshop URL Configuration + +The `urlpatterns` list routes URLs to views. For more information please see: + https://docs.djangoproject.com/en/1.10/topics/http/urls/ +Examples: +Function views + 1. Add an import: from my_app import views + 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') +Class-based views + 1. Add an import: from other_app.views import Home + 2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home') +Including another URLconf + 1. Import the include() function: from django.conf.urls import url, include + 2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls')) +""" +from django.conf.urls import url +from .views import productslist, product, categorieslist, producerslist + + +urlpatterns = [ + #url(r'^product/(?P\w+)/$', views.product, name='product'), + url(r'^$', producerslist, name='ProductList'), + + # Uncomment for elasticsearch + + # url(r'^autocomplete/$', autocomplete), + # url(r'^find/$', FacetedSearchView.as_view(), name='haystack_search'), + + + url(r'^product/(?P[-\w]+)/$', product, name='Product'), + url(r'^(?P[-\w]+)/$', categorieslist, name='CategoriesListByProducer'), + url(r'^(?P[-\w]+)/(?P[-\w]+)/$', productslist, name='ProductListByCategory') +] diff --git a/products/utils.py b/products/utils.py new file mode 100644 index 0000000..d077bf0 --- /dev/null +++ b/products/utils.py @@ -0,0 +1,40 @@ +from .models import Product + +def get_variant_picker_data(product): + variants = product.variants.all() + variant_attributes = product.attributes.all() + data = {'variants': [], 'variantAttributes': [], 'discount_policy': product.discount_policy} + + for attribute in variant_attributes: + data['variantAttributes'].append({ + 'name': attribute.name, + 'slug': attribute.slug, + 'values': [{'name': value.name, 'slug': value.slug} for value in attribute.values.all()] + }) + + for variant in variants: + price = variant.price + + variant_data = { + 'id': variant.id, + 'slug': variant.slug, + 'name': variant.name, + 'price': int(price), + 'attributes': variant.attributes, + + } + + data['variants'].append(variant_data) + + return data + +def expand_categories(categories): + products = None + new_categories = categories + for e in categories: + if e.name.startswith('None'): + products = Product.objects.filter(category=e) + new_categories = categories.exclude(pk=e.pk) + return new_categories, products + + diff --git a/products/views.py b/products/views.py new file mode 100644 index 0000000..f99f2bc --- /dev/null +++ b/products/views.py @@ -0,0 +1,79 @@ +from django.shortcuts import render, render_to_response, get_object_or_404 +from django.contrib import auth +from django.http import JsonResponse +import json +import decimal +from cart.forms import CartAddProductForm +from .utils import * +from cart.cart import Cart +from .models import * + +# Uncomment for elasticsearch + +# from .forms import FacetedProductSearchForm +# from haystack.generic_views import FacetedSearchView as BaseFacetedSearchView +# from haystack.query import SearchQuerySet + +def serialize_decimal(obj): + if isinstance(obj, decimal.Decimal): + return str(obj) + return json.JSONEncoder.default(obj) + +def producerslist(request): + username = auth.get_user(request).username + # category = None + # categories = ProductCategory.objects.filter(level__lte=0) + # products = Product.objects.filter(is_active=True) + producers = Producer.objects.filter(is_active=True) + # if category_slug: + # category = get_object_or_404(ProductCategory, slug=category_slug) + # products = products.filter(category__in=category.get_descendants(include_self=True)) + return render(request, 'products/list.html', locals()) + +def categorieslist(request, producer_slug): + username = auth.get_user(request).username + producer = Producer.objects.get(slug=producer_slug) + _categories = ProductCategory.objects.filter(is_active=True, producer=producer) + categories, products = expand_categories(_categories) + return render(request, 'products/categorieslist.html', {'username': username, 'categories':categories, + 'products': products}) + +def productslist(request, producer_slug, category_slug): + username = auth.get_user(request).username + category = ProductCategory.objects.get(slug=category_slug) + products = Product.objects.filter(is_active=True, category=category) + return render(request, 'products/productslist.html', locals()) + +def product(request, product_slug): + username = auth.get_user(request).username + product = get_object_or_404(Product, slug=product_slug, is_active=True) + cart_product_form = CartAddProductForm() + variant_picker_data = get_variant_picker_data(product) + show_variant_picker = all([v.attributes for v in product.variants.all()]) + # session_key = request.session.session_key + # if not session_key: + # request.session.cycle_key() + + return render(request, 'products/product.html', {'username': username, 'product': product, 'form': cart_product_form, + 'show_variant_picker': show_variant_picker, + 'variant_picker_data': variant_picker_data, + }) + +# Uncomment for elasticsearch + +# def autocomplete(request): +# sqs = SearchQuerySet().autocomplete(content_auto=request.GET.get('query', ''))[:5] +# s = [] +# for result in sqs: +# print(result) +# d = {"value": result.name, "data": result.object.slug} +# s.append(d) +# output = {'suggestions': s} +# return JsonResponse(output) +# +# class FacetedSearchView(BaseFacetedSearchView): +# form_class = FacetedProductSearchForm +# facet_fields = ['category', 'producer'] +# template_name = 'search/search.html' +# paginate_by = 3 +# context_object_name = 'object_list' \ No newline at end of file diff --git a/ql eshop_db b/ql eshop_db new file mode 100644 index 0000000..1611df5 --- /dev/null +++ b/ql eshop_db @@ -0,0 +1,11 @@ + List of databases + Name | Owner | Encoding | Collate | Ctype | Access privileges +-----------+----------+----------+-------------+-------------+----------------------- + eshop_db | denis | UTF8 | en_US.UTF-8 | en_US.UTF-8 | + postgres | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | + template0 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/postgres + + | | | | | postgres=CTc/postgres + template1 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/postgres + + | | | | | postgres=CTc/postgres +(4 rows) + diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..66cbe37 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,17 @@ +Django==1.10.6 +celery==4.0.2 +dj-database-url==0.4.2 +setuptools==35.0.2 +django-suit==0.2.25 +psycopg2==2.7.1 +django-import-export==0.5.1 +django-mptt==0.8.7 +django-haystack==2.5.1 +django-phonenumber-field==1.3.0pip +WeasyPrint==0.36 +cffi-1.10.0 +WeasyPrint==0.36 +elasticsearch==5.0.1 +whitenoise==3.3.0 +gunicorn==19.7.1 + diff --git a/runtime.txt b/runtime.txt new file mode 100644 index 0000000..c0354ee --- /dev/null +++ b/runtime.txt @@ -0,0 +1 @@ +python-3.5.2 diff --git a/schema.xml b/schema.xml new file mode 100644 index 0000000..91b649b --- /dev/null +++ b/schema.xml @@ -0,0 +1,166 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + id + + + text + + + + diff --git a/static/admin/css/base.ba3dc2f88fc5.css b/static/admin/css/base.ba3dc2f88fc5.css new file mode 100644 index 0000000..793142a --- /dev/null +++ b/static/admin/css/base.ba3dc2f88fc5.css @@ -0,0 +1,971 @@ +/* + DJANGO Admin styles +*/ + +@import url("fonts.cc6140298ba7.css"); + +body { + margin: 0; + padding: 0; + font-size: 14px; + font-family: "Roboto","Lucida Grande","DejaVu Sans","Bitstream Vera Sans",Verdana,Arial,sans-serif; + color: #333; + background: #fff; +} + +/* LINKS */ + +a:link, a:visited { + color: #447e9b; + text-decoration: none; +} + +a:focus, a:hover { + color: #036; +} + +a:focus { + text-decoration: underline; +} + +a img { + border: none; +} + +a.section:link, a.section:visited { + color: #fff; + text-decoration: none; +} + +a.section:focus, a.section:hover { + text-decoration: underline; +} + +/* GLOBAL DEFAULTS */ + +p, ol, ul, dl { + margin: .2em 0 .8em 0; +} + +p { + padding: 0; + line-height: 140%; +} + +h1,h2,h3,h4,h5 { + font-weight: bold; +} + +h1 { + margin: 0 0 20px; + font-weight: 300; + font-size: 20px; + color: #666; +} + +h2 { + font-size: 16px; + margin: 1em 0 .5em 0; +} + +h2.subhead { + font-weight: normal; + margin-top: 0; +} + +h3 { + font-size: 14px; + margin: .8em 0 .3em 0; + color: #666; + font-weight: bold; +} + +h4 { + font-size: 12px; + margin: 1em 0 .8em 0; + padding-bottom: 3px; +} + +h5 { + font-size: 10px; + margin: 1.5em 0 .5em 0; + color: #666; + text-transform: uppercase; + letter-spacing: 1px; +} + +ul li { + list-style-type: square; + padding: 1px 0; +} + +li ul { + margin-bottom: 0; +} + +li, dt, dd { + font-size: 13px; + line-height: 20px; +} + +dt { + font-weight: bold; + margin-top: 4px; +} + +dd { + margin-left: 0; +} + +form { + margin: 0; + padding: 0; +} + +fieldset { + margin: 0; + padding: 0; + border: none; + border-top: 1px solid #eee; +} + +blockquote { + font-size: 11px; + color: #777; + margin-left: 2px; + padding-left: 10px; + border-left: 5px solid #ddd; +} + +code, pre { + font-family: "Bitstream Vera Sans Mono", Monaco, "Courier New", Courier, monospace; + color: #666; + font-size: 12px; +} + +pre.literal-block { + margin: 10px; + background: #eee; + padding: 6px 8px; +} + +code strong { + color: #930; +} + +hr { + clear: both; + color: #eee; + background-color: #eee; + height: 1px; + border: none; + margin: 0; + padding: 0; + font-size: 1px; + line-height: 1px; +} + +/* TEXT STYLES & MODIFIERS */ + +.small { + font-size: 11px; +} + +.tiny { + font-size: 10px; +} + +p.tiny { + margin-top: -2px; +} + +.mini { + font-size: 10px; +} + +p.mini { + margin-top: -3px; +} + +.help, p.help, form p.help { + font-size: 11px; + color: #999; +} + +.help-tooltip { + cursor: help; +} + +p img, h1 img, h2 img, h3 img, h4 img, td img { + vertical-align: middle; +} + +.quiet, a.quiet:link, a.quiet:visited { + color: #999; + font-weight: normal; +} + +.float-right { + float: right; +} + +.float-left { + float: left; +} + +.clear { + clear: both; +} + +.align-left { + text-align: left; +} + +.align-right { + text-align: right; +} + +.example { + margin: 10px 0; + padding: 5px 10px; + background: #efefef; +} + +.nowrap { + white-space: nowrap; +} + +/* TABLES */ + +table { + border-collapse: collapse; + border-color: #ccc; +} + +td, th { + font-size: 13px; + line-height: 16px; + border-bottom: 1px solid #eee; + vertical-align: top; + padding: 8px; + font-family: "Roboto", "Lucida Grande", Verdana, Arial, sans-serif; +} + +th { + font-weight: 600; + text-align: left; +} + +thead th, +tfoot td { + color: #666; + padding: 5px 10px; + font-size: 11px; + background: #fff; + border: none; + border-top: 1px solid #eee; + border-bottom: 1px solid #eee; +} + +tfoot td { + border-bottom: none; + border-top: 1px solid #eee; +} + +thead th.required { + color: #000; +} + +tr.alt { + background: #f6f6f6; +} + +.row1 { + background: #fff; +} + +.row2 { + background: #f9f9f9; +} + +/* SORTABLE TABLES */ + +thead th { + padding: 5px 10px; + line-height: normal; + text-transform: uppercase; + background: #f6f6f6; +} + +thead th a:link, thead th a:visited { + color: #666; +} + +thead th.sorted { + background: #eee; +} + +thead th.sorted .text { + padding-right: 42px; +} + +table thead th .text span { + padding: 8px 10px; + display: block; +} + +table thead th .text a { + display: block; + cursor: pointer; + padding: 8px 10px; +} + +table thead th .text a:focus, table thead th .text a:hover { + background: #eee; +} + +thead th.sorted a.sortremove { + visibility: hidden; +} + +table thead th.sorted:hover a.sortremove { + visibility: visible; +} + +table thead th.sorted .sortoptions { + display: block; + padding: 9px 5px 0 5px; + float: right; + text-align: right; +} + +table thead th.sorted .sortpriority { + font-size: .8em; + min-width: 12px; + text-align: center; + vertical-align: 3px; + margin-left: 2px; + margin-right: 2px; +} + +table thead th.sorted .sortoptions a { + position: relative; + width: 14px; + height: 14px; + display: inline-block; + background: url("../img/sorting-icons.3a097b59f104.svg") 0 0 no-repeat; + background-size: 14px auto; +} + +table thead th.sorted .sortoptions a.sortremove { + background-position: 0 0; +} + +table thead th.sorted .sortoptions a.sortremove:after { + content: '\\'; + position: absolute; + top: -6px; + left: 3px; + font-weight: 200; + font-size: 18px; + color: #999; +} + +table thead th.sorted .sortoptions a.sortremove:focus:after, +table thead th.sorted .sortoptions a.sortremove:hover:after { + color: #447e9b; +} + +table thead th.sorted .sortoptions a.sortremove:focus, +table thead th.sorted .sortoptions a.sortremove:hover { + background-position: 0 -14px; +} + +table thead th.sorted .sortoptions a.ascending { + background-position: 0 -28px; +} + +table thead th.sorted .sortoptions a.ascending:focus, +table thead th.sorted .sortoptions a.ascending:hover { + background-position: 0 -42px; +} + +table thead th.sorted .sortoptions a.descending { + top: 1px; + background-position: 0 -56px; +} + +table thead th.sorted .sortoptions a.descending:focus, +table thead th.sorted .sortoptions a.descending:hover { + background-position: 0 -70px; +} + +/* FORM DEFAULTS */ + +input, textarea, select, .form-row p, form .button { + margin: 2px 0; + padding: 2px 3px; + vertical-align: middle; + font-family: "Roboto", "Lucida Grande", Verdana, Arial, sans-serif; + font-weight: normal; + font-size: 13px; +} + +textarea { + vertical-align: top; +} + +input[type=text], input[type=password], input[type=email], input[type=url], +input[type=number], textarea, select, .vTextField { + border: 1px solid #ccc; + border-radius: 4px; + padding: 5px 6px; + margin-top: 0; +} + +input[type=text]:focus, input[type=password]:focus, input[type=email]:focus, +input[type=url]:focus, input[type=number]:focus, textarea:focus, select:focus, +.vTextField:focus { + border-color: #999; +} + +select { + height: 30px; +} + +select[multiple] { + min-height: 150px; +} + +/* FORM BUTTONS */ + +.button, input[type=submit], input[type=button], .submit-row input, a.button { + background: #79aec8; + padding: 10px 15px; + border: none; + border-radius: 4px; + color: #fff; + cursor: pointer; +} + +a.button { + padding: 4px 5px; +} + +.button:active, input[type=submit]:active, input[type=button]:active, +.button:focus, input[type=submit]:focus, input[type=button]:focus, +.button:hover, input[type=submit]:hover, input[type=button]:hover { + background: #609ab6; +} + +.button[disabled], input[type=submit][disabled], input[type=button][disabled] { + opacity: 0.4; +} + +.button.default, input[type=submit].default, .submit-row input.default { + float: right; + border: none; + font-weight: 400; + background: #417690; +} + +.button.default:active, input[type=submit].default:active, +.button.default:focus, input[type=submit].default:focus, +.button.default:hover, input[type=submit].default:hover { + background: #205067; +} + +.button[disabled].default, +input[type=submit][disabled].default, +input[type=button][disabled].default { + opacity: 0.4; +} + + +/* MODULES */ + +.module { + border: none; + margin-bottom: 30px; + background: #fff; +} + +.module p, .module ul, .module h3, .module h4, .module dl, .module pre { + padding-left: 10px; + padding-right: 10px; +} + +.module blockquote { + margin-left: 12px; +} + +.module ul, .module ol { + margin-left: 1.5em; +} + +.module h3 { + margin-top: .6em; +} + +.module h2, .module caption, .inline-group h2 { + margin: 0; + padding: 8px; + font-weight: 400; + font-size: 13px; + text-align: left; + background: #79aec8; + color: #fff; +} + +.module caption, +.inline-group h2 { + font-size: 12px; + letter-spacing: 0.5px; + text-transform: uppercase; +} + +.module table { + border-collapse: collapse; +} + +/* MESSAGES & ERRORS */ + +ul.messagelist { + padding: 0; + margin: 0; +} + +ul.messagelist li { + display: block; + font-weight: 400; + font-size: 13px; + padding: 10px 10px 10px 65px; + margin: 0 0 10px 0; + background: #dfd url("../img/icon-yes.d2f9f035226a.svg") 40px 12px no-repeat; + background-size: 16px auto; + color: #333; +} + +ul.messagelist li.warning { + background: #ffc url("../img/icon-alert.034cc7d8a67f.svg") 40px 14px no-repeat; + background-size: 14px auto; +} + +ul.messagelist li.error { + background: #ffefef url("../img/icon-no.439e821418cd.svg") 40px 12px no-repeat; + background-size: 16px auto; +} + +.errornote { + font-size: 14px; + font-weight: 700; + display: block; + padding: 10px 12px; + margin: 0 0 10px 0; + color: #ba2121; + border: 1px solid #ba2121; + border-radius: 4px; + background-color: #fff; + background-position: 5px 12px; +} + +ul.errorlist { + margin: 0 0 4px; + padding: 0; + color: #ba2121; + background: #fff; +} + +ul.errorlist li { + font-size: 13px; + display: block; + margin-bottom: 4px; +} + +ul.errorlist li:first-child { + margin-top: 0; +} + +ul.errorlist li a { + color: inherit; + text-decoration: underline; +} + +td ul.errorlist { + margin: 0; + padding: 0; +} + +td ul.errorlist li { + margin: 0; +} + +.form-row.errors { + margin: 0; + border: none; + border-bottom: 1px solid #eee; + background: none; +} + +.form-row.errors ul.errorlist li { + padding-left: 0; +} + +.errors input, .errors select, .errors textarea { + border: 1px solid #ba2121; +} + +div.system-message { + background: #ffc; + margin: 10px; + padding: 6px 8px; + font-size: .8em; +} + +div.system-message p.system-message-title { + padding: 4px 5px 4px 25px; + margin: 0; + color: #c11; + background: #ffefef url("../img/icon-no.439e821418cd.svg") 5px 5px no-repeat; +} + +.description { + font-size: 12px; + padding: 5px 0 0 12px; +} + +/* BREADCRUMBS */ + +div.breadcrumbs { + background: #79aec8; + padding: 10px 40px; + border: none; + font-size: 14px; + color: #c4dce8; + text-align: left; +} + +div.breadcrumbs a { + color: #fff; +} + +div.breadcrumbs a:focus, div.breadcrumbs a:hover { + color: #c4dce8; +} + +/* ACTION ICONS */ + +.addlink { + padding-left: 16px; + background: url("../img/icon-addlink.d519b3bab011.svg") 0 1px no-repeat; +} + +.changelink, .inlinechangelink { + padding-left: 16px; + background: url("../img/icon-changelink.18d2fd706348.svg") 0 1px no-repeat; +} + +.deletelink { + padding-left: 16px; + background: url("../img/icon-deletelink.564ef9dc3854.svg") 0 1px no-repeat; +} + +a.deletelink:link, a.deletelink:visited { + color: #CC3434; +} + +a.deletelink:focus, a.deletelink:hover { + color: #993333; + text-decoration: none; +} + +/* OBJECT TOOLS */ + +.object-tools { + font-size: 10px; + font-weight: bold; + padding-left: 0; + float: right; + position: relative; + margin-top: -48px; +} + +.form-row .object-tools { + margin-top: 5px; + margin-bottom: 5px; + float: none; + height: 2em; + padding-left: 3.5em; +} + +.object-tools li { + display: block; + float: left; + margin-left: 5px; + height: 16px; +} + +.object-tools a { + border-radius: 15px; +} + +.object-tools a:link, .object-tools a:visited { + display: block; + float: left; + padding: 3px 12px; + background: #999; + font-weight: 400; + font-size: 11px; + text-transform: uppercase; + letter-spacing: 0.5px; + color: #fff; +} + +.object-tools a:focus, .object-tools a:hover { + background-color: #417690; +} + +.object-tools a:focus{ + text-decoration: none; +} + +.object-tools a.viewsitelink, .object-tools a.golink,.object-tools a.addlink { + background-repeat: no-repeat; + background-position: 93% center; + padding-right: 26px; +} + +.object-tools a.viewsitelink, .object-tools a.golink { + background-image: url("../img/tooltag-arrowright.bbfb788a849e.svg"); +} + +.object-tools a.addlink { + background-image: url("../img/tooltag-add.e59d620a9742.svg"); +} + +/* OBJECT HISTORY */ + +table#change-history { + width: 100%; +} + +table#change-history tbody th { + width: 16em; +} + +/* PAGE STRUCTURE */ + +#container { + position: relative; + width: 100%; + min-width: 980px; + padding: 0; +} + +#content { + padding: 20px 40px; +} + +.dashboard #content { + width: 600px; +} + +#content-main { + float: left; + width: 100%; +} + +#content-related { + float: right; + width: 260px; + position: relative; + margin-right: -300px; +} + +#footer { + clear: both; + padding: 10px; +} + +/* COLUMN TYPES */ + +.colMS { + margin-right: 300px; +} + +.colSM { + margin-left: 300px; +} + +.colSM #content-related { + float: left; + margin-right: 0; + margin-left: -300px; +} + +.colSM #content-main { + float: right; +} + +.popup .colM { + width: auto; +} + +/* HEADER */ + +#header { + width: auto; + height: 40px; + padding: 10px 40px; + background: #417690; + line-height: 40px; + color: #ffc; + overflow: hidden; +} + +#header a:link, #header a:visited { + color: #fff; +} + +#header a:focus , #header a:hover { + text-decoration: underline; +} + +#branding { + float: left; +} + +#branding h1 { + padding: 0; + margin: 0 20px 0 0; + font-weight: 300; + font-size: 24px; + color: #f5dd5d; +} + +#branding h1, #branding h1 a:link, #branding h1 a:visited { + color: #f5dd5d; +} + +#branding h2 { + padding: 0 10px; + font-size: 14px; + margin: -8px 0 8px 0; + font-weight: normal; + color: #ffc; +} + +#branding a:hover { + text-decoration: none; +} + +#user-tools { + float: right; + padding: 0; + margin: 0 0 0 20px; + font-weight: 300; + font-size: 11px; + letter-spacing: 0.5px; + text-transform: uppercase; + text-align: right; +} + +#user-tools a { + border-bottom: 1px solid rgba(255, 255, 255, 0.25); +} + +#user-tools a:focus, #user-tools a:hover { + text-decoration: none; + border-bottom-color: #79aec8; + color: #79aec8; +} + +/* SIDEBAR */ + +#content-related { + background: #f8f8f8; +} + +#content-related .module { + background: none; +} + +#content-related h3 { + font-size: 14px; + color: #666; + padding: 0 16px; + margin: 0 0 16px; +} + +#content-related h4 { + font-size: 13px; +} + +#content-related p { + padding-left: 16px; + padding-right: 16px; +} + +#content-related .actionlist { + padding: 0; + margin: 16px; +} + +#content-related .actionlist li { + line-height: 1.2; + margin-bottom: 10px; + padding-left: 18px; +} + +#content-related .module h2 { + background: none; + padding: 16px; + margin-bottom: 16px; + border-bottom: 1px solid #eaeaea; + font-size: 18px; + color: #333; +} + +.delete-confirmation form input[type="submit"] { + background: #ba2121; + border-radius: 4px; + padding: 10px 15px; + color: #fff; +} + +.delete-confirmation form input[type="submit"]:active, +.delete-confirmation form input[type="submit"]:focus, +.delete-confirmation form input[type="submit"]:hover { + background: #a41515; +} + +.delete-confirmation form .cancel-link { + display: inline-block; + vertical-align: middle; + height: 15px; + line-height: 15px; + background: #ddd; + border-radius: 4px; + padding: 10px 15px; + color: #333; + margin: 0 0 0 10px; +} + +.delete-confirmation form .cancel-link:active, +.delete-confirmation form .cancel-link:focus, +.delete-confirmation form .cancel-link:hover { + background: #ccc; +} + +/* POPUP */ +.popup #content { + padding: 20px; +} + +.popup #container { + min-width: 0; +} + +.popup #header { + padding: 10px 20px; +} diff --git a/static/admin/css/base.ba3dc2f88fc5.css.gz b/static/admin/css/base.ba3dc2f88fc5.css.gz new file mode 100644 index 0000000..bd298ae Binary files /dev/null and b/static/admin/css/base.ba3dc2f88fc5.css.gz differ diff --git a/static/admin/css/base.css b/static/admin/css/base.css new file mode 100644 index 0000000..49db502 --- /dev/null +++ b/static/admin/css/base.css @@ -0,0 +1,971 @@ +/* + DJANGO Admin styles +*/ + +@import url(fonts.css); + +body { + margin: 0; + padding: 0; + font-size: 14px; + font-family: "Roboto","Lucida Grande","DejaVu Sans","Bitstream Vera Sans",Verdana,Arial,sans-serif; + color: #333; + background: #fff; +} + +/* LINKS */ + +a:link, a:visited { + color: #447e9b; + text-decoration: none; +} + +a:focus, a:hover { + color: #036; +} + +a:focus { + text-decoration: underline; +} + +a img { + border: none; +} + +a.section:link, a.section:visited { + color: #fff; + text-decoration: none; +} + +a.section:focus, a.section:hover { + text-decoration: underline; +} + +/* GLOBAL DEFAULTS */ + +p, ol, ul, dl { + margin: .2em 0 .8em 0; +} + +p { + padding: 0; + line-height: 140%; +} + +h1,h2,h3,h4,h5 { + font-weight: bold; +} + +h1 { + margin: 0 0 20px; + font-weight: 300; + font-size: 20px; + color: #666; +} + +h2 { + font-size: 16px; + margin: 1em 0 .5em 0; +} + +h2.subhead { + font-weight: normal; + margin-top: 0; +} + +h3 { + font-size: 14px; + margin: .8em 0 .3em 0; + color: #666; + font-weight: bold; +} + +h4 { + font-size: 12px; + margin: 1em 0 .8em 0; + padding-bottom: 3px; +} + +h5 { + font-size: 10px; + margin: 1.5em 0 .5em 0; + color: #666; + text-transform: uppercase; + letter-spacing: 1px; +} + +ul li { + list-style-type: square; + padding: 1px 0; +} + +li ul { + margin-bottom: 0; +} + +li, dt, dd { + font-size: 13px; + line-height: 20px; +} + +dt { + font-weight: bold; + margin-top: 4px; +} + +dd { + margin-left: 0; +} + +form { + margin: 0; + padding: 0; +} + +fieldset { + margin: 0; + padding: 0; + border: none; + border-top: 1px solid #eee; +} + +blockquote { + font-size: 11px; + color: #777; + margin-left: 2px; + padding-left: 10px; + border-left: 5px solid #ddd; +} + +code, pre { + font-family: "Bitstream Vera Sans Mono", Monaco, "Courier New", Courier, monospace; + color: #666; + font-size: 12px; +} + +pre.literal-block { + margin: 10px; + background: #eee; + padding: 6px 8px; +} + +code strong { + color: #930; +} + +hr { + clear: both; + color: #eee; + background-color: #eee; + height: 1px; + border: none; + margin: 0; + padding: 0; + font-size: 1px; + line-height: 1px; +} + +/* TEXT STYLES & MODIFIERS */ + +.small { + font-size: 11px; +} + +.tiny { + font-size: 10px; +} + +p.tiny { + margin-top: -2px; +} + +.mini { + font-size: 10px; +} + +p.mini { + margin-top: -3px; +} + +.help, p.help, form p.help { + font-size: 11px; + color: #999; +} + +.help-tooltip { + cursor: help; +} + +p img, h1 img, h2 img, h3 img, h4 img, td img { + vertical-align: middle; +} + +.quiet, a.quiet:link, a.quiet:visited { + color: #999; + font-weight: normal; +} + +.float-right { + float: right; +} + +.float-left { + float: left; +} + +.clear { + clear: both; +} + +.align-left { + text-align: left; +} + +.align-right { + text-align: right; +} + +.example { + margin: 10px 0; + padding: 5px 10px; + background: #efefef; +} + +.nowrap { + white-space: nowrap; +} + +/* TABLES */ + +table { + border-collapse: collapse; + border-color: #ccc; +} + +td, th { + font-size: 13px; + line-height: 16px; + border-bottom: 1px solid #eee; + vertical-align: top; + padding: 8px; + font-family: "Roboto", "Lucida Grande", Verdana, Arial, sans-serif; +} + +th { + font-weight: 600; + text-align: left; +} + +thead th, +tfoot td { + color: #666; + padding: 5px 10px; + font-size: 11px; + background: #fff; + border: none; + border-top: 1px solid #eee; + border-bottom: 1px solid #eee; +} + +tfoot td { + border-bottom: none; + border-top: 1px solid #eee; +} + +thead th.required { + color: #000; +} + +tr.alt { + background: #f6f6f6; +} + +.row1 { + background: #fff; +} + +.row2 { + background: #f9f9f9; +} + +/* SORTABLE TABLES */ + +thead th { + padding: 5px 10px; + line-height: normal; + text-transform: uppercase; + background: #f6f6f6; +} + +thead th a:link, thead th a:visited { + color: #666; +} + +thead th.sorted { + background: #eee; +} + +thead th.sorted .text { + padding-right: 42px; +} + +table thead th .text span { + padding: 8px 10px; + display: block; +} + +table thead th .text a { + display: block; + cursor: pointer; + padding: 8px 10px; +} + +table thead th .text a:focus, table thead th .text a:hover { + background: #eee; +} + +thead th.sorted a.sortremove { + visibility: hidden; +} + +table thead th.sorted:hover a.sortremove { + visibility: visible; +} + +table thead th.sorted .sortoptions { + display: block; + padding: 9px 5px 0 5px; + float: right; + text-align: right; +} + +table thead th.sorted .sortpriority { + font-size: .8em; + min-width: 12px; + text-align: center; + vertical-align: 3px; + margin-left: 2px; + margin-right: 2px; +} + +table thead th.sorted .sortoptions a { + position: relative; + width: 14px; + height: 14px; + display: inline-block; + background: url(../img/sorting-icons.svg) 0 0 no-repeat; + background-size: 14px auto; +} + +table thead th.sorted .sortoptions a.sortremove { + background-position: 0 0; +} + +table thead th.sorted .sortoptions a.sortremove:after { + content: '\\'; + position: absolute; + top: -6px; + left: 3px; + font-weight: 200; + font-size: 18px; + color: #999; +} + +table thead th.sorted .sortoptions a.sortremove:focus:after, +table thead th.sorted .sortoptions a.sortremove:hover:after { + color: #447e9b; +} + +table thead th.sorted .sortoptions a.sortremove:focus, +table thead th.sorted .sortoptions a.sortremove:hover { + background-position: 0 -14px; +} + +table thead th.sorted .sortoptions a.ascending { + background-position: 0 -28px; +} + +table thead th.sorted .sortoptions a.ascending:focus, +table thead th.sorted .sortoptions a.ascending:hover { + background-position: 0 -42px; +} + +table thead th.sorted .sortoptions a.descending { + top: 1px; + background-position: 0 -56px; +} + +table thead th.sorted .sortoptions a.descending:focus, +table thead th.sorted .sortoptions a.descending:hover { + background-position: 0 -70px; +} + +/* FORM DEFAULTS */ + +input, textarea, select, .form-row p, form .button { + margin: 2px 0; + padding: 2px 3px; + vertical-align: middle; + font-family: "Roboto", "Lucida Grande", Verdana, Arial, sans-serif; + font-weight: normal; + font-size: 13px; +} + +textarea { + vertical-align: top; +} + +input[type=text], input[type=password], input[type=email], input[type=url], +input[type=number], textarea, select, .vTextField { + border: 1px solid #ccc; + border-radius: 4px; + padding: 5px 6px; + margin-top: 0; +} + +input[type=text]:focus, input[type=password]:focus, input[type=email]:focus, +input[type=url]:focus, input[type=number]:focus, textarea:focus, select:focus, +.vTextField:focus { + border-color: #999; +} + +select { + height: 30px; +} + +select[multiple] { + min-height: 150px; +} + +/* FORM BUTTONS */ + +.button, input[type=submit], input[type=button], .submit-row input, a.button { + background: #79aec8; + padding: 10px 15px; + border: none; + border-radius: 4px; + color: #fff; + cursor: pointer; +} + +a.button { + padding: 4px 5px; +} + +.button:active, input[type=submit]:active, input[type=button]:active, +.button:focus, input[type=submit]:focus, input[type=button]:focus, +.button:hover, input[type=submit]:hover, input[type=button]:hover { + background: #609ab6; +} + +.button[disabled], input[type=submit][disabled], input[type=button][disabled] { + opacity: 0.4; +} + +.button.default, input[type=submit].default, .submit-row input.default { + float: right; + border: none; + font-weight: 400; + background: #417690; +} + +.button.default:active, input[type=submit].default:active, +.button.default:focus, input[type=submit].default:focus, +.button.default:hover, input[type=submit].default:hover { + background: #205067; +} + +.button[disabled].default, +input[type=submit][disabled].default, +input[type=button][disabled].default { + opacity: 0.4; +} + + +/* MODULES */ + +.module { + border: none; + margin-bottom: 30px; + background: #fff; +} + +.module p, .module ul, .module h3, .module h4, .module dl, .module pre { + padding-left: 10px; + padding-right: 10px; +} + +.module blockquote { + margin-left: 12px; +} + +.module ul, .module ol { + margin-left: 1.5em; +} + +.module h3 { + margin-top: .6em; +} + +.module h2, .module caption, .inline-group h2 { + margin: 0; + padding: 8px; + font-weight: 400; + font-size: 13px; + text-align: left; + background: #79aec8; + color: #fff; +} + +.module caption, +.inline-group h2 { + font-size: 12px; + letter-spacing: 0.5px; + text-transform: uppercase; +} + +.module table { + border-collapse: collapse; +} + +/* MESSAGES & ERRORS */ + +ul.messagelist { + padding: 0; + margin: 0; +} + +ul.messagelist li { + display: block; + font-weight: 400; + font-size: 13px; + padding: 10px 10px 10px 65px; + margin: 0 0 10px 0; + background: #dfd url(../img/icon-yes.svg) 40px 12px no-repeat; + background-size: 16px auto; + color: #333; +} + +ul.messagelist li.warning { + background: #ffc url(../img/icon-alert.svg) 40px 14px no-repeat; + background-size: 14px auto; +} + +ul.messagelist li.error { + background: #ffefef url(../img/icon-no.svg) 40px 12px no-repeat; + background-size: 16px auto; +} + +.errornote { + font-size: 14px; + font-weight: 700; + display: block; + padding: 10px 12px; + margin: 0 0 10px 0; + color: #ba2121; + border: 1px solid #ba2121; + border-radius: 4px; + background-color: #fff; + background-position: 5px 12px; +} + +ul.errorlist { + margin: 0 0 4px; + padding: 0; + color: #ba2121; + background: #fff; +} + +ul.errorlist li { + font-size: 13px; + display: block; + margin-bottom: 4px; +} + +ul.errorlist li:first-child { + margin-top: 0; +} + +ul.errorlist li a { + color: inherit; + text-decoration: underline; +} + +td ul.errorlist { + margin: 0; + padding: 0; +} + +td ul.errorlist li { + margin: 0; +} + +.form-row.errors { + margin: 0; + border: none; + border-bottom: 1px solid #eee; + background: none; +} + +.form-row.errors ul.errorlist li { + padding-left: 0; +} + +.errors input, .errors select, .errors textarea { + border: 1px solid #ba2121; +} + +div.system-message { + background: #ffc; + margin: 10px; + padding: 6px 8px; + font-size: .8em; +} + +div.system-message p.system-message-title { + padding: 4px 5px 4px 25px; + margin: 0; + color: #c11; + background: #ffefef url(../img/icon-no.svg) 5px 5px no-repeat; +} + +.description { + font-size: 12px; + padding: 5px 0 0 12px; +} + +/* BREADCRUMBS */ + +div.breadcrumbs { + background: #79aec8; + padding: 10px 40px; + border: none; + font-size: 14px; + color: #c4dce8; + text-align: left; +} + +div.breadcrumbs a { + color: #fff; +} + +div.breadcrumbs a:focus, div.breadcrumbs a:hover { + color: #c4dce8; +} + +/* ACTION ICONS */ + +.addlink { + padding-left: 16px; + background: url(../img/icon-addlink.svg) 0 1px no-repeat; +} + +.changelink, .inlinechangelink { + padding-left: 16px; + background: url(../img/icon-changelink.svg) 0 1px no-repeat; +} + +.deletelink { + padding-left: 16px; + background: url(../img/icon-deletelink.svg) 0 1px no-repeat; +} + +a.deletelink:link, a.deletelink:visited { + color: #CC3434; +} + +a.deletelink:focus, a.deletelink:hover { + color: #993333; + text-decoration: none; +} + +/* OBJECT TOOLS */ + +.object-tools { + font-size: 10px; + font-weight: bold; + padding-left: 0; + float: right; + position: relative; + margin-top: -48px; +} + +.form-row .object-tools { + margin-top: 5px; + margin-bottom: 5px; + float: none; + height: 2em; + padding-left: 3.5em; +} + +.object-tools li { + display: block; + float: left; + margin-left: 5px; + height: 16px; +} + +.object-tools a { + border-radius: 15px; +} + +.object-tools a:link, .object-tools a:visited { + display: block; + float: left; + padding: 3px 12px; + background: #999; + font-weight: 400; + font-size: 11px; + text-transform: uppercase; + letter-spacing: 0.5px; + color: #fff; +} + +.object-tools a:focus, .object-tools a:hover { + background-color: #417690; +} + +.object-tools a:focus{ + text-decoration: none; +} + +.object-tools a.viewsitelink, .object-tools a.golink,.object-tools a.addlink { + background-repeat: no-repeat; + background-position: 93% center; + padding-right: 26px; +} + +.object-tools a.viewsitelink, .object-tools a.golink { + background-image: url(../img/tooltag-arrowright.svg); +} + +.object-tools a.addlink { + background-image: url(../img/tooltag-add.svg); +} + +/* OBJECT HISTORY */ + +table#change-history { + width: 100%; +} + +table#change-history tbody th { + width: 16em; +} + +/* PAGE STRUCTURE */ + +#container { + position: relative; + width: 100%; + min-width: 980px; + padding: 0; +} + +#content { + padding: 20px 40px; +} + +.dashboard #content { + width: 600px; +} + +#content-main { + float: left; + width: 100%; +} + +#content-related { + float: right; + width: 260px; + position: relative; + margin-right: -300px; +} + +#footer { + clear: both; + padding: 10px; +} + +/* COLUMN TYPES */ + +.colMS { + margin-right: 300px; +} + +.colSM { + margin-left: 300px; +} + +.colSM #content-related { + float: left; + margin-right: 0; + margin-left: -300px; +} + +.colSM #content-main { + float: right; +} + +.popup .colM { + width: auto; +} + +/* HEADER */ + +#header { + width: auto; + height: 40px; + padding: 10px 40px; + background: #417690; + line-height: 40px; + color: #ffc; + overflow: hidden; +} + +#header a:link, #header a:visited { + color: #fff; +} + +#header a:focus , #header a:hover { + text-decoration: underline; +} + +#branding { + float: left; +} + +#branding h1 { + padding: 0; + margin: 0 20px 0 0; + font-weight: 300; + font-size: 24px; + color: #f5dd5d; +} + +#branding h1, #branding h1 a:link, #branding h1 a:visited { + color: #f5dd5d; +} + +#branding h2 { + padding: 0 10px; + font-size: 14px; + margin: -8px 0 8px 0; + font-weight: normal; + color: #ffc; +} + +#branding a:hover { + text-decoration: none; +} + +#user-tools { + float: right; + padding: 0; + margin: 0 0 0 20px; + font-weight: 300; + font-size: 11px; + letter-spacing: 0.5px; + text-transform: uppercase; + text-align: right; +} + +#user-tools a { + border-bottom: 1px solid rgba(255, 255, 255, 0.25); +} + +#user-tools a:focus, #user-tools a:hover { + text-decoration: none; + border-bottom-color: #79aec8; + color: #79aec8; +} + +/* SIDEBAR */ + +#content-related { + background: #f8f8f8; +} + +#content-related .module { + background: none; +} + +#content-related h3 { + font-size: 14px; + color: #666; + padding: 0 16px; + margin: 0 0 16px; +} + +#content-related h4 { + font-size: 13px; +} + +#content-related p { + padding-left: 16px; + padding-right: 16px; +} + +#content-related .actionlist { + padding: 0; + margin: 16px; +} + +#content-related .actionlist li { + line-height: 1.2; + margin-bottom: 10px; + padding-left: 18px; +} + +#content-related .module h2 { + background: none; + padding: 16px; + margin-bottom: 16px; + border-bottom: 1px solid #eaeaea; + font-size: 18px; + color: #333; +} + +.delete-confirmation form input[type="submit"] { + background: #ba2121; + border-radius: 4px; + padding: 10px 15px; + color: #fff; +} + +.delete-confirmation form input[type="submit"]:active, +.delete-confirmation form input[type="submit"]:focus, +.delete-confirmation form input[type="submit"]:hover { + background: #a41515; +} + +.delete-confirmation form .cancel-link { + display: inline-block; + vertical-align: middle; + height: 15px; + line-height: 15px; + background: #ddd; + border-radius: 4px; + padding: 10px 15px; + color: #333; + margin: 0 0 0 10px; +} + +.delete-confirmation form .cancel-link:active, +.delete-confirmation form .cancel-link:focus, +.delete-confirmation form .cancel-link:hover { + background: #ccc; +} + +/* POPUP */ +.popup #content { + padding: 20px; +} + +.popup #container { + min-width: 0; +} + +.popup #header { + padding: 10px 20px; +} diff --git a/static/admin/css/base.css.gz b/static/admin/css/base.css.gz new file mode 100644 index 0000000..bd47d4d Binary files /dev/null and b/static/admin/css/base.css.gz differ diff --git a/static/admin/css/changelists.b1b060f73d37.css b/static/admin/css/changelists.b1b060f73d37.css new file mode 100644 index 0000000..4eab760 --- /dev/null +++ b/static/admin/css/changelists.b1b060f73d37.css @@ -0,0 +1,342 @@ +/* CHANGELISTS */ + +#changelist { + position: relative; + width: 100%; +} + +#changelist table { + width: 100%; +} + +.change-list .hiddenfields { display:none; } + +.change-list .filtered table { + border-right: none; +} + +.change-list .filtered { + min-height: 400px; +} + +.change-list .filtered .results, .change-list .filtered .paginator, +.filtered #toolbar, .filtered div.xfull { + margin-right: 280px; + width: auto; +} + +.change-list .filtered table tbody th { + padding-right: 1em; +} + +#changelist-form .results { + overflow-x: auto; +} + +#changelist .toplinks { + border-bottom: 1px solid #ddd; +} + +#changelist .paginator { + color: #666; + border-bottom: 1px solid #eee; + background: #fff; + overflow: hidden; +} + +/* CHANGELIST TABLES */ + +#changelist table thead th { + padding: 0; + white-space: nowrap; + vertical-align: middle; +} + +#changelist table thead th.action-checkbox-column { + width: 1.5em; + text-align: center; +} + +#changelist table tbody td.action-checkbox { + text-align: center; +} + +#changelist table tfoot { + color: #666; +} + +/* TOOLBAR */ + +#changelist #toolbar { + padding: 8px 10px; + margin-bottom: 15px; + border-top: 1px solid #eee; + border-bottom: 1px solid #eee; + background: #f8f8f8; + color: #666; +} + +#changelist #toolbar form input { + border-radius: 4px; + font-size: 14px; + padding: 5px; + color: #333; +} + +#changelist #toolbar form #searchbar { + height: 19px; + border: 1px solid #ccc; + padding: 2px 5px; + margin: 0; + vertical-align: top; + font-size: 13px; +} + +#changelist #toolbar form #searchbar:focus { + border-color: #999; +} + +#changelist #toolbar form input[type="submit"] { + border: 1px solid #ccc; + padding: 2px 10px; + margin: 0; + vertical-align: middle; + background: #fff; + box-shadow: 0 -15px 20px -10px rgba(0, 0, 0, 0.15) inset; + cursor: pointer; + color: #333; +} + +#changelist #toolbar form input[type="submit"]:focus, +#changelist #toolbar form input[type="submit"]:hover { + border-color: #999; +} + +#changelist #changelist-search img { + vertical-align: middle; + margin-right: 4px; +} + +/* FILTER COLUMN */ + +#changelist-filter { + position: absolute; + top: 0; + right: 0; + z-index: 1000; + width: 240px; + background: #f8f8f8; + border-left: none; + margin: 0; +} + +#changelist-filter h2 { + font-size: 14px; + text-transform: uppercase; + letter-spacing: 0.5px; + padding: 5px 15px; + margin-bottom: 12px; + border-bottom: none; +} + +#changelist-filter h3 { + font-weight: 400; + font-size: 14px; + padding: 0 15px; + margin-bottom: 10px; +} + +#changelist-filter ul { + margin: 5px 0; + padding: 0 15px 15px; + border-bottom: 1px solid #eaeaea; +} + +#changelist-filter ul:last-child { + border-bottom: none; + padding-bottom: none; +} + +#changelist-filter li { + list-style-type: none; + margin-left: 0; + padding-left: 0; +} + +#changelist-filter a { + display: block; + color: #999; +} + +#changelist-filter li.selected { + border-left: 5px solid #eaeaea; + padding-left: 10px; + margin-left: -15px; +} + +#changelist-filter li.selected a { + color: #5b80b2; +} + +#changelist-filter a:focus, #changelist-filter a:hover, +#changelist-filter li.selected a:focus, +#changelist-filter li.selected a:hover { + color: #036; +} + +/* DATE DRILLDOWN */ + +.change-list ul.toplinks { + display: block; + float: left; + padding: 0; + margin: 0; + width: 100%; +} + +.change-list ul.toplinks li { + padding: 3px 6px; + font-weight: bold; + list-style-type: none; + display: inline-block; +} + +.change-list ul.toplinks .date-back a { + color: #999; +} + +.change-list ul.toplinks .date-back a:focus, +.change-list ul.toplinks .date-back a:hover { + color: #036; +} + +/* PAGINATOR */ + +.paginator { + font-size: 13px; + padding-top: 10px; + padding-bottom: 10px; + line-height: 22px; + margin: 0; + border-top: 1px solid #ddd; +} + +.paginator a:link, .paginator a:visited { + padding: 2px 6px; + background: #79aec8; + text-decoration: none; + color: #fff; +} + +.paginator a.showall { + padding: 0; + border: none; + background: none; + color: #5b80b2; +} + +.paginator a.showall:focus, .paginator a.showall:hover { + background: none; + color: #036; +} + +.paginator .end { + margin-right: 6px; +} + +.paginator .this-page { + padding: 2px 6px; + font-weight: bold; + font-size: 13px; + vertical-align: top; +} + +.paginator a:focus, .paginator a:hover { + color: white; + background: #036; +} + +/* ACTIONS */ + +.filtered .actions { + margin-right: 280px; + border-right: none; +} + +#changelist table input { + margin: 0; + vertical-align: baseline; +} + +#changelist table tbody tr.selected { + background-color: #FFFFCC; +} + +#changelist .actions { + padding: 10px; + background: #fff; + border-top: none; + border-bottom: none; + line-height: 24px; + color: #999; +} + +#changelist .actions.selected { + background: #fffccf; + border-top: 1px solid #fffee8; + border-bottom: 1px solid #edecd6; +} + +#changelist .actions span.all, +#changelist .actions span.action-counter, +#changelist .actions span.clear, +#changelist .actions span.question { + font-size: 13px; + margin: 0 0.5em; + display: none; +} + +#changelist .actions:last-child { + border-bottom: none; +} + +#changelist .actions select { + vertical-align: top; + height: 24px; + background: none; + color: #000; + border: 1px solid #ccc; + border-radius: 4px; + font-size: 14px; + padding: 0 0 0 4px; + margin: 0; + margin-left: 10px; +} + +#changelist .actions select:focus { + border-color: #999; +} + +#changelist .actions label { + display: inline-block; + vertical-align: middle; + font-size: 13px; +} + +#changelist .actions .button { + font-size: 13px; + border: 1px solid #ccc; + border-radius: 4px; + background: #fff; + box-shadow: 0 -15px 20px -10px rgba(0, 0, 0, 0.15) inset; + cursor: pointer; + height: 24px; + line-height: 1; + padding: 4px 8px; + margin: 0; + color: #333; +} + +#changelist .actions .button:focus, #changelist .actions .button:hover { + border-color: #999; +} diff --git a/static/admin/css/changelists.b1b060f73d37.css.gz b/static/admin/css/changelists.b1b060f73d37.css.gz new file mode 100644 index 0000000..b45638c Binary files /dev/null and b/static/admin/css/changelists.b1b060f73d37.css.gz differ diff --git a/static/admin/css/changelists.css b/static/admin/css/changelists.css new file mode 100644 index 0000000..4eab760 --- /dev/null +++ b/static/admin/css/changelists.css @@ -0,0 +1,342 @@ +/* CHANGELISTS */ + +#changelist { + position: relative; + width: 100%; +} + +#changelist table { + width: 100%; +} + +.change-list .hiddenfields { display:none; } + +.change-list .filtered table { + border-right: none; +} + +.change-list .filtered { + min-height: 400px; +} + +.change-list .filtered .results, .change-list .filtered .paginator, +.filtered #toolbar, .filtered div.xfull { + margin-right: 280px; + width: auto; +} + +.change-list .filtered table tbody th { + padding-right: 1em; +} + +#changelist-form .results { + overflow-x: auto; +} + +#changelist .toplinks { + border-bottom: 1px solid #ddd; +} + +#changelist .paginator { + color: #666; + border-bottom: 1px solid #eee; + background: #fff; + overflow: hidden; +} + +/* CHANGELIST TABLES */ + +#changelist table thead th { + padding: 0; + white-space: nowrap; + vertical-align: middle; +} + +#changelist table thead th.action-checkbox-column { + width: 1.5em; + text-align: center; +} + +#changelist table tbody td.action-checkbox { + text-align: center; +} + +#changelist table tfoot { + color: #666; +} + +/* TOOLBAR */ + +#changelist #toolbar { + padding: 8px 10px; + margin-bottom: 15px; + border-top: 1px solid #eee; + border-bottom: 1px solid #eee; + background: #f8f8f8; + color: #666; +} + +#changelist #toolbar form input { + border-radius: 4px; + font-size: 14px; + padding: 5px; + color: #333; +} + +#changelist #toolbar form #searchbar { + height: 19px; + border: 1px solid #ccc; + padding: 2px 5px; + margin: 0; + vertical-align: top; + font-size: 13px; +} + +#changelist #toolbar form #searchbar:focus { + border-color: #999; +} + +#changelist #toolbar form input[type="submit"] { + border: 1px solid #ccc; + padding: 2px 10px; + margin: 0; + vertical-align: middle; + background: #fff; + box-shadow: 0 -15px 20px -10px rgba(0, 0, 0, 0.15) inset; + cursor: pointer; + color: #333; +} + +#changelist #toolbar form input[type="submit"]:focus, +#changelist #toolbar form input[type="submit"]:hover { + border-color: #999; +} + +#changelist #changelist-search img { + vertical-align: middle; + margin-right: 4px; +} + +/* FILTER COLUMN */ + +#changelist-filter { + position: absolute; + top: 0; + right: 0; + z-index: 1000; + width: 240px; + background: #f8f8f8; + border-left: none; + margin: 0; +} + +#changelist-filter h2 { + font-size: 14px; + text-transform: uppercase; + letter-spacing: 0.5px; + padding: 5px 15px; + margin-bottom: 12px; + border-bottom: none; +} + +#changelist-filter h3 { + font-weight: 400; + font-size: 14px; + padding: 0 15px; + margin-bottom: 10px; +} + +#changelist-filter ul { + margin: 5px 0; + padding: 0 15px 15px; + border-bottom: 1px solid #eaeaea; +} + +#changelist-filter ul:last-child { + border-bottom: none; + padding-bottom: none; +} + +#changelist-filter li { + list-style-type: none; + margin-left: 0; + padding-left: 0; +} + +#changelist-filter a { + display: block; + color: #999; +} + +#changelist-filter li.selected { + border-left: 5px solid #eaeaea; + padding-left: 10px; + margin-left: -15px; +} + +#changelist-filter li.selected a { + color: #5b80b2; +} + +#changelist-filter a:focus, #changelist-filter a:hover, +#changelist-filter li.selected a:focus, +#changelist-filter li.selected a:hover { + color: #036; +} + +/* DATE DRILLDOWN */ + +.change-list ul.toplinks { + display: block; + float: left; + padding: 0; + margin: 0; + width: 100%; +} + +.change-list ul.toplinks li { + padding: 3px 6px; + font-weight: bold; + list-style-type: none; + display: inline-block; +} + +.change-list ul.toplinks .date-back a { + color: #999; +} + +.change-list ul.toplinks .date-back a:focus, +.change-list ul.toplinks .date-back a:hover { + color: #036; +} + +/* PAGINATOR */ + +.paginator { + font-size: 13px; + padding-top: 10px; + padding-bottom: 10px; + line-height: 22px; + margin: 0; + border-top: 1px solid #ddd; +} + +.paginator a:link, .paginator a:visited { + padding: 2px 6px; + background: #79aec8; + text-decoration: none; + color: #fff; +} + +.paginator a.showall { + padding: 0; + border: none; + background: none; + color: #5b80b2; +} + +.paginator a.showall:focus, .paginator a.showall:hover { + background: none; + color: #036; +} + +.paginator .end { + margin-right: 6px; +} + +.paginator .this-page { + padding: 2px 6px; + font-weight: bold; + font-size: 13px; + vertical-align: top; +} + +.paginator a:focus, .paginator a:hover { + color: white; + background: #036; +} + +/* ACTIONS */ + +.filtered .actions { + margin-right: 280px; + border-right: none; +} + +#changelist table input { + margin: 0; + vertical-align: baseline; +} + +#changelist table tbody tr.selected { + background-color: #FFFFCC; +} + +#changelist .actions { + padding: 10px; + background: #fff; + border-top: none; + border-bottom: none; + line-height: 24px; + color: #999; +} + +#changelist .actions.selected { + background: #fffccf; + border-top: 1px solid #fffee8; + border-bottom: 1px solid #edecd6; +} + +#changelist .actions span.all, +#changelist .actions span.action-counter, +#changelist .actions span.clear, +#changelist .actions span.question { + font-size: 13px; + margin: 0 0.5em; + display: none; +} + +#changelist .actions:last-child { + border-bottom: none; +} + +#changelist .actions select { + vertical-align: top; + height: 24px; + background: none; + color: #000; + border: 1px solid #ccc; + border-radius: 4px; + font-size: 14px; + padding: 0 0 0 4px; + margin: 0; + margin-left: 10px; +} + +#changelist .actions select:focus { + border-color: #999; +} + +#changelist .actions label { + display: inline-block; + vertical-align: middle; + font-size: 13px; +} + +#changelist .actions .button { + font-size: 13px; + border: 1px solid #ccc; + border-radius: 4px; + background: #fff; + box-shadow: 0 -15px 20px -10px rgba(0, 0, 0, 0.15) inset; + cursor: pointer; + height: 24px; + line-height: 1; + padding: 4px 8px; + margin: 0; + color: #333; +} + +#changelist .actions .button:focus, #changelist .actions .button:hover { + border-color: #999; +} diff --git a/static/admin/css/changelists.css.gz b/static/admin/css/changelists.css.gz new file mode 100644 index 0000000..b45638c Binary files /dev/null and b/static/admin/css/changelists.css.gz differ diff --git a/static/admin/css/dashboard.4898e2e9983d.css b/static/admin/css/dashboard.4898e2e9983d.css new file mode 100644 index 0000000..05808bc --- /dev/null +++ b/static/admin/css/dashboard.4898e2e9983d.css @@ -0,0 +1,30 @@ +/* DASHBOARD */ + +.dashboard .module table th { + width: 100%; +} + +.dashboard .module table td { + white-space: nowrap; +} + +.dashboard .module table td a { + display: block; + padding-right: .6em; +} + +/* RECENT ACTIONS MODULE */ + +.module ul.actionlist { + margin-left: 0; +} + +ul.actionlist li { + list-style-type: none; +} + +ul.actionlist li { + overflow: hidden; + text-overflow: ellipsis; + -o-text-overflow: ellipsis; +} diff --git a/static/admin/css/dashboard.4898e2e9983d.css.gz b/static/admin/css/dashboard.4898e2e9983d.css.gz new file mode 100644 index 0000000..1bade2e Binary files /dev/null and b/static/admin/css/dashboard.4898e2e9983d.css.gz differ diff --git a/static/admin/css/dashboard.css b/static/admin/css/dashboard.css new file mode 100644 index 0000000..05808bc --- /dev/null +++ b/static/admin/css/dashboard.css @@ -0,0 +1,30 @@ +/* DASHBOARD */ + +.dashboard .module table th { + width: 100%; +} + +.dashboard .module table td { + white-space: nowrap; +} + +.dashboard .module table td a { + display: block; + padding-right: .6em; +} + +/* RECENT ACTIONS MODULE */ + +.module ul.actionlist { + margin-left: 0; +} + +ul.actionlist li { + list-style-type: none; +} + +ul.actionlist li { + overflow: hidden; + text-overflow: ellipsis; + -o-text-overflow: ellipsis; +} diff --git a/static/admin/css/dashboard.css.gz b/static/admin/css/dashboard.css.gz new file mode 100644 index 0000000..1bade2e Binary files /dev/null and b/static/admin/css/dashboard.css.gz differ diff --git a/static/admin/css/fonts.cc6140298ba7.css b/static/admin/css/fonts.cc6140298ba7.css new file mode 100644 index 0000000..0bee2e2 --- /dev/null +++ b/static/admin/css/fonts.cc6140298ba7.css @@ -0,0 +1,20 @@ +@font-face { + font-family: 'Roboto'; + src: url("../fonts/Roboto-Bold-webfont.2ad99072841e.woff"); + font-weight: 700; + font-style: normal; +} + +@font-face { + font-family: 'Roboto'; + src: url("../fonts/Roboto-Regular-webfont.ec39515ae8c6.woff"); + font-weight: 400; + font-style: normal; +} + +@font-face { + font-family: 'Roboto'; + src: url("../fonts/Roboto-Light-webfont.b446c2399bb6.woff"); + font-weight: 300; + font-style: normal; +} diff --git a/static/admin/css/fonts.cc6140298ba7.css.gz b/static/admin/css/fonts.cc6140298ba7.css.gz new file mode 100644 index 0000000..aab905b Binary files /dev/null and b/static/admin/css/fonts.cc6140298ba7.css.gz differ diff --git a/static/admin/css/fonts.css b/static/admin/css/fonts.css new file mode 100644 index 0000000..c837e01 --- /dev/null +++ b/static/admin/css/fonts.css @@ -0,0 +1,20 @@ +@font-face { + font-family: 'Roboto'; + src: url('../fonts/Roboto-Bold-webfont.woff'); + font-weight: 700; + font-style: normal; +} + +@font-face { + font-family: 'Roboto'; + src: url('../fonts/Roboto-Regular-webfont.woff'); + font-weight: 400; + font-style: normal; +} + +@font-face { + font-family: 'Roboto'; + src: url('../fonts/Roboto-Light-webfont.woff'); + font-weight: 300; + font-style: normal; +} diff --git a/static/admin/css/fonts.css.gz b/static/admin/css/fonts.css.gz new file mode 100644 index 0000000..834a458 Binary files /dev/null and b/static/admin/css/fonts.css.gz differ diff --git a/static/admin/css/forms.198ebbd0f980.css b/static/admin/css/forms.198ebbd0f980.css new file mode 100644 index 0000000..5f77c4d --- /dev/null +++ b/static/admin/css/forms.198ebbd0f980.css @@ -0,0 +1 @@ +/* Empty CSS from Django Suit app to override original file */ diff --git a/static/admin/css/forms.css b/static/admin/css/forms.css new file mode 100644 index 0000000..5f77c4d --- /dev/null +++ b/static/admin/css/forms.css @@ -0,0 +1 @@ +/* Empty CSS from Django Suit app to override original file */ diff --git a/static/admin/css/login.a846c0e2ef65.css b/static/admin/css/login.a846c0e2ef65.css new file mode 100644 index 0000000..cab3bbf --- /dev/null +++ b/static/admin/css/login.a846c0e2ef65.css @@ -0,0 +1,78 @@ +/* LOGIN FORM */ + +body.login { + background: #f8f8f8; +} + +.login #header { + height: auto; + padding: 5px 16px; +} + +.login #header h1 { + font-size: 18px; +} + +.login #header h1 a { + color: #fff; +} + +.login #content { + padding: 20px 20px 0; +} + +.login #container { + background: #fff; + border: 1px solid #eaeaea; + border-radius: 4px; + overflow: hidden; + width: 28em; + min-width: 300px; + margin: 100px auto; +} + +.login #content-main { + width: 100%; +} + +.login .form-row { + padding: 4px 0; + float: left; + width: 100%; + border-bottom: none; +} + +.login .form-row label { + padding-right: 0.5em; + line-height: 2em; + font-size: 1em; + clear: both; + color: #333; +} + +.login .form-row #id_username, .login .form-row #id_password { + clear: both; + padding: 8px; + width: 100%; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} + +.login span.help { + font-size: 10px; + display: block; +} + +.login .submit-row { + clear: both; + padding: 1em 0 0 9.4em; + margin: 0; + border: none; + background: none; + text-align: left; +} + +.login .password-reset-link { + text-align: center; +} diff --git a/static/admin/css/login.a846c0e2ef65.css.gz b/static/admin/css/login.a846c0e2ef65.css.gz new file mode 100644 index 0000000..3f810c8 Binary files /dev/null and b/static/admin/css/login.a846c0e2ef65.css.gz differ diff --git a/static/admin/css/login.css b/static/admin/css/login.css new file mode 100644 index 0000000..cab3bbf --- /dev/null +++ b/static/admin/css/login.css @@ -0,0 +1,78 @@ +/* LOGIN FORM */ + +body.login { + background: #f8f8f8; +} + +.login #header { + height: auto; + padding: 5px 16px; +} + +.login #header h1 { + font-size: 18px; +} + +.login #header h1 a { + color: #fff; +} + +.login #content { + padding: 20px 20px 0; +} + +.login #container { + background: #fff; + border: 1px solid #eaeaea; + border-radius: 4px; + overflow: hidden; + width: 28em; + min-width: 300px; + margin: 100px auto; +} + +.login #content-main { + width: 100%; +} + +.login .form-row { + padding: 4px 0; + float: left; + width: 100%; + border-bottom: none; +} + +.login .form-row label { + padding-right: 0.5em; + line-height: 2em; + font-size: 1em; + clear: both; + color: #333; +} + +.login .form-row #id_username, .login .form-row #id_password { + clear: both; + padding: 8px; + width: 100%; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} + +.login span.help { + font-size: 10px; + display: block; +} + +.login .submit-row { + clear: both; + padding: 1em 0 0 9.4em; + margin: 0; + border: none; + background: none; + text-align: left; +} + +.login .password-reset-link { + text-align: center; +} diff --git a/static/admin/css/login.css.gz b/static/admin/css/login.css.gz new file mode 100644 index 0000000..3f810c8 Binary files /dev/null and b/static/admin/css/login.css.gz differ diff --git a/static/admin/css/rtl.css b/static/admin/css/rtl.css new file mode 100644 index 0000000..8c1ceb4 --- /dev/null +++ b/static/admin/css/rtl.css @@ -0,0 +1,256 @@ +body { + direction: rtl; +} + +/* LOGIN */ + +.login .form-row { + float: right; +} + +.login .form-row label { + float: right; + padding-left: 0.5em; + padding-right: 0; + text-align: left; +} + +.login .submit-row { + clear: both; + padding: 1em 9.4em 0 0; +} + +/* GLOBAL */ + +th { + text-align: right; +} + +.module h2, .module caption { + text-align: right; +} + +.module ul, .module ol { + margin-left: 0; + margin-right: 1.5em; +} + +.addlink, .changelink { + padding-left: 0; + padding-right: 16px; + background-position: 100% 1px; +} + +.deletelink { + padding-left: 0; + padding-right: 16px; + background-position: 100% 1px; +} + +.object-tools { + float: left; +} + +thead th:first-child, +tfoot td:first-child { + border-left: none; +} + +/* LAYOUT */ + +#user-tools { + right: auto; + left: 0; + text-align: left; +} + +div.breadcrumbs { + text-align: right; +} + +#content-main { + float: right; +} + +#content-related { + float: left; + margin-left: -300px; + margin-right: auto; +} + +.colMS { + margin-left: 300px; + margin-right: 0; +} + +/* SORTABLE TABLES */ + +table thead th.sorted .sortoptions { + float: left; +} + +thead th.sorted .text { + padding-right: 0; + padding-left: 42px; +} + +/* dashboard styles */ + +.dashboard .module table td a { + padding-left: .6em; + padding-right: 16px; +} + +/* changelists styles */ + +.change-list .filtered table { + border-left: none; + border-right: 0px none; +} + +#changelist-filter { + right: auto; + left: 0; + border-left: none; + border-right: none; +} + +.change-list .filtered .results, .change-list .filtered .paginator, .filtered #toolbar, .filtered div.xfull { + margin-right: 0; + margin-left: 280px; +} + +#changelist-filter li.selected { + border-left: none; + padding-left: 10px; + margin-left: 0; + border-right: 5px solid #eaeaea; + padding-right: 10px; + margin-right: -15px; +} + +.filtered .actions { + margin-left: 280px; + margin-right: 0; +} + +#changelist table tbody td:first-child, #changelist table tbody th:first-child { + border-right: none; + border-left: none; +} + +/* FORMS */ + +.aligned label { + padding: 0 0 3px 1em; + float: right; +} + +.submit-row { + text-align: left +} + +.submit-row p.deletelink-box { + float: right; +} + +.submit-row input.default { + margin-left: 0; +} + +.vDateField, .vTimeField { + margin-left: 2px; +} + +.aligned .form-row input { + margin-left: 5px; +} + +form ul.inline li { + float: right; + padding-right: 0; + padding-left: 7px; +} + +input[type=submit].default, .submit-row input.default { + float: left; +} + +fieldset .field-box { + float: right; + margin-left: 20px; + margin-right: 0; +} + +.errorlist li { + background-position: 100% 12px; + padding: 0; +} + +.errornote { + background-position: 100% 12px; + padding: 10px 12px; +} + +/* WIDGETS */ + +.calendarnav-previous { + top: 0; + left: auto; + right: 10px; +} + +.calendarnav-next { + top: 0; + right: auto; + left: 10px; +} + +.calendar caption, .calendarbox h2 { + text-align: center; +} + +.selector { + float: right; +} + +.selector .selector-filter { + text-align: right; +} + +.inline-deletelink { + float: left; +} + +form .form-row p.datetime { + overflow: hidden; +} + +/* MISC */ + +.inline-related h2, .inline-group h2 { + text-align: right +} + +.inline-related h3 span.delete { + padding-right: 20px; + padding-left: inherit; + left: 10px; + right: inherit; + float:left; +} + +.inline-related h3 span.delete label { + margin-left: inherit; + margin-right: 2px; +} + +/* IE7 specific bug fixes */ + +div.colM { + position: relative; +} + +.submit-row input { + float: left; +} diff --git a/static/admin/css/rtl.css.gz b/static/admin/css/rtl.css.gz new file mode 100644 index 0000000..ad82817 Binary files /dev/null and b/static/admin/css/rtl.css.gz differ diff --git a/static/admin/css/rtl.e024aaf6df25.css b/static/admin/css/rtl.e024aaf6df25.css new file mode 100644 index 0000000..8c1ceb4 --- /dev/null +++ b/static/admin/css/rtl.e024aaf6df25.css @@ -0,0 +1,256 @@ +body { + direction: rtl; +} + +/* LOGIN */ + +.login .form-row { + float: right; +} + +.login .form-row label { + float: right; + padding-left: 0.5em; + padding-right: 0; + text-align: left; +} + +.login .submit-row { + clear: both; + padding: 1em 9.4em 0 0; +} + +/* GLOBAL */ + +th { + text-align: right; +} + +.module h2, .module caption { + text-align: right; +} + +.module ul, .module ol { + margin-left: 0; + margin-right: 1.5em; +} + +.addlink, .changelink { + padding-left: 0; + padding-right: 16px; + background-position: 100% 1px; +} + +.deletelink { + padding-left: 0; + padding-right: 16px; + background-position: 100% 1px; +} + +.object-tools { + float: left; +} + +thead th:first-child, +tfoot td:first-child { + border-left: none; +} + +/* LAYOUT */ + +#user-tools { + right: auto; + left: 0; + text-align: left; +} + +div.breadcrumbs { + text-align: right; +} + +#content-main { + float: right; +} + +#content-related { + float: left; + margin-left: -300px; + margin-right: auto; +} + +.colMS { + margin-left: 300px; + margin-right: 0; +} + +/* SORTABLE TABLES */ + +table thead th.sorted .sortoptions { + float: left; +} + +thead th.sorted .text { + padding-right: 0; + padding-left: 42px; +} + +/* dashboard styles */ + +.dashboard .module table td a { + padding-left: .6em; + padding-right: 16px; +} + +/* changelists styles */ + +.change-list .filtered table { + border-left: none; + border-right: 0px none; +} + +#changelist-filter { + right: auto; + left: 0; + border-left: none; + border-right: none; +} + +.change-list .filtered .results, .change-list .filtered .paginator, .filtered #toolbar, .filtered div.xfull { + margin-right: 0; + margin-left: 280px; +} + +#changelist-filter li.selected { + border-left: none; + padding-left: 10px; + margin-left: 0; + border-right: 5px solid #eaeaea; + padding-right: 10px; + margin-right: -15px; +} + +.filtered .actions { + margin-left: 280px; + margin-right: 0; +} + +#changelist table tbody td:first-child, #changelist table tbody th:first-child { + border-right: none; + border-left: none; +} + +/* FORMS */ + +.aligned label { + padding: 0 0 3px 1em; + float: right; +} + +.submit-row { + text-align: left +} + +.submit-row p.deletelink-box { + float: right; +} + +.submit-row input.default { + margin-left: 0; +} + +.vDateField, .vTimeField { + margin-left: 2px; +} + +.aligned .form-row input { + margin-left: 5px; +} + +form ul.inline li { + float: right; + padding-right: 0; + padding-left: 7px; +} + +input[type=submit].default, .submit-row input.default { + float: left; +} + +fieldset .field-box { + float: right; + margin-left: 20px; + margin-right: 0; +} + +.errorlist li { + background-position: 100% 12px; + padding: 0; +} + +.errornote { + background-position: 100% 12px; + padding: 10px 12px; +} + +/* WIDGETS */ + +.calendarnav-previous { + top: 0; + left: auto; + right: 10px; +} + +.calendarnav-next { + top: 0; + right: auto; + left: 10px; +} + +.calendar caption, .calendarbox h2 { + text-align: center; +} + +.selector { + float: right; +} + +.selector .selector-filter { + text-align: right; +} + +.inline-deletelink { + float: left; +} + +form .form-row p.datetime { + overflow: hidden; +} + +/* MISC */ + +.inline-related h2, .inline-group h2 { + text-align: right +} + +.inline-related h3 span.delete { + padding-right: 20px; + padding-left: inherit; + left: 10px; + right: inherit; + float:left; +} + +.inline-related h3 span.delete label { + margin-left: inherit; + margin-right: 2px; +} + +/* IE7 specific bug fixes */ + +div.colM { + position: relative; +} + +.submit-row input { + float: left; +} diff --git a/static/admin/css/rtl.e024aaf6df25.css.gz b/static/admin/css/rtl.e024aaf6df25.css.gz new file mode 100644 index 0000000..ad82817 Binary files /dev/null and b/static/admin/css/rtl.e024aaf6df25.css.gz differ diff --git a/static/admin/css/widgets.a7251c097987.css b/static/admin/css/widgets.a7251c097987.css new file mode 100644 index 0000000..8bd64ce --- /dev/null +++ b/static/admin/css/widgets.a7251c097987.css @@ -0,0 +1,565 @@ +/* SELECTOR (FILTER INTERFACE) */ + +.selector { + width: 800px; + float: left; +} + +.selector select { + width: 380px; + height: 17.2em; +} + +.selector-available, .selector-chosen { + float: left; + width: 380px; + text-align: center; + margin-bottom: 5px; +} + +.selector-chosen select { + border-top: none; +} + +.selector-available h2, .selector-chosen h2 { + border: 1px solid #ccc; + border-radius: 4px 4px 0 0; +} + +.selector-chosen h2 { + background: #79aec8; + color: #fff; +} + +.selector .selector-available h2 { + background: #f8f8f8; + color: #666; +} + +.selector .selector-filter { + background: white; + border: 1px solid #ccc; + border-width: 0 1px; + padding: 8px; + color: #999; + font-size: 10px; + margin: 0; + text-align: left; +} + +.selector .selector-filter label, +.inline-group .aligned .selector .selector-filter label { + float: left; + margin: 7px 0 0; + width: 18px; + height: 18px; + padding: 0; + overflow: hidden; + line-height: 1; +} + +.selector .selector-available input { + width: 320px; + margin-left: 8px; +} + +.selector ul.selector-chooser { + float: left; + width: 22px; + background-color: #eee; + border-radius: 10px; + margin: 10em 5px 0 5px; + padding: 0; +} + +.selector-chooser li { + margin: 0; + padding: 3px; + list-style-type: none; +} + +.selector select { + padding: 0 10px; + margin: 0 0 10px; + border-radius: 0 0 4px 4px; +} + +.selector-add, .selector-remove { + width: 16px; + height: 16px; + display: block; + text-indent: -3000px; + overflow: hidden; + cursor: default; + opacity: 0.3; +} + +.active.selector-add, .active.selector-remove { + opacity: 1; +} + +.active.selector-add:hover, .active.selector-remove:hover { + cursor: pointer; +} + +.selector-add { + background: url("../img/selector-icons.b4555096cea2.svg") 0 -96px no-repeat; +} + +.active.selector-add:focus, .active.selector-add:hover { + background-position: 0 -112px; +} + +.selector-remove { + background: url("../img/selector-icons.b4555096cea2.svg") 0 -64px no-repeat; +} + +.active.selector-remove:focus, .active.selector-remove:hover { + background-position: 0 -80px; +} + +a.selector-chooseall, a.selector-clearall { + display: inline-block; + height: 16px; + text-align: left; + margin: 1px auto 3px; + overflow: hidden; + font-weight: bold; + line-height: 16px; + color: #666; + text-decoration: none; + opacity: 0.3; +} + +a.active.selector-chooseall:focus, a.active.selector-clearall:focus, +a.active.selector-chooseall:hover, a.active.selector-clearall:hover { + color: #447e9b; +} + +a.active.selector-chooseall, a.active.selector-clearall { + opacity: 1; +} + +a.active.selector-chooseall:hover, a.active.selector-clearall:hover { + cursor: pointer; +} + +a.selector-chooseall { + padding: 0 18px 0 0; + background: url("../img/selector-icons.b4555096cea2.svg") right -160px no-repeat; + cursor: default; +} + +a.active.selector-chooseall:focus, a.active.selector-chooseall:hover { + background-position: 100% -176px; +} + +a.selector-clearall { + padding: 0 0 0 18px; + background: url("../img/selector-icons.b4555096cea2.svg") 0 -128px no-repeat; + cursor: default; +} + +a.active.selector-clearall:focus, a.active.selector-clearall:hover { + background-position: 0 -144px; +} + +/* STACKED SELECTORS */ + +.stacked { + float: left; + width: 490px; +} + +.stacked select { + width: 480px; + height: 10.1em; +} + +.stacked .selector-available, .stacked .selector-chosen { + width: 480px; +} + +.stacked .selector-available { + margin-bottom: 0; +} + +.stacked .selector-available input { + width: 422px; +} + +.stacked ul.selector-chooser { + height: 22px; + width: 50px; + margin: 0 0 10px 40%; + background-color: #eee; + border-radius: 10px; +} + +.stacked .selector-chooser li { + float: left; + padding: 3px 3px 3px 5px; +} + +.stacked .selector-chooseall, .stacked .selector-clearall { + display: none; +} + +.stacked .selector-add { + background: url("../img/selector-icons.b4555096cea2.svg") 0 -32px no-repeat; + cursor: default; +} + +.stacked .active.selector-add { + background-position: 0 -48px; + cursor: pointer; +} + +.stacked .selector-remove { + background: url("../img/selector-icons.b4555096cea2.svg") 0 0 no-repeat; + cursor: default; +} + +.stacked .active.selector-remove { + background-position: 0 -16px; + cursor: pointer; +} + +.selector .help-icon { + background: url("../img/icon-unknown.a18cb4398978.svg") 0 0 no-repeat; + display: inline-block; + vertical-align: middle; + margin: -2px 0 0 2px; + width: 13px; + height: 13px; +} + +.selector .selector-chosen .help-icon { + background: url("../img/icon-unknown-alt.81536e128bb6.svg") 0 0 no-repeat; +} + +.selector .search-label-icon { + background: url("../img/search.7cf54ff789c6.svg") 0 0 no-repeat; + display: inline-block; + height: 18px; + width: 18px; +} + +/* DATE AND TIME */ + +p.datetime { + line-height: 20px; + margin: 0; + padding: 0; + color: #666; + font-weight: bold; +} + +.datetime span { + white-space: nowrap; + font-weight: normal; + font-size: 11px; + color: #ccc; +} + +.datetime input, .form-row .datetime input.vDateField, .form-row .datetime input.vTimeField { + min-width: 0; + margin-left: 5px; + margin-bottom: 4px; +} + +table p.datetime { + font-size: 11px; + margin-left: 0; + padding-left: 0; +} + +.datetimeshortcuts .clock-icon, .datetimeshortcuts .date-icon { + position: relative; + display: inline-block; + vertical-align: middle; + height: 16px; + width: 16px; + overflow: hidden; +} + +.datetimeshortcuts .clock-icon { + background: url("../img/icon-clock.e1d4dfac3f2b.svg") 0 0 no-repeat; +} + +.datetimeshortcuts a:focus .clock-icon, +.datetimeshortcuts a:hover .clock-icon { + background-position: 0 -16px; +} + +.datetimeshortcuts .date-icon { + background: url("../img/icon-calendar.ac7aea671bea.svg") 0 0 no-repeat; + top: -1px; +} + +.datetimeshortcuts a:focus .date-icon, +.datetimeshortcuts a:hover .date-icon { + background-position: 0 -16px; +} + +.timezonewarning { + font-size: 11px; + color: #999; +} + +/* URL */ + +p.url { + line-height: 20px; + margin: 0; + padding: 0; + color: #666; + font-size: 11px; + font-weight: bold; +} + +.url a { + font-weight: normal; +} + +/* FILE UPLOADS */ + +p.file-upload { + line-height: 20px; + margin: 0; + padding: 0; + color: #666; + font-size: 11px; + font-weight: bold; +} + +.aligned p.file-upload { + margin-left: 170px; +} + +.file-upload a { + font-weight: normal; +} + +.file-upload .deletelink { + margin-left: 5px; +} + +span.clearable-file-input label { + color: #333; + font-size: 11px; + display: inline; + float: none; +} + +/* CALENDARS & CLOCKS */ + +.calendarbox, .clockbox { + margin: 5px auto; + font-size: 12px; + width: 19em; + text-align: center; + background: white; + border: 1px solid #ddd; + border-radius: 4px; + box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15); + overflow: hidden; + position: relative; +} + +.clockbox { + width: auto; +} + +.calendar { + margin: 0; + padding: 0; +} + +.calendar table { + margin: 0; + padding: 0; + border-collapse: collapse; + background: white; + width: 100%; +} + +.calendar caption, .calendarbox h2 { + margin: 0; + text-align: center; + border-top: none; + background: #f5dd5d; + font-weight: 700; + font-size: 12px; + color: #333; +} + +.calendar th { + padding: 8px 5px; + background: #f8f8f8; + border-bottom: 1px solid #ddd; + font-weight: 400; + font-size: 12px; + text-align: center; + color: #666; +} + +.calendar td { + font-weight: 400; + font-size: 12px; + text-align: center; + padding: 0; + border-top: 1px solid #eee; + border-bottom: none; +} + +.calendar td.selected a { + background: #79aec8; + color: #fff; +} + +.calendar td.nonday { + background: #f8f8f8; +} + +.calendar td.today a { + font-weight: 700; +} + +.calendar td a, .timelist a { + display: block; + font-weight: 400; + padding: 6px; + text-decoration: none; + color: #444; +} + +.calendar td a:focus, .timelist a:focus, +.calendar td a:hover, .timelist a:hover { + background: #79aec8; + color: white; +} + +.calendar td a:active, .timelist a:active { + background: #417690; + color: white; +} + +.calendarnav { + font-size: 10px; + text-align: center; + color: #ccc; + margin: 0; + padding: 1px 3px; +} + +.calendarnav a:link, #calendarnav a:visited, +#calendarnav a:focus, #calendarnav a:hover { + color: #999; +} + +.calendar-shortcuts { + background: white; + font-size: 11px; + line-height: 11px; + border-top: 1px solid #eee; + padding: 8px 0; + color: #ccc; +} + +.calendarbox .calendarnav-previous, .calendarbox .calendarnav-next { + display: block; + position: absolute; + top: 8px; + width: 15px; + height: 15px; + text-indent: -9999px; + padding: 0; +} + +.calendarnav-previous { + left: 10px; + background: url("../img/calendar-icons.39b290681a8b.svg") 0 0 no-repeat; +} + +.calendarbox .calendarnav-previous:focus, +.calendarbox .calendarnav-previous:hover { + background-position: 0 -15px; +} + +.calendarnav-next { + right: 10px; + background: url("../img/calendar-icons.39b290681a8b.svg") 0 -30px no-repeat; +} + +.calendarbox .calendarnav-next:focus, +.calendarbox .calendarnav-next:hover { + background-position: 0 -45px; +} + +.calendar-cancel { + margin: 0; + padding: 4px 0; + font-size: 12px; + background: #eee; + border-top: 1px solid #ddd; + color: #333; +} + +.calendar-cancel:focus, .calendar-cancel:hover { + background: #ddd; +} + +.calendar-cancel a { + color: black; + display: block; +} + +ul.timelist, .timelist li { + list-style-type: none; + margin: 0; + padding: 0; +} + +.timelist a { + padding: 2px; +} + +/* EDIT INLINE */ + +.inline-deletelink { + float: right; + text-indent: -9999px; + background: url("../img/inline-delete.fec1b761f254.svg") 0 0 no-repeat; + width: 16px; + height: 16px; + border: 0px none; +} + +.inline-deletelink:focus, .inline-deletelink:hover { + cursor: pointer; +} + +/* RELATED WIDGET WRAPPER */ +.related-widget-wrapper { + float: left; /* display properly in form rows with multiple fields */ + overflow: hidden; /* clear floated contents */ +} + +.related-widget-wrapper-link { + opacity: 0.3; +} + +.related-widget-wrapper-link:link { + opacity: .8; +} + +.related-widget-wrapper-link:link:focus, +.related-widget-wrapper-link:link:hover { + opacity: 1; +} + +select + .related-widget-wrapper-link, +.related-widget-wrapper-link + .related-widget-wrapper-link { + margin-left: 7px; +} diff --git a/static/admin/css/widgets.a7251c097987.css.gz b/static/admin/css/widgets.a7251c097987.css.gz new file mode 100644 index 0000000..2e537a0 Binary files /dev/null and b/static/admin/css/widgets.a7251c097987.css.gz differ diff --git a/static/admin/css/widgets.css b/static/admin/css/widgets.css new file mode 100644 index 0000000..d3bd67a --- /dev/null +++ b/static/admin/css/widgets.css @@ -0,0 +1,565 @@ +/* SELECTOR (FILTER INTERFACE) */ + +.selector { + width: 800px; + float: left; +} + +.selector select { + width: 380px; + height: 17.2em; +} + +.selector-available, .selector-chosen { + float: left; + width: 380px; + text-align: center; + margin-bottom: 5px; +} + +.selector-chosen select { + border-top: none; +} + +.selector-available h2, .selector-chosen h2 { + border: 1px solid #ccc; + border-radius: 4px 4px 0 0; +} + +.selector-chosen h2 { + background: #79aec8; + color: #fff; +} + +.selector .selector-available h2 { + background: #f8f8f8; + color: #666; +} + +.selector .selector-filter { + background: white; + border: 1px solid #ccc; + border-width: 0 1px; + padding: 8px; + color: #999; + font-size: 10px; + margin: 0; + text-align: left; +} + +.selector .selector-filter label, +.inline-group .aligned .selector .selector-filter label { + float: left; + margin: 7px 0 0; + width: 18px; + height: 18px; + padding: 0; + overflow: hidden; + line-height: 1; +} + +.selector .selector-available input { + width: 320px; + margin-left: 8px; +} + +.selector ul.selector-chooser { + float: left; + width: 22px; + background-color: #eee; + border-radius: 10px; + margin: 10em 5px 0 5px; + padding: 0; +} + +.selector-chooser li { + margin: 0; + padding: 3px; + list-style-type: none; +} + +.selector select { + padding: 0 10px; + margin: 0 0 10px; + border-radius: 0 0 4px 4px; +} + +.selector-add, .selector-remove { + width: 16px; + height: 16px; + display: block; + text-indent: -3000px; + overflow: hidden; + cursor: default; + opacity: 0.3; +} + +.active.selector-add, .active.selector-remove { + opacity: 1; +} + +.active.selector-add:hover, .active.selector-remove:hover { + cursor: pointer; +} + +.selector-add { + background: url(../img/selector-icons.svg) 0 -96px no-repeat; +} + +.active.selector-add:focus, .active.selector-add:hover { + background-position: 0 -112px; +} + +.selector-remove { + background: url(../img/selector-icons.svg) 0 -64px no-repeat; +} + +.active.selector-remove:focus, .active.selector-remove:hover { + background-position: 0 -80px; +} + +a.selector-chooseall, a.selector-clearall { + display: inline-block; + height: 16px; + text-align: left; + margin: 1px auto 3px; + overflow: hidden; + font-weight: bold; + line-height: 16px; + color: #666; + text-decoration: none; + opacity: 0.3; +} + +a.active.selector-chooseall:focus, a.active.selector-clearall:focus, +a.active.selector-chooseall:hover, a.active.selector-clearall:hover { + color: #447e9b; +} + +a.active.selector-chooseall, a.active.selector-clearall { + opacity: 1; +} + +a.active.selector-chooseall:hover, a.active.selector-clearall:hover { + cursor: pointer; +} + +a.selector-chooseall { + padding: 0 18px 0 0; + background: url(../img/selector-icons.svg) right -160px no-repeat; + cursor: default; +} + +a.active.selector-chooseall:focus, a.active.selector-chooseall:hover { + background-position: 100% -176px; +} + +a.selector-clearall { + padding: 0 0 0 18px; + background: url(../img/selector-icons.svg) 0 -128px no-repeat; + cursor: default; +} + +a.active.selector-clearall:focus, a.active.selector-clearall:hover { + background-position: 0 -144px; +} + +/* STACKED SELECTORS */ + +.stacked { + float: left; + width: 490px; +} + +.stacked select { + width: 480px; + height: 10.1em; +} + +.stacked .selector-available, .stacked .selector-chosen { + width: 480px; +} + +.stacked .selector-available { + margin-bottom: 0; +} + +.stacked .selector-available input { + width: 422px; +} + +.stacked ul.selector-chooser { + height: 22px; + width: 50px; + margin: 0 0 10px 40%; + background-color: #eee; + border-radius: 10px; +} + +.stacked .selector-chooser li { + float: left; + padding: 3px 3px 3px 5px; +} + +.stacked .selector-chooseall, .stacked .selector-clearall { + display: none; +} + +.stacked .selector-add { + background: url(../img/selector-icons.svg) 0 -32px no-repeat; + cursor: default; +} + +.stacked .active.selector-add { + background-position: 0 -48px; + cursor: pointer; +} + +.stacked .selector-remove { + background: url(../img/selector-icons.svg) 0 0 no-repeat; + cursor: default; +} + +.stacked .active.selector-remove { + background-position: 0 -16px; + cursor: pointer; +} + +.selector .help-icon { + background: url(../img/icon-unknown.svg) 0 0 no-repeat; + display: inline-block; + vertical-align: middle; + margin: -2px 0 0 2px; + width: 13px; + height: 13px; +} + +.selector .selector-chosen .help-icon { + background: url(../img/icon-unknown-alt.svg) 0 0 no-repeat; +} + +.selector .search-label-icon { + background: url(../img/search.svg) 0 0 no-repeat; + display: inline-block; + height: 18px; + width: 18px; +} + +/* DATE AND TIME */ + +p.datetime { + line-height: 20px; + margin: 0; + padding: 0; + color: #666; + font-weight: bold; +} + +.datetime span { + white-space: nowrap; + font-weight: normal; + font-size: 11px; + color: #ccc; +} + +.datetime input, .form-row .datetime input.vDateField, .form-row .datetime input.vTimeField { + min-width: 0; + margin-left: 5px; + margin-bottom: 4px; +} + +table p.datetime { + font-size: 11px; + margin-left: 0; + padding-left: 0; +} + +.datetimeshortcuts .clock-icon, .datetimeshortcuts .date-icon { + position: relative; + display: inline-block; + vertical-align: middle; + height: 16px; + width: 16px; + overflow: hidden; +} + +.datetimeshortcuts .clock-icon { + background: url(../img/icon-clock.svg) 0 0 no-repeat; +} + +.datetimeshortcuts a:focus .clock-icon, +.datetimeshortcuts a:hover .clock-icon { + background-position: 0 -16px; +} + +.datetimeshortcuts .date-icon { + background: url(../img/icon-calendar.svg) 0 0 no-repeat; + top: -1px; +} + +.datetimeshortcuts a:focus .date-icon, +.datetimeshortcuts a:hover .date-icon { + background-position: 0 -16px; +} + +.timezonewarning { + font-size: 11px; + color: #999; +} + +/* URL */ + +p.url { + line-height: 20px; + margin: 0; + padding: 0; + color: #666; + font-size: 11px; + font-weight: bold; +} + +.url a { + font-weight: normal; +} + +/* FILE UPLOADS */ + +p.file-upload { + line-height: 20px; + margin: 0; + padding: 0; + color: #666; + font-size: 11px; + font-weight: bold; +} + +.aligned p.file-upload { + margin-left: 170px; +} + +.file-upload a { + font-weight: normal; +} + +.file-upload .deletelink { + margin-left: 5px; +} + +span.clearable-file-input label { + color: #333; + font-size: 11px; + display: inline; + float: none; +} + +/* CALENDARS & CLOCKS */ + +.calendarbox, .clockbox { + margin: 5px auto; + font-size: 12px; + width: 19em; + text-align: center; + background: white; + border: 1px solid #ddd; + border-radius: 4px; + box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15); + overflow: hidden; + position: relative; +} + +.clockbox { + width: auto; +} + +.calendar { + margin: 0; + padding: 0; +} + +.calendar table { + margin: 0; + padding: 0; + border-collapse: collapse; + background: white; + width: 100%; +} + +.calendar caption, .calendarbox h2 { + margin: 0; + text-align: center; + border-top: none; + background: #f5dd5d; + font-weight: 700; + font-size: 12px; + color: #333; +} + +.calendar th { + padding: 8px 5px; + background: #f8f8f8; + border-bottom: 1px solid #ddd; + font-weight: 400; + font-size: 12px; + text-align: center; + color: #666; +} + +.calendar td { + font-weight: 400; + font-size: 12px; + text-align: center; + padding: 0; + border-top: 1px solid #eee; + border-bottom: none; +} + +.calendar td.selected a { + background: #79aec8; + color: #fff; +} + +.calendar td.nonday { + background: #f8f8f8; +} + +.calendar td.today a { + font-weight: 700; +} + +.calendar td a, .timelist a { + display: block; + font-weight: 400; + padding: 6px; + text-decoration: none; + color: #444; +} + +.calendar td a:focus, .timelist a:focus, +.calendar td a:hover, .timelist a:hover { + background: #79aec8; + color: white; +} + +.calendar td a:active, .timelist a:active { + background: #417690; + color: white; +} + +.calendarnav { + font-size: 10px; + text-align: center; + color: #ccc; + margin: 0; + padding: 1px 3px; +} + +.calendarnav a:link, #calendarnav a:visited, +#calendarnav a:focus, #calendarnav a:hover { + color: #999; +} + +.calendar-shortcuts { + background: white; + font-size: 11px; + line-height: 11px; + border-top: 1px solid #eee; + padding: 8px 0; + color: #ccc; +} + +.calendarbox .calendarnav-previous, .calendarbox .calendarnav-next { + display: block; + position: absolute; + top: 8px; + width: 15px; + height: 15px; + text-indent: -9999px; + padding: 0; +} + +.calendarnav-previous { + left: 10px; + background: url(../img/calendar-icons.svg) 0 0 no-repeat; +} + +.calendarbox .calendarnav-previous:focus, +.calendarbox .calendarnav-previous:hover { + background-position: 0 -15px; +} + +.calendarnav-next { + right: 10px; + background: url(../img/calendar-icons.svg) 0 -30px no-repeat; +} + +.calendarbox .calendarnav-next:focus, +.calendarbox .calendarnav-next:hover { + background-position: 0 -45px; +} + +.calendar-cancel { + margin: 0; + padding: 4px 0; + font-size: 12px; + background: #eee; + border-top: 1px solid #ddd; + color: #333; +} + +.calendar-cancel:focus, .calendar-cancel:hover { + background: #ddd; +} + +.calendar-cancel a { + color: black; + display: block; +} + +ul.timelist, .timelist li { + list-style-type: none; + margin: 0; + padding: 0; +} + +.timelist a { + padding: 2px; +} + +/* EDIT INLINE */ + +.inline-deletelink { + float: right; + text-indent: -9999px; + background: url(../img/inline-delete.svg) 0 0 no-repeat; + width: 16px; + height: 16px; + border: 0px none; +} + +.inline-deletelink:focus, .inline-deletelink:hover { + cursor: pointer; +} + +/* RELATED WIDGET WRAPPER */ +.related-widget-wrapper { + float: left; /* display properly in form rows with multiple fields */ + overflow: hidden; /* clear floated contents */ +} + +.related-widget-wrapper-link { + opacity: 0.3; +} + +.related-widget-wrapper-link:link { + opacity: .8; +} + +.related-widget-wrapper-link:link:focus, +.related-widget-wrapper-link:link:hover { + opacity: 1; +} + +select + .related-widget-wrapper-link, +.related-widget-wrapper-link + .related-widget-wrapper-link { + margin-left: 7px; +} diff --git a/static/admin/css/widgets.css.gz b/static/admin/css/widgets.css.gz new file mode 100644 index 0000000..f5a2f01 Binary files /dev/null and b/static/admin/css/widgets.css.gz differ diff --git a/static/admin/fonts/LICENSE.d273d63619c9.txt b/static/admin/fonts/LICENSE.d273d63619c9.txt new file mode 100644 index 0000000..75b5248 --- /dev/null +++ b/static/admin/fonts/LICENSE.d273d63619c9.txt @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/static/admin/fonts/LICENSE.d273d63619c9.txt.gz b/static/admin/fonts/LICENSE.d273d63619c9.txt.gz new file mode 100644 index 0000000..d3fd592 Binary files /dev/null and b/static/admin/fonts/LICENSE.d273d63619c9.txt.gz differ diff --git a/static/admin/fonts/LICENSE.txt b/static/admin/fonts/LICENSE.txt new file mode 100644 index 0000000..75b5248 --- /dev/null +++ b/static/admin/fonts/LICENSE.txt @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/static/admin/fonts/LICENSE.txt.gz b/static/admin/fonts/LICENSE.txt.gz new file mode 100644 index 0000000..d3fd592 Binary files /dev/null and b/static/admin/fonts/LICENSE.txt.gz differ diff --git a/static/admin/fonts/README.2c3d0bcdede2.txt b/static/admin/fonts/README.2c3d0bcdede2.txt new file mode 100644 index 0000000..cc2135a --- /dev/null +++ b/static/admin/fonts/README.2c3d0bcdede2.txt @@ -0,0 +1,2 @@ +Roboto webfont source: https://www.google.com/fonts/specimen/Roboto +Weights used in this project: Light (300), Regular (400), Bold (700) diff --git a/static/admin/fonts/README.txt b/static/admin/fonts/README.txt new file mode 100644 index 0000000..cc2135a --- /dev/null +++ b/static/admin/fonts/README.txt @@ -0,0 +1,2 @@ +Roboto webfont source: https://www.google.com/fonts/specimen/Roboto +Weights used in this project: Light (300), Regular (400), Bold (700) diff --git a/static/admin/fonts/Roboto-Bold-webfont.2ad99072841e.woff b/static/admin/fonts/Roboto-Bold-webfont.2ad99072841e.woff new file mode 100644 index 0000000..03357ce Binary files /dev/null and b/static/admin/fonts/Roboto-Bold-webfont.2ad99072841e.woff differ diff --git a/static/admin/fonts/Roboto-Bold-webfont.woff b/static/admin/fonts/Roboto-Bold-webfont.woff new file mode 100644 index 0000000..03357ce Binary files /dev/null and b/static/admin/fonts/Roboto-Bold-webfont.woff differ diff --git a/static/admin/fonts/Roboto-Light-webfont.b446c2399bb6.woff b/static/admin/fonts/Roboto-Light-webfont.b446c2399bb6.woff new file mode 100644 index 0000000..f6abd87 Binary files /dev/null and b/static/admin/fonts/Roboto-Light-webfont.b446c2399bb6.woff differ diff --git a/static/admin/fonts/Roboto-Light-webfont.woff b/static/admin/fonts/Roboto-Light-webfont.woff new file mode 100644 index 0000000..f6abd87 Binary files /dev/null and b/static/admin/fonts/Roboto-Light-webfont.woff differ diff --git a/static/admin/fonts/Roboto-Regular-webfont.ec39515ae8c6.woff b/static/admin/fonts/Roboto-Regular-webfont.ec39515ae8c6.woff new file mode 100644 index 0000000..6ff6afd Binary files /dev/null and b/static/admin/fonts/Roboto-Regular-webfont.ec39515ae8c6.woff differ diff --git a/static/admin/fonts/Roboto-Regular-webfont.woff b/static/admin/fonts/Roboto-Regular-webfont.woff new file mode 100644 index 0000000..6ff6afd Binary files /dev/null and b/static/admin/fonts/Roboto-Regular-webfont.woff differ diff --git a/static/admin/img/LICENSE b/static/admin/img/LICENSE new file mode 100644 index 0000000..a4faaa1 --- /dev/null +++ b/static/admin/img/LICENSE @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright (c) 2014 Code Charm Ltd + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/static/admin/img/LICENSE.2c54f4e1ca1c b/static/admin/img/LICENSE.2c54f4e1ca1c new file mode 100644 index 0000000..a4faaa1 --- /dev/null +++ b/static/admin/img/LICENSE.2c54f4e1ca1c @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright (c) 2014 Code Charm Ltd + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/static/admin/img/LICENSE.2c54f4e1ca1c.gz b/static/admin/img/LICENSE.2c54f4e1ca1c.gz new file mode 100644 index 0000000..9306e29 Binary files /dev/null and b/static/admin/img/LICENSE.2c54f4e1ca1c.gz differ diff --git a/static/admin/img/LICENSE.gz b/static/admin/img/LICENSE.gz new file mode 100644 index 0000000..9306e29 Binary files /dev/null and b/static/admin/img/LICENSE.gz differ diff --git a/static/admin/img/README.837277fa1908.txt b/static/admin/img/README.837277fa1908.txt new file mode 100644 index 0000000..43373ad --- /dev/null +++ b/static/admin/img/README.837277fa1908.txt @@ -0,0 +1,7 @@ +All icons are taken from Font Awesome (http://fontawesome.io/) project. +The Font Awesome font is licensed under the SIL OFL 1.1: +- http://scripts.sil.org/OFL + +SVG icons source: https://github.com/encharm/Font-Awesome-SVG-PNG +Font-Awesome-SVG-PNG is licensed under the MIT license (see file license +in current folder). diff --git a/static/admin/img/README.837277fa1908.txt.gz b/static/admin/img/README.837277fa1908.txt.gz new file mode 100644 index 0000000..43182c7 Binary files /dev/null and b/static/admin/img/README.837277fa1908.txt.gz differ diff --git a/static/admin/img/README.txt b/static/admin/img/README.txt new file mode 100644 index 0000000..43373ad --- /dev/null +++ b/static/admin/img/README.txt @@ -0,0 +1,7 @@ +All icons are taken from Font Awesome (http://fontawesome.io/) project. +The Font Awesome font is licensed under the SIL OFL 1.1: +- http://scripts.sil.org/OFL + +SVG icons source: https://github.com/encharm/Font-Awesome-SVG-PNG +Font-Awesome-SVG-PNG is licensed under the MIT license (see file license +in current folder). diff --git a/static/admin/img/README.txt.gz b/static/admin/img/README.txt.gz new file mode 100644 index 0000000..43182c7 Binary files /dev/null and b/static/admin/img/README.txt.gz differ diff --git a/static/admin/img/calendar-icons.39b290681a8b.svg b/static/admin/img/calendar-icons.39b290681a8b.svg new file mode 100644 index 0000000..dbf21c3 --- /dev/null +++ b/static/admin/img/calendar-icons.39b290681a8b.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/static/admin/img/calendar-icons.39b290681a8b.svg.gz b/static/admin/img/calendar-icons.39b290681a8b.svg.gz new file mode 100644 index 0000000..bef7ce1 Binary files /dev/null and b/static/admin/img/calendar-icons.39b290681a8b.svg.gz differ diff --git a/static/admin/img/calendar-icons.svg b/static/admin/img/calendar-icons.svg new file mode 100644 index 0000000..dbf21c3 --- /dev/null +++ b/static/admin/img/calendar-icons.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/static/admin/img/calendar-icons.svg.gz b/static/admin/img/calendar-icons.svg.gz new file mode 100644 index 0000000..bef7ce1 Binary files /dev/null and b/static/admin/img/calendar-icons.svg.gz differ diff --git a/static/admin/img/gis/move_vertex_off.7a23bf31ef8a.svg b/static/admin/img/gis/move_vertex_off.7a23bf31ef8a.svg new file mode 100644 index 0000000..228854f --- /dev/null +++ b/static/admin/img/gis/move_vertex_off.7a23bf31ef8a.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/static/admin/img/gis/move_vertex_off.7a23bf31ef8a.svg.gz b/static/admin/img/gis/move_vertex_off.7a23bf31ef8a.svg.gz new file mode 100644 index 0000000..f17ecfb Binary files /dev/null and b/static/admin/img/gis/move_vertex_off.7a23bf31ef8a.svg.gz differ diff --git a/static/admin/img/gis/move_vertex_off.svg b/static/admin/img/gis/move_vertex_off.svg new file mode 100644 index 0000000..228854f --- /dev/null +++ b/static/admin/img/gis/move_vertex_off.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/static/admin/img/gis/move_vertex_off.svg.gz b/static/admin/img/gis/move_vertex_off.svg.gz new file mode 100644 index 0000000..f17ecfb Binary files /dev/null and b/static/admin/img/gis/move_vertex_off.svg.gz differ diff --git a/static/admin/img/gis/move_vertex_on.0047eba25b67.svg b/static/admin/img/gis/move_vertex_on.0047eba25b67.svg new file mode 100644 index 0000000..96b87fd --- /dev/null +++ b/static/admin/img/gis/move_vertex_on.0047eba25b67.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/static/admin/img/gis/move_vertex_on.0047eba25b67.svg.gz b/static/admin/img/gis/move_vertex_on.0047eba25b67.svg.gz new file mode 100644 index 0000000..8047dfd Binary files /dev/null and b/static/admin/img/gis/move_vertex_on.0047eba25b67.svg.gz differ diff --git a/static/admin/img/gis/move_vertex_on.svg b/static/admin/img/gis/move_vertex_on.svg new file mode 100644 index 0000000..96b87fd --- /dev/null +++ b/static/admin/img/gis/move_vertex_on.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/static/admin/img/gis/move_vertex_on.svg.gz b/static/admin/img/gis/move_vertex_on.svg.gz new file mode 100644 index 0000000..8047dfd Binary files /dev/null and b/static/admin/img/gis/move_vertex_on.svg.gz differ diff --git a/static/admin/img/icon-addlink.d519b3bab011.svg b/static/admin/img/icon-addlink.d519b3bab011.svg new file mode 100644 index 0000000..e004fb1 --- /dev/null +++ b/static/admin/img/icon-addlink.d519b3bab011.svg @@ -0,0 +1,3 @@ + + + diff --git a/static/admin/img/icon-addlink.d519b3bab011.svg.gz b/static/admin/img/icon-addlink.d519b3bab011.svg.gz new file mode 100644 index 0000000..81cea0d Binary files /dev/null and b/static/admin/img/icon-addlink.d519b3bab011.svg.gz differ diff --git a/static/admin/img/icon-addlink.svg b/static/admin/img/icon-addlink.svg new file mode 100644 index 0000000..e004fb1 --- /dev/null +++ b/static/admin/img/icon-addlink.svg @@ -0,0 +1,3 @@ + + + diff --git a/static/admin/img/icon-addlink.svg.gz b/static/admin/img/icon-addlink.svg.gz new file mode 100644 index 0000000..81cea0d Binary files /dev/null and b/static/admin/img/icon-addlink.svg.gz differ diff --git a/static/admin/img/icon-alert.034cc7d8a67f.svg b/static/admin/img/icon-alert.034cc7d8a67f.svg new file mode 100644 index 0000000..e51ea83 --- /dev/null +++ b/static/admin/img/icon-alert.034cc7d8a67f.svg @@ -0,0 +1,3 @@ + + + diff --git a/static/admin/img/icon-alert.034cc7d8a67f.svg.gz b/static/admin/img/icon-alert.034cc7d8a67f.svg.gz new file mode 100644 index 0000000..a7e64ac Binary files /dev/null and b/static/admin/img/icon-alert.034cc7d8a67f.svg.gz differ diff --git a/static/admin/img/icon-alert.svg b/static/admin/img/icon-alert.svg new file mode 100644 index 0000000..e51ea83 --- /dev/null +++ b/static/admin/img/icon-alert.svg @@ -0,0 +1,3 @@ + + + diff --git a/static/admin/img/icon-alert.svg.gz b/static/admin/img/icon-alert.svg.gz new file mode 100644 index 0000000..a7e64ac Binary files /dev/null and b/static/admin/img/icon-alert.svg.gz differ diff --git a/static/admin/img/icon-calendar.ac7aea671bea.svg b/static/admin/img/icon-calendar.ac7aea671bea.svg new file mode 100644 index 0000000..97910a9 --- /dev/null +++ b/static/admin/img/icon-calendar.ac7aea671bea.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/static/admin/img/icon-calendar.ac7aea671bea.svg.gz b/static/admin/img/icon-calendar.ac7aea671bea.svg.gz new file mode 100644 index 0000000..18b5080 Binary files /dev/null and b/static/admin/img/icon-calendar.ac7aea671bea.svg.gz differ diff --git a/static/admin/img/icon-calendar.svg b/static/admin/img/icon-calendar.svg new file mode 100644 index 0000000..97910a9 --- /dev/null +++ b/static/admin/img/icon-calendar.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/static/admin/img/icon-calendar.svg.gz b/static/admin/img/icon-calendar.svg.gz new file mode 100644 index 0000000..18b5080 Binary files /dev/null and b/static/admin/img/icon-calendar.svg.gz differ diff --git a/static/admin/img/icon-changelink.18d2fd706348.svg b/static/admin/img/icon-changelink.18d2fd706348.svg new file mode 100644 index 0000000..bbb137a --- /dev/null +++ b/static/admin/img/icon-changelink.18d2fd706348.svg @@ -0,0 +1,3 @@ + + + diff --git a/static/admin/img/icon-changelink.18d2fd706348.svg.gz b/static/admin/img/icon-changelink.18d2fd706348.svg.gz new file mode 100644 index 0000000..48960ff Binary files /dev/null and b/static/admin/img/icon-changelink.18d2fd706348.svg.gz differ diff --git a/static/admin/img/icon-changelink.svg b/static/admin/img/icon-changelink.svg new file mode 100644 index 0000000..bbb137a --- /dev/null +++ b/static/admin/img/icon-changelink.svg @@ -0,0 +1,3 @@ + + + diff --git a/static/admin/img/icon-changelink.svg.gz b/static/admin/img/icon-changelink.svg.gz new file mode 100644 index 0000000..48960ff Binary files /dev/null and b/static/admin/img/icon-changelink.svg.gz differ diff --git a/static/admin/img/icon-clock.e1d4dfac3f2b.svg b/static/admin/img/icon-clock.e1d4dfac3f2b.svg new file mode 100644 index 0000000..bf9985d --- /dev/null +++ b/static/admin/img/icon-clock.e1d4dfac3f2b.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/static/admin/img/icon-clock.e1d4dfac3f2b.svg.gz b/static/admin/img/icon-clock.e1d4dfac3f2b.svg.gz new file mode 100644 index 0000000..c21e7e7 Binary files /dev/null and b/static/admin/img/icon-clock.e1d4dfac3f2b.svg.gz differ diff --git a/static/admin/img/icon-clock.svg b/static/admin/img/icon-clock.svg new file mode 100644 index 0000000..bf9985d --- /dev/null +++ b/static/admin/img/icon-clock.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/static/admin/img/icon-clock.svg.gz b/static/admin/img/icon-clock.svg.gz new file mode 100644 index 0000000..c21e7e7 Binary files /dev/null and b/static/admin/img/icon-clock.svg.gz differ diff --git a/static/admin/img/icon-deletelink.564ef9dc3854.svg b/static/admin/img/icon-deletelink.564ef9dc3854.svg new file mode 100644 index 0000000..4059b15 --- /dev/null +++ b/static/admin/img/icon-deletelink.564ef9dc3854.svg @@ -0,0 +1,3 @@ + + + diff --git a/static/admin/img/icon-deletelink.564ef9dc3854.svg.gz b/static/admin/img/icon-deletelink.564ef9dc3854.svg.gz new file mode 100644 index 0000000..4b93e9f Binary files /dev/null and b/static/admin/img/icon-deletelink.564ef9dc3854.svg.gz differ diff --git a/static/admin/img/icon-deletelink.svg b/static/admin/img/icon-deletelink.svg new file mode 100644 index 0000000..4059b15 --- /dev/null +++ b/static/admin/img/icon-deletelink.svg @@ -0,0 +1,3 @@ + + + diff --git a/static/admin/img/icon-deletelink.svg.gz b/static/admin/img/icon-deletelink.svg.gz new file mode 100644 index 0000000..4b93e9f Binary files /dev/null and b/static/admin/img/icon-deletelink.svg.gz differ diff --git a/static/admin/img/icon-no.439e821418cd.svg b/static/admin/img/icon-no.439e821418cd.svg new file mode 100644 index 0000000..2e0d383 --- /dev/null +++ b/static/admin/img/icon-no.439e821418cd.svg @@ -0,0 +1,3 @@ + + + diff --git a/static/admin/img/icon-no.439e821418cd.svg.gz b/static/admin/img/icon-no.439e821418cd.svg.gz new file mode 100644 index 0000000..251b7df Binary files /dev/null and b/static/admin/img/icon-no.439e821418cd.svg.gz differ diff --git a/static/admin/img/icon-no.svg b/static/admin/img/icon-no.svg new file mode 100644 index 0000000..2e0d383 --- /dev/null +++ b/static/admin/img/icon-no.svg @@ -0,0 +1,3 @@ + + + diff --git a/static/admin/img/icon-no.svg.gz b/static/admin/img/icon-no.svg.gz new file mode 100644 index 0000000..251b7df Binary files /dev/null and b/static/admin/img/icon-no.svg.gz differ diff --git a/static/admin/img/icon-unknown-alt.81536e128bb6.svg b/static/admin/img/icon-unknown-alt.81536e128bb6.svg new file mode 100644 index 0000000..1c6b99f --- /dev/null +++ b/static/admin/img/icon-unknown-alt.81536e128bb6.svg @@ -0,0 +1,3 @@ + + + diff --git a/static/admin/img/icon-unknown-alt.81536e128bb6.svg.gz b/static/admin/img/icon-unknown-alt.81536e128bb6.svg.gz new file mode 100644 index 0000000..3f254ad Binary files /dev/null and b/static/admin/img/icon-unknown-alt.81536e128bb6.svg.gz differ diff --git a/static/admin/img/icon-unknown-alt.svg b/static/admin/img/icon-unknown-alt.svg new file mode 100644 index 0000000..1c6b99f --- /dev/null +++ b/static/admin/img/icon-unknown-alt.svg @@ -0,0 +1,3 @@ + + + diff --git a/static/admin/img/icon-unknown-alt.svg.gz b/static/admin/img/icon-unknown-alt.svg.gz new file mode 100644 index 0000000..3f254ad Binary files /dev/null and b/static/admin/img/icon-unknown-alt.svg.gz differ diff --git a/static/admin/img/icon-unknown.a18cb4398978.svg b/static/admin/img/icon-unknown.a18cb4398978.svg new file mode 100644 index 0000000..50b4f97 --- /dev/null +++ b/static/admin/img/icon-unknown.a18cb4398978.svg @@ -0,0 +1,3 @@ + + + diff --git a/static/admin/img/icon-unknown.a18cb4398978.svg.gz b/static/admin/img/icon-unknown.a18cb4398978.svg.gz new file mode 100644 index 0000000..5710ee7 Binary files /dev/null and b/static/admin/img/icon-unknown.a18cb4398978.svg.gz differ diff --git a/static/admin/img/icon-unknown.svg b/static/admin/img/icon-unknown.svg new file mode 100644 index 0000000..50b4f97 --- /dev/null +++ b/static/admin/img/icon-unknown.svg @@ -0,0 +1,3 @@ + + + diff --git a/static/admin/img/icon-unknown.svg.gz b/static/admin/img/icon-unknown.svg.gz new file mode 100644 index 0000000..5710ee7 Binary files /dev/null and b/static/admin/img/icon-unknown.svg.gz differ diff --git a/static/admin/img/icon-yes.d2f9f035226a.svg b/static/admin/img/icon-yes.d2f9f035226a.svg new file mode 100644 index 0000000..5883d87 --- /dev/null +++ b/static/admin/img/icon-yes.d2f9f035226a.svg @@ -0,0 +1,3 @@ + + + diff --git a/static/admin/img/icon-yes.d2f9f035226a.svg.gz b/static/admin/img/icon-yes.d2f9f035226a.svg.gz new file mode 100644 index 0000000..c35e8df Binary files /dev/null and b/static/admin/img/icon-yes.d2f9f035226a.svg.gz differ diff --git a/static/admin/img/icon-yes.svg b/static/admin/img/icon-yes.svg new file mode 100644 index 0000000..5883d87 --- /dev/null +++ b/static/admin/img/icon-yes.svg @@ -0,0 +1,3 @@ + + + diff --git a/static/admin/img/icon-yes.svg.gz b/static/admin/img/icon-yes.svg.gz new file mode 100644 index 0000000..c35e8df Binary files /dev/null and b/static/admin/img/icon-yes.svg.gz differ diff --git a/static/admin/img/inline-delete.fec1b761f254.svg b/static/admin/img/inline-delete.fec1b761f254.svg new file mode 100644 index 0000000..17d1ad6 --- /dev/null +++ b/static/admin/img/inline-delete.fec1b761f254.svg @@ -0,0 +1,3 @@ + + + diff --git a/static/admin/img/inline-delete.fec1b761f254.svg.gz b/static/admin/img/inline-delete.fec1b761f254.svg.gz new file mode 100644 index 0000000..75f97b7 Binary files /dev/null and b/static/admin/img/inline-delete.fec1b761f254.svg.gz differ diff --git a/static/admin/img/inline-delete.svg b/static/admin/img/inline-delete.svg new file mode 100644 index 0000000..17d1ad6 --- /dev/null +++ b/static/admin/img/inline-delete.svg @@ -0,0 +1,3 @@ + + + diff --git a/static/admin/img/inline-delete.svg.gz b/static/admin/img/inline-delete.svg.gz new file mode 100644 index 0000000..75f97b7 Binary files /dev/null and b/static/admin/img/inline-delete.svg.gz differ diff --git a/static/admin/img/search.7cf54ff789c6.svg b/static/admin/img/search.7cf54ff789c6.svg new file mode 100644 index 0000000..c8c69b2 --- /dev/null +++ b/static/admin/img/search.7cf54ff789c6.svg @@ -0,0 +1,3 @@ + + + diff --git a/static/admin/img/search.7cf54ff789c6.svg.gz b/static/admin/img/search.7cf54ff789c6.svg.gz new file mode 100644 index 0000000..28c49b8 Binary files /dev/null and b/static/admin/img/search.7cf54ff789c6.svg.gz differ diff --git a/static/admin/img/search.svg b/static/admin/img/search.svg new file mode 100644 index 0000000..c8c69b2 --- /dev/null +++ b/static/admin/img/search.svg @@ -0,0 +1,3 @@ + + + diff --git a/static/admin/img/search.svg.gz b/static/admin/img/search.svg.gz new file mode 100644 index 0000000..28c49b8 Binary files /dev/null and b/static/admin/img/search.svg.gz differ diff --git a/static/admin/img/selector-icons.b4555096cea2.svg b/static/admin/img/selector-icons.b4555096cea2.svg new file mode 100644 index 0000000..926b8e2 --- /dev/null +++ b/static/admin/img/selector-icons.b4555096cea2.svg @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/static/admin/img/selector-icons.b4555096cea2.svg.gz b/static/admin/img/selector-icons.b4555096cea2.svg.gz new file mode 100644 index 0000000..99fe621 Binary files /dev/null and b/static/admin/img/selector-icons.b4555096cea2.svg.gz differ diff --git a/static/admin/img/selector-icons.svg b/static/admin/img/selector-icons.svg new file mode 100644 index 0000000..926b8e2 --- /dev/null +++ b/static/admin/img/selector-icons.svg @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/static/admin/img/selector-icons.svg.gz b/static/admin/img/selector-icons.svg.gz new file mode 100644 index 0000000..99fe621 Binary files /dev/null and b/static/admin/img/selector-icons.svg.gz differ diff --git a/static/admin/img/sorting-icons.3a097b59f104.svg b/static/admin/img/sorting-icons.3a097b59f104.svg new file mode 100644 index 0000000..7c31ec9 --- /dev/null +++ b/static/admin/img/sorting-icons.3a097b59f104.svg @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/static/admin/img/sorting-icons.3a097b59f104.svg.gz b/static/admin/img/sorting-icons.3a097b59f104.svg.gz new file mode 100644 index 0000000..f5a302d Binary files /dev/null and b/static/admin/img/sorting-icons.3a097b59f104.svg.gz differ diff --git a/static/admin/img/sorting-icons.svg b/static/admin/img/sorting-icons.svg new file mode 100644 index 0000000..7c31ec9 --- /dev/null +++ b/static/admin/img/sorting-icons.svg @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/static/admin/img/sorting-icons.svg.gz b/static/admin/img/sorting-icons.svg.gz new file mode 100644 index 0000000..f5a302d Binary files /dev/null and b/static/admin/img/sorting-icons.svg.gz differ diff --git a/static/admin/img/tooltag-add.e59d620a9742.svg b/static/admin/img/tooltag-add.e59d620a9742.svg new file mode 100644 index 0000000..1ca64ae --- /dev/null +++ b/static/admin/img/tooltag-add.e59d620a9742.svg @@ -0,0 +1,3 @@ + + + diff --git a/static/admin/img/tooltag-add.e59d620a9742.svg.gz b/static/admin/img/tooltag-add.e59d620a9742.svg.gz new file mode 100644 index 0000000..dcd1df1 Binary files /dev/null and b/static/admin/img/tooltag-add.e59d620a9742.svg.gz differ diff --git a/static/admin/img/tooltag-add.svg b/static/admin/img/tooltag-add.svg new file mode 100644 index 0000000..1ca64ae --- /dev/null +++ b/static/admin/img/tooltag-add.svg @@ -0,0 +1,3 @@ + + + diff --git a/static/admin/img/tooltag-add.svg.gz b/static/admin/img/tooltag-add.svg.gz new file mode 100644 index 0000000..dcd1df1 Binary files /dev/null and b/static/admin/img/tooltag-add.svg.gz differ diff --git a/static/admin/img/tooltag-arrowright.bbfb788a849e.svg b/static/admin/img/tooltag-arrowright.bbfb788a849e.svg new file mode 100644 index 0000000..b664d61 --- /dev/null +++ b/static/admin/img/tooltag-arrowright.bbfb788a849e.svg @@ -0,0 +1,3 @@ + + + diff --git a/static/admin/img/tooltag-arrowright.bbfb788a849e.svg.gz b/static/admin/img/tooltag-arrowright.bbfb788a849e.svg.gz new file mode 100644 index 0000000..54b1c3f Binary files /dev/null and b/static/admin/img/tooltag-arrowright.bbfb788a849e.svg.gz differ diff --git a/static/admin/img/tooltag-arrowright.svg b/static/admin/img/tooltag-arrowright.svg new file mode 100644 index 0000000..b664d61 --- /dev/null +++ b/static/admin/img/tooltag-arrowright.svg @@ -0,0 +1,3 @@ + + + diff --git a/static/admin/img/tooltag-arrowright.svg.gz b/static/admin/img/tooltag-arrowright.svg.gz new file mode 100644 index 0000000..54b1c3f Binary files /dev/null and b/static/admin/img/tooltag-arrowright.svg.gz differ diff --git a/static/admin/js/SelectBox.b49f008d186b.js b/static/admin/js/SelectBox.b49f008d186b.js new file mode 100644 index 0000000..1a14959 --- /dev/null +++ b/static/admin/js/SelectBox.b49f008d186b.js @@ -0,0 +1,144 @@ +(function($) { + 'use strict'; + var SelectBox = { + cache: {}, + init: function(id) { + var box = document.getElementById(id); + var node; + SelectBox.cache[id] = []; + var cache = SelectBox.cache[id]; + var boxOptions = box.options; + var boxOptionsLength = boxOptions.length; + for (var i = 0, j = boxOptionsLength; i < j; i++) { + node = boxOptions[i]; + cache.push({value: node.value, text: node.text, displayed: 1}); + } + }, + redisplay: function(id) { + // Repopulate HTML select box from cache + var box = document.getElementById(id); + var node; + $(box).empty(); // clear all options + var new_options = box.outerHTML.slice(0, -9); // grab just the opening tag + var cache = SelectBox.cache[id]; + for (var i = 0, j = cache.length; i < j; i++) { + node = cache[i]; + if (node.displayed) { + var new_option = new Option(node.text, node.value, false, false); + // Shows a tooltip when hovering over the option + new_option.setAttribute("title", node.text); + new_options += new_option.outerHTML; + } + } + new_options += ''; + box.outerHTML = new_options; + }, + filter: function(id, text) { + // Redisplay the HTML select box, displaying only the choices containing ALL + // the words in text. (It's an AND search.) + var tokens = text.toLowerCase().split(/\s+/); + var node, token; + var cache = SelectBox.cache[id]; + for (var i = 0, j = cache.length; i < j; i++) { + node = cache[i]; + node.displayed = 1; + var node_text = node.text.toLowerCase(); + var numTokens = tokens.length; + for (var k = 0; k < numTokens; k++) { + token = tokens[k]; + if (node_text.indexOf(token) === -1) { + node.displayed = 0; + break; // Once the first token isn't found we're done + } + } + } + SelectBox.redisplay(id); + }, + delete_from_cache: function(id, value) { + var node, delete_index = null; + var cache = SelectBox.cache[id]; + for (var i = 0, j = cache.length; i < j; i++) { + node = cache[i]; + if (node.value === value) { + delete_index = i; + break; + } + } + cache.splice(delete_index, 1); + }, + add_to_cache: function(id, option) { + SelectBox.cache[id].push({value: option.value, text: option.text, displayed: 1}); + }, + cache_contains: function(id, value) { + // Check if an item is contained in the cache + var node; + var cache = SelectBox.cache[id]; + for (var i = 0, j = cache.length; i < j; i++) { + node = cache[i]; + if (node.value === value) { + return true; + } + } + return false; + }, + move: function(from, to) { + var from_box = document.getElementById(from); + var option; + var boxOptions = from_box.options; + var boxOptionsLength = boxOptions.length; + for (var i = 0, j = boxOptionsLength; i < j; i++) { + option = boxOptions[i]; + var option_value = option.value; + if (option.selected && SelectBox.cache_contains(from, option_value)) { + SelectBox.add_to_cache(to, {value: option_value, text: option.text, displayed: 1}); + SelectBox.delete_from_cache(from, option_value); + } + } + SelectBox.redisplay(from); + SelectBox.redisplay(to); + }, + move_all: function(from, to) { + var from_box = document.getElementById(from); + var option; + var boxOptions = from_box.options; + var boxOptionsLength = boxOptions.length; + for (var i = 0, j = boxOptionsLength; i < j; i++) { + option = boxOptions[i]; + var option_value = option.value; + if (SelectBox.cache_contains(from, option_value)) { + SelectBox.add_to_cache(to, {value: option_value, text: option.text, displayed: 1}); + SelectBox.delete_from_cache(from, option_value); + } + } + SelectBox.redisplay(from); + SelectBox.redisplay(to); + }, + sort: function(id) { + SelectBox.cache[id].sort(function(a, b) { + a = a.text.toLowerCase(); + b = b.text.toLowerCase(); + try { + if (a > b) { + return 1; + } + if (a < b) { + return -1; + } + } + catch (e) { + // silently fail on IE 'unknown' exception + } + return 0; + } ); + }, + select_all: function(id) { + var box = document.getElementById(id); + var boxOptions = box.options; + var boxOptionsLength = boxOptions.length; + for (var i = 0; i < boxOptionsLength; i++) { + boxOptions[i].selected = 'selected'; + } + } + }; + window.SelectBox = SelectBox; +})(django.jQuery); diff --git a/static/admin/js/SelectBox.b49f008d186b.js.gz b/static/admin/js/SelectBox.b49f008d186b.js.gz new file mode 100644 index 0000000..f743a4a Binary files /dev/null and b/static/admin/js/SelectBox.b49f008d186b.js.gz differ diff --git a/static/admin/js/SelectBox.js b/static/admin/js/SelectBox.js new file mode 100644 index 0000000..1a14959 --- /dev/null +++ b/static/admin/js/SelectBox.js @@ -0,0 +1,144 @@ +(function($) { + 'use strict'; + var SelectBox = { + cache: {}, + init: function(id) { + var box = document.getElementById(id); + var node; + SelectBox.cache[id] = []; + var cache = SelectBox.cache[id]; + var boxOptions = box.options; + var boxOptionsLength = boxOptions.length; + for (var i = 0, j = boxOptionsLength; i < j; i++) { + node = boxOptions[i]; + cache.push({value: node.value, text: node.text, displayed: 1}); + } + }, + redisplay: function(id) { + // Repopulate HTML select box from cache + var box = document.getElementById(id); + var node; + $(box).empty(); // clear all options + var new_options = box.outerHTML.slice(0, -9); // grab just the opening tag + var cache = SelectBox.cache[id]; + for (var i = 0, j = cache.length; i < j; i++) { + node = cache[i]; + if (node.displayed) { + var new_option = new Option(node.text, node.value, false, false); + // Shows a tooltip when hovering over the option + new_option.setAttribute("title", node.text); + new_options += new_option.outerHTML; + } + } + new_options += ''; + box.outerHTML = new_options; + }, + filter: function(id, text) { + // Redisplay the HTML select box, displaying only the choices containing ALL + // the words in text. (It's an AND search.) + var tokens = text.toLowerCase().split(/\s+/); + var node, token; + var cache = SelectBox.cache[id]; + for (var i = 0, j = cache.length; i < j; i++) { + node = cache[i]; + node.displayed = 1; + var node_text = node.text.toLowerCase(); + var numTokens = tokens.length; + for (var k = 0; k < numTokens; k++) { + token = tokens[k]; + if (node_text.indexOf(token) === -1) { + node.displayed = 0; + break; // Once the first token isn't found we're done + } + } + } + SelectBox.redisplay(id); + }, + delete_from_cache: function(id, value) { + var node, delete_index = null; + var cache = SelectBox.cache[id]; + for (var i = 0, j = cache.length; i < j; i++) { + node = cache[i]; + if (node.value === value) { + delete_index = i; + break; + } + } + cache.splice(delete_index, 1); + }, + add_to_cache: function(id, option) { + SelectBox.cache[id].push({value: option.value, text: option.text, displayed: 1}); + }, + cache_contains: function(id, value) { + // Check if an item is contained in the cache + var node; + var cache = SelectBox.cache[id]; + for (var i = 0, j = cache.length; i < j; i++) { + node = cache[i]; + if (node.value === value) { + return true; + } + } + return false; + }, + move: function(from, to) { + var from_box = document.getElementById(from); + var option; + var boxOptions = from_box.options; + var boxOptionsLength = boxOptions.length; + for (var i = 0, j = boxOptionsLength; i < j; i++) { + option = boxOptions[i]; + var option_value = option.value; + if (option.selected && SelectBox.cache_contains(from, option_value)) { + SelectBox.add_to_cache(to, {value: option_value, text: option.text, displayed: 1}); + SelectBox.delete_from_cache(from, option_value); + } + } + SelectBox.redisplay(from); + SelectBox.redisplay(to); + }, + move_all: function(from, to) { + var from_box = document.getElementById(from); + var option; + var boxOptions = from_box.options; + var boxOptionsLength = boxOptions.length; + for (var i = 0, j = boxOptionsLength; i < j; i++) { + option = boxOptions[i]; + var option_value = option.value; + if (SelectBox.cache_contains(from, option_value)) { + SelectBox.add_to_cache(to, {value: option_value, text: option.text, displayed: 1}); + SelectBox.delete_from_cache(from, option_value); + } + } + SelectBox.redisplay(from); + SelectBox.redisplay(to); + }, + sort: function(id) { + SelectBox.cache[id].sort(function(a, b) { + a = a.text.toLowerCase(); + b = b.text.toLowerCase(); + try { + if (a > b) { + return 1; + } + if (a < b) { + return -1; + } + } + catch (e) { + // silently fail on IE 'unknown' exception + } + return 0; + } ); + }, + select_all: function(id) { + var box = document.getElementById(id); + var boxOptions = box.options; + var boxOptionsLength = boxOptions.length; + for (var i = 0; i < boxOptionsLength; i++) { + boxOptions[i].selected = 'selected'; + } + } + }; + window.SelectBox = SelectBox; +})(django.jQuery); diff --git a/static/admin/js/SelectBox.js.gz b/static/admin/js/SelectBox.js.gz new file mode 100644 index 0000000..f743a4a Binary files /dev/null and b/static/admin/js/SelectBox.js.gz differ diff --git a/static/admin/js/SelectFilter2.17009b6d4428.js b/static/admin/js/SelectFilter2.17009b6d4428.js new file mode 100644 index 0000000..0f9a188 --- /dev/null +++ b/static/admin/js/SelectFilter2.17009b6d4428.js @@ -0,0 +1,236 @@ +/*global SelectBox, addEvent, gettext, interpolate, quickElement, SelectFilter*/ +/* +SelectFilter2 - Turns a multiple-select box into a filter interface. + +Requires jQuery, core.js, and SelectBox.js. +*/ +(function($) { + 'use strict'; + function findForm(node) { + // returns the node of the form containing the given node + if (node.tagName.toLowerCase() !== 'form') { + return findForm(node.parentNode); + } + return node; + } + + window.SelectFilter = { + init: function(field_id, field_name, is_stacked) { + if (field_id.match(/__prefix__/)) { + // Don't initialize on empty forms. + return; + } + var from_box = document.getElementById(field_id); + from_box.id += '_from'; // change its ID + from_box.className = 'filtered'; + + var ps = from_box.parentNode.getElementsByTagName('p'); + for (var i = 0; i < ps.length; i++) { + if (ps[i].className.indexOf("info") !== -1) { + // Remove

, because it just gets in the way. + from_box.parentNode.removeChild(ps[i]); + } else if (ps[i].className.indexOf("help") !== -1) { + // Move help text up to the top so it isn't below the select + // boxes or wrapped off on the side to the right of the add + // button: + from_box.parentNode.insertBefore(ps[i], from_box.parentNode.firstChild); + } + } + + //

or
+ var selector_div = quickElement('div', from_box.parentNode); + selector_div.className = is_stacked ? 'selector stacked' : 'selector'; + + //
+ var selector_available = quickElement('div', selector_div); + selector_available.className = 'selector-available'; + var title_available = quickElement('h2', selector_available, interpolate(gettext('Available %s') + ' ', [field_name])); + quickElement( + 'span', title_available, '', + 'class', 'help help-tooltip help-icon', + 'title', interpolate( + gettext( + 'This is the list of available %s. You may choose some by ' + + 'selecting them in the box below and then clicking the ' + + '"Choose" arrow between the two boxes.' + ), + [field_name] + ) + ); + + var filter_p = quickElement('p', selector_available, '', 'id', field_id + '_filter'); + filter_p.className = 'selector-filter'; + + var search_filter_label = quickElement('label', filter_p, '', 'for', field_id + '_input'); + + quickElement( + 'span', search_filter_label, '', + 'class', 'help-tooltip search-label-icon', + 'title', interpolate(gettext("Type into this box to filter down the list of available %s."), [field_name]) + ); + + filter_p.appendChild(document.createTextNode(' ')); + + var filter_input = quickElement('input', filter_p, '', 'type', 'text', 'placeholder', gettext("Filter")); + filter_input.id = field_id + '_input'; + + selector_available.appendChild(from_box); + var choose_all = quickElement('a', selector_available, gettext('Choose all'), 'title', interpolate(gettext('Click to choose all %s at once.'), [field_name]), 'href', '#', 'id', field_id + '_add_all_link'); + choose_all.className = 'selector-chooseall'; + + //
    + var selector_chooser = quickElement('ul', selector_div); + selector_chooser.className = 'selector-chooser'; + var add_link = quickElement('a', quickElement('li', selector_chooser), gettext('Choose'), 'title', gettext('Choose'), 'href', '#', 'id', field_id + '_add_link'); + add_link.className = 'selector-add'; + var remove_link = quickElement('a', quickElement('li', selector_chooser), gettext('Remove'), 'title', gettext('Remove'), 'href', '#', 'id', field_id + '_remove_link'); + remove_link.className = 'selector-remove'; + + //
    + var selector_chosen = quickElement('div', selector_div); + selector_chosen.className = 'selector-chosen'; + var title_chosen = quickElement('h2', selector_chosen, interpolate(gettext('Chosen %s') + ' ', [field_name])); + quickElement( + 'span', title_chosen, '', + 'class', 'help help-tooltip help-icon', + 'title', interpolate( + gettext( + 'This is the list of chosen %s. You may remove some by ' + + 'selecting them in the box below and then clicking the ' + + '"Remove" arrow between the two boxes.' + ), + [field_name] + ) + ); + + var to_box = quickElement('select', selector_chosen, '', 'id', field_id + '_to', 'multiple', 'multiple', 'size', from_box.size, 'name', from_box.getAttribute('name')); + to_box.className = 'filtered'; + var clear_all = quickElement('a', selector_chosen, gettext('Remove all'), 'title', interpolate(gettext('Click to remove all chosen %s at once.'), [field_name]), 'href', '#', 'id', field_id + '_remove_all_link'); + clear_all.className = 'selector-clearall'; + + from_box.setAttribute('name', from_box.getAttribute('name') + '_old'); + + // Set up the JavaScript event handlers for the select box filter interface + var move_selection = function(e, elem, move_func, from, to) { + if (elem.className.indexOf('active') !== -1) { + move_func(from, to); + SelectFilter.refresh_icons(field_id); + } + e.preventDefault(); + }; + addEvent(choose_all, 'click', function(e) { move_selection(e, this, SelectBox.move_all, field_id + '_from', field_id + '_to'); }); + addEvent(add_link, 'click', function(e) { move_selection(e, this, SelectBox.move, field_id + '_from', field_id + '_to'); }); + addEvent(remove_link, 'click', function(e) { move_selection(e, this, SelectBox.move, field_id + '_to', field_id + '_from'); }); + addEvent(clear_all, 'click', function(e) { move_selection(e, this, SelectBox.move_all, field_id + '_to', field_id + '_from'); }); + addEvent(filter_input, 'keypress', function(e) { SelectFilter.filter_key_press(e, field_id); }); + addEvent(filter_input, 'keyup', function(e) { SelectFilter.filter_key_up(e, field_id); }); + addEvent(filter_input, 'keydown', function(e) { SelectFilter.filter_key_down(e, field_id); }); + addEvent(selector_div, 'change', function(e) { + if (e.target.tagName === 'SELECT') { + SelectFilter.refresh_icons(field_id); + } + }); + addEvent(selector_div, 'dblclick', function(e) { + if (e.target.tagName === 'OPTION') { + if (e.target.closest('select').id === field_id + '_to') { + SelectBox.move(field_id + '_to', field_id + '_from'); + } else { + SelectBox.move(field_id + '_from', field_id + '_to'); + } + SelectFilter.refresh_icons(field_id); + } + }); + addEvent(findForm(from_box), 'submit', function() { SelectBox.select_all(field_id + '_to'); }); + SelectBox.init(field_id + '_from'); + SelectBox.init(field_id + '_to'); + // Move selected from_box options to to_box + SelectBox.move(field_id + '_from', field_id + '_to'); + + if (!is_stacked) { + // In horizontal mode, give the same height to the two boxes. + var j_from_box = $(from_box); + var j_to_box = $(to_box); + var resize_filters = function() { j_to_box.height($(filter_p).outerHeight() + j_from_box.outerHeight()); }; + if (j_from_box.outerHeight() > 0) { + resize_filters(); // This fieldset is already open. Resize now. + } else { + // This fieldset is probably collapsed. Wait for its 'show' event. + j_to_box.closest('fieldset').one('show.fieldset', resize_filters); + } + } + + // Initial icon refresh + SelectFilter.refresh_icons(field_id); + }, + any_selected: function(field) { + var any_selected = false; + try { + // Temporarily add the required attribute and check validity. + // This is much faster in WebKit browsers than the fallback. + field.attr('required', 'required'); + any_selected = field.is(':valid'); + field.removeAttr('required'); + } catch (e) { + // Browsers that don't support :valid (IE < 10) + any_selected = field.find('option:selected').length > 0; + } + return any_selected; + }, + refresh_icons: function(field_id) { + var from = $('#' + field_id + '_from'); + var to = $('#' + field_id + '_to'); + // Active if at least one item is selected + $('#' + field_id + '_add_link').toggleClass('active', SelectFilter.any_selected(from)); + $('#' + field_id + '_remove_link').toggleClass('active', SelectFilter.any_selected(to)); + // Active if the corresponding box isn't empty + $('#' + field_id + '_add_all_link').toggleClass('active', from.find('option').length > 0); + $('#' + field_id + '_remove_all_link').toggleClass('active', to.find('option').length > 0); + }, + filter_key_press: function(event, field_id) { + var from = document.getElementById(field_id + '_from'); + // don't submit form if user pressed Enter + if ((event.which && event.which === 13) || (event.keyCode && event.keyCode === 13)) { + from.selectedIndex = 0; + SelectBox.move(field_id + '_from', field_id + '_to'); + from.selectedIndex = 0; + event.preventDefault(); + return false; + } + }, + filter_key_up: function(event, field_id) { + var from = document.getElementById(field_id + '_from'); + var temp = from.selectedIndex; + SelectBox.filter(field_id + '_from', document.getElementById(field_id + '_input').value); + from.selectedIndex = temp; + return true; + }, + filter_key_down: function(event, field_id) { + var from = document.getElementById(field_id + '_from'); + // right arrow -- move across + if ((event.which && event.which === 39) || (event.keyCode && event.keyCode === 39)) { + var old_index = from.selectedIndex; + SelectBox.move(field_id + '_from', field_id + '_to'); + from.selectedIndex = (old_index === from.length) ? from.length - 1 : old_index; + return false; + } + // down arrow -- wrap around + if ((event.which && event.which === 40) || (event.keyCode && event.keyCode === 40)) { + from.selectedIndex = (from.length === from.selectedIndex + 1) ? 0 : from.selectedIndex + 1; + } + // up arrow -- wrap around + if ((event.which && event.which === 38) || (event.keyCode && event.keyCode === 38)) { + from.selectedIndex = (from.selectedIndex === 0) ? from.length - 1 : from.selectedIndex - 1; + } + return true; + } + }; + + addEvent(window, 'load', function(e) { + $('select.selectfilter, select.selectfilterstacked').each(function() { + var $el = $(this), + data = $el.data(); + SelectFilter.init($el.attr('id'), data.fieldName, parseInt(data.isStacked, 10)); + }); + }); + +})(django.jQuery); diff --git a/static/admin/js/SelectFilter2.17009b6d4428.js.gz b/static/admin/js/SelectFilter2.17009b6d4428.js.gz new file mode 100644 index 0000000..3c0f7b5 Binary files /dev/null and b/static/admin/js/SelectFilter2.17009b6d4428.js.gz differ diff --git a/static/admin/js/SelectFilter2.js b/static/admin/js/SelectFilter2.js new file mode 100644 index 0000000..0f9a188 --- /dev/null +++ b/static/admin/js/SelectFilter2.js @@ -0,0 +1,236 @@ +/*global SelectBox, addEvent, gettext, interpolate, quickElement, SelectFilter*/ +/* +SelectFilter2 - Turns a multiple-select box into a filter interface. + +Requires jQuery, core.js, and SelectBox.js. +*/ +(function($) { + 'use strict'; + function findForm(node) { + // returns the node of the form containing the given node + if (node.tagName.toLowerCase() !== 'form') { + return findForm(node.parentNode); + } + return node; + } + + window.SelectFilter = { + init: function(field_id, field_name, is_stacked) { + if (field_id.match(/__prefix__/)) { + // Don't initialize on empty forms. + return; + } + var from_box = document.getElementById(field_id); + from_box.id += '_from'; // change its ID + from_box.className = 'filtered'; + + var ps = from_box.parentNode.getElementsByTagName('p'); + for (var i = 0; i < ps.length; i++) { + if (ps[i].className.indexOf("info") !== -1) { + // Remove

    , because it just gets in the way. + from_box.parentNode.removeChild(ps[i]); + } else if (ps[i].className.indexOf("help") !== -1) { + // Move help text up to the top so it isn't below the select + // boxes or wrapped off on the side to the right of the add + // button: + from_box.parentNode.insertBefore(ps[i], from_box.parentNode.firstChild); + } + } + + //

    or
    + var selector_div = quickElement('div', from_box.parentNode); + selector_div.className = is_stacked ? 'selector stacked' : 'selector'; + + //
    + var selector_available = quickElement('div', selector_div); + selector_available.className = 'selector-available'; + var title_available = quickElement('h2', selector_available, interpolate(gettext('Available %s') + ' ', [field_name])); + quickElement( + 'span', title_available, '', + 'class', 'help help-tooltip help-icon', + 'title', interpolate( + gettext( + 'This is the list of available %s. You may choose some by ' + + 'selecting them in the box below and then clicking the ' + + '"Choose" arrow between the two boxes.' + ), + [field_name] + ) + ); + + var filter_p = quickElement('p', selector_available, '', 'id', field_id + '_filter'); + filter_p.className = 'selector-filter'; + + var search_filter_label = quickElement('label', filter_p, '', 'for', field_id + '_input'); + + quickElement( + 'span', search_filter_label, '', + 'class', 'help-tooltip search-label-icon', + 'title', interpolate(gettext("Type into this box to filter down the list of available %s."), [field_name]) + ); + + filter_p.appendChild(document.createTextNode(' ')); + + var filter_input = quickElement('input', filter_p, '', 'type', 'text', 'placeholder', gettext("Filter")); + filter_input.id = field_id + '_input'; + + selector_available.appendChild(from_box); + var choose_all = quickElement('a', selector_available, gettext('Choose all'), 'title', interpolate(gettext('Click to choose all %s at once.'), [field_name]), 'href', '#', 'id', field_id + '_add_all_link'); + choose_all.className = 'selector-chooseall'; + + //
      + var selector_chooser = quickElement('ul', selector_div); + selector_chooser.className = 'selector-chooser'; + var add_link = quickElement('a', quickElement('li', selector_chooser), gettext('Choose'), 'title', gettext('Choose'), 'href', '#', 'id', field_id + '_add_link'); + add_link.className = 'selector-add'; + var remove_link = quickElement('a', quickElement('li', selector_chooser), gettext('Remove'), 'title', gettext('Remove'), 'href', '#', 'id', field_id + '_remove_link'); + remove_link.className = 'selector-remove'; + + //
      + var selector_chosen = quickElement('div', selector_div); + selector_chosen.className = 'selector-chosen'; + var title_chosen = quickElement('h2', selector_chosen, interpolate(gettext('Chosen %s') + ' ', [field_name])); + quickElement( + 'span', title_chosen, '', + 'class', 'help help-tooltip help-icon', + 'title', interpolate( + gettext( + 'This is the list of chosen %s. You may remove some by ' + + 'selecting them in the box below and then clicking the ' + + '"Remove" arrow between the two boxes.' + ), + [field_name] + ) + ); + + var to_box = quickElement('select', selector_chosen, '', 'id', field_id + '_to', 'multiple', 'multiple', 'size', from_box.size, 'name', from_box.getAttribute('name')); + to_box.className = 'filtered'; + var clear_all = quickElement('a', selector_chosen, gettext('Remove all'), 'title', interpolate(gettext('Click to remove all chosen %s at once.'), [field_name]), 'href', '#', 'id', field_id + '_remove_all_link'); + clear_all.className = 'selector-clearall'; + + from_box.setAttribute('name', from_box.getAttribute('name') + '_old'); + + // Set up the JavaScript event handlers for the select box filter interface + var move_selection = function(e, elem, move_func, from, to) { + if (elem.className.indexOf('active') !== -1) { + move_func(from, to); + SelectFilter.refresh_icons(field_id); + } + e.preventDefault(); + }; + addEvent(choose_all, 'click', function(e) { move_selection(e, this, SelectBox.move_all, field_id + '_from', field_id + '_to'); }); + addEvent(add_link, 'click', function(e) { move_selection(e, this, SelectBox.move, field_id + '_from', field_id + '_to'); }); + addEvent(remove_link, 'click', function(e) { move_selection(e, this, SelectBox.move, field_id + '_to', field_id + '_from'); }); + addEvent(clear_all, 'click', function(e) { move_selection(e, this, SelectBox.move_all, field_id + '_to', field_id + '_from'); }); + addEvent(filter_input, 'keypress', function(e) { SelectFilter.filter_key_press(e, field_id); }); + addEvent(filter_input, 'keyup', function(e) { SelectFilter.filter_key_up(e, field_id); }); + addEvent(filter_input, 'keydown', function(e) { SelectFilter.filter_key_down(e, field_id); }); + addEvent(selector_div, 'change', function(e) { + if (e.target.tagName === 'SELECT') { + SelectFilter.refresh_icons(field_id); + } + }); + addEvent(selector_div, 'dblclick', function(e) { + if (e.target.tagName === 'OPTION') { + if (e.target.closest('select').id === field_id + '_to') { + SelectBox.move(field_id + '_to', field_id + '_from'); + } else { + SelectBox.move(field_id + '_from', field_id + '_to'); + } + SelectFilter.refresh_icons(field_id); + } + }); + addEvent(findForm(from_box), 'submit', function() { SelectBox.select_all(field_id + '_to'); }); + SelectBox.init(field_id + '_from'); + SelectBox.init(field_id + '_to'); + // Move selected from_box options to to_box + SelectBox.move(field_id + '_from', field_id + '_to'); + + if (!is_stacked) { + // In horizontal mode, give the same height to the two boxes. + var j_from_box = $(from_box); + var j_to_box = $(to_box); + var resize_filters = function() { j_to_box.height($(filter_p).outerHeight() + j_from_box.outerHeight()); }; + if (j_from_box.outerHeight() > 0) { + resize_filters(); // This fieldset is already open. Resize now. + } else { + // This fieldset is probably collapsed. Wait for its 'show' event. + j_to_box.closest('fieldset').one('show.fieldset', resize_filters); + } + } + + // Initial icon refresh + SelectFilter.refresh_icons(field_id); + }, + any_selected: function(field) { + var any_selected = false; + try { + // Temporarily add the required attribute and check validity. + // This is much faster in WebKit browsers than the fallback. + field.attr('required', 'required'); + any_selected = field.is(':valid'); + field.removeAttr('required'); + } catch (e) { + // Browsers that don't support :valid (IE < 10) + any_selected = field.find('option:selected').length > 0; + } + return any_selected; + }, + refresh_icons: function(field_id) { + var from = $('#' + field_id + '_from'); + var to = $('#' + field_id + '_to'); + // Active if at least one item is selected + $('#' + field_id + '_add_link').toggleClass('active', SelectFilter.any_selected(from)); + $('#' + field_id + '_remove_link').toggleClass('active', SelectFilter.any_selected(to)); + // Active if the corresponding box isn't empty + $('#' + field_id + '_add_all_link').toggleClass('active', from.find('option').length > 0); + $('#' + field_id + '_remove_all_link').toggleClass('active', to.find('option').length > 0); + }, + filter_key_press: function(event, field_id) { + var from = document.getElementById(field_id + '_from'); + // don't submit form if user pressed Enter + if ((event.which && event.which === 13) || (event.keyCode && event.keyCode === 13)) { + from.selectedIndex = 0; + SelectBox.move(field_id + '_from', field_id + '_to'); + from.selectedIndex = 0; + event.preventDefault(); + return false; + } + }, + filter_key_up: function(event, field_id) { + var from = document.getElementById(field_id + '_from'); + var temp = from.selectedIndex; + SelectBox.filter(field_id + '_from', document.getElementById(field_id + '_input').value); + from.selectedIndex = temp; + return true; + }, + filter_key_down: function(event, field_id) { + var from = document.getElementById(field_id + '_from'); + // right arrow -- move across + if ((event.which && event.which === 39) || (event.keyCode && event.keyCode === 39)) { + var old_index = from.selectedIndex; + SelectBox.move(field_id + '_from', field_id + '_to'); + from.selectedIndex = (old_index === from.length) ? from.length - 1 : old_index; + return false; + } + // down arrow -- wrap around + if ((event.which && event.which === 40) || (event.keyCode && event.keyCode === 40)) { + from.selectedIndex = (from.length === from.selectedIndex + 1) ? 0 : from.selectedIndex + 1; + } + // up arrow -- wrap around + if ((event.which && event.which === 38) || (event.keyCode && event.keyCode === 38)) { + from.selectedIndex = (from.selectedIndex === 0) ? from.length - 1 : from.selectedIndex - 1; + } + return true; + } + }; + + addEvent(window, 'load', function(e) { + $('select.selectfilter, select.selectfilterstacked').each(function() { + var $el = $(this), + data = $el.data(); + SelectFilter.init($el.attr('id'), data.fieldName, parseInt(data.isStacked, 10)); + }); + }); + +})(django.jQuery); diff --git a/static/admin/js/SelectFilter2.js.gz b/static/admin/js/SelectFilter2.js.gz new file mode 100644 index 0000000..3c0f7b5 Binary files /dev/null and b/static/admin/js/SelectFilter2.js.gz differ diff --git a/static/admin/js/actions.32861b6cbdf9.js b/static/admin/js/actions.32861b6cbdf9.js new file mode 100644 index 0000000..7041701 --- /dev/null +++ b/static/admin/js/actions.32861b6cbdf9.js @@ -0,0 +1,153 @@ +/*global gettext, interpolate, ngettext*/ +(function($) { + 'use strict'; + var lastChecked; + + $.fn.actions = function(opts) { + var options = $.extend({}, $.fn.actions.defaults, opts); + var actionCheckboxes = $(this); + var list_editable_changed = false; + var showQuestion = function() { + $(options.acrossClears).hide(); + $(options.acrossQuestions).show(); + $(options.allContainer).hide(); + }, + showClear = function() { + $(options.acrossClears).show(); + $(options.acrossQuestions).hide(); + $(options.actionContainer).toggleClass(options.selectedClass); + $(options.allContainer).show(); + $(options.counterContainer).hide(); + }, + reset = function() { + $(options.acrossClears).hide(); + $(options.acrossQuestions).hide(); + $(options.allContainer).hide(); + $(options.counterContainer).show(); + }, + clearAcross = function() { + reset(); + $(options.acrossInput).val(0); + $(options.actionContainer).removeClass(options.selectedClass); + }, + checker = function(checked) { + if (checked) { + showQuestion(); + } else { + reset(); + } + $(actionCheckboxes).prop("checked", checked) + .parent().parent().toggleClass(options.selectedClass, checked); + }, + updateCounter = function() { + var sel = $(actionCheckboxes).filter(":checked").length; + // data-actions-icnt is defined in the generated HTML + // and contains the total amount of objects in the queryset + var actions_icnt = $('.action-counter').data('actionsIcnt'); + $(options.counterContainer).html(interpolate( + ngettext('%(sel)s of %(cnt)s selected', '%(sel)s of %(cnt)s selected', sel), { + sel: sel, + cnt: actions_icnt + }, true)); + $(options.allToggle).prop("checked", function() { + var value; + if (sel === actionCheckboxes.length) { + value = true; + showQuestion(); + } else { + value = false; + clearAcross(); + } + return value; + }); + }; + // Show counter by default + $(options.counterContainer).show(); + // Check state of checkboxes and reinit state if needed + $(this).filter(":checked").each(function(i) { + $(this).parent().parent().toggleClass(options.selectedClass); + updateCounter(); + if ($(options.acrossInput).val() === 1) { + showClear(); + } + }); + $(options.allToggle).show().click(function() { + checker($(this).prop("checked")); + updateCounter(); + }); + $("a", options.acrossQuestions).click(function(event) { + event.preventDefault(); + $(options.acrossInput).val(1); + showClear(); + }); + $("a", options.acrossClears).click(function(event) { + event.preventDefault(); + $(options.allToggle).prop("checked", false); + clearAcross(); + checker(0); + updateCounter(); + }); + lastChecked = null; + $(actionCheckboxes).click(function(event) { + if (!event) { event = window.event; } + var target = event.target ? event.target : event.srcElement; + if (lastChecked && $.data(lastChecked) !== $.data(target) && event.shiftKey === true) { + var inrange = false; + $(lastChecked).prop("checked", target.checked) + .parent().parent().toggleClass(options.selectedClass, target.checked); + $(actionCheckboxes).each(function() { + if ($.data(this) === $.data(lastChecked) || $.data(this) === $.data(target)) { + inrange = (inrange) ? false : true; + } + if (inrange) { + $(this).prop("checked", target.checked) + .parent().parent().toggleClass(options.selectedClass, target.checked); + } + }); + } + $(target).parent().parent().toggleClass(options.selectedClass, target.checked); + lastChecked = target; + updateCounter(); + }); + $('form#changelist-form table#result_list tr').find('td:gt(0) :input').change(function() { + list_editable_changed = true; + }); + $('form#changelist-form button[name="index"]').click(function(event) { + if (list_editable_changed) { + return confirm(gettext("You have unsaved changes on individual editable fields. If you run an action, your unsaved changes will be lost.")); + } + }); + $('form#changelist-form input[name="_save"]').click(function(event) { + var action_changed = false; + $('select option:selected', options.actionContainer).each(function() { + if ($(this).val()) { + action_changed = true; + } + }); + if (action_changed) { + if (list_editable_changed) { + return confirm(gettext("You have selected an action, but you haven't saved your changes to individual fields yet. Please click OK to save. You'll need to re-run the action.")); + } else { + return confirm(gettext("You have selected an action, and you haven't made any changes on individual fields. You're probably looking for the Go button rather than the Save button.")); + } + } + }); + }; + /* Setup plugin defaults */ + $.fn.actions.defaults = { + actionContainer: "div.actions", + counterContainer: "span.action-counter", + allContainer: "div.actions span.all", + acrossInput: "div.actions input.select-across", + acrossQuestions: "div.actions span.question", + acrossClears: "div.actions span.clear", + allToggle: "#action-toggle", + selectedClass: "selected" + }; + $(document).ready(function() { + var $actionsEls = $('tr input.action-select'); + if ($actionsEls.length > 0) { + $actionsEls.actions(); + } + }); +})(django.jQuery); diff --git a/static/admin/js/actions.32861b6cbdf9.js.gz b/static/admin/js/actions.32861b6cbdf9.js.gz new file mode 100644 index 0000000..6d42c0b Binary files /dev/null and b/static/admin/js/actions.32861b6cbdf9.js.gz differ diff --git a/static/admin/js/actions.js b/static/admin/js/actions.js new file mode 100644 index 0000000..7041701 --- /dev/null +++ b/static/admin/js/actions.js @@ -0,0 +1,153 @@ +/*global gettext, interpolate, ngettext*/ +(function($) { + 'use strict'; + var lastChecked; + + $.fn.actions = function(opts) { + var options = $.extend({}, $.fn.actions.defaults, opts); + var actionCheckboxes = $(this); + var list_editable_changed = false; + var showQuestion = function() { + $(options.acrossClears).hide(); + $(options.acrossQuestions).show(); + $(options.allContainer).hide(); + }, + showClear = function() { + $(options.acrossClears).show(); + $(options.acrossQuestions).hide(); + $(options.actionContainer).toggleClass(options.selectedClass); + $(options.allContainer).show(); + $(options.counterContainer).hide(); + }, + reset = function() { + $(options.acrossClears).hide(); + $(options.acrossQuestions).hide(); + $(options.allContainer).hide(); + $(options.counterContainer).show(); + }, + clearAcross = function() { + reset(); + $(options.acrossInput).val(0); + $(options.actionContainer).removeClass(options.selectedClass); + }, + checker = function(checked) { + if (checked) { + showQuestion(); + } else { + reset(); + } + $(actionCheckboxes).prop("checked", checked) + .parent().parent().toggleClass(options.selectedClass, checked); + }, + updateCounter = function() { + var sel = $(actionCheckboxes).filter(":checked").length; + // data-actions-icnt is defined in the generated HTML + // and contains the total amount of objects in the queryset + var actions_icnt = $('.action-counter').data('actionsIcnt'); + $(options.counterContainer).html(interpolate( + ngettext('%(sel)s of %(cnt)s selected', '%(sel)s of %(cnt)s selected', sel), { + sel: sel, + cnt: actions_icnt + }, true)); + $(options.allToggle).prop("checked", function() { + var value; + if (sel === actionCheckboxes.length) { + value = true; + showQuestion(); + } else { + value = false; + clearAcross(); + } + return value; + }); + }; + // Show counter by default + $(options.counterContainer).show(); + // Check state of checkboxes and reinit state if needed + $(this).filter(":checked").each(function(i) { + $(this).parent().parent().toggleClass(options.selectedClass); + updateCounter(); + if ($(options.acrossInput).val() === 1) { + showClear(); + } + }); + $(options.allToggle).show().click(function() { + checker($(this).prop("checked")); + updateCounter(); + }); + $("a", options.acrossQuestions).click(function(event) { + event.preventDefault(); + $(options.acrossInput).val(1); + showClear(); + }); + $("a", options.acrossClears).click(function(event) { + event.preventDefault(); + $(options.allToggle).prop("checked", false); + clearAcross(); + checker(0); + updateCounter(); + }); + lastChecked = null; + $(actionCheckboxes).click(function(event) { + if (!event) { event = window.event; } + var target = event.target ? event.target : event.srcElement; + if (lastChecked && $.data(lastChecked) !== $.data(target) && event.shiftKey === true) { + var inrange = false; + $(lastChecked).prop("checked", target.checked) + .parent().parent().toggleClass(options.selectedClass, target.checked); + $(actionCheckboxes).each(function() { + if ($.data(this) === $.data(lastChecked) || $.data(this) === $.data(target)) { + inrange = (inrange) ? false : true; + } + if (inrange) { + $(this).prop("checked", target.checked) + .parent().parent().toggleClass(options.selectedClass, target.checked); + } + }); + } + $(target).parent().parent().toggleClass(options.selectedClass, target.checked); + lastChecked = target; + updateCounter(); + }); + $('form#changelist-form table#result_list tr').find('td:gt(0) :input').change(function() { + list_editable_changed = true; + }); + $('form#changelist-form button[name="index"]').click(function(event) { + if (list_editable_changed) { + return confirm(gettext("You have unsaved changes on individual editable fields. If you run an action, your unsaved changes will be lost.")); + } + }); + $('form#changelist-form input[name="_save"]').click(function(event) { + var action_changed = false; + $('select option:selected', options.actionContainer).each(function() { + if ($(this).val()) { + action_changed = true; + } + }); + if (action_changed) { + if (list_editable_changed) { + return confirm(gettext("You have selected an action, but you haven't saved your changes to individual fields yet. Please click OK to save. You'll need to re-run the action.")); + } else { + return confirm(gettext("You have selected an action, and you haven't made any changes on individual fields. You're probably looking for the Go button rather than the Save button.")); + } + } + }); + }; + /* Setup plugin defaults */ + $.fn.actions.defaults = { + actionContainer: "div.actions", + counterContainer: "span.action-counter", + allContainer: "div.actions span.all", + acrossInput: "div.actions input.select-across", + acrossQuestions: "div.actions span.question", + acrossClears: "div.actions span.clear", + allToggle: "#action-toggle", + selectedClass: "selected" + }; + $(document).ready(function() { + var $actionsEls = $('tr input.action-select'); + if ($actionsEls.length > 0) { + $actionsEls.actions(); + } + }); +})(django.jQuery); diff --git a/static/admin/js/actions.js.gz b/static/admin/js/actions.js.gz new file mode 100644 index 0000000..6d42c0b Binary files /dev/null and b/static/admin/js/actions.js.gz differ diff --git a/static/admin/js/actions.min.f51f04edab28.js b/static/admin/js/actions.min.f51f04edab28.js new file mode 100644 index 0000000..c83b06a --- /dev/null +++ b/static/admin/js/actions.min.f51f04edab28.js @@ -0,0 +1,6 @@ +(function(a){var f;a.fn.actions=function(e){var b=a.extend({},a.fn.actions.defaults,e),g=a(this),k=!1,l=function(){a(b.acrossClears).hide();a(b.acrossQuestions).show();a(b.allContainer).hide()},m=function(){a(b.acrossClears).show();a(b.acrossQuestions).hide();a(b.actionContainer).toggleClass(b.selectedClass);a(b.allContainer).show();a(b.counterContainer).hide()},n=function(){a(b.acrossClears).hide();a(b.acrossQuestions).hide();a(b.allContainer).hide();a(b.counterContainer).show()},p=function(){n(); +a(b.acrossInput).val(0);a(b.actionContainer).removeClass(b.selectedClass)},q=function(c){c?l():n();a(g).prop("checked",c).parent().parent().toggleClass(b.selectedClass,c)},h=function(){var c=a(g).filter(":checked").length,d=a(".action-counter").data("actionsIcnt");a(b.counterContainer).html(interpolate(ngettext("%(sel)s of %(cnt)s selected","%(sel)s of %(cnt)s selected",c),{sel:c,cnt:d},!0));a(b.allToggle).prop("checked",function(){var a;c===g.length?(a=!0,l()):(a=!1,p());return a})};a(b.counterContainer).show(); +a(this).filter(":checked").each(function(c){a(this).parent().parent().toggleClass(b.selectedClass);h();1===a(b.acrossInput).val()&&m()});a(b.allToggle).show().click(function(){q(a(this).prop("checked"));h()});a("a",b.acrossQuestions).click(function(c){c.preventDefault();a(b.acrossInput).val(1);m()});a("a",b.acrossClears).click(function(c){c.preventDefault();a(b.allToggle).prop("checked",!1);p();q(0);h()});f=null;a(g).click(function(c){c||(c=window.event);var d=c.target?c.target:c.srcElement;if(f&& +a.data(f)!==a.data(d)&&!0===c.shiftKey){var e=!1;a(f).prop("checked",d.checked).parent().parent().toggleClass(b.selectedClass,d.checked);a(g).each(function(){if(a.data(this)===a.data(f)||a.data(this)===a.data(d))e=e?!1:!0;e&&a(this).prop("checked",d.checked).parent().parent().toggleClass(b.selectedClass,d.checked)})}a(d).parent().parent().toggleClass(b.selectedClass,d.checked);f=d;h()});a("form#changelist-form table#result_list tr").find("td:gt(0) :input").change(function(){k=!0});a('form#changelist-form button[name="index"]').click(function(a){if(k)return confirm(gettext("You have unsaved changes on individual editable fields. If you run an action, your unsaved changes will be lost."))}); +a('form#changelist-form input[name="_save"]').click(function(c){var d=!1;a("select option:selected",b.actionContainer).each(function(){a(this).val()&&(d=!0)});if(d)return k?confirm(gettext("You have selected an action, but you haven't saved your changes to individual fields yet. Please click OK to save. You'll need to re-run the action.")):confirm(gettext("You have selected an action, and you haven't made any changes on individual fields. You're probably looking for the Go button rather than the Save button."))})}; +a.fn.actions.defaults={actionContainer:"div.actions",counterContainer:"span.action-counter",allContainer:"div.actions span.all",acrossInput:"div.actions input.select-across",acrossQuestions:"div.actions span.question",acrossClears:"div.actions span.clear",allToggle:"#action-toggle",selectedClass:"selected"};a(document).ready(function(){var e=a("tr input.action-select");0 +// +(function() { + 'use strict'; + var DateTimeShortcuts = { + calendars: [], + calendarInputs: [], + clockInputs: [], + dismissClockFunc: [], + dismissCalendarFunc: [], + calendarDivName1: 'calendarbox', // name of calendar
      that gets toggled + calendarDivName2: 'calendarin', // name of
      that contains calendar + calendarLinkName: 'calendarlink',// name of the link that is used to toggle + clockDivName: 'clockbox', // name of clock
      that gets toggled + clockLinkName: 'clocklink', // name of the link that is used to toggle + shortCutsClass: 'datetimeshortcuts', // class of the clock and cal shortcuts + timezoneWarningClass: 'timezonewarning', // class of the warning for timezone mismatch + timezoneOffset: 0, + init: function() { + var body = document.getElementsByTagName('body')[0]; + var serverOffset = body.getAttribute('data-admin-utc-offset'); + if (serverOffset) { + var localOffset = new Date().getTimezoneOffset() * -60; + DateTimeShortcuts.timezoneOffset = localOffset - serverOffset; + } + + var inputs = document.getElementsByTagName('input'); + for (var i = 0; i < inputs.length; i++) { + var inp = inputs[i]; + if (inp.getAttribute('type') === 'text' && inp.className.match(/vTimeField/)) { + DateTimeShortcuts.addClock(inp); + DateTimeShortcuts.addTimezoneWarning(inp); + } + else if (inp.getAttribute('type') === 'text' && inp.className.match(/vDateField/)) { + DateTimeShortcuts.addCalendar(inp); + DateTimeShortcuts.addTimezoneWarning(inp); + } + } + }, + // Return the current time while accounting for the server timezone. + now: function() { + var body = document.getElementsByTagName('body')[0]; + var serverOffset = body.getAttribute('data-admin-utc-offset'); + if (serverOffset) { + var localNow = new Date(); + var localOffset = localNow.getTimezoneOffset() * -60; + localNow.setTime(localNow.getTime() + 1000 * (serverOffset - localOffset)); + return localNow; + } else { + return new Date(); + } + }, + // Add a warning when the time zone in the browser and backend do not match. + addTimezoneWarning: function(inp) { + var $ = django.jQuery; + var warningClass = DateTimeShortcuts.timezoneWarningClass; + var timezoneOffset = DateTimeShortcuts.timezoneOffset / 3600; + + // Only warn if there is a time zone mismatch. + if (!timezoneOffset) { + return; + } + + // Check if warning is already there. + if ($(inp).siblings('.' + warningClass).length) { + return; + } + + var message; + if (timezoneOffset > 0) { + message = ngettext( + 'Note: You are %s hour ahead of server time.', + 'Note: You are %s hours ahead of server time.', + timezoneOffset + ); + } + else { + timezoneOffset *= -1; + message = ngettext( + 'Note: You are %s hour behind server time.', + 'Note: You are %s hours behind server time.', + timezoneOffset + ); + } + message = interpolate(message, [timezoneOffset]); + + var $warning = $(''); + $warning.attr('class', warningClass); + $warning.text(message); + + $(inp).parent() + .append($('
      ')) + .append($warning); + }, + // Add clock widget to a given field + addClock: function(inp) { + var num = DateTimeShortcuts.clockInputs.length; + DateTimeShortcuts.clockInputs[num] = inp; + DateTimeShortcuts.dismissClockFunc[num] = function() { DateTimeShortcuts.dismissClock(num); return true; }; + + // Shortcut links (clock icon and "Now" link) + var shortcuts_span = document.createElement('span'); + shortcuts_span.className = DateTimeShortcuts.shortCutsClass; + inp.parentNode.insertBefore(shortcuts_span, inp.nextSibling); + var now_link = document.createElement('a'); + now_link.setAttribute('href', "#"); + now_link.appendChild(document.createTextNode(gettext('Now'))); + addEvent(now_link, 'click', function(e) { + e.preventDefault(); + DateTimeShortcuts.handleClockQuicklink(num, -1); + }); + var clock_link = document.createElement('a'); + clock_link.setAttribute('href', '#'); + clock_link.id = DateTimeShortcuts.clockLinkName + num; + addEvent(clock_link, 'click', function(e) { + e.preventDefault(); + // avoid triggering the document click handler to dismiss the clock + e.stopPropagation(); + DateTimeShortcuts.openClock(num); + }); + + quickElement( + 'span', clock_link, '', + 'class', 'clock-icon', + 'title', gettext('Choose a Time') + ); + shortcuts_span.appendChild(document.createTextNode('\u00A0')); + shortcuts_span.appendChild(now_link); + shortcuts_span.appendChild(document.createTextNode('\u00A0|\u00A0')); + shortcuts_span.appendChild(clock_link); + + // Create clock link div + // + // Markup looks like: + //
      + //

      Choose a time

      + // + //

      Cancel

      + //
      + + var clock_box = document.createElement('div'); + clock_box.style.display = 'none'; + clock_box.style.position = 'absolute'; + clock_box.className = 'clockbox module'; + clock_box.setAttribute('id', DateTimeShortcuts.clockDivName + num); + document.body.appendChild(clock_box); + addEvent(clock_box, 'click', cancelEventPropagation); + + quickElement('h2', clock_box, gettext('Choose a time')); + var time_list = quickElement('ul', clock_box); + time_list.className = 'timelist'; + var time_link = quickElement("a", quickElement("li", time_list), gettext("Now"), "href", "#"); + addEvent(time_link, 'click', function(e) { + e.preventDefault(); + DateTimeShortcuts.handleClockQuicklink(num, -1); + }); + time_link = quickElement("a", quickElement("li", time_list), gettext("Midnight"), "href", "#"); + addEvent(time_link, 'click', function(e) { + e.preventDefault(); + DateTimeShortcuts.handleClockQuicklink(num, 0); + }); + time_link = quickElement("a", quickElement("li", time_list), gettext("6 a.m."), "href", "#"); + addEvent(time_link, 'click', function(e) { + e.preventDefault(); + DateTimeShortcuts.handleClockQuicklink(num, 6); + }); + time_link = quickElement("a", quickElement("li", time_list), gettext("Noon"), "href", "#"); + addEvent(time_link, 'click', function(e) { + e.preventDefault(); + DateTimeShortcuts.handleClockQuicklink(num, 12); + }); + time_link = quickElement("a", quickElement("li", time_list), gettext("6 p.m."), "href", "#"); + addEvent(time_link, 'click', function(e) { + e.preventDefault(); + DateTimeShortcuts.handleClockQuicklink(num, 18); + }); + + var cancel_p = quickElement('p', clock_box); + cancel_p.className = 'calendar-cancel'; + var cancel_link = quickElement('a', cancel_p, gettext('Cancel'), 'href', '#'); + addEvent(cancel_link, 'click', function(e) { + e.preventDefault(); + DateTimeShortcuts.dismissClock(num); + }); + + django.jQuery(document).bind('keyup', function(event) { + if (event.which === 27) { + // ESC key closes popup + DateTimeShortcuts.dismissClock(num); + event.preventDefault(); + } + }); + }, + openClock: function(num) { + var clock_box = document.getElementById(DateTimeShortcuts.clockDivName + num); + var clock_link = document.getElementById(DateTimeShortcuts.clockLinkName + num); + + // Recalculate the clockbox position + // is it left-to-right or right-to-left layout ? + if (getStyle(document.body, 'direction') !== 'rtl') { + clock_box.style.left = findPosX(clock_link) + 17 + 'px'; + } + else { + // since style's width is in em, it'd be tough to calculate + // px value of it. let's use an estimated px for now + // TODO: IE returns wrong value for findPosX when in rtl mode + // (it returns as it was left aligned), needs to be fixed. + clock_box.style.left = findPosX(clock_link) - 110 + 'px'; + } + clock_box.style.top = Math.max(0, findPosY(clock_link) - 30) + 'px'; + + // Show the clock box + clock_box.style.display = 'block'; + addEvent(document, 'click', DateTimeShortcuts.dismissClockFunc[num]); + }, + dismissClock: function(num) { + document.getElementById(DateTimeShortcuts.clockDivName + num).style.display = 'none'; + removeEvent(document, 'click', DateTimeShortcuts.dismissClockFunc[num]); + }, + handleClockQuicklink: function(num, val) { + var d; + if (val === -1) { + d = DateTimeShortcuts.now(); + } + else { + d = new Date(1970, 1, 1, val, 0, 0, 0); + } + DateTimeShortcuts.clockInputs[num].value = d.strftime(get_format('TIME_INPUT_FORMATS')[0]); + DateTimeShortcuts.clockInputs[num].focus(); + DateTimeShortcuts.dismissClock(num); + }, + // Add calendar widget to a given field. + addCalendar: function(inp) { + var num = DateTimeShortcuts.calendars.length; + + DateTimeShortcuts.calendarInputs[num] = inp; + DateTimeShortcuts.dismissCalendarFunc[num] = function() { DateTimeShortcuts.dismissCalendar(num); return true; }; + + // Shortcut links (calendar icon and "Today" link) + var shortcuts_span = document.createElement('span'); + shortcuts_span.className = DateTimeShortcuts.shortCutsClass; + inp.parentNode.insertBefore(shortcuts_span, inp.nextSibling); + var today_link = document.createElement('a'); + today_link.setAttribute('href', '#'); + today_link.appendChild(document.createTextNode(gettext('Today'))); + addEvent(today_link, 'click', function(e) { + e.preventDefault(); + DateTimeShortcuts.handleCalendarQuickLink(num, 0); + }); + var cal_link = document.createElement('a'); + cal_link.setAttribute('href', '#'); + cal_link.id = DateTimeShortcuts.calendarLinkName + num; + addEvent(cal_link, 'click', function(e) { + e.preventDefault(); + // avoid triggering the document click handler to dismiss the calendar + e.stopPropagation(); + DateTimeShortcuts.openCalendar(num); + }); + quickElement( + 'span', cal_link, '', + 'class', 'date-icon', + 'title', gettext('Choose a Date') + ); + shortcuts_span.appendChild(document.createTextNode('\u00A0')); + shortcuts_span.appendChild(today_link); + shortcuts_span.appendChild(document.createTextNode('\u00A0|\u00A0')); + shortcuts_span.appendChild(cal_link); + + // Create calendarbox div. + // + // Markup looks like: + // + //
      + //

      + // + // February 2003 + //

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

      Cancel

      + //
      + var cal_box = document.createElement('div'); + cal_box.style.display = 'none'; + cal_box.style.position = 'absolute'; + cal_box.className = 'calendarbox module'; + cal_box.setAttribute('id', DateTimeShortcuts.calendarDivName1 + num); + document.body.appendChild(cal_box); + addEvent(cal_box, 'click', cancelEventPropagation); + + // next-prev links + var cal_nav = quickElement('div', cal_box); + var cal_nav_prev = quickElement('a', cal_nav, '<', 'href', '#'); + cal_nav_prev.className = 'calendarnav-previous'; + addEvent(cal_nav_prev, 'click', function(e) { + e.preventDefault(); + DateTimeShortcuts.drawPrev(num); + }); + + var cal_nav_next = quickElement('a', cal_nav, '>', 'href', '#'); + cal_nav_next.className = 'calendarnav-next'; + addEvent(cal_nav_next, 'click', function(e) { + e.preventDefault(); + DateTimeShortcuts.drawNext(num); + }); + + // main box + var cal_main = quickElement('div', cal_box, '', 'id', DateTimeShortcuts.calendarDivName2 + num); + cal_main.className = 'calendar'; + DateTimeShortcuts.calendars[num] = new Calendar(DateTimeShortcuts.calendarDivName2 + num, DateTimeShortcuts.handleCalendarCallback(num)); + DateTimeShortcuts.calendars[num].drawCurrent(); + + // calendar shortcuts + var shortcuts = quickElement('div', cal_box); + shortcuts.className = 'calendar-shortcuts'; + var day_link = quickElement('a', shortcuts, gettext('Yesterday'), 'href', '#'); + addEvent(day_link, 'click', function(e) { + e.preventDefault(); + DateTimeShortcuts.handleCalendarQuickLink(num, -1); + }); + shortcuts.appendChild(document.createTextNode('\u00A0|\u00A0')); + day_link = quickElement('a', shortcuts, gettext('Today'), 'href', '#'); + addEvent(day_link, 'click', function(e) { + e.preventDefault(); + DateTimeShortcuts.handleCalendarQuickLink(num, 0); + }); + shortcuts.appendChild(document.createTextNode('\u00A0|\u00A0')); + day_link = quickElement('a', shortcuts, gettext('Tomorrow'), 'href', '#'); + addEvent(day_link, 'click', function(e) { + e.preventDefault(); + DateTimeShortcuts.handleCalendarQuickLink(num, +1); + }); + + // cancel bar + var cancel_p = quickElement('p', cal_box); + cancel_p.className = 'calendar-cancel'; + var cancel_link = quickElement('a', cancel_p, gettext('Cancel'), 'href', '#'); + addEvent(cancel_link, 'click', function(e) { + e.preventDefault(); + DateTimeShortcuts.dismissCalendar(num); + }); + django.jQuery(document).bind('keyup', function(event) { + if (event.which === 27) { + // ESC key closes popup + DateTimeShortcuts.dismissCalendar(num); + event.preventDefault(); + } + }); + }, + openCalendar: function(num) { + var cal_box = document.getElementById(DateTimeShortcuts.calendarDivName1 + num); + var cal_link = document.getElementById(DateTimeShortcuts.calendarLinkName + num); + var inp = DateTimeShortcuts.calendarInputs[num]; + + // Determine if the current value in the input has a valid date. + // If so, draw the calendar with that date's year and month. + if (inp.value) { + var format = get_format('DATE_INPUT_FORMATS')[0]; + var selected = inp.value.strptime(format); + var year = selected.getUTCFullYear(); + var month = selected.getUTCMonth() + 1; + var re = /\d{4}/; + if (re.test(year.toString()) && month >= 1 && month <= 12) { + DateTimeShortcuts.calendars[num].drawDate(month, year, selected); + } + } + + // Recalculate the clockbox position + // is it left-to-right or right-to-left layout ? + if (getStyle(document.body, 'direction') !== 'rtl') { + cal_box.style.left = findPosX(cal_link) + 17 + 'px'; + } + else { + // since style's width is in em, it'd be tough to calculate + // px value of it. let's use an estimated px for now + // TODO: IE returns wrong value for findPosX when in rtl mode + // (it returns as it was left aligned), needs to be fixed. + cal_box.style.left = findPosX(cal_link) - 180 + 'px'; + } + cal_box.style.top = Math.max(0, findPosY(cal_link) - 75) + 'px'; + + cal_box.style.display = 'block'; + addEvent(document, 'click', DateTimeShortcuts.dismissCalendarFunc[num]); + }, + dismissCalendar: function(num) { + document.getElementById(DateTimeShortcuts.calendarDivName1 + num).style.display = 'none'; + removeEvent(document, 'click', DateTimeShortcuts.dismissCalendarFunc[num]); + }, + drawPrev: function(num) { + DateTimeShortcuts.calendars[num].drawPreviousMonth(); + }, + drawNext: function(num) { + DateTimeShortcuts.calendars[num].drawNextMonth(); + }, + handleCalendarCallback: function(num) { + var format = get_format('DATE_INPUT_FORMATS')[0]; + // the format needs to be escaped a little + format = format.replace('\\', '\\\\'); + format = format.replace('\r', '\\r'); + format = format.replace('\n', '\\n'); + format = format.replace('\t', '\\t'); + format = format.replace("'", "\\'"); + return function(y, m, d) { + DateTimeShortcuts.calendarInputs[num].value = new Date(y, m - 1, d).strftime(format); + DateTimeShortcuts.calendarInputs[num].focus(); + document.getElementById(DateTimeShortcuts.calendarDivName1 + num).style.display = 'none'; + }; + }, + handleCalendarQuickLink: function(num, offset) { + var d = DateTimeShortcuts.now(); + d.setDate(d.getDate() + offset); + DateTimeShortcuts.calendarInputs[num].value = d.strftime(get_format('DATE_INPUT_FORMATS')[0]); + DateTimeShortcuts.calendarInputs[num].focus(); + DateTimeShortcuts.dismissCalendar(num); + } + }; + + addEvent(window, 'load', DateTimeShortcuts.init); + window.DateTimeShortcuts = DateTimeShortcuts; +})(); diff --git a/static/admin/js/admin/DateTimeShortcuts.1536fb6bea1d.js.gz b/static/admin/js/admin/DateTimeShortcuts.1536fb6bea1d.js.gz new file mode 100644 index 0000000..1a05b13 Binary files /dev/null and b/static/admin/js/admin/DateTimeShortcuts.1536fb6bea1d.js.gz differ diff --git a/static/admin/js/admin/DateTimeShortcuts.js b/static/admin/js/admin/DateTimeShortcuts.js new file mode 100644 index 0000000..ce86593 --- /dev/null +++ b/static/admin/js/admin/DateTimeShortcuts.js @@ -0,0 +1,431 @@ +/*global addEvent, Calendar, cancelEventPropagation, findPosX, findPosY, getStyle, get_format, gettext, interpolate, ngettext, quickElement, removeEvent*/ +// Inserts shortcut buttons after all of the following: +// +// +(function() { + 'use strict'; + var DateTimeShortcuts = { + calendars: [], + calendarInputs: [], + clockInputs: [], + dismissClockFunc: [], + dismissCalendarFunc: [], + calendarDivName1: 'calendarbox', // name of calendar
      that gets toggled + calendarDivName2: 'calendarin', // name of
      that contains calendar + calendarLinkName: 'calendarlink',// name of the link that is used to toggle + clockDivName: 'clockbox', // name of clock
      that gets toggled + clockLinkName: 'clocklink', // name of the link that is used to toggle + shortCutsClass: 'datetimeshortcuts', // class of the clock and cal shortcuts + timezoneWarningClass: 'timezonewarning', // class of the warning for timezone mismatch + timezoneOffset: 0, + init: function() { + var body = document.getElementsByTagName('body')[0]; + var serverOffset = body.getAttribute('data-admin-utc-offset'); + if (serverOffset) { + var localOffset = new Date().getTimezoneOffset() * -60; + DateTimeShortcuts.timezoneOffset = localOffset - serverOffset; + } + + var inputs = document.getElementsByTagName('input'); + for (var i = 0; i < inputs.length; i++) { + var inp = inputs[i]; + if (inp.getAttribute('type') === 'text' && inp.className.match(/vTimeField/)) { + DateTimeShortcuts.addClock(inp); + DateTimeShortcuts.addTimezoneWarning(inp); + } + else if (inp.getAttribute('type') === 'text' && inp.className.match(/vDateField/)) { + DateTimeShortcuts.addCalendar(inp); + DateTimeShortcuts.addTimezoneWarning(inp); + } + } + }, + // Return the current time while accounting for the server timezone. + now: function() { + var body = document.getElementsByTagName('body')[0]; + var serverOffset = body.getAttribute('data-admin-utc-offset'); + if (serverOffset) { + var localNow = new Date(); + var localOffset = localNow.getTimezoneOffset() * -60; + localNow.setTime(localNow.getTime() + 1000 * (serverOffset - localOffset)); + return localNow; + } else { + return new Date(); + } + }, + // Add a warning when the time zone in the browser and backend do not match. + addTimezoneWarning: function(inp) { + var $ = django.jQuery; + var warningClass = DateTimeShortcuts.timezoneWarningClass; + var timezoneOffset = DateTimeShortcuts.timezoneOffset / 3600; + + // Only warn if there is a time zone mismatch. + if (!timezoneOffset) { + return; + } + + // Check if warning is already there. + if ($(inp).siblings('.' + warningClass).length) { + return; + } + + var message; + if (timezoneOffset > 0) { + message = ngettext( + 'Note: You are %s hour ahead of server time.', + 'Note: You are %s hours ahead of server time.', + timezoneOffset + ); + } + else { + timezoneOffset *= -1; + message = ngettext( + 'Note: You are %s hour behind server time.', + 'Note: You are %s hours behind server time.', + timezoneOffset + ); + } + message = interpolate(message, [timezoneOffset]); + + var $warning = $(''); + $warning.attr('class', warningClass); + $warning.text(message); + + $(inp).parent() + .append($('
      ')) + .append($warning); + }, + // Add clock widget to a given field + addClock: function(inp) { + var num = DateTimeShortcuts.clockInputs.length; + DateTimeShortcuts.clockInputs[num] = inp; + DateTimeShortcuts.dismissClockFunc[num] = function() { DateTimeShortcuts.dismissClock(num); return true; }; + + // Shortcut links (clock icon and "Now" link) + var shortcuts_span = document.createElement('span'); + shortcuts_span.className = DateTimeShortcuts.shortCutsClass; + inp.parentNode.insertBefore(shortcuts_span, inp.nextSibling); + var now_link = document.createElement('a'); + now_link.setAttribute('href', "#"); + now_link.appendChild(document.createTextNode(gettext('Now'))); + addEvent(now_link, 'click', function(e) { + e.preventDefault(); + DateTimeShortcuts.handleClockQuicklink(num, -1); + }); + var clock_link = document.createElement('a'); + clock_link.setAttribute('href', '#'); + clock_link.id = DateTimeShortcuts.clockLinkName + num; + addEvent(clock_link, 'click', function(e) { + e.preventDefault(); + // avoid triggering the document click handler to dismiss the clock + e.stopPropagation(); + DateTimeShortcuts.openClock(num); + }); + + quickElement( + 'span', clock_link, '', + 'class', 'clock-icon', + 'title', gettext('Choose a Time') + ); + shortcuts_span.appendChild(document.createTextNode('\u00A0')); + shortcuts_span.appendChild(now_link); + shortcuts_span.appendChild(document.createTextNode('\u00A0|\u00A0')); + shortcuts_span.appendChild(clock_link); + + // Create clock link div + // + // Markup looks like: + //
      + //

      Choose a time

      + // + //

      Cancel

      + //
      + + var clock_box = document.createElement('div'); + clock_box.style.display = 'none'; + clock_box.style.position = 'absolute'; + clock_box.className = 'clockbox module'; + clock_box.setAttribute('id', DateTimeShortcuts.clockDivName + num); + document.body.appendChild(clock_box); + addEvent(clock_box, 'click', cancelEventPropagation); + + quickElement('h2', clock_box, gettext('Choose a time')); + var time_list = quickElement('ul', clock_box); + time_list.className = 'timelist'; + var time_link = quickElement("a", quickElement("li", time_list), gettext("Now"), "href", "#"); + addEvent(time_link, 'click', function(e) { + e.preventDefault(); + DateTimeShortcuts.handleClockQuicklink(num, -1); + }); + time_link = quickElement("a", quickElement("li", time_list), gettext("Midnight"), "href", "#"); + addEvent(time_link, 'click', function(e) { + e.preventDefault(); + DateTimeShortcuts.handleClockQuicklink(num, 0); + }); + time_link = quickElement("a", quickElement("li", time_list), gettext("6 a.m."), "href", "#"); + addEvent(time_link, 'click', function(e) { + e.preventDefault(); + DateTimeShortcuts.handleClockQuicklink(num, 6); + }); + time_link = quickElement("a", quickElement("li", time_list), gettext("Noon"), "href", "#"); + addEvent(time_link, 'click', function(e) { + e.preventDefault(); + DateTimeShortcuts.handleClockQuicklink(num, 12); + }); + time_link = quickElement("a", quickElement("li", time_list), gettext("6 p.m."), "href", "#"); + addEvent(time_link, 'click', function(e) { + e.preventDefault(); + DateTimeShortcuts.handleClockQuicklink(num, 18); + }); + + var cancel_p = quickElement('p', clock_box); + cancel_p.className = 'calendar-cancel'; + var cancel_link = quickElement('a', cancel_p, gettext('Cancel'), 'href', '#'); + addEvent(cancel_link, 'click', function(e) { + e.preventDefault(); + DateTimeShortcuts.dismissClock(num); + }); + + django.jQuery(document).bind('keyup', function(event) { + if (event.which === 27) { + // ESC key closes popup + DateTimeShortcuts.dismissClock(num); + event.preventDefault(); + } + }); + }, + openClock: function(num) { + var clock_box = document.getElementById(DateTimeShortcuts.clockDivName + num); + var clock_link = document.getElementById(DateTimeShortcuts.clockLinkName + num); + + // Recalculate the clockbox position + // is it left-to-right or right-to-left layout ? + if (getStyle(document.body, 'direction') !== 'rtl') { + clock_box.style.left = findPosX(clock_link) + 17 + 'px'; + } + else { + // since style's width is in em, it'd be tough to calculate + // px value of it. let's use an estimated px for now + // TODO: IE returns wrong value for findPosX when in rtl mode + // (it returns as it was left aligned), needs to be fixed. + clock_box.style.left = findPosX(clock_link) - 110 + 'px'; + } + clock_box.style.top = Math.max(0, findPosY(clock_link) - 30) + 'px'; + + // Show the clock box + clock_box.style.display = 'block'; + addEvent(document, 'click', DateTimeShortcuts.dismissClockFunc[num]); + }, + dismissClock: function(num) { + document.getElementById(DateTimeShortcuts.clockDivName + num).style.display = 'none'; + removeEvent(document, 'click', DateTimeShortcuts.dismissClockFunc[num]); + }, + handleClockQuicklink: function(num, val) { + var d; + if (val === -1) { + d = DateTimeShortcuts.now(); + } + else { + d = new Date(1970, 1, 1, val, 0, 0, 0); + } + DateTimeShortcuts.clockInputs[num].value = d.strftime(get_format('TIME_INPUT_FORMATS')[0]); + DateTimeShortcuts.clockInputs[num].focus(); + DateTimeShortcuts.dismissClock(num); + }, + // Add calendar widget to a given field. + addCalendar: function(inp) { + var num = DateTimeShortcuts.calendars.length; + + DateTimeShortcuts.calendarInputs[num] = inp; + DateTimeShortcuts.dismissCalendarFunc[num] = function() { DateTimeShortcuts.dismissCalendar(num); return true; }; + + // Shortcut links (calendar icon and "Today" link) + var shortcuts_span = document.createElement('span'); + shortcuts_span.className = DateTimeShortcuts.shortCutsClass; + inp.parentNode.insertBefore(shortcuts_span, inp.nextSibling); + var today_link = document.createElement('a'); + today_link.setAttribute('href', '#'); + today_link.appendChild(document.createTextNode(gettext('Today'))); + addEvent(today_link, 'click', function(e) { + e.preventDefault(); + DateTimeShortcuts.handleCalendarQuickLink(num, 0); + }); + var cal_link = document.createElement('a'); + cal_link.setAttribute('href', '#'); + cal_link.id = DateTimeShortcuts.calendarLinkName + num; + addEvent(cal_link, 'click', function(e) { + e.preventDefault(); + // avoid triggering the document click handler to dismiss the calendar + e.stopPropagation(); + DateTimeShortcuts.openCalendar(num); + }); + quickElement( + 'span', cal_link, '', + 'class', 'date-icon', + 'title', gettext('Choose a Date') + ); + shortcuts_span.appendChild(document.createTextNode('\u00A0')); + shortcuts_span.appendChild(today_link); + shortcuts_span.appendChild(document.createTextNode('\u00A0|\u00A0')); + shortcuts_span.appendChild(cal_link); + + // Create calendarbox div. + // + // Markup looks like: + // + //
      + //

      + // + // February 2003 + //

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

      Cancel

      + //
      + var cal_box = document.createElement('div'); + cal_box.style.display = 'none'; + cal_box.style.position = 'absolute'; + cal_box.className = 'calendarbox module'; + cal_box.setAttribute('id', DateTimeShortcuts.calendarDivName1 + num); + document.body.appendChild(cal_box); + addEvent(cal_box, 'click', cancelEventPropagation); + + // next-prev links + var cal_nav = quickElement('div', cal_box); + var cal_nav_prev = quickElement('a', cal_nav, '<', 'href', '#'); + cal_nav_prev.className = 'calendarnav-previous'; + addEvent(cal_nav_prev, 'click', function(e) { + e.preventDefault(); + DateTimeShortcuts.drawPrev(num); + }); + + var cal_nav_next = quickElement('a', cal_nav, '>', 'href', '#'); + cal_nav_next.className = 'calendarnav-next'; + addEvent(cal_nav_next, 'click', function(e) { + e.preventDefault(); + DateTimeShortcuts.drawNext(num); + }); + + // main box + var cal_main = quickElement('div', cal_box, '', 'id', DateTimeShortcuts.calendarDivName2 + num); + cal_main.className = 'calendar'; + DateTimeShortcuts.calendars[num] = new Calendar(DateTimeShortcuts.calendarDivName2 + num, DateTimeShortcuts.handleCalendarCallback(num)); + DateTimeShortcuts.calendars[num].drawCurrent(); + + // calendar shortcuts + var shortcuts = quickElement('div', cal_box); + shortcuts.className = 'calendar-shortcuts'; + var day_link = quickElement('a', shortcuts, gettext('Yesterday'), 'href', '#'); + addEvent(day_link, 'click', function(e) { + e.preventDefault(); + DateTimeShortcuts.handleCalendarQuickLink(num, -1); + }); + shortcuts.appendChild(document.createTextNode('\u00A0|\u00A0')); + day_link = quickElement('a', shortcuts, gettext('Today'), 'href', '#'); + addEvent(day_link, 'click', function(e) { + e.preventDefault(); + DateTimeShortcuts.handleCalendarQuickLink(num, 0); + }); + shortcuts.appendChild(document.createTextNode('\u00A0|\u00A0')); + day_link = quickElement('a', shortcuts, gettext('Tomorrow'), 'href', '#'); + addEvent(day_link, 'click', function(e) { + e.preventDefault(); + DateTimeShortcuts.handleCalendarQuickLink(num, +1); + }); + + // cancel bar + var cancel_p = quickElement('p', cal_box); + cancel_p.className = 'calendar-cancel'; + var cancel_link = quickElement('a', cancel_p, gettext('Cancel'), 'href', '#'); + addEvent(cancel_link, 'click', function(e) { + e.preventDefault(); + DateTimeShortcuts.dismissCalendar(num); + }); + django.jQuery(document).bind('keyup', function(event) { + if (event.which === 27) { + // ESC key closes popup + DateTimeShortcuts.dismissCalendar(num); + event.preventDefault(); + } + }); + }, + openCalendar: function(num) { + var cal_box = document.getElementById(DateTimeShortcuts.calendarDivName1 + num); + var cal_link = document.getElementById(DateTimeShortcuts.calendarLinkName + num); + var inp = DateTimeShortcuts.calendarInputs[num]; + + // Determine if the current value in the input has a valid date. + // If so, draw the calendar with that date's year and month. + if (inp.value) { + var format = get_format('DATE_INPUT_FORMATS')[0]; + var selected = inp.value.strptime(format); + var year = selected.getUTCFullYear(); + var month = selected.getUTCMonth() + 1; + var re = /\d{4}/; + if (re.test(year.toString()) && month >= 1 && month <= 12) { + DateTimeShortcuts.calendars[num].drawDate(month, year, selected); + } + } + + // Recalculate the clockbox position + // is it left-to-right or right-to-left layout ? + if (getStyle(document.body, 'direction') !== 'rtl') { + cal_box.style.left = findPosX(cal_link) + 17 + 'px'; + } + else { + // since style's width is in em, it'd be tough to calculate + // px value of it. let's use an estimated px for now + // TODO: IE returns wrong value for findPosX when in rtl mode + // (it returns as it was left aligned), needs to be fixed. + cal_box.style.left = findPosX(cal_link) - 180 + 'px'; + } + cal_box.style.top = Math.max(0, findPosY(cal_link) - 75) + 'px'; + + cal_box.style.display = 'block'; + addEvent(document, 'click', DateTimeShortcuts.dismissCalendarFunc[num]); + }, + dismissCalendar: function(num) { + document.getElementById(DateTimeShortcuts.calendarDivName1 + num).style.display = 'none'; + removeEvent(document, 'click', DateTimeShortcuts.dismissCalendarFunc[num]); + }, + drawPrev: function(num) { + DateTimeShortcuts.calendars[num].drawPreviousMonth(); + }, + drawNext: function(num) { + DateTimeShortcuts.calendars[num].drawNextMonth(); + }, + handleCalendarCallback: function(num) { + var format = get_format('DATE_INPUT_FORMATS')[0]; + // the format needs to be escaped a little + format = format.replace('\\', '\\\\'); + format = format.replace('\r', '\\r'); + format = format.replace('\n', '\\n'); + format = format.replace('\t', '\\t'); + format = format.replace("'", "\\'"); + return function(y, m, d) { + DateTimeShortcuts.calendarInputs[num].value = new Date(y, m - 1, d).strftime(format); + DateTimeShortcuts.calendarInputs[num].focus(); + document.getElementById(DateTimeShortcuts.calendarDivName1 + num).style.display = 'none'; + }; + }, + handleCalendarQuickLink: function(num, offset) { + var d = DateTimeShortcuts.now(); + d.setDate(d.getDate() + offset); + DateTimeShortcuts.calendarInputs[num].value = d.strftime(get_format('DATE_INPUT_FORMATS')[0]); + DateTimeShortcuts.calendarInputs[num].focus(); + DateTimeShortcuts.dismissCalendar(num); + } + }; + + addEvent(window, 'load', DateTimeShortcuts.init); + window.DateTimeShortcuts = DateTimeShortcuts; +})(); diff --git a/static/admin/js/admin/DateTimeShortcuts.js.gz b/static/admin/js/admin/DateTimeShortcuts.js.gz new file mode 100644 index 0000000..1a05b13 Binary files /dev/null and b/static/admin/js/admin/DateTimeShortcuts.js.gz differ diff --git a/static/admin/js/admin/RelatedObjectLookups.183db436487a.js b/static/admin/js/admin/RelatedObjectLookups.183db436487a.js new file mode 100644 index 0000000..d2dda89 --- /dev/null +++ b/static/admin/js/admin/RelatedObjectLookups.183db436487a.js @@ -0,0 +1,175 @@ +/*global SelectBox, interpolate*/ +// Handles related-objects functionality: lookup link for raw_id_fields +// and Add Another links. + +(function($) { + 'use strict'; + + // IE doesn't accept periods or dashes in the window name, but the element IDs + // we use to generate popup window names may contain them, therefore we map them + // to allowed characters in a reversible way so that we can locate the correct + // element when the popup window is dismissed. + function id_to_windowname(text) { + text = text.replace(/\./g, '__dot__'); + text = text.replace(/\-/g, '__dash__'); + return text; + } + + function windowname_to_id(text) { + text = text.replace(/__dot__/g, '.'); + text = text.replace(/__dash__/g, '-'); + return text; + } + + function showAdminPopup(triggeringLink, name_regexp, add_popup) { + var name = triggeringLink.id.replace(name_regexp, ''); + name = id_to_windowname(name); + var href = triggeringLink.href; + if (add_popup) { + if (href.indexOf('?') === -1) { + href += '?_popup=1'; + } else { + href += '&_popup=1'; + } + } + var win = window.open(href, name, 'height=500,width=800,resizable=yes,scrollbars=yes'); + win.focus(); + return false; + } + + function showRelatedObjectLookupPopup(triggeringLink) { + return showAdminPopup(triggeringLink, /^lookup_/, true); + } + + function dismissRelatedLookupPopup(win, chosenId) { + var name = windowname_to_id(win.name); + var elem = document.getElementById(name); + if (elem.className.indexOf('vManyToManyRawIdAdminField') !== -1 && elem.value) { + elem.value += ',' + chosenId; + } else { + document.getElementById(name).value = chosenId; + } + win.close(); + } + + function showRelatedObjectPopup(triggeringLink) { + return showAdminPopup(triggeringLink, /^(change|add|delete)_/, false); + } + + function updateRelatedObjectLinks(triggeringLink) { + var $this = $(triggeringLink); + var siblings = $this.nextAll('.change-related, .delete-related'); + if (!siblings.length) { + return; + } + var value = $this.val(); + if (value) { + siblings.each(function() { + var elm = $(this); + elm.attr('href', elm.attr('data-href-template').replace('__fk__', value)); + }); + } else { + siblings.removeAttr('href'); + } + } + + function dismissAddRelatedObjectPopup(win, newId, newRepr) { + var name = windowname_to_id(win.name); + var elem = document.getElementById(name); + if (elem) { + var elemName = elem.nodeName.toUpperCase(); + if (elemName === 'SELECT') { + elem.options[elem.options.length] = new Option(newRepr, newId, true, true); + } else if (elemName === 'INPUT') { + if (elem.className.indexOf('vManyToManyRawIdAdminField') !== -1 && elem.value) { + elem.value += ',' + newId; + } else { + elem.value = newId; + } + } + // Trigger a change event to update related links if required. + $(elem).trigger('change'); + } else { + var toId = name + "_to"; + var o = new Option(newRepr, newId); + SelectBox.add_to_cache(toId, o); + SelectBox.redisplay(toId); + } + win.close(); + } + + function dismissChangeRelatedObjectPopup(win, objId, newRepr, newId) { + var id = windowname_to_id(win.name).replace(/^edit_/, ''); + var selectsSelector = interpolate('#%s, #%s_from, #%s_to', [id, id, id]); + var selects = $(selectsSelector); + selects.find('option').each(function() { + if (this.value === objId) { + this.textContent = newRepr; + this.value = newId; + } + }); + win.close(); + } + + function dismissDeleteRelatedObjectPopup(win, objId) { + var id = windowname_to_id(win.name).replace(/^delete_/, ''); + var selectsSelector = interpolate('#%s, #%s_from, #%s_to', [id, id, id]); + var selects = $(selectsSelector); + selects.find('option').each(function() { + if (this.value === objId) { + $(this).remove(); + } + }).trigger('change'); + win.close(); + } + + // Global for testing purposes + window.id_to_windowname = id_to_windowname; + window.windowname_to_id = windowname_to_id; + + window.showRelatedObjectLookupPopup = showRelatedObjectLookupPopup; + window.dismissRelatedLookupPopup = dismissRelatedLookupPopup; + window.showRelatedObjectPopup = showRelatedObjectPopup; + window.updateRelatedObjectLinks = updateRelatedObjectLinks; + window.dismissAddRelatedObjectPopup = dismissAddRelatedObjectPopup; + window.dismissChangeRelatedObjectPopup = dismissChangeRelatedObjectPopup; + window.dismissDeleteRelatedObjectPopup = dismissDeleteRelatedObjectPopup; + + // Kept for backward compatibility + window.showAddAnotherPopup = showRelatedObjectPopup; + window.dismissAddAnotherPopup = dismissAddRelatedObjectPopup; + + $(document).ready(function() { + $("a[data-popup-opener]").click(function(event) { + event.preventDefault(); + opener.dismissRelatedLookupPopup(window, $(this).data("popup-opener")); + }); + $('body').on('click', '.related-widget-wrapper-link', function(e) { + e.preventDefault(); + if (this.href) { + var event = $.Event('django:show-related', {href: this.href}); + $(this).trigger(event); + if (!event.isDefaultPrevented()) { + showRelatedObjectPopup(this); + } + } + }); + $('body').on('change', '.related-widget-wrapper select', function(e) { + var event = $.Event('django:update-related'); + $(this).trigger(event); + if (!event.isDefaultPrevented()) { + updateRelatedObjectLinks(this); + } + }); + $('.related-widget-wrapper select').trigger('change'); + $('.related-lookup').click(function(e) { + e.preventDefault(); + var event = $.Event('django:lookup-related'); + $(this).trigger(event); + if (!event.isDefaultPrevented()) { + showRelatedObjectLookupPopup(this); + } + }); + }); + +})(django.jQuery); diff --git a/static/admin/js/admin/RelatedObjectLookups.183db436487a.js.gz b/static/admin/js/admin/RelatedObjectLookups.183db436487a.js.gz new file mode 100644 index 0000000..7a6a9ce Binary files /dev/null and b/static/admin/js/admin/RelatedObjectLookups.183db436487a.js.gz differ diff --git a/static/admin/js/admin/RelatedObjectLookups.js b/static/admin/js/admin/RelatedObjectLookups.js new file mode 100644 index 0000000..d2dda89 --- /dev/null +++ b/static/admin/js/admin/RelatedObjectLookups.js @@ -0,0 +1,175 @@ +/*global SelectBox, interpolate*/ +// Handles related-objects functionality: lookup link for raw_id_fields +// and Add Another links. + +(function($) { + 'use strict'; + + // IE doesn't accept periods or dashes in the window name, but the element IDs + // we use to generate popup window names may contain them, therefore we map them + // to allowed characters in a reversible way so that we can locate the correct + // element when the popup window is dismissed. + function id_to_windowname(text) { + text = text.replace(/\./g, '__dot__'); + text = text.replace(/\-/g, '__dash__'); + return text; + } + + function windowname_to_id(text) { + text = text.replace(/__dot__/g, '.'); + text = text.replace(/__dash__/g, '-'); + return text; + } + + function showAdminPopup(triggeringLink, name_regexp, add_popup) { + var name = triggeringLink.id.replace(name_regexp, ''); + name = id_to_windowname(name); + var href = triggeringLink.href; + if (add_popup) { + if (href.indexOf('?') === -1) { + href += '?_popup=1'; + } else { + href += '&_popup=1'; + } + } + var win = window.open(href, name, 'height=500,width=800,resizable=yes,scrollbars=yes'); + win.focus(); + return false; + } + + function showRelatedObjectLookupPopup(triggeringLink) { + return showAdminPopup(triggeringLink, /^lookup_/, true); + } + + function dismissRelatedLookupPopup(win, chosenId) { + var name = windowname_to_id(win.name); + var elem = document.getElementById(name); + if (elem.className.indexOf('vManyToManyRawIdAdminField') !== -1 && elem.value) { + elem.value += ',' + chosenId; + } else { + document.getElementById(name).value = chosenId; + } + win.close(); + } + + function showRelatedObjectPopup(triggeringLink) { + return showAdminPopup(triggeringLink, /^(change|add|delete)_/, false); + } + + function updateRelatedObjectLinks(triggeringLink) { + var $this = $(triggeringLink); + var siblings = $this.nextAll('.change-related, .delete-related'); + if (!siblings.length) { + return; + } + var value = $this.val(); + if (value) { + siblings.each(function() { + var elm = $(this); + elm.attr('href', elm.attr('data-href-template').replace('__fk__', value)); + }); + } else { + siblings.removeAttr('href'); + } + } + + function dismissAddRelatedObjectPopup(win, newId, newRepr) { + var name = windowname_to_id(win.name); + var elem = document.getElementById(name); + if (elem) { + var elemName = elem.nodeName.toUpperCase(); + if (elemName === 'SELECT') { + elem.options[elem.options.length] = new Option(newRepr, newId, true, true); + } else if (elemName === 'INPUT') { + if (elem.className.indexOf('vManyToManyRawIdAdminField') !== -1 && elem.value) { + elem.value += ',' + newId; + } else { + elem.value = newId; + } + } + // Trigger a change event to update related links if required. + $(elem).trigger('change'); + } else { + var toId = name + "_to"; + var o = new Option(newRepr, newId); + SelectBox.add_to_cache(toId, o); + SelectBox.redisplay(toId); + } + win.close(); + } + + function dismissChangeRelatedObjectPopup(win, objId, newRepr, newId) { + var id = windowname_to_id(win.name).replace(/^edit_/, ''); + var selectsSelector = interpolate('#%s, #%s_from, #%s_to', [id, id, id]); + var selects = $(selectsSelector); + selects.find('option').each(function() { + if (this.value === objId) { + this.textContent = newRepr; + this.value = newId; + } + }); + win.close(); + } + + function dismissDeleteRelatedObjectPopup(win, objId) { + var id = windowname_to_id(win.name).replace(/^delete_/, ''); + var selectsSelector = interpolate('#%s, #%s_from, #%s_to', [id, id, id]); + var selects = $(selectsSelector); + selects.find('option').each(function() { + if (this.value === objId) { + $(this).remove(); + } + }).trigger('change'); + win.close(); + } + + // Global for testing purposes + window.id_to_windowname = id_to_windowname; + window.windowname_to_id = windowname_to_id; + + window.showRelatedObjectLookupPopup = showRelatedObjectLookupPopup; + window.dismissRelatedLookupPopup = dismissRelatedLookupPopup; + window.showRelatedObjectPopup = showRelatedObjectPopup; + window.updateRelatedObjectLinks = updateRelatedObjectLinks; + window.dismissAddRelatedObjectPopup = dismissAddRelatedObjectPopup; + window.dismissChangeRelatedObjectPopup = dismissChangeRelatedObjectPopup; + window.dismissDeleteRelatedObjectPopup = dismissDeleteRelatedObjectPopup; + + // Kept for backward compatibility + window.showAddAnotherPopup = showRelatedObjectPopup; + window.dismissAddAnotherPopup = dismissAddRelatedObjectPopup; + + $(document).ready(function() { + $("a[data-popup-opener]").click(function(event) { + event.preventDefault(); + opener.dismissRelatedLookupPopup(window, $(this).data("popup-opener")); + }); + $('body').on('click', '.related-widget-wrapper-link', function(e) { + e.preventDefault(); + if (this.href) { + var event = $.Event('django:show-related', {href: this.href}); + $(this).trigger(event); + if (!event.isDefaultPrevented()) { + showRelatedObjectPopup(this); + } + } + }); + $('body').on('change', '.related-widget-wrapper select', function(e) { + var event = $.Event('django:update-related'); + $(this).trigger(event); + if (!event.isDefaultPrevented()) { + updateRelatedObjectLinks(this); + } + }); + $('.related-widget-wrapper select').trigger('change'); + $('.related-lookup').click(function(e) { + e.preventDefault(); + var event = $.Event('django:lookup-related'); + $(this).trigger(event); + if (!event.isDefaultPrevented()) { + showRelatedObjectLookupPopup(this); + } + }); + }); + +})(django.jQuery); diff --git a/static/admin/js/admin/RelatedObjectLookups.js.gz b/static/admin/js/admin/RelatedObjectLookups.js.gz new file mode 100644 index 0000000..7a6a9ce Binary files /dev/null and b/static/admin/js/admin/RelatedObjectLookups.js.gz differ diff --git a/static/admin/js/calendar.9ac94d055fbd.js b/static/admin/js/calendar.9ac94d055fbd.js new file mode 100644 index 0000000..5765560 --- /dev/null +++ b/static/admin/js/calendar.9ac94d055fbd.js @@ -0,0 +1,208 @@ +/*global gettext, pgettext, get_format, quickElement, removeChildren, addEvent*/ +/* +calendar.js - Calendar functions by Adrian Holovaty +depends on core.js for utility functions like removeChildren or quickElement +*/ + +(function() { + 'use strict'; + // CalendarNamespace -- Provides a collection of HTML calendar-related helper functions + var CalendarNamespace = { + monthsOfYear: [ + gettext('January'), + gettext('February'), + gettext('March'), + gettext('April'), + gettext('May'), + gettext('June'), + gettext('July'), + gettext('August'), + gettext('September'), + gettext('October'), + gettext('November'), + gettext('December') + ], + daysOfWeek: [ + pgettext('one letter Sunday', 'S'), + pgettext('one letter Monday', 'M'), + pgettext('one letter Tuesday', 'T'), + pgettext('one letter Wednesday', 'W'), + pgettext('one letter Thursday', 'T'), + pgettext('one letter Friday', 'F'), + pgettext('one letter Saturday', 'S') + ], + firstDayOfWeek: parseInt(get_format('FIRST_DAY_OF_WEEK')), + isLeapYear: function(year) { + return (((year % 4) === 0) && ((year % 100) !== 0 ) || ((year % 400) === 0)); + }, + getDaysInMonth: function(month, year) { + var days; + if (month === 1 || month === 3 || month === 5 || month === 7 || month === 8 || month === 10 || month === 12) { + days = 31; + } + else if (month === 4 || month === 6 || month === 9 || month === 11) { + days = 30; + } + else if (month === 2 && CalendarNamespace.isLeapYear(year)) { + days = 29; + } + else { + days = 28; + } + return days; + }, + draw: function(month, year, div_id, callback, selected) { // month = 1-12, year = 1-9999 + var today = new Date(); + var todayDay = today.getDate(); + var todayMonth = today.getMonth() + 1; + var todayYear = today.getFullYear(); + var todayClass = ''; + + // Use UTC functions here because the date field does not contain time + // and using the UTC function variants prevent the local time offset + // from altering the date, specifically the day field. For example: + // + // ``` + // var x = new Date('2013-10-02'); + // var day = x.getDate(); + // ``` + // + // The day variable above will be 1 instead of 2 in, say, US Pacific time + // zone. + var isSelectedMonth = false; + if (typeof selected !== 'undefined') { + isSelectedMonth = (selected.getUTCFullYear() === year && (selected.getUTCMonth() + 1) === month); + } + + month = parseInt(month); + year = parseInt(year); + var calDiv = document.getElementById(div_id); + removeChildren(calDiv); + var calTable = document.createElement('table'); + quickElement('caption', calTable, CalendarNamespace.monthsOfYear[month - 1] + ' ' + year); + var tableBody = quickElement('tbody', calTable); + + // Draw days-of-week header + var tableRow = quickElement('tr', tableBody); + for (var i = 0; i < 7; i++) { + quickElement('th', tableRow, CalendarNamespace.daysOfWeek[(i + CalendarNamespace.firstDayOfWeek) % 7]); + } + + var startingPos = new Date(year, month - 1, 1 - CalendarNamespace.firstDayOfWeek).getDay(); + var days = CalendarNamespace.getDaysInMonth(month, year); + + var nonDayCell; + + // Draw blanks before first of month + tableRow = quickElement('tr', tableBody); + for (i = 0; i < startingPos; i++) { + nonDayCell = quickElement('td', tableRow, ' '); + nonDayCell.className = "nonday"; + } + + function calendarMonth(y, m) { + function onClick(e) { + e.preventDefault(); + callback(y, m, django.jQuery(this).text()); + } + return onClick; + } + + // Draw days of month + var currentDay = 1; + for (i = startingPos; currentDay <= days; i++) { + if (i % 7 === 0 && currentDay !== 1) { + tableRow = quickElement('tr', tableBody); + } + if ((currentDay === todayDay) && (month === todayMonth) && (year === todayYear)) { + todayClass = 'today'; + } else { + todayClass = ''; + } + + // use UTC function; see above for explanation. + if (isSelectedMonth && currentDay === selected.getUTCDate()) { + if (todayClass !== '') { + todayClass += " "; + } + todayClass += "selected"; + } + + var cell = quickElement('td', tableRow, '', 'class', todayClass); + var link = quickElement('a', cell, currentDay, 'href', '#'); + addEvent(link, 'click', calendarMonth(year, month)); + currentDay++; + } + + // Draw blanks after end of month (optional, but makes for valid code) + while (tableRow.childNodes.length < 7) { + nonDayCell = quickElement('td', tableRow, ' '); + nonDayCell.className = "nonday"; + } + + calDiv.appendChild(calTable); + } + }; + + // Calendar -- A calendar instance + function Calendar(div_id, callback, selected) { + // div_id (string) is the ID of the element in which the calendar will + // be displayed + // callback (string) is the name of a JavaScript function that will be + // called with the parameters (year, month, day) when a day in the + // calendar is clicked + this.div_id = div_id; + this.callback = callback; + this.today = new Date(); + this.currentMonth = this.today.getMonth() + 1; + this.currentYear = this.today.getFullYear(); + if (typeof selected !== 'undefined') { + this.selected = selected; + } + } + Calendar.prototype = { + drawCurrent: function() { + CalendarNamespace.draw(this.currentMonth, this.currentYear, this.div_id, this.callback, this.selected); + }, + drawDate: function(month, year, selected) { + this.currentMonth = month; + this.currentYear = year; + + if(selected) { + this.selected = selected; + } + + this.drawCurrent(); + }, + drawPreviousMonth: function() { + if (this.currentMonth === 1) { + this.currentMonth = 12; + this.currentYear--; + } + else { + this.currentMonth--; + } + this.drawCurrent(); + }, + drawNextMonth: function() { + if (this.currentMonth === 12) { + this.currentMonth = 1; + this.currentYear++; + } + else { + this.currentMonth++; + } + this.drawCurrent(); + }, + drawPreviousYear: function() { + this.currentYear--; + this.drawCurrent(); + }, + drawNextYear: function() { + this.currentYear++; + this.drawCurrent(); + } + }; + window.Calendar = Calendar; + window.CalendarNamespace = CalendarNamespace; +})(); diff --git a/static/admin/js/calendar.9ac94d055fbd.js.gz b/static/admin/js/calendar.9ac94d055fbd.js.gz new file mode 100644 index 0000000..0283a59 Binary files /dev/null and b/static/admin/js/calendar.9ac94d055fbd.js.gz differ diff --git a/static/admin/js/calendar.js b/static/admin/js/calendar.js new file mode 100644 index 0000000..5765560 --- /dev/null +++ b/static/admin/js/calendar.js @@ -0,0 +1,208 @@ +/*global gettext, pgettext, get_format, quickElement, removeChildren, addEvent*/ +/* +calendar.js - Calendar functions by Adrian Holovaty +depends on core.js for utility functions like removeChildren or quickElement +*/ + +(function() { + 'use strict'; + // CalendarNamespace -- Provides a collection of HTML calendar-related helper functions + var CalendarNamespace = { + monthsOfYear: [ + gettext('January'), + gettext('February'), + gettext('March'), + gettext('April'), + gettext('May'), + gettext('June'), + gettext('July'), + gettext('August'), + gettext('September'), + gettext('October'), + gettext('November'), + gettext('December') + ], + daysOfWeek: [ + pgettext('one letter Sunday', 'S'), + pgettext('one letter Monday', 'M'), + pgettext('one letter Tuesday', 'T'), + pgettext('one letter Wednesday', 'W'), + pgettext('one letter Thursday', 'T'), + pgettext('one letter Friday', 'F'), + pgettext('one letter Saturday', 'S') + ], + firstDayOfWeek: parseInt(get_format('FIRST_DAY_OF_WEEK')), + isLeapYear: function(year) { + return (((year % 4) === 0) && ((year % 100) !== 0 ) || ((year % 400) === 0)); + }, + getDaysInMonth: function(month, year) { + var days; + if (month === 1 || month === 3 || month === 5 || month === 7 || month === 8 || month === 10 || month === 12) { + days = 31; + } + else if (month === 4 || month === 6 || month === 9 || month === 11) { + days = 30; + } + else if (month === 2 && CalendarNamespace.isLeapYear(year)) { + days = 29; + } + else { + days = 28; + } + return days; + }, + draw: function(month, year, div_id, callback, selected) { // month = 1-12, year = 1-9999 + var today = new Date(); + var todayDay = today.getDate(); + var todayMonth = today.getMonth() + 1; + var todayYear = today.getFullYear(); + var todayClass = ''; + + // Use UTC functions here because the date field does not contain time + // and using the UTC function variants prevent the local time offset + // from altering the date, specifically the day field. For example: + // + // ``` + // var x = new Date('2013-10-02'); + // var day = x.getDate(); + // ``` + // + // The day variable above will be 1 instead of 2 in, say, US Pacific time + // zone. + var isSelectedMonth = false; + if (typeof selected !== 'undefined') { + isSelectedMonth = (selected.getUTCFullYear() === year && (selected.getUTCMonth() + 1) === month); + } + + month = parseInt(month); + year = parseInt(year); + var calDiv = document.getElementById(div_id); + removeChildren(calDiv); + var calTable = document.createElement('table'); + quickElement('caption', calTable, CalendarNamespace.monthsOfYear[month - 1] + ' ' + year); + var tableBody = quickElement('tbody', calTable); + + // Draw days-of-week header + var tableRow = quickElement('tr', tableBody); + for (var i = 0; i < 7; i++) { + quickElement('th', tableRow, CalendarNamespace.daysOfWeek[(i + CalendarNamespace.firstDayOfWeek) % 7]); + } + + var startingPos = new Date(year, month - 1, 1 - CalendarNamespace.firstDayOfWeek).getDay(); + var days = CalendarNamespace.getDaysInMonth(month, year); + + var nonDayCell; + + // Draw blanks before first of month + tableRow = quickElement('tr', tableBody); + for (i = 0; i < startingPos; i++) { + nonDayCell = quickElement('td', tableRow, ' '); + nonDayCell.className = "nonday"; + } + + function calendarMonth(y, m) { + function onClick(e) { + e.preventDefault(); + callback(y, m, django.jQuery(this).text()); + } + return onClick; + } + + // Draw days of month + var currentDay = 1; + for (i = startingPos; currentDay <= days; i++) { + if (i % 7 === 0 && currentDay !== 1) { + tableRow = quickElement('tr', tableBody); + } + if ((currentDay === todayDay) && (month === todayMonth) && (year === todayYear)) { + todayClass = 'today'; + } else { + todayClass = ''; + } + + // use UTC function; see above for explanation. + if (isSelectedMonth && currentDay === selected.getUTCDate()) { + if (todayClass !== '') { + todayClass += " "; + } + todayClass += "selected"; + } + + var cell = quickElement('td', tableRow, '', 'class', todayClass); + var link = quickElement('a', cell, currentDay, 'href', '#'); + addEvent(link, 'click', calendarMonth(year, month)); + currentDay++; + } + + // Draw blanks after end of month (optional, but makes for valid code) + while (tableRow.childNodes.length < 7) { + nonDayCell = quickElement('td', tableRow, ' '); + nonDayCell.className = "nonday"; + } + + calDiv.appendChild(calTable); + } + }; + + // Calendar -- A calendar instance + function Calendar(div_id, callback, selected) { + // div_id (string) is the ID of the element in which the calendar will + // be displayed + // callback (string) is the name of a JavaScript function that will be + // called with the parameters (year, month, day) when a day in the + // calendar is clicked + this.div_id = div_id; + this.callback = callback; + this.today = new Date(); + this.currentMonth = this.today.getMonth() + 1; + this.currentYear = this.today.getFullYear(); + if (typeof selected !== 'undefined') { + this.selected = selected; + } + } + Calendar.prototype = { + drawCurrent: function() { + CalendarNamespace.draw(this.currentMonth, this.currentYear, this.div_id, this.callback, this.selected); + }, + drawDate: function(month, year, selected) { + this.currentMonth = month; + this.currentYear = year; + + if(selected) { + this.selected = selected; + } + + this.drawCurrent(); + }, + drawPreviousMonth: function() { + if (this.currentMonth === 1) { + this.currentMonth = 12; + this.currentYear--; + } + else { + this.currentMonth--; + } + this.drawCurrent(); + }, + drawNextMonth: function() { + if (this.currentMonth === 12) { + this.currentMonth = 1; + this.currentYear++; + } + else { + this.currentMonth++; + } + this.drawCurrent(); + }, + drawPreviousYear: function() { + this.currentYear--; + this.drawCurrent(); + }, + drawNextYear: function() { + this.currentYear++; + this.drawCurrent(); + } + }; + window.Calendar = Calendar; + window.CalendarNamespace = CalendarNamespace; +})(); diff --git a/static/admin/js/calendar.js.gz b/static/admin/js/calendar.js.gz new file mode 100644 index 0000000..0283a59 Binary files /dev/null and b/static/admin/js/calendar.js.gz differ diff --git a/static/admin/js/cancel.1d69cba4b4bf.js b/static/admin/js/cancel.1d69cba4b4bf.js new file mode 100644 index 0000000..b641387 --- /dev/null +++ b/static/admin/js/cancel.1d69cba4b4bf.js @@ -0,0 +1,9 @@ +(function($) { + 'use strict'; + $(function() { + $('.cancel-link').click(function(e) { + e.preventDefault(); + window.history.back(); + }); + }); +})(django.jQuery); diff --git a/static/admin/js/cancel.1d69cba4b4bf.js.gz b/static/admin/js/cancel.1d69cba4b4bf.js.gz new file mode 100644 index 0000000..4804ca3 Binary files /dev/null and b/static/admin/js/cancel.1d69cba4b4bf.js.gz differ diff --git a/static/admin/js/cancel.js b/static/admin/js/cancel.js new file mode 100644 index 0000000..b641387 --- /dev/null +++ b/static/admin/js/cancel.js @@ -0,0 +1,9 @@ +(function($) { + 'use strict'; + $(function() { + $('.cancel-link').click(function(e) { + e.preventDefault(); + window.history.back(); + }); + }); +})(django.jQuery); diff --git a/static/admin/js/cancel.js.gz b/static/admin/js/cancel.js.gz new file mode 100644 index 0000000..4804ca3 Binary files /dev/null and b/static/admin/js/cancel.js.gz differ diff --git a/static/admin/js/change_form.d224f77c6b61.js b/static/admin/js/change_form.d224f77c6b61.js new file mode 100644 index 0000000..994b523 --- /dev/null +++ b/static/admin/js/change_form.d224f77c6b61.js @@ -0,0 +1,20 @@ +/*global showAddAnotherPopup, showRelatedObjectLookupPopup showRelatedObjectPopup updateRelatedObjectLinks*/ + +(function($) { + 'use strict'; + $(document).ready(function() { + var modelName = $('#django-admin-form-add-constants').data('modelName'); + $('.add-another').click(function(e) { + e.preventDefault(); + var event = $.Event('django:add-another-related'); + $(this).trigger(event); + if (!event.isDefaultPrevented()) { + showAddAnotherPopup(this); + } + }); + + if (modelName) { + $('form#' + modelName + '_form :input:visible:enabled:first').focus(); + } + }); +})(django.jQuery); diff --git a/static/admin/js/change_form.d224f77c6b61.js.gz b/static/admin/js/change_form.d224f77c6b61.js.gz new file mode 100644 index 0000000..0f82049 Binary files /dev/null and b/static/admin/js/change_form.d224f77c6b61.js.gz differ diff --git a/static/admin/js/change_form.js b/static/admin/js/change_form.js new file mode 100644 index 0000000..994b523 --- /dev/null +++ b/static/admin/js/change_form.js @@ -0,0 +1,20 @@ +/*global showAddAnotherPopup, showRelatedObjectLookupPopup showRelatedObjectPopup updateRelatedObjectLinks*/ + +(function($) { + 'use strict'; + $(document).ready(function() { + var modelName = $('#django-admin-form-add-constants').data('modelName'); + $('.add-another').click(function(e) { + e.preventDefault(); + var event = $.Event('django:add-another-related'); + $(this).trigger(event); + if (!event.isDefaultPrevented()) { + showAddAnotherPopup(this); + } + }); + + if (modelName) { + $('form#' + modelName + '_form :input:visible:enabled:first').focus(); + } + }); +})(django.jQuery); diff --git a/static/admin/js/change_form.js.gz b/static/admin/js/change_form.js.gz new file mode 100644 index 0000000..0f82049 Binary files /dev/null and b/static/admin/js/change_form.js.gz differ diff --git a/static/admin/js/collapse.17d715df2104.js b/static/admin/js/collapse.17d715df2104.js new file mode 100644 index 0000000..7cb9362 --- /dev/null +++ b/static/admin/js/collapse.17d715df2104.js @@ -0,0 +1,26 @@ +/*global gettext*/ +(function($) { + 'use strict'; + $(document).ready(function() { + // Add anchor tag for Show/Hide link + $("fieldset.collapse").each(function(i, elem) { + // Don't hide if fields in this fieldset have errors + if ($(elem).find("div.errors").length === 0) { + $(elem).addClass("collapsed").find("h2").first().append(' (' + gettext("Show") + + ')'); + } + }); + // Add toggle to anchor tag + $("fieldset.collapse a.collapse-toggle").click(function(ev) { + if ($(this).closest("fieldset").hasClass("collapsed")) { + // Show + $(this).text(gettext("Hide")).closest("fieldset").removeClass("collapsed").trigger("show.fieldset", [$(this).attr("id")]); + } else { + // Hide + $(this).text(gettext("Show")).closest("fieldset").addClass("collapsed").trigger("hide.fieldset", [$(this).attr("id")]); + } + return false; + }); + }); +})(django.jQuery); diff --git a/static/admin/js/collapse.17d715df2104.js.gz b/static/admin/js/collapse.17d715df2104.js.gz new file mode 100644 index 0000000..c7f767e Binary files /dev/null and b/static/admin/js/collapse.17d715df2104.js.gz differ diff --git a/static/admin/js/collapse.js b/static/admin/js/collapse.js new file mode 100644 index 0000000..7cb9362 --- /dev/null +++ b/static/admin/js/collapse.js @@ -0,0 +1,26 @@ +/*global gettext*/ +(function($) { + 'use strict'; + $(document).ready(function() { + // Add anchor tag for Show/Hide link + $("fieldset.collapse").each(function(i, elem) { + // Don't hide if fields in this fieldset have errors + if ($(elem).find("div.errors").length === 0) { + $(elem).addClass("collapsed").find("h2").first().append(' (' + gettext("Show") + + ')'); + } + }); + // Add toggle to anchor tag + $("fieldset.collapse a.collapse-toggle").click(function(ev) { + if ($(this).closest("fieldset").hasClass("collapsed")) { + // Show + $(this).text(gettext("Hide")).closest("fieldset").removeClass("collapsed").trigger("show.fieldset", [$(this).attr("id")]); + } else { + // Hide + $(this).text(gettext("Show")).closest("fieldset").addClass("collapsed").trigger("hide.fieldset", [$(this).attr("id")]); + } + return false; + }); + }); +})(django.jQuery); diff --git a/static/admin/js/collapse.js.gz b/static/admin/js/collapse.js.gz new file mode 100644 index 0000000..c7f767e Binary files /dev/null and b/static/admin/js/collapse.js.gz differ diff --git a/static/admin/js/collapse.min.dc930adb2821.js b/static/admin/js/collapse.min.dc930adb2821.js new file mode 100644 index 0000000..6251d91 --- /dev/null +++ b/static/admin/js/collapse.min.dc930adb2821.js @@ -0,0 +1,2 @@ +(function(a){a(document).ready(function(){a("fieldset.collapse").each(function(b,c){0===a(c).find("div.errors").length&&a(c).addClass("collapsed").find("h2").first().append(' ('+gettext("Show")+")")});a("fieldset.collapse a.collapse-toggle").click(function(b){a(this).closest("fieldset").hasClass("collapsed")?a(this).text(gettext("Hide")).closest("fieldset").removeClass("collapsed").trigger("show.fieldset",[a(this).attr("id")]):a(this).text(gettext("Show")).closest("fieldset").addClass("collapsed").trigger("hide.fieldset", +[a(this).attr("id")]);return!1})})})(django.jQuery); diff --git a/static/admin/js/collapse.min.dc930adb2821.js.gz b/static/admin/js/collapse.min.dc930adb2821.js.gz new file mode 100644 index 0000000..8e38b6b Binary files /dev/null and b/static/admin/js/collapse.min.dc930adb2821.js.gz differ diff --git a/static/admin/js/collapse.min.js b/static/admin/js/collapse.min.js new file mode 100644 index 0000000..6251d91 --- /dev/null +++ b/static/admin/js/collapse.min.js @@ -0,0 +1,2 @@ +(function(a){a(document).ready(function(){a("fieldset.collapse").each(function(b,c){0===a(c).find("div.errors").length&&a(c).addClass("collapsed").find("h2").first().append(' ('+gettext("Show")+")")});a("fieldset.collapse a.collapse-toggle").click(function(b){a(this).closest("fieldset").hasClass("collapsed")?a(this).text(gettext("Hide")).closest("fieldset").removeClass("collapsed").trigger("show.fieldset",[a(this).attr("id")]):a(this).text(gettext("Show")).closest("fieldset").addClass("collapsed").trigger("hide.fieldset", +[a(this).attr("id")]);return!1})})})(django.jQuery); diff --git a/static/admin/js/collapse.min.js.gz b/static/admin/js/collapse.min.js.gz new file mode 100644 index 0000000..8e38b6b Binary files /dev/null and b/static/admin/js/collapse.min.js.gz differ diff --git a/static/admin/js/core.fd861d43f0f5.js b/static/admin/js/core.fd861d43f0f5.js new file mode 100644 index 0000000..edccdc0 --- /dev/null +++ b/static/admin/js/core.fd861d43f0f5.js @@ -0,0 +1,250 @@ +// Core javascript helper functions + +// basic browser identification & version +var isOpera = (navigator.userAgent.indexOf("Opera") >= 0) && parseFloat(navigator.appVersion); +var isIE = ((document.all) && (!isOpera)) && parseFloat(navigator.appVersion.split("MSIE ")[1].split(";")[0]); + +// Cross-browser event handlers. +function addEvent(obj, evType, fn) { + 'use strict'; + if (obj.addEventListener) { + obj.addEventListener(evType, fn, false); + return true; + } else if (obj.attachEvent) { + var r = obj.attachEvent("on" + evType, fn); + return r; + } else { + return false; + } +} + +function removeEvent(obj, evType, fn) { + 'use strict'; + if (obj.removeEventListener) { + obj.removeEventListener(evType, fn, false); + return true; + } else if (obj.detachEvent) { + obj.detachEvent("on" + evType, fn); + return true; + } else { + return false; + } +} + +function cancelEventPropagation(e) { + 'use strict'; + if (!e) { + e = window.event; + } + e.cancelBubble = true; + if (e.stopPropagation) { + e.stopPropagation(); + } +} + +// quickElement(tagType, parentReference [, textInChildNode, attribute, attributeValue ...]); +function quickElement() { + 'use strict'; + var obj = document.createElement(arguments[0]); + if (arguments[2]) { + var textNode = document.createTextNode(arguments[2]); + obj.appendChild(textNode); + } + var len = arguments.length; + for (var i = 3; i < len; i += 2) { + obj.setAttribute(arguments[i], arguments[i + 1]); + } + arguments[1].appendChild(obj); + return obj; +} + +// "a" is reference to an object +function removeChildren(a) { + 'use strict'; + while (a.hasChildNodes()) { + a.removeChild(a.lastChild); + } +} + +// ---------------------------------------------------------------------------- +// Find-position functions by PPK +// See http://www.quirksmode.org/js/findpos.html +// ---------------------------------------------------------------------------- +function findPosX(obj) { + 'use strict'; + var curleft = 0; + if (obj.offsetParent) { + while (obj.offsetParent) { + curleft += obj.offsetLeft - ((isOpera) ? 0 : obj.scrollLeft); + obj = obj.offsetParent; + } + // IE offsetParent does not include the top-level + if (isIE && obj.parentElement) { + curleft += obj.offsetLeft - obj.scrollLeft; + } + } else if (obj.x) { + curleft += obj.x; + } + return curleft; +} + +function findPosY(obj) { + 'use strict'; + var curtop = 0; + if (obj.offsetParent) { + while (obj.offsetParent) { + curtop += obj.offsetTop - ((isOpera) ? 0 : obj.scrollTop); + obj = obj.offsetParent; + } + // IE offsetParent does not include the top-level + if (isIE && obj.parentElement) { + curtop += obj.offsetTop - obj.scrollTop; + } + } else if (obj.y) { + curtop += obj.y; + } + return curtop; +} + +//----------------------------------------------------------------------------- +// Date object extensions +// ---------------------------------------------------------------------------- +(function() { + 'use strict'; + Date.prototype.getTwelveHours = function() { + var hours = this.getHours(); + if (hours === 0) { + return 12; + } + else { + return hours <= 12 ? hours : hours - 12; + } + }; + + Date.prototype.getTwoDigitMonth = function() { + return (this.getMonth() < 9) ? '0' + (this.getMonth() + 1) : (this.getMonth() + 1); + }; + + Date.prototype.getTwoDigitDate = function() { + return (this.getDate() < 10) ? '0' + this.getDate() : this.getDate(); + }; + + Date.prototype.getTwoDigitTwelveHour = function() { + return (this.getTwelveHours() < 10) ? '0' + this.getTwelveHours() : this.getTwelveHours(); + }; + + Date.prototype.getTwoDigitHour = function() { + return (this.getHours() < 10) ? '0' + this.getHours() : this.getHours(); + }; + + Date.prototype.getTwoDigitMinute = function() { + return (this.getMinutes() < 10) ? '0' + this.getMinutes() : this.getMinutes(); + }; + + Date.prototype.getTwoDigitSecond = function() { + return (this.getSeconds() < 10) ? '0' + this.getSeconds() : this.getSeconds(); + }; + + Date.prototype.getHourMinute = function() { + return this.getTwoDigitHour() + ':' + this.getTwoDigitMinute(); + }; + + Date.prototype.getHourMinuteSecond = function() { + return this.getTwoDigitHour() + ':' + this.getTwoDigitMinute() + ':' + this.getTwoDigitSecond(); + }; + + Date.prototype.getFullMonthName = function() { + return typeof window.CalendarNamespace === "undefined" + ? this.getTwoDigitMonth() + : window.CalendarNamespace.monthsOfYear[this.getMonth()]; + }; + + Date.prototype.strftime = function(format) { + var fields = { + B: this.getFullMonthName(), + c: this.toString(), + d: this.getTwoDigitDate(), + H: this.getTwoDigitHour(), + I: this.getTwoDigitTwelveHour(), + m: this.getTwoDigitMonth(), + M: this.getTwoDigitMinute(), + p: (this.getHours() >= 12) ? 'PM' : 'AM', + S: this.getTwoDigitSecond(), + w: '0' + this.getDay(), + x: this.toLocaleDateString(), + X: this.toLocaleTimeString(), + y: ('' + this.getFullYear()).substr(2, 4), + Y: '' + this.getFullYear(), + '%': '%' + }; + var result = '', i = 0; + while (i < format.length) { + if (format.charAt(i) === '%') { + result = result + fields[format.charAt(i + 1)]; + ++i; + } + else { + result = result + format.charAt(i); + } + ++i; + } + return result; + }; + +// ---------------------------------------------------------------------------- +// String object extensions +// ---------------------------------------------------------------------------- + String.prototype.pad_left = function(pad_length, pad_string) { + var new_string = this; + for (var i = 0; new_string.length < pad_length; i++) { + new_string = pad_string + new_string; + } + return new_string; + }; + + String.prototype.strptime = function(format) { + var split_format = format.split(/[.\-/]/); + var date = this.split(/[.\-/]/); + var i = 0; + var day, month, year; + while (i < split_format.length) { + switch (split_format[i]) { + case "%d": + day = date[i]; + break; + case "%m": + month = date[i] - 1; + break; + case "%Y": + year = date[i]; + break; + case "%y": + year = date[i]; + break; + } + ++i; + } + // Create Date object from UTC since the parsed value is supposed to be + // in UTC, not local time. Also, the calendar uses UTC functions for + // date extraction. + return new Date(Date.UTC(year, month, day)); + }; + +})(); +// ---------------------------------------------------------------------------- +// Get the computed style for and element +// ---------------------------------------------------------------------------- +function getStyle(oElm, strCssRule) { + 'use strict'; + var strValue = ""; + if(document.defaultView && document.defaultView.getComputedStyle) { + strValue = document.defaultView.getComputedStyle(oElm, "").getPropertyValue(strCssRule); + } + else if(oElm.currentStyle) { + strCssRule = strCssRule.replace(/\-(\w)/g, function(strMatch, p1) { + return p1.toUpperCase(); + }); + strValue = oElm.currentStyle[strCssRule]; + } + return strValue; +} diff --git a/static/admin/js/core.fd861d43f0f5.js.gz b/static/admin/js/core.fd861d43f0f5.js.gz new file mode 100644 index 0000000..8b84556 Binary files /dev/null and b/static/admin/js/core.fd861d43f0f5.js.gz differ diff --git a/static/admin/js/core.js b/static/admin/js/core.js new file mode 100644 index 0000000..edccdc0 --- /dev/null +++ b/static/admin/js/core.js @@ -0,0 +1,250 @@ +// Core javascript helper functions + +// basic browser identification & version +var isOpera = (navigator.userAgent.indexOf("Opera") >= 0) && parseFloat(navigator.appVersion); +var isIE = ((document.all) && (!isOpera)) && parseFloat(navigator.appVersion.split("MSIE ")[1].split(";")[0]); + +// Cross-browser event handlers. +function addEvent(obj, evType, fn) { + 'use strict'; + if (obj.addEventListener) { + obj.addEventListener(evType, fn, false); + return true; + } else if (obj.attachEvent) { + var r = obj.attachEvent("on" + evType, fn); + return r; + } else { + return false; + } +} + +function removeEvent(obj, evType, fn) { + 'use strict'; + if (obj.removeEventListener) { + obj.removeEventListener(evType, fn, false); + return true; + } else if (obj.detachEvent) { + obj.detachEvent("on" + evType, fn); + return true; + } else { + return false; + } +} + +function cancelEventPropagation(e) { + 'use strict'; + if (!e) { + e = window.event; + } + e.cancelBubble = true; + if (e.stopPropagation) { + e.stopPropagation(); + } +} + +// quickElement(tagType, parentReference [, textInChildNode, attribute, attributeValue ...]); +function quickElement() { + 'use strict'; + var obj = document.createElement(arguments[0]); + if (arguments[2]) { + var textNode = document.createTextNode(arguments[2]); + obj.appendChild(textNode); + } + var len = arguments.length; + for (var i = 3; i < len; i += 2) { + obj.setAttribute(arguments[i], arguments[i + 1]); + } + arguments[1].appendChild(obj); + return obj; +} + +// "a" is reference to an object +function removeChildren(a) { + 'use strict'; + while (a.hasChildNodes()) { + a.removeChild(a.lastChild); + } +} + +// ---------------------------------------------------------------------------- +// Find-position functions by PPK +// See http://www.quirksmode.org/js/findpos.html +// ---------------------------------------------------------------------------- +function findPosX(obj) { + 'use strict'; + var curleft = 0; + if (obj.offsetParent) { + while (obj.offsetParent) { + curleft += obj.offsetLeft - ((isOpera) ? 0 : obj.scrollLeft); + obj = obj.offsetParent; + } + // IE offsetParent does not include the top-level + if (isIE && obj.parentElement) { + curleft += obj.offsetLeft - obj.scrollLeft; + } + } else if (obj.x) { + curleft += obj.x; + } + return curleft; +} + +function findPosY(obj) { + 'use strict'; + var curtop = 0; + if (obj.offsetParent) { + while (obj.offsetParent) { + curtop += obj.offsetTop - ((isOpera) ? 0 : obj.scrollTop); + obj = obj.offsetParent; + } + // IE offsetParent does not include the top-level + if (isIE && obj.parentElement) { + curtop += obj.offsetTop - obj.scrollTop; + } + } else if (obj.y) { + curtop += obj.y; + } + return curtop; +} + +//----------------------------------------------------------------------------- +// Date object extensions +// ---------------------------------------------------------------------------- +(function() { + 'use strict'; + Date.prototype.getTwelveHours = function() { + var hours = this.getHours(); + if (hours === 0) { + return 12; + } + else { + return hours <= 12 ? hours : hours - 12; + } + }; + + Date.prototype.getTwoDigitMonth = function() { + return (this.getMonth() < 9) ? '0' + (this.getMonth() + 1) : (this.getMonth() + 1); + }; + + Date.prototype.getTwoDigitDate = function() { + return (this.getDate() < 10) ? '0' + this.getDate() : this.getDate(); + }; + + Date.prototype.getTwoDigitTwelveHour = function() { + return (this.getTwelveHours() < 10) ? '0' + this.getTwelveHours() : this.getTwelveHours(); + }; + + Date.prototype.getTwoDigitHour = function() { + return (this.getHours() < 10) ? '0' + this.getHours() : this.getHours(); + }; + + Date.prototype.getTwoDigitMinute = function() { + return (this.getMinutes() < 10) ? '0' + this.getMinutes() : this.getMinutes(); + }; + + Date.prototype.getTwoDigitSecond = function() { + return (this.getSeconds() < 10) ? '0' + this.getSeconds() : this.getSeconds(); + }; + + Date.prototype.getHourMinute = function() { + return this.getTwoDigitHour() + ':' + this.getTwoDigitMinute(); + }; + + Date.prototype.getHourMinuteSecond = function() { + return this.getTwoDigitHour() + ':' + this.getTwoDigitMinute() + ':' + this.getTwoDigitSecond(); + }; + + Date.prototype.getFullMonthName = function() { + return typeof window.CalendarNamespace === "undefined" + ? this.getTwoDigitMonth() + : window.CalendarNamespace.monthsOfYear[this.getMonth()]; + }; + + Date.prototype.strftime = function(format) { + var fields = { + B: this.getFullMonthName(), + c: this.toString(), + d: this.getTwoDigitDate(), + H: this.getTwoDigitHour(), + I: this.getTwoDigitTwelveHour(), + m: this.getTwoDigitMonth(), + M: this.getTwoDigitMinute(), + p: (this.getHours() >= 12) ? 'PM' : 'AM', + S: this.getTwoDigitSecond(), + w: '0' + this.getDay(), + x: this.toLocaleDateString(), + X: this.toLocaleTimeString(), + y: ('' + this.getFullYear()).substr(2, 4), + Y: '' + this.getFullYear(), + '%': '%' + }; + var result = '', i = 0; + while (i < format.length) { + if (format.charAt(i) === '%') { + result = result + fields[format.charAt(i + 1)]; + ++i; + } + else { + result = result + format.charAt(i); + } + ++i; + } + return result; + }; + +// ---------------------------------------------------------------------------- +// String object extensions +// ---------------------------------------------------------------------------- + String.prototype.pad_left = function(pad_length, pad_string) { + var new_string = this; + for (var i = 0; new_string.length < pad_length; i++) { + new_string = pad_string + new_string; + } + return new_string; + }; + + String.prototype.strptime = function(format) { + var split_format = format.split(/[.\-/]/); + var date = this.split(/[.\-/]/); + var i = 0; + var day, month, year; + while (i < split_format.length) { + switch (split_format[i]) { + case "%d": + day = date[i]; + break; + case "%m": + month = date[i] - 1; + break; + case "%Y": + year = date[i]; + break; + case "%y": + year = date[i]; + break; + } + ++i; + } + // Create Date object from UTC since the parsed value is supposed to be + // in UTC, not local time. Also, the calendar uses UTC functions for + // date extraction. + return new Date(Date.UTC(year, month, day)); + }; + +})(); +// ---------------------------------------------------------------------------- +// Get the computed style for and element +// ---------------------------------------------------------------------------- +function getStyle(oElm, strCssRule) { + 'use strict'; + var strValue = ""; + if(document.defaultView && document.defaultView.getComputedStyle) { + strValue = document.defaultView.getComputedStyle(oElm, "").getPropertyValue(strCssRule); + } + else if(oElm.currentStyle) { + strCssRule = strCssRule.replace(/\-(\w)/g, function(strMatch, p1) { + return p1.toUpperCase(); + }); + strValue = oElm.currentStyle[strCssRule]; + } + return strValue; +} diff --git a/static/admin/js/core.js.gz b/static/admin/js/core.js.gz new file mode 100644 index 0000000..8b84556 Binary files /dev/null and b/static/admin/js/core.js.gz differ diff --git a/static/admin/js/inlines.17981b4df24a.js b/static/admin/js/inlines.17981b4df24a.js new file mode 100644 index 0000000..a284d76 --- /dev/null +++ b/static/admin/js/inlines.17981b4df24a.js @@ -0,0 +1,290 @@ +/*global DateTimeShortcuts, SelectFilter*/ +/** + * Django admin inlines + * + * Based on jQuery Formset 1.1 + * @author Stanislaus Madueke (stan DOT madueke AT gmail DOT com) + * @requires jQuery 1.2.6 or later + * + * Copyright (c) 2009, Stanislaus Madueke + * All rights reserved. + * + * Spiced up with Code from Zain Memon's GSoC project 2009 + * and modified for Django by Jannis Leidel, Travis Swicegood and Julien Phalip. + * + * Licensed under the New BSD License + * See: http://www.opensource.org/licenses/bsd-license.php + */ +(function($) { + 'use strict'; + $.fn.formset = function(opts) { + var options = $.extend({}, $.fn.formset.defaults, opts); + var $this = $(this); + var $parent = $this.parent(); + var updateElementIndex = function(el, prefix, ndx) { + var id_regex = new RegExp("(" + prefix + "-(\\d+|__prefix__))"); + var replacement = prefix + "-" + ndx; + if ($(el).prop("for")) { + $(el).prop("for", $(el).prop("for").replace(id_regex, replacement)); + } + if (el.id) { + el.id = el.id.replace(id_regex, replacement); + } + if (el.name) { + el.name = el.name.replace(id_regex, replacement); + } + }; + var totalForms = $("#id_" + options.prefix + "-TOTAL_FORMS").prop("autocomplete", "off"); + var nextIndex = parseInt(totalForms.val(), 10); + var maxForms = $("#id_" + options.prefix + "-MAX_NUM_FORMS").prop("autocomplete", "off"); + // only show the add button if we are allowed to add more items, + // note that max_num = None translates to a blank string. + var showAddButton = maxForms.val() === '' || (maxForms.val() - totalForms.val()) > 0; + $this.each(function(i) { + $(this).not("." + options.emptyCssClass).addClass(options.formCssClass); + }); + if ($this.length && showAddButton) { + var addButton; + if ($this.prop("tagName") === "TR") { + // If forms are laid out as table rows, insert the + // "add" button in a new table row: + var numCols = this.eq(-1).children().length; + $parent.append('' + options.addText + ""); + addButton = $parent.find("tr:last a"); + } else { + // Otherwise, insert it immediately after the last form: + $this.filter(":last").after('"); + addButton = $this.filter(":last").next().find("a"); + } + addButton.click(function(e) { + e.preventDefault(); + var template = $("#" + options.prefix + "-empty"); + var row = template.clone(true); + row.removeClass(options.emptyCssClass) + .addClass(options.formCssClass) + .attr("id", options.prefix + "-" + nextIndex); + if (row.is("tr")) { + // If the forms are laid out in table rows, insert + // the remove button into the last table cell: + row.children(":last").append('"); + } else if (row.is("ul") || row.is("ol")) { + // If they're laid out as an ordered/unordered list, + // insert an
    • after the last list item: + row.append('
    • ' + options.deleteText + "
    • "); + } else { + // Otherwise, just insert the remove button as the + // last child element of the form's container: + row.children(":first").append('' + options.deleteText + ""); + } + row.find("*").each(function() { + updateElementIndex(this, options.prefix, totalForms.val()); + }); + // Insert the new form when it has been fully edited + row.insertBefore($(template)); + // Update number of total forms + $(totalForms).val(parseInt(totalForms.val(), 10) + 1); + nextIndex += 1; + // Hide add button in case we've hit the max, except we want to add infinitely + if ((maxForms.val() !== '') && (maxForms.val() - totalForms.val()) <= 0) { + addButton.parent().hide(); + } + // The delete button of each row triggers a bunch of other things + row.find("a." + options.deleteCssClass).click(function(e1) { + e1.preventDefault(); + // Remove the parent form containing this button: + row.remove(); + nextIndex -= 1; + // If a post-delete callback was provided, call it with the deleted form: + if (options.removed) { + options.removed(row); + } + $(document).trigger('formset:removed', [row, options.prefix]); + // Update the TOTAL_FORMS form count. + var forms = $("." + options.formCssClass); + $("#id_" + options.prefix + "-TOTAL_FORMS").val(forms.length); + // Show add button again once we drop below max + if ((maxForms.val() === '') || (maxForms.val() - forms.length) > 0) { + addButton.parent().show(); + } + // Also, update names and ids for all remaining form controls + // so they remain in sequence: + var i, formCount; + var updateElementCallback = function() { + updateElementIndex(this, options.prefix, i); + }; + for (i = 0, formCount = forms.length; i < formCount; i++) { + updateElementIndex($(forms).get(i), options.prefix, i); + $(forms.get(i)).find("*").each(updateElementCallback); + } + }); + // If a post-add callback was supplied, call it with the added form: + if (options.added) { + options.added(row); + } + $(document).trigger('formset:added', [row, options.prefix]); + }); + } + return this; + }; + + /* Setup plugin defaults */ + $.fn.formset.defaults = { + prefix: "form", // The form prefix for your django formset + addText: "add another", // Text for the add link + deleteText: "remove", // Text for the delete link + addCssClass: "add-row", // CSS class applied to the add link + deleteCssClass: "delete-row", // CSS class applied to the delete link + emptyCssClass: "empty-row", // CSS class applied to the empty row + formCssClass: "dynamic-form", // CSS class applied to each form in a formset + added: null, // Function called each time a new form is added + removed: null // Function called each time a form is deleted + }; + + + // Tabular inlines --------------------------------------------------------- + $.fn.tabularFormset = function(options) { + var $rows = $(this); + var alternatingRows = function(row) { + $($rows.selector).not(".add-row").removeClass("row1 row2") + .filter(":even").addClass("row1").end() + .filter(":odd").addClass("row2"); + }; + + var reinitDateTimeShortCuts = function() { + // Reinitialize the calendar and clock widgets by force + if (typeof DateTimeShortcuts !== "undefined") { + $(".datetimeshortcuts").remove(); + DateTimeShortcuts.init(); + } + }; + + var updateSelectFilter = function() { + // If any SelectFilter widgets are a part of the new form, + // instantiate a new SelectFilter instance for it. + if (typeof SelectFilter !== 'undefined') { + $('.selectfilter').each(function(index, value) { + var namearr = value.name.split('-'); + SelectFilter.init(value.id, namearr[namearr.length - 1], false); + }); + $('.selectfilterstacked').each(function(index, value) { + var namearr = value.name.split('-'); + SelectFilter.init(value.id, namearr[namearr.length - 1], true); + }); + } + }; + + var initPrepopulatedFields = function(row) { + row.find('.prepopulated_field').each(function() { + var field = $(this), + input = field.find('input, select, textarea'), + dependency_list = input.data('dependency_list') || [], + dependencies = []; + $.each(dependency_list, function(i, field_name) { + dependencies.push('#' + row.find('.field-' + field_name).find('input, select, textarea').attr('id')); + }); + if (dependencies.length) { + input.prepopulate(dependencies, input.attr('maxlength')); + } + }); + }; + + $rows.formset({ + prefix: options.prefix, + addText: options.addText, + formCssClass: "dynamic-" + options.prefix, + deleteCssClass: "inline-deletelink", + deleteText: options.deleteText, + emptyCssClass: "empty-form", + removed: alternatingRows, + added: function(row) { + initPrepopulatedFields(row); + reinitDateTimeShortCuts(); + updateSelectFilter(); + alternatingRows(row); + } + }); + + return $rows; + }; + + // Stacked inlines --------------------------------------------------------- + $.fn.stackedFormset = function(options) { + var $rows = $(this); + var updateInlineLabel = function(row) { + $($rows.selector).find(".inline_label").each(function(i) { + var count = i + 1; + $(this).html($(this).html().replace(/(#\d+)/g, "#" + count)); + }); + }; + + var reinitDateTimeShortCuts = function() { + // Reinitialize the calendar and clock widgets by force, yuck. + if (typeof DateTimeShortcuts !== "undefined") { + $(".datetimeshortcuts").remove(); + DateTimeShortcuts.init(); + } + }; + + var updateSelectFilter = function() { + // If any SelectFilter widgets were added, instantiate a new instance. + if (typeof SelectFilter !== "undefined") { + $(".selectfilter").each(function(index, value) { + var namearr = value.name.split('-'); + SelectFilter.init(value.id, namearr[namearr.length - 1], false); + }); + $(".selectfilterstacked").each(function(index, value) { + var namearr = value.name.split('-'); + SelectFilter.init(value.id, namearr[namearr.length - 1], true); + }); + } + }; + + var initPrepopulatedFields = function(row) { + row.find('.prepopulated_field').each(function() { + var field = $(this), + input = field.find('input, select, textarea'), + dependency_list = input.data('dependency_list') || [], + dependencies = []; + $.each(dependency_list, function(i, field_name) { + dependencies.push('#' + row.find('.form-row .field-' + field_name).find('input, select, textarea').attr('id')); + }); + if (dependencies.length) { + input.prepopulate(dependencies, input.attr('maxlength')); + } + }); + }; + + $rows.formset({ + prefix: options.prefix, + addText: options.addText, + formCssClass: "dynamic-" + options.prefix, + deleteCssClass: "inline-deletelink", + deleteText: options.deleteText, + emptyCssClass: "empty-form", + removed: updateInlineLabel, + added: function(row) { + initPrepopulatedFields(row); + reinitDateTimeShortCuts(); + updateSelectFilter(); + updateInlineLabel(row); + } + }); + + return $rows; + }; + + $(document).ready(function() { + $(".js-inline-admin-formset").each(function() { + var data = $(this).data(), + inlineOptions = data.inlineFormset; + switch(data.inlineType) { + case "stacked": + $(inlineOptions.name + "-group .inline-related").stackedFormset(inlineOptions.options); + break; + case "tabular": + $(inlineOptions.name + "-group .tabular.inline-related tbody tr").tabularFormset(inlineOptions.options); + break; + } + }); + }); +})(django.jQuery); diff --git a/static/admin/js/inlines.17981b4df24a.js.gz b/static/admin/js/inlines.17981b4df24a.js.gz new file mode 100644 index 0000000..f69dd3c Binary files /dev/null and b/static/admin/js/inlines.17981b4df24a.js.gz differ diff --git a/static/admin/js/inlines.js b/static/admin/js/inlines.js new file mode 100644 index 0000000..a284d76 --- /dev/null +++ b/static/admin/js/inlines.js @@ -0,0 +1,290 @@ +/*global DateTimeShortcuts, SelectFilter*/ +/** + * Django admin inlines + * + * Based on jQuery Formset 1.1 + * @author Stanislaus Madueke (stan DOT madueke AT gmail DOT com) + * @requires jQuery 1.2.6 or later + * + * Copyright (c) 2009, Stanislaus Madueke + * All rights reserved. + * + * Spiced up with Code from Zain Memon's GSoC project 2009 + * and modified for Django by Jannis Leidel, Travis Swicegood and Julien Phalip. + * + * Licensed under the New BSD License + * See: http://www.opensource.org/licenses/bsd-license.php + */ +(function($) { + 'use strict'; + $.fn.formset = function(opts) { + var options = $.extend({}, $.fn.formset.defaults, opts); + var $this = $(this); + var $parent = $this.parent(); + var updateElementIndex = function(el, prefix, ndx) { + var id_regex = new RegExp("(" + prefix + "-(\\d+|__prefix__))"); + var replacement = prefix + "-" + ndx; + if ($(el).prop("for")) { + $(el).prop("for", $(el).prop("for").replace(id_regex, replacement)); + } + if (el.id) { + el.id = el.id.replace(id_regex, replacement); + } + if (el.name) { + el.name = el.name.replace(id_regex, replacement); + } + }; + var totalForms = $("#id_" + options.prefix + "-TOTAL_FORMS").prop("autocomplete", "off"); + var nextIndex = parseInt(totalForms.val(), 10); + var maxForms = $("#id_" + options.prefix + "-MAX_NUM_FORMS").prop("autocomplete", "off"); + // only show the add button if we are allowed to add more items, + // note that max_num = None translates to a blank string. + var showAddButton = maxForms.val() === '' || (maxForms.val() - totalForms.val()) > 0; + $this.each(function(i) { + $(this).not("." + options.emptyCssClass).addClass(options.formCssClass); + }); + if ($this.length && showAddButton) { + var addButton; + if ($this.prop("tagName") === "TR") { + // If forms are laid out as table rows, insert the + // "add" button in a new table row: + var numCols = this.eq(-1).children().length; + $parent.append('' + options.addText + ""); + addButton = $parent.find("tr:last a"); + } else { + // Otherwise, insert it immediately after the last form: + $this.filter(":last").after('"); + addButton = $this.filter(":last").next().find("a"); + } + addButton.click(function(e) { + e.preventDefault(); + var template = $("#" + options.prefix + "-empty"); + var row = template.clone(true); + row.removeClass(options.emptyCssClass) + .addClass(options.formCssClass) + .attr("id", options.prefix + "-" + nextIndex); + if (row.is("tr")) { + // If the forms are laid out in table rows, insert + // the remove button into the last table cell: + row.children(":last").append('"); + } else if (row.is("ul") || row.is("ol")) { + // If they're laid out as an ordered/unordered list, + // insert an
    • after the last list item: + row.append('
    • ' + options.deleteText + "
    • "); + } else { + // Otherwise, just insert the remove button as the + // last child element of the form's container: + row.children(":first").append('' + options.deleteText + ""); + } + row.find("*").each(function() { + updateElementIndex(this, options.prefix, totalForms.val()); + }); + // Insert the new form when it has been fully edited + row.insertBefore($(template)); + // Update number of total forms + $(totalForms).val(parseInt(totalForms.val(), 10) + 1); + nextIndex += 1; + // Hide add button in case we've hit the max, except we want to add infinitely + if ((maxForms.val() !== '') && (maxForms.val() - totalForms.val()) <= 0) { + addButton.parent().hide(); + } + // The delete button of each row triggers a bunch of other things + row.find("a." + options.deleteCssClass).click(function(e1) { + e1.preventDefault(); + // Remove the parent form containing this button: + row.remove(); + nextIndex -= 1; + // If a post-delete callback was provided, call it with the deleted form: + if (options.removed) { + options.removed(row); + } + $(document).trigger('formset:removed', [row, options.prefix]); + // Update the TOTAL_FORMS form count. + var forms = $("." + options.formCssClass); + $("#id_" + options.prefix + "-TOTAL_FORMS").val(forms.length); + // Show add button again once we drop below max + if ((maxForms.val() === '') || (maxForms.val() - forms.length) > 0) { + addButton.parent().show(); + } + // Also, update names and ids for all remaining form controls + // so they remain in sequence: + var i, formCount; + var updateElementCallback = function() { + updateElementIndex(this, options.prefix, i); + }; + for (i = 0, formCount = forms.length; i < formCount; i++) { + updateElementIndex($(forms).get(i), options.prefix, i); + $(forms.get(i)).find("*").each(updateElementCallback); + } + }); + // If a post-add callback was supplied, call it with the added form: + if (options.added) { + options.added(row); + } + $(document).trigger('formset:added', [row, options.prefix]); + }); + } + return this; + }; + + /* Setup plugin defaults */ + $.fn.formset.defaults = { + prefix: "form", // The form prefix for your django formset + addText: "add another", // Text for the add link + deleteText: "remove", // Text for the delete link + addCssClass: "add-row", // CSS class applied to the add link + deleteCssClass: "delete-row", // CSS class applied to the delete link + emptyCssClass: "empty-row", // CSS class applied to the empty row + formCssClass: "dynamic-form", // CSS class applied to each form in a formset + added: null, // Function called each time a new form is added + removed: null // Function called each time a form is deleted + }; + + + // Tabular inlines --------------------------------------------------------- + $.fn.tabularFormset = function(options) { + var $rows = $(this); + var alternatingRows = function(row) { + $($rows.selector).not(".add-row").removeClass("row1 row2") + .filter(":even").addClass("row1").end() + .filter(":odd").addClass("row2"); + }; + + var reinitDateTimeShortCuts = function() { + // Reinitialize the calendar and clock widgets by force + if (typeof DateTimeShortcuts !== "undefined") { + $(".datetimeshortcuts").remove(); + DateTimeShortcuts.init(); + } + }; + + var updateSelectFilter = function() { + // If any SelectFilter widgets are a part of the new form, + // instantiate a new SelectFilter instance for it. + if (typeof SelectFilter !== 'undefined') { + $('.selectfilter').each(function(index, value) { + var namearr = value.name.split('-'); + SelectFilter.init(value.id, namearr[namearr.length - 1], false); + }); + $('.selectfilterstacked').each(function(index, value) { + var namearr = value.name.split('-'); + SelectFilter.init(value.id, namearr[namearr.length - 1], true); + }); + } + }; + + var initPrepopulatedFields = function(row) { + row.find('.prepopulated_field').each(function() { + var field = $(this), + input = field.find('input, select, textarea'), + dependency_list = input.data('dependency_list') || [], + dependencies = []; + $.each(dependency_list, function(i, field_name) { + dependencies.push('#' + row.find('.field-' + field_name).find('input, select, textarea').attr('id')); + }); + if (dependencies.length) { + input.prepopulate(dependencies, input.attr('maxlength')); + } + }); + }; + + $rows.formset({ + prefix: options.prefix, + addText: options.addText, + formCssClass: "dynamic-" + options.prefix, + deleteCssClass: "inline-deletelink", + deleteText: options.deleteText, + emptyCssClass: "empty-form", + removed: alternatingRows, + added: function(row) { + initPrepopulatedFields(row); + reinitDateTimeShortCuts(); + updateSelectFilter(); + alternatingRows(row); + } + }); + + return $rows; + }; + + // Stacked inlines --------------------------------------------------------- + $.fn.stackedFormset = function(options) { + var $rows = $(this); + var updateInlineLabel = function(row) { + $($rows.selector).find(".inline_label").each(function(i) { + var count = i + 1; + $(this).html($(this).html().replace(/(#\d+)/g, "#" + count)); + }); + }; + + var reinitDateTimeShortCuts = function() { + // Reinitialize the calendar and clock widgets by force, yuck. + if (typeof DateTimeShortcuts !== "undefined") { + $(".datetimeshortcuts").remove(); + DateTimeShortcuts.init(); + } + }; + + var updateSelectFilter = function() { + // If any SelectFilter widgets were added, instantiate a new instance. + if (typeof SelectFilter !== "undefined") { + $(".selectfilter").each(function(index, value) { + var namearr = value.name.split('-'); + SelectFilter.init(value.id, namearr[namearr.length - 1], false); + }); + $(".selectfilterstacked").each(function(index, value) { + var namearr = value.name.split('-'); + SelectFilter.init(value.id, namearr[namearr.length - 1], true); + }); + } + }; + + var initPrepopulatedFields = function(row) { + row.find('.prepopulated_field').each(function() { + var field = $(this), + input = field.find('input, select, textarea'), + dependency_list = input.data('dependency_list') || [], + dependencies = []; + $.each(dependency_list, function(i, field_name) { + dependencies.push('#' + row.find('.form-row .field-' + field_name).find('input, select, textarea').attr('id')); + }); + if (dependencies.length) { + input.prepopulate(dependencies, input.attr('maxlength')); + } + }); + }; + + $rows.formset({ + prefix: options.prefix, + addText: options.addText, + formCssClass: "dynamic-" + options.prefix, + deleteCssClass: "inline-deletelink", + deleteText: options.deleteText, + emptyCssClass: "empty-form", + removed: updateInlineLabel, + added: function(row) { + initPrepopulatedFields(row); + reinitDateTimeShortCuts(); + updateSelectFilter(); + updateInlineLabel(row); + } + }); + + return $rows; + }; + + $(document).ready(function() { + $(".js-inline-admin-formset").each(function() { + var data = $(this).data(), + inlineOptions = data.inlineFormset; + switch(data.inlineType) { + case "stacked": + $(inlineOptions.name + "-group .inline-related").stackedFormset(inlineOptions.options); + break; + case "tabular": + $(inlineOptions.name + "-group .tabular.inline-related tbody tr").tabularFormset(inlineOptions.options); + break; + } + }); + }); +})(django.jQuery); diff --git a/static/admin/js/inlines.js.gz b/static/admin/js/inlines.js.gz new file mode 100644 index 0000000..f69dd3c Binary files /dev/null and b/static/admin/js/inlines.js.gz differ diff --git a/static/admin/js/inlines.min.8ef8b2379896.js b/static/admin/js/inlines.min.8ef8b2379896.js new file mode 100644 index 0000000..7e5228d --- /dev/null +++ b/static/admin/js/inlines.min.8ef8b2379896.js @@ -0,0 +1,10 @@ +(function(c){c.fn.formset=function(b){var a=c.extend({},c.fn.formset.defaults,b),d=c(this);b=d.parent();var k=function(a,g,l){var b=new RegExp("("+g+"-(\\d+|__prefix__))");g=g+"-"+l;c(a).prop("for")&&c(a).prop("for",c(a).prop("for").replace(b,g));a.id&&(a.id=a.id.replace(b,g));a.name&&(a.name=a.name.replace(b,g))},e=c("#id_"+a.prefix+"-TOTAL_FORMS").prop("autocomplete","off"),l=parseInt(e.val(),10),g=c("#id_"+a.prefix+"-MAX_NUM_FORMS").prop("autocomplete","off"),h=""===g.val()||0'+a.addText+""),m=b.find("tr:last a")):(d.filter(":last").after('"),m=d.filter(":last").next().find("a"));m.click(function(b){b.preventDefault();b=c("#"+a.prefix+"-empty");var f=b.clone(!0);f.removeClass(a.emptyCssClass).addClass(a.formCssClass).attr("id", +a.prefix+"-"+l);f.is("tr")?f.children(":last").append('"):f.is("ul")||f.is("ol")?f.append('
    • '+a.deleteText+"
    • "):f.children(":first").append(''+a.deleteText+"");f.find("*").each(function(){k(this,a.prefix,e.val())});f.insertBefore(c(b));c(e).val(parseInt(e.val(),10)+1);l+=1;""!==g.val()&&0>=g.val()-e.val()&&m.parent().hide(); +f.find("a."+a.deleteCssClass).click(function(b){b.preventDefault();f.remove();--l;a.removed&&a.removed(f);c(document).trigger("formset:removed",[f,a.prefix]);b=c("."+a.formCssClass);c("#id_"+a.prefix+"-TOTAL_FORMS").val(b.length);(""===g.val()||0'+a.addText+""),m=b.find("tr:last a")):(d.filter(":last").after('"),m=d.filter(":last").next().find("a"));m.click(function(b){b.preventDefault();b=c("#"+a.prefix+"-empty");var f=b.clone(!0);f.removeClass(a.emptyCssClass).addClass(a.formCssClass).attr("id", +a.prefix+"-"+l);f.is("tr")?f.children(":last").append('"):f.is("ul")||f.is("ol")?f.append('
    • '+a.deleteText+"
    • "):f.children(":first").append(''+a.deleteText+"");f.find("*").each(function(){k(this,a.prefix,e.val())});f.insertBefore(c(b));c(e).val(parseInt(e.val(),10)+1);l+=1;""!==g.val()&&0>=g.val()-e.val()&&m.parent().hide(); +f.find("a."+a.deleteCssClass).click(function(b){b.preventDefault();f.remove();--l;a.removed&&a.removed(f);c(document).trigger("formset:removed",[f,a.prefix]);b=c("."+a.formCssClass);c("#id_"+a.prefix+"-TOTAL_FORMS").val(b.length);(""===g.val()||0 0) { + values.push(field.val()); + } + }); + prepopulatedField.val(URLify(values.join(' '), maxLength, allowUnicode)); + }; + + prepopulatedField.data('_changed', false); + prepopulatedField.change(function() { + prepopulatedField.data('_changed', true); + }); + + if (!prepopulatedField.val()) { + $(dependencies.join(',')).keyup(populate).change(populate).focus(populate); + } + }); + }; +})(django.jQuery); diff --git a/static/admin/js/prepopulate.ff9208865444.js.gz b/static/admin/js/prepopulate.ff9208865444.js.gz new file mode 100644 index 0000000..83cdffb Binary files /dev/null and b/static/admin/js/prepopulate.ff9208865444.js.gz differ diff --git a/static/admin/js/prepopulate.js b/static/admin/js/prepopulate.js new file mode 100644 index 0000000..5d4b0e8 --- /dev/null +++ b/static/admin/js/prepopulate.js @@ -0,0 +1,42 @@ +/*global URLify*/ +(function($) { + 'use strict'; + $.fn.prepopulate = function(dependencies, maxLength, allowUnicode) { + /* + Depends on urlify.js + Populates a selected field with the values of the dependent fields, + URLifies and shortens the string. + dependencies - array of dependent fields ids + maxLength - maximum length of the URLify'd string + allowUnicode - Unicode support of the URLify'd string + */ + return this.each(function() { + var prepopulatedField = $(this); + + var populate = function() { + // Bail if the field's value has been changed by the user + if (prepopulatedField.data('_changed')) { + return; + } + + var values = []; + $.each(dependencies, function(i, field) { + field = $(field); + if (field.val().length > 0) { + values.push(field.val()); + } + }); + prepopulatedField.val(URLify(values.join(' '), maxLength, allowUnicode)); + }; + + prepopulatedField.data('_changed', false); + prepopulatedField.change(function() { + prepopulatedField.data('_changed', true); + }); + + if (!prepopulatedField.val()) { + $(dependencies.join(',')).keyup(populate).change(populate).focus(populate); + } + }); + }; +})(django.jQuery); diff --git a/static/admin/js/prepopulate.js.gz b/static/admin/js/prepopulate.js.gz new file mode 100644 index 0000000..83cdffb Binary files /dev/null and b/static/admin/js/prepopulate.js.gz differ diff --git a/static/admin/js/prepopulate.min.f4057ebb9b62.js b/static/admin/js/prepopulate.min.f4057ebb9b62.js new file mode 100644 index 0000000..75f3c17 --- /dev/null +++ b/static/admin/js/prepopulate.min.f4057ebb9b62.js @@ -0,0 +1 @@ +(function(c){c.fn.prepopulate=function(e,f,g){return this.each(function(){var a=c(this),b=function(){if(!a.data("_changed")){var b=[];c.each(e,function(a,d){d=c(d);0= 0 && j < len ? [ this[ j ] ] : [] ); + }, + + end: function() { + return this.prevObject || this.constructor(); + }, + + // For internal use only. + // Behaves like an Array's method, not like a jQuery method. + push: push, + sort: arr.sort, + splice: arr.splice +}; + +jQuery.extend = jQuery.fn.extend = function() { + var options, name, src, copy, copyIsArray, clone, + target = arguments[ 0 ] || {}, + i = 1, + length = arguments.length, + deep = false; + + // Handle a deep copy situation + if ( typeof target === "boolean" ) { + deep = target; + + // Skip the boolean and the target + target = arguments[ i ] || {}; + i++; + } + + // Handle case when target is a string or something (possible in deep copy) + if ( typeof target !== "object" && !jQuery.isFunction( target ) ) { + target = {}; + } + + // Extend jQuery itself if only one argument is passed + if ( i === length ) { + target = this; + i--; + } + + for ( ; i < length; i++ ) { + + // Only deal with non-null/undefined values + if ( ( options = arguments[ i ] ) != null ) { + + // Extend the base object + for ( name in options ) { + src = target[ name ]; + copy = options[ name ]; + + // Prevent never-ending loop + if ( target === copy ) { + continue; + } + + // Recurse if we're merging plain objects or arrays + if ( deep && copy && ( jQuery.isPlainObject( copy ) || + ( copyIsArray = jQuery.isArray( copy ) ) ) ) { + + if ( copyIsArray ) { + copyIsArray = false; + clone = src && jQuery.isArray( src ) ? src : []; + + } else { + clone = src && jQuery.isPlainObject( src ) ? src : {}; + } + + // Never move original objects, clone them + target[ name ] = jQuery.extend( deep, clone, copy ); + + // Don't bring in undefined values + } else if ( copy !== undefined ) { + target[ name ] = copy; + } + } + } + } + + // Return the modified object + return target; +}; + +jQuery.extend( { + + // Unique for each copy of jQuery on the page + expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ), + + // Assume jQuery is ready without the ready module + isReady: true, + + error: function( msg ) { + throw new Error( msg ); + }, + + noop: function() {}, + + isFunction: function( obj ) { + return jQuery.type( obj ) === "function"; + }, + + isArray: Array.isArray, + + isWindow: function( obj ) { + return obj != null && obj === obj.window; + }, + + isNumeric: function( obj ) { + + // parseFloat NaNs numeric-cast false positives (null|true|false|"") + // ...but misinterprets leading-number strings, particularly hex literals ("0x...") + // subtraction forces infinities to NaN + // adding 1 corrects loss of precision from parseFloat (#15100) + var realStringObj = obj && obj.toString(); + return !jQuery.isArray( obj ) && ( realStringObj - parseFloat( realStringObj ) + 1 ) >= 0; + }, + + isPlainObject: function( obj ) { + var key; + + // Not plain objects: + // - Any object or value whose internal [[Class]] property is not "[object Object]" + // - DOM nodes + // - window + if ( jQuery.type( obj ) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) { + return false; + } + + // Not own constructor property must be Object + if ( obj.constructor && + !hasOwn.call( obj, "constructor" ) && + !hasOwn.call( obj.constructor.prototype || {}, "isPrototypeOf" ) ) { + return false; + } + + // Own properties are enumerated firstly, so to speed up, + // if last one is own, then all properties are own + for ( key in obj ) {} + + return key === undefined || hasOwn.call( obj, key ); + }, + + isEmptyObject: function( obj ) { + var name; + for ( name in obj ) { + return false; + } + return true; + }, + + type: function( obj ) { + if ( obj == null ) { + return obj + ""; + } + + // Support: Android<4.0, iOS<6 (functionish RegExp) + return typeof obj === "object" || typeof obj === "function" ? + class2type[ toString.call( obj ) ] || "object" : + typeof obj; + }, + + // Evaluates a script in a global context + globalEval: function( code ) { + var script, + indirect = eval; + + code = jQuery.trim( code ); + + if ( code ) { + + // If the code includes a valid, prologue position + // strict mode pragma, execute code by injecting a + // script tag into the document. + if ( code.indexOf( "use strict" ) === 1 ) { + script = document.createElement( "script" ); + script.text = code; + document.head.appendChild( script ).parentNode.removeChild( script ); + } else { + + // Otherwise, avoid the DOM node creation, insertion + // and removal by using an indirect global eval + + indirect( code ); + } + } + }, + + // Convert dashed to camelCase; used by the css and data modules + // Support: IE9-11+ + // Microsoft forgot to hump their vendor prefix (#9572) + camelCase: function( string ) { + return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); + }, + + nodeName: function( elem, name ) { + return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); + }, + + each: function( obj, callback ) { + var length, i = 0; + + if ( isArrayLike( obj ) ) { + length = obj.length; + for ( ; i < length; i++ ) { + if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { + break; + } + } + } else { + for ( i in obj ) { + if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { + break; + } + } + } + + return obj; + }, + + // Support: Android<4.1 + trim: function( text ) { + return text == null ? + "" : + ( text + "" ).replace( rtrim, "" ); + }, + + // results is for internal usage only + makeArray: function( arr, results ) { + var ret = results || []; + + if ( arr != null ) { + if ( isArrayLike( Object( arr ) ) ) { + jQuery.merge( ret, + typeof arr === "string" ? + [ arr ] : arr + ); + } else { + push.call( ret, arr ); + } + } + + return ret; + }, + + inArray: function( elem, arr, i ) { + return arr == null ? -1 : indexOf.call( arr, elem, i ); + }, + + merge: function( first, second ) { + var len = +second.length, + j = 0, + i = first.length; + + for ( ; j < len; j++ ) { + first[ i++ ] = second[ j ]; + } + + first.length = i; + + return first; + }, + + grep: function( elems, callback, invert ) { + var callbackInverse, + matches = [], + i = 0, + length = elems.length, + callbackExpect = !invert; + + // Go through the array, only saving the items + // that pass the validator function + for ( ; i < length; i++ ) { + callbackInverse = !callback( elems[ i ], i ); + if ( callbackInverse !== callbackExpect ) { + matches.push( elems[ i ] ); + } + } + + return matches; + }, + + // arg is for internal usage only + map: function( elems, callback, arg ) { + var length, value, + i = 0, + ret = []; + + // Go through the array, translating each of the items to their new values + if ( isArrayLike( elems ) ) { + length = elems.length; + for ( ; i < length; i++ ) { + value = callback( elems[ i ], i, arg ); + + if ( value != null ) { + ret.push( value ); + } + } + + // Go through every key on the object, + } else { + for ( i in elems ) { + value = callback( elems[ i ], i, arg ); + + if ( value != null ) { + ret.push( value ); + } + } + } + + // Flatten any nested arrays + return concat.apply( [], ret ); + }, + + // A global GUID counter for objects + guid: 1, + + // Bind a function to a context, optionally partially applying any + // arguments. + proxy: function( fn, context ) { + var tmp, args, proxy; + + if ( typeof context === "string" ) { + tmp = fn[ context ]; + context = fn; + fn = tmp; + } + + // Quick check to determine if target is callable, in the spec + // this throws a TypeError, but we will just return undefined. + if ( !jQuery.isFunction( fn ) ) { + return undefined; + } + + // Simulated bind + args = slice.call( arguments, 2 ); + proxy = function() { + return fn.apply( context || this, args.concat( slice.call( arguments ) ) ); + }; + + // Set the guid of unique handler to the same of original handler, so it can be removed + proxy.guid = fn.guid = fn.guid || jQuery.guid++; + + return proxy; + }, + + now: Date.now, + + // jQuery.support is not used in Core but other projects attach their + // properties to it so it needs to exist. + support: support +} ); + +// JSHint would error on this code due to the Symbol not being defined in ES5. +// Defining this global in .jshintrc would create a danger of using the global +// unguarded in another place, it seems safer to just disable JSHint for these +// three lines. +/* jshint ignore: start */ +if ( typeof Symbol === "function" ) { + jQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ]; +} +/* jshint ignore: end */ + +// Populate the class2type map +jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ), +function( i, name ) { + class2type[ "[object " + name + "]" ] = name.toLowerCase(); +} ); + +function isArrayLike( obj ) { + + // Support: iOS 8.2 (not reproducible in simulator) + // `in` check used to prevent JIT error (gh-2145) + // hasOwn isn't used here due to false negatives + // regarding Nodelist length in IE + var length = !!obj && "length" in obj && obj.length, + type = jQuery.type( obj ); + + if ( type === "function" || jQuery.isWindow( obj ) ) { + return false; + } + + return type === "array" || length === 0 || + typeof length === "number" && length > 0 && ( length - 1 ) in obj; +} +var Sizzle = +/*! + * Sizzle CSS Selector Engine v2.2.1 + * http://sizzlejs.com/ + * + * Copyright jQuery Foundation and other contributors + * Released under the MIT license + * http://jquery.org/license + * + * Date: 2015-10-17 + */ +(function( window ) { + +var i, + support, + Expr, + getText, + isXML, + tokenize, + compile, + select, + outermostContext, + sortInput, + hasDuplicate, + + // Local document vars + setDocument, + document, + docElem, + documentIsHTML, + rbuggyQSA, + rbuggyMatches, + matches, + contains, + + // Instance-specific data + expando = "sizzle" + 1 * new Date(), + preferredDoc = window.document, + dirruns = 0, + done = 0, + classCache = createCache(), + tokenCache = createCache(), + compilerCache = createCache(), + sortOrder = function( a, b ) { + if ( a === b ) { + hasDuplicate = true; + } + return 0; + }, + + // General-purpose constants + MAX_NEGATIVE = 1 << 31, + + // Instance methods + hasOwn = ({}).hasOwnProperty, + arr = [], + pop = arr.pop, + push_native = arr.push, + push = arr.push, + slice = arr.slice, + // Use a stripped-down indexOf as it's faster than native + // http://jsperf.com/thor-indexof-vs-for/5 + indexOf = function( list, elem ) { + var i = 0, + len = list.length; + for ( ; i < len; i++ ) { + if ( list[i] === elem ) { + return i; + } + } + return -1; + }, + + booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped", + + // Regular expressions + + // http://www.w3.org/TR/css3-selectors/#whitespace + whitespace = "[\\x20\\t\\r\\n\\f]", + + // http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier + identifier = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+", + + // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors + attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace + + // Operator (capture 2) + "*([*^$|!~]?=)" + whitespace + + // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]" + "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace + + "*\\]", + + pseudos = ":(" + identifier + ")(?:\\((" + + // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments: + // 1. quoted (capture 3; capture 4 or capture 5) + "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" + + // 2. simple (capture 6) + "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" + + // 3. anything else (capture 2) + ".*" + + ")\\)|)", + + // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter + rwhitespace = new RegExp( whitespace + "+", "g" ), + rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ), + + rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), + rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ), + + rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]", "g" ), + + rpseudo = new RegExp( pseudos ), + ridentifier = new RegExp( "^" + identifier + "$" ), + + matchExpr = { + "ID": new RegExp( "^#(" + identifier + ")" ), + "CLASS": new RegExp( "^\\.(" + identifier + ")" ), + "TAG": new RegExp( "^(" + identifier + "|[*])" ), + "ATTR": new RegExp( "^" + attributes ), + "PSEUDO": new RegExp( "^" + pseudos ), + "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace + + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace + + "*(\\d+)|))" + whitespace + "*\\)|)", "i" ), + "bool": new RegExp( "^(?:" + booleans + ")$", "i" ), + // For use in libraries implementing .is() + // We use this for POS matching in `select` + "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + + whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" ) + }, + + rinputs = /^(?:input|select|textarea|button)$/i, + rheader = /^h\d$/i, + + rnative = /^[^{]+\{\s*\[native \w/, + + // Easily-parseable/retrievable ID or TAG or CLASS selectors + rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, + + rsibling = /[+~]/, + rescape = /'|\\/g, + + // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters + runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ), + funescape = function( _, escaped, escapedWhitespace ) { + var high = "0x" + escaped - 0x10000; + // NaN means non-codepoint + // Support: Firefox<24 + // Workaround erroneous numeric interpretation of +"0x" + return high !== high || escapedWhitespace ? + escaped : + high < 0 ? + // BMP codepoint + String.fromCharCode( high + 0x10000 ) : + // Supplemental Plane codepoint (surrogate pair) + String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); + }, + + // Used for iframes + // See setDocument() + // Removing the function wrapper causes a "Permission Denied" + // error in IE + unloadHandler = function() { + setDocument(); + }; + +// Optimize for push.apply( _, NodeList ) +try { + push.apply( + (arr = slice.call( preferredDoc.childNodes )), + preferredDoc.childNodes + ); + // Support: Android<4.0 + // Detect silently failing push.apply + arr[ preferredDoc.childNodes.length ].nodeType; +} catch ( e ) { + push = { apply: arr.length ? + + // Leverage slice if possible + function( target, els ) { + push_native.apply( target, slice.call(els) ); + } : + + // Support: IE<9 + // Otherwise append directly + function( target, els ) { + var j = target.length, + i = 0; + // Can't trust NodeList.length + while ( (target[j++] = els[i++]) ) {} + target.length = j - 1; + } + }; +} + +function Sizzle( selector, context, results, seed ) { + var m, i, elem, nid, nidselect, match, groups, newSelector, + newContext = context && context.ownerDocument, + + // nodeType defaults to 9, since context defaults to document + nodeType = context ? context.nodeType : 9; + + results = results || []; + + // Return early from calls with invalid selector or context + if ( typeof selector !== "string" || !selector || + nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) { + + return results; + } + + // Try to shortcut find operations (as opposed to filters) in HTML documents + if ( !seed ) { + + if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) { + setDocument( context ); + } + context = context || document; + + if ( documentIsHTML ) { + + // If the selector is sufficiently simple, try using a "get*By*" DOM method + // (excepting DocumentFragment context, where the methods don't exist) + if ( nodeType !== 11 && (match = rquickExpr.exec( selector )) ) { + + // ID selector + if ( (m = match[1]) ) { + + // Document context + if ( nodeType === 9 ) { + if ( (elem = context.getElementById( m )) ) { + + // Support: IE, Opera, Webkit + // TODO: identify versions + // getElementById can match elements by name instead of ID + if ( elem.id === m ) { + results.push( elem ); + return results; + } + } else { + return results; + } + + // Element context + } else { + + // Support: IE, Opera, Webkit + // TODO: identify versions + // getElementById can match elements by name instead of ID + if ( newContext && (elem = newContext.getElementById( m )) && + contains( context, elem ) && + elem.id === m ) { + + results.push( elem ); + return results; + } + } + + // Type selector + } else if ( match[2] ) { + push.apply( results, context.getElementsByTagName( selector ) ); + return results; + + // Class selector + } else if ( (m = match[3]) && support.getElementsByClassName && + context.getElementsByClassName ) { + + push.apply( results, context.getElementsByClassName( m ) ); + return results; + } + } + + // Take advantage of querySelectorAll + if ( support.qsa && + !compilerCache[ selector + " " ] && + (!rbuggyQSA || !rbuggyQSA.test( selector )) ) { + + if ( nodeType !== 1 ) { + newContext = context; + newSelector = selector; + + // qSA looks outside Element context, which is not what we want + // Thanks to Andrew Dupont for this workaround technique + // Support: IE <=8 + // Exclude object elements + } else if ( context.nodeName.toLowerCase() !== "object" ) { + + // Capture the context ID, setting it first if necessary + if ( (nid = context.getAttribute( "id" )) ) { + nid = nid.replace( rescape, "\\$&" ); + } else { + context.setAttribute( "id", (nid = expando) ); + } + + // Prefix every selector in the list + groups = tokenize( selector ); + i = groups.length; + nidselect = ridentifier.test( nid ) ? "#" + nid : "[id='" + nid + "']"; + while ( i-- ) { + groups[i] = nidselect + " " + toSelector( groups[i] ); + } + newSelector = groups.join( "," ); + + // Expand context for sibling selectors + newContext = rsibling.test( selector ) && testContext( context.parentNode ) || + context; + } + + if ( newSelector ) { + try { + push.apply( results, + newContext.querySelectorAll( newSelector ) + ); + return results; + } catch ( qsaError ) { + } finally { + if ( nid === expando ) { + context.removeAttribute( "id" ); + } + } + } + } + } + } + + // All others + return select( selector.replace( rtrim, "$1" ), context, results, seed ); +} + +/** + * Create key-value caches of limited size + * @returns {function(string, object)} Returns the Object data after storing it on itself with + * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength) + * deleting the oldest entry + */ +function createCache() { + var keys = []; + + function cache( key, value ) { + // Use (key + " ") to avoid collision with native prototype properties (see Issue #157) + if ( keys.push( key + " " ) > Expr.cacheLength ) { + // Only keep the most recent entries + delete cache[ keys.shift() ]; + } + return (cache[ key + " " ] = value); + } + return cache; +} + +/** + * Mark a function for special use by Sizzle + * @param {Function} fn The function to mark + */ +function markFunction( fn ) { + fn[ expando ] = true; + return fn; +} + +/** + * Support testing using an element + * @param {Function} fn Passed the created div and expects a boolean result + */ +function assert( fn ) { + var div = document.createElement("div"); + + try { + return !!fn( div ); + } catch (e) { + return false; + } finally { + // Remove from its parent by default + if ( div.parentNode ) { + div.parentNode.removeChild( div ); + } + // release memory in IE + div = null; + } +} + +/** + * Adds the same handler for all of the specified attrs + * @param {String} attrs Pipe-separated list of attributes + * @param {Function} handler The method that will be applied + */ +function addHandle( attrs, handler ) { + var arr = attrs.split("|"), + i = arr.length; + + while ( i-- ) { + Expr.attrHandle[ arr[i] ] = handler; + } +} + +/** + * Checks document order of two siblings + * @param {Element} a + * @param {Element} b + * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b + */ +function siblingCheck( a, b ) { + var cur = b && a, + diff = cur && a.nodeType === 1 && b.nodeType === 1 && + ( ~b.sourceIndex || MAX_NEGATIVE ) - + ( ~a.sourceIndex || MAX_NEGATIVE ); + + // Use IE sourceIndex if available on both nodes + if ( diff ) { + return diff; + } + + // Check if b follows a + if ( cur ) { + while ( (cur = cur.nextSibling) ) { + if ( cur === b ) { + return -1; + } + } + } + + return a ? 1 : -1; +} + +/** + * Returns a function to use in pseudos for input types + * @param {String} type + */ +function createInputPseudo( type ) { + return function( elem ) { + var name = elem.nodeName.toLowerCase(); + return name === "input" && elem.type === type; + }; +} + +/** + * Returns a function to use in pseudos for buttons + * @param {String} type + */ +function createButtonPseudo( type ) { + return function( elem ) { + var name = elem.nodeName.toLowerCase(); + return (name === "input" || name === "button") && elem.type === type; + }; +} + +/** + * Returns a function to use in pseudos for positionals + * @param {Function} fn + */ +function createPositionalPseudo( fn ) { + return markFunction(function( argument ) { + argument = +argument; + return markFunction(function( seed, matches ) { + var j, + matchIndexes = fn( [], seed.length, argument ), + i = matchIndexes.length; + + // Match elements found at the specified indexes + while ( i-- ) { + if ( seed[ (j = matchIndexes[i]) ] ) { + seed[j] = !(matches[j] = seed[j]); + } + } + }); + }); +} + +/** + * Checks a node for validity as a Sizzle context + * @param {Element|Object=} context + * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value + */ +function testContext( context ) { + return context && typeof context.getElementsByTagName !== "undefined" && context; +} + +// Expose support vars for convenience +support = Sizzle.support = {}; + +/** + * Detects XML nodes + * @param {Element|Object} elem An element or a document + * @returns {Boolean} True iff elem is a non-HTML XML node + */ +isXML = Sizzle.isXML = function( elem ) { + // documentElement is verified for cases where it doesn't yet exist + // (such as loading iframes in IE - #4833) + var documentElement = elem && (elem.ownerDocument || elem).documentElement; + return documentElement ? documentElement.nodeName !== "HTML" : false; +}; + +/** + * Sets document-related variables once based on the current document + * @param {Element|Object} [doc] An element or document object to use to set the document + * @returns {Object} Returns the current document + */ +setDocument = Sizzle.setDocument = function( node ) { + var hasCompare, parent, + doc = node ? node.ownerDocument || node : preferredDoc; + + // Return early if doc is invalid or already selected + if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) { + return document; + } + + // Update global variables + document = doc; + docElem = document.documentElement; + documentIsHTML = !isXML( document ); + + // Support: IE 9-11, Edge + // Accessing iframe documents after unload throws "permission denied" errors (jQuery #13936) + if ( (parent = document.defaultView) && parent.top !== parent ) { + // Support: IE 11 + if ( parent.addEventListener ) { + parent.addEventListener( "unload", unloadHandler, false ); + + // Support: IE 9 - 10 only + } else if ( parent.attachEvent ) { + parent.attachEvent( "onunload", unloadHandler ); + } + } + + /* Attributes + ---------------------------------------------------------------------- */ + + // Support: IE<8 + // Verify that getAttribute really returns attributes and not properties + // (excepting IE8 booleans) + support.attributes = assert(function( div ) { + div.className = "i"; + return !div.getAttribute("className"); + }); + + /* getElement(s)By* + ---------------------------------------------------------------------- */ + + // Check if getElementsByTagName("*") returns only elements + support.getElementsByTagName = assert(function( div ) { + div.appendChild( document.createComment("") ); + return !div.getElementsByTagName("*").length; + }); + + // Support: IE<9 + support.getElementsByClassName = rnative.test( document.getElementsByClassName ); + + // Support: IE<10 + // Check if getElementById returns elements by name + // The broken getElementById methods don't pick up programatically-set names, + // so use a roundabout getElementsByName test + support.getById = assert(function( div ) { + docElem.appendChild( div ).id = expando; + return !document.getElementsByName || !document.getElementsByName( expando ).length; + }); + + // ID find and filter + if ( support.getById ) { + Expr.find["ID"] = function( id, context ) { + if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { + var m = context.getElementById( id ); + return m ? [ m ] : []; + } + }; + Expr.filter["ID"] = function( id ) { + var attrId = id.replace( runescape, funescape ); + return function( elem ) { + return elem.getAttribute("id") === attrId; + }; + }; + } else { + // Support: IE6/7 + // getElementById is not reliable as a find shortcut + delete Expr.find["ID"]; + + Expr.filter["ID"] = function( id ) { + var attrId = id.replace( runescape, funescape ); + return function( elem ) { + var node = typeof elem.getAttributeNode !== "undefined" && + elem.getAttributeNode("id"); + return node && node.value === attrId; + }; + }; + } + + // Tag + Expr.find["TAG"] = support.getElementsByTagName ? + function( tag, context ) { + if ( typeof context.getElementsByTagName !== "undefined" ) { + return context.getElementsByTagName( tag ); + + // DocumentFragment nodes don't have gEBTN + } else if ( support.qsa ) { + return context.querySelectorAll( tag ); + } + } : + + function( tag, context ) { + var elem, + tmp = [], + i = 0, + // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too + results = context.getElementsByTagName( tag ); + + // Filter out possible comments + if ( tag === "*" ) { + while ( (elem = results[i++]) ) { + if ( elem.nodeType === 1 ) { + tmp.push( elem ); + } + } + + return tmp; + } + return results; + }; + + // Class + Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) { + if ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) { + return context.getElementsByClassName( className ); + } + }; + + /* QSA/matchesSelector + ---------------------------------------------------------------------- */ + + // QSA and matchesSelector support + + // matchesSelector(:active) reports false when true (IE9/Opera 11.5) + rbuggyMatches = []; + + // qSa(:focus) reports false when true (Chrome 21) + // We allow this because of a bug in IE8/9 that throws an error + // whenever `document.activeElement` is accessed on an iframe + // So, we allow :focus to pass through QSA all the time to avoid the IE error + // See http://bugs.jquery.com/ticket/13378 + rbuggyQSA = []; + + if ( (support.qsa = rnative.test( document.querySelectorAll )) ) { + // Build QSA regex + // Regex strategy adopted from Diego Perini + assert(function( div ) { + // Select is set to empty string on purpose + // This is to test IE's treatment of not explicitly + // setting a boolean content attribute, + // since its presence should be enough + // http://bugs.jquery.com/ticket/12359 + docElem.appendChild( div ).innerHTML = "" + + ""; + + // Support: IE8, Opera 11-12.16 + // Nothing should be selected when empty strings follow ^= or $= or *= + // The test attribute must be unknown in Opera but "safe" for WinRT + // http://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section + if ( div.querySelectorAll("[msallowcapture^='']").length ) { + rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" ); + } + + // Support: IE8 + // Boolean attributes and "value" are not treated correctly + if ( !div.querySelectorAll("[selected]").length ) { + rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" ); + } + + // Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+ + if ( !div.querySelectorAll( "[id~=" + expando + "-]" ).length ) { + rbuggyQSA.push("~="); + } + + // Webkit/Opera - :checked should return selected option elements + // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked + // IE8 throws error here and will not see later tests + if ( !div.querySelectorAll(":checked").length ) { + rbuggyQSA.push(":checked"); + } + + // Support: Safari 8+, iOS 8+ + // https://bugs.webkit.org/show_bug.cgi?id=136851 + // In-page `selector#id sibing-combinator selector` fails + if ( !div.querySelectorAll( "a#" + expando + "+*" ).length ) { + rbuggyQSA.push(".#.+[+~]"); + } + }); + + assert(function( div ) { + // Support: Windows 8 Native Apps + // The type and name attributes are restricted during .innerHTML assignment + var input = document.createElement("input"); + input.setAttribute( "type", "hidden" ); + div.appendChild( input ).setAttribute( "name", "D" ); + + // Support: IE8 + // Enforce case-sensitivity of name attribute + if ( div.querySelectorAll("[name=d]").length ) { + rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" ); + } + + // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled) + // IE8 throws error here and will not see later tests + if ( !div.querySelectorAll(":enabled").length ) { + rbuggyQSA.push( ":enabled", ":disabled" ); + } + + // Opera 10-11 does not throw on post-comma invalid pseudos + div.querySelectorAll("*,:x"); + rbuggyQSA.push(",.*:"); + }); + } + + if ( (support.matchesSelector = rnative.test( (matches = docElem.matches || + docElem.webkitMatchesSelector || + docElem.mozMatchesSelector || + docElem.oMatchesSelector || + docElem.msMatchesSelector) )) ) { + + assert(function( div ) { + // Check to see if it's possible to do matchesSelector + // on a disconnected node (IE 9) + support.disconnectedMatch = matches.call( div, "div" ); + + // This should fail with an exception + // Gecko does not error, returns false instead + matches.call( div, "[s!='']:x" ); + rbuggyMatches.push( "!=", pseudos ); + }); + } + + rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") ); + rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") ); + + /* Contains + ---------------------------------------------------------------------- */ + hasCompare = rnative.test( docElem.compareDocumentPosition ); + + // Element contains another + // Purposefully self-exclusive + // As in, an element does not contain itself + contains = hasCompare || rnative.test( docElem.contains ) ? + function( a, b ) { + var adown = a.nodeType === 9 ? a.documentElement : a, + bup = b && b.parentNode; + return a === bup || !!( bup && bup.nodeType === 1 && ( + adown.contains ? + adown.contains( bup ) : + a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16 + )); + } : + function( a, b ) { + if ( b ) { + while ( (b = b.parentNode) ) { + if ( b === a ) { + return true; + } + } + } + return false; + }; + + /* Sorting + ---------------------------------------------------------------------- */ + + // Document order sorting + sortOrder = hasCompare ? + function( a, b ) { + + // Flag for duplicate removal + if ( a === b ) { + hasDuplicate = true; + return 0; + } + + // Sort on method existence if only one input has compareDocumentPosition + var compare = !a.compareDocumentPosition - !b.compareDocumentPosition; + if ( compare ) { + return compare; + } + + // Calculate position if both inputs belong to the same document + compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ? + a.compareDocumentPosition( b ) : + + // Otherwise we know they are disconnected + 1; + + // Disconnected nodes + if ( compare & 1 || + (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) { + + // Choose the first element that is related to our preferred document + if ( a === document || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) { + return -1; + } + if ( b === document || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) { + return 1; + } + + // Maintain original order + return sortInput ? + ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : + 0; + } + + return compare & 4 ? -1 : 1; + } : + function( a, b ) { + // Exit early if the nodes are identical + if ( a === b ) { + hasDuplicate = true; + return 0; + } + + var cur, + i = 0, + aup = a.parentNode, + bup = b.parentNode, + ap = [ a ], + bp = [ b ]; + + // Parentless nodes are either documents or disconnected + if ( !aup || !bup ) { + return a === document ? -1 : + b === document ? 1 : + aup ? -1 : + bup ? 1 : + sortInput ? + ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : + 0; + + // If the nodes are siblings, we can do a quick check + } else if ( aup === bup ) { + return siblingCheck( a, b ); + } + + // Otherwise we need full lists of their ancestors for comparison + cur = a; + while ( (cur = cur.parentNode) ) { + ap.unshift( cur ); + } + cur = b; + while ( (cur = cur.parentNode) ) { + bp.unshift( cur ); + } + + // Walk down the tree looking for a discrepancy + while ( ap[i] === bp[i] ) { + i++; + } + + return i ? + // Do a sibling check if the nodes have a common ancestor + siblingCheck( ap[i], bp[i] ) : + + // Otherwise nodes in our document sort first + ap[i] === preferredDoc ? -1 : + bp[i] === preferredDoc ? 1 : + 0; + }; + + return document; +}; + +Sizzle.matches = function( expr, elements ) { + return Sizzle( expr, null, null, elements ); +}; + +Sizzle.matchesSelector = function( elem, expr ) { + // Set document vars if needed + if ( ( elem.ownerDocument || elem ) !== document ) { + setDocument( elem ); + } + + // Make sure that attribute selectors are quoted + expr = expr.replace( rattributeQuotes, "='$1']" ); + + if ( support.matchesSelector && documentIsHTML && + !compilerCache[ expr + " " ] && + ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) && + ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) { + + try { + var ret = matches.call( elem, expr ); + + // IE 9's matchesSelector returns false on disconnected nodes + if ( ret || support.disconnectedMatch || + // As well, disconnected nodes are said to be in a document + // fragment in IE 9 + elem.document && elem.document.nodeType !== 11 ) { + return ret; + } + } catch (e) {} + } + + return Sizzle( expr, document, null, [ elem ] ).length > 0; +}; + +Sizzle.contains = function( context, elem ) { + // Set document vars if needed + if ( ( context.ownerDocument || context ) !== document ) { + setDocument( context ); + } + return contains( context, elem ); +}; + +Sizzle.attr = function( elem, name ) { + // Set document vars if needed + if ( ( elem.ownerDocument || elem ) !== document ) { + setDocument( elem ); + } + + var fn = Expr.attrHandle[ name.toLowerCase() ], + // Don't get fooled by Object.prototype properties (jQuery #13807) + val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ? + fn( elem, name, !documentIsHTML ) : + undefined; + + return val !== undefined ? + val : + support.attributes || !documentIsHTML ? + elem.getAttribute( name ) : + (val = elem.getAttributeNode(name)) && val.specified ? + val.value : + null; +}; + +Sizzle.error = function( msg ) { + throw new Error( "Syntax error, unrecognized expression: " + msg ); +}; + +/** + * Document sorting and removing duplicates + * @param {ArrayLike} results + */ +Sizzle.uniqueSort = function( results ) { + var elem, + duplicates = [], + j = 0, + i = 0; + + // Unless we *know* we can detect duplicates, assume their presence + hasDuplicate = !support.detectDuplicates; + sortInput = !support.sortStable && results.slice( 0 ); + results.sort( sortOrder ); + + if ( hasDuplicate ) { + while ( (elem = results[i++]) ) { + if ( elem === results[ i ] ) { + j = duplicates.push( i ); + } + } + while ( j-- ) { + results.splice( duplicates[ j ], 1 ); + } + } + + // Clear input after sorting to release objects + // See https://github.com/jquery/sizzle/pull/225 + sortInput = null; + + return results; +}; + +/** + * Utility function for retrieving the text value of an array of DOM nodes + * @param {Array|Element} elem + */ +getText = Sizzle.getText = function( elem ) { + var node, + ret = "", + i = 0, + nodeType = elem.nodeType; + + if ( !nodeType ) { + // If no nodeType, this is expected to be an array + while ( (node = elem[i++]) ) { + // Do not traverse comment nodes + ret += getText( node ); + } + } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { + // Use textContent for elements + // innerText usage removed for consistency of new lines (jQuery #11153) + if ( typeof elem.textContent === "string" ) { + return elem.textContent; + } else { + // Traverse its children + for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { + ret += getText( elem ); + } + } + } else if ( nodeType === 3 || nodeType === 4 ) { + return elem.nodeValue; + } + // Do not include comment or processing instruction nodes + + return ret; +}; + +Expr = Sizzle.selectors = { + + // Can be adjusted by the user + cacheLength: 50, + + createPseudo: markFunction, + + match: matchExpr, + + attrHandle: {}, + + find: {}, + + relative: { + ">": { dir: "parentNode", first: true }, + " ": { dir: "parentNode" }, + "+": { dir: "previousSibling", first: true }, + "~": { dir: "previousSibling" } + }, + + preFilter: { + "ATTR": function( match ) { + match[1] = match[1].replace( runescape, funescape ); + + // Move the given value to match[3] whether quoted or unquoted + match[3] = ( match[3] || match[4] || match[5] || "" ).replace( runescape, funescape ); + + if ( match[2] === "~=" ) { + match[3] = " " + match[3] + " "; + } + + return match.slice( 0, 4 ); + }, + + "CHILD": function( match ) { + /* matches from matchExpr["CHILD"] + 1 type (only|nth|...) + 2 what (child|of-type) + 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...) + 4 xn-component of xn+y argument ([+-]?\d*n|) + 5 sign of xn-component + 6 x of xn-component + 7 sign of y-component + 8 y of y-component + */ + match[1] = match[1].toLowerCase(); + + if ( match[1].slice( 0, 3 ) === "nth" ) { + // nth-* requires argument + if ( !match[3] ) { + Sizzle.error( match[0] ); + } + + // numeric x and y parameters for Expr.filter.CHILD + // remember that false/true cast respectively to 0/1 + match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) ); + match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" ); + + // other types prohibit arguments + } else if ( match[3] ) { + Sizzle.error( match[0] ); + } + + return match; + }, + + "PSEUDO": function( match ) { + var excess, + unquoted = !match[6] && match[2]; + + if ( matchExpr["CHILD"].test( match[0] ) ) { + return null; + } + + // Accept quoted arguments as-is + if ( match[3] ) { + match[2] = match[4] || match[5] || ""; + + // Strip excess characters from unquoted arguments + } else if ( unquoted && rpseudo.test( unquoted ) && + // Get excess from tokenize (recursively) + (excess = tokenize( unquoted, true )) && + // advance to the next closing parenthesis + (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) { + + // excess is a negative index + match[0] = match[0].slice( 0, excess ); + match[2] = unquoted.slice( 0, excess ); + } + + // Return only captures needed by the pseudo filter method (type and argument) + return match.slice( 0, 3 ); + } + }, + + filter: { + + "TAG": function( nodeNameSelector ) { + var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase(); + return nodeNameSelector === "*" ? + function() { return true; } : + function( elem ) { + return elem.nodeName && elem.nodeName.toLowerCase() === nodeName; + }; + }, + + "CLASS": function( className ) { + var pattern = classCache[ className + " " ]; + + return pattern || + (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) && + classCache( className, function( elem ) { + return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== "undefined" && elem.getAttribute("class") || "" ); + }); + }, + + "ATTR": function( name, operator, check ) { + return function( elem ) { + var result = Sizzle.attr( elem, name ); + + if ( result == null ) { + return operator === "!="; + } + if ( !operator ) { + return true; + } + + result += ""; + + return operator === "=" ? result === check : + operator === "!=" ? result !== check : + operator === "^=" ? check && result.indexOf( check ) === 0 : + operator === "*=" ? check && result.indexOf( check ) > -1 : + operator === "$=" ? check && result.slice( -check.length ) === check : + operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 : + operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" : + false; + }; + }, + + "CHILD": function( type, what, argument, first, last ) { + var simple = type.slice( 0, 3 ) !== "nth", + forward = type.slice( -4 ) !== "last", + ofType = what === "of-type"; + + return first === 1 && last === 0 ? + + // Shortcut for :nth-*(n) + function( elem ) { + return !!elem.parentNode; + } : + + function( elem, context, xml ) { + var cache, uniqueCache, outerCache, node, nodeIndex, start, + dir = simple !== forward ? "nextSibling" : "previousSibling", + parent = elem.parentNode, + name = ofType && elem.nodeName.toLowerCase(), + useCache = !xml && !ofType, + diff = false; + + if ( parent ) { + + // :(first|last|only)-(child|of-type) + if ( simple ) { + while ( dir ) { + node = elem; + while ( (node = node[ dir ]) ) { + if ( ofType ? + node.nodeName.toLowerCase() === name : + node.nodeType === 1 ) { + + return false; + } + } + // Reverse direction for :only-* (if we haven't yet done so) + start = dir = type === "only" && !start && "nextSibling"; + } + return true; + } + + start = [ forward ? parent.firstChild : parent.lastChild ]; + + // non-xml :nth-child(...) stores cache data on `parent` + if ( forward && useCache ) { + + // Seek `elem` from a previously-cached index + + // ...in a gzip-friendly way + node = parent; + outerCache = node[ expando ] || (node[ expando ] = {}); + + // Support: IE <9 only + // Defend against cloned attroperties (jQuery gh-1709) + uniqueCache = outerCache[ node.uniqueID ] || + (outerCache[ node.uniqueID ] = {}); + + cache = uniqueCache[ type ] || []; + nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; + diff = nodeIndex && cache[ 2 ]; + node = nodeIndex && parent.childNodes[ nodeIndex ]; + + while ( (node = ++nodeIndex && node && node[ dir ] || + + // Fallback to seeking `elem` from the start + (diff = nodeIndex = 0) || start.pop()) ) { + + // When found, cache indexes on `parent` and break + if ( node.nodeType === 1 && ++diff && node === elem ) { + uniqueCache[ type ] = [ dirruns, nodeIndex, diff ]; + break; + } + } + + } else { + // Use previously-cached element index if available + if ( useCache ) { + // ...in a gzip-friendly way + node = elem; + outerCache = node[ expando ] || (node[ expando ] = {}); + + // Support: IE <9 only + // Defend against cloned attroperties (jQuery gh-1709) + uniqueCache = outerCache[ node.uniqueID ] || + (outerCache[ node.uniqueID ] = {}); + + cache = uniqueCache[ type ] || []; + nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; + diff = nodeIndex; + } + + // xml :nth-child(...) + // or :nth-last-child(...) or :nth(-last)?-of-type(...) + if ( diff === false ) { + // Use the same loop as above to seek `elem` from the start + while ( (node = ++nodeIndex && node && node[ dir ] || + (diff = nodeIndex = 0) || start.pop()) ) { + + if ( ( ofType ? + node.nodeName.toLowerCase() === name : + node.nodeType === 1 ) && + ++diff ) { + + // Cache the index of each encountered element + if ( useCache ) { + outerCache = node[ expando ] || (node[ expando ] = {}); + + // Support: IE <9 only + // Defend against cloned attroperties (jQuery gh-1709) + uniqueCache = outerCache[ node.uniqueID ] || + (outerCache[ node.uniqueID ] = {}); + + uniqueCache[ type ] = [ dirruns, diff ]; + } + + if ( node === elem ) { + break; + } + } + } + } + } + + // Incorporate the offset, then check against cycle size + diff -= last; + return diff === first || ( diff % first === 0 && diff / first >= 0 ); + } + }; + }, + + "PSEUDO": function( pseudo, argument ) { + // pseudo-class names are case-insensitive + // http://www.w3.org/TR/selectors/#pseudo-classes + // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters + // Remember that setFilters inherits from pseudos + var args, + fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] || + Sizzle.error( "unsupported pseudo: " + pseudo ); + + // The user may use createPseudo to indicate that + // arguments are needed to create the filter function + // just as Sizzle does + if ( fn[ expando ] ) { + return fn( argument ); + } + + // But maintain support for old signatures + if ( fn.length > 1 ) { + args = [ pseudo, pseudo, "", argument ]; + return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ? + markFunction(function( seed, matches ) { + var idx, + matched = fn( seed, argument ), + i = matched.length; + while ( i-- ) { + idx = indexOf( seed, matched[i] ); + seed[ idx ] = !( matches[ idx ] = matched[i] ); + } + }) : + function( elem ) { + return fn( elem, 0, args ); + }; + } + + return fn; + } + }, + + pseudos: { + // Potentially complex pseudos + "not": markFunction(function( selector ) { + // Trim the selector passed to compile + // to avoid treating leading and trailing + // spaces as combinators + var input = [], + results = [], + matcher = compile( selector.replace( rtrim, "$1" ) ); + + return matcher[ expando ] ? + markFunction(function( seed, matches, context, xml ) { + var elem, + unmatched = matcher( seed, null, xml, [] ), + i = seed.length; + + // Match elements unmatched by `matcher` + while ( i-- ) { + if ( (elem = unmatched[i]) ) { + seed[i] = !(matches[i] = elem); + } + } + }) : + function( elem, context, xml ) { + input[0] = elem; + matcher( input, null, xml, results ); + // Don't keep the element (issue #299) + input[0] = null; + return !results.pop(); + }; + }), + + "has": markFunction(function( selector ) { + return function( elem ) { + return Sizzle( selector, elem ).length > 0; + }; + }), + + "contains": markFunction(function( text ) { + text = text.replace( runescape, funescape ); + return function( elem ) { + return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1; + }; + }), + + // "Whether an element is represented by a :lang() selector + // is based solely on the element's language value + // being equal to the identifier C, + // or beginning with the identifier C immediately followed by "-". + // The matching of C against the element's language value is performed case-insensitively. + // The identifier C does not have to be a valid language name." + // http://www.w3.org/TR/selectors/#lang-pseudo + "lang": markFunction( function( lang ) { + // lang value must be a valid identifier + if ( !ridentifier.test(lang || "") ) { + Sizzle.error( "unsupported lang: " + lang ); + } + lang = lang.replace( runescape, funescape ).toLowerCase(); + return function( elem ) { + var elemLang; + do { + if ( (elemLang = documentIsHTML ? + elem.lang : + elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) { + + elemLang = elemLang.toLowerCase(); + return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0; + } + } while ( (elem = elem.parentNode) && elem.nodeType === 1 ); + return false; + }; + }), + + // Miscellaneous + "target": function( elem ) { + var hash = window.location && window.location.hash; + return hash && hash.slice( 1 ) === elem.id; + }, + + "root": function( elem ) { + return elem === docElem; + }, + + "focus": function( elem ) { + return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex); + }, + + // Boolean properties + "enabled": function( elem ) { + return elem.disabled === false; + }, + + "disabled": function( elem ) { + return elem.disabled === true; + }, + + "checked": function( elem ) { + // In CSS3, :checked should return both checked and selected elements + // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked + var nodeName = elem.nodeName.toLowerCase(); + return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected); + }, + + "selected": function( elem ) { + // Accessing this property makes selected-by-default + // options in Safari work properly + if ( elem.parentNode ) { + elem.parentNode.selectedIndex; + } + + return elem.selected === true; + }, + + // Contents + "empty": function( elem ) { + // http://www.w3.org/TR/selectors/#empty-pseudo + // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5), + // but not by others (comment: 8; processing instruction: 7; etc.) + // nodeType < 6 works because attributes (2) do not appear as children + for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { + if ( elem.nodeType < 6 ) { + return false; + } + } + return true; + }, + + "parent": function( elem ) { + return !Expr.pseudos["empty"]( elem ); + }, + + // Element/input types + "header": function( elem ) { + return rheader.test( elem.nodeName ); + }, + + "input": function( elem ) { + return rinputs.test( elem.nodeName ); + }, + + "button": function( elem ) { + var name = elem.nodeName.toLowerCase(); + return name === "input" && elem.type === "button" || name === "button"; + }, + + "text": function( elem ) { + var attr; + return elem.nodeName.toLowerCase() === "input" && + elem.type === "text" && + + // Support: IE<8 + // New HTML5 attribute values (e.g., "search") appear with elem.type === "text" + ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text" ); + }, + + // Position-in-collection + "first": createPositionalPseudo(function() { + return [ 0 ]; + }), + + "last": createPositionalPseudo(function( matchIndexes, length ) { + return [ length - 1 ]; + }), + + "eq": createPositionalPseudo(function( matchIndexes, length, argument ) { + return [ argument < 0 ? argument + length : argument ]; + }), + + "even": createPositionalPseudo(function( matchIndexes, length ) { + var i = 0; + for ( ; i < length; i += 2 ) { + matchIndexes.push( i ); + } + return matchIndexes; + }), + + "odd": createPositionalPseudo(function( matchIndexes, length ) { + var i = 1; + for ( ; i < length; i += 2 ) { + matchIndexes.push( i ); + } + return matchIndexes; + }), + + "lt": createPositionalPseudo(function( matchIndexes, length, argument ) { + var i = argument < 0 ? argument + length : argument; + for ( ; --i >= 0; ) { + matchIndexes.push( i ); + } + return matchIndexes; + }), + + "gt": createPositionalPseudo(function( matchIndexes, length, argument ) { + var i = argument < 0 ? argument + length : argument; + for ( ; ++i < length; ) { + matchIndexes.push( i ); + } + return matchIndexes; + }) + } +}; + +Expr.pseudos["nth"] = Expr.pseudos["eq"]; + +// Add button/input type pseudos +for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) { + Expr.pseudos[ i ] = createInputPseudo( i ); +} +for ( i in { submit: true, reset: true } ) { + Expr.pseudos[ i ] = createButtonPseudo( i ); +} + +// Easy API for creating new setFilters +function setFilters() {} +setFilters.prototype = Expr.filters = Expr.pseudos; +Expr.setFilters = new setFilters(); + +tokenize = Sizzle.tokenize = function( selector, parseOnly ) { + var matched, match, tokens, type, + soFar, groups, preFilters, + cached = tokenCache[ selector + " " ]; + + if ( cached ) { + return parseOnly ? 0 : cached.slice( 0 ); + } + + soFar = selector; + groups = []; + preFilters = Expr.preFilter; + + while ( soFar ) { + + // Comma and first run + if ( !matched || (match = rcomma.exec( soFar )) ) { + if ( match ) { + // Don't consume trailing commas as valid + soFar = soFar.slice( match[0].length ) || soFar; + } + groups.push( (tokens = []) ); + } + + matched = false; + + // Combinators + if ( (match = rcombinators.exec( soFar )) ) { + matched = match.shift(); + tokens.push({ + value: matched, + // Cast descendant combinators to space + type: match[0].replace( rtrim, " " ) + }); + soFar = soFar.slice( matched.length ); + } + + // Filters + for ( type in Expr.filter ) { + if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] || + (match = preFilters[ type ]( match ))) ) { + matched = match.shift(); + tokens.push({ + value: matched, + type: type, + matches: match + }); + soFar = soFar.slice( matched.length ); + } + } + + if ( !matched ) { + break; + } + } + + // Return the length of the invalid excess + // if we're just parsing + // Otherwise, throw an error or return tokens + return parseOnly ? + soFar.length : + soFar ? + Sizzle.error( selector ) : + // Cache the tokens + tokenCache( selector, groups ).slice( 0 ); +}; + +function toSelector( tokens ) { + var i = 0, + len = tokens.length, + selector = ""; + for ( ; i < len; i++ ) { + selector += tokens[i].value; + } + return selector; +} + +function addCombinator( matcher, combinator, base ) { + var dir = combinator.dir, + checkNonElements = base && dir === "parentNode", + doneName = done++; + + return combinator.first ? + // Check against closest ancestor/preceding element + function( elem, context, xml ) { + while ( (elem = elem[ dir ]) ) { + if ( elem.nodeType === 1 || checkNonElements ) { + return matcher( elem, context, xml ); + } + } + } : + + // Check against all ancestor/preceding elements + function( elem, context, xml ) { + var oldCache, uniqueCache, outerCache, + newCache = [ dirruns, doneName ]; + + // We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching + if ( xml ) { + while ( (elem = elem[ dir ]) ) { + if ( elem.nodeType === 1 || checkNonElements ) { + if ( matcher( elem, context, xml ) ) { + return true; + } + } + } + } else { + while ( (elem = elem[ dir ]) ) { + if ( elem.nodeType === 1 || checkNonElements ) { + outerCache = elem[ expando ] || (elem[ expando ] = {}); + + // Support: IE <9 only + // Defend against cloned attroperties (jQuery gh-1709) + uniqueCache = outerCache[ elem.uniqueID ] || (outerCache[ elem.uniqueID ] = {}); + + if ( (oldCache = uniqueCache[ dir ]) && + oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) { + + // Assign to newCache so results back-propagate to previous elements + return (newCache[ 2 ] = oldCache[ 2 ]); + } else { + // Reuse newcache so results back-propagate to previous elements + uniqueCache[ dir ] = newCache; + + // A match means we're done; a fail means we have to keep checking + if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) { + return true; + } + } + } + } + } + }; +} + +function elementMatcher( matchers ) { + return matchers.length > 1 ? + function( elem, context, xml ) { + var i = matchers.length; + while ( i-- ) { + if ( !matchers[i]( elem, context, xml ) ) { + return false; + } + } + return true; + } : + matchers[0]; +} + +function multipleContexts( selector, contexts, results ) { + var i = 0, + len = contexts.length; + for ( ; i < len; i++ ) { + Sizzle( selector, contexts[i], results ); + } + return results; +} + +function condense( unmatched, map, filter, context, xml ) { + var elem, + newUnmatched = [], + i = 0, + len = unmatched.length, + mapped = map != null; + + for ( ; i < len; i++ ) { + if ( (elem = unmatched[i]) ) { + if ( !filter || filter( elem, context, xml ) ) { + newUnmatched.push( elem ); + if ( mapped ) { + map.push( i ); + } + } + } + } + + return newUnmatched; +} + +function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) { + if ( postFilter && !postFilter[ expando ] ) { + postFilter = setMatcher( postFilter ); + } + if ( postFinder && !postFinder[ expando ] ) { + postFinder = setMatcher( postFinder, postSelector ); + } + return markFunction(function( seed, results, context, xml ) { + var temp, i, elem, + preMap = [], + postMap = [], + preexisting = results.length, + + // Get initial elements from seed or context + elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ), + + // Prefilter to get matcher input, preserving a map for seed-results synchronization + matcherIn = preFilter && ( seed || !selector ) ? + condense( elems, preMap, preFilter, context, xml ) : + elems, + + matcherOut = matcher ? + // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results, + postFinder || ( seed ? preFilter : preexisting || postFilter ) ? + + // ...intermediate processing is necessary + [] : + + // ...otherwise use results directly + results : + matcherIn; + + // Find primary matches + if ( matcher ) { + matcher( matcherIn, matcherOut, context, xml ); + } + + // Apply postFilter + if ( postFilter ) { + temp = condense( matcherOut, postMap ); + postFilter( temp, [], context, xml ); + + // Un-match failing elements by moving them back to matcherIn + i = temp.length; + while ( i-- ) { + if ( (elem = temp[i]) ) { + matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem); + } + } + } + + if ( seed ) { + if ( postFinder || preFilter ) { + if ( postFinder ) { + // Get the final matcherOut by condensing this intermediate into postFinder contexts + temp = []; + i = matcherOut.length; + while ( i-- ) { + if ( (elem = matcherOut[i]) ) { + // Restore matcherIn since elem is not yet a final match + temp.push( (matcherIn[i] = elem) ); + } + } + postFinder( null, (matcherOut = []), temp, xml ); + } + + // Move matched elements from seed to results to keep them synchronized + i = matcherOut.length; + while ( i-- ) { + if ( (elem = matcherOut[i]) && + (temp = postFinder ? indexOf( seed, elem ) : preMap[i]) > -1 ) { + + seed[temp] = !(results[temp] = elem); + } + } + } + + // Add elements to results, through postFinder if defined + } else { + matcherOut = condense( + matcherOut === results ? + matcherOut.splice( preexisting, matcherOut.length ) : + matcherOut + ); + if ( postFinder ) { + postFinder( null, results, matcherOut, xml ); + } else { + push.apply( results, matcherOut ); + } + } + }); +} + +function matcherFromTokens( tokens ) { + var checkContext, matcher, j, + len = tokens.length, + leadingRelative = Expr.relative[ tokens[0].type ], + implicitRelative = leadingRelative || Expr.relative[" "], + i = leadingRelative ? 1 : 0, + + // The foundational matcher ensures that elements are reachable from top-level context(s) + matchContext = addCombinator( function( elem ) { + return elem === checkContext; + }, implicitRelative, true ), + matchAnyContext = addCombinator( function( elem ) { + return indexOf( checkContext, elem ) > -1; + }, implicitRelative, true ), + matchers = [ function( elem, context, xml ) { + var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || ( + (checkContext = context).nodeType ? + matchContext( elem, context, xml ) : + matchAnyContext( elem, context, xml ) ); + // Avoid hanging onto element (issue #299) + checkContext = null; + return ret; + } ]; + + for ( ; i < len; i++ ) { + if ( (matcher = Expr.relative[ tokens[i].type ]) ) { + matchers = [ addCombinator(elementMatcher( matchers ), matcher) ]; + } else { + matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches ); + + // Return special upon seeing a positional matcher + if ( matcher[ expando ] ) { + // Find the next relative operator (if any) for proper handling + j = ++i; + for ( ; j < len; j++ ) { + if ( Expr.relative[ tokens[j].type ] ) { + break; + } + } + return setMatcher( + i > 1 && elementMatcher( matchers ), + i > 1 && toSelector( + // If the preceding token was a descendant combinator, insert an implicit any-element `*` + tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" }) + ).replace( rtrim, "$1" ), + matcher, + i < j && matcherFromTokens( tokens.slice( i, j ) ), + j < len && matcherFromTokens( (tokens = tokens.slice( j )) ), + j < len && toSelector( tokens ) + ); + } + matchers.push( matcher ); + } + } + + return elementMatcher( matchers ); +} + +function matcherFromGroupMatchers( elementMatchers, setMatchers ) { + var bySet = setMatchers.length > 0, + byElement = elementMatchers.length > 0, + superMatcher = function( seed, context, xml, results, outermost ) { + var elem, j, matcher, + matchedCount = 0, + i = "0", + unmatched = seed && [], + setMatched = [], + contextBackup = outermostContext, + // We must always have either seed elements or outermost context + elems = seed || byElement && Expr.find["TAG"]( "*", outermost ), + // Use integer dirruns iff this is the outermost matcher + dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1), + len = elems.length; + + if ( outermost ) { + outermostContext = context === document || context || outermost; + } + + // Add elements passing elementMatchers directly to results + // Support: IE<9, Safari + // Tolerate NodeList properties (IE: "length"; Safari: ) matching elements by id + for ( ; i !== len && (elem = elems[i]) != null; i++ ) { + if ( byElement && elem ) { + j = 0; + if ( !context && elem.ownerDocument !== document ) { + setDocument( elem ); + xml = !documentIsHTML; + } + while ( (matcher = elementMatchers[j++]) ) { + if ( matcher( elem, context || document, xml) ) { + results.push( elem ); + break; + } + } + if ( outermost ) { + dirruns = dirrunsUnique; + } + } + + // Track unmatched elements for set filters + if ( bySet ) { + // They will have gone through all possible matchers + if ( (elem = !matcher && elem) ) { + matchedCount--; + } + + // Lengthen the array for every element, matched or not + if ( seed ) { + unmatched.push( elem ); + } + } + } + + // `i` is now the count of elements visited above, and adding it to `matchedCount` + // makes the latter nonnegative. + matchedCount += i; + + // Apply set filters to unmatched elements + // NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount` + // equals `i`), unless we didn't visit _any_ elements in the above loop because we have + // no element matchers and no seed. + // Incrementing an initially-string "0" `i` allows `i` to remain a string only in that + // case, which will result in a "00" `matchedCount` that differs from `i` but is also + // numerically zero. + if ( bySet && i !== matchedCount ) { + j = 0; + while ( (matcher = setMatchers[j++]) ) { + matcher( unmatched, setMatched, context, xml ); + } + + if ( seed ) { + // Reintegrate element matches to eliminate the need for sorting + if ( matchedCount > 0 ) { + while ( i-- ) { + if ( !(unmatched[i] || setMatched[i]) ) { + setMatched[i] = pop.call( results ); + } + } + } + + // Discard index placeholder values to get only actual matches + setMatched = condense( setMatched ); + } + + // Add matches to results + push.apply( results, setMatched ); + + // Seedless set matches succeeding multiple successful matchers stipulate sorting + if ( outermost && !seed && setMatched.length > 0 && + ( matchedCount + setMatchers.length ) > 1 ) { + + Sizzle.uniqueSort( results ); + } + } + + // Override manipulation of globals by nested matchers + if ( outermost ) { + dirruns = dirrunsUnique; + outermostContext = contextBackup; + } + + return unmatched; + }; + + return bySet ? + markFunction( superMatcher ) : + superMatcher; +} + +compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) { + var i, + setMatchers = [], + elementMatchers = [], + cached = compilerCache[ selector + " " ]; + + if ( !cached ) { + // Generate a function of recursive functions that can be used to check each element + if ( !match ) { + match = tokenize( selector ); + } + i = match.length; + while ( i-- ) { + cached = matcherFromTokens( match[i] ); + if ( cached[ expando ] ) { + setMatchers.push( cached ); + } else { + elementMatchers.push( cached ); + } + } + + // Cache the compiled function + cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) ); + + // Save selector and tokenization + cached.selector = selector; + } + return cached; +}; + +/** + * A low-level selection function that works with Sizzle's compiled + * selector functions + * @param {String|Function} selector A selector or a pre-compiled + * selector function built with Sizzle.compile + * @param {Element} context + * @param {Array} [results] + * @param {Array} [seed] A set of elements to match against + */ +select = Sizzle.select = function( selector, context, results, seed ) { + var i, tokens, token, type, find, + compiled = typeof selector === "function" && selector, + match = !seed && tokenize( (selector = compiled.selector || selector) ); + + results = results || []; + + // Try to minimize operations if there is only one selector in the list and no seed + // (the latter of which guarantees us context) + if ( match.length === 1 ) { + + // Reduce context if the leading compound selector is an ID + tokens = match[0] = match[0].slice( 0 ); + if ( tokens.length > 2 && (token = tokens[0]).type === "ID" && + support.getById && context.nodeType === 9 && documentIsHTML && + Expr.relative[ tokens[1].type ] ) { + + context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0]; + if ( !context ) { + return results; + + // Precompiled matchers will still verify ancestry, so step up a level + } else if ( compiled ) { + context = context.parentNode; + } + + selector = selector.slice( tokens.shift().value.length ); + } + + // Fetch a seed set for right-to-left matching + i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length; + while ( i-- ) { + token = tokens[i]; + + // Abort if we hit a combinator + if ( Expr.relative[ (type = token.type) ] ) { + break; + } + if ( (find = Expr.find[ type ]) ) { + // Search, expanding context for leading sibling combinators + if ( (seed = find( + token.matches[0].replace( runescape, funescape ), + rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context + )) ) { + + // If seed is empty or no tokens remain, we can return early + tokens.splice( i, 1 ); + selector = seed.length && toSelector( tokens ); + if ( !selector ) { + push.apply( results, seed ); + return results; + } + + break; + } + } + } + } + + // Compile and execute a filtering function if one is not provided + // Provide `match` to avoid retokenization if we modified the selector above + ( compiled || compile( selector, match ) )( + seed, + context, + !documentIsHTML, + results, + !context || rsibling.test( selector ) && testContext( context.parentNode ) || context + ); + return results; +}; + +// One-time assignments + +// Sort stability +support.sortStable = expando.split("").sort( sortOrder ).join("") === expando; + +// Support: Chrome 14-35+ +// Always assume duplicates if they aren't passed to the comparison function +support.detectDuplicates = !!hasDuplicate; + +// Initialize against the default document +setDocument(); + +// Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27) +// Detached nodes confoundingly follow *each other* +support.sortDetached = assert(function( div1 ) { + // Should return 1, but returns 4 (following) + return div1.compareDocumentPosition( document.createElement("div") ) & 1; +}); + +// Support: IE<8 +// Prevent attribute/property "interpolation" +// http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx +if ( !assert(function( div ) { + div.innerHTML = ""; + return div.firstChild.getAttribute("href") === "#" ; +}) ) { + addHandle( "type|href|height|width", function( elem, name, isXML ) { + if ( !isXML ) { + return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 ); + } + }); +} + +// Support: IE<9 +// Use defaultValue in place of getAttribute("value") +if ( !support.attributes || !assert(function( div ) { + div.innerHTML = ""; + div.firstChild.setAttribute( "value", "" ); + return div.firstChild.getAttribute( "value" ) === ""; +}) ) { + addHandle( "value", function( elem, name, isXML ) { + if ( !isXML && elem.nodeName.toLowerCase() === "input" ) { + return elem.defaultValue; + } + }); +} + +// Support: IE<9 +// Use getAttributeNode to fetch booleans when getAttribute lies +if ( !assert(function( div ) { + return div.getAttribute("disabled") == null; +}) ) { + addHandle( booleans, function( elem, name, isXML ) { + var val; + if ( !isXML ) { + return elem[ name ] === true ? name.toLowerCase() : + (val = elem.getAttributeNode( name )) && val.specified ? + val.value : + null; + } + }); +} + +return Sizzle; + +})( window ); + + + +jQuery.find = Sizzle; +jQuery.expr = Sizzle.selectors; +jQuery.expr[ ":" ] = jQuery.expr.pseudos; +jQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort; +jQuery.text = Sizzle.getText; +jQuery.isXMLDoc = Sizzle.isXML; +jQuery.contains = Sizzle.contains; + + + +var dir = function( elem, dir, until ) { + var matched = [], + truncate = until !== undefined; + + while ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) { + if ( elem.nodeType === 1 ) { + if ( truncate && jQuery( elem ).is( until ) ) { + break; + } + matched.push( elem ); + } + } + return matched; +}; + + +var siblings = function( n, elem ) { + var matched = []; + + for ( ; n; n = n.nextSibling ) { + if ( n.nodeType === 1 && n !== elem ) { + matched.push( n ); + } + } + + return matched; +}; + + +var rneedsContext = jQuery.expr.match.needsContext; + +var rsingleTag = ( /^<([\w-]+)\s*\/?>(?:<\/\1>|)$/ ); + + + +var risSimple = /^.[^:#\[\.,]*$/; + +// Implement the identical functionality for filter and not +function winnow( elements, qualifier, not ) { + if ( jQuery.isFunction( qualifier ) ) { + return jQuery.grep( elements, function( elem, i ) { + /* jshint -W018 */ + return !!qualifier.call( elem, i, elem ) !== not; + } ); + + } + + if ( qualifier.nodeType ) { + return jQuery.grep( elements, function( elem ) { + return ( elem === qualifier ) !== not; + } ); + + } + + if ( typeof qualifier === "string" ) { + if ( risSimple.test( qualifier ) ) { + return jQuery.filter( qualifier, elements, not ); + } + + qualifier = jQuery.filter( qualifier, elements ); + } + + return jQuery.grep( elements, function( elem ) { + return ( indexOf.call( qualifier, elem ) > -1 ) !== not; + } ); +} + +jQuery.filter = function( expr, elems, not ) { + var elem = elems[ 0 ]; + + if ( not ) { + expr = ":not(" + expr + ")"; + } + + return elems.length === 1 && elem.nodeType === 1 ? + jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [] : + jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) { + return elem.nodeType === 1; + } ) ); +}; + +jQuery.fn.extend( { + find: function( selector ) { + var i, + len = this.length, + ret = [], + self = this; + + if ( typeof selector !== "string" ) { + return this.pushStack( jQuery( selector ).filter( function() { + for ( i = 0; i < len; i++ ) { + if ( jQuery.contains( self[ i ], this ) ) { + return true; + } + } + } ) ); + } + + for ( i = 0; i < len; i++ ) { + jQuery.find( selector, self[ i ], ret ); + } + + // Needed because $( selector, context ) becomes $( context ).find( selector ) + ret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret ); + ret.selector = this.selector ? this.selector + " " + selector : selector; + return ret; + }, + filter: function( selector ) { + return this.pushStack( winnow( this, selector || [], false ) ); + }, + not: function( selector ) { + return this.pushStack( winnow( this, selector || [], true ) ); + }, + is: function( selector ) { + return !!winnow( + this, + + // If this is a positional/relative selector, check membership in the returned set + // so $("p:first").is("p:last") won't return true for a doc with two "p". + typeof selector === "string" && rneedsContext.test( selector ) ? + jQuery( selector ) : + selector || [], + false + ).length; + } +} ); + + +// Initialize a jQuery object + + +// A central reference to the root jQuery(document) +var rootjQuery, + + // A simple way to check for HTML strings + // Prioritize #id over to avoid XSS via location.hash (#9521) + // Strict HTML recognition (#11290: must start with <) + rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/, + + init = jQuery.fn.init = function( selector, context, root ) { + var match, elem; + + // HANDLE: $(""), $(null), $(undefined), $(false) + if ( !selector ) { + return this; + } + + // Method init() accepts an alternate rootjQuery + // so migrate can support jQuery.sub (gh-2101) + root = root || rootjQuery; + + // Handle HTML strings + if ( typeof selector === "string" ) { + if ( selector[ 0 ] === "<" && + selector[ selector.length - 1 ] === ">" && + selector.length >= 3 ) { + + // Assume that strings that start and end with <> are HTML and skip the regex check + match = [ null, selector, null ]; + + } else { + match = rquickExpr.exec( selector ); + } + + // Match html or make sure no context is specified for #id + if ( match && ( match[ 1 ] || !context ) ) { + + // HANDLE: $(html) -> $(array) + if ( match[ 1 ] ) { + context = context instanceof jQuery ? context[ 0 ] : context; + + // Option to run scripts is true for back-compat + // Intentionally let the error be thrown if parseHTML is not present + jQuery.merge( this, jQuery.parseHTML( + match[ 1 ], + context && context.nodeType ? context.ownerDocument || context : document, + true + ) ); + + // HANDLE: $(html, props) + if ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) { + for ( match in context ) { + + // Properties of context are called as methods if possible + if ( jQuery.isFunction( this[ match ] ) ) { + this[ match ]( context[ match ] ); + + // ...and otherwise set as attributes + } else { + this.attr( match, context[ match ] ); + } + } + } + + return this; + + // HANDLE: $(#id) + } else { + elem = document.getElementById( match[ 2 ] ); + + // Support: Blackberry 4.6 + // gEBID returns nodes no longer in the document (#6963) + if ( elem && elem.parentNode ) { + + // Inject the element directly into the jQuery object + this.length = 1; + this[ 0 ] = elem; + } + + this.context = document; + this.selector = selector; + return this; + } + + // HANDLE: $(expr, $(...)) + } else if ( !context || context.jquery ) { + return ( context || root ).find( selector ); + + // HANDLE: $(expr, context) + // (which is just equivalent to: $(context).find(expr) + } else { + return this.constructor( context ).find( selector ); + } + + // HANDLE: $(DOMElement) + } else if ( selector.nodeType ) { + this.context = this[ 0 ] = selector; + this.length = 1; + return this; + + // HANDLE: $(function) + // Shortcut for document ready + } else if ( jQuery.isFunction( selector ) ) { + return root.ready !== undefined ? + root.ready( selector ) : + + // Execute immediately if ready is not present + selector( jQuery ); + } + + if ( selector.selector !== undefined ) { + this.selector = selector.selector; + this.context = selector.context; + } + + return jQuery.makeArray( selector, this ); + }; + +// Give the init function the jQuery prototype for later instantiation +init.prototype = jQuery.fn; + +// Initialize central reference +rootjQuery = jQuery( document ); + + +var rparentsprev = /^(?:parents|prev(?:Until|All))/, + + // Methods guaranteed to produce a unique set when starting from a unique set + guaranteedUnique = { + children: true, + contents: true, + next: true, + prev: true + }; + +jQuery.fn.extend( { + has: function( target ) { + var targets = jQuery( target, this ), + l = targets.length; + + return this.filter( function() { + var i = 0; + for ( ; i < l; i++ ) { + if ( jQuery.contains( this, targets[ i ] ) ) { + return true; + } + } + } ); + }, + + closest: function( selectors, context ) { + var cur, + i = 0, + l = this.length, + matched = [], + pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ? + jQuery( selectors, context || this.context ) : + 0; + + for ( ; i < l; i++ ) { + for ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) { + + // Always skip document fragments + if ( cur.nodeType < 11 && ( pos ? + pos.index( cur ) > -1 : + + // Don't pass non-elements to Sizzle + cur.nodeType === 1 && + jQuery.find.matchesSelector( cur, selectors ) ) ) { + + matched.push( cur ); + break; + } + } + } + + return this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched ); + }, + + // Determine the position of an element within the set + index: function( elem ) { + + // No argument, return index in parent + if ( !elem ) { + return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1; + } + + // Index in selector + if ( typeof elem === "string" ) { + return indexOf.call( jQuery( elem ), this[ 0 ] ); + } + + // Locate the position of the desired element + return indexOf.call( this, + + // If it receives a jQuery object, the first element is used + elem.jquery ? elem[ 0 ] : elem + ); + }, + + add: function( selector, context ) { + return this.pushStack( + jQuery.uniqueSort( + jQuery.merge( this.get(), jQuery( selector, context ) ) + ) + ); + }, + + addBack: function( selector ) { + return this.add( selector == null ? + this.prevObject : this.prevObject.filter( selector ) + ); + } +} ); + +function sibling( cur, dir ) { + while ( ( cur = cur[ dir ] ) && cur.nodeType !== 1 ) {} + return cur; +} + +jQuery.each( { + parent: function( elem ) { + var parent = elem.parentNode; + return parent && parent.nodeType !== 11 ? parent : null; + }, + parents: function( elem ) { + return dir( elem, "parentNode" ); + }, + parentsUntil: function( elem, i, until ) { + return dir( elem, "parentNode", until ); + }, + next: function( elem ) { + return sibling( elem, "nextSibling" ); + }, + prev: function( elem ) { + return sibling( elem, "previousSibling" ); + }, + nextAll: function( elem ) { + return dir( elem, "nextSibling" ); + }, + prevAll: function( elem ) { + return dir( elem, "previousSibling" ); + }, + nextUntil: function( elem, i, until ) { + return dir( elem, "nextSibling", until ); + }, + prevUntil: function( elem, i, until ) { + return dir( elem, "previousSibling", until ); + }, + siblings: function( elem ) { + return siblings( ( elem.parentNode || {} ).firstChild, elem ); + }, + children: function( elem ) { + return siblings( elem.firstChild ); + }, + contents: function( elem ) { + return elem.contentDocument || jQuery.merge( [], elem.childNodes ); + } +}, function( name, fn ) { + jQuery.fn[ name ] = function( until, selector ) { + var matched = jQuery.map( this, fn, until ); + + if ( name.slice( -5 ) !== "Until" ) { + selector = until; + } + + if ( selector && typeof selector === "string" ) { + matched = jQuery.filter( selector, matched ); + } + + if ( this.length > 1 ) { + + // Remove duplicates + if ( !guaranteedUnique[ name ] ) { + jQuery.uniqueSort( matched ); + } + + // Reverse order for parents* and prev-derivatives + if ( rparentsprev.test( name ) ) { + matched.reverse(); + } + } + + return this.pushStack( matched ); + }; +} ); +var rnotwhite = ( /\S+/g ); + + + +// Convert String-formatted options into Object-formatted ones +function createOptions( options ) { + var object = {}; + jQuery.each( options.match( rnotwhite ) || [], function( _, flag ) { + object[ flag ] = true; + } ); + return object; +} + +/* + * Create a callback list using the following parameters: + * + * options: an optional list of space-separated options that will change how + * the callback list behaves or a more traditional option object + * + * By default a callback list will act like an event callback list and can be + * "fired" multiple times. + * + * Possible options: + * + * once: will ensure the callback list can only be fired once (like a Deferred) + * + * memory: will keep track of previous values and will call any callback added + * after the list has been fired right away with the latest "memorized" + * values (like a Deferred) + * + * unique: will ensure a callback can only be added once (no duplicate in the list) + * + * stopOnFalse: interrupt callings when a callback returns false + * + */ +jQuery.Callbacks = function( options ) { + + // Convert options from String-formatted to Object-formatted if needed + // (we check in cache first) + options = typeof options === "string" ? + createOptions( options ) : + jQuery.extend( {}, options ); + + var // Flag to know if list is currently firing + firing, + + // Last fire value for non-forgettable lists + memory, + + // Flag to know if list was already fired + fired, + + // Flag to prevent firing + locked, + + // Actual callback list + list = [], + + // Queue of execution data for repeatable lists + queue = [], + + // Index of currently firing callback (modified by add/remove as needed) + firingIndex = -1, + + // Fire callbacks + fire = function() { + + // Enforce single-firing + locked = options.once; + + // Execute callbacks for all pending executions, + // respecting firingIndex overrides and runtime changes + fired = firing = true; + for ( ; queue.length; firingIndex = -1 ) { + memory = queue.shift(); + while ( ++firingIndex < list.length ) { + + // Run callback and check for early termination + if ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false && + options.stopOnFalse ) { + + // Jump to end and forget the data so .add doesn't re-fire + firingIndex = list.length; + memory = false; + } + } + } + + // Forget the data if we're done with it + if ( !options.memory ) { + memory = false; + } + + firing = false; + + // Clean up if we're done firing for good + if ( locked ) { + + // Keep an empty list if we have data for future add calls + if ( memory ) { + list = []; + + // Otherwise, this object is spent + } else { + list = ""; + } + } + }, + + // Actual Callbacks object + self = { + + // Add a callback or a collection of callbacks to the list + add: function() { + if ( list ) { + + // If we have memory from a past run, we should fire after adding + if ( memory && !firing ) { + firingIndex = list.length - 1; + queue.push( memory ); + } + + ( function add( args ) { + jQuery.each( args, function( _, arg ) { + if ( jQuery.isFunction( arg ) ) { + if ( !options.unique || !self.has( arg ) ) { + list.push( arg ); + } + } else if ( arg && arg.length && jQuery.type( arg ) !== "string" ) { + + // Inspect recursively + add( arg ); + } + } ); + } )( arguments ); + + if ( memory && !firing ) { + fire(); + } + } + return this; + }, + + // Remove a callback from the list + remove: function() { + jQuery.each( arguments, function( _, arg ) { + var index; + while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) { + list.splice( index, 1 ); + + // Handle firing indexes + if ( index <= firingIndex ) { + firingIndex--; + } + } + } ); + return this; + }, + + // Check if a given callback is in the list. + // If no argument is given, return whether or not list has callbacks attached. + has: function( fn ) { + return fn ? + jQuery.inArray( fn, list ) > -1 : + list.length > 0; + }, + + // Remove all callbacks from the list + empty: function() { + if ( list ) { + list = []; + } + return this; + }, + + // Disable .fire and .add + // Abort any current/pending executions + // Clear all callbacks and values + disable: function() { + locked = queue = []; + list = memory = ""; + return this; + }, + disabled: function() { + return !list; + }, + + // Disable .fire + // Also disable .add unless we have memory (since it would have no effect) + // Abort any pending executions + lock: function() { + locked = queue = []; + if ( !memory ) { + list = memory = ""; + } + return this; + }, + locked: function() { + return !!locked; + }, + + // Call all callbacks with the given context and arguments + fireWith: function( context, args ) { + if ( !locked ) { + args = args || []; + args = [ context, args.slice ? args.slice() : args ]; + queue.push( args ); + if ( !firing ) { + fire(); + } + } + return this; + }, + + // Call all the callbacks with the given arguments + fire: function() { + self.fireWith( this, arguments ); + return this; + }, + + // To know if the callbacks have already been called at least once + fired: function() { + return !!fired; + } + }; + + return self; +}; + + +jQuery.extend( { + + Deferred: function( func ) { + var tuples = [ + + // action, add listener, listener list, final state + [ "resolve", "done", jQuery.Callbacks( "once memory" ), "resolved" ], + [ "reject", "fail", jQuery.Callbacks( "once memory" ), "rejected" ], + [ "notify", "progress", jQuery.Callbacks( "memory" ) ] + ], + state = "pending", + promise = { + state: function() { + return state; + }, + always: function() { + deferred.done( arguments ).fail( arguments ); + return this; + }, + then: function( /* fnDone, fnFail, fnProgress */ ) { + var fns = arguments; + return jQuery.Deferred( function( newDefer ) { + jQuery.each( tuples, function( i, tuple ) { + var fn = jQuery.isFunction( fns[ i ] ) && fns[ i ]; + + // deferred[ done | fail | progress ] for forwarding actions to newDefer + deferred[ tuple[ 1 ] ]( function() { + var returned = fn && fn.apply( this, arguments ); + if ( returned && jQuery.isFunction( returned.promise ) ) { + returned.promise() + .progress( newDefer.notify ) + .done( newDefer.resolve ) + .fail( newDefer.reject ); + } else { + newDefer[ tuple[ 0 ] + "With" ]( + this === promise ? newDefer.promise() : this, + fn ? [ returned ] : arguments + ); + } + } ); + } ); + fns = null; + } ).promise(); + }, + + // Get a promise for this deferred + // If obj is provided, the promise aspect is added to the object + promise: function( obj ) { + return obj != null ? jQuery.extend( obj, promise ) : promise; + } + }, + deferred = {}; + + // Keep pipe for back-compat + promise.pipe = promise.then; + + // Add list-specific methods + jQuery.each( tuples, function( i, tuple ) { + var list = tuple[ 2 ], + stateString = tuple[ 3 ]; + + // promise[ done | fail | progress ] = list.add + promise[ tuple[ 1 ] ] = list.add; + + // Handle state + if ( stateString ) { + list.add( function() { + + // state = [ resolved | rejected ] + state = stateString; + + // [ reject_list | resolve_list ].disable; progress_list.lock + }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock ); + } + + // deferred[ resolve | reject | notify ] + deferred[ tuple[ 0 ] ] = function() { + deferred[ tuple[ 0 ] + "With" ]( this === deferred ? promise : this, arguments ); + return this; + }; + deferred[ tuple[ 0 ] + "With" ] = list.fireWith; + } ); + + // Make the deferred a promise + promise.promise( deferred ); + + // Call given func if any + if ( func ) { + func.call( deferred, deferred ); + } + + // All done! + return deferred; + }, + + // Deferred helper + when: function( subordinate /* , ..., subordinateN */ ) { + var i = 0, + resolveValues = slice.call( arguments ), + length = resolveValues.length, + + // the count of uncompleted subordinates + remaining = length !== 1 || + ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0, + + // the master Deferred. + // If resolveValues consist of only a single Deferred, just use that. + deferred = remaining === 1 ? subordinate : jQuery.Deferred(), + + // Update function for both resolve and progress values + updateFunc = function( i, contexts, values ) { + return function( value ) { + contexts[ i ] = this; + values[ i ] = arguments.length > 1 ? slice.call( arguments ) : value; + if ( values === progressValues ) { + deferred.notifyWith( contexts, values ); + } else if ( !( --remaining ) ) { + deferred.resolveWith( contexts, values ); + } + }; + }, + + progressValues, progressContexts, resolveContexts; + + // Add listeners to Deferred subordinates; treat others as resolved + if ( length > 1 ) { + progressValues = new Array( length ); + progressContexts = new Array( length ); + resolveContexts = new Array( length ); + for ( ; i < length; i++ ) { + if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) { + resolveValues[ i ].promise() + .progress( updateFunc( i, progressContexts, progressValues ) ) + .done( updateFunc( i, resolveContexts, resolveValues ) ) + .fail( deferred.reject ); + } else { + --remaining; + } + } + } + + // If we're not waiting on anything, resolve the master + if ( !remaining ) { + deferred.resolveWith( resolveContexts, resolveValues ); + } + + return deferred.promise(); + } +} ); + + +// The deferred used on DOM ready +var readyList; + +jQuery.fn.ready = function( fn ) { + + // Add the callback + jQuery.ready.promise().done( fn ); + + return this; +}; + +jQuery.extend( { + + // Is the DOM ready to be used? Set to true once it occurs. + isReady: false, + + // A counter to track how many items to wait for before + // the ready event fires. See #6781 + readyWait: 1, + + // Hold (or release) the ready event + holdReady: function( hold ) { + if ( hold ) { + jQuery.readyWait++; + } else { + jQuery.ready( true ); + } + }, + + // Handle when the DOM is ready + ready: function( wait ) { + + // Abort if there are pending holds or we're already ready + if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) { + return; + } + + // Remember that the DOM is ready + jQuery.isReady = true; + + // If a normal DOM Ready event fired, decrement, and wait if need be + if ( wait !== true && --jQuery.readyWait > 0 ) { + return; + } + + // If there are functions bound, to execute + readyList.resolveWith( document, [ jQuery ] ); + + // Trigger any bound ready events + if ( jQuery.fn.triggerHandler ) { + jQuery( document ).triggerHandler( "ready" ); + jQuery( document ).off( "ready" ); + } + } +} ); + +/** + * The ready event handler and self cleanup method + */ +function completed() { + document.removeEventListener( "DOMContentLoaded", completed ); + window.removeEventListener( "load", completed ); + jQuery.ready(); +} + +jQuery.ready.promise = function( obj ) { + if ( !readyList ) { + + readyList = jQuery.Deferred(); + + // Catch cases where $(document).ready() is called + // after the browser event has already occurred. + // Support: IE9-10 only + // Older IE sometimes signals "interactive" too soon + if ( document.readyState === "complete" || + ( document.readyState !== "loading" && !document.documentElement.doScroll ) ) { + + // Handle it asynchronously to allow scripts the opportunity to delay ready + window.setTimeout( jQuery.ready ); + + } else { + + // Use the handy event callback + document.addEventListener( "DOMContentLoaded", completed ); + + // A fallback to window.onload, that will always work + window.addEventListener( "load", completed ); + } + } + return readyList.promise( obj ); +}; + +// Kick off the DOM ready check even if the user does not +jQuery.ready.promise(); + + + + +// Multifunctional method to get and set values of a collection +// The value/s can optionally be executed if it's a function +var access = function( elems, fn, key, value, chainable, emptyGet, raw ) { + var i = 0, + len = elems.length, + bulk = key == null; + + // Sets many values + if ( jQuery.type( key ) === "object" ) { + chainable = true; + for ( i in key ) { + access( elems, fn, i, key[ i ], true, emptyGet, raw ); + } + + // Sets one value + } else if ( value !== undefined ) { + chainable = true; + + if ( !jQuery.isFunction( value ) ) { + raw = true; + } + + if ( bulk ) { + + // Bulk operations run against the entire set + if ( raw ) { + fn.call( elems, value ); + fn = null; + + // ...except when executing function values + } else { + bulk = fn; + fn = function( elem, key, value ) { + return bulk.call( jQuery( elem ), value ); + }; + } + } + + if ( fn ) { + for ( ; i < len; i++ ) { + fn( + elems[ i ], key, raw ? + value : + value.call( elems[ i ], i, fn( elems[ i ], key ) ) + ); + } + } + } + + return chainable ? + elems : + + // Gets + bulk ? + fn.call( elems ) : + len ? fn( elems[ 0 ], key ) : emptyGet; +}; +var acceptData = function( owner ) { + + // Accepts only: + // - Node + // - Node.ELEMENT_NODE + // - Node.DOCUMENT_NODE + // - Object + // - Any + /* jshint -W018 */ + return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType ); +}; + + + + +function Data() { + this.expando = jQuery.expando + Data.uid++; +} + +Data.uid = 1; + +Data.prototype = { + + register: function( owner, initial ) { + var value = initial || {}; + + // If it is a node unlikely to be stringify-ed or looped over + // use plain assignment + if ( owner.nodeType ) { + owner[ this.expando ] = value; + + // Otherwise secure it in a non-enumerable, non-writable property + // configurability must be true to allow the property to be + // deleted with the delete operator + } else { + Object.defineProperty( owner, this.expando, { + value: value, + writable: true, + configurable: true + } ); + } + return owner[ this.expando ]; + }, + cache: function( owner ) { + + // We can accept data for non-element nodes in modern browsers, + // but we should not, see #8335. + // Always return an empty object. + if ( !acceptData( owner ) ) { + return {}; + } + + // Check if the owner object already has a cache + var value = owner[ this.expando ]; + + // If not, create one + if ( !value ) { + value = {}; + + // We can accept data for non-element nodes in modern browsers, + // but we should not, see #8335. + // Always return an empty object. + if ( acceptData( owner ) ) { + + // If it is a node unlikely to be stringify-ed or looped over + // use plain assignment + if ( owner.nodeType ) { + owner[ this.expando ] = value; + + // Otherwise secure it in a non-enumerable property + // configurable must be true to allow the property to be + // deleted when data is removed + } else { + Object.defineProperty( owner, this.expando, { + value: value, + configurable: true + } ); + } + } + } + + return value; + }, + set: function( owner, data, value ) { + var prop, + cache = this.cache( owner ); + + // Handle: [ owner, key, value ] args + if ( typeof data === "string" ) { + cache[ data ] = value; + + // Handle: [ owner, { properties } ] args + } else { + + // Copy the properties one-by-one to the cache object + for ( prop in data ) { + cache[ prop ] = data[ prop ]; + } + } + return cache; + }, + get: function( owner, key ) { + return key === undefined ? + this.cache( owner ) : + owner[ this.expando ] && owner[ this.expando ][ key ]; + }, + access: function( owner, key, value ) { + var stored; + + // In cases where either: + // + // 1. No key was specified + // 2. A string key was specified, but no value provided + // + // Take the "read" path and allow the get method to determine + // which value to return, respectively either: + // + // 1. The entire cache object + // 2. The data stored at the key + // + if ( key === undefined || + ( ( key && typeof key === "string" ) && value === undefined ) ) { + + stored = this.get( owner, key ); + + return stored !== undefined ? + stored : this.get( owner, jQuery.camelCase( key ) ); + } + + // When the key is not a string, or both a key and value + // are specified, set or extend (existing objects) with either: + // + // 1. An object of properties + // 2. A key and value + // + this.set( owner, key, value ); + + // Since the "set" path can have two possible entry points + // return the expected data based on which path was taken[*] + return value !== undefined ? value : key; + }, + remove: function( owner, key ) { + var i, name, camel, + cache = owner[ this.expando ]; + + if ( cache === undefined ) { + return; + } + + if ( key === undefined ) { + this.register( owner ); + + } else { + + // Support array or space separated string of keys + if ( jQuery.isArray( key ) ) { + + // If "name" is an array of keys... + // When data is initially created, via ("key", "val") signature, + // keys will be converted to camelCase. + // Since there is no way to tell _how_ a key was added, remove + // both plain key and camelCase key. #12786 + // This will only penalize the array argument path. + name = key.concat( key.map( jQuery.camelCase ) ); + } else { + camel = jQuery.camelCase( key ); + + // Try the string as a key before any manipulation + if ( key in cache ) { + name = [ key, camel ]; + } else { + + // If a key with the spaces exists, use it. + // Otherwise, create an array by matching non-whitespace + name = camel; + name = name in cache ? + [ name ] : ( name.match( rnotwhite ) || [] ); + } + } + + i = name.length; + + while ( i-- ) { + delete cache[ name[ i ] ]; + } + } + + // Remove the expando if there's no more data + if ( key === undefined || jQuery.isEmptyObject( cache ) ) { + + // Support: Chrome <= 35-45+ + // Webkit & Blink performance suffers when deleting properties + // from DOM nodes, so set to undefined instead + // https://code.google.com/p/chromium/issues/detail?id=378607 + if ( owner.nodeType ) { + owner[ this.expando ] = undefined; + } else { + delete owner[ this.expando ]; + } + } + }, + hasData: function( owner ) { + var cache = owner[ this.expando ]; + return cache !== undefined && !jQuery.isEmptyObject( cache ); + } +}; +var dataPriv = new Data(); + +var dataUser = new Data(); + + + +// Implementation Summary +// +// 1. Enforce API surface and semantic compatibility with 1.9.x branch +// 2. Improve the module's maintainability by reducing the storage +// paths to a single mechanism. +// 3. Use the same single mechanism to support "private" and "user" data. +// 4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData) +// 5. Avoid exposing implementation details on user objects (eg. expando properties) +// 6. Provide a clear path for implementation upgrade to WeakMap in 2014 + +var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, + rmultiDash = /[A-Z]/g; + +function dataAttr( elem, key, data ) { + var name; + + // If nothing was found internally, try to fetch any + // data from the HTML5 data-* attribute + if ( data === undefined && elem.nodeType === 1 ) { + name = "data-" + key.replace( rmultiDash, "-$&" ).toLowerCase(); + data = elem.getAttribute( name ); + + if ( typeof data === "string" ) { + try { + data = data === "true" ? true : + data === "false" ? false : + data === "null" ? null : + + // Only convert to a number if it doesn't change the string + +data + "" === data ? +data : + rbrace.test( data ) ? jQuery.parseJSON( data ) : + data; + } catch ( e ) {} + + // Make sure we set the data so it isn't changed later + dataUser.set( elem, key, data ); + } else { + data = undefined; + } + } + return data; +} + +jQuery.extend( { + hasData: function( elem ) { + return dataUser.hasData( elem ) || dataPriv.hasData( elem ); + }, + + data: function( elem, name, data ) { + return dataUser.access( elem, name, data ); + }, + + removeData: function( elem, name ) { + dataUser.remove( elem, name ); + }, + + // TODO: Now that all calls to _data and _removeData have been replaced + // with direct calls to dataPriv methods, these can be deprecated. + _data: function( elem, name, data ) { + return dataPriv.access( elem, name, data ); + }, + + _removeData: function( elem, name ) { + dataPriv.remove( elem, name ); + } +} ); + +jQuery.fn.extend( { + data: function( key, value ) { + var i, name, data, + elem = this[ 0 ], + attrs = elem && elem.attributes; + + // Gets all values + if ( key === undefined ) { + if ( this.length ) { + data = dataUser.get( elem ); + + if ( elem.nodeType === 1 && !dataPriv.get( elem, "hasDataAttrs" ) ) { + i = attrs.length; + while ( i-- ) { + + // Support: IE11+ + // The attrs elements can be null (#14894) + if ( attrs[ i ] ) { + name = attrs[ i ].name; + if ( name.indexOf( "data-" ) === 0 ) { + name = jQuery.camelCase( name.slice( 5 ) ); + dataAttr( elem, name, data[ name ] ); + } + } + } + dataPriv.set( elem, "hasDataAttrs", true ); + } + } + + return data; + } + + // Sets multiple values + if ( typeof key === "object" ) { + return this.each( function() { + dataUser.set( this, key ); + } ); + } + + return access( this, function( value ) { + var data, camelKey; + + // The calling jQuery object (element matches) is not empty + // (and therefore has an element appears at this[ 0 ]) and the + // `value` parameter was not undefined. An empty jQuery object + // will result in `undefined` for elem = this[ 0 ] which will + // throw an exception if an attempt to read a data cache is made. + if ( elem && value === undefined ) { + + // Attempt to get data from the cache + // with the key as-is + data = dataUser.get( elem, key ) || + + // Try to find dashed key if it exists (gh-2779) + // This is for 2.2.x only + dataUser.get( elem, key.replace( rmultiDash, "-$&" ).toLowerCase() ); + + if ( data !== undefined ) { + return data; + } + + camelKey = jQuery.camelCase( key ); + + // Attempt to get data from the cache + // with the key camelized + data = dataUser.get( elem, camelKey ); + if ( data !== undefined ) { + return data; + } + + // Attempt to "discover" the data in + // HTML5 custom data-* attrs + data = dataAttr( elem, camelKey, undefined ); + if ( data !== undefined ) { + return data; + } + + // We tried really hard, but the data doesn't exist. + return; + } + + // Set the data... + camelKey = jQuery.camelCase( key ); + this.each( function() { + + // First, attempt to store a copy or reference of any + // data that might've been store with a camelCased key. + var data = dataUser.get( this, camelKey ); + + // For HTML5 data-* attribute interop, we have to + // store property names with dashes in a camelCase form. + // This might not apply to all properties...* + dataUser.set( this, camelKey, value ); + + // *... In the case of properties that might _actually_ + // have dashes, we need to also store a copy of that + // unchanged property. + if ( key.indexOf( "-" ) > -1 && data !== undefined ) { + dataUser.set( this, key, value ); + } + } ); + }, null, value, arguments.length > 1, null, true ); + }, + + removeData: function( key ) { + return this.each( function() { + dataUser.remove( this, key ); + } ); + } +} ); + + +jQuery.extend( { + queue: function( elem, type, data ) { + var queue; + + if ( elem ) { + type = ( type || "fx" ) + "queue"; + queue = dataPriv.get( elem, type ); + + // Speed up dequeue by getting out quickly if this is just a lookup + if ( data ) { + if ( !queue || jQuery.isArray( data ) ) { + queue = dataPriv.access( elem, type, jQuery.makeArray( data ) ); + } else { + queue.push( data ); + } + } + return queue || []; + } + }, + + dequeue: function( elem, type ) { + type = type || "fx"; + + var queue = jQuery.queue( elem, type ), + startLength = queue.length, + fn = queue.shift(), + hooks = jQuery._queueHooks( elem, type ), + next = function() { + jQuery.dequeue( elem, type ); + }; + + // If the fx queue is dequeued, always remove the progress sentinel + if ( fn === "inprogress" ) { + fn = queue.shift(); + startLength--; + } + + if ( fn ) { + + // Add a progress sentinel to prevent the fx queue from being + // automatically dequeued + if ( type === "fx" ) { + queue.unshift( "inprogress" ); + } + + // Clear up the last queue stop function + delete hooks.stop; + fn.call( elem, next, hooks ); + } + + if ( !startLength && hooks ) { + hooks.empty.fire(); + } + }, + + // Not public - generate a queueHooks object, or return the current one + _queueHooks: function( elem, type ) { + var key = type + "queueHooks"; + return dataPriv.get( elem, key ) || dataPriv.access( elem, key, { + empty: jQuery.Callbacks( "once memory" ).add( function() { + dataPriv.remove( elem, [ type + "queue", key ] ); + } ) + } ); + } +} ); + +jQuery.fn.extend( { + queue: function( type, data ) { + var setter = 2; + + if ( typeof type !== "string" ) { + data = type; + type = "fx"; + setter--; + } + + if ( arguments.length < setter ) { + return jQuery.queue( this[ 0 ], type ); + } + + return data === undefined ? + this : + this.each( function() { + var queue = jQuery.queue( this, type, data ); + + // Ensure a hooks for this queue + jQuery._queueHooks( this, type ); + + if ( type === "fx" && queue[ 0 ] !== "inprogress" ) { + jQuery.dequeue( this, type ); + } + } ); + }, + dequeue: function( type ) { + return this.each( function() { + jQuery.dequeue( this, type ); + } ); + }, + clearQueue: function( type ) { + return this.queue( type || "fx", [] ); + }, + + // Get a promise resolved when queues of a certain type + // are emptied (fx is the type by default) + promise: function( type, obj ) { + var tmp, + count = 1, + defer = jQuery.Deferred(), + elements = this, + i = this.length, + resolve = function() { + if ( !( --count ) ) { + defer.resolveWith( elements, [ elements ] ); + } + }; + + if ( typeof type !== "string" ) { + obj = type; + type = undefined; + } + type = type || "fx"; + + while ( i-- ) { + tmp = dataPriv.get( elements[ i ], type + "queueHooks" ); + if ( tmp && tmp.empty ) { + count++; + tmp.empty.add( resolve ); + } + } + resolve(); + return defer.promise( obj ); + } +} ); +var pnum = ( /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/ ).source; + +var rcssNum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" ); + + +var cssExpand = [ "Top", "Right", "Bottom", "Left" ]; + +var isHidden = function( elem, el ) { + + // isHidden might be called from jQuery#filter function; + // in that case, element will be second argument + elem = el || elem; + return jQuery.css( elem, "display" ) === "none" || + !jQuery.contains( elem.ownerDocument, elem ); + }; + + + +function adjustCSS( elem, prop, valueParts, tween ) { + var adjusted, + scale = 1, + maxIterations = 20, + currentValue = tween ? + function() { return tween.cur(); } : + function() { return jQuery.css( elem, prop, "" ); }, + initial = currentValue(), + unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ), + + // Starting value computation is required for potential unit mismatches + initialInUnit = ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) && + rcssNum.exec( jQuery.css( elem, prop ) ); + + if ( initialInUnit && initialInUnit[ 3 ] !== unit ) { + + // Trust units reported by jQuery.css + unit = unit || initialInUnit[ 3 ]; + + // Make sure we update the tween properties later on + valueParts = valueParts || []; + + // Iteratively approximate from a nonzero starting point + initialInUnit = +initial || 1; + + do { + + // If previous iteration zeroed out, double until we get *something*. + // Use string for doubling so we don't accidentally see scale as unchanged below + scale = scale || ".5"; + + // Adjust and apply + initialInUnit = initialInUnit / scale; + jQuery.style( elem, prop, initialInUnit + unit ); + + // Update scale, tolerating zero or NaN from tween.cur() + // Break the loop if scale is unchanged or perfect, or if we've just had enough. + } while ( + scale !== ( scale = currentValue() / initial ) && scale !== 1 && --maxIterations + ); + } + + if ( valueParts ) { + initialInUnit = +initialInUnit || +initial || 0; + + // Apply relative offset (+=/-=) if specified + adjusted = valueParts[ 1 ] ? + initialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] : + +valueParts[ 2 ]; + if ( tween ) { + tween.unit = unit; + tween.start = initialInUnit; + tween.end = adjusted; + } + } + return adjusted; +} +var rcheckableType = ( /^(?:checkbox|radio)$/i ); + +var rtagName = ( /<([\w:-]+)/ ); + +var rscriptType = ( /^$|\/(?:java|ecma)script/i ); + + + +// We have to close these tags to support XHTML (#13200) +var wrapMap = { + + // Support: IE9 + option: [ 1, "" ], + + // XHTML parsers do not magically insert elements in the + // same way that tag soup parsers do. So we cannot shorten + // this by omitting or other required elements. + thead: [ 1, "", "
      " ], + col: [ 2, "", "
      " ], + tr: [ 2, "", "
      " ], + td: [ 3, "", "
      " ], + + _default: [ 0, "", "" ] +}; + +// Support: IE9 +wrapMap.optgroup = wrapMap.option; + +wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; +wrapMap.th = wrapMap.td; + + +function getAll( context, tag ) { + + // Support: IE9-11+ + // Use typeof to avoid zero-argument method invocation on host objects (#15151) + var ret = typeof context.getElementsByTagName !== "undefined" ? + context.getElementsByTagName( tag || "*" ) : + typeof context.querySelectorAll !== "undefined" ? + context.querySelectorAll( tag || "*" ) : + []; + + return tag === undefined || tag && jQuery.nodeName( context, tag ) ? + jQuery.merge( [ context ], ret ) : + ret; +} + + +// Mark scripts as having already been evaluated +function setGlobalEval( elems, refElements ) { + var i = 0, + l = elems.length; + + for ( ; i < l; i++ ) { + dataPriv.set( + elems[ i ], + "globalEval", + !refElements || dataPriv.get( refElements[ i ], "globalEval" ) + ); + } +} + + +var rhtml = /<|&#?\w+;/; + +function buildFragment( elems, context, scripts, selection, ignored ) { + var elem, tmp, tag, wrap, contains, j, + fragment = context.createDocumentFragment(), + nodes = [], + i = 0, + l = elems.length; + + for ( ; i < l; i++ ) { + elem = elems[ i ]; + + if ( elem || elem === 0 ) { + + // Add nodes directly + if ( jQuery.type( elem ) === "object" ) { + + // Support: Android<4.1, PhantomJS<2 + // push.apply(_, arraylike) throws on ancient WebKit + jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem ); + + // Convert non-html into a text node + } else if ( !rhtml.test( elem ) ) { + nodes.push( context.createTextNode( elem ) ); + + // Convert html into DOM nodes + } else { + tmp = tmp || fragment.appendChild( context.createElement( "div" ) ); + + // Deserialize a standard representation + tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase(); + wrap = wrapMap[ tag ] || wrapMap._default; + tmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ]; + + // Descend through wrappers to the right content + j = wrap[ 0 ]; + while ( j-- ) { + tmp = tmp.lastChild; + } + + // Support: Android<4.1, PhantomJS<2 + // push.apply(_, arraylike) throws on ancient WebKit + jQuery.merge( nodes, tmp.childNodes ); + + // Remember the top-level container + tmp = fragment.firstChild; + + // Ensure the created nodes are orphaned (#12392) + tmp.textContent = ""; + } + } + } + + // Remove wrapper from fragment + fragment.textContent = ""; + + i = 0; + while ( ( elem = nodes[ i++ ] ) ) { + + // Skip elements already in the context collection (trac-4087) + if ( selection && jQuery.inArray( elem, selection ) > -1 ) { + if ( ignored ) { + ignored.push( elem ); + } + continue; + } + + contains = jQuery.contains( elem.ownerDocument, elem ); + + // Append to fragment + tmp = getAll( fragment.appendChild( elem ), "script" ); + + // Preserve script evaluation history + if ( contains ) { + setGlobalEval( tmp ); + } + + // Capture executables + if ( scripts ) { + j = 0; + while ( ( elem = tmp[ j++ ] ) ) { + if ( rscriptType.test( elem.type || "" ) ) { + scripts.push( elem ); + } + } + } + } + + return fragment; +} + + +( function() { + var fragment = document.createDocumentFragment(), + div = fragment.appendChild( document.createElement( "div" ) ), + input = document.createElement( "input" ); + + // Support: Android 4.0-4.3, Safari<=5.1 + // Check state lost if the name is set (#11217) + // Support: Windows Web Apps (WWA) + // `name` and `type` must use .setAttribute for WWA (#14901) + input.setAttribute( "type", "radio" ); + input.setAttribute( "checked", "checked" ); + input.setAttribute( "name", "t" ); + + div.appendChild( input ); + + // Support: Safari<=5.1, Android<4.2 + // Older WebKit doesn't clone checked state correctly in fragments + support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked; + + // Support: IE<=11+ + // Make sure textarea (and checkbox) defaultValue is properly cloned + div.innerHTML = ""; + support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue; +} )(); + + +var + rkeyEvent = /^key/, + rmouseEvent = /^(?:mouse|pointer|contextmenu|drag|drop)|click/, + rtypenamespace = /^([^.]*)(?:\.(.+)|)/; + +function returnTrue() { + return true; +} + +function returnFalse() { + return false; +} + +// Support: IE9 +// See #13393 for more info +function safeActiveElement() { + try { + return document.activeElement; + } catch ( err ) { } +} + +function on( elem, types, selector, data, fn, one ) { + var origFn, type; + + // Types can be a map of types/handlers + if ( typeof types === "object" ) { + + // ( types-Object, selector, data ) + if ( typeof selector !== "string" ) { + + // ( types-Object, data ) + data = data || selector; + selector = undefined; + } + for ( type in types ) { + on( elem, type, selector, data, types[ type ], one ); + } + return elem; + } + + if ( data == null && fn == null ) { + + // ( types, fn ) + fn = selector; + data = selector = undefined; + } else if ( fn == null ) { + if ( typeof selector === "string" ) { + + // ( types, selector, fn ) + fn = data; + data = undefined; + } else { + + // ( types, data, fn ) + fn = data; + data = selector; + selector = undefined; + } + } + if ( fn === false ) { + fn = returnFalse; + } else if ( !fn ) { + return elem; + } + + if ( one === 1 ) { + origFn = fn; + fn = function( event ) { + + // Can use an empty set, since event contains the info + jQuery().off( event ); + return origFn.apply( this, arguments ); + }; + + // Use same guid so caller can remove using origFn + fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); + } + return elem.each( function() { + jQuery.event.add( this, types, fn, data, selector ); + } ); +} + +/* + * Helper functions for managing events -- not part of the public interface. + * Props to Dean Edwards' addEvent library for many of the ideas. + */ +jQuery.event = { + + global: {}, + + add: function( elem, types, handler, data, selector ) { + + var handleObjIn, eventHandle, tmp, + events, t, handleObj, + special, handlers, type, namespaces, origType, + elemData = dataPriv.get( elem ); + + // Don't attach events to noData or text/comment nodes (but allow plain objects) + if ( !elemData ) { + return; + } + + // Caller can pass in an object of custom data in lieu of the handler + if ( handler.handler ) { + handleObjIn = handler; + handler = handleObjIn.handler; + selector = handleObjIn.selector; + } + + // Make sure that the handler has a unique ID, used to find/remove it later + if ( !handler.guid ) { + handler.guid = jQuery.guid++; + } + + // Init the element's event structure and main handler, if this is the first + if ( !( events = elemData.events ) ) { + events = elemData.events = {}; + } + if ( !( eventHandle = elemData.handle ) ) { + eventHandle = elemData.handle = function( e ) { + + // Discard the second event of a jQuery.event.trigger() and + // when an event is called after a page has unloaded + return typeof jQuery !== "undefined" && jQuery.event.triggered !== e.type ? + jQuery.event.dispatch.apply( elem, arguments ) : undefined; + }; + } + + // Handle multiple events separated by a space + types = ( types || "" ).match( rnotwhite ) || [ "" ]; + t = types.length; + while ( t-- ) { + tmp = rtypenamespace.exec( types[ t ] ) || []; + type = origType = tmp[ 1 ]; + namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); + + // There *must* be a type, no attaching namespace-only handlers + if ( !type ) { + continue; + } + + // If event changes its type, use the special event handlers for the changed type + special = jQuery.event.special[ type ] || {}; + + // If selector defined, determine special event api type, otherwise given type + type = ( selector ? special.delegateType : special.bindType ) || type; + + // Update special based on newly reset type + special = jQuery.event.special[ type ] || {}; + + // handleObj is passed to all event handlers + handleObj = jQuery.extend( { + type: type, + origType: origType, + data: data, + handler: handler, + guid: handler.guid, + selector: selector, + needsContext: selector && jQuery.expr.match.needsContext.test( selector ), + namespace: namespaces.join( "." ) + }, handleObjIn ); + + // Init the event handler queue if we're the first + if ( !( handlers = events[ type ] ) ) { + handlers = events[ type ] = []; + handlers.delegateCount = 0; + + // Only use addEventListener if the special events handler returns false + if ( !special.setup || + special.setup.call( elem, data, namespaces, eventHandle ) === false ) { + + if ( elem.addEventListener ) { + elem.addEventListener( type, eventHandle ); + } + } + } + + if ( special.add ) { + special.add.call( elem, handleObj ); + + if ( !handleObj.handler.guid ) { + handleObj.handler.guid = handler.guid; + } + } + + // Add to the element's handler list, delegates in front + if ( selector ) { + handlers.splice( handlers.delegateCount++, 0, handleObj ); + } else { + handlers.push( handleObj ); + } + + // Keep track of which events have ever been used, for event optimization + jQuery.event.global[ type ] = true; + } + + }, + + // Detach an event or set of events from an element + remove: function( elem, types, handler, selector, mappedTypes ) { + + var j, origCount, tmp, + events, t, handleObj, + special, handlers, type, namespaces, origType, + elemData = dataPriv.hasData( elem ) && dataPriv.get( elem ); + + if ( !elemData || !( events = elemData.events ) ) { + return; + } + + // Once for each type.namespace in types; type may be omitted + types = ( types || "" ).match( rnotwhite ) || [ "" ]; + t = types.length; + while ( t-- ) { + tmp = rtypenamespace.exec( types[ t ] ) || []; + type = origType = tmp[ 1 ]; + namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); + + // Unbind all events (on this namespace, if provided) for the element + if ( !type ) { + for ( type in events ) { + jQuery.event.remove( elem, type + types[ t ], handler, selector, true ); + } + continue; + } + + special = jQuery.event.special[ type ] || {}; + type = ( selector ? special.delegateType : special.bindType ) || type; + handlers = events[ type ] || []; + tmp = tmp[ 2 ] && + new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ); + + // Remove matching events + origCount = j = handlers.length; + while ( j-- ) { + handleObj = handlers[ j ]; + + if ( ( mappedTypes || origType === handleObj.origType ) && + ( !handler || handler.guid === handleObj.guid ) && + ( !tmp || tmp.test( handleObj.namespace ) ) && + ( !selector || selector === handleObj.selector || + selector === "**" && handleObj.selector ) ) { + handlers.splice( j, 1 ); + + if ( handleObj.selector ) { + handlers.delegateCount--; + } + if ( special.remove ) { + special.remove.call( elem, handleObj ); + } + } + } + + // Remove generic event handler if we removed something and no more handlers exist + // (avoids potential for endless recursion during removal of special event handlers) + if ( origCount && !handlers.length ) { + if ( !special.teardown || + special.teardown.call( elem, namespaces, elemData.handle ) === false ) { + + jQuery.removeEvent( elem, type, elemData.handle ); + } + + delete events[ type ]; + } + } + + // Remove data and the expando if it's no longer used + if ( jQuery.isEmptyObject( events ) ) { + dataPriv.remove( elem, "handle events" ); + } + }, + + dispatch: function( event ) { + + // Make a writable jQuery.Event from the native event object + event = jQuery.event.fix( event ); + + var i, j, ret, matched, handleObj, + handlerQueue = [], + args = slice.call( arguments ), + handlers = ( dataPriv.get( this, "events" ) || {} )[ event.type ] || [], + special = jQuery.event.special[ event.type ] || {}; + + // Use the fix-ed jQuery.Event rather than the (read-only) native event + args[ 0 ] = event; + event.delegateTarget = this; + + // Call the preDispatch hook for the mapped type, and let it bail if desired + if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) { + return; + } + + // Determine handlers + handlerQueue = jQuery.event.handlers.call( this, event, handlers ); + + // Run delegates first; they may want to stop propagation beneath us + i = 0; + while ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) { + event.currentTarget = matched.elem; + + j = 0; + while ( ( handleObj = matched.handlers[ j++ ] ) && + !event.isImmediatePropagationStopped() ) { + + // Triggered event must either 1) have no namespace, or 2) have namespace(s) + // a subset or equal to those in the bound event (both can have no namespace). + if ( !event.rnamespace || event.rnamespace.test( handleObj.namespace ) ) { + + event.handleObj = handleObj; + event.data = handleObj.data; + + ret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle || + handleObj.handler ).apply( matched.elem, args ); + + if ( ret !== undefined ) { + if ( ( event.result = ret ) === false ) { + event.preventDefault(); + event.stopPropagation(); + } + } + } + } + } + + // Call the postDispatch hook for the mapped type + if ( special.postDispatch ) { + special.postDispatch.call( this, event ); + } + + return event.result; + }, + + handlers: function( event, handlers ) { + var i, matches, sel, handleObj, + handlerQueue = [], + delegateCount = handlers.delegateCount, + cur = event.target; + + // Support (at least): Chrome, IE9 + // Find delegate handlers + // Black-hole SVG instance trees (#13180) + // + // Support: Firefox<=42+ + // Avoid non-left-click in FF but don't block IE radio events (#3861, gh-2343) + if ( delegateCount && cur.nodeType && + ( event.type !== "click" || isNaN( event.button ) || event.button < 1 ) ) { + + for ( ; cur !== this; cur = cur.parentNode || this ) { + + // Don't check non-elements (#13208) + // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764) + if ( cur.nodeType === 1 && ( cur.disabled !== true || event.type !== "click" ) ) { + matches = []; + for ( i = 0; i < delegateCount; i++ ) { + handleObj = handlers[ i ]; + + // Don't conflict with Object.prototype properties (#13203) + sel = handleObj.selector + " "; + + if ( matches[ sel ] === undefined ) { + matches[ sel ] = handleObj.needsContext ? + jQuery( sel, this ).index( cur ) > -1 : + jQuery.find( sel, this, null, [ cur ] ).length; + } + if ( matches[ sel ] ) { + matches.push( handleObj ); + } + } + if ( matches.length ) { + handlerQueue.push( { elem: cur, handlers: matches } ); + } + } + } + } + + // Add the remaining (directly-bound) handlers + if ( delegateCount < handlers.length ) { + handlerQueue.push( { elem: this, handlers: handlers.slice( delegateCount ) } ); + } + + return handlerQueue; + }, + + // Includes some event props shared by KeyEvent and MouseEvent + props: ( "altKey bubbles cancelable ctrlKey currentTarget detail eventPhase " + + "metaKey relatedTarget shiftKey target timeStamp view which" ).split( " " ), + + fixHooks: {}, + + keyHooks: { + props: "char charCode key keyCode".split( " " ), + filter: function( event, original ) { + + // Add which for key events + if ( event.which == null ) { + event.which = original.charCode != null ? original.charCode : original.keyCode; + } + + return event; + } + }, + + mouseHooks: { + props: ( "button buttons clientX clientY offsetX offsetY pageX pageY " + + "screenX screenY toElement" ).split( " " ), + filter: function( event, original ) { + var eventDoc, doc, body, + button = original.button; + + // Calculate pageX/Y if missing and clientX/Y available + if ( event.pageX == null && original.clientX != null ) { + eventDoc = event.target.ownerDocument || document; + doc = eventDoc.documentElement; + body = eventDoc.body; + + event.pageX = original.clientX + + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - + ( doc && doc.clientLeft || body && body.clientLeft || 0 ); + event.pageY = original.clientY + + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - + ( doc && doc.clientTop || body && body.clientTop || 0 ); + } + + // Add which for click: 1 === left; 2 === middle; 3 === right + // Note: button is not normalized, so don't use it + if ( !event.which && button !== undefined ) { + event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) ); + } + + return event; + } + }, + + fix: function( event ) { + if ( event[ jQuery.expando ] ) { + return event; + } + + // Create a writable copy of the event object and normalize some properties + var i, prop, copy, + type = event.type, + originalEvent = event, + fixHook = this.fixHooks[ type ]; + + if ( !fixHook ) { + this.fixHooks[ type ] = fixHook = + rmouseEvent.test( type ) ? this.mouseHooks : + rkeyEvent.test( type ) ? this.keyHooks : + {}; + } + copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props; + + event = new jQuery.Event( originalEvent ); + + i = copy.length; + while ( i-- ) { + prop = copy[ i ]; + event[ prop ] = originalEvent[ prop ]; + } + + // Support: Cordova 2.5 (WebKit) (#13255) + // All events should have a target; Cordova deviceready doesn't + if ( !event.target ) { + event.target = document; + } + + // Support: Safari 6.0+, Chrome<28 + // Target should not be a text node (#504, #13143) + if ( event.target.nodeType === 3 ) { + event.target = event.target.parentNode; + } + + return fixHook.filter ? fixHook.filter( event, originalEvent ) : event; + }, + + special: { + load: { + + // Prevent triggered image.load events from bubbling to window.load + noBubble: true + }, + focus: { + + // Fire native event if possible so blur/focus sequence is correct + trigger: function() { + if ( this !== safeActiveElement() && this.focus ) { + this.focus(); + return false; + } + }, + delegateType: "focusin" + }, + blur: { + trigger: function() { + if ( this === safeActiveElement() && this.blur ) { + this.blur(); + return false; + } + }, + delegateType: "focusout" + }, + click: { + + // For checkbox, fire native event so checked state will be right + trigger: function() { + if ( this.type === "checkbox" && this.click && jQuery.nodeName( this, "input" ) ) { + this.click(); + return false; + } + }, + + // For cross-browser consistency, don't fire native .click() on links + _default: function( event ) { + return jQuery.nodeName( event.target, "a" ); + } + }, + + beforeunload: { + postDispatch: function( event ) { + + // Support: Firefox 20+ + // Firefox doesn't alert if the returnValue field is not set. + if ( event.result !== undefined && event.originalEvent ) { + event.originalEvent.returnValue = event.result; + } + } + } + } +}; + +jQuery.removeEvent = function( elem, type, handle ) { + + // This "if" is needed for plain objects + if ( elem.removeEventListener ) { + elem.removeEventListener( type, handle ); + } +}; + +jQuery.Event = function( src, props ) { + + // Allow instantiation without the 'new' keyword + if ( !( this instanceof jQuery.Event ) ) { + return new jQuery.Event( src, props ); + } + + // Event object + if ( src && src.type ) { + this.originalEvent = src; + this.type = src.type; + + // Events bubbling up the document may have been marked as prevented + // by a handler lower down the tree; reflect the correct value. + this.isDefaultPrevented = src.defaultPrevented || + src.defaultPrevented === undefined && + + // Support: Android<4.0 + src.returnValue === false ? + returnTrue : + returnFalse; + + // Event type + } else { + this.type = src; + } + + // Put explicitly provided properties onto the event object + if ( props ) { + jQuery.extend( this, props ); + } + + // Create a timestamp if incoming event doesn't have one + this.timeStamp = src && src.timeStamp || jQuery.now(); + + // Mark it as fixed + this[ jQuery.expando ] = true; +}; + +// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding +// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html +jQuery.Event.prototype = { + constructor: jQuery.Event, + isDefaultPrevented: returnFalse, + isPropagationStopped: returnFalse, + isImmediatePropagationStopped: returnFalse, + + preventDefault: function() { + var e = this.originalEvent; + + this.isDefaultPrevented = returnTrue; + + if ( e ) { + e.preventDefault(); + } + }, + stopPropagation: function() { + var e = this.originalEvent; + + this.isPropagationStopped = returnTrue; + + if ( e ) { + e.stopPropagation(); + } + }, + stopImmediatePropagation: function() { + var e = this.originalEvent; + + this.isImmediatePropagationStopped = returnTrue; + + if ( e ) { + e.stopImmediatePropagation(); + } + + this.stopPropagation(); + } +}; + +// Create mouseenter/leave events using mouseover/out and event-time checks +// so that event delegation works in jQuery. +// Do the same for pointerenter/pointerleave and pointerover/pointerout +// +// Support: Safari 7 only +// Safari sends mouseenter too often; see: +// https://code.google.com/p/chromium/issues/detail?id=470258 +// for the description of the bug (it existed in older Chrome versions as well). +jQuery.each( { + mouseenter: "mouseover", + mouseleave: "mouseout", + pointerenter: "pointerover", + pointerleave: "pointerout" +}, function( orig, fix ) { + jQuery.event.special[ orig ] = { + delegateType: fix, + bindType: fix, + + handle: function( event ) { + var ret, + target = this, + related = event.relatedTarget, + handleObj = event.handleObj; + + // For mouseenter/leave call the handler if related is outside the target. + // NB: No relatedTarget if the mouse left/entered the browser window + if ( !related || ( related !== target && !jQuery.contains( target, related ) ) ) { + event.type = handleObj.origType; + ret = handleObj.handler.apply( this, arguments ); + event.type = fix; + } + return ret; + } + }; +} ); + +jQuery.fn.extend( { + on: function( types, selector, data, fn ) { + return on( this, types, selector, data, fn ); + }, + one: function( types, selector, data, fn ) { + return on( this, types, selector, data, fn, 1 ); + }, + off: function( types, selector, fn ) { + var handleObj, type; + if ( types && types.preventDefault && types.handleObj ) { + + // ( event ) dispatched jQuery.Event + handleObj = types.handleObj; + jQuery( types.delegateTarget ).off( + handleObj.namespace ? + handleObj.origType + "." + handleObj.namespace : + handleObj.origType, + handleObj.selector, + handleObj.handler + ); + return this; + } + if ( typeof types === "object" ) { + + // ( types-object [, selector] ) + for ( type in types ) { + this.off( type, selector, types[ type ] ); + } + return this; + } + if ( selector === false || typeof selector === "function" ) { + + // ( types [, fn] ) + fn = selector; + selector = undefined; + } + if ( fn === false ) { + fn = returnFalse; + } + return this.each( function() { + jQuery.event.remove( this, types, fn, selector ); + } ); + } +} ); + + +var + rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi, + + // Support: IE 10-11, Edge 10240+ + // In IE/Edge using regex groups here causes severe slowdowns. + // See https://connect.microsoft.com/IE/feedback/details/1736512/ + rnoInnerhtml = /\s*$/g; + +// Manipulating tables requires a tbody +function manipulationTarget( elem, content ) { + return jQuery.nodeName( elem, "table" ) && + jQuery.nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ? + + elem.getElementsByTagName( "tbody" )[ 0 ] || + elem.appendChild( elem.ownerDocument.createElement( "tbody" ) ) : + elem; +} + +// Replace/restore the type attribute of script elements for safe DOM manipulation +function disableScript( elem ) { + elem.type = ( elem.getAttribute( "type" ) !== null ) + "/" + elem.type; + return elem; +} +function restoreScript( elem ) { + var match = rscriptTypeMasked.exec( elem.type ); + + if ( match ) { + elem.type = match[ 1 ]; + } else { + elem.removeAttribute( "type" ); + } + + return elem; +} + +function cloneCopyEvent( src, dest ) { + var i, l, type, pdataOld, pdataCur, udataOld, udataCur, events; + + if ( dest.nodeType !== 1 ) { + return; + } + + // 1. Copy private data: events, handlers, etc. + if ( dataPriv.hasData( src ) ) { + pdataOld = dataPriv.access( src ); + pdataCur = dataPriv.set( dest, pdataOld ); + events = pdataOld.events; + + if ( events ) { + delete pdataCur.handle; + pdataCur.events = {}; + + for ( type in events ) { + for ( i = 0, l = events[ type ].length; i < l; i++ ) { + jQuery.event.add( dest, type, events[ type ][ i ] ); + } + } + } + } + + // 2. Copy user data + if ( dataUser.hasData( src ) ) { + udataOld = dataUser.access( src ); + udataCur = jQuery.extend( {}, udataOld ); + + dataUser.set( dest, udataCur ); + } +} + +// Fix IE bugs, see support tests +function fixInput( src, dest ) { + var nodeName = dest.nodeName.toLowerCase(); + + // Fails to persist the checked state of a cloned checkbox or radio button. + if ( nodeName === "input" && rcheckableType.test( src.type ) ) { + dest.checked = src.checked; + + // Fails to return the selected option to the default selected state when cloning options + } else if ( nodeName === "input" || nodeName === "textarea" ) { + dest.defaultValue = src.defaultValue; + } +} + +function domManip( collection, args, callback, ignored ) { + + // Flatten any nested arrays + args = concat.apply( [], args ); + + var fragment, first, scripts, hasScripts, node, doc, + i = 0, + l = collection.length, + iNoClone = l - 1, + value = args[ 0 ], + isFunction = jQuery.isFunction( value ); + + // We can't cloneNode fragments that contain checked, in WebKit + if ( isFunction || + ( l > 1 && typeof value === "string" && + !support.checkClone && rchecked.test( value ) ) ) { + return collection.each( function( index ) { + var self = collection.eq( index ); + if ( isFunction ) { + args[ 0 ] = value.call( this, index, self.html() ); + } + domManip( self, args, callback, ignored ); + } ); + } + + if ( l ) { + fragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored ); + first = fragment.firstChild; + + if ( fragment.childNodes.length === 1 ) { + fragment = first; + } + + // Require either new content or an interest in ignored elements to invoke the callback + if ( first || ignored ) { + scripts = jQuery.map( getAll( fragment, "script" ), disableScript ); + hasScripts = scripts.length; + + // Use the original fragment for the last item + // instead of the first because it can end up + // being emptied incorrectly in certain situations (#8070). + for ( ; i < l; i++ ) { + node = fragment; + + if ( i !== iNoClone ) { + node = jQuery.clone( node, true, true ); + + // Keep references to cloned scripts for later restoration + if ( hasScripts ) { + + // Support: Android<4.1, PhantomJS<2 + // push.apply(_, arraylike) throws on ancient WebKit + jQuery.merge( scripts, getAll( node, "script" ) ); + } + } + + callback.call( collection[ i ], node, i ); + } + + if ( hasScripts ) { + doc = scripts[ scripts.length - 1 ].ownerDocument; + + // Reenable scripts + jQuery.map( scripts, restoreScript ); + + // Evaluate executable scripts on first document insertion + for ( i = 0; i < hasScripts; i++ ) { + node = scripts[ i ]; + if ( rscriptType.test( node.type || "" ) && + !dataPriv.access( node, "globalEval" ) && + jQuery.contains( doc, node ) ) { + + if ( node.src ) { + + // Optional AJAX dependency, but won't run scripts if not present + if ( jQuery._evalUrl ) { + jQuery._evalUrl( node.src ); + } + } else { + jQuery.globalEval( node.textContent.replace( rcleanScript, "" ) ); + } + } + } + } + } + } + + return collection; +} + +function remove( elem, selector, keepData ) { + var node, + nodes = selector ? jQuery.filter( selector, elem ) : elem, + i = 0; + + for ( ; ( node = nodes[ i ] ) != null; i++ ) { + if ( !keepData && node.nodeType === 1 ) { + jQuery.cleanData( getAll( node ) ); + } + + if ( node.parentNode ) { + if ( keepData && jQuery.contains( node.ownerDocument, node ) ) { + setGlobalEval( getAll( node, "script" ) ); + } + node.parentNode.removeChild( node ); + } + } + + return elem; +} + +jQuery.extend( { + htmlPrefilter: function( html ) { + return html.replace( rxhtmlTag, "<$1>" ); + }, + + clone: function( elem, dataAndEvents, deepDataAndEvents ) { + var i, l, srcElements, destElements, + clone = elem.cloneNode( true ), + inPage = jQuery.contains( elem.ownerDocument, elem ); + + // Fix IE cloning issues + if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) && + !jQuery.isXMLDoc( elem ) ) { + + // We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2 + destElements = getAll( clone ); + srcElements = getAll( elem ); + + for ( i = 0, l = srcElements.length; i < l; i++ ) { + fixInput( srcElements[ i ], destElements[ i ] ); + } + } + + // Copy the events from the original to the clone + if ( dataAndEvents ) { + if ( deepDataAndEvents ) { + srcElements = srcElements || getAll( elem ); + destElements = destElements || getAll( clone ); + + for ( i = 0, l = srcElements.length; i < l; i++ ) { + cloneCopyEvent( srcElements[ i ], destElements[ i ] ); + } + } else { + cloneCopyEvent( elem, clone ); + } + } + + // Preserve script evaluation history + destElements = getAll( clone, "script" ); + if ( destElements.length > 0 ) { + setGlobalEval( destElements, !inPage && getAll( elem, "script" ) ); + } + + // Return the cloned set + return clone; + }, + + cleanData: function( elems ) { + var data, elem, type, + special = jQuery.event.special, + i = 0; + + for ( ; ( elem = elems[ i ] ) !== undefined; i++ ) { + if ( acceptData( elem ) ) { + if ( ( data = elem[ dataPriv.expando ] ) ) { + if ( data.events ) { + for ( type in data.events ) { + if ( special[ type ] ) { + jQuery.event.remove( elem, type ); + + // This is a shortcut to avoid jQuery.event.remove's overhead + } else { + jQuery.removeEvent( elem, type, data.handle ); + } + } + } + + // Support: Chrome <= 35-45+ + // Assign undefined instead of using delete, see Data#remove + elem[ dataPriv.expando ] = undefined; + } + if ( elem[ dataUser.expando ] ) { + + // Support: Chrome <= 35-45+ + // Assign undefined instead of using delete, see Data#remove + elem[ dataUser.expando ] = undefined; + } + } + } + } +} ); + +jQuery.fn.extend( { + + // Keep domManip exposed until 3.0 (gh-2225) + domManip: domManip, + + detach: function( selector ) { + return remove( this, selector, true ); + }, + + remove: function( selector ) { + return remove( this, selector ); + }, + + text: function( value ) { + return access( this, function( value ) { + return value === undefined ? + jQuery.text( this ) : + this.empty().each( function() { + if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { + this.textContent = value; + } + } ); + }, null, value, arguments.length ); + }, + + append: function() { + return domManip( this, arguments, function( elem ) { + if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { + var target = manipulationTarget( this, elem ); + target.appendChild( elem ); + } + } ); + }, + + prepend: function() { + return domManip( this, arguments, function( elem ) { + if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { + var target = manipulationTarget( this, elem ); + target.insertBefore( elem, target.firstChild ); + } + } ); + }, + + before: function() { + return domManip( this, arguments, function( elem ) { + if ( this.parentNode ) { + this.parentNode.insertBefore( elem, this ); + } + } ); + }, + + after: function() { + return domManip( this, arguments, function( elem ) { + if ( this.parentNode ) { + this.parentNode.insertBefore( elem, this.nextSibling ); + } + } ); + }, + + empty: function() { + var elem, + i = 0; + + for ( ; ( elem = this[ i ] ) != null; i++ ) { + if ( elem.nodeType === 1 ) { + + // Prevent memory leaks + jQuery.cleanData( getAll( elem, false ) ); + + // Remove any remaining nodes + elem.textContent = ""; + } + } + + return this; + }, + + clone: function( dataAndEvents, deepDataAndEvents ) { + dataAndEvents = dataAndEvents == null ? false : dataAndEvents; + deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; + + return this.map( function() { + return jQuery.clone( this, dataAndEvents, deepDataAndEvents ); + } ); + }, + + html: function( value ) { + return access( this, function( value ) { + var elem = this[ 0 ] || {}, + i = 0, + l = this.length; + + if ( value === undefined && elem.nodeType === 1 ) { + return elem.innerHTML; + } + + // See if we can take a shortcut and just use innerHTML + if ( typeof value === "string" && !rnoInnerhtml.test( value ) && + !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) { + + value = jQuery.htmlPrefilter( value ); + + try { + for ( ; i < l; i++ ) { + elem = this[ i ] || {}; + + // Remove element nodes and prevent memory leaks + if ( elem.nodeType === 1 ) { + jQuery.cleanData( getAll( elem, false ) ); + elem.innerHTML = value; + } + } + + elem = 0; + + // If using innerHTML throws an exception, use the fallback method + } catch ( e ) {} + } + + if ( elem ) { + this.empty().append( value ); + } + }, null, value, arguments.length ); + }, + + replaceWith: function() { + var ignored = []; + + // Make the changes, replacing each non-ignored context element with the new content + return domManip( this, arguments, function( elem ) { + var parent = this.parentNode; + + if ( jQuery.inArray( this, ignored ) < 0 ) { + jQuery.cleanData( getAll( this ) ); + if ( parent ) { + parent.replaceChild( elem, this ); + } + } + + // Force callback invocation + }, ignored ); + } +} ); + +jQuery.each( { + appendTo: "append", + prependTo: "prepend", + insertBefore: "before", + insertAfter: "after", + replaceAll: "replaceWith" +}, function( name, original ) { + jQuery.fn[ name ] = function( selector ) { + var elems, + ret = [], + insert = jQuery( selector ), + last = insert.length - 1, + i = 0; + + for ( ; i <= last; i++ ) { + elems = i === last ? this : this.clone( true ); + jQuery( insert[ i ] )[ original ]( elems ); + + // Support: QtWebKit + // .get() because push.apply(_, arraylike) throws + push.apply( ret, elems.get() ); + } + + return this.pushStack( ret ); + }; +} ); + + +var iframe, + elemdisplay = { + + // Support: Firefox + // We have to pre-define these values for FF (#10227) + HTML: "block", + BODY: "block" + }; + +/** + * Retrieve the actual display of a element + * @param {String} name nodeName of the element + * @param {Object} doc Document object + */ + +// Called only from within defaultDisplay +function actualDisplay( name, doc ) { + var elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ), + + display = jQuery.css( elem[ 0 ], "display" ); + + // We don't have any data stored on the element, + // so use "detach" method as fast way to get rid of the element + elem.detach(); + + return display; +} + +/** + * Try to determine the default display value of an element + * @param {String} nodeName + */ +function defaultDisplay( nodeName ) { + var doc = document, + display = elemdisplay[ nodeName ]; + + if ( !display ) { + display = actualDisplay( nodeName, doc ); + + // If the simple way fails, read from inside an iframe + if ( display === "none" || !display ) { + + // Use the already-created iframe if possible + iframe = ( iframe || jQuery( "