From 708b9cb529f68c5ccfd8cd3f6c3961c723efe4e2 Mon Sep 17 00:00:00 2001 From: nshan651 Date: Mon, 10 Oct 2022 14:21:43 -0500 Subject: [PATCH] Finalized center_ features --- pybadges/__init__.py | 1 - pybadges/badge-template-full.svg | 12 ++++++++++-- tests/golden-images/github.svg | 2 +- tests/golden-images/python.svg | 2 +- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/pybadges/__init__.py b/pybadges/__init__.py index 757dbd4..ce0c383 100644 --- a/pybadges/__init__.py +++ b/pybadges/__init__.py @@ -194,7 +194,6 @@ def badge( 'whole_link may not bet set with left_link, right_link, or center_link' ) - # NOTE: Can only have a center_* element if also a right_* element if center_image and not (right_image or right_text): raise ValueError('cannot have a center_image without a right element') diff --git a/pybadges/badge-template-full.svg b/pybadges/badge-template-full.svg index 9bde911..d449a99 100644 --- a/pybadges/badge-template-full.svg +++ b/pybadges/badge-template-full.svg @@ -53,19 +53,27 @@ {% if center_image %} {% endif %} + {% if right_image %} + + {% endif %} {% if right_text %} {{ right_text }} {{ right_text }} {% endif %} {% if left_link or whole_link %} - + {% endif %} + {% if center_image and (center_width or whole_link) %} + + + + {% endif %} {% if right_link or whole_link %} - + {% endif %} diff --git a/tests/golden-images/github.svg b/tests/golden-images/github.svg index 7770b2d..c1ac864 100644 --- a/tests/golden-images/github.svg +++ b/tests/golden-images/github.svg @@ -1 +1 @@ -githubgithubpybadgespybadges \ No newline at end of file +githubgithubpybadgespybadges \ No newline at end of file diff --git a/tests/golden-images/python.svg b/tests/golden-images/python.svg index cde40b4..8541fe0 100644 --- a/tests/golden-images/python.svg +++ b/tests/golden-images/python.svg @@ -1 +1 @@ -pythonpython3.2, 3.3, 3.4, 3.5, 3.63.2, 3.3, 3.4, 3.5, 3.6 \ No newline at end of file +pythonpython3.2, 3.3, 3.4, 3.5, 3.63.2, 3.3, 3.4, 3.5, 3.6 \ No newline at end of file