From d2cbfc0286009a7d25991b38517acb06b37a4de9 Mon Sep 17 00:00:00 2001 From: Yuri Kuznetsov Date: Thu, 21 Dec 2023 14:31:19 +0200 Subject: [PATCH] about text in file --- application/Espo/Resources/routes.json | 5 ++ application/Espo/Resources/texts/about.md | 15 ++++++ .../Espo/Tools/App/Api/GetAboutText.php | 53 +++++++++++++++++++ client/res/templates/about.tpl | 43 ++++----------- client/src/views/about.js | 8 +++ 5 files changed, 92 insertions(+), 32 deletions(-) create mode 100644 application/Espo/Resources/texts/about.md create mode 100644 application/Espo/Tools/App/Api/GetAboutText.php diff --git a/application/Espo/Resources/routes.json b/application/Espo/Resources/routes.json index aaf7819230..37a348951f 100644 --- a/application/Espo/Resources/routes.json +++ b/application/Espo/Resources/routes.json @@ -17,6 +17,11 @@ "method": "post", "actionClassName": "Espo\\Tools\\App\\Api\\PostDestroyAuthToken" }, + { + "route": "/App/aboutText", + "method": "get", + "actionClassName": "Espo\\Tools\\App\\Api\\GetAboutText" + }, { "route": "/Metadata", "method": "get", diff --git a/application/Espo/Resources/texts/about.md b/application/Espo/Resources/texts/about.md new file mode 100644 index 0000000000..1733ed5241 --- /dev/null +++ b/application/Espo/Resources/texts/about.md @@ -0,0 +1,15 @@ +## EspoCRM – Open Source CRM application + +www.espocrm.com + +Copyright © 2014-2023 EspoCRM: Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko. + +EspoCRM is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + +EspoCRM is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License along with EspoCRM. If not, see http://www.gnu.org/licenses/. + +The interactive user interfaces in modified source and object code versions of this program must display Appropriate Legal Notices, as required under Section 5 of the GNU General Public License version 3. + +In accordance with Section 7(b) of the GNU General Public License version 3, these Appropriate Legal Notices must retain the display of the "EspoCRM" word. diff --git a/application/Espo/Tools/App/Api/GetAboutText.php b/application/Espo/Tools/App/Api/GetAboutText.php new file mode 100644 index 0000000000..19bad13411 --- /dev/null +++ b/application/Espo/Tools/App/Api/GetAboutText.php @@ -0,0 +1,53 @@ +fileReader->read('texts/about.md', FileReader\Params::create()); + + return ResponseComposer::json($text); + } +} diff --git a/client/res/templates/about.tpl b/client/res/templates/about.tpl index 7e1151edcd..cfe25f581e 100644 --- a/client/res/templates/about.tpl +++ b/client/res/templates/about.tpl @@ -1,45 +1,24 @@
-
Version {{version}}

- Copyright © 2014-2023 EspoCRM: Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko. -

-

- Website: www.espocrm.com. -

-

- EspoCRM is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. -

-

- EspoCRM is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty - of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. -

-

- You should have received a copy of the GNU General Public License - along with EspoCRM. If not, see http://www.gnu.org/licenses/. -

- -

- The interactive user interfaces in modified source and object code versions - of this program must display Appropriate Legal Notices, as required under - Section 5 of the GNU General Public License version 3. -

- -

- In accordance with Section 7(b) of the GNU General Public License version 3, - these Appropriate Legal Notices must retain the display of the "EspoCRM" word. + Version {{version}}

+
+
+
+
+ {{text}} +
+
+
+
diff --git a/client/src/views/about.js b/client/src/views/about.js index 55ff5c2276..a16bf289a7 100644 --- a/client/src/views/about.js +++ b/client/src/views/about.js @@ -35,8 +35,16 @@ class AboutView extends View { data() { return { version: this.getConfig().get('version'), + text: this.getHelper().transformMarkdownText(this.text) }; } + + setup() { + this.wait( + Espo.Ajax.getRequest('App/aboutText') + .then(text => this.text = text) + ); + } } export default AboutView;