Allow users to filter albums by contributors #48

Merged
Roflin merged 18 commits from refactor/viewalbum into master 2024-01-20 20:11:18 +01:00
2 changed files with 11 additions and 1 deletions
Showing only changes of commit 1f53689e4b - Show all commits

View File

@ -55,6 +55,7 @@ class ViewPhotoAlbum extends HTMLController
{ {
$filters[$contributor['slug']] = [ $filters[$contributor['slug']] = [
'id_user' => $contributor['id_user'], 'id_user' => $contributor['id_user'],
'label' => $contributor['first_name'],
'caption' => sprintf('By %s (%s photos)', 'caption' => sprintf('By %s (%s photos)',
$contributor['first_name'], $contributor['num_assets']), $contributor['first_name'], $contributor['num_assets']),
'link' => $tag->getUrl() . '/?by=' . $contributor['slug'], 'link' => $tag->getUrl() . '/?by=' . $contributor['slug'],

View File

@ -33,7 +33,16 @@ class AlbumButtonBox extends Template
echo ' echo '
<div class="dropdown"> <div class="dropdown">
<button class="btn btn-light dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false"> <button class="btn btn-light dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false">
<i class="bi bi-filter"></i> <i class="bi bi-filter"></i>';
if ($this->active_filter)
{
echo '
<span class="badge text-bg-danger">',
$this->filters[$this->active_filter]['label'], '</span>';
}
echo '
</button> </button>
<ul class="dropdown-menu">'; <ul class="dropdown-menu">';