Skip to content

Commit

Permalink
Fix user_token template pages
Browse files Browse the repository at this point in the history
  • Loading branch information
Xpirix committed Sep 20, 2024
1 parent 53a701f commit 1bad3a0
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 17 deletions.
20 changes: 20 additions & 0 deletions qgis-app/api/templates/user_token_base.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{% extends BASE_TEMPLATE %}{% load i18n %}
{% block app_title %}
<h2 xmlns="http://www.w3.org/1999/html">{{ title }}</h2>
{% endblock %}

{% block menu %}
{{ block.super }}
<form method="post" action="{% url "user_token_create"%}">{% csrf_token %}
<div>
<h2>
<button type="submit" name="user_token_create" id="user_token_create"
value="{% trans "Generate a New Token" %}" class="btn btn-block btn-primary btn-large" style="padding: 10px">
<i class="icon-plus icon-white icon-2x" style=" vertical-align: middle;"></i>
&nbsp;{% trans "Generate a New Token" %}
</button>
</h2>
</div>
</form>

{% endblock %}
2 changes: 1 addition & 1 deletion qgis-app/api/templates/user_token_delete.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% extends BASE_TEMPLATE %}{% load i18n %}
{% extends 'user_token_base.html' %}{% load i18n %}
{% block content %}
<h3>Delete token of "{{ username }}"</h3>
<form action="" method="post">{% csrf_token %}
Expand Down
6 changes: 3 additions & 3 deletions qgis-app/api/templates/user_token_detail.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% extends BASE_TEMPLATE %}{% load i18n %}
{% extends 'user_token_base.html' %}{% load i18n %}
{% load local_timezone %}
{% block content %}
<h2>{% trans "Token for" %} {{ hub.name }}</h2>
<h2>{% trans "New Token" %}</h2>
<div class="alert">
<button type="button" class="close" data-dismiss="alert">&times;</button>
To enhance the security of your token,
Expand Down Expand Up @@ -30,7 +30,7 @@ <h2>{% trans "Token for" %} {{ hub.name }}</h2>
</dd>

</dl>
<div>
<div style="margin-bottom: 10px;">
<a class="btn" href="{% url "user_token_list" %}?v={{ timestamp_from_last_edit }}">{% trans "Back to the list" %}</a>
<a class="btn btn-primary" href="{% url "user_token_update" object.pk %}">{% trans "Edit description" %}</a>
</div>
Expand Down
2 changes: 1 addition & 1 deletion qgis-app/api/templates/user_token_form.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% extends BASE_TEMPLATE %}{% load i18n %}
{% extends 'user_token_base.html' %}{% load i18n %}
{% load local_timezone %}
{% block content %}
<h2>{% trans "Edit token description " %} {{ token.jti }}</h2>
Expand Down
17 changes: 5 additions & 12 deletions qgis-app/api/templates/user_token_list.html
Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
{% extends BASE_TEMPLATE %}{% load i18n %}
{% extends 'user_token_base.html' %}{% load i18n %}
{% load local_timezone %}
{% block content %}
<h2>{% trans "My Tokens" %}</h2>
<form method="post" action="{% url "user_token_create"%}">{% csrf_token %}
<div style="margin:0; width:fit-content;">
<h2>
<button type="submit" name="user_token_create" id="user_token_create"
value="{% trans "Generate a New Token" %}" class="btn btn-block btn-primary" style="padding: 10px">
<i class="icon-plus icon-white icon-2x" style=" vertical-align: middle;"></i>
&nbsp;{% trans "Generate a New Token" %}
</button>
</h2>
</div>
</form>
<p>
The token allows access to the Resources API, enabling you to create, view, update, or delete resources.
For more details, refer to the <a href="https://github.com/qgis/QGIS-Django/blob/master/HUB_API.md" target="_blank">HUB_API.md</a> file.
</p>
{% if object_list.count %}
<div>
<table class="table table-striped plugins">
Expand Down
3 changes: 3 additions & 0 deletions qgis-app/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,9 @@ <h5>Silver Sponsors</h5>
width: auto;
}
}
.responsive-content {
min-height: 50vh;
}
</style>
{% tracking_code %}
</body>
Expand Down

0 comments on commit 1bad3a0

Please sign in to comment.