diff --git a/common/components.py b/common/components.py index a969397..d1130d7 100644 --- a/common/components.py +++ b/common/components.py @@ -21,11 +21,16 @@ def Component( if isinstance(children, str): children = [children] childrenBlob = "\n".join(children) - attributesList = [f'{name} = "{value}"' for name, value in attributes] - attributesBlob = " ".join(attributesList) + if len(attributes) == 0: + attributesBlob = "" + else: + attributesList = [f'{name}="{value}"' for name, value in attributes] + # make attribute list into a string + # and insert space between tag and attribute list + attributesBlob = f" {" ".join(attributesList)}" tag: str = "" if tag_name != "": - tag = f"{childrenBlob}" + tag = f"<{tag_name}{attributesBlob}>{childrenBlob}" elif template != "": tag = render_to_string( template, diff --git a/games/templates/cotton/icon/nintendoswitch.html b/games/templates/cotton/icon/nintendo-switch.html similarity index 100% rename from games/templates/cotton/icon/nintendoswitch.html rename to games/templates/cotton/icon/nintendo-switch.html diff --git a/games/templates/cotton/icon/physicalmediacddvd.html b/games/templates/cotton/icon/physical.html similarity index 100% rename from games/templates/cotton/icon/physicalmediacddvd.html rename to games/templates/cotton/icon/physical.html diff --git a/games/templates/cotton/icon/xboxgamepass.html b/games/templates/cotton/icon/xbox-gamepass.html similarity index 100% rename from games/templates/cotton/icon/xboxgamepass.html rename to games/templates/cotton/icon/xbox-gamepass.html