From 519a666057b7ed19f7fb6978476c3575c4ce3df3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C4=93teris=20Caune?= Date: Tue, 21 Jul 2020 17:59:39 +0300 Subject: [PATCH] {% site_name %} -> {{ site_name }} so we can use blocktrans tags for L10N --- hc/front/context_processors.py | 5 ++++ hc/settings.py | 10 +++---- templates/accounts/billing.html | 2 +- templates/accounts/change_email.html | 2 +- templates/accounts/check_token_submit.html | 6 ++-- templates/accounts/login.html | 8 +++--- templates/accounts/notifications.html | 2 +- templates/accounts/profile.html | 6 ++-- templates/accounts/set_password.html | 2 +- templates/accounts/unsubscribed.html | 2 +- templates/base.html | 10 +++---- templates/base_bare.html | 2 +- templates/front/badges.html | 6 ++-- templates/front/base_docs.html | 2 +- templates/front/channels.html | 4 +-- templates/front/docs_cron.html | 6 ++-- templates/front/docs_single.html | 2 +- templates/front/filtering_rules_modal.html | 2 +- templates/front/log.html | 2 +- templates/front/projects.html | 2 +- templates/front/unsubscribe_success.html | 2 +- templates/front/verify_email_success.html | 2 +- templates/front/welcome.html | 28 +++++++++---------- templates/integrations/add_apprise.html | 2 +- templates/integrations/add_discord.html | 4 +-- templates/integrations/add_email.html | 4 +-- templates/integrations/add_matrix.html | 6 ++-- templates/integrations/add_mattermost.html | 4 +-- templates/integrations/add_msteams.html | 6 ++-- templates/integrations/add_opsgenie.html | 4 +-- templates/integrations/add_pagertree.html | 4 +-- templates/integrations/add_pd.html | 4 +-- templates/integrations/add_pdc.html | 12 ++++---- templates/integrations/add_prometheus.html | 8 +++--- templates/integrations/add_pushbullet.html | 4 +-- templates/integrations/add_pushover.html | 4 +-- templates/integrations/add_pushover_help.html | 12 ++++---- templates/integrations/add_shell.html | 4 +-- templates/integrations/add_slack.html | 4 +-- templates/integrations/add_slack_btn.html | 20 ++++++------- templates/integrations/add_sms.html | 2 +- templates/integrations/add_spike.html | 4 +-- templates/integrations/add_telegram.html | 10 +++---- templates/integrations/add_trello.html | 4 +-- templates/integrations/add_victorops.html | 6 ++-- templates/integrations/add_whatsapp.html | 2 +- templates/integrations/add_zulip.html | 10 +++---- templates/payments/pricing.html | 12 ++++---- templates/payments/pricing_not_owner.html | 2 +- 49 files changed, 138 insertions(+), 135 deletions(-) create mode 100644 hc/front/context_processors.py diff --git a/hc/front/context_processors.py b/hc/front/context_processors.py new file mode 100644 index 00000000..eca8bd9f --- /dev/null +++ b/hc/front/context_processors.py @@ -0,0 +1,5 @@ +from django.conf import settings + + +def branding(request): + return {"site_name": settings.SITE_NAME, "site_root": settings.SITE_ROOT} diff --git a/hc/settings.py b/hc/settings.py index 7662ea3a..c3d9669b 100644 --- a/hc/settings.py +++ b/hc/settings.py @@ -87,6 +87,7 @@ TEMPLATES = [ "django.template.context_processors.request", "django.contrib.auth.context_processors.auth", "django.contrib.messages.context_processors.messages", + "hc.front.context_processors.branding", "hc.payments.context_processors.payments", ] }, @@ -141,13 +142,10 @@ if os.getenv("DB") == "mysql": } } -TIME_ZONE = "UTC" - -USE_I18N = False - -USE_L10N = False - USE_TZ = True +TIME_ZONE = "UTC" +USE_I18N = True +USE_L10N = True SITE_ROOT = os.getenv("SITE_ROOT", "http://localhost:8000") SITE_NAME = os.getenv("SITE_NAME", "Mychecks") diff --git a/templates/accounts/billing.html b/templates/accounts/billing.html index 51b6800c..570dcd17 100644 --- a/templates/accounts/billing.html +++ b/templates/accounts/billing.html @@ -1,7 +1,7 @@ {% extends "base.html" %} {% load compress static hc_extras %} -{% block title %}Account Settings - {% site_name %}{% endblock %} +{% block title %}Account Settings - {{ site_name }}{% endblock %} {% block content %}
diff --git a/templates/accounts/change_email.html b/templates/accounts/change_email.html index 5ac0c4f1..4d7cb427 100644 --- a/templates/accounts/change_email.html +++ b/templates/accounts/change_email.html @@ -16,7 +16,7 @@ Otherwise, you may get locked out of - your {% site_name %} account. + your {{ site_name }} account.

{% if request.user.has_usable_password %} diff --git a/templates/accounts/check_token_submit.html b/templates/accounts/check_token_submit.html index 3631025e..2b1d6056 100644 --- a/templates/accounts/check_token_submit.html +++ b/templates/accounts/check_token_submit.html @@ -3,7 +3,7 @@ - Continue to {% site_name %} + Continue to {{ site_name }} @@ -36,7 +36,7 @@ } -

You are about to log into {% site_name %}.

+

You are about to log into {{ site_name }}.

Please press the button below to continue:


@@ -45,7 +45,7 @@ id="submit-btn" type="submit" class="btn btn-lg btn-primary" - value="Continue to {% site_name %}"> + value="Continue to {{ site_name }}">
diff --git a/templates/accounts/login.html b/templates/accounts/login.html index 45e0051b..5ba24ee5 100644 --- a/templates/accounts/login.html +++ b/templates/accounts/login.html @@ -1,19 +1,19 @@ {% extends "base.html" %} -{% load compress hc_extras static %} +{% load compress static %} -{% block title %}Sign In - {% site_name %}{% endblock %} +{% block title %}Sign In - {{ site_name }}{% endblock %} {% block description %}{% endblock %} {% block head %} - + {% endblock %} {% block content %}
-

Sign In to {% site_name %}

+

Sign In to {{ site_name }}

{% if bad_link %}

The login link you just used is either incorrect or expired.

diff --git a/templates/accounts/notifications.html b/templates/accounts/notifications.html index 83346f0f..e05b0f43 100644 --- a/templates/accounts/notifications.html +++ b/templates/accounts/notifications.html @@ -1,7 +1,7 @@ {% extends "base.html" %} {% load hc_extras %} -{% block title %}Account Settings - {% site_name %}{% endblock %} +{% block title %}Account Settings - {{ site_name }}{% endblock %} {% block content %}
diff --git a/templates/accounts/profile.html b/templates/accounts/profile.html index 186828ed..dc9c8579 100644 --- a/templates/accounts/profile.html +++ b/templates/accounts/profile.html @@ -1,7 +1,7 @@ {% extends "base.html" %} {% load compress static hc_extras %} -{% block title %}Account Settings - {% site_name %}{% endblock %} +{% block title %}Account Settings - {{ site_name }}{% endblock %} {% block content %} @@ -49,7 +49,7 @@

- Attach a password to your {% site_name %} account + Attach a password to your {{ site_name }} account

diff --git a/templates/accounts/set_password.html b/templates/accounts/set_password.html index f0b159f3..6cabd896 100644 --- a/templates/accounts/set_password.html +++ b/templates/accounts/set_password.html @@ -8,7 +8,7 @@

Set a Password

- Please pick a password for your {% site_name %} account. + Please pick a password for your {{ site_name }} account.

diff --git a/templates/accounts/unsubscribed.html b/templates/accounts/unsubscribed.html index 68f8c745..78f4ead1 100644 --- a/templates/accounts/unsubscribed.html +++ b/templates/accounts/unsubscribed.html @@ -7,6 +7,6 @@

Unsubscribed

Your email address has been unsubscribed from - {% site_name %} reports. + {{ site_name }} reports.

{% endblock %} diff --git a/templates/base.html b/templates/base.html index 495e0abd..4593fa62 100644 --- a/templates/base.html +++ b/templates/base.html @@ -2,7 +2,7 @@ - {% block title %}{% site_name %} - Monitor Cron Jobs. Get Notified When Your Cron Jobs Fail{% endblock %} + {% block title %}{{ site_name }} - Monitor Cron Jobs. Get Notified When Your Cron Jobs Fail{% endblock %} {% block description %} {% endblock %} @@ -10,8 +10,8 @@ {% endblock %} - - + + {% block head %}{% endblock %} @@ -79,7 +79,7 @@ width="59" src="{% static 'img/logo.png'%}" srcset="{% static 'img/logo.png'%} 1x, {% static 'img/logo@2x.png'%} 2x" - alt="{% site_name %}"> + alt="{{ site_name }}"> {% else %} + alt="{{ site_name }}"> {% endif %}
diff --git a/templates/base_bare.html b/templates/base_bare.html index f24da3e4..da8b42a3 100644 --- a/templates/base_bare.html +++ b/templates/base_bare.html @@ -2,7 +2,7 @@ - {% block title %}{% site_name %}{% endblock %} + {% block title %}{{ site_name }}{% endblock %} diff --git a/templates/front/badges.html b/templates/front/badges.html index 6562208d..a82f7c79 100644 --- a/templates/front/badges.html +++ b/templates/front/badges.html @@ -1,7 +1,7 @@ {% extends "base.html" %} {% load compress static hc_extras %} -{% block title %}Status Badges - {% site_name %}{% endblock %} +{% block title %}Status Badges - {{ site_name }}{% endblock %} {% block content %}
@@ -9,8 +9,8 @@

Status Badges

- {% site_name %} provides status badges for each of the tags - you have used. Additionally, the "{% site_name %}" + {{ site_name }} provides status badges for each of the tags + you have used. Additionally, the "{{ site_name }}" badge shows the overall status of all checks in a project. The badges have public, but hard-to-guess URLs. You can use them in your READMEs, diff --git a/templates/front/base_docs.html b/templates/front/base_docs.html index 349009ba..72391949 100644 --- a/templates/front/base_docs.html +++ b/templates/front/base_docs.html @@ -7,7 +7,7 @@

    - +
  • Introduction
  • diff --git a/templates/front/channels.html b/templates/front/channels.html index b0e12c38..6c06b408 100644 --- a/templates/front/channels.html +++ b/templates/front/channels.html @@ -1,7 +1,7 @@ {% extends "base.html" %} {% load compress humanize static hc_extras %} -{% block title %}Integrations - {% site_name %}{% endblock %} +{% block title %}Integrations - {{ site_name }}{% endblock %} {% block content %} @@ -160,7 +160,7 @@

    The project "{{ project }}" does not have any integrations set up yet.

    -

    With no configured integrations, {% site_name %} +

    With no configured integrations, {{ site_name }} will not send any notifications when checks change state.

    diff --git a/templates/front/docs_cron.html b/templates/front/docs_cron.html index 43927a14..843d66b9 100644 --- a/templates/front/docs_cron.html +++ b/templates/front/docs_cron.html @@ -1,7 +1,7 @@ {% extends "base.html" %} {% load hc_extras %} -{% block title %}Cron Syntax Cheatsheet - {% site_name %}{% endblock %} +{% block title %}Cron Syntax Cheatsheet - {{ site_name }}{% endblock %} {% block description %} @@ -16,7 +16,7 @@

    Cron Syntax Cheatsheet

    - {% site_name %} understands most of the traditional cron syntax features. + {{ site_name }} understands most of the traditional cron syntax features. Under the hood, it uses the croniter package to parse and interpret cron expressions. Below is a showcase of @@ -462,7 +462,7 @@ Cron daemon uses server's local time. If your server's timezone is other than UTC, make sure to set a matching timezone for your check - on {% site_name %} as well. + on {{ site_name }} as well.

    On Ubuntu systems you can check the server's timezone diff --git a/templates/front/docs_single.html b/templates/front/docs_single.html index 2bd71ca5..6080603c 100644 --- a/templates/front/docs_single.html +++ b/templates/front/docs_single.html @@ -1,7 +1,7 @@ {% extends "front/base_docs.html" %} {% load compress static hc_extras %} -{% block title %}{{ first_line|striptags }} - {% site_name %}{% endblock %} +{% block title %}{{ first_line|striptags }} - {{ site_name }}{% endblock %} {% block description %}{% endblock %} {% block keywords %}{% endblock %} diff --git a/templates/front/filtering_rules_modal.html b/templates/front/filtering_rules_modal.html index e3711232..6b51b5c9 100644 --- a/templates/front/filtering_rules_modal.html +++ b/templates/front/filtering_rules_modal.html @@ -29,7 +29,7 @@ Only POST - If set, {% site_name %} will ignore HTTP requests + If set, {{ site_name }} will ignore HTTP requests using any other request method. diff --git a/templates/front/log.html b/templates/front/log.html index aa0e93ef..dc90b3e3 100644 --- a/templates/front/log.html +++ b/templates/front/log.html @@ -1,7 +1,7 @@ {% extends "base.html" %} {% load compress humanize static hc_extras %} -{% block title %}My Checks - {% site_name %}{% endblock %} +{% block title %}Ping Log - {{ site_name }}{% endblock %} {% block content %} diff --git a/templates/front/projects.html b/templates/front/projects.html index a820968d..f2ec0416 100644 --- a/templates/front/projects.html +++ b/templates/front/projects.html @@ -1,7 +1,7 @@ {% extends "base.html" %} {% load compress static hc_extras %} -{% block title %}{% site_name %}{% endblock %} +{% block title %}{{ site_name }}{% endblock %} {% block content %} diff --git a/templates/front/unsubscribe_success.html b/templates/front/unsubscribe_success.html index 175dffb3..a370d7fe 100644 --- a/templates/front/unsubscribe_success.html +++ b/templates/front/unsubscribe_success.html @@ -7,6 +7,6 @@

    Unsubscribed

    Your email address has been unsubscribed from - {% site_name %} notifications. + {{ site_name }} notifications.

    {% endblock %} diff --git a/templates/front/verify_email_success.html b/templates/front/verify_email_success.html index e566a0e2..bda8e0d1 100644 --- a/templates/front/verify_email_success.html +++ b/templates/front/verify_email_success.html @@ -10,7 +10,7 @@

    Success! You've verified this email address, and it will now receive - {% site_name %} notifications. + {{ site_name }} notifications.

diff --git a/templates/front/welcome.html b/templates/front/welcome.html index c8aa847b..7e904f16 100644 --- a/templates/front/welcome.html +++ b/templates/front/welcome.html @@ -1,5 +1,5 @@ {% extends "base.html" %} -{% load compress hc_extras humanize static %} +{% load compress humanize static %} {% block description %} @@ -7,7 +7,7 @@ {% block head %} - + {% endblock %} {% block containers %} @@ -27,7 +27,7 @@ Make HTTP requests to the Ping URL at regular intervals. When the URL is not pinged on time, - {% site_name %} will send you an alert. + {{ site_name }} will send you an alert. You can monitor any service that can make HTTP requests @@ -37,7 +37,7 @@

For each of your periodic tasks, - {% site_name %} provides an unique URL similar to this one: + {{ site_name }} provides an unique URL similar to this one:

{{ ping_url }} @@ -123,7 +123,7 @@ sending email messages.

- You can instruct {% site_name %} to look for a particular + You can instruct {{ site_name }} to look for a particular keyword in the subject line. This is handy when your backup software sends an email after every run, and uses a different subject line depending on success or failure. @@ -140,7 +140,7 @@

-

{% site_name %} monitors the heartbeat messages sent by your cron jobs, services and APIs. +

{{ site_name }} monitors the heartbeat messages sent by your cron jobs, services and APIs. Get immediate alerts when they don't arrive on schedule.

Sign Up – It's Free @@ -236,7 +236,7 @@ Down. Time since last ping has exceeded Period + Grace. - When check goes from "Late" to "Down", {% site_name %} + When check goes from "Late" to "Down", {{ site_name }} sends you a notification. @@ -302,8 +302,8 @@

Public Status Badges

- {% site_name %} provides status badges for each of the tags - you have used. Additionally, the "{% site_name %}" badge + {{ site_name }} provides status badges for each of the tags + you have used. Additionally, the "{{ site_name }}" badge shows the overall status of all checks in your account.

@@ -511,11 +511,11 @@

-

What Can I Monitor With {% site_name %}?

+

What Can I Monitor With {{ site_name }}?

Cron Jobs

-

{% site_name %} monitoring is a great fit for cron jobs and cron-like systems +

{{ site_name }} monitoring is a great fit for cron jobs and cron-like systems (systemd timers, Jenkins build jobs, Windows Scheduled Tasks, wp-cron, uwsgi cron-like interface, Heroku Scheduler, ...). A failed cron job often has no immediate visible consequences, and can go unnoticed for a long time.

@@ -534,9 +534,9 @@

Processes, Services, Servers

-

{% site_name %} monitoring can be used for lightweight server monitoring: +

{{ site_name }} monitoring can be used for lightweight server monitoring: ensuring a particular system service, or the server as a whole is alive and healthy. - Write a shell script that checks for a specific condition, and pings {% site_name %} + Write a shell script that checks for a specific condition, and pings {{ site_name }} if successful. Run the shell script regularly.

Specific examples:

@@ -557,7 +557,7 @@