├── .gitignore ├── .hgignore ├── README.md ├── api ├── __init__.py ├── urls.py └── views.py ├── manage.py ├── nx ├── __init__.py ├── models.py ├── search_indexes.py └── templates │ └── search │ └── indexes │ └── nx │ └── note_text.txt ├── nx2django ├── __init__.py ├── settings.py ├── static │ ├── admin │ │ ├── css │ │ │ ├── base.css │ │ │ ├── changelists.css │ │ │ ├── dashboard.css │ │ │ ├── forms.css │ │ │ ├── ie.css │ │ │ ├── login.css │ │ │ ├── rtl.css │ │ │ └── widgets.css │ │ ├── img │ │ │ ├── changelist-bg.gif │ │ │ ├── changelist-bg_rtl.gif │ │ │ ├── default-bg-reverse.gif │ │ │ ├── default-bg.gif │ │ │ ├── deleted-overlay.gif │ │ │ ├── gis │ │ │ │ ├── move_vertex_off.png │ │ │ │ └── move_vertex_on.png │ │ │ ├── icon-no.gif │ │ │ ├── icon-unknown.gif │ │ │ ├── icon-yes.gif │ │ │ ├── icon_addlink.gif │ │ │ ├── icon_alert.gif │ │ │ ├── icon_calendar.gif │ │ │ ├── icon_changelink.gif │ │ │ ├── icon_clock.gif │ │ │ ├── icon_deletelink.gif │ │ │ ├── icon_error.gif │ │ │ ├── icon_searchbox.png │ │ │ ├── icon_success.gif │ │ │ ├── inline-delete-8bit.png │ │ │ ├── inline-delete.png │ │ │ ├── inline-restore-8bit.png │ │ │ ├── inline-restore.png │ │ │ ├── inline-splitter-bg.gif │ │ │ ├── nav-bg-grabber.gif │ │ │ ├── nav-bg-reverse.gif │ │ │ ├── nav-bg-selected.gif │ │ │ ├── nav-bg.gif │ │ │ ├── selector-icons.gif │ │ │ ├── selector-search.gif │ │ │ ├── sorting-icons.gif │ │ │ ├── tooltag-add.png │ │ │ └── tooltag-arrowright.png │ │ └── js │ │ │ ├── LICENSE-JQUERY.txt │ │ │ ├── SelectBox.js │ │ │ ├── SelectFilter2.js │ │ │ ├── actions.js │ │ │ ├── actions.min.js │ │ │ ├── admin │ │ │ ├── DateTimeShortcuts.js │ │ │ └── RelatedObjectLookups.js │ │ │ ├── calendar.js │ │ │ ├── collapse.js │ │ │ ├── collapse.min.js │ │ │ ├── core.js │ │ │ ├── inlines.js │ │ │ ├── inlines.min.js │ │ │ ├── jquery.init.js │ │ │ ├── jquery.js │ │ │ ├── jquery.min.js │ │ │ ├── prepopulate.js │ │ │ ├── prepopulate.min.js │ │ │ ├── related-widget-wrapper.js │ │ │ ├── timeparse.js │ │ │ └── urlify.js │ └── rest_framework │ │ ├── css │ │ ├── bootstrap-tweaks.css │ │ ├── bootstrap.min.css │ │ ├── default.css │ │ └── prettify.css │ │ ├── fonts │ │ ├── glyphicons-halflings-regular.eot │ │ ├── glyphicons-halflings-regular.svg │ │ ├── glyphicons-halflings-regular.ttf │ │ └── glyphicons-halflings-regular.woff │ │ ├── img │ │ ├── glyphicons-halflings-white.png │ │ ├── glyphicons-halflings.png │ │ └── grid.png │ │ └── js │ │ ├── bootstrap.min.js │ │ ├── default.js │ │ ├── jquery-1.8.1-min.js │ │ └── prettify-min.js ├── urls.py └── wsgi.py ├── requirements.txt ├── screenshots ├── 1.jpg └── 2.jpg ├── start.sh ├── struct.png └── test_query └── query.json /.gitignore: -------------------------------------------------------------------------------- 1 | *.pyc 2 | *.pyo 3 | *.db 4 | .DS_Store 5 | .coverage 6 | local_settings.py 7 | /static 8 | .idea 9 | db.sqlite3 -------------------------------------------------------------------------------- /.hgignore: -------------------------------------------------------------------------------- 1 | syntax: glob 2 | *.pyc 3 | *.pyo 4 | *.db 5 | .DS_Store 6 | .coverage 7 | local_settings.py 8 | 9 | syntax: regexp 10 | ^static/ 11 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ##Ionic ElasticSearch with OpenLayers 3 2 | 3 | > A Demo of ElasticSearch, Django, Ionic 4 | 5 | ##Struct 6 | 7 | ![Struct](./struct.png) 8 | 9 | ##Tech 10 | 11 | - ElasticSearch 12 | - Django 13 | - Ionic 14 | - OpenLayers 3 15 | 16 | ##Screenshot 17 | 18 | ![Django Ionic ScreenShot](./screenshots/1.jpg) 19 | ![Django Ionic ScreenShot](./screenshots/2.jpg) 20 | 21 | 22 | ##Client 23 | 24 | Visit: [https://github.com/phodal/ionic-elasticsearch](https://github.com/phodal/ionic-elasticsearch) 25 | 26 | ##Document 27 | 28 | [Django ElasticSearch Ionic 打造 GIS 移动应用 —— 架构设计](http://www.phodal.com/blog/django-elasticsearch-ionic-build-gis-application/) 29 | 30 | [地图移动应用实战 —— Django Haystack ElasticSearch 环境准备](http://www.phodal.com/blog/django-elasticsearch-ionic-build-gis-application/) 31 | 32 | [地图移动应用实战 —— 服务端构建](http://www.phodal.com/blog/django-elasticsearch-ionic-build-gis-application-create-model/) 33 | 34 | [地图移动应用实战:Ionic ElasticSearch 搜索服务](http://www.phodal.com/blog/ionic-searchview-django-elasticsearch-ionic-build-gis-application/) 35 | 36 | [地图移动应用实战:Ionic OpenLayer 地图显示](http://www.phodal.com/blog/django-elasticsearch-ionic-build-gis-application-show-on-map/) 37 | 38 | [Mac OS Django Geo 环境搭建](http://www.phodal.com/blog/django-elasticsearch-geo-solution/) 39 | 40 | [AWS CentOS Django Geo 环境搭建](http://www.phodal.com/blog/install-geo-django-in-centos/) 41 | 42 | -------------------------------------------------------------------------------- /api/__init__.py: -------------------------------------------------------------------------------- 1 | __author__ = 'fdhuang' 2 | -------------------------------------------------------------------------------- /api/urls.py: -------------------------------------------------------------------------------- 1 | from django.conf.urls import url, include 2 | from rest_framework import routers 3 | 4 | from api.views import AllListView 5 | 6 | router = routers.DefaultRouter() 7 | router.register(r'all', AllListView, 'all') 8 | 9 | 10 | urlpatterns = [ 11 | url(r'^', include(router.urls)), 12 | url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework')) 13 | ] -------------------------------------------------------------------------------- /api/views.py: -------------------------------------------------------------------------------- 1 | from rest_framework import serializers, viewsets 2 | from rest_framework.response import Response 3 | 4 | from nx.models import Note 5 | 6 | 7 | class NoteDetailSerializer(serializers.HyperlinkedModelSerializer): 8 | 9 | class Meta: 10 | model = Note 11 | fields = ("username", "email", "phone_number", "title", "body", "price", "number", "province", "city", "address") 12 | 13 | class AllListView(viewsets.ModelViewSet): 14 | serializer_class = NoteDetailSerializer 15 | 16 | def list(self, request): 17 | queryset = Note.objects.filter() 18 | serializer = NoteDetailSerializer(queryset, many=True) 19 | return Response(serializer.data) -------------------------------------------------------------------------------- /manage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | import os 3 | import sys 4 | 5 | if __name__ == "__main__": 6 | os.environ.setdefault("DJANGO_SETTINGS_MODULE", "nx2django.settings") 7 | 8 | from django.core.management import execute_from_command_line 9 | 10 | execute_from_command_line(sys.argv) 11 | -------------------------------------------------------------------------------- /nx/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phodal/django-elasticsearch/a80f5067fc8f57edf64da809471315a53c5942c7/nx/__init__.py -------------------------------------------------------------------------------- /nx/models.py: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | 3 | from __future__ import absolute_import, division, print_function, unicode_literals 4 | import re 5 | from django.contrib import admin 6 | 7 | from django.contrib.gis.geos import Point 8 | from django.core import validators 9 | from django.utils.translation import ugettext_lazy as _ 10 | from django.db import models 11 | from pygeocoder import Geocoder 12 | 13 | 14 | class Note(models.Model): 15 | username = models.CharField("用户名", max_length=30) 16 | email = models.EmailField("邮箱", blank=True) 17 | phone_number = models.CharField("手机号", max_length=11, unique=True, 18 | validators=[ 19 | validators.RegexValidator(re.compile('^\+?1?\d{9,15}$'), _('Enter a valid Phone Number.'), 'invalid') 20 | ]) 21 | number = models.IntegerField("数量", max_length=10) 22 | price = models.FloatField("价格", max_length=5) 23 | title = models.CharField("标题", max_length=1000) 24 | body = models.TextField("简介") 25 | province = models.CharField("省", max_length=10) 26 | city = models.CharField("市", max_length=20) 27 | address = models.CharField("地址", max_length=40) 28 | timestamp = models.DateTimeField(auto_now=True) 29 | latitude = models.FloatField(blank=True) 30 | longitude = models.FloatField(blank=True) 31 | 32 | def __unicode__(self): 33 | return self.title 34 | 35 | def save(self, *args, **kwargs): 36 | #Geocode the address 37 | results = Geocoder.geocode(self.province + self.city + self.address) 38 | self.latitude = results[0].coordinates[0] 39 | self.longitude = results[0].coordinates[1] 40 | super(Note, self).save(*args, **kwargs) 41 | 42 | def get_location(self): 43 | return Point(self.longitude, self.latitude) 44 | 45 | def get_location_info(self): 46 | return self.province + self.city + self.address 47 | 48 | admin.site.register(Note) -------------------------------------------------------------------------------- /nx/search_indexes.py: -------------------------------------------------------------------------------- 1 | from haystack import indexes 2 | 3 | from .models import Note 4 | 5 | 6 | class NoteIndex(indexes.SearchIndex, indexes.Indexable): 7 | text = indexes.CharField(document=True, use_template=True) 8 | title = indexes.CharField(model_attr='title') 9 | body = indexes.CharField(model_attr='body') 10 | number = indexes.IntegerField(model_attr='number') 11 | price = indexes.IntegerField(model_attr='price') 12 | phone_number = indexes.IntegerField(model_attr='phone_number') 13 | location = indexes.LocationField(model_attr='get_location') 14 | location_info = indexes.CharField(model_attr='get_location_info') 15 | 16 | def get_model(self): 17 | return Note -------------------------------------------------------------------------------- /nx/templates/search/indexes/nx/note_text.txt: -------------------------------------------------------------------------------- 1 | {{ object.title }} 2 | {{ object.body }} 3 | {{ object.number }} 4 | {{ object.price }} 5 | {{ object.phone_number }} 6 | {{ object.get_location }} 7 | {{ object.get_location_info }} 8 | -------------------------------------------------------------------------------- /nx2django/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phodal/django-elasticsearch/a80f5067fc8f57edf64da809471315a53c5942c7/nx2django/__init__.py -------------------------------------------------------------------------------- /nx2django/settings.py: -------------------------------------------------------------------------------- 1 | """ 2 | Django settings for nx2django project. 3 | 4 | For more information on this file, see 5 | https://docs.djangoproject.com/en/1.7/topics/settings/ 6 | 7 | For the full list of settings and their values, see 8 | https://docs.djangoproject.com/en/1.7/ref/settings/ 9 | """ 10 | 11 | # Build paths inside the project like this: os.path.join(BASE_DIR, ...) 12 | import os 13 | BASE_DIR = os.path.dirname(os.path.dirname(__file__)) 14 | 15 | 16 | ######### 17 | # PATHS # 18 | ######### 19 | 20 | # Full filesystem path to the project. 21 | PROJECT_ROOT = os.path.dirname(os.path.abspath(__file__)) 22 | 23 | # Name of the directory for the project. 24 | PROJECT_DIRNAME = PROJECT_ROOT.split(os.sep)[-1] 25 | 26 | # Every cache key will get prefixed with this value - here we set it to 27 | # the name of the directory the project is in to try and use something 28 | # project specific. 29 | CACHE_MIDDLEWARE_KEY_PREFIX = PROJECT_DIRNAME 30 | 31 | # URL prefix for static files. 32 | # Example: "http://media.lawrence.com/static/" 33 | STATIC_URL = "/static/" 34 | 35 | # Absolute path to the directory static files should be collected to. 36 | # Don't put anything in this directory yourself; store your static files 37 | # in apps' "static/" subdirectories and in STATICFILES_DIRS. 38 | # Example: "/home/media/media.lawrence.com/static/" 39 | STATIC_ROOT = os.path.join(PROJECT_ROOT, STATIC_URL.strip("/")) 40 | 41 | # URL that handles the media served from MEDIA_ROOT. Make sure to use a 42 | # trailing slash. 43 | # Examples: "http://media.lawrence.com/media/", "http://example.com/media/" 44 | MEDIA_URL = STATIC_URL + "media/" 45 | 46 | # Absolute filesystem path to the directory that will hold user-uploaded files. 47 | # Example: "/home/media/media.lawrence.com/media/" 48 | MEDIA_ROOT = os.path.join(PROJECT_ROOT, *MEDIA_URL.strip("/").split("/")) 49 | 50 | # Package/module name to import the root urlpatterns from for the project. 51 | ROOT_URLCONF = "%s.urls" % PROJECT_DIRNAME 52 | 53 | # Put strings here, like "/home/html/django_templates" 54 | # or "C:/www/django/templates". 55 | # Always use forward slashes, even on Windows. 56 | # Don't forget to use absolute paths, not relative paths. 57 | TEMPLATE_DIRS = (os.path.join(PROJECT_ROOT, "templates"),) 58 | 59 | # Quick-start development settings - unsuitable for production 60 | # See https://docs.djangoproject.com/en/1.7/howto/deployment/checklist/ 61 | 62 | # SECURITY WARNING: keep the secret key used in production secret! 63 | SECRET_KEY = 'y_6zps4!7ax_u^dvo#i0i1jy0=u4jsjger2v)_3(9n_buq=$e(' 64 | 65 | # SECURITY WARNING: don't run with debug turned on in production! 66 | DEBUG = True 67 | 68 | TEMPLATE_DEBUG = True 69 | 70 | ALLOWED_HOSTS = [] 71 | 72 | 73 | # Application definition 74 | 75 | INSTALLED_APPS = ( 76 | "grappelli", 77 | 'django.contrib.admin', 78 | 'django.contrib.auth', 79 | 'django.contrib.contenttypes', 80 | 'django.contrib.sessions', 81 | 'django.contrib.messages', 82 | 'django.contrib.staticfiles', 83 | "haystack", 84 | "rest_framework", 85 | "nx", 86 | ) 87 | 88 | MIDDLEWARE_CLASSES = ( 89 | 'django.contrib.sessions.middleware.SessionMiddleware', 90 | 'django.middleware.common.CommonMiddleware', 91 | 'django.middleware.csrf.CsrfViewMiddleware', 92 | 'django.contrib.auth.middleware.AuthenticationMiddleware', 93 | 'django.contrib.messages.middleware.MessageMiddleware', 94 | 'django.middleware.clickjacking.XFrameOptionsMiddleware', 95 | ) 96 | 97 | TEMPLATE_CONTEXT_PROCESSORS = ( 98 | "django.contrib.auth.context_processors.auth", 99 | "django.contrib.messages.context_processors.messages", 100 | "django.core.context_processors.debug", 101 | "django.core.context_processors.i18n", 102 | "django.core.context_processors.static", 103 | "django.core.context_processors.media", 104 | "django.core.context_processors.request", 105 | "django.core.context_processors.tz", 106 | ) 107 | 108 | ROOT_URLCONF = 'nx2django.urls' 109 | 110 | WSGI_APPLICATION = 'nx2django.wsgi.application' 111 | 112 | 113 | # Database 114 | # https://docs.djangoproject.com/en/1.7/ref/settings/#databases 115 | 116 | DATABASES = { 117 | 'default': { 118 | 'ENGINE': 'django.db.backends.sqlite3', 119 | 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), 120 | } 121 | } 122 | 123 | # Internationalization 124 | # https://docs.djangoproject.com/en/1.7/topics/i18n/ 125 | 126 | LANGUAGE_CODE = 'en-us' 127 | 128 | TIME_ZONE = 'UTC' 129 | 130 | USE_I18N = True 131 | 132 | USE_L10N = True 133 | 134 | USE_TZ = True 135 | 136 | 137 | # Static files (CSS, JavaScript, Images) 138 | # https://docs.djangoproject.com/en/1.7/howto/static-files/ 139 | 140 | STATIC_URL = '/static/' 141 | 142 | HAYSTACK_SIGNAL_PROCESSOR = 'haystack.signals.RealtimeSignalProcessor' 143 | 144 | HAYSTACK_CONNECTIONS = { 145 | 'default': { 146 | 'ENGINE': 'haystack.backends.elasticsearch_backend.ElasticsearchSearchEngine', 147 | 'URL': 'http://127.0.0.1:9200/', 148 | 'INDEX_NAME': 'django', 149 | }, 150 | } -------------------------------------------------------------------------------- /nx2django/static/admin/css/base.css: -------------------------------------------------------------------------------- 1 | /* 2 | DJANGO Admin styles 3 | */ 4 | 5 | body { 6 | margin: 0; 7 | padding: 0; 8 | font-size: 12px; 9 | font-family: "Lucida Grande","DejaVu Sans","Bitstream Vera Sans",Verdana,Arial,sans-serif; 10 | color: #333; 11 | background: #fff; 12 | } 13 | 14 | /* LINKS */ 15 | 16 | a:link, a:visited { 17 | color: #5b80b2; 18 | text-decoration: none; 19 | } 20 | 21 | a:hover { 22 | color: #036; 23 | } 24 | 25 | a img { 26 | border: none; 27 | } 28 | 29 | a.section:link, a.section:visited { 30 | color: #fff; 31 | text-decoration: none; 32 | } 33 | 34 | /* GLOBAL DEFAULTS */ 35 | 36 | p, ol, ul, dl { 37 | margin: .2em 0 .8em 0; 38 | } 39 | 40 | p { 41 | padding: 0; 42 | line-height: 140%; 43 | } 44 | 45 | h1,h2,h3,h4,h5 { 46 | font-weight: bold; 47 | } 48 | 49 | h1 { 50 | font-size: 18px; 51 | color: #666; 52 | padding: 0 6px 0 0; 53 | margin: 0 0 .2em 0; 54 | } 55 | 56 | h2 { 57 | font-size: 16px; 58 | margin: 1em 0 .5em 0; 59 | } 60 | 61 | h2.subhead { 62 | font-weight: normal; 63 | margin-top: 0; 64 | } 65 | 66 | h3 { 67 | font-size: 14px; 68 | margin: .8em 0 .3em 0; 69 | color: #666; 70 | font-weight: bold; 71 | } 72 | 73 | h4 { 74 | font-size: 12px; 75 | margin: 1em 0 .8em 0; 76 | padding-bottom: 3px; 77 | } 78 | 79 | h5 { 80 | font-size: 10px; 81 | margin: 1.5em 0 .5em 0; 82 | color: #666; 83 | text-transform: uppercase; 84 | letter-spacing: 1px; 85 | } 86 | 87 | ul li { 88 | list-style-type: square; 89 | padding: 1px 0; 90 | } 91 | 92 | ul.plainlist { 93 | margin-left: 0 !important; 94 | } 95 | 96 | ul.plainlist li { 97 | list-style-type: none; 98 | } 99 | 100 | li ul { 101 | margin-bottom: 0; 102 | } 103 | 104 | li, dt, dd { 105 | font-size: 11px; 106 | line-height: 14px; 107 | } 108 | 109 | dt { 110 | font-weight: bold; 111 | margin-top: 4px; 112 | } 113 | 114 | dd { 115 | margin-left: 0; 116 | } 117 | 118 | form { 119 | margin: 0; 120 | padding: 0; 121 | } 122 | 123 | fieldset { 124 | margin: 0; 125 | padding: 0; 126 | } 127 | 128 | blockquote { 129 | font-size: 11px; 130 | color: #777; 131 | margin-left: 2px; 132 | padding-left: 10px; 133 | border-left: 5px solid #ddd; 134 | } 135 | 136 | code, pre { 137 | font-family: "Bitstream Vera Sans Mono", Monaco, "Courier New", Courier, monospace; 138 | color: #666; 139 | font-size: 11px; 140 | } 141 | 142 | pre.literal-block { 143 | margin: 10px; 144 | background: #eee; 145 | padding: 6px 8px; 146 | } 147 | 148 | code strong { 149 | color: #930; 150 | } 151 | 152 | hr { 153 | clear: both; 154 | color: #eee; 155 | background-color: #eee; 156 | height: 1px; 157 | border: none; 158 | margin: 0; 159 | padding: 0; 160 | font-size: 1px; 161 | line-height: 1px; 162 | } 163 | 164 | /* TEXT STYLES & MODIFIERS */ 165 | 166 | .small { 167 | font-size: 11px; 168 | } 169 | 170 | .tiny { 171 | font-size: 10px; 172 | } 173 | 174 | p.tiny { 175 | margin-top: -2px; 176 | } 177 | 178 | .mini { 179 | font-size: 9px; 180 | } 181 | 182 | p.mini { 183 | margin-top: -3px; 184 | } 185 | 186 | .help, p.help { 187 | font-size: 10px !important; 188 | color: #999; 189 | } 190 | 191 | img.help-tooltip { 192 | cursor: help; 193 | } 194 | 195 | p img, h1 img, h2 img, h3 img, h4 img, td img { 196 | vertical-align: middle; 197 | } 198 | 199 | .quiet, a.quiet:link, a.quiet:visited { 200 | color: #999 !important; 201 | font-weight: normal !important; 202 | } 203 | 204 | .quiet strong { 205 | font-weight: bold !important; 206 | } 207 | 208 | .float-right { 209 | float: right; 210 | } 211 | 212 | .float-left { 213 | float: left; 214 | } 215 | 216 | .clear { 217 | clear: both; 218 | } 219 | 220 | .align-left { 221 | text-align: left; 222 | } 223 | 224 | .align-right { 225 | text-align: right; 226 | } 227 | 228 | .example { 229 | margin: 10px 0; 230 | padding: 5px 10px; 231 | background: #efefef; 232 | } 233 | 234 | .nowrap { 235 | white-space: nowrap; 236 | } 237 | 238 | /* TABLES */ 239 | 240 | table { 241 | border-collapse: collapse; 242 | border-color: #ccc; 243 | } 244 | 245 | td, th { 246 | font-size: 11px; 247 | line-height: 13px; 248 | border-bottom: 1px solid #eee; 249 | vertical-align: top; 250 | padding: 5px; 251 | font-family: "Lucida Grande", Verdana, Arial, sans-serif; 252 | } 253 | 254 | th { 255 | text-align: left; 256 | font-size: 12px; 257 | font-weight: bold; 258 | } 259 | 260 | thead th, 261 | tfoot td { 262 | color: #666; 263 | padding: 2px 5px; 264 | font-size: 11px; 265 | background: #e1e1e1 url(../img/nav-bg.gif) top left repeat-x; 266 | border-left: 1px solid #ddd; 267 | border-bottom: 1px solid #ddd; 268 | } 269 | 270 | tfoot td { 271 | border-bottom: none; 272 | border-top: 1px solid #ddd; 273 | } 274 | 275 | thead th:first-child, 276 | tfoot td:first-child { 277 | border-left: none !important; 278 | } 279 | 280 | thead th.optional { 281 | font-weight: normal !important; 282 | } 283 | 284 | fieldset table { 285 | border-right: 1px solid #eee; 286 | } 287 | 288 | tr.row-label td { 289 | font-size: 9px; 290 | padding-top: 2px; 291 | padding-bottom: 0; 292 | border-bottom: none; 293 | color: #666; 294 | margin-top: -1px; 295 | } 296 | 297 | tr.alt { 298 | background: #f6f6f6; 299 | } 300 | 301 | .row1 { 302 | background: #EDF3FE; 303 | } 304 | 305 | .row2 { 306 | background: #fff; 307 | } 308 | 309 | /* SORTABLE TABLES */ 310 | 311 | thead th { 312 | padding: 2px 5px; 313 | line-height: normal; 314 | } 315 | 316 | thead th a:link, thead th a:visited { 317 | color: #666; 318 | } 319 | 320 | thead th.sorted { 321 | background: #c5c5c5 url(../img/nav-bg-selected.gif) top left repeat-x; 322 | } 323 | 324 | thead th.sorted .text { 325 | padding-right: 42px; 326 | } 327 | 328 | table thead th .text span { 329 | padding: 2px 5px; 330 | display:block; 331 | } 332 | 333 | table thead th .text a { 334 | display: block; 335 | cursor: pointer; 336 | padding: 2px 5px; 337 | } 338 | 339 | table thead th.sortable:hover { 340 | background: #fff url(../img/nav-bg-reverse.gif) 0 -5px repeat-x; 341 | } 342 | 343 | thead th.sorted a.sortremove { 344 | visibility: hidden; 345 | } 346 | 347 | table thead th.sorted:hover a.sortremove { 348 | visibility: visible; 349 | } 350 | 351 | table thead th.sorted .sortoptions { 352 | display: block; 353 | padding: 4px 5px 0 5px; 354 | float: right; 355 | text-align: right; 356 | } 357 | 358 | table thead th.sorted .sortpriority { 359 | font-size: .8em; 360 | min-width: 12px; 361 | text-align: center; 362 | vertical-align: top; 363 | } 364 | 365 | table thead th.sorted .sortoptions a { 366 | width: 14px; 367 | height: 12px; 368 | display: inline-block; 369 | } 370 | 371 | table thead th.sorted .sortoptions a.sortremove { 372 | background: url(../img/sorting-icons.gif) -4px -5px no-repeat; 373 | } 374 | 375 | table thead th.sorted .sortoptions a.sortremove:hover { 376 | background: url(../img/sorting-icons.gif) -4px -27px no-repeat; 377 | } 378 | 379 | table thead th.sorted .sortoptions a.ascending { 380 | background: url(../img/sorting-icons.gif) -5px -50px no-repeat; 381 | } 382 | 383 | table thead th.sorted .sortoptions a.ascending:hover { 384 | background: url(../img/sorting-icons.gif) -5px -72px no-repeat; 385 | } 386 | 387 | table thead th.sorted .sortoptions a.descending { 388 | background: url(../img/sorting-icons.gif) -5px -94px no-repeat; 389 | } 390 | 391 | table thead th.sorted .sortoptions a.descending:hover { 392 | background: url(../img/sorting-icons.gif) -5px -115px no-repeat; 393 | } 394 | 395 | /* ORDERABLE TABLES */ 396 | 397 | table.orderable tbody tr td:hover { 398 | cursor: move; 399 | } 400 | 401 | table.orderable tbody tr td:first-child { 402 | padding-left: 14px; 403 | background-image: url(../img/nav-bg-grabber.gif); 404 | background-repeat: repeat-y; 405 | } 406 | 407 | table.orderable-initalized .order-cell, body>tr>td.order-cell { 408 | display: none; 409 | } 410 | 411 | /* FORM DEFAULTS */ 412 | 413 | input, textarea, select, .form-row p, form .button { 414 | margin: 2px 0; 415 | padding: 2px 3px; 416 | vertical-align: middle; 417 | font-family: "Lucida Grande", Verdana, Arial, sans-serif; 418 | font-weight: normal; 419 | font-size: 11px; 420 | } 421 | 422 | textarea { 423 | vertical-align: top !important; 424 | } 425 | 426 | input[type=text], input[type=password], input[type=email], input[type=url], input[type=number], 427 | textarea, select, .vTextField { 428 | border: 1px solid #ccc; 429 | } 430 | 431 | /* FORM BUTTONS */ 432 | 433 | .button, input[type=submit], input[type=button], .submit-row input, a.button { 434 | background: #fff url(../img/nav-bg.gif) bottom repeat-x; 435 | padding: 3px 5px; 436 | color: black; 437 | border: 1px solid #bbb; 438 | border-color: #ddd #aaa #aaa #ddd; 439 | } 440 | 441 | a.button { 442 | padding: 4px 5px; 443 | } 444 | 445 | .button:active, input[type=submit]:active, input[type=button]:active { 446 | background-image: url(../img/nav-bg-reverse.gif); 447 | background-position: top; 448 | } 449 | 450 | .button[disabled], input[type=submit][disabled], input[type=button][disabled] { 451 | background-image: url(../img/nav-bg.gif); 452 | background-position: bottom; 453 | opacity: 0.4; 454 | } 455 | 456 | .button.default, input[type=submit].default, .submit-row input.default { 457 | border: 2px solid #5b80b2; 458 | background: #7CA0C7 url(../img/default-bg.gif) bottom repeat-x; 459 | font-weight: bold; 460 | color: #fff; 461 | float: right; 462 | } 463 | 464 | .button.default:active, input[type=submit].default:active { 465 | background-image: url(../img/default-bg-reverse.gif); 466 | background-position: top; 467 | } 468 | 469 | .button[disabled].default, input[type=submit][disabled].default, input[type=button][disabled].default { 470 | background-image: url(../img/default-bg.gif); 471 | background-position: bottom; 472 | opacity: 0.4; 473 | } 474 | 475 | 476 | /* MODULES */ 477 | 478 | .module { 479 | border: 1px solid #ccc; 480 | margin-bottom: 5px; 481 | background: #fff; 482 | } 483 | 484 | .module p, .module ul, .module h3, .module h4, .module dl, .module pre { 485 | padding-left: 10px; 486 | padding-right: 10px; 487 | } 488 | 489 | .module blockquote { 490 | margin-left: 12px; 491 | } 492 | 493 | .module ul, .module ol { 494 | margin-left: 1.5em; 495 | } 496 | 497 | .module h3 { 498 | margin-top: .6em; 499 | } 500 | 501 | .module h2, .module caption, .inline-group h2 { 502 | margin: 0; 503 | padding: 2px 5px 3px 5px; 504 | font-size: 11px; 505 | text-align: left; 506 | font-weight: bold; 507 | background: #7CA0C7 url(../img/default-bg.gif) top left repeat-x; 508 | color: #fff; 509 | } 510 | 511 | .module table { 512 | border-collapse: collapse; 513 | } 514 | 515 | /* MESSAGES & ERRORS */ 516 | 517 | ul.messagelist { 518 | padding: 0; 519 | margin: 0; 520 | } 521 | 522 | ul.messagelist li { 523 | font-size: 12px; 524 | font-weight: bold; 525 | display: block; 526 | padding: 5px 5px 4px 25px; 527 | margin: 0 0 3px 0; 528 | border-bottom: 1px solid #ddd; 529 | color: #666; 530 | background: #dfd url(../img/icon_success.gif) 5px .3em no-repeat; 531 | } 532 | 533 | ul.messagelist li.warning { 534 | background: #ffc url(../img/icon_alert.gif) 5px .3em no-repeat; 535 | } 536 | 537 | ul.messagelist li.error { 538 | background: #ffefef url(../img/icon_error.gif) 5px .3em no-repeat; 539 | } 540 | 541 | .errornote { 542 | font-size: 12px !important; 543 | font-weight: bold; 544 | display: block; 545 | padding: 5px 5px 4px 25px; 546 | margin: 0 0 3px 0; 547 | border: 1px solid #c22; 548 | color: #c11; 549 | background: #ffefef url(../img/icon_error.gif) 5px .38em no-repeat; 550 | } 551 | 552 | .errornote, ul.errorlist { 553 | border-radius: 1px; 554 | } 555 | 556 | ul.errorlist { 557 | margin: 0 0 4px !important; 558 | padding: 0 !important; 559 | color: #fff; 560 | background: #c11; 561 | } 562 | 563 | ul.errorlist li { 564 | font-size: 12px !important; 565 | display: block; 566 | padding: 5px 5px 4px 7px; 567 | margin: 3px 0 0 0; 568 | } 569 | 570 | ul.errorlist li:first-child { 571 | margin-top: 0; 572 | } 573 | 574 | ul.errorlist li a { 575 | color: #fff; 576 | text-decoration: underline; 577 | } 578 | 579 | td ul.errorlist { 580 | margin: 0 !important; 581 | padding: 0 !important; 582 | } 583 | 584 | td ul.errorlist li { 585 | margin: 0 !important; 586 | } 587 | 588 | .errors, .form-row.errors { 589 | background: #ffefef; 590 | } 591 | 592 | .form-row.errors { 593 | border: 1px solid #c22; 594 | margin: -1px; 595 | } 596 | 597 | .errors input, .errors select, .errors textarea { 598 | border: 1px solid #c11; 599 | } 600 | 601 | div.system-message { 602 | background: #ffc; 603 | margin: 10px; 604 | padding: 6px 8px; 605 | font-size: .8em; 606 | } 607 | 608 | div.system-message p.system-message-title { 609 | padding: 4px 5px 4px 25px; 610 | margin: 0; 611 | color: #c11; 612 | background: #ffefef url(../img/icon_error.gif) 5px .3em no-repeat; 613 | } 614 | 615 | .description { 616 | font-size: 12px; 617 | padding: 5px 0 0 12px; 618 | } 619 | 620 | /* BREADCRUMBS */ 621 | 622 | div.breadcrumbs { 623 | background: #fff url(../img/nav-bg-reverse.gif) 0 -10px repeat-x; 624 | padding: 2px 8px 3px 8px; 625 | font-size: 11px; 626 | color: #999; 627 | border-top: 1px solid #fff; 628 | border-bottom: 1px solid #ddd; 629 | text-align: left; 630 | } 631 | 632 | /* ACTION ICONS */ 633 | 634 | .addlink { 635 | padding-left: 12px; 636 | background: url(../img/icon_addlink.gif) 0 .2em no-repeat; 637 | } 638 | 639 | .changelink, .inlinechangelink { 640 | padding-left: 12px; 641 | background: url(../img/icon_changelink.gif) 0 .2em no-repeat; 642 | } 643 | 644 | .deletelink { 645 | padding-left: 12px; 646 | background: url(../img/icon_deletelink.gif) 0 .25em no-repeat; 647 | } 648 | 649 | a.deletelink:link, a.deletelink:visited { 650 | color: #CC3434; 651 | } 652 | 653 | a.deletelink:hover { 654 | color: #993333; 655 | } 656 | 657 | /* OBJECT TOOLS */ 658 | 659 | .object-tools { 660 | font-size: 10px; 661 | font-weight: bold; 662 | font-family: Arial,Helvetica,sans-serif; 663 | padding-left: 0; 664 | float: right; 665 | position: relative; 666 | margin-top: -2.4em; 667 | margin-bottom: -2em; 668 | } 669 | 670 | .form-row .object-tools { 671 | margin-top: 5px; 672 | margin-bottom: 5px; 673 | float: none; 674 | height: 2em; 675 | padding-left: 3.5em; 676 | } 677 | 678 | .object-tools li { 679 | display: block; 680 | float: left; 681 | margin-left: 5px; 682 | height: 16px; 683 | } 684 | 685 | .object-tools a { 686 | border-radius: 15px; 687 | } 688 | 689 | .object-tools a:link, .object-tools a:visited { 690 | display: block; 691 | float: left; 692 | color: #fff; 693 | padding: .2em 10px; 694 | background: #999; 695 | } 696 | 697 | .object-tools a:hover, .object-tools li:hover a { 698 | background-color: #5b80b2; 699 | } 700 | 701 | .object-tools a.viewsitelink, .object-tools a.golink { 702 | background: #999 url(../img/tooltag-arrowright.png) 95% center no-repeat; 703 | padding-right: 26px; 704 | } 705 | 706 | .object-tools a.addlink { 707 | background: #999 url(../img/tooltag-add.png) 95% center no-repeat; 708 | padding-right: 26px; 709 | } 710 | 711 | /* OBJECT HISTORY */ 712 | 713 | table#change-history { 714 | width: 100%; 715 | } 716 | 717 | table#change-history tbody th { 718 | width: 16em; 719 | } 720 | 721 | /* PAGE STRUCTURE */ 722 | 723 | #container { 724 | position: relative; 725 | width: 100%; 726 | min-width: 760px; 727 | padding: 0; 728 | } 729 | 730 | #content { 731 | margin: 10px 15px; 732 | } 733 | 734 | #content-main { 735 | float: left; 736 | width: 100%; 737 | } 738 | 739 | #content-related { 740 | float: right; 741 | width: 18em; 742 | position: relative; 743 | margin-right: -19em; 744 | } 745 | 746 | #footer { 747 | clear: both; 748 | padding: 10px; 749 | } 750 | 751 | /* COLUMN TYPES */ 752 | 753 | .colMS { 754 | margin-right: 20em !important; 755 | } 756 | 757 | .colSM { 758 | margin-left: 20em !important; 759 | } 760 | 761 | .colSM #content-related { 762 | float: left; 763 | margin-right: 0; 764 | margin-left: -19em; 765 | } 766 | 767 | .colSM #content-main { 768 | float: right; 769 | } 770 | 771 | .popup .colM { 772 | width: 95%; 773 | } 774 | 775 | .subcol { 776 | float: left; 777 | width: 46%; 778 | margin-right: 15px; 779 | } 780 | 781 | .dashboard #content { 782 | width: 500px; 783 | } 784 | 785 | /* HEADER */ 786 | 787 | #header { 788 | width: 100%; 789 | background: #417690; 790 | color: #ffc; 791 | overflow: hidden; 792 | } 793 | 794 | #header a:link, #header a:visited { 795 | color: #fff; 796 | } 797 | 798 | #header a:hover { 799 | text-decoration: underline; 800 | } 801 | 802 | #branding { 803 | float: left; 804 | } 805 | #branding h1 { 806 | padding: 0 10px; 807 | font-size: 18px; 808 | margin: 8px 0; 809 | font-weight: normal; 810 | } 811 | 812 | #branding h1, #branding h1 a:link, #branding h1 a:visited { 813 | color: #f4f379; 814 | } 815 | 816 | #branding h2 { 817 | padding: 0 10px; 818 | font-size: 14px; 819 | margin: -8px 0 8px 0; 820 | font-weight: normal; 821 | color: #ffc; 822 | } 823 | 824 | #branding a:hover { 825 | text-decoration: none; 826 | } 827 | 828 | #user-tools { 829 | float: right; 830 | padding: 1.2em 10px; 831 | font-size: 11px; 832 | text-align: right; 833 | } 834 | 835 | /* SIDEBAR */ 836 | 837 | #content-related h3 { 838 | font-size: 12px; 839 | color: #666; 840 | margin-bottom: 3px; 841 | } 842 | 843 | #content-related h4 { 844 | font-size: 11px; 845 | } 846 | 847 | #content-related .module h2 { 848 | background: #eee url(../img/nav-bg.gif) bottom left repeat-x; 849 | color: #666; 850 | } 851 | -------------------------------------------------------------------------------- /nx2django/static/admin/css/changelists.css: -------------------------------------------------------------------------------- 1 | /* CHANGELISTS */ 2 | 3 | #changelist { 4 | position: relative; 5 | width: 100%; 6 | } 7 | 8 | #changelist table { 9 | width: 100%; 10 | } 11 | 12 | .change-list .hiddenfields { display:none; } 13 | 14 | .change-list .filtered table { 15 | border-right: 1px solid #ddd; 16 | } 17 | 18 | .change-list .filtered { 19 | min-height: 400px; 20 | } 21 | 22 | .change-list .filtered { 23 | background: white url(../img/changelist-bg.gif) top right repeat-y !important; 24 | } 25 | 26 | .change-list .filtered .results, .change-list .filtered .paginator, .filtered #toolbar, .filtered div.xfull { 27 | margin-right: 160px !important; 28 | width: auto !important; 29 | } 30 | 31 | .change-list .filtered table tbody th { 32 | padding-right: 1em; 33 | } 34 | 35 | #changelist-form .results { 36 | overflow-x: auto; 37 | } 38 | 39 | #changelist .toplinks { 40 | border-bottom: 1px solid #ccc !important; 41 | } 42 | 43 | #changelist .paginator { 44 | color: #666; 45 | border-top: 1px solid #eee; 46 | border-bottom: 1px solid #eee; 47 | background: white url(../img/nav-bg.gif) 0 180% repeat-x; 48 | overflow: hidden; 49 | } 50 | 51 | .change-list .filtered .paginator { 52 | border-right: 1px solid #ddd; 53 | } 54 | 55 | /* CHANGELIST TABLES */ 56 | 57 | #changelist table thead th { 58 | padding: 0; 59 | white-space: nowrap; 60 | vertical-align: middle; 61 | } 62 | 63 | #changelist table thead th.action-checkbox-column { 64 | width: 1.5em; 65 | text-align: center; 66 | } 67 | 68 | #changelist table tbody td, #changelist table tbody th { 69 | border-left: 1px solid #ddd; 70 | } 71 | 72 | #changelist table tbody td:first-child, #changelist table tbody th:first-child { 73 | border-left: 0; 74 | border-right: 1px solid #ddd; 75 | } 76 | 77 | #changelist table tbody td.action-checkbox { 78 | text-align:center; 79 | } 80 | 81 | #changelist table tfoot { 82 | color: #666; 83 | } 84 | 85 | /* TOOLBAR */ 86 | 87 | #changelist #toolbar { 88 | padding: 3px; 89 | border-bottom: 1px solid #ddd; 90 | background: #e1e1e1 url(../img/nav-bg.gif) top left repeat-x; 91 | color: #666; 92 | } 93 | 94 | #changelist #toolbar form input { 95 | font-size: 11px; 96 | padding: 1px 2px; 97 | } 98 | 99 | #changelist #toolbar form #searchbar { 100 | padding: 2px; 101 | } 102 | 103 | #changelist #changelist-search img { 104 | vertical-align: middle; 105 | } 106 | 107 | /* FILTER COLUMN */ 108 | 109 | #changelist-filter { 110 | position: absolute; 111 | top: 0; 112 | right: 0; 113 | z-index: 1000; 114 | width: 160px; 115 | border-left: 1px solid #ddd; 116 | background: #efefef; 117 | margin: 0; 118 | } 119 | 120 | #changelist-filter h2 { 121 | font-size: 11px; 122 | padding: 2px 5px; 123 | border-bottom: 1px solid #ddd; 124 | } 125 | 126 | #changelist-filter h3 { 127 | font-size: 12px; 128 | margin-bottom: 0; 129 | } 130 | 131 | #changelist-filter ul { 132 | padding-left: 0; 133 | margin-left: 10px; 134 | } 135 | 136 | #changelist-filter li { 137 | list-style-type: none; 138 | margin-left: 0; 139 | padding-left: 0; 140 | } 141 | 142 | #changelist-filter a { 143 | color: #999; 144 | } 145 | 146 | #changelist-filter a:hover { 147 | color: #036; 148 | } 149 | 150 | #changelist-filter li.selected { 151 | border-left: 5px solid #ccc; 152 | padding-left: 5px; 153 | margin-left: -10px; 154 | } 155 | 156 | #changelist-filter li.selected a { 157 | color: #5b80b2 !important; 158 | } 159 | 160 | /* DATE DRILLDOWN */ 161 | 162 | .change-list ul.toplinks { 163 | display: block; 164 | background: white url(../img/nav-bg-reverse.gif) 0 -10px repeat-x; 165 | border-top: 1px solid white; 166 | float: left; 167 | padding: 0 !important; 168 | margin: 0 !important; 169 | width: 100%; 170 | } 171 | 172 | .change-list ul.toplinks li { 173 | padding: 3px 6px; 174 | font-weight: bold; 175 | list-style-type: none; 176 | display: inline-block; 177 | } 178 | 179 | .change-list ul.toplinks .date-back a { 180 | color: #999; 181 | } 182 | 183 | .change-list ul.toplinks .date-back a:hover { 184 | color: #036; 185 | } 186 | 187 | /* PAGINATOR */ 188 | 189 | .paginator { 190 | font-size: 11px; 191 | padding-top: 10px; 192 | padding-bottom: 10px; 193 | line-height: 22px; 194 | margin: 0; 195 | border-top: 1px solid #ddd; 196 | } 197 | 198 | .paginator a:link, .paginator a:visited { 199 | padding: 2px 6px; 200 | border: solid 1px #ccc; 201 | background: white; 202 | text-decoration: none; 203 | } 204 | 205 | .paginator a.showall { 206 | padding: 0 !important; 207 | border: none !important; 208 | } 209 | 210 | .paginator a.showall:hover { 211 | color: #036 !important; 212 | background: transparent !important; 213 | } 214 | 215 | .paginator .end { 216 | border-width: 2px !important; 217 | margin-right: 6px; 218 | } 219 | 220 | .paginator .this-page { 221 | padding: 2px 6px; 222 | font-weight: bold; 223 | font-size: 13px; 224 | vertical-align: top; 225 | } 226 | 227 | .paginator a:hover { 228 | color: white; 229 | background: #5b80b2; 230 | border-color: #036; 231 | } 232 | 233 | /* ACTIONS */ 234 | 235 | .filtered .actions { 236 | margin-right: 160px !important; 237 | border-right: 1px solid #ddd; 238 | } 239 | 240 | #changelist table input { 241 | margin: 0; 242 | } 243 | 244 | #changelist table tbody tr.selected { 245 | background-color: #FFFFCC; 246 | } 247 | 248 | #changelist .actions { 249 | color: #999; 250 | padding: 3px; 251 | border-top: 1px solid #fff; 252 | border-bottom: 1px solid #ddd; 253 | background: white url(../img/nav-bg-reverse.gif) 0 -10px repeat-x; 254 | } 255 | 256 | #changelist .actions.selected { 257 | background: #fffccf; 258 | border-top: 1px solid #fffee8; 259 | border-bottom: 1px solid #edecd6; 260 | } 261 | 262 | #changelist .actions span.all, 263 | #changelist .actions span.action-counter, 264 | #changelist .actions span.clear, 265 | #changelist .actions span.question { 266 | font-size: 11px; 267 | margin: 0 0.5em; 268 | display: none; 269 | } 270 | 271 | #changelist .actions:last-child { 272 | border-bottom: none; 273 | } 274 | 275 | #changelist .actions select { 276 | border: 1px solid #aaa; 277 | margin-left: 0.5em; 278 | padding: 1px 2px; 279 | } 280 | 281 | #changelist .actions label { 282 | font-size: 11px; 283 | margin-left: 0.5em; 284 | } 285 | 286 | #changelist #action-toggle { 287 | display: none; 288 | } 289 | 290 | #changelist .actions .button { 291 | font-size: 11px; 292 | padding: 1px 2px; 293 | } 294 | -------------------------------------------------------------------------------- /nx2django/static/admin/css/dashboard.css: -------------------------------------------------------------------------------- 1 | /* DASHBOARD */ 2 | 3 | .dashboard .module table th { 4 | width: 100%; 5 | } 6 | 7 | .dashboard .module table td { 8 | white-space: nowrap; 9 | } 10 | 11 | .dashboard .module table td a { 12 | display: block; 13 | padding-right: .6em; 14 | } 15 | 16 | /* RECENT ACTIONS MODULE */ 17 | 18 | .module ul.actionlist { 19 | margin-left: 0; 20 | } 21 | 22 | ul.actionlist li { 23 | list-style-type: none; 24 | } 25 | 26 | ul.actionlist li { 27 | overflow: hidden; 28 | text-overflow: ellipsis; 29 | -o-text-overflow: ellipsis; 30 | } 31 | -------------------------------------------------------------------------------- /nx2django/static/admin/css/forms.css: -------------------------------------------------------------------------------- 1 | @import url('widgets.css'); 2 | 3 | /* FORM ROWS */ 4 | 5 | .form-row { 6 | overflow: hidden; 7 | padding: 8px 12px; 8 | font-size: 11px; 9 | border-bottom: 1px solid #eee; 10 | } 11 | 12 | .form-row img, .form-row input { 13 | vertical-align: middle; 14 | } 15 | 16 | form .form-row p { 17 | padding-left: 0; 18 | font-size: 11px; 19 | } 20 | 21 | .hidden { 22 | display: none; 23 | } 24 | 25 | /* FORM LABELS */ 26 | 27 | form h4 { 28 | margin: 0 !important; 29 | padding: 0 !important; 30 | border: none !important; 31 | } 32 | 33 | label { 34 | font-weight: normal !important; 35 | color: #666; 36 | font-size: 12px; 37 | } 38 | 39 | .required label, label.required { 40 | font-weight: bold !important; 41 | color: #333 !important; 42 | } 43 | 44 | /* RADIO BUTTONS */ 45 | 46 | form ul.radiolist li { 47 | list-style-type: none; 48 | } 49 | 50 | form ul.radiolist label { 51 | float: none; 52 | display: inline; 53 | } 54 | 55 | form ul.inline { 56 | margin-left: 0; 57 | padding: 0; 58 | } 59 | 60 | form ul.inline li { 61 | float: left; 62 | padding-right: 7px; 63 | } 64 | 65 | /* ALIGNED FIELDSETS */ 66 | 67 | .aligned label { 68 | display: block; 69 | padding: 3px 10px 0 0; 70 | float: left; 71 | width: 8em; 72 | word-wrap: break-word; 73 | } 74 | 75 | .aligned ul label { 76 | display: inline; 77 | float: none; 78 | width: auto; 79 | } 80 | 81 | .colMS .aligned .vLargeTextField, .colMS .aligned .vXMLLargeTextField { 82 | width: 350px; 83 | } 84 | 85 | form .aligned p, form .aligned ul { 86 | margin-left: 7em; 87 | padding-left: 30px; 88 | } 89 | 90 | form .aligned table p { 91 | margin-left: 0; 92 | padding-left: 0; 93 | } 94 | 95 | form .aligned p.help { 96 | padding-left: 38px; 97 | } 98 | 99 | .aligned .vCheckboxLabel { 100 | float: none !important; 101 | display: inline; 102 | padding-left: 4px; 103 | } 104 | 105 | .colM .aligned .vLargeTextField, .colM .aligned .vXMLLargeTextField { 106 | width: 610px; 107 | } 108 | 109 | .checkbox-row p.help { 110 | margin-left: 0; 111 | padding-left: 0 !important; 112 | } 113 | 114 | fieldset .field-box { 115 | float: left; 116 | margin-right: 20px; 117 | } 118 | 119 | /* WIDE FIELDSETS */ 120 | 121 | .wide label { 122 | width: 15em !important; 123 | } 124 | 125 | form .wide p { 126 | margin-left: 15em; 127 | } 128 | 129 | form .wide p.help { 130 | padding-left: 38px; 131 | } 132 | 133 | .colM fieldset.wide .vLargeTextField, .colM fieldset.wide .vXMLLargeTextField { 134 | width: 450px; 135 | } 136 | 137 | /* COLLAPSED FIELDSETS */ 138 | 139 | fieldset.collapsed * { 140 | display: none; 141 | } 142 | 143 | fieldset.collapsed h2, fieldset.collapsed { 144 | display: block !important; 145 | } 146 | 147 | fieldset.collapsed h2 { 148 | background-image: url(../img/nav-bg.gif); 149 | background-position: bottom left; 150 | color: #999; 151 | } 152 | 153 | fieldset.collapsed .collapse-toggle { 154 | background: transparent; 155 | display: inline !important; 156 | } 157 | 158 | /* MONOSPACE TEXTAREAS */ 159 | 160 | fieldset.monospace textarea { 161 | font-family: "Bitstream Vera Sans Mono",Monaco,"Courier New",Courier,monospace; 162 | } 163 | 164 | /* SUBMIT ROW */ 165 | 166 | .submit-row { 167 | padding: 5px 7px; 168 | text-align: right; 169 | background: white url(../img/nav-bg.gif) 0 100% repeat-x; 170 | border: 1px solid #ccc; 171 | margin: 5px 0; 172 | overflow: hidden; 173 | } 174 | 175 | body.popup .submit-row { 176 | overflow: auto; 177 | } 178 | 179 | .submit-row input { 180 | margin: 0 0 0 5px; 181 | } 182 | 183 | .submit-row p { 184 | margin: 0.3em; 185 | } 186 | 187 | .submit-row p.deletelink-box { 188 | float: left; 189 | } 190 | 191 | .submit-row .deletelink { 192 | background: url(../img/icon_deletelink.gif) 0 50% no-repeat; 193 | padding-left: 14px; 194 | } 195 | 196 | /* CUSTOM FORM FIELDS */ 197 | 198 | .vSelectMultipleField { 199 | vertical-align: top !important; 200 | } 201 | 202 | .vCheckboxField { 203 | border: none; 204 | } 205 | 206 | .vDateField, .vTimeField { 207 | margin-right: 2px; 208 | } 209 | 210 | .vDateField { 211 | min-width: 6.85em; 212 | } 213 | 214 | .vTimeField { 215 | min-width: 4.7em; 216 | } 217 | 218 | .vURLField { 219 | width: 30em; 220 | } 221 | 222 | .vLargeTextField, .vXMLLargeTextField { 223 | width: 48em; 224 | } 225 | 226 | .flatpages-flatpage #id_content { 227 | height: 40.2em; 228 | } 229 | 230 | .module table .vPositiveSmallIntegerField { 231 | width: 2.2em; 232 | } 233 | 234 | .vTextField { 235 | width: 20em; 236 | } 237 | 238 | .vIntegerField { 239 | width: 5em; 240 | } 241 | 242 | .vBigIntegerField { 243 | width: 10em; 244 | } 245 | 246 | .vForeignKeyRawIdAdminField { 247 | width: 5em; 248 | } 249 | 250 | /* INLINES */ 251 | 252 | .inline-group { 253 | padding: 0; 254 | border: 1px solid #ccc; 255 | margin: 10px 0; 256 | } 257 | 258 | .inline-group .aligned label { 259 | width: 8em; 260 | } 261 | 262 | .inline-related { 263 | position: relative; 264 | } 265 | 266 | .inline-related h3 { 267 | margin: 0; 268 | color: #666; 269 | padding: 3px 5px; 270 | font-size: 11px; 271 | background: #e1e1e1 url(../img/nav-bg.gif) top left repeat-x; 272 | border-bottom: 1px solid #ddd; 273 | } 274 | 275 | .inline-related h3 span.delete { 276 | float: right; 277 | } 278 | 279 | .inline-related h3 span.delete label { 280 | margin-left: 2px; 281 | font-size: 11px; 282 | } 283 | 284 | .inline-related fieldset { 285 | margin: 0; 286 | background: #fff; 287 | border: none; 288 | width: 100%; 289 | } 290 | 291 | .inline-related fieldset.module h3 { 292 | margin: 0; 293 | padding: 2px 5px 3px 5px; 294 | font-size: 11px; 295 | text-align: left; 296 | font-weight: bold; 297 | background: #bcd; 298 | color: #fff; 299 | } 300 | 301 | .inline-group .tabular fieldset.module { 302 | border: none; 303 | border-bottom: 1px solid #ddd; 304 | } 305 | 306 | .inline-related.tabular fieldset.module table { 307 | width: 100%; 308 | } 309 | 310 | .last-related fieldset { 311 | border: none; 312 | } 313 | 314 | .inline-group .tabular tr.has_original td { 315 | padding-top: 2em; 316 | } 317 | 318 | .inline-group .tabular tr td.original { 319 | padding: 2px 0 0 0; 320 | width: 0; 321 | _position: relative; 322 | } 323 | 324 | .inline-group .tabular th.original { 325 | width: 0px; 326 | padding: 0; 327 | } 328 | 329 | .inline-group .tabular td.original p { 330 | position: absolute; 331 | left: 0; 332 | height: 1.1em; 333 | padding: 2px 7px; 334 | overflow: hidden; 335 | font-size: 9px; 336 | font-weight: bold; 337 | color: #666; 338 | _width: 700px; 339 | } 340 | 341 | .inline-group ul.tools { 342 | padding: 0; 343 | margin: 0; 344 | list-style: none; 345 | } 346 | 347 | .inline-group ul.tools li { 348 | display: inline; 349 | padding: 0 5px; 350 | } 351 | 352 | .inline-group div.add-row, 353 | .inline-group .tabular tr.add-row td { 354 | color: #666; 355 | padding: 3px 5px; 356 | border-bottom: 1px solid #ddd; 357 | background: #e1e1e1 url(../img/nav-bg.gif) top left repeat-x; 358 | } 359 | 360 | .inline-group .tabular tr.add-row td { 361 | padding: 4px 5px 3px; 362 | border-bottom: none; 363 | } 364 | 365 | .inline-group ul.tools a.add, 366 | .inline-group div.add-row a, 367 | .inline-group .tabular tr.add-row td a { 368 | background: url(../img/icon_addlink.gif) 0 50% no-repeat; 369 | padding-left: 14px; 370 | font-size: 11px; 371 | outline: 0; /* Remove dotted border around link */ 372 | } 373 | 374 | .empty-form { 375 | display: none; 376 | } 377 | 378 | /* RELATED FIELD ADD ONE / LOOKUP */ 379 | 380 | .add-another, .related-lookup { 381 | margin-left: 5px; 382 | display: inline-block; 383 | } 384 | 385 | .add-another { 386 | width: 10px; 387 | height: 10px; 388 | background-image: url(../img/icon_addlink.gif); 389 | } 390 | 391 | .related-lookup { 392 | width: 16px; 393 | height: 16px; 394 | background-image: url(../img/selector-search.gif); 395 | } 396 | -------------------------------------------------------------------------------- /nx2django/static/admin/css/ie.css: -------------------------------------------------------------------------------- 1 | /* IE 6 & 7 */ 2 | 3 | /* Proper fixed width for dashboard in IE6 */ 4 | 5 | .dashboard #content { 6 | *width: 768px; 7 | } 8 | 9 | .dashboard #content-main { 10 | *width: 535px; 11 | } 12 | 13 | /* IE 6 ONLY */ 14 | 15 | /* Keep header from flowing off the page */ 16 | 17 | #container { 18 | _position: static; 19 | } 20 | 21 | /* Put the right sidebars back on the page */ 22 | 23 | .colMS #content-related { 24 | _margin-right: 0; 25 | _margin-left: 10px; 26 | _position: static; 27 | } 28 | 29 | /* Put the left sidebars back on the page */ 30 | 31 | .colSM #content-related { 32 | _margin-right: 10px; 33 | _margin-left: -115px; 34 | _position: static; 35 | } 36 | 37 | .form-row { 38 | _height: 1%; 39 | } 40 | 41 | /* Fix right margin for changelist filters in IE6 */ 42 | 43 | #changelist-filter ul { 44 | _margin-right: -10px; 45 | } 46 | 47 | /* IE ignores min-height, but treats height as if it were min-height */ 48 | 49 | .change-list .filtered { 50 | _height: 400px; 51 | } 52 | 53 | /* IE doesn't know alpha transparency in PNGs */ 54 | 55 | .inline-deletelink { 56 | background: transparent url(../img/inline-delete-8bit.png) no-repeat; 57 | } 58 | 59 | /* IE7 doesn't support inline-block */ 60 | .change-list ul.toplinks li { 61 | zoom: 1; 62 | *display: inline; 63 | } 64 | -------------------------------------------------------------------------------- /nx2django/static/admin/css/login.css: -------------------------------------------------------------------------------- 1 | /* LOGIN FORM */ 2 | 3 | body.login { 4 | background: #eee; 5 | } 6 | 7 | .login #container { 8 | background: white; 9 | border: 1px solid #ccc; 10 | width: 28em; 11 | min-width: 300px; 12 | margin-left: auto; 13 | margin-right: auto; 14 | margin-top: 100px; 15 | } 16 | 17 | .login #content-main { 18 | width: 100%; 19 | } 20 | 21 | .login form { 22 | margin-top: 1em; 23 | } 24 | 25 | .login .form-row { 26 | padding: 4px 0; 27 | float: left; 28 | width: 100%; 29 | } 30 | 31 | .login .form-row label { 32 | padding-right: 0.5em; 33 | line-height: 2em; 34 | font-size: 1em; 35 | clear: both; 36 | color: #333; 37 | } 38 | 39 | .login .form-row #id_username, .login .form-row #id_password { 40 | clear: both; 41 | padding: 6px; 42 | width: 100%; 43 | -webkit-box-sizing: border-box; 44 | -moz-box-sizing: border-box; 45 | box-sizing: border-box; 46 | } 47 | 48 | .login span.help { 49 | font-size: 10px; 50 | display: block; 51 | } 52 | 53 | .login .submit-row { 54 | clear: both; 55 | padding: 1em 0 0 9.4em; 56 | } 57 | 58 | .login .password-reset-link { 59 | text-align: center; 60 | } 61 | -------------------------------------------------------------------------------- /nx2django/static/admin/css/rtl.css: -------------------------------------------------------------------------------- 1 | body { 2 | direction: rtl; 3 | } 4 | 5 | /* LOGIN */ 6 | 7 | .login .form-row { 8 | float: right; 9 | } 10 | 11 | .login .form-row label { 12 | float: right; 13 | padding-left: 0.5em; 14 | padding-right: 0; 15 | text-align: left; 16 | } 17 | 18 | .login .submit-row { 19 | clear: both; 20 | padding: 1em 9.4em 0 0; 21 | } 22 | 23 | /* GLOBAL */ 24 | 25 | th { 26 | text-align: right; 27 | } 28 | 29 | .module h2, .module caption { 30 | text-align: right; 31 | } 32 | 33 | .addlink, .changelink { 34 | padding-left: 0px; 35 | padding-right: 12px; 36 | background-position: 100% 0.2em; 37 | } 38 | 39 | .deletelink { 40 | padding-left: 0px; 41 | padding-right: 12px; 42 | background-position: 100% 0.25em; 43 | } 44 | 45 | .object-tools { 46 | float: left; 47 | } 48 | 49 | thead th:first-child, 50 | tfoot td:first-child { 51 | border-left: 1px solid #ddd !important; 52 | } 53 | 54 | /* LAYOUT */ 55 | 56 | #user-tools { 57 | right: auto; 58 | left: 0; 59 | text-align: left; 60 | } 61 | 62 | div.breadcrumbs { 63 | text-align: right; 64 | } 65 | 66 | #content-main { 67 | float: right; 68 | } 69 | 70 | #content-related { 71 | float: left; 72 | margin-left: -19em; 73 | margin-right: auto; 74 | } 75 | 76 | .colMS { 77 | margin-left: 20em !important; 78 | margin-right: 10px !important; 79 | } 80 | 81 | /* SORTABLE TABLES */ 82 | 83 | table thead th.sorted .sortoptions { 84 | float: left; 85 | } 86 | 87 | thead th.sorted .text { 88 | padding-right: 0; 89 | padding-left: 42px; 90 | } 91 | 92 | /* dashboard styles */ 93 | 94 | .dashboard .module table td a { 95 | padding-left: .6em; 96 | padding-right: 12px; 97 | } 98 | 99 | /* changelists styles */ 100 | 101 | .change-list .filtered { 102 | background: white url(../img/changelist-bg_rtl.gif) top left repeat-y !important; 103 | } 104 | 105 | .change-list .filtered table { 106 | border-left: 1px solid #ddd; 107 | border-right: 0px none; 108 | } 109 | 110 | #changelist-filter { 111 | right: auto; 112 | left: 0; 113 | border-left: 0px none; 114 | border-right: 1px solid #ddd; 115 | } 116 | 117 | .change-list .filtered .results, .change-list .filtered .paginator, .filtered #toolbar, .filtered div.xfull { 118 | margin-right: 0px !important; 119 | margin-left: 160px !important; 120 | } 121 | 122 | #changelist-filter li.selected { 123 | border-left: 0px none; 124 | padding-left: 0px; 125 | margin-left: 0; 126 | border-right: 5px solid #ccc; 127 | padding-right: 5px; 128 | margin-right: -10px; 129 | } 130 | 131 | .filtered .actions { 132 | border-left:1px solid #DDDDDD; 133 | margin-left:160px !important; 134 | border-right: 0 none; 135 | margin-right:0 !important; 136 | } 137 | 138 | #changelist table tbody td:first-child, #changelist table tbody th:first-child { 139 | border-right: 0; 140 | border-left: 1px solid #ddd; 141 | } 142 | 143 | /* FORMS */ 144 | 145 | .aligned label { 146 | padding: 0 0 3px 1em; 147 | float: right; 148 | } 149 | 150 | .submit-row { 151 | text-align: left 152 | } 153 | 154 | .submit-row p.deletelink-box { 155 | float: right; 156 | } 157 | 158 | .submit-row .deletelink { 159 | background: url(../img/icon_deletelink.gif) 0 50% no-repeat; 160 | padding-right: 14px; 161 | } 162 | 163 | .vDateField, .vTimeField { 164 | margin-left: 2px; 165 | } 166 | 167 | form ul.inline li { 168 | float: right; 169 | padding-right: 0; 170 | padding-left: 7px; 171 | } 172 | 173 | input[type=submit].default, .submit-row input.default { 174 | float: left; 175 | } 176 | 177 | fieldset .field-box { 178 | float: right; 179 | margin-left: 20px; 180 | margin-right: 0; 181 | } 182 | 183 | .errorlist li { 184 | background-position: 100% .3em; 185 | padding: 4px 25px 4px 5px; 186 | } 187 | 188 | .errornote { 189 | background-position: 100% .3em; 190 | padding: 4px 25px 4px 5px; 191 | } 192 | 193 | /* WIDGETS */ 194 | 195 | .calendarnav-previous { 196 | top: 0; 197 | left: auto; 198 | right: 0; 199 | } 200 | 201 | .calendarnav-next { 202 | top: 0; 203 | right: auto; 204 | left: 0; 205 | } 206 | 207 | .calendar caption, .calendarbox h2 { 208 | text-align: center; 209 | } 210 | 211 | .selector { 212 | float: right; 213 | } 214 | 215 | .selector .selector-filter { 216 | text-align: right; 217 | } 218 | 219 | .inline-deletelink { 220 | float: left; 221 | } 222 | 223 | /* MISC */ 224 | 225 | .inline-related h2, .inline-group h2 { 226 | text-align: right 227 | } 228 | 229 | .inline-related h3 span.delete { 230 | padding-right: 20px; 231 | padding-left: inherit; 232 | left: 10px; 233 | right: inherit; 234 | float:left; 235 | } 236 | 237 | .inline-related h3 span.delete label { 238 | margin-left: inherit; 239 | margin-right: 2px; 240 | } 241 | 242 | /* IE7 specific bug fixes */ 243 | 244 | div.colM { 245 | position: relative; 246 | } 247 | 248 | .submit-row input { 249 | float: left; 250 | } 251 | -------------------------------------------------------------------------------- /nx2django/static/admin/css/widgets.css: -------------------------------------------------------------------------------- 1 | /* SELECTOR (FILTER INTERFACE) */ 2 | 3 | .selector { 4 | width: 840px; 5 | float: left; 6 | } 7 | 8 | .selector select { 9 | width: 400px; 10 | height: 17.2em; 11 | } 12 | 13 | .selector-available, .selector-chosen { 14 | float: left; 15 | width: 400px; 16 | text-align: center; 17 | margin-bottom: 5px; 18 | } 19 | 20 | .selector-chosen select { 21 | border-top: none; 22 | } 23 | 24 | .selector-available h2, .selector-chosen h2 { 25 | border: 1px solid #ccc; 26 | } 27 | 28 | .selector .selector-available h2 { 29 | background: white url(../img/nav-bg.gif) bottom left repeat-x; 30 | color: #666; 31 | } 32 | 33 | .selector .selector-filter { 34 | background: white; 35 | border: 1px solid #ccc; 36 | border-width: 0 1px; 37 | padding: 3px; 38 | color: #999; 39 | font-size: 10px; 40 | margin: 0; 41 | text-align: left; 42 | } 43 | 44 | .selector .selector-filter label, 45 | .inline-group .aligned .selector .selector-filter label { 46 | width: 16px; 47 | padding: 2px; 48 | } 49 | 50 | .selector .selector-available input { 51 | width: 360px; 52 | } 53 | 54 | .selector ul.selector-chooser { 55 | float: left; 56 | width: 22px; 57 | background-color: #eee; 58 | border-radius: 10px; 59 | margin: 10em 5px 0 5px; 60 | padding: 0; 61 | } 62 | 63 | .selector-chooser li { 64 | margin: 0; 65 | padding: 3px; 66 | list-style-type: none; 67 | } 68 | 69 | .selector select { 70 | margin-bottom: 10px; 71 | margin-top: 0; 72 | } 73 | 74 | .selector-add, .selector-remove { 75 | width: 16px; 76 | height: 16px; 77 | display: block; 78 | text-indent: -3000px; 79 | overflow: hidden; 80 | } 81 | 82 | .selector-add { 83 | background: url(../img/selector-icons.gif) 0 -161px no-repeat; 84 | cursor: default; 85 | margin-bottom: 2px; 86 | } 87 | 88 | .active.selector-add { 89 | background: url(../img/selector-icons.gif) 0 -187px no-repeat; 90 | cursor: pointer; 91 | } 92 | 93 | .selector-remove { 94 | background: url(../img/selector-icons.gif) 0 -109px no-repeat; 95 | cursor: default; 96 | } 97 | 98 | .active.selector-remove { 99 | background: url(../img/selector-icons.gif) 0 -135px no-repeat; 100 | cursor: pointer; 101 | } 102 | 103 | a.selector-chooseall, a.selector-clearall { 104 | display: inline-block; 105 | text-align: left; 106 | margin-left: auto; 107 | margin-right: auto; 108 | font-weight: bold; 109 | color: #666; 110 | } 111 | 112 | a.selector-chooseall { 113 | padding: 3px 18px 3px 0; 114 | } 115 | 116 | a.selector-clearall { 117 | padding: 3px 0 3px 18px; 118 | } 119 | 120 | a.active.selector-chooseall:hover, a.active.selector-clearall:hover { 121 | color: #036; 122 | } 123 | 124 | a.selector-chooseall { 125 | background: url(../img/selector-icons.gif) right -263px no-repeat; 126 | cursor: default; 127 | } 128 | 129 | a.active.selector-chooseall { 130 | background: url(../img/selector-icons.gif) right -289px no-repeat; 131 | cursor: pointer; 132 | } 133 | 134 | a.selector-clearall { 135 | background: url(../img/selector-icons.gif) left -211px no-repeat; 136 | cursor: default; 137 | } 138 | 139 | a.active.selector-clearall { 140 | background: url(../img/selector-icons.gif) left -237px no-repeat; 141 | cursor: pointer; 142 | } 143 | 144 | /* STACKED SELECTORS */ 145 | 146 | .stacked { 147 | float: left; 148 | width: 500px; 149 | } 150 | 151 | .stacked select { 152 | width: 480px; 153 | height: 10.1em; 154 | } 155 | 156 | .stacked .selector-available, .stacked .selector-chosen { 157 | width: 480px; 158 | } 159 | 160 | .stacked .selector-available { 161 | margin-bottom: 0; 162 | } 163 | 164 | .stacked .selector-available input { 165 | width: 442px; 166 | } 167 | 168 | .stacked ul.selector-chooser { 169 | height: 22px; 170 | width: 50px; 171 | margin: 0 0 3px 40%; 172 | background-color: #eee; 173 | border-radius: 10px; 174 | } 175 | 176 | .stacked .selector-chooser li { 177 | float: left; 178 | padding: 3px 3px 3px 5px; 179 | } 180 | 181 | .stacked .selector-chooseall, .stacked .selector-clearall { 182 | display: none; 183 | } 184 | 185 | .stacked .selector-add { 186 | background: url(../img/selector-icons.gif) 0 -57px no-repeat; 187 | cursor: default; 188 | } 189 | 190 | .stacked .active.selector-add { 191 | background: url(../img/selector-icons.gif) 0 -83px no-repeat; 192 | cursor: pointer; 193 | } 194 | 195 | .stacked .selector-remove { 196 | background: url(../img/selector-icons.gif) 0 -5px no-repeat; 197 | cursor: default; 198 | } 199 | 200 | .stacked .active.selector-remove { 201 | background: url(../img/selector-icons.gif) 0 -31px no-repeat; 202 | cursor: pointer; 203 | } 204 | 205 | /* DATE AND TIME */ 206 | 207 | p.datetime { 208 | line-height: 20px; 209 | margin: 0; 210 | padding: 0; 211 | color: #666; 212 | font-size: 11px; 213 | font-weight: bold; 214 | } 215 | 216 | .datetime span { 217 | font-size: 11px; 218 | color: #ccc; 219 | font-weight: normal; 220 | white-space: nowrap; 221 | } 222 | 223 | table p.datetime { 224 | font-size: 10px; 225 | margin-left: 0; 226 | padding-left: 0; 227 | } 228 | 229 | /* URL */ 230 | 231 | p.url { 232 | line-height: 20px; 233 | margin: 0; 234 | padding: 0; 235 | color: #666; 236 | font-size: 11px; 237 | font-weight: bold; 238 | } 239 | 240 | .url a { 241 | font-weight: normal; 242 | } 243 | 244 | /* FILE UPLOADS */ 245 | 246 | p.file-upload { 247 | line-height: 20px; 248 | margin: 0; 249 | padding: 0; 250 | color: #666; 251 | font-size: 11px; 252 | font-weight: bold; 253 | } 254 | 255 | .file-upload a { 256 | font-weight: normal; 257 | } 258 | 259 | .file-upload .deletelink { 260 | margin-left: 5px; 261 | } 262 | 263 | span.clearable-file-input label { 264 | color: #333; 265 | font-size: 11px; 266 | display: inline; 267 | float: none; 268 | } 269 | 270 | /* CALENDARS & CLOCKS */ 271 | 272 | .calendarbox, .clockbox { 273 | margin: 5px auto; 274 | font-size: 11px; 275 | width: 16em; 276 | text-align: center; 277 | background: white; 278 | position: relative; 279 | } 280 | 281 | .clockbox { 282 | width: auto; 283 | } 284 | 285 | .calendar { 286 | margin: 0; 287 | padding: 0; 288 | } 289 | 290 | .calendar table { 291 | margin: 0; 292 | padding: 0; 293 | border-collapse: collapse; 294 | background: white; 295 | width: 100%; 296 | } 297 | 298 | .calendar caption, .calendarbox h2 { 299 | margin: 0; 300 | font-size: 11px; 301 | text-align: center; 302 | border-top: none; 303 | } 304 | 305 | .calendar th { 306 | font-size: 10px; 307 | color: #666; 308 | padding: 2px 3px; 309 | text-align: center; 310 | background: #e1e1e1 url(../img/nav-bg.gif) 0 50% repeat-x; 311 | border-bottom: 1px solid #ddd; 312 | } 313 | 314 | .calendar td { 315 | font-size: 11px; 316 | text-align: center; 317 | padding: 0; 318 | border-top: 1px solid #eee; 319 | border-bottom: none; 320 | } 321 | 322 | .calendar td.selected a { 323 | background: #C9DBED; 324 | } 325 | 326 | .calendar td.nonday { 327 | background: #efefef; 328 | } 329 | 330 | .calendar td.today a { 331 | background: #ffc; 332 | } 333 | 334 | .calendar td a, .timelist a { 335 | display: block; 336 | font-weight: bold; 337 | padding: 4px; 338 | text-decoration: none; 339 | color: #444; 340 | } 341 | 342 | .calendar td a:hover, .timelist a:hover { 343 | background: #5b80b2; 344 | color: white; 345 | } 346 | 347 | .calendar td a:active, .timelist a:active { 348 | background: #036; 349 | color: white; 350 | } 351 | 352 | .calendarnav { 353 | font-size: 10px; 354 | text-align: center; 355 | color: #ccc; 356 | margin: 0; 357 | padding: 1px 3px; 358 | } 359 | 360 | .calendarnav a:link, #calendarnav a:visited, #calendarnav a:hover { 361 | color: #999; 362 | } 363 | 364 | .calendar-shortcuts { 365 | background: white; 366 | font-size: 10px; 367 | line-height: 11px; 368 | border-top: 1px solid #eee; 369 | padding: 3px 0 4px; 370 | color: #ccc; 371 | } 372 | 373 | .calendarbox .calendarnav-previous, .calendarbox .calendarnav-next { 374 | display: block; 375 | position: absolute; 376 | font-weight: bold; 377 | font-size: 12px; 378 | background: #C9DBED url(../img/default-bg.gif) bottom left repeat-x; 379 | padding: 1px 4px 2px 4px; 380 | color: white; 381 | } 382 | 383 | .calendarnav-previous:hover, .calendarnav-next:hover { 384 | background: #036; 385 | } 386 | 387 | .calendarnav-previous { 388 | top: 0; 389 | left: 0; 390 | } 391 | 392 | .calendarnav-next { 393 | top: 0; 394 | right: 0; 395 | } 396 | 397 | .calendar-cancel { 398 | margin: 0 !important; 399 | padding: 0 !important; 400 | font-size: 10px; 401 | background: #e1e1e1 url(../img/nav-bg.gif) 0 50% repeat-x; 402 | border-top: 1px solid #ddd; 403 | } 404 | 405 | .calendar-cancel:hover { 406 | background: #e1e1e1 url(../img/nav-bg-reverse.gif) 0 50% repeat-x; 407 | } 408 | 409 | .calendar-cancel a { 410 | color: black; 411 | display: block; 412 | } 413 | 414 | ul.timelist, .timelist li { 415 | list-style-type: none; 416 | margin: 0; 417 | padding: 0; 418 | } 419 | 420 | .timelist a { 421 | padding: 2px; 422 | } 423 | 424 | /* INLINE ORDERER */ 425 | 426 | ul.orderer { 427 | position: relative; 428 | padding: 0 !important; 429 | margin: 0 !important; 430 | list-style-type: none; 431 | } 432 | 433 | ul.orderer li { 434 | list-style-type: none; 435 | display: block; 436 | padding: 0; 437 | margin: 0; 438 | border: 1px solid #bbb; 439 | border-width: 0 1px 1px 0; 440 | white-space: nowrap; 441 | overflow: hidden; 442 | background: #e2e2e2 url(../img/nav-bg-grabber.gif) repeat-y; 443 | } 444 | 445 | ul.orderer li:hover { 446 | cursor: move; 447 | background-color: #ddd; 448 | } 449 | 450 | ul.orderer li a.selector { 451 | margin-left: 12px; 452 | overflow: hidden; 453 | width: 83%; 454 | font-size: 10px !important; 455 | padding: 0.6em 0; 456 | } 457 | 458 | ul.orderer li a:link, ul.orderer li a:visited { 459 | color: #333; 460 | } 461 | 462 | ul.orderer li .inline-deletelink { 463 | position: absolute; 464 | right: 4px; 465 | margin-top: 0.6em; 466 | } 467 | 468 | ul.orderer li.selected { 469 | background-color: #f8f8f8; 470 | border-right-color: #f8f8f8; 471 | } 472 | 473 | ul.orderer li.deleted { 474 | background: #bbb url(../img/deleted-overlay.gif); 475 | } 476 | 477 | ul.orderer li.deleted a:link, ul.orderer li.deleted a:visited { 478 | color: #888; 479 | } 480 | 481 | ul.orderer li.deleted .inline-deletelink { 482 | background-image: url(../img/inline-restore.png); 483 | } 484 | 485 | ul.orderer li.deleted:hover, ul.orderer li.deleted a.selector:hover { 486 | cursor: default; 487 | } 488 | 489 | /* EDIT INLINE */ 490 | 491 | .inline-deletelink { 492 | float: right; 493 | text-indent: -9999px; 494 | background: transparent url(../img/inline-delete.png) no-repeat; 495 | width: 15px; 496 | height: 15px; 497 | border: 0px none; 498 | outline: 0; /* Remove dotted border around link */ 499 | } 500 | 501 | .inline-deletelink:hover { 502 | background-position: -15px 0; 503 | cursor: pointer; 504 | } 505 | 506 | .editinline button.addlink { 507 | border: 0px none; 508 | color: #5b80b2; 509 | font-size: 100%; 510 | cursor: pointer; 511 | } 512 | 513 | .editinline button.addlink:hover { 514 | color: #036; 515 | cursor: pointer; 516 | } 517 | 518 | .editinline table .help { 519 | text-align: right; 520 | float: right; 521 | padding-left: 2em; 522 | } 523 | 524 | .editinline tfoot .addlink { 525 | white-space: nowrap; 526 | } 527 | 528 | .editinline table thead th:last-child { 529 | border-left: none; 530 | } 531 | 532 | .editinline tr.deleted { 533 | background: #ddd url(../img/deleted-overlay.gif); 534 | } 535 | 536 | .editinline tr.deleted .inline-deletelink { 537 | background-image: url(../img/inline-restore.png); 538 | } 539 | 540 | .editinline tr.deleted td:hover { 541 | cursor: default; 542 | } 543 | 544 | .editinline tr.deleted td:first-child { 545 | background-image: none !important; 546 | } 547 | 548 | /* EDIT INLINE - STACKED */ 549 | 550 | .editinline-stacked { 551 | min-width: 758px; 552 | } 553 | 554 | .editinline-stacked .inline-object { 555 | margin-left: 210px; 556 | background: white; 557 | } 558 | 559 | .editinline-stacked .inline-source { 560 | float: left; 561 | width: 200px; 562 | background: #f8f8f8; 563 | } 564 | 565 | .editinline-stacked .inline-splitter { 566 | float: left; 567 | width: 9px; 568 | background: #f8f8f8 url(../img/inline-splitter-bg.gif) 50% 50% no-repeat; 569 | border-right: 1px solid #ccc; 570 | } 571 | 572 | .editinline-stacked .controls { 573 | clear: both; 574 | background: #e1e1e1 url(../img/nav-bg.gif) top left repeat-x; 575 | padding: 3px 4px; 576 | font-size: 11px; 577 | border-top: 1px solid #ddd; 578 | } 579 | 580 | /* RELATED WIDGET WRAPPER */ 581 | 582 | .related-widget-wrapper-link { 583 | opacity: 0.3; 584 | } 585 | 586 | .related-widget-wrapper-link:link { 587 | opacity: 1; 588 | } 589 | -------------------------------------------------------------------------------- /nx2django/static/admin/img/changelist-bg.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phodal/django-elasticsearch/a80f5067fc8f57edf64da809471315a53c5942c7/nx2django/static/admin/img/changelist-bg.gif -------------------------------------------------------------------------------- /nx2django/static/admin/img/changelist-bg_rtl.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phodal/django-elasticsearch/a80f5067fc8f57edf64da809471315a53c5942c7/nx2django/static/admin/img/changelist-bg_rtl.gif -------------------------------------------------------------------------------- /nx2django/static/admin/img/default-bg-reverse.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phodal/django-elasticsearch/a80f5067fc8f57edf64da809471315a53c5942c7/nx2django/static/admin/img/default-bg-reverse.gif -------------------------------------------------------------------------------- /nx2django/static/admin/img/default-bg.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phodal/django-elasticsearch/a80f5067fc8f57edf64da809471315a53c5942c7/nx2django/static/admin/img/default-bg.gif -------------------------------------------------------------------------------- /nx2django/static/admin/img/deleted-overlay.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phodal/django-elasticsearch/a80f5067fc8f57edf64da809471315a53c5942c7/nx2django/static/admin/img/deleted-overlay.gif -------------------------------------------------------------------------------- /nx2django/static/admin/img/gis/move_vertex_off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phodal/django-elasticsearch/a80f5067fc8f57edf64da809471315a53c5942c7/nx2django/static/admin/img/gis/move_vertex_off.png -------------------------------------------------------------------------------- /nx2django/static/admin/img/gis/move_vertex_on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phodal/django-elasticsearch/a80f5067fc8f57edf64da809471315a53c5942c7/nx2django/static/admin/img/gis/move_vertex_on.png -------------------------------------------------------------------------------- /nx2django/static/admin/img/icon-no.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phodal/django-elasticsearch/a80f5067fc8f57edf64da809471315a53c5942c7/nx2django/static/admin/img/icon-no.gif -------------------------------------------------------------------------------- /nx2django/static/admin/img/icon-unknown.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phodal/django-elasticsearch/a80f5067fc8f57edf64da809471315a53c5942c7/nx2django/static/admin/img/icon-unknown.gif -------------------------------------------------------------------------------- /nx2django/static/admin/img/icon-yes.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phodal/django-elasticsearch/a80f5067fc8f57edf64da809471315a53c5942c7/nx2django/static/admin/img/icon-yes.gif -------------------------------------------------------------------------------- /nx2django/static/admin/img/icon_addlink.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phodal/django-elasticsearch/a80f5067fc8f57edf64da809471315a53c5942c7/nx2django/static/admin/img/icon_addlink.gif -------------------------------------------------------------------------------- /nx2django/static/admin/img/icon_alert.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phodal/django-elasticsearch/a80f5067fc8f57edf64da809471315a53c5942c7/nx2django/static/admin/img/icon_alert.gif -------------------------------------------------------------------------------- /nx2django/static/admin/img/icon_calendar.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phodal/django-elasticsearch/a80f5067fc8f57edf64da809471315a53c5942c7/nx2django/static/admin/img/icon_calendar.gif -------------------------------------------------------------------------------- /nx2django/static/admin/img/icon_changelink.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phodal/django-elasticsearch/a80f5067fc8f57edf64da809471315a53c5942c7/nx2django/static/admin/img/icon_changelink.gif -------------------------------------------------------------------------------- /nx2django/static/admin/img/icon_clock.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phodal/django-elasticsearch/a80f5067fc8f57edf64da809471315a53c5942c7/nx2django/static/admin/img/icon_clock.gif -------------------------------------------------------------------------------- /nx2django/static/admin/img/icon_deletelink.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phodal/django-elasticsearch/a80f5067fc8f57edf64da809471315a53c5942c7/nx2django/static/admin/img/icon_deletelink.gif -------------------------------------------------------------------------------- /nx2django/static/admin/img/icon_error.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phodal/django-elasticsearch/a80f5067fc8f57edf64da809471315a53c5942c7/nx2django/static/admin/img/icon_error.gif -------------------------------------------------------------------------------- /nx2django/static/admin/img/icon_searchbox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phodal/django-elasticsearch/a80f5067fc8f57edf64da809471315a53c5942c7/nx2django/static/admin/img/icon_searchbox.png -------------------------------------------------------------------------------- /nx2django/static/admin/img/icon_success.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phodal/django-elasticsearch/a80f5067fc8f57edf64da809471315a53c5942c7/nx2django/static/admin/img/icon_success.gif -------------------------------------------------------------------------------- /nx2django/static/admin/img/inline-delete-8bit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phodal/django-elasticsearch/a80f5067fc8f57edf64da809471315a53c5942c7/nx2django/static/admin/img/inline-delete-8bit.png -------------------------------------------------------------------------------- /nx2django/static/admin/img/inline-delete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phodal/django-elasticsearch/a80f5067fc8f57edf64da809471315a53c5942c7/nx2django/static/admin/img/inline-delete.png -------------------------------------------------------------------------------- /nx2django/static/admin/img/inline-restore-8bit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phodal/django-elasticsearch/a80f5067fc8f57edf64da809471315a53c5942c7/nx2django/static/admin/img/inline-restore-8bit.png -------------------------------------------------------------------------------- /nx2django/static/admin/img/inline-restore.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phodal/django-elasticsearch/a80f5067fc8f57edf64da809471315a53c5942c7/nx2django/static/admin/img/inline-restore.png -------------------------------------------------------------------------------- /nx2django/static/admin/img/inline-splitter-bg.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phodal/django-elasticsearch/a80f5067fc8f57edf64da809471315a53c5942c7/nx2django/static/admin/img/inline-splitter-bg.gif -------------------------------------------------------------------------------- /nx2django/static/admin/img/nav-bg-grabber.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phodal/django-elasticsearch/a80f5067fc8f57edf64da809471315a53c5942c7/nx2django/static/admin/img/nav-bg-grabber.gif -------------------------------------------------------------------------------- /nx2django/static/admin/img/nav-bg-reverse.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phodal/django-elasticsearch/a80f5067fc8f57edf64da809471315a53c5942c7/nx2django/static/admin/img/nav-bg-reverse.gif -------------------------------------------------------------------------------- /nx2django/static/admin/img/nav-bg-selected.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phodal/django-elasticsearch/a80f5067fc8f57edf64da809471315a53c5942c7/nx2django/static/admin/img/nav-bg-selected.gif -------------------------------------------------------------------------------- /nx2django/static/admin/img/nav-bg.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phodal/django-elasticsearch/a80f5067fc8f57edf64da809471315a53c5942c7/nx2django/static/admin/img/nav-bg.gif -------------------------------------------------------------------------------- /nx2django/static/admin/img/selector-icons.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phodal/django-elasticsearch/a80f5067fc8f57edf64da809471315a53c5942c7/nx2django/static/admin/img/selector-icons.gif -------------------------------------------------------------------------------- /nx2django/static/admin/img/selector-search.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phodal/django-elasticsearch/a80f5067fc8f57edf64da809471315a53c5942c7/nx2django/static/admin/img/selector-search.gif -------------------------------------------------------------------------------- /nx2django/static/admin/img/sorting-icons.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phodal/django-elasticsearch/a80f5067fc8f57edf64da809471315a53c5942c7/nx2django/static/admin/img/sorting-icons.gif -------------------------------------------------------------------------------- /nx2django/static/admin/img/tooltag-add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phodal/django-elasticsearch/a80f5067fc8f57edf64da809471315a53c5942c7/nx2django/static/admin/img/tooltag-add.png -------------------------------------------------------------------------------- /nx2django/static/admin/img/tooltag-arrowright.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phodal/django-elasticsearch/a80f5067fc8f57edf64da809471315a53c5942c7/nx2django/static/admin/img/tooltag-arrowright.png -------------------------------------------------------------------------------- /nx2django/static/admin/js/LICENSE-JQUERY.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2010 John Resig, http://jquery.com/ 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /nx2django/static/admin/js/SelectBox.js: -------------------------------------------------------------------------------- 1 | var SelectBox = { 2 | cache: new Object(), 3 | init: function(id) { 4 | var box = document.getElementById(id); 5 | var node; 6 | SelectBox.cache[id] = new Array(); 7 | var cache = SelectBox.cache[id]; 8 | for (var i = 0; (node = box.options[i]); i++) { 9 | cache.push({value: node.value, text: node.text, displayed: 1}); 10 | } 11 | }, 12 | redisplay: function(id) { 13 | // Repopulate HTML select box from cache 14 | var box = document.getElementById(id); 15 | box.options.length = 0; // clear all options 16 | for (var i = 0, j = SelectBox.cache[id].length; i < j; i++) { 17 | var node = SelectBox.cache[id][i]; 18 | if (node.displayed) { 19 | var new_option = new Option(node.text, node.value, false, false); 20 | // Shows a tooltip when hovering over the option 21 | new_option.setAttribute("title", node.text); 22 | box.options[box.options.length] = new_option; 23 | } 24 | } 25 | }, 26 | filter: function(id, text) { 27 | // Redisplay the HTML select box, displaying only the choices containing ALL 28 | // the words in text. (It's an AND search.) 29 | var tokens = text.toLowerCase().split(/\s+/); 30 | var node, token; 31 | for (var i = 0; (node = SelectBox.cache[id][i]); i++) { 32 | node.displayed = 1; 33 | for (var j = 0; (token = tokens[j]); j++) { 34 | if (node.text.toLowerCase().indexOf(token) == -1) { 35 | node.displayed = 0; 36 | } 37 | } 38 | } 39 | SelectBox.redisplay(id); 40 | }, 41 | delete_from_cache: function(id, value) { 42 | var node, delete_index = null; 43 | for (var i = 0; (node = SelectBox.cache[id][i]); i++) { 44 | if (node.value == value) { 45 | delete_index = i; 46 | break; 47 | } 48 | } 49 | var j = SelectBox.cache[id].length - 1; 50 | for (var i = delete_index; i < j; i++) { 51 | SelectBox.cache[id][i] = SelectBox.cache[id][i+1]; 52 | } 53 | SelectBox.cache[id].length--; 54 | }, 55 | add_to_cache: function(id, option) { 56 | SelectBox.cache[id].push({value: option.value, text: option.text, displayed: 1}); 57 | }, 58 | cache_contains: function(id, value) { 59 | // Check if an item is contained in the cache 60 | var node; 61 | for (var i = 0; (node = SelectBox.cache[id][i]); i++) { 62 | if (node.value == value) { 63 | return true; 64 | } 65 | } 66 | return false; 67 | }, 68 | move: function(from, to) { 69 | var from_box = document.getElementById(from); 70 | var to_box = document.getElementById(to); 71 | var option; 72 | for (var i = 0; (option = from_box.options[i]); i++) { 73 | if (option.selected && SelectBox.cache_contains(from, option.value)) { 74 | SelectBox.add_to_cache(to, {value: option.value, text: option.text, displayed: 1}); 75 | SelectBox.delete_from_cache(from, option.value); 76 | } 77 | } 78 | SelectBox.redisplay(from); 79 | SelectBox.redisplay(to); 80 | }, 81 | move_all: function(from, to) { 82 | var from_box = document.getElementById(from); 83 | var to_box = document.getElementById(to); 84 | var option; 85 | for (var i = 0; (option = from_box.options[i]); i++) { 86 | if (SelectBox.cache_contains(from, option.value)) { 87 | SelectBox.add_to_cache(to, {value: option.value, text: option.text, displayed: 1}); 88 | SelectBox.delete_from_cache(from, option.value); 89 | } 90 | } 91 | SelectBox.redisplay(from); 92 | SelectBox.redisplay(to); 93 | }, 94 | sort: function(id) { 95 | SelectBox.cache[id].sort( function(a, b) { 96 | a = a.text.toLowerCase(); 97 | b = b.text.toLowerCase(); 98 | try { 99 | if (a > b) return 1; 100 | if (a < b) return -1; 101 | } 102 | catch (e) { 103 | // silently fail on IE 'unknown' exception 104 | } 105 | return 0; 106 | } ); 107 | }, 108 | select_all: function(id) { 109 | var box = document.getElementById(id); 110 | for (var i = 0; i < box.options.length; i++) { 111 | box.options[i].selected = 'selected'; 112 | } 113 | } 114 | } 115 | -------------------------------------------------------------------------------- /nx2django/static/admin/js/SelectFilter2.js: -------------------------------------------------------------------------------- 1 | /* 2 | SelectFilter2 - Turns a multiple-select box into a filter interface. 3 | 4 | Requires core.js, SelectBox.js and addevent.js. 5 | */ 6 | (function($) { 7 | function findForm(node) { 8 | // returns the node of the form containing the given node 9 | if (node.tagName.toLowerCase() != 'form') { 10 | return findForm(node.parentNode); 11 | } 12 | return node; 13 | } 14 | 15 | window.SelectFilter = { 16 | init: function(field_id, field_name, is_stacked, admin_static_prefix) { 17 | if (field_id.match(/__prefix__/)){ 18 | // Don't initialize on empty forms. 19 | return; 20 | } 21 | var from_box = document.getElementById(field_id); 22 | from_box.id += '_from'; // change its ID 23 | from_box.className = 'filtered'; 24 | 25 | var ps = from_box.parentNode.getElementsByTagName('p'); 26 | for (var i=0; i, because it just gets in the way. 29 | from_box.parentNode.removeChild(ps[i]); 30 | } else if (ps[i].className.indexOf("help") != -1) { 31 | // Move help text up to the top so it isn't below the select 32 | // boxes or wrapped off on the side to the right of the add 33 | // button: 34 | from_box.parentNode.insertBefore(ps[i], from_box.parentNode.firstChild); 35 | } 36 | } 37 | 38 | //
or
39 | var selector_div = quickElement('div', from_box.parentNode); 40 | selector_div.className = is_stacked ? 'selector stacked' : 'selector'; 41 | 42 | //
43 | var selector_available = quickElement('div', selector_div); 44 | selector_available.className = 'selector-available'; 45 | var title_available = quickElement('h2', selector_available, interpolate(gettext('Available %s') + ' ', [field_name])); 46 | quickElement('img', title_available, '', 'src', admin_static_prefix + 'img/icon-unknown.gif', 'width', '10', 'height', '10', 'class', 'help help-tooltip', '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])); 47 | 48 | var filter_p = quickElement('p', selector_available, '', 'id', field_id + '_filter'); 49 | filter_p.className = 'selector-filter'; 50 | 51 | var search_filter_label = quickElement('label', filter_p, '', 'for', field_id + "_input"); 52 | 53 | var search_selector_img = quickElement('img', search_filter_label, '', 'src', admin_static_prefix + 'img/selector-search.gif', 'class', 'help-tooltip', 'alt', '', 'title', interpolate(gettext("Type into this box to filter down the list of available %s."), [field_name])); 54 | 55 | filter_p.appendChild(document.createTextNode(' ')); 56 | 57 | var filter_input = quickElement('input', filter_p, '', 'type', 'text', 'placeholder', gettext("Filter")); 58 | filter_input.id = field_id + '_input'; 59 | 60 | selector_available.appendChild(from_box); 61 | var choose_all = quickElement('a', selector_available, gettext('Choose all'), 'title', interpolate(gettext('Click to choose all %s at once.'), [field_name]), 'href', 'javascript: (function(){ SelectBox.move_all("' + field_id + '_from", "' + field_id + '_to"); SelectFilter.refresh_icons("' + field_id + '");})()', 'id', field_id + '_add_all_link'); 62 | choose_all.className = 'selector-chooseall'; 63 | 64 | //
    65 | var selector_chooser = quickElement('ul', selector_div); 66 | selector_chooser.className = 'selector-chooser'; 67 | var add_link = quickElement('a', quickElement('li', selector_chooser), gettext('Choose'), 'title', gettext('Choose'), 'href', 'javascript: (function(){ SelectBox.move("' + field_id + '_from","' + field_id + '_to"); SelectFilter.refresh_icons("' + field_id + '");})()', 'id', field_id + '_add_link'); 68 | add_link.className = 'selector-add'; 69 | var remove_link = quickElement('a', quickElement('li', selector_chooser), gettext('Remove'), 'title', gettext('Remove'), 'href', 'javascript: (function(){ SelectBox.move("' + field_id + '_to","' + field_id + '_from"); SelectFilter.refresh_icons("' + field_id + '");})()', 'id', field_id + '_remove_link'); 70 | remove_link.className = 'selector-remove'; 71 | 72 | //
    73 | var selector_chosen = quickElement('div', selector_div); 74 | selector_chosen.className = 'selector-chosen'; 75 | var title_chosen = quickElement('h2', selector_chosen, interpolate(gettext('Chosen %s') + ' ', [field_name])); 76 | quickElement('img', title_chosen, '', 'src', admin_static_prefix + 'img/icon-unknown.gif', 'width', '10', 'height', '10', 'class', 'help help-tooltip', '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])); 77 | 78 | var to_box = quickElement('select', selector_chosen, '', 'id', field_id + '_to', 'multiple', 'multiple', 'size', from_box.size, 'name', from_box.getAttribute('name')); 79 | to_box.className = 'filtered'; 80 | var clear_all = quickElement('a', selector_chosen, gettext('Remove all'), 'title', interpolate(gettext('Click to remove all chosen %s at once.'), [field_name]), 'href', 'javascript: (function() { SelectBox.move_all("' + field_id + '_to", "' + field_id + '_from"); SelectFilter.refresh_icons("' + field_id + '");})()', 'id', field_id + '_remove_all_link'); 81 | clear_all.className = 'selector-clearall'; 82 | 83 | from_box.setAttribute('name', from_box.getAttribute('name') + '_old'); 84 | 85 | // Set up the JavaScript event handlers for the select box filter interface 86 | addEvent(filter_input, 'keypress', function(e) { SelectFilter.filter_key_press(e, field_id); }); 87 | addEvent(filter_input, 'keyup', function(e) { SelectFilter.filter_key_up(e, field_id); }); 88 | addEvent(filter_input, 'keydown', function(e) { SelectFilter.filter_key_down(e, field_id); }); 89 | addEvent(from_box, 'change', function(e) { SelectFilter.refresh_icons(field_id) }); 90 | addEvent(to_box, 'change', function(e) { SelectFilter.refresh_icons(field_id) }); 91 | addEvent(from_box, 'dblclick', function() { SelectBox.move(field_id + '_from', field_id + '_to'); SelectFilter.refresh_icons(field_id); }); 92 | addEvent(to_box, 'dblclick', function() { SelectBox.move(field_id + '_to', field_id + '_from'); SelectFilter.refresh_icons(field_id); }); 93 | addEvent(findForm(from_box), 'submit', function() { SelectBox.select_all(field_id + '_to'); }); 94 | SelectBox.init(field_id + '_from'); 95 | SelectBox.init(field_id + '_to'); 96 | // Move selected from_box options to to_box 97 | SelectBox.move(field_id + '_from', field_id + '_to'); 98 | 99 | if (!is_stacked) { 100 | // In horizontal mode, give the same height to the two boxes. 101 | var j_from_box = $(from_box); 102 | var j_to_box = $(to_box); 103 | var resize_filters = function() { j_to_box.height($(filter_p).outerHeight() + j_from_box.outerHeight()); } 104 | if (j_from_box.outerHeight() > 0) { 105 | resize_filters(); // This fieldset is already open. Resize now. 106 | } else { 107 | // This fieldset is probably collapsed. Wait for its 'show' event. 108 | j_to_box.closest('fieldset').one('show.fieldset', resize_filters); 109 | } 110 | } 111 | 112 | // Initial icon refresh 113 | SelectFilter.refresh_icons(field_id); 114 | }, 115 | refresh_icons: function(field_id) { 116 | var from = $('#' + field_id + '_from'); 117 | var to = $('#' + field_id + '_to'); 118 | var is_from_selected = from.find('option:selected').length > 0; 119 | var is_to_selected = to.find('option:selected').length > 0; 120 | // Active if at least one item is selected 121 | $('#' + field_id + '_add_link').toggleClass('active', is_from_selected); 122 | $('#' + field_id + '_remove_link').toggleClass('active', is_to_selected); 123 | // Active if the corresponding box isn't empty 124 | $('#' + field_id + '_add_all_link').toggleClass('active', from.find('option').length > 0); 125 | $('#' + field_id + '_remove_all_link').toggleClass('active', to.find('option').length > 0); 126 | }, 127 | filter_key_press: function(event, field_id) { 128 | var from = document.getElementById(field_id + '_from'); 129 | // don't submit form if user pressed Enter 130 | if ((event.which && event.which == 13) || (event.keyCode && event.keyCode == 13)) { 131 | from.selectedIndex = 0; 132 | SelectBox.move(field_id + '_from', field_id + '_to'); 133 | from.selectedIndex = 0; 134 | event.preventDefault() 135 | return false; 136 | } 137 | }, 138 | filter_key_up: function(event, field_id) { 139 | var from = document.getElementById(field_id + '_from'); 140 | var temp = from.selectedIndex; 141 | SelectBox.filter(field_id + '_from', document.getElementById(field_id + '_input').value); 142 | from.selectedIndex = temp; 143 | return true; 144 | }, 145 | filter_key_down: function(event, field_id) { 146 | var from = document.getElementById(field_id + '_from'); 147 | // right arrow -- move across 148 | if ((event.which && event.which == 39) || (event.keyCode && event.keyCode == 39)) { 149 | var old_index = from.selectedIndex; 150 | SelectBox.move(field_id + '_from', field_id + '_to'); 151 | from.selectedIndex = (old_index == from.length) ? from.length - 1 : old_index; 152 | return false; 153 | } 154 | // down arrow -- wrap around 155 | if ((event.which && event.which == 40) || (event.keyCode && event.keyCode == 40)) { 156 | from.selectedIndex = (from.length == from.selectedIndex + 1) ? 0 : from.selectedIndex + 1; 157 | } 158 | // up arrow -- wrap around 159 | if ((event.which && event.which == 38) || (event.keyCode && event.keyCode == 38)) { 160 | from.selectedIndex = (from.selectedIndex == 0) ? from.length - 1 : from.selectedIndex - 1; 161 | } 162 | return true; 163 | } 164 | } 165 | 166 | })(django.jQuery); 167 | -------------------------------------------------------------------------------- /nx2django/static/admin/js/actions.js: -------------------------------------------------------------------------------- 1 | (function($) { 2 | var lastChecked; 3 | 4 | $.fn.actions = function(opts) { 5 | var options = $.extend({}, $.fn.actions.defaults, opts); 6 | var actionCheckboxes = $(this); 7 | var list_editable_changed = false; 8 | var checker = function(checked) { 9 | if (checked) { 10 | showQuestion(); 11 | } else { 12 | reset(); 13 | } 14 | $(actionCheckboxes).prop("checked", checked) 15 | .parent().parent().toggleClass(options.selectedClass, checked); 16 | }, 17 | updateCounter = function() { 18 | var sel = $(actionCheckboxes).filter(":checked").length; 19 | // _actions_icnt is defined in the generated HTML 20 | // and contains the total amount of objects in the queryset 21 | $(options.counterContainer).html(interpolate( 22 | ngettext('%(sel)s of %(cnt)s selected', '%(sel)s of %(cnt)s selected', sel), { 23 | sel: sel, 24 | cnt: _actions_icnt 25 | }, true)); 26 | $(options.allToggle).prop("checked", function() { 27 | var value; 28 | if (sel == actionCheckboxes.length) { 29 | value = true; 30 | showQuestion(); 31 | } else { 32 | value = false; 33 | clearAcross(); 34 | } 35 | return value; 36 | }); 37 | }, 38 | showQuestion = function() { 39 | $(options.acrossClears).hide(); 40 | $(options.acrossQuestions).show(); 41 | $(options.allContainer).hide(); 42 | }, 43 | showClear = function() { 44 | $(options.acrossClears).show(); 45 | $(options.acrossQuestions).hide(); 46 | $(options.actionContainer).toggleClass(options.selectedClass); 47 | $(options.allContainer).show(); 48 | $(options.counterContainer).hide(); 49 | }, 50 | reset = function() { 51 | $(options.acrossClears).hide(); 52 | $(options.acrossQuestions).hide(); 53 | $(options.allContainer).hide(); 54 | $(options.counterContainer).show(); 55 | }, 56 | clearAcross = function() { 57 | reset(); 58 | $(options.acrossInput).val(0); 59 | $(options.actionContainer).removeClass(options.selectedClass); 60 | }; 61 | // Show counter by default 62 | $(options.counterContainer).show(); 63 | // Check state of checkboxes and reinit state if needed 64 | $(this).filter(":checked").each(function(i) { 65 | $(this).parent().parent().toggleClass(options.selectedClass); 66 | updateCounter(); 67 | if ($(options.acrossInput).val() == 1) { 68 | showClear(); 69 | } 70 | }); 71 | $(options.allToggle).show().click(function() { 72 | checker($(this).prop("checked")); 73 | updateCounter(); 74 | }); 75 | $("a", options.acrossQuestions).click(function(event) { 76 | event.preventDefault(); 77 | $(options.acrossInput).val(1); 78 | showClear(); 79 | }); 80 | $("a", options.acrossClears).click(function(event) { 81 | event.preventDefault(); 82 | $(options.allToggle).prop("checked", false); 83 | clearAcross(); 84 | checker(0); 85 | updateCounter(); 86 | }); 87 | lastChecked = null; 88 | $(actionCheckboxes).click(function(event) { 89 | if (!event) { event = window.event; } 90 | var target = event.target ? event.target : event.srcElement; 91 | if (lastChecked && $.data(lastChecked) != $.data(target) && event.shiftKey === true) { 92 | var inrange = false; 93 | $(lastChecked).prop("checked", target.checked) 94 | .parent().parent().toggleClass(options.selectedClass, target.checked); 95 | $(actionCheckboxes).each(function() { 96 | if ($.data(this) == $.data(lastChecked) || $.data(this) == $.data(target)) { 97 | inrange = (inrange) ? false : true; 98 | } 99 | if (inrange) { 100 | $(this).prop("checked", target.checked) 101 | .parent().parent().toggleClass(options.selectedClass, target.checked); 102 | } 103 | }); 104 | } 105 | $(target).parent().parent().toggleClass(options.selectedClass, target.checked); 106 | lastChecked = target; 107 | updateCounter(); 108 | }); 109 | $('form#changelist-form table#result_list tr').find('td:gt(0) :input').change(function() { 110 | list_editable_changed = true; 111 | }); 112 | $('form#changelist-form button[name="index"]').click(function(event) { 113 | if (list_editable_changed) { 114 | return confirm(gettext("You have unsaved changes on individual editable fields. If you run an action, your unsaved changes will be lost.")); 115 | } 116 | }); 117 | $('form#changelist-form input[name="_save"]').click(function(event) { 118 | var action_changed = false; 119 | $('select option:selected', options.actionContainer).each(function() { 120 | if ($(this).val()) { 121 | action_changed = true; 122 | } 123 | }); 124 | if (action_changed) { 125 | if (list_editable_changed) { 126 | 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.")); 127 | } else { 128 | 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.")); 129 | } 130 | } 131 | }); 132 | }; 133 | /* Setup plugin defaults */ 134 | $.fn.actions.defaults = { 135 | actionContainer: "div.actions", 136 | counterContainer: "span.action-counter", 137 | allContainer: "div.actions span.all", 138 | acrossInput: "div.actions input.select-across", 139 | acrossQuestions: "div.actions span.question", 140 | acrossClears: "div.actions span.clear", 141 | allToggle: "#action-toggle", 142 | selectedClass: "selected" 143 | }; 144 | })(django.jQuery); 145 | -------------------------------------------------------------------------------- /nx2django/static/admin/js/actions.min.js: -------------------------------------------------------------------------------- 1 | (function(a){var f;a.fn.actions=function(q){var b=a.extend({},a.fn.actions.defaults,q),g=a(this),e=!1,m=function(c){c?k():l();a(g).prop("checked",c).parent().parent().toggleClass(b.selectedClass,c)},h=function(){var c=a(g).filter(":checked").length;a(b.counterContainer).html(interpolate(ngettext("%(sel)s of %(cnt)s selected","%(sel)s of %(cnt)s selected",c),{sel:c,cnt:_actions_icnt},!0));a(b.allToggle).prop("checked",function(){var a;c==g.length?(a=!0,k()):(a=!1,n());return a})},k=function(){a(b.acrossClears).hide(); 2 | a(b.acrossQuestions).show();a(b.allContainer).hide()},p=function(){a(b.acrossClears).show();a(b.acrossQuestions).hide();a(b.actionContainer).toggleClass(b.selectedClass);a(b.allContainer).show();a(b.counterContainer).hide()},l=function(){a(b.acrossClears).hide();a(b.acrossQuestions).hide();a(b.allContainer).hide();a(b.counterContainer).show()},n=function(){l();a(b.acrossInput).val(0);a(b.actionContainer).removeClass(b.selectedClass)};a(b.counterContainer).show();a(this).filter(":checked").each(function(c){a(this).parent().parent().toggleClass(b.selectedClass); 3 | h();1==a(b.acrossInput).val()&&p()});a(b.allToggle).show().click(function(){m(a(this).prop("checked"));h()});a("a",b.acrossQuestions).click(function(c){c.preventDefault();a(b.acrossInput).val(1);p()});a("a",b.acrossClears).click(function(c){c.preventDefault();a(b.allToggle).prop("checked",!1);n();m(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, 4 | 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(){e=!0});a('form#changelist-form button[name="index"]').click(function(a){if(e)return confirm(gettext("You have unsaved changes on individual editable fields. If you run an action, your unsaved changes will be lost."))}); 5 | 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 e?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."))})}; 6 | a.fn.actions.defaults={actionContainer:"div.actions",counterContainer:"span.action-counter",allContainer:"div.actions span.all",acrossInput:"div.actions input.select-across",acrossQuestions:"div.actions span.question",acrossClears:"div.actions span.clear",allToggle:"#action-toggle",selectedClass:"selected"}})(django.jQuery); 7 | -------------------------------------------------------------------------------- /nx2django/static/admin/js/admin/DateTimeShortcuts.js: -------------------------------------------------------------------------------- 1 | // Inserts shortcut buttons after all of the following: 2 | // 3 | // 4 | 5 | var DateTimeShortcuts = { 6 | calendars: [], 7 | calendarInputs: [], 8 | clockInputs: [], 9 | dismissClockFunc: [], 10 | dismissCalendarFunc: [], 11 | calendarDivName1: 'calendarbox', // name of calendar
    that gets toggled 12 | calendarDivName2: 'calendarin', // name of
    that contains calendar 13 | calendarLinkName: 'calendarlink',// name of the link that is used to toggle 14 | clockDivName: 'clockbox', // name of clock
    that gets toggled 15 | clockLinkName: 'clocklink', // name of the link that is used to toggle 16 | shortCutsClass: 'datetimeshortcuts', // class of the clock and cal shortcuts 17 | timezoneWarningClass: 'timezonewarning', // class of the warning for timezone mismatch 18 | timezoneOffset: 0, 19 | admin_media_prefix: '', 20 | init: function() { 21 | // Get admin_media_prefix by grabbing it off the window object. It's 22 | // set in the admin/base.html template, so if it's not there, someone's 23 | // overridden the template. In that case, we'll set a clearly-invalid 24 | // value in the hopes that someone will examine HTTP requests and see it. 25 | if (window.__admin_media_prefix__ != undefined) { 26 | DateTimeShortcuts.admin_media_prefix = window.__admin_media_prefix__; 27 | } else { 28 | DateTimeShortcuts.admin_media_prefix = '/missing-admin-media-prefix/'; 29 | } 30 | 31 | if (window.__admin_utc_offset__ != undefined) { 32 | var serverOffset = window.__admin_utc_offset__; 33 | var localOffset = new Date().getTimezoneOffset() * -60; 34 | DateTimeShortcuts.timezoneOffset = localOffset - serverOffset; 35 | } 36 | 37 | var inputs = document.getElementsByTagName('input'); 38 | for (i=0; i 0) { 78 | message = ngettext( 79 | 'Note: You are %s hour ahead of server time.', 80 | 'Note: You are %s hours ahead of server time.', 81 | timezoneOffset 82 | ); 83 | } 84 | else { 85 | timezoneOffset *= -1 86 | message = ngettext( 87 | 'Note: You are %s hour behind server time.', 88 | 'Note: You are %s hours behind server time.', 89 | timezoneOffset 90 | ); 91 | } 92 | message = interpolate(message, [timezoneOffset]); 93 | 94 | var $warning = $(''); 95 | $warning.attr('class', warningClass); 96 | $warning.text(message); 97 | 98 | $(inp).parent() 99 | .append($('
    ')) 100 | .append($warning) 101 | }, 102 | // Add clock widget to a given field 103 | addClock: function(inp) { 104 | var num = DateTimeShortcuts.clockInputs.length; 105 | DateTimeShortcuts.clockInputs[num] = inp; 106 | DateTimeShortcuts.dismissClockFunc[num] = function() { DateTimeShortcuts.dismissClock(num); return true; }; 107 | 108 | // Shortcut links (clock icon and "Now" link) 109 | var shortcuts_span = document.createElement('span'); 110 | shortcuts_span.className = DateTimeShortcuts.shortCutsClass; 111 | inp.parentNode.insertBefore(shortcuts_span, inp.nextSibling); 112 | var now_link = document.createElement('a'); 113 | now_link.setAttribute('href', "javascript:DateTimeShortcuts.handleClockQuicklink(" + num + ", -1);"); 114 | now_link.appendChild(document.createTextNode(gettext('Now'))); 115 | var clock_link = document.createElement('a'); 116 | clock_link.setAttribute('href', 'javascript:DateTimeShortcuts.openClock(' + num + ');'); 117 | clock_link.id = DateTimeShortcuts.clockLinkName + num; 118 | quickElement('img', clock_link, '', 'src', DateTimeShortcuts.admin_media_prefix + 'img/icon_clock.gif', 'alt', gettext('Clock')); 119 | shortcuts_span.appendChild(document.createTextNode('\240')); 120 | shortcuts_span.appendChild(now_link); 121 | shortcuts_span.appendChild(document.createTextNode('\240|\240')); 122 | shortcuts_span.appendChild(clock_link); 123 | 124 | // Create clock link div 125 | // 126 | // Markup looks like: 127 | //
    128 | //

    Choose a time

    129 | // 135 | //

    Cancel

    136 | //
    137 | 138 | var clock_box = document.createElement('div'); 139 | clock_box.style.display = 'none'; 140 | clock_box.style.position = 'absolute'; 141 | clock_box.className = 'clockbox module'; 142 | clock_box.setAttribute('id', DateTimeShortcuts.clockDivName + num); 143 | document.body.appendChild(clock_box); 144 | addEvent(clock_box, 'click', cancelEventPropagation); 145 | 146 | quickElement('h2', clock_box, gettext('Choose a time')); 147 | var time_list = quickElement('ul', clock_box); 148 | time_list.className = 'timelist'; 149 | quickElement("a", quickElement("li", time_list), gettext("Now"), "href", "javascript:DateTimeShortcuts.handleClockQuicklink(" + num + ", -1);"); 150 | quickElement("a", quickElement("li", time_list), gettext("Midnight"), "href", "javascript:DateTimeShortcuts.handleClockQuicklink(" + num + ", 0);"); 151 | quickElement("a", quickElement("li", time_list), gettext("6 a.m."), "href", "javascript:DateTimeShortcuts.handleClockQuicklink(" + num + ", 6);"); 152 | quickElement("a", quickElement("li", time_list), gettext("Noon"), "href", "javascript:DateTimeShortcuts.handleClockQuicklink(" + num + ", 12);"); 153 | 154 | var cancel_p = quickElement('p', clock_box); 155 | cancel_p.className = 'calendar-cancel'; 156 | quickElement('a', cancel_p, gettext('Cancel'), 'href', 'javascript:DateTimeShortcuts.dismissClock(' + num + ');'); 157 | django.jQuery(document).bind('keyup', function(event) { 158 | if (event.which == 27) { 159 | // ESC key closes popup 160 | DateTimeShortcuts.dismissClock(num); 161 | event.preventDefault(); 162 | } 163 | }); 164 | }, 165 | openClock: function(num) { 166 | var clock_box = document.getElementById(DateTimeShortcuts.clockDivName+num) 167 | var clock_link = document.getElementById(DateTimeShortcuts.clockLinkName+num) 168 | 169 | // Recalculate the clockbox position 170 | // is it left-to-right or right-to-left layout ? 171 | if (getStyle(document.body,'direction')!='rtl') { 172 | clock_box.style.left = findPosX(clock_link) + 17 + 'px'; 173 | } 174 | else { 175 | // since style's width is in em, it'd be tough to calculate 176 | // px value of it. let's use an estimated px for now 177 | // TODO: IE returns wrong value for findPosX when in rtl mode 178 | // (it returns as it was left aligned), needs to be fixed. 179 | clock_box.style.left = findPosX(clock_link) - 110 + 'px'; 180 | } 181 | clock_box.style.top = Math.max(0, findPosY(clock_link) - 30) + 'px'; 182 | 183 | // Show the clock box 184 | clock_box.style.display = 'block'; 185 | addEvent(document, 'click', DateTimeShortcuts.dismissClockFunc[num]); 186 | }, 187 | dismissClock: function(num) { 188 | document.getElementById(DateTimeShortcuts.clockDivName + num).style.display = 'none'; 189 | removeEvent(document, 'click', DateTimeShortcuts.dismissClockFunc[num]); 190 | }, 191 | handleClockQuicklink: function(num, val) { 192 | var d; 193 | if (val == -1) { 194 | d = DateTimeShortcuts.now(); 195 | } 196 | else { 197 | d = new Date(1970, 1, 1, val, 0, 0, 0) 198 | } 199 | DateTimeShortcuts.clockInputs[num].value = d.strftime(get_format('TIME_INPUT_FORMATS')[0]); 200 | DateTimeShortcuts.clockInputs[num].focus(); 201 | DateTimeShortcuts.dismissClock(num); 202 | }, 203 | // Add calendar widget to a given field. 204 | addCalendar: function(inp) { 205 | var num = DateTimeShortcuts.calendars.length; 206 | 207 | DateTimeShortcuts.calendarInputs[num] = inp; 208 | DateTimeShortcuts.dismissCalendarFunc[num] = function() { DateTimeShortcuts.dismissCalendar(num); return true; }; 209 | 210 | // Shortcut links (calendar icon and "Today" link) 211 | var shortcuts_span = document.createElement('span'); 212 | shortcuts_span.className = DateTimeShortcuts.shortCutsClass; 213 | inp.parentNode.insertBefore(shortcuts_span, inp.nextSibling); 214 | var today_link = document.createElement('a'); 215 | today_link.setAttribute('href', 'javascript:DateTimeShortcuts.handleCalendarQuickLink(' + num + ', 0);'); 216 | today_link.appendChild(document.createTextNode(gettext('Today'))); 217 | var cal_link = document.createElement('a'); 218 | cal_link.setAttribute('href', 'javascript:DateTimeShortcuts.openCalendar(' + num + ');'); 219 | cal_link.id = DateTimeShortcuts.calendarLinkName + num; 220 | quickElement('img', cal_link, '', 'src', DateTimeShortcuts.admin_media_prefix + 'img/icon_calendar.gif', 'alt', gettext('Calendar')); 221 | shortcuts_span.appendChild(document.createTextNode('\240')); 222 | shortcuts_span.appendChild(today_link); 223 | shortcuts_span.appendChild(document.createTextNode('\240|\240')); 224 | shortcuts_span.appendChild(cal_link); 225 | 226 | // Create calendarbox div. 227 | // 228 | // Markup looks like: 229 | // 230 | //
    231 | //

    232 | // 233 | // February 2003 234 | //

    235 | //
    236 | // 237 | //
    238 | //
    239 | // Yesterday | Today | Tomorrow 240 | //
    241 | //

    Cancel

    242 | //
    243 | var cal_box = document.createElement('div'); 244 | cal_box.style.display = 'none'; 245 | cal_box.style.position = 'absolute'; 246 | cal_box.className = 'calendarbox module'; 247 | cal_box.setAttribute('id', DateTimeShortcuts.calendarDivName1 + num); 248 | document.body.appendChild(cal_box); 249 | addEvent(cal_box, 'click', cancelEventPropagation); 250 | 251 | // next-prev links 252 | var cal_nav = quickElement('div', cal_box); 253 | var cal_nav_prev = quickElement('a', cal_nav, '<', 'href', 'javascript:DateTimeShortcuts.drawPrev('+num+');'); 254 | cal_nav_prev.className = 'calendarnav-previous'; 255 | var cal_nav_next = quickElement('a', cal_nav, '>', 'href', 'javascript:DateTimeShortcuts.drawNext('+num+');'); 256 | cal_nav_next.className = 'calendarnav-next'; 257 | 258 | // main box 259 | var cal_main = quickElement('div', cal_box, '', 'id', DateTimeShortcuts.calendarDivName2 + num); 260 | cal_main.className = 'calendar'; 261 | DateTimeShortcuts.calendars[num] = new Calendar(DateTimeShortcuts.calendarDivName2 + num, DateTimeShortcuts.handleCalendarCallback(num)); 262 | DateTimeShortcuts.calendars[num].drawCurrent(); 263 | 264 | // calendar shortcuts 265 | var shortcuts = quickElement('div', cal_box); 266 | shortcuts.className = 'calendar-shortcuts'; 267 | quickElement('a', shortcuts, gettext('Yesterday'), 'href', 'javascript:DateTimeShortcuts.handleCalendarQuickLink(' + num + ', -1);'); 268 | shortcuts.appendChild(document.createTextNode('\240|\240')); 269 | quickElement('a', shortcuts, gettext('Today'), 'href', 'javascript:DateTimeShortcuts.handleCalendarQuickLink(' + num + ', 0);'); 270 | shortcuts.appendChild(document.createTextNode('\240|\240')); 271 | quickElement('a', shortcuts, gettext('Tomorrow'), 'href', 'javascript:DateTimeShortcuts.handleCalendarQuickLink(' + num + ', +1);'); 272 | 273 | // cancel bar 274 | var cancel_p = quickElement('p', cal_box); 275 | cancel_p.className = 'calendar-cancel'; 276 | quickElement('a', cancel_p, gettext('Cancel'), 'href', 'javascript:DateTimeShortcuts.dismissCalendar(' + num + ');'); 277 | django.jQuery(document).bind('keyup', function(event) { 278 | if (event.which == 27) { 279 | // ESC key closes popup 280 | DateTimeShortcuts.dismissCalendar(num); 281 | event.preventDefault(); 282 | } 283 | }); 284 | }, 285 | openCalendar: function(num) { 286 | var cal_box = document.getElementById(DateTimeShortcuts.calendarDivName1+num) 287 | var cal_link = document.getElementById(DateTimeShortcuts.calendarLinkName+num) 288 | var inp = DateTimeShortcuts.calendarInputs[num]; 289 | 290 | // Determine if the current value in the input has a valid date. 291 | // If so, draw the calendar with that date's year and month. 292 | if (inp.value) { 293 | var format = get_format('DATE_INPUT_FORMATS')[0]; 294 | var selected = inp.value.strptime(format); 295 | var year = selected.getFullYear(); 296 | var month = selected.getMonth() + 1; 297 | var re = /\d{4}/ 298 | if (re.test(year.toString()) && month >= 1 && month <= 12) { 299 | DateTimeShortcuts.calendars[num].drawDate(month, year, selected); 300 | } 301 | } 302 | 303 | // Recalculate the clockbox position 304 | // is it left-to-right or right-to-left layout ? 305 | if (getStyle(document.body,'direction')!='rtl') { 306 | cal_box.style.left = findPosX(cal_link) + 17 + 'px'; 307 | } 308 | else { 309 | // since style's width is in em, it'd be tough to calculate 310 | // px value of it. let's use an estimated px for now 311 | // TODO: IE returns wrong value for findPosX when in rtl mode 312 | // (it returns as it was left aligned), needs to be fixed. 313 | cal_box.style.left = findPosX(cal_link) - 180 + 'px'; 314 | } 315 | cal_box.style.top = Math.max(0, findPosY(cal_link) - 75) + 'px'; 316 | 317 | cal_box.style.display = 'block'; 318 | addEvent(document, 'click', DateTimeShortcuts.dismissCalendarFunc[num]); 319 | }, 320 | dismissCalendar: function(num) { 321 | document.getElementById(DateTimeShortcuts.calendarDivName1+num).style.display = 'none'; 322 | removeEvent(document, 'click', DateTimeShortcuts.dismissCalendarFunc[num]); 323 | }, 324 | drawPrev: function(num) { 325 | DateTimeShortcuts.calendars[num].drawPreviousMonth(); 326 | }, 327 | drawNext: function(num) { 328 | DateTimeShortcuts.calendars[num].drawNextMonth(); 329 | }, 330 | handleCalendarCallback: function(num) { 331 | var format = get_format('DATE_INPUT_FORMATS')[0]; 332 | // the format needs to be escaped a little 333 | format = format.replace('\\', '\\\\'); 334 | format = format.replace('\r', '\\r'); 335 | format = format.replace('\n', '\\n'); 336 | format = format.replace('\t', '\\t'); 337 | format = format.replace("'", "\\'"); 338 | return ["function(y, m, d) { DateTimeShortcuts.calendarInputs[", 339 | num, 340 | "].value = new Date(y, m-1, d).strftime('", 341 | format, 342 | "');DateTimeShortcuts.calendarInputs[", 343 | num, 344 | "].focus();document.getElementById(DateTimeShortcuts.calendarDivName1+", 345 | num, 346 | ").style.display='none';}"].join(''); 347 | }, 348 | handleCalendarQuickLink: function(num, offset) { 349 | var d = DateTimeShortcuts.now(); 350 | d.setDate(d.getDate() + offset) 351 | DateTimeShortcuts.calendarInputs[num].value = d.strftime(get_format('DATE_INPUT_FORMATS')[0]); 352 | DateTimeShortcuts.calendarInputs[num].focus(); 353 | DateTimeShortcuts.dismissCalendar(num); 354 | } 355 | } 356 | 357 | addEvent(window, 'load', DateTimeShortcuts.init); 358 | -------------------------------------------------------------------------------- /nx2django/static/admin/js/admin/RelatedObjectLookups.js: -------------------------------------------------------------------------------- 1 | // Handles related-objects functionality: lookup link for raw_id_fields 2 | // and Add Another links. 3 | 4 | function html_unescape(text) { 5 | // Unescape a string that was escaped using django.utils.html.escape. 6 | text = text.replace(/</g, '<'); 7 | text = text.replace(/>/g, '>'); 8 | text = text.replace(/"/g, '"'); 9 | text = text.replace(/'/g, "'"); 10 | text = text.replace(/&/g, '&'); 11 | return text; 12 | } 13 | 14 | // IE doesn't accept periods or dashes in the window name, but the element IDs 15 | // we use to generate popup window names may contain them, therefore we map them 16 | // to allowed characters in a reversible way so that we can locate the correct 17 | // element when the popup window is dismissed. 18 | function id_to_windowname(text) { 19 | text = text.replace(/\./g, '__dot__'); 20 | text = text.replace(/\-/g, '__dash__'); 21 | return text; 22 | } 23 | 24 | function windowname_to_id(text) { 25 | text = text.replace(/__dot__/g, '.'); 26 | text = text.replace(/__dash__/g, '-'); 27 | return text; 28 | } 29 | 30 | function showAdminPopup(triggeringLink, name_regexp) { 31 | var name = triggeringLink.id.replace(name_regexp, ''); 32 | name = id_to_windowname(name); 33 | var href = triggeringLink.href; 34 | if (href.indexOf('?') == -1) { 35 | href += '?_popup=1'; 36 | } else { 37 | href += '&_popup=1'; 38 | } 39 | var win = window.open(href, name, 'height=500,width=800,resizable=yes,scrollbars=yes'); 40 | win.focus(); 41 | return false; 42 | } 43 | 44 | function showRelatedObjectLookupPopup(triggeringLink) { 45 | return showAdminPopup(triggeringLink, /^lookup_/); 46 | } 47 | 48 | function dismissRelatedLookupPopup(win, chosenId) { 49 | var name = windowname_to_id(win.name); 50 | var elem = document.getElementById(name); 51 | if (elem.className.indexOf('vManyToManyRawIdAdminField') != -1 && elem.value) { 52 | elem.value += ',' + chosenId; 53 | } else { 54 | document.getElementById(name).value = chosenId; 55 | } 56 | win.close(); 57 | } 58 | 59 | function showRelatedObjectPopup(triggeringLink) { 60 | var name = triggeringLink.id.replace(/^(change|add|delete)_/, ''); 61 | name = id_to_windowname(name); 62 | var href = triggeringLink.href; 63 | var win = window.open(href, name, 'height=500,width=800,resizable=yes,scrollbars=yes'); 64 | win.focus(); 65 | return false; 66 | } 67 | 68 | function dismissAddRelatedObjectPopup(win, newId, newRepr) { 69 | // newId and newRepr are expected to have previously been escaped by 70 | // django.utils.html.escape. 71 | newId = html_unescape(newId); 72 | newRepr = html_unescape(newRepr); 73 | var name = windowname_to_id(win.name); 74 | var elem = document.getElementById(name); 75 | var o; 76 | if (elem) { 77 | var elemName = elem.nodeName.toUpperCase(); 78 | if (elemName == 'SELECT') { 79 | o = new Option(newRepr, newId); 80 | elem.options[elem.options.length] = o; 81 | o.selected = true; 82 | } else if (elemName == 'INPUT') { 83 | if (elem.className.indexOf('vManyToManyRawIdAdminField') != -1 && elem.value) { 84 | elem.value += ',' + newId; 85 | } else { 86 | elem.value = newId; 87 | } 88 | } 89 | // Trigger a change event to update related links if required. 90 | django.jQuery(elem).trigger('change'); 91 | } else { 92 | var toId = name + "_to"; 93 | o = new Option(newRepr, newId); 94 | SelectBox.add_to_cache(toId, o); 95 | SelectBox.redisplay(toId); 96 | } 97 | win.close(); 98 | } 99 | 100 | function dismissChangeRelatedObjectPopup(win, objId, newRepr, newId) { 101 | objId = html_unescape(objId); 102 | newRepr = html_unescape(newRepr); 103 | var id = windowname_to_id(win.name).replace(/^edit_/, ''); 104 | var selectsSelector = interpolate('#%s, #%s_from, #%s_to', [id, id, id]); 105 | var selects = django.jQuery(selectsSelector); 106 | selects.find('option').each(function() { 107 | if (this.value == objId) { 108 | this.innerHTML = newRepr; 109 | this.value = newId; 110 | } 111 | }); 112 | win.close(); 113 | }; 114 | 115 | function dismissDeleteRelatedObjectPopup(win, objId) { 116 | objId = html_unescape(objId); 117 | var id = windowname_to_id(win.name).replace(/^delete_/, ''); 118 | var selectsSelector = interpolate('#%s, #%s_from, #%s_to', [id, id, id]); 119 | var selects = django.jQuery(selectsSelector); 120 | selects.find('option').each(function() { 121 | if (this.value == objId) { 122 | django.jQuery(this).remove(); 123 | } 124 | }).trigger('change'); 125 | win.close(); 126 | }; 127 | 128 | // Kept for backward compatibility 129 | showAddAnotherPopup = showRelatedObjectPopup; 130 | dismissAddAnotherPopup = dismissAddRelatedObjectPopup; 131 | -------------------------------------------------------------------------------- /nx2django/static/admin/js/calendar.js: -------------------------------------------------------------------------------- 1 | /* 2 | calendar.js - Calendar functions by Adrian Holovaty 3 | depends on core.js for utility functions like removeChildren or quickElement 4 | */ 5 | 6 | // CalendarNamespace -- Provides a collection of HTML calendar-related helper functions 7 | var CalendarNamespace = { 8 | monthsOfYear: gettext('January February March April May June July August September October November December').split(' '), 9 | daysOfWeek: gettext('S M T W T F S').split(' '), 10 | firstDayOfWeek: parseInt(get_format('FIRST_DAY_OF_WEEK')), 11 | isLeapYear: function(year) { 12 | return (((year % 4)==0) && ((year % 100)!=0) || ((year % 400)==0)); 13 | }, 14 | getDaysInMonth: function(month,year) { 15 | var days; 16 | if (month==1 || month==3 || month==5 || month==7 || month==8 || month==10 || month==12) { 17 | days = 31; 18 | } 19 | else if (month==4 || month==6 || month==9 || month==11) { 20 | days = 30; 21 | } 22 | else if (month==2 && CalendarNamespace.isLeapYear(year)) { 23 | days = 29; 24 | } 25 | else { 26 | days = 28; 27 | } 28 | return days; 29 | }, 30 | draw: function(month, year, div_id, callback, selected) { // month = 1-12, year = 1-9999 31 | var today = new Date(); 32 | var todayDay = today.getDate(); 33 | var todayMonth = today.getMonth()+1; 34 | var todayYear = today.getFullYear(); 35 | var todayClass = ''; 36 | 37 | // Use UTC functions here because the date field does not contain time 38 | // and using the UTC function variants prevent the local time offset 39 | // from altering the date, specifically the day field. For example: 40 | // 41 | // ``` 42 | // var x = new Date('2013-10-02'); 43 | // var day = x.getDate(); 44 | // ``` 45 | // 46 | // The day variable above will be 1 instead of 2 in, say, US Pacific time 47 | // zone. 48 | var isSelectedMonth = false; 49 | if (typeof selected != 'undefined') { 50 | isSelectedMonth = (selected.getUTCFullYear() == year && (selected.getUTCMonth()+1) == month); 51 | } 52 | 53 | month = parseInt(month); 54 | year = parseInt(year); 55 | var calDiv = document.getElementById(div_id); 56 | removeChildren(calDiv); 57 | var calTable = document.createElement('table'); 58 | quickElement('caption', calTable, CalendarNamespace.monthsOfYear[month-1] + ' ' + year); 59 | var tableBody = quickElement('tbody', calTable); 60 | 61 | // Draw days-of-week header 62 | var tableRow = quickElement('tr', tableBody); 63 | for (var i = 0; i < 7; i++) { 64 | quickElement('th', tableRow, CalendarNamespace.daysOfWeek[(i + CalendarNamespace.firstDayOfWeek) % 7]); 65 | } 66 | 67 | var startingPos = new Date(year, month-1, 1 - CalendarNamespace.firstDayOfWeek).getDay(); 68 | var days = CalendarNamespace.getDaysInMonth(month, year); 69 | 70 | // Draw blanks before first of month 71 | tableRow = quickElement('tr', tableBody); 72 | for (var i = 0; i < startingPos; i++) { 73 | var _cell = quickElement('td', tableRow, ' '); 74 | _cell.className = "nonday"; 75 | } 76 | 77 | // Draw days of month 78 | var currentDay = 1; 79 | for (var i = startingPos; currentDay <= days; i++) { 80 | if (i%7 == 0 && currentDay != 1) { 81 | tableRow = quickElement('tr', tableBody); 82 | } 83 | if ((currentDay==todayDay) && (month==todayMonth) && (year==todayYear)) { 84 | todayClass='today'; 85 | } else { 86 | todayClass=''; 87 | } 88 | 89 | // use UTC function; see above for explanation. 90 | if (isSelectedMonth && currentDay == selected.getUTCDate()) { 91 | if (todayClass != '') todayClass += " "; 92 | todayClass += "selected"; 93 | } 94 | 95 | var cell = quickElement('td', tableRow, '', 'class', todayClass); 96 | 97 | quickElement('a', cell, currentDay, 'href', 'javascript:void(' + callback + '('+year+','+month+','+currentDay+'));'); 98 | currentDay++; 99 | } 100 | 101 | // Draw blanks after end of month (optional, but makes for valid code) 102 | while (tableRow.childNodes.length < 7) { 103 | var _cell = quickElement('td', tableRow, ' '); 104 | _cell.className = "nonday"; 105 | } 106 | 107 | calDiv.appendChild(calTable); 108 | } 109 | } 110 | 111 | // Calendar -- A calendar instance 112 | function Calendar(div_id, callback, selected) { 113 | // div_id (string) is the ID of the element in which the calendar will 114 | // be displayed 115 | // callback (string) is the name of a JavaScript function that will be 116 | // called with the parameters (year, month, day) when a day in the 117 | // calendar is clicked 118 | this.div_id = div_id; 119 | this.callback = callback; 120 | this.today = new Date(); 121 | this.currentMonth = this.today.getMonth() + 1; 122 | this.currentYear = this.today.getFullYear(); 123 | if (typeof selected != 'undefined') { 124 | this.selected = selected; 125 | } 126 | } 127 | Calendar.prototype = { 128 | drawCurrent: function() { 129 | CalendarNamespace.draw(this.currentMonth, this.currentYear, this.div_id, this.callback, this.selected); 130 | }, 131 | drawDate: function(month, year, selected) { 132 | this.currentMonth = month; 133 | this.currentYear = year; 134 | 135 | if(selected) { 136 | this.selected = selected; 137 | } 138 | 139 | this.drawCurrent(); 140 | }, 141 | drawPreviousMonth: function() { 142 | if (this.currentMonth == 1) { 143 | this.currentMonth = 12; 144 | this.currentYear--; 145 | } 146 | else { 147 | this.currentMonth--; 148 | } 149 | this.drawCurrent(); 150 | }, 151 | drawNextMonth: function() { 152 | if (this.currentMonth == 12) { 153 | this.currentMonth = 1; 154 | this.currentYear++; 155 | } 156 | else { 157 | this.currentMonth++; 158 | } 159 | this.drawCurrent(); 160 | }, 161 | drawPreviousYear: function() { 162 | this.currentYear--; 163 | this.drawCurrent(); 164 | }, 165 | drawNextYear: function() { 166 | this.currentYear++; 167 | this.drawCurrent(); 168 | } 169 | } 170 | -------------------------------------------------------------------------------- /nx2django/static/admin/js/collapse.js: -------------------------------------------------------------------------------- 1 | (function($) { 2 | $(document).ready(function() { 3 | // Add anchor tag for Show/Hide link 4 | $("fieldset.collapse").each(function(i, elem) { 5 | // Don't hide if fields in this fieldset have errors 6 | if ($(elem).find("div.errors").length == 0) { 7 | $(elem).addClass("collapsed").find("h2").first().append(' (' + gettext("Show") + 9 | ')'); 10 | } 11 | }); 12 | // Add toggle to anchor tag 13 | $("fieldset.collapse a.collapse-toggle").click(function(ev) { 14 | if ($(this).closest("fieldset").hasClass("collapsed")) { 15 | // Show 16 | $(this).text(gettext("Hide")).closest("fieldset").removeClass("collapsed").trigger("show.fieldset", [$(this).attr("id")]); 17 | } else { 18 | // Hide 19 | $(this).text(gettext("Show")).closest("fieldset").addClass("collapsed").trigger("hide.fieldset", [$(this).attr("id")]); 20 | } 21 | return false; 22 | }); 23 | }); 24 | })(django.jQuery); 25 | -------------------------------------------------------------------------------- /nx2django/static/admin/js/collapse.min.js: -------------------------------------------------------------------------------- 1 | (function(a){a(document).ready(function(){a("fieldset.collapse").each(function(c,b){a(b).find("div.errors").length==0&&a(b).addClass("collapsed").find("h2").first().append(' ('+gettext("Show")+")")});a("fieldset.collapse a.collapse-toggle").click(function(){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", 2 | [a(this).attr("id")]);return false})})})(django.jQuery); 3 | -------------------------------------------------------------------------------- /nx2django/static/admin/js/core.js: -------------------------------------------------------------------------------- 1 | // Core javascript helper functions 2 | 3 | // basic browser identification & version 4 | var isOpera = (navigator.userAgent.indexOf("Opera")>=0) && parseFloat(navigator.appVersion); 5 | var isIE = ((document.all) && (!isOpera)) && parseFloat(navigator.appVersion.split("MSIE ")[1].split(";")[0]); 6 | 7 | // Cross-browser event handlers. 8 | function addEvent(obj, evType, fn) { 9 | if (obj.addEventListener) { 10 | obj.addEventListener(evType, fn, false); 11 | return true; 12 | } else if (obj.attachEvent) { 13 | var r = obj.attachEvent("on" + evType, fn); 14 | return r; 15 | } else { 16 | return false; 17 | } 18 | } 19 | 20 | function removeEvent(obj, evType, fn) { 21 | if (obj.removeEventListener) { 22 | obj.removeEventListener(evType, fn, false); 23 | return true; 24 | } else if (obj.detachEvent) { 25 | obj.detachEvent("on" + evType, fn); 26 | return true; 27 | } else { 28 | return false; 29 | } 30 | } 31 | 32 | function cancelEventPropagation(e) { 33 | if (!e) e = window.event; 34 | e.cancelBubble = true; 35 | if (e.stopPropagation) e.stopPropagation(); 36 | } 37 | 38 | // quickElement(tagType, parentReference [, textInChildNode, attribute, attributeValue ...]); 39 | function quickElement() { 40 | var obj = document.createElement(arguments[0]); 41 | if (arguments[2]) { 42 | var textNode = document.createTextNode(arguments[2]); 43 | obj.appendChild(textNode); 44 | } 45 | var len = arguments.length; 46 | for (var i = 3; i < len; i += 2) { 47 | obj.setAttribute(arguments[i], arguments[i+1]); 48 | } 49 | arguments[1].appendChild(obj); 50 | return obj; 51 | } 52 | 53 | // "a" is reference to an object 54 | function removeChildren(a) { 55 | while (a.hasChildNodes()) a.removeChild(a.lastChild); 56 | } 57 | 58 | // ---------------------------------------------------------------------------- 59 | // Cross-browser xmlhttp object 60 | // from http://jibbering.com/2002/4/httprequest.html 61 | // ---------------------------------------------------------------------------- 62 | var xmlhttp; 63 | /*@cc_on @*/ 64 | /*@if (@_jscript_version >= 5) 65 | try { 66 | xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); 67 | } catch (e) { 68 | try { 69 | xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); 70 | } catch (E) { 71 | xmlhttp = false; 72 | } 73 | } 74 | @else 75 | xmlhttp = false; 76 | @end @*/ 77 | if (!xmlhttp && typeof XMLHttpRequest != 'undefined') { 78 | xmlhttp = new XMLHttpRequest(); 79 | } 80 | 81 | // ---------------------------------------------------------------------------- 82 | // Find-position functions by PPK 83 | // See http://www.quirksmode.org/js/findpos.html 84 | // ---------------------------------------------------------------------------- 85 | function findPosX(obj) { 86 | var curleft = 0; 87 | if (obj.offsetParent) { 88 | while (obj.offsetParent) { 89 | curleft += obj.offsetLeft - ((isOpera) ? 0 : obj.scrollLeft); 90 | obj = obj.offsetParent; 91 | } 92 | // IE offsetParent does not include the top-level 93 | if (isIE && obj.parentElement){ 94 | curleft += obj.offsetLeft - obj.scrollLeft; 95 | } 96 | } else if (obj.x) { 97 | curleft += obj.x; 98 | } 99 | return curleft; 100 | } 101 | 102 | function findPosY(obj) { 103 | var curtop = 0; 104 | if (obj.offsetParent) { 105 | while (obj.offsetParent) { 106 | curtop += obj.offsetTop - ((isOpera) ? 0 : obj.scrollTop); 107 | obj = obj.offsetParent; 108 | } 109 | // IE offsetParent does not include the top-level 110 | if (isIE && obj.parentElement){ 111 | curtop += obj.offsetTop - obj.scrollTop; 112 | } 113 | } else if (obj.y) { 114 | curtop += obj.y; 115 | } 116 | return curtop; 117 | } 118 | 119 | //----------------------------------------------------------------------------- 120 | // Date object extensions 121 | // ---------------------------------------------------------------------------- 122 | 123 | Date.prototype.getTwelveHours = function() { 124 | hours = this.getHours(); 125 | if (hours == 0) { 126 | return 12; 127 | } 128 | else { 129 | return hours <= 12 ? hours : hours-12 130 | } 131 | } 132 | 133 | Date.prototype.getTwoDigitMonth = function() { 134 | return (this.getMonth() < 9) ? '0' + (this.getMonth()+1) : (this.getMonth()+1); 135 | } 136 | 137 | Date.prototype.getTwoDigitDate = function() { 138 | return (this.getDate() < 10) ? '0' + this.getDate() : this.getDate(); 139 | } 140 | 141 | Date.prototype.getTwoDigitTwelveHour = function() { 142 | return (this.getTwelveHours() < 10) ? '0' + this.getTwelveHours() : this.getTwelveHours(); 143 | } 144 | 145 | Date.prototype.getTwoDigitHour = function() { 146 | return (this.getHours() < 10) ? '0' + this.getHours() : this.getHours(); 147 | } 148 | 149 | Date.prototype.getTwoDigitMinute = function() { 150 | return (this.getMinutes() < 10) ? '0' + this.getMinutes() : this.getMinutes(); 151 | } 152 | 153 | Date.prototype.getTwoDigitSecond = function() { 154 | return (this.getSeconds() < 10) ? '0' + this.getSeconds() : this.getSeconds(); 155 | } 156 | 157 | Date.prototype.getHourMinute = function() { 158 | return this.getTwoDigitHour() + ':' + this.getTwoDigitMinute(); 159 | } 160 | 161 | Date.prototype.getHourMinuteSecond = function() { 162 | return this.getTwoDigitHour() + ':' + this.getTwoDigitMinute() + ':' + this.getTwoDigitSecond(); 163 | } 164 | 165 | Date.prototype.strftime = function(format) { 166 | var fields = { 167 | c: this.toString(), 168 | d: this.getTwoDigitDate(), 169 | H: this.getTwoDigitHour(), 170 | I: this.getTwoDigitTwelveHour(), 171 | m: this.getTwoDigitMonth(), 172 | M: this.getTwoDigitMinute(), 173 | p: (this.getHours() >= 12) ? 'PM' : 'AM', 174 | S: this.getTwoDigitSecond(), 175 | w: '0' + this.getDay(), 176 | x: this.toLocaleDateString(), 177 | X: this.toLocaleTimeString(), 178 | y: ('' + this.getFullYear()).substr(2, 4), 179 | Y: '' + this.getFullYear(), 180 | '%' : '%' 181 | }; 182 | var result = '', i = 0; 183 | while (i < format.length) { 184 | if (format.charAt(i) === '%') { 185 | result = result + fields[format.charAt(i + 1)]; 186 | ++i; 187 | } 188 | else { 189 | result = result + format.charAt(i); 190 | } 191 | ++i; 192 | } 193 | return result; 194 | } 195 | 196 | // ---------------------------------------------------------------------------- 197 | // String object extensions 198 | // ---------------------------------------------------------------------------- 199 | String.prototype.pad_left = function(pad_length, pad_string) { 200 | var new_string = this; 201 | for (var i = 0; new_string.length < pad_length; i++) { 202 | new_string = pad_string + new_string; 203 | } 204 | return new_string; 205 | } 206 | 207 | String.prototype.strptime = function(format) { 208 | var split_format = format.split(/[.\-/]/); 209 | var date = this.split(/[.\-/]/); 210 | var i = 0; 211 | while (i < split_format.length) { 212 | switch (split_format[i]) { 213 | case "%d": 214 | var day = date[i]; 215 | break; 216 | case "%m": 217 | var month = date[i] - 1; 218 | break; 219 | case "%Y": 220 | var year = date[i]; 221 | break; 222 | case "%y": 223 | var year = date[i]; 224 | break; 225 | } 226 | ++i; 227 | }; 228 | return new Date(year, month, day); 229 | } 230 | 231 | // ---------------------------------------------------------------------------- 232 | // Get the computed style for and element 233 | // ---------------------------------------------------------------------------- 234 | function getStyle(oElm, strCssRule){ 235 | var strValue = ""; 236 | if(document.defaultView && document.defaultView.getComputedStyle){ 237 | strValue = document.defaultView.getComputedStyle(oElm, "").getPropertyValue(strCssRule); 238 | } 239 | else if(oElm.currentStyle){ 240 | strCssRule = strCssRule.replace(/\-(\w)/g, function (strMatch, p1){ 241 | return p1.toUpperCase(); 242 | }); 243 | strValue = oElm.currentStyle[strCssRule]; 244 | } 245 | return strValue; 246 | } 247 | -------------------------------------------------------------------------------- /nx2django/static/admin/js/inlines.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Django admin inlines 3 | * 4 | * Based on jQuery Formset 1.1 5 | * @author Stanislaus Madueke (stan DOT madueke AT gmail DOT com) 6 | * @requires jQuery 1.2.6 or later 7 | * 8 | * Copyright (c) 2009, Stanislaus Madueke 9 | * All rights reserved. 10 | * 11 | * Spiced up with Code from Zain Memon's GSoC project 2009 12 | * and modified for Django by Jannis Leidel, Travis Swicegood and Julien Phalip. 13 | * 14 | * Licensed under the New BSD License 15 | * See: http://www.opensource.org/licenses/bsd-license.php 16 | */ 17 | (function($) { 18 | $.fn.formset = function(opts) { 19 | var options = $.extend({}, $.fn.formset.defaults, opts); 20 | var $this = $(this); 21 | var $parent = $this.parent(); 22 | var updateElementIndex = function(el, prefix, ndx) { 23 | var id_regex = new RegExp("(" + prefix + "-(\\d+|__prefix__))"); 24 | var replacement = prefix + "-" + ndx; 25 | if ($(el).prop("for")) { 26 | $(el).prop("for", $(el).prop("for").replace(id_regex, replacement)); 27 | } 28 | if (el.id) { 29 | el.id = el.id.replace(id_regex, replacement); 30 | } 31 | if (el.name) { 32 | el.name = el.name.replace(id_regex, replacement); 33 | } 34 | }; 35 | var totalForms = $("#id_" + options.prefix + "-TOTAL_FORMS").prop("autocomplete", "off"); 36 | var nextIndex = parseInt(totalForms.val(), 10); 37 | var maxForms = $("#id_" + options.prefix + "-MAX_NUM_FORMS").prop("autocomplete", "off"); 38 | // only show the add button if we are allowed to add more items, 39 | // note that max_num = None translates to a blank string. 40 | var showAddButton = maxForms.val() === '' || (maxForms.val()-totalForms.val()) > 0; 41 | $this.each(function(i) { 42 | $(this).not("." + options.emptyCssClass).addClass(options.formCssClass); 43 | }); 44 | if ($this.length && showAddButton) { 45 | var addButton; 46 | if ($this.prop("tagName") == "TR") { 47 | // If forms are laid out as table rows, insert the 48 | // "add" button in a new table row: 49 | var numCols = this.eq(-1).children().length; 50 | $parent.append('' + options.addText + ""); 51 | addButton = $parent.find("tr:last a"); 52 | } else { 53 | // Otherwise, insert it immediately after the last form: 54 | $this.filter(":last").after('"); 55 | addButton = $this.filter(":last").next().find("a"); 56 | } 57 | addButton.click(function(e) { 58 | e.preventDefault(); 59 | var totalForms = $("#id_" + options.prefix + "-TOTAL_FORMS"); 60 | var template = $("#" + options.prefix + "-empty"); 61 | var row = template.clone(true); 62 | row.removeClass(options.emptyCssClass) 63 | .addClass(options.formCssClass) 64 | .attr("id", options.prefix + "-" + nextIndex); 65 | if (row.is("tr")) { 66 | // If the forms are laid out in table rows, insert 67 | // the remove button into the last table cell: 68 | row.children(":last").append('"); 69 | } else if (row.is("ul") || row.is("ol")) { 70 | // If they're laid out as an ordered/unordered list, 71 | // insert an
  • after the last list item: 72 | row.append('
  • ' + options.deleteText + "
  • "); 73 | } else { 74 | // Otherwise, just insert the remove button as the 75 | // last child element of the form's container: 76 | row.children(":first").append('' + options.deleteText + ""); 77 | } 78 | row.find("*").each(function() { 79 | updateElementIndex(this, options.prefix, totalForms.val()); 80 | }); 81 | // Insert the new form when it has been fully edited 82 | row.insertBefore($(template)); 83 | // Update number of total forms 84 | $(totalForms).val(parseInt(totalForms.val(), 10) + 1); 85 | nextIndex += 1; 86 | // Hide add button in case we've hit the max, except we want to add infinitely 87 | if ((maxForms.val() !== '') && (maxForms.val()-totalForms.val()) <= 0) { 88 | addButton.parent().hide(); 89 | } 90 | // The delete button of each row triggers a bunch of other things 91 | row.find("a." + options.deleteCssClass).click(function(e) { 92 | e.preventDefault(); 93 | // Remove the parent form containing this button: 94 | var row = $(this).parents("." + options.formCssClass); 95 | row.remove(); 96 | nextIndex -= 1; 97 | // If a post-delete callback was provided, call it with the deleted form: 98 | if (options.removed) { 99 | options.removed(row); 100 | } 101 | // Update the TOTAL_FORMS form count. 102 | var forms = $("." + options.formCssClass); 103 | $("#id_" + options.prefix + "-TOTAL_FORMS").val(forms.length); 104 | // Show add button again once we drop below max 105 | if ((maxForms.val() === '') || (maxForms.val()-forms.length) > 0) { 106 | addButton.parent().show(); 107 | } 108 | // Also, update names and ids for all remaining form controls 109 | // so they remain in sequence: 110 | for (var i=0, formCount=forms.length; i0;i.each(function(){a(this).not("."+ 2 | b.emptyCssClass).addClass(b.formCssClass)});if(i.length&&l){var f;if(i.prop("tagName")=="TR"){i=this.eq(-1).children().length;g.append(''+b.addText+"");f=g.find("tr:last a")}else{i.filter(":last").after('");f=i.filter(":last").next().find("a")}f.click(function(e){e.preventDefault();var k=a("#id_"+b.prefix+"-TOTAL_FORMS");e=a("#"+ 3 | b.prefix+"-empty");var h=e.clone(true);h.removeClass(b.emptyCssClass).addClass(b.formCssClass).attr("id",b.prefix+"-"+d);if(h.is("tr"))h.children(":last").append('");else h.is("ul")||h.is("ol")?h.append('
  • '+b.deleteText+"
  • "):h.children(":first").append(''+b.deleteText+""); 4 | h.find("*").each(function(){m(this,b.prefix,k.val())});h.insertBefore(a(e));a(k).val(parseInt(k.val(),10)+1);d+=1;c.val()!==""&&c.val()-k.val()<=0&&f.parent().hide();h.find("a."+b.deleteCssClass).click(function(j){j.preventDefault();j=a(this).parents("."+b.formCssClass);j.remove();d-=1;b.removed&&b.removed(j);j=a("."+b.formCssClass);a("#id_"+b.prefix+"-TOTAL_FORMS").val(j.length);if(c.val()===""||c.val()-j.length>0)f.parent().show();for(var n=0,o=j.length;n 0) { 23 | values.push(field.val()); 24 | } 25 | }); 26 | prepopulatedField.val(URLify(values.join(' '), maxLength)); 27 | }; 28 | 29 | prepopulatedField.data('_changed', false); 30 | prepopulatedField.change(function() { 31 | prepopulatedField.data('_changed', true); 32 | }); 33 | 34 | if (!prepopulatedField.val()) { 35 | $(dependencies.join(',')).keyup(populate).change(populate).focus(populate); 36 | } 37 | }); 38 | }; 39 | })(django.jQuery); 40 | -------------------------------------------------------------------------------- /nx2django/static/admin/js/prepopulate.min.js: -------------------------------------------------------------------------------- 1 | (function(b){b.fn.prepopulate=function(e,g){return this.each(function(){var a=b(this),d=function(){if(!a.data("_changed")){var f=[];b.each(e,function(h,c){c=b(c);c.val().length>0&&f.push(c.val())});a.val(URLify(f.join(" "),g))}};a.data("_changed",false);a.change(function(){a.data("_changed",true)});a.val()||b(e.join(",")).keyup(d).change(d).focus(d)})}})(django.jQuery); 2 | -------------------------------------------------------------------------------- /nx2django/static/admin/js/related-widget-wrapper.js: -------------------------------------------------------------------------------- 1 | django.jQuery(function($){ 2 | function updateLinks() { 3 | var $this = $(this); 4 | var siblings = $this.nextAll('.change-related, .delete-related'); 5 | if (!siblings.length) return; 6 | var value = $this.val(); 7 | if (value) { 8 | siblings.each(function(){ 9 | var elm = $(this); 10 | elm.attr('href', elm.attr('data-href-template').replace('__fk__', value)); 11 | }); 12 | } else siblings.removeAttr('href'); 13 | } 14 | var container = $(document); 15 | container.on('change', '.related-widget-wrapper select', updateLinks); 16 | container.find('.related-widget-wrapper select').each(updateLinks); 17 | container.on('click', '.related-widget-wrapper-link', function(event){ 18 | if (this.href) { 19 | showRelatedObjectPopup(this); 20 | } 21 | event.preventDefault(); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /nx2django/static/admin/js/timeparse.js: -------------------------------------------------------------------------------- 1 | var timeParsePatterns = [ 2 | // 9 3 | { re: /^\d{1,2}$/i, 4 | handler: function(bits) { 5 | if (bits[0].length == 1) { 6 | return '0' + bits[0] + ':00'; 7 | } else { 8 | return bits[0] + ':00'; 9 | } 10 | } 11 | }, 12 | // 13:00 13 | { re: /^\d{2}[:.]\d{2}$/i, 14 | handler: function(bits) { 15 | return bits[0].replace('.', ':'); 16 | } 17 | }, 18 | // 9:00 19 | { re: /^\d[:.]\d{2}$/i, 20 | handler: function(bits) { 21 | return '0' + bits[0].replace('.', ':'); 22 | } 23 | }, 24 | // 3 am / 3 a.m. / 3am 25 | { re: /^(\d+)\s*([ap])(?:.?m.?)?$/i, 26 | handler: function(bits) { 27 | var hour = parseInt(bits[1]); 28 | if (hour == 12) { 29 | hour = 0; 30 | } 31 | if (bits[2].toLowerCase() == 'p') { 32 | if (hour == 12) { 33 | hour = 0; 34 | } 35 | return (hour + 12) + ':00'; 36 | } else { 37 | if (hour < 10) { 38 | return '0' + hour + ':00'; 39 | } else { 40 | return hour + ':00'; 41 | } 42 | } 43 | } 44 | }, 45 | // 3.30 am / 3:15 a.m. / 3.00am 46 | { re: /^(\d+)[.:](\d{2})\s*([ap]).?m.?$/i, 47 | handler: function(bits) { 48 | var hour = parseInt(bits[1]); 49 | var mins = parseInt(bits[2]); 50 | if (mins < 10) { 51 | mins = '0' + mins; 52 | } 53 | if (hour == 12) { 54 | hour = 0; 55 | } 56 | if (bits[3].toLowerCase() == 'p') { 57 | if (hour == 12) { 58 | hour = 0; 59 | } 60 | return (hour + 12) + ':' + mins; 61 | } else { 62 | if (hour < 10) { 63 | return '0' + hour + ':' + mins; 64 | } else { 65 | return hour + ':' + mins; 66 | } 67 | } 68 | } 69 | }, 70 | // noon 71 | { re: /^no/i, 72 | handler: function(bits) { 73 | return '12:00'; 74 | } 75 | }, 76 | // midnight 77 | { re: /^mid/i, 78 | handler: function(bits) { 79 | return '00:00'; 80 | } 81 | } 82 | ]; 83 | 84 | function parseTimeString(s) { 85 | for (var i = 0; i < timeParsePatterns.length; i++) { 86 | var re = timeParsePatterns[i].re; 87 | var handler = timeParsePatterns[i].handler; 88 | var bits = re.exec(s); 89 | if (bits) { 90 | return handler(bits); 91 | } 92 | } 93 | return s; 94 | } 95 | -------------------------------------------------------------------------------- /nx2django/static/admin/js/urlify.js: -------------------------------------------------------------------------------- 1 | var LATIN_MAP = { 2 | 'À': 'A', 'Á': 'A', 'Â': 'A', 'Ã': 'A', 'Ä': 'A', 'Å': 'A', 'Æ': 'AE', 'Ç': 3 | 'C', 'È': 'E', 'É': 'E', 'Ê': 'E', 'Ë': 'E', 'Ì': 'I', 'Í': 'I', 'Î': 'I', 4 | 'Ï': 'I', 'Ð': 'D', 'Ñ': 'N', 'Ò': 'O', 'Ó': 'O', 'Ô': 'O', 'Õ': 'O', 'Ö': 5 | 'O', 'Ő': 'O', 'Ø': 'O', 'Ù': 'U', 'Ú': 'U', 'Û': 'U', 'Ü': 'U', 'Ű': 'U', 6 | 'Ý': 'Y', 'Þ': 'TH', 'Ÿ': 'Y', 'ß': 'ss', 'à':'a', 'á':'a', 'â': 'a', 'ã': 7 | 'a', 'ä': 'a', 'å': 'a', 'æ': 'ae', 'ç': 'c', 'è': 'e', 'é': 'e', 'ê': 'e', 8 | 'ë': 'e', 'ì': 'i', 'í': 'i', 'î': 'i', 'ï': 'i', 'ð': 'd', 'ñ': 'n', 'ò': 9 | 'o', 'ó': 'o', 'ô': 'o', 'õ': 'o', 'ö': 'o', 'ő': 'o', 'ø': 'o', 'ù': 'u', 10 | 'ú': 'u', 'û': 'u', 'ü': 'u', 'ű': 'u', 'ý': 'y', 'þ': 'th', 'ÿ': 'y' 11 | }; 12 | var LATIN_SYMBOLS_MAP = { 13 | '©':'(c)' 14 | }; 15 | var GREEK_MAP = { 16 | 'α':'a', 'β':'b', 'γ':'g', 'δ':'d', 'ε':'e', 'ζ':'z', 'η':'h', 'θ':'8', 17 | 'ι':'i', 'κ':'k', 'λ':'l', 'μ':'m', 'ν':'n', 'ξ':'3', 'ο':'o', 'π':'p', 18 | 'ρ':'r', 'σ':'s', 'τ':'t', 'υ':'y', 'φ':'f', 'χ':'x', 'ψ':'ps', 'ω':'w', 19 | 'ά':'a', 'έ':'e', 'ί':'i', 'ό':'o', 'ύ':'y', 'ή':'h', 'ώ':'w', 'ς':'s', 20 | 'ϊ':'i', 'ΰ':'y', 'ϋ':'y', 'ΐ':'i', 21 | 'Α':'A', 'Β':'B', 'Γ':'G', 'Δ':'D', 'Ε':'E', 'Ζ':'Z', 'Η':'H', 'Θ':'8', 22 | 'Ι':'I', 'Κ':'K', 'Λ':'L', 'Μ':'M', 'Ν':'N', 'Ξ':'3', 'Ο':'O', 'Π':'P', 23 | 'Ρ':'R', 'Σ':'S', 'Τ':'T', 'Υ':'Y', 'Φ':'F', 'Χ':'X', 'Ψ':'PS', 'Ω':'W', 24 | 'Ά':'A', 'Έ':'E', 'Ί':'I', 'Ό':'O', 'Ύ':'Y', 'Ή':'H', 'Ώ':'W', 'Ϊ':'I', 25 | 'Ϋ':'Y' 26 | }; 27 | var TURKISH_MAP = { 28 | 'ş':'s', 'Ş':'S', 'ı':'i', 'İ':'I', 'ç':'c', 'Ç':'C', 'ü':'u', 'Ü':'U', 29 | 'ö':'o', 'Ö':'O', 'ğ':'g', 'Ğ':'G' 30 | }; 31 | var RUSSIAN_MAP = { 32 | 'а':'a', 'б':'b', 'в':'v', 'г':'g', 'д':'d', 'е':'e', 'ё':'yo', 'ж':'zh', 33 | 'з':'z', 'и':'i', 'й':'j', 'к':'k', 'л':'l', 'м':'m', 'н':'n', 'о':'o', 34 | 'п':'p', 'р':'r', 'с':'s', 'т':'t', 'у':'u', 'ф':'f', 'х':'h', 'ц':'c', 35 | 'ч':'ch', 'ш':'sh', 'щ':'sh', 'ъ':'', 'ы':'y', 'ь':'', 'э':'e', 'ю':'yu', 36 | 'я':'ya', 37 | 'А':'A', 'Б':'B', 'В':'V', 'Г':'G', 'Д':'D', 'Е':'E', 'Ё':'Yo', 'Ж':'Zh', 38 | 'З':'Z', 'И':'I', 'Й':'J', 'К':'K', 'Л':'L', 'М':'M', 'Н':'N', 'О':'O', 39 | 'П':'P', 'Р':'R', 'С':'S', 'Т':'T', 'У':'U', 'Ф':'F', 'Х':'H', 'Ц':'C', 40 | 'Ч':'Ch', 'Ш':'Sh', 'Щ':'Sh', 'Ъ':'', 'Ы':'Y', 'Ь':'', 'Э':'E', 'Ю':'Yu', 41 | 'Я':'Ya' 42 | }; 43 | var UKRAINIAN_MAP = { 44 | 'Є':'Ye', 'І':'I', 'Ї':'Yi', 'Ґ':'G', 'є':'ye', 'і':'i', 'ї':'yi', 'ґ':'g' 45 | }; 46 | var CZECH_MAP = { 47 | 'č':'c', 'ď':'d', 'ě':'e', 'ň': 'n', 'ř':'r', 'š':'s', 'ť':'t', 'ů':'u', 48 | 'ž':'z', 'Č':'C', 'Ď':'D', 'Ě':'E', 'Ň': 'N', 'Ř':'R', 'Š':'S', 'Ť':'T', 49 | 'Ů':'U', 'Ž':'Z' 50 | }; 51 | var POLISH_MAP = { 52 | 'ą':'a', 'ć':'c', 'ę':'e', 'ł':'l', 'ń':'n', 'ó':'o', 'ś':'s', 'ź':'z', 53 | 'ż':'z', 'Ą':'A', 'Ć':'C', 'Ę':'E', 'Ł':'L', 'Ń':'N', 'Ó':'O', 'Ś':'S', 54 | 'Ź':'Z', 'Ż':'Z' 55 | }; 56 | var LATVIAN_MAP = { 57 | 'ā':'a', 'č':'c', 'ē':'e', 'ģ':'g', 'ī':'i', 'ķ':'k', 'ļ':'l', 'ņ':'n', 58 | 'š':'s', 'ū':'u', 'ž':'z', 'Ā':'A', 'Č':'C', 'Ē':'E', 'Ģ':'G', 'Ī':'I', 59 | 'Ķ':'K', 'Ļ':'L', 'Ņ':'N', 'Š':'S', 'Ū':'U', 'Ž':'Z' 60 | }; 61 | var ARABIC_MAP = { 62 | 'أ':'a', 'ب':'b', 'ت':'t', 'ث': 'th', 'ج':'g', 'ح':'h', 'خ':'kh', 'د':'d', 63 | 'ذ':'th', 'ر':'r', 'ز':'z', 'س':'s', 'ش':'sh', 'ص':'s', 'ض':'d', 'ط':'t', 64 | 'ظ':'th', 'ع':'aa', 'غ':'gh', 'ف':'f', 'ق':'k', 'ك':'k', 'ل':'l', 'م':'m', 65 | 'ن':'n', 'ه':'h', 'و':'o', 'ي':'y' 66 | }; 67 | var LITHUANIAN_MAP = { 68 | 'ą':'a', 'č':'c', 'ę':'e', 'ė':'e', 'į':'i', 'š':'s', 'ų':'u', 'ū':'u', 69 | 'ž':'z', 70 | 'Ą':'A', 'Č':'C', 'Ę':'E', 'Ė':'E', 'Į':'I', 'Š':'S', 'Ų':'U', 'Ū':'U', 71 | 'Ž':'Z' 72 | }; 73 | var SERBIAN_MAP = { 74 | 'ђ':'dj', 'ј':'j', 'љ':'lj', 'њ':'nj', 'ћ':'c', 'џ':'dz', 'đ':'dj', 75 | 'Ђ':'Dj', 'Ј':'j', 'Љ':'Lj', 'Њ':'Nj', 'Ћ':'C', 'Џ':'Dz', 'Đ':'Dj' 76 | }; 77 | var AZERBAIJANI_MAP = { 78 | 'ç':'c', 'ə':'e', 'ğ':'g', 'ı':'i', 'ö':'o', 'ş':'s', 'ü':'u', 79 | 'Ç':'C', 'Ə':'E', 'Ğ':'G', 'İ':'I', 'Ö':'O', 'Ş':'S', 'Ü':'U' 80 | }; 81 | 82 | var ALL_DOWNCODE_MAPS = [ 83 | LATIN_MAP, 84 | LATIN_SYMBOLS_MAP, 85 | GREEK_MAP, 86 | TURKISH_MAP, 87 | RUSSIAN_MAP, 88 | UKRAINIAN_MAP, 89 | CZECH_MAP, 90 | POLISH_MAP, 91 | LATVIAN_MAP, 92 | ARABIC_MAP, 93 | LITHUANIAN_MAP, 94 | SERBIAN_MAP, 95 | AZERBAIJANI_MAP 96 | ]; 97 | 98 | var Downcoder = { 99 | 'Initialize': function() { 100 | if (Downcoder.map) { // already made 101 | return; 102 | } 103 | Downcoder.map = {}; 104 | Downcoder.chars = []; 105 | for (var i=0; i .active > a, .nav-list > .active > a:hover { 51 | background: #2C2C2C; 52 | } 53 | 54 | .navbar .dropdown-menu li a, .navbar .dropdown-menu li { 55 | color: #A30000; 56 | } 57 | 58 | .navbar .dropdown-menu li a:hover { 59 | background: #EEEEEE; 60 | color: #C20000; 61 | } 62 | 63 | .pagination>.disabled>a, 64 | .pagination>.disabled>a:hover, 65 | .pagination>.disabled>a:focus { 66 | cursor: not-allowed; 67 | pointer-events: none; 68 | } 69 | 70 | .pager>.disabled>a, 71 | .pager>.disabled>a:hover, 72 | .pager>.disabled>a:focus { 73 | pointer-events: none; 74 | } 75 | 76 | .pager .next { 77 | margin-left: 10px; 78 | } 79 | 80 | /*=== dabapps bootstrap styles ====*/ 81 | 82 | html { 83 | width:100%; 84 | background: none; 85 | } 86 | 87 | /*body, .navbar .container-fluid { 88 | max-width: 1150px; 89 | margin: 0 auto; 90 | }*/ 91 | 92 | body { 93 | background: url("../img/grid.png") repeat-x; 94 | background-attachment: fixed; 95 | } 96 | 97 | #content { 98 | margin: 0; 99 | padding-bottom: 60px; 100 | } 101 | 102 | /* sticky footer and footer */ 103 | html, body { 104 | height: 100%; 105 | } 106 | 107 | .wrapper { 108 | position: relative; 109 | top: 0; 110 | left: 0; 111 | padding-top: 60px; 112 | margin: -60px 0; 113 | min-height: 100%; 114 | } 115 | 116 | .form-switcher { 117 | margin-bottom: 0; 118 | } 119 | 120 | .well { 121 | -webkit-box-shadow: none; 122 | -moz-box-shadow: none; 123 | box-shadow: none; 124 | } 125 | 126 | .well .form-actions { 127 | padding-bottom: 0; 128 | margin-bottom: 0; 129 | } 130 | 131 | .well form { 132 | margin-bottom: 0; 133 | } 134 | 135 | .nav-tabs { 136 | border: 0; 137 | } 138 | 139 | .nav-tabs > li { 140 | float: right; 141 | } 142 | 143 | .nav-tabs li a { 144 | margin-right: 0; 145 | } 146 | 147 | .nav-tabs > .active > a { 148 | background: #F5F5F5; 149 | } 150 | 151 | .nav-tabs > .active > a:hover { 152 | background: #F5F5F5; 153 | } 154 | 155 | .tabbable.first-tab-active .tab-content { 156 | border-top-right-radius: 0; 157 | } 158 | 159 | footer { 160 | position: absolute; 161 | bottom: 0; 162 | left: 0; 163 | clear: both; 164 | z-index: 10; 165 | height: 60px; 166 | width: 95%; 167 | margin: 0 2.5%; 168 | } 169 | 170 | footer p { 171 | text-align: center; 172 | color: gray; 173 | border-top: 1px solid #DDDDDD; 174 | padding-top: 10px; 175 | } 176 | 177 | footer a { 178 | color: gray !important; 179 | font-weight: bold; 180 | } 181 | 182 | footer a:hover { 183 | color: gray; 184 | } 185 | 186 | .page-header { 187 | border-bottom: none; 188 | padding-bottom: 0px; 189 | margin: 0; 190 | } 191 | 192 | /* custom general page styles */ 193 | .hero-unit h1, .hero-unit h2 { 194 | color: #A30000; 195 | } 196 | 197 | body a { 198 | color: #A30000; 199 | } 200 | 201 | body a:hover { 202 | color: #c20000; 203 | } 204 | 205 | .request-info { 206 | clear:both; 207 | } 208 | -------------------------------------------------------------------------------- /nx2django/static/rest_framework/css/default.css: -------------------------------------------------------------------------------- 1 | 2 | /* The navbar is fixed at >= 980px wide, so add padding to the body to prevent 3 | content running up underneath it. */ 4 | 5 | h1 { 6 | font-weight: 500; 7 | } 8 | 9 | h2, h3 { 10 | font-weight: 300; 11 | } 12 | 13 | .resource-description, .response-info { 14 | margin-bottom: 2em; 15 | } 16 | .version:before { 17 | content: "v"; 18 | opacity: 0.6; 19 | padding-right: 0.25em; 20 | } 21 | 22 | .version { 23 | font-size: 70%; 24 | } 25 | 26 | .format-option { 27 | font-family: Menlo, Consolas, "Andale Mono", "Lucida Console", monospace; 28 | } 29 | 30 | .button-form { 31 | float: right; 32 | margin-right: 1em; 33 | } 34 | 35 | ul.breadcrumb { 36 | margin: 70px 0 0 0; 37 | } 38 | 39 | .breadcrumb li.active a { 40 | color: #777; 41 | } 42 | 43 | form select, form input, form textarea { 44 | width: 90%; 45 | } 46 | 47 | form select[multiple] { 48 | height: 150px; 49 | } 50 | 51 | /* To allow tooltips to work on disabled elements */ 52 | .disabled-tooltip-shield { 53 | position: absolute; 54 | top: 0; 55 | right: 0; 56 | bottom: 0; 57 | left: 0; 58 | } 59 | 60 | .errorlist { 61 | margin-top: 0.5em; 62 | } 63 | 64 | pre { 65 | overflow: auto; 66 | word-wrap: normal; 67 | white-space: pre; 68 | font-size: 12px; 69 | } 70 | 71 | .page-header { 72 | border-bottom: none; 73 | padding-bottom: 0px; 74 | } 75 | -------------------------------------------------------------------------------- /nx2django/static/rest_framework/css/prettify.css: -------------------------------------------------------------------------------- 1 | .com { color: #93a1a1; } 2 | .lit { color: #195f91; } 3 | .pun, .opn, .clo { color: #93a1a1; } 4 | .fun { color: #dc322f; } 5 | .str, .atv { color: #D14; } 6 | .kwd, .prettyprint .tag { color: #1e347b; } 7 | .typ, .atn, .dec, .var { color: teal; } 8 | .pln { color: #48484c; } 9 | 10 | .prettyprint { 11 | padding: 8px; 12 | background-color: #f7f7f9; 13 | border: 1px solid #e1e1e8; 14 | } 15 | .prettyprint.linenums { 16 | -webkit-box-shadow: inset 40px 0 0 #fbfbfc, inset 41px 0 0 #ececf0; 17 | -moz-box-shadow: inset 40px 0 0 #fbfbfc, inset 41px 0 0 #ececf0; 18 | box-shadow: inset 40px 0 0 #fbfbfc, inset 41px 0 0 #ececf0; 19 | } 20 | 21 | /* Specify class=linenums on a pre to get line numbering */ 22 | ol.linenums { 23 | margin: 0 0 0 33px; /* IE indents via margin-left */ 24 | } 25 | ol.linenums li { 26 | padding-left: 12px; 27 | color: #bebec5; 28 | line-height: 20px; 29 | text-shadow: 0 1px 0 #fff; 30 | } -------------------------------------------------------------------------------- /nx2django/static/rest_framework/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phodal/django-elasticsearch/a80f5067fc8f57edf64da809471315a53c5942c7/nx2django/static/rest_framework/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /nx2django/static/rest_framework/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phodal/django-elasticsearch/a80f5067fc8f57edf64da809471315a53c5942c7/nx2django/static/rest_framework/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /nx2django/static/rest_framework/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phodal/django-elasticsearch/a80f5067fc8f57edf64da809471315a53c5942c7/nx2django/static/rest_framework/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /nx2django/static/rest_framework/img/glyphicons-halflings-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phodal/django-elasticsearch/a80f5067fc8f57edf64da809471315a53c5942c7/nx2django/static/rest_framework/img/glyphicons-halflings-white.png -------------------------------------------------------------------------------- /nx2django/static/rest_framework/img/glyphicons-halflings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phodal/django-elasticsearch/a80f5067fc8f57edf64da809471315a53c5942c7/nx2django/static/rest_framework/img/glyphicons-halflings.png -------------------------------------------------------------------------------- /nx2django/static/rest_framework/img/grid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phodal/django-elasticsearch/a80f5067fc8f57edf64da809471315a53c5942c7/nx2django/static/rest_framework/img/grid.png -------------------------------------------------------------------------------- /nx2django/static/rest_framework/js/bootstrap.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap v3.2.0 (http://getbootstrap.com) 3 | * Copyright 2011-2014 Twitter, Inc. 4 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 5 | */ 6 | if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]};return!1}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one("bsTransitionEnd",function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b(),a.support.transition&&(a.event.special.bsTransitionEnd={bindType:a.support.transition.end,delegateType:a.support.transition.end,handle:function(b){return a(b.target).is(this)?b.handleObj.handler.apply(this,arguments):void 0}})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var c=a(this),e=c.data("bs.alert");e||c.data("bs.alert",e=new d(this)),"string"==typeof b&&e[b].call(c)})}var c='[data-dismiss="alert"]',d=function(b){a(b).on("click",c,this.close)};d.VERSION="3.2.0",d.prototype.close=function(b){function c(){f.detach().trigger("closed.bs.alert").remove()}var d=a(this),e=d.attr("data-target");e||(e=d.attr("href"),e=e&&e.replace(/.*(?=#[^\s]*$)/,""));var f=a(e);b&&b.preventDefault(),f.length||(f=d.hasClass("alert")?d:d.parent()),f.trigger(b=a.Event("close.bs.alert")),b.isDefaultPrevented()||(f.removeClass("in"),a.support.transition&&f.hasClass("fade")?f.one("bsTransitionEnd",c).emulateTransitionEnd(150):c())};var e=a.fn.alert;a.fn.alert=b,a.fn.alert.Constructor=d,a.fn.alert.noConflict=function(){return a.fn.alert=e,this},a(document).on("click.bs.alert.data-api",c,d.prototype.close)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.button"),f="object"==typeof b&&b;e||d.data("bs.button",e=new c(this,f)),"toggle"==b?e.toggle():b&&e.setState(b)})}var c=function(b,d){this.$element=a(b),this.options=a.extend({},c.DEFAULTS,d),this.isLoading=!1};c.VERSION="3.2.0",c.DEFAULTS={loadingText:"loading..."},c.prototype.setState=function(b){var c="disabled",d=this.$element,e=d.is("input")?"val":"html",f=d.data();b+="Text",null==f.resetText&&d.data("resetText",d[e]()),d[e](null==f[b]?this.options[b]:f[b]),setTimeout(a.proxy(function(){"loadingText"==b?(this.isLoading=!0,d.addClass(c).attr(c,c)):this.isLoading&&(this.isLoading=!1,d.removeClass(c).removeAttr(c))},this),0)},c.prototype.toggle=function(){var a=!0,b=this.$element.closest('[data-toggle="buttons"]');if(b.length){var c=this.$element.find("input");"radio"==c.prop("type")&&(c.prop("checked")&&this.$element.hasClass("active")?a=!1:b.find(".active").removeClass("active")),a&&c.prop("checked",!this.$element.hasClass("active")).trigger("change")}a&&this.$element.toggleClass("active")};var d=a.fn.button;a.fn.button=b,a.fn.button.Constructor=c,a.fn.button.noConflict=function(){return a.fn.button=d,this},a(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(c){var d=a(c.target);d.hasClass("btn")||(d=d.closest(".btn")),b.call(d,"toggle"),c.preventDefault()})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.carousel"),f=a.extend({},c.DEFAULTS,d.data(),"object"==typeof b&&b),g="string"==typeof b?b:f.slide;e||d.data("bs.carousel",e=new c(this,f)),"number"==typeof b?e.to(b):g?e[g]():f.interval&&e.pause().cycle()})}var c=function(b,c){this.$element=a(b).on("keydown.bs.carousel",a.proxy(this.keydown,this)),this.$indicators=this.$element.find(".carousel-indicators"),this.options=c,this.paused=this.sliding=this.interval=this.$active=this.$items=null,"hover"==this.options.pause&&this.$element.on("mouseenter.bs.carousel",a.proxy(this.pause,this)).on("mouseleave.bs.carousel",a.proxy(this.cycle,this))};c.VERSION="3.2.0",c.DEFAULTS={interval:5e3,pause:"hover",wrap:!0},c.prototype.keydown=function(a){switch(a.which){case 37:this.prev();break;case 39:this.next();break;default:return}a.preventDefault()},c.prototype.cycle=function(b){return b||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},c.prototype.getItemIndex=function(a){return this.$items=a.parent().children(".item"),this.$items.index(a||this.$active)},c.prototype.to=function(b){var c=this,d=this.getItemIndex(this.$active=this.$element.find(".item.active"));return b>this.$items.length-1||0>b?void 0:this.sliding?this.$element.one("slid.bs.carousel",function(){c.to(b)}):d==b?this.pause().cycle():this.slide(b>d?"next":"prev",a(this.$items[b]))},c.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},c.prototype.next=function(){return this.sliding?void 0:this.slide("next")},c.prototype.prev=function(){return this.sliding?void 0:this.slide("prev")},c.prototype.slide=function(b,c){var d=this.$element.find(".item.active"),e=c||d[b](),f=this.interval,g="next"==b?"left":"right",h="next"==b?"first":"last",i=this;if(!e.length){if(!this.options.wrap)return;e=this.$element.find(".item")[h]()}if(e.hasClass("active"))return this.sliding=!1;var j=e[0],k=a.Event("slide.bs.carousel",{relatedTarget:j,direction:g});if(this.$element.trigger(k),!k.isDefaultPrevented()){if(this.sliding=!0,f&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var l=a(this.$indicators.children()[this.getItemIndex(e)]);l&&l.addClass("active")}var m=a.Event("slid.bs.carousel",{relatedTarget:j,direction:g});return a.support.transition&&this.$element.hasClass("slide")?(e.addClass(b),e[0].offsetWidth,d.addClass(g),e.addClass(g),d.one("bsTransitionEnd",function(){e.removeClass([b,g].join(" ")).addClass("active"),d.removeClass(["active",g].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger(m)},0)}).emulateTransitionEnd(1e3*d.css("transition-duration").slice(0,-1))):(d.removeClass("active"),e.addClass("active"),this.sliding=!1,this.$element.trigger(m)),f&&this.cycle(),this}};var d=a.fn.carousel;a.fn.carousel=b,a.fn.carousel.Constructor=c,a.fn.carousel.noConflict=function(){return a.fn.carousel=d,this},a(document).on("click.bs.carousel.data-api","[data-slide], [data-slide-to]",function(c){var d,e=a(this),f=a(e.attr("data-target")||(d=e.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,""));if(f.hasClass("carousel")){var g=a.extend({},f.data(),e.data()),h=e.attr("data-slide-to");h&&(g.interval=!1),b.call(f,g),h&&f.data("bs.carousel").to(h),c.preventDefault()}}),a(window).on("load",function(){a('[data-ride="carousel"]').each(function(){var c=a(this);b.call(c,c.data())})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.collapse"),f=a.extend({},c.DEFAULTS,d.data(),"object"==typeof b&&b);!e&&f.toggle&&"show"==b&&(b=!b),e||d.data("bs.collapse",e=new c(this,f)),"string"==typeof b&&e[b]()})}var c=function(b,d){this.$element=a(b),this.options=a.extend({},c.DEFAULTS,d),this.transitioning=null,this.options.parent&&(this.$parent=a(this.options.parent)),this.options.toggle&&this.toggle()};c.VERSION="3.2.0",c.DEFAULTS={toggle:!0},c.prototype.dimension=function(){var a=this.$element.hasClass("width");return a?"width":"height"},c.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var c=a.Event("show.bs.collapse");if(this.$element.trigger(c),!c.isDefaultPrevented()){var d=this.$parent&&this.$parent.find("> .panel > .in");if(d&&d.length){var e=d.data("bs.collapse");if(e&&e.transitioning)return;b.call(d,"hide"),e||d.data("bs.collapse",null)}var f=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[f](0),this.transitioning=1;var g=function(){this.$element.removeClass("collapsing").addClass("collapse in")[f](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return g.call(this);var h=a.camelCase(["scroll",f].join("-"));this.$element.one("bsTransitionEnd",a.proxy(g,this)).emulateTransitionEnd(350)[f](this.$element[0][h])}}},c.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var b=a.Event("hide.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.dimension();this.$element[c](this.$element[c]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse").removeClass("in"),this.transitioning=1;var d=function(){this.transitioning=0,this.$element.trigger("hidden.bs.collapse").removeClass("collapsing").addClass("collapse")};return a.support.transition?void this.$element[c](0).one("bsTransitionEnd",a.proxy(d,this)).emulateTransitionEnd(350):d.call(this)}}},c.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()};var d=a.fn.collapse;a.fn.collapse=b,a.fn.collapse.Constructor=c,a.fn.collapse.noConflict=function(){return a.fn.collapse=d,this},a(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(c){var d,e=a(this),f=e.attr("data-target")||c.preventDefault()||(d=e.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,""),g=a(f),h=g.data("bs.collapse"),i=h?"toggle":e.data(),j=e.attr("data-parent"),k=j&&a(j);h&&h.transitioning||(k&&k.find('[data-toggle="collapse"][data-parent="'+j+'"]').not(e).addClass("collapsed"),e[g.hasClass("in")?"addClass":"removeClass"]("collapsed")),b.call(g,i)})}(jQuery),+function(a){"use strict";function b(b){b&&3===b.which||(a(e).remove(),a(f).each(function(){var d=c(a(this)),e={relatedTarget:this};d.hasClass("open")&&(d.trigger(b=a.Event("hide.bs.dropdown",e)),b.isDefaultPrevented()||d.removeClass("open").trigger("hidden.bs.dropdown",e))}))}function c(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#[A-Za-z]/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}function d(b){return this.each(function(){var c=a(this),d=c.data("bs.dropdown");d||c.data("bs.dropdown",d=new g(this)),"string"==typeof b&&d[b].call(c)})}var e=".dropdown-backdrop",f='[data-toggle="dropdown"]',g=function(b){a(b).on("click.bs.dropdown",this.toggle)};g.VERSION="3.2.0",g.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=c(e),g=f.hasClass("open");if(b(),!g){"ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a('