-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
48 changed files
with
1,166 additions
and
3,461 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# coding: utf-8 | ||
import os | ||
|
||
|
||
# TODO: tests & docstring | ||
class ConfLoader(object): | ||
class ConfigNotFound(Exception): | ||
def __init__(self, key): | ||
self.key = key | ||
|
||
@property | ||
def message(self): | ||
return u"ConfigNotFound: {}".format(self.key) | ||
|
||
def __init__(self, settings=None, env_fmt=None, env=True, | ||
raise_missing=True, **defaults): | ||
self._defaults = defaults or {} | ||
self.env = env | ||
self.env_fmt = env_fmt or "{}" | ||
self.raise_missing = raise_missing | ||
self.settings = settings | ||
|
||
def _get_from_env(self, key): | ||
env_key = self.env_fmt.format(key) | ||
return os.environ.get(env_key, None) | ||
|
||
# TODO: caching? | ||
def __getitem__(self, item): | ||
try: | ||
if self.settings and hasattr(self.settings, item): | ||
return getattr(self.settings, item) | ||
elif self.env: | ||
env_value = self._get_from_env(item) | ||
if env_value is not None: | ||
return env_value | ||
return self._defaults[item] | ||
except KeyError: | ||
if self.raise_missing: | ||
raise ConfLoader.ConfigNotFound(item) | ||
return None | ||
|
||
def __getattr__(self, key): | ||
return self[key] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# coding: utf-8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# coding: utf-8 | ||
|
||
from django.conf import settings | ||
|
||
from common.conf_loader import ConfLoader | ||
|
||
|
||
def google_tools_config(request): | ||
config = ConfLoader(settings, raise_missing=False) | ||
|
||
google_tools = dict() | ||
|
||
if config.GOOGLE_SITE_VERIFICATION: # and not settings.DEBUG: | ||
google_tools['site_verification'] = config.GOOGLE_SITE_VERIFICATION | ||
|
||
if config.GOOGLE_ANALYTICS_TRACKING_ID: # and not settings.DEBUG: | ||
google_tools['analytics'] = { | ||
'tracking_id': config.GOOGLE_ANALYTICS_TRACKING_ID, | ||
'domain': config.GOOGLE_ANALYTICS_DOMAIN | ||
} | ||
|
||
return dict(google_tools=google_tools) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{% if google_tools %}{% if google_tools.site_verification %} | ||
<meta name="google-site-verification" content="{{ google_tools.site_verification }}"/> | ||
{% endif %}{% if google_tools.analytics %} | ||
<script> | ||
(function (i, s, o, g, r, a, m) { | ||
i['GoogleAnalyticsObject'] = r; | ||
i[r] = i[r] || function () { | ||
(i[r].q = i[r].q || []).push(arguments) | ||
}, i[r].l = 1 * new Date(); | ||
a = s.createElement(o), | ||
m = s.getElementsByTagName(o)[0]; | ||
a.async = 1; | ||
a.src = g; | ||
m.parentNode.insertBefore(a, m) | ||
})(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga'); | ||
|
||
ga('create', '{{ google_tools.analytics.tracking_id }}', '{{ google_tools.analytics.domain|default:"auto" }}'); | ||
ga('send', 'pageview'); | ||
</script>{% endif %}{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ msgid "" | |
msgstr "" | ||
"Project-Id-Version: PACKAGE VERSION\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"POT-Creation-Date: 2015-09-14 10:29+0200\n" | ||
"POT-Creation-Date: 2015-09-16 12:32+0200\n" | ||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" | ||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" | ||
"Language-Team: LANGUAGE <[email protected]>\n" | ||
|
@@ -131,60 +131,48 @@ msgstr "Schicht" | |
msgid "shifts" | ||
msgstr "Schichten" | ||
|
||
#: scheduler/models.py:20 scheduler/models.py:90 | ||
#: scheduler/models.py:20 scheduler/models.py:67 | ||
msgid "helptype" | ||
msgstr "Hilfebereich" | ||
|
||
#: scheduler/models.py:20 | ||
msgid "helptype_text" | ||
msgstr "Jeder Hilfebereich hat so viele Planelemente wie es Arbeitsschichten geben soll. Dies ist EINE Arbeitsschicht für einen bestimmten Tag" | ||
|
||
#: scheduler/models.py:21 scheduler/models.py:125 | ||
#: scheduler/models.py:21 scheduler/models.py:90 | ||
msgid "location" | ||
msgstr "Ort" | ||
|
||
#: scheduler/models.py:23 | ||
msgid "starting time" | ||
msgstr "Beginn" | ||
|
||
#: scheduler/models.py:24 | ||
msgid "time from" | ||
msgstr "Anfangszeit" | ||
msgid "ending time" | ||
msgstr "Ende" | ||
|
||
#: scheduler/models.py:29 | ||
#: scheduler/models.py:28 | ||
msgid "number of needed volunteers" | ||
msgstr "Anz. benötigter Freiwillige" | ||
|
||
#: scheduler/models.py:34 | ||
msgid "assigned volunteers" | ||
msgstr "Reg. Freiwillige" | ||
|
||
#: scheduler/models.py:39 | ||
msgid "volunteers" | ||
msgstr "Freiwillige" | ||
|
||
#: scheduler/models.py:91 | ||
#: scheduler/models.py:68 | ||
msgid "helptypes" | ||
msgstr "Hilfebereiche" | ||
|
||
#: scheduler/models.py:106 | ||
msgid "timeperiod" | ||
msgstr "Zeitspanne" | ||
|
||
#: scheduler/models.py:107 | ||
msgid "timeperiods" | ||
msgstr "Zeitspannen" | ||
|
||
#: scheduler/models.py:126 | ||
#: scheduler/models.py:91 | ||
msgid "locations" | ||
msgstr "Orte" | ||
|
||
#: scheduler/views.py:79 | ||
#: scheduler/views.py:84 | ||
msgid "The submitted data was invalid." | ||
msgstr "Die eingegebenen Daten sind ungültig." | ||
|
||
#: scheduler/views.py:90 | ||
#: scheduler/views.py:97 | ||
#, python-brace-format | ||
msgid "We can't add you to this shift because you've already agreed to other shifts at the same time: {conflicts}" | ||
msgstr "Sie können der Schicht nicht beitreten, da Sie bereits an anderen mit überschneidenden Zeiten teilnehmen: {conflicts}" | ||
|
||
#: scheduler/views.py:93 | ||
#: scheduler/views.py:102 | ||
msgid "You were successfully added to this shift." | ||
msgstr "Sie haben sich erfolgreich für die Schicht angemeldet." | ||
|
||
|
@@ -208,11 +196,11 @@ msgstr "Organisation" | |
msgid "email" | ||
msgstr "E-Mail" | ||
|
||
#: volunteer_planner/settings/base.py:130 | ||
#: volunteer_planner/settings/base.py:131 | ||
msgid "German" | ||
msgstr "Deutsch" | ||
|
||
#: volunteer_planner/settings/base.py:131 | ||
#: volunteer_planner/settings/base.py:132 | ||
msgid "English" | ||
msgstr "Englisch" | ||
|
||
|
Oops, something went wrong.