diff --git a/datacenterlight/locale/de/LC_MESSAGES/django.po b/datacenterlight/locale/de/LC_MESSAGES/django.po index 6eeb605b..a0c9a470 100644 --- a/datacenterlight/locale/de/LC_MESSAGES/django.po +++ b/datacenterlight/locale/de/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-07-01 02:15+0530\n" +"POT-Creation-Date: 2017-07-02 23:08+0530\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -18,14 +18,6 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: templates/datacenterlight/base.html:72 -msgid "Please enter your name" -msgstr "Bitte gib Deinen Namen ein" - -#: templates/datacenterlight/base.html:73 -msgid "Please enter a valid email address" -msgstr "Bitte gib eine gültige E-Mail-Adresse ein" - #: templates/datacenterlight/beta_access.html:13 msgid "Enter name" msgstr "Name" @@ -264,41 +256,61 @@ msgstr "MwSt. inklusive" msgid "Hosted in Switzerland" msgstr "Standort: Schweiz" -#: templates/datacenterlight/index.html:173 +#: templates/datacenterlight/index.html:161 +msgid "Please enter a value greater than or equal to 1." +msgstr "Bitte gib einen Wert größer oder gleich 1 ein." + +#: templates/datacenterlight/index.html:170 +msgid "Please enter a value greater than or equal to 2." +msgstr "Bitte gib einen Wert größer oder gleich 2 ein." + +#: templates/datacenterlight/index.html:179 +msgid "Please enter a value greater than or equal to 10." +msgstr "Bitte gib einen Wert größer oder gleich 10 ein" + +#: templates/datacenterlight/index.html:180 #: templates/datacenterlight/pricing.html:50 msgid "GB Storage (SSD)" msgstr "GB Storage (SSD)" -#: templates/datacenterlight/index.html:189 +#: templates/datacenterlight/index.html:199 msgid "Name" msgstr "" -#: templates/datacenterlight/index.html:190 +#: templates/datacenterlight/index.html:200 msgid "Your Name" msgstr "Dein Name" -#: templates/datacenterlight/index.html:193 +#: templates/datacenterlight/index.html:200 +msgid "Please enter your name" +msgstr "Bitte gib Deinen Namen ein" + +#: templates/datacenterlight/index.html:214 msgid "Email" msgstr "E-Mail-Adresse" -#: templates/datacenterlight/index.html:194 +#: templates/datacenterlight/index.html:215 msgid "Your Email" msgstr "Deine E-Mail" -#: templates/datacenterlight/index.html:197 +#: templates/datacenterlight/index.html:215 +msgid "Please enter a valid email address" +msgstr "Bitte gib eine gültige E-Mailadresse ein" + +#: templates/datacenterlight/index.html:228 #: templates/datacenterlight/pricing.html:79 msgid "Order Now!" msgstr "Bestelle jetzt!" -#: templates/datacenterlight/index.html:226 +#: templates/datacenterlight/index.html:254 msgid "Switzerland " msgstr "Schweiz" -#: templates/datacenterlight/index.html:243 +#: templates/datacenterlight/index.html:271 msgid "Questions?" msgstr "Fragen?" -#: templates/datacenterlight/index.html:243 +#: templates/datacenterlight/index.html:271 msgid "Contact us!" msgstr "Kontaktiere uns!" @@ -380,6 +392,14 @@ msgstr "" msgid "as soon as possible!" msgstr "" +#: views.py:234 +msgid "is not a proper name" +msgstr "ist kein gültiger Name" + +#: views.py:241 +msgid "is not a proper email" +msgstr "ist keine gültige E-Mailadresse" + #~ msgid "Buy VM" #~ msgstr "VM Kaufen" diff --git a/datacenterlight/static/datacenterlight/css/landing-page.css b/datacenterlight/static/datacenterlight/css/landing-page.css index bcfa3f83..d943a8e9 100755 --- a/datacenterlight/static/datacenterlight/css/landing-page.css +++ b/datacenterlight/static/datacenterlight/css/landing-page.css @@ -430,7 +430,6 @@ h6 { } .pricing-section .card .description{ padding: 12px; - border-bottom: 1px solid rgba(128, 128, 128, 0.3); } .pricing-section .card .descriptions{ padding: 10px 30px; @@ -646,11 +645,10 @@ h6 { } .price-calc-section .card .description{ padding: 12px; - border-bottom: 1px solid rgba(128, 128, 128, 0.3); position: relative; display: flex; - justify-content: space-around; - align-items: center; + justify-content: space-around !important; + align-items: center !important; } .price-calc-section .card .description span { @@ -661,10 +659,10 @@ h6 { width: 30%; text-align: left; } -.price-calc-section .card .description input{ - font-size: 20px; - text-align: center; - width: 60px; +.price-calc-section .card .description .select-number{ + font-size: 20px; + text-align: center; + width: 60px; } .price-calc-section .card .description i{ color: #29427A; @@ -701,8 +699,8 @@ h6 { .price-calc-section .card .check-ip{ font-size: 18px; } -.price-calc-section .card .description.input{ - justify-content: center; +.price-calc-section .card .justify-center{ + justify-content: center !important; } .price-calc-section .card .description.input label{ font-size: 15px; @@ -711,10 +709,11 @@ h6 { margin-bottom: 0; width: 40px; } -.price-calc-section .card .description.input input{ - width: 200px; - font-size: 14px; - text-align: left; +/*Changed class****.price-calc-section .card .description.input input*/ +.price-calc-section .card .description input{ + width: 200px; + font-size: 14px; + text-align: left; padding: 5px 10px; border-radius: 4px; border: 1px solid #d0d0d0; @@ -726,6 +725,18 @@ h6 { font-size: 17px; margin: 0 8px; } +.help-block.with-errors { + text-align: center; + margin: 0; + padding: 0; +} +.has-error .checkbox, .has-error .checkbox-inline, .has-error .control-label, .has-error .help-block, .has-error .radio, .has-error .radio-inline, .has-error.checkbox label, .has-error.checkbox-inline label, .has-error.radio label, .has-error.radio-inline label{ +color: #eb4d5c; +} +.form-group { + margin: 0; + border-bottom: 1px solid rgba(128, 128, 128, 0.3); +} @media(max-width:990px) { .pricing-section .text { @@ -911,7 +922,7 @@ h6 { text-align: center; } - .price-calc-section .card .description input { + .price-calc-section .card .description .select-number{ font-size: 17px; text-align: center; width: 60px; diff --git a/datacenterlight/templates/datacenterlight/base.html b/datacenterlight/templates/datacenterlight/base.html index c62d92f7..2c3f0e5d 100644 --- a/datacenterlight/templates/datacenterlight/base.html +++ b/datacenterlight/templates/datacenterlight/base.html @@ -33,6 +33,9 @@ + + {% include "google_analytics.html" %} + @@ -60,53 +63,5 @@ - - - - - + diff --git a/datacenterlight/templates/datacenterlight/index.html b/datacenterlight/templates/datacenterlight/index.html index 6d63b29b..822858ae 100755 --- a/datacenterlight/templates/datacenterlight/index.html +++ b/datacenterlight/templates/datacenterlight/index.html @@ -139,7 +139,7 @@
-
+ {% csrf_token %}

{% trans "VM hosting" %}

@@ -152,28 +152,37 @@
-
+

{% trans "Hosted in Switzerland" %}

-
+
+
- + Core +
+
-
+
+
- + GB RAM +
+
-
+
+
- + {% trans "GB Storage (SSD)" %} +
+
-
+
-
-
- - -
+
+
+ + +
+
+ {% for message in messages %} + {% if 'name' in message.tags %} +
  • + {{ message|safe }} +
+ {% endif %} + {% endfor %} +
+
+
+
+ + +
+
+ {% for message in messages %} + {% if 'email' in message.tags %} +
  • + {{ message|safe }} +
+ {% endif %} + {% endfor %} +
+
-
-
-
@@ -250,4 +278,4 @@
- {% endblock %} \ No newline at end of file + {% endblock %} diff --git a/datacenterlight/templates/datacenterlight/order_detail.html b/datacenterlight/templates/datacenterlight/order_detail.html index 42f916e3..273074cf 100644 --- a/datacenterlight/templates/datacenterlight/order_detail.html +++ b/datacenterlight/templates/datacenterlight/order_detail.html @@ -67,7 +67,7 @@

{% trans "Disk space"%} {{vm.disk_size}} GB


{% trans "Configuration"%} {{request.session.template.name}}

-
+

{% trans "Total"%}

{{vm.price}} CHF

{% endwith %}
@@ -83,8 +83,8 @@ {% endif %}
- - + + {% include 'google_analytics.html' %} + diff --git a/dynamicweb/settings/base.py b/dynamicweb/settings/base.py index d276f022..ba304ff9 100644 --- a/dynamicweb/settings/base.py +++ b/dynamicweb/settings/base.py @@ -118,6 +118,7 @@ INSTALLED_APPS = ( MIDDLEWARE_CLASSES = ( 'django.contrib.sessions.middleware.SessionMiddleware', + 'utils.middleware.MultipleProxyMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', @@ -138,6 +139,7 @@ TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': [os.path.join(PROJECT_DIR, 'cms_templates/'), + os.path.join(PROJECT_DIR, 'templates'), os.path.join(PROJECT_DIR, 'cms_templates/djangocms_blog/'), os.path.join(PROJECT_DIR, 'membership'), os.path.join(PROJECT_DIR, 'hosting/templates/'), @@ -161,6 +163,7 @@ TEMPLATES = [ "django.contrib.messages.context_processors.messages", 'sekizai.context_processors.sekizai', 'cms.context_processors.cms_settings', + 'utils.context_processor.google_analytics', ], }, }, @@ -509,3 +512,12 @@ OPENNEBULA_ENDPOINT = env('OPENNEBULA_ENDPOINT') # dcl email configurations DCL_TEXT = env('DCL_TEXT') DCL_SUPPORT_FROM_ADDRESS = env('DCL_SUPPORT_FROM_ADDRESS') + +# Settings for Google analytics +GOOGLE_ANALYTICS_PROPERTY_IDS = { + 'datacenterlight.ch': 'UA-62285904-9', + 'digitalglarus.ch': 'UA-62285904-2', + '127.0.0.1:8000': 'localhost', + 'dynamicweb-development.ungleich.ch': 'development', + 'dynamicweb-staging.ungleich.ch': 'staging' +} diff --git a/templates/google_analytics.html b/templates/google_analytics.html new file mode 100644 index 00000000..64dbae40 --- /dev/null +++ b/templates/google_analytics.html @@ -0,0 +1,13 @@ +{% if GOOGLE_ANALYTICS_PROPERTY_ID %} + +{% else %} + +{% endif %} \ No newline at end of file diff --git a/utils/context_processor.py b/utils/context_processor.py new file mode 100644 index 00000000..740591ba --- /dev/null +++ b/utils/context_processor.py @@ -0,0 +1,15 @@ +from django.conf import settings + + +def google_analytics(request): + """ + Use the variables returned in this function to + render your Google Analytics tracking code template. + """ + host = request.get_host() + ga_prop_id = getattr(settings, 'GOOGLE_ANALYTICS_PROPERTY_IDS', False).get(host) + if not settings.DEBUG and ga_prop_id: + return { + 'GOOGLE_ANALYTICS_PROPERTY_ID': ga_prop_id + } + return {} diff --git a/utils/middleware.py b/utils/middleware.py new file mode 100644 index 00000000..d37bdbfd --- /dev/null +++ b/utils/middleware.py @@ -0,0 +1,17 @@ +class MultipleProxyMiddleware(object): + FORWARDED_FOR_FIELDS = [ + 'HTTP_X_FORWARDED_FOR', + 'HTTP_X_FORWARDED_HOST', + 'HTTP_X_FORWARDED_SERVER', + ] + + def process_request(self, request): + """ + Rewrites the proxy headers so that only the most + recent proxy is used. + """ + for field in self.FORWARDED_FOR_FIELDS: + if field in request.META: + if ',' in request.META[field]: + parts = request.META[field].split(',') + request.META[field] = parts[-1].strip() \ No newline at end of file