From 4b8c37981ed709ee9eca530d82ef8cbc7d123a57 Mon Sep 17 00:00:00 2001 From: Andrej Velichkovski Date: Thu, 1 Aug 2024 11:20:18 +0200 Subject: [PATCH 01/16] Initial implementation for Platform Page --- .../certified/platforms/platform-details.html | 221 ++++++++++++++++++ .../certified/shared/category-image.html | 44 ++++ webapp/certified/api.py | 23 +- webapp/certified/views.py | 154 ++++++------ 4 files changed, 360 insertions(+), 82 deletions(-) create mode 100644 templates/certified/platforms/platform-details.html create mode 100644 templates/certified/shared/category-image.html diff --git a/templates/certified/platforms/platform-details.html b/templates/certified/platforms/platform-details.html new file mode 100644 index 00000000000..8660adc54a9 --- /dev/null +++ b/templates/certified/platforms/platform-details.html @@ -0,0 +1,221 @@ +{% extends "templates/base.html" %} + +{% block title %} {{ platform.vendor }} {{ platform.name }} certified with Ubuntu.{% endblock %} + +{% block meta_description %}Platform that is certified for use with Ubuntu.{% endblock meta_description %} + +{% block outer_content %} + + + +
+
+ {% with category=platform.category %} + {% include "certified/shared/category-image.html" %} + {% endwith %} +
+
+
+ +

{{platform.category}} > Platform

+
+
+ +

{{platform.vendor}} {{platform.name}}

+ {% if platform.certificates|length == 1 %} +

1 certified configuration

+ {% else %} +

{{platform.certificates|length}} certified configurations

+ {% endif %} +
+ +
+ +
+ + + + + {% for canonical_id, certificate in platform.certificates.items() %} + + {% endfor %} + + + + + + {% for canonical_id, certificate in platform.certificates.items() %} + + {% endfor %} + + + + {% endfor %} + + + + {% for canonical_id, certificate in platform.certificates.items() %} + + {% endfor %} + + + + {% for canonical_id, certificate in platform.certificates.items() %} + + {% endfor %} + + + + {% for canonical_id, certificate in platform.certificates.items() %} + + {% endfor %} + + + + + {% for canonical_id, certificate in platform.certificates.items() %} + + {% endfor %} + + +
{{certificate.name}}
Certified Ubuntu Release{% for release in certificate.releases%}

{{release}}

{% endfor %}
Processor + {% for canonical_id, certificate in platform.certificates.items() %} + + {% for device in certificate.processor %} +
  • + {{ device.name }} {% if device.bus in ["usb", "pci"] %}({{ device.identifier }}{% if device.subsystem %} {{ device.subsystem }}{% endif %}){% endif %} +
  • + {% endfor %} +
    Graphics + {% for device in certificate.video %} +
  • + {{ device.name }} {% if device.bus in ["usb", "pci"] %}({{ device.identifier }}{% if device.subsystem %} {{ device.subsystem }}{% endif %}){% endif %} +
  • + {% endfor %} +
    Network + {% for device in certificate.network %} +
  • + {{ device.name }} {% if device.bus in ["usb", "pci"] %}({{ device.identifier }}{% if device.subsystem %} {{ device.subsystem }}{% endif %}){% endif %} +
  • + {% endfor %} +
    Wireless + {% for device in certificate.wireless %} +
  • + {{ device.name }} {% if device.bus in ["usb", "pci"] %}({{ device.identifier }}{% if device.subsystem %} {{ device.subsystem }}{% endif %}){% endif %} +
  • + {% endfor %} +
    Certificate date + {{certificate.date}} +
    + +
    + +
    + +
    +
    +
    + + + +{% endblock %} diff --git a/templates/certified/shared/category-image.html b/templates/certified/shared/category-image.html new file mode 100644 index 00000000000..728426f4623 --- /dev/null +++ b/templates/certified/shared/category-image.html @@ -0,0 +1,44 @@ +{% if category == "Desktop" or category == "Laptop" %} +{{ image ( + url="https://assets.ubuntu.com/v1/4b732966-Laptop.svg", + alt="", + width="132", + height="77", + hi_def=True, + loading="auto" + ) | safe +}} +{% endif %} +{% if category == "Server" %} +{{ image ( + url="https://assets.ubuntu.com/v1/fdf83d49-Server.svg", + alt="Server", + width="80", + height="96", + hi_def=True, + loading="auto" + ) | safe +}} +{% endif %} +{% if category == "Ubuntu Core" %} +{{ image ( + url="https://assets.ubuntu.com/v1/f9f8ace9-gateway.svg", + alt="Gateway", + width="96", + height="100", + hi_def=True, + loading="auto" + ) | safe +}} +{% endif %} +{% if category == "Server SoC" %} +{{ image ( + url="https://assets.ubuntu.com/v1/4e0399a1-chip.svg", + alt="Chip", + width="84", + height="100", + hi_def=True, + loading="auto" + ) | safe +}} +{% endif %} \ No newline at end of file diff --git a/webapp/certified/api.py b/webapp/certified/api.py index 56b3e6683f7..ecc4cd59905 100644 --- a/webapp/certified/api.py +++ b/webapp/certified/api.py @@ -17,9 +17,7 @@ def __init__(self, base_url: str, session: Session): def _get(self, path: str, params: dict = {}): # Remove "None" values from params - params = { - key: value for key, value in params.items() if value is not None - } + params = {key: value for key, value in params.items() if value is not None} params["pagination"] = "limitoffset" # Get the JSON data @@ -33,6 +31,21 @@ def _get(self, path: str, params: dict = {}): return response + def certified_platform_details( + self, + platform_id, + limit=None, + offset=None, + ): + # TODO: update URL once stable + return self._get( + f"certified-platforms/{platform_id}", + params={ + "limit": limit, + "offset": offset, + }, + ).json() + def certified_vendors( self, limit=None, @@ -204,9 +217,7 @@ def device_categories(self, limit=None, offset=None): ).json() def releases(self, limit=None, offset=None): - return self._get( - "releases", params={"limit": limit, "offset": offset} - ).json() + return self._get("releases", params={"limit": limit, "offset": offset}).json() def vendor_summaries_server(self, limit=None, offset=None): return self._get( diff --git a/webapp/certified/views.py b/webapp/certified/views.py index 7ef3c7f58ad..70e9f2728ad 100644 --- a/webapp/certified/views.py +++ b/webapp/certified/views.py @@ -20,9 +20,7 @@ session = Session() talisker.requests.configure(session) -api = CertificationAPI( - base_url="https://certification.canonical.com/api/v2", session=session -) +api = CertificationAPI(base_url="http://localhost:8081/api/v2", session=session) partners_api = PartnersAPI(session=session) @@ -36,6 +34,13 @@ def certified_routes(app): """ app.add_url_rule("/certified", view_func=certified_home) + app.add_url_rule( + "/certified/platforms/", view_func=certified_platform_details + ) + app.add_url_rule( + "/certified/platforms//", + view_func=certified_platform_details_by_release, + ) app.add_url_rule( "/certified/", view_func=certified_model_details, @@ -76,9 +81,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 +111,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 +140,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 @@ -150,6 +149,51 @@ def _parse_query_params(all_releases, all_vendors): return new_query_params +def certified_platform_details(platform_id): + platform = api.certified_platform_details(platform_id) + releases = set( + release + for _, certificate in platform["certificates"].items() + for release in certificate["releases"] + ) + print(releases) + return render_template( + "certified/platforms/platform-details.html", + platform=platform, + releases=releases, + selected_release=None, + ) + + +def certified_platform_details_by_release(platform_id, release): + platform = api.certified_platform_details(platform_id) + releases = set( + release + for _, certificate in platform["certificates"].items() + for release in certificate["releases"] + ) + + if release not in releases: + return render_template( + "certified/platforms/platform-details.html", + platform=platform, + releases=releases, + selected_release=None, + ) + + platform["certificates"] = { + canonical_id: certificate + for canonical_id, certificate in platform["certificates"].items() + if release in certificate["releases"] + } + return render_template( + "certified/platforms/platform-details.html", + platform=platform, + releases=releases, + selected_release=release, + ) + + def get_vendors_releases_filters(): categories = request.args.getlist("category") selected_vendors = request.args.getlist("vendor") @@ -302,31 +346,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: @@ -446,11 +478,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 +522,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 +557,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 +622,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 +657,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 +666,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 +736,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 +804,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 8fb1a94404d6e2f4900d45510df03290de09c44e Mon Sep 17 00:00:00 2001 From: Nadzeya H Date: Mon, 12 Aug 2024 18:29:09 +0300 Subject: [PATCH 02/16] Fix bullet points in list items --- .../certified/platforms/platform-details.html | 50 +++++++++++-------- webapp/certified/api.py | 2 +- webapp/certified/views.py | 1 - 3 files changed, 30 insertions(+), 23 deletions(-) diff --git a/templates/certified/platforms/platform-details.html b/templates/certified/platforms/platform-details.html index 8660adc54a9..dfd9e1c952c 100644 --- a/templates/certified/platforms/platform-details.html +++ b/templates/certified/platforms/platform-details.html @@ -21,7 +21,7 @@
    -

    {{platform.category}} > Platform

    +

    {{platform.category}} › Platform

    @@ -69,11 +69,13 @@

    {{platform.certificates|length}} certified configuratio Processor {% for canonical_id, certificate in platform.certificates.items() %} - {% for device in certificate.processor %} -
  • - {{ device.name }} {% if device.bus in ["usb", "pci"] %}({{ device.identifier }}{% if device.subsystem %} {{ device.subsystem }}{% endif %}){% endif %} -
  • - {% endfor %} +
      + {% for device in certificate.processor %} +
    • + {{ device.name }} {% if device.bus in ["usb", "pci"] %}({{ device.identifier }}{% if device.subsystem %} {{ device.subsystem }}{% endif %}){% endif %} +
    • + {% endfor %} +
    {% endfor %} @@ -81,11 +83,13 @@

    {{platform.certificates|length}} certified configuratio Graphics {% for canonical_id, certificate in platform.certificates.items() %} - {% for device in certificate.video %} -
  • - {{ device.name }} {% if device.bus in ["usb", "pci"] %}({{ device.identifier }}{% if device.subsystem %} {{ device.subsystem }}{% endif %}){% endif %} -
  • - {% endfor %} +
      + {% for device in certificate.video %} +
    • + {{ device.name }} {% if device.bus in ["usb", "pci"] %}({{ device.identifier }}{% if device.subsystem %} {{ device.subsystem }}{% endif %}){% endif %} +
    • + {% endfor %} +
    {% endfor %} @@ -93,11 +97,13 @@

    {{platform.certificates|length}} certified configuratio Network {% for canonical_id, certificate in platform.certificates.items() %} - {% for device in certificate.network %} -
  • - {{ device.name }} {% if device.bus in ["usb", "pci"] %}({{ device.identifier }}{% if device.subsystem %} {{ device.subsystem }}{% endif %}){% endif %} -
  • - {% endfor %} +
      + {% for device in certificate.network %} +
    • + {{ device.name }} {% if device.bus in ["usb", "pci"] %}({{ device.identifier }}{% if device.subsystem %} {{ device.subsystem }}{% endif %}){% endif %} +
    • + {% endfor %} +
    {% endfor %} @@ -105,11 +111,13 @@

    {{platform.certificates|length}} certified configuratio Wireless {% for canonical_id, certificate in platform.certificates.items() %} - {% for device in certificate.wireless %} -
  • - {{ device.name }} {% if device.bus in ["usb", "pci"] %}({{ device.identifier }}{% if device.subsystem %} {{ device.subsystem }}{% endif %}){% endif %} -
  • - {% endfor %} +
      + {% for device in certificate.wireless %} +
    • + {{ device.name }} {% if device.bus in ["usb", "pci"] %}({{ device.identifier }}{% if device.subsystem %} {{ device.subsystem }}{% endif %}){% endif %} +
    • + {% endfor %} +
    {% endfor %} diff --git a/webapp/certified/api.py b/webapp/certified/api.py index ecc4cd59905..b58a6647f45 100644 --- a/webapp/certified/api.py +++ b/webapp/certified/api.py @@ -8,7 +8,7 @@ class CertificationAPI: Method names and properties to describe and map directly onto the Certification API (at the time of writing, this API is available at - https://certification.canonical.com/api/v1) + https://certification.canonical.com/api/v2) """ def __init__(self, base_url: str, session: Session): diff --git a/webapp/certified/views.py b/webapp/certified/views.py index 70e9f2728ad..2e953ab036d 100644 --- a/webapp/certified/views.py +++ b/webapp/certified/views.py @@ -156,7 +156,6 @@ def certified_platform_details(platform_id): for _, certificate in platform["certificates"].items() for release in certificate["releases"] ) - print(releases) return render_template( "certified/platforms/platform-details.html", platform=platform, From e98b9f884bf3953079ee5a8c28a9e994c8c4d1a2 Mon Sep 17 00:00:00 2001 From: Nadzeya H Date: Tue, 13 Aug 2024 16:14:53 +0300 Subject: [PATCH 03/16] Update certified/ page to match the design --- templates/certified/model-details.html | 574 ++++++++---------- .../certified/platforms/platform-details.html | 2 +- webapp/certified/views.py | 2 + 3 files changed, 265 insertions(+), 313 deletions(-) diff --git a/templates/certified/model-details.html b/templates/certified/model-details.html index a42fe82b1fe..b008580db1c 100644 --- a/templates/certified/model-details.html +++ b/templates/certified/model-details.html @@ -9,322 +9,272 @@ {% block outer_content %} {# djlint: off #} -
    -
    -
    -

    {{ vendor }} {{ name }}

    -

    {{ form_factor }} system certified with Ubuntu

    - {% if hardware_website %}Visit the website{% endif %} -
    -
    - {% if category == "Desktop" or category == "Laptop" %} - {{ image(url="https://assets.ubuntu.com/v1/4b732966-Laptop.svg", - alt="", - width="132", - height="77", - hi_def=True, - loading="auto") | safe - }} - {% endif %} - {% if category == "Server" %} - {{ image(url="https://assets.ubuntu.com/v1/fdf83d49-Server.svg", - alt="Server", - width="80", - height="96", - hi_def=True, - loading="auto") | safe - }} - {% endif %} - {% if category == "Ubuntu Core" %} - {{ image(url="https://assets.ubuntu.com/v1/f9f8ace9-gateway.svg", - alt="Gateway", - width="96", - height="100", - hi_def=True, - loading="auto") | safe - }} - {% endif %} - {% if category == "Server SoC" %} - {{ image(url="https://assets.ubuntu.com/v1/4e0399a1-chip.svg", - alt="Chip", - width="84", - height="100", - hi_def=True, - loading="auto") | safe - }} - {% endif %} -
    +
    +
    +
    + {% if category == "Desktop" or category == "Laptop" %} + {{ image(url="https://assets.ubuntu.com/v1/4b732966-Laptop.svg", alt="", width="132", height="77", hi_def=True, loading="auto") | safe}} + {% endif %} + {% if category == "Server" %} + {{ image(url="https://assets.ubuntu.com/v1/fdf83d49-Server.svg", alt="Server", width="80", height="96", hi_def=True, loading="auto") | safe }} + {% endif %} + {% if category == "Ubuntu Core" %} + {{ image(url="https://assets.ubuntu.com/v1/f9f8ace9-gateway.svg", alt="Gateway", width="96", height="100", hi_def=True, loading="auto") | safe }} + {% endif %} + {% if category == "Server SoC" %} + {{ image(url="https://assets.ubuntu.com/v1/4e0399a1-chip.svg", alt="Chip", width="84", height="100", hi_def=True, loading="auto") | safe }} + {% endif %}
    -
    -
    -

    - Release - {% if release_details["releases"]|length > 1 %}s{% endif %} -

    -
    +
    +
    + {{ image(url="https://assets.ubuntu.com/v1/d9c2c5bf-ubuntu_certified.png", alt="", width="112", height="157", hi_def=True, loading="auto") | safe }} +
    +
    +
    -
    +
    +
    {# djlint: on #} - {% if components %} -
    -
    -

    Components certified with this system

    - - - - - - - - - - - - - - {% for component in components %} - - - {% if '14.04 ESM' in component.lts_releases %} - {% if component.lts_releases['14.04 ESM'][0].third_party_driver %} - - {% elif component.lts_releases['14.04 ESM'][0].status == 'inprogress' %} - - {% elif component.lts_releases['14.04 ESM'][0].status == 'certified' %} - - {% endif %} - {% else %} - - {% endif %} - {% if '16.04 LTS' in component.lts_releases %} - {% if component.lts_releases['16.04 LTS'][0].third_party_driver %} - - {% elif component.lts_releases['16.04 LTS'][0].status == 'inprogress' %} - - {% elif component.lts_releases['16.04 LTS'][0].status == 'certified' %} - - {% endif %} - {% else %} - - {% endif %} - {% if '18.04 LTS' in component.lts_releases %} - {% if component.lts_releases['18.04 LTS'][0].third_party_driver %} - - {% elif component.lts_releases['18.04 LTS'][0].status == 'inprogress' %} - - {% elif component.lts_releases['18.04 LTS'][0].status == 'certified' %} - - {% endif %} - {% else %} - - {% endif %} - {% if '20.04 LTS' in component.lts_releases %} - {% if component.lts_releases['20.04 LTS'][0].third_party_driver %} - - {% elif component.lts_releases['20.04 LTS'][0].status == 'inprogress' %} - - {% elif component.lts_releases['20.04 LTS'][0].status == 'certified' %} - - {% endif %} - {% else %} - - {% endif %} - {% if '22.04 LTS' in component.lts_releases %} - {% if component.lts_releases['22.04 LTS'][0].third_party_driver %} - - {% elif component.lts_releases['22.04 LTS'][0].status == 'inprogress' %} - - {% elif component.lts_releases['22.04 LTS'][0].status == 'certified' %} - - {% endif %} - {% else %} - - {% endif %} - - - {% endfor %} - -
    Component14.04 ESM16.04 LTS18.04 LTS20.04 LTS22.04 LTSComments
    - {{ component.vendor_name }} {{ component.model }} - - {{ image(url="https://assets.ubuntu.com/v1/8dd0626d-3rd-party-icon.svg", - alt="May require third-party driver", - width="21", - height="14", - hi_def=True, - loading="lazy") | safe - }} - - In progress - - Supported - - {{ image(url="https://assets.ubuntu.com/v1/8dd0626d-3rd-party-icon.svg", - alt="May require third-party driver", - width="21", - height="14", - hi_def=True, - attrs={"style":"margin-left: 0.45rem;"}, - loading="lazy") | safe - }} - - Untested - - Supported - - {{ image(url="https://assets.ubuntu.com/v1/8dd0626d-3rd-party-icon.svg", - alt="May require third-party driver", - width="21", - height="14", - hi_def=True, - attrs={"style":"margin-left: 0.45rem;"}, - loading="lazy") | safe - }} - - In progress - - Supported - - {{ image(url="https://assets.ubuntu.com/v1/8dd0626d-3rd-party-icon.svg", - alt="May require third-party driver", - width="21", - height="14", - hi_def=True, - attrs={"style":"margin-left: 0.45rem;"}, - loading="lazy") | safe - }} - - In progress - - Supported - - {{ image(url="https://assets.ubuntu.com/v1/8dd0626d-3rd-party-icon.svg", - alt="May require third-party driver", - width="21", - height="14", - hi_def=True, - attrs={"style":"margin-left: 0.45rem;"}, - loading="lazy") | safe - }} - - In progress - - Supported - - - {{ component.note }}
    -
      -
    • - Supported -
    • -
    • - - May require 3rd-party driver -
    • -
    • - In progress -
    • -
    -
    -
    - {% endif %} -
    -
    -
    Issues? Let us know
    -

    - If there is an issue with the information for this system, - please let us know. -

    -
    -
    +{% if components %} +
    +
    +

    Components certified with this system

    + + + + + + + + + + + + + {% for component in components %} + + + {% if '18.04 LTS' in component.lts_releases %} + {% if component.lts_releases['18.04 LTS'][0].third_party_driver %} + + {% elif component.lts_releases['18.04 LTS'][0].status == 'inprogress' %} + + {% elif component.lts_releases['18.04 LTS'][0].status == 'certified' %} + + {% endif %} + {% else %} + + {% endif %} + {% if '20.04 LTS' in component.lts_releases %} + {% if component.lts_releases['20.04 LTS'][0].third_party_driver %} + + {% elif component.lts_releases['20.04 LTS'][0].status == 'inprogress' %} + + {% elif component.lts_releases['20.04 LTS'][0].status == 'certified' %} + + {% endif %} + {% else %} + + {% endif %} + {% if '22.04 LTS' in component.lts_releases %} + {% if component.lts_releases['22.04 LTS'][0].third_party_driver %} + + {% elif component.lts_releases['22.04 LTS'][0].status == 'inprogress' %} + + {% elif component.lts_releases['22.04 LTS'][0].status == 'certified' %} + + {% endif %} + {% else %} + + {% endif %} + {% if '24.04 LTS' in component.lts_releases %} + {% if component.lts_releases['24.04 LTS'][0].third_party_driver %} + + {% elif component.lts_releases['24.04 LTS'][0].status == 'inprogress' %} + + {% elif component.lts_releases['24.04 LTS'][0].status == 'certified' %} + + {% endif %} + {% else %} + + {% endif %} + + + {% endfor %} + +
    Component18.04 LTS20.04 LTS22.04 LTS24.04 LTSComments
    + {{ component.vendor_name }} {{ component.model }} + + {{ image(url="https://assets.ubuntu.com/v1/8dd0626d-3rd-party-icon.svg", alt="May require third-party driver", width="21", height="14", hi_def=True, attrs={"style":"margin-left: 0.45rem;"}, loading="lazy") | safe }} + + In progress + + Supported + + {{ image(url="https://assets.ubuntu.com/v1/8dd0626d-3rd-party-icon.svg", + alt="May require third-party driver", + width="21", + height="14", + hi_def=True, + attrs={"style":"margin-left: 0.45rem;"}, + loading="lazy") | safe + }} + + In progress + + Supported + + {{ image(url="https://assets.ubuntu.com/v1/8dd0626d-3rd-party-icon.svg", alt="May require third-party driver", width="21", height="14", hi_def=True, attrs={"style":"margin-left: 0.45rem;"}, loading="lazy") | safe }} + + In progress + + Supported + + + + {{ image(url="https://assets.ubuntu.com/v1/8dd0626d-3rd-party-icon.svg", alt="May require third-party driver", width="21", height="14", hi_def=True, attrs={"style":"margin-left: 0.45rem;"}, loading="lazy") | safe }} + + In progress + + Supported + + + {{ component.note }}
    +
      +
    • + Supported +
    • +
    • + + May require 3rd-party driver +
    • +
    • + In progress +
    • +
    +
    +
    +{% endif %} +
    +
    +
    Issues? Let us know
    +

    + If there is an issue with the information for this system, + please let us know. +

    +
    +
    + + + {% endblock %} diff --git a/templates/certified/platforms/platform-details.html b/templates/certified/platforms/platform-details.html index dfd9e1c952c..37bf67f092c 100644 --- a/templates/certified/platforms/platform-details.html +++ b/templates/certified/platforms/platform-details.html @@ -13,7 +13,7 @@
    -
    +
    {% with category=platform.category %} {% include "certified/shared/category-image.html" %} {% endwith %} diff --git a/webapp/certified/views.py b/webapp/certified/views.py index 2e953ab036d..9fd227ae3c9 100644 --- a/webapp/certified/views.py +++ b/webapp/certified/views.py @@ -590,6 +590,8 @@ def certified_model_details(canonical_id): category=model_release["category"], form_factor=form_factor, vendor=model_release["make"], + platform_name=model_release["platform_name"], + platform_id=model_release["platform_id"], major_release=model_release["certified_release"], release_details=release_details, has_enabled_releases=has_enabled_releases, From 910fb1f4370a2f3a89e9397dd2e3b8e2b55579c6 Mon Sep 17 00:00:00 2001 From: Nadzeya H Date: Wed, 14 Aug 2024 11:13:00 +0300 Subject: [PATCH 04/16] Fix style issues --- .../certified/platforms/platform-details.html | 14 +-- webapp/certified/api.py | 8 +- webapp/certified/views.py | 105 +++++++++++++----- 3 files changed, 91 insertions(+), 36 deletions(-) diff --git a/templates/certified/platforms/platform-details.html b/templates/certified/platforms/platform-details.html index 37bf67f092c..c2030f3deca 100644 --- a/templates/certified/platforms/platform-details.html +++ b/templates/certified/platforms/platform-details.html @@ -16,31 +16,31 @@
    {% with category=platform.category %} {% include "certified/shared/category-image.html" %} - {% endwith %} + {% endwith %}x
    -

    {{platform.category}} › Platform

    +

    {{ platform.category }} › Platform

    -

    {{platform.vendor}} {{platform.name}}

    +

    {{ platform.vendor }} {{ platform.name }}

    {% if platform.certificates|length == 1 %}

    1 certified configuration

    {% else %} -

    {{platform.certificates|length}} certified configurations

    +

    {{ platform.certificates|length }} certified configurations

    {% endif %}