diff --git a/.github/phpstan.neon b/.github/phpstan.neon index 46e47bfde..f495dbbeb 100644 --- a/.github/phpstan.neon +++ b/.github/phpstan.neon @@ -1,6 +1,4 @@ parameters: - ignoreErrors: - - '#Call to an undefined method Kitodo\\Dlf\\Domain\\Model\\Document::getCurrentDocument\(\)\.#' level: 5 paths: - ../Classes/ diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml new file mode 100644 index 000000000..d101ec033 --- /dev/null +++ b/.github/workflows/documentation.yml @@ -0,0 +1,17 @@ +name: test documentation + +on: [ push, pull_request ] + +jobs: + tests: + name: documentation + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Test if the documentation will render without warnings + run: | + mkdir -p Documentation-GENERATED-temp \ + && docker run --rm --pull always -v $(pwd):/project \ + ghcr.io/typo3-documentation/render-guides:latest --config=Documentation --no-progress --fail-on-log diff --git a/.github/workflows/npm-grunt.yml b/.github/workflows/npm-grunt.yml index 43b9012ce..1680b664a 100644 --- a/.github/workflows/npm-grunt.yml +++ b/.github/workflows/npm-grunt.yml @@ -59,14 +59,14 @@ jobs: strategy: matrix: - node-version: [12.x] + node-version: [20.x] steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} cache: npm diff --git a/.github/workflows/phpstan.yml b/.github/workflows/phpstan.yml index 8d8861501..35c5266de 100644 --- a/.github/workflows/phpstan.yml +++ b/.github/workflows/phpstan.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Install dependencies uses: php-actions/composer@v6 diff --git a/.gitignore b/.gitignore index d477370c1..4c5f4df22 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,6 @@ node_modules *.css.map Documentation-GENERATED-temp/ +public/ +vendor/ +composer.lock diff --git a/Build/Documentation/.gitignore b/Build/Documentation/.gitignore deleted file mode 100644 index 703312362..000000000 --- a/Build/Documentation/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -_build -venv diff --git a/Build/Documentation/conf.py b/Build/Documentation/conf.py deleted file mode 100644 index 1a0a918f8..000000000 --- a/Build/Documentation/conf.py +++ /dev/null @@ -1,35 +0,0 @@ -""" -Basic Sphinx configuration for TYPO3 theme. Uses configuration from Settings.cfg. -""" - -import ConfigParser - -settings = globals() -settings['general'] = settings - -config = ConfigParser.RawConfigParser() -config.read('../../Documentation/Settings.cfg') - -for section in config.sections(): - target = settings.setdefault(section, {}) - - for (name, value) in config.items(section): - if section == 'intersphinx_mapping': - target[name] = (value, None) - else: - target[name] = value - -extensions = [ - 'sphinx_typo3_theme', - 'sphinx.ext.intersphinx', - 'sphinxcontrib.t3fieldlisttable' -] - -html_theme = 'sphinx_typo3_theme' - -# The TYPO3 convention is to capitalize the index filename, which would require -# us to visit http://127.0.0.1:8000/Index.html. We thus add an `index.html` that -# redirects to `Index.html`. -master_doc = 'Index' -html_extra_path = ['index.html'] -exclude_patterns = [] diff --git a/Build/Documentation/docker-compose.t3docs.yml b/Build/Documentation/docker-compose.t3docs.yml deleted file mode 100644 index 497c1af59..000000000 --- a/Build/Documentation/docker-compose.t3docs.yml +++ /dev/null @@ -1,7 +0,0 @@ -version: '3' -services: - t3docs: - image: t3docs/render-documentation:latest - volumes: - - ../../:/PROJECT:ro - - ../../Documentation-GENERATED-temp:/RESULT diff --git a/Build/Documentation/sphinx.sh b/Build/Documentation/sphinx.sh deleted file mode 100755 index c8d216f87..000000000 --- a/Build/Documentation/sphinx.sh +++ /dev/null @@ -1,55 +0,0 @@ -#!/bin/bash - -BASE_DIR=$(dirname "$0") -VENV_DIR="$BASE_DIR/venv" -DOCS_DIR="$BASE_DIR/../../Documentation" - -function usage() -{ - cat << EOF -Usage: sphinx.sh [options] - -Commands: - i, install Install Sphinx in a virtualenv - s, serve Serve documentation. Options are forwarded to sphinx-autobuild. - -H Server host - -p Server port - -a Write all files (from sphinx-build) - -E Don't use a saved environment (from sphinx-build) -EOF - - exit -} - -function use_sphinx() -{ - source "$VENV_DIR/bin/activate" -} - -COMMAND=$1 -shift - -case $COMMAND in - i|install) - if [ ! -e "$VENV_DIR" ]; then - # t3fieldlisttable doesn't seem to work with Python 3 - virtualenv -p python2 "$VENV_DIR" - fi - - use_sphinx - - pip install sphinx-autobuild - pip install t3fieldlisttable - pip install sphinx_typo3_theme - - ;; - - s|serve) - use_sphinx - sphinx-autobuild -c "$BASE_DIR" "$@" "$DOCS_DIR" "$BASE_DIR/_build" - ;; - - *) - usage - ;; -esac diff --git a/Build/package-lock.json b/Build/package-lock.json index c185a285c..80ea6692c 100644 --- a/Build/package-lock.json +++ b/Build/package-lock.json @@ -169,12 +169,12 @@ } }, "node_modules/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "dev": true, "dependencies": { - "fill-range": "^7.0.1" + "fill-range": "^7.1.1" }, "engines": { "node": ">=8" @@ -383,9 +383,9 @@ } }, "node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "dev": true, "dependencies": { "to-regex-range": "^5.0.1" @@ -1849,12 +1849,12 @@ } }, "braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "dev": true, "requires": { - "fill-range": "^7.0.1" + "fill-range": "^7.1.1" } }, "buffer-from": { @@ -2020,9 +2020,9 @@ } }, "fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "dev": true, "requires": { "to-regex-range": "^5.0.1" diff --git a/Build/package.json b/Build/package.json index 0622eb332..c609f3075 100644 --- a/Build/package.json +++ b/Build/package.json @@ -15,7 +15,8 @@ "license": "GPL-3.0-or-later", "homepage": "https://dfgviewer.de", "devDependencies": { - "grunt": "^1.5.3", + "grunt": "^1.6", + "grunt-cli": "^1.5.0", "grunt-contrib-less": "^2.0.0", "grunt-contrib-watch": "^1.1.0", "grunt-terser": "^2.0.0", diff --git a/Configuration/TCA/Overrides/tt_content.php b/Configuration/TCA/Overrides/tt_content.php index fcea07627..a3aed29b5 100644 --- a/Configuration/TCA/Overrides/tt_content.php +++ b/Configuration/TCA/Overrides/tt_content.php @@ -5,13 +5,13 @@ $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['dfgviewer_uri'] = 'layout,select_key,pages,recursive'; \TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin( - 'Slub.Dfgviewer', + 'Dfgviewer', 'Uri', 'LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:plugins.search.title', ); \TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin( - 'Slub.Dfgviewer', + 'Dfgviewer', 'SRU', 'LLL:EXT:dfgviewer/Resources/Private/Language/locallang_be.xlf:plugins.sru.title', ); diff --git a/Configuration/TypoScript/Page/header.typoscript b/Configuration/TypoScript/Page/header.typoscript index 6d86fa256..b38c29fd7 100644 --- a/Configuration/TypoScript/Page/header.typoscript +++ b/Configuration/TypoScript/Page/header.typoscript @@ -7,8 +7,6 @@ page { includeCSS { style = EXT:dfgviewer/Resources/Public/Css/webStyles.css highlight = EXT:dfgviewer/Resources/Public/JavaScript/Highlight/styles/magula.css - 3DViewer = EXT:dfgviewer/Resources/Public/Css/3DViewer/main.css - 3DViewerSpinner = EXT:dfgviewer/Resources/Public/Css/3DViewer/spinner.css } includeJSFooterlibs { jQuery = EXT:dfgviewer/Resources/Public/JavaScript/jQuery/jquery-3.6.0.min.js diff --git a/Configuration/TypoScript/Plugins/kitodo.typoscript b/Configuration/TypoScript/Plugins/kitodo.typoscript index 9d14ff1af..9959c34a9 100644 --- a/Configuration/TypoScript/Plugins/kitodo.typoscript +++ b/Configuration/TypoScript/Plugins/kitodo.typoscript @@ -67,15 +67,10 @@ plugin.tx_dlf_pageview { } # -------------------------------------------------------------------------------------------------------------------- -# 3D objects view +# embedded 3D viewer # -------------------------------------------------------------------------------------------------------------------- -plugin.tx_dlf_view3d < tt_content.list.20.dlf_view3d -plugin.tx_dlf_view3d { - pages = {$config.storagePid} - excludeOther = 0 - features = - elementId = tx-dfgviewer-3d-view - fileGrpImages = THUMBS,DEFAULT +plugin.tx_dlf_embedded3dviewer < tt_content.list.20.dlf_embedded3dviewer +plugin.tx_dlf_embedded3dviewer { } # -------------------------------------------------------------------------------------------------------------------- @@ -159,6 +154,7 @@ lib.kitodo.navigation.viewfunction { # fulltextdownloadtool # imagedownloadtool # imagemanipulationtool +# modeldownloadtool # pdfdownloadtool # searchindocumenttool @@ -169,6 +165,14 @@ plugin.tx_dlf_toolbox { } } +plugin.tx_dlf_modeldownloadtool < plugin.tx_dlf_toolbox +plugin.tx_dlf_modeldownloadtool { + settings { + fileGrpsModelDownload = DEFAULT + tools = modeldownloadtool + } +} + plugin.tx_dlf_fulltexttool < plugin.tx_dlf_toolbox plugin.tx_dlf_fulltexttool { settings { @@ -204,9 +208,18 @@ plugin.tx_dlf_audioplayer { } # -------------------------------------------------------------------------------------------------------------------- -# newspaper navigation +# 3d object # -------------------------------------------------------------------------------------------------------------------- +[getDocumentType({$config.storagePid}) == "object"] + page.10.variables { + is3dObject = TEXT + is3dObject.value = 1 + } +[END] +# -------------------------------------------------------------------------------------------------------------------- +# newspaper navigation +# -------------------------------------------------------------------------------------------------------------------- [getDocumentType({$config.storagePid}) == "ephemera" or getDocumentType({$config.storagePid}) == "newspaper"] page.10.variables { isNewspaper = TEXT diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index 4182c314d..8e61b2661 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -16,35 +16,59 @@ npm run build ## Documentation -### Local Preview Server +Build the DFG-Viewer documentation using the `docs:build` script with Composer. +This script generates the documentation using the rendering tool for Typo3 and +places it in the `Documentation-GENERATED-temp` folder. -To preview the rendered output and automatically rebuild documentation on changes, you may spawn a local server. This supports auto-refresh and is faster than the official preview build, but omits some features such as syntax highlighting. +```bash +composer docs:build +``` + +Take a look at the documentation by opening the file `Index.html` in the folder +`Documentation-GENERATED-temp` in your browser. + +### Provide via Http Server (optional) -This requires Python 2 to be installed. +Starts the http server and mounts the mandatory directory `Documentation-GENERATED-temp`. ```bash -# First start: Setup Sphinx in a virtualenv -composer docs:setup +composer docs:start +``` + +Take a look at the documentation by opening +in your browser. + +The server runs in detached mode, so you will need to stop the http server manually. -# Spawn server -composer docs:serve -composer docs:serve -- -E # Don't use a saved environment (useful when changing toctree) -composer docs:serve -- -p 8000 # Port may be specified +```bash +composer docs:stop ``` -By default, the output is served to http://127.0.0.1:8000. +### Troubleshooting + +#### Permission -### Official Preview Build +The documentation container runs as a non-root user. If there are some problem regarding +the permission of container user you can link the UID and GID of host into the container +using the `--user` parameter. -Build documentation using the [official Docker image](https://docs.typo3.org/m/typo3/docs-how-to-document/main/en-us/RenderingDocs/Quickstart.html): +**Example:** ```bash -# Full build -composer docs:t3 makehtml +docker run --rm --user=$(id -u):$(id -g) [...] +``` + +_In the `docs:build` Composer script, this parameter is already included. +If any issues arise, you can adjust or remove it as needed._ -# Only run sphinx-build -composer docs:t3 just1sphinxbuild +#### Output directory -# (Alternative) Run docker-compose manually -docker-compose -f ./Build/Documentation/docker-compose.t3docs.yml run --rm t3docs makehtml +The default documentation directory name is `Documentation-GENERATED-temp`. +If you want to change the directory name add the `--output` parameter at the +end of the building command. + +**Example:** + +```bash +[...] --config ./Documentation --output="My_Documentation_Directory" ``` diff --git a/Documentation/Settings.cfg b/Documentation/Settings.cfg deleted file mode 100644 index 986504c34..000000000 --- a/Documentation/Settings.cfg +++ /dev/null @@ -1,19 +0,0 @@ -[general] -project = DFG-Viewer -release = 6.0.0 -t3author = Sebastian Meyer, Alexander Bigga -copyright = 2020 by the author -description = Remote resources navigator for digital libraries. Reads METS/MODS - and METS/TEI via OAI-PMH. - -[html_theme_options] -github_repository = slub/dfg-viewer -github_branch = master - -project_contact = mailto:typo3@slub-dresden.de -project_home = https://github.com/slub/dfg-viewer -project_issues = https://github.com/slub/dfg-viewer/issues -project_repository = https://github.com/slub/dfg-viewer - -# leave this empty -use_opensearch = diff --git a/Documentation/guides.xml b/Documentation/guides.xml new file mode 100644 index 000000000..18d4b0102 --- /dev/null +++ b/Documentation/guides.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/Resources/Private/Less/components/controls.less b/Resources/Private/Less/components/controls.less index ac3ba3d18..3938ca64b 100644 --- a/Resources/Private/Less/components/controls.less +++ b/Resources/Private/Less/components/controls.less @@ -140,6 +140,7 @@ &.persistence-page:before { background-position: -320px -80px; } + &.tx-dlf-tools-modeldownload:before, &.tx-dlf-tools-imagedownload:before { background-position: -320px -40px; } @@ -153,6 +154,9 @@ left: -40px; } } + &.tx-dlf-tools-modeldownload { + opacity: 1; + } } span { opacity: 0.5; @@ -1144,4 +1148,4 @@ body.dfgviewer.calendar { position: relative; top: -80px; } -} \ No newline at end of file +} diff --git a/Resources/Private/Less/modules/fulltext.less b/Resources/Private/Less/modules/fulltext.less index c1bfb72d5..98382c287 100644 --- a/Resources/Private/Less/modules/fulltext.less +++ b/Resources/Private/Less/modules/fulltext.less @@ -32,7 +32,7 @@ } #tx-dlf-fulltextselection { position: relative; - top: 0; + top: 20px; right: 0; width: 100%; height: 100%; diff --git a/Resources/Private/Less/modules/gridview.less b/Resources/Private/Less/modules/gridview.less index b50d8e0a9..f9b9e82d4 100644 --- a/Resources/Private/Less/modules/gridview.less +++ b/Resources/Private/Less/modules/gridview.less @@ -57,117 +57,6 @@ } } - -.tx-dlf-pagegrid .pagination { - position: absolute; - bottom: 15px; - height: 1px; - width: 290px; - left: 50%; - margin-left: -145px; - line-height: 0; - background: green; - .text-hide(); - display: flex; - a { - position: absolute; - bottom: 0; - display: none; - width: 40px; - height: 40px; - &:before { - position: absolute; - top: 0; - left: 0; - bottom: -1px; - width: 40px; - height: 40px; - border-radius: 20px; - background-color: white; - content: " "; - } - &:first-child { - display: block; - left: 0; - &:before { - background-position: -240px -80px; - } - } - &:last-child { - display: block; - right: 0; - &:before { - background-position: -280px -80px; - } - } - } - .current { - width: 40px; - height: 40px; - } - @media screen and (min-width: @tabletLandscapeViewportWidth) { - height: 70px; - padding: 15px 0; - font-weight: bold; - font-size: 14px; - line-height: 30px; - color: white; - white-space: nowrap; - width: auto; - margin: 0; - .transform(translateX(-50%)); - -moz-font-feature-settings: "lnum"; - -webkit-font-feature-settings: "lnum"; - font-feature-settings: "lnum"; - background: fade(@base-blue, 90%); - box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2); - a, - a:first-child, - a:last-child { - color: @base-blue; - position: relative; - display: inline-block; - bottom: auto; - margin: 0 3px; - left: auto; - right: auto; - background: white; - border-radius: 20px; - width: 30px; - height: 30px; - &:before { - display: none; - } - } - li.next, li.previous { - a, - a:first-child, - a:last-child { - width: 60px; - height: 30px; - } - } - } - @media screen and (min-width: @desktopViewportWidth) { - font-size: 18px; - line-height: 40px; - a, - a:first-child, - a:last-child { - width: 40px; - height: 40px; - } - li.next, li.previous { - a, - a:first-child, - a:last-child { - width: 90px; - height: 40px; - } - } - } -} - // Pagination Box .tx-dlf-pagegrid ul.pagination { position: absolute; diff --git a/Resources/Private/Less/structure.less b/Resources/Private/Less/structure.less index 1b8fd3686..348f4ea73 100644 --- a/Resources/Private/Less/structure.less +++ b/Resources/Private/Less/structure.less @@ -180,6 +180,7 @@ a { margin-top: 5px; width: 70px; height: 33px; + object-fit: contain; } } .mobile-meta { @@ -322,6 +323,7 @@ a { width: 108px; height: 50px; border-radius: 4px; + object-fit: contain; } } .mobile-meta, diff --git a/Resources/Private/Partials/ControlBar.html b/Resources/Private/Partials/ControlBar.html index 861b5830d..a52f91afa 100644 --- a/Resources/Private/Partials/ControlBar.html +++ b/Resources/Private/Partials/ControlBar.html @@ -19,31 +19,17 @@