From bf67eb3366551a5357856ca62938accf4c72d343 Mon Sep 17 00:00:00 2001 From: Andrej Velichkovski Date: Mon, 30 Sep 2024 11:17:21 +0200 Subject: [PATCH 1/8] Rebrand public representation for components --- templates/certified/component-details.html | 98 ----------------- .../components/_certified-releases.html | 25 +++++ .../components/_hardware-details.html | 63 +++++++++++ .../certified/components/_hero-section.html | 14 +++ .../components/_machines-present.html | 21 ++++ .../components/component-details.html | 33 ++++++ webapp/certified/views.py | 100 +++++------------- 7 files changed, 182 insertions(+), 172 deletions(-) delete mode 100644 templates/certified/component-details.html create mode 100644 templates/certified/components/_certified-releases.html create mode 100644 templates/certified/components/_hardware-details.html create mode 100644 templates/certified/components/_hero-section.html create mode 100644 templates/certified/components/_machines-present.html create mode 100644 templates/certified/components/component-details.html diff --git a/templates/certified/component-details.html b/templates/certified/component-details.html deleted file mode 100644 index 323ccba2f6c..00000000000 --- a/templates/certified/component-details.html +++ /dev/null @@ -1,98 +0,0 @@ -{% extends "templates/base.html" %} - -{% block title %}Ubuntu certified component: {{ component.vendor_name }} {{ component.model }}{% endblock %} - -{% block meta_description %}Hardware that have been certified for use with Ubuntu.{% endblock meta_description %} - -{% block outer_content %} -
-
-
-

{{ component.vendor_name }} {{ component.model }}

-
-
-
-
-

Components certified in Ubuntu releases

-
-
-
-
- - - - - - - - - - {% for name, details in component.lts_releases.items() %} - - - - - - {% endfor %} - -
ReleaseStatusThird-party driver
{{ details.0.release }}{{ details.0.status.title() }}{% if details.0.third_party_driver != True %}No{% else %}Yes{% endif %}
-
-
-
-
-

Component details

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Vendor{{ component.vendor_name }}
Model name{{ component.model }}
Identifier{{ component.identifier }}
Subsystem Identifier{{ component.subsystem_identifier}}
Hardware Vendor make{{ component.hardware_vendor_make }}
Vendor make{{ component.vendor_make }}
Part number{{ component.part_number }}
Device category{{ component.category }}
Note{{ component.note }}
-
-
-
-

Present in {{ machines|length }} certified system{% if machines|length > 1 %}s{% endif %}

- -
-
- -{% endblock %} diff --git a/templates/certified/components/_certified-releases.html b/templates/certified/components/_certified-releases.html new file mode 100644 index 00000000000..ae39d1686b2 --- /dev/null +++ b/templates/certified/components/_certified-releases.html @@ -0,0 +1,25 @@ +
+
+
+
+ + + + + + + + + + {% for name, details in lts_releases.items() %} + + + + + + {% endfor %} + +
ReleaseStatusThird-party driver
{{ details.0.release }}{{ details.0.status.title() }}{% if details.0.third_party_driver != True %}No{% else %}Yes{% endif %}
+
+
+
\ No newline at end of file diff --git a/templates/certified/components/_hardware-details.html b/templates/certified/components/_hardware-details.html new file mode 100644 index 00000000000..430b9931bce --- /dev/null +++ b/templates/certified/components/_hardware-details.html @@ -0,0 +1,63 @@ +
+
+
+

Component details

+
+
+ + + + + + + + + + + {% if component.identifier %} + + + + + {% endif %} + {% if component.subsystem_identifier %} + + + + + {% endif %} + {% if component.hardware_vendor_make %} + + + + + {% endif %} + {% if component.vendor_make %} + + + + + {% endif %} + {% if component.part_number %} + + + + + {% endif %} + {% if component.category %} + + + + + {% endif %} + {% if component.note %} + + + + + {% endif %} + +
Vendor{{ component.vendor_name }}
Model name{{ component.model }}
Identifier{{ component.identifier }}
Subsystem Identifier{{ component.subsystem_identifier}}
Hardware Vendor make{{ component.hardware_vendor_make }}
Vendor make{{ component.vendor_make }}
Part number{{ component.part_number }}
Device category{{ component.category }}
Note{{ component.note }}
+
+
+
\ No newline at end of file diff --git a/templates/certified/components/_hero-section.html b/templates/certified/components/_hero-section.html new file mode 100644 index 00000000000..e7f67f819b8 --- /dev/null +++ b/templates/certified/components/_hero-section.html @@ -0,0 +1,14 @@ +
+
+
+
+
+
+

Component

+

+ {{ vendor_name }} {{ component_name }} +

+
+
+
+
\ No newline at end of file diff --git a/templates/certified/components/_machines-present.html b/templates/certified/components/_machines-present.html new file mode 100644 index 00000000000..303db1c8742 --- /dev/null +++ b/templates/certified/components/_machines-present.html @@ -0,0 +1,21 @@ +
+
+
+

Present in {{ machines|length }} certified system{% if machines|length > 1 %}s{% endif %}

+
+
+ +
+
+
\ No newline at end of file diff --git a/templates/certified/components/component-details.html b/templates/certified/components/component-details.html new file mode 100644 index 00000000000..5b740ef54a3 --- /dev/null +++ b/templates/certified/components/component-details.html @@ -0,0 +1,33 @@ +{% extends "templates/base.html" %} + +{% block title %}Ubuntu certified component: {{ component.vendor_name }} {{ component.model }}{% endblock %} + +{% block meta_description %}Hardware that have been certified for use with Ubuntu.{% endblock meta_description %} + +{% block outer_content %} + +
+
+ {% with + vendor_name=component.vendor_name, + component_name=component.model + %} + {% include "/certified/components/_hero-section.html" %} + {% endwith %} + + {% with + lts_releases=component.lts_releases + %} + {% include "/certified/components/_certified-releases.html" %} + {% endwith %} +
+ {% with component=component %} + {% include "/certified/components/_hardware-details.html" %} + {% endwith %} +
+ {% with machines=machines %} + {% include "/certified/components/_machines-present.html" %} + {% endwith %} +
+
+{% endblock %} diff --git a/webapp/certified/views.py b/webapp/certified/views.py index 7ef3c7f58ad..dff95e03c19 100644 --- a/webapp/certified/views.py +++ b/webapp/certified/views.py @@ -76,9 +76,7 @@ def certified_routes(app): "/certified/why-certify", view_func=certified_why, ) - app.add_url_rule( - "/certified/filters.json", view_func=get_vendors_releases_filters - ) + app.add_url_rule("/certified/filters.json", view_func=get_vendors_releases_filters) def _parse_query_params(all_releases, all_vendors): @@ -108,9 +106,7 @@ def _parse_query_params(all_releases, all_vendors): if item in category_params: continue if item == category: - new_query_params["category"] = category_params.append( - category - ) + new_query_params["category"] = category_params.append(category) new_query_params["category"] = category_params if request.args.getlist("vendor"): @@ -139,9 +135,7 @@ def _parse_query_params(all_releases, all_vendors): new_query_params["vendors_limit"] = [request.args.get("vendors_limit")] if request.args.get("releases_limit"): - new_query_params["releases_limit"] = [ - request.args.get("releases_limit") - ] + new_query_params["releases_limit"] = [request.args.get("releases_limit")] if new_query_params == request.args.to_dict(flat=False): # No parsing was done @@ -302,31 +296,19 @@ def get_filters(request_args=None, json: bool = False): if version not in release_filters and version != "18.04": release_filters.append(version) - if ( - int(release["laptops"]) > 0 - and release["release"] not in laptop_releases - ): + if int(release["laptops"]) > 0 and release["release"] not in laptop_releases: laptop_releases.append(release["release"]) - if ( - int(release["desktops"]) > 0 - and release["release"] not in desktop_releases - ): + if int(release["desktops"]) > 0 and release["release"] not in desktop_releases: desktop_releases.append(release["release"]) - if ( - int(release["smart_core"]) > 0 - and release["release"] not in iot_releases - ): + if int(release["smart_core"]) > 0 and release["release"] not in iot_releases: iot_releases.append(release["release"]) if int(release["soc"]) > 0 and release["release"] not in soc_releases: soc_releases.append(release["release"]) - if ( - int(release["servers"]) > 0 - and release["release"] not in server_releases - ): + if int(release["servers"]) > 0 and release["release"] not in server_releases: server_releases.append(release["release"]) for vendor in certified_makes: @@ -424,7 +406,7 @@ def certified_component_details(component_id): machines = machines_by_id.values() return render_template( - "certified/component-details.html", + "certified/components/component-details.html", component=component, machines=sorted( machines, key=lambda machine: machine["canonical_id"], reverse=True @@ -446,11 +428,7 @@ def certified_hardware_details(canonical_id, release): # Release section release_details = next( - ( - detail - for detail in model_releases - if detail["certified_release"] == release - ), + (detail for detail in model_releases if detail["certified_release"] == release), None, ) if not release_details: @@ -494,16 +472,14 @@ def certified_hardware_details(canonical_id, release): def certified_model_details(canonical_id): - model_releases = api.certified_configuration_details( - canonical_id=canonical_id - )["results"] + model_releases = api.certified_configuration_details(canonical_id=canonical_id)[ + "results" + ] if not model_releases: abort(404) - component_summaries = api.component_summaries(canonical_id=canonical_id)[ - "results" - ] + component_summaries = api.component_summaries(canonical_id=canonical_id)["results"] release_details = {"components": {}, "releases": []} has_enabled_releases = False @@ -531,8 +507,7 @@ def certified_model_details(canonical_id): for device_category, devices in model_release.items(): if ( - device_category - in ["video", "processor", "network", "wireless"] + device_category in ["video", "processor", "network", "wireless"] and devices ): device_category = device_category.capitalize() @@ -597,10 +572,7 @@ def certified_home(): if new_certified_params: return redirect(url_for(request.endpoint, **new_certified_params)) - if ( - "category" in request.args - and len(request.args.getlist("category")) == 1 - ): + if "category" in request.args and len(request.args.getlist("category")) == 1: parameters = request.args.to_dict(flat=False) parameters.pop("category") new_params = "" @@ -635,9 +607,7 @@ def certified_home(): # Put back Ubuntu Core, as required by API endpoint selected_categories.append("Ubuntu Core") - categories = ( - ",".join(selected_categories) if selected_categories else None - ) + categories = ",".join(selected_categories) if selected_categories else None if categories and "All" in categories: categories = None releases = ( @@ -646,9 +616,7 @@ def certified_home(): else None ) vendors = ( - request.args.getlist("vendor") - if request.args.getlist("vendor") - else None + request.args.getlist("vendor") if request.args.getlist("vendor") else None ) models_response = api.certified_configurations( @@ -718,40 +686,28 @@ def create_category_views(category, template_path): return redirect(url) if category == "Desktop": - certified_releases = api.certified_releases( - limit="0", desktops__gte=1 - )["results"] - certified_makes = api.certified_vendors(limit="0", desktops__gte=1)[ + certified_releases = api.certified_releases(limit="0", desktops__gte=1)[ "results" ] + certified_makes = api.certified_vendors(limit="0", desktops__gte=1)["results"] elif category == "Laptop": certified_releases = api.certified_releases(limit="0", laptops__gte=1)[ "results" ] - certified_makes = api.certified_vendors(limit="0", laptops__gte=1)[ - "results" - ] + certified_makes = api.certified_vendors(limit="0", laptops__gte=1)["results"] elif category == "Server SoC": - certified_releases = api.certified_releases(limit="0", soc__gte=1)[ - "results" - ] - certified_makes = api.certified_vendors(limit="0", soc__gte=1)[ - "results" - ] + certified_releases = api.certified_releases(limit="0", soc__gte=1)["results"] + certified_makes = api.certified_vendors(limit="0", soc__gte=1)["results"] elif category == "Ubuntu Core": - certified_releases = api.certified_releases( - limit="0", smart_core__gte=1 - )["results"] - certified_makes = api.certified_vendors(limit="0", smart_core__gte=1)[ + certified_releases = api.certified_releases(limit="0", smart_core__gte=1)[ "results" ] + certified_makes = api.certified_vendors(limit="0", smart_core__gte=1)["results"] elif category == "Server": certified_releases = api.certified_releases(limit="0", servers__gte=1)[ "results" ] - certified_makes = api.certified_vendors(limit="0", servers__gte=1)[ - "results" - ] + certified_makes = api.certified_vendors(limit="0", servers__gte=1)["results"] else: certified_releases = api.certified_releases(limit="0")["results"] certified_makes = api.certified_vendors(limit="0")["results"] @@ -798,11 +754,7 @@ def create_category_views(category, template_path): if request.args.getlist("release") else None ) - vendors = ( - request.args.getlist("vendor") - if request.args.getlist("vendor") - else None - ) + vendors = request.args.getlist("vendor") if request.args.getlist("vendor") else None models_response = api.certified_configurations( category__in=category, From ed1e188dbda3cc2c3bf3e15f67714e12f3f48d04 Mon Sep 17 00:00:00 2001 From: Andrej Velichkovski Date: Mon, 30 Sep 2024 17:47:05 +0200 Subject: [PATCH 2/8] Apply black formatting --- webapp/certified/views.py | 98 +++++++++++++++++++++++++++++---------- 1 file changed, 73 insertions(+), 25 deletions(-) diff --git a/webapp/certified/views.py b/webapp/certified/views.py index dff95e03c19..2c357a5f19b 100644 --- a/webapp/certified/views.py +++ b/webapp/certified/views.py @@ -76,7 +76,9 @@ def certified_routes(app): "/certified/why-certify", view_func=certified_why, ) - app.add_url_rule("/certified/filters.json", view_func=get_vendors_releases_filters) + app.add_url_rule( + "/certified/filters.json", view_func=get_vendors_releases_filters + ) def _parse_query_params(all_releases, all_vendors): @@ -106,7 +108,9 @@ def _parse_query_params(all_releases, all_vendors): if item in category_params: continue if item == category: - new_query_params["category"] = category_params.append(category) + new_query_params["category"] = category_params.append( + category + ) new_query_params["category"] = category_params if request.args.getlist("vendor"): @@ -135,7 +139,9 @@ def _parse_query_params(all_releases, all_vendors): new_query_params["vendors_limit"] = [request.args.get("vendors_limit")] if request.args.get("releases_limit"): - new_query_params["releases_limit"] = [request.args.get("releases_limit")] + new_query_params["releases_limit"] = [ + request.args.get("releases_limit") + ] if new_query_params == request.args.to_dict(flat=False): # No parsing was done @@ -296,19 +302,31 @@ def get_filters(request_args=None, json: bool = False): if version not in release_filters and version != "18.04": release_filters.append(version) - if int(release["laptops"]) > 0 and release["release"] not in laptop_releases: + if ( + int(release["laptops"]) > 0 + and release["release"] not in laptop_releases + ): laptop_releases.append(release["release"]) - if int(release["desktops"]) > 0 and release["release"] not in desktop_releases: + if ( + int(release["desktops"]) > 0 + and release["release"] not in desktop_releases + ): desktop_releases.append(release["release"]) - if int(release["smart_core"]) > 0 and release["release"] not in iot_releases: + if ( + int(release["smart_core"]) > 0 + and release["release"] not in iot_releases + ): iot_releases.append(release["release"]) if int(release["soc"]) > 0 and release["release"] not in soc_releases: soc_releases.append(release["release"]) - if int(release["servers"]) > 0 and release["release"] not in server_releases: + if ( + int(release["servers"]) > 0 + and release["release"] not in server_releases + ): server_releases.append(release["release"]) for vendor in certified_makes: @@ -428,7 +446,11 @@ def certified_hardware_details(canonical_id, release): # Release section release_details = next( - (detail for detail in model_releases if detail["certified_release"] == release), + ( + detail + for detail in model_releases + if detail["certified_release"] == release + ), None, ) if not release_details: @@ -472,14 +494,16 @@ def certified_hardware_details(canonical_id, release): def certified_model_details(canonical_id): - model_releases = api.certified_configuration_details(canonical_id=canonical_id)[ - "results" - ] + model_releases = api.certified_configuration_details( + canonical_id=canonical_id + )["results"] if not model_releases: abort(404) - component_summaries = api.component_summaries(canonical_id=canonical_id)["results"] + component_summaries = api.component_summaries(canonical_id=canonical_id)[ + "results" + ] release_details = {"components": {}, "releases": []} has_enabled_releases = False @@ -507,7 +531,8 @@ def certified_model_details(canonical_id): for device_category, devices in model_release.items(): if ( - device_category in ["video", "processor", "network", "wireless"] + device_category + in ["video", "processor", "network", "wireless"] and devices ): device_category = device_category.capitalize() @@ -572,7 +597,10 @@ def certified_home(): if new_certified_params: return redirect(url_for(request.endpoint, **new_certified_params)) - if "category" in request.args and len(request.args.getlist("category")) == 1: + if ( + "category" in request.args + and len(request.args.getlist("category")) == 1 + ): parameters = request.args.to_dict(flat=False) parameters.pop("category") new_params = "" @@ -607,7 +635,9 @@ def certified_home(): # Put back Ubuntu Core, as required by API endpoint selected_categories.append("Ubuntu Core") - categories = ",".join(selected_categories) if selected_categories else None + categories = ( + ",".join(selected_categories) if selected_categories else None + ) if categories and "All" in categories: categories = None releases = ( @@ -616,7 +646,9 @@ def certified_home(): else None ) vendors = ( - request.args.getlist("vendor") if request.args.getlist("vendor") else None + request.args.getlist("vendor") + if request.args.getlist("vendor") + else None ) models_response = api.certified_configurations( @@ -686,28 +718,40 @@ def create_category_views(category, template_path): return redirect(url) if category == "Desktop": - certified_releases = api.certified_releases(limit="0", desktops__gte=1)[ + certified_releases = api.certified_releases( + limit="0", desktops__gte=1 + )["results"] + certified_makes = api.certified_vendors(limit="0", desktops__gte=1)[ "results" ] - certified_makes = api.certified_vendors(limit="0", desktops__gte=1)["results"] elif category == "Laptop": certified_releases = api.certified_releases(limit="0", laptops__gte=1)[ "results" ] - certified_makes = api.certified_vendors(limit="0", laptops__gte=1)["results"] + certified_makes = api.certified_vendors(limit="0", laptops__gte=1)[ + "results" + ] elif category == "Server SoC": - certified_releases = api.certified_releases(limit="0", soc__gte=1)["results"] - certified_makes = api.certified_vendors(limit="0", soc__gte=1)["results"] + certified_releases = api.certified_releases(limit="0", soc__gte=1)[ + "results" + ] + certified_makes = api.certified_vendors(limit="0", soc__gte=1)[ + "results" + ] elif category == "Ubuntu Core": - certified_releases = api.certified_releases(limit="0", smart_core__gte=1)[ + certified_releases = api.certified_releases( + limit="0", smart_core__gte=1 + )["results"] + certified_makes = api.certified_vendors(limit="0", smart_core__gte=1)[ "results" ] - certified_makes = api.certified_vendors(limit="0", smart_core__gte=1)["results"] elif category == "Server": certified_releases = api.certified_releases(limit="0", servers__gte=1)[ "results" ] - certified_makes = api.certified_vendors(limit="0", servers__gte=1)["results"] + certified_makes = api.certified_vendors(limit="0", servers__gte=1)[ + "results" + ] else: certified_releases = api.certified_releases(limit="0")["results"] certified_makes = api.certified_vendors(limit="0")["results"] @@ -754,7 +798,11 @@ def create_category_views(category, template_path): if request.args.getlist("release") else None ) - vendors = request.args.getlist("vendor") if request.args.getlist("vendor") else None + vendors = ( + request.args.getlist("vendor") + if request.args.getlist("vendor") + else None + ) models_response = api.certified_configurations( category__in=category, From 7842bcab2d190e8bfd742795e94de8a5c250495b Mon Sep 17 00:00:00 2001 From: Andrej Velichkovski Date: Mon, 30 Sep 2024 17:53:41 +0200 Subject: [PATCH 3/8] Fix issue in jinja template --- templates/certified/components/_hardware-details.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/certified/components/_hardware-details.html b/templates/certified/components/_hardware-details.html index 430b9931bce..33377b4cccb 100644 --- a/templates/certified/components/_hardware-details.html +++ b/templates/certified/components/_hardware-details.html @@ -23,7 +23,7 @@

Component details

{% if component.subsystem_identifier %} Subsystem Identifier - {{ component.subsystem_identifier}} + {{ component.subsystem_identifier }} {% endif %} {% if component.hardware_vendor_make %} From 493bae7c977629ccc37783f90ed8a59f05a44564 Mon Sep 17 00:00:00 2001 From: Andrej Velichkovski Date: Tue, 1 Oct 2024 14:12:43 +0200 Subject: [PATCH 4/8] Remove empty col div --- .../certified/components/_certified-releases.html | 13 ++++++------- templates/certified/components/_hero-section.html | 6 ++---- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/templates/certified/components/_certified-releases.html b/templates/certified/components/_certified-releases.html index ae39d1686b2..4738011dd6b 100644 --- a/templates/certified/components/_certified-releases.html +++ b/templates/certified/components/_certified-releases.html @@ -1,8 +1,7 @@
-
-
-
- +
+
+
@@ -13,9 +12,9 @@ {% for name, details in lts_releases.items() %} - - - + + + {% endfor %} diff --git a/templates/certified/components/_hero-section.html b/templates/certified/components/_hero-section.html index e7f67f819b8..a83e6f970e4 100644 --- a/templates/certified/components/_hero-section.html +++ b/templates/certified/components/_hero-section.html @@ -1,8 +1,6 @@
-
-
-
-
+
+

Component

From fd1c6a7bf7767e6fbf8b0f8d2f97fd7cc560790f Mon Sep 17 00:00:00 2001 From: Andrej Velichkovski Date: Tue, 1 Oct 2024 14:19:49 +0200 Subject: [PATCH 5/8] Remove is-paper specification --- .../components/component-details.html | 47 ++++++++++--------- 1 file changed, 24 insertions(+), 23 deletions(-) diff --git a/templates/certified/components/component-details.html b/templates/certified/components/component-details.html index 5b740ef54a3..a65d8acc0d1 100644 --- a/templates/certified/components/component-details.html +++ b/templates/certified/components/component-details.html @@ -4,30 +4,31 @@ {% block meta_description %}Hardware that have been certified for use with Ubuntu.{% endblock meta_description %} +{% block body_class %}is-paper{% endblock body_class %} + {% block outer_content %} -
-
- {% with - vendor_name=component.vendor_name, - component_name=component.model - %} - {% include "/certified/components/_hero-section.html" %} - {% endwith %} +
+ {% with + vendor_name=component.vendor_name, + component_name=component.model + %} + {% include "/certified/components/_hero-section.html" %} + {% endwith %} + + {% with + lts_releases=component.lts_releases + %} + {% include "/certified/components/_certified-releases.html" %} + {% endwith %} +
+ {% with component=component %} + {% include "/certified/components/_hardware-details.html" %} + {% endwith %} +
+ {% with machines=machines %} + {% include "/certified/components/_machines-present.html" %} + {% endwith %} +
- {% with - lts_releases=component.lts_releases - %} - {% include "/certified/components/_certified-releases.html" %} - {% endwith %} -
- {% with component=component %} - {% include "/certified/components/_hardware-details.html" %} - {% endwith %} -
- {% with machines=machines %} - {% include "/certified/components/_machines-present.html" %} - {% endwith %} -
-
{% endblock %} From 0584f8256d79d5da6b6b9ea2af9baa019c24ee43 Mon Sep 17 00:00:00 2001 From: Andrej Velichkovski Date: Tue, 1 Oct 2024 14:21:43 +0200 Subject: [PATCH 6/8] Change wording from release to ubuntu release --- templates/certified/components/_certified-releases.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/certified/components/_certified-releases.html b/templates/certified/components/_certified-releases.html index 4738011dd6b..7e12d12a1e3 100644 --- a/templates/certified/components/_certified-releases.html +++ b/templates/certified/components/_certified-releases.html @@ -4,7 +4,7 @@

Release
{{ details.0.release }}{{ details.0.status.title() }}{% if details.0.third_party_driver != True %}No{% else %}Yes{% endif %}{{ details.0.release }}{{ details.0.status.title() }}{% if details.0.third_party_driver != True %}No{% else %}Yes{% endif %}
- + From beeb5e3ee35cc821a81c01876b967abe559d0ecc Mon Sep 17 00:00:00 2001 From: Andrej Velichkovski Date: Fri, 1 Nov 2024 11:24:13 +0100 Subject: [PATCH 7/8] Address PR comments --- .../components/_certified-releases.html | 18 +++-- .../components/_hardware-details.html | 78 ++++++++++--------- .../certified/components/_hero-section.html | 6 +- .../components/_machines-present.html | 20 +++-- .../components/component-details.html | 44 +++++------ 5 files changed, 86 insertions(+), 80 deletions(-) diff --git a/templates/certified/components/_certified-releases.html b/templates/certified/components/_certified-releases.html index 7e12d12a1e3..fa44ca63d97 100644 --- a/templates/certified/components/_certified-releases.html +++ b/templates/certified/components/_certified-releases.html @@ -11,14 +11,20 @@ {% for name, details in lts_releases.items() %} - - - - - + + + + + {% endfor %}
ReleaseUbuntu Release Status Third-party driver
{{ details.0.release }}{{ details.0.status.title() }}{% if details.0.third_party_driver != True %}No{% else %}Yes{% endif %}
{{ details.0.release }}{{ details.0.status.title() }} + {% if details.0.third_party_driver != True %} + No + {% else %} + Yes + {% endif %} +
-
\ No newline at end of file + diff --git a/templates/certified/components/_hardware-details.html b/templates/certified/components/_hardware-details.html index 33377b4cccb..cca947286b4 100644 --- a/templates/certified/components/_hardware-details.html +++ b/templates/certified/components/_hardware-details.html @@ -6,58 +6,62 @@

Component details

- - - - - - - - + {% if component.vendor_name %} + + + + + {% endif %} + {% if component.model %} + + + + + {% endif %} {% if component.identifier %} - - - - + + + + {% endif %} {% if component.subsystem_identifier %} - - - - + + + + {% endif %} {% if component.hardware_vendor_make %} - - - - + + + + {% endif %} {% if component.vendor_make %} - - - - + + + + {% endif %} {% if component.part_number %} - - - - + + + + {% endif %} {% if component.category %} - - - - + + + + {% endif %} {% if component.note %} - - - - + + + + {% endif %}
Vendor{{ component.vendor_name }}
Model name{{ component.model }}
Vendor{{ component.vendor_name }}
Model name{{ component.model }}
Identifier{{ component.identifier }}
Identifier{{ component.identifier }}
Subsystem Identifier{{ component.subsystem_identifier }}
Subsystem Identifier{{ component.subsystem_identifier }}
Hardware Vendor make{{ component.hardware_vendor_make }}
Hardware Vendor make{{ component.hardware_vendor_make }}
Vendor make{{ component.vendor_make }}
Vendor make{{ component.vendor_make }}
Part number{{ component.part_number }}
Part number{{ component.part_number }}
Device category{{ component.category }}
Device category{{ component.category }}
Note{{ component.note }}
Note{{ component.note }}
- \ No newline at end of file + diff --git a/templates/certified/components/_hero-section.html b/templates/certified/components/_hero-section.html index a83e6f970e4..5906ebd9d14 100644 --- a/templates/certified/components/_hero-section.html +++ b/templates/certified/components/_hero-section.html @@ -3,10 +3,8 @@

Component

-

- {{ vendor_name }} {{ component_name }} -

+

{{ vendor_name }} {{ component_name }}

- \ No newline at end of file + diff --git a/templates/certified/components/_machines-present.html b/templates/certified/components/_machines-present.html index 303db1c8742..52d98c929c6 100644 --- a/templates/certified/components/_machines-present.html +++ b/templates/certified/components/_machines-present.html @@ -1,21 +1,19 @@
-

Present in {{ machines|length }} certified system{% if machines|length > 1 %}s{% endif %}

+

+ Present in {{ machines|length }} certified system + {% if machines|length > 1 %}s{% endif %} +

-
-
\ No newline at end of file + diff --git a/templates/certified/components/component-details.html b/templates/certified/components/component-details.html index a65d8acc0d1..3189571394b 100644 --- a/templates/certified/components/component-details.html +++ b/templates/certified/components/component-details.html @@ -8,27 +8,27 @@ {% block outer_content %} -
- {% with - vendor_name=component.vendor_name, - component_name=component.model - %} - {% include "/certified/components/_hero-section.html" %} - {% endwith %} - - {% with - lts_releases=component.lts_releases - %} - {% include "/certified/components/_certified-releases.html" %} - {% endwith %} -
- {% with component=component %} - {% include "/certified/components/_hardware-details.html" %} - {% endwith %} -
- {% with machines=machines %} - {% include "/certified/components/_machines-present.html" %} - {% endwith %} -
+{% with + vendor_name=component.vendor_name, + component_name=component.model +%} + {% include "/certified/components/_hero-section.html" %} +{% endwith %} + +{% with + lts_releases=component.lts_releases +%} + {% include "/certified/components/_certified-releases.html" %} +{% endwith %} + +
+{% with component=component %} + {% include "/certified/components/_hardware-details.html" %} +{% endwith %} + +
+{% with machines=machines %} + {% include "/certified/components/_machines-present.html" %} +{% endwith %} {% endblock %} From 79b073b23da035561ddb8148352e685ab93dfb71 Mon Sep 17 00:00:00 2001 From: Andrej Velichkovski Date: Mon, 4 Nov 2024 09:25:37 +0100 Subject: [PATCH 8/8] Fix issue with s rendered wrongly --- templates/certified/components/_machines-present.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/certified/components/_machines-present.html b/templates/certified/components/_machines-present.html index 52d98c929c6..9592a649a1f 100644 --- a/templates/certified/components/_machines-present.html +++ b/templates/certified/components/_machines-present.html @@ -3,7 +3,7 @@

Present in {{ machines|length }} certified system - {% if machines|length > 1 %}s{% endif %} + {%- if machines|length > 1 -%}s{% endif %}