From 429783adfdd1154afa7839728af4d314be05e418 Mon Sep 17 00:00:00 2001 From: Daniel Jettka Date: Thu, 21 Nov 2024 17:31:14 +0100 Subject: [PATCH] fetching info from CITATION.cff; refs #381 --- add/data/locale/edirom-lang-de.xml | 1 + add/data/locale/edirom-lang-en.xml | 1 + app/controller/window/about/AboutWindow.js | 35 +++++++++++++++++++++- 3 files changed, 36 insertions(+), 1 deletion(-) diff --git a/add/data/locale/edirom-lang-de.xml b/add/data/locale/edirom-lang-de.xml index 1a2e8ef44..60ea41462 100644 --- a/add/data/locale/edirom-lang-de.xml +++ b/add/data/locale/edirom-lang-de.xml @@ -101,6 +101,7 @@ + diff --git a/add/data/locale/edirom-lang-en.xml b/add/data/locale/edirom-lang-en.xml index a73cb2b64..5f94ad188 100644 --- a/add/data/locale/edirom-lang-en.xml +++ b/add/data/locale/edirom-lang-en.xml @@ -101,6 +101,7 @@ + diff --git a/app/controller/window/about/AboutWindow.js b/app/controller/window/about/AboutWindow.js index 3af2de088..34585da3b 100644 --- a/app/controller/window/about/AboutWindow.js +++ b/app/controller/window/about/AboutWindow.js @@ -42,7 +42,40 @@ Ext.define('EdiromOnline.controller.window.about.AboutWindow', { window.doAJAXRequest('resources/CITATION.cff', 'GET', {}, Ext.bind(function(response){ - view.setResult('
'+response.responseText+'
'); + + const citation = response.responseText; + + // find keys in citation + const version = citation.match(/^version: (.*)/m)[1]; + const title = citation.match(/^title: (.*)/m)[1]; + const license = citation.match(/^license: (.*)/m)[1]; + const repoUrl = citation.match(/^repository\-code: '(.*)'/m)[1]; + const releaseDate = citation.match(/^date\-released: '(.*)'/m)[1]; + const doi = citation.match(/value: ([0-9]+\.[0-9]+\/zenodo\.[0-9]+)/)[1]; + + + + + + view.setResult(` +
+

About ${title}

+
+

Version: ${version}

+

Release date: ${releaseDate}

+

DOI: ${doi}

+

${getLangString('view.window.about.AboutWindow_License')}: ${license}

+

GitHub: ${repoUrl}

+

Contributors:
+ + Avatars of contributors to ${title} in GitHub + +

+
+
+ `); + + }, this) ); }