David Beltra 7 months ago
commit
22a0d7672c
100 changed files with 36130 additions and 0 deletions
  1. 40
    0
      .gitignore
  2. 0
    0
      apps/blocks/__init__.py
  3. 43
    0
      apps/blocks/admin.py
  4. 43
    0
      apps/blocks/migrations/0001_initial.py
  5. 36
    0
      apps/blocks/migrations/0002_auto_20180906_0832.py
  6. 19
    0
      apps/blocks/migrations/0003_remove_homeblock_content.py
  7. 38
    0
      apps/blocks/migrations/0004_addressblock.py
  8. 25
    0
      apps/blocks/migrations/0005_auto_20180906_1302.py
  9. 34
    0
      apps/blocks/migrations/0006_auto_20180906_1306.py
  10. 35
    0
      apps/blocks/migrations/0007_auto_20180906_1307.py
  11. 41
    0
      apps/blocks/migrations/0008_auto_20180907_0819.py
  12. 0
    0
      apps/blocks/migrations/__init__.py
  13. 45
    0
      apps/blocks/models.py
  14. 36
    0
      apps/blocks/translation.py
  15. 0
    0
      apps/components/__init__.py
  16. 0
    0
      apps/components/button/__init__.py
  17. 27
    0
      apps/components/button/migrations/0001_initial.py
  18. 22
    0
      apps/components/button/migrations/0002_button_home_block.py
  19. 20
    0
      apps/components/button/migrations/0003_button_info_text.py
  20. 21
    0
      apps/components/button/migrations/0004_auto_20180904_1334.py
  21. 26
    0
      apps/components/button/migrations/0005_auto_20180904_1335.py
  22. 19
    0
      apps/components/button/migrations/0006_remove_button_info_text.py
  23. 0
    0
      apps/components/button/migrations/__init__.py
  24. 13
    0
      apps/components/button/models.py
  25. 11
    0
      apps/components/button/translation.py
  26. 0
    0
      apps/components/icon/__init__.py
  27. 27
    0
      apps/components/icon/migrations/0001_initial.py
  28. 0
    0
      apps/components/icon/migrations/__init__.py
  29. 10
    0
      apps/components/icon/models.py
  30. 11
    0
      apps/components/icon/translation.py
  31. 0
    0
      apps/nominations/__init__.py
  32. 104
    0
      apps/nominations/templates/pages/nominierungen.html
  33. 15
    0
      apps/nominations/urls.py
  34. 72
    0
      apps/nominations/views.py
  35. 0
    0
      apps/pep_theme/__init__.py
  36. 49
    0
      apps/pep_theme/admin_mixins.py
  37. 9
    0
      apps/pep_theme/context_processors.py
  38. 0
    0
      apps/pep_theme/static/__init__.py
  39. 27
    0
      apps/pep_theme/static/bower.json
  40. 37
    0
      apps/pep_theme/static/bower_components/jquery-i18n/.bower.json
  41. 35
    0
      apps/pep_theme/static/bower_components/jquery-i18n/Gruntfile.js
  42. 19
    0
      apps/pep_theme/static/bower_components/jquery-i18n/LICENSE
  43. 159
    0
      apps/pep_theme/static/bower_components/jquery-i18n/README.md
  44. 23
    0
      apps/pep_theme/static/bower_components/jquery-i18n/SpecRunner.html
  45. 23
    0
      apps/pep_theme/static/bower_components/jquery-i18n/bower.json
  46. 81
    0
      apps/pep_theme/static/bower_components/jquery-i18n/examples/index.html
  47. 6240
    0
      apps/pep_theme/static/bower_components/jquery-i18n/examples/jquery-1.4.2.js
  48. 120
    0
      apps/pep_theme/static/bower_components/jquery-i18n/jquery.i18n.js
  49. 1
    0
      apps/pep_theme/static/bower_components/jquery-i18n/jquery.i18n.min.js
  50. 20
    0
      apps/pep_theme/static/bower_components/jquery-i18n/lib/jasmine-1.2.0/MIT.LICENSE
  51. 616
    0
      apps/pep_theme/static/bower_components/jquery-i18n/lib/jasmine-1.2.0/jasmine-html.js
  52. 81
    0
      apps/pep_theme/static/bower_components/jquery-i18n/lib/jasmine-1.2.0/jasmine.css
  53. 2529
    0
      apps/pep_theme/static/bower_components/jquery-i18n/lib/jasmine-1.2.0/jasmine.js
  54. 17
    0
      apps/pep_theme/static/bower_components/jquery-i18n/package.json
  55. 83
    0
      apps/pep_theme/static/bower_components/jquery-i18n/specs/jquery.i18n.spec.js
  56. 120
    0
      apps/pep_theme/static/bower_components/jquery-i18n/src/jquery.i18n.js
  57. 25
    0
      apps/pep_theme/static/bower_components/jquery/.bower.json
  58. 313
    0
      apps/pep_theme/static/bower_components/jquery/AUTHORS.txt
  59. 36
    0
      apps/pep_theme/static/bower_components/jquery/LICENSE.txt
  60. 67
    0
      apps/pep_theme/static/bower_components/jquery/README.md
  61. 14
    0
      apps/pep_theme/static/bower_components/jquery/bower.json
  62. 399
    0
      apps/pep_theme/static/bower_components/jquery/dist/core.js
  63. 10364
    0
      apps/pep_theme/static/bower_components/jquery/dist/jquery.js
  64. 2
    0
      apps/pep_theme/static/bower_components/jquery/dist/jquery.min.js
  65. 1
    0
      apps/pep_theme/static/bower_components/jquery/dist/jquery.min.map
  66. 8269
    0
      apps/pep_theme/static/bower_components/jquery/dist/jquery.slim.js
  67. 2
    0
      apps/pep_theme/static/bower_components/jquery/dist/jquery.slim.min.js
  68. 1
    0
      apps/pep_theme/static/bower_components/jquery/dist/jquery.slim.min.map
  69. 36
    0
      apps/pep_theme/static/bower_components/jquery/external/sizzle/LICENSE.txt
  70. 2272
    0
      apps/pep_theme/static/bower_components/jquery/external/sizzle/dist/sizzle.js
  71. 3
    0
      apps/pep_theme/static/bower_components/jquery/external/sizzle/dist/sizzle.min.js
  72. 1
    0
      apps/pep_theme/static/bower_components/jquery/external/sizzle/dist/sizzle.min.map
  73. 5
    0
      apps/pep_theme/static/bower_components/jquery/src/.eslintrc.json
  74. 856
    0
      apps/pep_theme/static/bower_components/jquery/src/ajax.js
  75. 103
    0
      apps/pep_theme/static/bower_components/jquery/src/ajax/jsonp.js
  76. 77
    0
      apps/pep_theme/static/bower_components/jquery/src/ajax/load.js
  77. 30
    0
      apps/pep_theme/static/bower_components/jquery/src/ajax/parseXML.js
  78. 77
    0
      apps/pep_theme/static/bower_components/jquery/src/ajax/script.js
  79. 5
    0
      apps/pep_theme/static/bower_components/jquery/src/ajax/var/location.js
  80. 5
    0
      apps/pep_theme/static/bower_components/jquery/src/ajax/var/nonce.js
  81. 5
    0
      apps/pep_theme/static/bower_components/jquery/src/ajax/var/rquery.js
  82. 170
    0
      apps/pep_theme/static/bower_components/jquery/src/ajax/xhr.js
  83. 13
    0
      apps/pep_theme/static/bower_components/jquery/src/attributes.js
  84. 141
    0
      apps/pep_theme/static/bower_components/jquery/src/attributes/attr.js
  85. 186
    0
      apps/pep_theme/static/bower_components/jquery/src/attributes/classes.js
  86. 143
    0
      apps/pep_theme/static/bower_components/jquery/src/attributes/prop.js
  87. 33
    0
      apps/pep_theme/static/bower_components/jquery/src/attributes/support.js
  88. 191
    0
      apps/pep_theme/static/bower_components/jquery/src/attributes/val.js
  89. 236
    0
      apps/pep_theme/static/bower_components/jquery/src/callbacks.js
  90. 399
    0
      apps/pep_theme/static/bower_components/jquery/src/core.js
  91. 30
    0
      apps/pep_theme/static/bower_components/jquery/src/core/DOMEval.js
  92. 72
    0
      apps/pep_theme/static/bower_components/jquery/src/core/access.js
  93. 23
    0
      apps/pep_theme/static/bower_components/jquery/src/core/camelCase.js
  94. 129
    0
      apps/pep_theme/static/bower_components/jquery/src/core/init.js
  95. 13
    0
      apps/pep_theme/static/bower_components/jquery/src/core/nodeName.js
  96. 65
    0
      apps/pep_theme/static/bower_components/jquery/src/core/parseHTML.js
  97. 97
    0
      apps/pep_theme/static/bower_components/jquery/src/core/ready-no-deferred.js
  98. 86
    0
      apps/pep_theme/static/bower_components/jquery/src/core/ready.js
  99. 13
    0
      apps/pep_theme/static/bower_components/jquery/src/core/readyException.js
  100. 0
    0
      apps/pep_theme/static/bower_components/jquery/src/core/stripAndCollapse.js

+ 40
- 0
.gitignore View File

@@ -0,0 +1,40 @@
1
+#bower_components
2
+node_modules
3
+
4
+# Ignore automatically generated cruft
5
+*.log
6
+.sass-cache
7
+
8
+
9
+# Operating system files
10
+.Spotlight-V100
11
+.Trashes
12
+.DS_Store
13
+.DS_Store?
14
+ehthumbs.db
15
+Thumbs.db
16
+
17
+#PYC
18
+*.pyc
19
+
20
+#VIRTUALENV
21
+.env
22
+.venv
23
+env/
24
+venv/
25
+ENV/
26
+env.bak/
27
+venv.bak/
28
+
29
+# django static (collected by django)
30
+/static
31
+
32
+#local db, must run migrations on production to sync
33
+dev.db
34
+
35
+#credentials
36
+credentials.sh
37
+
38
+#local settings
39
+**/local_settings.py
40
+**/local_urls.py

+ 0
- 0
apps/blocks/__init__.py View File


+ 43
- 0
apps/blocks/admin.py View File

@@ -0,0 +1,43 @@
1
+from copy import deepcopy
2
+from django.contrib import admin
3
+from mezzanine.core.admin import ContentTypedAdmin
4
+from mezzanine.pages.admin import PageAdmin
5
+from apps.components.icon.models import Icon
6
+from apps.components.button.models import Button
7
+from .models import ContentBlock, HomeBlock, AddressBlock
8
+
9
+
10
+class IconInline(admin.StackedInline):
11
+    model = Icon
12
+    extra = 0
13
+
14
+
15
+class ButtonInline(admin.StackedInline):
16
+    model = Button
17
+    extra = 0
18
+
19
+
20
+class ContentBlockAdmin(PageAdmin, ContentTypedAdmin):
21
+    inlines = [
22
+        IconInline,
23
+        ButtonInline,
24
+    ]
25
+
26
+
27
+admin.site.register(ContentBlock, ContentBlockAdmin)
28
+
29
+
30
+class HomeBlockAdmin(PageAdmin, ContentTypedAdmin):
31
+    inlines = [
32
+        ButtonInline,
33
+    ]
34
+
35
+
36
+admin.site.register(HomeBlock, HomeBlockAdmin)
37
+
38
+
39
+class AddressBlockAdmin(PageAdmin, ContentTypedAdmin):
40
+    pass
41
+
42
+
43
+admin.site.register(AddressBlock, AddressBlockAdmin)

+ 43
- 0
apps/blocks/migrations/0001_initial.py View File

@@ -0,0 +1,43 @@
1
+# -*- coding: utf-8 -*-
2
+# Generated by Django 1.11.15 on 2018-09-04 12:53
3
+from __future__ import unicode_literals
4
+
5
+from django.db import migrations, models
6
+import django.db.models.deletion
7
+import mezzanine.core.fields
8
+
9
+
10
+class Migration(migrations.Migration):
11
+
12
+    initial = True
13
+
14
+    dependencies = [
15
+        ('pages', '0004_auto_20170411_0504'),
16
+    ]
17
+
18
+    operations = [
19
+        migrations.CreateModel(
20
+            name='ContentBlock',
21
+            fields=[
22
+                ('page_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='pages.Page')),
23
+                ('content', mezzanine.core.fields.RichTextField(verbose_name='Content')),
24
+                ('background', models.ImageField(blank=True, upload_to='backgrounds', verbose_name='Background')),
25
+            ],
26
+            options={
27
+                'ordering': ('_order',),
28
+            },
29
+            bases=('pages.page', models.Model),
30
+        ),
31
+        migrations.CreateModel(
32
+            name='HomeBlock',
33
+            fields=[
34
+                ('page_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='pages.Page')),
35
+                ('content', mezzanine.core.fields.RichTextField(verbose_name='Content')),
36
+                ('image', models.ImageField(blank=True, upload_to='images', verbose_name='Image')),
37
+            ],
38
+            options={
39
+                'ordering': ('_order',),
40
+            },
41
+            bases=('pages.page', models.Model),
42
+        ),
43
+    ]

+ 36
- 0
apps/blocks/migrations/0002_auto_20180906_0832.py View File

@@ -0,0 +1,36 @@
1
+# -*- coding: utf-8 -*-
2
+# Generated by Django 1.11.15 on 2018-09-06 08:32
3
+from __future__ import unicode_literals
4
+
5
+from django.db import migrations, models
6
+import mezzanine.core.fields
7
+
8
+
9
+class Migration(migrations.Migration):
10
+
11
+    dependencies = [
12
+        ('blocks', '0001_initial'),
13
+    ]
14
+
15
+    operations = [
16
+        migrations.AddField(
17
+            model_name='homeblock',
18
+            name='button_text_1',
19
+            field=mezzanine.core.fields.RichTextField(blank=True, max_length=500, null=True, verbose_name='Button text 1'),
20
+        ),
21
+        migrations.AddField(
22
+            model_name='homeblock',
23
+            name='button_text_2',
24
+            field=mezzanine.core.fields.RichTextField(blank=True, max_length=500, null=True, verbose_name='Button text 2'),
25
+        ),
26
+        migrations.AddField(
27
+            model_name='homeblock',
28
+            name='header',
29
+            field=models.CharField(blank=True, max_length=500, null=True, verbose_name='Header'),
30
+        ),
31
+        migrations.AddField(
32
+            model_name='homeblock',
33
+            name='providers',
34
+            field=mezzanine.core.fields.RichTextField(blank=True, max_length=500, null=True, verbose_name='Providers'),
35
+        ),
36
+    ]

+ 19
- 0
apps/blocks/migrations/0003_remove_homeblock_content.py View File

@@ -0,0 +1,19 @@
1
+# -*- coding: utf-8 -*-
2
+# Generated by Django 1.11.15 on 2018-09-06 09:00
3
+from __future__ import unicode_literals
4
+
5
+from django.db import migrations
6
+
7
+
8
+class Migration(migrations.Migration):
9
+
10
+    dependencies = [
11
+        ('blocks', '0002_auto_20180906_0832'),
12
+    ]
13
+
14
+    operations = [
15
+        migrations.RemoveField(
16
+            model_name='homeblock',
17
+            name='content',
18
+        ),
19
+    ]

+ 38
- 0
apps/blocks/migrations/0004_addressblock.py View File

@@ -0,0 +1,38 @@
1
+# -*- coding: utf-8 -*-
2
+# Generated by Django 1.11.15 on 2018-09-06 12:34
3
+from __future__ import unicode_literals
4
+
5
+from django.db import migrations, models
6
+import django.db.models.deletion
7
+import mezzanine.core.fields
8
+
9
+
10
+class Migration(migrations.Migration):
11
+
12
+    dependencies = [
13
+        ('pages', '0004_auto_20170411_0504'),
14
+        ('blocks', '0003_remove_homeblock_content'),
15
+    ]
16
+
17
+    operations = [
18
+        migrations.CreateModel(
19
+            name='AddressBlock',
20
+            fields=[
21
+                ('page_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='pages.Page')),
22
+                ('map_left', models.CharField(blank=True, help_text='https://www.openstreetmap.org/export', max_length=500, null=True, verbose_name='Map left')),
23
+                ('map_top', models.CharField(blank=True, max_length=500, null=True, verbose_name='Map top')),
24
+                ('map_right', models.CharField(blank=True, max_length=500, null=True, verbose_name='Map right')),
25
+                ('map_bottom', models.CharField(blank=True, max_length=500, null=True, verbose_name='Map bottom')),
26
+                ('marker_lat', models.CharField(blank=True, max_length=500, null=True, verbose_name='Marker Latitude')),
27
+                ('marker_long', models.CharField(blank=True, max_length=500, null=True, verbose_name='Marker Longitude')),
28
+                ('image', models.ImageField(blank=True, upload_to='images', verbose_name='Image')),
29
+                ('company', models.CharField(blank=True, max_length=500, null=True, verbose_name='Company')),
30
+                ('address', mezzanine.core.fields.RichTextField(blank=True, max_length=500, null=True, verbose_name='Address')),
31
+                ('text_description', mezzanine.core.fields.RichTextField(blank=True, max_length=500, null=True, verbose_name='Description')),
32
+            ],
33
+            options={
34
+                'ordering': ('_order',),
35
+            },
36
+            bases=('pages.page',),
37
+        ),
38
+    ]

+ 25
- 0
apps/blocks/migrations/0005_auto_20180906_1302.py View File

@@ -0,0 +1,25 @@
1
+# -*- coding: utf-8 -*-
2
+# Generated by Django 1.11.15 on 2018-09-06 13:02
3
+from __future__ import unicode_literals
4
+
5
+from django.db import migrations
6
+
7
+
8
+class Migration(migrations.Migration):
9
+
10
+    dependencies = [
11
+        ('blocks', '0004_addressblock'),
12
+    ]
13
+
14
+    operations = [
15
+        migrations.RenameField(
16
+            model_name='homeblock',
17
+            old_name='button_text_1',
18
+            new_name='text_1',
19
+        ),
20
+        migrations.RenameField(
21
+            model_name='homeblock',
22
+            old_name='button_text_2',
23
+            new_name='text_2',
24
+        ),
25
+    ]

+ 34
- 0
apps/blocks/migrations/0006_auto_20180906_1306.py View File

@@ -0,0 +1,34 @@
1
+# -*- coding: utf-8 -*-
2
+# Generated by Django 1.11.15 on 2018-09-06 13:06
3
+from __future__ import unicode_literals
4
+
5
+from django.db import migrations
6
+import mezzanine.core.fields
7
+
8
+
9
+class Migration(migrations.Migration):
10
+
11
+    dependencies = [
12
+        ('blocks', '0005_auto_20180906_1302'),
13
+    ]
14
+
15
+    operations = [
16
+        migrations.RemoveField(
17
+            model_name='homeblock',
18
+            name='text_1',
19
+        ),
20
+        migrations.RemoveField(
21
+            model_name='homeblock',
22
+            name='text_2',
23
+        ),
24
+        migrations.AddField(
25
+            model_name='homeblock',
26
+            name='text_10',
27
+            field=mezzanine.core.fields.RichTextField(blank=True, max_length=500, null=True, verbose_name='Text 1'),
28
+        ),
29
+        migrations.AddField(
30
+            model_name='homeblock',
31
+            name='text_20',
32
+            field=mezzanine.core.fields.RichTextField(blank=True, max_length=500, null=True, verbose_name='Text 2'),
33
+        ),
34
+    ]

+ 35
- 0
apps/blocks/migrations/0007_auto_20180906_1307.py View File

@@ -0,0 +1,35 @@
1
+# -*- coding: utf-8 -*-
2
+# Generated by Django 1.11.15 on 2018-09-06 13:07
3
+from __future__ import unicode_literals
4
+
5
+from django.db import migrations
6
+import mezzanine.core.fields
7
+
8
+
9
+class Migration(migrations.Migration):
10
+
11
+    dependencies = [
12
+        ('blocks', '0006_auto_20180906_1306'),
13
+    ]
14
+
15
+    operations = [
16
+        migrations.RenameField(
17
+            model_name='homeblock',
18
+            old_name='text_10',
19
+            new_name='text_1',
20
+        ),
21
+        migrations.RenameField(
22
+            model_name='homeblock',
23
+            old_name='text_20',
24
+            new_name='text_2',
25
+        ),
26
+        migrations.RemoveField(
27
+            model_name='homeblock',
28
+            name='providers',
29
+        ),
30
+        migrations.AddField(
31
+            model_name='homeblock',
32
+            name='text_3',
33
+            field=mezzanine.core.fields.RichTextField(blank=True, max_length=500, null=True, verbose_name='Text 3'),
34
+        ),
35
+    ]

+ 41
- 0
apps/blocks/migrations/0008_auto_20180907_0819.py View File

@@ -0,0 +1,41 @@
1
+# -*- coding: utf-8 -*-
2
+# Generated by Django 1.11.15 on 2018-09-07 08:19
3
+from __future__ import unicode_literals
4
+
5
+from django.db import migrations
6
+import mezzanine.core.fields
7
+
8
+
9
+class Migration(migrations.Migration):
10
+
11
+    dependencies = [
12
+        ('blocks', '0007_auto_20180906_1307'),
13
+    ]
14
+
15
+    operations = [
16
+        migrations.AlterField(
17
+            model_name='addressblock',
18
+            name='address',
19
+            field=mezzanine.core.fields.RichTextField(blank=True, null=True, verbose_name='Address'),
20
+        ),
21
+        migrations.AlterField(
22
+            model_name='addressblock',
23
+            name='text_description',
24
+            field=mezzanine.core.fields.RichTextField(blank=True, null=True, verbose_name='Description'),
25
+        ),
26
+        migrations.AlterField(
27
+            model_name='homeblock',
28
+            name='text_1',
29
+            field=mezzanine.core.fields.RichTextField(blank=True, null=True, verbose_name='Text 1'),
30
+        ),
31
+        migrations.AlterField(
32
+            model_name='homeblock',
33
+            name='text_2',
34
+            field=mezzanine.core.fields.RichTextField(blank=True, null=True, verbose_name='Text 2'),
35
+        ),
36
+        migrations.AlterField(
37
+            model_name='homeblock',
38
+            name='text_3',
39
+            field=mezzanine.core.fields.RichTextField(blank=True, null=True, verbose_name='Text 3'),
40
+        ),
41
+    ]

+ 0
- 0
apps/blocks/migrations/__init__.py View File


+ 45
- 0
apps/blocks/models.py View File

@@ -0,0 +1,45 @@
1
+from django.db import models
2
+from mezzanine.core.models import RichText
3
+from mezzanine.pages.models import Page
4
+from django.utils.translation import ugettext, ugettext_lazy as _
5
+from mezzanine.core.fields import RichTextField
6
+
7
+
8
+class ContentBlock(Page, RichText):
9
+    background = models.ImageField(
10
+        _("Background"), upload_to="backgrounds", blank=True)
11
+
12
+
13
+class HomeBlock(Page):
14
+    image = models.ImageField(_("Image"), upload_to="images", blank=True)
15
+    header = models.CharField(
16
+        _("Header"), max_length=500, blank=True, null=True)
17
+    text_1 = RichTextField(_("Text 1"), blank=True, null=True)
18
+    text_2 = RichTextField(_("Text 2"), blank=True, null=True)
19
+    text_3 = RichTextField(_("Text 3"), blank=True, null=True)
20
+
21
+
22
+class AddressBlock(Page):
23
+
24
+    map_left = models.CharField(_("Map left"), max_length=500, blank=True, null=True,
25
+                                help_text="https://www.openstreetmap.org/export")
26
+
27
+    map_top = models.CharField(
28
+        _("Map top"), max_length=500, blank=True, null=True)
29
+    map_right = models.CharField(
30
+        _("Map right"), max_length=500, blank=True, null=True)
31
+    map_bottom = models.CharField(
32
+        _("Map bottom"), max_length=500, blank=True, null=True)
33
+
34
+    marker_lat = models.CharField(
35
+        _("Marker Latitude"), max_length=500, blank=True, null=True)
36
+    marker_long = models.CharField(
37
+        _("Marker Longitude"), max_length=500, blank=True, null=True)
38
+
39
+    image = models.ImageField(_("Image"), upload_to="images", blank=True)
40
+
41
+    company = models.CharField(
42
+        _("Company"), max_length=500, blank=True, null=True)
43
+
44
+    address = RichTextField(_("Address"), blank=True, null=True)
45
+    text_description = RichTextField(_("Description"), blank=True, null=True)

+ 36
- 0
apps/blocks/translation.py View File

@@ -0,0 +1,36 @@
1
+from modeltranslation.translator import translator, TranslationOptions
2
+from mezzanine.core.translation import (
3
+    TranslatedDisplayable,
4
+    TranslatedRichText,
5
+)
6
+from .models import (
7
+    ContentBlock,
8
+    HomeBlock,
9
+    AddressBlock,
10
+)
11
+
12
+
13
+class TranslatedContent(TranslatedRichText):
14
+    fields = ()
15
+
16
+
17
+class TranslatedHome(TranslationOptions):
18
+    fields = (
19
+        'header',
20
+        'text_1',
21
+        'text_2',
22
+        'text_3',
23
+    )
24
+
25
+
26
+class TranslatedAddress(TranslationOptions):
27
+    fields = (
28
+        'company',
29
+        'address',
30
+        'text_description',
31
+    )
32
+
33
+
34
+translator.register(ContentBlock, TranslatedContent)
35
+translator.register(HomeBlock, TranslatedHome)
36
+translator.register(AddressBlock, TranslatedAddress)

+ 0
- 0
apps/components/__init__.py View File


+ 0
- 0
apps/components/button/__init__.py View File


+ 27
- 0
apps/components/button/migrations/0001_initial.py View File

@@ -0,0 +1,27 @@
1
+# -*- coding: utf-8 -*-
2
+# Generated by Django 1.11.15 on 2018-09-04 12:53
3
+from __future__ import unicode_literals
4
+
5
+from django.db import migrations, models
6
+import django.db.models.deletion
7
+
8
+
9
+class Migration(migrations.Migration):
10
+
11
+    initial = True
12
+
13
+    dependencies = [
14
+        ('blocks', '0001_initial'),
15
+    ]
16
+
17
+    operations = [
18
+        migrations.CreateModel(
19
+            name='Button',
20
+            fields=[
21
+                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
22
+                ('text', models.CharField(max_length=500, verbose_name='Text')),
23
+                ('url', models.CharField(max_length=500, verbose_name='URL')),
24
+                ('block', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='blocks.ContentBlock')),
25
+            ],
26
+        ),
27
+    ]

+ 22
- 0
apps/components/button/migrations/0002_button_home_block.py View File

@@ -0,0 +1,22 @@
1
+# -*- coding: utf-8 -*-
2
+# Generated by Django 1.11.15 on 2018-09-04 13:03
3
+from __future__ import unicode_literals
4
+
5
+from django.db import migrations, models
6
+import django.db.models.deletion
7
+
8
+
9
+class Migration(migrations.Migration):
10
+
11
+    dependencies = [
12
+        ('blocks', '0001_initial'),
13
+        ('button', '0001_initial'),
14
+    ]
15
+
16
+    operations = [
17
+        migrations.AddField(
18
+            model_name='button',
19
+            name='home_block',
20
+            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='blocks.HomeBlock'),
21
+        ),
22
+    ]

+ 20
- 0
apps/components/button/migrations/0003_button_info_text.py View File

@@ -0,0 +1,20 @@
1
+# -*- coding: utf-8 -*-
2
+# Generated by Django 1.11.15 on 2018-09-04 13:20
3
+from __future__ import unicode_literals
4
+
5
+from django.db import migrations, models
6
+
7
+
8
+class Migration(migrations.Migration):
9
+
10
+    dependencies = [
11
+        ('button', '0002_button_home_block'),
12
+    ]
13
+
14
+    operations = [
15
+        migrations.AddField(
16
+            model_name='button',
17
+            name='info_text',
18
+            field=models.CharField(blank=True, max_length=500, null=True, verbose_name='Info text'),
19
+        ),
20
+    ]

+ 21
- 0
apps/components/button/migrations/0004_auto_20180904_1334.py View File

@@ -0,0 +1,21 @@
1
+# -*- coding: utf-8 -*-
2
+# Generated by Django 1.11.15 on 2018-09-04 13:34
3
+from __future__ import unicode_literals
4
+
5
+from django.db import migrations
6
+import mezzanine.core.fields
7
+
8
+
9
+class Migration(migrations.Migration):
10
+
11
+    dependencies = [
12
+        ('button', '0003_button_info_text'),
13
+    ]
14
+
15
+    operations = [
16
+        migrations.AlterField(
17
+            model_name='button',
18
+            name='text',
19
+            field=mezzanine.core.fields.RichTextField(max_length=500, verbose_name='Text'),
20
+        ),
21
+    ]

+ 26
- 0
apps/components/button/migrations/0005_auto_20180904_1335.py View File

@@ -0,0 +1,26 @@
1
+# -*- coding: utf-8 -*-
2
+# Generated by Django 1.11.15 on 2018-09-04 13:35
3
+from __future__ import unicode_literals
4
+
5
+from django.db import migrations, models
6
+import mezzanine.core.fields
7
+
8
+
9
+class Migration(migrations.Migration):
10
+
11
+    dependencies = [
12
+        ('button', '0004_auto_20180904_1334'),
13
+    ]
14
+
15
+    operations = [
16
+        migrations.AlterField(
17
+            model_name='button',
18
+            name='info_text',
19
+            field=mezzanine.core.fields.RichTextField(blank=True, max_length=500, null=True, verbose_name='Info text'),
20
+        ),
21
+        migrations.AlterField(
22
+            model_name='button',
23
+            name='text',
24
+            field=models.CharField(max_length=500, verbose_name='Text'),
25
+        ),
26
+    ]

+ 19
- 0
apps/components/button/migrations/0006_remove_button_info_text.py View File

@@ -0,0 +1,19 @@
1
+# -*- coding: utf-8 -*-
2
+# Generated by Django 1.11.15 on 2018-09-06 08:46
3
+from __future__ import unicode_literals
4
+
5
+from django.db import migrations
6
+
7
+
8
+class Migration(migrations.Migration):
9
+
10
+    dependencies = [
11
+        ('button', '0005_auto_20180904_1335'),
12
+    ]
13
+
14
+    operations = [
15
+        migrations.RemoveField(
16
+            model_name='button',
17
+            name='info_text',
18
+        ),
19
+    ]

+ 0
- 0
apps/components/button/migrations/__init__.py View File


+ 13
- 0
apps/components/button/models.py View File

@@ -0,0 +1,13 @@
1
+from django.db import models
2
+from apps.blocks.models import ContentBlock, HomeBlock
3
+from django.utils.translation import ugettext, ugettext_lazy as _
4
+from mezzanine.core.fields import RichTextField
5
+
6
+
7
+class Button(models.Model):
8
+    block = models.ForeignKey(
9
+        ContentBlock, on_delete=models.CASCADE, blank=True, null=True)
10
+    home_block = models.ForeignKey(
11
+        HomeBlock, on_delete=models.CASCADE, blank=True, null=True)
12
+    text = models.CharField(_("Text"), max_length=500)
13
+    url = models.CharField(_("URL"), max_length=500)

+ 11
- 0
apps/components/button/translation.py View File

@@ -0,0 +1,11 @@
1
+from modeltranslation.translator import translator, TranslationOptions
2
+from .models import Button
3
+
4
+
5
+class TranslatedButton(TranslationOptions):
6
+    fields = (
7
+        'text',
8
+    )
9
+
10
+
11
+translator.register(Button, TranslatedButton)

+ 0
- 0
apps/components/icon/__init__.py View File


+ 27
- 0
apps/components/icon/migrations/0001_initial.py View File

@@ -0,0 +1,27 @@
1
+# -*- coding: utf-8 -*-
2
+# Generated by Django 1.11.15 on 2018-09-04 12:53
3
+from __future__ import unicode_literals
4
+
5
+from django.db import migrations, models
6
+import django.db.models.deletion
7
+
8
+
9
+class Migration(migrations.Migration):
10
+
11
+    initial = True
12
+
13
+    dependencies = [
14
+        ('blocks', '0001_initial'),
15
+    ]
16
+
17
+    operations = [
18
+        migrations.CreateModel(
19
+            name='Icon',
20
+            fields=[
21
+                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
22
+                ('icon', models.ImageField(upload_to='icons', verbose_name='Icon')),
23
+                ('text', models.CharField(blank=True, max_length=500, verbose_name='Text')),
24
+                ('block', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='blocks.ContentBlock')),
25
+            ],
26
+        ),
27
+    ]

+ 0
- 0
apps/components/icon/migrations/__init__.py View File


+ 10
- 0
apps/components/icon/models.py View File

@@ -0,0 +1,10 @@
1
+from django.db import models
2
+from apps.blocks.models import ContentBlock
3
+from django.utils.translation import ugettext, ugettext_lazy as _
4
+
5
+
6
+class Icon(models.Model):
7
+    block = models.ForeignKey(
8
+        ContentBlock, on_delete=models.CASCADE, blank=True, null=True)
9
+    icon = models.ImageField(_("Icon"), upload_to="icons")
10
+    text = models.CharField(_("Text"), max_length=500, blank=True)

+ 11
- 0
apps/components/icon/translation.py View File

@@ -0,0 +1,11 @@
1
+from modeltranslation.translator import translator, TranslationOptions
2
+from .models import Icon
3
+
4
+
5
+class TranslatedIcon(TranslationOptions):
6
+    fields = (
7
+        'text',
8
+    )
9
+
10
+
11
+translator.register(Icon, TranslatedIcon)

+ 0
- 0
apps/nominations/__init__.py View File


+ 104
- 0
apps/nominations/templates/pages/nominierungen.html View File

@@ -0,0 +1,104 @@
1
+{% extends "pages/richtextpage.html" %}
2
+{% load i18n mezzanine_tags pages_tags %}
3
+
4
+{% block main %}
5
+
6
+{% editable page.get_content_model.content %}
7
+{{page.get_content_model.content|safe}}
8
+{% endeditable %}
9
+
10
+{% nevercache %}
11
+{% if messages %}
12
+    {% for message in messages %}
13
+        {% if message.extra_tags == 'general' %}
14
+            <p class="alert alert-{{ message.level_tag }}">{{message}}</p>
15
+        {% endif %}
16
+    {% endfor %}
17
+{% endif %}
18
+{% endnevercache %}
19
+
20
+<form id="nominations-form" class="mezzanine-form" method="post" action="/nominierungen/">
21
+
22
+    {% csrf_token %}
23
+
24
+    <div class="form-group input_id_nominated charfield">
25
+        <label class="control-label" for="id_nominated">{% trans "Nominiert wird" %}</label>
26
+        <input type="text" name="nominated" maxlength="2000" required="" id="id_nominated">
27
+        <p class="help-block">{% trans "Name, Adresse, Tel. Nr, Webseite etc." %}</p>
28
+        {% nevercache %}
29
+        {% if messages %}
30
+            {% for message in messages %}
31
+                {% if message.extra_tags == 'nominated' %}
32
+                    <p class="alert alert-{{ message.level_tag }}">{{message}}</p>
33
+                {% endif %}
34
+            {% endfor %}
35
+        {% endif %}
36
+        {% endnevercache %}
37
+    </div>
38
+
39
+    <div class="form-group input_id_reasons_nomination charfield">
40
+        <label class="control-label" for="id_reasons_nomination">{% trans "Grund der Nominierung" %}</label>
41
+        <textarea name="reasons_nomination" cols="40" rows="10" maxlength="2000" required="" id="id_reasons_nomination" class="input-xlarge"></textarea>
42
+        <p class="help-block">{% trans "Begründung; welcher Personenkreis ist von den Eingriffen/der Kontrolle besonders betroffen; Quellen, Presseartikel, Dokumente, URLs" %}</p>
43
+        {% nevercache %}
44
+        {% if messages %}
45
+            {% for message in messages %}
46
+                {% if message.extra_tags == 'reasons_nomination' %}
47
+                    <p class="alert alert-{{ message.level_tag }}">{{message}}</p>
48
+                {% endif %}
49
+            {% endfor %}
50
+        {% endif %}
51
+        {% endnevercache %}
52
+    </div>
53
+
54
+    <div class="form-group input_id_name charfield">
55
+        <label class="control-label" for="id_name">{% trans "Ihr Name" %}</label>
56
+        <input type="text" name="name" maxlength="2000" id="id_name">
57
+    </div>
58
+
59
+    <div class="form-group input_id_email emailfield">
60
+        <label class="control-label" for="id_email">{% trans "Ihre E-Mail-Adresse" %}</label>
61
+        <input type="email" name="email" id="id_email">
62
+
63
+        {% nevercache %}
64
+        {% if messages %}
65
+            {% for message in messages %}
66
+                {% if message.extra_tags == 'email' %}
67
+                    <p class="alert alert-{{ message.level_tag }}">{{message}}</p>
68
+                {% endif %}
69
+            {% endfor %}
70
+        {% endif %}
71
+        {% endnevercache %}
72
+    </div>
73
+
74
+
75
+    <p>{% trans "Bitte tragen Sie mich in Ihren Newsletter ein:" %}</p>
76
+
77
+    <span class="subscriptions">
78
+        <div class="form-group input_id_sk booleanfield">
79
+            <input type="checkbox" name="sk" id="id_sk">
80
+            <label class="control-label" for="id_sk">{% trans "Stiftung für Konsumentenschutz" %}</label>
81
+        </div>
82
+
83
+        <div class="form-group input_id_dg booleanfield">
84
+            <input type="checkbox" name="dg" id="id_dg">
85
+            <label class="control-label" for="id_dg">{% trans "Digitale Gesellschaft" %}</label>
86
+        </div>
87
+
88
+        <div class="form-group input_id_pep booleanfield">
89
+            <input type="checkbox" name="pep" id="id_pep">
90
+            <label class="control-label" for="id_pep">{% trans "p≡p Foundation" %}</label>
91
+        </div>
92
+
93
+        <div class="form-group input_id_ccc booleanfield">
94
+            <input type="checkbox" name="ccc" id="id_ccc">
95
+            <label class="control-label" for="id_ccc">{% trans "Chaos Computer Club Schweiz (CCC-CH)" %}</label>
96
+        </div>
97
+    </span>
98
+
99
+    <div class="form-actions">
100
+        <input class="btn btn-primary btn-lg" type="submit" value="Nominieren">
101
+    </div>
102
+</form>
103
+
104
+{% endblock %}

+ 15
- 0
apps/nominations/urls.py View File

@@ -0,0 +1,15 @@
1
+from __future__ import unicode_literals
2
+from django.conf import settings
3
+
4
+from django.conf.urls import url, include
5
+
6
+from . import views
7
+
8
+
9
+# Trailing slahes for urlpatterns based on setup.
10
+_slash = "/" if settings.APPEND_SLASH else ""
11
+
12
+# Blog patterns.
13
+urlpatterns = [
14
+    # url(r"^$", views.sendNomination, name="send-nomination"),
15
+]

+ 72
- 0
apps/nominations/views.py View File

@@ -0,0 +1,72 @@
1
+from django.http import HttpResponseRedirect
2
+from django.contrib import messages 
3
+from django.core.mail import send_mail, EmailMessage
4
+from django.utils.translation import ugettext, ugettext_lazy as _
5
+
6
+from mezzanine.pages.page_processors import processor_for
7
+from mezzanine.pages.models import Page
8
+import re
9
+
10
+EMAIL_REGEX = re.compile(r"[^@]+@[^@]+\.[^@]+")
11
+
12
+@processor_for("nominierungen")
13
+def sendNomination(request, page=None):
14
+    print('HOLA')
15
+
16
+    if request.method == 'POST':
17
+        print(request.POST)
18
+
19
+        page = Page.objects.get(slug="nominierungen")
20
+        form_valid = True
21
+
22
+        email = request.POST.get('email')
23
+        nominated = request.POST.get('nominated')
24
+        reasons_nomination = request.POST.get('reasons_nomination')
25
+
26
+        # if email != "" and not EMAIL_REGEX.match(email):
27
+        if not EMAIL_REGEX.match(email):
28
+            form_valid = False
29
+            messages.error(request, str(_('Ungültige E-Mail')), extra_tags='email')
30
+
31
+        if nominated == '':
32
+            form_valid = False
33
+            messages.error(request, str(_('Pflichtfeld')), extra_tags='nominated')
34
+
35
+        if reasons_nomination == '':
36
+            form_valid = False
37
+            messages.error(request, str(_('Pflichtfeld')), extra_tags='reasons_nomination')
38
+
39
+        if form_valid:
40
+            is_valid = True
41
+
42
+            try:
43
+
44
+                subject = 'Nomination sumbitted'
45
+                message = 'Nominated: ' + nominated + ' Reasons: ' + reasons_nomination
46
+                from_email = email
47
+                recipient_list = ['dbe@pep.security']
48
+
49
+                email = EmailMessage(subject, message, from_email, recipient_list)
50
+                email.send()
51
+
52
+            except Exception:
53
+                messages.error(request, str(_('Fehler beim Senden des Formulars')), extra_tags='general')
54
+                is_valid = False
55
+
56
+            if request.POST.get('sk') == 'on':
57
+                print('email Stiftung für Konsumentenschutz')
58
+
59
+            if request.POST.get('dg') == 'on':
60
+                print('email Digitale Gesellschaft')
61
+
62
+            if request.POST.get('pep') == 'on':
63
+                print('email pEp')
64
+
65
+            if request.POST.get('ccc') == 'on':
66
+                print('email CCC')
67
+
68
+            if is_valid:
69
+                return HttpResponseRedirect('/danke/')
70
+
71
+    print('MESSAGES:')
72
+    print(messages)

+ 0
- 0
apps/pep_theme/__init__.py View File


+ 49
- 0
apps/pep_theme/admin_mixins.py View File

@@ -0,0 +1,49 @@
1
+from django.contrib.auth.models import Group
2
+
3
+
4
+def user_readonly(request):
5
+    if Group.objects.filter(name="readonly").count() > 0:
6
+        readonly_group = Group.objects.get(name="readonly")
7
+        if readonly_group in request.user.groups.all():
8
+            return True
9
+        else:
10
+            return False
11
+    else:
12
+        return False
13
+
14
+
15
+class ReadOnlyMixin(object):
16
+    def get_readonly_fields(self, request, obj=None):
17
+        if user_readonly(request):
18
+            if obj != None:
19
+                print(obj)
20
+                all_fields = obj._meta.get_fields(
21
+                    include_parents=False, include_hidden=False)
22
+                all_field_names = []
23
+                for field in all_fields:
24
+                    if field.concrete:
25
+                        all_field_names.append(field.name)
26
+                return all_field_names
27
+        else:
28
+            return []
29
+
30
+    def has_add_permission(self, request):
31
+        if user_readonly(request):
32
+            return False
33
+        else:
34
+            return True
35
+
36
+    def has_delete_permission(self, request, obj=None):
37
+        if user_readonly(request):
38
+            return False
39
+        else:
40
+            return True
41
+
42
+    def get_actions(self, request):
43
+        actions = super().get_actions(request)
44
+        if user_readonly(request):
45
+            actions = None
46
+        return actions
47
+
48
+    def __init__(self, *args, **kwargs):
49
+        super(ReadOnlyMixin, self).__init__(*args, **kwargs)

+ 9
- 0
apps/pep_theme/context_processors.py View File

@@ -0,0 +1,9 @@
1
+from mezzanine.pages.models import Page
2
+
3
+def footer(request):
4
+    footer_page = Page.objects.get(id=13)
5
+    return {'footer_page': footer_page}
6
+
7
+def navbar(request):
8
+    navbar_page = Page.objects.get(id=11)
9
+    return {'navbar_page': navbar_page}

+ 0
- 0
apps/pep_theme/static/__init__.py View File


+ 27
- 0
apps/pep_theme/static/bower.json View File

@@ -0,0 +1,27 @@
1
+{
2
+  "name": "pep",
3
+  "description": "",
4
+  "main": "index.html",
5
+  "authors": [
6
+    "jakubwrycza.pl"
7
+  ],
8
+  "license": "ISC",
9
+  "homepage": "",
10
+  "ignore": [
11
+    "**/.*",
12
+    "node_modules",
13
+    "bower_components",
14
+    "test",
15
+    "tests"
16
+  ],
17
+  "dependencies": {
18
+    "swiper": "^4.2.2",
19
+    "jquery": "^3.3.1",
20
+    "masonry-layout": "^4.2.1",
21
+    "jquery-i18n": "^1.1.2"
22
+  },
23
+  "devDependencies": {
24
+    "masonry-layout": "^4.2.1",
25
+    "jquery-i18n": "^1.1.2"
26
+  }
27
+}

+ 37
- 0
apps/pep_theme/static/bower_components/jquery-i18n/.bower.json View File

@@ -0,0 +1,37 @@
1
+{
2
+  "name": "jquery-i18n",
3
+  "version": "1.1.2",
4
+  "homepage": "https://github.com/recurser/jquery-i18n",
5
+  "authors": [
6
+    "Dave Perrett <hello@daveperrett.com>"
7
+  ],
8
+  "description": "A jQuery plugin for doing client-side translations in javascript.",
9
+  "main": "jquery.i18n.js",
10
+  "keywords": [
11
+    "jquery",
12
+    "i18n",
13
+    "translation"
14
+  ],
15
+  "license": "MIT",
16
+  "ignore": [
17
+    "**/.*",
18
+    "node_modules",
19
+    "bower_components",
20
+    "test",
21
+    "tests"
22
+  ],
23
+  "_release": "1.1.2",
24
+  "_resolution": {
25
+    "type": "version",
26
+    "tag": "v1.1.2",
27
+    "commit": "401f28b4ed9165689551eac123131b39a0845a37"
28
+  },
29
+  "_source": "https://github.com/recurser/jquery-i18n.git",
30
+  "_target": "^1.1.2",
31
+<<<<<<< HEAD
32
+  "_originalSource": "jquery-i18n",
33
+  "_direct": true
34
+=======
35
+  "_originalSource": "jquery-i18n"
36
+>>>>>>> 067c97801de6912e5313a5f84b465ec9231a0bfb
37
+}

+ 35
- 0
apps/pep_theme/static/bower_components/jquery-i18n/Gruntfile.js View File

@@ -0,0 +1,35 @@
1
+
2
+module.exports = function(grunt) {
3
+
4
+  grunt.initConfig({
5
+    meta: {
6
+      date: (new Date()).toUTCString()
7
+    },
8
+    pkg: grunt.file.readJSON('package.json'),
9
+    uglify: {
10
+      dist: {
11
+        src: 'jquery.i18n.js',
12
+        dest: 'jquery.i18n.min.js'
13
+      }
14
+    }
15
+  });
16
+
17
+  grunt.registerTask('build', function() {
18
+    var content = grunt.file.read('src/jquery.i18n.js', 'utf-8');
19
+    var output = grunt.template.process(content);
20
+    grunt.file.write('jquery.i18n.js', output);
21
+    grunt.log.ok('File jquery.i18n.js created.');
22
+  });
23
+
24
+  // update bower version
25
+  grunt.registerTask('bower', function() {
26
+    var pkg = grunt.file.readJSON('package.json');
27
+    var bower = grunt.file.readJSON('bower.json');
28
+    bower.version = pkg.version;
29
+    grunt.file.write('bower.json', JSON.stringify(bower, null, 2));
30
+  });
31
+
32
+  grunt.registerTask('default', ['build', 'uglify']);
33
+
34
+  grunt.loadNpmTasks('grunt-contrib-uglify');
35
+};

+ 19
- 0
apps/pep_theme/static/bower_components/jquery-i18n/LICENSE View File

@@ -0,0 +1,19 @@
1
+Copyright (c) 2010 Dave Perrett, http://recursive-design.com/
2
+
3
+Permission is hereby granted, free of charge, to any person obtaining a copy
4
+of this software and associated documentation files (the "Software"), to deal
5
+in the Software without restriction, including without limitation the rights
6
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+copies of the Software, and to permit persons to whom the Software is
8
+furnished to do so, subject to the following conditions:
9
+
10
+The above copyright notice and this permission notice shall be included in
11
+all copies or substantial portions of the Software.
12
+
13
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
+THE SOFTWARE.

+ 159
- 0
apps/pep_theme/static/bower_components/jquery-i18n/README.md View File

@@ -0,0 +1,159 @@
1
+
2
+About
3
+-----
4
+
5
+_jQuery-i18n_ is a jQuery plugin for doing client-side translations in javascript. It is based heavily on [javascript i18n that almost doesn't suck](http://markos.gaivo.net/blog/?p=100) by Marko Samastur, and is licensed under the [MIT license](http://www.opensource.org/licenses/mit-license.php).
6
+
7
+Installation
8
+------------
9
+
10
+You'll need to download the [jQuery library](http://docs.jquery.com/Downloading_jQuery#Current_Release), and include it before _jquery.i18n.js_ in your HTML source. See the _examples_ folder for examples.
11
+
12
+This library is also available as a [bower](http://bower.io/) component under the name *jquery-i18n*.
13
+
14
+Usage
15
+-----
16
+
17
+Before you can do any translation you have to initialise the plugin with a 'dictionary' (basically a property list mapping keys to their translations).
18
+
19
+```javascript
20
+var myDictionary = {
21
+  "some text":      "a translation",
22
+  "some more text": "another translation"
23
+}
24
+$.i18n.load(myDictionary);
25
+```
26
+
27
+Once you've initialised it with a dictionary, you can translate strings using the $.i18n._() function, for example:
28
+
29
+```javascript
30
+$('div#example').text($.i18n._('some text'));
31
+```
32
+
33
+or using $('selector')._t() function
34
+
35
+```javascript
36
+$('div#example')._t('some text');
37
+```
38
+
39
+If you'd like to switch languages, you can unload the current dictionary and load a new one:
40
+
41
+```javascript
42
+$.i18n.load('en');
43
+$.i18n.unload();
44
+$.i18n.load('ja');
45
+```
46
+
47
+Wildcards
48
+---------
49
+
50
+It's straightforward to pass dynamic data into your translations. First, add _%s_ in the translation for each variable you want to swap in :
51
+
52
+```javascript
53
+var myDictionary = {
54
+  "wildcard example": "We have been passed two values : %s and %s."
55
+}
56
+$.i18n.load(myDictionary);
57
+```
58
+
59
+Next, pass values in sequence after the dictionary key when you perform the translation :
60
+
61
+```javascript
62
+$('div#example').text($.i18n._('wildcard example', 100, 200));
63
+```
64
+
65
+or
66
+
67
+```javascript
68
+$('div#example')._t('wildcard example', 100, 200);
69
+```
70
+
71
+This will output _We have been passed two values : 100 and 200._
72
+
73
+Because some languages will need to order arguments differently to english, you can also specify the order in which the variables appear :
74
+
75
+```javascript
76
+var myDictionary = {
77
+  "wildcard example": "We have been passed two values : %2$s and %1$s."
78
+}
79
+$.i18n.load(myDictionary);
80
+
81
+$('div#example').text($.i18n._('wildcard example', 100, 200));
82
+```
83
+
84
+This will output: _We have been passed two values: 200 and 100._
85
+
86
+If you need to explicitly output the string _%s_ in your translation, use _%%s_ :
87
+
88
+```javascript
89
+var myDictionary = {
90
+  "wildcard example": "I have %s literal %%s character."
91
+}
92
+$.i18n.load(myDictionary);
93
+
94
+$('div#example').text($.i18n._('wildcard example', 1));
95
+```
96
+
97
+This will output: _I have 1 literal %%s character._
98
+
99
+
100
+Identifying missing translations
101
+---------
102
+
103
+When loading the dictionary, you can pass a second `missingPattern` parameter, which will be used to format any missing translations.
104
+
105
+```javascript
106
+$.i18n.load({ a_key: 'translated string' }, "{{ %s }}");
107
+// The following line will output '{{ another_key }}'
108
+$.i18n._('another_key')
109
+```
110
+
111
+This allows you scan for the given pattern to identify missing translations.
112
+
113
+
114
+Building From Scratch
115
+---------------------
116
+
117
+Use `npm install` to install the dependencies, and `grunt` to run the build.
118
+
119
+
120
+Change history
121
+-----------
122
+
123
+* **Version 1.1.2 (2017-08-11)** : Add an `unload()` method to clear the dictionary, support passing a `missingPattern` when loading the dictionary (thanks to [briantani](https://github.com/briantani)).
124
+* **Version 1.1.1 (2014-01-05)** : Use `html()` instead of `text()` when rendering translations.
125
+* **Version 1.1.0 (2013-12-31)** : Use grunt, update `printf` implementation, `setDictionary` is now `load` (thanks to [ktmud](https://github.com/ktmud)).
126
+* **Version 1.0.1 (2013-10-11)** : Add bower support.
127
+* **Version 1.0.0 (2012-10-14)** : 1.0 release - addition of a test suite (huge thanks to [alexaitken](https://github.com/alexaitken)), plus a major cleanup.
128
+
129
+Bug Reports
130
+-----------
131
+
132
+If you come across any problems, please [create a ticket](https://github.com/recurser/jquery-i18n/issues) and we'll try to get it fixed as soon as possible.
133
+
134
+
135
+Contributing
136
+------------
137
+
138
+Once you've made your commits:
139
+
140
+1. [Fork](http://help.github.com/fork-a-repo/) jquery-i18n
141
+2. Create a topic branch - `git checkout -b my_branch`
142
+3. Push to your branch - `git push origin my_branch`
143
+4. Create a [Pull Request](http://help.github.com/pull-requests/) from your branch
144
+5. That's it!
145
+
146
+
147
+Author
148
+------
149
+
150
+Dave Perrett :: hello@daveperrett.com :: [@daveperrett](http://twitter.com/daveperrett)
151
+
152
+
153
+Copyright
154
+---------
155
+
156
+Copyright (c) 2010 Dave Perrett. See [License](https://github.com/recurser/jquery-i18n/blob/master/LICENSE) for details.
157
+
158
+
159
+

+ 23
- 0
apps/pep_theme/static/bower_components/jquery-i18n/SpecRunner.html View File

@@ -0,0 +1,23 @@
1
+<!doctype html>
2
+<html>
3
+<head>
4
+  <title>jasmine-sinon specs</title>
5
+  <link rel="stylesheet" href="lib/jasmine-1.2.0/jasmine.css">
6
+  <script src="lib/jasmine-1.2.0/jasmine.js"></script>
7
+  <script src="lib/jasmine-1.2.0/jasmine-html.js"></script>
8
+
9
+  <script src="examples/jquery-1.4.2.js"></script>
10
+
11
+  <script src="src/jquery.i18n.js"></script>
12
+  <script src="specs/jquery.i18n.spec.js"></script>
13
+
14
+</head>
15
+<body>
16
+
17
+<script type="text/javascript">
18
+  jasmine.getEnv().addReporter(new jasmine.TrivialReporter());
19
+  jasmine.getEnv().execute();
20
+</script>
21
+
22
+</body>
23
+</html>

+ 23
- 0
apps/pep_theme/static/bower_components/jquery-i18n/bower.json View File

@@ -0,0 +1,23 @@
1
+{
2
+  "name": "jquery-i18n",
3
+  "version": "1.1.2",
4
+  "homepage": "https://github.com/recurser/jquery-i18n",
5
+  "authors": [
6
+    "Dave Perrett <hello@daveperrett.com>"
7
+  ],
8
+  "description": "A jQuery plugin for doing client-side translations in javascript.",
9
+  "main": "jquery.i18n.js",
10
+  "keywords": [
11
+    "jquery",
12
+    "i18n",
13
+    "translation"
14
+  ],
15
+  "license": "MIT",
16
+  "ignore": [
17
+    "**/.*",
18
+    "node_modules",
19
+    "bower_components",
20
+    "test",
21
+    "tests"
22
+  ]
23
+}

+ 81
- 0
apps/pep_theme/static/bower_components/jquery-i18n/examples/index.html View File

@@ -0,0 +1,81 @@
1
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2
+<html xmlns="http://www.w3.org/1999/xhtml">
3
+<head>
4
+<meta http-equiv="Content-Type" content="text/html; charset=utf8" />
5
+<title>jQuery i18n Plugin</title>
6
+<script type="text/javascript" src="jquery-1.4.2.js"></script>
7
+<script type="text/javascript" src="../jquery.i18n.min.js"></script>
8
+
9
+<script  type="text/javascript">
10
+$(document).ready(function(){
11
+	i18n_dict = {
12
+		"Example 1"  							: "teiän veen",
13
+		"Example 2"  							: "tei'än ve'en",
14
+		"Example 3"  							: "teiä vede",
15
+		"Example 4"  							: "teirän veren",
16
+		"Example 5"  							: "teilän velen",
17
+		"Example 6"  							: "teijjän vejen",
18
+		"Example 7"  							: "teidän veden",
19
+		"Example 8"  							: "teitän veten",
20
+		"Example 9"  							: "teiðän veðen",
21
+		"Example 10" 							: "teidhän vethen",
22
+		"Dynamic Content" 				: "Your browser window is %s x %s",
23
+		"Ordered Dynamic Content" : "%2$s is the height of your browser window, and %1$s is the width.",
24
+		"HTML Content"            : "Your browser window is <b><i>%s</i></b> x <b><i>%s</i></b>"
25
+	};
26
+
27
+	$.i18n.load(i18n_dict);
28
+
29
+	$('input#translate_button').click( function(event) {
30
+		$('div#example1')._t('Example 1');
31
+		$('div#example2')._t('Example 2');
32
+		$('div#example3')._t('Example 3');
33
+		$('div#example4')._t('Example 4');
34
+		$('div#example5')._t('Example 5');
35
+		$('div#example6')._t('Example 6');
36
+		$('div#example7')._t('Example 7');
37
+		$('div#example8')._t('Example 8');
38
+		$('div#example9')._t('Example 9');
39
+		$('div#example10')._t('Example 10');
40
+		$('div#dynamic')._t('Dynamic Content', $(document).width(), $(document).height());
41
+		$('div#orderedDynamic')._t('Ordered Dynamic Content', $(document).width(), $(document).height());
42
+		$('div#html')._t('HTML Content', $(document).width(), $(document).height());
43
+	});
44
+});
45
+</script>
46
+<style type="text/css">
47
+	body {
48
+		font-size: 30px;
49
+		text-align: center;
50
+	}
51
+	input {
52
+		font-size: 30px;
53
+	}
54
+	p {
55
+		font-size: 17px;
56
+	}
57
+</style>
58
+
59
+<body>
60
+	<p>
61
+		Click the button to translate the following text into some random Finnish from the
62
+		<a href='http://en.wikipedia.org/wiki/Finnish_phonology'>Wikipedia Finnish Phonology Article</a>
63
+	</p>
64
+
65
+	<div id='example1'>Example 1</div>
66
+	<div id='example2'>Example 2</div>
67
+	<div id='example3'>Example 3</div>
68
+	<div id='example4'>Example 4</div>
69
+	<div id='example5'>Example 5</div>
70
+	<div id='example6'>Example 6</div>
71
+	<div id='example7'>Example 7</div>
72
+	<div id='example8'>Example 8</div>
73
+	<div id='example9'>Example 9</div>
74
+	<div id='example10'>Example 10</div>
75
+	<div id='dynamic'>Dynamic Content</div>
76
+	<div id='orderedDynamic'>Ordered Dynamic Content</div>
77
+	<div id='html'>HTML Content</div>
78
+
79
+	<input type='button' id='translate_button' value='Internationalize!' />
80
+</body>
81
+</html>

+ 6240
- 0
apps/pep_theme/static/bower_components/jquery-i18n/examples/jquery-1.4.2.js
File diff suppressed because it is too large
View File


+ 120
- 0
apps/pep_theme/static/bower_components/jquery-i18n/jquery.i18n.js View File

@@ -0,0 +1,120 @@
1
+/*!
2
+ * jQuery i18n plugin
3
+ * @requires jQuery v1.1 or later
4
+ *
5
+ * See https://github.com/recurser/jquery-i18n
6
+ *
7
+ * Licensed under the MIT license.
8
+ *
9
+ * Version: 1.1.2 (Fri, 11 Aug 2017 03:52:21 GMT)
10
+ */
11
+(function($) {
12
+  /**
13
+   * i18n provides a mechanism for translating strings using a jscript dictionary.
14
+   *
15
+   */
16
+
17
+  var __slice = Array.prototype.slice;
18
+
19
+  /*
20
+   * i18n property list
21
+   */
22
+  var i18n = {
23
+
24
+    dict: null,
25
+    missingPattern: null,
26
+
27
+    /**
28
+     * load()
29
+     *
30
+     * Load translations.
31
+     *
32
+     * @param  property_list i18nDict : The dictionary to use for translation.
33
+     */
34
+    load: function(i18nDict, missingPattern) {
35
+      if (this.dict !== null) {
36
+        $.extend(this.dict, i18nDict);
37
+      } else {
38
+        this.dict = i18nDict;
39
+      }
40
+
41
+      if (missingPattern) {
42
+        this.missingPattern = missingPattern;
43
+      }
44
+    },
45
+
46
+    /**
47
+     * unload()
48
+     *
49
+     * Unloads translations and clears the dictionary.
50
+     */
51
+    unload: function() {
52
+      this.dict           = null;
53
+      this.missingPattern = null;
54
+    },
55
+
56
+    /**
57
+     * _()
58
+     *
59
+     * Looks the given string up in the dictionary and returns the translation if
60
+     * one exists. If a translation is not found, returns the original word.
61
+     *
62
+     * @param  string str           : The string to translate.
63
+     * @param  property_list params.. : params for using printf() on the string.
64
+     *
65
+     * @return string               : Translated word.
66
+     */
67
+    _: function (str) {
68
+      dict = this.dict;
69
+      if (dict && dict.hasOwnProperty(str)) {
70
+        str = dict[str];
71
+      } else if (this.missingPattern !== null) {
72
+        return this.printf(this.missingPattern, str);
73
+      }
74
+      args = __slice.call(arguments);
75
+      args[0] = str;
76
+      // Substitute any params.
77
+      return this.printf.apply(this, args);
78
+    },
79
+
80
+    /*
81
+     * printf()
82
+     *
83
+     * Substitutes %s with parameters given in list. %%s is used to escape %s.
84
+     *
85
+     * @param  string str    : String to perform printf on.
86
+     * @param  string args   : Array of arguments for printf.
87
+     *
88
+     * @return string result : Substituted string
89
+     */
90
+    printf: function(str, args) {
91
+      if (arguments.length < 2) return str;
92
+      args = $.isArray(args) ? args : __slice.call(arguments, 1);
93
+      return str.replace(/([^%]|^)%(?:(\d+)\$)?s/g, function(p0, p, position) {
94
+        if (position) {
95
+          return p + args[parseInt(position)-1];
96
+        }
97
+        return p + args.shift();
98
+      }).replace(/%%s/g, '%s');
99
+    }
100
+
101
+  };
102
+
103
+  /*
104
+   * _t()
105
+   *
106
+   * Allows you to translate a jQuery selector.
107
+   *
108
+   * eg $('h1')._t('some text')
109
+   *
110
+   * @param  string str           : The string to translate .
111
+   * @param  property_list params : Params for using printf() on the string.
112
+   *
113
+   * @return element              : Chained and translated element(s).
114
+  */
115
+  $.fn._t = function(str, params) {
116
+    return $(this).html(i18n._.apply(i18n, arguments));
117
+  };
118
+
119
+  $.i18n = i18n;
120
+})(jQuery);

+ 1
- 0
apps/pep_theme/static/bower_components/jquery-i18n/jquery.i18n.min.js View File

@@ -0,0 +1 @@
1
+!function(a){var b=Array.prototype.slice,c={dict:null,missingPattern:null,load:function(b,c){null!==this.dict?a.extend(this.dict,b):this.dict=b,c&&(this.missingPattern=c)},unload:function(){this.dict=null,this.missingPattern=null},_:function(a){if(dict=this.dict,dict&&dict.hasOwnProperty(a))a=dict[a];else if(null!==this.missingPattern)return this.printf(this.missingPattern,a);return args=b.call(arguments),args[0]=a,this.printf.apply(this,args)},printf:function(c,d){return arguments.length<2?c:(d=a.isArray(d)?d:b.call(arguments,1),c.replace(/([^%]|^)%(?:(\d+)\$)?s/g,function(a,b,c){return c?b+d[parseInt(c)-1]:b+d.shift()}).replace(/%%s/g,"%s"))}};a.fn._t=function(){return a(this).html(c._.apply(c,arguments))},a.i18n=c}(jQuery);

+ 20
- 0
apps/pep_theme/static/bower_components/jquery-i18n/lib/jasmine-1.2.0/MIT.LICENSE View File

@@ -0,0 +1,20 @@
1
+Copyright (c) 2008-2011 Pivotal Labs
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.

+ 616
- 0
apps/pep_theme/static/bower_components/jquery-i18n/lib/jasmine-1.2.0/jasmine-html.js View File

@@ -0,0 +1,616 @@
1
+jasmine.HtmlReporterHelpers = {};
2
+
3
+jasmine.HtmlReporterHelpers.createDom = function(type, attrs, childrenVarArgs) {
4
+  var el = document.createElement(type);
5
+
6
+  for (var i = 2; i < arguments.length; i++) {
7
+    var child = arguments[i];
8
+
9
+    if (typeof child === 'string') {
10
+      el.appendChild(document.createTextNode(child));
11
+    } else {
12
+      if (child) {
13
+        el.appendChild(child);
14
+      }
15
+    }
16
+  }
17
+
18
+  for (var attr in attrs) {
19
+    if (attr == "className") {
20
+      el[attr] = attrs[attr];
21
+    } else {
22
+      el.setAttribute(attr, attrs[attr]);
23
+    }
24
+  }
25
+
26
+  return el;
27
+};
28
+
29
+jasmine.HtmlReporterHelpers.getSpecStatus = function(child) {
30
+  var results = child.results();
31
+  var status = results.passed() ? 'passed' : 'failed';
32
+  if (results.skipped) {
33
+    status = 'skipped';
34
+  }
35
+
36
+  return status;
37
+};
38
+
39
+jasmine.HtmlReporterHelpers.appendToSummary = function(child, childElement) {
40
+  var parentDiv = this.dom.summary;
41
+  var parentSuite = (typeof child.parentSuite == 'undefined') ? 'suite' : 'parentSuite';
42
+  var parent = child[parentSuite];
43
+
44
+  if (parent) {
45
+    if (typeof this.views.suites[parent.id] == 'undefined') {
46
+      this.views.suites[parent.id] = new jasmine.HtmlReporter.SuiteView(parent, this.dom, this.views);
47
+    }
48
+    parentDiv = this.views.suites[parent.id].element;
49
+  }
50
+
51
+  parentDiv.appendChild(childElement);
52
+};
53
+
54
+
55
+jasmine.HtmlReporterHelpers.addHelpers = function(ctor) {
56
+  for(var fn in jasmine.HtmlReporterHelpers) {
57
+    ctor.prototype[fn] = jasmine.HtmlReporterHelpers[fn];
58
+  }
59
+};
60
+
61
+jasmine.HtmlReporter = function(_doc) {
62
+  var self = this;
63
+  var doc = _doc || window.document;
64
+
65
+  var reporterView;
66
+
67
+  var dom = {};
68
+
69
+  // Jasmine Reporter Public Interface
70
+  self.logRunningSpecs = false;
71
+
72
+  self.reportRunnerStarting = function(runner) {
73
+    var specs = runner.specs() || [];
74
+
75
+    if (specs.length == 0) {
76
+      return;
77
+    }
78
+
79
+    createReporterDom(runner.env.versionString());
80
+    doc.body.appendChild(dom.reporter);
81
+
82
+    reporterView = new jasmine.HtmlReporter.ReporterView(dom);
83
+    reporterView.addSpecs(specs, self.specFilter);
84
+  };
85
+
86
+  self.reportRunnerResults = function(runner) {
87
+    reporterView && reporterView.complete();
88
+  };
89
+
90
+  self.reportSuiteResults = function(suite) {
91
+    reporterView.suiteComplete(suite);
92
+  };
93
+
94
+  self.reportSpecStarting = function(spec) {
95
+    if (self.logRunningSpecs) {
96
+      self.log('>> Jasmine Running ' + spec.suite.description + ' ' + spec.description + '...');
97
+    }
98
+  };
99
+
100
+  self.reportSpecResults = function(spec) {
101
+    reporterView.specComplete(spec);
102
+  };
103
+
104
+  self.log = function() {
105
+    var console = jasmine.getGlobal().console;
106
+    if (console && console.log) {
107
+      if (console.log.apply) {
108
+        console.log.apply(console, arguments);
109
+      } else {
110
+        console.log(arguments); // ie fix: console.log.apply doesn't exist on ie
111
+      }
112
+    }
113
+  };
114
+
115
+  self.specFilter = function(spec) {
116
+    if (!focusedSpecName()) {
117
+      return true;
118
+    }
119
+
120
+    return spec.getFullName().indexOf(focusedSpecName()) === 0;
121
+  };
122
+
123
+  return self;
124
+
125
+  function focusedSpecName() {
126
+    var specName;
127
+
128
+    (function memoizeFocusedSpec() {
129
+      if (specName) {
130
+        return;
131
+      }
132
+
133
+      var paramMap = [];
134
+      var params = doc.location.search.substring(1).split('&');
135
+
136
+      for (var i = 0; i < params.length; i++) {
137
+        var p = params[i].split('=');
138
+        paramMap[decodeURIComponent(p[0])] = decodeURIComponent(p[1]);
139
+      }
140
+
141
+      specName = paramMap.spec;
142
+    })();
143
+
144
+    return specName;
145
+  }
146
+
147
+  function createReporterDom(version) {
148
+    dom.reporter = self.createDom('div', { id: 'HTMLReporter', className: 'jasmine_reporter' },
149
+      dom.banner = self.createDom('div', { className: 'banner' },
150
+        self.createDom('span', { className: 'title' }, "Jasmine "),
151
+        self.createDom('span', { className: 'version' }, version)),
152
+
153
+      dom.symbolSummary = self.createDom('ul', {className: 'symbolSummary'}),
154
+      dom.alert = self.createDom('div', {className: 'alert'}),
155
+      dom.results = self.createDom('div', {className: 'results'},
156
+        dom.summary = self.createDom('div', { className: 'summary' }),
157
+        dom.details = self.createDom('div', { id: 'details' }))
158
+    );
159
+  }
160
+};
161
+jasmine.HtmlReporterHelpers.addHelpers(jasmine.HtmlReporter);jasmine.HtmlReporter.ReporterView = function(dom) {
162
+  this.startedAt = new Date();
163
+  this.runningSpecCount = 0;
164
+  this.completeSpecCount = 0;
165
+  this.passedCount = 0;
166
+  this.failedCount = 0;
167
+  this.skippedCount = 0;
168
+
169
+  this.createResultsMenu = function() {
170
+    this.resultsMenu = this.createDom('span', {className: 'resultsMenu bar'},
171
+      this.summaryMenuItem = this.createDom('a', {className: 'summaryMenuItem', href: "#"}, '0 specs'),
172
+      ' | ',
173
+      this.detailsMenuItem = this.createDom('a', {className: 'detailsMenuItem', href: "#"}, '0 failing'));
174
+
175
+    this.summaryMenuItem.onclick = function() {
176
+      dom.reporter.className = dom.reporter.className.replace(/ showDetails/g, '');
177
+    };
178
+
179
+    this.detailsMenuItem.onclick = function() {
180
+      showDetails();
181
+    };
182
+  };
183
+
184
+  this.addSpecs = function(specs, specFilter) {
185
+    this.totalSpecCount = specs.length;
186
+
187
+    this.views = {
188
+      specs: {},
189
+      suites: {}
190
+    };
191
+
192
+    for (var i = 0; i < specs.length; i++) {
193
+      var spec = specs[i];
194
+      this.views.specs[spec.id] = new jasmine.HtmlReporter.SpecView(spec, dom, this.views);
195
+      if (specFilter(spec)) {
196
+        this.runningSpecCount++;
197
+      }
198
+    }
199
+  };
200
+
201
+  this.specComplete = function(spec) {
202
+    this.completeSpecCount++;
203
+
204
+    if (isUndefined(this.views.specs[spec.id])) {
205
+      this.views.specs[spec.id] = new jasmine.HtmlReporter.SpecView(spec, dom);
206
+    }
207
+
208
+    var specView = this.views.specs[spec.id];
209
+
210
+    switch (specView.status()) {
211
+      case 'passed':
212
+        this.passedCount++;
213
+        break;
214
+
215
+      case 'failed':
216
+        this.failedCount++;
217
+        break;
218
+
219
+      case 'skipped':
220
+        this.skippedCount++;
221
+        break;
222
+    }
223
+
224
+    specView.refresh();
225
+    this.refresh();
226
+  };
227
+
228
+  this.suiteComplete = function(suite) {
229
+    var suiteView = this.views.suites[suite.id];
230
+    if (isUndefined(suiteView)) {
231
+      return;
232
+    }
233
+    suiteView.refresh();
234
+  };
235
+
236
+  this.refresh = function() {
237
+
238
+    if (isUndefined(this.resultsMenu)) {
239
+      this.createResultsMenu();
240
+    }
241
+
242
+    // currently running UI
243
+    if (isUndefined(this.runningAlert)) {
244
+      this.runningAlert = this.createDom('a', {href: "?", className: "runningAlert bar"});
245
+      dom.alert.appendChild(this.runningAlert);
246
+    }
247
+    this.runningAlert.innerHTML = "Running " + this.completeSpecCount + " of " + specPluralizedFor(this.totalSpecCount);
248
+
249
+    // skipped specs UI
250
+    if (isUndefined(this.skippedAlert)) {
251
+      this.skippedAlert = this.createDom('a', {href: "?", className: "skippedAlert bar"});
252
+    }
253
+
254
+    this.skippedAlert.innerHTML = "Skipping " + this.skippedCount + " of " + specPluralizedFor(this.totalSpecCount) + " - run all";
255
+
256
+    if (this.skippedCount === 1 && isDefined(dom.alert)) {
257
+      dom.alert.appendChild(this.skippedAlert);
258
+    }
259
+
260
+    // passing specs UI
261
+    if (isUndefined(this.passedAlert)) {
262
+      this.passedAlert = this.createDom('span', {href: "?", className: "passingAlert bar"});
263
+    }
264
+    this.passedAlert.innerHTML = "Passing " + specPluralizedFor(this.passedCount);
265
+
266
+    // failing specs UI
267
+    if (isUndefined(this.failedAlert)) {
268
+      this.failedAlert = this.createDom('span', {href: "?", className: "failingAlert bar"});
269
+    }
270
+    this.failedAlert.innerHTML = "Failing " + specPluralizedFor(this.failedCount);
271
+
272
+    if (this.failedCount === 1 && isDefined(dom.alert)) {
273
+      dom.alert.appendChild(this.failedAlert);
274
+      dom.alert.appendChild(this.resultsMenu);
275
+    }
276
+
277
+    // summary info
278
+    this.summaryMenuItem.innerHTML = "" + specPluralizedFor(this.runningSpecCount);
279
+    this.detailsMenuItem.innerHTML = "" + this.failedCount + " failing";
280
+  };
281
+
282
+  this.complete = function() {
283
+    dom.alert.removeChild(this.runningAlert);
284
+
285
+    this.skippedAlert.innerHTML = "Ran " + this.runningSpecCount + " of " + specPluralizedFor(this.totalSpecCount) + " - run all";
286
+
287
+    if (this.failedCount === 0) {
288
+      dom.alert.appendChild(this.createDom('span', {className: 'passingAlert bar'}, "Passing " + specPluralizedFor(this.passedCount)));
289
+    } else {
290
+      showDetails();
291
+    }
292
+
293
+    dom.banner.appendChild(this.createDom('span', {className: 'duration'}, "finished in " + ((new Date().getTime() - this.startedAt.getTime()) / 1000) + "s"));
294
+  };
295
+
296
+  return this;
297
+
298
+  function showDetails() {
299
+    if (dom.reporter.className.search(/showDetails/) === -1) {
300
+      dom.reporter.className += " showDetails";
301
+    }
302
+  }
303
+
304
+  function isUndefined(obj) {
305
+    return typeof obj === 'undefined';
306
+  }
307
+
308
+  function isDefined(obj) {
309
+    return !isUndefined(obj);
310
+  }
311
+
312
+  function specPluralizedFor(count) {
313
+    var str = count + " spec";
314
+    if (count > 1) {
315
+      str += "s"
316
+    }
317
+    return str;
318
+  }
319
+
320
+};
321
+
322
+jasmine.HtmlReporterHelpers.addHelpers(jasmine.HtmlReporter.ReporterView);
323
+
324
+
325
+jasmine.HtmlReporter.SpecView = function(spec, dom, views) {
326
+  this.spec = spec;
327
+  this.dom = dom;
328
+  this.views = views;
329
+
330
+  this.symbol = this.createDom('li', { className: 'pending' });
331
+  this.dom.symbolSummary.appendChild(this.symbol);
332
+
333
+  this.summary = this.createDom('div', { className: 'specSummary' },
334
+      this.createDom('a', {
335
+        className: 'description',
336
+        href: '?spec=' + encodeURIComponent(this.spec.getFullName()),
337
+        title: this.spec.getFullName()
338
+      }, this.spec.description)
339
+  );
340
+
341
+  this.detail = this.createDom('div', { className: 'specDetail' },
342
+      this.createDom('a', {
343
+        className: 'description',
344
+        href: '?spec=' + encodeURIComponent(this.spec.getFullName()),
345
+        title: this.spec.getFullName()
346
+      }, this.spec.getFullName())
347
+  );
348
+};
349
+
350
+jasmine.HtmlReporter.SpecView.prototype.status = function() {
351
+  return this.getSpecStatus(this.spec);
352
+};
353
+
354
+jasmine.HtmlReporter.SpecView.prototype.refresh = function() {
355
+  this.symbol.className = this.status();
356
+
357
+  switch (this.status()) {
358
+    case 'skipped':
359
+      break;
360
+
361
+    case 'passed':
362
+      this.appendSummaryToSuiteDiv();
363
+      break;
364
+
365
+    case 'failed':
366
+      this.appendSummaryToSuiteDiv();
367
+      this.appendFailureDetail();
368
+      break;
369
+  }
370
+};
371
+
372
+jasmine.HtmlReporter.SpecView.prototype.appendSummaryToSuiteDiv = function() {
373
+  this.summary.className += ' ' + this.status();
374
+  this.appendToSummary(this.spec, this.summary);
375
+};
376
+
377
+jasmine.HtmlReporter.SpecView.prototype.appendFailureDetail = function() {
378
+  this.detail.className += ' ' + this.status();
379
+
380
+  var resultItems = this.spec.results().getItems();
381
+  var messagesDiv = this.createDom('div', { className: 'messages' });
382
+
383
+  for (var i = 0; i < resultItems.length; i++) {
384
+    var result = resultItems[i];
385
+
386
+    if (result.type == 'log') {
387
+      messagesDiv.appendChild(this.createDom('div', {className: 'resultMessage log'}, result.toString()));
388
+    } else if (result.type == 'expect' && result.passed && !result.passed()) {
389
+      messagesDiv.appendChild(this.createDom('div', {className: 'resultMessage fail'}, result.message));
390
+
391
+      if (result.trace.stack) {
392
+        messagesDiv.appendChild(this.createDom('div', {className: 'stackTrace'}, result.trace.stack));
393
+      }
394
+    }
395
+  }
396
+
397
+  if (messagesDiv.childNodes.length > 0) {
398
+    this.detail.appendChild(messagesDiv);
399
+    this.dom.details.appendChild(this.detail);
400
+  }
401
+};
402
+
403
+jasmine.HtmlReporterHelpers.addHelpers(jasmine.HtmlReporter.SpecView);jasmine.HtmlReporter.SuiteView = function(suite, dom, views) {
404
+  this.suite = suite;
405
+  this.dom = dom;
406
+  this.views = views;
407
+
408
+  this.element = this.createDom('div', { className: 'suite' },
409
+      this.createDom('a', { className: 'description', href: '?spec=' + encodeURIComponent(this.suite.getFullName()) }, this.suite.description)
410
+  );
411
+
412
+  this.appendToSummary(this.suite, this.element);
413
+};
414
+
415
+jasmine.HtmlReporter.SuiteView.prototype.status = function() {
416
+  return this.getSpecStatus(this.suite);
417
+};
418
+
419
+jasmine.HtmlReporter.SuiteView.prototype.refresh = function() {
420
+  this.element.className += " " + this.status();
421
+};
422
+
423
+jasmine.HtmlReporterHelpers.addHelpers(jasmine.HtmlReporter.SuiteView);
424
+
425
+/* @deprecated Use jasmine.HtmlReporter instead
426
+ */
427
+jasmine.TrivialReporter = function(doc) {
428
+  this.document = doc || document;
429
+  this.suiteDivs = {};
430
+  this.logRunningSpecs = false;
431
+};
432
+
433
+jasmine.TrivialReporter.prototype.createDom = function(type, attrs, childrenVarArgs) {
434
+  var el = document.createElement(type);
435
+
436
+  for (var i = 2; i < arguments.length; i++) {
437
+    var child = arguments[i];
438
+
439
+    if (typeof child === 'string') {
440
+      el.appendChild(document.createTextNode(child));
441
+    } else {
442
+      if (child) { el.appendChild(child); }
443
+    }
444
+  }
445
+
446
+  for (var attr in attrs) {
447
+    if (attr == "className") {
448
+      el[attr] = attrs[attr];
449
+    } else {
450
+      el.setAttribute(attr, attrs[attr]);
451
+    }
452
+  }
453
+
454
+  return el;
455
+};
456
+
457
+jasmine.TrivialReporter.prototype.reportRunnerStarting = function(runner) {
458
+  var showPassed, showSkipped;
459
+
460
+  this.outerDiv = this.createDom('div', { id: 'TrivialReporter', className: 'jasmine_reporter' },
461
+      this.createDom('div', { className: 'banner' },
462
+        this.createDom('div', { className: 'logo' },
463
+            this.createDom('span', { className: 'title' }, "Jasmine"),
464
+            this.createDom('span', { className: 'version' }, runner.env.versionString())),
465
+        this.createDom('div', { className: 'options' },
466
+            "Show ",
467
+            showPassed = this.createDom('input', { id: "__jasmine_TrivialReporter_showPassed__", type: 'checkbox' }),
468
+            this.createDom('label', { "for": "__jasmine_TrivialReporter_showPassed__" }, " passed "),
469
+            showSkipped = this.createDom('input', { id: "__jasmine_TrivialReporter_showSkipped__", type: 'checkbox' }),
470
+            this.createDom('label', { "for": "__jasmine_TrivialReporter_showSkipped__" }, " skipped")
471
+            )
472
+          ),
473
+
474
+      this.runnerDiv = this.createDom('div', { className: 'runner running' },
475
+          this.createDom('a', { className: 'run_spec', href: '?' }, "run all"),
476
+          this.runnerMessageSpan = this.createDom('span', {}, "Running..."),
477
+          this.finishedAtSpan = this.createDom('span', { className: 'finished-at' }, ""))
478
+      );
479
+
480
+  this.document.body.appendChild(this.outerDiv);
481
+
482
+  var suites = runner.suites();
483
+  for (var i = 0; i < suites.length; i++) {
484
+    var suite = suites[i];
485
+    var suiteDiv = this.createDom('div', { className: 'suite' },
486
+        this.createDom('a', { className: 'run_spec', href: '?spec=' + encodeURIComponent(suite.getFullName()) }, "run"),
487
+        this.createDom('a', { className: 'description', href: '?spec=' + encodeURIComponent(suite.getFullName()) }, suite.description));
488
+    this.suiteDivs[suite.id] = suiteDiv;
489
+    var parentDiv = this.outerDiv;
490
+    if (suite.parentSuite) {
491
+      parentDiv = this.suiteDivs[suite.parentSuite.id];
492
+    }
493
+    parentDiv.appendChild(suiteDiv);
494
+  }
495
+
496
+  this.startedAt = new Date();
497
+
498
+  var self = this;
499
+  showPassed.onclick = function(evt) {
500
+    if (showPassed.checked) {
501
+      self.outerDiv.className += ' show-passed';
502
+    } else {
503
+      self.outerDiv.className = self.outerDiv.className.replace(/ show-passed/, '');
504
+    }
505
+  };
506
+
507
+  showSkipped.onclick = function(evt) {
508
+    if (showSkipped.checked) {
509
+      self.outerDiv.className += ' show-skipped';
510
+    } else {
511
+      self.outerDiv.className = self.outerDiv.className.replace(/ show-skipped/, '');
512
+    }
513
+  };
514
+};
515
+
516
+jasmine.TrivialReporter.prototype.reportRunnerResults = function(runner) {
517
+  var results = runner.results();
518
+  var className = (results.failedCount > 0) ? "runner failed" : "runner passed";
519
+  this.runnerDiv.setAttribute("class", className);
520
+  //do it twice for IE
521
+  this.runnerDiv.setAttribute("className", className);
522
+  var specs = runner.specs();
523
+  var specCount = 0;
524
+  for (var i = 0; i < specs.length; i++) {
525
+    if (this.specFilter(specs[i])) {
526
+      specCount++;
527
+    }
528
+  }
529
+  var message = "" + specCount + " spec" + (specCount == 1 ? "" : "s" ) + ", " + results.failedCount + " failure" + ((results.failedCount == 1) ? "" : "s");
530
+  message += " in " + ((new Date().getTime() - this.startedAt.getTime()) / 1000) + "s";
531
+  this.runnerMessageSpan.replaceChild(this.createDom('a', { className: 'description', href: '?'}, message), this.runnerMessageSpan.firstChild);
532
+
533
+  this.finishedAtSpan.appendChild(document.createTextNode("Finished at " + new Date().toString()));
534
+};
535
+
536
+jasmine.TrivialReporter.prototype.reportSuiteResults = function(suite) {
537
+  var results = suite.results();
538
+  var status = results.passed() ? 'passed' : 'failed';
539
+  if (results.totalCount === 0) { // todo: change this to check results.skipped
540
+    status = 'skipped';
541
+  }
542
+  this.suiteDivs[suite.id].className += " " + status;
543
+};
544
+
545
+jasmine.TrivialReporter.prototype.reportSpecStarting = function(spec) {
546
+  if (this.logRunningSpecs) {
547
+    this.log('>> Jasmine Running ' + spec.suite.description + ' ' + spec.description + '...');
548
+  }
549
+};
550
+
551
+jasmine.TrivialReporter.prototype.reportSpecResults = function(spec) {
552
+  var results = spec.results();
553
+  var status = results.passed() ? 'passed' : 'failed';
554
+  if (results.skipped) {
555
+    status = 'skipped';
556
+  }
557
+  var specDiv = this.createDom('div', { className: 'spec '  + status },
558
+      this.createDom('a', { className: 'run_spec', href: '?spec=' + encodeURIComponent(spec.getFullName()) }, "run"),
559
+      this.createDom('a', {
560
+        className: 'description',
561
+        href: '?spec=' + encodeURIComponent(spec.getFullName()),
562
+        title: spec.getFullName()
563
+      }, spec.description));
564
+
565
+
566
+  var resultItems = results.getItems();
567
+  var messagesDiv = this.createDom('div', { className: 'messages' });
568
+  for (var i = 0; i < resultItems.length; i++) {
569
+    var result = resultItems[i];
570
+
571
+    if (result.type == 'log') {
572
+      messagesDiv.appendChild(this.createDom('div', {className: 'resultMessage log'}, result.toString()));
573
+    } else if (result.type == 'expect' && result.passed && !result.passed()) {
574
+      messagesDiv.appendChild(this.createDom('div', {className: 'resultMessage fail'}, result.message));
575
+
576
+      if (result.trace.stack) {
577
+        messagesDiv.appendChild(this.createDom('div', {className: 'stackTrace'}, result.trace.stack));
578
+      }
579
+    }
580
+  }
581
+
582
+  if (messagesDiv.childNodes.length > 0) {
583
+    specDiv.appendChild(messagesDiv);
584
+  }
585
+
586
+  this.suiteDivs[spec.suite.id].appendChild(specDiv);
587
+};
588
+
589
+jasmine.TrivialReporter.prototype.log = function() {
590
+  var console = jasmine.getGlobal().console;
591
+  if (console && console.log) {
592
+    if (console.log.apply) {
593
+      console.log.apply(console, arguments);
594
+    } else {
595
+      console.log(arguments); // ie fix: console.log.apply doesn't exist on ie
596
+    }
597
+  }
598
+};
599
+
600
+jasmine.TrivialReporter.prototype.getLocation = function() {
601
+  return this.document.location;
602
+};
603
+
604
+jasmine.TrivialReporter.prototype.specFilter = function(spec) {
605
+  var paramMap = {};
606
+  var params = this.getLocation().search.substring(1).split('&');
607
+  for (var i = 0; i < params.length; i++) {
608
+    var p = params[i].split('=');
609
+    paramMap[decodeURIComponent(p[0])] = decodeURIComponent(p[1]);
610
+  }
611
+
612
+  if (!paramMap.spec) {
613
+    return true;
614
+  }
615
+  return spec.getFullName().indexOf(paramMap.spec) === 0;
616
+};

+ 81
- 0
apps/pep_theme/static/bower_components/jquery-i18n/lib/jasmine-1.2.0/jasmine.css View File

@@ -0,0 +1,81 @@
1
+body { background-color: #eeeeee; padding: 0; margin: 5px; overflow-y: scroll; }
2
+
3
+#HTMLReporter { font-size: 11px; font-family: Monaco, "Lucida Console", monospace; line-height: 14px; color: #333333; }
4
+#HTMLReporter a { text-decoration: none; }
5
+#HTMLReporter a:hover { text-decoration: underline; }
6
+#HTMLReporter p, #HTMLReporter h1, #HTMLReporter h2, #HTMLReporter h3, #HTMLReporter h4, #HTMLReporter h5, #HTMLReporter h6 { margin: 0; line-height: 14px; }
7
+#HTMLReporter .banner, #HTMLReporter .symbolSummary, #HTMLReporter .summary, #HTMLReporter .resultMessage, #HTMLReporter .specDetail .description, #HTMLReporter .alert .bar, #HTMLReporter .stackTrace { padding-left: 9px; padding-right: 9px; }
8
+#HTMLReporter #jasmine_content { position: fixed; right: 100%; }
9
+#HTMLReporter .version { color: #aaaaaa; }
10
+#HTMLReporter .banner { margin-top: 14px; }
11
+#HTMLReporter .duration { color: #aaaaaa; float: right; }
12
+#HTMLReporter .symbolSummary { overflow: hidden; *zoom: 1; margin: 14px 0; }
13
+#HTMLReporter .symbolSummary li { display: block; float: left; height: 7px; width: 14px; margin-bottom: 7px; font-size: 16px; }
14
+#HTMLReporter .symbolSummary li.passed { font-size: 14px; }
15
+#HTMLReporter .symbolSummary li.passed:before { color: #5e7d00; content: "\02022"; }
16
+#HTMLReporter .symbolSummary li.failed { line-height: 9px; }
17
+#HTMLReporter .symbolSummary li.failed:before { color: #b03911; content: "x"; font-weight: bold; margin-left: -1px; }
18
+#HTMLReporter .symbolSummary li.skipped { font-size: 14px; }
19
+#HTMLReporter .symbolSummary li.skipped:before { color: #bababa; content: "\02022"; }
20
+#HTMLReporter .symbolSummary li.pending { line-height: 11px; }
21
+#HTMLReporter .symbolSummary li.pending:before { color: #aaaaaa; content: "-"; }
22
+#HTMLReporter .bar { line-height: 28px; font-size: 14px; display: block; color: #eee; }
23
+#HTMLReporter .runningAlert { background-color: #666666; }
24
+#HTMLReporter .skippedAlert { background-color: #aaaaaa; }
25
+#HTMLReporter .skippedAlert:first-child { background-color: #333333; }
26
+#HTMLReporter .skippedAlert:hover { text-decoration: none; color: white; text-decoration: underline; }
27
+#HTMLReporter .passingAlert { background-color: #a6b779; }
28
+#HTMLReporter .passingAlert:first-child { background-color: #5e7d00; }
29
+#HTMLReporter .failingAlert { background-color: #cf867e; }
30
+#HTMLReporter .failingAlert:first-child { background-color: #b03911; }
31
+#HTMLReporter .results { margin-top: 14px; }
32
+#HTMLReporter #details { display: none; }
33
+#HTMLReporter .resultsMenu, #HTMLReporter .resultsMenu a { background-color: #fff; color: #333333; }
34
+#HTMLReporter.showDetails .summaryMenuItem { font-weight: normal; text-decoration: inherit; }
35
+#HTMLReporter.showDetails .summaryMenuItem:hover { text-decoration: underline; }
36
+#HTMLReporter.showDetails .detailsMenuItem { font-weight: bold; text-decoration: underline; }
37
+#HTMLReporter.showDetails .summary { display: none; }
38
+#HTMLReporter.showDetails #details { display: block; }
39
+#HTMLReporter .summaryMenuItem { font-weight: bold; text-decoration: underline; }
40
+#HTMLReporter .summary { margin-top: 14px; }
41
+#HTMLReporter .summary .suite .suite, #HTMLReporter .summary .specSummary { margin-left: 14px; }
42
+#HTMLReporter .summary .specSummary.passed a { color: #5e7d00; }
43
+#HTMLReporter .summary .specSummary.failed a { color: #b03911; }
44
+#HTMLReporter .description + .suite { margin-top: 0; }
45
+#HTMLReporter .suite { margin-top: 14px; }
46
+#HTMLReporter .suite a { color: #333333; }
47
+#HTMLReporter #details .specDetail { margin-bottom: 28px; }
48
+#HTMLReporter #details .specDetail .description { display: block; color: white; background-color: #b03911; }
49
+#HTMLReporter .resultMessage { padding-top: 14px; color: #333333; }
50
+#HTMLReporter .resultMessage span.result { display: block; }
51
+#HTMLReporter .stackTrace { margin: 5px 0 0 0; max-height: 224px; overflow: auto; line-height: 18px; color: #666666; border: 1px solid #ddd; background: white; white-space: pre; }
52
+
53
+#TrivialReporter { padding: 8px 13px; position: absolute; top: 0; bottom: 0; left: 0; right: 0; overflow-y: scroll; background-color: white; font-family: "Helvetica Neue Light", "Lucida Grande", "Calibri", "Arial", sans-serif; /*.resultMessage {*/ /*white-space: pre;*/ /*}*/ }
54
+#TrivialReporter a:visited, #TrivialReporter a { color: #303; }
55
+#TrivialReporter a:hover, #TrivialReporter a:active { color: blue; }
56
+#TrivialReporter .run_spec { float: right; padding-right: 5px; font-size: .8em; text-decoration: none; }
57
+#TrivialReporter .banner { color: #303; background-color: #fef; padding: 5px; }
58
+#TrivialReporter .logo { float: left; font-size: 1.1em; padding-left: 5px; }
59
+#TrivialReporter .logo .version { font-size: .6em; padding-left: 1em; }
60
+#TrivialReporter .runner.running { background-color: yellow; }
61
+#TrivialReporter .options { text-align: right; font-size: .8em; }
62
+#TrivialReporter .suite { border: 1px outset gray; margin: 5px 0; padding-left: 1em; }
63
+#TrivialReporter .suite .suite { margin: 5px; }
64
+#TrivialReporter .suite.passed { background-color: #dfd; }
65
+#TrivialReporter .suite.failed { background-color: #fdd; }
66
+#TrivialReporter .spec { margin: 5px; padding-left: 1em; clear: both; }
67
+#TrivialReporter .spec.failed, #TrivialReporter .spec.passed, #TrivialReporter .spec.skipped { padding-bottom: 5px; border: 1px solid gray; }
68
+#TrivialReporter .spec.failed { background-color: #fbb; border-color: red; }
69
+#TrivialReporter .spec.passed { background-color: #bfb; border-color: green; }
70
+#TrivialReporter .spec.skipped { background-color: #bbb; }
71
+#TrivialReporter .messages { border-left: 1px dashed gray; padding-left: 1em; padding-right: 1em; }
72
+#TrivialReporter .passed { background-color: #cfc; display: none; }
73
+#TrivialReporter .failed { background-color: #fbb; }
74
+#TrivialReporter .skipped { color: #777; background-color: #eee; display: none; }
75
+#TrivialReporter .resultMessage span.result { display: block; line-height: 2em; color: black; }
76
+#TrivialReporter .resultMessage .mismatch { color: black; }
77
+#TrivialReporter .stackTrace { white-space: pre; font-size: .8em; margin-left: 10px; max-height: 5em; overflow: auto; border: 1px inset red; padding: 1em; background: #eef; }
78
+#TrivialReporter .finished-at { padding-left: 1em; font-size: .6em; }
79
+#TrivialReporter.show-passed .passed, #TrivialReporter.show-skipped .skipped { display: block; }
80
+#TrivialReporter #jasmine_content { position: fixed; right: 100%; }
81
+#TrivialReporter .runner { border: 1px solid gray; display: block; margin: 5px 0; padding: 2px 0 2px 10px; }

+ 2529
- 0
apps/pep_theme/static/bower_components/jquery-i18n/lib/jasmine-1.2.0/jasmine.js
File diff suppressed because it is too large
View File


+ 17
- 0
apps/pep_theme/static/bower_components/jquery-i18n/package.json View File

@@ -0,0 +1,17 @@
1
+{
2
+  "name": "jquery-i18n",
3
+  "description": "A jQuery plugin for doing client-side translations in javascript.",
4
+  "repository": "git@github.com:recurser/jquery-i18n.git",
5
+  "version": "1.1.2",
6
+  "main": "Gruntfile.js",
7
+  "dependencies": {
8
+  },
9
+  "devDependencies": {
10
+    "grunt-contrib-uglify": "~0.2.0",
11
+    "grunt": "~0.4.0"
12
+  },
13
+  "peerDependencies": {
14
+    "grunt": "~0.4.0"
15
+  }
16
+}
17
+

+ 83
- 0
apps/pep_theme/static/bower_components/jquery-i18n/specs/jquery.i18n.spec.js View File

@@ -0,0 +1,83 @@
1
+describe ('jquery.i18n plugin', function() {
2
+
3
+	it ('translates a key into the string', function() {
4
+		$.i18n.load({ a_key: 'translated string' });
5
+
6
+		expect($.i18n._('a_key')).toEqual('translated string');
7
+	});
8
+
9
+	it ('returns the key when there is no translation', function() {
10
+		$.i18n.load({ a_key: 'translated string' });
11
+
12
+		expect($.i18n._('another_key')).toEqual('another_key');
13
+	});
14
+
15
+	it ('returns the missing pattern when there is no translation, and a missing pattern is provided', function() {
16
+		$.i18n.load({ a_key: 'translated string' }, "{{ %s }}");
17
+
18
+		expect($.i18n._('another_key')).toEqual('{{ another_key }}');
19
+	});
20
+
21
+	describe ('variable substitution', function() {
22
+
23
+		describe ('variable lists', function() {
24
+
25
+			it ('allows a string variable to be substituted into a translation', function() {
26
+				$.i18n.load({ a_key: 'translated string %s' });
27
+
28
+				expect($.i18n._('a_key', ['variable'])).toEqual('translated string variable');
29
+			});
30
+
31
+			it ('allows many string variable to be substituted into a translation', function() {
32
+				$.i18n.load({ a_key: 'translated string %s - %s - %s' });
33
+
34
+				expect($.i18n._('a_key', ['variables', 'in', 'list'])).toEqual('translated string variables - in - list');
35
+			});
36
+
37
+			it ('handles variables at the start of a translation', function() {
38
+				$.i18n.load({ a_key: '%s and %s' });
39
+
40
+				expect($.i18n._('a_key', ['string 1', 'string 2'])).toEqual('string 1 and string 2');
41
+			});
42
+
43
+			it ('treats %%s as a literal %s', function() {
44
+				$.i18n.load({ a_key: '%s and a literal %%s and %s' });
45
+
46
+				expect($.i18n._('a_key', ['string 1', 'string 2'])).toEqual('string 1 and a literal %s and string 2');
47
+			});
48
+
49
+		});
50
+
51
+		describe ('numbered variables', function() {
52
+
53
+			it ('put 2 numbered variables out of order', function() {
54
+				$.i18n.load({ a_key: 'translated string %2$s - %1$s' });
55
+
56
+				expect($.i18n._('a_key', ['order', 'in'])).toEqual('translated string in - order');
57
+			});
58
+
59
+			it ('put 2 numbered variables in order', function() {
60
+				$.i18n.load({ a_key: 'translated string %1$s - %2$s' });
61
+
62
+				expect($.i18n._('a_key', ['order', 'in'])).toEqual('translated string order - in');
63
+			});
64
+
65
+			it ('put many numbered variables in random order', function() {
66
+				$.i18n.load({ a_key: 'translated string %3$s %1$s - %2$s' });
67
+
68
+				expect($.i18n._('a_key', ['in', 'order',  'many' ])).toEqual('translated string many in - order');
69
+			});
70
+
71
+		});
72
+
73
+	});
74
+
75
+	it ('allows the dictionary to be cleared', function() {
76
+		$.i18n.load({ a_key: 'translated string' });
77
+		expect($.i18n._('a_key')).toEqual('translated string');
78
+		$.i18n.unload();
79
+		expect($.i18n._('a_key')).toEqual('a_key');
80
+		expect($.i18n.dict).toBeNull();
81
+	});
82
+
83
+});

+ 120
- 0
apps/pep_theme/static/bower_components/jquery-i18n/src/jquery.i18n.js View File

@@ -0,0 +1,120 @@
1
+/*!
2
+ * jQuery i18n plugin
3
+ * @requires jQuery v1.1 or later
4
+ *
5
+ * See https://github.com/recurser/jquery-i18n
6
+ *
7
+ * Licensed under the MIT license.
8
+ *
9
+ * Version: <%= pkg.version %> (<%= meta.date %>)
10
+ */
11
+(function($) {
12
+  /**
13
+   * i18n provides a mechanism for translating strings using a jscript dictionary.
14
+   *
15
+   */
16
+
17
+  var __slice = Array.prototype.slice;
18
+
19
+  /*
20
+   * i18n property list
21
+   */
22
+  var i18n = {
23
+
24
+    dict: null,
25
+    missingPattern: null,
26
+
27
+    /**
28
+     * load()
29
+     *
30
+     * Load translations.
31
+     *
32
+     * @param  property_list i18nDict : The dictionary to use for translation.
33
+     */
34
+    load: function(i18nDict, missingPattern) {
35
+      if (this.dict !== null) {
36
+        $.extend(this.dict, i18nDict);
37
+      } else {
38
+        this.dict = i18nDict;
39
+      }
40
+
41
+      if (missingPattern) {
42
+        this.missingPattern = missingPattern;
43
+      }
44
+    },
45
+
46
+    /**
47
+     * unload()
48
+     *
49
+     * Unloads translations and clears the dictionary.
50
+     */
51
+    unload: function() {
52
+      this.dict           = null;
53
+      this.missingPattern = null;
54
+    },
55
+
56
+    /**
57
+     * _()
58
+     *
59
+     * Looks the given string up in the dictionary and returns the translation if
60
+     * one exists. If a translation is not found, returns the original word.
61
+     *
62
+     * @param  string str           : The string to translate.
63
+     * @param  property_list params.. : params for using printf() on the string.
64
+     *
65
+     * @return string               : Translated word.
66
+     */
67
+    _: function (str) {
68
+      dict = this.dict;
69
+      if (dict && dict.hasOwnProperty(str)) {
70
+        str = dict[str];
71
+      } else if (this.missingPattern !== null) {
72
+        return this.printf(this.missingPattern, str);
73
+      }
74
+      args = __slice.call(arguments);
75
+      args[0] = str;
76
+      // Substitute any params.
77
+      return this.printf.apply(this, args);
78
+    },
79
+
80
+    /*
81
+     * printf()
82
+     *
83
+     * Substitutes %s with parameters given in list. %%s is used to escape %s.
84
+     *
85
+     * @param  string str    : String to perform printf on.
86
+     * @param  string args   : Array of arguments for printf.
87
+     *
88
+     * @return string result : Substituted string
89
+     */
90
+    printf: function(str, args) {
91
+      if (arguments.length < 2) return str;
92
+      args = $.isArray(args) ? args : __slice.call(arguments, 1);
93
+      return str.replace(/([^%]|^)%(?:(\d+)\$)?s/g, function(p0, p, position) {
94
+        if (position) {
95
+          return p + args[parseInt(position)-1];
96
+        }
97
+        return p + args.shift();
98
+      }).replace(/%%s/g, '%s');
99
+    }
100
+
101
+  };
102
+
103
+  /*
104
+   * _t()
105
+   *
106
+   * Allows you to translate a jQuery selector.
107
+   *
108
+   * eg $('h1')._t('some text')
109
+   *
110
+   * @param  string str           : The string to translate .
111
+   * @param  property_list params : Params for using printf() on the string.
112
+   *
113
+   * @return element              : Chained and translated element(s).
114
+  */
115
+  $.fn._t = function(str, params) {
116
+    return $(this).html(i18n._.apply(i18n, arguments));
117
+  };
118
+
119
+  $.i18n = i18n;
120
+})(jQuery);

+ 25
- 0
apps/pep_theme/static/bower_components/jquery/.bower.json View File

@@ -0,0 +1,25 @@
1
+{
2
+  "name": "jquery",
3
+  "main": "dist/jquery.js",
4
+  "license": "MIT",
5