list of sites from table to lists (ul/li) to be able to use accordion and more semantic

This commit is contained in:
jorge 2021-06-29 08:51:17 +02:00
parent 2d4eb887be
commit 7dc3de84c2
2 changed files with 79 additions and 62 deletions

View File

@ -2,40 +2,55 @@
$archiveSiteHelper = $this->getHelperPluginManager()->get('archiveSiteMeta');
?>
<div class="list-of-sites">
<div class="site-list">
<section class="collections-list">
<table>
<thead>
<tr>
<th>Title</th>
<th>Artist</th>
<th>Collection</th>
<th>Date</th>
</tr>
</thead>
<tbody>
<header>
<h2> Latest in collections</h2>
</header>
<main class="">
<article class="">
<ul class="accordion" data-responsive-accordion-tabs="accordion small-accordion" data-multi-expand="true" data-allow-all-closed="true" data-deep-link="true">
<li class="accordion-item title" data-accordion-item disabled>
<a href="#" class="accordion-title">
<ul class="">
<li class="title">Title</li>
<li class="curator">Artist</li>
<li class="collection-name">Collection</li>
<li class="date">Date</li>
</ul>
</a>
<div class="accordion-content" data-tab-content>
<figure>
</figure>
<p>
</p>
</div>
</li>
<?php
// read each omeka site to publish
foreach($sites as $site):
$site_meta_values = $archiveSiteHelper->getSiteMetaValues($site);
echo $this->partial('common/site-list-entry', [
'site' => $site,
'showSummary' => $summaries,
'site_meta_values' => $site_meta_values,
'archive_collections' => $archiveSiteHelper->getCollections(),
]);
$site_meta_values = $archiveSiteHelper->getSiteMetaValues($site);
// table body build file
echo $this->partial('common/site-list-entry', [
'site' => $site,
'showSummary' => $summaries,
'site_meta_values' => $site_meta_values,
'archive_collections' => $archiveSiteHelper->getCollections(),
]);
endforeach;
?>
</tbody>
</table>
</div>
<?php
if (1 == 0):
//if ($pagination):
</ul>
</article>
</main>
<aside>
<nav>
<?php
if (1 == 0):
//if ($pagination):
echo $this->pagination();
endif;
?>
</div>
endif;
?>
</nav>
</aside>
</section>

View File

@ -1,41 +1,43 @@
<?php
// publish as a table the content
$summary = $showSummary ? $site->summary() : null;
//
?>
<tr class="_expand_site_item">
<td>
<?= $site->title() ?>
</td>
<td>
<?php if ($site_meta_values != null): ?>
<?= $site_meta_values['currator']; ?><br />
<?php endif; ?>
</td>
<td>
<?php if ($site_meta_values != null): ?>
<?= $archive_collections[$site_meta_values['collection']]; ?>
<?php endif; ?>
</td>
<td>
<?php if ($site_meta_values != null): ?>
<?= $site_meta_values['project_date']; ?>
<?php endif; ?>
</td>
</tr>
<tr style="display:none">
<td>
<li class="accordion-item" data-accordion-item>
<a href="#" class="accordion-title">
<ul class="">
<li class="title">
<?= $site->title() ?>
</li>
<li class="curator">
<?php if ($site_meta_values != null): ?>
<?= $site_meta_values['currator']; ?><br />
<?php endif; ?>
</li>
<li class="collection-name">
<?php if ($site_meta_values != null): ?>
<?= $archive_collections[$site_meta_values['collection']]; ?>
<?php endif; ?>
</li>
<li class="date">
<?php if ($site_meta_values != null): ?>
<?= $site_meta_values['project_date']; ?>
<?php endif; ?>
</li>
</ul>
</a>
<div class="accordion-content" data-tab-content>
<figure>
<?php if ($site_meta_values != null): ?>
<img src="<?= $site_meta_values['thumbnail']; ?>" />
<?php endif; ?>
</td>
<td colspan="3">
</figure>
<p>
<?php if ($summary): ?>
<?php echo nl2br($this->escapeHtml($summary)); ?>
<br />
<?php echo nl2br($this->escapeHtml($summary)); ?>
<?php endif; ?>
<button class="go_to_site_button"
onclick="window.location.href = '<?= $site->siteUrl() ?>'">
View
</button>
</td>
</tr>
<a class="button small" href="<?= $site->siteUrl() ?>">View</a>
</p>
</div>
</li>