├── .gitignore ├── Django REST framework快速入门.pptx ├── README.md ├── _config.yml ├── course ├── __init__.py ├── admin.py ├── apps.py ├── migrations │ ├── 0001_initial.py │ └── __init__.py ├── models.py ├── permissions.py ├── serializers.py ├── tests.py ├── urls.py └── views.py ├── db.sqlite3 ├── drf-tutorial ├── __init__.py ├── settings.py ├── urls.py └── wsgi.py ├── manage.py ├── requirements.txt └── static ├── DRF进阶与实战.png ├── admin ├── css │ ├── autocomplete.css │ ├── base.css │ ├── changelists.css │ ├── dashboard.css │ ├── fonts.css │ ├── forms.css │ ├── login.css │ ├── responsive.css │ ├── responsive_rtl.css │ ├── rtl.css │ ├── vendor │ │ └── select2 │ │ │ ├── LICENSE-SELECT2.md │ │ │ ├── select2.css │ │ │ └── select2.min.css │ └── widgets.css ├── fonts │ ├── LICENSE.txt │ ├── README.txt │ ├── Roboto-Bold-webfont.woff │ ├── Roboto-Light-webfont.woff │ └── Roboto-Regular-webfont.woff ├── img │ ├── LICENSE │ ├── README.txt │ ├── calendar-icons.svg │ ├── gis │ │ ├── move_vertex_off.svg │ │ └── move_vertex_on.svg │ ├── icon-addlink.svg │ ├── icon-alert.svg │ ├── icon-calendar.svg │ ├── icon-changelink.svg │ ├── icon-clock.svg │ ├── icon-deletelink.svg │ ├── icon-no.svg │ ├── icon-unknown-alt.svg │ ├── icon-unknown.svg │ ├── icon-viewlink.svg │ ├── icon-yes.svg │ ├── inline-delete.svg │ ├── search.svg │ ├── selector-icons.svg │ ├── sorting-icons.svg │ ├── tooltag-add.svg │ └── tooltag-arrowright.svg └── js │ ├── SelectBox.js │ ├── SelectFilter2.js │ ├── actions.js │ ├── actions.min.js │ ├── admin │ ├── DateTimeShortcuts.js │ └── RelatedObjectLookups.js │ ├── autocomplete.js │ ├── calendar.js │ ├── cancel.js │ ├── change_form.js │ ├── collapse.js │ ├── collapse.min.js │ ├── core.js │ ├── inlines.js │ ├── inlines.min.js │ ├── jquery.init.js │ ├── popup_response.js │ ├── prepopulate.js │ ├── prepopulate.min.js │ ├── prepopulate_init.js │ ├── urlify.js │ └── vendor │ ├── jquery │ ├── LICENSE.txt │ ├── jquery.js │ └── jquery.min.js │ ├── select2 │ ├── LICENSE.md │ ├── i18n │ │ ├── af.js │ │ ├── ar.js │ │ ├── az.js │ │ ├── bg.js │ │ ├── bn.js │ │ ├── bs.js │ │ ├── ca.js │ │ ├── cs.js │ │ ├── da.js │ │ ├── de.js │ │ ├── dsb.js │ │ ├── el.js │ │ ├── en.js │ │ ├── es.js │ │ ├── et.js │ │ ├── eu.js │ │ ├── fa.js │ │ ├── fi.js │ │ ├── fr.js │ │ ├── gl.js │ │ ├── he.js │ │ ├── hi.js │ │ ├── hr.js │ │ ├── hsb.js │ │ ├── hu.js │ │ ├── hy.js │ │ ├── id.js │ │ ├── is.js │ │ ├── it.js │ │ ├── ja.js │ │ ├── ka.js │ │ ├── km.js │ │ ├── ko.js │ │ ├── lt.js │ │ ├── lv.js │ │ ├── mk.js │ │ ├── ms.js │ │ ├── nb.js │ │ ├── ne.js │ │ ├── nl.js │ │ ├── pl.js │ │ ├── ps.js │ │ ├── pt-BR.js │ │ ├── pt.js │ │ ├── ro.js │ │ ├── ru.js │ │ ├── sk.js │ │ ├── sl.js │ │ ├── sq.js │ │ ├── sr-Cyrl.js │ │ ├── sr.js │ │ ├── sv.js │ │ ├── th.js │ │ ├── tk.js │ │ ├── tr.js │ │ ├── uk.js │ │ ├── vi.js │ │ ├── zh-CN.js │ │ └── zh-TW.js │ ├── select2.full.js │ └── select2.full.min.js │ └── xregexp │ ├── LICENSE.txt │ ├── xregexp.js │ └── xregexp.min.js ├── drf-tutorial.png └── rest_framework ├── css ├── bootstrap-theme.min.css ├── bootstrap-tweaks.css ├── bootstrap.min.css ├── default.css ├── font-awesome-4.0.3.css └── prettify.css ├── docs ├── css │ ├── base.css │ ├── highlight.css │ └── jquery.json-view.min.css ├── img │ ├── favicon.ico │ └── grid.png └── js │ ├── api.js │ ├── highlight.pack.js │ └── jquery.json-view.min.js ├── fonts ├── fontawesome-webfont.eot ├── fontawesome-webfont.svg ├── fontawesome-webfont.ttf ├── fontawesome-webfont.woff ├── glyphicons-halflings-regular.eot ├── glyphicons-halflings-regular.svg ├── glyphicons-halflings-regular.ttf ├── glyphicons-halflings-regular.woff └── glyphicons-halflings-regular.woff2 ├── img ├── glyphicons-halflings-white.png ├── glyphicons-halflings.png └── grid.png └── js ├── ajax-form.js ├── bootstrap.min.js ├── coreapi-0.1.1.js ├── csrf.js ├── default.js ├── jquery-3.4.1.min.js └── prettify-min.js /.gitignore: -------------------------------------------------------------------------------- 1 | ### Python template 2 | # Byte-compiled / optimized / DLL files 3 | __pycache__/ 4 | *.py[cod] 5 | *$py.class 6 | 7 | # C extensions 8 | *.so 9 | 10 | # Distribution / packaging 11 | .Python 12 | build/ 13 | develop-eggs/ 14 | dist/ 15 | downloads/ 16 | eggs/ 17 | .eggs/ 18 | lib/ 19 | lib64/ 20 | parts/ 21 | sdist/ 22 | var/ 23 | wheels/ 24 | *.egg-info/ 25 | .installed.cfg 26 | *.egg 27 | MANIFEST 28 | 29 | # PyInstaller 30 | # Usually these files are written by a python script from a template 31 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 32 | *.manifest 33 | *.spec 34 | 35 | # Installer logs 36 | pip-log.txt 37 | pip-delete-this-directory.txt 38 | 39 | # Unit test / coverage reports 40 | htmlcov/ 41 | .tox/ 42 | .coverage 43 | .coverage.* 44 | .cache 45 | nosetests.xml 46 | coverage.xml 47 | *.cover 48 | .hypothesis/ 49 | 50 | # Translations 51 | *.mo 52 | *.pot 53 | 54 | # Sphinx documentation 55 | docs/_build/ 56 | 57 | # PyBuilder 58 | target/ 59 | 60 | # pyenv 61 | .python-version 62 | 63 | # celery beat schedule file 64 | celerybeat-schedule 65 | 66 | # Environments 67 | .venv 68 | venv/ 69 | ENV/ 70 | .envs/* 71 | env.bak/ 72 | venv.bak/ 73 | 74 | # Rope project settings 75 | .ropeproject 76 | 77 | # mkdocs documentation 78 | /site 79 | 80 | # godie 81 | .godie_cache/ 82 | 83 | # Logs 84 | /logs/ 85 | *.log 86 | 87 | # Runtime data 88 | pids 89 | *.pid 90 | *.seed 91 | *.pid.lock 92 | 93 | # Directory for instrumented libs generated by jscoverage/JSCover 94 | lib-cov 95 | 96 | # Coverage directory used by tools like istanbul 97 | coverage 98 | 99 | # nyc test coverage 100 | .nyc_output 101 | 102 | # Bower dependency directory (https://bower.io/) 103 | bower_components 104 | 105 | # node-waf configuration 106 | .lock-wscript 107 | 108 | # Compiled binary addons (http://nodejs.org/api/addons.html) 109 | build/Release 110 | 111 | # Dependency directories 112 | node_modules/ 113 | jspm_packages/ 114 | 115 | # Typescript v1 declaration files 116 | typings/ 117 | 118 | # Optional npm cache directory 119 | .npm 120 | 121 | # Optional eslint cache 122 | .eslintcache 123 | 124 | # Optional REPL history 125 | .node_repl_history 126 | 127 | # Output of "npm pack" 128 | *.tgz 129 | 130 | # Yarn Integrity file 131 | .yarn-integrity 132 | 133 | 134 | ### Linux template 135 | *~ 136 | 137 | # temporary files which can be created if a process still has a handle open of a deleted file 138 | .fuse_hidden* 139 | 140 | # KDE directory preferences 141 | .directory 142 | 143 | # Linux trash folder which might appear on any partition or disk 144 | .Trash-* 145 | 146 | # .nfs files are created when an open file is removed but is still being accessed 147 | .nfs* 148 | 149 | 150 | ### Project template 151 | .pytest_cache/ 152 | .ipython/ 153 | 154 | # Django stuff: 155 | godie/static/ 156 | godie/staticfiles/ 157 | godie/media/ 158 | .static_storage/ 159 | 160 | # Flask stuff: 161 | instance/ 162 | .webassets-cache 163 | 164 | # Scrapy stuff: 165 | .scrapy 166 | 167 | # Jupyter Notebook 168 | .ipynb_checkpoints 169 | 170 | # SageMath parsed files 171 | *.sage.py 172 | 173 | # Spyder project settings 174 | .spyderproject 175 | .spyproject 176 | 177 | # pycharm 178 | /.idea/ 179 | -------------------------------------------------------------------------------- /Django REST framework快速入门.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liaogx/drf-tutorial/4e12b1c5da56be4180328193fc9dbe1245d48dbb/Django REST framework快速入门.pptx -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Django REST framework快速入门 2 | 3 | > 快速入门Django REST framework,学会开发一套自己的Restful API服务,并且自动生成API文档 4 | 5 | ![drf-tutorial](./static/drf-tutorial.png) 6 | 7 | ​ API接口开发无需费时费力,本课程将从零开始引导同学们快速开发自己的Restful API接口,从Django项目环境搭建、API接口生成数据、Postman接口测试到DRF认证方式的讲解,通过一个典型的课程信息接口(含增删改查),给同学们讲解完DRF中的序列化(serializers)、视图(viewsets)、路由(routers)、认证(authentication)、权限(permission),为将来前后端分离项目的开发打下基础。 8 | 9 | ### 课程9个核心技术点 10 | 11 | 1. 深入理解什么是Restful API 12 | 2. Django REST framework组件介绍 13 | 3. DRF中的序列化Serializers 14 | 4. Django的views开发API接口 15 | 5. DRF的多种视图api_view/APIView/GenericAPIView/viewsets 16 | 6. Django的URLs与DRF的Routers 17 | 7. 如何使用DRF的API接口文档 18 | 8. API测试神器Postman 19 | 9. DRF的认证和权限 20 | 21 | ### 适合人群 22 | 23 | 24 | ​ 任何想学习Python前后端分离项目开发的同学。熟练Python语法,有Django项目基础。 25 | 26 | ### 第一章 课程介绍 27 | 28 | #### 1.1 课程内容与导学 29 | 30 | ​ 介绍本课程的学习内容和目标,如何学习本课程,引导学生对Django REST framework有一个基础的了解,并能够在课程结束后独立使用DRF完成简单的Restful API接口开发。 31 | 32 | ### 第二章 Django REST framework介绍和项目准备 33 | 34 | #### 2.1 前后端分离介绍 35 | 36 | ​ 前后端分离与不分离的区别,前后端分离项目的优劣。 37 | 38 | #### 2.2 深入理解什么是RESTful API 39 | 40 | ​ REST API介绍,RESTful API接口设计的规范,有哪些最佳实践。 41 | 42 | #### 2.3 Pycharm搭建项目开发环境 43 | 44 | ​ 搭建Django项目开发环境,如何在Pycharm中设置Django server,点击“run”就直接运行项目。 45 | 46 | #### 2.4 Django REST framework介绍和安装 47 | 48 | ​ Django REST framework的组件介绍,让大家对DRF有一个初步的了解;安装DRF以及coreapi,Markdown等,介绍各自的功能场景。 49 | 50 | ### 第三章 DRF中的序列化Serializers 51 | 52 | #### 3.1 开发课程信息模型类 53 | 54 | ​ 创建课程应用,课程信息的模型类开发,讲解各字段和参数的含义,生成数据表。 55 | 56 | #### 3.2 什么是序列化 57 | 58 | ​ 序列化介绍,序列化对象与反序列化对象的概念,如何重写.save()方法保存实例,如何使用验证器。 59 | 60 | #### 3.3 如何继承ModelSerializer序列化模型类 61 | 62 | ​ 讲解如何序列化模型类中指定字段,关系字段的序列化深度,指定只读字段。 63 | 64 | #### 3.4 带URL的HyperlinkedModelSerializer 65 | 66 | ​ 实现带URL字段的序列化结果,绝对和相对URL,如何更改URL字段名称。 67 | 68 | ### 第四章 DRF的视图和路由 69 | 70 | #### 4.1 Django的views开发RESTful API接口 71 | 72 | ​ 讲解Django的views开发课程信息的CRUD接口,包括函数视图,类视图,通用类视图分别怎么写。 73 | 74 | #### 4.2 DRF中的装饰器api_view 75 | 76 | ​ 如何使用api_view装饰函数,响应对应的HTTP方法,对比学习Django的FBV。 77 | 78 | #### 4.3 如何使用Postman测试API接口 79 | 80 | ​ Postman安装和介绍,演示如何使用Postman测试前面课程信息的Restfu API接口。 81 | 82 | #### 4.4 DRF中的视图APIView 83 | 84 | ​ 如何使用类视图APIView开发RESTful API接口,Response的处理。 85 | 86 | #### 4.5 DRF中的通用类视图GenericAPIView 87 | 88 | ​ 如何使用GenericAPIView开发RESTful API接口,mixin与多种通用CRUD类视图的继承关系。 89 | 90 | #### 4.6 DRF的viewsets开发课程信息的增删改查接口 91 | 92 | ​ 讲解DRF的viewsets开发课程信息的CRUD接口,与上一小节对比学习,演示DRF写RESTful API接口的效率。 93 | 94 | #### 4.7 Django的URLs与DRF的Routers 95 | 96 | ​ 讲解Django中urlpatterns的写法,路由课程信息接口,以及如何使用DRF的Routers更快更省事。 97 | 98 | ### 第五章 DRF的认证和权限 99 | 100 | #### 5.1 DRF认证方式介绍 101 | 102 | ​ 讲解常用的认证方式BasicAuthentication和SessionAuthentication,认证过程,请求头和响应头的变化。 103 | 104 | #### 5.2 Django信号机制自动生成Token 105 | 106 | ​ TokenAuthentication介绍和配置,如何使用Django信号机制为用户自动生成Token,提供获取Token的API接口。 107 | 108 | #### 5.3 DRF的权限控制 109 | 110 | ​ 讲解权限检测后的处理,认证URL设置,全局权限控制与ViewSet的权限。 111 | 112 | ### 第六章 如何使用DRF的API接口文档 113 | 114 | #### 6.1 如何生成API接口文档 115 | 116 | ​ 设置DEFAULT_SCHEMA_CLASS和docs路由,访问文档页面。 117 | 118 | #### 6.2 DRF的概要使用方法介绍 119 | 120 | ​ DRF的概要功能讲解,如何配置认证,如何与接口数据交互。 121 | 122 | ### 第七章 课程总结 123 | 124 | #### 7.1 课程总结 125 | 126 | ​ 三种视图开发方式的比较,给未来的实战课来个预告。 127 | 128 | ![drf-tutorial](./static/DRF进阶与实战.png) 129 | -------------------------------------------------------------------------------- /_config.yml: -------------------------------------------------------------------------------- 1 | theme: jekyll-theme-minimal -------------------------------------------------------------------------------- /course/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liaogx/drf-tutorial/4e12b1c5da56be4180328193fc9dbe1245d48dbb/course/__init__.py -------------------------------------------------------------------------------- /course/admin.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | # -*- coding:utf-8 -*- 3 | # __author__ = "__Jack__" 4 | 5 | 6 | from django.contrib import admin 7 | 8 | from .models import Course 9 | 10 | 11 | @admin.register(Course) 12 | class CourseAdmin(admin.ModelAdmin): 13 | list_display = ("name", "introduction", "teacher", "price") 14 | search_fields = list_display 15 | list_filter = list_display 16 | -------------------------------------------------------------------------------- /course/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class CourseConfig(AppConfig): 5 | name = "course" 6 | verbose_name = "课程信息" 7 | -------------------------------------------------------------------------------- /course/migrations/0001_initial.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.0.2 on 2020-05-11 21:28 2 | 3 | import django.db.models.deletion 4 | from django.conf import settings 5 | from django.db import migrations, models 6 | 7 | 8 | class Migration(migrations.Migration): 9 | initial = True 10 | 11 | dependencies = [ 12 | migrations.swappable_dependency(settings.AUTH_USER_MODEL), 13 | ] 14 | 15 | operations = [ 16 | migrations.CreateModel( 17 | name='Course', 18 | fields=[ 19 | ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), 20 | ('name', models.CharField(max_length=255, unique=True, help_text='课程名称', verbose_name='名称')), 21 | ('introduction', models.TextField( help_text='课程简介', verbose_name='简介')), 22 | ('price', models.DecimalField(decimal_places=2, max_digits=6, help_text='课程价格', verbose_name='价格')), 23 | ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')), 24 | ('updated_at', models.DateTimeField(auto_now=True, verbose_name='更新时间')), 25 | ('teacher', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, 26 | help_text='课程讲师', verbose_name='讲师')), 27 | ], 28 | options={'ordering': ('price',), 'verbose_name': '课程信息', 'verbose_name_plural': '课程信息'}, 29 | ), 30 | ] 31 | -------------------------------------------------------------------------------- /course/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liaogx/drf-tutorial/4e12b1c5da56be4180328193fc9dbe1245d48dbb/course/migrations/__init__.py -------------------------------------------------------------------------------- /course/models.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | # -*- coding:utf-8 -*- 3 | # __author__ = "__Jack__" 4 | 5 | from django.conf import settings 6 | from django.db import models 7 | 8 | 9 | class Course(models.Model): 10 | name = models.CharField(max_length=255, unique=True, help_text="课程名称", verbose_name="名称") 11 | introduction = models.TextField(help_text="课程简介", verbose_name="简介") 12 | teacher = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE, 13 | help_text="课程讲师", verbose_name="讲师") 14 | price = models.DecimalField(max_digits=6, decimal_places=2, help_text="课程价格", verbose_name="价格") 15 | created_at = models.DateTimeField(auto_now_add=True, verbose_name="创建时间") 16 | updated_at = models.DateTimeField(auto_now=True, verbose_name="更新时间") 17 | 18 | class Meta: 19 | verbose_name = "课程信息" 20 | verbose_name_plural = verbose_name 21 | ordering = ("price",) 22 | 23 | def __str__(self): 24 | return self.name 25 | -------------------------------------------------------------------------------- /course/permissions.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | # -*- coding:utf-8 -*- 3 | # __author__ = "__Jack__" 4 | 5 | 6 | from rest_framework import permissions 7 | 8 | 9 | class IsOwnerOrReadOnly(permissions.BasePermission): 10 | """自定义权限:只允许对象的所有者能够编辑""" 11 | 12 | def has_object_permission(self, request, view, obj): 13 | """ 14 | 所有的request请求都有读权限,因此一律允许GET/HEAD/OPTIONS方法 15 | :param request: 16 | :param view: 17 | :param obj: 18 | :return: bool 19 | """ 20 | if request.method in permissions.SAFE_METHODS: # SAFE_METHODS = ("GET", "HEAD", "OPTIONS") 21 | return True 22 | # 对象的所有者才有写权限 23 | return obj.teacher == request.user 24 | -------------------------------------------------------------------------------- /course/serializers.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | # -*- coding:utf-8 -*- 3 | # __author__ = "__Jack__" 4 | 5 | 6 | from django import forms 7 | from django.contrib.auth.models import User 8 | from rest_framework import serializers 9 | 10 | from .models import Course 11 | 12 | 13 | class CourseForm(forms.ModelForm): 14 | class Meta: 15 | model = Course 16 | fields = ('name', 'introduction', 'teacher', 'price') 17 | 18 | 19 | class UserSerializer(serializers.ModelSerializer): 20 | class Meta: 21 | model = User 22 | fields = '__all__' 23 | 24 | 25 | class CourseSerializer(serializers.ModelSerializer): 26 | teacher = serializers.ReadOnlyField(source='teacher.username') # 外键字段 只读 27 | 28 | class Meta: 29 | model = Course # 写法和上面的CourseForm类似 30 | # exclude = ('id', ) # 注意元组中只有1个元素时不能写成("id") 31 | # fields = ('id', 'name', 'introduction', 'teacher', 'price', 'created_at', 'updated_at') 32 | fields = '__all__' 33 | depth = 2 34 | 35 | # class CourseSerializer(serializers.HyperlinkedModelSerializer): 36 | # teacher = serializers.ReadOnlyField(source='teacher.username') 37 | # 38 | # class Meta: 39 | # model = Course 40 | # # url是默认值,可在settings.py中设置URL_FIELD_NAME使全局生效 41 | # fields = ('id', 'url', 'name', 'introduction', 'teacher', 'price', 'created_at', 'updated_at') 42 | -------------------------------------------------------------------------------- /course/tests.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | # -*- coding:utf-8 -*- 3 | # __author__ = "__Jack__" 4 | -------------------------------------------------------------------------------- /course/urls.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | # -*- coding:utf-8 -*- 3 | # __author__ = "__Jack__" 4 | 5 | from django.urls import path, include 6 | from rest_framework.routers import DefaultRouter 7 | 8 | from course import views 9 | 10 | router = DefaultRouter() 11 | router.register(prefix="viewsets", viewset=views.CourseViewSet) 12 | 13 | urlpatterns = [ 14 | # Function Based View 15 | path("fbv/list/", views.course_list, name="fbv-list"), 16 | path("fbv/detail//", views.course_detail, name="fbv-detail"), 17 | 18 | # Class Based View 19 | path("cbv/list/", views.CourseList.as_view(), name="cbv-list"), 20 | path("cbv/detail//", views.CourseDetail.as_view(), name="cbv-detail"), 21 | 22 | # Generic Class Based View 23 | path("gcbv/list/", views.GCourseList.as_view(), name="gcbv-list"), 24 | path("gcbv/detail//", views.GCourseDetail.as_view(), name="gcbv-detail"), 25 | 26 | # DRF viewsets 27 | # path("viewsets/", views.CourseViewSet.as_view( 28 | # {"get": "list", "post": "create"} 29 | # ), name="viewsets-list"), 30 | # path("viewsets//", views.CourseViewSet.as_view( 31 | # {"get": "retrieve", "put": "update", "patch": "partial_update", "delete": "destroy"} 32 | # ), name="viewsets-detail"), 33 | 34 | path("", include(router.urls)) 35 | ] 36 | -------------------------------------------------------------------------------- /course/views.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | # -*- coding:utf-8 -*- 3 | # __author__ = "__Jack__" 4 | 5 | from django.conf import settings 6 | from django.db.models.signals import post_save 7 | from django.dispatch import receiver 8 | from rest_framework import generics, viewsets 9 | from rest_framework import status 10 | from rest_framework.authentication import BasicAuthentication, SessionAuthentication, TokenAuthentication 11 | from rest_framework.authtoken.models import Token 12 | from rest_framework.decorators import api_view, authentication_classes, permission_classes 13 | from rest_framework.permissions import IsAuthenticated 14 | from rest_framework.response import Response 15 | from rest_framework.views import APIView 16 | 17 | from .models import Course 18 | from .permissions import IsOwnerOrReadOnly 19 | from .serializers import CourseSerializer 20 | 21 | 22 | @receiver(post_save, sender=settings.AUTH_USER_MODEL) # Django的信号机制 23 | def generate_token(sender, instance=None, created=False, **kwargs): 24 | """ 25 | 创建用户时自动生成Token 26 | :param sender: 27 | :param instance: 28 | :param created: 29 | :param kwargs: 30 | :return: 31 | """ 32 | if created: 33 | Token.objects.create(user=instance) 34 | 35 | 36 | """一、 函数式编程 Function Based View""" 37 | 38 | 39 | @api_view(["GET", "POST"]) 40 | @authentication_classes((BasicAuthentication, SessionAuthentication, TokenAuthentication)) 41 | @permission_classes((IsAuthenticated,)) 42 | def course_list(request): 43 | """ 44 | 获取所有课程信息或新增一个课程 45 | :param request: 46 | :return: 47 | """ 48 | if request.method == "GET": 49 | s = CourseSerializer(instance=Course.objects.all(), many=True) 50 | return Response(data=s.data, status=status.HTTP_200_OK) 51 | 52 | elif request.method == "POST": 53 | s = CourseSerializer(data=request.data) # 部分更新用partial=True属性 54 | if s.is_valid(): 55 | s.save(teacher=request.user) 56 | return Response(data=s.data, status=status.HTTP_201_CREATED) 57 | return Response(s.errors, status=status.HTTP_400_BAD_REQUEST) 58 | 59 | 60 | @api_view(["GET", "PUT", "DELETE"]) 61 | @authentication_classes((BasicAuthentication, SessionAuthentication, TokenAuthentication)) 62 | @permission_classes((IsAuthenticated,)) 63 | def course_detail(request, pk): 64 | """ 65 | 获取、更新、删除一个课程 66 | :param request: 67 | :param pk: 68 | :return: 69 | """ 70 | try: 71 | course = Course.objects.get(pk=pk) 72 | except Course.DoesNotExist: 73 | return Response(data={"msg": "没有此课程信息"}, status=status.HTTP_404_NOT_FOUND) 74 | else: 75 | if request.method == "GET": 76 | s = CourseSerializer(instance=course) 77 | return Response(data=s.data, status=status.HTTP_200_OK) 78 | 79 | elif request.method == "PUT": 80 | s = CourseSerializer(instance=course, data=request.data) 81 | if s.is_valid(): 82 | s.save() 83 | return Response(data=s.data, status=status.HTTP_200_OK) 84 | return Response(data=s.errors, status=status.HTTP_400_BAD_REQUEST) 85 | 86 | elif request.method == "DELETE": 87 | course.delete() 88 | return Response(status=status.HTTP_204_NO_CONTENT) 89 | 90 | 91 | """二、 类视图 Class Based View""" 92 | 93 | 94 | class CourseList(APIView): 95 | permission_classes = (IsAuthenticated,) # settings.py中已设置,此处是多余的 96 | 97 | def get(self, request): 98 | """ 99 | :param request: 100 | :return: 101 | """ 102 | queryset = Course.objects.all() 103 | s = CourseSerializer(instance=queryset, many=True) # 这里是instance = xx 104 | # s = CourseSerializer(instance=queryset.first()) 105 | return Response(s.data, status=status.HTTP_200_OK) 106 | 107 | def post(self, request): 108 | """ 109 | :param request: 110 | :return: 111 | """ 112 | s = CourseSerializer(data=request.data) # 这里是data = xx, return前要先调用.is_valid() 113 | if s.is_valid(): 114 | s.save(teacher=self.request.user) 115 | # 分别是 116 | print(type(request.data), type(s.data)) 117 | return Response(data=s.data, status=status.HTTP_201_CREATED) 118 | return Response(data=s.errors, status=status.HTTP_400_BAD_REQUEST) 119 | 120 | 121 | class CourseDetail(APIView): 122 | permission_classes = (IsAuthenticated,) 123 | 124 | @staticmethod 125 | def get_object(pk): 126 | try: 127 | return Course.objects.get(pk=pk) 128 | except Course.DoesNotExist: 129 | return 130 | 131 | def get(self, request, pk): 132 | """ 133 | :param request: 134 | :param pk: 135 | :return: 136 | """ 137 | obj = self.get_object(pk=pk) 138 | if not obj: 139 | return Response(data={"msg": "没有此课程信息"}, status=status.HTTP_404_NOT_FOUND) 140 | 141 | s = CourseSerializer(instance=obj) 142 | return Response(s.data, status=status.HTTP_200_OK) 143 | 144 | def put(self, request, pk): 145 | """ 146 | :param request: 147 | :param pk: 148 | :return: 149 | """ 150 | obj = self.get_object(pk=pk) 151 | if not obj: 152 | return Response(data={"msg": "没有此课程信息"}, status=status.HTTP_404_NOT_FOUND) 153 | 154 | s = CourseSerializer(instance=obj, data=request.data) 155 | if s.is_valid(): 156 | s.save() 157 | return Response(data=s.data, status=status.HTTP_200_OK) 158 | return Response(data=s.errors, status=status.HTTP_400_BAD_REQUEST) 159 | 160 | def delete(self, request, pk): 161 | """ 162 | :param request: 163 | :param pk: 164 | :return: 165 | """ 166 | obj = self.get_object(pk=pk) 167 | if not obj: 168 | return Response(data={"msg": "没有此课程信息"}, status=status.HTTP_404_NOT_FOUND) 169 | obj.delete() 170 | return Response(status=status.HTTP_204_NO_CONTENT) 171 | 172 | 173 | """三、 通用类视图 Generic Class Based View""" 174 | 175 | 176 | class GCourseList(generics.ListCreateAPIView): 177 | queryset = Course.objects.all() 178 | serializer_class = CourseSerializer 179 | permission_classes = (IsAuthenticated,) 180 | 181 | def perform_create(self, serializer): 182 | serializer.save(teacher=self.request.user) 183 | 184 | 185 | class GCourseDetail(generics.RetrieveUpdateDestroyAPIView): 186 | queryset = Course.objects.all() 187 | serializer_class = CourseSerializer 188 | permission_classes = (IsAuthenticated, IsOwnerOrReadOnly) 189 | 190 | 191 | """四、 DRF的视图集viewsets""" 192 | 193 | 194 | class CourseViewSet(viewsets.ModelViewSet): 195 | queryset = Course.objects.all() 196 | serializer_class = CourseSerializer 197 | permission_classes = (IsAuthenticated, IsOwnerOrReadOnly) 198 | 199 | def perform_create(self, serializer): 200 | serializer.save(teacher=self.request.user) 201 | -------------------------------------------------------------------------------- /db.sqlite3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liaogx/drf-tutorial/4e12b1c5da56be4180328193fc9dbe1245d48dbb/db.sqlite3 -------------------------------------------------------------------------------- /drf-tutorial/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liaogx/drf-tutorial/4e12b1c5da56be4180328193fc9dbe1245d48dbb/drf-tutorial/__init__.py -------------------------------------------------------------------------------- /drf-tutorial/settings.py: -------------------------------------------------------------------------------- 1 | """ 2 | Django settings for drf-tutorial project. 3 | 4 | Generated by "django-admin startproject" using Django 3.0.5. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/3.0/topics/settings/ 8 | 9 | For the full list of settings and their values, see 10 | https://docs.djangoproject.com/en/3.0/ref/settings/ 11 | """ 12 | 13 | import os 14 | 15 | # Build paths inside the project like this: os.path.join(BASE_DIR, ...) 16 | BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) 17 | 18 | # Quick-start development settings - unsuitable for production 19 | # See https://docs.djangoproject.com/en/3.0/howto/deployment/checklist/ 20 | 21 | # SECURITY WARNING: keep the secret key used in production secret! 22 | SECRET_KEY = "#3(vjynordxvt)er)h9hk*h#h7z@5wawz$usb^immomrb6e$wi" 23 | 24 | # SECURITY WARNING: don"t run with debug turned on in production! 25 | DEBUG = True 26 | 27 | ALLOWED_HOSTS = ["*"] 28 | 29 | # Application definition 30 | 31 | INSTALLED_APPS = [ 32 | "django.contrib.admin", 33 | "django.contrib.auth", 34 | "django.contrib.contenttypes", 35 | "django.contrib.sessions", 36 | "django.contrib.messages", 37 | "django.contrib.staticfiles", 38 | "rest_framework", # RESTful API 39 | "rest_framework.authtoken", # DRF自带的token认证 40 | "course.apps.CourseConfig", 41 | ] 42 | 43 | MIDDLEWARE = [ 44 | "django.middleware.security.SecurityMiddleware", 45 | "django.contrib.sessions.middleware.SessionMiddleware", 46 | "django.middleware.common.CommonMiddleware", 47 | "django.middleware.csrf.CsrfViewMiddleware", 48 | "django.contrib.auth.middleware.AuthenticationMiddleware", 49 | "django.contrib.messages.middleware.MessageMiddleware", 50 | "django.middleware.clickjacking.XFrameOptionsMiddleware", 51 | ] 52 | 53 | ROOT_URLCONF = "drf-tutorial.urls" 54 | 55 | TEMPLATES = [ 56 | { 57 | "BACKEND": "django.template.backends.django.DjangoTemplates", 58 | "DIRS": [], 59 | "APP_DIRS": True, 60 | "OPTIONS": { 61 | "context_processors": [ 62 | "django.template.context_processors.debug", 63 | "django.template.context_processors.request", 64 | "django.contrib.auth.context_processors.auth", 65 | "django.contrib.messages.context_processors.messages", 66 | ], 67 | }, 68 | }, 69 | ] 70 | 71 | WSGI_APPLICATION = "drf-tutorial.wsgi.application" 72 | 73 | # Database 74 | # https://docs.djangoproject.com/en/3.0/ref/settings/#databases 75 | 76 | DATABASES = { 77 | "default": { 78 | "ENGINE": "django.db.backends.sqlite3", 79 | "NAME": os.path.join(BASE_DIR, "db.sqlite3"), 80 | } 81 | } 82 | 83 | # Password validation 84 | # https://docs.djangoproject.com/en/3.0/ref/settings/#auth-password-validators 85 | 86 | AUTH_PASSWORD_VALIDATORS = [ 87 | { 88 | "NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator", 89 | }, 90 | { 91 | "NAME": "django.contrib.auth.password_validation.MinimumLengthValidator", 92 | }, 93 | { 94 | "NAME": "django.contrib.auth.password_validation.CommonPasswordValidator", 95 | }, 96 | { 97 | "NAME": "django.contrib.auth.password_validation.NumericPasswordValidator", 98 | }, 99 | ] 100 | 101 | # Internationalization 102 | # https://docs.djangoproject.com/en/3.0/topics/i18n/ 103 | 104 | LANGUAGE_CODE = "zh-hans" 105 | 106 | TIME_ZONE = "Asia/Shanghai" 107 | 108 | USE_I18N = True 109 | 110 | USE_L10N = True 111 | 112 | USE_TZ = False 113 | 114 | # Static files (CSS, JavaScript, Images) 115 | # https://docs.djangoproject.com/en/3.0/howto/static-files/ 116 | 117 | STATIC_URL = "/static/" 118 | 119 | STATIC_ROOT = os.path.join(BASE_DIR, "static") 120 | 121 | STATICFILES_DIRS = [ 122 | os.path.join(BASE_DIR, "staticfiles"), 123 | ] 124 | 125 | REST_FRAMEWORK = { 126 | "DEFAULT_SCHEMA_CLASS": "rest_framework.schemas.coreapi.AutoSchema", 127 | "DEFAULT_PAGINATION_CLASS": "rest_framework.pagination.PageNumberPagination", 128 | "PAGE_SIZE": 50, 129 | "DATETIME_FORMAT": "%Y-%m-%d %H:%M:%S", 130 | "DEFAULT_RENDERER_CLASSES": [ 131 | "rest_framework.renderers.JSONRenderer", 132 | "rest_framework.renderers.BrowsableAPIRenderer", 133 | ], 134 | "DEFAULT_PARSER_CLASSES": [ # 解析request.data 135 | "rest_framework.parsers.JSONParser", 136 | "rest_framework.parsers.FormParser", 137 | "rest_framework.parsers.MultiPartParser", 138 | ], 139 | "DEFAULT_PERMISSION_CLASSES": [ 140 | "rest_framework.permissions.IsAuthenticated", 141 | ], 142 | "DEFAULT_AUTHENTICATION_CLASSES": [ 143 | "rest_framework.authentication.BasicAuthentication", 144 | "rest_framework.authentication.SessionAuthentication", 145 | "rest_framework.authentication.TokenAuthentication", 146 | ] 147 | } 148 | -------------------------------------------------------------------------------- /drf-tutorial/urls.py: -------------------------------------------------------------------------------- 1 | """drf-tutorial URL Configuration 2 | 3 | The `urlpatterns` list routes URLs to views. For more information please see: 4 | https://docs.djangoproject.com/en/3.0/topics/http/urls/ 5 | Examples: 6 | Function views 7 | 1. Add an import: from my_app import views 8 | 2. Add a URL to urlpatterns: path("", views.home, name="home") 9 | Class-based views 10 | 1. Add an import: from other_app.views import Home 11 | 2. Add a URL to urlpatterns: path("", Home.as_view(), name="home") 12 | Including another URLconf 13 | 1. Import the include() function: from django.urls import include, path 14 | 2. Add a URL to urlpatterns: path("blog/", include("blog.urls")) 15 | """ 16 | from django.contrib import admin 17 | from django.urls import path, include 18 | from rest_framework.authtoken import views 19 | from rest_framework.documentation import include_docs_urls 20 | 21 | urlpatterns = [ 22 | path("api-token-auth/", views.obtain_auth_token), # 获取Token的接口 23 | path("api-auth/", include("rest_framework.urls")), # DRF的登录退出 24 | path("admin/", admin.site.urls), 25 | path("docs/", include_docs_urls(title="DRF API文档", description="Django REST framework快速入门")), 26 | path("course/", include("course.urls")), 27 | ] 28 | -------------------------------------------------------------------------------- /drf-tutorial/wsgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | WSGI config for drf-tutorial project. 3 | 4 | It exposes the WSGI callable as a module-level variable named ``application``. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/3.0/howto/deployment/wsgi/ 8 | """ 9 | 10 | import os 11 | 12 | from django.core.wsgi import get_wsgi_application 13 | 14 | os.environ.setdefault("DJANGO_SETTINGS_MODULE", "drf-tutorial.settings") 15 | 16 | application = get_wsgi_application() 17 | -------------------------------------------------------------------------------- /manage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | # -*- coding:utf-8 -*- 3 | # __author__ = "__Jack__" 4 | 5 | 6 | import os 7 | import sys 8 | 9 | if __name__ == "__main__": 10 | os.environ.setdefault("DJANGO_SETTINGS_MODULE", "drf-tutorial.settings") 11 | try: 12 | from django.core.management import execute_from_command_line 13 | except ImportError as exc: 14 | raise ImportError( 15 | "Couldn't import Django. Are you sure it's installed and " 16 | "available on your PYTHONPATH environment variable? Did you " 17 | "forget to activate a virtual environment?" 18 | ) from exc 19 | execute_from_command_line(sys.argv) 20 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | asgiref==3.2.7 2 | certifi==2020.4.5.1 3 | chardet==3.0.4 4 | coreapi==2.3.3 5 | coreschema==0.0.4 6 | Django==3.0.6 7 | django-filter==2.2.0 8 | djangorestframework==3.11.0 9 | idna==2.9 10 | importlib-metadata==1.6.0 11 | itypes==1.2.0 12 | Jinja2==2.11.2 13 | Markdown==3.2.2 14 | MarkupSafe==1.1.1 15 | Pygments==2.6.1 16 | pytz==2020.1 17 | requests==2.23.0 18 | sqlparse==0.3.1 19 | uritemplate==3.0.1 20 | urllib3==1.25.9 21 | zipp==3.1.0 22 | -------------------------------------------------------------------------------- /static/DRF进阶与实战.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liaogx/drf-tutorial/4e12b1c5da56be4180328193fc9dbe1245d48dbb/static/DRF进阶与实战.png -------------------------------------------------------------------------------- /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 { 13 | display: none; 14 | } 15 | 16 | .change-list .filtered table { 17 | border-right: none; 18 | } 19 | 20 | .change-list .filtered { 21 | min-height: 400px; 22 | } 23 | 24 | .change-list .filtered .results, .change-list .filtered .paginator, 25 | .filtered #toolbar, .filtered div.xfull { 26 | margin-right: 280px; 27 | width: auto; 28 | } 29 | 30 | .change-list .filtered table tbody th { 31 | padding-right: 1em; 32 | } 33 | 34 | #changelist-form .results { 35 | overflow-x: auto; 36 | } 37 | 38 | #changelist .toplinks { 39 | border-bottom: 1px solid #ddd; 40 | } 41 | 42 | #changelist .paginator { 43 | color: #666; 44 | border-bottom: 1px solid #eee; 45 | background: #fff; 46 | overflow: hidden; 47 | } 48 | 49 | /* CHANGELIST TABLES */ 50 | 51 | #changelist table thead th { 52 | padding: 0; 53 | white-space: nowrap; 54 | vertical-align: middle; 55 | } 56 | 57 | #changelist table thead th.action-checkbox-column { 58 | width: 1.5em; 59 | text-align: center; 60 | } 61 | 62 | #changelist table tbody td.action-checkbox { 63 | text-align: center; 64 | } 65 | 66 | #changelist table tfoot { 67 | color: #666; 68 | } 69 | 70 | /* TOOLBAR */ 71 | 72 | #changelist #toolbar { 73 | padding: 8px 10px; 74 | margin-bottom: 15px; 75 | border-top: 1px solid #eee; 76 | border-bottom: 1px solid #eee; 77 | background: #f8f8f8; 78 | color: #666; 79 | } 80 | 81 | #changelist #toolbar form input { 82 | border-radius: 4px; 83 | font-size: 14px; 84 | padding: 5px; 85 | color: #333; 86 | } 87 | 88 | #changelist #toolbar form #searchbar { 89 | height: 19px; 90 | border: 1px solid #ccc; 91 | padding: 2px 5px; 92 | margin: 0; 93 | vertical-align: top; 94 | font-size: 13px; 95 | } 96 | 97 | #changelist #toolbar form #searchbar:focus { 98 | border-color: #999; 99 | } 100 | 101 | #changelist #toolbar form input[type="submit"] { 102 | border: 1px solid #ccc; 103 | font-size: 13px; 104 | padding: 4px 8px; 105 | margin: 0; 106 | vertical-align: middle; 107 | background: #fff; 108 | box-shadow: 0 -15px 20px -10px rgba(0, 0, 0, 0.15) inset; 109 | cursor: pointer; 110 | color: #333; 111 | } 112 | 113 | #changelist #toolbar form input[type="submit"]:focus, 114 | #changelist #toolbar form input[type="submit"]:hover { 115 | border-color: #999; 116 | } 117 | 118 | #changelist #changelist-search img { 119 | vertical-align: middle; 120 | margin-right: 4px; 121 | } 122 | 123 | /* FILTER COLUMN */ 124 | 125 | #changelist-filter { 126 | position: absolute; 127 | top: 0; 128 | right: 0; 129 | z-index: 1000; 130 | width: 240px; 131 | background: #f8f8f8; 132 | border-left: none; 133 | margin: 0; 134 | } 135 | 136 | #changelist-filter h2 { 137 | font-size: 14px; 138 | text-transform: uppercase; 139 | letter-spacing: 0.5px; 140 | padding: 5px 15px; 141 | margin-bottom: 12px; 142 | border-bottom: none; 143 | } 144 | 145 | #changelist-filter h3 { 146 | font-weight: 400; 147 | font-size: 14px; 148 | padding: 0 15px; 149 | margin-bottom: 10px; 150 | } 151 | 152 | #changelist-filter ul { 153 | margin: 5px 0; 154 | padding: 0 15px 15px; 155 | border-bottom: 1px solid #eaeaea; 156 | } 157 | 158 | #changelist-filter ul:last-child { 159 | border-bottom: none; 160 | padding-bottom: none; 161 | } 162 | 163 | #changelist-filter li { 164 | list-style-type: none; 165 | margin-left: 0; 166 | padding-left: 0; 167 | } 168 | 169 | #changelist-filter a { 170 | display: block; 171 | color: #999; 172 | text-overflow: ellipsis; 173 | overflow-x: hidden; 174 | } 175 | 176 | #changelist-filter li.selected { 177 | border-left: 5px solid #eaeaea; 178 | padding-left: 10px; 179 | margin-left: -15px; 180 | } 181 | 182 | #changelist-filter li.selected a { 183 | color: #5b80b2; 184 | } 185 | 186 | #changelist-filter a:focus, #changelist-filter a:hover, 187 | #changelist-filter li.selected a:focus, 188 | #changelist-filter li.selected a:hover { 189 | color: #036; 190 | } 191 | 192 | /* DATE DRILLDOWN */ 193 | 194 | .change-list ul.toplinks { 195 | display: block; 196 | float: left; 197 | padding: 0; 198 | margin: 0; 199 | width: 100%; 200 | } 201 | 202 | .change-list ul.toplinks li { 203 | padding: 3px 6px; 204 | font-weight: bold; 205 | list-style-type: none; 206 | display: inline-block; 207 | } 208 | 209 | .change-list ul.toplinks .date-back a { 210 | color: #999; 211 | } 212 | 213 | .change-list ul.toplinks .date-back a:focus, 214 | .change-list ul.toplinks .date-back a:hover { 215 | color: #036; 216 | } 217 | 218 | /* PAGINATOR */ 219 | 220 | .paginator { 221 | font-size: 13px; 222 | padding-top: 10px; 223 | padding-bottom: 10px; 224 | line-height: 22px; 225 | margin: 0; 226 | border-top: 1px solid #ddd; 227 | } 228 | 229 | .paginator a:link, .paginator a:visited { 230 | padding: 2px 6px; 231 | background: #79aec8; 232 | text-decoration: none; 233 | color: #fff; 234 | } 235 | 236 | .paginator a.showall { 237 | padding: 0; 238 | border: none; 239 | background: none; 240 | color: #5b80b2; 241 | } 242 | 243 | .paginator a.showall:focus, .paginator a.showall:hover { 244 | background: none; 245 | color: #036; 246 | } 247 | 248 | .paginator .end { 249 | margin-right: 6px; 250 | } 251 | 252 | .paginator .this-page { 253 | padding: 2px 6px; 254 | font-weight: bold; 255 | font-size: 13px; 256 | vertical-align: top; 257 | } 258 | 259 | .paginator a:focus, .paginator a:hover { 260 | color: white; 261 | background: #036; 262 | } 263 | 264 | /* ACTIONS */ 265 | 266 | .filtered .actions { 267 | margin-right: 280px; 268 | border-right: none; 269 | } 270 | 271 | #changelist table input { 272 | margin: 0; 273 | vertical-align: baseline; 274 | } 275 | 276 | #changelist table tbody tr.selected { 277 | background-color: #FFFFCC; 278 | } 279 | 280 | #changelist .actions { 281 | padding: 10px; 282 | background: #fff; 283 | border-top: none; 284 | border-bottom: none; 285 | line-height: 24px; 286 | color: #999; 287 | } 288 | 289 | #changelist .actions.selected { 290 | background: #fffccf; 291 | border-top: 1px solid #fffee8; 292 | border-bottom: 1px solid #edecd6; 293 | } 294 | 295 | #changelist .actions span.all, 296 | #changelist .actions span.action-counter, 297 | #changelist .actions span.clear, 298 | #changelist .actions span.question { 299 | font-size: 13px; 300 | margin: 0 0.5em; 301 | display: none; 302 | } 303 | 304 | #changelist .actions:last-child { 305 | border-bottom: none; 306 | } 307 | 308 | #changelist .actions select { 309 | vertical-align: top; 310 | height: 24px; 311 | background: none; 312 | color: #000; 313 | border: 1px solid #ccc; 314 | border-radius: 4px; 315 | font-size: 14px; 316 | padding: 0 0 0 4px; 317 | margin: 0; 318 | margin-left: 10px; 319 | } 320 | 321 | #changelist .actions select:focus { 322 | border-color: #999; 323 | } 324 | 325 | #changelist .actions label { 326 | display: inline-block; 327 | vertical-align: middle; 328 | font-size: 13px; 329 | } 330 | 331 | #changelist .actions .button { 332 | font-size: 13px; 333 | border: 1px solid #ccc; 334 | border-radius: 4px; 335 | background: #fff; 336 | box-shadow: 0 -15px 20px -10px rgba(0, 0, 0, 0.15) inset; 337 | cursor: pointer; 338 | height: 24px; 339 | line-height: 1; 340 | padding: 4px 8px; 341 | margin: 0; 342 | color: #333; 343 | } 344 | 345 | #changelist .actions .button:focus, #changelist .actions .button:hover { 346 | border-color: #999; 347 | } 348 | -------------------------------------------------------------------------------- /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 | overflow: hidden; 25 | text-overflow: ellipsis; 26 | -o-text-overflow: ellipsis; 27 | } 28 | -------------------------------------------------------------------------------- /static/admin/css/fonts.css: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: 'Roboto'; 3 | src: url('../fonts/Roboto-Bold-webfont.woff'); 4 | font-weight: 700; 5 | font-style: normal; 6 | } 7 | 8 | @font-face { 9 | font-family: 'Roboto'; 10 | src: url('../fonts/Roboto-Regular-webfont.woff'); 11 | font-weight: 400; 12 | font-style: normal; 13 | } 14 | 15 | @font-face { 16 | font-family: 'Roboto'; 17 | src: url('../fonts/Roboto-Light-webfont.woff'); 18 | font-weight: 300; 19 | font-style: normal; 20 | } 21 | -------------------------------------------------------------------------------- /static/admin/css/login.css: -------------------------------------------------------------------------------- 1 | /* LOGIN FORM */ 2 | 3 | body.login { 4 | background: #f8f8f8; 5 | } 6 | 7 | .login #header { 8 | height: auto; 9 | padding: 15px 16px; 10 | justify-content: center; 11 | } 12 | 13 | .login #header h1 { 14 | font-size: 18px; 15 | } 16 | 17 | .login #header h1 a { 18 | color: #fff; 19 | } 20 | 21 | .login #content { 22 | padding: 20px 20px 0; 23 | } 24 | 25 | .login #container { 26 | background: #fff; 27 | border: 1px solid #eaeaea; 28 | border-radius: 4px; 29 | overflow: hidden; 30 | width: 28em; 31 | min-width: 300px; 32 | margin: 100px auto; 33 | } 34 | 35 | .login #content-main { 36 | width: 100%; 37 | } 38 | 39 | .login .form-row { 40 | padding: 4px 0; 41 | float: left; 42 | width: 100%; 43 | border-bottom: none; 44 | } 45 | 46 | .login .form-row label { 47 | padding-right: 0.5em; 48 | line-height: 2em; 49 | font-size: 1em; 50 | clear: both; 51 | color: #333; 52 | } 53 | 54 | .login .form-row #id_username, .login .form-row #id_password { 55 | clear: both; 56 | padding: 8px; 57 | width: 100%; 58 | -webkit-box-sizing: border-box; 59 | -moz-box-sizing: border-box; 60 | box-sizing: border-box; 61 | } 62 | 63 | .login span.help { 64 | font-size: 10px; 65 | display: block; 66 | } 67 | 68 | .login .submit-row { 69 | clear: both; 70 | padding: 1em 0 0 9.4em; 71 | margin: 0; 72 | border: none; 73 | background: none; 74 | text-align: left; 75 | } 76 | 77 | .login .password-reset-link { 78 | text-align: center; 79 | } 80 | -------------------------------------------------------------------------------- /static/admin/css/responsive_rtl.css: -------------------------------------------------------------------------------- 1 | /* TABLETS */ 2 | 3 | @media (max-width: 1024px) { 4 | [dir="rtl"] .colMS { 5 | margin-right: 0; 6 | } 7 | 8 | [dir="rtl"] #user-tools { 9 | text-align: right; 10 | } 11 | 12 | [dir="rtl"] #changelist .actions label { 13 | padding-left: 10px; 14 | padding-right: 0; 15 | } 16 | 17 | [dir="rtl"] #changelist .actions select { 18 | margin-left: 0; 19 | margin-right: 15px; 20 | } 21 | 22 | [dir="rtl"] .change-list .filtered .results, 23 | [dir="rtl"] .change-list .filtered .paginator, 24 | [dir="rtl"] .filtered #toolbar, 25 | [dir="rtl"] .filtered div.xfull, 26 | [dir="rtl"] .filtered .actions { 27 | margin-right: 0; 28 | margin-left: 230px; 29 | } 30 | 31 | [dir="rtl"] .inline-group ul.tools a.add, 32 | [dir="rtl"] .inline-group div.add-row a, 33 | [dir="rtl"] .inline-group .tabular tr.add-row td a { 34 | padding: 8px 26px 8px 10px; 35 | background-position: calc(100% - 8px) 9px; 36 | } 37 | 38 | [dir="rtl"] .related-widget-wrapper-link + .selector { 39 | margin-right: 0; 40 | margin-left: 15px; 41 | } 42 | 43 | [dir="rtl"] .selector .selector-filter label { 44 | margin-right: 0; 45 | margin-left: 8px; 46 | } 47 | 48 | [dir="rtl"] .object-tools li { 49 | float: right; 50 | } 51 | 52 | [dir="rtl"] .object-tools li + li { 53 | margin-left: 0; 54 | margin-right: 15px; 55 | } 56 | 57 | [dir="rtl"] .dashboard .module table td a { 58 | padding-left: 0; 59 | padding-right: 16px; 60 | } 61 | } 62 | 63 | /* MOBILE */ 64 | 65 | @media (max-width: 767px) { 66 | [dir="rtl"] .change-list .filtered .results, 67 | [dir="rtl"] .change-list .filtered .paginator, 68 | [dir="rtl"] .filtered #toolbar, 69 | [dir="rtl"] .filtered div.xfull, 70 | [dir="rtl"] .filtered .actions { 71 | margin-left: 0; 72 | } 73 | 74 | [dir="rtl"] .aligned .add-another, 75 | [dir="rtl"] .aligned .related-lookup, 76 | [dir="rtl"] .aligned .datetimeshortcuts { 77 | margin-left: 0; 78 | margin-right: 15px; 79 | } 80 | 81 | [dir="rtl"] .aligned ul { 82 | margin-right: 0; 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /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 | .module ul, .module ol { 34 | margin-left: 0; 35 | margin-right: 1.5em; 36 | } 37 | 38 | .viewlink, .addlink, .changelink { 39 | padding-left: 0; 40 | padding-right: 16px; 41 | background-position: 100% 1px; 42 | } 43 | 44 | .deletelink { 45 | padding-left: 0; 46 | padding-right: 16px; 47 | background-position: 100% 1px; 48 | } 49 | 50 | .object-tools { 51 | float: left; 52 | } 53 | 54 | thead th:first-child, 55 | tfoot td:first-child { 56 | border-left: none; 57 | } 58 | 59 | /* LAYOUT */ 60 | 61 | #user-tools { 62 | right: auto; 63 | left: 0; 64 | text-align: left; 65 | } 66 | 67 | div.breadcrumbs { 68 | text-align: right; 69 | } 70 | 71 | #content-main { 72 | float: right; 73 | } 74 | 75 | #content-related { 76 | float: left; 77 | margin-left: -300px; 78 | margin-right: auto; 79 | } 80 | 81 | .colMS { 82 | margin-left: 300px; 83 | margin-right: 0; 84 | } 85 | 86 | /* SORTABLE TABLES */ 87 | 88 | table thead th.sorted .sortoptions { 89 | float: left; 90 | } 91 | 92 | thead th.sorted .text { 93 | padding-right: 0; 94 | padding-left: 42px; 95 | } 96 | 97 | /* dashboard styles */ 98 | 99 | .dashboard .module table td a { 100 | padding-left: .6em; 101 | padding-right: 16px; 102 | } 103 | 104 | /* changelists styles */ 105 | 106 | .change-list .filtered table { 107 | border-left: none; 108 | border-right: 0px none; 109 | } 110 | 111 | #changelist-filter { 112 | right: auto; 113 | left: 0; 114 | border-left: none; 115 | border-right: none; 116 | } 117 | 118 | .change-list .filtered .results, .change-list .filtered .paginator, .filtered #toolbar, .filtered div.xfull { 119 | margin-right: 0; 120 | margin-left: 280px; 121 | } 122 | 123 | #changelist-filter li.selected { 124 | border-left: none; 125 | padding-left: 10px; 126 | margin-left: 0; 127 | border-right: 5px solid #eaeaea; 128 | padding-right: 10px; 129 | margin-right: -15px; 130 | } 131 | 132 | .filtered .actions { 133 | margin-left: 280px; 134 | margin-right: 0; 135 | } 136 | 137 | #changelist table tbody td:first-child, #changelist table tbody th:first-child { 138 | border-right: none; 139 | border-left: none; 140 | } 141 | 142 | /* FORMS */ 143 | 144 | .aligned label { 145 | padding: 0 0 3px 1em; 146 | float: right; 147 | } 148 | 149 | .submit-row { 150 | text-align: left 151 | } 152 | 153 | .submit-row p.deletelink-box { 154 | float: right; 155 | } 156 | 157 | .submit-row input.default { 158 | margin-left: 0; 159 | } 160 | 161 | .vDateField, .vTimeField { 162 | margin-left: 2px; 163 | } 164 | 165 | .aligned .form-row input { 166 | margin-left: 5px; 167 | } 168 | 169 | form .aligned p.help, form .aligned div.help { 170 | clear: right; 171 | } 172 | 173 | form .aligned ul { 174 | margin-right: 163px; 175 | margin-left: 0; 176 | } 177 | 178 | form ul.inline li { 179 | float: right; 180 | padding-right: 0; 181 | padding-left: 7px; 182 | } 183 | 184 | input[type=submit].default, .submit-row input.default { 185 | float: left; 186 | } 187 | 188 | fieldset .fieldBox { 189 | float: right; 190 | margin-left: 20px; 191 | margin-right: 0; 192 | } 193 | 194 | .errorlist li { 195 | background-position: 100% 12px; 196 | padding: 0; 197 | } 198 | 199 | .errornote { 200 | background-position: 100% 12px; 201 | padding: 10px 12px; 202 | } 203 | 204 | /* WIDGETS */ 205 | 206 | .calendarnav-previous { 207 | top: 0; 208 | left: auto; 209 | right: 10px; 210 | } 211 | 212 | .calendarnav-next { 213 | top: 0; 214 | right: auto; 215 | left: 10px; 216 | } 217 | 218 | .calendar caption, .calendarbox h2 { 219 | text-align: center; 220 | } 221 | 222 | .selector { 223 | float: right; 224 | } 225 | 226 | .selector .selector-filter { 227 | text-align: right; 228 | } 229 | 230 | .inline-deletelink { 231 | float: left; 232 | } 233 | 234 | form .form-row p.datetime { 235 | overflow: hidden; 236 | } 237 | 238 | .related-widget-wrapper { 239 | float: right; 240 | } 241 | 242 | /* MISC */ 243 | 244 | .inline-related h2, .inline-group h2 { 245 | text-align: right 246 | } 247 | 248 | .inline-related h3 span.delete { 249 | padding-right: 20px; 250 | padding-left: inherit; 251 | left: 10px; 252 | right: inherit; 253 | float: left; 254 | } 255 | 256 | .inline-related h3 span.delete label { 257 | margin-left: inherit; 258 | margin-right: 2px; 259 | } 260 | 261 | /* IE7 specific bug fixes */ 262 | 263 | div.colM { 264 | position: relative; 265 | } 266 | 267 | .submit-row input { 268 | float: left; 269 | } 270 | -------------------------------------------------------------------------------- /static/admin/css/vendor/select2/LICENSE-SELECT2.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2012-2017 Kevin Brown, Igor Vaynberg, and Select2 contributors 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /static/admin/fonts/README.txt: -------------------------------------------------------------------------------- 1 | Roboto webfont source: https://www.google.com/fonts/specimen/Roboto 2 | WOFF files extracted using https://github.com/majodev/google-webfonts-helper 3 | Weights used in this project: Light (300), Regular (400), Bold (700) 4 | -------------------------------------------------------------------------------- /static/admin/fonts/Roboto-Bold-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liaogx/drf-tutorial/4e12b1c5da56be4180328193fc9dbe1245d48dbb/static/admin/fonts/Roboto-Bold-webfont.woff -------------------------------------------------------------------------------- /static/admin/fonts/Roboto-Light-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liaogx/drf-tutorial/4e12b1c5da56be4180328193fc9dbe1245d48dbb/static/admin/fonts/Roboto-Light-webfont.woff -------------------------------------------------------------------------------- /static/admin/fonts/Roboto-Regular-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liaogx/drf-tutorial/4e12b1c5da56be4180328193fc9dbe1245d48dbb/static/admin/fonts/Roboto-Regular-webfont.woff -------------------------------------------------------------------------------- /static/admin/img/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Code Charm Ltd 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /static/admin/img/README.txt: -------------------------------------------------------------------------------- 1 | All icons are taken from Font Awesome (http://fontawesome.io/) project. 2 | The Font Awesome font is licensed under the SIL OFL 1.1: 3 | - https://scripts.sil.org/OFL 4 | 5 | SVG icons source: https://github.com/encharm/Font-Awesome-SVG-PNG 6 | Font-Awesome-SVG-PNG is licensed under the MIT license (see file license 7 | in current folder). 8 | -------------------------------------------------------------------------------- /static/admin/img/calendar-icons.svg: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /static/admin/img/gis/move_vertex_off.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /static/admin/img/gis/move_vertex_on.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /static/admin/img/icon-addlink.svg: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | -------------------------------------------------------------------------------- /static/admin/img/icon-alert.svg: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | -------------------------------------------------------------------------------- /static/admin/img/icon-calendar.svg: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /static/admin/img/icon-changelink.svg: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | -------------------------------------------------------------------------------- /static/admin/img/icon-clock.svg: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /static/admin/img/icon-deletelink.svg: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | -------------------------------------------------------------------------------- /static/admin/img/icon-no.svg: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | -------------------------------------------------------------------------------- /static/admin/img/icon-unknown-alt.svg: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | -------------------------------------------------------------------------------- /static/admin/img/icon-unknown.svg: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | -------------------------------------------------------------------------------- /static/admin/img/icon-viewlink.svg: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | -------------------------------------------------------------------------------- /static/admin/img/icon-yes.svg: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | -------------------------------------------------------------------------------- /static/admin/img/inline-delete.svg: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | -------------------------------------------------------------------------------- /static/admin/img/search.svg: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | -------------------------------------------------------------------------------- /static/admin/img/selector-icons.svg: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 19 | 20 | 21 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /static/admin/img/sorting-icons.svg: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /static/admin/img/tooltag-add.svg: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | -------------------------------------------------------------------------------- /static/admin/img/tooltag-arrowright.svg: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | -------------------------------------------------------------------------------- /static/admin/js/SelectBox.js: -------------------------------------------------------------------------------- 1 | (function ($) { 2 | 'use strict'; 3 | var SelectBox = { 4 | cache: {}, 5 | init: function (id) { 6 | var box = document.getElementById(id); 7 | var node; 8 | SelectBox.cache[id] = []; 9 | var cache = SelectBox.cache[id]; 10 | var boxOptions = box.options; 11 | var boxOptionsLength = boxOptions.length; 12 | for (var i = 0, j = boxOptionsLength; i < j; i++) { 13 | node = boxOptions[i]; 14 | cache.push({value: node.value, text: node.text, displayed: 1}); 15 | } 16 | }, 17 | redisplay: function (id) { 18 | // Repopulate HTML select box from cache 19 | var box = document.getElementById(id); 20 | var node; 21 | $(box).empty(); // clear all options 22 | var new_options = box.outerHTML.slice(0, -9); // grab just the opening tag 23 | var cache = SelectBox.cache[id]; 24 | for (var i = 0, j = cache.length; i < j; i++) { 25 | node = cache[i]; 26 | if (node.displayed) { 27 | var new_option = new Option(node.text, node.value, false, false); 28 | // Shows a tooltip when hovering over the option 29 | new_option.setAttribute("title", node.text); 30 | new_options += new_option.outerHTML; 31 | } 32 | } 33 | new_options += ''; 34 | box.outerHTML = new_options; 35 | }, 36 | filter: function (id, text) { 37 | // Redisplay the HTML select box, displaying only the choices containing ALL 38 | // the words in text. (It's an AND search.) 39 | var tokens = text.toLowerCase().split(/\s+/); 40 | var node, token; 41 | var cache = SelectBox.cache[id]; 42 | for (var i = 0, j = cache.length; i < j; i++) { 43 | node = cache[i]; 44 | node.displayed = 1; 45 | var node_text = node.text.toLowerCase(); 46 | var numTokens = tokens.length; 47 | for (var k = 0; k < numTokens; k++) { 48 | token = tokens[k]; 49 | if (node_text.indexOf(token) === -1) { 50 | node.displayed = 0; 51 | break; // Once the first token isn't found we're done 52 | } 53 | } 54 | } 55 | SelectBox.redisplay(id); 56 | }, 57 | delete_from_cache: function (id, value) { 58 | var node, delete_index = null; 59 | var cache = SelectBox.cache[id]; 60 | for (var i = 0, j = cache.length; i < j; i++) { 61 | node = cache[i]; 62 | if (node.value === value) { 63 | delete_index = i; 64 | break; 65 | } 66 | } 67 | cache.splice(delete_index, 1); 68 | }, 69 | add_to_cache: function (id, option) { 70 | SelectBox.cache[id].push({value: option.value, text: option.text, displayed: 1}); 71 | }, 72 | cache_contains: function (id, value) { 73 | // Check if an item is contained in the cache 74 | var node; 75 | var cache = SelectBox.cache[id]; 76 | for (var i = 0, j = cache.length; i < j; i++) { 77 | node = cache[i]; 78 | if (node.value === value) { 79 | return true; 80 | } 81 | } 82 | return false; 83 | }, 84 | move: function (from, to) { 85 | var from_box = document.getElementById(from); 86 | var option; 87 | var boxOptions = from_box.options; 88 | var boxOptionsLength = boxOptions.length; 89 | for (var i = 0, j = boxOptionsLength; i < j; i++) { 90 | option = boxOptions[i]; 91 | var option_value = option.value; 92 | if (option.selected && SelectBox.cache_contains(from, option_value)) { 93 | SelectBox.add_to_cache(to, {value: option_value, text: option.text, displayed: 1}); 94 | SelectBox.delete_from_cache(from, option_value); 95 | } 96 | } 97 | SelectBox.redisplay(from); 98 | SelectBox.redisplay(to); 99 | }, 100 | move_all: function (from, to) { 101 | var from_box = document.getElementById(from); 102 | var option; 103 | var boxOptions = from_box.options; 104 | var boxOptionsLength = boxOptions.length; 105 | for (var i = 0, j = boxOptionsLength; i < j; i++) { 106 | option = boxOptions[i]; 107 | var option_value = option.value; 108 | if (SelectBox.cache_contains(from, option_value)) { 109 | SelectBox.add_to_cache(to, {value: option_value, text: option.text, displayed: 1}); 110 | SelectBox.delete_from_cache(from, option_value); 111 | } 112 | } 113 | SelectBox.redisplay(from); 114 | SelectBox.redisplay(to); 115 | }, 116 | sort: function (id) { 117 | SelectBox.cache[id].sort(function (a, b) { 118 | a = a.text.toLowerCase(); 119 | b = b.text.toLowerCase(); 120 | try { 121 | if (a > b) { 122 | return 1; 123 | } 124 | if (a < b) { 125 | return -1; 126 | } 127 | } catch (e) { 128 | // silently fail on IE 'unknown' exception 129 | } 130 | return 0; 131 | }); 132 | }, 133 | select_all: function (id) { 134 | var box = document.getElementById(id); 135 | var boxOptions = box.options; 136 | var boxOptionsLength = boxOptions.length; 137 | for (var i = 0; i < boxOptionsLength; i++) { 138 | boxOptions[i].selected = 'selected'; 139 | } 140 | } 141 | }; 142 | window.SelectBox = SelectBox; 143 | })(django.jQuery); 144 | -------------------------------------------------------------------------------- /static/admin/js/actions.js: -------------------------------------------------------------------------------- 1 | /*global gettext, interpolate, ngettext*/ 2 | (function ($) { 3 | 'use strict'; 4 | var lastChecked; 5 | 6 | $.fn.actions = function (opts) { 7 | var options = $.extend({}, $.fn.actions.defaults, opts); 8 | var actionCheckboxes = $(this); 9 | var list_editable_changed = false; 10 | var showQuestion = function () { 11 | $(options.acrossClears).hide(); 12 | $(options.acrossQuestions).show(); 13 | $(options.allContainer).hide(); 14 | }, 15 | showClear = function () { 16 | $(options.acrossClears).show(); 17 | $(options.acrossQuestions).hide(); 18 | $(options.actionContainer).toggleClass(options.selectedClass); 19 | $(options.allContainer).show(); 20 | $(options.counterContainer).hide(); 21 | }, 22 | reset = function () { 23 | $(options.acrossClears).hide(); 24 | $(options.acrossQuestions).hide(); 25 | $(options.allContainer).hide(); 26 | $(options.counterContainer).show(); 27 | }, 28 | clearAcross = function () { 29 | reset(); 30 | $(options.acrossInput).val(0); 31 | $(options.actionContainer).removeClass(options.selectedClass); 32 | }, 33 | checker = function (checked) { 34 | if (checked) { 35 | showQuestion(); 36 | } else { 37 | reset(); 38 | } 39 | $(actionCheckboxes).prop("checked", checked) 40 | .parent().parent().toggleClass(options.selectedClass, checked); 41 | }, 42 | updateCounter = function () { 43 | var sel = $(actionCheckboxes).filter(":checked").length; 44 | // data-actions-icnt is defined in the generated HTML 45 | // and contains the total amount of objects in the queryset 46 | var actions_icnt = $('.action-counter').data('actionsIcnt'); 47 | $(options.counterContainer).html(interpolate( 48 | ngettext('%(sel)s of %(cnt)s selected', '%(sel)s of %(cnt)s selected', sel), { 49 | sel: sel, 50 | cnt: actions_icnt 51 | }, true)); 52 | $(options.allToggle).prop("checked", function () { 53 | var value; 54 | if (sel === actionCheckboxes.length) { 55 | value = true; 56 | showQuestion(); 57 | } else { 58 | value = false; 59 | clearAcross(); 60 | } 61 | return value; 62 | }); 63 | }; 64 | // Show counter by default 65 | $(options.counterContainer).show(); 66 | // Check state of checkboxes and reinit state if needed 67 | $(this).filter(":checked").each(function (i) { 68 | $(this).parent().parent().toggleClass(options.selectedClass); 69 | updateCounter(); 70 | if ($(options.acrossInput).val() === 1) { 71 | showClear(); 72 | } 73 | }); 74 | $(options.allToggle).show().on('click', function () { 75 | checker($(this).prop("checked")); 76 | updateCounter(); 77 | }); 78 | $("a", options.acrossQuestions).on('click', function (event) { 79 | event.preventDefault(); 80 | $(options.acrossInput).val(1); 81 | showClear(); 82 | }); 83 | $("a", options.acrossClears).on('click', function (event) { 84 | event.preventDefault(); 85 | $(options.allToggle).prop("checked", false); 86 | clearAcross(); 87 | checker(0); 88 | updateCounter(); 89 | }); 90 | lastChecked = null; 91 | $(actionCheckboxes).on('click', function (event) { 92 | if (!event) { 93 | event = window.event; 94 | } 95 | var target = event.target ? event.target : event.srcElement; 96 | if (lastChecked && $.data(lastChecked) !== $.data(target) && event.shiftKey === true) { 97 | var inrange = false; 98 | $(lastChecked).prop("checked", target.checked) 99 | .parent().parent().toggleClass(options.selectedClass, target.checked); 100 | $(actionCheckboxes).each(function () { 101 | if ($.data(this) === $.data(lastChecked) || $.data(this) === $.data(target)) { 102 | inrange = (inrange) ? false : true; 103 | } 104 | if (inrange) { 105 | $(this).prop("checked", target.checked) 106 | .parent().parent().toggleClass(options.selectedClass, target.checked); 107 | } 108 | }); 109 | } 110 | $(target).parent().parent().toggleClass(options.selectedClass, target.checked); 111 | lastChecked = target; 112 | updateCounter(); 113 | }); 114 | $('form#changelist-form table#result_list tr').on('change', 'td:gt(0) :input', function () { 115 | list_editable_changed = true; 116 | }); 117 | $('form#changelist-form button[name="index"]').on('click', function (event) { 118 | if (list_editable_changed) { 119 | return confirm(gettext("You have unsaved changes on individual editable fields. If you run an action, your unsaved changes will be lost.")); 120 | } 121 | }); 122 | $('form#changelist-form input[name="_save"]').on('click', function (event) { 123 | var action_changed = false; 124 | $('select option:selected', options.actionContainer).each(function () { 125 | if ($(this).val()) { 126 | action_changed = true; 127 | } 128 | }); 129 | if (action_changed) { 130 | if (list_editable_changed) { 131 | 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.")); 132 | } else { 133 | 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.")); 134 | } 135 | } 136 | }); 137 | }; 138 | /* Setup plugin defaults */ 139 | $.fn.actions.defaults = { 140 | actionContainer: "div.actions", 141 | counterContainer: "span.action-counter", 142 | allContainer: "div.actions span.all", 143 | acrossInput: "div.actions input.select-across", 144 | acrossQuestions: "div.actions span.question", 145 | acrossClears: "div.actions span.clear", 146 | allToggle: "#action-toggle", 147 | selectedClass: "selected" 148 | }; 149 | $(document).ready(function () { 150 | var $actionsEls = $('tr input.action-select'); 151 | if ($actionsEls.length > 0) { 152 | $actionsEls.actions(); 153 | } 154 | }); 155 | })(django.jQuery); 156 | -------------------------------------------------------------------------------- /static/admin/js/actions.min.js: -------------------------------------------------------------------------------- 1 | (function(a){var f;a.fn.actions=function(e){var b=a.extend({},a.fn.actions.defaults,e),g=a(this),k=!1,l=function(){a(b.acrossClears).hide();a(b.acrossQuestions).show();a(b.allContainer).hide()},m=function(){a(b.acrossClears).show();a(b.acrossQuestions).hide();a(b.actionContainer).toggleClass(b.selectedClass);a(b.allContainer).show();a(b.counterContainer).hide()},n=function(){a(b.acrossClears).hide();a(b.acrossQuestions).hide();a(b.allContainer).hide();a(b.counterContainer).show()},p=function(){n(); 2 | a(b.acrossInput).val(0);a(b.actionContainer).removeClass(b.selectedClass)},q=function(c){c?l():n();a(g).prop("checked",c).parent().parent().toggleClass(b.selectedClass,c)},h=function(){var c=a(g).filter(":checked").length,d=a(".action-counter").data("actionsIcnt");a(b.counterContainer).html(interpolate(ngettext("%(sel)s of %(cnt)s selected","%(sel)s of %(cnt)s selected",c),{sel:c,cnt:d},!0));a(b.allToggle).prop("checked",function(){if(c===g.length){var a=!0;l()}else a=!1,p();return a})};a(b.counterContainer).show(); 3 | a(this).filter(":checked").each(function(c){a(this).parent().parent().toggleClass(b.selectedClass);h();1===a(b.acrossInput).val()&&m()});a(b.allToggle).show().on("click",function(){q(a(this).prop("checked"));h()});a("a",b.acrossQuestions).on("click",function(c){c.preventDefault();a(b.acrossInput).val(1);m()});a("a",b.acrossClears).on("click",function(c){c.preventDefault();a(b.allToggle).prop("checked",!1);p();q(0);h()});f=null;a(g).on("click",function(c){c||(c=window.event);var d=c.target?c.target: 4 | c.srcElement;if(f&&a.data(f)!==a.data(d)&&!0===c.shiftKey){var e=!1;a(f).prop("checked",d.checked).parent().parent().toggleClass(b.selectedClass,d.checked);a(g).each(function(){if(a.data(this)===a.data(f)||a.data(this)===a.data(d))e=e?!1:!0;e&&a(this).prop("checked",d.checked).parent().parent().toggleClass(b.selectedClass,d.checked)})}a(d).parent().parent().toggleClass(b.selectedClass,d.checked);f=d;h()});a("form#changelist-form table#result_list tr").on("change","td:gt(0) :input",function(){k=!0}); 5 | a('form#changelist-form button[name="index"]').on("click",function(a){if(k)return confirm(gettext("You have unsaved changes on individual editable fields. If you run an action, your unsaved changes will be lost."))});a('form#changelist-form input[name="_save"]').on("click",function(c){var d=!1;a("select option:selected",b.actionContainer).each(function(){a(this).val()&&(d=!0)});if(d)return k?confirm(gettext("You have selected an action, but you haven't saved your changes to individual fields yet. Please click OK to save. You'll need to re-run the action.")): 6 | confirm(gettext("You have selected an action, and you haven't made any changes on individual fields. You're probably looking for the Go button rather than the Save button."))})};a.fn.actions.defaults={actionContainer:"div.actions",counterContainer:"span.action-counter",allContainer:"div.actions span.all",acrossInput:"div.actions input.select-across",acrossQuestions:"div.actions span.question",acrossClears:"div.actions span.clear",allToggle:"#action-toggle",selectedClass:"selected"};a(document).ready(function(){var e= 7 | a("tr input.action-select");0= 0) && parseFloat(navigator.appVersion); 5 | var isIE = ((document.all) && (!isOpera)) && parseFloat(navigator.appVersion.split("MSIE ")[1].split(";")[0]); 6 | 7 | // quickElement(tagType, parentReference [, textInChildNode, attribute, attributeValue ...]); 8 | function quickElement() { 9 | 'use strict'; 10 | var obj = document.createElement(arguments[0]); 11 | if (arguments[2]) { 12 | var textNode = document.createTextNode(arguments[2]); 13 | obj.appendChild(textNode); 14 | } 15 | var len = arguments.length; 16 | for (var i = 3; i < len; i += 2) { 17 | obj.setAttribute(arguments[i], arguments[i + 1]); 18 | } 19 | arguments[1].appendChild(obj); 20 | return obj; 21 | } 22 | 23 | // "a" is reference to an object 24 | function removeChildren(a) { 25 | 'use strict'; 26 | while (a.hasChildNodes()) { 27 | a.removeChild(a.lastChild); 28 | } 29 | } 30 | 31 | // ---------------------------------------------------------------------------- 32 | // Find-position functions by PPK 33 | // See https://www.quirksmode.org/js/findpos.html 34 | // ---------------------------------------------------------------------------- 35 | function findPosX(obj) { 36 | 'use strict'; 37 | var curleft = 0; 38 | if (obj.offsetParent) { 39 | while (obj.offsetParent) { 40 | curleft += obj.offsetLeft - ((isOpera) ? 0 : obj.scrollLeft); 41 | obj = obj.offsetParent; 42 | } 43 | // IE offsetParent does not include the top-level 44 | if (isIE && obj.parentElement) { 45 | curleft += obj.offsetLeft - obj.scrollLeft; 46 | } 47 | } else if (obj.x) { 48 | curleft += obj.x; 49 | } 50 | return curleft; 51 | } 52 | 53 | function findPosY(obj) { 54 | 'use strict'; 55 | var curtop = 0; 56 | if (obj.offsetParent) { 57 | while (obj.offsetParent) { 58 | curtop += obj.offsetTop - ((isOpera) ? 0 : obj.scrollTop); 59 | obj = obj.offsetParent; 60 | } 61 | // IE offsetParent does not include the top-level 62 | if (isIE && obj.parentElement) { 63 | curtop += obj.offsetTop - obj.scrollTop; 64 | } 65 | } else if (obj.y) { 66 | curtop += obj.y; 67 | } 68 | return curtop; 69 | } 70 | 71 | //----------------------------------------------------------------------------- 72 | // Date object extensions 73 | // ---------------------------------------------------------------------------- 74 | (function () { 75 | 'use strict'; 76 | Date.prototype.getTwelveHours = function () { 77 | return this.getHours() % 12 || 12; 78 | }; 79 | 80 | Date.prototype.getTwoDigitMonth = function () { 81 | return (this.getMonth() < 9) ? '0' + (this.getMonth() + 1) : (this.getMonth() + 1); 82 | }; 83 | 84 | Date.prototype.getTwoDigitDate = function () { 85 | return (this.getDate() < 10) ? '0' + this.getDate() : this.getDate(); 86 | }; 87 | 88 | Date.prototype.getTwoDigitTwelveHour = function () { 89 | return (this.getTwelveHours() < 10) ? '0' + this.getTwelveHours() : this.getTwelveHours(); 90 | }; 91 | 92 | Date.prototype.getTwoDigitHour = function () { 93 | return (this.getHours() < 10) ? '0' + this.getHours() : this.getHours(); 94 | }; 95 | 96 | Date.prototype.getTwoDigitMinute = function () { 97 | return (this.getMinutes() < 10) ? '0' + this.getMinutes() : this.getMinutes(); 98 | }; 99 | 100 | Date.prototype.getTwoDigitSecond = function () { 101 | return (this.getSeconds() < 10) ? '0' + this.getSeconds() : this.getSeconds(); 102 | }; 103 | 104 | Date.prototype.getFullMonthName = function () { 105 | return typeof window.CalendarNamespace === "undefined" 106 | ? this.getTwoDigitMonth() 107 | : window.CalendarNamespace.monthsOfYear[this.getMonth()]; 108 | }; 109 | 110 | Date.prototype.strftime = function (format) { 111 | var fields = { 112 | B: this.getFullMonthName(), 113 | c: this.toString(), 114 | d: this.getTwoDigitDate(), 115 | H: this.getTwoDigitHour(), 116 | I: this.getTwoDigitTwelveHour(), 117 | m: this.getTwoDigitMonth(), 118 | M: this.getTwoDigitMinute(), 119 | p: (this.getHours() >= 12) ? 'PM' : 'AM', 120 | S: this.getTwoDigitSecond(), 121 | w: '0' + this.getDay(), 122 | x: this.toLocaleDateString(), 123 | X: this.toLocaleTimeString(), 124 | y: ('' + this.getFullYear()).substr(2, 4), 125 | Y: '' + this.getFullYear(), 126 | '%': '%' 127 | }; 128 | var result = '', i = 0; 129 | while (i < format.length) { 130 | if (format.charAt(i) === '%') { 131 | result = result + fields[format.charAt(i + 1)]; 132 | ++i; 133 | } else { 134 | result = result + format.charAt(i); 135 | } 136 | ++i; 137 | } 138 | return result; 139 | }; 140 | 141 | // ---------------------------------------------------------------------------- 142 | // String object extensions 143 | // ---------------------------------------------------------------------------- 144 | String.prototype.strptime = function (format) { 145 | var split_format = format.split(/[.\-/]/); 146 | var date = this.split(/[.\-/]/); 147 | var i = 0; 148 | var day, month, year; 149 | while (i < split_format.length) { 150 | switch (split_format[i]) { 151 | case "%d": 152 | day = date[i]; 153 | break; 154 | case "%m": 155 | month = date[i] - 1; 156 | break; 157 | case "%Y": 158 | year = date[i]; 159 | break; 160 | case "%y": 161 | year = date[i]; 162 | break; 163 | } 164 | ++i; 165 | } 166 | // Create Date object from UTC since the parsed value is supposed to be 167 | // in UTC, not local time. Also, the calendar uses UTC functions for 168 | // date extraction. 169 | return new Date(Date.UTC(year, month, day)); 170 | }; 171 | 172 | })(); 173 | -------------------------------------------------------------------------------- /static/admin/js/inlines.min.js: -------------------------------------------------------------------------------- 1 | (function(b){b.fn.formset=function(c){var a=b.extend({},b.fn.formset.defaults,c),d=b(this);c=d.parent();var h=function(a,e,f){var c=new RegExp("("+e+"-(\\d+|__prefix__))");e=e+"-"+f;b(a).prop("for")&&b(a).prop("for",b(a).prop("for").replace(c,e));a.id&&(a.id=a.id.replace(c,e));a.name&&(a.name=a.name.replace(c,e))},g=b("#id_"+a.prefix+"-TOTAL_FORMS").prop("autocomplete","off"),k=parseInt(g.val(),10),e=b("#id_"+a.prefix+"-MAX_NUM_FORMS").prop("autocomplete","off"),f=""===e.val()||0'+a.addText+""),m=c.find("tr:last a")):(d.filter(":last").after('"),m=d.filter(":last").next().find("a")));m.on("click",function(f){f.preventDefault();f=b("#"+a.prefix+"-empty"); 3 | var c=f.clone(!0);c.removeClass(a.emptyCssClass).addClass(a.formCssClass).attr("id",a.prefix+"-"+k);c.is("tr")?c.children(":last").append('"):c.is("ul")||c.is("ol")?c.append('
  • '+a.deleteText+"
  • "):c.children(":first").append(''+a.deleteText+"");c.find("*").each(function(){h(this,a.prefix,g.val())});c.insertBefore(b(f)); 4 | b(g).val(parseInt(g.val(),10)+1);k+=1;""!==e.val()&&0>=e.val()-g.val()&&m.parent().hide();c.find("a."+a.deleteCssClass).on("click",function(f){f.preventDefault();c.remove();--k;a.removed&&a.removed(c);b(document).trigger("formset:removed",[c,a.prefix]);f=b("."+a.formCssClass);b("#id_"+a.prefix+"-TOTAL_FORMS").val(f.length);(""===e.val()||0 tr",b(c).tabularFormset(c,a.options)}})})})(django.jQuery); 11 | -------------------------------------------------------------------------------- /static/admin/js/jquery.init.js: -------------------------------------------------------------------------------- 1 | /*global django:true, jQuery:false*/ 2 | /* Puts the included jQuery into our own namespace using noConflict and passing 3 | * it 'true'. This ensures that the included jQuery doesn't pollute the global 4 | * namespace (i.e. this preserves pre-existing values for both window.$ and 5 | * window.jQuery). 6 | */ 7 | var django = django || {}; 8 | django.jQuery = jQuery.noConflict(true); 9 | -------------------------------------------------------------------------------- /static/admin/js/popup_response.js: -------------------------------------------------------------------------------- 1 | /*global opener */ 2 | (function () { 3 | 'use strict'; 4 | var initData = JSON.parse(document.getElementById('django-admin-popup-response-constants').dataset.popupResponse); 5 | switch (initData.action) { 6 | case 'change': 7 | opener.dismissChangeRelatedObjectPopup(window, initData.value, initData.obj, initData.new_value); 8 | break; 9 | case 'delete': 10 | opener.dismissDeleteRelatedObjectPopup(window, initData.value); 11 | break; 12 | default: 13 | opener.dismissAddRelatedObjectPopup(window, initData.value, initData.obj); 14 | break; 15 | } 16 | })(); 17 | -------------------------------------------------------------------------------- /static/admin/js/prepopulate.js: -------------------------------------------------------------------------------- 1 | /*global URLify*/ 2 | (function ($) { 3 | 'use strict'; 4 | $.fn.prepopulate = function (dependencies, maxLength, allowUnicode) { 5 | /* 6 | Depends on urlify.js 7 | Populates a selected field with the values of the dependent fields, 8 | URLifies and shortens the string. 9 | dependencies - array of dependent fields ids 10 | maxLength - maximum length of the URLify'd string 11 | allowUnicode - Unicode support of the URLify'd string 12 | */ 13 | return this.each(function () { 14 | var prepopulatedField = $(this); 15 | 16 | var populate = function () { 17 | // Bail if the field's value has been changed by the user 18 | if (prepopulatedField.data('_changed')) { 19 | return; 20 | } 21 | 22 | var values = []; 23 | $.each(dependencies, function (i, field) { 24 | field = $(field); 25 | if (field.val().length > 0) { 26 | values.push(field.val()); 27 | } 28 | }); 29 | prepopulatedField.val(URLify(values.join(' '), maxLength, allowUnicode)); 30 | }; 31 | 32 | prepopulatedField.data('_changed', false); 33 | prepopulatedField.on('change', function () { 34 | prepopulatedField.data('_changed', true); 35 | }); 36 | 37 | if (!prepopulatedField.val()) { 38 | $(dependencies.join(',')).on('keyup change focus', populate); 39 | } 40 | }); 41 | }; 42 | })(django.jQuery); 43 | -------------------------------------------------------------------------------- /static/admin/js/prepopulate.min.js: -------------------------------------------------------------------------------- 1 | (function(b){b.fn.prepopulate=function(d,f,g){return this.each(function(){var a=b(this),h=function(){if(!a.data("_changed")){var e=[];b.each(d,function(a,c){c=b(c);01&&(n+="a"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Моля въведете още "+t+" символ";return t>1&&(n+="a"),n},loadingMore:function(){return"Зареждат се още…"},maximumSelected:function(e){var t="Можете да направите до "+e.maximum+" ";return e.maximum>1?t+="избора":t+="избор",t},noResults:function(){return"Няма намерени съвпадения"},searching:function(){return"Търсене…"},removeAllItems:function(){return"Премахнете всички елементи"}}}),{define:e.define,require:e.require}})(); -------------------------------------------------------------------------------- /static/admin/js/vendor/select2/i18n/bn.js: -------------------------------------------------------------------------------- 1 | /*! Select2 4.0.7 | https://github.com/select2/select2/blob/master/LICENSE.md */ 2 | 3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/bn",[],function(){return{errorLoading:function(){return"ফলাফলগুলি লোড করা যায়নি।"},inputTooLong:function(e){var t=e.input.length-e.maximum,n="অনুগ্রহ করে "+t+" টি অক্ষর মুছে দিন।";return t!=1&&(n="অনুগ্রহ করে "+t+" টি অক্ষর মুছে দিন।"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n=t+" টি অক্ষর অথবা অধিক অক্ষর লিখুন।";return n},loadingMore:function(){return"আরো ফলাফল লোড হচ্ছে ..."},maximumSelected:function(e){var t=e.maximum+" টি আইটেম নির্বাচন করতে পারবেন।";return e.maximum!=1&&(t=e.maximum+" টি আইটেম নির্বাচন করতে পারবেন।"),t},noResults:function(){return"কোন ফলাফল পাওয়া যায়নি।"},searching:function(){return"অনুসন্ধান করা হচ্ছে ..."}}}),{define:e.define,require:e.require}})(); -------------------------------------------------------------------------------- /static/admin/js/vendor/select2/i18n/bs.js: -------------------------------------------------------------------------------- 1 | /*! Select2 4.0.7 | https://github.com/select2/select2/blob/master/LICENSE.md */ 2 | 3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/bs",[],function(){function e(e,t,n,r){return e%10==1&&e%100!=11?t:e%10>=2&&e%10<=4&&(e%100<12||e%100>14)?n:r}return{errorLoading:function(){return"Preuzimanje nije uspijelo."},inputTooLong:function(t){var n=t.input.length-t.maximum,r="Obrišite "+n+" simbol";return r+=e(n,"","a","a"),r},inputTooShort:function(t){var n=t.minimum-t.input.length,r="Ukucajte bar još "+n+" simbol";return r+=e(n,"","a","a"),r},loadingMore:function(){return"Preuzimanje još rezultata…"},maximumSelected:function(t){var n="Možete izabrati samo "+t.maximum+" stavk";return n+=e(t.maximum,"u","e","i"),n},noResults:function(){return"Ništa nije pronađeno"},searching:function(){return"Pretraga…"},removeAllItems:function(){return"Uklonite sve stavke"}}}),{define:e.define,require:e.require}})(); -------------------------------------------------------------------------------- /static/admin/js/vendor/select2/i18n/ca.js: -------------------------------------------------------------------------------- 1 | /*! Select2 4.0.7 | https://github.com/select2/select2/blob/master/LICENSE.md */ 2 | 3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/ca",[],function(){return{errorLoading:function(){return"La càrrega ha fallat"},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Si us plau, elimina "+t+" car";return t==1?n+="àcter":n+="àcters",n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Si us plau, introdueix "+t+" car";return t==1?n+="àcter":n+="àcters",n},loadingMore:function(){return"Carregant més resultats…"},maximumSelected:function(e){var t="Només es pot seleccionar "+e.maximum+" element";return e.maximum!=1&&(t+="s"),t},noResults:function(){return"No s'han trobat resultats"},searching:function(){return"Cercant…"},removeAllItems:function(){return"Treu tots els elements"}}}),{define:e.define,require:e.require}})(); -------------------------------------------------------------------------------- /static/admin/js/vendor/select2/i18n/cs.js: -------------------------------------------------------------------------------- 1 | /*! Select2 4.0.7 | https://github.com/select2/select2/blob/master/LICENSE.md */ 2 | 3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/cs",[],function(){function e(e,t){switch(e){case 2:return t?"dva":"dvě";case 3:return"tři";case 4:return"čtyři"}return""}return{errorLoading:function(){return"Výsledky nemohly být načteny."},inputTooLong:function(t){var n=t.input.length-t.maximum;return n==1?"Prosím, zadejte o jeden znak méně.":n<=4?"Prosím, zadejte o "+e(n,!0)+" znaky méně.":"Prosím, zadejte o "+n+" znaků méně."},inputTooShort:function(t){var n=t.minimum-t.input.length;return n==1?"Prosím, zadejte ještě jeden znak.":n<=4?"Prosím, zadejte ještě další "+e(n,!0)+" znaky.":"Prosím, zadejte ještě dalších "+n+" znaků."},loadingMore:function(){return"Načítají se další výsledky…"},maximumSelected:function(t){var n=t.maximum;return n==1?"Můžete zvolit jen jednu položku.":n<=4?"Můžete zvolit maximálně "+e(n,!1)+" položky.":"Můžete zvolit maximálně "+n+" položek."},noResults:function(){return"Nenalezeny žádné položky."},searching:function(){return"Vyhledávání…"},removeAllItems:function(){return"Odstraňte všechny položky"}}}),{define:e.define,require:e.require}})(); -------------------------------------------------------------------------------- /static/admin/js/vendor/select2/i18n/da.js: -------------------------------------------------------------------------------- 1 | /*! Select2 4.0.7 | https://github.com/select2/select2/blob/master/LICENSE.md */ 2 | 3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/da",[],function(){return{errorLoading:function(){return"Resultaterne kunne ikke indlæses."},inputTooLong:function(e){var t=e.input.length-e.maximum;return"Angiv venligst "+t+" tegn mindre"},inputTooShort:function(e){var t=e.minimum-e.input.length;return"Angiv venligst "+t+" tegn mere"},loadingMore:function(){return"Indlæser flere resultater…"},maximumSelected:function(e){var t="Du kan kun vælge "+e.maximum+" emne";return e.maximum!=1&&(t+="r"),t},noResults:function(){return"Ingen resultater fundet"},searching:function(){return"Søger…"},removeAllItems:function(){return"Fjern alle elementer"}}}),{define:e.define,require:e.require}})(); -------------------------------------------------------------------------------- /static/admin/js/vendor/select2/i18n/de.js: -------------------------------------------------------------------------------- 1 | /*! Select2 4.0.7 | https://github.com/select2/select2/blob/master/LICENSE.md */ 2 | 3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/de",[],function(){return{errorLoading:function(){return"Die Ergebnisse konnten nicht geladen werden."},inputTooLong:function(e){var t=e.input.length-e.maximum;return"Bitte "+t+" Zeichen weniger eingeben"},inputTooShort:function(e){var t=e.minimum-e.input.length;return"Bitte "+t+" Zeichen mehr eingeben"},loadingMore:function(){return"Lade mehr Ergebnisse…"},maximumSelected:function(e){var t="Sie können nur "+e.maximum+" Eintr";return e.maximum===1?t+="ag":t+="äge",t+=" auswählen",t},noResults:function(){return"Keine Übereinstimmungen gefunden"},searching:function(){return"Suche…"},removeAllItems:function(){return"Entferne alle Gegenstände"}}}),{define:e.define,require:e.require}})(); -------------------------------------------------------------------------------- /static/admin/js/vendor/select2/i18n/dsb.js: -------------------------------------------------------------------------------- 1 | /*! Select2 4.0.7 | https://github.com/select2/select2/blob/master/LICENSE.md */ 2 | 3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/dsb",[],function(){var e=["znamuško","znamušce","znamuška","znamuškow"],t=["zapisk","zapiska","zapiski","zapiskow"],n=function(t,n){if(t===1)return n[0];if(t===2)return n[1];if(t>2&&t<=4)return n[2];if(t>=5)return n[3]};return{errorLoading:function(){return"Wuslědki njejsu se dali zacytaś."},inputTooLong:function(t){var r=t.input.length-t.maximum;return"Pšosym lašuj "+r+" "+n(r,e)},inputTooShort:function(t){var r=t.minimum-t.input.length;return"Pšosym zapódaj nanejmjenjej "+r+" "+n(r,e)},loadingMore:function(){return"Dalšne wuslědki se zacytaju…"},maximumSelected:function(e){return"Móžoš jano "+e.maximum+" "+n(e.maximum,t)+"wubraś."},noResults:function(){return"Žedne wuslědki namakane"},searching:function(){return"Pyta se…"},removeAllItems:function(){return"Remove all items"}}}),{define:e.define,require:e.require}})(); -------------------------------------------------------------------------------- /static/admin/js/vendor/select2/i18n/el.js: -------------------------------------------------------------------------------- 1 | /*! Select2 4.0.7 | https://github.com/select2/select2/blob/master/LICENSE.md */ 2 | 3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/el",[],function(){return{errorLoading:function(){return"Τα αποτελέσματα δεν μπόρεσαν να φορτώσουν."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Παρακαλώ διαγράψτε "+t+" χαρακτήρ";return t==1&&(n+="α"),t!=1&&(n+="ες"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Παρακαλώ συμπληρώστε "+t+" ή περισσότερους χαρακτήρες";return n},loadingMore:function(){return"Φόρτωση περισσότερων αποτελεσμάτων…"},maximumSelected:function(e){var t="Μπορείτε να επιλέξετε μόνο "+e.maximum+" επιλογ";return e.maximum==1&&(t+="ή"),e.maximum!=1&&(t+="ές"),t},noResults:function(){return"Δεν βρέθηκαν αποτελέσματα"},searching:function(){return"Αναζήτηση…"},removeAllItems:function(){return"Καταργήστε όλα τα στοιχεία"}}}),{define:e.define,require:e.require}})(); -------------------------------------------------------------------------------- /static/admin/js/vendor/select2/i18n/en.js: -------------------------------------------------------------------------------- 1 | /*! Select2 4.0.7 | https://github.com/select2/select2/blob/master/LICENSE.md */ 2 | 3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/en",[],function(){return{errorLoading:function(){return"The results could not be loaded."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Please delete "+t+" character";return t!=1&&(n+="s"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Please enter "+t+" or more characters";return n},loadingMore:function(){return"Loading more results…"},maximumSelected:function(e){var t="You can only select "+e.maximum+" item";return e.maximum!=1&&(t+="s"),t},noResults:function(){return"No results found"},searching:function(){return"Searching…"},removeAllItems:function(){return"Remove all items"}}}),{define:e.define,require:e.require}})(); -------------------------------------------------------------------------------- /static/admin/js/vendor/select2/i18n/es.js: -------------------------------------------------------------------------------- 1 | /*! Select2 4.0.7 | https://github.com/select2/select2/blob/master/LICENSE.md */ 2 | 3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/es",[],function(){return{errorLoading:function(){return"No se pudieron cargar los resultados"},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Por favor, elimine "+t+" car";return t==1?n+="ácter":n+="acteres",n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Por favor, introduzca "+t+" car";return t==1?n+="ácter":n+="acteres",n},loadingMore:function(){return"Cargando más resultados…"},maximumSelected:function(e){var t="Sólo puede seleccionar "+e.maximum+" elemento";return e.maximum!=1&&(t+="s"),t},noResults:function(){return"No se encontraron resultados"},searching:function(){return"Buscando…"},removeAllItems:function(){return"Eliminar todos los elementos"}}}),{define:e.define,require:e.require}})(); -------------------------------------------------------------------------------- /static/admin/js/vendor/select2/i18n/et.js: -------------------------------------------------------------------------------- 1 | /*! Select2 4.0.7 | https://github.com/select2/select2/blob/master/LICENSE.md */ 2 | 3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/et",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n="Sisesta "+t+" täht";return t!=1&&(n+="e"),n+=" vähem",n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Sisesta "+t+" täht";return t!=1&&(n+="e"),n+=" rohkem",n},loadingMore:function(){return"Laen tulemusi…"},maximumSelected:function(e){var t="Saad vaid "+e.maximum+" tulemus";return e.maximum==1?t+="e":t+="t",t+=" valida",t},noResults:function(){return"Tulemused puuduvad"},searching:function(){return"Otsin…"},removeAllItems:function(){return"Eemalda kõik esemed"}}}),{define:e.define,require:e.require}})(); -------------------------------------------------------------------------------- /static/admin/js/vendor/select2/i18n/eu.js: -------------------------------------------------------------------------------- 1 | /*! Select2 4.0.7 | https://github.com/select2/select2/blob/master/LICENSE.md */ 2 | 3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/eu",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n="Idatzi ";return t==1?n+="karaktere bat":n+=t+" karaktere",n+=" gutxiago",n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Idatzi ";return t==1?n+="karaktere bat":n+=t+" karaktere",n+=" gehiago",n},loadingMore:function(){return"Emaitza gehiago kargatzen…"},maximumSelected:function(e){return e.maximum===1?"Elementu bakarra hauta dezakezu":e.maximum+" elementu hauta ditzakezu soilik"},noResults:function(){return"Ez da bat datorrenik aurkitu"},searching:function(){return"Bilatzen…"},removeAllItems:function(){return"Kendu elementu guztiak"}}}),{define:e.define,require:e.require}})(); -------------------------------------------------------------------------------- /static/admin/js/vendor/select2/i18n/fa.js: -------------------------------------------------------------------------------- 1 | /*! Select2 4.0.7 | https://github.com/select2/select2/blob/master/LICENSE.md */ 2 | 3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/fa",[],function(){return{errorLoading:function(){return"امکان بارگذاری نتایج وجود ندارد."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="لطفاً "+t+" کاراکتر را حذف نمایید";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="لطفاً تعداد "+t+" کاراکتر یا بیشتر وارد نمایید";return n},loadingMore:function(){return"در حال بارگذاری نتایج بیشتر..."},maximumSelected:function(e){var t="شما تنها می‌توانید "+e.maximum+" آیتم را انتخاب نمایید";return t},noResults:function(){return"هیچ نتیجه‌ای یافت نشد"},searching:function(){return"در حال جستجو..."},removeAllItems:function(){return"همه موارد را حذف کنید"}}}),{define:e.define,require:e.require}})(); -------------------------------------------------------------------------------- /static/admin/js/vendor/select2/i18n/fi.js: -------------------------------------------------------------------------------- 1 | /*! Select2 4.0.7 | https://github.com/select2/select2/blob/master/LICENSE.md */ 2 | 3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/fi",[],function(){return{errorLoading:function(){return"Tuloksia ei saatu ladattua."},inputTooLong:function(e){var t=e.input.length-e.maximum;return"Ole hyvä ja anna "+t+" merkkiä vähemmän"},inputTooShort:function(e){var t=e.minimum-e.input.length;return"Ole hyvä ja anna "+t+" merkkiä lisää"},loadingMore:function(){return"Ladataan lisää tuloksia…"},maximumSelected:function(e){return"Voit valita ainoastaan "+e.maximum+" kpl"},noResults:function(){return"Ei tuloksia"},searching:function(){return"Haetaan…"},removeAllItems:function(){return"Poista kaikki kohteet"}}}),{define:e.define,require:e.require}})(); -------------------------------------------------------------------------------- /static/admin/js/vendor/select2/i18n/fr.js: -------------------------------------------------------------------------------- 1 | /*! Select2 4.0.7 | https://github.com/select2/select2/blob/master/LICENSE.md */ 2 | 3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/fr",[],function(){return{errorLoading:function(){return"Les résultats ne peuvent pas être chargés."},inputTooLong:function(e){var t=e.input.length-e.maximum;return"Supprimez "+t+" caractère"+(t>1?"s":"")},inputTooShort:function(e){var t=e.minimum-e.input.length;return"Saisissez au moins "+t+" caractère"+(t>1?"s":"")},loadingMore:function(){return"Chargement de résultats supplémentaires…"},maximumSelected:function(e){return"Vous pouvez seulement sélectionner "+e.maximum+" élément"+(e.maximum>1?"s":"")},noResults:function(){return"Aucun résultat trouvé"},searching:function(){return"Recherche en cours…"},removeAllItems:function(){return"Supprimer tous les articles"}}}),{define:e.define,require:e.require}})(); -------------------------------------------------------------------------------- /static/admin/js/vendor/select2/i18n/gl.js: -------------------------------------------------------------------------------- 1 | /*! Select2 4.0.7 | https://github.com/select2/select2/blob/master/LICENSE.md */ 2 | 3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/gl",[],function(){return{errorLoading:function(){return"Non foi posíbel cargar os resultados."},inputTooLong:function(e){var t=e.input.length-e.maximum;return t===1?"Elimine un carácter":"Elimine "+t+" caracteres"},inputTooShort:function(e){var t=e.minimum-e.input.length;return t===1?"Engada un carácter":"Engada "+t+" caracteres"},loadingMore:function(){return"Cargando máis resultados…"},maximumSelected:function(e){return e.maximum===1?"Só pode seleccionar un elemento":"Só pode seleccionar "+e.maximum+" elementos"},noResults:function(){return"Non se atoparon resultados"},searching:function(){return"Buscando…"},removeAllItems:function(){return"Elimina todos os elementos"}}}),{define:e.define,require:e.require}})(); -------------------------------------------------------------------------------- /static/admin/js/vendor/select2/i18n/he.js: -------------------------------------------------------------------------------- 1 | /*! Select2 4.0.7 | https://github.com/select2/select2/blob/master/LICENSE.md */ 2 | 3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/he",[],function(){return{errorLoading:function(){return"שגיאה בטעינת התוצאות"},inputTooLong:function(e){var t=e.input.length-e.maximum,n="נא למחוק ";return t===1?n+="תו אחד":n+=t+" תווים",n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="נא להכניס ";return t===1?n+="תו אחד":n+=t+" תווים",n+=" או יותר",n},loadingMore:function(){return"טוען תוצאות נוספות…"},maximumSelected:function(e){var t="באפשרותך לבחור עד ";return e.maximum===1?t+="פריט אחד":t+=e.maximum+" פריטים",t},noResults:function(){return"לא נמצאו תוצאות"},searching:function(){return"מחפש…"},removeAllItems:function(){return"הסר את כל הפריטים"}}}),{define:e.define,require:e.require}})(); -------------------------------------------------------------------------------- /static/admin/js/vendor/select2/i18n/hi.js: -------------------------------------------------------------------------------- 1 | /*! Select2 4.0.7 | https://github.com/select2/select2/blob/master/LICENSE.md */ 2 | 3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/hi",[],function(){return{errorLoading:function(){return"परिणामों को लोड नहीं किया जा सका।"},inputTooLong:function(e){var t=e.input.length-e.maximum,n=t+" अक्षर को हटा दें";return t>1&&(n=t+" अक्षरों को हटा दें "),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="कृपया "+t+" या अधिक अक्षर दर्ज करें";return n},loadingMore:function(){return"अधिक परिणाम लोड हो रहे है..."},maximumSelected:function(e){var t="आप केवल "+e.maximum+" आइटम का चयन कर सकते हैं";return t},noResults:function(){return"कोई परिणाम नहीं मिला"},searching:function(){return"खोज रहा है..."},removeAllItems:function(){return"सभी वस्तुओं को हटा दें"}}}),{define:e.define,require:e.require}})(); -------------------------------------------------------------------------------- /static/admin/js/vendor/select2/i18n/hr.js: -------------------------------------------------------------------------------- 1 | /*! Select2 4.0.7 | https://github.com/select2/select2/blob/master/LICENSE.md */ 2 | 3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/hr",[],function(){function e(e){var t=" "+e+" znak";return e%10<5&&e%10>0&&(e%100<5||e%100>19)?e%10>1&&(t+="a"):t+="ova",t}return{errorLoading:function(){return"Preuzimanje nije uspjelo."},inputTooLong:function(t){var n=t.input.length-t.maximum;return"Unesite "+e(n)},inputTooShort:function(t){var n=t.minimum-t.input.length;return"Unesite još "+e(n)},loadingMore:function(){return"Učitavanje rezultata…"},maximumSelected:function(e){return"Maksimalan broj odabranih stavki je "+e.maximum},noResults:function(){return"Nema rezultata"},searching:function(){return"Pretraga…"},removeAllItems:function(){return"Ukloni sve stavke"}}}),{define:e.define,require:e.require}})(); -------------------------------------------------------------------------------- /static/admin/js/vendor/select2/i18n/hsb.js: -------------------------------------------------------------------------------- 1 | /*! Select2 4.0.7 | https://github.com/select2/select2/blob/master/LICENSE.md */ 2 | 3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/hsb",[],function(){var e=["znamješko","znamješce","znamješka","znamješkow"],t=["zapisk","zapiskaj","zapiski","zapiskow"],n=function(t,n){if(t===1)return n[0];if(t===2)return n[1];if(t>2&&t<=4)return n[2];if(t>=5)return n[3]};return{errorLoading:function(){return"Wuslědki njedachu so začitać."},inputTooLong:function(t){var r=t.input.length-t.maximum;return"Prošu zhašej "+r+" "+n(r,e)},inputTooShort:function(t){var r=t.minimum-t.input.length;return"Prošu zapodaj znajmjeńša "+r+" "+n(r,e)},loadingMore:function(){return"Dalše wuslědki so začitaja…"},maximumSelected:function(e){return"Móžeš jenož "+e.maximum+" "+n(e.maximum,t)+"wubrać"},noResults:function(){return"Žane wuslědki namakane"},searching:function(){return"Pyta so…"},removeAllItems:function(){return"Remove all items"}}}),{define:e.define,require:e.require}})(); -------------------------------------------------------------------------------- /static/admin/js/vendor/select2/i18n/hu.js: -------------------------------------------------------------------------------- 1 | /*! Select2 4.0.7 | https://github.com/select2/select2/blob/master/LICENSE.md */ 2 | 3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/hu",[],function(){return{errorLoading:function(){return"Az eredmények betöltése nem sikerült."},inputTooLong:function(e){var t=e.input.length-e.maximum;return"Túl hosszú. "+t+" karakterrel több, mint kellene."},inputTooShort:function(e){var t=e.minimum-e.input.length;return"Túl rövid. Még "+t+" karakter hiányzik."},loadingMore:function(){return"Töltés…"},maximumSelected:function(e){return"Csak "+e.maximum+" elemet lehet kiválasztani."},noResults:function(){return"Nincs találat."},searching:function(){return"Keresés…"},removeAllItems:function(){return"Távolítson el minden elemet"}}}),{define:e.define,require:e.require}})(); -------------------------------------------------------------------------------- /static/admin/js/vendor/select2/i18n/hy.js: -------------------------------------------------------------------------------- 1 | /*! Select2 4.0.7 | https://github.com/select2/select2/blob/master/LICENSE.md */ 2 | 3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/hy",[],function(){return{errorLoading:function(){return"Արդյունքները հնարավոր չէ բեռնել։"},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Խնդրում ենք հեռացնել "+t+" նշան";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Խնդրում ենք մուտքագրել "+t+" կամ ավել նշաններ";return n},loadingMore:function(){return"Բեռնվում են նոր արդյունքներ․․․"},maximumSelected:function(e){var t="Դուք կարող եք ընտրել առավելագույնը "+e.maximum+" կետ";return t},noResults:function(){return"Արդյունքներ չեն գտնվել"},searching:function(){return"Որոնում․․․"},removeAllItems:function(){return"Հեռացնել բոլոր տարրերը"}}}),{define:e.define,require:e.require}})(); -------------------------------------------------------------------------------- /static/admin/js/vendor/select2/i18n/id.js: -------------------------------------------------------------------------------- 1 | /*! Select2 4.0.7 | https://github.com/select2/select2/blob/master/LICENSE.md */ 2 | 3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/id",[],function(){return{errorLoading:function(){return"Data tidak boleh diambil."},inputTooLong:function(e){var t=e.input.length-e.maximum;return"Hapuskan "+t+" huruf"},inputTooShort:function(e){var t=e.minimum-e.input.length;return"Masukkan "+t+" huruf lagi"},loadingMore:function(){return"Mengambil data…"},maximumSelected:function(e){return"Anda hanya dapat memilih "+e.maximum+" pilihan"},noResults:function(){return"Tidak ada data yang sesuai"},searching:function(){return"Mencari…"},removeAllItems:function(){return"Hapus semua item"}}}),{define:e.define,require:e.require}})(); -------------------------------------------------------------------------------- /static/admin/js/vendor/select2/i18n/is.js: -------------------------------------------------------------------------------- 1 | /*! Select2 4.0.7 | https://github.com/select2/select2/blob/master/LICENSE.md */ 2 | 3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/is",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n="Vinsamlegast styttið texta um "+t+" staf";return t<=1?n:n+"i"},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Vinsamlegast skrifið "+t+" staf";return t>1&&(n+="i"),n+=" í viðbót",n},loadingMore:function(){return"Sæki fleiri niðurstöður…"},maximumSelected:function(e){return"Þú getur aðeins valið "+e.maximum+" atriði"},noResults:function(){return"Ekkert fannst"},searching:function(){return"Leita…"},removeAllItems:function(){return"Fjarlægðu öll atriði"}}}),{define:e.define,require:e.require}})(); -------------------------------------------------------------------------------- /static/admin/js/vendor/select2/i18n/it.js: -------------------------------------------------------------------------------- 1 | /*! Select2 4.0.7 | https://github.com/select2/select2/blob/master/LICENSE.md */ 2 | 3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/it",[],function(){return{errorLoading:function(){return"I risultati non possono essere caricati."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Per favore cancella "+t+" caratter";return t!==1?n+="i":n+="e",n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Per favore inserisci "+t+" o più caratteri";return n},loadingMore:function(){return"Caricando più risultati…"},maximumSelected:function(e){var t="Puoi selezionare solo "+e.maximum+" element";return e.maximum!==1?t+="i":t+="o",t},noResults:function(){return"Nessun risultato trovato"},searching:function(){return"Sto cercando…"},removeAllItems:function(){return"Rimuovi tutti gli oggetti"}}}),{define:e.define,require:e.require}})(); -------------------------------------------------------------------------------- /static/admin/js/vendor/select2/i18n/ja.js: -------------------------------------------------------------------------------- 1 | /*! Select2 4.0.7 | https://github.com/select2/select2/blob/master/LICENSE.md */ 2 | 3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/ja",[],function(){return{errorLoading:function(){return"結果が読み込まれませんでした"},inputTooLong:function(e){var t=e.input.length-e.maximum,n=t+" 文字を削除してください";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="少なくとも "+t+" 文字を入力してください";return n},loadingMore:function(){return"読み込み中…"},maximumSelected:function(e){var t=e.maximum+" 件しか選択できません";return t},noResults:function(){return"対象が見つかりません"},searching:function(){return"検索しています…"},removeAllItems:function(){return"すべてのアイテムを削除"}}}),{define:e.define,require:e.require}})(); -------------------------------------------------------------------------------- /static/admin/js/vendor/select2/i18n/ka.js: -------------------------------------------------------------------------------- 1 | /*! Select2 4.0.7 | https://github.com/select2/select2/blob/master/LICENSE.md */ 2 | 3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/ka",[],function(){return{errorLoading:function(){return"მონაცემების ჩატვირთვა შეუძლებელია."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="გთხოვთ აკრიფეთ "+t+" სიმბოლოთი ნაკლები";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="გთხოვთ აკრიფეთ "+t+" სიმბოლო ან მეტი";return n},loadingMore:function(){return"მონაცემების ჩატვირთვა…"},maximumSelected:function(e){var t="თქვენ შეგიძლიათ აირჩიოთ არაუმეტეს "+e.maximum+" ელემენტი";return t},noResults:function(){return"რეზულტატი არ მოიძებნა"},searching:function(){return"ძიება…"},removeAllItems:function(){return"ამოიღე ყველა ელემენტი"}}}),{define:e.define,require:e.require}})(); -------------------------------------------------------------------------------- /static/admin/js/vendor/select2/i18n/km.js: -------------------------------------------------------------------------------- 1 | /*! Select2 4.0.7 | https://github.com/select2/select2/blob/master/LICENSE.md */ 2 | 3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/km",[],function(){return{errorLoading:function(){return"មិនអាចទាញយកទិន្នន័យ"},inputTooLong:function(e){var t=e.input.length-e.maximum,n="សូមលុបចេញ "+t+" អក្សរ";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="សូមបញ្ចូល"+t+" អក្សរ រឺ ច្រើនជាងនេះ";return n},loadingMore:function(){return"កំពុងទាញយកទិន្នន័យបន្ថែម..."},maximumSelected:function(e){var t="អ្នកអាចជ្រើសរើសបានតែ "+e.maximum+" ជម្រើសប៉ុណ្ណោះ";return t},noResults:function(){return"មិនមានលទ្ធផល"},searching:function(){return"កំពុងស្វែងរក..."},removeAllItems:function(){return"លុបធាតុទាំងអស់"}}}),{define:e.define,require:e.require}})(); -------------------------------------------------------------------------------- /static/admin/js/vendor/select2/i18n/ko.js: -------------------------------------------------------------------------------- 1 | /*! Select2 4.0.7 | https://github.com/select2/select2/blob/master/LICENSE.md */ 2 | 3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/ko",[],function(){return{errorLoading:function(){return"결과를 불러올 수 없습니다."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="너무 깁니다. "+t+" 글자 지워주세요.";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="너무 짧습니다. "+t+" 글자 더 입력해주세요.";return n},loadingMore:function(){return"불러오는 중…"},maximumSelected:function(e){var t="최대 "+e.maximum+"개까지만 선택 가능합니다.";return t},noResults:function(){return"결과가 없습니다."},searching:function(){return"검색 중…"},removeAllItems:function(){return"모든 항목 삭제"}}}),{define:e.define,require:e.require}})(); -------------------------------------------------------------------------------- /static/admin/js/vendor/select2/i18n/lt.js: -------------------------------------------------------------------------------- 1 | /*! Select2 4.0.7 | https://github.com/select2/select2/blob/master/LICENSE.md */ 2 | 3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/lt",[],function(){function e(e,t,n,r){return e%10===1&&(e%100<11||e%100>19)?t:e%10>=2&&e%10<=9&&(e%100<11||e%100>19)?n:r}return{inputTooLong:function(t){var n=t.input.length-t.maximum,r="Pašalinkite "+n+" simbol";return r+=e(n,"į","ius","ių"),r},inputTooShort:function(t){var n=t.minimum-t.input.length,r="Įrašykite dar "+n+" simbol";return r+=e(n,"į","ius","ių"),r},loadingMore:function(){return"Kraunama daugiau rezultatų…"},maximumSelected:function(t){var n="Jūs galite pasirinkti tik "+t.maximum+" element";return n+=e(t.maximum,"ą","us","ų"),n},noResults:function(){return"Atitikmenų nerasta"},searching:function(){return"Ieškoma…"},removeAllItems:function(){return"Pašalinti visus elementus"}}}),{define:e.define,require:e.require}})(); -------------------------------------------------------------------------------- /static/admin/js/vendor/select2/i18n/lv.js: -------------------------------------------------------------------------------- 1 | /*! Select2 4.0.7 | https://github.com/select2/select2/blob/master/LICENSE.md */ 2 | 3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/lv",[],function(){function e(e,t,n,r){return e===11?t:e%10===1?n:r}return{inputTooLong:function(t){var n=t.input.length-t.maximum,r="Lūdzu ievadiet par "+n;return r+=" simbol"+e(n,"iem","u","iem"),r+" mazāk"},inputTooShort:function(t){var n=t.minimum-t.input.length,r="Lūdzu ievadiet vēl "+n;return r+=" simbol"+e(n,"us","u","us"),r},loadingMore:function(){return"Datu ielāde…"},maximumSelected:function(t){var n="Jūs varat izvēlēties ne vairāk kā "+t.maximum;return n+=" element"+e(t.maximum,"us","u","us"),n},noResults:function(){return"Sakritību nav"},searching:function(){return"Meklēšana…"},removeAllItems:function(){return"Noņemt visus vienumus"}}}),{define:e.define,require:e.require}})(); -------------------------------------------------------------------------------- /static/admin/js/vendor/select2/i18n/mk.js: -------------------------------------------------------------------------------- 1 | /*! Select2 4.0.7 | https://github.com/select2/select2/blob/master/LICENSE.md */ 2 | 3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/mk",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n="Ве молиме внесете "+e.maximum+" помалку карактер";return e.maximum!==1&&(n+="и"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Ве молиме внесете уште "+e.maximum+" карактер";return e.maximum!==1&&(n+="и"),n},loadingMore:function(){return"Вчитување резултати…"},maximumSelected:function(e){var t="Можете да изберете само "+e.maximum+" ставк";return e.maximum===1?t+="а":t+="и",t},noResults:function(){return"Нема пронајдено совпаѓања"},searching:function(){return"Пребарување…"},removeAllItems:function(){return"Отстрани ги сите предмети"}}}),{define:e.define,require:e.require}})(); -------------------------------------------------------------------------------- /static/admin/js/vendor/select2/i18n/ms.js: -------------------------------------------------------------------------------- 1 | /*! Select2 4.0.7 | https://github.com/select2/select2/blob/master/LICENSE.md */ 2 | 3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/ms",[],function(){return{errorLoading:function(){return"Keputusan tidak berjaya dimuatkan."},inputTooLong:function(e){var t=e.input.length-e.maximum;return"Sila hapuskan "+t+" aksara"},inputTooShort:function(e){var t=e.minimum-e.input.length;return"Sila masukkan "+t+" atau lebih aksara"},loadingMore:function(){return"Sedang memuatkan keputusan…"},maximumSelected:function(e){return"Anda hanya boleh memilih "+e.maximum+" pilihan"},noResults:function(){return"Tiada padanan yang ditemui"},searching:function(){return"Mencari…"},removeAllItems:function(){return"Keluarkan semua item"}}}),{define:e.define,require:e.require}})(); -------------------------------------------------------------------------------- /static/admin/js/vendor/select2/i18n/nb.js: -------------------------------------------------------------------------------- 1 | /*! Select2 4.0.7 | https://github.com/select2/select2/blob/master/LICENSE.md */ 2 | 3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/nb",[],function(){return{errorLoading:function(){return"Kunne ikke hente resultater."},inputTooLong:function(e){var t=e.input.length-e.maximum;return"Vennligst fjern "+t+" tegn"},inputTooShort:function(e){var t=e.minimum-e.input.length;return"Vennligst skriv inn "+t+" tegn til"},loadingMore:function(){return"Laster flere resultater…"},maximumSelected:function(e){return"Du kan velge maks "+e.maximum+" elementer"},noResults:function(){return"Ingen treff"},searching:function(){return"Søker…"},removeAllItems:function(){return"Fjern alle elementer"}}}),{define:e.define,require:e.require}})(); -------------------------------------------------------------------------------- /static/admin/js/vendor/select2/i18n/ne.js: -------------------------------------------------------------------------------- 1 | /*! Select2 4.0.7 | https://github.com/select2/select2/blob/master/LICENSE.md */ 2 | 3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/ne",[],function(){return{errorLoading:function(){return"नतिजाहरु देखाउन सकिएन।"},inputTooLong:function(e){var t=e.input.length-e.maximum,n="कृपया "+t+" अक्षर मेटाउनुहोस्।";return t!=1&&(n+="कृपया "+t+" अक्षरहरु मेटाउनुहोस्।"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="कृपया बाँकी रहेका "+t+" वा अरु धेरै अक्षरहरु भर्नुहोस्।";return n},loadingMore:function(){return"अरु नतिजाहरु भरिँदैछन् …"},maximumSelected:function(e){var t="तँपाई "+e.maximum+" वस्तु मात्र छान्न पाउँनुहुन्छ।";return e.maximum!=1&&(t="तँपाई "+e.maximum+" वस्तुहरु मात्र छान्न पाउँनुहुन्छ।"),t},noResults:function(){return"कुनै पनि नतिजा भेटिएन।"},searching:function(){return"खोजि हुँदैछ…"}}}),{define:e.define,require:e.require}})(); -------------------------------------------------------------------------------- /static/admin/js/vendor/select2/i18n/nl.js: -------------------------------------------------------------------------------- 1 | /*! Select2 4.0.7 | https://github.com/select2/select2/blob/master/LICENSE.md */ 2 | 3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/nl",[],function(){return{errorLoading:function(){return"De resultaten konden niet worden geladen."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Gelieve "+t+" karakters te verwijderen";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Gelieve "+t+" of meer karakters in te voeren";return n},loadingMore:function(){return"Meer resultaten laden…"},maximumSelected:function(e){var t=e.maximum==1?"kan":"kunnen",n="Er "+t+" maar "+e.maximum+" item";return e.maximum!=1&&(n+="s"),n+=" worden geselecteerd",n},noResults:function(){return"Geen resultaten gevonden…"},searching:function(){return"Zoeken…"},removeAllItems:function(){return"Verwijder alle items"}}}),{define:e.define,require:e.require}})(); -------------------------------------------------------------------------------- /static/admin/js/vendor/select2/i18n/pl.js: -------------------------------------------------------------------------------- 1 | /*! Select2 4.0.7 | https://github.com/select2/select2/blob/master/LICENSE.md */ 2 | 3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/pl",[],function(){var e=["znak","znaki","znaków"],t=["element","elementy","elementów"],n=function(t,n){if(t===1)return n[0];if(t>1&&t<=4)return n[1];if(t>=5)return n[2]};return{errorLoading:function(){return"Nie można załadować wyników."},inputTooLong:function(t){var r=t.input.length-t.maximum;return"Usuń "+r+" "+n(r,e)},inputTooShort:function(t){var r=t.minimum-t.input.length;return"Podaj przynajmniej "+r+" "+n(r,e)},loadingMore:function(){return"Trwa ładowanie…"},maximumSelected:function(e){return"Możesz zaznaczyć tylko "+e.maximum+" "+n(e.maximum,t)},noResults:function(){return"Brak wyników"},searching:function(){return"Trwa wyszukiwanie…"},removeAllItems:function(){return"Usuń wszystkie przedmioty"}}}),{define:e.define,require:e.require}})(); -------------------------------------------------------------------------------- /static/admin/js/vendor/select2/i18n/ps.js: -------------------------------------------------------------------------------- 1 | /*! Select2 4.0.7 | https://github.com/select2/select2/blob/master/LICENSE.md */ 2 | 3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/ps",[],function(){return{errorLoading:function(){return"پايلي نه سي ترلاسه کېدای"},inputTooLong:function(e){var t=e.input.length-e.maximum,n="د مهربانۍ لمخي "+t+" توری ړنګ کړئ";return t!=1&&(n=n.replace("توری","توري")),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="لږ تر لږه "+t+" يا ډېر توري وليکئ";return n},loadingMore:function(){return"نوري پايلي ترلاسه کيږي..."},maximumSelected:function(e){var t="تاسو يوازي "+e.maximum+" قلم په نښه کولای سی";return e.maximum!=1&&(t=t.replace("قلم","قلمونه")),t},noResults:function(){return"پايلي و نه موندل سوې"},searching:function(){return"لټول کيږي..."},removeAllItems:function(){return"ټول توکي لرې کړئ"}}}),{define:e.define,require:e.require}})(); -------------------------------------------------------------------------------- /static/admin/js/vendor/select2/i18n/pt-BR.js: -------------------------------------------------------------------------------- 1 | /*! Select2 4.0.7 | https://github.com/select2/select2/blob/master/LICENSE.md */ 2 | 3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/pt-BR",[],function(){return{errorLoading:function(){return"Os resultados não puderam ser carregados."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Apague "+t+" caracter";return t!=1&&(n+="es"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Digite "+t+" ou mais caracteres";return n},loadingMore:function(){return"Carregando mais resultados…"},maximumSelected:function(e){var t="Você só pode selecionar "+e.maximum+" ite";return e.maximum==1?t+="m":t+="ns",t},noResults:function(){return"Nenhum resultado encontrado"},searching:function(){return"Buscando…"},removeAllItems:function(){return"Remover todos os itens"}}}),{define:e.define,require:e.require}})(); -------------------------------------------------------------------------------- /static/admin/js/vendor/select2/i18n/pt.js: -------------------------------------------------------------------------------- 1 | /*! Select2 4.0.7 | https://github.com/select2/select2/blob/master/LICENSE.md */ 2 | 3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/pt",[],function(){return{errorLoading:function(){return"Os resultados não puderam ser carregados."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Por favor apague "+t+" ";return n+=t!=1?"caracteres":"caractere",n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Introduza "+t+" ou mais caracteres";return n},loadingMore:function(){return"A carregar mais resultados…"},maximumSelected:function(e){var t="Apenas pode seleccionar "+e.maximum+" ";return t+=e.maximum!=1?"itens":"item",t},noResults:function(){return"Sem resultados"},searching:function(){return"A procurar…"},removeAllItems:function(){return"Remover todos os itens"}}}),{define:e.define,require:e.require}})(); -------------------------------------------------------------------------------- /static/admin/js/vendor/select2/i18n/ro.js: -------------------------------------------------------------------------------- 1 | /*! Select2 4.0.7 | https://github.com/select2/select2/blob/master/LICENSE.md */ 2 | 3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/ro",[],function(){return{errorLoading:function(){return"Rezultatele nu au putut fi incărcate."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Vă rugăm să ștergeți"+t+" caracter";return t!==1&&(n+="e"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Vă rugăm să introduceți "+t+" sau mai multe caractere";return n},loadingMore:function(){return"Se încarcă mai multe rezultate…"},maximumSelected:function(e){var t="Aveți voie să selectați cel mult "+e.maximum;return t+=" element",e.maximum!==1&&(t+="e"),t},noResults:function(){return"Nu au fost găsite rezultate"},searching:function(){return"Căutare…"},removeAllItems:function(){return"Eliminați toate elementele"}}}),{define:e.define,require:e.require}})(); -------------------------------------------------------------------------------- /static/admin/js/vendor/select2/i18n/ru.js: -------------------------------------------------------------------------------- 1 | /*! Select2 4.0.7 | https://github.com/select2/select2/blob/master/LICENSE.md */ 2 | 3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/ru",[],function(){function e(e,t,n,r){return e%10<5&&e%10>0&&e%100<5||e%100>20?e%10>1?n:t:r}return{errorLoading:function(){return"Невозможно загрузить результаты"},inputTooLong:function(t){var n=t.input.length-t.maximum,r="Пожалуйста, введите на "+n+" символ";return r+=e(n,"","a","ов"),r+=" меньше",r},inputTooShort:function(t){var n=t.minimum-t.input.length,r="Пожалуйста, введите ещё хотя бы "+n+" символ";return r+=e(n,"","a","ов"),r},loadingMore:function(){return"Загрузка данных…"},maximumSelected:function(t){var n="Вы можете выбрать не более "+t.maximum+" элемент";return n+=e(t.maximum,"","a","ов"),n},noResults:function(){return"Совпадений не найдено"},searching:function(){return"Поиск…"},removeAllItems:function(){return"Удалить все элементы"}}}),{define:e.define,require:e.require}})(); -------------------------------------------------------------------------------- /static/admin/js/vendor/select2/i18n/sk.js: -------------------------------------------------------------------------------- 1 | /*! Select2 4.0.7 | https://github.com/select2/select2/blob/master/LICENSE.md */ 2 | 3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/sk",[],function(){var e={2:function(e){return e?"dva":"dve"},3:function(){return"tri"},4:function(){return"štyri"}};return{errorLoading:function(){return"Výsledky sa nepodarilo načítať."},inputTooLong:function(t){var n=t.input.length-t.maximum;return n==1?"Prosím, zadajte o jeden znak menej":n>=2&&n<=4?"Prosím, zadajte o "+e[n](!0)+" znaky menej":"Prosím, zadajte o "+n+" znakov menej"},inputTooShort:function(t){var n=t.minimum-t.input.length;return n==1?"Prosím, zadajte ešte jeden znak":n<=4?"Prosím, zadajte ešte ďalšie "+e[n](!0)+" znaky":"Prosím, zadajte ešte ďalších "+n+" znakov"},loadingMore:function(){return"Načítanie ďalších výsledkov…"},maximumSelected:function(t){return t.maximum==1?"Môžete zvoliť len jednu položku":t.maximum>=2&&t.maximum<=4?"Môžete zvoliť najviac "+e[t.maximum](!1)+" položky":"Môžete zvoliť najviac "+t.maximum+" položiek"},noResults:function(){return"Nenašli sa žiadne položky"},searching:function(){return"Vyhľadávanie…"},removeAllItems:function(){return"Odstráňte všetky položky"}}}),{define:e.define,require:e.require}})(); -------------------------------------------------------------------------------- /static/admin/js/vendor/select2/i18n/sl.js: -------------------------------------------------------------------------------- 1 | /*! Select2 4.0.7 | https://github.com/select2/select2/blob/master/LICENSE.md */ 2 | 3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/sl",[],function(){return{errorLoading:function(){return"Zadetkov iskanja ni bilo mogoče naložiti."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Prosim zbrišite "+t+" znak";return t==2?n+="a":t!=1&&(n+="e"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Prosim vpišite še "+t+" znak";return t==2?n+="a":t!=1&&(n+="e"),n},loadingMore:function(){return"Nalagam več zadetkov…"},maximumSelected:function(e){var t="Označite lahko največ "+e.maximum+" predmet";return e.maximum==2?t+="a":e.maximum!=1&&(t+="e"),t},noResults:function(){return"Ni zadetkov."},searching:function(){return"Iščem…"},removeAllItems:function(){return"Odstranite vse elemente"}}}),{define:e.define,require:e.require}})(); -------------------------------------------------------------------------------- /static/admin/js/vendor/select2/i18n/sq.js: -------------------------------------------------------------------------------- 1 | /*! Select2 4.0.7 | https://github.com/select2/select2/blob/master/LICENSE.md */ 2 | 3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/sq",[],function(){return{errorLoading:function(){return"Rezultatet nuk mund të ngarkoheshin."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Të lutem fshi "+t+" karakter";return t!=1&&(n+="e"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Të lutem shkruaj "+t+" ose më shumë karaktere";return n},loadingMore:function(){return"Duke ngarkuar më shumë rezultate…"},maximumSelected:function(e){var t="Mund të zgjedhësh vetëm "+e.maximum+" element";return e.maximum!=1&&(t+="e"),t},noResults:function(){return"Nuk u gjet asnjë rezultat"},searching:function(){return"Duke kërkuar…"},removeAllItems:function(){return"Hiq të gjitha sendet"}}}),{define:e.define,require:e.require}})(); -------------------------------------------------------------------------------- /static/admin/js/vendor/select2/i18n/sr-Cyrl.js: -------------------------------------------------------------------------------- 1 | /*! Select2 4.0.7 | https://github.com/select2/select2/blob/master/LICENSE.md */ 2 | 3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/sr-Cyrl",[],function(){function e(e,t,n,r){return e%10==1&&e%100!=11?t:e%10>=2&&e%10<=4&&(e%100<12||e%100>14)?n:r}return{errorLoading:function(){return"Преузимање није успело."},inputTooLong:function(t){var n=t.input.length-t.maximum,r="Обришите "+n+" симбол";return r+=e(n,"","а","а"),r},inputTooShort:function(t){var n=t.minimum-t.input.length,r="Укуцајте бар још "+n+" симбол";return r+=e(n,"","а","а"),r},loadingMore:function(){return"Преузимање још резултата…"},maximumSelected:function(t){var n="Можете изабрати само "+t.maximum+" ставк";return n+=e(t.maximum,"у","е","и"),n},noResults:function(){return"Ништа није пронађено"},searching:function(){return"Претрага…"},removeAllItems:function(){return"Уклоните све ставке"}}}),{define:e.define,require:e.require}})(); -------------------------------------------------------------------------------- /static/admin/js/vendor/select2/i18n/sr.js: -------------------------------------------------------------------------------- 1 | /*! Select2 4.0.7 | https://github.com/select2/select2/blob/master/LICENSE.md */ 2 | 3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/sr",[],function(){function e(e,t,n,r){return e%10==1&&e%100!=11?t:e%10>=2&&e%10<=4&&(e%100<12||e%100>14)?n:r}return{errorLoading:function(){return"Preuzimanje nije uspelo."},inputTooLong:function(t){var n=t.input.length-t.maximum,r="Obrišite "+n+" simbol";return r+=e(n,"","a","a"),r},inputTooShort:function(t){var n=t.minimum-t.input.length,r="Ukucajte bar još "+n+" simbol";return r+=e(n,"","a","a"),r},loadingMore:function(){return"Preuzimanje još rezultata…"},maximumSelected:function(t){var n="Možete izabrati samo "+t.maximum+" stavk";return n+=e(t.maximum,"u","e","i"),n},noResults:function(){return"Ništa nije pronađeno"},searching:function(){return"Pretraga…"},removeAllItems:function(){return"Уклоните све ставке"}}}),{define:e.define,require:e.require}})(); -------------------------------------------------------------------------------- /static/admin/js/vendor/select2/i18n/sv.js: -------------------------------------------------------------------------------- 1 | /*! Select2 4.0.7 | https://github.com/select2/select2/blob/master/LICENSE.md */ 2 | 3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/sv",[],function(){return{errorLoading:function(){return"Resultat kunde inte laddas."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Vänligen sudda ut "+t+" tecken";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Vänligen skriv in "+t+" eller fler tecken";return n},loadingMore:function(){return"Laddar fler resultat…"},maximumSelected:function(e){var t="Du kan max välja "+e.maximum+" element";return t},noResults:function(){return"Inga träffar"},searching:function(){return"Söker…"},removeAllItems:function(){return"Ta bort alla objekt"}}}),{define:e.define,require:e.require}})(); -------------------------------------------------------------------------------- /static/admin/js/vendor/select2/i18n/th.js: -------------------------------------------------------------------------------- 1 | /*! Select2 4.0.7 | https://github.com/select2/select2/blob/master/LICENSE.md */ 2 | 3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/th",[],function(){return{errorLoading:function(){return"ไม่สามารถค้นข้อมูลได้"},inputTooLong:function(e){var t=e.input.length-e.maximum,n="โปรดลบออก "+t+" ตัวอักษร";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="โปรดพิมพ์เพิ่มอีก "+t+" ตัวอักษร";return n},loadingMore:function(){return"กำลังค้นข้อมูลเพิ่ม…"},maximumSelected:function(e){var t="คุณสามารถเลือกได้ไม่เกิน "+e.maximum+" รายการ";return t},noResults:function(){return"ไม่พบข้อมูล"},searching:function(){return"กำลังค้นข้อมูล…"},removeAllItems:function(){return"ลบรายการทั้งหมด"}}}),{define:e.define,require:e.require}})(); -------------------------------------------------------------------------------- /static/admin/js/vendor/select2/i18n/tk.js: -------------------------------------------------------------------------------- 1 | /*! Select2 4.0.7 | https://github.com/select2/select2/blob/master/LICENSE.md */ 2 | 3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/tk",[],function(){return{errorLoading:function(){return"Netije ýüklenmedi."},inputTooLong:function(e){var t=e.input.length-e.maximum,n=t+" harp bozuň.";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Ýene-de iň az "+t+" harp ýazyň.";return n},loadingMore:function(){return"Köpräk netije görkezilýär…"},maximumSelected:function(e){var t="Diňe "+e.maximum+" sanysyny saýlaň.";return t},noResults:function(){return"Netije tapylmady."},searching:function(){return"Gözlenýär…"},removeAllItems:function(){return"Remove all items"}}}),{define:e.define,require:e.require}})(); -------------------------------------------------------------------------------- /static/admin/js/vendor/select2/i18n/tr.js: -------------------------------------------------------------------------------- 1 | /*! Select2 4.0.7 | https://github.com/select2/select2/blob/master/LICENSE.md */ 2 | 3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/tr",[],function(){return{errorLoading:function(){return"Sonuç yüklenemedi"},inputTooLong:function(e){var t=e.input.length-e.maximum,n=t+" karakter daha girmelisiniz";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="En az "+t+" karakter daha girmelisiniz";return n},loadingMore:function(){return"Daha fazla…"},maximumSelected:function(e){var t="Sadece "+e.maximum+" seçim yapabilirsiniz";return t},noResults:function(){return"Sonuç bulunamadı"},searching:function(){return"Aranıyor…"},removeAllItems:function(){return"Tüm öğeleri kaldır"}}}),{define:e.define,require:e.require}})(); -------------------------------------------------------------------------------- /static/admin/js/vendor/select2/i18n/uk.js: -------------------------------------------------------------------------------- 1 | /*! Select2 4.0.7 | https://github.com/select2/select2/blob/master/LICENSE.md */ 2 | 3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/uk",[],function(){function e(e,t,n,r){return e%100>10&&e%100<15?r:e%10===1?t:e%10>1&&e%10<5?n:r}return{errorLoading:function(){return"Неможливо завантажити результати"},inputTooLong:function(t){var n=t.input.length-t.maximum;return"Будь ласка, видаліть "+n+" "+e(t.maximum,"літеру","літери","літер")},inputTooShort:function(e){var t=e.minimum-e.input.length;return"Будь ласка, введіть "+t+" або більше літер"},loadingMore:function(){return"Завантаження інших результатів…"},maximumSelected:function(t){return"Ви можете вибрати лише "+t.maximum+" "+e(t.maximum,"пункт","пункти","пунктів")},noResults:function(){return"Нічого не знайдено"},searching:function(){return"Пошук…"},removeAllItems:function(){return"Видалити всі елементи"}}}),{define:e.define,require:e.require}})(); -------------------------------------------------------------------------------- /static/admin/js/vendor/select2/i18n/vi.js: -------------------------------------------------------------------------------- 1 | /*! Select2 4.0.7 | https://github.com/select2/select2/blob/master/LICENSE.md */ 2 | 3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/vi",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n="Vui lòng xóa bớt "+t+" ký tự";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Vui lòng nhập thêm từ "+t+" ký tự trở lên";return n},loadingMore:function(){return"Đang lấy thêm kết quả…"},maximumSelected:function(e){var t="Chỉ có thể chọn được "+e.maximum+" lựa chọn";return t},noResults:function(){return"Không tìm thấy kết quả"},searching:function(){return"Đang tìm…"},removeAllItems:function(){return"Xóa tất cả các mục"}}}),{define:e.define,require:e.require}})(); -------------------------------------------------------------------------------- /static/admin/js/vendor/select2/i18n/zh-CN.js: -------------------------------------------------------------------------------- 1 | /*! Select2 4.0.7 | https://github.com/select2/select2/blob/master/LICENSE.md */ 2 | 3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/zh-CN",[],function(){return{errorLoading:function(){return"无法载入结果。"},inputTooLong:function(e){var t=e.input.length-e.maximum,n="请删除"+t+"个字符";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="请再输入至少"+t+"个字符";return n},loadingMore:function(){return"载入更多结果…"},maximumSelected:function(e){var t="最多只能选择"+e.maximum+"个项目";return t},noResults:function(){return"未找到结果"},searching:function(){return"搜索中…"},removeAllItems:function(){return"删除所有项目"}}}),{define:e.define,require:e.require}})(); -------------------------------------------------------------------------------- /static/admin/js/vendor/select2/i18n/zh-TW.js: -------------------------------------------------------------------------------- 1 | /*! Select2 4.0.7 | https://github.com/select2/select2/blob/master/LICENSE.md */ 2 | 3 | (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/zh-TW",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n="請刪掉"+t+"個字元";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="請再輸入"+t+"個字元";return n},loadingMore:function(){return"載入中…"},maximumSelected:function(e){var t="你只能選擇最多"+e.maximum+"項";return t},noResults:function(){return"沒有找到相符的項目"},searching:function(){return"搜尋中…"},removeAllItems:function(){return"刪除所有項目"}}}),{define:e.define,require:e.require}})(); -------------------------------------------------------------------------------- /static/admin/js/vendor/xregexp/LICENSE.txt: -------------------------------------------------------------------------------- 1 | The MIT License 2 | 3 | Copyright (c) 2007-2012 Steven Levithan 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /static/drf-tutorial.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liaogx/drf-tutorial/4e12b1c5da56be4180328193fc9dbe1245d48dbb/static/drf-tutorial.png -------------------------------------------------------------------------------- /static/rest_framework/css/bootstrap-tweaks.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | This CSS file contains some tweaks specific to the included Bootstrap theme. 4 | It's separate from `style.css` so that it can be easily overridden by replacing 5 | a single block in the template. 6 | 7 | */ 8 | 9 | .form-actions { 10 | background: transparent; 11 | border-top-color: transparent; 12 | padding-top: 0; 13 | text-align: right; 14 | } 15 | 16 | #generic-content-form textarea { 17 | font-family: Consolas, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace; 18 | font-size: 80%; 19 | } 20 | 21 | .navbar-inverse .brand a { 22 | color: #999999; 23 | } 24 | 25 | .navbar-inverse .brand:hover a { 26 | color: white; 27 | text-decoration: none; 28 | } 29 | 30 | /* custom navigation styles */ 31 | .navbar { 32 | width: 100%; 33 | position: fixed; 34 | left: 0; 35 | top: 0; 36 | } 37 | 38 | .navbar { 39 | background: #2C2C2C; 40 | color: white; 41 | border: none; 42 | border-top: 5px solid #A30000; 43 | border-radius: 0px; 44 | } 45 | 46 | .navbar .nav li, .navbar .nav li a, .navbar .brand:hover { 47 | color: white; 48 | } 49 | 50 | .nav-list > .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 | ul.breadcrumb { 64 | margin: 70px 0 0 0; 65 | } 66 | 67 | .breadcrumb li.active a { 68 | color: #777; 69 | } 70 | 71 | .pagination > .disabled > a, 72 | .pagination > .disabled > a:hover, 73 | .pagination > .disabled > a:focus { 74 | cursor: not-allowed; 75 | pointer-events: none; 76 | } 77 | 78 | .pager > .disabled > a, 79 | .pager > .disabled > a:hover, 80 | .pager > .disabled > a:focus { 81 | pointer-events: none; 82 | } 83 | 84 | .pager .next { 85 | margin-left: 10px; 86 | } 87 | 88 | /*=== dabapps bootstrap styles ====*/ 89 | 90 | html { 91 | width: 100%; 92 | background: none; 93 | } 94 | 95 | /*body, .navbar .container-fluid { 96 | max-width: 1150px; 97 | margin: 0 auto; 98 | }*/ 99 | 100 | body { 101 | background: url("../img/grid.png") repeat-x; 102 | background-attachment: fixed; 103 | } 104 | 105 | #content { 106 | margin: 0; 107 | padding-bottom: 60px; 108 | } 109 | 110 | /* sticky footer and footer */ 111 | html, body { 112 | height: 100%; 113 | } 114 | 115 | .wrapper { 116 | position: relative; 117 | top: 0; 118 | left: 0; 119 | padding-top: 60px; 120 | margin: -60px 0; 121 | min-height: 100%; 122 | } 123 | 124 | .form-switcher { 125 | margin-bottom: 0; 126 | } 127 | 128 | .well { 129 | -webkit-box-shadow: none; 130 | -moz-box-shadow: none; 131 | box-shadow: none; 132 | } 133 | 134 | .well .form-actions { 135 | padding-bottom: 0; 136 | margin-bottom: 0; 137 | } 138 | 139 | .well form { 140 | margin-bottom: 0; 141 | } 142 | 143 | .nav-tabs { 144 | border: 0; 145 | } 146 | 147 | .nav-tabs > li { 148 | float: right; 149 | } 150 | 151 | .nav-tabs li a { 152 | margin-right: 0; 153 | } 154 | 155 | .nav-tabs > .active > a { 156 | background: #F5F5F5; 157 | } 158 | 159 | .nav-tabs > .active > a:hover { 160 | background: #F5F5F5; 161 | } 162 | 163 | .tabbable.first-tab-active .tab-content { 164 | border-top-right-radius: 0; 165 | } 166 | 167 | footer { 168 | position: absolute; 169 | bottom: 0; 170 | left: 0; 171 | clear: both; 172 | z-index: 10; 173 | height: 60px; 174 | width: 95%; 175 | margin: 0 2.5%; 176 | } 177 | 178 | footer p { 179 | text-align: center; 180 | color: gray; 181 | border-top: 1px solid #DDDDDD; 182 | padding-top: 10px; 183 | } 184 | 185 | footer a { 186 | color: gray !important; 187 | font-weight: bold; 188 | } 189 | 190 | footer a:hover { 191 | color: gray; 192 | } 193 | 194 | .page-header { 195 | border-bottom: none; 196 | padding-bottom: 0px; 197 | margin: 0; 198 | } 199 | 200 | /* custom general page styles */ 201 | .hero-unit h1, .hero-unit h2 { 202 | color: #A30000; 203 | } 204 | 205 | body a { 206 | color: #A30000; 207 | } 208 | 209 | body a:hover { 210 | color: #c20000; 211 | } 212 | 213 | .request-info { 214 | clear: both; 215 | } 216 | 217 | .horizontal-checkbox label { 218 | padding-top: 0; 219 | } 220 | 221 | .horizontal-checkbox label { 222 | padding-top: 0 !important; 223 | } 224 | 225 | .horizontal-checkbox input { 226 | float: left; 227 | width: 20px; 228 | margin-top: 3px; 229 | } 230 | 231 | .modal-footer form { 232 | margin-left: 5px; 233 | margin-right: 5px; 234 | } 235 | -------------------------------------------------------------------------------- /static/rest_framework/css/default.css: -------------------------------------------------------------------------------- 1 | /* The navbar is fixed at >= 980px wide, so add padding to the body to prevent 2 | content running up underneath it. */ 3 | 4 | h1 { 5 | font-weight: 300; 6 | } 7 | 8 | h2, h3 { 9 | font-weight: 300; 10 | } 11 | 12 | .resource-description, .response-info { 13 | margin-bottom: 2em; 14 | } 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 | td.nested { 36 | padding: 0 !important; 37 | } 38 | 39 | td.nested > table { 40 | margin: 0; 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 | 76 | #filtersModal form input[type=submit] { 77 | width: auto; 78 | } 79 | 80 | #filtersModal .modal-body h2 { 81 | margin-top: 0 82 | } 83 | -------------------------------------------------------------------------------- /static/rest_framework/css/prettify.css: -------------------------------------------------------------------------------- 1 | .com { 2 | color: #93a1a1; 3 | } 4 | 5 | .lit { 6 | color: #195f91; 7 | } 8 | 9 | .pun, .opn, .clo { 10 | color: #93a1a1; 11 | } 12 | 13 | .fun { 14 | color: #dc322f; 15 | } 16 | 17 | .str, .atv { 18 | color: #D14; 19 | } 20 | 21 | .kwd, .prettyprint .tag { 22 | color: #1e347b; 23 | } 24 | 25 | .typ, .atn, .dec, .var { 26 | color: teal; 27 | } 28 | 29 | .pln { 30 | color: #48484c; 31 | } 32 | 33 | .prettyprint { 34 | padding: 8px; 35 | background-color: #f7f7f9; 36 | border: 1px solid #e1e1e8; 37 | } 38 | 39 | .prettyprint.linenums { 40 | -webkit-box-shadow: inset 40px 0 0 #fbfbfc, inset 41px 0 0 #ececf0; 41 | -moz-box-shadow: inset 40px 0 0 #fbfbfc, inset 41px 0 0 #ececf0; 42 | box-shadow: inset 40px 0 0 #fbfbfc, inset 41px 0 0 #ececf0; 43 | } 44 | 45 | /* Specify class=linenums on a pre to get line numbering */ 46 | ol.linenums { 47 | margin: 0 0 0 33px; /* IE indents via margin-left */ 48 | } 49 | 50 | ol.linenums li { 51 | padding-left: 12px; 52 | color: #bebec5; 53 | line-height: 20px; 54 | text-shadow: 0 1px 0 #fff; 55 | } -------------------------------------------------------------------------------- /static/rest_framework/docs/css/base.css: -------------------------------------------------------------------------------- 1 | h1 { 2 | font-size: 45px; 3 | } 4 | 5 | .intro-code { 6 | margin-top: 20px; 7 | } 8 | 9 | pre.highlight code * { 10 | white-space: nowrap; 11 | / / this sets all children inside to nowrap 12 | } 13 | 14 | pre.highlight { 15 | overflow-x: auto; 16 | / / this sets the scrolling in x 17 | } 18 | 19 | pre.highlight code { 20 | white-space: pre; 21 | / / forces < code > to respect < pre > formatting 22 | } 23 | 24 | .main-container { 25 | padding-left: 30px; 26 | padding-right: 30px; 27 | } 28 | 29 | .btn:focus, 30 | .btn:focus:active { 31 | outline: none; 32 | } 33 | 34 | .sidebar { 35 | overflow: auto; 36 | font-family: verdana, sans-serif; 37 | font-size: 12px; 38 | font-weight: 200; 39 | background-color: #2e353d; 40 | position: fixed; 41 | top: 0px; 42 | width: 225px; 43 | height: 100%; 44 | color: #FFF; 45 | } 46 | 47 | .sidebar .brand { 48 | background-color: #23282e; 49 | display: block; 50 | text-align: center; 51 | padding: 25px 0; 52 | margin-top: 0; 53 | margin-bottom: 0; 54 | } 55 | 56 | .sidebar .brand a { 57 | color: #FFF; 58 | } 59 | 60 | .sidebar .brand a:hover, 61 | .sidebar .brand a:active, 62 | .sidebar .brand a:focus { 63 | text-decoration: none; 64 | } 65 | 66 | .sidebar .toggle-btn { 67 | display: none; 68 | } 69 | 70 | .sidebar .menu-list { 71 | width: inherit; 72 | } 73 | 74 | .sidebar .menu-list ul, 75 | .sidebar .menu-list li { 76 | background: #2e353d; 77 | list-style: none; 78 | padding: 0px; 79 | margin: 0px; 80 | line-height: 35px; 81 | cursor: pointer; 82 | } 83 | 84 | .sidebar .menu-list ul :not(collapsed) .arrow:before, 85 | .sidebar .menu-list li :not(collapsed) .arrow:before { 86 | font-family: FontAwesome; 87 | content: "\f078"; 88 | display: inline-block; 89 | padding-left: 10px; 90 | padding-right: 10px; 91 | vertical-align: middle; 92 | float: right; 93 | } 94 | 95 | .sidebar .menu-list ul .active, 96 | .sidebar .menu-list li .active { 97 | border-left: 3px solid #d19b3d; 98 | background-color: #4f5b69; 99 | } 100 | 101 | .sidebar .menu-list ul .sub-menu li.active, 102 | .sidebar .menu-list li .sub-menu li.active { 103 | color: #d19b3d; 104 | } 105 | 106 | .sidebar .menu-list ul .sub-menu li.active a, 107 | .sidebar .menu-list li .sub-menu li.active a { 108 | color: #d19b3d; 109 | } 110 | 111 | .sidebar .menu-list ul .sub-menu li, 112 | .sidebar .menu-list li .sub-menu li { 113 | background-color: #181c20; 114 | border: none; 115 | border-bottom: 1px solid #23282e; 116 | margin-left: 0px; 117 | line-height: 1.4; 118 | padding-top: 10px; 119 | padding-bottom: 10px; 120 | padding-right: 10px; 121 | padding-left: 25px; 122 | } 123 | 124 | .sidebar .menu-list ul .sub-menu li:hover, 125 | .sidebar .menu-list li .sub-menu li:hover { 126 | background-color: #020203; 127 | } 128 | 129 | 130 | .sidebar .menu-list ul .sub-menu li a, 131 | .sidebar .menu-list li .sub-menu li a { 132 | display: block; 133 | } 134 | 135 | .sidebar .menu-list ul .sub-menu li a:before, 136 | .sidebar .menu-list li .sub-menu li a:before { 137 | font-family: FontAwesome; 138 | font-size: 14px; 139 | font-weight: bold; 140 | content: "\f105"; 141 | display: inline; 142 | vertical-align: middle; 143 | padding-left: 0; 144 | padding-right: 7px; 145 | margin-left: -12px; 146 | } 147 | 148 | .sidebar .menu-list li { 149 | padding-left: 0px; 150 | border-left: 3px solid #2e353d; 151 | border-bottom: 1px solid #23282e; 152 | } 153 | 154 | .sidebar .menu-list li a { 155 | text-decoration: none; 156 | color: white; 157 | } 158 | 159 | .sidebar .menu-list li a i { 160 | padding-left: 10px; 161 | width: 20px; 162 | padding-right: 20px; 163 | } 164 | 165 | .sidebar .menu-list li:hover { 166 | border-left: 3px solid #d19b3d; 167 | background-color: #4f5b69; 168 | -webkit-transition: all 1s ease; 169 | -moz-transition: all 1s ease; 170 | -o-transition: all 1s ease; 171 | -ms-transition: all 1s ease; 172 | transition: all 1s ease; 173 | } 174 | 175 | .sidebar #menu-content { 176 | padding-bottom: 70px; 177 | } 178 | 179 | body { 180 | margin: 0px; 181 | padding: 0px; 182 | } 183 | 184 | .coredocs-section-title { 185 | margin-top: 20px; 186 | padding-bottom: 10px; 187 | border-bottom: 1px solid lightgrey; 188 | } 189 | 190 | .coredocs-link-title a, 191 | .coredocs-section-title a { 192 | display: none; 193 | } 194 | 195 | .coredocs-link-title a, 196 | .coredocs-section-title a { 197 | text-decoration: none; 198 | } 199 | 200 | .coredocs-link-title:hover a, 201 | .coredocs-section-title:hover a { 202 | display: inline; 203 | font-size: 20px; 204 | } 205 | 206 | .coredocs-section-title:last-child { 207 | margin-top: 0; 208 | } 209 | 210 | 211 | /* @group Language Switcher */ 212 | 213 | .sidebar .menu-list.menu-list-bottom { 214 | margin-bottom: 0; 215 | position: fixed; 216 | width: inherit; 217 | bottom: 0; 218 | left: 0; 219 | right: 0; 220 | border-top: 1px solid #23282e; 221 | } 222 | 223 | .sidebar .menu-list-bottom li span { 224 | float: right; 225 | margin-right: 20px; 226 | color: #d19b3d; 227 | } 228 | 229 | /* @end Language Switcher */ 230 | 231 | 232 | /* @group Docs Content */ 233 | 234 | .docs-content .meta .label { 235 | vertical-align: middle; 236 | font-size: 14px; 237 | font-weight: normal; 238 | } 239 | 240 | .docs-content .meta code { 241 | vertical-align: middle; 242 | padding: .2em .6em .3em; 243 | font-size: 14px; 244 | } 245 | 246 | .docs-content .btn { 247 | font-size: inherit; 248 | } 249 | 250 | .code-samples pre { 251 | margin-top: 20px; 252 | } 253 | 254 | /* @end Docs Content */ 255 | 256 | 257 | @media (max-width: 767px) { 258 | .main-container { 259 | padding-left: 15px; 260 | padding-right: 15px; 261 | } 262 | 263 | .sidebar { 264 | position: relative; 265 | width: 100%; 266 | margin-bottom: 10px; 267 | overflow: visible; 268 | } 269 | 270 | .sidebar .toggle-btn { 271 | display: block; 272 | cursor: pointer; 273 | position: absolute; 274 | right: 10px; 275 | top: 10px; 276 | z-index: 10 !important; 277 | padding: 3px; 278 | width: 40px; 279 | text-align: center; 280 | } 281 | 282 | .sidebar .menu-list.menu-list-bottom { 283 | position: static; 284 | } 285 | 286 | .sidebar .brand { 287 | margin-top: 0; 288 | margin-bottom: 0; 289 | 290 | text-align: left !important; 291 | font-size: 22px; 292 | padding: 0; 293 | padding-left: 20px; 294 | line-height: 50px !important; 295 | } 296 | } 297 | 298 | @media (min-width: 767px) { 299 | .sidebar .menu-list .menu-content { 300 | display: block; 301 | } 302 | 303 | #main { 304 | width: calc(100% - 225px); 305 | float: right; 306 | } 307 | } 308 | 309 | @media (min-width: 992px) { 310 | .modal-lg { 311 | width: 980px; 312 | } 313 | } 314 | 315 | .api-modal .modal-title .fa { 316 | color: #93c54b; 317 | } 318 | 319 | .api-modal .modal-body .request-awaiting { 320 | padding: 35px 10px; 321 | color: #7F8177; 322 | text-align: center; 323 | } 324 | 325 | .api-modal .modal-body .meta { 326 | margin-bottom: 20px; 327 | } 328 | 329 | .api-modal .modal-body .meta .label { 330 | vertical-align: middle; 331 | font-size: 14px; 332 | font-weight: normal; 333 | } 334 | 335 | .api-modal .modal-body .meta code { 336 | vertical-align: middle; 337 | padding: .2em .6em .3em; 338 | font-size: 14px; 339 | } 340 | 341 | .api-modal .modal-content .toggle-view { 342 | text-align: right; 343 | float: right; 344 | } 345 | 346 | .api-modal .modal-content .response .well { 347 | margin: 0; 348 | max-height: 550px; 349 | } 350 | 351 | .highlight { 352 | background-color: #f7f7f9 353 | } 354 | 355 | .checkbox label.control-label { 356 | font-weight: bold 357 | } 358 | 359 | @media (min-width: 768px) { 360 | .navbar-nav.navbar-right:last-child { 361 | margin-right: 0 !important; 362 | } 363 | } 364 | -------------------------------------------------------------------------------- /static/rest_framework/docs/css/highlight.css: -------------------------------------------------------------------------------- 1 | /* 2 | This is the GitHub theme for highlight.js 3 | 4 | github.com style (c) Vasily Polovnyov 5 | 6 | */ 7 | 8 | .hljs { 9 | display: block; 10 | overflow-x: auto; 11 | padding: 0.5em; 12 | color: #333; 13 | -webkit-text-size-adjust: none; 14 | } 15 | 16 | .hljs-comment, 17 | .diff .hljs-header, 18 | .hljs-javadoc { 19 | color: #998; 20 | font-style: italic; 21 | } 22 | 23 | .hljs-keyword, 24 | .css .rule .hljs-keyword, 25 | .hljs-winutils, 26 | .nginx .hljs-title, 27 | .hljs-subst, 28 | .hljs-request, 29 | .hljs-status { 30 | color: #333; 31 | font-weight: bold; 32 | } 33 | 34 | .hljs-number, 35 | .hljs-hexcolor, 36 | .ruby .hljs-constant { 37 | color: #008080; 38 | } 39 | 40 | .hljs-string, 41 | .hljs-tag .hljs-value, 42 | .hljs-phpdoc, 43 | .hljs-dartdoc, 44 | .tex .hljs-formula { 45 | color: #d14; 46 | } 47 | 48 | .hljs-title, 49 | .hljs-id, 50 | .scss .hljs-preprocessor { 51 | color: #900; 52 | font-weight: bold; 53 | } 54 | 55 | .hljs-list .hljs-keyword, 56 | .hljs-subst { 57 | font-weight: normal; 58 | } 59 | 60 | .hljs-class .hljs-title, 61 | .hljs-type, 62 | .vhdl .hljs-literal, 63 | .tex .hljs-command { 64 | color: #458; 65 | font-weight: bold; 66 | } 67 | 68 | .hljs-tag, 69 | .hljs-tag .hljs-title, 70 | .hljs-rule .hljs-property, 71 | .django .hljs-tag .hljs-keyword { 72 | color: #000080; 73 | font-weight: normal; 74 | } 75 | 76 | .hljs-attribute, 77 | .hljs-variable, 78 | .lisp .hljs-body, 79 | .hljs-name { 80 | color: #008080; 81 | } 82 | 83 | .hljs-regexp { 84 | color: #009926; 85 | } 86 | 87 | .hljs-symbol, 88 | .ruby .hljs-symbol .hljs-string, 89 | .lisp .hljs-keyword, 90 | .clojure .hljs-keyword, 91 | .scheme .hljs-keyword, 92 | .tex .hljs-special, 93 | .hljs-prompt { 94 | color: #990073; 95 | } 96 | 97 | .hljs-built_in { 98 | color: #0086b3; 99 | } 100 | 101 | .hljs-preprocessor, 102 | .hljs-pragma, 103 | .hljs-pi, 104 | .hljs-doctype, 105 | .hljs-shebang, 106 | .hljs-cdata { 107 | color: #999; 108 | font-weight: bold; 109 | } 110 | 111 | .hljs-deletion { 112 | background: #fdd; 113 | } 114 | 115 | .hljs-addition { 116 | background: #dfd; 117 | } 118 | 119 | .diff .hljs-change { 120 | background: #0086b3; 121 | } 122 | 123 | .hljs-chunk { 124 | color: #aaa; 125 | } 126 | -------------------------------------------------------------------------------- /static/rest_framework/docs/css/jquery.json-view.min.css: -------------------------------------------------------------------------------- 1 | .json-view{position:relative} 2 | .json-view .collapser{width:20px;height:18px;display:block;position:absolute;left:-1.7em;top:-.2em;z-index:5;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAD1JREFUeNpiYGBgOADE%2F3Hgw0DM4IRHgSsDFOzFInmMAQnY49ONzZRjDFiADT7dMLALiE8y4AGW6LoBAgwAuIkf%2F%2FB7O9sAAAAASUVORK5CYII%3D);background-repeat:no-repeat;background-position:center center;opacity:.5;cursor:pointer} 3 | .json-view .collapsed{-ms-transform:rotate(-90deg);-moz-transform:rotate(-90deg);-khtml-transform:rotate(-90deg);-webkit-transform:rotate(-90deg);-o-transform:rotate(-90deg);transform:rotate(-90deg)} 4 | .json-view .bl{display:block;padding-left:20px;margin-left:-20px;position:relative} 5 | .json-view{font-family:monospace} 6 | .json-view ul{list-style-type:none;padding-left:2em;border-left:1px dotted;margin:.3em} 7 | .json-view ul li{position:relative} 8 | .json-view .comments,.json-view .dots{display:none;-moz-user-select:none;-ms-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-o-user-select:none;user-select:none} 9 | .json-view .comments{padding-left:.8em;font-style:italic;color:#888} 10 | .json-view .bool,.json-view .null,.json-view .num,.json-view .undef{font-weight:700;color:#1A01CC} 11 | .json-view .str{color:#800} -------------------------------------------------------------------------------- /static/rest_framework/docs/img/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liaogx/drf-tutorial/4e12b1c5da56be4180328193fc9dbe1245d48dbb/static/rest_framework/docs/img/favicon.ico -------------------------------------------------------------------------------- /static/rest_framework/docs/img/grid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liaogx/drf-tutorial/4e12b1c5da56be4180328193fc9dbe1245d48dbb/static/rest_framework/docs/img/grid.png -------------------------------------------------------------------------------- /static/rest_framework/docs/js/jquery.json-view.min.js: -------------------------------------------------------------------------------- 1 | /** 2 | * jquery.json-view - jQuery collapsible JSON plugin 3 | * @version v1.0.0 4 | * @link http://github.com/bazh/jquery.json-view 5 | * @license MIT 6 | */ 7 | !function(e){"use strict";var n=function(n){var a=e("",{"class":"collapser",on:{click:function(){var n=e(this);n.toggleClass("collapsed");var a=n.parent().children(".block"),p=a.children("ul");n.hasClass("collapsed")?(p.hide(),a.children(".dots, .comments").show()):(p.show(),a.children(".dots, .comments").hide())}}});return n&&a.addClass("collapsed"),a},a=function(a,p){var t=e.extend({},{nl2br:!0},p),r=function(e){return e.toString()?e.toString().replace(/&/g,"&").replace(/"/g,""").replace(//g,">"):""},s=function(n,a){return e("",{"class":a,html:r(n)})},l=function(a,p){switch(e.type(a)){case"object":p||(p=0);var c=e("",{"class":"block"}),d=Object.keys(a).length;if(!d)return c.append(s("{","b")).append(" ").append(s("}","b"));c.append(s("{","b"));var i=e("