54 lines
1.5 KiB
PHP
54 lines
1.5 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace OCA\NuqloudScrum\Controller;
|
|
|
|
use OCA\NuqloudScrum\AppInfo\Application;
|
|
use OCA\NuqloudScrum\Service\ConfigService;
|
|
use OCP\AppFramework\Controller;
|
|
use OCP\AppFramework\Http\Attribute\NoAdminRequired;
|
|
use OCP\AppFramework\Http\Attribute\NoCSRFRequired;
|
|
use OCP\AppFramework\Http\TemplateResponse;
|
|
use OCP\IL10N;
|
|
use OCP\IRequest;
|
|
use OCP\Util;
|
|
|
|
class PageController extends Controller {
|
|
public function __construct(
|
|
IRequest $request,
|
|
private IL10N $l,
|
|
private ConfigService $configService,
|
|
) {
|
|
parent::__construct(Application::APP_ID, $request);
|
|
}
|
|
|
|
#[NoAdminRequired]
|
|
#[NoCSRFRequired]
|
|
public function index(): TemplateResponse {
|
|
Util::addStyle(Application::APP_ID, 'admin');
|
|
|
|
return new TemplateResponse(
|
|
Application::APP_ID,
|
|
'index',
|
|
[
|
|
'title' => $this->l->t('NuQloud Scrum'),
|
|
'settings' => $this->configService->getPublicSettings(),
|
|
'text' => $this->getText(),
|
|
],
|
|
TemplateResponse::RENDER_AS_USER
|
|
);
|
|
}
|
|
|
|
/** @return array<string, string> */
|
|
private function getText(): array {
|
|
return [
|
|
'title' => $this->l->t('NuQloud Scrum'),
|
|
'workspaceSync' => $this->l->t('Workspace Sync'),
|
|
'enabled' => $this->l->t('NuQloud Scrum automation is enabled.'),
|
|
'notEnabled' => $this->l->t('NuQloud Scrum automation is not enabled yet.'),
|
|
'intro' => $this->l->t('Talk remains the primary workspace. Synced task folders and Deck cards will appear here after the sync services are connected.'),
|
|
];
|
|
}
|
|
}
|