Skip to content

Commit

Permalink
Provide link from Arachne frontend to HacVia archive
Browse files Browse the repository at this point in the history
  • Loading branch information
dersmon committed Jan 13, 2025
1 parent 8fedca7 commit d4170b0
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 9 deletions.
1 change: 1 addition & 0 deletions frontend/app/_transl8.de.js
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,7 @@ export default {
"facet_bennenungallg": "Benennung allgemein",
"ui.passwordchange.illegal": "Das alte und das neue Passwort dürfen nicht die selben sein!",
"edit_button": "Bearbeitung",
"image_archive_button": "Archiv",
"catalog_no_catalog_info": "Ein Katalog in Arachne ist geordnetes Verzeichnis von archäologischen Objekten.",
"catalog_no_catalog_help": "Mit einem Klick auf \"Neuen Katalog anlegen\", kann man einen eigenen persönlichen Katalog erstellen. Weitere Hilfe zum Bearbeiten von Einträgen findet man wenn man den Katalog öffnet.",
"catalog_no_catalog_hint_note": "Kataloge sind standardmäßig privat, sodass sie nicht öffentlich sichtar sind. Außerdem müssen weitere Bearbeiter gesondert freigeschaltet werden.",
Expand Down
1 change: 1 addition & 0 deletions frontend/app/_transl8.en.js
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,7 @@ export default {
"facet_bennenungallg": "General designation",
"ui.passwordchange.illegal": "The old and new password can't be the same!",
"edit_button": "Edit",
"image_archive_button": "Archive",
"undefined": "undefined",
"catalog_no_catalog_info": "A catalog in Arachne is an ordered list of archaeological objects.",
"general_hint": "Note:",
Expand Down
9 changes: 6 additions & 3 deletions frontend/app/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ const lazyLoadService = ($ocLazyLoad) => (importPromise) =>
});

angular.module('arachne', [
'angulartics',
'angulartics',
'angulartics.piwik',
'ui.bootstrap',
'ui.bootstrap.tpls',
Expand Down Expand Up @@ -148,8 +148,8 @@ angular.module('arachne', [
'editUser.**': { url: '/editUser', lazyLoad: lazyLoad(import('./users/users.module.js'))},
'contact.**': { url: '/contact', lazyLoad: lazyLoad(import('./users/users.module.js'))},
'pwdreset.**': { url: '/pwdreset', lazyLoad: lazyLoad(import('./users/users.module.js'))},
'pwdchange.**': { url: '/pwdchange', lazyLoad: lazyLoad(import('./users/users.module.js'))},
'userActivation.**': { url: '/user/activation/:token', lazyLoad: lazyLoad(import('./users/users.module.js'))},
'pwdchange.**': { url: '/pwdchange', lazyLoad: lazyLoad(import('./users/users.module.js'))},
'userActivation.**': { url: '/user/activation/:token', lazyLoad: lazyLoad(import('./users/users.module.js'))},
'login.**': { url: '/login?redirectTo',lazyLoad: lazyLoad(import('./users/users.module.js'))},
'dataimport': { url: '/admin/dataimport', template: require('./admin/dataimport.html')},
'dataexport': { url: '/admin/dataexport', template: require('./admin/dataexport.html')},
Expand Down Expand Up @@ -191,6 +191,9 @@ angular.module('arachne', [
.constant('arachneSettings', {
arachneUrl: 'https://arachne.dainst.org',
dataserviceUri: "//" + document.location.host + "/data",
hacViaUrl: function () {
return document.location.host == "arachne.dainst.org" ? "//images.arachne.dainst.org" : "//images.arachne.test.dainst.org"
}(),
limit: 50,
facetLimit: 20,
openFacets : ["facet_kategorie", "facet_image", "facet_bestandsname", "facet_subkategoriebestand"], // order is important for sorting of default facets
Expand Down
24 changes: 22 additions & 2 deletions frontend/app/image/ar-imageslider.directive.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,31 @@
import './ar-imageslider.scss';

export default function() {
const hacViaEntityCategories = [
"bauwerk",
"bauwerksteil",
"gruppen",
"gruppenrekonstruktion",
"inschrift",
"objekt",
"realien",
"relief",
"reproduktion",
"rezeption",
"sammlungen",
"typus"
]

export default function (arachneSettings, authService) {
return {
scope: {entity: '=', currentQuery: '='},
scope: { entity: '=', currentQuery: '=' },
template: require('./ar-imageslider.html'),
link: function (scope, element, attrs) {

if (hacViaEntityCategories.includes(scope.entity.categoryKey)) {
scope.hacViaUrl = arachneSettings.hacViaUrl + "/archive/files/" + scope.entity.entityId;
}

scope.user = authService.getUser();
var thumbRow = angular.element(angular.element(element.children()[0]).children()[0]).children()[2];
var sliderRow = angular.element(element.children()[0]).children()[0];

Expand Down
12 changes: 8 additions & 4 deletions frontend/app/image/ar-imageslider.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
<h3 ng-if="entity.images.length > 1" ng-init="loadImages(entity)">
<a ng-href="entity/{{entity.entityId}}/images{{currentQuery.toString()}}">
<h3>
<a ng-if="entity.images.length > 1" ng-init="loadImages(entity)"
ng-href="entity/{{entity.entityId}}/images{{currentQuery.toString()}}">
{{'entity_images'|transl8}}
<small>({{entity.imageSize}})</small>
</a>
<span ng-if="entity.images.length == 1">{{'entity_image'|transl8}}></span>
<a ng-if="hacViaUrl" class="btn btn-default" target="_blank" href="{{hacViaUrl}}">
<span class="glyphicon glyphicon-folder-open"></span>
{{"image_archive_button"|transl8}}
</a>
</h3>
<h3 ng-if="entity.images.length == 1">{{'entity_image'|transl8}}</h3>

<div class="ar-imageslider">
<div ng-if="currentImgNo >= 0"
class="panel panel-default"
Expand Down

0 comments on commit d4170b0

Please sign in to comment.