|
1 | 1 | import django_tables2 as tables
|
2 |
| -from django.urls import reverse |
3 |
| -from django.utils.safestring import mark_safe |
4 | 2 | from django.utils.translation import gettext_lazy as _
|
5 | 3 |
|
6 | 4 | from netbox.tables import BaseTable, columns
|
7 |
| -from .template_code import PLUGIN_IS_INSTALLED |
| 5 | +from .template_code import PLUGIN_IS_INSTALLED, PLUGIN_NAME_TEMPLATE |
8 | 6 |
|
9 | 7 | __all__ = (
|
10 | 8 | 'CatalogPluginTable',
|
11 | 9 | 'PluginVersionTable',
|
12 | 10 | )
|
13 | 11 |
|
14 | 12 |
|
15 |
| -PLUGIN_NAME_TEMPLATE = """ |
16 |
| -<img class="plugin-icon" src="{{ record.icon_url }}"> |
17 |
| -<a href="{% url 'core:plugin' record.config_name %}">{{ record.title_long }}</a> |
18 |
| -""" |
19 |
| - |
20 |
| - |
21 | 13 | class PluginVersionTable(BaseTable):
|
22 | 14 | version = tables.Column(
|
23 | 15 | verbose_name=_('Version')
|
@@ -93,10 +85,4 @@ class Meta(BaseTable.Meta):
|
93 | 85 | )
|
94 | 86 | # List installed plugins first, then certified plugins, then
|
95 | 87 | # everything else (with each tranche ordered alphabetically)
|
96 |
| - order_by = ('-is_installed', '-is_certified', 'name') |
97 |
| - |
98 |
| - def render_title_long(self, value, record): |
99 |
| - if record.static: |
100 |
| - return value |
101 |
| - url = reverse('core:plugin', args=[record.config_name]) |
102 |
| - return mark_safe(f"<a href='{url}'>{value}</a>") |
| 88 | + order_by = ('-is_installed', '-is_certified', 'title_long') |
0 commit comments