Compare commits

...

4 Commits

Author SHA1 Message Date
buttle adafaf38b9 updates vue component 2021-11-24 15:34:30 +01:00
buttle 60eac3e67a ensures all site data is present 2021-11-24 13:21:57 +01:00
buttle e951669cff recovers accordion aria attributes 2021-11-24 11:22:01 +01:00
buttle 6af87367eb uses custom jquery to handle accordion 2021-11-24 11:02:30 +01:00
3 changed files with 37 additions and 19 deletions

File diff suppressed because one or more lines are too long

View File

@ -1,8 +1,18 @@
(function($) {
$(document).ready(function() {
$('._expand_site_item').click(function() {
$(this).next('tr').toggle();
return false;
});
});
})(jQuery)
$(function(){
$("#site-list").on( "click", ".accordion-title", function() {
var title = this
var content = $(this).closest('.accordion-item')
.find('.accordion-content')
if ($(content).is(':visible')) {
$(content).slideUp('fast')
$(this).closest('.accordion-item').removeClass('is-active')
$(title).attr('aria-expanded', false)
} else {
$(content).slideDown('fast')
$(this).closest('.accordion-item').addClass('is-active')
$(title).attr('aria-expanded', true)
}
return false;
});
})

View File

@ -2,30 +2,38 @@
$archiveSiteHelper = $this->getHelperPluginManager()->get('archiveSiteMeta');
?>
<?php
$collections = [];
$collections = $archiveSiteHelper->getCollections();
$projects = [];
foreach($sites as $site){
$site_data = $archiveSiteHelper->getSiteMetaValues($site);
$site_data['id'] = $site->id();
$site_data['url'] = $site->siteUrl();
$site_data['title'] = $site->title();
if (isset($site_data['collection'])) {
$site_data['collection'] = $collections[$site_data['collection']];
} else {
$site_data['collection'] = "";
}
$site_data['summary'] = nl2br($this->escapeHtml($site->summary()));
array_push($collections, $site_data);
if (!isset($site_data['currator'])) {
$site_data['currator'] = "";
}
array_push($projects, $site_data);
}
//$collections = json_encode($collections, JSON_UNESCAPED_SLASHES);
//$collections = json_encode($collections, JSON_HEX_APOS);
//$collections = htmlspecialchars(json_encode($collections), ENT_QUOTES, 'UTF-8');
//$collections = str_replace("'", "\'", $collections);
$collections = htmlentities(json_encode($collections, JSON_HEX_QUOT), ENT_QUOTES, 'UTF-8');
//$collections = json_encode($collections);
$projects = htmlentities(json_encode($projects, JSON_HEX_QUOT), ENT_QUOTES, 'UTF-8');
?>
<div data-vue-component="archive-list"
data-collections='<?= $collections ?>'
data-page_size=3>
<div id="site-list">
<div
data-vue-component="archive-list"
data-collections='<?= $projects ?>'
data-page_size=3>
</div>
</div>
<script src="/themes/archive/asset/js/archive-list.js"></script>