Browse Source

init

master
David Beltra 1 year ago
commit
22a0d7672c
100 changed files with 36144 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. +14
    -0
      apps/pep_theme/static/bower_components/jquery/src/core/stripAndCollapse.js

+ 40
- 0
.gitignore View File

@@ -0,0 +1,40 @@
#bower_components
node_modules

# Ignore automatically generated cruft
*.log
.sass-cache


# Operating system files
.Spotlight-V100
.Trashes
.DS_Store
.DS_Store?
ehthumbs.db
Thumbs.db

#PYC
*.pyc

#VIRTUALENV
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# django static (collected by django)
/static

#local db, must run migrations on production to sync
dev.db

#credentials
credentials.sh

#local settings
**/local_settings.py
**/local_urls.py

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


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

@@ -0,0 +1,43 @@
from copy import deepcopy
from django.contrib import admin
from mezzanine.core.admin import ContentTypedAdmin
from mezzanine.pages.admin import PageAdmin
from apps.components.icon.models import Icon
from apps.components.button.models import Button
from .models import ContentBlock, HomeBlock, AddressBlock


class IconInline(admin.StackedInline):
model = Icon
extra = 0


class ButtonInline(admin.StackedInline):
model = Button
extra = 0


class ContentBlockAdmin(PageAdmin, ContentTypedAdmin):
inlines = [
IconInline,
ButtonInline,
]


admin.site.register(ContentBlock, ContentBlockAdmin)


class HomeBlockAdmin(PageAdmin, ContentTypedAdmin):
inlines = [
ButtonInline,
]


admin.site.register(HomeBlock, HomeBlockAdmin)


class AddressBlockAdmin(PageAdmin, ContentTypedAdmin):
pass


admin.site.register(AddressBlock, AddressBlockAdmin)

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

@@ -0,0 +1,43 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2018-09-04 12:53
from __future__ import unicode_literals

from django.db import migrations, models
import django.db.models.deletion
import mezzanine.core.fields


class Migration(migrations.Migration):

initial = True

dependencies = [
('pages', '0004_auto_20170411_0504'),
]

operations = [
migrations.CreateModel(
name='ContentBlock',
fields=[
('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')),
('content', mezzanine.core.fields.RichTextField(verbose_name='Content')),
('background', models.ImageField(blank=True, upload_to='backgrounds', verbose_name='Background')),
],
options={
'ordering': ('_order',),
},
bases=('pages.page', models.Model),
),
migrations.CreateModel(
name='HomeBlock',
fields=[
('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')),
('content', mezzanine.core.fields.RichTextField(verbose_name='Content')),
('image', models.ImageField(blank=True, upload_to='images', verbose_name='Image')),
],
options={
'ordering': ('_order',),
},
bases=('pages.page', models.Model),
),
]

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

@@ -0,0 +1,36 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2018-09-06 08:32
from __future__ import unicode_literals

from django.db import migrations, models
import mezzanine.core.fields


class Migration(migrations.Migration):

dependencies = [
('blocks', '0001_initial'),
]

operations = [
migrations.AddField(
model_name='homeblock',
name='button_text_1',
field=mezzanine.core.fields.RichTextField(blank=True, max_length=500, null=True, verbose_name='Button text 1'),
),
migrations.AddField(
model_name='homeblock',
name='button_text_2',
field=mezzanine.core.fields.RichTextField(blank=True, max_length=500, null=True, verbose_name='Button text 2'),
),
migrations.AddField(
model_name='homeblock',
name='header',
field=models.CharField(blank=True, max_length=500, null=True, verbose_name='Header'),
),
migrations.AddField(
model_name='homeblock',
name='providers',
field=mezzanine.core.fields.RichTextField(blank=True, max_length=500, null=True, verbose_name='Providers'),
),
]

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

@@ -0,0 +1,19 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2018-09-06 09:00
from __future__ import unicode_literals

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('blocks', '0002_auto_20180906_0832'),
]

operations = [
migrations.RemoveField(
model_name='homeblock',
name='content',
),
]

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

@@ -0,0 +1,38 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2018-09-06 12:34
from __future__ import unicode_literals

from django.db import migrations, models
import django.db.models.deletion
import mezzanine.core.fields


class Migration(migrations.Migration):

dependencies = [
('pages', '0004_auto_20170411_0504'),
('blocks', '0003_remove_homeblock_content'),
]

operations = [
migrations.CreateModel(
name='AddressBlock',
fields=[
('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')),
('map_left', models.CharField(blank=True, help_text='https://www.openstreetmap.org/export', max_length=500, null=True, verbose_name='Map left')),
('map_top', models.CharField(blank=True, max_length=500, null=True, verbose_name='Map top')),
('map_right', models.CharField(blank=True, max_length=500, null=True, verbose_name='Map right')),
('map_bottom', models.CharField(blank=True, max_length=500, null=True, verbose_name='Map bottom')),
('marker_lat', models.CharField(blank=True, max_length=500, null=True, verbose_name='Marker Latitude')),
('marker_long', models.CharField(blank=True, max_length=500, null=True, verbose_name='Marker Longitude')),
('image', models.ImageField(blank=True, upload_to='images', verbose_name='Image')),
('company', models.CharField(blank=True, max_length=500, null=True, verbose_name='Company')),
('address', mezzanine.core.fields.RichTextField(blank=True, max_length=500, null=True, verbose_name='Address')),
('text_description', mezzanine.core.fields.RichTextField(blank=True, max_length=500, null=True, verbose_name='Description')),
],
options={
'ordering': ('_order',),
},
bases=('pages.page',),
),
]

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

@@ -0,0 +1,25 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2018-09-06 13:02
from __future__ import unicode_literals

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('blocks', '0004_addressblock'),
]

operations = [
migrations.RenameField(
model_name='homeblock',
old_name='button_text_1',
new_name='text_1',
),
migrations.RenameField(
model_name='homeblock',
old_name='button_text_2',
new_name='text_2',
),
]

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

@@ -0,0 +1,34 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2018-09-06 13:06
from __future__ import unicode_literals

from django.db import migrations
import mezzanine.core.fields


class Migration(migrations.Migration):

dependencies = [
('blocks', '0005_auto_20180906_1302'),
]

operations = [
migrations.RemoveField(
model_name='homeblock',
name='text_1',
),
migrations.RemoveField(
model_name='homeblock',
name='text_2',
),
migrations.AddField(
model_name='homeblock',
name='text_10',
field=mezzanine.core.fields.RichTextField(blank=True, max_length=500, null=True, verbose_name='Text 1'),
),
migrations.AddField(
model_name='homeblock',
name='text_20',
field=mezzanine.core.fields.RichTextField(blank=True, max_length=500, null=True, verbose_name='Text 2'),
),
]

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

@@ -0,0 +1,35 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2018-09-06 13:07
from __future__ import unicode_literals

from django.db import migrations
import mezzanine.core.fields


class Migration(migrations.Migration):

dependencies = [
('blocks', '0006_auto_20180906_1306'),
]

operations = [
migrations.RenameField(
model_name='homeblock',
old_name='text_10',
new_name='text_1',
),
migrations.RenameField(
model_name='homeblock',
old_name='text_20',
new_name='text_2',
),
migrations.RemoveField(
model_name='homeblock',
name='providers',
),
migrations.AddField(
model_name='homeblock',
name='text_3',
field=mezzanine.core.fields.RichTextField(blank=True, max_length=500, null=True, verbose_name='Text 3'),
),
]

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

@@ -0,0 +1,41 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2018-09-07 08:19
from __future__ import unicode_literals

from django.db import migrations
import mezzanine.core.fields


class Migration(migrations.Migration):

dependencies = [
('blocks', '0007_auto_20180906_1307'),
]

operations = [
migrations.AlterField(
model_name='addressblock',
name='address',
field=mezzanine.core.fields.RichTextField(blank=True, null=True, verbose_name='Address'),
),
migrations.AlterField(
model_name='addressblock',
name='text_description',
field=mezzanine.core.fields.RichTextField(blank=True, null=True, verbose_name='Description'),
),
migrations.AlterField(
model_name='homeblock',
name='text_1',
field=mezzanine.core.fields.RichTextField(blank=True, null=True, verbose_name='Text 1'),
),
migrations.AlterField(
model_name='homeblock',
name='text_2',
field=mezzanine.core.fields.RichTextField(blank=True, null=True, verbose_name='Text 2'),
),
migrations.AlterField(
model_name='homeblock',
name='text_3',
field=mezzanine.core.fields.RichTextField(blank=True, null=True, verbose_name='Text 3'),
),
]

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


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

@@ -0,0 +1,45 @@
from django.db import models
from mezzanine.core.models import RichText
from mezzanine.pages.models import Page
from django.utils.translation import ugettext, ugettext_lazy as _
from mezzanine.core.fields import RichTextField


class ContentBlock(Page, RichText):
background = models.ImageField(
_("Background"), upload_to="backgrounds", blank=True)


class HomeBlock(Page):
image = models.ImageField(_("Image"), upload_to="images", blank=True)
header = models.CharField(
_("Header"), max_length=500, blank=True, null=True)
text_1 = RichTextField(_("Text 1"), blank=True, null=True)
text_2 = RichTextField(_("Text 2"), blank=True, null=True)
text_3 = RichTextField(_("Text 3"), blank=True, null=True)


class AddressBlock(Page):

map_left = models.CharField(_("Map left"), max_length=500, blank=True, null=True,
help_text="https://www.openstreetmap.org/export")

map_top = models.CharField(
_("Map top"), max_length=500, blank=True, null=True)
map_right = models.CharField(
_("Map right"), max_length=500, blank=True, null=True)
map_bottom = models.CharField(
_("Map bottom"), max_length=500, blank=True, null=True)

marker_lat = models.CharField(
_("Marker Latitude"), max_length=500, blank=True, null=True)
marker_long = models.CharField(
_("Marker Longitude"), max_length=500, blank=True, null=True)

image = models.ImageField(_("Image"), upload_to="images", blank=True)

company = models.CharField(
_("Company"), max_length=500, blank=True, null=True)

address = RichTextField(_("Address"), blank=True, null=True)
text_description = RichTextField(_("Description"), blank=True, null=True)

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

@@ -0,0 +1,36 @@
from modeltranslation.translator import translator, TranslationOptions
from mezzanine.core.translation import (
TranslatedDisplayable,
TranslatedRichText,
)
from .models import (
ContentBlock,
HomeBlock,
AddressBlock,
)


class TranslatedContent(TranslatedRichText):
fields = ()


class TranslatedHome(TranslationOptions):
fields = (
'header',
'text_1',
'text_2',
'text_3',
)


class TranslatedAddress(TranslationOptions):
fields = (
'company',
'address',
'text_description',
)


translator.register(ContentBlock, TranslatedContent)
translator.register(HomeBlock, TranslatedHome)
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 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2018-09-04 12:53
from __future__ import unicode_literals

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

initial = True

dependencies = [
('blocks', '0001_initial'),
]

operations = [
migrations.CreateModel(
name='Button',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('text', models.CharField(max_length=500, verbose_name='Text')),
('url', models.CharField(max_length=500, verbose_name='URL')),
('block', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='blocks.ContentBlock')),
],
),
]

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

@@ -0,0 +1,22 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2018-09-04 13:03
from __future__ import unicode_literals

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

dependencies = [
('blocks', '0001_initial'),
('button', '0001_initial'),
]

operations = [
migrations.AddField(
model_name='button',
name='home_block',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='blocks.HomeBlock'),
),
]

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

@@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2018-09-04 13:20
from __future__ import unicode_literals

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('button', '0002_button_home_block'),
]

operations = [
migrations.AddField(
model_name='button',
name='info_text',
field=models.CharField(blank=True, max_length=500, null=True, verbose_name='Info text'),
),
]

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

@@ -0,0 +1,21 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2018-09-04 13:34
from __future__ import unicode_literals

from django.db import migrations
import mezzanine.core.fields


class Migration(migrations.Migration):

dependencies = [
('button', '0003_button_info_text'),
]

operations = [
migrations.AlterField(
model_name='button',
name='text',
field=mezzanine.core.fields.RichTextField(max_length=500, verbose_name='Text'),
),
]

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

@@ -0,0 +1,26 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2018-09-04 13:35
from __future__ import unicode_literals

from django.db import migrations, models
import mezzanine.core.fields


class Migration(migrations.Migration):

dependencies = [
('button', '0004_auto_20180904_1334'),
]

operations = [
migrations.AlterField(
model_name='button',
name='info_text',
field=mezzanine.core.fields.RichTextField(blank=True, max_length=500, null=True, verbose_name='Info text'),
),
migrations.AlterField(
model_name='button',
name='text',
field=models.CharField(max_length=500, verbose_name='Text'),
),
]

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

@@ -0,0 +1,19 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2018-09-06 08:46
from __future__ import unicode_literals

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('button', '0005_auto_20180904_1335'),
]

operations = [
migrations.RemoveField(
model_name='button',
name='info_text',
),
]

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


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

@@ -0,0 +1,13 @@
from django.db import models
from apps.blocks.models import ContentBlock, HomeBlock
from django.utils.translation import ugettext, ugettext_lazy as _
from mezzanine.core.fields import RichTextField


class Button(models.Model):
block = models.ForeignKey(
ContentBlock, on_delete=models.CASCADE, blank=True, null=True)
home_block = models.ForeignKey(
HomeBlock, on_delete=models.CASCADE, blank=True, null=True)
text = models.CharField(_("Text"), max_length=500)
url = models.CharField(_("URL"), max_length=500)

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

@@ -0,0 +1,11 @@
from modeltranslation.translator import translator, TranslationOptions
from .models import Button


class TranslatedButton(TranslationOptions):
fields = (
'text',
)


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 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2018-09-04 12:53
from __future__ import unicode_literals

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

initial = True

dependencies = [
('blocks', '0001_initial'),
]

operations = [
migrations.CreateModel(
name='Icon',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('icon', models.ImageField(upload_to='icons', verbose_name='Icon')),
('text', models.CharField(blank=True, max_length=500, verbose_name='Text')),
('block', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='blocks.ContentBlock')),
],
),
]

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


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

@@ -0,0 +1,10 @@
from django.db import models
from apps.blocks.models import ContentBlock
from django.utils.translation import ugettext, ugettext_lazy as _


class Icon(models.Model):
block = models.ForeignKey(
ContentBlock, on_delete=models.CASCADE, blank=True, null=True)
icon = models.ImageField(_("Icon"), upload_to="icons")
text = models.CharField(_("Text"), max_length=500, blank=True)

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

@@ -0,0 +1,11 @@
from modeltranslation.translator import translator, TranslationOptions
from .models import Icon


class TranslatedIcon(TranslationOptions):
fields = (
'text',
)


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 @@
{% extends "pages/richtextpage.html" %}
{% load i18n mezzanine_tags pages_tags %}

{% block main %}

{% editable page.get_content_model.content %}
{{page.get_content_model.content|safe}}
{% endeditable %}

{% nevercache %}
{% if messages %}
{% for message in messages %}
{% if message.extra_tags == 'general' %}
<p class="alert alert-{{ message.level_tag }}">{{message}}</p>
{% endif %}
{% endfor %}
{% endif %}
{% endnevercache %}

<form id="nominations-form" class="mezzanine-form" method="post" action="/nominierungen/">

{% csrf_token %}

<div class="form-group input_id_nominated charfield">
<label class="control-label" for="id_nominated">{% trans "Nominiert wird" %}</label>
<input type="text" name="nominated" maxlength="2000" required="" id="id_nominated">
<p class="help-block">{% trans "Name, Adresse, Tel. Nr, Webseite etc." %}</p>
{% nevercache %}
{% if messages %}
{% for message in messages %}
{% if message.extra_tags == 'nominated' %}
<p class="alert alert-{{ message.level_tag }}">{{message}}</p>
{% endif %}
{% endfor %}
{% endif %}
{% endnevercache %}
</div>

<div class="form-group input_id_reasons_nomination charfield">
<label class="control-label" for="id_reasons_nomination">{% trans "Grund der Nominierung" %}</label>
<textarea name="reasons_nomination" cols="40" rows="10" maxlength="2000" required="" id="id_reasons_nomination" class="input-xlarge"></textarea>
<p class="help-block">{% trans "Begründung; welcher Personenkreis ist von den Eingriffen/der Kontrolle besonders betroffen; Quellen, Presseartikel, Dokumente, URLs" %}</p>
{% nevercache %}
{% if messages %}
{% for message in messages %}
{% if message.extra_tags == 'reasons_nomination' %}
<p class="alert alert-{{ message.level_tag }}">{{message}}</p>
{% endif %}
{% endfor %}
{% endif %}
{% endnevercache %}
</div>

<div class="form-group input_id_name charfield">
<label class="control-label" for="id_name">{% trans "Ihr Name" %}</label>
<input type="text" name="name" maxlength="2000" id="id_name">
</div>

<div class="form-group input_id_email emailfield">
<label class="control-label" for="id_email">{% trans "Ihre E-Mail-Adresse" %}</label>
<input type="email" name="email" id="id_email">

{% nevercache %}
{% if messages %}
{% for message in messages %}
{% if message.extra_tags == 'email' %}
<p class="alert alert-{{ message.level_tag }}">{{message}}</p>
{% endif %}
{% endfor %}
{% endif %}
{% endnevercache %}
</div>


<p>{% trans "Bitte tragen Sie mich in Ihren Newsletter ein:" %}</p>

<span class="subscriptions">
<div class="form-group input_id_sk booleanfield">
<input type="checkbox" name="sk" id="id_sk">
<label class="control-label" for="id_sk">{% trans "Stiftung für Konsumentenschutz" %}</label>
</div>

<div class="form-group input_id_dg booleanfield">
<input type="checkbox" name="dg" id="id_dg">
<label class="control-label" for="id_dg">{% trans "Digitale Gesellschaft" %}</label>
</div>

<div class="form-group input_id_pep booleanfield">
<input type="checkbox" name="pep" id="id_pep">
<label class="control-label" for="id_pep">{% trans "p≡p Foundation" %}</label>
</div>

<div class="form-group input_id_ccc booleanfield">
<input type="checkbox" name="ccc" id="id_ccc">
<label class="control-label" for="id_ccc">{% trans "Chaos Computer Club Schweiz (CCC-CH)" %}</label>
</div>
</span>

<div class="form-actions">
<input class="btn btn-primary btn-lg" type="submit" value="Nominieren">
</div>
</form>

{% endblock %}

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

@@ -0,0 +1,15 @@
from __future__ import unicode_literals
from django.conf import settings

from django.conf.urls import url, include

from . import views


# Trailing slahes for urlpatterns based on setup.
_slash = "/" if settings.APPEND_SLASH else ""

# Blog patterns.
urlpatterns = [
# url(r"^$", views.sendNomination, name="send-nomination"),
]

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

@@ -0,0 +1,72 @@
from django.http import HttpResponseRedirect
from django.contrib import messages
from django.core.mail import send_mail, EmailMessage
from django.utils.translation import ugettext, ugettext_lazy as _

from mezzanine.pages.page_processors import processor_for
from mezzanine.pages.models import Page
import re

EMAIL_REGEX = re.compile(r"[^@]+@[^@]+\.[^@]+")

@processor_for("nominierungen")
def sendNomination(request, page=None):
print('HOLA')

if request.method == 'POST':
print(request.POST)

page = Page.objects.get(slug="nominierungen")
form_valid = True

email = request.POST.get('email')
nominated = request.POST.get('nominated')
reasons_nomination = request.POST.get('reasons_nomination')

# if email != "" and not EMAIL_REGEX.match(email):
if not EMAIL_REGEX.match(email):
form_valid = False
messages.error(request, str(_('Ungültige E-Mail')), extra_tags='email')

if nominated == '':
form_valid = False
messages.error(request, str(_('Pflichtfeld')), extra_tags='nominated')

if reasons_nomination == '':
form_valid = False
messages.error(request, str(_('Pflichtfeld')), extra_tags='reasons_nomination')

if form_valid:
is_valid = True

try:

subject = 'Nomination sumbitted'
message = 'Nominated: ' + nominated + ' Reasons: ' + reasons_nomination
from_email = email
recipient_list = ['dbe@pep.security']

email = EmailMessage(subject, message, from_email, recipient_list)
email.send()

except Exception:
messages.error(request, str(_('Fehler beim Senden des Formulars')), extra_tags='general')
is_valid = False

if request.POST.get('sk') == 'on':
print('email Stiftung für Konsumentenschutz')

if request.POST.get('dg') == 'on':
print('email Digitale Gesellschaft')

if request.POST.get('pep') == 'on':
print('email pEp')

if request.POST.get('ccc') == 'on':
print('email CCC')

if is_valid:
return HttpResponseRedirect('/danke/')

print('MESSAGES:')
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 @@
from django.contrib.auth.models import Group


def user_readonly(request):
if Group.objects.filter(name="readonly").count() > 0:
readonly_group = Group.objects.get(name="readonly")
if readonly_group in request.user.groups.all():
return True
else:
return False
else:
return False


class ReadOnlyMixin(object):
def get_readonly_fields(self, request, obj=None):
if user_readonly(request):
if obj != None:
print(obj)
all_fields = obj._meta.get_fields(
include_parents=False, include_hidden=False)
all_field_names = []
for field in all_fields:
if field.concrete:
all_field_names.append(field.name)
return all_field_names
else:
return []

def has_add_permission(self, request):
if user_readonly(request):
return False
else:
return True

def has_delete_permission(self, request, obj=None):
if user_readonly(request):
return False
else:
return True

def get_actions(self, request):
actions = super().get_actions(request)
if user_readonly(request):
actions = None
return actions

def __init__(self, *args, **kwargs):
super(ReadOnlyMixin, self).__init__(*args, **kwargs)

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

@@ -0,0 +1,9 @@
from mezzanine.pages.models import Page

def footer(request):
footer_page = Page.objects.get(id=13)
return {'footer_page': footer_page}

def navbar(request):
navbar_page = Page.objects.get(id=11)
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 @@
{
"name": "pep",
"description": "",
"main": "index.html",
"authors": [
"jakubwrycza.pl"
],
"license": "ISC",
"homepage": "",
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"test",
"tests"
],
"dependencies": {
"swiper": "^4.2.2",
"jquery": "^3.3.1",
"masonry-layout": "^4.2.1",
"jquery-i18n": "^1.1.2"
},
"devDependencies": {
"masonry-layout": "^4.2.1",
"jquery-i18n": "^1.1.2"
}
}

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

@@ -0,0 +1,37 @@
{
"name": "jquery-i18n",
"version": "1.1.2",
"homepage": "https://github.com/recurser/jquery-i18n",
"authors": [
"Dave Perrett <hello@daveperrett.com>"
],
"description": "A jQuery plugin for doing client-side translations in javascript.",
"main": "jquery.i18n.js",
"keywords": [
"jquery",
"i18n",
"translation"
],
"license": "MIT",
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"test",
"tests"
],
"_release": "1.1.2",
"_resolution": {
"type": "version",
"tag": "v1.1.2",
"commit": "401f28b4ed9165689551eac123131b39a0845a37"
},
"_source": "https://github.com/recurser/jquery-i18n.git",
"_target": "^1.1.2",
<<<<<<< HEAD
"_originalSource": "jquery-i18n",
"_direct": true
=======
"_originalSource": "jquery-i18n"
>>>>>>> 067c97801de6912e5313a5f84b465ec9231a0bfb
}

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

@@ -0,0 +1,35 @@

module.exports = function(grunt) {

grunt.initConfig({
meta: {
date: (new Date()).toUTCString()
},
pkg: grunt.file.readJSON('package.json'),
uglify: {
dist: {
src: 'jquery.i18n.js',
dest: 'jquery.i18n.min.js'
}
}
});

grunt.registerTask('build', function() {
var content = grunt.file.read('src/jquery.i18n.js', 'utf-8');
var output = grunt.template.process(content);
grunt.file.write('jquery.i18n.js', output);
grunt.log.ok('File jquery.i18n.js created.');
});

// update bower version
grunt.registerTask('bower', function() {
var pkg = grunt.file.readJSON('package.json');
var bower = grunt.file.readJSON('bower.json');
bower.version = pkg.version;
grunt.file.write('bower.json', JSON.stringify(bower, null, 2));
});

grunt.registerTask('default', ['build', 'uglify']);

grunt.loadNpmTasks('grunt-contrib-uglify');
};

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

@@ -0,0 +1,19 @@
Copyright (c) 2010 Dave Perrett, http://recursive-design.com/

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

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

@@ -0,0 +1,159 @@

About
-----

_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).

Installation
------------

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.

This library is also available as a [bower](http://bower.io/) component under the name *jquery-i18n*.

Usage
-----

Before you can do any translation you have to initialise the plugin with a 'dictionary' (basically a property list mapping keys to their translations).

```javascript
var myDictionary = {
"some text": "a translation",
"some more text": "another translation"
}
$.i18n.load(myDictionary);
```

Once you've initialised it with a dictionary, you can translate strings using the $.i18n._() function, for example:

```javascript
$('div#example').text($.i18n._('some text'));
```

or using $('selector')._t() function

```javascript
$('div#example')._t('some text');
```

If you'd like to switch languages, you can unload the current dictionary and load a new one:

```javascript
$.i18n.load('en');
$.i18n.unload();
$.i18n.load('ja');
```

Wildcards
---------

It's straightforward to pass dynamic data into your translations. First, add _%s_ in the translation for each variable you want to swap in :

```javascript
var myDictionary = {
"wildcard example": "We have been passed two values : %s and %s."
}
$.i18n.load(myDictionary);
```

Next, pass values in sequence after the dictionary key when you perform the translation :

```javascript
$('div#example').text($.i18n._('wildcard example', 100, 200));
```

or

```javascript
$('div#example')._t('wildcard example', 100, 200);
```

This will output _We have been passed two values : 100 and 200._

Because some languages will need to order arguments differently to english, you can also specify the order in which the variables appear :

```javascript
var myDictionary = {
"wildcard example": "We have been passed two values : %2$s and %1$s."
}
$.i18n.load(myDictionary);

$('div#example').text($.i18n._('wildcard example', 100, 200));
```

This will output: _We have been passed two values: 200 and 100._

If you need to explicitly output the string _%s_ in your translation, use _%%s_ :

```javascript
var myDictionary = {
"wildcard example": "I have %s literal %%s character."
}
$.i18n.load(myDictionary);

$('div#example').text($.i18n._('wildcard example', 1));
```

This will output: _I have 1 literal %%s character._


Identifying missing translations
---------

When loading the dictionary, you can pass a second `missingPattern` parameter, which will be used to format any missing translations.

```javascript
$.i18n.load({ a_key: 'translated string' }, "{{ %s }}");
// The following line will output '{{ another_key }}'
$.i18n._('another_key')
```

This allows you scan for the given pattern to identify missing translations.


Building From Scratch
---------------------

Use `npm install` to install the dependencies, and `grunt` to run the build.


Change history
-----------

* **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)).
* **Version 1.1.1 (2014-01-05)** : Use `html()` instead of `text()` when rendering translations.
* **Version 1.1.0 (2013-12-31)** : Use grunt, update `printf` implementation, `setDictionary` is now `load` (thanks to [ktmud](https://github.com/ktmud)).
* **Version 1.0.1 (2013-10-11)** : Add bower support.
* **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.

Bug Reports
-----------

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.


Contributing
------------

Once you've made your commits:

1. [Fork](http://help.github.com/fork-a-repo/) jquery-i18n
2. Create a topic branch - `git checkout -b my_branch`
3. Push to your branch - `git push origin my_branch`
4. Create a [Pull Request](http://help.github.com/pull-requests/) from your branch
5. That's it!


Author
------

Dave Perrett :: hello@daveperrett.com :: [@daveperrett](http://twitter.com/daveperrett)


Copyright
---------

Copyright (c) 2010 Dave Perrett. See [License](https://github.com/recurser/jquery-i18n/blob/master/LICENSE) for details.




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

@@ -0,0 +1,23 @@
<!doctype html>
<html>
<head>
<title>jasmine-sinon specs</title>
<link rel="stylesheet" href="lib/jasmine-1.2.0/jasmine.css">
<script src="lib/jasmine-1.2.0/jasmine.js"></script>
<script src="lib/jasmine-1.2.0/jasmine-html.js"></script>

<script src="examples/jquery-1.4.2.js"></script>

<script src="src/jquery.i18n.js"></script>
<script src="specs/jquery.i18n.spec.js"></script>

</head>
<body>

<script type="text/javascript">
jasmine.getEnv().addReporter(new jasmine.TrivialReporter());
jasmine.getEnv().execute();
</script>

</body>
</html>

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

@@ -0,0 +1,23 @@
{
"name": "jquery-i18n",
"version": "1.1.2",
"homepage": "https://github.com/recurser/jquery-i18n",
"authors": [
"Dave Perrett <hello@daveperrett.com>"
],
"description": "A jQuery plugin for doing client-side translations in javascript.",
"main": "jquery.i18n.js",
"keywords": [
"jquery",
"i18n",
"translation"
],
"license": "MIT",
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"test",
"tests"
]
}

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

@@ -0,0 +1,81 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf8" />
<title>jQuery i18n Plugin</title>
<script type="text/javascript" src="jquery-1.4.2.js"></script>
<script type="text/javascript" src="../jquery.i18n.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
i18n_dict = {
"Example 1" : "teiän veen",
"Example 2" : "tei'än ve'en",
"Example 3" : "teiä vede",
"Example 4" : "teirän veren",
"Example 5" : "teilän velen",
"Example 6" : "teijjän vejen",
"Example 7" : "teidän veden",
"Example 8" : "teitän veten",
"Example 9" : "teiðän veðen",
"Example 10" : "teidhän vethen",
"Dynamic Content" : "Your browser window is %s x %s",
"Ordered Dynamic Content" : "%2$s is the height of your browser window, and %1$s is the width.",
"HTML Content" : "Your browser window is <b><i>%s</i></b> x <b><i>%s</i></b>"
};
$.i18n.load(i18n_dict);
$('input#translate_button').click( function(event) {
$('div#example1')._t('Example 1');
$('div#example2')._t('Example 2');
$('div#example3')._t('Example 3');
$('div#example4')._t('Example 4');
$('div#example5')._t('Example 5');
$('div#example6')._t('Example 6');
$('div#example7')._t('Example 7');
$('div#example8')._t('Example 8');
$('div#example9')._t('Example 9');
$('div#example10')._t('Example 10');
$('div#dynamic')._t('Dynamic Content', $(document).width(), $(document).height());
$('div#orderedDynamic')._t('Ordered Dynamic Content', $(document).width(), $(document).height());
$('div#html')._t('HTML Content', $(document).width(), $(document).height());
});
});
</script>
<style type="text/css">
body {
font-size: 30px;
text-align: center;
}
input {
font-size: 30px;
}
p {
font-size: 17px;
}
</style>
<body>
<p>
Click the button to translate the following text into some random Finnish from the
<a href='http://en.wikipedia.org/wiki/Finnish_phonology'>Wikipedia Finnish Phonology Article</a>
</p>
<div id='example1'>Example 1</div>
<div id='example2'>Example 2</div>
<div id='example3'>Example 3</div>
<div id='example4'>Example 4</div>
<div id='example5'>Example 5</div>
<div id='example6'>Example 6</div>
<div id='example7'>Example 7</div>
<div id='example8'>Example 8</div>
<div id='example9'>Example 9</div>
<div id='example10'>Example 10</div>
<div id='dynamic'>Dynamic Content</div>
<div id='orderedDynamic'>Ordered Dynamic Content</div>
<div id='html'>HTML Content</div>
<input type='button' id='translate_button' value='Internationalize!' />
</body>
</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 @@
/*!
* jQuery i18n plugin
* @requires jQuery v1.1 or later
*
* See https://github.com/recurser/jquery-i18n
*
* Licensed under the MIT license.
*
* Version: 1.1.2 (Fri, 11 Aug 2017 03:52:21 GMT)
*/
(function($) {
/**
* i18n provides a mechanism for translating strings using a jscript dictionary.
*
*/

var __slice = Array.prototype.slice;

/*
* i18n property list
*/
var i18n = {

dict: null,
missingPattern: null,

/**
* load()
*
* Load translations.
*
* @param property_list i18nDict : The dictionary to use for translation.
*/
load: function(i18nDict, missingPattern) {
if (this.dict !== null) {
$.extend(this.dict, i18nDict);
} else {
this.dict = i18nDict;
}

if (missingPattern) {
this.missingPattern = missingPattern;
}
},

/**
* unload()
*
* Unloads translations and clears the dictionary.
*/
unload: function() {
this.dict = null;
this.missingPattern = null;
},

/**
* _()
*
* Looks the given string up in the dictionary and returns the translation if
* one exists. If a translation is not found, returns the original word.
*
* @param string str : The string to translate.
* @param property_list params.. : params for using printf() on the string.
*
* @return string : Translated word.
*/
_: function (str) {
dict = this.dict;
if (dict && dict.hasOwnProperty(str)) {
str = dict[str];
} else if (this.missingPattern !== null) {
return this.printf(this.missingPattern, str);
}
args = __slice.call(arguments);
args[0] = str;
// Substitute any params.
return this.printf.apply(this, args);
},

/*
* printf()
*
* Substitutes %s with parameters given in list. %%s is used to escape %s.
*
* @param string str : String to perform printf on.
* @param string args : Array of arguments for printf.
*
* @return string result : Substituted string
*/
printf: function(str, args) {
if (arguments.length < 2) return str;
args = $.isArray(args) ? args : __slice.call(arguments, 1);
return str.replace(/([^%]|^)%(?:(\d+)\$)?s/g, function(p0, p, position) {
if (position) {
return p + args[parseInt(position)-1];
}
return p + args.shift();
}).replace(/%%s/g, '%s');
}

};

/*
* _t()
*
* Allows you to translate a jQuery selector.
*
* eg $('h1')._t('some text')
*
* @param string str : The string to translate .
* @param property_list params : Params for using printf() on the string.
*
* @return element : Chained and translated element(s).
*/
$.fn._t = function(str, params) {
return $(this).html(i18n._.apply(i18n, arguments));
};

$.i18n = i18n;
})(jQuery);

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

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

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

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

@@ -0,0 +1,616 @@
jasmine.HtmlReporterHelpers = {};

jasmine.HtmlReporterHelpers.createDom = function(type, attrs, childrenVarArgs) {
var el = document.createElement(type);

for (var i = 2; i < arguments.length; i++) {
var child = arguments[i];

if (typeof child === 'string') {
el.appendChild(document.createTextNode(child));
} else {
if (child) {
el.appendChild(child);
}
}
}

for (var attr in attrs) {
if (attr == "className") {
el[attr] = attrs[attr];
} else {
el.setAttribute(attr, attrs[attr]);
}
}

return el;
};

jasmine.HtmlReporterHelpers.getSpecStatus = function(child) {
var results = child.results();
var status = results.passed() ? 'passed' : 'failed';
if (results.skipped) {
status = 'skipped';
}

return status;
};

jasmine.HtmlReporterHelpers.appendToSummary = function(child, childElement) {
var parentDiv = this.dom.summary;
var parentSuite = (typeof child.parentSuite == 'undefined') ? 'suite' : 'parentSuite';
var parent = child[parentSuite];

if (parent) {
if (typeof this.views.suites[parent.id] == 'undefined') {
this.views.suites[parent.id] = new jasmine.HtmlReporter.SuiteView(parent, this.dom, this.views);
}
parentDiv = this.views.suites[parent.id].element;
}

parentDiv.appendChild(childElement);
};


jasmine.HtmlReporterHelpers.addHelpers = function(ctor) {
for(var fn in jasmine.HtmlReporterHelpers) {
ctor.prototype[fn] = jasmine.HtmlReporterHelpers[fn];
}
};

jasmine.HtmlReporter = function(_doc) {
var self = this;
var doc = _doc || window.document;

var reporterView;

var dom = {};

// Jasmine Reporter Public Interface
self.logRunningSpecs = false;

self.reportRunnerStarting = function(runner) {
var specs = runner.specs() || [];

if (specs.length == 0) {
return;
}

createReporterDom(runner.env.versionString());
doc.body.appendChild(dom.reporter);

reporterView = new jasmine.HtmlReporter.ReporterView(dom);
reporterView.addSpecs(specs, self.specFilter);
};

self.reportRunnerResults = function(runner) {
reporterView && reporterView.complete();
};

self.reportSuiteResults = function(suite) {
reporterView.suiteComplete(suite);
};

self.reportSpecStarting = function(spec) {
if (self.logRunningSpecs) {
self.log('>> Jasmine Running ' + spec.suite.description + ' ' + spec.description + '...');
}
};

self.reportSpecResults = function(spec) {
reporterView.specComplete(spec);
};

self.log = function() {
var console = jasmine.getGlobal().console;
if (console && console.log) {
if (console.log.apply) {
console.log.apply(console, arguments);
} else {
console.log(arguments); // ie fix: console.log.apply doesn't exist on ie
}
}
};

self.specFilter = function(spec) {
if (!focusedSpecName()) {
return true;
}

return spec.getFullName().indexOf(focusedSpecName()) === 0;
};

return self;

function focusedSpecName() {
var specName;

(function memoizeFocusedSpec() {
if (specName) {
return;
}

var paramMap = [];
var params = doc.location.search.substring(1).split('&');

for (var i = 0; i < params.length; i++) {
var p = params[i].split('=');
paramMap[decodeURIComponent(p[0])] = decodeURIComponent(p[1]);
}

specName = paramMap.spec;
})();

return specName;
}

function createReporterDom(version) {
dom.reporter = self.createDom('div', { id: 'HTMLReporter', className: 'jasmine_reporter' },
dom.banner = self.createDom('div', { className: 'banner' },
self.createDom('span', { className: 'title' }, "Jasmine "),
self.createDom('span', { className: 'version' }, version)),

dom.symbolSummary = self.createDom('ul', {className: 'symbolSummary'}),
dom.alert = self.createDom('div', {className: 'alert'}),
dom.results = self.createDom('div', {className: 'results'},
dom.summary = self.createDom('div', { className: 'summary' }),
dom.details = self.createDom('div', { id: 'details' }))
);
}
};
jasmine.HtmlReporterHelpers.addHelpers(jasmine.HtmlReporter);jasmine.HtmlReporter.ReporterView = function(dom) {
this.startedAt = new Date();
this.runningSpecCount = 0;
this.completeSpecCount = 0;
this.passedCount = 0;
this.failedCount = 0;
this.skippedCount = 0;

this.createResultsMenu = function() {
this.resultsMenu = this.createDom('span', {className: 'resultsMenu bar'},
this.summaryMenuItem = this.createDom('a', {className: 'summaryMenuItem', href: "#"}, '0 specs'),
' | ',
this.detailsMenuItem = this.createDom('a', {className: 'detailsMenuItem', href: "#"}, '0 failing'));

this.summaryMenuItem.onclick = function() {
dom.reporter.className = dom.reporter.className.replace(/ showDetails/g, '');
};

this.detailsMenuItem.onclick = function() {
showDetails();
};
};

this.addSpecs = function(specs, specFilter) {
this.totalSpecCount = specs.length;

this.views = {
specs: {},
suites: {}
};

for (var i = 0; i < specs.length; i++) {
var spec = specs[i];
this.views.specs[spec.id] = new jasmine.HtmlReporter.SpecView(spec, dom, this.views);
if (specFilter(spec)) {
this.runningSpecCount++;
}
}
};

this.specComplete = function(spec) {
this.completeSpecCount++;

if (isUndefined(this.views.specs[spec.id])) {
this.views.specs[spec.id] = new jasmine.HtmlReporter.SpecView(spec, dom);
}

var specView = this.views.specs[spec.id];

switch (specView.status()) {
case 'passed':
this.passedCount++;
break;

case 'failed':
this.failedCount++;
break;

case 'skipped':
this.skippedCount++;
break;
}

specView.refresh();
this.refresh();
};

this.suiteComplete = function(suite) {
var suiteView = this.views.suites[suite.id];
if (isUndefined(suiteView)) {
return;
}
suiteView.refresh();
};

this.refresh = function() {

if (isUndefined(this.resultsMenu)) {
this.createResultsMenu();
}

// currently running UI
if (isUndefined(this.runningAlert)) {
this.runningAlert = this.createDom('a', {href: "?", className: "runningAlert bar"});
dom.alert.appendChild(this.runningAlert);
}
this.runningAlert.innerHTML = "Running " + this.completeSpecCount + " of " + specPluralizedFor(this.totalSpecCount);

// skipped specs UI
if (isUndefined(this.skippedAlert)) {
this.skippedAlert = this.createDom('a', {href: "?", className: "skippedAlert bar"});
}

this.skippedAlert.innerHTML = "Skipping " + this.skippedCount + " of " + specPluralizedFor(this.totalSpecCount) + " - run all";

if (this.skippedCount === 1 && isDefined(dom.alert)) {
dom.alert.appendChild(this.skippedAlert);
}

// passing specs UI
if (isUndefined(this.passedAlert)) {
this.passedAlert = this.createDom('span', {href: "?", className: "passingAlert bar"});
}
this.passedAlert.innerHTML = "Passing " + specPluralizedFor(this.passedCount);

// failing specs UI
if (isUndefined(this.failedAlert)) {
this.failedAlert = this.createDom('span', {href: "?", className: "failingAlert bar"});
}
this.failedAlert.innerHTML = "Failing " + specPluralizedFor(this.failedCount);

if (this.failedCount === 1 && isDefined(dom.alert)) {
dom.alert.appendChild(this.failedAlert);
dom.alert.appendChild(this.resultsMenu);
}

// summary info
this.summaryMenuItem.innerHTML = "" + specPluralizedFor(this.runningSpecCount);
this.detailsMenuItem.innerHTML = "" + this.failedCount + " failing";
};

this.complete = function() {
dom.alert.removeChild(this.runningAlert);

this.skippedAlert.innerHTML = "Ran " + this.runningSpecCount + " of " + specPluralizedFor(this.totalSpecCount) + " - run all";

if (this.failedCount === 0) {
dom.alert.appendChild(this.createDom('span', {className: 'passingAlert bar'}, "Passing " + specPluralizedFor(this.passedCount)));
} else {
showDetails();
}

dom.banner.appendChild(this.createDom('span', {className: 'duration'}, "finished in " + ((new Date().getTime() - this.startedAt.getTime()) / 1000) + "s"));
};

return this;

function showDetails() {
if (dom.reporter.className.search(/showDetails/) === -1) {
dom.reporter.className += " showDetails";
}
}

function isUndefined(obj) {
return typeof obj === 'undefined';
}

function isDefined(obj) {
return !isUndefined(obj);
}

function specPluralizedFor(count) {
var str = count + " spec";
if (count > 1) {
str += "s"
}
return str;
}

};

jasmine.HtmlReporterHelpers.addHelpers(jasmine.HtmlReporter.ReporterView);


jasmine.HtmlReporter.SpecView = function(spec, dom, views) {
this.spec = spec;
this.dom = dom;
this.views = views;

this.symbol = this.createDom('li', { className: 'pending' });
this.dom.symbolSummary.appendChild(this.symbol);

this.summary = this.createDom('div', { className: 'specSummary' },
this.createDom('a', {
className: 'description',
href: '?spec=' + encodeURIComponent(this.spec.getFullName()),
title: this.spec.getFullName()
}, this.spec.description)
);

this.detail = this.createDom('div', { className: 'specDetail' },
this.createDom('a', {
className: 'description',
href: '?spec=' + encodeURIComponent(this.spec.getFullName()),
title: this.spec.getFullName()
}, this.spec.getFullName())
);
};

jasmine.HtmlReporter.SpecView.prototype.status = function() {
return this.getSpecStatus(this.spec);
};

jasmine.HtmlReporter.SpecView.prototype.refresh = function() {
this.symbol.className = this.status();

switch (this.status()) {
case 'skipped':
break;

case 'passed':
this.appendSummaryToSuiteDiv();
break;

case 'failed':
this.appendSummaryToSuiteDiv();
this.appendFailureDetail();
break;
}
};

jasmine.HtmlReporter.SpecView.prototype.appendSummaryToSuiteDiv = function() {
this.summary.className += ' ' + this.status();
this.appendToSummary(this.spec, this.summary);
};

jasmine.HtmlReporter.SpecView.prototype.appendFailureDetail = function() {
this.detail.className += ' ' + this.status();

var resultItems = this.spec.results().getItems();
var messagesDiv = this.createDom('div', { className: 'messages' });

for (var i = 0; i < resultItems.length; i++) {
var result = resultItems[i];

if (result.type == 'log') {
messagesDiv.appendChild(this.createDom('div', {className: 'resultMessage log'}, result.toString()));
} else if (result.type == 'expect' && result.passed && !result.passed()) {
messagesDiv.appendChild(this.createDom('div', {className: 'resultMessage fail'}, result.message));

if (result.trace.stack) {
messagesDiv.appendChild(this.createDom('div', {className: 'stackTrace'}, result.trace.stack));
}
}
}

if (messagesDiv.childNodes.length > 0) {
this.detail.appendChild(messagesDiv);
this.dom.details.appendChild(this.detail);
}
};

jasmine.HtmlReporterHelpers.addHelpers(jasmine.HtmlReporter.SpecView);jasmine.HtmlReporter.SuiteView = function(suite, dom, views) {
this.suite = suite;
this.dom = dom;
this.views = views;

this.element = this.createDom('div', { className: 'suite' },
this.createDom('a', { className: 'description', href: '?spec=' + encodeURIComponent(this.suite.getFullName()) }, this.suite.description)
);

this.appendToSummary(this.suite, this.element);
};

jasmine.HtmlReporter.SuiteView.prototype.status = function() {
return this.getSpecStatus(this.suite);
};

jasmine.HtmlReporter.SuiteView.prototype.refresh = function() {
this.element.className += " " + this.status();
};

jasmine.HtmlReporterHelpers.addHelpers(jasmine.HtmlReporter.SuiteView);

/* @deprecated Use jasmine.HtmlReporter instead
*/
jasmine.TrivialReporter = function(doc) {
this.document = doc || document;
this.suiteDivs = {};
this.logRunningSpecs = false;
};

jasmine.TrivialReporter.prototype.createDom = function(type, attrs, childrenVarArgs) {
var el = document.createElement(type);

for (var i = 2; i < arguments.length; i++) {
var child = arguments[i];

if (typeof child === 'string') {
el.appendChild(document.createTextNode(child));
} else {
if (child) { el.appendChild(child); }
}
}

for (var attr in attrs) {
if (attr == "className") {
el[attr] = attrs[attr];
} else {
el.setAttribute(attr, attrs[attr]);
}
}

return el;
};

jasmine.TrivialReporter.prototype.reportRunnerStarting = function(runner) {
var showPassed, showSkipped;

this.outerDiv = this.createDom('div', { id: 'TrivialReporter', className: 'jasmine_reporter' },
this.createDom('div', { className: 'banner' },
this.createDom('div', { className: 'logo' },
this.createDom('span', { className: 'title' }, "Jasmine"),
this.createDom('span', { className: 'version' }, runner.env.versionString())),
this.createDom('div', { className: 'options' },
"Show ",
showPassed = this.createDom('input', { id: "__jasmine_TrivialReporter_showPassed__", type: 'checkbox' }),
this.createDom('label', { "for": "__jasmine_TrivialReporter_showPassed__" }, " passed "),
showSkipped = this.createDom('input', { id: "__jasmine_TrivialReporter_showSkipped__", type: 'checkbox' }),
this.createDom('label', { "for": "__jasmine_TrivialReporter_showSkipped__" }, " skipped")
)
),

this.runnerDiv = this.createDom('div', { className: 'runner running' },
this.createDom('a', { className: 'run_spec', href: '?' }, "run all"),
this.runnerMessageSpan = this.createDom('span', {}, "Running..."),