mirror of
https://github.com/chenasraf/nextcloud-forum.git
synced 2026-05-17 17:28:02 +00:00
feat: rename project
This commit is contained in:
@@ -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 }}
|
||||
@@ -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/<lang>/nextcloudapptemplate.po
|
||||
source_file = translationfiles/templates/nextcloudapptemplate.pot
|
||||
[o:nextcloud:p:nextcloud:r:forum]
|
||||
file_filter = translationfiles/<lang>/forum.po
|
||||
source_file = translationfiles/templates/forum.pot
|
||||
source_lang = en
|
||||
type = PO
|
||||
|
||||
6
Makefile
6
Makefile
@@ -1,7 +1,7 @@
|
||||
# SPDX-FileCopyrightText: Bernhard Posselt <dev@bernhard-posselt.com>
|
||||
# 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
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<!--
|
||||
SPDX-FileCopyrightText: Your Name <your@email.com>
|
||||
SPDX-FileCopyrightText: Chen Asraf <contact@casraf.dev>
|
||||
SPDX-License-Identifier: CC0-1.0
|
||||
-->
|
||||
|
||||
# Nextcloud App Template
|
||||
# Forum
|
||||
|
||||
This is a starter template for a Nextcloud app, using Vue 3 with Vite as frontend.
|
||||
|
||||
|
||||
@@ -1,41 +1,41 @@
|
||||
<?xml version="1.0"?>
|
||||
<info xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://apps.nextcloud.com/schema/apps/info.xsd">
|
||||
<!--
|
||||
SPDX-FileCopyrightText: Your Name <your@email.com>
|
||||
SPDX-FileCopyrightText: Chen Asraf <contact@casraf.dev>
|
||||
SPDX-License-Identifier: CC0-1.0
|
||||
-->
|
||||
<id>nextcloudapptemplate</id>
|
||||
<name>Nextcloud App Template</name>
|
||||
<id>forum</id>
|
||||
<name>Forum</name>
|
||||
<summary>Enter your app summary here.</summary>
|
||||
<description><![CDATA[
|
||||
Enter your app description here.
|
||||
]]></description>
|
||||
<version>1.0.0</version>
|
||||
<licence>agpl</licence>
|
||||
<author mail="your@email.com" homepage="https://your.website">Your Name</author>
|
||||
<namespace>NextcloudAppTemplate</namespace>
|
||||
<author mail="contact@casraf.dev" homepage="https://casraf.dev">Chen Asraf</author>
|
||||
<namespace>Forum</namespace>
|
||||
<documentation>
|
||||
<user>https://github.com/your-user/nextcloud-nextcloudapptemplate/blob/master/README.md</user>
|
||||
<admin>https://github.com/your-user/nextcloud-nextcloudapptemplate#installation</admin>
|
||||
<developer>https://github.com/your-user/nextcloud-nextcloudapptemplate#development</developer>
|
||||
<user>https://github.com/chenasraf/nextcloud-forum/blob/master/README.md</user>
|
||||
<admin>https://github.com/chenasraf/nextcloud-forum#installation</admin>
|
||||
<developer>https://github.com/chenasraf/nextcloud-forum#development</developer>
|
||||
</documentation>
|
||||
<category>organization</category>
|
||||
<category>tools</category>
|
||||
<website>https://github.com/your-user/nextcloud-nextcloudapptemplate</website>
|
||||
<bugs>https://github.com/your-user/nextcloud-nextcloudapptemplate/issues</bugs>
|
||||
<repository>https://github.com/your-user/nextcloud-nextcloudapptemplate</repository>
|
||||
<screenshot>https://raw.githubusercontent.com/your-user/nextcloud-nextcloudapptemplate/refs/heads/master/promo.png</screenshot>
|
||||
<website>https://github.com/chenasraf/nextcloud-forum</website>
|
||||
<bugs>https://github.com/chenasraf/nextcloud-forum/issues</bugs>
|
||||
<repository>https://github.com/chenasraf/nextcloud-forum</repository>
|
||||
<screenshot>https://raw.githubusercontent.com/chenasraf/nextcloud-forum/refs/heads/master/promo.png</screenshot>
|
||||
<dependencies>
|
||||
<nextcloud min-version="29" max-version="32"/>
|
||||
<nextcloud min-version="29" max-version="33"/>
|
||||
</dependencies>
|
||||
<settings>
|
||||
<admin>OCA\NextcloudAppTemplate\Settings\Admin</admin>
|
||||
<admin-section>OCA\NextcloudAppTemplate\Sections\Admin</admin-section>
|
||||
<admin>OCA\Forum\Settings\Admin</admin>
|
||||
<admin-section>OCA\Forum\Sections\Admin</admin-section>
|
||||
</settings>
|
||||
<navigations>
|
||||
<navigation role="all">
|
||||
<name>Nextcloud App Template</name>
|
||||
<route>nextcloudapptemplate.page.index</route>
|
||||
<name>Forum</name>
|
||||
<route>forum.page.index</route>
|
||||
<icon>app.svg</icon>
|
||||
<order>6</order>
|
||||
</navigation>
|
||||
|
||||
@@ -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": {
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
// SPDX-FileCopyrightText: Your Name <your@email.com>
|
||||
// SPDX-FileCopyrightText: Chen Asraf <contact@casraf.dev>
|
||||
// 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;
|
||||
@@ -2,10 +2,10 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
// SPDX-FileCopyrightText: Your Name <your@email.com>
|
||||
// SPDX-FileCopyrightText: Chen Asraf <contact@casraf.dev>
|
||||
// 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;
|
||||
@@ -2,10 +2,10 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
// SPDX-FileCopyrightText: Your Name <your@email.com>
|
||||
// SPDX-FileCopyrightText: Chen Asraf <contact@casraf.dev>
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
namespace OCA\NextcloudAppTemplate\Migration;
|
||||
namespace OCA\Forum\Migration;
|
||||
|
||||
use Closure;
|
||||
use OCP\DB\ISchemaWrapper;
|
||||
@@ -2,10 +2,10 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
// SPDX-FileCopyrightText: Your Name <your@email.com>
|
||||
// SPDX-FileCopyrightText: Chen Asraf <contact@casraf.dev>
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
namespace OCA\NextcloudAppTemplate\Db;
|
||||
namespace OCA\Forum\Db;
|
||||
|
||||
use JsonSerializable;
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
// SPDX-FileCopyrightText: Your Name <your@email.com>
|
||||
// SPDX-FileCopyrightText: Chen Asraf <contact@casraf.dev>
|
||||
// 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;
|
||||
@@ -2,10 +2,10 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
// SPDX-FileCopyrightText: Your Name <your@email.com>
|
||||
// SPDX-FileCopyrightText: Chen Asraf <contact@casraf.dev>
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
namespace OCA\NextcloudAppTemplate\Service;
|
||||
namespace OCA\Forum\Service;
|
||||
|
||||
use Psr\Log\LoggerInterface;
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
// SPDX-FileCopyrightText: Your Name <your@email.com>
|
||||
// SPDX-FileCopyrightText: Chen Asraf <contact@casraf.dev>
|
||||
// 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;
|
||||
@@ -2,10 +2,10 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
// SPDX-FileCopyrightText: Your Name <your@email.com>
|
||||
// SPDX-FileCopyrightText: Chen Asraf <contact@casraf.dev>
|
||||
// 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;
|
||||
@@ -2,10 +2,10 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
// SPDX-FileCopyrightText: Your Name <your@email.com>
|
||||
// SPDX-FileCopyrightText: Chen Asraf <contact@casraf.dev>
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
namespace OCA\NextcloudAppTemplate\Util;
|
||||
namespace OCA\Forum\Util;
|
||||
|
||||
use Psr\Log\LoggerInterface;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,101 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace OCA\NextcloudAppTemplate\Controller;
|
||||
|
||||
use OCA\NextcloudAppTemplate\AppInfo;
|
||||
use OCP\AppFramework\Http;
|
||||
use OCP\AppFramework\Http\Attribute\ApiRoute;
|
||||
use OCP\AppFramework\Http\Attribute\NoAdminRequired;
|
||||
use OCP\AppFramework\Http\DataResponse;
|
||||
use OCP\AppFramework\OCSController;
|
||||
use OCP\IAppConfig;
|
||||
use OCP\IL10N;
|
||||
use OCP\IRequest;
|
||||
|
||||
final class ApiController extends OCSController {
|
||||
public function __construct(
|
||||
string $appName,
|
||||
IRequest $request,
|
||||
private IAppConfig $config,
|
||||
private IL10N $l10n,
|
||||
) {
|
||||
parent::__construct($appName, $request);
|
||||
$this->config = $config;
|
||||
$this->l10n = $l10n;
|
||||
}
|
||||
|
||||
/**
|
||||
* GET /api/hello
|
||||
*
|
||||
* Returns a simple hello message and the last time the server said hello.
|
||||
*
|
||||
* @return DataResponse<Http::STATUS_OK, array{message: string, at: string|null}, array{}>
|
||||
*
|
||||
* 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<string>,
|
||||
* counter?: int
|
||||
* } $data Request payload for creating a hello message.
|
||||
*
|
||||
* @return DataResponse<Http::STATUS_OK, array{message: string, at: string}, array{}>
|
||||
*
|
||||
* 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,
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -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',
|
||||
]);
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?php
|
||||
|
||||
namespace OCA\NextcloudAppTemplate\Sections;
|
||||
namespace OCA\Forum\Sections;
|
||||
|
||||
use OCA\NextcloudAppTemplate\AppInfo;
|
||||
use OCA\Forum\AppInfo;
|
||||
use OCP\IL10N;
|
||||
use OCP\IURLGenerator;
|
||||
use OCP\Settings\IIconSection;
|
||||
@@ -25,7 +25,7 @@ class Admin implements IIconSection {
|
||||
}
|
||||
|
||||
public function getName(): string {
|
||||
return $this->l->t('Nextcloud App Template');
|
||||
return $this->l->t('Forum');
|
||||
}
|
||||
|
||||
public function getPriority(): int {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?php
|
||||
|
||||
namespace OCA\NextcloudAppTemplate\Settings;
|
||||
namespace OCA\Forum\Settings;
|
||||
|
||||
use OCA\NextcloudAppTemplate\AppInfo\Application;
|
||||
use OCA\Forum\AppInfo\Application;
|
||||
use OCP\AppFramework\Http\TemplateResponse;
|
||||
use OCP\IAppConfig;
|
||||
use OCP\IL10N;
|
||||
@@ -22,8 +22,8 @@ class Admin implements ISettings {
|
||||
* @return TemplateResponse
|
||||
*/
|
||||
public function getForm(): TemplateResponse {
|
||||
Util::addScript(Application::APP_ID, Application::JS_DIR . '/nextcloudapptemplate-settings');
|
||||
Util::addStyle(Application::APP_ID, Application::CSS_DIR . '/nextcloudapptemplate-style');
|
||||
Util::addScript(Application::APP_ID, Application::JS_DIR . '/forum-settings');
|
||||
Util::addStyle(Application::APP_ID, Application::CSS_DIR . '/forum-style');
|
||||
return new TemplateResponse(Application::APP_ID, 'settings', [], '');
|
||||
}
|
||||
|
||||
|
||||
8036
openapi.json
8036
openapi.json
File diff suppressed because it is too large
Load Diff
24
package.json
24
package.json
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "nextcloudapptemplate",
|
||||
"name": "forum",
|
||||
"version": "0.0.0",
|
||||
"license": "AGPL-3.0-or-later",
|
||||
"type": "module",
|
||||
@@ -23,29 +23,29 @@
|
||||
"@nextcloud/l10n": "^3.4.0",
|
||||
"@nextcloud/router": "^3.0.1",
|
||||
"@nextcloud/vite-config": "2.3.5",
|
||||
"@nextcloud/vue": "9.0.0",
|
||||
"@nextcloud/vue": "9.0.1",
|
||||
"date-fns": "^4.1.0",
|
||||
"linkifyjs": "^4.3.2",
|
||||
"vue": "^3.5.22",
|
||||
"vue-material-design-icons": "^5.3.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/js": "^9.36.0",
|
||||
"@nextcloud/browserslist-config": "^3.0.1",
|
||||
"@eslint/js": "^9.39.1",
|
||||
"@nextcloud/browserslist-config": "^3.1.1",
|
||||
"@nextcloud/eslint-config": "^8.4.2",
|
||||
"@nextcloud/stylelint-config": "^3.1.0",
|
||||
"@nextcloud/stylelint-config": "^3.1.1",
|
||||
"@vue/tsconfig": "^0.8.1",
|
||||
"eslint": "^9.36.0",
|
||||
"eslint": "^9.39.1",
|
||||
"husky": "^9.1.7",
|
||||
"lint-staged": "^16.2.1",
|
||||
"lint-staged": "^16.2.6",
|
||||
"prettier": "^2.8.8",
|
||||
"prettier-plugin-vue": "^1.1.6",
|
||||
"sass": "^1.93.2",
|
||||
"sass-embedded": "^1.93.2",
|
||||
"sass": "^1.93.3",
|
||||
"sass-embedded": "^1.93.3",
|
||||
"typescript": "5.9.2",
|
||||
"typescript-eslint": "^8.44.1",
|
||||
"vite": "^6.3.6",
|
||||
"vue-router": "^4.5.1",
|
||||
"typescript-eslint": "^8.46.3",
|
||||
"vite": "^6.4.1",
|
||||
"vue-router": "^4.6.3",
|
||||
"vue-tsc": "^2.2.12"
|
||||
}
|
||||
}
|
||||
|
||||
18
src/App.vue
18
src/App.vue
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<NcContent app-name="nextcloudapptemplate">
|
||||
<NcContent app-name="forum">
|
||||
<!-- Left sidebar -->
|
||||
<NcAppNavigation>
|
||||
<template #search>
|
||||
@@ -98,21 +98,21 @@ export default {
|
||||
searchValue: '',
|
||||
isRouterLoading: false,
|
||||
// Mount path for this app section; adjust to your mount.
|
||||
basePath: '/apps/nextcloudapptemplate',
|
||||
basePath: '/apps/forum',
|
||||
strings: {
|
||||
title: t('nextcloudapptemplate', 'Hello World — App'),
|
||||
title: t('forum', 'Hello World — App'),
|
||||
subtitle: t(
|
||||
'nextcloudapptemplate',
|
||||
'forum',
|
||||
'Use the sidebar to navigate between views. Backend calls use {cStart}axios{cEnd} and OCS responses.',
|
||||
{ cStart: '<code>', cEnd: '</code>' },
|
||||
undefined,
|
||||
{ escape: false },
|
||||
),
|
||||
searchLabel: t('nextcloudapptemplate', 'Search'),
|
||||
searchPlaceholder: t('nextcloudapptemplate', 'Type to filter…'),
|
||||
navHome: t('nextcloudapptemplate', 'Home'),
|
||||
navExamples: t('nextcloudapptemplate', 'Examples'),
|
||||
navAbout: t('nextcloudapptemplate', 'About'),
|
||||
searchLabel: t('forum', 'Search'),
|
||||
searchPlaceholder: t('forum', 'Type to filter…'),
|
||||
navHome: t('forum', 'Home'),
|
||||
navExamples: t('forum', 'Examples'),
|
||||
navAbout: t('forum', 'About'),
|
||||
},
|
||||
_removeBeforeEach: null,
|
||||
_removeAfterEach: null,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div id="nextcloudapptemplate-content" class="section">
|
||||
<div id="forum-content" class="section">
|
||||
<h2>{{ strings.title }}</h2>
|
||||
|
||||
<!-- Information / quick start -->
|
||||
@@ -161,10 +161,10 @@ export default {
|
||||
// Example: select with label <-> value mapping (like your intervals)
|
||||
themeLabel: null,
|
||||
themeOptions: [
|
||||
{ label: t('nextcloudapptemplate', 'Light'), value: 'light' },
|
||||
{ label: t('nextcloudapptemplate', 'Dark'), value: 'dark' },
|
||||
{ label: t('forum', 'Light'), value: 'light' },
|
||||
{ label: t('forum', 'Dark'), value: 'dark' },
|
||||
{
|
||||
label: n('nextcloudapptemplate', 'System (1 option)', 'System (%n options)', 2),
|
||||
label: n('forum', 'System (1 option)', 'System (%n options)', 2),
|
||||
value: 'system',
|
||||
},
|
||||
],
|
||||
@@ -183,15 +183,15 @@ export default {
|
||||
// All user-visible strings go here
|
||||
strings: {
|
||||
// Titles / headers
|
||||
title: t('nextcloudapptemplate', 'Hello World — App Template'),
|
||||
infoTitle: t('nextcloudapptemplate', 'Information'),
|
||||
examplesHeader: t('nextcloudapptemplate', 'Quick Examples'),
|
||||
itemsHeader: t('nextcloudapptemplate', 'Editable List'),
|
||||
backendHeader: t('nextcloudapptemplate', 'Backend Calls'),
|
||||
title: t('forum', 'Hello World — App Template'),
|
||||
infoTitle: t('forum', 'Information'),
|
||||
examplesHeader: t('forum', 'Quick Examples'),
|
||||
itemsHeader: t('forum', 'Editable List'),
|
||||
backendHeader: t('forum', 'Backend Calls'),
|
||||
|
||||
// Info
|
||||
infoIntro: t(
|
||||
'nextcloudapptemplate',
|
||||
'forum',
|
||||
'This view shows {bStart}small, focused examples{bEnd} for inputs, lists, selections, and backend calls.',
|
||||
{ bStart: '<b>', bEnd: '</b>' },
|
||||
undefined,
|
||||
@@ -200,21 +200,21 @@ export default {
|
||||
|
||||
gettingStartedList: [
|
||||
t(
|
||||
'nextcloudapptemplate',
|
||||
'forum',
|
||||
'Import UI parts from {cStart}@nextcloud/vue{cEnd} and wire them with {cStart}v-model{cEnd}.',
|
||||
{ cStart: '<code>', cEnd: '</code>' },
|
||||
undefined,
|
||||
{ escape: false },
|
||||
),
|
||||
t(
|
||||
'nextcloudapptemplate',
|
||||
'forum',
|
||||
'Use {cStart}axios{cEnd} for API calls; return OCS data as needed.',
|
||||
{ cStart: '<code>', cEnd: '</code>' },
|
||||
undefined,
|
||||
{ escape: false },
|
||||
),
|
||||
t(
|
||||
'nextcloudapptemplate',
|
||||
'forum',
|
||||
'Keep user-facing text in a central {cStart}strings{cEnd} object with {cStart}t/n{cEnd}.',
|
||||
{ cStart: '<code>', cEnd: '</code>' },
|
||||
undefined,
|
||||
@@ -223,7 +223,7 @@ export default {
|
||||
],
|
||||
|
||||
tipsNote: t(
|
||||
'nextcloudapptemplate',
|
||||
'forum',
|
||||
'Pro tip: keep labels in {cStart}label{cEnd} and values in {cStart}value{cEnd} to simplify mapping.',
|
||||
{ cStart: '<code>', cEnd: '</code>' },
|
||||
undefined,
|
||||
@@ -231,40 +231,40 @@ export default {
|
||||
),
|
||||
|
||||
// Name example
|
||||
nameInputHeader: t('nextcloudapptemplate', 'Your Name'),
|
||||
nameInputLabel: t('nextcloudapptemplate', 'Name'),
|
||||
nameInputPlaceholder: t('nextcloudapptemplate', 'e.g. Ada Lovelace'),
|
||||
livePreview: t('nextcloudapptemplate', 'Live preview:'),
|
||||
nameInputHeader: t('forum', 'Chen Asraf'),
|
||||
nameInputLabel: t('forum', 'Name'),
|
||||
nameInputPlaceholder: t('forum', 'e.g. Ada Lovelace'),
|
||||
livePreview: t('forum', 'Live preview:'),
|
||||
|
||||
// Theme example
|
||||
themeHeader: t('nextcloudapptemplate', 'Theme'),
|
||||
themeLabel: t('nextcloudapptemplate', 'Choose a theme'),
|
||||
themePreview: t('nextcloudapptemplate', 'Active value:'),
|
||||
themeHeader: t('forum', 'Theme'),
|
||||
themeLabel: t('forum', 'Choose a theme'),
|
||||
themePreview: t('forum', 'Active value:'),
|
||||
|
||||
// Counter example
|
||||
counterHeader: t('nextcloudapptemplate', 'Counter'),
|
||||
plus: t('nextcloudapptemplate', '+1'),
|
||||
minus: t('nextcloudapptemplate', '-1'),
|
||||
counterHeader: t('forum', 'Counter'),
|
||||
plus: t('forum', '+1'),
|
||||
minus: t('forum', '-1'),
|
||||
|
||||
// Items table
|
||||
newItemLabel: t('nextcloudapptemplate', 'New item'),
|
||||
newItemPlaceholder: t('nextcloudapptemplate', 'e.g. Hello item'),
|
||||
add: t('nextcloudapptemplate', 'Add'),
|
||||
clear: t('nextcloudapptemplate', 'Clear'),
|
||||
tableItem: t('nextcloudapptemplate', 'Item'),
|
||||
tableActions: t('nextcloudapptemplate', 'Actions'),
|
||||
editItemAria: t('nextcloudapptemplate', 'Edit item'),
|
||||
duplicate: t('nextcloudapptemplate', 'Duplicate'),
|
||||
remove: t('nextcloudapptemplate', 'Remove'),
|
||||
noItems: t('nextcloudapptemplate', 'No items yet'),
|
||||
newItemLabel: t('forum', 'New item'),
|
||||
newItemPlaceholder: t('forum', 'e.g. Hello item'),
|
||||
add: t('forum', 'Add'),
|
||||
clear: t('forum', 'Clear'),
|
||||
tableItem: t('forum', 'Item'),
|
||||
tableActions: t('forum', 'Actions'),
|
||||
editItemAria: t('forum', 'Edit item'),
|
||||
duplicate: t('forum', 'Duplicate'),
|
||||
remove: t('forum', 'Remove'),
|
||||
noItems: t('forum', 'No items yet'),
|
||||
|
||||
// Backend
|
||||
fetchHello: t('nextcloudapptemplate', 'Fetch Hello'),
|
||||
save: t('nextcloudapptemplate', 'Save'),
|
||||
loading: t('nextcloudapptemplate', 'Loading…'),
|
||||
lastHelloAt: t('nextcloudapptemplate', 'Last hello at:'),
|
||||
never: t('nextcloudapptemplate', 'Never'),
|
||||
serverSaid: t('nextcloudapptemplate', 'Server said:'),
|
||||
fetchHello: t('forum', 'Fetch Hello'),
|
||||
save: t('forum', 'Save'),
|
||||
loading: t('forum', 'Loading…'),
|
||||
lastHelloAt: t('forum', 'Last hello at:'),
|
||||
never: t('forum', 'Never'),
|
||||
serverSaid: t('forum', 'Server said:'),
|
||||
},
|
||||
}
|
||||
},
|
||||
@@ -359,7 +359,7 @@ function cryptoRandom() {
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
#nextcloudapptemplate-content {
|
||||
#forum-content {
|
||||
h2:first-child {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
@@ -4,6 +4,6 @@ import { createApp } from 'vue'
|
||||
import { http } from './axios'
|
||||
import router from './router'
|
||||
|
||||
console.log('[DEBUG] Mounting NextcloudAppTemplate app')
|
||||
console.log('[DEBUG] Mounting Forum app')
|
||||
console.log('[DEBUG] Base URL:', http.defaults.baseURL)
|
||||
createApp(App).use(router).mount('#nextcloudapptemplate-app')
|
||||
createApp(App).use(router).mount('#forum-app')
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { generateOcsUrl } from '@nextcloud/router'
|
||||
import _axios from '@nextcloud/axios'
|
||||
|
||||
const baseURL = generateOcsUrl('/apps/nextcloudapptemplate/api')
|
||||
const baseURL = generateOcsUrl('/apps/forum/api')
|
||||
export const http = _axios.create({ baseURL })
|
||||
export const ocs = _axios.create({ baseURL })
|
||||
ocs.interceptors.response.use(
|
||||
|
||||
@@ -3,6 +3,6 @@ import Settings from './Settings.vue'
|
||||
import './style.scss'
|
||||
import { createApp } from 'vue'
|
||||
|
||||
console.log('[DEBUG] Mounting NextcloudAppTemplate Settings')
|
||||
console.log('[DEBUG] Mounting Forum Settings')
|
||||
console.log('[DEBUG] Base URL:', http.defaults.baseURL)
|
||||
createApp(Settings).mount('#nextcloudapptemplate-settings')
|
||||
createApp(Settings).mount('#forum-settings')
|
||||
|
||||
@@ -162,10 +162,10 @@ export default {
|
||||
name: '',
|
||||
themeLabel: null,
|
||||
themeOptions: [
|
||||
{ label: t('nextcloudapptemplate', 'Light'), value: 'light' },
|
||||
{ label: t('nextcloudapptemplate', 'Dark'), value: 'dark' },
|
||||
{ label: t('forum', 'Light'), value: 'light' },
|
||||
{ label: t('forum', 'Dark'), value: 'dark' },
|
||||
{
|
||||
label: n('nextcloudapptemplate', 'System (1 option)', 'System (%n options)', 2),
|
||||
label: n('forum', 'System (1 option)', 'System (%n options)', 2),
|
||||
value: 'system',
|
||||
},
|
||||
],
|
||||
@@ -175,15 +175,15 @@ export default {
|
||||
|
||||
strings: {
|
||||
// Toolbar
|
||||
searchLabel: t('nextcloudapptemplate', 'Search'),
|
||||
searchPlaceholder: t('nextcloudapptemplate', 'Filter messages…'),
|
||||
refresh: t('nextcloudapptemplate', 'Refresh'),
|
||||
showForm: t('nextcloudapptemplate', 'Show form'),
|
||||
hideForm: t('nextcloudapptemplate', 'Hide form'),
|
||||
searchLabel: t('forum', 'Search'),
|
||||
searchPlaceholder: t('forum', 'Filter messages…'),
|
||||
refresh: t('forum', 'Refresh'),
|
||||
showForm: t('forum', 'Show form'),
|
||||
hideForm: t('forum', 'Hide form'),
|
||||
|
||||
// Info
|
||||
quickHelp: t(
|
||||
'nextcloudapptemplate',
|
||||
'forum',
|
||||
'Use the form to post a hello. The list shows recent hellos fetched from the server. All user-visible text is centralized in {cStart}strings{cEnd}.',
|
||||
{ cStart: '<code>', cEnd: '</code>' },
|
||||
undefined,
|
||||
@@ -191,26 +191,26 @@ export default {
|
||||
),
|
||||
|
||||
// Form
|
||||
formHeader: t('nextcloudapptemplate', 'Say hello'),
|
||||
nameInputLabel: t('nextcloudapptemplate', 'Name'),
|
||||
nameInputPlaceholder: t('nextcloudapptemplate', 'e.g. Ada'),
|
||||
themeLabel: t('nextcloudapptemplate', 'Theme'),
|
||||
add: t('nextcloudapptemplate', 'Add'),
|
||||
clear: t('nextcloudapptemplate', 'Clear'),
|
||||
livePreview: t('nextcloudapptemplate', 'Preview:'),
|
||||
formHeader: t('forum', 'Say hello'),
|
||||
nameInputLabel: t('forum', 'Name'),
|
||||
nameInputPlaceholder: t('forum', 'e.g. Ada'),
|
||||
themeLabel: t('forum', 'Theme'),
|
||||
add: t('forum', 'Add'),
|
||||
clear: t('forum', 'Clear'),
|
||||
livePreview: t('forum', 'Preview:'),
|
||||
|
||||
// List
|
||||
loading: t('nextcloudapptemplate', 'Loading…'),
|
||||
emptyTitle: t('nextcloudapptemplate', 'No hellos yet'),
|
||||
emptyDesc: t('nextcloudapptemplate', 'Try adding one using the form above.'),
|
||||
addExample: t('nextcloudapptemplate', 'Add example'),
|
||||
colMessage: t('nextcloudapptemplate', 'Message'),
|
||||
colAt: t('nextcloudapptemplate', 'Time'),
|
||||
colActions: t('nextcloudapptemplate', 'Actions'),
|
||||
duplicate: t('nextcloudapptemplate', 'Duplicate'),
|
||||
remove: t('nextcloudapptemplate', 'Remove'),
|
||||
clearAll: t('nextcloudapptemplate', 'Clear all'),
|
||||
never: t('nextcloudapptemplate', 'Never'),
|
||||
loading: t('forum', 'Loading…'),
|
||||
emptyTitle: t('forum', 'No hellos yet'),
|
||||
emptyDesc: t('forum', 'Try adding one using the form above.'),
|
||||
addExample: t('forum', 'Add example'),
|
||||
colMessage: t('forum', 'Message'),
|
||||
colAt: t('forum', 'Time'),
|
||||
colActions: t('forum', 'Actions'),
|
||||
duplicate: t('forum', 'Duplicate'),
|
||||
remove: t('forum', 'Remove'),
|
||||
clearAll: t('forum', 'Clear all'),
|
||||
never: t('forum', 'Never'),
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
<?php
|
||||
|
||||
use OCA\NextcloudAppTemplate\AppInfo\Application;
|
||||
use OCA\Forum\AppInfo\Application;
|
||||
use OCP\Util;
|
||||
|
||||
/* @var array $_ */
|
||||
$script = $_['script'];
|
||||
Util::addScript(Application::APP_ID, Application::JS_DIR . "/nextcloudapptemplate-$script");
|
||||
Util::addStyle(Application::APP_ID, Application::CSS_DIR . '/nextcloudapptemplate-style');
|
||||
Util::addScript(Application::APP_ID, Application::JS_DIR . "/forum-$script");
|
||||
Util::addStyle(Application::APP_ID, Application::CSS_DIR . '/forum-style');
|
||||
?>
|
||||
<div id="nextcloudapptemplate-app"></div>
|
||||
<div id="forum-app"></div>
|
||||
|
||||
@@ -1 +1 @@
|
||||
<div id="nextcloudapptemplate-settings"></div>
|
||||
<div id="forum-settings"></div>
|
||||
|
||||
@@ -5,5 +5,5 @@ declare(strict_types=1);
|
||||
require_once __DIR__ . '/../../../tests/bootstrap.php';
|
||||
require_once __DIR__ . '/../vendor/autoload.php';
|
||||
|
||||
\OC_App::loadApp(OCA\NextcloudAppTemplate\AppInfo\Application::APP_ID);
|
||||
\OC_App::loadApp(OCA\Forum\AppInfo\Application::APP_ID);
|
||||
OC_Hook::clear();
|
||||
|
||||
@@ -4,9 +4,9 @@ declare(strict_types=1);
|
||||
|
||||
namespace Controller;
|
||||
|
||||
use OCA\NextcloudAppTemplate\AppInfo\Application;
|
||||
use OCA\NextcloudAppTemplate\Controller\ApiController;
|
||||
use OCA\NextcloudAppTemplate\Service\FetchCurrenciesService;
|
||||
use OCA\Forum\AppInfo\Application;
|
||||
use OCA\Forum\Controller\ApiController;
|
||||
use OCA\Forum\Service\FetchCurrenciesService;
|
||||
use OCP\IAppConfig;
|
||||
use OCP\IL10N;
|
||||
use OCP\IRequest;
|
||||
|
||||
Reference in New Issue
Block a user