Ignore closed issues

This commit is contained in:
T'rahk Rokym 2025-04-21 16:10:58 +02:00
parent 9cc3283399
commit 92d8c699eb
3 changed files with 4 additions and 10 deletions

View File

@ -57,19 +57,13 @@
<ul class="list-group"> <ul class="list-group">
{% for notif in application_notifications %} {% for notif in application_notifications %}
<li class="list-group-item"> <li class="list-group-item">
{% if 'open' in notif.state %} <span class="badge bg-success me-2">{% translate "Open" %}</span>
<span class="badge bg-success me-2">{% translate "Open" %}</span>
{% else %}
<span class="badge bg-danger me-2">{% translate "Closed" %}</span>
{% endif %}
<span class="badge bg-info me-2">{{ notif.app_name }}</span> <span class="badge bg-info me-2">{{ notif.app_name }}</span>
<a href="{{ notif.web_url }}" target="_blank">#{{ notif.iid }} {{ notif.title }}</a> <a href="{{ notif.web_url }}" target="_blank">#{{ notif.iid }} {{ notif.title }}</a>
</li> </li>
{% endfor %} {% endfor %}
</ul> </ul>
{# TODO maybe add some disclaimer that those are managed by application devs? #} {# TODO maybe add some disclaimer that those are managed by application devs? #}
</div> </div>
</div> </div>
</div> </div>

View File

@ -20,7 +20,7 @@ register = template.Library()
# cache timers # cache timers
TAG_CACHE_TIME = 3600 # 1 hours TAG_CACHE_TIME = 3600 # 1 hours
NOTIFICATION_CACHE_TIME = 300 # 5 minutes NOTIFICATION_CACHE_TIME = 10 # 5 minutes
# timeout for all requests # timeout for all requests
REQUESTS_TIMEOUT = 5 # 5 seconds REQUESTS_TIMEOUT = 5 # 5 seconds
# max pages to be fetched from gitlab # max pages to be fetched from gitlab
@ -86,7 +86,7 @@ class AppAnnouncementHook:
""" """
raw_list = _fetch_list_from_github( raw_list = _fetch_list_from_github(
f"https://api.github.com/repos/{self.repository_namespace}/issues" f"https://api.github.com/repos/{self.repository_namespace}/issues"
f"?labels={self.label}&state=all" f"?labels={self.label}"
) )
# Translates GitHub attributes to GitLab and filters out pull requests # Translates GitHub attributes to GitLab and filters out pull requests
clean_list = [] clean_list = []
@ -101,7 +101,7 @@ class AppAnnouncementHook:
"""Return the issues list for a GitLab repository""" """Return the issues list for a GitLab repository"""
return _fetch_list_from_gitlab( return _fetch_list_from_gitlab(
f"https://gitlab.com/api/v4/projects/{quote_plus(self.repository_namespace)}/issues" f"https://gitlab.com/api/v4/projects/{quote_plus(self.repository_namespace)}/issues"
f"?labels={self.label}") f"?labels={self.label}&state=opened")
@register.simple_tag() @register.simple_tag()
def decimal_widthratio(this_value, max_value, max_width) -> str: def decimal_widthratio(this_value, max_value, max_width) -> str:

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

After

Width:  |  Height:  |  Size: 29 KiB