From b38730bacf8e7d835e175ce1b76b343455847f3f Mon Sep 17 00:00:00 2001 From: Lova ANDRIARIMALALA <43842786+Xpirix@users.noreply.github.com> Date: Mon, 2 Sep 2024 11:44:46 +0300 Subject: [PATCH] Update plugin upload UI --- qgis-app/plugins/forms.py | 2 +- .../templates/plugins/form_snippet.html | 94 ++++++++++++++----- .../templates/plugins/plugin_upload.html | 62 ++++++++---- 3 files changed, 113 insertions(+), 45 deletions(-) diff --git a/qgis-app/plugins/forms.py b/qgis-app/plugins/forms.py index 9f98f03f..fa13eb8d 100644 --- a/qgis-app/plugins/forms.py +++ b/qgis-app/plugins/forms.py @@ -181,7 +181,7 @@ class PackageUploadForm(forms.Form): required=False, label=_("Experimental"), help_text=_( - "Please check this box if the plugin is experimental. Please note that this field might be overridden by metadata (if present)." + "Please check this box if the plugin is experimental.
Please note that this field might be overridden by metadata (if present)." ), ) package = forms.FileField( diff --git a/qgis-app/plugins/templates/plugins/form_snippet.html b/qgis-app/plugins/templates/plugins/form_snippet.html index ae794508..52cac3ba 100755 --- a/qgis-app/plugins/templates/plugins/form_snippet.html +++ b/qgis-app/plugins/templates/plugins/form_snippet.html @@ -1,27 +1,69 @@ {% load i18n plugin_utils %} -
-{% for field in form %} -
- {% if field.field.widget|klass == 'CheckboxInput' %} - - {% else %} - {{ field.label_tag }} - {% if field.errors %} -
- {{ field.errors }} -
- {% endif %} - {{ field }} - {% endif %} -
{{ field.help_text }}
-
-{% endfor %} -
+
+ {% for field in form %} +
+ {% if field.field.widget|klass == 'CheckboxInput' %} +
+ +
+ {% elif field.field.widget|klass == 'ClearableFileInput' %} +
+ +
+ {% else %} {{ field.label_tag }} {% if field.errors %} +

{{ field.errors }}

+ {% endif %} {{ field }} {% endif %} +
{{ field.help_text | safe }}
+
+ {% endfor %} +
+ + diff --git a/qgis-app/plugins/templates/plugins/plugin_upload.html b/qgis-app/plugins/templates/plugins/plugin_upload.html index c9fac526..49f30f1f 100644 --- a/qgis-app/plugins/templates/plugins/plugin_upload.html +++ b/qgis-app/plugins/templates/plugins/plugin_upload.html @@ -1,8 +1,13 @@ {% extends 'plugins/plugin_base.html' %}{% load i18n %} {% block content %}

{% trans "Upload a plugin" %}

-

{% trans "To upload a new plugin or update an existing one, you can specify the zipped file in this form." %}

-

{% trans "Alternatively, to update an existing plugin, you can also open the plugin's details view and add a new version from there." %}

+ +
+
+

{% trans "To upload a new plugin or update an existing one, you can specify the zipped file in this form." %}

+

{% trans "Alternatively, to update an existing plugin, you can also open the plugin's details view and add a new version from there." %}

+
+
{% if form.non_field_errors %}
@@ -11,19 +16,42 @@

{% trans "Upload a plugin" %}

{% endfor %}
{% endif %} -
{% csrf_token %} - {% include "plugins/form_snippet.html" %} -
- - {% blocktrans %} - Please note that by uploading a plugin to the official QGIS plugin repository, - you agree that we will use your email to contact you. We will only contact - you for matters relating to the management of plugins and will not make - your email available to third parties for marketing purposes. - {% endblocktrans %} + +
+
+ {% csrf_token %} + {% include "plugins/form_snippet.html" %} +
+ +
+
-
- +
+
+
+
+
+

+ {% blocktrans %} + Please note that by uploading a plugin to the official QGIS plugin repository, + you agree that we will use your email to contact you. We will only contact + you for matters relating to the management of plugins and will not make + your email available to third parties for marketing purposes. + {% endblocktrans %} + +

+
+
+
+
+

{% blocktrans %} By uploading your plugin to the QGIS plugin repository, you agree to keep your email address current and to be @@ -36,10 +64,8 @@

{% trans "Upload a plugin" %}

where the plugin author is not contactable and there are issues reported about a plugin. {% endblocktrans %} +

-
- -
- +
{% endblock %}