mirror of
https://github.com/ad-aures/castopod.git
synced 2026-04-12 19:17:45 +02:00
feat(public-ui): adapt public podcast and episode pages to wireframes
- adapt wireframes with responsive design - refactor models methods to cache requests for faster queries - update public controllers to cache pages while retaining analytics hits - add platform links to podcast page - add previous / next episodes in episode page - update npm packages to latest versions closes #30, #13
This commit is contained in:
parent
2517808cd4
commit
40a0535fc1
32 changed files with 2058 additions and 1474 deletions
|
|
@ -1,18 +1,33 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @copyright 2020 Podlibre
|
||||
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
||||
* @link https://castopod.org/
|
||||
*/
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
class UserModel extends \Myth\Auth\Models\UserModel
|
||||
{
|
||||
protected $returnType = \App\Entities\User::class;
|
||||
|
||||
public function getPodcastContributors($podcast_id)
|
||||
public function getPodcastContributors($podcastId)
|
||||
{
|
||||
return $this->select('users.*, auth_groups.name as podcast_role')
|
||||
->join('users_podcasts', 'users_podcasts.user_id = users.id')
|
||||
->join('auth_groups', 'auth_groups.id = users_podcasts.group_id')
|
||||
->where('users_podcasts.podcast_id', $podcast_id)
|
||||
->findAll();
|
||||
if (!($found = cache("podcast{$podcastId}_contributors"))) {
|
||||
$found = $this->select('users.*, auth_groups.name as podcast_role')
|
||||
->join('users_podcasts', 'users_podcasts.user_id = users.id')
|
||||
->join(
|
||||
'auth_groups',
|
||||
'auth_groups.id = users_podcasts.group_id'
|
||||
)
|
||||
->where('users_podcasts.podcast_id', $podcastId)
|
||||
->findAll();
|
||||
|
||||
cache()->save("podcast{$podcastId}_contributors", $found, DECADE);
|
||||
}
|
||||
|
||||
return $found;
|
||||
}
|
||||
|
||||
public function getPodcastContributor($user_id, $podcast_id)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue