7 |
8 |
{{ title }}
9 |
10 |
11 |
12 |
13 |
17 |
18 | {% if extra_form_link %}
19 |
20 |
21 | {{ extra_form_link|safe }}
22 |
23 | {% endif %}
24 |
25 |
26 | {% if title == "Login" %}
27 |
28 |
29 | Need Account? Register now.
30 |
31 | {% endif %}
32 |
33 |
34 |
35 |
36 |
37 | {% endblock %}
--------------------------------------------------------------------------------
/src/templates/accounts/home_logged_in.html:
--------------------------------------------------------------------------------
1 | {% extends "base.html" %}
2 |
3 | {% block title %}Welcome | {% endblock %}
4 |
5 |
10 |
11 |
12 |
13 |
14 | {% block content %}
15 |
16 | {% if not recent_videos %}
17 |
118 |
119 |
120 |
121 |
122 |
123 | {% if messages %}
124 | {% for message in messages %}
125 |
{% if 'safe' in message.tags %}{{ message|safe }}{% else %} {{ message }}{% endif %}
126 |
127 |
128 | {% endfor %}
129 | {% endif %}
130 | {% block content %}
131 | {% endblock %}
132 |
133 |
142 |
143 |
144 |
145 | {% include 'footer.html' %}
146 |
147 | {% include 'javascript.html' %}
148 |
156 |
194 |
195 |
196 |
197 |
--------------------------------------------------------------------------------
/src/templates/billing/history.html:
--------------------------------------------------------------------------------
1 | {% extends "base.html" %}
2 |
3 |
4 | {% block content %}
5 |
58 |
59 |
{{ obj.title }}
60 |
61 |
62 |
63 |
64 |
65 | {% if obj.get_previous_url %}
66 |
67 | {% endif %}
68 | {% if obj.get_next_url %}
69 |
70 | {% endif %}
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
32 |
33 | {% if queryset %}
34 |
35 |
36 | # |
37 | Lecture |
38 |
39 |
40 | {% for item in queryset %}
41 |
42 | {{ forloop.counter }} | {% if request.user.is_authenticated or item.has_preview %}{{ item }} {% else %} {{ item }} {% endif %} |
43 |
44 |
45 | {% endfor %}
46 |
47 |
48 | {% else %}
49 |
50 |
Project is coming soon.
51 |
52 | {% endif %}
53 |
54 |
55 |
56 |
57 |
58 | {% endblock %}
--------------------------------------------------------------------------------
/src/videos/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codingforentrepreneurs/srvup-membership/4f6279849668225390fdb94255a5612cb28739be/src/videos/__init__.py
--------------------------------------------------------------------------------
/src/videos/__init__.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codingforentrepreneurs/srvup-membership/4f6279849668225390fdb94255a5612cb28739be/src/videos/__init__.pyc
--------------------------------------------------------------------------------
/src/videos/admin.py:
--------------------------------------------------------------------------------
1 | from django.contrib import admin
2 | from django.contrib.contenttypes.admin import GenericTabularInline
3 | # Register your models here.
4 | from .models import Video, Category, TaggedItem
5 |
6 |
7 | #admin.site.register(TaggedItem)
8 |
9 | class TaggedItemInline(GenericTabularInline):
10 | model = TaggedItem
11 |
12 |
13 |
14 | class VideoInline(admin.TabularInline):
15 | model = Video
16 |
17 | class VideoAdmin(admin.ModelAdmin):
18 | inlines = [TaggedItemInline]
19 | list_display = ["__unicode__", 'slug']
20 | fields = ['title', 'order', 'share_message', 'embed_code','active','slug',
21 | 'featured', 'free_preview',
22 | 'category']
23 | prepopulated_fields = {
24 | 'slug': ["title"],
25 | }
26 | class Meta:
27 | model = Video
28 |
29 | admin.site.register(Video, VideoAdmin)
30 |
31 |
32 | class CategoryAdmin(admin.ModelAdmin):
33 | inlines = [VideoInline, TaggedItemInline]
34 | class Meta:
35 | model = Category
36 |
37 | admin.site.register(Category, CategoryAdmin)
38 |
--------------------------------------------------------------------------------
/src/videos/admin.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codingforentrepreneurs/srvup-membership/4f6279849668225390fdb94255a5612cb28739be/src/videos/admin.pyc
--------------------------------------------------------------------------------
/src/videos/forms.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codingforentrepreneurs/srvup-membership/4f6279849668225390fdb94255a5612cb28739be/src/videos/forms.py
--------------------------------------------------------------------------------
/src/videos/migrations/0001_initial.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | from __future__ import unicode_literals
3 |
4 | from django.db import models, migrations
5 |
6 |
7 | class Migration(migrations.Migration):
8 |
9 | dependencies = [
10 | ]
11 |
12 | operations = [
13 | migrations.CreateModel(
14 | name='Video',
15 | fields=[
16 | ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
17 | ('title', models.CharField(max_length=120)),
18 | ('embed_code', models.CharField(max_length=500, null=True, blank=True)),
19 | ],
20 | options={
21 | },
22 | bases=(models.Model,),
23 | ),
24 | ]
25 |
--------------------------------------------------------------------------------
/src/videos/migrations/0001_initial.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codingforentrepreneurs/srvup-membership/4f6279849668225390fdb94255a5612cb28739be/src/videos/migrations/0001_initial.pyc
--------------------------------------------------------------------------------
/src/videos/migrations/0002_auto_20150116_2215.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | from __future__ import unicode_literals
3 |
4 | from django.db import models, migrations
5 |
6 |
7 | class Migration(migrations.Migration):
8 |
9 | dependencies = [
10 | ('videos', '0001_initial'),
11 | ]
12 |
13 | operations = [
14 | migrations.AddField(
15 | model_name='video',
16 | name='active',
17 | field=models.BooleanField(default=True),
18 | preserve_default=True,
19 | ),
20 | migrations.AddField(
21 | model_name='video',
22 | name='featured',
23 | field=models.BooleanField(default=False),
24 | preserve_default=True,
25 | ),
26 | migrations.AddField(
27 | model_name='video',
28 | name='free_preview',
29 | field=models.BooleanField(default=False),
30 | preserve_default=True,
31 | ),
32 | ]
33 |
--------------------------------------------------------------------------------
/src/videos/migrations/0003_auto_20150117_0006.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | from __future__ import unicode_literals
3 |
4 | from django.db import models, migrations
5 |
6 |
7 | class Migration(migrations.Migration):
8 |
9 | dependencies = [
10 | ('videos', '0002_auto_20150116_2215'),
11 | ]
12 |
13 | operations = [
14 | migrations.CreateModel(
15 | name='Category',
16 | fields=[
17 | ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
18 | ('title', models.CharField(max_length=120)),
19 | ('description', models.TextField(max_length=5000, null=True, blank=True)),
20 | ('image', models.ImageField(null=True, upload_to=b'images/', blank=True)),
21 | ('active', models.BooleanField(default=True)),
22 | ('featured', models.BooleanField(default=False)),
23 | ('timestamp', models.DateTimeField(auto_now_add=True)),
24 | ('updated', models.DateTimeField(auto_now=True)),
25 | ],
26 | options={
27 | },
28 | bases=(models.Model,),
29 | ),
30 | migrations.AddField(
31 | model_name='video',
32 | name='category',
33 | field=models.ForeignKey(to='videos.Category', null=True),
34 | preserve_default=True,
35 | ),
36 | migrations.AddField(
37 | model_name='video',
38 | name='timestamp',
39 | field=models.DateTimeField(auto_now_add=True, null=True),
40 | preserve_default=True,
41 | ),
42 | migrations.AddField(
43 | model_name='video',
44 | name='updated',
45 | field=models.DateTimeField(auto_now=True, null=True),
46 | preserve_default=True,
47 | ),
48 | ]
49 |
--------------------------------------------------------------------------------
/src/videos/migrations/0004_auto_20150117_0013.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | from __future__ import unicode_literals
3 |
4 | from django.db import models, migrations
5 |
6 |
7 | class Migration(migrations.Migration):
8 |
9 | dependencies = [
10 | ('videos', '0003_auto_20150117_0006'),
11 | ]
12 |
13 | operations = [
14 | migrations.RemoveField(
15 | model_name='video',
16 | name='category',
17 | ),
18 | migrations.AddField(
19 | model_name='category',
20 | name='videos',
21 | field=models.ManyToManyField(to='videos.Video', null=True, blank=True),
22 | preserve_default=True,
23 | ),
24 | ]
25 |
--------------------------------------------------------------------------------
/src/videos/migrations/0005_auto_20150117_0021.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | from __future__ import unicode_literals
3 |
4 | from django.db import models, migrations
5 |
6 |
7 | class Migration(migrations.Migration):
8 |
9 | dependencies = [
10 | ('videos', '0004_auto_20150117_0013'),
11 | ]
12 |
13 | operations = [
14 | migrations.RemoveField(
15 | model_name='category',
16 | name='videos',
17 | ),
18 | migrations.AddField(
19 | model_name='video',
20 | name='category',
21 | field=models.ForeignKey(to='videos.Category', null=True),
22 | preserve_default=True,
23 | ),
24 | ]
25 |
--------------------------------------------------------------------------------
/src/videos/migrations/0006_category_slug.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | from __future__ import unicode_literals
3 |
4 | from django.db import models, migrations
5 |
6 |
7 | class Migration(migrations.Migration):
8 |
9 | dependencies = [
10 | ('videos', '0005_auto_20150117_0021'),
11 | ]
12 |
13 | operations = [
14 | migrations.AddField(
15 | model_name='category',
16 | name='slug',
17 | field=models.SlugField(default=b'abc', unique=True),
18 | preserve_default=True,
19 | ),
20 | ]
21 |
--------------------------------------------------------------------------------
/src/videos/migrations/0007_auto_20150117_0048.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | from __future__ import unicode_literals
3 |
4 | from django.db import models, migrations
5 |
6 |
7 | class Migration(migrations.Migration):
8 |
9 | dependencies = [
10 | ('videos', '0006_category_slug'),
11 | ]
12 |
13 | operations = [
14 | migrations.AlterField(
15 | model_name='video',
16 | name='category',
17 | field=models.ForeignKey(default=1, to='videos.Category'),
18 | preserve_default=True,
19 | ),
20 | ]
21 |
--------------------------------------------------------------------------------
/src/videos/migrations/0008_auto_20150119_2127.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | from __future__ import unicode_literals
3 |
4 | from django.db import models, migrations
5 |
6 |
7 | class Migration(migrations.Migration):
8 |
9 | dependencies = [
10 | ('videos', '0007_auto_20150117_0048'),
11 | ]
12 |
13 | operations = [
14 | migrations.AddField(
15 | model_name='video',
16 | name='slug',
17 | field=models.SlugField(null=True, blank=True),
18 | preserve_default=True,
19 | ),
20 | migrations.AlterUniqueTogether(
21 | name='video',
22 | unique_together=set([('slug', 'category')]),
23 | ),
24 | ]
25 |
--------------------------------------------------------------------------------
/src/videos/migrations/0009_video_share_message.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | from __future__ import unicode_literals
3 |
4 | from django.db import models, migrations
5 |
6 |
7 | class Migration(migrations.Migration):
8 |
9 | dependencies = [
10 | ('videos', '0008_auto_20150119_2127'),
11 | ]
12 |
13 | operations = [
14 | migrations.AddField(
15 | model_name='video',
16 | name='share_message',
17 | field=models.TextField(default=b'\nCheck out this awesome video.\n'),
18 | preserve_default=True,
19 | ),
20 | ]
21 |
--------------------------------------------------------------------------------
/src/videos/migrations/0010_auto_20150120_2335.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | from __future__ import unicode_literals
3 |
4 | from django.db import models, migrations
5 |
6 |
7 | class Migration(migrations.Migration):
8 |
9 | dependencies = [
10 | ('videos', '0009_video_share_message'),
11 | ]
12 |
13 | operations = [
14 | migrations.AlterField(
15 | model_name='video',
16 | name='share_message',
17 | field=models.TextField(default=b'Check out this awesome video.'),
18 | preserve_default=True,
19 | ),
20 | ]
21 |
--------------------------------------------------------------------------------
/src/videos/migrations/0011_taggeditem.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | from __future__ import unicode_literals
3 |
4 | from django.db import models, migrations
5 |
6 |
7 | class Migration(migrations.Migration):
8 |
9 | dependencies = [
10 | ('contenttypes', '0001_initial'),
11 | ('videos', '0010_auto_20150120_2335'),
12 | ]
13 |
14 | operations = [
15 | migrations.CreateModel(
16 | name='TaggedItem',
17 | fields=[
18 | ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
19 | ('tag', models.SlugField(choices=[(b'python', b'python'), (b'django', b'django')])),
20 | ('object_id', models.PositiveIntegerField()),
21 | ('content_type', models.ForeignKey(to='contenttypes.ContentType')),
22 | ],
23 | options={
24 | },
25 | bases=(models.Model,),
26 | ),
27 | ]
28 |
--------------------------------------------------------------------------------
/src/videos/migrations/0012_auto_20150126_0712.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | from __future__ import unicode_literals
3 |
4 | from django.db import models, migrations
5 |
6 |
7 | class Migration(migrations.Migration):
8 |
9 | dependencies = [
10 | ('videos', '0011_taggeditem'),
11 | ]
12 |
13 | operations = [
14 | migrations.AlterField(
15 | model_name='taggeditem',
16 | name='tag',
17 | field=models.SlugField(choices=[(b'python', b'python'), (b'django', b'django'), (b'css', b'css'), (b'bootstrap', b'bootstrap')]),
18 | preserve_default=True,
19 | ),
20 | ]
21 |
--------------------------------------------------------------------------------
/src/videos/migrations/0013_auto_20150130_2131.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | from __future__ import unicode_literals
3 |
4 | from django.db import models, migrations
5 |
6 |
7 | class Migration(migrations.Migration):
8 |
9 | dependencies = [
10 | ('videos', '0012_auto_20150126_0712'),
11 | ]
12 |
13 | operations = [
14 | migrations.AlterModelOptions(
15 | name='category',
16 | options={'ordering': ['title', 'timestamp']},
17 | ),
18 | migrations.AddField(
19 | model_name='video',
20 | name='order',
21 | field=models.PositiveIntegerField(default=1),
22 | preserve_default=True,
23 | ),
24 | ]
25 |
--------------------------------------------------------------------------------
/src/videos/migrations/0014_auto_20150131_1915.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | from __future__ import unicode_literals
3 |
4 | from django.db import models, migrations
5 |
6 |
7 | class Migration(migrations.Migration):
8 |
9 | dependencies = [
10 | ('videos', '0013_auto_20150130_2131'),
11 | ]
12 |
13 | operations = [
14 | migrations.AlterModelOptions(
15 | name='video',
16 | options={'ordering': ['order', '-timestamp']},
17 | ),
18 | ]
19 |
--------------------------------------------------------------------------------
/src/videos/migrations/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codingforentrepreneurs/srvup-membership/4f6279849668225390fdb94255a5612cb28739be/src/videos/migrations/__init__.py
--------------------------------------------------------------------------------
/src/videos/migrations/__init__.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codingforentrepreneurs/srvup-membership/4f6279849668225390fdb94255a5612cb28739be/src/videos/migrations/__init__.pyc
--------------------------------------------------------------------------------
/src/videos/models.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codingforentrepreneurs/srvup-membership/4f6279849668225390fdb94255a5612cb28739be/src/videos/models.pyc
--------------------------------------------------------------------------------
/src/videos/tests.py:
--------------------------------------------------------------------------------
1 | from django.test import TestCase
2 |
3 | # Create your tests here.
4 |
--------------------------------------------------------------------------------
/src/videos/utils.py:
--------------------------------------------------------------------------------
1 |
2 |
3 | def get_vid_for_direction(instance, direction):
4 | ''' get next video instance based on direction and current video instance'''
5 | category = instance.category
6 | video_qs = category.video_set.all()
7 | if direction == "next":
8 | new_qs = video_qs.filter(order__gt=instance.order)
9 | else:
10 | new_qs = video_qs.filter(order__lt=instance.order).reverse()
11 | next_vid = None
12 | if len(new_qs) >= 1:
13 | try:
14 | next_vid = new_qs[0]
15 | except IndexError:
16 | next_vid = None
17 | return next_vid
18 |
19 |
--------------------------------------------------------------------------------
/src/videos/views.py:
--------------------------------------------------------------------------------
1 | from itertools import chain
2 |
3 | from django.core.urlresolvers import reverse
4 | from django.contrib.auth.decorators import login_required
5 | from django.contrib.contenttypes.models import ContentType
6 | from django.shortcuts import render, Http404, HttpResponseRedirect, get_object_or_404
7 |
8 | # Create your views here.
9 | from analytics.signals import page_view
10 | from comments.forms import CommentForm
11 | from comments.models import Comment
12 |
13 |
14 |
15 | from .models import Video, Category, TaggedItem
16 |
17 |
18 | #@login_required
19 | def video_detail(request, cat_slug, vid_slug):
20 | cat = get_object_or_404(Category, slug=cat_slug)
21 | obj = get_object_or_404(Video, slug=vid_slug, category=cat)
22 | page_view.send(request.user,
23 | page_path=request.get_full_path(),
24 | primary_obj=obj,
25 | secondary_obj=cat)
26 | if request.user.is_authenticated() or obj.has_preview:
27 | try:
28 | is_member = request.user.is_member
29 | except:
30 | is_member = None
31 | if is_member or obj.has_preview:
32 | comments = obj.comment_set.all()
33 | for c in comments:
34 | c.get_children()
35 | comment_form = CommentForm()
36 | context = {"obj": obj,
37 | "comments":comments,
38 | "comment_form": comment_form}
39 | return render(request, "videos/video_detail.html", context)
40 | else:
41 | # upgrade account
42 | next_url = obj.get_absolute_url()
43 | return HttpResponseRedirect("%s?next=%s"%(reverse('account_upgrade'), next_url))
44 | else:
45 | next_url = obj.get_absolute_url()
46 | return HttpResponseRedirect("%s?next=%s"%(reverse('login'), next_url))
47 |
48 |
49 |
50 | def category_list(request):
51 | queryset = Category.objects.all()
52 | # queryset2 = Category.objects.all()
53 | # queryset3 = list(chain(queryset,queryset2))
54 | context = {
55 | "queryset": queryset,
56 | }
57 | return render(request, "videos/category_list.html", context)
58 |
59 |
60 |
61 | # @login_required
62 | def category_detail(request, cat_slug):
63 | obj = get_object_or_404(Category, slug=cat_slug)
64 | queryset = obj.video_set.all()
65 | page_view.send(request.user,
66 | page_path=request.get_full_path(),
67 | primary_obj=obj)
68 |
69 |
70 | print queryset
71 | return render(request, "videos/video_list.html", {"obj": obj, "queryset": queryset})
72 |
73 |
74 |
75 | # def video_edit(request):
76 |
77 | # return render(request, "videos/video_single.html", {})
78 |
79 |
80 | # def video_create(request):
81 |
82 | # return render(request, "videos/video_single.html", {})
83 |
--------------------------------------------------------------------------------
/srvup.sublime-project:
--------------------------------------------------------------------------------
1 | {
2 | "folders":
3 | [
4 | {
5 | "follow_symlinks": true,
6 | "path": "src"
7 | },
8 | {
9 | "follow_symlinks": true,
10 | "path": "static"
11 | }
12 | ]
13 | }
14 |
--------------------------------------------------------------------------------
/static/media/images/Screen_Shot_2015-01-30_at_1.07.12_PM.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codingforentrepreneurs/srvup-membership/4f6279849668225390fdb94255a5612cb28739be/static/media/images/Screen_Shot_2015-01-30_at_1.07.12_PM.png
--------------------------------------------------------------------------------
/static/media/images/djangogap.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codingforentrepreneurs/srvup-membership/4f6279849668225390fdb94255a5612cb28739be/static/media/images/djangogap.png
--------------------------------------------------------------------------------
/static/media/images/heroku_django.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codingforentrepreneurs/srvup-membership/4f6279849668225390fdb94255a5612cb28739be/static/media/images/heroku_django.png
--------------------------------------------------------------------------------
/static/media/images/launch_with_code.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codingforentrepreneurs/srvup-membership/4f6279849668225390fdb94255a5612cb28739be/static/media/images/launch_with_code.png
--------------------------------------------------------------------------------
/static/media/images/open-ecommerce.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codingforentrepreneurs/srvup-membership/4f6279849668225390fdb94255a5612cb28739be/static/media/images/open-ecommerce.png
--------------------------------------------------------------------------------
/static/media/images/srvup_membership.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codingforentrepreneurs/srvup-membership/4f6279849668225390fdb94255a5612cb28739be/static/media/images/srvup_membership.png
--------------------------------------------------------------------------------
/static/media/images/try_django_17.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codingforentrepreneurs/srvup-membership/4f6279849668225390fdb94255a5612cb28739be/static/media/images/try_django_17.jpg
--------------------------------------------------------------------------------
/static/static_dirs/js/ie-emulation-modes-warning.js:
--------------------------------------------------------------------------------
1 | // NOTICE!! DO NOT USE ANY OF THIS JAVASCRIPT
2 | // IT'S JUST JUNK FOR OUR DOCS!
3 | // ++++++++++++++++++++++++++++++++++++++++++
4 | /*!
5 | * Copyright 2014 Twitter, Inc.
6 | *
7 | * Licensed under the Creative Commons Attribution 3.0 Unported License. For
8 | * details, see http://creativecommons.org/licenses/by/3.0/.
9 | */
10 | // Intended to prevent false-positive bug reports about Bootstrap not working properly in old versions of IE due to folks testing using IE's unreliable emulation modes.
11 | (function () {
12 | 'use strict';
13 |
14 | function emulatedIEMajorVersion() {
15 | var groups = /MSIE ([0-9.]+)/.exec(window.navigator.userAgent)
16 | if (groups === null) {
17 | return null
18 | }
19 | var ieVersionNum = parseInt(groups[1], 10)
20 | var ieMajorVersion = Math.floor(ieVersionNum)
21 | return ieMajorVersion
22 | }
23 |
24 | function actualNonEmulatedIEMajorVersion() {
25 | // Detects the actual version of IE in use, even if it's in an older-IE emulation mode.
26 | // IE JavaScript conditional compilation docs: http://msdn.microsoft.com/en-us/library/ie/121hztk3(v=vs.94).aspx
27 | // @cc_on docs: http://msdn.microsoft.com/en-us/library/ie/8ka90k2e(v=vs.94).aspx
28 | var jscriptVersion = new Function('/*@cc_on return @_jscript_version; @*/')() // jshint ignore:line
29 | if (jscriptVersion === undefined) {
30 | return 11 // IE11+ not in emulation mode
31 | }
32 | if (jscriptVersion < 9) {
33 | return 8 // IE8 (or lower; haven't tested on IE<8)
34 | }
35 | return jscriptVersion // IE9 or IE10 in any mode, or IE11 in non-IE11 mode
36 | }
37 |
38 | var ua = window.navigator.userAgent
39 | if (ua.indexOf('Opera') > -1 || ua.indexOf('Presto') > -1) {
40 | return // Opera, which might pretend to be IE
41 | }
42 | var emulated = emulatedIEMajorVersion()
43 | if (emulated === null) {
44 | return // Not IE
45 | }
46 | var nonEmulated = actualNonEmulatedIEMajorVersion()
47 |
48 | if (emulated !== nonEmulated) {
49 | window.alert('WARNING: You appear to be using IE' + nonEmulated + ' in IE' + emulated + ' emulation mode.\nIE emulation modes can behave significantly differently from ACTUAL older versions of IE.\nPLEASE DON\'T FILE BOOTSTRAP BUGS based on testing in IE emulation modes!')
50 | }
51 | })();
52 |
--------------------------------------------------------------------------------
/static/static_dirs/js/ie10-viewport-bug-workaround.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * IE10 viewport hack for Surface/desktop Windows 8 bug
3 | * Copyright 2014 Twitter, Inc.
4 | * Licensed under the Creative Commons Attribution 3.0 Unported License. For
5 | * details, see http://creativecommons.org/licenses/by/3.0/.
6 | */
7 |
8 | // See the Getting Started docs for more information:
9 | // http://getbootstrap.com/getting-started/#support-ie10-width
10 |
11 | (function () {
12 | 'use strict';
13 | if (navigator.userAgent.match(/IEMobile\/10\.0/)) {
14 | var msViewportStyle = document.createElement('style')
15 | msViewportStyle.appendChild(
16 | document.createTextNode(
17 | '@-ms-viewport{width:auto!important}'
18 | )
19 | )
20 | document.querySelector('head').appendChild(msViewportStyle)
21 | }
22 | })();
23 |
--------------------------------------------------------------------------------
/static/static_root/admin/css/dashboard.css:
--------------------------------------------------------------------------------
1 | /* DASHBOARD */
2 |
3 | .dashboard .module table th {
4 | width: 100%;
5 | }
6 |
7 | .dashboard .module table td {
8 | white-space: nowrap;
9 | }
10 |
11 | .dashboard .module table td a {
12 | display: block;
13 | padding-right: .6em;
14 | }
15 |
16 | /* RECENT ACTIONS MODULE */
17 |
18 | .module ul.actionlist {
19 | margin-left: 0;
20 | }
21 |
22 | ul.actionlist li {
23 | list-style-type: none;
24 | }
25 |
26 | ul.actionlist li {
27 | overflow: hidden;
28 | text-overflow: ellipsis;
29 | -o-text-overflow: ellipsis;
30 | }
31 |
--------------------------------------------------------------------------------
/static/static_root/admin/css/ie.css:
--------------------------------------------------------------------------------
1 | /* IE 6 & 7 */
2 |
3 | /* Proper fixed width for dashboard in IE6 */
4 |
5 | .dashboard #content {
6 | *width: 768px;
7 | }
8 |
9 | .dashboard #content-main {
10 | *width: 535px;
11 | }
12 |
13 | /* IE 6 ONLY */
14 |
15 | /* Keep header from flowing off the page */
16 |
17 | #container {
18 | _position: static;
19 | }
20 |
21 | /* Put the right sidebars back on the page */
22 |
23 | .colMS #content-related {
24 | _margin-right: 0;
25 | _margin-left: 10px;
26 | _position: static;
27 | }
28 |
29 | /* Put the left sidebars back on the page */
30 |
31 | .colSM #content-related {
32 | _margin-right: 10px;
33 | _margin-left: -115px;
34 | _position: static;
35 | }
36 |
37 | .form-row {
38 | _height: 1%;
39 | }
40 |
41 | /* Fix right margin for changelist filters in IE6 */
42 |
43 | #changelist-filter ul {
44 | _margin-right: -10px;
45 | }
46 |
47 | /* IE ignores min-height, but treats height as if it were min-height */
48 |
49 | .change-list .filtered {
50 | _height: 400px;
51 | }
52 |
53 | /* IE doesn't know alpha transparency in PNGs */
54 |
55 | .inline-deletelink {
56 | background: transparent url(../img/inline-delete-8bit.png) no-repeat;
57 | }
58 |
59 | /* IE7 doesn't support inline-block */
60 | .change-list ul.toplinks li {
61 | zoom: 1;
62 | *display: inline;
63 | }
--------------------------------------------------------------------------------
/static/static_root/admin/css/login.css:
--------------------------------------------------------------------------------
1 | /* LOGIN FORM */
2 |
3 | body.login {
4 | background: #eee;
5 | }
6 |
7 | .login #container {
8 | background: white;
9 | border: 1px solid #ccc;
10 | width: 28em;
11 | min-width: 300px;
12 | margin-left: auto;
13 | margin-right: auto;
14 | margin-top: 100px;
15 | }
16 |
17 | .login #content-main {
18 | width: 100%;
19 | }
20 |
21 | .login form {
22 | margin-top: 1em;
23 | }
24 |
25 | .login .form-row {
26 | padding: 4px 0;
27 | float: left;
28 | width: 100%;
29 | }
30 |
31 | .login .form-row label {
32 | padding-right: 0.5em;
33 | line-height: 2em;
34 | font-size: 1em;
35 | clear: both;
36 | color: #333;
37 | }
38 |
39 | .login .form-row #id_username, .login .form-row #id_password {
40 | clear: both;
41 | padding: 6px;
42 | width: 100%;
43 | -webkit-box-sizing: border-box;
44 | -moz-box-sizing: border-box;
45 | box-sizing: border-box;
46 | }
47 |
48 | .login span.help {
49 | font-size: 10px;
50 | display: block;
51 | }
52 |
53 | .login .submit-row {
54 | clear: both;
55 | padding: 1em 0 0 9.4em;
56 | }
57 |
58 | .login .password-reset-link {
59 | text-align: center;
60 | }
61 |
--------------------------------------------------------------------------------
/static/static_root/admin/css/rtl.css:
--------------------------------------------------------------------------------
1 | body {
2 | direction: rtl;
3 | }
4 |
5 | /* LOGIN */
6 |
7 | .login .form-row {
8 | float: right;
9 | }
10 |
11 | .login .form-row label {
12 | float: right;
13 | padding-left: 0.5em;
14 | padding-right: 0;
15 | text-align: left;
16 | }
17 |
18 | .login .submit-row {
19 | clear: both;
20 | padding: 1em 9.4em 0 0;
21 | }
22 |
23 | /* GLOBAL */
24 |
25 | th {
26 | text-align: right;
27 | }
28 |
29 | .module h2, .module caption {
30 | text-align: right;
31 | }
32 |
33 | .addlink, .changelink {
34 | padding-left: 0px;
35 | padding-right: 12px;
36 | background-position: 100% 0.2em;
37 | }
38 |
39 | .deletelink {
40 | padding-left: 0px;
41 | padding-right: 12px;
42 | background-position: 100% 0.25em;
43 | }
44 |
45 | .object-tools {
46 | float: left;
47 | }
48 |
49 | thead th:first-child,
50 | tfoot td:first-child {
51 | border-left: 1px solid #ddd !important;
52 | }
53 |
54 | /* LAYOUT */
55 |
56 | #user-tools {
57 | right: auto;
58 | left: 0;
59 | text-align: left;
60 | }
61 |
62 | div.breadcrumbs {
63 | text-align: right;
64 | }
65 |
66 | #content-main {
67 | float: right;
68 | }
69 |
70 | #content-related {
71 | float: left;
72 | margin-left: -19em;
73 | margin-right: auto;
74 | }
75 |
76 | .colMS {
77 | margin-left: 20em !important;
78 | margin-right: 10px !important;
79 | }
80 |
81 | /* SORTABLE TABLES */
82 |
83 | table thead th.sorted .sortoptions {
84 | float: left;
85 | }
86 |
87 | thead th.sorted .text {
88 | padding-right: 0;
89 | padding-left: 42px;
90 | }
91 |
92 | /* dashboard styles */
93 |
94 | .dashboard .module table td a {
95 | padding-left: .6em;
96 | padding-right: 12px;
97 | }
98 |
99 | /* changelists styles */
100 |
101 | .change-list .filtered {
102 | background: white url(../img/changelist-bg_rtl.gif) top left repeat-y !important;
103 | }
104 |
105 | .change-list .filtered table {
106 | border-left: 1px solid #ddd;
107 | border-right: 0px none;
108 | }
109 |
110 | #changelist-filter {
111 | right: auto;
112 | left: 0;
113 | border-left: 0px none;
114 | border-right: 1px solid #ddd;
115 | }
116 |
117 | .change-list .filtered .results, .change-list .filtered .paginator, .filtered #toolbar, .filtered div.xfull {
118 | margin-right: 0px !important;
119 | margin-left: 160px !important;
120 | }
121 |
122 | #changelist-filter li.selected {
123 | border-left: 0px none;
124 | padding-left: 0px;
125 | margin-left: 0;
126 | border-right: 5px solid #ccc;
127 | padding-right: 5px;
128 | margin-right: -10px;
129 | }
130 |
131 | .filtered .actions {
132 | border-left:1px solid #DDDDDD;
133 | margin-left:160px !important;
134 | border-right: 0 none;
135 | margin-right:0 !important;
136 | }
137 |
138 | #changelist table tbody td:first-child, #changelist table tbody th:first-child {
139 | border-right: 0;
140 | border-left: 1px solid #ddd;
141 | }
142 |
143 | /* FORMS */
144 |
145 | .aligned label {
146 | padding: 0 0 3px 1em;
147 | float: right;
148 | }
149 |
150 | .submit-row {
151 | text-align: left
152 | }
153 |
154 | .submit-row p.deletelink-box {
155 | float: right;
156 | }
157 |
158 | .submit-row .deletelink {
159 | background: url(../img/icon_deletelink.gif) 0 50% no-repeat;
160 | padding-right: 14px;
161 | }
162 |
163 | .vDateField, .vTimeField {
164 | margin-left: 2px;
165 | }
166 |
167 | form ul.inline li {
168 | float: right;
169 | padding-right: 0;
170 | padding-left: 7px;
171 | }
172 |
173 | input[type=submit].default, .submit-row input.default {
174 | float: left;
175 | }
176 |
177 | fieldset .field-box {
178 | float: right;
179 | margin-left: 20px;
180 | margin-right: 0;
181 | }
182 |
183 | .errorlist li {
184 | background-position: 100% .3em;
185 | padding: 4px 25px 4px 5px;
186 | }
187 |
188 | .errornote {
189 | background-position: 100% .3em;
190 | padding: 4px 25px 4px 5px;
191 | }
192 |
193 | /* WIDGETS */
194 |
195 | .calendarnav-previous {
196 | top: 0;
197 | left: auto;
198 | right: 0;
199 | }
200 |
201 | .calendarnav-next {
202 | top: 0;
203 | right: auto;
204 | left: 0;
205 | }
206 |
207 | .calendar caption, .calendarbox h2 {
208 | text-align: center;
209 | }
210 |
211 | .selector {
212 | float: right;
213 | }
214 |
215 | .selector .selector-filter {
216 | text-align: right;
217 | }
218 |
219 | .inline-deletelink {
220 | float: left;
221 | }
222 |
223 | /* MISC */
224 |
225 | .inline-related h2, .inline-group h2 {
226 | text-align: right
227 | }
228 |
229 | .inline-related h3 span.delete {
230 | padding-right: 20px;
231 | padding-left: inherit;
232 | left: 10px;
233 | right: inherit;
234 | float:left;
235 | }
236 |
237 | .inline-related h3 span.delete label {
238 | margin-left: inherit;
239 | margin-right: 2px;
240 | }
241 |
242 | /* IE7 specific bug fixes */
243 |
244 | div.colM {
245 | position: relative;
246 | }
247 |
248 | .submit-row input {
249 | float: left;
250 | }
--------------------------------------------------------------------------------
/static/static_root/admin/img/changelist-bg.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codingforentrepreneurs/srvup-membership/4f6279849668225390fdb94255a5612cb28739be/static/static_root/admin/img/changelist-bg.gif
--------------------------------------------------------------------------------
/static/static_root/admin/img/changelist-bg_rtl.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codingforentrepreneurs/srvup-membership/4f6279849668225390fdb94255a5612cb28739be/static/static_root/admin/img/changelist-bg_rtl.gif
--------------------------------------------------------------------------------
/static/static_root/admin/img/default-bg-reverse.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codingforentrepreneurs/srvup-membership/4f6279849668225390fdb94255a5612cb28739be/static/static_root/admin/img/default-bg-reverse.gif
--------------------------------------------------------------------------------
/static/static_root/admin/img/default-bg.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codingforentrepreneurs/srvup-membership/4f6279849668225390fdb94255a5612cb28739be/static/static_root/admin/img/default-bg.gif
--------------------------------------------------------------------------------
/static/static_root/admin/img/deleted-overlay.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codingforentrepreneurs/srvup-membership/4f6279849668225390fdb94255a5612cb28739be/static/static_root/admin/img/deleted-overlay.gif
--------------------------------------------------------------------------------
/static/static_root/admin/img/gis/move_vertex_off.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codingforentrepreneurs/srvup-membership/4f6279849668225390fdb94255a5612cb28739be/static/static_root/admin/img/gis/move_vertex_off.png
--------------------------------------------------------------------------------
/static/static_root/admin/img/gis/move_vertex_on.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codingforentrepreneurs/srvup-membership/4f6279849668225390fdb94255a5612cb28739be/static/static_root/admin/img/gis/move_vertex_on.png
--------------------------------------------------------------------------------
/static/static_root/admin/img/icon-no.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codingforentrepreneurs/srvup-membership/4f6279849668225390fdb94255a5612cb28739be/static/static_root/admin/img/icon-no.gif
--------------------------------------------------------------------------------
/static/static_root/admin/img/icon-unknown.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codingforentrepreneurs/srvup-membership/4f6279849668225390fdb94255a5612cb28739be/static/static_root/admin/img/icon-unknown.gif
--------------------------------------------------------------------------------
/static/static_root/admin/img/icon-yes.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codingforentrepreneurs/srvup-membership/4f6279849668225390fdb94255a5612cb28739be/static/static_root/admin/img/icon-yes.gif
--------------------------------------------------------------------------------
/static/static_root/admin/img/icon_addlink.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codingforentrepreneurs/srvup-membership/4f6279849668225390fdb94255a5612cb28739be/static/static_root/admin/img/icon_addlink.gif
--------------------------------------------------------------------------------
/static/static_root/admin/img/icon_alert.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codingforentrepreneurs/srvup-membership/4f6279849668225390fdb94255a5612cb28739be/static/static_root/admin/img/icon_alert.gif
--------------------------------------------------------------------------------
/static/static_root/admin/img/icon_calendar.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codingforentrepreneurs/srvup-membership/4f6279849668225390fdb94255a5612cb28739be/static/static_root/admin/img/icon_calendar.gif
--------------------------------------------------------------------------------
/static/static_root/admin/img/icon_changelink.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codingforentrepreneurs/srvup-membership/4f6279849668225390fdb94255a5612cb28739be/static/static_root/admin/img/icon_changelink.gif
--------------------------------------------------------------------------------
/static/static_root/admin/img/icon_clock.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codingforentrepreneurs/srvup-membership/4f6279849668225390fdb94255a5612cb28739be/static/static_root/admin/img/icon_clock.gif
--------------------------------------------------------------------------------
/static/static_root/admin/img/icon_deletelink.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codingforentrepreneurs/srvup-membership/4f6279849668225390fdb94255a5612cb28739be/static/static_root/admin/img/icon_deletelink.gif
--------------------------------------------------------------------------------
/static/static_root/admin/img/icon_error.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codingforentrepreneurs/srvup-membership/4f6279849668225390fdb94255a5612cb28739be/static/static_root/admin/img/icon_error.gif
--------------------------------------------------------------------------------
/static/static_root/admin/img/icon_searchbox.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codingforentrepreneurs/srvup-membership/4f6279849668225390fdb94255a5612cb28739be/static/static_root/admin/img/icon_searchbox.png
--------------------------------------------------------------------------------
/static/static_root/admin/img/icon_success.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codingforentrepreneurs/srvup-membership/4f6279849668225390fdb94255a5612cb28739be/static/static_root/admin/img/icon_success.gif
--------------------------------------------------------------------------------
/static/static_root/admin/img/inline-delete-8bit.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codingforentrepreneurs/srvup-membership/4f6279849668225390fdb94255a5612cb28739be/static/static_root/admin/img/inline-delete-8bit.png
--------------------------------------------------------------------------------
/static/static_root/admin/img/inline-delete.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codingforentrepreneurs/srvup-membership/4f6279849668225390fdb94255a5612cb28739be/static/static_root/admin/img/inline-delete.png
--------------------------------------------------------------------------------
/static/static_root/admin/img/inline-restore-8bit.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codingforentrepreneurs/srvup-membership/4f6279849668225390fdb94255a5612cb28739be/static/static_root/admin/img/inline-restore-8bit.png
--------------------------------------------------------------------------------
/static/static_root/admin/img/inline-restore.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codingforentrepreneurs/srvup-membership/4f6279849668225390fdb94255a5612cb28739be/static/static_root/admin/img/inline-restore.png
--------------------------------------------------------------------------------
/static/static_root/admin/img/inline-splitter-bg.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codingforentrepreneurs/srvup-membership/4f6279849668225390fdb94255a5612cb28739be/static/static_root/admin/img/inline-splitter-bg.gif
--------------------------------------------------------------------------------
/static/static_root/admin/img/nav-bg-grabber.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codingforentrepreneurs/srvup-membership/4f6279849668225390fdb94255a5612cb28739be/static/static_root/admin/img/nav-bg-grabber.gif
--------------------------------------------------------------------------------
/static/static_root/admin/img/nav-bg-reverse.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codingforentrepreneurs/srvup-membership/4f6279849668225390fdb94255a5612cb28739be/static/static_root/admin/img/nav-bg-reverse.gif
--------------------------------------------------------------------------------
/static/static_root/admin/img/nav-bg-selected.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codingforentrepreneurs/srvup-membership/4f6279849668225390fdb94255a5612cb28739be/static/static_root/admin/img/nav-bg-selected.gif
--------------------------------------------------------------------------------
/static/static_root/admin/img/nav-bg.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codingforentrepreneurs/srvup-membership/4f6279849668225390fdb94255a5612cb28739be/static/static_root/admin/img/nav-bg.gif
--------------------------------------------------------------------------------
/static/static_root/admin/img/selector-icons.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codingforentrepreneurs/srvup-membership/4f6279849668225390fdb94255a5612cb28739be/static/static_root/admin/img/selector-icons.gif
--------------------------------------------------------------------------------
/static/static_root/admin/img/selector-search.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codingforentrepreneurs/srvup-membership/4f6279849668225390fdb94255a5612cb28739be/static/static_root/admin/img/selector-search.gif
--------------------------------------------------------------------------------
/static/static_root/admin/img/sorting-icons.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codingforentrepreneurs/srvup-membership/4f6279849668225390fdb94255a5612cb28739be/static/static_root/admin/img/sorting-icons.gif
--------------------------------------------------------------------------------
/static/static_root/admin/img/tooltag-add.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codingforentrepreneurs/srvup-membership/4f6279849668225390fdb94255a5612cb28739be/static/static_root/admin/img/tooltag-add.png
--------------------------------------------------------------------------------
/static/static_root/admin/img/tooltag-arrowright.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codingforentrepreneurs/srvup-membership/4f6279849668225390fdb94255a5612cb28739be/static/static_root/admin/img/tooltag-arrowright.png
--------------------------------------------------------------------------------
/static/static_root/admin/js/LICENSE-JQUERY.txt:
--------------------------------------------------------------------------------
1 | Copyright (c) 2010 John Resig, http://jquery.com/
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining
4 | a copy of this software and associated documentation files (the
5 | "Software"), to deal in the Software without restriction, including
6 | without limitation the rights to use, copy, modify, merge, publish,
7 | distribute, sublicense, and/or sell copies of the Software, and to
8 | permit persons to whom the Software is furnished to do so, subject to
9 | the following conditions:
10 |
11 | The above copyright notice and this permission notice shall be
12 | included in all copies or substantial portions of the Software.
13 |
14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
--------------------------------------------------------------------------------
/static/static_root/admin/js/SelectBox.js:
--------------------------------------------------------------------------------
1 | var SelectBox = {
2 | cache: new Object(),
3 | init: function(id) {
4 | var box = document.getElementById(id);
5 | var node;
6 | SelectBox.cache[id] = new Array();
7 | var cache = SelectBox.cache[id];
8 | for (var i = 0; (node = box.options[i]); i++) {
9 | cache.push({value: node.value, text: node.text, displayed: 1});
10 | }
11 | },
12 | redisplay: function(id) {
13 | // Repopulate HTML select box from cache
14 | var box = document.getElementById(id);
15 | box.options.length = 0; // clear all options
16 | for (var i = 0, j = SelectBox.cache[id].length; i < j; i++) {
17 | var node = SelectBox.cache[id][i];
18 | if (node.displayed) {
19 | var new_option = new Option(node.text, node.value, false, false);
20 | // Shows a tooltip when hovering over the option
21 | new_option.setAttribute("title", node.text);
22 | box.options[box.options.length] = new_option;
23 | }
24 | }
25 | },
26 | filter: function(id, text) {
27 | // Redisplay the HTML select box, displaying only the choices containing ALL
28 | // the words in text. (It's an AND search.)
29 | var tokens = text.toLowerCase().split(/\s+/);
30 | var node, token;
31 | for (var i = 0; (node = SelectBox.cache[id][i]); i++) {
32 | node.displayed = 1;
33 | for (var j = 0; (token = tokens[j]); j++) {
34 | if (node.text.toLowerCase().indexOf(token) == -1) {
35 | node.displayed = 0;
36 | }
37 | }
38 | }
39 | SelectBox.redisplay(id);
40 | },
41 | delete_from_cache: function(id, value) {
42 | var node, delete_index = null;
43 | for (var i = 0; (node = SelectBox.cache[id][i]); i++) {
44 | if (node.value == value) {
45 | delete_index = i;
46 | break;
47 | }
48 | }
49 | var j = SelectBox.cache[id].length - 1;
50 | for (var i = delete_index; i < j; i++) {
51 | SelectBox.cache[id][i] = SelectBox.cache[id][i+1];
52 | }
53 | SelectBox.cache[id].length--;
54 | },
55 | add_to_cache: function(id, option) {
56 | SelectBox.cache[id].push({value: option.value, text: option.text, displayed: 1});
57 | },
58 | cache_contains: function(id, value) {
59 | // Check if an item is contained in the cache
60 | var node;
61 | for (var i = 0; (node = SelectBox.cache[id][i]); i++) {
62 | if (node.value == value) {
63 | return true;
64 | }
65 | }
66 | return false;
67 | },
68 | move: function(from, to) {
69 | var from_box = document.getElementById(from);
70 | var to_box = document.getElementById(to);
71 | var option;
72 | for (var i = 0; (option = from_box.options[i]); i++) {
73 | if (option.selected && SelectBox.cache_contains(from, option.value)) {
74 | SelectBox.add_to_cache(to, {value: option.value, text: option.text, displayed: 1});
75 | SelectBox.delete_from_cache(from, option.value);
76 | }
77 | }
78 | SelectBox.redisplay(from);
79 | SelectBox.redisplay(to);
80 | },
81 | move_all: function(from, to) {
82 | var from_box = document.getElementById(from);
83 | var to_box = document.getElementById(to);
84 | var option;
85 | for (var i = 0; (option = from_box.options[i]); i++) {
86 | if (SelectBox.cache_contains(from, option.value)) {
87 | SelectBox.add_to_cache(to, {value: option.value, text: option.text, displayed: 1});
88 | SelectBox.delete_from_cache(from, option.value);
89 | }
90 | }
91 | SelectBox.redisplay(from);
92 | SelectBox.redisplay(to);
93 | },
94 | sort: function(id) {
95 | SelectBox.cache[id].sort( function(a, b) {
96 | a = a.text.toLowerCase();
97 | b = b.text.toLowerCase();
98 | try {
99 | if (a > b) return 1;
100 | if (a < b) return -1;
101 | }
102 | catch (e) {
103 | // silently fail on IE 'unknown' exception
104 | }
105 | return 0;
106 | } );
107 | },
108 | select_all: function(id) {
109 | var box = document.getElementById(id);
110 | for (var i = 0; i < box.options.length; i++) {
111 | box.options[i].selected = 'selected';
112 | }
113 | }
114 | }
115 |
--------------------------------------------------------------------------------
/static/static_root/admin/js/actions.js:
--------------------------------------------------------------------------------
1 | (function($) {
2 | var lastChecked;
3 |
4 | $.fn.actions = function(opts) {
5 | var options = $.extend({}, $.fn.actions.defaults, opts);
6 | var actionCheckboxes = $(this);
7 | var list_editable_changed = false;
8 | var checker = function(checked) {
9 | if (checked) {
10 | showQuestion();
11 | } else {
12 | reset();
13 | }
14 | $(actionCheckboxes).prop("checked", checked)
15 | .parent().parent().toggleClass(options.selectedClass, checked);
16 | },
17 | updateCounter = function() {
18 | var sel = $(actionCheckboxes).filter(":checked").length;
19 | // _actions_icnt is defined in the generated HTML
20 | // and contains the total amount of objects in the queryset
21 | $(options.counterContainer).html(interpolate(
22 | ngettext('%(sel)s of %(cnt)s selected', '%(sel)s of %(cnt)s selected', sel), {
23 | sel: sel,
24 | cnt: _actions_icnt
25 | }, true));
26 | $(options.allToggle).prop("checked", function() {
27 | var value;
28 | if (sel == actionCheckboxes.length) {
29 | value = true;
30 | showQuestion();
31 | } else {
32 | value = false;
33 | clearAcross();
34 | }
35 | return value;
36 | });
37 | },
38 | showQuestion = function() {
39 | $(options.acrossClears).hide();
40 | $(options.acrossQuestions).show();
41 | $(options.allContainer).hide();
42 | },
43 | showClear = function() {
44 | $(options.acrossClears).show();
45 | $(options.acrossQuestions).hide();
46 | $(options.actionContainer).toggleClass(options.selectedClass);
47 | $(options.allContainer).show();
48 | $(options.counterContainer).hide();
49 | },
50 | reset = function() {
51 | $(options.acrossClears).hide();
52 | $(options.acrossQuestions).hide();
53 | $(options.allContainer).hide();
54 | $(options.counterContainer).show();
55 | },
56 | clearAcross = function() {
57 | reset();
58 | $(options.acrossInput).val(0);
59 | $(options.actionContainer).removeClass(options.selectedClass);
60 | };
61 | // Show counter by default
62 | $(options.counterContainer).show();
63 | // Check state of checkboxes and reinit state if needed
64 | $(this).filter(":checked").each(function(i) {
65 | $(this).parent().parent().toggleClass(options.selectedClass);
66 | updateCounter();
67 | if ($(options.acrossInput).val() == 1) {
68 | showClear();
69 | }
70 | });
71 | $(options.allToggle).show().click(function() {
72 | checker($(this).prop("checked"));
73 | updateCounter();
74 | });
75 | $("a", options.acrossQuestions).click(function(event) {
76 | event.preventDefault();
77 | $(options.acrossInput).val(1);
78 | showClear();
79 | });
80 | $("a", options.acrossClears).click(function(event) {
81 | event.preventDefault();
82 | $(options.allToggle).prop("checked", false);
83 | clearAcross();
84 | checker(0);
85 | updateCounter();
86 | });
87 | lastChecked = null;
88 | $(actionCheckboxes).click(function(event) {
89 | if (!event) { event = window.event; }
90 | var target = event.target ? event.target : event.srcElement;
91 | if (lastChecked && $.data(lastChecked) != $.data(target) && event.shiftKey === true) {
92 | var inrange = false;
93 | $(lastChecked).prop("checked", target.checked)
94 | .parent().parent().toggleClass(options.selectedClass, target.checked);
95 | $(actionCheckboxes).each(function() {
96 | if ($.data(this) == $.data(lastChecked) || $.data(this) == $.data(target)) {
97 | inrange = (inrange) ? false : true;
98 | }
99 | if (inrange) {
100 | $(this).prop("checked", target.checked)
101 | .parent().parent().toggleClass(options.selectedClass, target.checked);
102 | }
103 | });
104 | }
105 | $(target).parent().parent().toggleClass(options.selectedClass, target.checked);
106 | lastChecked = target;
107 | updateCounter();
108 | });
109 | $('form#changelist-form table#result_list tr').find('td:gt(0) :input').change(function() {
110 | list_editable_changed = true;
111 | });
112 | $('form#changelist-form button[name="index"]').click(function(event) {
113 | if (list_editable_changed) {
114 | return confirm(gettext("You have unsaved changes on individual editable fields. If you run an action, your unsaved changes will be lost."));
115 | }
116 | });
117 | $('form#changelist-form input[name="_save"]').click(function(event) {
118 | var action_changed = false;
119 | $('select option:selected', options.actionContainer).each(function() {
120 | if ($(this).val()) {
121 | action_changed = true;
122 | }
123 | });
124 | if (action_changed) {
125 | if (list_editable_changed) {
126 | return confirm(gettext("You have selected an action, but you haven't saved your changes to individual fields yet. Please click OK to save. You'll need to re-run the action."));
127 | } else {
128 | return confirm(gettext("You have selected an action, and you haven't made any changes on individual fields. You're probably looking for the Go button rather than the Save button."));
129 | }
130 | }
131 | });
132 | };
133 | /* Setup plugin defaults */
134 | $.fn.actions.defaults = {
135 | actionContainer: "div.actions",
136 | counterContainer: "span.action-counter",
137 | allContainer: "div.actions span.all",
138 | acrossInput: "div.actions input.select-across",
139 | acrossQuestions: "div.actions span.question",
140 | acrossClears: "div.actions span.clear",
141 | allToggle: "#action-toggle",
142 | selectedClass: "selected"
143 | };
144 | })(django.jQuery);
145 |
--------------------------------------------------------------------------------
/static/static_root/admin/js/actions.min.js:
--------------------------------------------------------------------------------
1 | (function(a){var f;a.fn.actions=function(q){var b=a.extend({},a.fn.actions.defaults,q),g=a(this),e=!1,m=function(c){c?k():l();a(g).prop("checked",c).parent().parent().toggleClass(b.selectedClass,c)},h=function(){var c=a(g).filter(":checked").length;a(b.counterContainer).html(interpolate(ngettext("%(sel)s of %(cnt)s selected","%(sel)s of %(cnt)s selected",c),{sel:c,cnt:_actions_icnt},!0));a(b.allToggle).prop("checked",function(){var a;c==g.length?(a=!0,k()):(a=!1,n());return a})},k=function(){a(b.acrossClears).hide();
2 | a(b.acrossQuestions).show();a(b.allContainer).hide()},p=function(){a(b.acrossClears).show();a(b.acrossQuestions).hide();a(b.actionContainer).toggleClass(b.selectedClass);a(b.allContainer).show();a(b.counterContainer).hide()},l=function(){a(b.acrossClears).hide();a(b.acrossQuestions).hide();a(b.allContainer).hide();a(b.counterContainer).show()},n=function(){l();a(b.acrossInput).val(0);a(b.actionContainer).removeClass(b.selectedClass)};a(b.counterContainer).show();a(this).filter(":checked").each(function(c){a(this).parent().parent().toggleClass(b.selectedClass);
3 | h();1==a(b.acrossInput).val()&&p()});a(b.allToggle).show().click(function(){m(a(this).prop("checked"));h()});a("a",b.acrossQuestions).click(function(c){c.preventDefault();a(b.acrossInput).val(1);p()});a("a",b.acrossClears).click(function(c){c.preventDefault();a(b.allToggle).prop("checked",!1);n();m(0);h()});f=null;a(g).click(function(c){c||(c=window.event);var d=c.target?c.target:c.srcElement;if(f&&a.data(f)!=a.data(d)&&!0===c.shiftKey){var e=!1;a(f).prop("checked",d.checked).parent().parent().toggleClass(b.selectedClass,
4 | d.checked);a(g).each(function(){if(a.data(this)==a.data(f)||a.data(this)==a.data(d))e=e?!1:!0;e&&a(this).prop("checked",d.checked).parent().parent().toggleClass(b.selectedClass,d.checked)})}a(d).parent().parent().toggleClass(b.selectedClass,d.checked);f=d;h()});a("form#changelist-form table#result_list tr").find("td:gt(0) :input").change(function(){e=!0});a('form#changelist-form button[name="index"]').click(function(a){if(e)return confirm(gettext("You have unsaved changes on individual editable fields. If you run an action, your unsaved changes will be lost."))});
5 | a('form#changelist-form input[name="_save"]').click(function(c){var d=!1;a("select option:selected",b.actionContainer).each(function(){a(this).val()&&(d=!0)});if(d)return e?confirm(gettext("You have selected an action, but you haven't saved your changes to individual fields yet. Please click OK to save. You'll need to re-run the action.")):confirm(gettext("You have selected an action, and you haven't made any changes on individual fields. You're probably looking for the Go button rather than the Save button."))})};
6 | a.fn.actions.defaults={actionContainer:"div.actions",counterContainer:"span.action-counter",allContainer:"div.actions span.all",acrossInput:"div.actions input.select-across",acrossQuestions:"div.actions span.question",acrossClears:"div.actions span.clear",allToggle:"#action-toggle",selectedClass:"selected"}})(django.jQuery);
7 |
--------------------------------------------------------------------------------
/static/static_root/admin/js/admin/RelatedObjectLookups.js:
--------------------------------------------------------------------------------
1 | // Handles related-objects functionality: lookup link for raw_id_fields
2 | // and Add Another links.
3 |
4 | function html_unescape(text) {
5 | // Unescape a string that was escaped using django.utils.html.escape.
6 | text = text.replace(/</g, '<');
7 | text = text.replace(/>/g, '>');
8 | text = text.replace(/"/g, '"');
9 | text = text.replace(/'/g, "'");
10 | text = text.replace(/&/g, '&');
11 | return text;
12 | }
13 |
14 | // IE doesn't accept periods or dashes in the window name, but the element IDs
15 | // we use to generate popup window names may contain them, therefore we map them
16 | // to allowed characters in a reversible way so that we can locate the correct
17 | // element when the popup window is dismissed.
18 | function id_to_windowname(text) {
19 | text = text.replace(/\./g, '__dot__');
20 | text = text.replace(/\-/g, '__dash__');
21 | return text;
22 | }
23 |
24 | function windowname_to_id(text) {
25 | text = text.replace(/__dot__/g, '.');
26 | text = text.replace(/__dash__/g, '-');
27 | return text;
28 | }
29 |
30 | function showRelatedObjectLookupPopup(triggeringLink) {
31 | var name = triggeringLink.id.replace(/^lookup_/, '');
32 | name = id_to_windowname(name);
33 | var href;
34 | if (triggeringLink.href.search(/\?/) >= 0) {
35 | href = triggeringLink.href + '&_popup=1';
36 | } else {
37 | href = triggeringLink.href + '?_popup=1';
38 | }
39 | var win = window.open(href, name, 'height=500,width=800,resizable=yes,scrollbars=yes');
40 | win.focus();
41 | return false;
42 | }
43 |
44 | function dismissRelatedLookupPopup(win, chosenId) {
45 | var name = windowname_to_id(win.name);
46 | var elem = document.getElementById(name);
47 | if (elem.className.indexOf('vManyToManyRawIdAdminField') != -1 && elem.value) {
48 | elem.value += ',' + chosenId;
49 | } else {
50 | document.getElementById(name).value = chosenId;
51 | }
52 | win.close();
53 | }
54 |
55 | function showAddAnotherPopup(triggeringLink) {
56 | var name = triggeringLink.id.replace(/^add_/, '');
57 | name = id_to_windowname(name);
58 | var href = triggeringLink.href;
59 | if (href.indexOf('?') == -1) {
60 | href += '?_popup=1';
61 | } else {
62 | href += '&_popup=1';
63 | }
64 | var win = window.open(href, name, 'height=500,width=800,resizable=yes,scrollbars=yes');
65 | win.focus();
66 | return false;
67 | }
68 |
69 | function dismissAddAnotherPopup(win, newId, newRepr) {
70 | // newId and newRepr are expected to have previously been escaped by
71 | // django.utils.html.escape.
72 | newId = html_unescape(newId);
73 | newRepr = html_unescape(newRepr);
74 | var name = windowname_to_id(win.name);
75 | var elem = document.getElementById(name);
76 | var o;
77 | if (elem) {
78 | var elemName = elem.nodeName.toUpperCase();
79 | if (elemName == 'SELECT') {
80 | o = new Option(newRepr, newId);
81 | elem.options[elem.options.length] = o;
82 | o.selected = true;
83 | } else if (elemName == 'INPUT') {
84 | if (elem.className.indexOf('vManyToManyRawIdAdminField') != -1 && elem.value) {
85 | elem.value += ',' + newId;
86 | } else {
87 | elem.value = newId;
88 | }
89 | }
90 | } else {
91 | var toId = name + "_to";
92 | o = new Option(newRepr, newId);
93 | SelectBox.add_to_cache(toId, o);
94 | SelectBox.redisplay(toId);
95 | }
96 | win.close();
97 | }
98 |
--------------------------------------------------------------------------------
/static/static_root/admin/js/calendar.js:
--------------------------------------------------------------------------------
1 | /*
2 | calendar.js - Calendar functions by Adrian Holovaty
3 | depends on core.js for utility functions like removeChildren or quickElement
4 | */
5 |
6 | // CalendarNamespace -- Provides a collection of HTML calendar-related helper functions
7 | var CalendarNamespace = {
8 | monthsOfYear: gettext('January February March April May June July August September October November December').split(' '),
9 | daysOfWeek: gettext('S M T W T F S').split(' '),
10 | firstDayOfWeek: parseInt(get_format('FIRST_DAY_OF_WEEK')),
11 | isLeapYear: function(year) {
12 | return (((year % 4)==0) && ((year % 100)!=0) || ((year % 400)==0));
13 | },
14 | getDaysInMonth: function(month,year) {
15 | var days;
16 | if (month==1 || month==3 || month==5 || month==7 || month==8 || month==10 || month==12) {
17 | days = 31;
18 | }
19 | else if (month==4 || month==6 || month==9 || month==11) {
20 | days = 30;
21 | }
22 | else if (month==2 && CalendarNamespace.isLeapYear(year)) {
23 | days = 29;
24 | }
25 | else {
26 | days = 28;
27 | }
28 | return days;
29 | },
30 | draw: function(month, year, div_id, callback, selected) { // month = 1-12, year = 1-9999
31 | var today = new Date();
32 | var todayDay = today.getDate();
33 | var todayMonth = today.getMonth()+1;
34 | var todayYear = today.getFullYear();
35 | var todayClass = '';
36 |
37 | // Use UTC functions here because the date field does not contain time
38 | // and using the UTC function variants prevent the local time offset
39 | // from altering the date, specifically the day field. For example:
40 | //
41 | // ```
42 | // var x = new Date('2013-10-02');
43 | // var day = x.getDate();
44 | // ```
45 | //
46 | // The day variable above will be 1 instead of 2 in, say, US Pacific time
47 | // zone.
48 | var isSelectedMonth = false;
49 | if (typeof selected != 'undefined') {
50 | isSelectedMonth = (selected.getUTCFullYear() == year && (selected.getUTCMonth()+1) == month);
51 | }
52 |
53 | month = parseInt(month);
54 | year = parseInt(year);
55 | var calDiv = document.getElementById(div_id);
56 | removeChildren(calDiv);
57 | var calTable = document.createElement('table');
58 | quickElement('caption', calTable, CalendarNamespace.monthsOfYear[month-1] + ' ' + year);
59 | var tableBody = quickElement('tbody', calTable);
60 |
61 | // Draw days-of-week header
62 | var tableRow = quickElement('tr', tableBody);
63 | for (var i = 0; i < 7; i++) {
64 | quickElement('th', tableRow, CalendarNamespace.daysOfWeek[(i + CalendarNamespace.firstDayOfWeek) % 7]);
65 | }
66 |
67 | var startingPos = new Date(year, month-1, 1 - CalendarNamespace.firstDayOfWeek).getDay();
68 | var days = CalendarNamespace.getDaysInMonth(month, year);
69 |
70 | // Draw blanks before first of month
71 | tableRow = quickElement('tr', tableBody);
72 | for (var i = 0; i < startingPos; i++) {
73 | var _cell = quickElement('td', tableRow, ' ');
74 | _cell.className = "nonday";
75 | }
76 |
77 | // Draw days of month
78 | var currentDay = 1;
79 | for (var i = startingPos; currentDay <= days; i++) {
80 | if (i%7 == 0 && currentDay != 1) {
81 | tableRow = quickElement('tr', tableBody);
82 | }
83 | if ((currentDay==todayDay) && (month==todayMonth) && (year==todayYear)) {
84 | todayClass='today';
85 | } else {
86 | todayClass='';
87 | }
88 |
89 | // use UTC function; see above for explanation.
90 | if (isSelectedMonth && currentDay == selected.getUTCDate()) {
91 | if (todayClass != '') todayClass += " ";
92 | todayClass += "selected";
93 | }
94 |
95 | var cell = quickElement('td', tableRow, '', 'class', todayClass);
96 |
97 | quickElement('a', cell, currentDay, 'href', 'javascript:void(' + callback + '('+year+','+month+','+currentDay+'));');
98 | currentDay++;
99 | }
100 |
101 | // Draw blanks after end of month (optional, but makes for valid code)
102 | while (tableRow.childNodes.length < 7) {
103 | var _cell = quickElement('td', tableRow, ' ');
104 | _cell.className = "nonday";
105 | }
106 |
107 | calDiv.appendChild(calTable);
108 | }
109 | }
110 |
111 | // Calendar -- A calendar instance
112 | function Calendar(div_id, callback, selected) {
113 | // div_id (string) is the ID of the element in which the calendar will
114 | // be displayed
115 | // callback (string) is the name of a JavaScript function that will be
116 | // called with the parameters (year, month, day) when a day in the
117 | // calendar is clicked
118 | this.div_id = div_id;
119 | this.callback = callback;
120 | this.today = new Date();
121 | this.currentMonth = this.today.getMonth() + 1;
122 | this.currentYear = this.today.getFullYear();
123 | if (typeof selected != 'undefined') {
124 | this.selected = selected;
125 | }
126 | }
127 | Calendar.prototype = {
128 | drawCurrent: function() {
129 | CalendarNamespace.draw(this.currentMonth, this.currentYear, this.div_id, this.callback, this.selected);
130 | },
131 | drawDate: function(month, year, selected) {
132 | this.currentMonth = month;
133 | this.currentYear = year;
134 |
135 | if(selected) {
136 | this.selected = selected;
137 | }
138 |
139 | this.drawCurrent();
140 | },
141 | drawPreviousMonth: function() {
142 | if (this.currentMonth == 1) {
143 | this.currentMonth = 12;
144 | this.currentYear--;
145 | }
146 | else {
147 | this.currentMonth--;
148 | }
149 | this.drawCurrent();
150 | },
151 | drawNextMonth: function() {
152 | if (this.currentMonth == 12) {
153 | this.currentMonth = 1;
154 | this.currentYear++;
155 | }
156 | else {
157 | this.currentMonth++;
158 | }
159 | this.drawCurrent();
160 | },
161 | drawPreviousYear: function() {
162 | this.currentYear--;
163 | this.drawCurrent();
164 | },
165 | drawNextYear: function() {
166 | this.currentYear++;
167 | this.drawCurrent();
168 | }
169 | }
170 |
--------------------------------------------------------------------------------
/static/static_root/admin/js/collapse.js:
--------------------------------------------------------------------------------
1 | (function($) {
2 | $(document).ready(function() {
3 | // Add anchor tag for Show/Hide link
4 | $("fieldset.collapse").each(function(i, elem) {
5 | // Don't hide if fields in this fieldset have errors
6 | if ($(elem).find("div.errors").length == 0) {
7 | $(elem).addClass("collapsed").find("h2").first().append(' (