diff --git a/bornhack/settings/base.py b/bornhack/settings/base.py index db1ebbcc..9344ccce 100644 --- a/bornhack/settings/base.py +++ b/bornhack/settings/base.py @@ -1,5 +1,8 @@ import os +import environ +env = environ.Env() +environ.Env.read_env() def local_dir(entry): return os.path.join( @@ -23,7 +26,9 @@ INSTALLED_APPS = [ 'profiles', 'camps', - 'tickets', + 'shop', + 'news', + 'utils', 'allauth', 'allauth.account', @@ -33,9 +38,8 @@ INSTALLED_APPS = [ STATIC_URL = '/static/' STATIC_ROOT = local_dir('static') STATICFILES_DIRS = [local_dir('static_src')] -MEDIA_URL = '/media/' -MEDIA_ROOT = local_dir('media') - +#MEDIA_URL = '/media/' +MEDIA_ROOT = env('MEDIA_ROOT') LANGUAGE_CODE = 'en-us' TIME_ZONE = 'UTC' USE_I18N = True @@ -53,6 +57,9 @@ TEMPLATES = [ 'django.template.context_processors.request', 'django.contrib.auth.context_processors.auth', 'django.contrib.messages.context_processors.messages', + 'camps.context_processors.current_camp', + 'shop.context_processors.current_order', + 'shop.context_processors.user_has_tickets', ], }, }, @@ -82,6 +89,7 @@ ACCOUNT_EMAIL_REQUIRED = True ACCOUNT_EMAIL_VERIFICATION = True ACCOUNT_EMAIL_SUBJECT_PREFIX = '[bornhack] ' ACCOUNT_USERNAME_REQUIRED = False +LOGIN_REDIRECT_URL='/shop/' LOGIN_URL = '/login/' ACCOUNT_DEFAULT_HTTP_PROTOCOL = 'https' @@ -90,3 +98,20 @@ BOOTSTRAP3 = { 'jquery_url': '/static/js/jquery.min.js', 'javascript_url': '/static/js/bootstrap.min.js' } + +EPAY_MERCHANT_NUMBER = env('EPAY_MERCHANT_NUMBER') +EPAY_MD5_SECRET = env('EPAY_MD5_SECRET') + +TICKET_CATEGORY_ID = env('TICKET_CATEGORY_ID') + +COINIFY_API_KEY = env('COINIFY_API_KEY') +COINIFY_API_SECRET = env('COINIFY_API_SECRET') +COINIFY_IPN_SECRET = env('COINIFY_IPN_SECRET') + +LETTERHEAD_PDF_PATH = os.path.join(local_dir('static_src'), 'pdf', env('PDF_LETTERHEAD_FILENAME')) +PDF_ARCHIVE_PATH='/usr/local/www/pdf_archive/' + +BANKACCOUNT_IBAN = env('BANKACCOUNT_IBAN') +BANKACCOUNT_SWIFTBIC = env('BANKACCOUNT_SWIFTBIC') +BANKACCOUNT_REG = env('BANKACCOUNT_REG') +BANKACCOUNT_ACCOUNT = env('BANKACCOUNT_ACCOUNT') diff --git a/bornhack/settings/env.dist b/bornhack/settings/env.dist index 23b99a18..262086a7 100644 --- a/bornhack/settings/env.dist +++ b/bornhack/settings/env.dist @@ -7,3 +7,17 @@ EMAIL_HOST_USER='mymailuser' EMAIL_HOST_PASSWORD='mymailpassword' EMAIL_USE_TLS=True EMAIL_FROM='noreply@example.com' +ARCHIVE_EMAIL='archive@example.com' +EPAY_MERCHANT_NUMBER=something +EPAY_MD5_SECRET=something +TICKET_CATEGORY_ID='' +COINIFY_API_KEY='' +COINIFY_API_SECRET='' +COINIFY_IPN_SECRET='' +PDF_LETTERHEAD_FILENAME='' +MEDIA_ROOT='' +BANKACCOUNT_IBAN='' +BANKACCOUNT_SWIFTBIC='' +BANKACCOUNT_REG='' +BANKACCOUNT_ACCOUNT='' + diff --git a/bornhack/settings/production.py b/bornhack/settings/production.py index f6435415..ca93b6ce 100644 --- a/bornhack/settings/production.py +++ b/bornhack/settings/production.py @@ -20,3 +20,31 @@ EMAIL_HOST_PASSWORD = env('EMAIL_HOST_PASSWORD') EMAIL_USE_TLS = env('EMAIL_USE_TLS') DEFAULT_FROM_EMAIL = env('DEFAULT_FROM_EMAIL') SERVER_EMAIL = env('DEFAULT_FROM_EMAIL') +ARCHIVE_EMAIL = env('ARCHIVE_EMAIL') + +LOGGING = { + 'version': 1, + 'disable_existing_loggers': False, + 'handlers': { + 'mail_admins': { + 'level': 'ERROR', + 'class': 'django.utils.log.AdminEmailHandler', + }, + 'console': { + 'level':'DEBUG', + 'class':'logging.StreamHandler', + }, + }, + 'loggers': { + 'django.request': { + 'handlers': ['mail_admins'], + 'level': 'ERROR', + 'propagate': True, + }, + } +} + +ADMINS = ( + ('bornhack sysadm', 'sysadm@bornhack.org'), +) + diff --git a/bornhack/static_src/css/bornhack.css b/bornhack/static_src/css/bornhack.css index cc035e18..0af22276 100644 --- a/bornhack/static_src/css/bornhack.css +++ b/bornhack/static_src/css/bornhack.css @@ -1,5 +1,6 @@ body { margin-top: 90px; + margin-bottom: 35px; } * { @@ -82,7 +83,29 @@ a, a:active, a:focus { color: rgb(255, 255, 255); } +.btn-grey { + background-color: #777; + color: rgb(255, 255, 255); +} + #map { height: 500px; } +.thumbnail { + height: 350px; +} + +/* Footer */ +footer { + position: fixed; + width: 700px; + text-align: center; + background-color: white; + bottom: 0px; + padding: 5px; +} + +.breadcrumb > li.no-before::before { + content: ""; +} diff --git a/bornhack/static_src/fonts/glyphicons-halflings-regular.eot b/bornhack/static_src/fonts/glyphicons-halflings-regular.eot new file mode 100644 index 00000000..b93a4953 Binary files /dev/null and b/bornhack/static_src/fonts/glyphicons-halflings-regular.eot differ diff --git a/bornhack/static_src/fonts/glyphicons-halflings-regular.svg b/bornhack/static_src/fonts/glyphicons-halflings-regular.svg new file mode 100644 index 00000000..94fb5490 --- /dev/null +++ b/bornhack/static_src/fonts/glyphicons-halflings-regular.svg @@ -0,0 +1,288 @@ + + + \ No newline at end of file diff --git a/bornhack/static_src/fonts/glyphicons-halflings-regular.ttf b/bornhack/static_src/fonts/glyphicons-halflings-regular.ttf new file mode 100644 index 00000000..1413fc60 Binary files /dev/null and b/bornhack/static_src/fonts/glyphicons-halflings-regular.ttf differ diff --git a/bornhack/static_src/fonts/glyphicons-halflings-regular.woff b/bornhack/static_src/fonts/glyphicons-halflings-regular.woff new file mode 100644 index 00000000..9e612858 Binary files /dev/null and b/bornhack/static_src/fonts/glyphicons-halflings-regular.woff differ diff --git a/bornhack/static_src/fonts/glyphicons-halflings-regular.woff2 b/bornhack/static_src/fonts/glyphicons-halflings-regular.woff2 new file mode 100644 index 00000000..64539b54 Binary files /dev/null and b/bornhack/static_src/fonts/glyphicons-halflings-regular.woff2 differ diff --git a/bornhack/static_src/pdf/bornhack_2016_letterhead.odt b/bornhack/static_src/pdf/bornhack_2016_letterhead.odt new file mode 100644 index 00000000..eedeace4 Binary files /dev/null and b/bornhack/static_src/pdf/bornhack_2016_letterhead.odt differ diff --git a/bornhack/static_src/pdf/bornhack_2016_letterhead.pdf b/bornhack/static_src/pdf/bornhack_2016_letterhead.pdf new file mode 100644 index 00000000..5ca82cb7 Binary files /dev/null and b/bornhack/static_src/pdf/bornhack_2016_letterhead.pdf differ diff --git a/bornhack/static_src/pdf/bornhack_2016_test_letterhead.odt b/bornhack/static_src/pdf/bornhack_2016_test_letterhead.odt new file mode 100644 index 00000000..6f01b349 Binary files /dev/null and b/bornhack/static_src/pdf/bornhack_2016_test_letterhead.odt differ diff --git a/bornhack/static_src/pdf/bornhack_2016_test_letterhead.pdf b/bornhack/static_src/pdf/bornhack_2016_test_letterhead.pdf new file mode 100644 index 00000000..a26b1e03 Binary files /dev/null and b/bornhack/static_src/pdf/bornhack_2016_test_letterhead.pdf differ diff --git a/bornhack/static_src/pdf/bornhack_webshop_cancellation_form.pdf b/bornhack/static_src/pdf/bornhack_webshop_cancellation_form.pdf new file mode 100644 index 00000000..5be7a580 Binary files /dev/null and b/bornhack/static_src/pdf/bornhack_webshop_cancellation_form.pdf differ diff --git a/bornhack/templates/404.html b/bornhack/templates/404.html new file mode 100644 index 00000000..b15561b1 --- /dev/null +++ b/bornhack/templates/404.html @@ -0,0 +1,9 @@ +{% extends 'base.html' %} + +{% block content %} + +
+ 404 page not found. Sorry about that. +
+ +{% endblock %} diff --git a/bornhack/templates/500.html b/bornhack/templates/500.html new file mode 100644 index 00000000..4a9ce4c7 --- /dev/null +++ b/bornhack/templates/500.html @@ -0,0 +1,9 @@ +{% extends 'base.html' %} + +{% block content %} + ++ 500 internal server error. Sorry about that. The people responsible have been notified. +
+ +{% endblock %} diff --git a/bornhack/templates/base.html b/bornhack/templates/base.html index 18062297..ced0f9bd 100644 --- a/bornhack/templates/base.html +++ b/bornhack/templates/base.html @@ -37,7 +37,25 @@