Skip to content

Commit 1bca5b1

Browse files
committed
Add support for verbose_name in tabset_data #101
Signed-off-by: Thomas Druez <[email protected]>
1 parent 45527d9 commit 1bca5b1

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

scanpipe/templates/scanpipe/tabset/tabset.html

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,13 @@
66
{% if tab_data.icon_class %}
77
<span class="icon is-small"><i class="{{ tab_data.icon_class }}"></i></span>
88
{% endif %}
9-
<span>{{ label|capfirst }}</span>
9+
<span>
10+
{% if tab_data.verbose_name %}
11+
{{ tab_data.verbose_name }}
12+
{% else %}
13+
{{ label|capfirst }}
14+
{% endif %}
15+
</span>
1016
</a>
1117
</li>
1218
{% endfor %}

scanpipe/views.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,7 @@ def get_tabset_data(self):
199199

200200
for label, tab_definition in self.tabset.items():
201201
tab_data = {
202+
"verbose_name": tab_definition.get("verbose_name"),
202203
"icon_class": tab_definition.get("icon_class"),
203204
"template": tab_definition.get("template"),
204205
"fields": self.get_fields_data(tab_definition.get("fields")),
@@ -1093,10 +1094,11 @@ class DiscoveredPackageDetailsView(
10931094
],
10941095
"icon_class": "fas fa-plus-square",
10951096
},
1096-
"extra data": {
1097+
"extra_data": {
10971098
"fields": [
10981099
{"field_name": "extra_data", "render_func": render_as_yaml},
10991100
],
1101+
"verbose_name": "Extra data",
11001102
"icon_class": "fas fa-database",
11011103
},
11021104
}

0 commit comments

Comments
 (0)