ci: fix lint and formatting issues
This commit is contained in:
parent
34777598dd
commit
84a6447fd4
|
@ -1 +1 @@
|
|||
{"version":1,"defects":[],"times":{"Tests\\Database\\ExampleDatabaseTest::testModelFindAll":0.003,"Tests\\Database\\ExampleDatabaseTest::testSoftDeleteLeavesRow":0.004,"modules\\Api\\Rest\\V1\\PodcastTest::testList":0.033,"modules\\Api\\Rest\\V1\\PodcastTest::testView":0.004,"modules\\Api\\Rest\\V1\\PodcastTest::testViewNotFound":0.01,"modules\\Api\\Rest\\V1\\PodcastTest::testListEmpty":4.313,"Tests\\Session\\ExampleSessionTest::testSessionSimple":0,"HealthTest::testIsDefinedAppPath":0,"HealthTest::testBaseUrlHasBeenSet":0.005}}
|
||||
{"version":1,"defects":[],"times":{"Tests\\Database\\ExampleDatabaseTest::testModelFindAll":0.002,"Tests\\Database\\ExampleDatabaseTest::testSoftDeleteLeavesRow":0.002,"modules\\Api\\Rest\\V1\\PodcastTest::testList":0.008,"modules\\Api\\Rest\\V1\\PodcastTest::testView":0.003,"modules\\Api\\Rest\\V1\\PodcastTest::testViewNotFound":0.002,"modules\\Api\\Rest\\V1\\PodcastTest::testListEmpty":0.633,"Tests\\Session\\ExampleSessionTest::testSessionSimple":0,"HealthTest::testIsDefinedAppPath":0,"HealthTest::testBaseUrlHasBeenSet":0.001}}
|
|
@ -49,8 +49,6 @@ class Database extends Config
|
|||
/**
|
||||
* This database connection is used when running PHPUnit database tests.
|
||||
*
|
||||
* @noRector StringClassNameToClassConstantRector
|
||||
*
|
||||
* @var array<string, mixed>
|
||||
*/
|
||||
public array $tests = [
|
||||
|
@ -84,7 +82,6 @@ class Database extends Config
|
|||
// Ensure that we always set the database group to 'tests' if
|
||||
// we are currently running an automated test suite, so that
|
||||
// we don't overwrite live data on accident.
|
||||
/** @noRector RemoveAlwaysTrueIfConditionRector */
|
||||
if (ENVIRONMENT === 'testing') {
|
||||
$this->defaultGroup = 'tests';
|
||||
}
|
||||
|
|
|
@ -7,6 +7,7 @@ namespace Config;
|
|||
use App\Entities\Actor;
|
||||
use App\Entities\Post;
|
||||
use App\Models\EpisodeModel;
|
||||
use CodeIgniter\Debug\Toolbar\Collectors\Database;
|
||||
use CodeIgniter\Events\Events;
|
||||
use CodeIgniter\Exceptions\FrameworkException;
|
||||
|
||||
|
@ -47,7 +48,7 @@ Events::on('pre_system', static function () {
|
|||
* If you delete, they will no longer be collected.
|
||||
*/
|
||||
if (CI_DEBUG && ! is_cli()) {
|
||||
Events::on('DBQuery', 'CodeIgniter\Debug\Toolbar\Collectors\Database::collect');
|
||||
Events::on('DBQuery', Database::class . '::collect');
|
||||
Services::toolbar()->respond();
|
||||
}
|
||||
});
|
||||
|
|
|
@ -21,8 +21,6 @@ class Pager extends BaseConfig
|
|||
* and the desired group as $pagerGroup;
|
||||
*
|
||||
* @var array<string, string>
|
||||
*
|
||||
* @noRector Rector\Php55\Rector\String_\StringClassNameToClassConstantRector
|
||||
*/
|
||||
public $templates = [
|
||||
'default_full' => 'App\Views\pager\default_full',
|
||||
|
|
|
@ -27,8 +27,6 @@ class Services extends BaseService
|
|||
/**
|
||||
* The Router class uses a RouteCollection's array of routes, and determines the correct Controller and Method to
|
||||
* execute.
|
||||
*
|
||||
* @noRector PHPStan\Reflection\MissingMethodFromReflectionException
|
||||
*/
|
||||
public static function router(
|
||||
?RouteCollectionInterface $routes = null,
|
||||
|
@ -48,8 +46,6 @@ class Services extends BaseService
|
|||
/**
|
||||
* The Negotiate class provides the content negotiation features for working the request to determine correct
|
||||
* language, encoding, charset, and more.
|
||||
*
|
||||
* @noRector PHPStan\Reflection\MissingMethodFromReflectionException
|
||||
*/
|
||||
public static function negotiator(?RequestInterface $request = null, bool $getShared = true): Negotiate
|
||||
{
|
||||
|
|
|
@ -15,9 +15,6 @@ use CodeIgniter\HTTP\Response;
|
|||
|
||||
class ColorsController extends Controller
|
||||
{
|
||||
/**
|
||||
* @noRector ReturnTypeDeclarationRector
|
||||
*/
|
||||
public function index(): Response
|
||||
{
|
||||
$cacheName = 'colors.css';
|
||||
|
|
|
@ -120,9 +120,6 @@ class EpisodeCommentController extends BaseController
|
|||
return $cachedView;
|
||||
}
|
||||
|
||||
/**
|
||||
* @noRector ReturnTypeDeclarationRector
|
||||
*/
|
||||
public function commentObject(): Response
|
||||
{
|
||||
$commentObject = new CommentObject($this->comment);
|
||||
|
@ -132,9 +129,6 @@ class EpisodeCommentController extends BaseController
|
|||
->setBody($commentObject->toJSON());
|
||||
}
|
||||
|
||||
/**
|
||||
* @noRector ReturnTypeDeclarationRector
|
||||
*/
|
||||
public function replies(): Response
|
||||
{
|
||||
/**
|
||||
|
|
|
@ -274,9 +274,6 @@ class EpisodeController extends BaseController
|
|||
return $this->response->setXML($oembed);
|
||||
}
|
||||
|
||||
/**
|
||||
* @noRector ReturnTypeDeclarationRector
|
||||
*/
|
||||
public function episodeObject(): Response
|
||||
{
|
||||
$podcastObject = new PodcastEpisode($this->episode);
|
||||
|
@ -286,9 +283,6 @@ class EpisodeController extends BaseController
|
|||
->setBody($podcastObject->toJSON());
|
||||
}
|
||||
|
||||
/**
|
||||
* @noRector ReturnTypeDeclarationRector
|
||||
*/
|
||||
public function comments(): Response
|
||||
{
|
||||
/**
|
||||
|
|
|
@ -47,9 +47,6 @@ class PodcastController extends BaseController
|
|||
return $this->{$method}(...$params);
|
||||
}
|
||||
|
||||
/**
|
||||
* @noRector ReturnTypeDeclarationRector
|
||||
*/
|
||||
public function podcastActor(): Response
|
||||
{
|
||||
$podcastActor = new PodcastActor($this->podcast);
|
||||
|
@ -285,9 +282,6 @@ class PodcastController extends BaseController
|
|||
return $cachedView;
|
||||
}
|
||||
|
||||
/**
|
||||
* @noRector ReturnTypeDeclarationRector
|
||||
*/
|
||||
public function episodeCollection(): Response
|
||||
{
|
||||
if ($this->podcast->type === 'serial') {
|
||||
|
|
|
@ -45,7 +45,7 @@ class PostController extends FediversePostController
|
|||
public function _remap(string $method, string ...$params): mixed
|
||||
{
|
||||
if (
|
||||
($podcast = (new PodcastModel())->getPodcastByHandle($params[0],)) === null
|
||||
($podcast = (new PodcastModel())->getPodcastByHandle($params[0])) === null
|
||||
) {
|
||||
throw PageNotFoundException::forPageNotFound();
|
||||
}
|
||||
|
|
|
@ -36,9 +36,6 @@ class Category extends Entity
|
|||
'google_category' => 'string',
|
||||
];
|
||||
|
||||
/**
|
||||
* @noRector ReturnTypeDeclarationRector
|
||||
*/
|
||||
public function getParent(): ?self
|
||||
{
|
||||
if ($this->parent_id === null) {
|
||||
|
|
|
@ -92,9 +92,6 @@ class Credit extends Entity
|
|||
return $this->episode;
|
||||
}
|
||||
|
||||
/**
|
||||
* @noRector ReturnTypeDeclarationRector
|
||||
*/
|
||||
public function getGroupLabel(): string
|
||||
{
|
||||
if ($this->person_group === null) {
|
||||
|
@ -104,9 +101,6 @@ class Credit extends Entity
|
|||
return lang("PersonsTaxonomy.persons.{$this->person_group}.label");
|
||||
}
|
||||
|
||||
/**
|
||||
* @noRector ReturnTypeDeclarationRector
|
||||
*/
|
||||
public function getRoleLabel(): string
|
||||
{
|
||||
if ($this->person_group === '') {
|
||||
|
|
|
@ -450,7 +450,7 @@ class Episode extends Entity
|
|||
public function getEmbedUrl(string $theme = null): string
|
||||
{
|
||||
return $theme
|
||||
? url_to('embed-theme', esc($this->getPodcast()->handle), esc($this->attributes['slug']), $theme,)
|
||||
? url_to('embed-theme', esc($this->getPodcast()->handle), esc($this->attributes['slug']), $theme)
|
||||
: url_to('embed', esc($this->getPodcast()->handle), esc($this->attributes['slug']));
|
||||
}
|
||||
|
||||
|
|
|
@ -87,8 +87,6 @@ class EpisodeComment extends UuidEntity
|
|||
|
||||
/**
|
||||
* Returns the comment's actor
|
||||
*
|
||||
* @noRector ReturnTypeDeclarationRector
|
||||
*/
|
||||
public function getActor(): ?Actor
|
||||
{
|
||||
|
@ -125,9 +123,6 @@ class EpisodeComment extends UuidEntity
|
|||
return $this->getReplies() !== [];
|
||||
}
|
||||
|
||||
/**
|
||||
* @noRector ReturnTypeDeclarationRector
|
||||
*/
|
||||
public function getReplyToComment(): ?self
|
||||
{
|
||||
if ($this->in_reply_to_id === null) {
|
||||
|
|
|
@ -215,9 +215,6 @@ class Podcast extends Entity
|
|||
return '@' . $this->handle;
|
||||
}
|
||||
|
||||
/**
|
||||
* @noRector ReturnTypeDeclarationRector
|
||||
*/
|
||||
public function getActor(): ?Actor
|
||||
{
|
||||
if ($this->actor_id === 0) {
|
||||
|
|
|
@ -61,7 +61,7 @@ if (! function_exists('parse_form_attributes')) {
|
|||
}
|
||||
}
|
||||
|
||||
if (! empty($attributes)) {
|
||||
if ($attributes !== []) {
|
||||
$default = array_merge($default, $attributes);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -239,7 +239,6 @@ if (! function_exists('generate_random_salt')) {
|
|||
|
||||
|
||||
if (! function_exists('file_upload_max_size')) {
|
||||
|
||||
/**
|
||||
* Returns a file size limit in bytes based on the PHP upload_max_filesize and post_max_size Adapted from:
|
||||
* https://stackoverflow.com/a/25370978
|
||||
|
|
|
@ -125,7 +125,7 @@ if (! function_exists('get_rss_feed')) {
|
|||
$castopodSocialElement->addAttribute('accountUrl', $podcast->link);
|
||||
|
||||
foreach ($podcast->social_platforms as $socialPlatform) {
|
||||
$socialElement = $channel->addChild('social', null, $podcastNamespace,);
|
||||
$socialElement = $channel->addChild('social', null, $podcastNamespace);
|
||||
$socialElement->addAttribute('priority', '2');
|
||||
$socialElement->addAttribute('platform', $socialPlatform->slug);
|
||||
|
||||
|
@ -202,7 +202,7 @@ if (! function_exists('get_rss_feed')) {
|
|||
|
||||
foreach ($podcast->persons as $person) {
|
||||
foreach ($person->roles as $role) {
|
||||
$personElement = $channel->addChild('person', $person->full_name, $podcastNamespace,);
|
||||
$personElement = $channel->addChild('person', $person->full_name, $podcastNamespace);
|
||||
|
||||
$personElement->addAttribute('img', $person->avatar->medium_url);
|
||||
|
||||
|
@ -294,7 +294,7 @@ if (! function_exists('get_rss_feed')) {
|
|||
$item->addChild('guid', $episode->guid);
|
||||
$item->addChild('pubDate', $episode->published_at->format(DATE_RFC1123));
|
||||
if ($episode->location !== null) {
|
||||
$locationElement = $item->addChild('location', $episode->location->name, $podcastNamespace,);
|
||||
$locationElement = $item->addChild('location', $episode->location->name, $podcastNamespace);
|
||||
if ($episode->location->geo !== null) {
|
||||
$locationElement->addAttribute('geo', $episode->location->geo);
|
||||
}
|
||||
|
@ -376,11 +376,11 @@ if (! function_exists('get_rss_feed')) {
|
|||
|
||||
foreach ($episode->persons as $person) {
|
||||
foreach ($person->roles as $role) {
|
||||
$personElement = $item->addChild('person', esc($person->full_name), $podcastNamespace,);
|
||||
$personElement = $item->addChild('person', esc($person->full_name), $podcastNamespace);
|
||||
|
||||
$personElement->addAttribute(
|
||||
'role',
|
||||
esc(lang("PersonsTaxonomy.persons.{$role->group}.roles.{$role->role}.label", [], 'en'),),
|
||||
esc(lang("PersonsTaxonomy.persons.{$role->group}.roles.{$role->role}.label", [], 'en')),
|
||||
);
|
||||
|
||||
$personElement->addAttribute(
|
||||
|
|
|
@ -30,7 +30,6 @@ class Router extends CodeIgniterRouter
|
|||
*/
|
||||
protected function checkRoutes(string $uri): bool
|
||||
{
|
||||
/** @noRector RemoveExtraParametersRector */
|
||||
$routes = $this->collection->getRoutes($this->collection->getHTTPVerb());
|
||||
|
||||
// Don't waste any time
|
||||
|
|
|
@ -86,7 +86,6 @@ class TranscriptParser
|
|||
}
|
||||
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -70,7 +70,6 @@ class Vite
|
|||
if (array_key_exists('imports', $manifestElement)) {
|
||||
foreach ($manifestElement['imports'] as $importPath) {
|
||||
if (array_key_exists($importPath, $this->manifestData)) {
|
||||
|
||||
// import css dependencies if any
|
||||
if (array_key_exists('css', $this->manifestData[$importPath])) {
|
||||
foreach ($this->manifestData[$importPath]['css'] as $cssFile) {
|
||||
|
@ -98,11 +97,11 @@ class Vite
|
|||
'css' => <<<CODE_SAMPLE
|
||||
<link rel="stylesheet" href="{$assetUrl}"/>
|
||||
CODE_SAMPLE
|
||||
,
|
||||
,
|
||||
'js' => <<<CODE_SAMPLE
|
||||
<script type="module" src="{$assetUrl}"></script>
|
||||
CODE_SAMPLE
|
||||
,
|
||||
,
|
||||
default => '',
|
||||
};
|
||||
}
|
||||
|
|
|
@ -53,9 +53,6 @@ class ClipModel extends Model
|
|||
'job_ended_at',
|
||||
];
|
||||
|
||||
/**
|
||||
* @noRector
|
||||
*/
|
||||
protected $returnType = BaseClip::class;
|
||||
|
||||
/**
|
||||
|
|
|
@ -195,8 +195,6 @@ class EpisodeCommentModel extends UuidModel
|
|||
* Retrieves all published posts for a given episode ordered by publication date
|
||||
*
|
||||
* @return EpisodeComment[]
|
||||
*
|
||||
* @noRector ReturnTypeDeclarationRector
|
||||
*/
|
||||
public function getEpisodeComments(int $episodeId): array
|
||||
{
|
||||
|
|
|
@ -28,9 +28,6 @@ class MediaModel extends Model
|
|||
*/
|
||||
protected $table = 'media';
|
||||
|
||||
/**
|
||||
* @noRector
|
||||
*/
|
||||
protected $returnType = Document::class;
|
||||
|
||||
/**
|
||||
|
@ -135,8 +132,6 @@ class MediaModel extends Model
|
|||
|
||||
/**
|
||||
* @param Document|Audio|Video|Image|Transcript|Chapters $media
|
||||
*
|
||||
* @noRector ReturnTypeDeclarationRector
|
||||
*/
|
||||
public function saveMedia(object $media): int | false
|
||||
{
|
||||
|
@ -150,8 +145,6 @@ class MediaModel extends Model
|
|||
|
||||
/**
|
||||
* @param Document|Audio|Video|Image|Transcript|Chapters $media
|
||||
*
|
||||
* @noRector ReturnTypeDeclarationRector
|
||||
*/
|
||||
public function updateMedia(object $media): bool
|
||||
{
|
||||
|
|
|
@ -310,8 +310,8 @@ $error_id = uniqid('error', true); ?>
|
|||
<!-- Response -->
|
||||
<?php
|
||||
$response = \Config\Services::response();
|
||||
$response->setStatusCode(http_response_code());
|
||||
?>
|
||||
$response->setStatusCode(http_response_code());
|
||||
?>
|
||||
<div class="content" id="response">
|
||||
<table>
|
||||
<tr>
|
||||
|
|
|
@ -12,17 +12,17 @@ $pager->setSurroundCount(2);
|
|||
<li>
|
||||
<a href="<?= $pager->getFirst() ?>" aria-label="<?= lang(
|
||||
'Pager.first',
|
||||
) ?>" class="block px-3 py-2 text-skin-muted hover:bg-highlight">
|
||||
) ?>" class="block px-3 py-2 text-skin-muted hover:bg-highlight">
|
||||
<span aria-hidden="true"><?= lang('Pager.first') ?></span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="<?= $pager->getPreviousPage() ?>" aria-label="<?= lang(
|
||||
'Pager.previous',
|
||||
) ?>" class="block px-3 py-2 text-skin-muted hover:bg-highlight">
|
||||
) ?>" class="block px-3 py-2 text-skin-muted hover:bg-highlight">
|
||||
<span aria-hidden="true"><?= lang(
|
||||
'Pager.previous',
|
||||
) ?></span>
|
||||
) ?></span>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
|
@ -34,9 +34,7 @@ $pager->setSurroundCount(2);
|
|||
<?= $link['title'] ?>
|
||||
</span>
|
||||
<?php else: ?>
|
||||
<a href="<?= $link[
|
||||
'uri'
|
||||
] ?>" class="block px-4 py-2 rounded-full text-skin-muted hover:bg-highlight">
|
||||
<a href="<?= $link['uri'] ?>" class="block px-4 py-2 rounded-full text-skin-muted hover:bg-highlight">
|
||||
<?= $link['title'] ?>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
|
|
|
@ -89,7 +89,7 @@ class PodcastPlatformController extends BaseController
|
|||
array_key_exists('visible', $podcastPlatform) &&
|
||||
$podcastPlatform['visible'] === 'yes',
|
||||
'is_on_embed' =>
|
||||
array_key_exists('on_embed', $podcastPlatform,) && $podcastPlatform['on_embed'] === 'yes',
|
||||
array_key_exists('on_embed', $podcastPlatform) && $podcastPlatform['on_embed'] === 'yes',
|
||||
];
|
||||
}
|
||||
|
||||
|
|
|
@ -47,7 +47,6 @@ class SchedulerController extends Controller
|
|||
// Loop through clips to generate them
|
||||
foreach ($scheduledClips as $scheduledClip) {
|
||||
try {
|
||||
|
||||
// set clip to pending
|
||||
(new ClipModel())
|
||||
->update($scheduledClip->id, [
|
||||
|
|
|
@ -117,7 +117,7 @@ class SoundbiteController extends BaseController
|
|||
$newSoundbite = new Soundbite([
|
||||
'title' => $this->request->getPost('title'),
|
||||
'start_time' => (float) $this->request->getPost('start_time'),
|
||||
'duration' => (float) $this->request->getPost('duration',),
|
||||
'duration' => (float) $this->request->getPost('duration'),
|
||||
'type' => 'audio',
|
||||
'status' => '',
|
||||
'podcast_id' => $this->podcast->id,
|
||||
|
|
|
@ -165,7 +165,7 @@ class VideoClipsController extends BaseController
|
|||
$videoClip = new VideoClip([
|
||||
'title' => $this->request->getPost('title'),
|
||||
'start_time' => (float) $this->request->getPost('start_time'),
|
||||
'duration' => (float) $this->request->getPost('duration',),
|
||||
'duration' => (float) $this->request->getPost('duration'),
|
||||
'theme' => $theme,
|
||||
'format' => $this->request->getPost('format'),
|
||||
'type' => 'video',
|
||||
|
|
|
@ -57,8 +57,8 @@ $routes->group('', [
|
|||
/**
|
||||
* @deprecated Route for podcast audio file analytics (/audio/pack(podcast_id,episode_id,bytes_threshold,filesize,duration,date)/podcast_folder/filename.mp3)
|
||||
*/
|
||||
$routes->head('audio/(:base64)/(:any)', 'EpisodeAnalyticsController::hit/$1/$2',);
|
||||
$routes->get('audio/(:base64)/(:any)', 'EpisodeAnalyticsController::hit/$1/$2',);
|
||||
$routes->head('audio/(:base64)/(:any)', 'EpisodeAnalyticsController::hit/$1/$2');
|
||||
$routes->get('audio/(:base64)/(:any)', 'EpisodeAnalyticsController::hit/$1/$2');
|
||||
});
|
||||
|
||||
// Show the Unknown UserAgents
|
||||
|
|
|
@ -39,9 +39,6 @@ class AnalyticsPodcastsByCountry extends Entity
|
|||
'hits' => 'integer',
|
||||
];
|
||||
|
||||
/**
|
||||
* @noRector ReturnTypeDeclarationRector
|
||||
*/
|
||||
public function getLabels(): string
|
||||
{
|
||||
return lang('Countries.' . $this->attributes['labels']);
|
||||
|
|
|
@ -44,9 +44,6 @@ class AnalyticsPodcastsByRegion extends Entity
|
|||
'hits' => 'integer',
|
||||
];
|
||||
|
||||
/**
|
||||
* @noRector ReturnTypeDeclarationRector
|
||||
*/
|
||||
public function getCountryCode(): string
|
||||
{
|
||||
return lang('Countries.' . $this->attributes['country_code']);
|
||||
|
|
|
@ -15,9 +15,6 @@ use CodeIgniter\HTTP\Response;
|
|||
|
||||
class ActivityPubController extends Controller
|
||||
{
|
||||
/**
|
||||
* @noRector ReturnTypeDeclarationRector
|
||||
*/
|
||||
public function preflight(): Response
|
||||
{
|
||||
return $this->response->setHeader('Access-Control-Allow-Origin', '*') // for allowing any domain, insecure
|
||||
|
|
|
@ -56,9 +56,6 @@ class ActorController extends Controller
|
|||
return $this->{$method}(...$params);
|
||||
}
|
||||
|
||||
/**
|
||||
* @noRector ReturnTypeDeclarationRector
|
||||
*/
|
||||
public function index(): ResponseInterface
|
||||
{
|
||||
$actorObjectClass = $this->config->actorObject;
|
||||
|
@ -71,8 +68,6 @@ class ActorController extends Controller
|
|||
|
||||
/**
|
||||
* Handles incoming requests from fediverse servers
|
||||
*
|
||||
* @noRector ReturnTypeDeclarationRector
|
||||
*/
|
||||
public function inbox(): ResponseInterface
|
||||
{
|
||||
|
@ -264,9 +259,6 @@ class ActorController extends Controller
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @noRector ReturnTypeDeclarationRector
|
||||
*/
|
||||
public function outbox(): ResponseInterface
|
||||
{
|
||||
// get published activities by publication date
|
||||
|
@ -297,9 +289,6 @@ class ActorController extends Controller
|
|||
->setBody($collection->toJSON());
|
||||
}
|
||||
|
||||
/**
|
||||
* @noRector ReturnTypeDeclarationRector
|
||||
*/
|
||||
public function followers(): ResponseInterface
|
||||
{
|
||||
$tablesPrefix = config('Fediverse')
|
||||
|
@ -386,9 +375,6 @@ class ActorController extends Controller
|
|||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @noRector ReturnTypeDeclarationRector
|
||||
*/
|
||||
public function activity(string $activityId): ResponseInterface
|
||||
{
|
||||
if (
|
||||
|
|
|
@ -53,9 +53,6 @@ class PostController extends Controller
|
|||
return $this->{$method}(...$params);
|
||||
}
|
||||
|
||||
/**
|
||||
* @noRector ReturnTypeDeclarationRector
|
||||
*/
|
||||
public function index(): Response
|
||||
{
|
||||
$noteObjectClass = $this->config->noteObject;
|
||||
|
@ -66,9 +63,6 @@ class PostController extends Controller
|
|||
->setBody($noteObject->toJSON());
|
||||
}
|
||||
|
||||
/**
|
||||
* @noRector ReturnTypeDeclarationRector
|
||||
*/
|
||||
public function replies(): Response
|
||||
{
|
||||
/**
|
||||
|
|
|
@ -539,7 +539,7 @@ class PostModel extends BaseUuidModel
|
|||
->first();
|
||||
|
||||
$announceActivity = new AnnounceActivity($reblogPost);
|
||||
$announceActivity->set('id', url_to('activity', $reblogPost->actor->username, $activity->id),);
|
||||
$announceActivity->set('id', url_to('activity', $reblogPost->actor->username, $activity->id));
|
||||
|
||||
$undoActivity
|
||||
->set('actor', $reblogPost->actor->uri)
|
||||
|
|
|
@ -115,19 +115,13 @@ class InstallController extends Controller
|
|||
}
|
||||
|
||||
try {
|
||||
$db = db_connect();
|
||||
|
||||
// Check if instance owner has been created, meaning install was completed
|
||||
if (
|
||||
$db->tableExists('users') &&
|
||||
(new UserModel())->where('is_owner', true)
|
||||
if ((new UserModel())->where('is_owner', true)
|
||||
->first() !== null
|
||||
) {
|
||||
// if so, show a 404 page
|
||||
throw PageNotFoundException::forPageNotFound();
|
||||
}
|
||||
|
||||
/** @noRector */
|
||||
} catch (DatabaseException) {
|
||||
// Could not connect to the database
|
||||
// show database config view to fix value
|
||||
|
|
|
@ -42,9 +42,6 @@ class SubscriptionModel extends Model
|
|||
'updated_by',
|
||||
];
|
||||
|
||||
/**
|
||||
* @noRector
|
||||
*/
|
||||
protected $returnType = Subscription::class;
|
||||
|
||||
/**
|
||||
|
|
|
@ -20,7 +20,6 @@ class WebSubController extends Controller
|
|||
{
|
||||
public function publish(): void
|
||||
{
|
||||
/** @noRector RemoveAlwaysTrueIfConditionRector */
|
||||
if (ENVIRONMENT !== 'production') {
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -46,12 +46,9 @@ class PodcastTest extends CIUnitTestCase
|
|||
|
||||
private readonly string $podcastApiUrl;
|
||||
|
||||
/**
|
||||
* @param array<mixed> $data
|
||||
*/
|
||||
public function __construct(?string $name = null, array $data = [], $dataName = '')
|
||||
public function __construct(?string $name = null)
|
||||
{
|
||||
parent::__construct($name, $data, $dataName);
|
||||
parent::__construct($name);
|
||||
$this->podcast = FakeSinglePodcastApiSeeder::podcast();
|
||||
$this->podcast['created_at'] = [];
|
||||
$this->podcast['updated_at'] = [];
|
||||
|
|
|
@ -9,12 +9,12 @@ $userPodcasts = get_podcasts_user_can_interact_with(auth()->user()); ?>
|
|||
<div class="inline-flex items-center h-full">
|
||||
<a href="<?= route_to(
|
||||
'admin',
|
||||
) ?>" class="inline-flex items-center h-full px-2 border-r border-navigation focus:ring-inset focus:ring-accent">
|
||||
) ?>" class="inline-flex items-center h-full px-2 border-r border-navigation focus:ring-inset focus:ring-accent">
|
||||
<?= (isset($podcast) ? icon('arrow-left', 'mr-2') : '') . svg('castopod-logo-base', 'h-6') ?>
|
||||
</a>
|
||||
<a href="<?= route_to(
|
||||
'home',
|
||||
) ?>" class="inline-flex items-center h-full px-6 text-sm font-semibold hover:underline focus:ring-inset focus:ring-accent">
|
||||
) ?>" class="inline-flex items-center h-full px-6 text-sm font-semibold hover:underline focus:ring-inset focus:ring-accent">
|
||||
<?= lang('Navigation.go_to_website') ?>
|
||||
<?= icon('external-link', 'ml-1 opacity-60') ?>
|
||||
</a>
|
||||
|
@ -29,16 +29,16 @@ $userPodcasts = get_podcasts_user_can_interact_with(auth()->user()); ?>
|
|||
<?php
|
||||
$notificationsTitle = lang('Notifications.title');
|
||||
|
||||
$items = [
|
||||
$items = [
|
||||
[
|
||||
'type' => 'html',
|
||||
'content' => esc(<<<CODE_SAMPLE
|
||||
<span class="px-4 my-2 text-xs font-semibold tracking-wider uppercase text-skin-muted">{$notificationsTitle}</span>
|
||||
CODE_SAMPLE),
|
||||
],
|
||||
];
|
||||
];
|
||||
|
||||
if ($userPodcasts !== []) {
|
||||
if ($userPodcasts !== []) {
|
||||
foreach ($userPodcasts as $userPodcast) {
|
||||
$userPodcastTitle = esc($userPodcast->title);
|
||||
|
||||
|
@ -59,7 +59,7 @@ $userPodcasts = get_podcasts_user_can_interact_with(auth()->user()); ?>
|
|||
'uri' => route_to('notification-list', $userPodcast->id),
|
||||
];
|
||||
}
|
||||
} else {
|
||||
} else {
|
||||
$noNotificationsText = lang('Notifications.no_notifications');
|
||||
$items[] = [
|
||||
'type' => 'html',
|
||||
|
@ -67,8 +67,8 @@ $userPodcasts = get_podcasts_user_can_interact_with(auth()->user()); ?>
|
|||
<span class="mx-4 my-2 text-sm italic text-center text-skin-muted">{$noNotificationsText}</span>
|
||||
CODE_SAMPLE),
|
||||
];
|
||||
}
|
||||
?>
|
||||
}
|
||||
?>
|
||||
<DropdownMenu id="notifications-dropdown-menu" labelledby="notifications-dropdown" items="<?= esc(json_encode($items)) ?>" placement="bottom"/>
|
||||
|
||||
<button
|
||||
|
@ -86,8 +86,8 @@ $userPodcasts = get_podcasts_user_can_interact_with(auth()->user()); ?>
|
|||
<?= icon('caret-down', 'ml-auto text-2xl') ?></button>
|
||||
</div>
|
||||
<?php
|
||||
$interactButtons = '';
|
||||
foreach ($userPodcasts as $userPodcast) {
|
||||
$interactButtons = '';
|
||||
foreach ($userPodcasts as $userPodcast) {
|
||||
$checkMark = interact_as_actor_id() === $userPodcast->actor_id ? icon('check', 'ml-2 bg-accent-base text-accent-contrast rounded-full') : '';
|
||||
$userPodcastTitle = esc($userPodcast->title);
|
||||
|
||||
|
@ -96,13 +96,13 @@ $userPodcasts = get_podcasts_user_can_interact_with(auth()->user()); ?>
|
|||
<div class="inline-flex items-center flex-1 text-sm"><img src="{$userPodcast->cover->tiny_url}" class="w-6 h-6 mr-2 rounded-full" loading="lazy" /><span class="max-w-xs truncate">{$userPodcastTitle}</span>{$checkMark}</div>
|
||||
</button>
|
||||
CODE_SAMPLE;
|
||||
}
|
||||
}
|
||||
|
||||
$interactAsText = lang('Common.choose_interact');
|
||||
$interactAsRoute = route_to('interact-as-actor');
|
||||
$csrfField = csrf_field();
|
||||
$interactAsText = lang('Common.choose_interact');
|
||||
$interactAsRoute = route_to('interact-as-actor');
|
||||
$csrfField = csrf_field();
|
||||
|
||||
$menuItems = [
|
||||
$menuItems = [
|
||||
[
|
||||
'type' => 'link',
|
||||
'title' => lang('Navigation.account.my-account'),
|
||||
|
@ -121,9 +121,9 @@ $userPodcasts = get_podcasts_user_can_interact_with(auth()->user()); ?>
|
|||
'title' => lang('Navigation.account.logout'),
|
||||
'uri' => route_to('logout'),
|
||||
],
|
||||
];
|
||||
];
|
||||
|
||||
if ($userPodcasts !== []) {
|
||||
if ($userPodcasts !== []) {
|
||||
$menuItems = array_merge([
|
||||
[
|
||||
'type' => 'html',
|
||||
|
@ -141,7 +141,7 @@ $userPodcasts = get_podcasts_user_can_interact_with(auth()->user()); ?>
|
|||
'type' => 'separator',
|
||||
],
|
||||
], $menuItems);
|
||||
}
|
||||
?>
|
||||
}
|
||||
?>
|
||||
<DropdownMenu id="my-account-dropdown-menu" labelledby="my-account-dropdown" items="<?= esc(json_encode($menuItems)) ?>" />
|
||||
</header>
|
|
@ -53,14 +53,14 @@
|
|||
'type' => 'separator',
|
||||
],
|
||||
];
|
||||
if ($episode->published_at === null) {
|
||||
if ($episode->published_at === null) {
|
||||
$items[] = [
|
||||
'type' => 'link',
|
||||
'title' => lang('Episode.delete'),
|
||||
'uri' => route_to('episode-delete', $episode->podcast->id, $episode->id),
|
||||
'class' => 'font-semibold text-red-600',
|
||||
];
|
||||
} else {
|
||||
} else {
|
||||
$label = lang('Episode.delete');
|
||||
$icon = icon('forbid', 'mr-2');
|
||||
$title = lang('Episode.messages.unpublishBeforeDeleteTip');
|
||||
|
@ -70,6 +70,6 @@
|
|||
<span class="inline-flex items-center px-4 py-1 font-semibold text-gray-400 cursor-not-allowed" data-tooltip="bottom" title="{$title}">{$icon}{$label}</span>
|
||||
CODE_SAMPLE),
|
||||
];
|
||||
} ?>
|
||||
} ?>
|
||||
<DropdownMenu id="more-dropdown-<?= $episode->id ?>-menu" labelledby="more-dropdown-<?= $episode->id ?>" offsetY="-32" items="<?= esc(json_encode($items)) ?>" />
|
||||
</article>
|
|
@ -37,9 +37,9 @@ $podcastNavigation = [
|
|||
'episode',
|
||||
esc($podcast->handle),
|
||||
esc($episode->slug),
|
||||
) ?>" class="inline-flex items-center text-xs hover:underline focus:ring-accent"><?= lang(
|
||||
) ?>" class="inline-flex items-center text-xs hover:underline focus:ring-accent"><?= lang(
|
||||
'EpisodeNavigation.go_to_page',
|
||||
) ?>
|
||||
) ?>
|
||||
<?= icon('external-link', 'ml-1 opacity-60') ?>
|
||||
</a>
|
||||
</div>
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
name="cover"
|
||||
label="<?= lang('Episode.form.cover') ?>"
|
||||
hint="<?= lang('Episode.form.cover_hint') ?>"
|
||||
helper="<?= lang('Episode.form.cover_size_hint', ) ?>"
|
||||
helper="<?= lang('Episode.form.cover_size_hint') ?>"
|
||||
type="file"
|
||||
accept=".jpg,.jpeg,.png" />
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@
|
|||
'PodcastByEpisode',
|
||||
'ByDay',
|
||||
$episode->id,
|
||||
) ?>"/>
|
||||
) ?>"/>
|
||||
|
||||
<Charts.XY title="<?= lang('Charts.episode_by_month') ?>" dataUrl="<?= route_to(
|
||||
'analytics-filtered-data',
|
||||
|
@ -54,7 +54,7 @@
|
|||
'PodcastByEpisode',
|
||||
'ByMonth',
|
||||
$episode->id,
|
||||
) ?>"/>
|
||||
) ?>"/>
|
||||
</div>
|
||||
|
||||
|
||||
|
|
|
@ -60,10 +60,10 @@ $counts = [
|
|||
<a href="<?= route_to(
|
||||
'podcast-activity',
|
||||
esc($podcast->handle),
|
||||
) ?>" class="inline-flex items-center text-sm hover:underline focus:ring-accent"
|
||||
) ?>" class="inline-flex items-center text-sm hover:underline focus:ring-accent"
|
||||
data-tooltip="bottom" title="<?= lang(
|
||||
'PodcastNavigation.go_to_page',
|
||||
) ?>">@<?= esc($podcast->handle) ?>
|
||||
) ?>">@<?= esc($podcast->handle) ?>
|
||||
<?= icon('external-link', 'ml-1 opacity-60') ?>
|
||||
</a>
|
||||
</div>
|
||||
|
|
|
@ -16,21 +16,21 @@
|
|||
$podcast->id,
|
||||
'Podcast',
|
||||
'ByDay',
|
||||
) ?>"/>
|
||||
) ?>"/>
|
||||
|
||||
<Charts.XY class="col-span-1" title="<?= lang('Charts.podcast_by_month') ?>" dataUrl="<?= route_to(
|
||||
'analytics-data',
|
||||
$podcast->id,
|
||||
'Podcast',
|
||||
'ByMonth',
|
||||
) ?>"/>
|
||||
) ?>"/>
|
||||
|
||||
<Charts.XY class="col-span-1" title="<?= lang('Charts.podcast_by_bandwidth') ?>" dataUrl="<?= route_to(
|
||||
'analytics-data',
|
||||
$podcast->id,
|
||||
'Podcast',
|
||||
'BandwidthByDay',
|
||||
) ?>"/>
|
||||
) ?>"/>
|
||||
</div>
|
||||
|
||||
<?= service('vite')
|
||||
|
|
|
@ -16,14 +16,14 @@
|
|||
$podcast->id,
|
||||
'Podcast',
|
||||
'TotalListeningTimeByDay',
|
||||
) ?>"/>
|
||||
) ?>"/>
|
||||
|
||||
<Charts.XY class="col-span-1" title="<?= lang('Charts.monthly_listening_time') ?>" dataUrl="<?= route_to(
|
||||
'analytics-data',
|
||||
$podcast->id,
|
||||
'Podcast',
|
||||
'TotalListeningTimeByMonth',
|
||||
) ?>"/>
|
||||
) ?>"/>
|
||||
</div>
|
||||
|
||||
<?= service('vite')
|
||||
|
|
|
@ -16,18 +16,18 @@
|
|||
$podcast->id,
|
||||
'PodcastByCountry',
|
||||
'Weekly',
|
||||
) ?>" />
|
||||
) ?>" />
|
||||
<Charts.Pie title="<?= lang('Charts.by_country_yearly') ?>" dataUrl="<?= route_to(
|
||||
'analytics-data',
|
||||
$podcast->id,
|
||||
'PodcastByCountry',
|
||||
'Yearly',
|
||||
) ?>" />
|
||||
) ?>" />
|
||||
<Charts.Map class="col-span-2" title="<?= lang('Charts.podcast_by_region') ?>" dataUrl="<?= route_to(
|
||||
'analytics-full-data',
|
||||
$podcast->id,
|
||||
'PodcastByRegion',
|
||||
) ?>" />
|
||||
) ?>" />
|
||||
</div>
|
||||
|
||||
|
||||
|
|
|
@ -16,31 +16,31 @@
|
|||
$podcast->id,
|
||||
'PodcastByPlayer',
|
||||
'ByAppWeekly',
|
||||
) ?>" />
|
||||
) ?>" />
|
||||
<Charts.Pie title="<?= lang('Charts.by_service_weekly') ?>" dataUrl="<?= route_to(
|
||||
'analytics-data',
|
||||
$podcast->id,
|
||||
'PodcastByService',
|
||||
'ByServiceWeekly',
|
||||
) ?>" />
|
||||
) ?>" />
|
||||
<Charts.Pie title="<?= lang('Charts.by_device_weekly') ?>" dataUrl="<?= route_to(
|
||||
'analytics-data',
|
||||
$podcast->id,
|
||||
'PodcastByPlayer',
|
||||
'ByDeviceWeekly',
|
||||
) ?>" />
|
||||
) ?>" />
|
||||
<Charts.Pie title="<?= lang('Charts.by_os_weekly') ?>" dataUrl="<?= route_to(
|
||||
'analytics-data',
|
||||
$podcast->id,
|
||||
'PodcastByPlayer',
|
||||
'ByOsWeekly',
|
||||
) ?>" />
|
||||
) ?>" />
|
||||
<Charts.XY class="col-span-2" title="<?= lang('Charts.podcast_bots') ?>" dataUrl="<?= route_to(
|
||||
'analytics-data',
|
||||
$podcast->id,
|
||||
'PodcastByPlayer',
|
||||
'Bots',
|
||||
) ?>" />
|
||||
) ?>" />
|
||||
</div>
|
||||
|
||||
<?= service('vite')
|
||||
|
|
|
@ -16,12 +16,12 @@
|
|||
$podcast->id,
|
||||
'Podcast',
|
||||
'ByWeekday',
|
||||
) ?>" />
|
||||
) ?>" />
|
||||
<Charts.Bar title="<?= lang('Charts.by_hour') ?>" dataUrl="<?= route_to(
|
||||
'analytics-full-data',
|
||||
$podcast->id,
|
||||
'PodcastByHour',
|
||||
) ?>" />
|
||||
) ?>" />
|
||||
</div>
|
||||
|
||||
<?= service('vite')
|
||||
|
|
|
@ -16,14 +16,14 @@
|
|||
$podcast->id,
|
||||
'Podcast',
|
||||
'UniqueListenersByDay',
|
||||
) ?>"/>
|
||||
) ?>"/>
|
||||
|
||||
<Charts.XY class="col-span-1" title="<?= lang('Charts.unique_monthly_listeners') ?>" dataUrl="<?= route_to(
|
||||
'analytics-data',
|
||||
$podcast->id,
|
||||
'Podcast',
|
||||
'UniqueListenersByMonth',
|
||||
) ?>"/>
|
||||
) ?>"/>
|
||||
</div>
|
||||
|
||||
<?= service('vite')
|
||||
|
|
|
@ -16,23 +16,23 @@
|
|||
$podcast->id,
|
||||
'WebsiteByReferer',
|
||||
'ByDomainWeekly',
|
||||
) ?>" />
|
||||
) ?>" />
|
||||
<Charts.Pie title="<?= lang('Charts.by_domain_yearly') ?>" dataUrl="<?= route_to(
|
||||
'analytics-data',
|
||||
$podcast->id,
|
||||
'WebsiteByReferer',
|
||||
'ByDomainYearly',
|
||||
) ?>" />
|
||||
) ?>" />
|
||||
<Charts.Pie title="<?= lang('Charts.by_entry_page') ?>" dataUrl="<?= route_to(
|
||||
'analytics-full-data',
|
||||
$podcast->id,
|
||||
'WebsiteByEntryPage',
|
||||
) ?>" />
|
||||
) ?>" />
|
||||
<Charts.Pie title="<?= lang('Charts.by_browser') ?>" dataUrl="<?= route_to(
|
||||
'analytics-full-data',
|
||||
$podcast->id,
|
||||
'WebsiteByBrowser',
|
||||
) ?>" />
|
||||
) ?>" />
|
||||
</div>
|
||||
|
||||
|
||||
|
|
|
@ -111,11 +111,11 @@
|
|||
<Forms.RadioButton
|
||||
value="clean"
|
||||
name="parental_advisory"
|
||||
isChecked="false" ><?= lang('Podcast.form.parental_advisory.clean', ) ?></Forms.RadioButton>
|
||||
isChecked="false" ><?= lang('Podcast.form.parental_advisory.clean') ?></Forms.RadioButton>
|
||||
<Forms.RadioButton
|
||||
value="explicit"
|
||||
name="parental_advisory"
|
||||
isChecked="false" ><?= lang('Podcast.form.parental_advisory.explicit', ) ?></Forms.RadioButton>
|
||||
isChecked="false" ><?= lang('Podcast.form.parental_advisory.explicit') ?></Forms.RadioButton>
|
||||
</div>
|
||||
</fieldset>
|
||||
</Forms.Section>
|
||||
|
|
|
@ -128,11 +128,11 @@
|
|||
<Forms.RadioButton
|
||||
value="clean"
|
||||
name="parental_advisory"
|
||||
isChecked="<?= $podcast->parental_advisory === 'clean' ? 'true' : 'false' ?>" ><?= lang('Podcast.form.parental_advisory.clean', ) ?></Forms.RadioButton>
|
||||
isChecked="<?= $podcast->parental_advisory === 'clean' ? 'true' : 'false' ?>" ><?= lang('Podcast.form.parental_advisory.clean') ?></Forms.RadioButton>
|
||||
<Forms.RadioButton
|
||||
value="explicit"
|
||||
name="parental_advisory"
|
||||
isChecked="<?= $podcast->parental_advisory === 'explicit' ? 'true' : 'false' ?>" ><?= lang('Podcast.form.parental_advisory.explicit', ) ?></Forms.RadioButton>
|
||||
isChecked="<?= $podcast->parental_advisory === 'explicit' ? 'true' : 'false' ?>" ><?= lang('Podcast.form.parental_advisory.explicit') ?></Forms.RadioButton>
|
||||
</div>
|
||||
</fieldset>
|
||||
</Forms.Section>
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<a href="<?= route_to(
|
||||
'episode-list',
|
||||
$podcast->id,
|
||||
) ?>" class="inline-flex items-center text-sm underline hover:no-underline focus:ring-accent">
|
||||
) ?>" class="inline-flex items-center text-sm underline hover:no-underline focus:ring-accent">
|
||||
<?= lang('Podcast.see_all_episodes') ?>
|
||||
<?= icon('chevron-right', 'ml-2') ?>
|
||||
</a>
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
esc($platform->slug),
|
||||
'text-skin-muted text-4xl',
|
||||
$platform->type
|
||||
) ?>
|
||||
) ?>
|
||||
<?php else: ?>
|
||||
<?= anchor(
|
||||
$platform->submit_url,
|
||||
|
@ -44,7 +44,7 @@
|
|||
'platformName' => $platform->label,
|
||||
]),
|
||||
],
|
||||
) ?>
|
||||
) ?>
|
||||
<?php endif; ?>
|
||||
<div class="inline-flex mt-1 bg-highlight">
|
||||
<?= anchor($platform->home_url, icon('external-link', 'mx-auto'), [
|
||||
|
|
|
@ -49,7 +49,7 @@
|
|||
<fieldset class="flex flex-col">
|
||||
<legend class="text-lg font-semibold"><?= lang(
|
||||
'Podcast.publish_form.publication_date',
|
||||
) ?></legend>
|
||||
) ?></legend>
|
||||
<Forms.Radio value="now" name="publication_method" isChecked="<?= old('publication_method') ? old('publish') === 'now' : true ?>"><?= lang('Podcast.publish_form.publication_method.now') ?></Forms.Radio>
|
||||
<div class="inline-flex flex-wrap items-center radio-toggler">
|
||||
<input
|
||||
|
|
|
@ -125,6 +125,6 @@
|
|||
$podcast->subscriptions,
|
||||
'',
|
||||
$podcast,
|
||||
) ?>
|
||||
) ?>
|
||||
|
||||
<?= $this->endSection() ?>
|
||||
|
|
|
@ -7,7 +7,7 @@ $userPodcasts = get_podcasts_user_can_interact_with(auth()->user()); ?>
|
|||
<a href="<?= route_to('home') ?>" class="inline-flex items-center h-full px-2 border-r border-navigation focus:ring-inset focus:ring-accent">
|
||||
<?= svg('castopod-logo-base', 'h-6') ?>
|
||||
</a>
|
||||
<a href="<?= route_to('admin', ) ?>" class="inline-flex items-center h-full px-6 text-sm font-semibold hover:underline focus:ring-inset focus:ring-accent">
|
||||
<a href="<?= route_to('admin') ?>" class="inline-flex items-center h-full px-6 text-sm font-semibold hover:underline focus:ring-inset focus:ring-accent">
|
||||
<?= lang('Navigation.go_to_admin') ?>
|
||||
<?= icon('external-link', 'ml-1 opacity-60') ?>
|
||||
</a>
|
||||
|
@ -23,16 +23,16 @@ $userPodcasts = get_podcasts_user_can_interact_with(auth()->user()); ?>
|
|||
<?php
|
||||
$notificationsTitle = lang('Notifications.title');
|
||||
|
||||
$items = [
|
||||
$items = [
|
||||
[
|
||||
'type' => 'html',
|
||||
'content' => esc(<<<CODE_SAMPLE
|
||||
<span class="px-4 my-2 text-xs font-semibold tracking-wider uppercase text-skin-muted">{$notificationsTitle}</span>
|
||||
CODE_SAMPLE),
|
||||
],
|
||||
];
|
||||
];
|
||||
|
||||
if ($userPodcasts !== []) {
|
||||
if ($userPodcasts !== []) {
|
||||
foreach ($userPodcasts as $userPodcast) {
|
||||
$userPodcastTitle = esc($userPodcast->title);
|
||||
|
||||
|
@ -53,7 +53,7 @@ $userPodcasts = get_podcasts_user_can_interact_with(auth()->user()); ?>
|
|||
'uri' => route_to('notification-list', $userPodcast->id),
|
||||
];
|
||||
}
|
||||
} else {
|
||||
} else {
|
||||
$noNotificationsText = lang('Notifications.no_notifications');
|
||||
$items[] = [
|
||||
'type' => 'html',
|
||||
|
@ -61,8 +61,8 @@ $userPodcasts = get_podcasts_user_can_interact_with(auth()->user()); ?>
|
|||
<span class="mx-4 my-2 text-sm italic text-center text-skin-muted">{$noNotificationsText}</span>
|
||||
CODE_SAMPLE),
|
||||
];
|
||||
}
|
||||
?>
|
||||
}
|
||||
?>
|
||||
<DropdownMenu id="notifications-dropdown-menu" labelledby="notifications-dropdown" items="<?= esc(json_encode($items)) ?>" placement="bottom"/>
|
||||
|
||||
<button
|
||||
|
@ -84,8 +84,8 @@ $userPodcasts = get_podcasts_user_can_interact_with(auth()->user()); ?>
|
|||
<?= esc(auth()->user()->username) ?>
|
||||
<?= icon('caret-down', 'ml-auto text-2xl') ?></button>
|
||||
<?php
|
||||
$interactButtons = '';
|
||||
foreach ($userPodcasts as $userPodcast) {
|
||||
$interactButtons = '';
|
||||
foreach ($userPodcasts as $userPodcast) {
|
||||
if (can_podcast(auth()->user(), $userPodcast->id, 'interact-as')) {
|
||||
$checkMark = interact_as_actor_id() === $userPodcast->actor_id ? icon('check', 'ml-2 bg-accent-base text-accent-contrast rounded-full') : '';
|
||||
$userPodcastTitle = esc($userPodcast->title);
|
||||
|
@ -96,13 +96,13 @@ $userPodcasts = get_podcasts_user_can_interact_with(auth()->user()); ?>
|
|||
</button>
|
||||
CODE_SAMPLE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$interactAsText = lang('Common.choose_interact');
|
||||
$interactAsRoute = route_to('interact-as-actor');
|
||||
$csrfField = csrf_field();
|
||||
$interactAsText = lang('Common.choose_interact');
|
||||
$interactAsRoute = route_to('interact-as-actor');
|
||||
$csrfField = csrf_field();
|
||||
|
||||
$menuItems = [
|
||||
$menuItems = [
|
||||
[
|
||||
'type' => 'link',
|
||||
'title' => lang('Navigation.account.my-account'),
|
||||
|
@ -121,9 +121,9 @@ $userPodcasts = get_podcasts_user_can_interact_with(auth()->user()); ?>
|
|||
'title' => lang('Navigation.account.logout'),
|
||||
'uri' => route_to('logout'),
|
||||
],
|
||||
];
|
||||
];
|
||||
|
||||
if ($userPodcasts !== []) {
|
||||
if ($userPodcasts !== []) {
|
||||
$menuItems = array_merge([
|
||||
[
|
||||
'type' => 'html',
|
||||
|
@ -141,8 +141,8 @@ $userPodcasts = get_podcasts_user_can_interact_with(auth()->user()); ?>
|
|||
'type' => 'separator',
|
||||
],
|
||||
], $menuItems);
|
||||
}
|
||||
?>
|
||||
}
|
||||
?>
|
||||
<DropdownMenu id="my-account-dropdown-menu" labelledby="my-account-dropdown" items="<?= esc(json_encode($menuItems)) ?>" />
|
||||
</div>
|
||||
</div>
|
|
@ -37,7 +37,7 @@
|
|||
'.label',
|
||||
);
|
||||
}, $person->roles),
|
||||
) ?></p>
|
||||
) ?></p>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
|
|
|
@ -98,7 +98,8 @@
|
|||
<?php $i = 0; ?>
|
||||
<?php foreach ($episode->persons as $person): ?>
|
||||
<img src="<?= $person->avatar->thumbnail_url ?>" alt="<?= esc($person->full_name) ?>" class="object-cover w-8 h-8 -ml-4 border-2 rounded-full aspect-square border-background-header last:ml-0" loading="lazy" />
|
||||
<?php $i++; if ($i === 3) {
|
||||
<?php $i++;
|
||||
if ($i === 3) {
|
||||
break;
|
||||
}?>
|
||||
<?php endforeach; ?>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
[
|
||||
'numberOfLikes' => $comment->likes_count,
|
||||
],
|
||||
) ?>"><?= icon('heart', 'text-xl mr-1 text-gray-400 group-hover:text-red-600') . $comment->likes_count ?></button>
|
||||
) ?>"><?= icon('heart', 'text-xl mr-1 text-gray-400 group-hover:text-red-600') . $comment->likes_count ?></button>
|
||||
<Button uri="<?= route_to('episode-comment', esc($comment->episode->podcast->handle), esc($comment->episode->slug), $comment->id) ?>" size="small"><?= lang('Comment.reply') ?></Button>
|
||||
</form>
|
||||
<?php if ($comment->replies_count): ?>
|
||||
|
@ -19,7 +19,7 @@
|
|||
[
|
||||
'class' => 'inline-flex items-center text-xs hover:underline',
|
||||
]
|
||||
) ?>
|
||||
) ?>
|
||||
<?php endif; ?>
|
||||
<?php else: ?>
|
||||
<button class="inline-flex items-center opacity-50 cursor-not-allowed hover:underline" title="<?= lang(
|
||||
|
@ -27,7 +27,7 @@
|
|||
[
|
||||
'numberOfLikes' => $comment->likes_count,
|
||||
],
|
||||
) ?>"><?= icon('heart', 'text-xl mr-1 text-skin-muted') . $comment->likes_count ?></button>
|
||||
) ?>"><?= icon('heart', 'text-xl mr-1 text-skin-muted') . $comment->likes_count ?></button>
|
||||
<?php if ($comment->replies_count): ?>
|
||||
<?= anchor(
|
||||
route_to('episode-comment', esc($comment->episode->podcast->handle), esc($comment->episode->slug), $comment->id),
|
||||
|
@ -37,7 +37,7 @@
|
|||
[
|
||||
'class' => 'inline-flex items-center text-xs hover:underline',
|
||||
]
|
||||
) ?>
|
||||
) ?>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
</footer>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
[
|
||||
'numberOfLikes' => $comment->likes_count,
|
||||
],
|
||||
) ?>"><?= icon('heart', 'text-xl mr-1 text-gray-400 group-hover:text-red-600') . $comment->likes_count ?></button>
|
||||
) ?>"><?= icon('heart', 'text-xl mr-1 text-gray-400 group-hover:text-red-600') . $comment->likes_count ?></button>
|
||||
<Button uri="<?= route_to('post', esc($podcast->handle), $comment->id) ?>" size="small"><?= lang('Comment.reply') ?></Button>
|
||||
</form>
|
||||
<?php if ($comment->replies_count): ?>
|
||||
|
@ -19,7 +19,7 @@
|
|||
[
|
||||
'class' => 'inline-flex items-center text-xs hover:underline',
|
||||
]
|
||||
) ?>
|
||||
) ?>
|
||||
<?php endif; ?>
|
||||
<?php else: ?>
|
||||
<?= anchor_popup(
|
||||
|
@ -33,7 +33,7 @@
|
|||
'numberOfFavourites' => $comment->likes_count,
|
||||
]),
|
||||
],
|
||||
) ?>
|
||||
) ?>
|
||||
<?php if ($comment->replies_count): ?>
|
||||
<?= anchor(
|
||||
route_to('post', esc($podcast->handle), $comment->id),
|
||||
|
@ -43,7 +43,7 @@
|
|||
[
|
||||
'class' => 'inline-flex items-center text-xs hover:underline',
|
||||
]
|
||||
) ?>
|
||||
) ?>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
</footer>
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
[
|
||||
'numberOfLikes' => $reply->likes_count,
|
||||
],
|
||||
) ?>"><?= icon('heart', 'text-lg mr-1 text-gray-400 group-hover:text-red-600') . $reply->likes_count ?></button>
|
||||
) ?>"><?= icon('heart', 'text-lg mr-1 text-gray-400 group-hover:text-red-600') . $reply->likes_count ?></button>
|
||||
<Button uri="<?= route_to('episode-comment', esc($reply->episode->podcast->handle), esc($reply->episode->slug), $reply->id) ?>" size="small"><?= lang('Comment.reply') ?></Button>
|
||||
</form>
|
||||
<?php else: ?>
|
||||
|
@ -17,7 +17,7 @@
|
|||
[
|
||||
'numberOfLikes' => $reply->likes_count,
|
||||
],
|
||||
) ?>"><?= icon('heart', 'text-lg mr-1 text-skin-muted') . $reply->likes_count ?></button>
|
||||
) ?>"><?= icon('heart', 'text-lg mr-1 text-skin-muted') . $reply->likes_count ?></button>
|
||||
<?php if ($reply->replies_count): ?>
|
||||
<?= anchor(
|
||||
route_to('episode-comment', esc($reply->episode->podcast->handle), esc($reply->episode->slug), $reply->id),
|
||||
|
@ -28,7 +28,7 @@
|
|||
'numberOfReplies' => $reply->replies_count,
|
||||
]),
|
||||
],
|
||||
) ?>
|
||||
) ?>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
</footer>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
class="inline-flex items-center px-4 py-2 text-sm focus:ring-accent"><?= icon(
|
||||
'arrow-left',
|
||||
'mr-2 text-lg',
|
||||
) . lang('Comment.back_to_comments') ?></a>
|
||||
) . lang('Comment.back_to_comments') ?></a>
|
||||
</nav>
|
||||
<div class="pb-12">
|
||||
<?= $this->include('episode/_partials/comment_with_replies') ?>
|
||||
|
|
|
@ -22,9 +22,10 @@
|
|||
<?php $i = 0; ?>
|
||||
<?php foreach ($podcast->persons as $person): ?>
|
||||
<img src="<?= $person->avatar->thumbnail_url ?>" alt="<?= esc($person->full_name) ?>" class="object-cover w-8 -ml-4 border-2 rounded-full aspect-square bg-header border-background-base last:ml-0" loading="lazy" />
|
||||
<?php $i++; if ($i === 3) {
|
||||
<?php $i++;
|
||||
if ($i === 3) {
|
||||
break;
|
||||
}?>
|
||||
}?>
|
||||
<?php endforeach; ?>
|
||||
</span>
|
||||
<?= lang('Podcast.persons', [
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
? 'font-semibold'
|
||||
: 'text-skin-muted hover:text-skin-base'),
|
||||
],
|
||||
) ?>
|
||||
) ?>
|
||||
<?php endforeach; ?>
|
||||
</nav>
|
||||
<?php endif; ?>
|
||||
|
|
|
@ -11,13 +11,13 @@
|
|||
'numberOfReplies' => $post->replies_count,
|
||||
]),
|
||||
],
|
||||
) ?>
|
||||
) ?>
|
||||
<button type="submit" name="action" value="reblog" class="inline-flex items-center hover:underline" title="<?= lang(
|
||||
'Post.reblogs',
|
||||
[
|
||||
'numberOfReblogs' => $post->reblogs_count,
|
||||
],
|
||||
) ?>"><?= icon('repeat', 'text-2xl mr-1 opacity-40') .
|
||||
) ?>"><?= icon('repeat', 'text-2xl mr-1 opacity-40') .
|
||||
$post->reblogs_count ?></button>
|
||||
<button type="submit" name="action" value="favourite" class="inline-flex items-center hover:underline" title="<?= lang(
|
||||
'Post.favourites',
|
||||
|
|
|
@ -7,7 +7,7 @@ if ($preview_card->type === 'image'): ?>
|
|||
<?= icon(
|
||||
'external-link',
|
||||
'absolute inset-0 m-auto text-6xl bg-accent-base bg-opacity-50 group-hover:bg-opacity-100 text-accent-contrast rounded-full p-2',
|
||||
) ?>
|
||||
) ?>
|
||||
<img src="<?= $preview_card->image ?>" alt="<?= esc($preview_card->title) ?>" class="object-cover w-full aspect-video" loading="lazy" />
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
@ -23,7 +23,7 @@ if ($preview_card->type === 'image'): ?>
|
|||
<?= icon(
|
||||
'play',
|
||||
'absolute inset-0 m-auto text-6xl bg-accent-base bg-opacity-50 group-hover:bg-opacity-100 text-accent-contrast rounded-full p-2',
|
||||
) ?>
|
||||
) ?>
|
||||
<img class="object-cover w-full aspect-video" src="<?= $preview_card->image ?>" alt="<?= esc($preview_card->title) ?>" loading="lazy" />
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
|
|
@ -2,40 +2,28 @@
|
|||
<p class="inline-flex px-6 pt-4 text-xs text-skin-muted"><?= icon(
|
||||
'repeat',
|
||||
'text-lg mr-2 opacity-40',
|
||||
) .
|
||||
lang('Post.actor_shared', [
|
||||
) . lang('Post.actor_shared', [
|
||||
'actor' => esc($post->actor->display_name),
|
||||
]) ?></p>
|
||||
<header class="flex px-6 py-4 gap-x-2">
|
||||
<img src="<?= $post->actor
|
||||
->avatar_image_url ?>" alt="<?= esc($post->actor->display_name) ?>" class="w-10 h-10 rounded-full aspect-square" loading="lazy" />
|
||||
<img src="<?= $post->actor->avatar_image_url ?>" alt="<?= esc($post->actor->display_name) ?>" class="w-10 h-10 rounded-full aspect-square" loading="lazy" />
|
||||
<div class="flex flex-col min-w-0">
|
||||
<a href="<?= $post->actor
|
||||
->uri ?>" class="flex items-baseline hover:underline" <?= $post
|
||||
->actor->is_local
|
||||
? ''
|
||||
: 'target="_blank" rel="noopener noreferrer"' ?>>
|
||||
<span class="mr-2 font-semibold truncate"><?= esc($post->actor
|
||||
->display_name) ?></span>
|
||||
<span class="text-sm truncate text-skin-muted">@<?= esc($post->actor
|
||||
->username) .
|
||||
($post->actor->is_local
|
||||
? ''
|
||||
: '@' . $post->actor->domain) ?></span>
|
||||
<a href="<?= $post->actor->uri ?>" class="flex items-baseline hover:underline" <?= $post->actor->is_local ? '' : 'target="_blank" rel="noopener noreferrer"' ?>>
|
||||
<span class="mr-2 font-semibold truncate"><?= esc($post->actor->display_name) ?></span>
|
||||
<span class="text-sm truncate text-skin-muted">@<?= esc($post->actor->username) . ($post->actor->is_local ? '' : '@' . $post->actor->domain) ?></span>
|
||||
</a>
|
||||
<a href="<?= route_to('post', esc($podcast->handle), $post->id) ?>"
|
||||
class="text-xs text-skin-muted">
|
||||
<a href="<?= route_to('post', esc($podcast->handle), $post->id) ?>" class="text-xs text-skin-muted">
|
||||
<?= relative_time($post->published_at) ?>
|
||||
</a>
|
||||
</div>
|
||||
</header>
|
||||
<div class="px-6 mb-4 post-content"><?= $post->message_html ?></div>
|
||||
<?php if ($post->episode_id): ?>
|
||||
<?php if ($post->episode_id) : ?>
|
||||
<?= view('episode/_partials/preview_card', [
|
||||
'index' => $index,
|
||||
'episode' => $post->episode,
|
||||
]) ?>
|
||||
<?php elseif ($post->preview_card_id): ?>
|
||||
<?php elseif ($post->preview_card_id) : ?>
|
||||
<?= view('post/_partials/preview_card', [
|
||||
'preview_card' => $post->preview_card,
|
||||
]) ?>
|
||||
|
|
|
@ -13,13 +13,13 @@ if (can_user_interact()): ?>
|
|||
'numberOfReplies' => $reply->replies_count,
|
||||
]),
|
||||
],
|
||||
) ?>
|
||||
) ?>
|
||||
<button type="submit" name="action" value="reblog" class="inline-flex items-center text-sm hover:underline" title="<?= lang(
|
||||
'Post.reblogs',
|
||||
[
|
||||
'numberOfReblogs' => $reply->reblogs_count,
|
||||
],
|
||||
) ?>"><?= icon('repeat', 'text-lg mr-1 opacity-40') .
|
||||
) ?>"><?= icon('repeat', 'text-lg mr-1 opacity-40') .
|
||||
$reply->reblogs_count ?></button>
|
||||
<button type="submit" name="action" value="favourite" class="inline-flex items-center text-sm hover:underline" title="<?= lang(
|
||||
'Post.favourites',
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
class="inline-flex items-center px-4 py-2 text-sm focus:ring-accent"><?= icon(
|
||||
'arrow-left',
|
||||
'mr-2 text-lg',
|
||||
) .
|
||||
) .
|
||||
lang('Post.back_to_actor_posts', [
|
||||
'actor' => esc($post->actor->display_name),
|
||||
]) ?></a>
|
||||
|
|
|
@ -54,9 +54,9 @@
|
|||
<p class="py-4 text-sm text-center">
|
||||
<?= lang(
|
||||
'Auth.haveAccount',
|
||||
) ?> <a class="underline hover:no-underline" href="<?= route_to(
|
||||
) ?> <a class="underline hover:no-underline" href="<?= route_to(
|
||||
'login',
|
||||
) ?>"><?= lang('Auth.login') ?></a>
|
||||
) ?>"><?= lang('Auth.login') ?></a>
|
||||
</p>
|
||||
|
||||
<?= $this->endSection() ?>
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
|
||||
<p class="mt-2 text-sm text-skin-muted"><?= lang(
|
||||
'Install.form.cache_config_hint',
|
||||
) ?></p>
|
||||
) ?></p>
|
||||
</div>
|
||||
|
||||
<Forms.Field
|
||||
|
|
|
@ -10,12 +10,12 @@
|
|||
<span class="inline-flex items-center justify-center w-12 h-12 mr-2 text-sm font-semibold tracking-wider border-4 rounded-full text-accent-base border-accent-base">2/4</span>
|
||||
<Heading tagName="h1"><?= lang(
|
||||
'Install.form.database_config',
|
||||
) ?></Heading>
|
||||
) ?></Heading>
|
||||
</div>
|
||||
|
||||
<p class="mt-2 text-sm text-skin-muted"><?= lang(
|
||||
'Install.form.database_config_hint',
|
||||
) ?></p>
|
||||
) ?></p>
|
||||
</div>
|
||||
|
||||
<Forms.Field
|
||||
|
|
Loading…
Reference in New Issue