From e21beb378745d37d52a4a5aa998ee428fd85d8e4 Mon Sep 17 00:00:00 2001 From: pluja Date: Mon, 7 Oct 2024 17:14:38 +0200 Subject: [PATCH] added support contacts to service pagego --- src/database/models.go | 6 + src/frontend/templates/service.html | 133 ++++++++--- src/package-lock.json | 334 +++++++++++++++------------- src/package.json | 10 +- 4 files changed, 287 insertions(+), 196 deletions(-) diff --git a/src/database/models.go b/src/database/models.go index b7aad5e..81f5d8e 100644 --- a/src/database/models.go +++ b/src/database/models.go @@ -32,6 +32,12 @@ type Service struct { Cash bool `json:"cash"` Lightning bool `json:"lightning"` Notes []string `json:"notes,omitempty"` + SupportMethods []Support `json:"support"` +} + +type Support struct { + Platform string `json:"platform"` + Link string `json:"Link"` } type TosReview struct { diff --git a/src/frontend/templates/service.html b/src/frontend/templates/service.html index 1c03c4d..80b1a7b 100644 --- a/src/frontend/templates/service.html +++ b/src/frontend/templates/service.html @@ -3,11 +3,11 @@ -
+
{{if .Service.Pending}} -
-
{{partial "partials/kyc_level" .Service.KycLevel}}
+
{{partial "partials/kyc_level" .Service.KycLevel}}
-
+
{{if .Service.Comments}}
@@ -206,15 +206,84 @@ {{if .Attributes}} -
{{range .Attributes}} {{partial "partials/attribute_line" .}} {{end}}
+
{{range .Attributes}} {{partial "partials/attribute_line" .}} {{end}}
{{end}} - (updated {{humanizePbTimeString .Service.Updated}})
-
+ +{{if gt (len .Service.SupportMethods) 0}} +
+

Contact

+
+
+{{end}} + + +
-
+
@@ -234,30 +303,30 @@ ?

Automated, ai-driven monthly ToS reviews.

-

Last Check: {{ dateString .Service.LastTosReview }}

+

Last Check: {{ dateString .Service.LastTosReview }}

{{if .Service.TosReviews}}
{{if eq 0 (len .Service.TosReviews)}} -

Not ToS reviews for this service (yet).

+

Not ToS reviews for this service (yet).

{{else if eq (len .Service.TosUrls) 0}} -

This service has no ToS.

+

This service has no ToS.

{{else}} {{range .Service.TosReviews}} {{if .Warning}} {{partial "partials/tos_check" .}} {{end}} {{end}}
- Show non-conflictive ToS reviews + Show non-conflictive ToS reviews {{range .Service.TosReviews}} {{if ne .Warning true}} {{partial "partials/tos_check" .}} {{end}} {{end}}
{{end}}
{{else}} -

Not ToS reviews for this service (yet).

+

Not ToS reviews for this service (yet).

{{end}}
-
+
-
+
@@ -268,9 +337,9 @@ ?

-

Alghough comments are moderated, beware of fake reviews. Always do your own research.

+

Alghough comments are moderated, beware of fake reviews. Always do your own research.

-
+