From 1911a1211bec40370dac49fa70936b30806e98b7 Mon Sep 17 00:00:00 2001 From: Tobias Brunner Date: Wed, 7 May 2025 08:36:02 +0200 Subject: [PATCH] make whole card clickable --- hub/services/static/css/servala-main.css | 16 +++ hub/services/static/js/servala-addons.js | 9 ++ hub/services/templates/base.html | 1 + hub/services/templates/pages/homepage.html | 120 +++++++++++------- .../templates/services/partner_list.html | 11 +- .../templates/services/provider_list.html | 11 +- .../templates/services/service_list.html | 42 ++---- 7 files changed, 126 insertions(+), 84 deletions(-) create mode 100644 hub/services/static/js/servala-addons.js diff --git a/hub/services/static/css/servala-main.css b/hub/services/static/css/servala-main.css index 9d99d26..dc240b5 100644 --- a/hub/services/static/css/servala-main.css +++ b/hub/services/static/css/servala-main.css @@ -12322,4 +12322,20 @@ a.btn:focus { .page-content .page-action a { text-decoration: none +} + +.clickable-card { + cursor: pointer; + transition: transform 0.2s, box-shadow 0.2s; + position: relative; +} + +.clickable-card:hover { + transform: translateY(-5px); + box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1); +} + +.clickable-button { + position: relative; + z-index: 2; } \ No newline at end of file diff --git a/hub/services/static/js/servala-addons.js b/hub/services/static/js/servala-addons.js new file mode 100644 index 0000000..d3c164f --- /dev/null +++ b/hub/services/static/js/servala-addons.js @@ -0,0 +1,9 @@ +function cardClicked(event, url) { + // Don't navigate if the click was on a button or link + if (event.target.closest('.clickable-button') || event.target.closest('.clickable-link')) { + return; + } + + // Navigate to the provider detail page + window.location.href = url; +} \ No newline at end of file diff --git a/hub/services/templates/base.html b/hub/services/templates/base.html index f103d7c..fd32704 100644 --- a/hub/services/templates/base.html +++ b/hub/services/templates/base.html @@ -23,6 +23,7 @@ + {% block extra_js %}{% endblock %} diff --git a/hub/services/templates/pages/homepage.html b/hub/services/templates/pages/homepage.html index c3d235a..f16da44 100644 --- a/hub/services/templates/pages/homepage.html +++ b/hub/services/templates/pages/homepage.html @@ -41,20 +41,31 @@
{% for service in featured_services %}
-
-
- +
+
+
+
+
+ + {{ service.name }} + +
+
+

+ {{ service.name }} +

+ {% for category in service.categories.all|slice:":1" %} +

{{ category.name }}

+ {% endfor %} +
+
+

{{ service.description|safe|truncatewords:15 }}

+
+
-
-

{{ service.name }}

- {% for category in service.categories.all|slice:":1" %} -

{{ category.name }}

- {% endfor %} -
-
-

{{ service.description|safe|truncatewords:15 }}

-
-
{% empty %}
@@ -85,29 +96,36 @@
-
-
- {% for provider in featured_providers %} -
-
-
- -
+ {% for provider in featured_providers %} +
+
+
-

{{ provider.description|safe|truncatewords:15 }}

+

{{ provider.description|safe|truncatewords:15 }}

-
- {% empty %} -
-

No featured provider available at the moment.

-
- {% endfor %} +
-
+ {% empty %} +
+

No featured provider available at the moment.

+
+ {% endfor %}
@@ -132,25 +150,36 @@
- {% for partner in featured_partners %} + {% for partner in featured_partners %}
-
-
- -
- -
-

{{ partner.description|safe|truncatewords:15 }}

+
+
+
+
+
+ + {{ partner.name }} + +
+
+

+ {{ partner.name }} +

+
+
+

{{ partner.description|safe|truncatewords:15 }}

+
+
-
- {% empty %} + {% empty %}
-

No featured partner available at the moment.

+

No featured partner available at the moment.

- {% endfor %} + {% endfor %}
@@ -189,7 +218,7 @@

Frequenty Asked Questions

-

Still need more information? Read our FAQ or contact us to learn more about the Servala.

+

Still need more information? Read our FAQ or contact us to learn more about the Servala.

@@ -215,7 +244,6 @@
{% endfor %} -
diff --git a/hub/services/templates/services/partner_list.html b/hub/services/templates/services/partner_list.html index 4fc7361..fb196dc 100644 --- a/hub/services/templates/services/partner_list.html +++ b/hub/services/templates/services/partner_list.html @@ -108,12 +108,13 @@
{% for partner in partners %}
-
+
diff --git a/hub/services/templates/services/provider_list.html b/hub/services/templates/services/provider_list.html index e6f8630..b343f80 100644 --- a/hub/services/templates/services/provider_list.html +++ b/hub/services/templates/services/provider_list.html @@ -91,12 +91,13 @@
{% for provider in providers %}
-
+
diff --git a/hub/services/templates/services/service_list.html b/hub/services/templates/services/service_list.html index adbc447..da16d3e 100644 --- a/hub/services/templates/services/service_list.html +++ b/hub/services/templates/services/service_list.html @@ -150,49 +150,30 @@
{% for service in services %}
-