Allow users to filter albums by contributors #48

Merge aplicado
Roflin aplicou merge dos 18 commits de refactor/viewalbum em master 2024-01-20 20:11:18 +01:00
Membro
  • Refactor ViewPhotoAlbum a little to clean up the code
  • Add a method to enumerate contributors
  • Add a method to safely filter by contributor
  • Add a UI for users to select an available filter
  • Carry filter over to photo page (e.g. ?by, analogous to ?in)
  • Take active filter into account when generating previous/next photo url
  • Carry filter over to download page
  • Test things thoroughly
- [x] Refactor ViewPhotoAlbum a little to clean up the code - [x] Add a method to enumerate contributors - [x] Add a method to safely filter by contributor - [x] Add a UI for users to select an available filter - [x] Carry filter over to photo page (e.g. `?by`, analogous to `?in`) - [x] Take active filter into account when generating previous/next photo url - [x] Carry filter over to download page - [x] Test things thoroughly
Aaron adicionou 6 commits 2024-01-14 21:29:30 +01:00
Aaron alterou o título de Allow users to filter albums by contributors para WIP: Allow users to filter albums by contributors 2024-01-14 21:29:34 +01:00
Aaron adicionou 1 commit 2024-01-14 22:17:40 +01:00
Aaron adicionou 4 commits 2024-01-15 00:55:52 +01:00
Aaron alterou o título de WIP: Allow users to filter albums by contributors para Allow users to filter albums by contributors 2024-01-15 00:56:50 +01:00
Aaron forçou o push refactor/viewalbum de 35cb6798c8 para 1f53689e4b 2024-01-15 01:01:08 +01:00 Comparar
Membro

Fixes #13

Fixes #13
minnozz alterações solicitadas 2024-01-15 10:01:34 +01:00
@ -66,0 +50,4 @@
$filters = [];
if (!empty($contributors))
{
$filters[''] = ['id_user' => null, 'caption' => 'Show all photos', 'link' => $tag->getUrl()];
Membro

Key label missing

Key `label` missing
Autor
Membro

I initially didn't add it as it'd never be used. You're right, though, and it's better to just have it there for consistency.

I initially didn't add it as it'd never be used. You're right, though, and it's better to just have it there for consistency.
Aaron marcou esta conversa como resolvida
@ -74,3 +91,3 @@
// Load a photo mosaic for the current tag.
list($mosaic, $total_count) = $this->getPhotoMosaic($id_tag, $page, !isset($is_person));
list($mosaic, $total_count) = $this->getPhotoMosaic($id_tag, $id_user_uploaded, $current_page, !isset($is_person));
Membro

$is_person is never set

(At $employer we had the convention to always use !== null instead of isset when you expect the variable to exist to catch these kind of errors. empty() was also discouraged for this reason)

`$is_person` is never set (At $employer we had the convention to always use `!== null` instead of `isset` when you expect the variable to exist to catch these kind of errors. `empty()` was also discouraged for this reason)
Autor
Membro

Yeah, I don't like this either. I've opted instead to explicitly declare it as a boolean before it's used.

Yeah, I don't like this either. I've opted instead to explicitly declare it as a boolean before it's used.
Aaron marcou esta conversa como resolvida
@ -201,0 +235,4 @@
{
$back_link = BASEURL . '/people/';
$back_link_title = 'Back to "People"';
$is_person = true;
Membro

Unused here

Unused here
Aaron marcou esta conversa como resolvida
Aaron adicionou 1 commit 2024-01-15 11:25:30 +01:00
Aaron adicionou 1 commit 2024-01-15 11:26:43 +01:00
Aaron adicionou 2 commits 2024-01-15 11:40:59 +01:00
Aaron adicionou 1 commit 2024-01-15 11:46:22 +01:00
minnozz aprovou estas alterações 2024-01-15 11:48:01 +01:00
Aaron adicionou 1 commit 2024-01-15 13:42:13 +01:00
Aaron adicionou 1 commit 2024-01-15 13:44:59 +01:00
Aaron adicionou 4 commits 2024-01-17 17:54:40 +01:00
Aaron forçou o push refactor/viewalbum de f82bd7b065 para 30bc0bb884 2024-01-17 18:21:31 +01:00 Comparar
Roflin aplicou o merge do commit cf6adbf80c em master 2024-01-20 20:11:18 +01:00
Aaron excluiu branch refactor/viewalbum 2024-01-20 20:52:17 +01:00
Acesse para participar desta conversação.
No Reviewers
Sem etiqueta
2 participante(s)
Notificações
Data limite
Data limite não informada.
Dependências

Nenhuma dependência definida.

Referência: Public/pics#48
Nenhuma descrição fornecida.