diff --git a/.idea/php.xml b/.idea/php.xml index cf4c3067..cad75414 100644 --- a/.idea/php.xml +++ b/.idea/php.xml @@ -116,6 +116,8 @@ + + diff --git a/VERSION b/VERSION new file mode 100644 index 00000000..be0aef56 --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +1.0.0-alpha \ No newline at end of file diff --git a/composer.json b/composer.json index cd7312b2..a24ada54 100644 --- a/composer.json +++ b/composer.json @@ -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.*", diff --git a/composer.lock b/composer.lock index 6b0811f3..8e347502 100644 --- a/composer.lock +++ b/composer.lock @@ -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", diff --git a/config/bundles.php b/config/bundles.php index 4e218ebc..36851112 100644 --- a/config/bundles.php +++ b/config/bundles.php @@ -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], ]; diff --git a/config/packages/twig.yaml b/config/packages/twig.yaml index 5b910f77..9d076b84 100644 --- a/config/packages/twig.yaml +++ b/config/packages/twig.yaml @@ -4,4 +4,4 @@ twig: strict_variables: '%kernel.debug%' globals: - partdb_title: "Part-DB" + partdb_title: '%partdb_title%' diff --git a/config/services.yaml b/config/services.yaml index 10bca7de..73dc2984 100644 --- a/config/services.yaml +++ b/config/services.yaml @@ -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 diff --git a/src/Controller/HomepageController.php b/src/Controller/HomepageController.php index d8f5d228..735bc297 100644 --- a/src/Controller/HomepageController.php +++ b/src/Controller/HomepageController.php @@ -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') + ]); } } \ No newline at end of file diff --git a/symfony.lock b/symfony.lock index 18be144f..6c38d290 100644 --- a/symfony.lock +++ b/symfony.lock @@ -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" }, diff --git a/templates/base.html.twig b/templates/base.html.twig index 48e557ee..02cdbdb0 100644 --- a/templates/base.html.twig +++ b/templates/base.html.twig @@ -3,7 +3,7 @@ - {% block title %}Part-DB{% endblock %} + {% block title %}{{ partdb_title }}{% endblock %} {% block stylesheets %} {{ encore_entry_link_tags('app') }} {% endblock %} diff --git a/templates/homepage.html.twig b/templates/homepage.html.twig new file mode 100644 index 00000000..8ff1f4fa --- /dev/null +++ b/templates/homepage.html.twig @@ -0,0 +1,18 @@ +{% extends "base.html.twig" %} + +{% block content %} +
+

{{ partdb_title }}

+ +

+ {% trans %}version.caption{% endtrans %}: {{ shivas_app_version }} +

+ + {% if banner is not empty %} +
+
+
{{ banner }}
+
+ {% endif %} +
+{% endblock %} \ No newline at end of file