diff --git a/.github/workflows.template/block-unconventional-commits.yml b/.github/workflows/block-unconventional-commits.yml similarity index 100% rename from .github/workflows.template/block-unconventional-commits.yml rename to .github/workflows/block-unconventional-commits.yml diff --git a/.github/workflows.template/build-npm.yml b/.github/workflows/build-npm.yml similarity index 100% rename from .github/workflows.template/build-npm.yml rename to .github/workflows/build-npm.yml diff --git a/.github/workflows.template/lint-appinfo-xml.yml b/.github/workflows/lint-appinfo-xml.yml similarity index 100% rename from .github/workflows.template/lint-appinfo-xml.yml rename to .github/workflows/lint-appinfo-xml.yml diff --git a/.github/workflows.template/lint-eslint.yml b/.github/workflows/lint-eslint.yml similarity index 100% rename from .github/workflows.template/lint-eslint.yml rename to .github/workflows/lint-eslint.yml diff --git a/.github/workflows.template/lint-openapi.yml b/.github/workflows/lint-openapi.yml similarity index 100% rename from .github/workflows.template/lint-openapi.yml rename to .github/workflows/lint-openapi.yml diff --git a/.github/workflows.template/lint-php-cs.yml b/.github/workflows/lint-php-cs.yml similarity index 100% rename from .github/workflows.template/lint-php-cs.yml rename to .github/workflows/lint-php-cs.yml diff --git a/.github/workflows.template/lint-php.yml b/.github/workflows/lint-php.yml similarity index 100% rename from .github/workflows.template/lint-php.yml rename to .github/workflows/lint-php.yml diff --git a/.github/workflows.template/psalm-matrix.yml b/.github/workflows/psalm-matrix.yml similarity index 100% rename from .github/workflows.template/psalm-matrix.yml rename to .github/workflows/psalm-matrix.yml diff --git a/.github/workflows.template/release.yml b/.github/workflows/release.yml similarity index 87% rename from .github/workflows.template/release.yml rename to .github/workflows/release.yml index 6819c07..2a9297d 100644 --- a/.github/workflows.template/release.yml +++ b/.github/workflows/release.yml @@ -71,8 +71,8 @@ jobs: - name: Upload Artifacts uses: actions/upload-artifact@v4 with: - name: nextcloudapptemplate.tar.gz - path: build/artifacts/appstore/nextcloudapptemplate.tar.gz + name: forum.tar.gz + path: build/artifacts/appstore/forum.tar.gz upload: runs-on: ubuntu-latest @@ -86,18 +86,18 @@ jobs: - name: Download Artifacts uses: actions/download-artifact@v4 with: - name: nextcloudapptemplate.tar.gz + name: forum.tar.gz - name: Prepare Artifact Upload - run: test -f "$PWD/nextcloudapptemplate.tar.gz" + run: test -f "$PWD/forum.tar.gz" - name: Upload to Release if: ${{ needs.release.outputs.release_created }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - mv nextcloudapptemplate.tar.gz "nextcloudapptemplate-${{ needs.release.outputs.tag_name }}.tar.gz" - gh release upload ${{ needs.release.outputs.tag_name }} nextcloudapptemplate-${{ needs.release.outputs.tag_name }}.tar.gz + mv forum.tar.gz "forum-${{ needs.release.outputs.tag_name }}.tar.gz" + gh release upload ${{ needs.release.outputs.tag_name }} forum-${{ needs.release.outputs.tag_name }}.tar.gz release-nextcloud: name: Release to Nextcloud Apps @@ -115,7 +115,7 @@ jobs: echo "Private key not provided" exit 1 fi - echo -n "${{ secrets.NEXTCLOUD_APP_PRIVATE_KEY }}" > ~/.nextcloud/certificates/nextcloudapptemplate.key + echo -n "${{ secrets.NEXTCLOUD_APP_PRIVATE_KEY }}" > ~/.nextcloud/certificates/forum.key - name: Release to Nextcloud Apps if: ${{ needs.release.outputs.release_created }} diff --git a/.tx/config b/.tx/config index 304195e..d4986a3 100644 --- a/.tx/config +++ b/.tx/config @@ -2,8 +2,8 @@ host = https://www.transifex.com lang_map = hu_HU: hu, nb_NO: nb, sk_SK: sk, th_TH: th, ja_JP: ja, bg_BG: bg, cs_CZ: cs, fi_FI: fi, he_IL: he, ar_AR: ar -[o:nextcloud:p:nextcloud:r:nextcloudapptemplate] -file_filter = translationfiles//nextcloudapptemplate.po -source_file = translationfiles/templates/nextcloudapptemplate.pot +[o:nextcloud:p:nextcloud:r:forum] +file_filter = translationfiles//forum.po +source_file = translationfiles/templates/forum.pot source_lang = en type = PO diff --git a/Makefile b/Makefile index 6dd6965..641e189 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: Bernhard Posselt # SPDX-License-Identifier: AGPL-3.0-or-later # -# Nextcloud App Template — Makefile +# Forum — Makefile # --------------------------------- # A friendly, batteries-included Makefile for building and packaging a Nextcloud app # that uses pnpm (JS) and Composer (PHP). @@ -26,8 +26,8 @@ # make release → upload release to Nextcloud App Store # -app_name=nextcloudapptemplate -repo_path=your-user/nextcloud-$(app_name) +app_name=forum +repo_path=chenasraf/nextcloud-$(app_name) build_tools_directory=$(CURDIR)/build/tools source_build_directory=$(CURDIR)/build/artifacts/source source_intermediate_directory=$(CURDIR)/build/artifacts/intermediate-source diff --git a/README.md b/README.md index 31c150a..21e6d4f 100755 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ -# Nextcloud App Template +# Forum This is a starter template for a Nextcloud app, using Vue 3 with Vite as frontend. diff --git a/appinfo/info.xml b/appinfo/info.xml index d4808e9..7ad4ee2 100644 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -1,41 +1,41 @@ - nextcloudapptemplate - Nextcloud App Template + forum + Forum Enter your app summary here. 1.0.0 agpl - Your Name - NextcloudAppTemplate + Chen Asraf + Forum - https://github.com/your-user/nextcloud-nextcloudapptemplate/blob/master/README.md - https://github.com/your-user/nextcloud-nextcloudapptemplate#installation - https://github.com/your-user/nextcloud-nextcloudapptemplate#development + https://github.com/chenasraf/nextcloud-forum/blob/master/README.md + https://github.com/chenasraf/nextcloud-forum#installation + https://github.com/chenasraf/nextcloud-forum#development organization tools - https://github.com/your-user/nextcloud-nextcloudapptemplate - https://github.com/your-user/nextcloud-nextcloudapptemplate/issues - https://github.com/your-user/nextcloud-nextcloudapptemplate - https://raw.githubusercontent.com/your-user/nextcloud-nextcloudapptemplate/refs/heads/master/promo.png + https://github.com/chenasraf/nextcloud-forum + https://github.com/chenasraf/nextcloud-forum/issues + https://github.com/chenasraf/nextcloud-forum + https://raw.githubusercontent.com/chenasraf/nextcloud-forum/refs/heads/master/promo.png - + - OCA\NextcloudAppTemplate\Settings\Admin - OCA\NextcloudAppTemplate\Sections\Admin + OCA\Forum\Settings\Admin + OCA\Forum\Sections\Admin - Nextcloud App Template - nextcloudapptemplate.page.index + Forum + forum.page.index app.svg 6 diff --git a/composer.json b/composer.json index 00ebcac..718456b 100644 --- a/composer.json +++ b/composer.json @@ -1,17 +1,17 @@ { - "name": "nextcloud/nextcloudapptemplate", + "name": "nextcloud/forum", "description": "Automatically fills the currency rates for your Cospend projects daily.", "license": "AGPL-3.0-or-later", "authors": [ { - "name": "Your Name", - "email": "your@email.com", - "homepage": "https://your.website" + "name": "Chen Asraf", + "email": "contact@casraf.dev", + "homepage": "https://casraf.dev" } ], "autoload": { "psr-4": { - "OCA\\NextcloudAppTemplate\\": "lib/" + "OCA\\Forum\\": "lib/" } }, "scripts": { diff --git a/gen/gen/api/{{pascalCase name}}Controller.php b/gen/api/{{pascalCase name}}Controller.php similarity index 89% rename from gen/gen/api/{{pascalCase name}}Controller.php rename to gen/api/{{pascalCase name}}Controller.php index c3f9914..dba21fc 100644 --- a/gen/gen/api/{{pascalCase name}}Controller.php +++ b/gen/api/{{pascalCase name}}Controller.php @@ -2,10 +2,10 @@ declare(strict_types=1); -// SPDX-FileCopyrightText: Your Name +// SPDX-FileCopyrightText: Chen Asraf // SPDX-License-Identifier: AGPL-3.0-or-later -namespace OCA\NextcloudAppTemplate\Controller; +namespace OCA\Forum\Controller; use OCP\AppFramework\Http; use OCP\AppFramework\Http\Attribute\ApiRoute; diff --git a/gen/gen/command/{{pascalCase name}}.php b/gen/command/{{pascalCase name}}.php similarity index 88% rename from gen/gen/command/{{pascalCase name}}.php rename to gen/command/{{pascalCase name}}.php index 564c29e..dddc952 100644 --- a/gen/gen/command/{{pascalCase name}}.php +++ b/gen/command/{{pascalCase name}}.php @@ -2,10 +2,10 @@ declare(strict_types=1); -// SPDX-FileCopyrightText: Your Name +// SPDX-FileCopyrightText: Chen Asraf // SPDX-License-Identifier: AGPL-3.0-or-later -namespace OCA\NextcloudAppTemplate\Command; +namespace OCA\Forum\Command; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputInterface; diff --git a/gen/gen/component/{{pascalCase name}}.vue b/gen/component/{{pascalCase name}}.vue similarity index 100% rename from gen/gen/component/{{pascalCase name}}.vue rename to gen/component/{{pascalCase name}}.vue diff --git a/gen/gen/migration/Version{{version}}Date{{dt}}.php b/gen/migration/Version{{version}}Date{{dt}}.php similarity index 91% rename from gen/gen/migration/Version{{version}}Date{{dt}}.php rename to gen/migration/Version{{version}}Date{{dt}}.php index d1ce988..d355918 100644 --- a/gen/gen/migration/Version{{version}}Date{{dt}}.php +++ b/gen/migration/Version{{version}}Date{{dt}}.php @@ -2,10 +2,10 @@ declare(strict_types=1); -// SPDX-FileCopyrightText: Your Name +// SPDX-FileCopyrightText: Chen Asraf // SPDX-License-Identifier: AGPL-3.0-or-later -namespace OCA\NextcloudAppTemplate\Migration; +namespace OCA\Forum\Migration; use Closure; use OCP\DB\ISchemaWrapper; diff --git a/gen/gen/model/{{pascalCase name}}.php b/gen/model/{{pascalCase name}}.php similarity index 84% rename from gen/gen/model/{{pascalCase name}}.php rename to gen/model/{{pascalCase name}}.php index a5f5e0c..146a7e9 100755 --- a/gen/gen/model/{{pascalCase name}}.php +++ b/gen/model/{{pascalCase name}}.php @@ -2,10 +2,10 @@ declare(strict_types=1); -// SPDX-FileCopyrightText: Your Name +// SPDX-FileCopyrightText: Chen Asraf // SPDX-License-Identifier: AGPL-3.0-or-later -namespace OCA\NextcloudAppTemplate\Db; +namespace OCA\Forum\Db; use JsonSerializable; diff --git a/gen/gen/model/{{pascalCase name}}Mapper.php b/gen/model/{{pascalCase name}}Mapper.php similarity index 89% rename from gen/gen/model/{{pascalCase name}}Mapper.php rename to gen/model/{{pascalCase name}}Mapper.php index 7f3a66f..297d12f 100755 --- a/gen/gen/model/{{pascalCase name}}Mapper.php +++ b/gen/model/{{pascalCase name}}Mapper.php @@ -2,12 +2,12 @@ declare(strict_types=1); -// SPDX-FileCopyrightText: Your Name +// SPDX-FileCopyrightText: Chen Asraf // SPDX-License-Identifier: AGPL-3.0-or-later -namespace OCA\NextcloudAppTemplate\Db; +namespace OCA\Forum\Db; -use OCA\NextcloudAppTemplate\AppInfo\Application; +use OCA\Forum\AppInfo\Application; use OCP\AppFramework\Db\DoesNotExistException; use OCP\AppFramework\Db\QBMapper; use OCP\DB\QueryBuilder\IQueryBuilder; diff --git a/gen/gen/page/{{pascalCase name}}Page.vue b/gen/page/{{pascalCase name}}Page.vue similarity index 100% rename from gen/gen/page/{{pascalCase name}}Page.vue rename to gen/page/{{pascalCase name}}Page.vue diff --git a/gen/gen/service/{{pascalCase name}}Service.php b/gen/service/{{pascalCase name}}Service.php similarity index 75% rename from gen/gen/service/{{pascalCase name}}Service.php rename to gen/service/{{pascalCase name}}Service.php index a6981d5..d70a7e0 100644 --- a/gen/gen/service/{{pascalCase name}}Service.php +++ b/gen/service/{{pascalCase name}}Service.php @@ -2,10 +2,10 @@ declare(strict_types=1); -// SPDX-FileCopyrightText: Your Name +// SPDX-FileCopyrightText: Chen Asraf // SPDX-License-Identifier: AGPL-3.0-or-later -namespace OCA\NextcloudAppTemplate\Service; +namespace OCA\Forum\Service; use Psr\Log\LoggerInterface; diff --git a/gen/gen/task-queued/{{pascalCase name}}Task.php b/gen/task-queued/{{pascalCase name}}Task.php similarity index 82% rename from gen/gen/task-queued/{{pascalCase name}}Task.php rename to gen/task-queued/{{pascalCase name}}Task.php index bc7729a..0807f66 100644 --- a/gen/gen/task-queued/{{pascalCase name}}Task.php +++ b/gen/task-queued/{{pascalCase name}}Task.php @@ -2,10 +2,10 @@ declare(strict_types=1); -// SPDX-FileCopyrightText: Your Name +// SPDX-FileCopyrightText: Chen Asraf // SPDX-License-Identifier: AGPL-3.0-or-later -namespace OCA\NextcloudAppTemplate\Cron; +namespace OCA\Forum\Cron; use OCP\AppFramework\Utility\ITimeFactory; use OCP\BackgroundJob\QueuedJob; diff --git a/gen/gen/task-timed/{{pascalCase name}}Task.php b/gen/task-timed/{{pascalCase name}}Task.php similarity index 84% rename from gen/gen/task-timed/{{pascalCase name}}Task.php rename to gen/task-timed/{{pascalCase name}}Task.php index 351d322..e9f7430 100644 --- a/gen/gen/task-timed/{{pascalCase name}}Task.php +++ b/gen/task-timed/{{pascalCase name}}Task.php @@ -2,10 +2,10 @@ declare(strict_types=1); -// SPDX-FileCopyrightText: Your Name +// SPDX-FileCopyrightText: Chen Asraf // SPDX-License-Identifier: AGPL-3.0-or-later -namespace OCA\NextcloudAppTemplate\Cron; +namespace OCA\Forum\Cron; use OCP\AppFramework\Utility\ITimeFactory; use OCP\BackgroundJob\TimedJob; diff --git a/gen/gen/util/{{pascalCase name}}Util.php b/gen/util/{{pascalCase name}}Util.php similarity index 75% rename from gen/gen/util/{{pascalCase name}}Util.php rename to gen/util/{{pascalCase name}}Util.php index c385f4c..a89d1a7 100644 --- a/gen/gen/util/{{pascalCase name}}Util.php +++ b/gen/util/{{pascalCase name}}Util.php @@ -2,10 +2,10 @@ declare(strict_types=1); -// SPDX-FileCopyrightText: Your Name +// SPDX-FileCopyrightText: Chen Asraf // SPDX-License-Identifier: AGPL-3.0-or-later -namespace OCA\NextcloudAppTemplate\Util; +namespace OCA\Forum\Util; use Psr\Log\LoggerInterface; diff --git a/lib/AppInfo/Application.php b/lib/AppInfo/Application.php index f59a227..0dc47a2 100644 --- a/lib/AppInfo/Application.php +++ b/lib/AppInfo/Application.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace OCA\NextcloudAppTemplate\AppInfo; +namespace OCA\Forum\AppInfo; use OCP\AppFramework\App; use OCP\AppFramework\Bootstrap\IBootContext; @@ -10,7 +10,7 @@ use OCP\AppFramework\Bootstrap\IBootstrap; use OCP\AppFramework\Bootstrap\IRegistrationContext; class Application extends App implements IBootstrap { - public const APP_ID = 'nextcloudapptemplate'; + public const APP_ID = 'forum'; public const DIST_DIR = '../dist'; public const JS_DIR = self::DIST_DIR . '/js'; public const CSS_DIR = self::DIST_DIR . '/css'; @@ -25,4 +25,9 @@ class Application extends App implements IBootstrap { public function boot(IBootContext $context): void { } + + public static function tableName(string $name): string { + // return self::APP_ID . '_' . $name; + return $name; + } } diff --git a/lib/Controller/ApiController.php b/lib/Controller/ApiController.php deleted file mode 100644 index 17b803c..0000000 --- a/lib/Controller/ApiController.php +++ /dev/null @@ -1,101 +0,0 @@ -config = $config; - $this->l10n = $l10n; - } - - /** - * GET /api/hello - * - * Returns a simple hello message and the last time the server said hello. - * - * @return DataResponse - * - * 200: Data returned successfully. - */ - #[ApiRoute(verb: 'GET', url: '/api/hello')] - #[NoAdminRequired] - public function getHello(): DataResponse { - $lastAt = $this->config->getValueString(AppInfo\Application::APP_ID, 'last_hello_at', ''); - $at = $lastAt !== '' ? $lastAt : null; - - $message = (string)$this->l10n->t('👋 Hello from server!'); - - return new DataResponse([ - 'message' => $message, - 'at' => $at, - ]); - } - - /** - * POST /api/hello - * - * Accepts example payload and returns a message + timestamp. - * - * @param array{ - * name?: string, - * theme?: string, - * items?: list, - * counter?: int - * } $data Request payload for creating a hello message. - * - * @return DataResponse - * - * 200: Data returned successfully. - */ - #[ApiRoute(verb: 'POST', url: '/api/hello')] - #[NoAdminRequired] - public function postHello(mixed $data = []): DataResponse { - // Normalize incoming payload (be permissive for the example) - $name = isset($data['name']) && is_string($data['name']) ? trim($data['name']) : ''; - $theme = isset($data['theme']) && is_string($data['theme']) ? $data['theme'] : null; - $items = isset($data['items']) && is_array($data['items']) ? $data['items'] : []; - $counter = isset($data['counter']) && is_int($data['counter']) ? $data['counter'] : 0; - - // Build a friendly message (localized) - $who = $name !== '' ? $name : (string)$this->l10n->t('there'); - $message = (string)$this->l10n->t('Hello, %s!', [$who]); - - // Optionally include a tiny summary (kept simple for the example) - if ($theme !== null) { - $message .= ' ' . (string)$this->l10n->t('Theme: %s.', [$theme]); - } - if (!empty($items)) { - $message .= ' ' . (string)$this->l10n->t('Items: %d.', [count($items)]); - } - if ($counter !== 0) { - $message .= ' ' . (string)$this->l10n->t('Counter: %d.', [$counter]); - } - - // Stamp "now" and persist as the last hello time - $now = (new \DateTimeImmutable('now', new \DateTimeZone('UTC')))->format(\DATE_ATOM); - $this->config->setValueString(AppInfo\Application::APP_ID, 'last_hello_at', $now); - - return new DataResponse([ - 'message' => $message, - 'at' => $now, - ]); - } -} diff --git a/lib/Controller/PageController.php b/lib/Controller/PageController.php index a782d4e..e54b4e4 100644 --- a/lib/Controller/PageController.php +++ b/lib/Controller/PageController.php @@ -2,9 +2,9 @@ declare(strict_types=1); -namespace OCA\NextcloudAppTemplate\Controller; +namespace OCA\Forum\Controller; -use OCA\NextcloudAppTemplate\AppInfo\Application; +use OCA\Forum\AppInfo\Application; use OCP\AppFramework\Controller; use OCP\AppFramework\Http\Attribute\FrontpageRoute; use OCP\AppFramework\Http\Attribute\NoAdminRequired; @@ -19,7 +19,7 @@ class PageController extends Controller { IRequest $request, private LoggerInterface $logger, ) { - $this->logger->info('NextcloudAppTemplate page controller loaded'); + $this->logger->info('Forum page controller loaded'); parent::__construct($appName, $request); } @@ -34,7 +34,7 @@ class PageController extends Controller { #[NoCSRFRequired] #[FrontpageRoute(verb: 'GET', url: '/')] public function index(): TemplateResponse { - $this->logger->info('NextcloudAppTemplate main page loaded'); + $this->logger->info('Forum main page loaded'); return new TemplateResponse(Application::APP_ID, 'app', [ 'script' => 'app', ]); diff --git a/lib/Sections/Admin.php b/lib/Sections/Admin.php index 8496095..7cb7372 100644 --- a/lib/Sections/Admin.php +++ b/lib/Sections/Admin.php @@ -1,8 +1,8 @@ l->t('Nextcloud App Template'); + return $this->l->t('Forum'); } public function getPriority(): int { diff --git a/lib/Settings/Admin.php b/lib/Settings/Admin.php index b4a2cdf..32ea233 100644 --- a/lib/Settings/Admin.php +++ b/lib/Settings/Admin.php @@ -1,8 +1,8 @@ - +