From cd7f953d0586184f177ef37536aea2105008a1eb Mon Sep 17 00:00:00 2001 From: ghost Date: Wed, 21 Feb 2024 22:06:39 +0200 Subject: [PATCH] remove custom modes --- .env | 2 +- README.md | 6 ----- public/css/default.css | 16 -------------- src/Controller/ModuleController.php | 1 - src/Controller/RoomController.php | 28 ------------------------ templates/default/layout.html.twig | 2 +- templates/default/module/post.html.twig | 2 +- templates/default/module/room.html.twig | 2 +- templates/default/module/rooms.html.twig | 8 +++---- templates/default/room/index.html.twig | 10 ++++----- templates/default/room/list.html.twig | 2 +- templates/default/user/list.html.twig | 6 +---- 12 files changed, 15 insertions(+), 70 deletions(-) diff --git a/.env b/.env index 01b7772..2c66fea 100644 --- a/.env +++ b/.env @@ -19,7 +19,7 @@ APP_ENV=dev APP_SECRET=EDIT_ME ###< symfony/framework-bundle ### -APP_VERSION=1.12.0 +APP_VERSION=1.12.1 APP_NAME=KevaChat diff --git a/README.md b/README.md index 7041768..6fda003 100644 --- a/README.md +++ b/README.md @@ -64,12 +64,6 @@ Application package contain settings preset, just few steps required to launch: * Create at least one room namespace with Web UI or CLI `kevacoin-cli keva_namespace "sandbox"` * Provide at least one namespace for default chat room to `env`.`APP_KEVACOIN_ROOM_NAMESPACE_DEFAULT` (for homepage redirects) -## Modes - -KevaChat supported following `mode` in `GET` requests: - -* `stream` - useful for iframe integrations on external websites to create news feed or support chats - ## Contribution Project created by people for people: MIT License to use it for other needs e.g. new fork, chat instance or KevaCoin blockchain explorer. diff --git a/public/css/default.css b/public/css/default.css index e34cdf4..4e1a2d2 100644 --- a/public/css/default.css +++ b/public/css/default.css @@ -287,20 +287,4 @@ footer > form > output display: block; font-weight: bolder; margin-bottom: 16px; -} - -/* apply mode corrections */ -body[data-mode="stream"] > header -{ - display: none; -} - -body[data-mode="stream"] > main -{ - padding-top: 0; -} - -body[data-mode="stream"] > main ul li div a[name] -{ - top: -16px; } \ No newline at end of file diff --git a/src/Controller/ModuleController.php b/src/Controller/ModuleController.php index e259676..98692a8 100644 --- a/src/Controller/ModuleController.php +++ b/src/Controller/ModuleController.php @@ -188,7 +188,6 @@ class ModuleController extends AbstractController return $this->render( 'default/module/post.html.twig', [ - 'mode' => $request->get('mode'), 'namespace' => $request->get('namespace'), 'error' => $request->get('error'), 'warning' => $request->get('warning'), diff --git a/src/Controller/RoomController.php b/src/Controller/RoomController.php index 0ab8d49..be45d2e 100644 --- a/src/Controller/RoomController.php +++ b/src/Controller/RoomController.php @@ -32,7 +32,6 @@ class RoomController extends AbstractController return $this->redirectToRoute( 'room_namespace', [ - 'mode' => $request->get('mode'), 'namespace' => $request->get('namespace') ? $request->get('namespace') : $this->getParameter('app.kevacoin.room.namespace.default'), '_fragment' => 'latest' ] @@ -365,7 +364,6 @@ class RoomController extends AbstractController return $this->redirectToRoute( 'room_namespace', [ - 'mode' => $request->get('mode'), 'namespace' => $request->get('namespace'), 'message' => $request->get('message'), 'sign' => $request->get('sign'), @@ -413,7 +411,6 @@ class RoomController extends AbstractController return $this->redirectToRoute( 'room_namespace', [ - 'mode' => $request->get('mode'), 'namespace' => $request->get('namespace'), 'message' => $request->get('message'), 'sign' => $request->get('sign'), @@ -437,7 +434,6 @@ class RoomController extends AbstractController return $this->redirectToRoute( 'room_namespace', [ - 'mode' => $request->get('mode'), 'namespace' => $request->get('namespace'), 'message' => $request->get('message'), 'sign' => $request->get('sign'), @@ -466,7 +462,6 @@ class RoomController extends AbstractController return $this->redirectToRoute( 'room_namespace', [ - 'mode' => $request->get('mode'), 'namespace' => $request->get('namespace'), 'message' => $request->get('message'), 'sign' => $request->get('sign'), @@ -482,7 +477,6 @@ class RoomController extends AbstractController return $this->redirectToRoute( 'room_namespace', [ - 'mode' => $request->get('mode'), 'namespace' => $request->get('namespace'), 'message' => $request->get('message'), 'sign' => $request->get('sign'), @@ -501,7 +495,6 @@ class RoomController extends AbstractController return $this->redirectToRoute( 'room_namespace', [ - 'mode' => $request->get('mode'), 'namespace' => $request->get('namespace'), 'message' => $request->get('message'), 'sign' => $request->get('sign'), @@ -520,7 +513,6 @@ class RoomController extends AbstractController return $this->redirectToRoute( 'room_namespace', [ - 'mode' => $request->get('mode'), 'namespace' => $request->get('namespace'), 'message' => $request->get('message'), 'sign' => $request->get('sign'), @@ -536,7 +528,6 @@ class RoomController extends AbstractController return $this->redirectToRoute( 'room_namespace', [ - 'mode' => $request->get('mode'), 'namespace' => $request->get('namespace'), 'message' => $request->get('message'), 'sign' => $request->get('sign'), @@ -556,7 +547,6 @@ class RoomController extends AbstractController return $this->redirectToRoute( 'room_namespace', [ - 'mode' => $request->get('mode'), 'namespace' => $request->get('namespace'), 'message' => $request->get('message'), 'sign' => $request->get('sign'), @@ -575,7 +565,6 @@ class RoomController extends AbstractController return $this->redirectToRoute( 'room_namespace', [ - 'mode' => $request->get('mode'), 'namespace' => $request->get('namespace'), 'message' => $request->get('message'), 'sign' => $request->get('sign'), @@ -649,7 +638,6 @@ class RoomController extends AbstractController return $this->redirectToRoute( 'room_namespace', [ - 'mode' => $request->get('mode'), 'namespace' => $request->get('namespace'), 'sign' => $request->get('sign'), 'error' => null, @@ -722,7 +710,6 @@ class RoomController extends AbstractController return $this->redirectToRoute( 'room_namespace', [ - 'mode' => $request->get('mode'), 'namespace' => $request->get('namespace'), 'sign' => $request->get('sign'), 'message' => null, @@ -768,7 +755,6 @@ class RoomController extends AbstractController return $this->redirectToRoute( 'room_namespace', [ - 'mode' => $request->get('mode'), 'namespace' => $request->get('namespace'), 'sign' => $request->get('sign'), 'error' => null, @@ -783,7 +769,6 @@ class RoomController extends AbstractController return $this->redirectToRoute( 'room_namespace', [ - 'mode' => $request->get('mode'), 'namespace' => $request->get('namespace'), 'message' => $request->get('message'), 'sign' => $request->get('sign'), @@ -813,7 +798,6 @@ class RoomController extends AbstractController return $this->redirectToRoute( 'room_namespace', [ - 'mode' => $request->get('mode'), 'namespace' => $request->get('namespace'), 'message' => $request->get('message'), 'error' => $this->getParameter('app.maintenance'), @@ -864,7 +848,6 @@ class RoomController extends AbstractController return $this->redirectToRoute( 'room_list', [ - 'mode' => $request->get('mode'), 'name' => $name, 'error' => $translator->trans('Session token expired') ] @@ -877,7 +860,6 @@ class RoomController extends AbstractController return $this->redirectToRoute( 'room_list', [ - 'mode' => $request->get('mode'), 'name' => $name, 'error' => $translator->trans('Name length out of KevaCoin protocol limits') ] @@ -890,7 +872,6 @@ class RoomController extends AbstractController return $this->redirectToRoute( 'room_list', [ - 'mode' => $request->get('mode'), 'name' => $name, 'error' => sprintf( $translator->trans('Room name does not match node requirements: %s'), @@ -906,7 +887,6 @@ class RoomController extends AbstractController return $this->redirectToRoute( 'room_list', [ - 'mode' => $request->get('mode'), 'name' => $name, 'error' => $translator->trans('Could not create namespace in meta area') ] @@ -926,7 +906,6 @@ class RoomController extends AbstractController return $this->redirectToRoute( 'room_list', [ - 'mode' => $request->get('mode'), 'name' => $name, 'error' => $translator->trans('Room with same name already exists on this node!') ] @@ -939,7 +918,6 @@ class RoomController extends AbstractController return $this->redirectToRoute( 'room_list', [ - 'mode' => $request->get('mode'), 'name' => $name, 'error' => sprintf( $translator->trans('Access denied for host %s!'), @@ -955,7 +933,6 @@ class RoomController extends AbstractController return $this->redirectToRoute( 'room_list', [ - 'mode' => $request->get('mode'), 'name' => $name, 'error' => sprintf( $translator->trans('Access restricted for host %s!'), @@ -972,7 +949,6 @@ class RoomController extends AbstractController return $this->redirectToRoute( 'room_list', [ - 'mode' => $request->get('mode'), 'name' => $name, 'error' => sprintf( $translator->trans('Please wait for %s seconds before add new room!'), @@ -988,7 +964,6 @@ class RoomController extends AbstractController return $this->redirectToRoute( 'room_list', [ - 'mode' => $request->get('mode'), 'name' => $name, 'error' => $translator->trans('Insufficient funds') ] @@ -1046,7 +1021,6 @@ class RoomController extends AbstractController return $this->redirectToRoute( 'room_list', [ - 'mode' => $request->get('mode'), 'name' => $name, 'warning' => sprintf( $translator->trans('To complete, send %s KVA to %s'), @@ -1093,7 +1067,6 @@ class RoomController extends AbstractController return $this->redirectToRoute( 'room_namespace', [ - 'mode' => $request->get('mode'), 'namespace' => $namespace['namespaceId'], 'error' => null, 'message' => null, @@ -1106,7 +1079,6 @@ class RoomController extends AbstractController return $this->redirectToRoute( 'room_list', [ - 'mode' => $request->get('mode'), 'name' => $name, 'error' => $translator->trans('Internal error! Please feedback') ] diff --git a/templates/default/layout.html.twig b/templates/default/layout.html.twig index 33e6cd8..141c2b8 100644 --- a/templates/default/layout.html.twig +++ b/templates/default/layout.html.twig @@ -5,7 +5,7 @@ {% block head_title_content %}{{ app.name }}{% endblock %} - + {% block header_container %}
{% block header_content %} diff --git a/templates/default/module/post.html.twig b/templates/default/module/post.html.twig index a7a2b32..9a376cd 100644 --- a/templates/default/module/post.html.twig +++ b/templates/default/module/post.html.twig @@ -1,5 +1,5 @@ {% if enabled %} -
+ {% if error %} {{ error }} {% endif %} diff --git a/templates/default/module/room.html.twig b/templates/default/module/room.html.twig index 4f538c8..1326bfa 100644 --- a/templates/default/module/room.html.twig +++ b/templates/default/module/room.html.twig @@ -1,4 +1,4 @@ - + {% if request.get('error') %} {{ request.get('error') }} {% endif %} diff --git a/templates/default/module/rooms.html.twig b/templates/default/module/rooms.html.twig index 83dd13e..3d4d5d5 100644 --- a/templates/default/module/rooms.html.twig +++ b/templates/default/module/rooms.html.twig @@ -1,4 +1,4 @@ - +
{% if list %} @@ -8,7 +8,7 @@ {% if namespace == request.get('namespace') %} {{ namespace | keva_namespace_value }} {% else %} - {{ namespace | keva_namespace_value }} + {{ namespace | keva_namespace_value }} {% endif %} @@ -26,7 +26,7 @@ {% if 'room_list' == request.get('_route') %} {{ 'rooms' | trans }} {% else %} - {{ 'rooms' | trans }} + {{ 'rooms' | trans }} {% endif %} @@ -41,7 +41,7 @@ {% if 'user_list' == request.get('_route') %} {{ 'users' | trans }} {% else %} - {{ 'users' | trans }} + {{ 'users' | trans }} {% endif %} diff --git a/templates/default/room/index.html.twig b/templates/default/room/index.html.twig index fb4195b..61fae12 100644 --- a/templates/default/room/index.html.twig +++ b/templates/default/room/index.html.twig @@ -1,4 +1,4 @@ -{% macro recursive_post_tree(mode, namespace, writable, tree) %} +{% macro recursive_post_tree(namespace, writable, tree) %} {% import _self as self %} {% if tree | length %}