Added changelog page

This commit is contained in:
Luca Patera 2020-04-13 16:30:05 +02:00
parent 9cad1dc35b
commit a37854ef57
9 changed files with 116 additions and 24 deletions

View file

@ -146,6 +146,7 @@ module.exports = function (grunt) {
'composer.lock',
'LICENSE',
'favicon.ico',
'CHANGELOG.md'
]
},
@ -154,7 +155,7 @@ module.exports = function (grunt) {
command: '"./vendor/bin/phpstan" --level=0 analyse app resources/lang bin install'
},
composer_no_dev: {
command: 'composer update --no-dev --prefer-dist'
command: 'composer install --no-dev --prefer-dist'
}
}

View file

@ -4,6 +4,7 @@ namespace App\Controllers;
use App\Web\Session;
use Monolog\Logger;
use Parsedown;
use Psr\Http\Message\ResponseInterface as Response;
use Psr\Http\Message\ServerRequestInterface as Request;
use RuntimeException;
@ -153,6 +154,21 @@ class UpgradeController extends Controller
return json($response, $jsonResponse);
}
/**
* @param Request $request
* @param Response $response
* @return Response
* @throws \Twig\Error\LoaderError
* @throws \Twig\Error\RuntimeError
* @throws \Twig\Error\SyntaxError
*/
public function changelog(Request $request, Response $response): Response
{
return view()->render($response, 'dashboard/changelog.twig', [
'content' => Parsedown::instance()->text(file_get_contents('CHANGELOG.md')),
]);
}
protected function getApiJson()
{

View file

@ -34,10 +34,11 @@ $app->group('', function (RouteCollectorProxy $group) {
$group->get('/system/themes', [AdminController::class, 'getThemes'])->setName('theme');
$group->post('/system/settings/save', [SettingController::class, 'saveSettings'])->setName('settings.save');
$group->post('/system/upgrade', [UpgradeController::class, 'upgrade'])->setName('system.upgrade');
$group->get('/system/checkForUpdates', [UpgradeController::class, 'checkForUpdates'])->setName('system.checkForUpdates');
$group->get('/system/changelog', [UpgradeController::class, 'changelog'])->setName('system.changelog');
$group->get('/system', [AdminController::class, 'system'])->setName('system');
$group->get('/users[/page/{page}]', [UserController::class, 'index'])->setName('user.index');

View file

@ -1,5 +1,6 @@
{
"name": "sergix44/xbackbone",
"license": "AGPL-3.0",
"version": "3.1.2",
"description": "A lightweight ShareX PHP backend",
"type": "project",
@ -10,6 +11,7 @@
"ext-json": "*",
"ext-pdo": "*",
"ext-zip": "*",
"erusev/parsedown": "^1.7",
"guzzlehttp/psr7": "^1.6",
"http-interop/http-factory-guzzle": "^1.0",
"intervention/image": "^2.4",

89
composer.lock generated
View file

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "6f92268190e2189e19ce34681370d6f3",
"content-hash": "38f18f0b967be3ce9096df807dea1a17",
"packages": [
{
"name": "aws/aws-sdk-php",
@ -90,6 +90,52 @@
],
"time": "2020-04-08T18:27:07+00:00"
},
{
"name": "erusev/parsedown",
"version": "1.7.4",
"source": {
"type": "git",
"url": "https://github.com/erusev/parsedown.git",
"reference": "cb17b6477dfff935958ba01325f2e8a2bfa6dab3"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/erusev/parsedown/zipball/cb17b6477dfff935958ba01325f2e8a2bfa6dab3",
"reference": "cb17b6477dfff935958ba01325f2e8a2bfa6dab3",
"shasum": ""
},
"require": {
"ext-mbstring": "*",
"php": ">=5.3.0"
},
"require-dev": {
"phpunit/phpunit": "^4.8.35"
},
"type": "library",
"autoload": {
"psr-0": {
"Parsedown": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Emanuil Rusev",
"email": "hello@erusev.com",
"homepage": "http://erusev.com"
}
],
"description": "Parser for Markdown.",
"homepage": "http://parsedown.org",
"keywords": [
"markdown",
"parser"
],
"time": "2019-12-30T22:54:17+00:00"
},
{
"name": "firebase/php-jwt",
"version": "v5.2.0",
@ -3019,34 +3065,35 @@
},
{
"name": "ocramius/package-versions",
"version": "1.4.2",
"version": "1.8.0",
"source": {
"type": "git",
"url": "https://github.com/Ocramius/PackageVersions.git",
"reference": "44af6f3a2e2e04f2af46bcb302ad9600cba41c7d"
"reference": "421679846270a5772534828013a93be709fb13df"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Ocramius/PackageVersions/zipball/44af6f3a2e2e04f2af46bcb302ad9600cba41c7d",
"reference": "44af6f3a2e2e04f2af46bcb302ad9600cba41c7d",
"url": "https://api.github.com/repos/Ocramius/PackageVersions/zipball/421679846270a5772534828013a93be709fb13df",
"reference": "421679846270a5772534828013a93be709fb13df",
"shasum": ""
},
"require": {
"composer-plugin-api": "^1.0.0",
"php": "^7.1.0"
"composer-plugin-api": "^1.1.0 || ^2.0",
"php": "^7.4.0"
},
"require-dev": {
"composer/composer": "^1.6.3",
"doctrine/coding-standard": "^5.0.1",
"ext-zip": "*",
"infection/infection": "^0.7.1",
"phpunit/phpunit": "^7.5.17"
"composer/composer": "^1.9.3 || ^2.0@dev",
"doctrine/coding-standard": "^7.0.2",
"ext-zip": "^1.15.0",
"infection/infection": "^0.15.3",
"phpunit/phpunit": "^9.0.1",
"vimeo/psalm": "^3.9.3"
},
"type": "composer-plugin",
"extra": {
"class": "PackageVersions\\Installer",
"branch-alias": {
"dev-master": "2.0.x-dev"
"dev-master": "1.99.x-dev"
}
},
"autoload": {
@ -3065,7 +3112,7 @@
}
],
"description": "Composer plugin that provides efficient querying for installed package versions (no runtime IO)",
"time": "2019-11-15T16:17:10+00:00"
"time": "2020-04-06T17:43:35+00:00"
},
{
"name": "phpstan/phpdoc-parser",
@ -3374,20 +3421,20 @@
},
{
"name": "symfony/service-contracts",
"version": "v1.1.8",
"version": "v2.0.1",
"source": {
"type": "git",
"url": "https://github.com/symfony/service-contracts.git",
"reference": "ffc7f5692092df31515df2a5ecf3b7302b3ddacf"
"reference": "144c5e51266b281231e947b51223ba14acf1a749"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/service-contracts/zipball/ffc7f5692092df31515df2a5ecf3b7302b3ddacf",
"reference": "ffc7f5692092df31515df2a5ecf3b7302b3ddacf",
"url": "https://api.github.com/repos/symfony/service-contracts/zipball/144c5e51266b281231e947b51223ba14acf1a749",
"reference": "144c5e51266b281231e947b51223ba14acf1a749",
"shasum": ""
},
"require": {
"php": "^7.1.3",
"php": "^7.2.5",
"psr/container": "^1.0"
},
"suggest": {
@ -3396,7 +3443,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.1-dev"
"dev-master": "2.0-dev"
}
},
"autoload": {
@ -3428,7 +3475,7 @@
"interoperability",
"standards"
],
"time": "2019-10-14T12:27:06+00:00"
"time": "2019-11-18T17:27:11+00:00"
}
],
"aliases": [],

View file

@ -156,4 +156,6 @@ return [
'no_tags' => 'No tags added',
'auto_tagging' => 'Auto upload tagging',
'zip_ext_not_loaded' => 'The required "zip" extension is not loaded',
'changelog' => 'Changelog',
'show_changelog' => 'Show changelog',
];

View file

@ -1,4 +1,5 @@
<?php
return [
'lang' => 'Italian',
'yes' => 'Sì',
@ -158,4 +159,6 @@ return [
'mail.recover_text' => 'Ciao %s,<br>è stata richiesta una reimpostazione della password per il tuo account. Per completare la procedura clicca sul seguente link:<br><br><a href="%s">%s</a><br><br>Se non sei stato tu a richiedere la reimpostazione della password, ignora semplicemente questa e-mail.',
'mail.activate_text' => 'Ciao %s!<br>grazie per aver creato il tuo account su %s (<a href="%s">%s</a>), fai clic sul seguente link per attivarlo:<br><br><a href="%s">%s</a>',
'zip_ext_not_loaded' => 'L\'estensione "zip" richiesta non è caricata',
'changelog' => 'Changelog',
'show_changelog' => 'Mostra changelog'
];

View file

@ -0,0 +1,17 @@
{% extends 'base.twig' %}
{% block title %}{{ lang('changelog') }}{% endblock %}
{% block content %}
{% include 'comp/navbar.twig' %}
<div class="container">
<div class="card shadow-sm mt-3">
<div class="card-header">{{ lang('changelog') }}</div>
<div class="card-body">
{{ content | raw }}
</div>
</div>
</div>
{% endblock %}

View file

@ -162,6 +162,9 @@
</div>
</div>
</div>
<div class="card-footer text-center">
<a href="{{ route('system.changelog') }}">{{ lang('show_changelog') }}</a>
</div>
</div>
</div>
<div class="col-md-4 mt-3">