Show the version number of Part-DB on homepage.

This commit is contained in:
Jan Böhmer 2019-03-12 13:34:33 +01:00
parent a748a6328d
commit 95cd56f0bd
11 changed files with 150 additions and 6 deletions

2
.idea/php.xml generated
View file

@ -116,6 +116,8 @@
<path value="$PROJECT_DIR$/vendor/twig/extensions" />
<path value="$PROJECT_DIR$/vendor/omines/datatables-bundle" />
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-intl-idn" />
<path value="$PROJECT_DIR$/vendor/nikolaposa/version" />
<path value="$PROJECT_DIR$/vendor/shivas/versioning-bundle" />
</include_path>
</component>
<component name="PhpProjectSharedConfiguration" php_language_level="7.1" />

1
VERSION Normal file
View file

@ -0,0 +1 @@
1.0.0-alpha

View file

@ -7,6 +7,7 @@
"ext-iconv": "*",
"omines/datatables-bundle": "^0.2.2",
"sensio/framework-extra-bundle": "^5.1",
"shivas/versioning-bundle": "^3.1",
"symfony/asset": "4.2.*",
"symfony/console": "4.2.*",
"symfony/dotenv": "4.2.*",

110
composer.lock generated
View file

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
"content-hash": "61459a4adf332f0c6f3242b54f1eedb1",
"content-hash": "b8930537cde9ee459d093b68931b8d5a",
"packages": [
{
"name": "doctrine/annotations",
@ -1429,6 +1429,62 @@
],
"time": "2018-11-05T09:00:11+00:00"
},
{
"name": "nikolaposa/version",
"version": "2.2.2",
"source": {
"type": "git",
"url": "https://github.com/nikolaposa/version.git",
"reference": "9fd723babf6fccc9ee221e3b987348af0b00a8c7"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/nikolaposa/version/zipball/9fd723babf6fccc9ee221e3b987348af0b00a8c7",
"reference": "9fd723babf6fccc9ee221e3b987348af0b00a8c7",
"shasum": ""
},
"require": {
"php": ">=5.5"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^1.11",
"phpunit/phpunit": "^4.7"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.2.x-dev"
}
},
"autoload": {
"psr-4": {
"Version\\": "src/"
},
"classmap": [
"src/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Nikola Poša",
"email": "posa.nikola@gmail.com",
"homepage": "http://www.nikolaposa.in.rs"
}
],
"description": "Value Object that represents a SemVer-compliant version number.",
"homepage": "https://github.com/nikolaposa/version",
"keywords": [
"semantic",
"semver",
"version",
"versioning"
],
"time": "2018-04-22T08:54:55+00:00"
},
{
"name": "ocramius/package-versions",
"version": "1.4.0",
@ -2097,6 +2153,58 @@
],
"time": "2018-12-11T16:59:23+00:00"
},
{
"name": "shivas/versioning-bundle",
"version": "3.1.3",
"source": {
"type": "git",
"url": "https://github.com/shivas/versioning-bundle.git",
"reference": "ff92fb096646a1330f1e72cdd8ed83a581079450"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/shivas/versioning-bundle/zipball/ff92fb096646a1330f1e72cdd8ed83a581079450",
"reference": "ff92fb096646a1330f1e72cdd8ed83a581079450",
"shasum": ""
},
"require": {
"nikolaposa/version": "^2.2",
"php": "^7.0",
"symfony/console": "^3.4|^4.0",
"symfony/framework-bundle": "^3.4|^4.0",
"symfony/process": "^3.4|^4.0"
},
"require-dev": {
"composer/composer": "^1.0",
"phpunit/phpunit": "^5.5"
},
"type": "symfony-bundle",
"autoload": {
"psr-4": {
"Shivas\\VersioningBundle\\": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Audrius Karabanovas",
"email": "audrius@karabanovas.net",
"role": "Developer"
}
],
"description": "Symfony3|4 application versioning, simple console command to manage version (with providers e.g. git tag) of your application using Semantic Versioning 2.0.0 recommendations",
"homepage": "https://github.com/shivas/versioning-bundle",
"keywords": [
"semantic",
"semver",
"version",
"versioning"
],
"time": "2018-04-30T06:42:35+00:00"
},
{
"name": "swiftmailer/swiftmailer",
"version": "v6.2.0",

View file

@ -16,4 +16,5 @@ return [
Symfony\Bundle\WebServerBundle\WebServerBundle::class => ['dev' => true],
Symfony\WebpackEncoreBundle\WebpackEncoreBundle::class => ['all' => true],
Omines\DataTablesBundle\DataTablesBundle::class => ['all' => true],
Shivas\VersioningBundle\ShivasVersioningBundle::class => ['all' => true],
];

View file

@ -4,4 +4,4 @@ twig:
strict_variables: '%kernel.debug%'
globals:
partdb_title: "Part-DB"
partdb_title: '%partdb_title%'

View file

@ -3,8 +3,11 @@
# Put parameters here that don't need to change on each machine where the app is deployed
# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration
parameters:
locale: 'en'
locale: 'en' # Set the default language to use her
partdb_title: 'Part-DB' # The title shown inside of Part-DB (e.g. in the navbar and on homepage)
banner: '' # The info text shown in the homepage
services:
# default configuration for services in *this* file

View file

@ -39,6 +39,7 @@ use App\Entity\AttachmentType;
use App\Entity\Category;
use App\Entity\Part;
use App\Entity\StructuralDBElement;
use Shivas\VersioningBundle\Service\VersionManager;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
@ -48,8 +49,11 @@ class HomepageController extends AbstractController
/**
* @Route("/", name="homepage")
*/
function homepage()
function homepage(VersionManager $versionManager)
{
return $this->render('base.html.twig');
return $this->render('homepage.html.twig',
[
'banner' => $this->getParameter('banner')
]);
}
}

View file

@ -108,6 +108,9 @@
"nikic/php-parser": {
"version": "v4.2.1"
},
"nikolaposa/version": {
"version": "2.2.2"
},
"ocramius/proxy-manager": {
"version": "2.1.1"
},
@ -159,6 +162,9 @@
"./config/packages/sensio_framework_extra.yaml"
]
},
"shivas/versioning-bundle": {
"version": "3.1.3"
},
"swiftmailer/swiftmailer": {
"version": "v6.1.3"
},

View file

@ -3,7 +3,7 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>{% block title %}Part-DB{% endblock %}</title>
<title>{% block title %}{{ partdb_title }}{% endblock %}</title>
{% block stylesheets %}
{{ encore_entry_link_tags('app') }}
{% endblock %}

View file

@ -0,0 +1,18 @@
{% extends "base.html.twig" %}
{% block content %}
<div class="jumbotron">
<h1 class="display-3">{{ partdb_title }}</h1>
<h4>
{% trans %}version.caption{% endtrans %}: {{ shivas_app_version }}
</h4>
{% if banner is not empty %}
<hr>
<div>
<h5>{{ banner }}</h5>
</div>
{% endif %}
</div>
{% endblock %}