17169 use config_name for matching in plugin catalog (#17172)

* 17169 use config_name for matching

* 17169 remove cache buster
This commit is contained in:
Arthur Hanson 2024-08-15 21:18:34 +07:00 committed by GitHub
parent 122522a625
commit 93a13ce311
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 9 additions and 8 deletions

View File

@ -81,8 +81,9 @@ def get_local_plugins(plugins=None):
plugin_config: PluginConfig = plugin.config plugin_config: PluginConfig = plugin.config
local_plugins[plugin_config.name] = Plugin( local_plugins[plugin_config.name] = Plugin(
slug=plugin_config.name, config_name=plugin_config.name,
title_short=plugin_config.verbose_name, title_short=plugin_config.verbose_name,
title_long=plugin_config.verbose_name,
tag_line=plugin_config.description, tag_line=plugin_config.description,
description_short=plugin_config.description, description_short=plugin_config.description,
is_local=True, is_local=True,
@ -181,7 +182,7 @@ def get_catalog_plugins():
author = None author = None
# Populate plugin data # Populate plugin data
plugins[data['slug']] = Plugin( plugins[data['config_name']] = Plugin(
id=data['id'], id=data['id'],
status=data['status'], status=data['status'],
title_short=data['title_short'], title_short=data['title_short'],

View File

@ -39,8 +39,8 @@ class PluginVersionTable(BaseTable):
class CatalogPluginTable(BaseTable): class CatalogPluginTable(BaseTable):
title_short = tables.Column( title_long = tables.Column(
linkify=('core:plugin', [tables.A('slug')]), linkify=('core:plugin', [tables.A('config_name')]),
verbose_name=_('Name') verbose_name=_('Name')
) )
author = tables.Column( author = tables.Column(
@ -69,11 +69,11 @@ class CatalogPluginTable(BaseTable):
class Meta(BaseTable.Meta): class Meta(BaseTable.Meta):
empty_text = _('No plugin data found') empty_text = _('No plugin data found')
fields = ( fields = (
'title_short', 'author', 'is_local', 'is_installed', 'is_certified', 'created_at', 'updated_at', 'title_long', 'author', 'is_local', 'is_installed', 'is_certified', 'created_at', 'updated_at',
'installed_version', 'installed_version',
) )
default_columns = ( default_columns = (
'title_short', 'author', 'is_local', 'is_installed', 'is_certified', 'created_at', 'updated_at', 'title_long', 'author', 'is_local', 'is_installed', 'is_certified', 'created_at', 'updated_at',
) )
# List installed plugins first, then certified plugins, then # List installed plugins first, then certified plugins, then
# everything else (with each tranche ordered alphabetically) # everything else (with each tranche ordered alphabetically)

View File

@ -3,7 +3,7 @@
{% load form_helpers %} {% load form_helpers %}
{% load i18n %} {% load i18n %}
{% block title %}{{ plugin.title_short }}{% endblock %} {% block title %}{{ plugin.title_long }}{% endblock %}
{% block object_identifier %} {% block object_identifier %}
{% endblock object_identifier %} {% endblock object_identifier %}
@ -51,7 +51,7 @@
<table class="table table-hover attr-table"> <table class="table table-hover attr-table">
<tr> <tr>
<th scope="row">{% trans "Name" %}</th> <th scope="row">{% trans "Name" %}</th>
<td>{{ plugin.title_short }}</td> <td>{{ plugin.title_long }}</td>
</tr> </tr>
<tr> <tr>
<th scope="row">{% trans "Summary" %}</th> <th scope="row">{% trans "Summary" %}</th>