diff --git a/products.yaml b/data.yaml similarity index 73% rename from products.yaml rename to data.yaml index 790744b..797ab02 100644 --- a/products.yaml +++ b/data.yaml @@ -1,161 +1,228 @@ products: - - name: "Ubuntu Frame" - slug: "ubuntu-frame" - - name: "Support" - slug: "support" - - name: "ESM" - slug: "esm" - - name: "MicroCloud" - slug: "microcloud" + - name: "AKS/EKS/GKE" + slug: "aks-eks-gke" + - name: "AI/ML" + slug: "ai-ml" + - name: "Anbox" + slug: "anbox" + - name: "Appliance Portfolio" + slug: "appliance-portfolio" + - name: "Automotive" + slug: "automotive" + - name: "Blender" + slug: "blender" + - name: "Canonical K8s" + slug: "canonical-k8s" + - name: "Canonical Openstack" + slug: "canonical-openstack" + - name: "Ceph" + slug: "ceph" + - name: "Charm Collection" + slug: "charm-collection" + - name: "Charm Hub" + slug: "charm-hub" + - name: "Charmed K8s" + slug: "charmed-k8s" + - name: "Charmed Openstack" + slug: "charmed-openstack" - name: "Cube" slug: "cube" - - name: "Managed Apps" - slug: "managed-apps" - - name: "Ubuntu Core / Snapd" - slug: "ubuntu-core-snapd" - - name: "Ubuntu Pro" - slug: "ubuntu-pro" - - name: "Snapcraft" - slug: "snapcraft" - - name: "Security" - slug: "security" - - name: "Edge" - slug: "edge" - - name: "Launchpad" - slug: "launchpad" - - name: "Industrial" - slug: "industrial" - - name: "Security - Tech" - slug: "security-tech" - - name: "Security Notices" - slug: "security-notices" - - name: "Smart Displays (Mir)" - slug: "smart-displays-mir" - - name: "Multipass" - slug: "multipass" - name: "Data - Big Data" slug: "data-big-data" - - name: "Charm Collection" - slug: "charm-collection" - - name: "Smart Home" - slug: "smart-home" + - name: "Data - NoSQL" + slug: "data-nosql" + - name: "Data - SQL" + slug: "data-sql" + - name: "Data Platform" + slug: "data-platform" + - name: "Desktop" + slug: "desktop" + - name: "Edge" + slug: "edge" + - name: "EdgeX" + slug: "edgex" + - name: "Embedded" + slug: "embedded" - name: "Embedding" slug: "embedding" - - name: "Charmed Openstack" - slug: "charmed-openstack" - - name: "Observability" - slug: "observability" + - name: "ESM" + slug: "esm" - name: "FIPS" slug: "fips" - - name: "Canonical Openstack" - slug: "canonical-openstack" - - name: "Canonical K8s" - slug: "canonical-k8s" - - name: "Identity" - slug: "identity" - name: "Finance" slug: "finance" - - name: "Real-Time Kernel" - slug: "real-time-kernel" - - name: "Blender" - slug: "blender" - - name: "Robotics" - slug: "robotics" + - name: "GSI" + slug: "gsi" + - name: "Hardening" + slug: "hardening" + - name: "HPC" + slug: "hpc" + - name: "HW Certification" + slug: "hw-certification" + - name: "IOT Management" + slug: "iot-management" + - name: "Identity" + slug: "identity" + - name: "Industrial" + slug: "industrial" + - name: "Jaas" + slug: "jaas" + - name: "Juju" + slug: "juju" + - name: "Juggle" + slug: "juggle" + - name: "Kernel" + slug: "kernel" - name: "Kernel Factory" slug: "kernel-factory" - - name: "WSL" - slug: "wsl" + - name: "Kernos" + slug: "kernos" + - name: "Kubeflow / AI" + slug: "kubeflow-ai" + - name: "Landscape" + slug: "landscape" + - name: "Launchpad" + slug: "launchpad" + - name: "Livepatch" + slug: "livepatch" + - name: "LXD" + slug: "lxd" + - name: "MAAS" + slug: "maas" + - name: "Managed Apps" + slug: "managed-apps" - name: "Managed Infra" slug: "managed-infra" + - name: "MicroCloud" + slug: "microcloud" + - name: "Microcloud/LXD" + slug: "microcloud-lxd" + - name: "Microk8s" + slug: "microk8s" - name: "Microstack" slug: "microstack" - - name: "Appliance Portfolio" - slug: "appliance-portfolio" + - name: "Multipass" + slug: "multipass" - name: "Networking" slug: "networking" - - name: "Juju" - slug: "juju" - - name: "Snap Store" - slug: "snap-store" - - name: "Public Cloud" - slug: "public-cloud" - - name: "Charmed K8s" - slug: "charmed-k8s" - - name: "Store" - slug: "store" - - name: "Microcloud/LXD" - slug: "microcloud-lxd" - - name: "Rocks" - slug: "rocks" - - name: "AI/ML" - slug: "ai-ml" + - name: "Observability" + slug: "observability" + - name: "Other" + slug: "other" - name: "Pro for devices" slug: "pro-for-devices" - - name: "Charm Hub" - slug: "charm-hub" - - name: "Kernel" - slug: "kernel" - - name: "Anbox" - slug: "anbox" - - name: "Juggle" - slug: "juggle" - - name: "Microk8s" - slug: "microk8s" - - name: "Desktop" - slug: "desktop" - - name: "Embedded" - slug: "embedded" - - name: "HPC" - slug: "hpc" - - name: "Data - SQL" - slug: "data-sql" - - name: "Livepatch" - slug: "livepatch" - - name: "GSI" - slug: "gsi" - - name: "Landscape" - slug: "landscape" - - name: "Telco" - slug: "telco" - - name: "Jaas" - slug: "jaas" - - name: "Automotive" - slug: "automotive" + - name: "Public Cloud" + slug: "public-cloud" + - name: "Raspberrypi" + slug: "raspberrypi" + - name: "Real-Time Kernel" + slug: "real-time-kernel" + - name: "Robotics" + slug: "robotics" - name: "Robotics Developers" slug: "robotics-developers" - - name: "MAAS" - slug: "maas" - - name: "EdgeX" - slug: "edgex" - - name: "Kubeflow / AI" - slug: "kubeflow-ai" - - name: "Data Platform" - slug: "data-platform" - - name: "AKS/EKS/GKE" - slug: "aks-eks-gke" - - name: "Ubuntu Core / Snapd Ux" - slug: "ubuntu-core-snapd-ux" - - name: "Ubuntu Core / Snapd Docs" - slug: "ubuntu-core-snapd-docs" - - name: "Hardening" - slug: "hardening" - - name: "Kernos" - slug: "kernos" - - name: "Ceph" - slug: "ceph" + - name: "Rocks" + slug: "rocks" + - name: "Security" + slug: "security" + - name: "Security - Tech" + slug: "security-tech" + - name: "Security Notices" + slug: "security-notices" - name: "Server" slug: "server" + - name: "Smart Displays (Mir)" + slug: "smart-displays-mir" + - name: "Smart Home" + slug: "smart-home" + - name: "Snap Store" + slug: "snap-store" + - name: "Snapcraft" + slug: "snapcraft" + - name: "Store" + slug: "store" + - name: "Support" + slug: "support" + - name: "Telco" + slug: "telco" - name: "UA-A (Adv/Std/Ess)" slug: "ua-a-adv-std-ess" - - name: "Data - NoSQL" - slug: "data-nosql" - - name: "IOT Management" - slug: "iot-management" - - name: "HW Certification" - slug: "hw-certification" - - name: "Raspberrypi" - slug: "raspberrypi" + - name: "Ubuntu Core / Snapd" + slug: "ubuntu-core-snapd" + - name: "Ubuntu Core / Snapd Docs" + slug: "ubuntu-core-snapd-docs" + - name: "Ubuntu Core / Snapd Ux" + slug: "ubuntu-core-snapd-ux" + - name: "Ubuntu Frame" + slug: "ubuntu-frame" + - name: "Ubuntu Pro" + slug: "ubuntu-pro" + - name: "WSL" + slug: "wsl" + +asset_types: + - name: "Image" + - name: "Illustration" + - name: "-" + - name: "Case Study" + - name: "Datasheets" + - name: "Demo" + - name: "Diagram" + - name: "Ebook" + - name: "Explainer Video" + - name: "Guides" + - name: "Icon" + - name: "Infographic" + - name: "Whitepaper" + - name: "Tutorial Video" + +languages: + - name: "Arabic" + - name: "Bengali" + - name: "Bhojpuri" + - name: "Bulgarian" + - name: "Catalan" + - name: "Chinese" + - name: "Croatian" + - name: "Czech" + - name: "Danish" + - name: "Dutch" + - name: "English" + - name: "Estonian" + - name: "Finnish" + - name: "French" + - name: "German" + - name: "Greek" + - name: "Gujrati" + - name: "Hausa" + - name: "Hebrew" + - name: "Hindi/Urdu" + - name: "Hungarian" + - name: "Indonesian" + - name: "Italian" + - name: "Japanese" + - name: "Javanese" + - name: "Korean" + - name: "Lithuanian" + - name: "Mandarin Chinese" + - name: "Marathi" + - name: "Nigerian Pidgin" + - name: "Norwegian" + - name: "Persian" + - name: "Polish" + - name: "Portuguese" + - name: "Punjabi" + - name: "Romanian" + - name: "Russian" + - name: "Serbian" + - name: "Slovak" + - name: "Slovenian" + - name: "Spanish" + - name: "Swedish" + - name: "Tamil" + - name: "Telugu" + - name: "Thai" + - name: "Turkish" + - name: "Ukrainian" + - name: "Vietnamese" - name: "Other" - slug: "other" - - name: "LXD" - slug: "lxd" diff --git a/templates/_search-form.html b/templates/_search-form.html index 5fe86ae..593c831 100644 --- a/templates/_search-form.html +++ b/templates/_search-form.html @@ -10,38 +10,19 @@
- {% set asset_types = [ - "Datasheets", "Guides", "Ebook", "Whitepaper", "Case Study", - "Explainer Video", "Tutorial Video", "Demo", "Infographic", - "Diagram", "Icon", "Illustration", "Image" - ] - %}
- {% set languages = [ - "Arabic", "Bengali", "Bhojpuri", "Bulgarian", "Catalan", "Chinese", - "Croatian", "Czech", "Danish", "Dutch", "English", "Estonian", - "Finnish", "French", "German", "Greek", "Gujrati", "Hausa", "Hebrew", - "Hindi/Urdu", "Hungarian", "Indonesian", "Italian", "Japanese", - "Javanese", "Korean", "Lithuanian", "Mandarin Chinese", "Marathi", - "Nigerian Pidgin", "Norwegian", "Persian", "Polish", "Portuguese", - "Punjabi", "Romanian", "Russian", "Serbian", "Slovak", "Slovenian", - "Spanish", "Swedish", "Tamil", "Telugu", "Thai", "Turkish", - "Ukrainian", "Vietnamese", "Other" - ] - %} -
@@ -70,7 +51,7 @@ aria-labelledby="product" name="product"> - {% for product in products_list.products %} + {% for product in data.products %} diff --git a/templates/create-update.html b/templates/create-update.html index 01ef9a3..4e91742 100644 --- a/templates/create-update.html +++ b/templates/create-update.html @@ -33,22 +33,16 @@

{{ asset.file_path}}

- {% set asset_types = [ - "Datasheets", "Guides", "Ebook", "Whitepaper", "Case Study", - "Explainer Video", "Tutorial Video", "Demo", "Infographic", - "Diagram", "Icon", "Illustration", "Image" - ] - %}

For example, image, whitepaper or diagram.

@@ -86,7 +80,7 @@

For example, Ubuntu Pro, Juju.

- {% for product in products_list.products %} + {% for product in data.products %} @@ -194,18 +188,6 @@

Authors

- {% set languages = [ - "Arabic", "Bengali", "Bhojpuri", "Bulgarian", "Catalan", "Chinese", - "Croatian", "Czech", "Danish", "Dutch", "English", "Estonian", - "Finnish", "French", "German", "Greek", "Gujrati", "Hausa", "Hebrew", - "Hindi/Urdu", "Hungarian", "Indonesian", "Italian", "Japanese", - "Javanese", "Korean", "Lithuanian", "Mandarin Chinese", "Marathi", - "Nigerian Pidgin", "Norwegian", "Persian", "Polish", "Portuguese", - "Punjabi", "Romanian", "Russian", "Serbian", "Slovak", "Slovenian", - "Spanish", "Swedish", "Tamil", "Telugu", "Thai", "Turkish", - "Ukrainian", "Vietnamese", "Other" - ] - %}
@@ -216,9 +198,9 @@

Authors

aria-labelledby="language" multiple> - {% for language in languages %} - {% endfor %} diff --git a/webapp/routes.py b/webapp/routes.py index 66c4882..b35f8d8 100644 --- a/webapp/routes.py +++ b/webapp/routes.py @@ -39,8 +39,8 @@ ui_blueprint = Blueprint("ui_blueprint", __name__, url_prefix="/manager") api_blueprint = Blueprint("api_blueprint", __name__, url_prefix="/v1") -with open("products.yaml") as file: - products_list = yaml.load(file, Loader=yaml.FullLoader) +with open("data.yaml") as file: + data = yaml.load(file, Loader=yaml.FullLoader) # Manager Routes # === @@ -82,7 +82,7 @@ def home(): assets=assets, query=search_params.tag, type=search_params.asset_type, - products_list=products_list, + data=data, ) @@ -156,15 +156,13 @@ def create(): optimize=optimize, ) return flask.render_template( - "create-update.html", products_list=products_list + "create-update.html", data=data ) @ui_blueprint.route("/update", methods=["GET", "POST"]) @login_required def update(): - with open("products.yaml") as file: - products_list = yaml.load(file, Loader=yaml.FullLoader) file_path = request.args.get("file-path") if request.method == "GET": @@ -209,7 +207,7 @@ def update(): return flask.redirect("/manager/details?file-path=" + file_path) return flask.render_template( - "create-update.html", products_list=products_list, asset=asset + "create-update.html", data=data, asset=asset )