Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add conversations count to feedback icons #442

Merged
merged 2 commits into from
Jul 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions qgis-app/plugins/templates/plugins/plugin_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -329,10 +329,21 @@ <h2>{{ object.name }}
<td>{{ version.created_on|local_timezone }}</td>
{% if user.is_staff or user in version.plugin.approvers or user in version.plugin.editors %}<td><form method="post" action="{% url "version_manage" object.package_name version.version %}">{% csrf_token %}
{% if user.is_staff or user in version.plugin.approvers %}
{% if not version.approved %}<button class="btn btn-success btn-mini" type="submit" name="version_approve" id="version_approve"title="{% trans "Approve" %}"><i class="icon-thumbs-up icon-white"></i></button>{% else %}<button class="btn btn-warning btn-mini" type="submit" name="version_unapprove" id="version_unapprove" title="{% trans "Unapprove" %}"><i class="icon-thumbs-down icon-white"></i></button>{% endif %}
{% if not version.approved %}
<button class="btn btn-success btn-mini" type="submit" name="version_approve" id="version_approve"title="{% trans "Approve" %}">
<i class="icon-thumbs-up icon-white"></i>
</button>
{% else %}
<button class="btn btn-warning btn-mini" type="submit" name="version_unapprove" id="version_unapprove" title="{% trans "Unapprove" %}">
<i class="icon-thumbs-down icon-white"></i></button>
{% endif %}
{% endif %}
<a class="btn {% if version.feedback.exists %}btn-warning{% else %}btn-primary{% endif %} btn-mini"
href="{% url "version_feedback" object.package_name version.version %}" title="{% trans "Feedback" %}"><i class="icon-comments icon-white"></i>
<a class="btn {% if version.feedback|feedbacks_not_completed|length >= 1 %}btn-warning{% else %}btn-primary{% endif %} btn-mini"
href="{% url "version_feedback" object.package_name version.version %}" title="{% trans "Feedback" %}">
<i class="icon-comments icon-white"></i>
{% if version.feedback|feedbacks_not_completed|length >= 2 %}
{{ version.feedback|feedbacks_not_completed|length }}
{% endif %}
</a>
{% if user.is_staff or user in version.plugin.editors %}
<a class="btn btn-primary btn-mini" href="{% url "version_update" object.package_name version.version %}" title="{% trans "Edit" %}"><i class="icon-pencil icon-white"></i></a>&nbsp;<a class="btn btn-danger btn-mini delete" href="{% url "version_delete" object.package_name version.version %}" title="{% trans "Delete" %}"><i class="icon-remove icon-white"></i></a>{% endif %}</form>
Expand Down
4 changes: 4 additions & 0 deletions qgis-app/plugins/templatetags/plugin_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,7 @@ def _validate_image(file_path):
return True
except (FileNotFoundError, UnidentifiedImageError):
return False

@register.filter
def feedbacks_not_completed(feedbacks):
return feedbacks.filter(is_completed=False)