Start switch to Bootstrap 5

- drop jQuery and fontawesome dependencies
- add bootstrap5 and bootstrap-icons
- update fonts mfizz
- update base templates and the first set of other templates
- replace blocktrans and trans with blocktranslate and translate to
  prepare for Django 4
- move hostingpakcage templates to hostingpackages/templates
- update translations
This commit is contained in:
Jan Dittberner 2023-04-16 22:11:32 +02:00
parent 5cf7ef7a23
commit 8e42cb9c18
124 changed files with 10873 additions and 4490 deletions

View file

@ -2,30 +2,46 @@
{% load i18n crispy_forms_tags %}
{% block title %}{{ block.super }} - {% spaceless %}
{% if customer == user %}
{% blocktrans with dbuser=dbuser.name %}Set Database User Password for {{ dbuser }}{% endblocktrans %}
{% else %}
{% blocktrans with dbuser=dbuser.name full_name=customer.get_full_name %}Set Database User Password for {{ dbuser }} of Customer {{ full_name }}{% endblocktrans %}
{% endif %}
{% if customer == user %}
{% blocktranslate with dbuser=dbuser.name %}Set Database User Password for {{ dbuser }}{% endblocktranslate %}
{% else %}
{% blocktranslate with dbuser=dbuser.name full_name=customer.get_full_name trimmed %}
Set Database User Password for {{ dbuser }} of Customer {{ full_name }}
{% endblocktranslate %}
{% endif %}
{% endspaceless %}{% endblock title %}
{% block page_title %}{% spaceless %}
{% if customer == user %}
{% blocktrans with dbuser=dbuser.name %}Set Database User Password <small>for {{ dbuser }}</small>{% endblocktrans %}
{% else %}
{% blocktrans with dbuser=dbuser.name full_name=customer.get_full_name %}Set Database User Password <small>for {{ dbuser }} of Customer {{ full_name }}</small>{% endblocktrans %}
{% endif %}
{% if customer == user %}
{% blocktranslate with dbuser=dbuser.name trimmed %}
Set Database User Password <small>for {{ dbuser }}</small>
{% endblocktranslate %}
{% else %}
{% blocktranslate with dbuser=dbuser.name full_name=customer.get_full_name trimmed %}
Set Database User Password <small>for {{ dbuser }} of Customer {{ full_name }}</small>
{% endblocktranslate %}
{% endif %}
{% endspaceless %}{% endblock page_title %}
{% block content %}
<p>{% if customer == user %}{% trans "Please specify the new password for your database user." %}{% else %}{% trans "Please specify the new password of the database user." %}{% endif %}
{% crispy form %}
<p>{% spaceless %}{% if customer == user %}
{% translate "Please specify the new password for your database user." %}
{% else %}
{% translate "Please specify the new password of the database user." %}
{% endif %}{% endspaceless %}</p>
{% crispy form %}
{% endblock content %}
{% block extra_js %}
<script type="text/javascript">
$(document).ready(function() {
$('input[type=password]').val('').first().focus();
});
</script>
{% endblock extra_js %}
<script type="text/javascript">
document.addEventListener("DOMContentLoaded", function () {
let passwordFields = document.querySelectorAll('input[type=password]');
for (const passwordFieldsKey in passwordFields) {
passwordFields[passwordFieldsKey].val('');
}
passwordFields[0].focus();
});
</script>
{% endblock extra_js %}

View file

@ -1,3 +1,3 @@
{# format database types #}
{% load userdb %}
<i class="{% db_type_icon_class %}" title="{% db_type_name %}"></i><span class="sr-only">{% db_type_name %}</span>
<i class="{% db_type_icon_class %}" title="{% db_type_name %}"></i><span class="visually-hidden">{% db_type_name %}</span>

View file

@ -2,33 +2,46 @@
{% load i18n %}
{% block title %}{{ block.super }} - {% spaceless %}
{% if user == customer %}
{% blocktrans with database=database.db_name %}Delete Database {{ database }}{% endblocktrans %}
{% else %}
{% blocktrans with database=database.db_name full_name=customer.get_full_name %}Delete Database {{ database }} of customer {{ full_name }}{% endblocktrans %}
{% endif %}
{% if user == customer %}
{% blocktranslate with database=database.db_name %}Delete Database {{ database }}{% endblocktranslate %}
{% else %}
{% blocktranslate with database=database.db_name full_name=customer.get_full_name trimmed %}
Delete Database {{ database }} of customer {{ full_name }}
{% endblocktranslate %}
{% endif %}
{% endspaceless %}{% endblock title %}
{% block page_title %}{% spaceless %}
{% if user == customer %}
{% blocktrans with database=database.db_name %}Delete Database <small>{{ database }}</small>{% endblocktrans %}
{% else %}
{% blocktrans with database=database.db_name full_name=customer.get_full_name %}Delete Database <small>{{ database }} of customer {{ full_name }}</small>{% endblocktrans %}
{% endif %}
{% if user == customer %}
{% blocktranslate with database=database.db_name trimmed %}
Delete Database <small>{{ database }}</small>
{% endblocktranslate %}
{% else %}
{% blocktranslate with database=database.db_name full_name=customer.get_full_name trimmed %}
Delete Database <small>{{ database }} of customer {{ full_name }}</small>
{% endblocktranslate %}
{% endif %}
{% endspaceless %}{% endblock page_title %}
{% block content %}
<div class="panel panel-warning">
<div class="panel-heading">
{% blocktrans with database=database.db_name %}Do you really want to delete the database {{ database }}?{% endblocktrans %}
</div>
<div class="panel-body form">
<p>{% blocktrans %}When you confirm the deletion the database will be removed from the database server. <strong>All data in the database will be lost!</strong> If the database user assigned to that database has no other databases assigned it will be deleted too.{% endblocktrans %}</p>
<form action="{% url 'delete_userdatabase' package=hostingpackage.id slug=database.db_name %}" method="post">
{% csrf_token %}
<input class="btn btn-warning" type="submit" value="{% trans "Yes, do it!" %}" />
<a class="btn btn-default" href="{{ hostingpackage.get_absolute_url }}">{% trans "Cancel" %}</a>
</form>
</div>
</div>
{% endblock content %}
<div class="panel panel-warning">
<div class="panel-heading">
{% blocktranslate with database=database.db_name trimmed %}
Do you really want to delete the database {{ database }}?
{% endblocktranslate %}
</div>
<div class="panel-body form">
<p>{% blocktranslate trimmed %}
When you confirm the deletion the database will be removed from the database server.
<strong>All data in the database will be lost!</strong> If the database user assigned to that database
has no other databases assigned it will be deleted too.
{% endblocktranslate %}</p>
<form action="{% url 'delete_userdatabase' package=hostingpackage.id slug=database.db_name %}"
method="post">
{% csrf_token %}
<input class="btn btn-warning" type="submit" value="{% translate "Yes, do it!" %}"/>
<a class="btn btn-default" href="{{ hostingpackage.get_absolute_url }}">{% translate "Cancel" %}</a>
</form>
</div>
</div>
{% endblock content %}

View file

@ -2,30 +2,40 @@
{% load i18n crispy_forms_tags %}
{% block title %}{{ block.super }} - {% spaceless %}
{% if user == customer %}
{% blocktrans %}Add new Database{% endblocktrans %}
{% else %}
{% blocktrans with full_name=customer.get_full_name %}Add new Database for Customer {{ full_name }}{% endblocktrans %}
{% endif %}
{% if user == customer %}
{% blocktranslate %}Add new Database{% endblocktranslate %}
{% else %}
{% blocktranslate with full_name=customer.get_full_name trimmed %}
Add new Database for Customer {{ full_name }}
{% endblocktranslate %}
{% endif %}
{% endspaceless %}{% endblock title %}
{% block page_title %}{% spaceless %}
{% if user == customer %}
{% blocktrans %}Add new Database{% endblocktrans %}
{% else %}
{% blocktrans with full_name=customer.get_full_name %}Add new Database for Customer {{ full_name }}{% endblocktrans %}
{% endif %}
{% if user == customer %}
{% blocktranslate %}Add new Database{% endblocktranslate %}
{% else %}
{% blocktranslate with full_name=customer.get_full_name trimmed %}
Add new Database for Customer {{ full_name }}
{% endblocktranslate %}
{% endif %}
{% endspaceless %}{% endblock page_title %}
{% block content %}
<p>{% blocktrans %}Please enter a password for a new database user for your database.{% endblocktrans %}</p>
{% crispy form %}
<p>{% blocktranslate %}Please enter a password for a new database user for your database.{% endblocktranslate %}</p>
{% crispy form %}
{% endblock content %}
{% block extra_js %}
<script type="text/javascript">
$(document).ready(function() {
$('input[type=password]').val('').first().focus();
});
</script>
{% endblock %}
<script type="text/javascript">
document.addEventListener("DOMContentLoaded", function () {
let passwordFields = document.querySelectorAll('input[type=password]');
for (const passwordFieldsKey in passwordFields) {
passwordFields[passwordFieldsKey].val('');
}
passwordFields[0].focus();
});
</script>
{% endblock %}