diff options
author | Danjela Lura <danielaluraa@gmail.com> | 2020-06-23 13:44:18 +0200 |
---|---|---|
committer | Christopher Baines <mail@cbaines.net> | 2020-06-26 17:54:19 +0100 |
commit | f16fdb44f12beed1afbb1bf2cd0270e79154f4e6 (patch) | |
tree | d5b7289d76485a0edce1e3a6e2d869c336ec8226 /guix-data-service/web/revision | |
parent | 7d85372accd34999704f1353573b9dec88e26f7c (diff) | |
download | data-service-f16fdb44f12beed1afbb1bf2cd0270e79154f4e6.tar data-service-f16fdb44f12beed1afbb1bf2cd0270e79154f4e6.tar.gz |
Add indications for no translations available in the packages page
Signed-off-by: Christopher Baines <mail@cbaines.net>
Diffstat (limited to 'guix-data-service/web/revision')
-rw-r--r-- | guix-data-service/web/revision/controller.scm | 6 | ||||
-rw-r--r-- | guix-data-service/web/revision/html.scm | 22 |
2 files changed, 23 insertions, 5 deletions
diff --git a/guix-data-service/web/revision/controller.scm b/guix-data-service/web/revision/controller.scm index e233fe7..a038e5c 100644 --- a/guix-data-service/web/revision/controller.scm +++ b/guix-data-service/web/revision/controller.scm @@ -568,6 +568,7 @@ (limit-results (or (assq-ref query-parameters 'limit_results) 99999)) ; TODO There shouldn't be a limit (fields (assq-ref query-parameters 'field)) + (locale (assq-ref query-parameters 'locale)) (packages (if search-query (search-packages-in-revision @@ -587,7 +588,9 @@ (show-next-page? (and (not search-query) (>= (length packages) - limit-results)))) + limit-results))) + (any-translations? (any-package-synopsis-or-descriptions-translations? + packages locale))) (case (most-appropriate-mime-type '(application/json text/html) mime-types) @@ -638,6 +641,7 @@ git-repositories show-next-page? description-and-synopsis-locale-options + any-translations? #:path-base path-base #:header-text header-text #:header-link header-link) diff --git a/guix-data-service/web/revision/html.scm b/guix-data-service/web/revision/html.scm index bc1aff7..cf34d5f 100644 --- a/guix-data-service/web/revision/html.scm +++ b/guix-data-service/web/revision/html.scm @@ -532,6 +532,7 @@ git-repositories show-next-page? locale-options + any-translations-available? #:key path-base header-text header-link) (define field-options @@ -571,7 +572,10 @@ #:options locale-options #:allow-selecting-multiple-options #f #:help-text - "Language.") + (if any-translations-available? + "Language." + '((span (@ (class "text-danger")) + "No translations available in this page.")))) ,(form-horizontal-control "Search query" query-parameters #:help-text @@ -632,7 +636,7 @@ ,@(let ((fields (assq-ref query-parameters 'field))) (map (match-lambda - ((name version synopsis _ description _ home-page + ((name version synopsis synopsis-locale description description-locale home-page location-file location-line location-column-number licenses) `(tr @@ -641,10 +645,20 @@ `((td ,version)) '()) ,(if (member "synopsis" fields) - `((td ,(stexi->shtml (texi-fragment->stexi synopsis)))) + `((td ,(stexi->shtml (texi-fragment->stexi synopsis)) + ,(if (string=? synopsis-locale + (assq-ref query-parameters 'locale)) + "" + '((span (@ (class "text-danger")) + "No translation available for synopsis."))))) '()) ,(if (member "description" fields) - `((td ,(stexi->shtml (texi-fragment->stexi description)))) + `((td ,(stexi->shtml (texi-fragment->stexi description)) + ,(if (string=? description-locale + (assq-ref query-parameters 'locale)) + "" + '((span (@ (class "text-danger")) + "No translation available for description."))))) '()) ,(if (member "home-page" fields) `((td ,home-page)) |