Compare commits
4 Commits
efa9584e9c
...
adafaf38b9
Author | SHA1 | Date |
---|---|---|
buttle | adafaf38b9 | |
buttle | 60eac3e67a | |
buttle | e951669cff | |
buttle | 6af87367eb |
File diff suppressed because one or more lines are too long
|
@ -1,8 +1,18 @@
|
||||||
(function($) {
|
|
||||||
$(document).ready(function() {
|
$(function(){
|
||||||
$('._expand_site_item').click(function() {
|
$("#site-list").on( "click", ".accordion-title", function() {
|
||||||
$(this).next('tr').toggle();
|
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;
|
return false;
|
||||||
});
|
});
|
||||||
});
|
})
|
||||||
})(jQuery)
|
|
||||||
|
|
|
@ -2,30 +2,38 @@
|
||||||
$archiveSiteHelper = $this->getHelperPluginManager()->get('archiveSiteMeta');
|
$archiveSiteHelper = $this->getHelperPluginManager()->get('archiveSiteMeta');
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
$collections = [];
|
$collections = $archiveSiteHelper->getCollections();
|
||||||
|
$projects = [];
|
||||||
foreach($sites as $site){
|
foreach($sites as $site){
|
||||||
$site_data = $archiveSiteHelper->getSiteMetaValues($site);
|
$site_data = $archiveSiteHelper->getSiteMetaValues($site);
|
||||||
$site_data['id'] = $site->id();
|
$site_data['id'] = $site->id();
|
||||||
$site_data['url'] = $site->siteUrl();
|
$site_data['url'] = $site->siteUrl();
|
||||||
$site_data['title'] = $site->title();
|
$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()));
|
$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_UNESCAPED_SLASHES);
|
||||||
//$collections = json_encode($collections, JSON_HEX_APOS);
|
//$collections = json_encode($collections, JSON_HEX_APOS);
|
||||||
//$collections = htmlspecialchars(json_encode($collections), ENT_QUOTES, 'UTF-8');
|
//$collections = htmlspecialchars(json_encode($collections), ENT_QUOTES, 'UTF-8');
|
||||||
//$collections = str_replace("'", "\'", $collections);
|
$projects = htmlentities(json_encode($projects, JSON_HEX_QUOT), ENT_QUOTES, 'UTF-8');
|
||||||
$collections = htmlentities(json_encode($collections, JSON_HEX_QUOT), ENT_QUOTES, 'UTF-8');
|
|
||||||
//$collections = json_encode($collections);
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<div data-vue-component="archive-list"
|
<div id="site-list">
|
||||||
data-collections='<?= $collections ?>'
|
<div
|
||||||
|
data-vue-component="archive-list"
|
||||||
|
data-collections='<?= $projects ?>'
|
||||||
data-page_size=3>
|
data-page_size=3>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<script src="/themes/archive/asset/js/archive-list.js"></script>
|
<script src="/themes/archive/asset/js/archive-list.js"></script>
|
||||||
|
|
Loading…
Reference in New Issue