From 06cbd2f6b0267283301d4e309e5ba4ed4179b387 Mon Sep 17 00:00:00 2001 From: elnappo Date: Tue, 28 Oct 2014 14:25:19 +0100 Subject: [PATCH 1/7] use naturaltime in overview --- nsupdate/main/templates/main/overview.html | 6 +++--- nsupdate/settings/base.py | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/nsupdate/main/templates/main/overview.html b/nsupdate/main/templates/main/overview.html index 055beec..1026c50 100644 --- a/nsupdate/main/templates/main/overview.html +++ b/nsupdate/main/templates/main/overview.html @@ -1,5 +1,5 @@ {% extends "base.html" %} -{% load i18n %}{% load bootstrap %} +{% load i18n %}{% load bootstrap %}{% load humanize %} {% block content %}
@@ -53,7 +53,7 @@ {{ host.get_ipv4 }}
{% if host.last_update_ipv4 %} - ({{ host.last_update_ipv4|timesince }}, + ({{ host.last_update_ipv4|naturaltime }}, {% if not host.tls_update_ipv4 %} no {% else %} {% endif %}TLS) @@ -64,7 +64,7 @@ {{ host.get_ipv6 }}
{% if host.last_update_ipv6 %} - ({{ host.last_update_ipv6|timesince }}, + ({{ host.last_update_ipv6|naturaltime }}, {% if not host.tls_update_ipv6 %} no {% else %} {% endif %}TLS) diff --git a/nsupdate/settings/base.py b/nsupdate/settings/base.py index 7556589..5fd06f1 100644 --- a/nsupdate/settings/base.py +++ b/nsupdate/settings/base.py @@ -150,6 +150,7 @@ INSTALLED_APPS = ( 'django.contrib.sites', 'django.contrib.messages', 'django.contrib.staticfiles', + 'django.contrib.humanize', 'social.apps.django_app.default', 'nsupdate.login', 'nsupdate', From 886919ac83d091d26e078c10531cfdc3cee73625 Mon Sep 17 00:00:00 2001 From: elnappo Date: Tue, 28 Oct 2014 17:09:05 +0100 Subject: [PATCH 2/7] change col-layout from large to medium in about template --- nsupdate/main/templates/main/about.html | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/nsupdate/main/templates/main/about.html b/nsupdate/main/templates/main/about.html index d43c31f..c000fcd 100644 --- a/nsupdate/main/templates/main/about.html +++ b/nsupdate/main/templates/main/about.html @@ -4,7 +4,7 @@ {% block content %}

{% blocktrans %}About the {{ WWW_HOST }} service{% endblocktrans %}

-
+

{% trans "What's this?" %}

{% blocktrans %}{{ WWW_HOST }} is a dynamic dns service.{% endblocktrans %} @@ -18,7 +18,7 @@ {% blocktrans %}{{ WWW_HOST }} is simple, usable, free, friendly, secure and respects your privacy.{% endblocktrans %}

-
+

{% trans "Why another one?" %}

{% blocktrans %}As far as we know, there was no service yet that is not:{% endblocktrans %} @@ -31,7 +31,7 @@ between a ton of commercial-only features{% endblocktrans %}

-
+

{% trans "How is it?" %}

{% trans "You can just try it using the test account (see Register page)." %} @@ -49,7 +49,7 @@

-
+

{% trans "Fair use of the service" %}

{% trans "The only thing we expect from you is fair use of this service:" %} @@ -67,7 +67,7 @@ related to unfair use of the service - at any time and without prior notice.{% endblocktrans %}

-
+

{% trans "No warranties" %}

{% trans "This is free software and a free service, there are no warranties." %} @@ -76,7 +76,7 @@ {% trans "If it breaks, it breaks." %}

-
+

{% trans "Service Contact" %}

{{ SERVICE_CONTACT }} From b617396f2a77a5c773c5c8462a826c1d471165ff Mon Sep 17 00:00:00 2001 From: elnappo Date: Tue, 28 Oct 2014 17:10:53 +0100 Subject: [PATCH 3/7] make registration views prettier (fix missing trans, layout improvments and code cleanup) #119 --- .../accounts/templates/registration/activate.html | 11 ++++++----- .../registration/activation_complete.html | 10 +++++----- .../registration/registration_complete.html | 10 +++++----- .../templates/registration/registration_form.html | 14 ++++++++------ 4 files changed, 24 insertions(+), 21 deletions(-) diff --git a/nsupdate/accounts/templates/registration/activate.html b/nsupdate/accounts/templates/registration/activate.html index af3efb0..c7cb554 100644 --- a/nsupdate/accounts/templates/registration/activate.html +++ b/nsupdate/accounts/templates/registration/activate.html @@ -2,13 +2,14 @@ {% load i18n %}{% load bootstrap %} {% url 'auth_login' as auth_login_url %} {% block title %}{% if account %}{% trans "Activation complete" %}{% else %}{% trans "Activation problem" %}{% endif %}{% endblock %} + {% block content %} {% if account %} -{% blocktrans %} -Thanks {{ account }}, activation complete! -You may now login using the username and password you set at registration. -{% endblocktrans %} +

{% trans 'Thanks, activation complete!' %}

+

{% trans 'You may now login using the username and password you set at registration.' %}

+

{% else %} -{% blocktrans %}Oops -- it seems that your activation key is invalid. Please check the url again.{% endblocktrans %} +

{% trans 'Oops' %}

+

{% trans 'it seems that your activation key is invalid. Please check the url again.' %}

{% endif %} {% endblock %} diff --git a/nsupdate/accounts/templates/registration/activation_complete.html b/nsupdate/accounts/templates/registration/activation_complete.html index 6bcdf4c..2107453 100644 --- a/nsupdate/accounts/templates/registration/activation_complete.html +++ b/nsupdate/accounts/templates/registration/activation_complete.html @@ -1,9 +1,9 @@ {% extends "registration/registration_base.html" %} {% load i18n %}{% load bootstrap %} -{% block title %}Activation complete{% endblock %} +{% block title %}{% trans 'Activation complete' %}{% endblock %} + {% block content %} -

Thanks, activation complete!

-

You may now login using the username and password you set at registration.

+

{% trans 'Thanks, activation complete!' %}

+

{% trans 'You may now login using the username and password you set at registration.' %}

+

{% endblock %} - - diff --git a/nsupdate/accounts/templates/registration/registration_complete.html b/nsupdate/accounts/templates/registration/registration_complete.html index 4cf3b7e..b6047cb 100644 --- a/nsupdate/accounts/templates/registration/registration_complete.html +++ b/nsupdate/accounts/templates/registration/registration_complete.html @@ -1,8 +1,8 @@ {% extends "registration/registration_base.html" %} {% load i18n %}{% load bootstrap %} -{% block title %}{% trans "Activation email sent" %}{% endblock %} -{% block content %} -{% blocktrans %}An activation email has been sent. -Please check your email and click on the link to activate your account.{% endblocktrans %} -{% endblock %} +{% block title %}{% trans 'Activation email sent' %}{% endblock %} +{% block content %} +

{% trans 'An activation email has been sent.' %}

+

{% trans 'Please check your email and click on the link to activate your account.' %}

+{% endblock %} diff --git a/nsupdate/accounts/templates/registration/registration_form.html b/nsupdate/accounts/templates/registration/registration_form.html index ce70035..830249b 100644 --- a/nsupdate/accounts/templates/registration/registration_form.html +++ b/nsupdate/accounts/templates/registration/registration_form.html @@ -1,10 +1,10 @@ {% extends "registration/registration_base.html" %} {% load i18n %}{% load bootstrap %} -{% load bootstrap %} {% block title %}{% trans "Register for an account" %}{% endblock %} + {% block content %}
-
+

{% trans "No registration required for testing" %}

{% trans "You can easily test the service and see what you get." %} @@ -34,7 +34,7 @@ finishing your initial evaluation.{% endblocktrans %}

-
+

{% trans "Register new account" %}

{% blocktrans %} @@ -43,15 +43,17 @@ E-Mail address: must be a working one, we'll send you an activation E-Mail there.
Password: please use a sane one, we trust you.{% endblocktrans %}

-
+
+ {% csrf_token %} - {{ form|bootstrap_horizontal }} + {{ form|bootstrap_horizontal:"col-sm-3 col-lg-3" }}
-
+
+ {% endblock %} From c943728d0049ca7a341cc473c450e16816083b23 Mon Sep 17 00:00:00 2001 From: elnappo Date: Tue, 28 Oct 2014 17:14:43 +0100 Subject: [PATCH 4/7] minor login template cleanup --- nsupdate/login/templates/logout.html | 1 + .../templates/password_reset_complete.html | 2 -- .../templates/password_reset_confirm.html | 33 ++++++++----------- .../login/templates/password_reset_done.html | 2 -- 4 files changed, 14 insertions(+), 24 deletions(-) diff --git a/nsupdate/login/templates/logout.html b/nsupdate/login/templates/logout.html index d831964..d24bdbf 100644 --- a/nsupdate/login/templates/logout.html +++ b/nsupdate/login/templates/logout.html @@ -1,6 +1,7 @@ {% extends "base.html" %} {% load i18n %}{% load bootstrap %} {% block title %}{% trans "Log out" %}{% endblock %} + {% block content %}