From a2655a398713719934be9ca64f18143c1428daec Mon Sep 17 00:00:00 2001 From: Osma Suominen Date: Wed, 9 Oct 2024 15:42:33 +0300 Subject: [PATCH 1/2] reimplement vocab home twig template using Bootstrap Grid instead of tables --- resource/css/skosmos.css | 17 +------ src/view/concept-card.inc.twig | 4 +- src/view/vocab-info.inc.twig | 90 ++++++++++++++++------------------ 3 files changed, 46 insertions(+), 65 deletions(-) diff --git a/resource/css/skosmos.css b/resource/css/skosmos.css index ad14fd90c..00463e2f8 100644 --- a/resource/css/skosmos.css +++ b/resource/css/skosmos.css @@ -677,7 +677,7 @@ body { } /***** Main content vocabpage & termpage *****/ - #main-content h2 { + #main-content h1 { font-size: 2.5rem; } @@ -704,6 +704,7 @@ body { font-weight: bold; font-size: 20px !important; margin-bottom: 0; + display: inline; } .property-value { @@ -946,21 +947,7 @@ body { border: none !important; } - tr > td { - color: var(--dark-color); - } - tr > td > div > a { - color: var(--secondary-dark-color); - text-decoration: none !important; - font-weight: 700 !important; - } .vocab-statistics > h3 { font-size: 20px !important; } - td.align-middle { - font-size: 16px; - } - table.vocab-info-literals > tbody > tr { - border-top: 1px solid var(--medium-color); - } diff --git a/src/view/concept-card.inc.twig b/src/view/concept-card.inc.twig index 392f8e8be..4275539cd 100644 --- a/src/view/concept-card.inc.twig +++ b/src/view/concept-card.inc.twig @@ -1,5 +1,4 @@ -
-
+
@@ -150,5 +149,4 @@
-
diff --git a/src/view/vocab-info.inc.twig b/src/view/vocab-info.inc.twig index ff61dfd99..cf7f771c5 100644 --- a/src/view/vocab-info.inc.twig +++ b/src/view/vocab-info.inc.twig @@ -1,79 +1,75 @@ -
-
-

{{ "Vocabulary information" | trans }}

+
+
+

{{ "Vocabulary information" | trans }}

+ {% set vocabInfo = vocab.info(request.contentLang) %} {% if not vocabInfo %} {% else %} - - - {% for key, values in vocabInfo %} - {% set keytrans = key %} - - - - - {% endfor %} - - - - - -
{{ keytrans | trans }} - {% for val in values %} -
- {% if val.get('skosmos:vocab') %} - {{ val.get('skosmos:label') }} - {% elseif val.label %} - - {% if val.label(request.contentLang) %}{{ val.label(request.contentLang) }} - {% else %}{{ val.label }} - {% endif %} - - {% elseif val matches '|^(https?://)|' %}{{ val }} - {% elseif val matches '|<\\w*\\b[^>]*>|' %}{{ val|raw|nl2br }} - {% else %}{{ val|nl2br }} + + {% for key, values in vocabInfo %} +
+

{{ key | trans }}

+ - {% endfor %} -
URI -
- {{ vocab.defaultConceptScheme }} -
-
+ + {% elseif val matches '|^(https?://)|' %}{{ val }} + {% elseif val matches '|<\\w*\\b[^>]*>|' %}{{ val|raw|nl2br }} + {% else %}{{ val|nl2br }} + {% endif %} + + {% endfor %} + +
+
+ {% endfor %} + {% endif %} + {% if vocab.config.showStatistics %}
{% endif %} + {% if vocab.config.dataURLs %} - {% apply spaceless %} - From 70ef363d5e8aa54cf6cd594df8715329c8805700 Mon Sep 17 00:00:00 2001 From: Osma Suominen Date: Thu, 10 Oct 2024 13:06:34 +0300 Subject: [PATCH 2/2] fix cypress test that broke due to HTML changes --- tests/cypress/template/landing.cy.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/cypress/template/landing.cy.js b/tests/cypress/template/landing.cy.js index 598bcc7ed..c430add73 100644 --- a/tests/cypress/template/landing.cy.js +++ b/tests/cypress/template/landing.cy.js @@ -46,6 +46,6 @@ describe('Landing page', () => { // check that we are still within the Skosmos URL space cy.url().should('include', Cypress.config().baseUrl) // check that we are on the vocab home page - cy.get('#vocab-info') + cy.get('.vocabpage') }) })