A lot of visual updates

This commit is contained in:
Timothy Warren 2018-07-23 09:52:00 -04:00
parent 307181e03d
commit 513974292a
25 changed files with 1182 additions and 412 deletions

View File

@ -3,14 +3,16 @@
"license": "proprietary", "license": "proprietary",
"require": { "require": {
"php": "^7.2.0", "php": "^7.2.0",
"sensio/framework-extra-bundle": "^5.2",
"symfony/debug-pack": "^1.0", "symfony/debug-pack": "^1.0",
"symfony/form": "^4.0", "symfony/form": "^4.0",
"symfony/maker-bundle": "^1.0", "symfony/maker-bundle": "^1.0",
"symfony/orm-pack": "^1.0" "symfony/orm-pack": "^1.0"
}, },
"require-dev": { "require-dev": {
"symfony/flex": "^1.0", "roave/security-advisories": "dev-master",
"symfony/dotenv": "^4.0" "symfony/dotenv": "^4.0",
"symfony/flex": "^1.0"
}, },
"config": { "config": {
"preferred-install": { "preferred-install": {

257
composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "88c714a6bc903ca05f5c8e9220b78a27", "content-hash": "2babc300973f97bc97e2ba8e4f35f47c",
"packages": [ "packages": [
{ {
"name": "doctrine/annotations", "name": "doctrine/annotations",
@ -1707,6 +1707,77 @@
], ],
"time": "2017-10-23T01:57:42+00:00" "time": "2017-10-23T01:57:42+00:00"
}, },
{
"name": "sensio/framework-extra-bundle",
"version": "v5.2.0",
"source": {
"type": "git",
"url": "https://github.com/sensiolabs/SensioFrameworkExtraBundle.git",
"reference": "50e8b7292425957b8fd66887504430c89bcbd83c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sensiolabs/SensioFrameworkExtraBundle/zipball/50e8b7292425957b8fd66887504430c89bcbd83c",
"reference": "50e8b7292425957b8fd66887504430c89bcbd83c",
"shasum": ""
},
"require": {
"doctrine/common": "^2.2",
"symfony/config": "^3.3|^4.0",
"symfony/dependency-injection": "^3.3|^4.0",
"symfony/framework-bundle": "^3.4|^4.0",
"symfony/http-kernel": "^3.3|^4.0"
},
"require-dev": {
"doctrine/doctrine-bundle": "^1.6",
"doctrine/orm": "^2.5",
"symfony/browser-kit": "^3.3|^4.0",
"symfony/dom-crawler": "^3.3|^4.0",
"symfony/expression-language": "^3.3|^4.0",
"symfony/finder": "^3.3|^4.0",
"symfony/monolog-bridge": "^3.0|^4.0",
"symfony/monolog-bundle": "^3.2",
"symfony/phpunit-bridge": "^3.3|^4.0",
"symfony/psr-http-message-bridge": "^0.3",
"symfony/security-bundle": "^3.3|^4.0",
"symfony/twig-bundle": "^3.3|^4.0",
"symfony/yaml": "^3.3|^4.0",
"twig/twig": "~1.12|~2.0",
"zendframework/zend-diactoros": "^1.3"
},
"suggest": {
"symfony/expression-language": "",
"symfony/psr-http-message-bridge": "To use the PSR-7 converters",
"symfony/security-bundle": ""
},
"type": "symfony-bundle",
"extra": {
"branch-alias": {
"dev-master": "5.2.x-dev"
}
},
"autoload": {
"psr-4": {
"Sensio\\Bundle\\FrameworkExtraBundle\\": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
}
],
"description": "This bundle provides a way to configure your controllers with annotations",
"keywords": [
"annotations",
"controllers"
],
"time": "2018-05-12T09:37:42+00:00"
},
{ {
"name": "symfony/cache", "name": "symfony/cache",
"version": "v4.1.1", "version": "v4.1.1",
@ -4105,6 +4176,176 @@
} }
], ],
"packages-dev": [ "packages-dev": [
{
"name": "roave/security-advisories",
"version": "dev-master",
"source": {
"type": "git",
"url": "https://github.com/Roave/SecurityAdvisories.git",
"reference": "053766d789f6393e5bc0896635d35abf8d2d362e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/053766d789f6393e5bc0896635d35abf8d2d362e",
"reference": "053766d789f6393e5bc0896635d35abf8d2d362e",
"shasum": ""
},
"conflict": {
"3f/pygmentize": "<1.2",
"adodb/adodb-php": "<5.20.12",
"amphp/artax": "<1.0.6|>=2,<2.0.6",
"amphp/http": "<1.0.1",
"asymmetricrypt/asymmetricrypt": ">=0,<9.9.99",
"aws/aws-sdk-php": ">=3,<3.2.1",
"bugsnag/bugsnag-laravel": ">=2,<2.0.2",
"cakephp/cakephp": ">=1.3,<1.3.18|>=2,<2.4.99|>=2.5,<2.5.99|>=2.6,<2.6.12|>=2.7,<2.7.6|>=3,<3.0.15|>=3.1,<3.1.4|>=3.4,<3.4.14|>=3.5,<3.5.17|>=3.6,<3.6.4",
"cart2quote/module-quotation": ">=4.1.6,<=4.4.5|>=5,<5.4.4",
"cartalyst/sentry": "<=2.1.6",
"codeigniter/framework": "<=3.0.6",
"composer/composer": "<=1.0.0-alpha11",
"contao-components/mediaelement": ">=2.14.2,<2.21.1",
"contao/core": ">=2,<3.5.35",
"contao/core-bundle": ">=4,<4.4.18|>=4.5,<4.5.8",
"contao/listing-bundle": ">=4,<4.4.8",
"contao/newsletter-bundle": ">=4,<4.1",
"doctrine/annotations": ">=1,<1.2.7",
"doctrine/cache": ">=1,<1.3.2|>=1.4,<1.4.2",
"doctrine/common": ">=2,<2.4.3|>=2.5,<2.5.1",
"doctrine/dbal": ">=2,<2.0.8|>=2.1,<2.1.2",
"doctrine/doctrine-bundle": "<1.5.2",
"doctrine/doctrine-module": "<=0.7.1",
"doctrine/mongodb-odm": ">=1,<1.0.2",
"doctrine/mongodb-odm-bundle": ">=2,<3.0.1",
"doctrine/orm": ">=2,<2.4.8|>=2.5,<2.5.1",
"dompdf/dompdf": ">=0.6,<0.6.2",
"drupal/core": ">=7,<7.59|>=8,<8.4.8|>=8.5,<8.5.3",
"drupal/drupal": ">=7,<7.59|>=8,<8.4.8|>=8.5,<8.5.3",
"erusev/parsedown": "<1.7",
"ezsystems/ezpublish-legacy": ">=5.3,<5.3.12.3|>=5.4,<5.4.11.3|>=2017.8,<2017.8.1.1|>=2017.12,<2017.12.2.1",
"firebase/php-jwt": "<2",
"friendsofsymfony/rest-bundle": ">=1.2,<1.2.2",
"friendsofsymfony/user-bundle": ">=1.2,<1.3.5",
"fuel/core": "<1.8.1",
"gree/jose": "<=2.2",
"gregwar/rst": "<1.0.3",
"guzzlehttp/guzzle": ">=6,<6.2.1|>=4.0.0-rc2,<4.2.4|>=5,<5.3.1",
"illuminate/auth": ">=4,<4.0.99|>=4.1,<=4.1.31|>=4.2,<=4.2.22|>=5,<=5.0.35|>=5.1,<=5.1.46|>=5.2,<=5.2.45|>=5.3,<=5.3.31|>=5.4,<=5.4.36|>=5.5,<5.5.10",
"illuminate/database": ">=4,<4.0.99|>=4.1,<4.1.29",
"illuminate/encryption": ">=4,<=4.0.11|>=4.1,<=4.1.31|>=4.2,<=4.2.22|>=5,<=5.0.35|>=5.1,<=5.1.46|>=5.2,<=5.2.45|>=5.3,<=5.3.31|>=5.4,<=5.4.36|>=5.5,<5.5.40|>=5.6,<5.6.15",
"joomla/session": "<1.3.1",
"kreait/firebase-php": ">=3.2,<3.8.1",
"laravel/framework": ">=4,<4.0.99|>=4.1,<=4.1.31|>=4.2,<=4.2.22|>=5,<=5.0.35|>=5.1,<=5.1.46|>=5.2,<=5.2.45|>=5.3,<=5.3.31|>=5.4,<=5.4.36|>=5.5,<5.5.40|>=5.6,<5.6.15",
"laravel/socialite": ">=1,<1.0.99|>=2,<2.0.10",
"magento/magento1ce": "<1.9.3.9",
"magento/magento1ee": ">=1.9,<1.14.3.2",
"magento/product-community-edition": ">=2,<2.2.5",
"monolog/monolog": ">=1.8,<1.12",
"namshi/jose": "<2.2",
"onelogin/php-saml": "<2.10.4",
"oro/crm": ">=1.7,<1.7.4",
"oro/platform": ">=1.7,<1.7.4",
"padraic/humbug_get_contents": "<1.1.2",
"pagarme/pagarme-php": ">=0,<3",
"paragonie/random_compat": "<2",
"paypal/merchant-sdk-php": "<3.12",
"phpmailer/phpmailer": ">=5,<5.2.24",
"phpunit/phpunit": ">=4.8.19,<4.8.28|>=5.0.10,<5.6.3",
"phpxmlrpc/extras": "<0.6.1",
"propel/propel": ">=2.0.0-alpha1,<=2.0.0-alpha7",
"propel/propel1": ">=1,<=1.7.1",
"pusher/pusher-php-server": "<2.2.1",
"sabre/dav": ">=1.6,<1.6.99|>=1.7,<1.7.11|>=1.8,<1.8.9",
"sensiolabs/connect": "<4.2.3",
"shopware/shopware": "<5.3.7",
"silverstripe/cms": ">=3,<=3.0.11|>=3.1,<3.1.11",
"silverstripe/forum": "<=0.6.1|>=0.7,<=0.7.3",
"silverstripe/framework": ">=3,<3.3",
"silverstripe/userforms": "<3",
"simplesamlphp/saml2": "<1.10.6|>=2,<2.3.8|>=3,<3.1.4",
"simplesamlphp/simplesamlphp": "<1.15.2",
"simplesamlphp/simplesamlphp-module-infocard": "<1.0.1",
"slim/slim": "<2.6",
"socalnick/scn-social-auth": "<1.15.2",
"squizlabs/php_codesniffer": ">=1,<2.8.1|>=3,<3.0.1",
"stormpath/sdk": ">=0,<9.9.99",
"swiftmailer/swiftmailer": ">=4,<5.4.5",
"sylius/admin-bundle": ">=1,<1.0.17|>=1.1,<1.1.9|>=1.2,<1.2.2",
"sylius/sylius": ">=1,<1.0.17|>=1.1,<1.1.9|>=1.2,<1.2.2",
"symfony/dependency-injection": ">=2,<2.0.17",
"symfony/form": ">=2.3,<2.3.35|>=2.4,<2.6.12|>=2.7,<2.7.38|>=2.8,<2.8.31|>=3,<3.2.14|>=3.3,<3.3.13",
"symfony/framework-bundle": ">=2,<2.3.18|>=2.4,<2.4.8|>=2.5,<2.5.2",
"symfony/http-foundation": ">=2,<2.7.48|>=2.8,<2.8.41|>=3,<3.3.17|>=3.4,<3.4.11|>=4,<4.0.11",
"symfony/http-kernel": ">=2,<2.3.29|>=2.4,<2.5.12|>=2.6,<2.6.8",
"symfony/intl": ">=2.7,<2.7.38|>=2.8,<2.8.31|>=3,<3.2.14|>=3.3,<3.3.13",
"symfony/routing": ">=2,<2.0.19",
"symfony/security": ">=2,<2.7.48|>=2.8,<2.8.41|>=3,<3.3.17|>=3.4,<3.4.11|>=4,<4.0.11",
"symfony/security-bundle": ">=2,<2.7.48|>=2.8,<2.8.41|>=3,<3.3.17|>=3.4,<3.4.11|>=4,<4.0.11",
"symfony/security-core": ">=2.4,<2.6.13|>=2.7,<2.7.9|>=2.7.30,<2.7.32|>=2.8,<2.8.37|>=3,<3.3.17|>=3.4,<3.4.7|>=4,<4.0.7",
"symfony/security-csrf": ">=2.4,<2.7.48|>=2.8,<2.8.41|>=3,<3.3.17|>=3.4,<3.4.11|>=4,<4.0.11",
"symfony/security-guard": ">=2.8,<2.8.41|>=3,<3.3.17|>=3.4,<3.4.11|>=4,<4.0.11",
"symfony/security-http": ">=2.3,<2.3.41|>=2.4,<2.7.48|>=2.8,<2.8.41|>=3,<3.3.17|>=3.4,<3.4.11|>=4,<4.0.11",
"symfony/serializer": ">=2,<2.0.11",
"symfony/symfony": ">=2,<2.7.48|>=2.8,<2.8.41|>=3,<3.3.17|>=3.4,<3.4.11|>=4,<4.0.11",
"symfony/translation": ">=2,<2.0.17",
"symfony/validator": ">=2,<2.0.24|>=2.1,<2.1.12|>=2.2,<2.2.5|>=2.3,<2.3.3",
"symfony/web-profiler-bundle": ">=2,<2.3.19|>=2.4,<2.4.9|>=2.5,<2.5.4",
"symfony/yaml": ">=2,<2.0.22|>=2.1,<2.1.7",
"thelia/backoffice-default-template": ">=2.1,<2.1.2",
"thelia/thelia": ">=2.1,<2.1.2|>=2.1.0-beta1,<2.1.3",
"titon/framework": ">=0,<9.9.99",
"twig/twig": "<1.20",
"typo3/cms": ">=6.2,<6.2.30|>=7,<7.6.30|>=8,<8.7.17|>=9,<9.3.2",
"typo3/cms-core": ">=8,<8.7.17|>=9,<9.3.2",
"typo3/flow": ">=1,<1.0.4|>=1.1,<1.1.1|>=2,<2.0.1|>=2.3,<2.3.16|>=3,<3.0.10|>=3.1,<3.1.7|>=3.2,<3.2.7|>=3.3,<3.3.5",
"typo3/neos": ">=1.1,<1.1.3|>=1.2,<1.2.13|>=2,<2.0.4",
"willdurand/js-translation-bundle": "<2.1.1",
"yiisoft/yii": ">=1.1.14,<1.1.15",
"yiisoft/yii2": "<2.0.15",
"yiisoft/yii2-bootstrap": "<2.0.4",
"yiisoft/yii2-dev": "<2.0.15",
"yiisoft/yii2-elasticsearch": "<2.0.5",
"yiisoft/yii2-gii": "<2.0.4",
"yiisoft/yii2-jui": "<2.0.4",
"yiisoft/yii2-redis": "<2.0.8",
"zendframework/zend-cache": ">=2.4,<2.4.8|>=2.5,<2.5.3",
"zendframework/zend-captcha": ">=2,<2.4.9|>=2.5,<2.5.2",
"zendframework/zend-crypt": ">=2,<2.4.9|>=2.5,<2.5.2",
"zendframework/zend-db": ">=2,<2.0.99|>=2.1,<2.1.99|>=2.2,<2.2.10|>=2.3,<2.3.5",
"zendframework/zend-diactoros": ">=1,<1.0.4",
"zendframework/zend-form": ">=2,<2.2.7|>=2.3,<2.3.1",
"zendframework/zend-http": ">=2,<2.0.99|>=2.1,<2.1.99|>=2.3,<2.3.8|>=2.4,<2.4.1",
"zendframework/zend-json": ">=2.1,<2.1.6|>=2.2,<2.2.6",
"zendframework/zend-ldap": ">=2,<2.0.99|>=2.1,<2.1.99|>=2.2,<2.2.8|>=2.3,<2.3.3",
"zendframework/zend-mail": ">=2,<2.4.11|>=2.5,<2.7.2",
"zendframework/zend-navigation": ">=2,<2.2.7|>=2.3,<2.3.1",
"zendframework/zend-session": ">=2,<2.0.99|>=2.1,<2.1.99|>=2.2,<2.2.9|>=2.3,<2.3.4",
"zendframework/zend-validator": ">=2.3,<2.3.6",
"zendframework/zend-view": ">=2,<2.2.7|>=2.3,<2.3.1",
"zendframework/zend-xmlrpc": ">=2.1,<2.1.6|>=2.2,<2.2.6",
"zendframework/zendframework": ">=2,<2.4.11|>=2.5,<2.5.1",
"zendframework/zendframework1": "<1.12.20",
"zendframework/zendopenid": ">=2,<2.0.2",
"zendframework/zendxml": ">=1,<1.0.1",
"zetacomponents/mail": "<1.8.2",
"zf-commons/zfc-user": "<1.2.2",
"zfcampus/zf-apigility-doctrine": ">=1,<1.0.3",
"zfr/zfr-oauth2-server-module": "<0.1.2"
},
"type": "metapackage",
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Marco Pivetta",
"email": "ocramius@gmail.com",
"role": "maintainer"
}
],
"description": "Prevents installation of composer packages with known security vulnerabilities: no API, simply require it",
"time": "2018-07-18T13:51:34+00:00"
},
{ {
"name": "symfony/dotenv", "name": "symfony/dotenv",
"version": "v4.1.1", "version": "v4.1.1",
@ -4164,16 +4405,16 @@
}, },
{ {
"name": "symfony/flex", "name": "symfony/flex",
"version": "v1.0.83", "version": "v1.0.84",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/flex.git", "url": "https://github.com/symfony/flex.git",
"reference": "ec42e791e12ca37d73ac37dd8744ef763d39dbbe" "reference": "7ede6446afac01e6e381db8c8c6fddb7c05a2aa7"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/flex/zipball/ec42e791e12ca37d73ac37dd8744ef763d39dbbe", "url": "https://api.github.com/repos/symfony/flex/zipball/7ede6446afac01e6e381db8c8c6fddb7c05a2aa7",
"reference": "ec42e791e12ca37d73ac37dd8744ef763d39dbbe", "reference": "7ede6446afac01e6e381db8c8c6fddb7c05a2aa7",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -4207,12 +4448,14 @@
} }
], ],
"description": "Composer plugin for Symfony", "description": "Composer plugin for Symfony",
"time": "2018-07-13T07:56:08+00:00" "time": "2018-07-19T06:01:11+00:00"
} }
], ],
"aliases": [], "aliases": [],
"minimum-stability": "stable", "minimum-stability": "stable",
"stability-flags": [], "stability-flags": {
"roave/security-advisories": 20
},
"prefer-stable": false, "prefer-stable": false,
"prefer-lowest": false, "prefer-lowest": false,
"platform": { "platform": {

View File

@ -5,10 +5,11 @@ return [
Doctrine\Bundle\DoctrineBundle\DoctrineBundle::class => ['all' => true], Doctrine\Bundle\DoctrineBundle\DoctrineBundle::class => ['all' => true],
Doctrine\Bundle\DoctrineCacheBundle\DoctrineCacheBundle::class => ['all' => true], Doctrine\Bundle\DoctrineCacheBundle\DoctrineCacheBundle::class => ['all' => true],
Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true], Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true],
Symfony\Bundle\MonologBundle\MonologBundle::class => ['all' => true],
Symfony\Bundle\TwigBundle\TwigBundle::class => ['all' => true], Symfony\Bundle\TwigBundle\TwigBundle::class => ['all' => true],
Symfony\Bundle\WebProfilerBundle\WebProfilerBundle::class => ['dev' => true, 'test' => true],
Symfony\Bundle\DebugBundle\DebugBundle::class => ['dev' => true, 'test' => true],
Symfony\Bundle\MakerBundle\MakerBundle::class => ['dev' => true], Symfony\Bundle\MakerBundle\MakerBundle::class => ['dev' => true],
Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle::class => ['all' => true], Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle::class => ['all' => true],
Symfony\Bundle\WebProfilerBundle\WebProfilerBundle::class => ['dev' => true, 'test' => true], Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle::class => ['all' => true],
Symfony\Bundle\MonologBundle\MonologBundle::class => ['all' => true],
Symfony\Bundle\DebugBundle\DebugBundle::class => ['dev' => true, 'test' => true],
]; ];

View File

@ -9,7 +9,6 @@ doctrine:
dbal: dbal:
# configure these for your database server # configure these for your database server
driver: 'pdo_pgsql' driver: 'pdo_pgsql'
types: types:
money: App\Types\MoneyType money: App\Types\MoneyType
mapping_types: mapping_types:

View File

@ -0,0 +1,3 @@
sensio_framework_extra:
router:
annotations: false

View File

@ -1,4 +1,5 @@
twig: twig:
form_themes: ['form_custom_layout.html.twig']
paths: ['%kernel.project_dir%/templates'] paths: ['%kernel.project_dir%/templates']
debug: '%kernel.debug%' debug: '%kernel.debug%'
strict_variables: '%kernel.debug%' strict_variables: '%kernel.debug%'

View File

@ -25,7 +25,7 @@ table {
} }
table.scroll { table.scroll {
display: table; /* display: table; */
} }
/* ---------------------------------------------------------------------------- /* ----------------------------------------------------------------------------
@ -38,8 +38,24 @@ textarea {
/* ---------------------------------------------------------------------------- /* ----------------------------------------------------------------------------
Miscellaneous Miscellaneous
---------------------------------------------------------------------------- */ ---------------------------------------------------------------------------- */
.edit-icon { .edit-icon {
display: inline-block; display: inline-block;
transform: rotateZ(90deg); transform: rotateZ(90deg);
} }
.tabs {
border-width: 0;
border-bottom-width: 1px;
}
.tabs-title {
border-top-left-radius: 5px;
border-top-right-radius: 5px;
border: 1px solid #e6e6e6;
border-bottom: 0;
margin: 0 0.5rem;
}
.tabs-title > a {
font-size: 1rem;
}

View File

@ -35,6 +35,7 @@ class CameraController extends Controller
$receivedItems = $em->getRepository(self::ENTITY)->findBy([ $receivedItems = $em->getRepository(self::ENTITY)->findBy([
'received' => true 'received' => true
], [ ], [
'isWorking' => 'ASC',
'brand' => 'ASC', 'brand' => 'ASC',
'mount' => 'ASC', 'mount' => 'ASC',
'model' => 'ASC', 'model' => 'ASC',
@ -47,9 +48,13 @@ class CameraController extends Controller
'model' => 'ASC', 'model' => 'ASC',
]); ]);
$working = array_filter($receivedItems, [$this, 'isWorking']);
$notWorking = array_filter($receivedItems, [$this, 'isNotWorking']);
return $this->render('camera/index.html.twig', [ return $this->render('camera/index.html.twig', [
'not_received' => $newItems, 'not_received' => $newItems,
'cameras' => $receivedItems, 'not_working' => $notWorking,
'working' => $working,
]); ]);
} }
@ -133,4 +138,14 @@ class CameraController extends Controller
{ {
return $this->buildForm($camera, 'camera_deacquire'); return $this->buildForm($camera, 'camera_deacquire');
} }
private function isWorking(Camera $camera): bool
{
return $camera->getIsWorking();
}
private function isNotWorking(Camera $camera): bool
{
return !$this->isWorking($camera);
}
} }

View File

@ -2,13 +2,10 @@
namespace App\Controller; namespace App\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\ControllerTrait;
use Symfony\Component\Form\FormInterface; use Symfony\Component\Form\FormInterface;
use Symfony\Component\HttpFoundation\{Request, Response, RedirectResponse}; use Symfony\Component\HttpFoundation\{Request, Response, RedirectResponse};
trait FormControllerTrait { trait FormControllerTrait {
use ControllerTrait;
/** /**
* Create a form generator * Create a form generator
*/ */

View File

@ -1,4 +1,4 @@
<?php declare(strict_types = 1); <?php declare(strict_types=1);
namespace App\Entity; namespace App\Entity;
@ -8,7 +8,8 @@ use Doctrine\ORM\Mapping as ORM;
* @ORM\Table(name="film_format", schema="camera") * @ORM\Table(name="film_format", schema="camera")
* @ORM\Entity * @ORM\Entity
*/ */
class FilmFormat { class FilmFormat
{
/** /**
* @ORM\Id * @ORM\Id
* @ORM\GeneratedValue * @ORM\GeneratedValue

View File

@ -2,7 +2,10 @@
namespace App\Form; namespace App\Form;
use Symfony\Component\Form\{AbstractType, FormBuilderInterface}; use Symfony\Component\Form\{
AbstractType, FormBuilderInterface
};
use Symfony\Component\Form\Extension\Core\Type\{ChoiceType, MoneyType};
use Symfony\Component\OptionsResolver\Exception\AccessException; use Symfony\Component\OptionsResolver\Exception\AccessException;
use Symfony\Component\OptionsResolver\OptionsResolver; use Symfony\Component\OptionsResolver\OptionsResolver;
@ -20,10 +23,24 @@ class CameraType extends AbstractType
->add('isDigital') ->add('isDigital')
->add('mount') ->add('mount')
->add('model') ->add('model')
->add('filmFormat') ->add('filmFormat', ChoiceType::class, [
'choices' => [
'Small Format' => [
'35mm' => '135',
'110' => '110',
],
'Medium Format' => [
'120' => '120',
'127' => '127',
'620' => '620',
],
]
])
->add('cropFactor') ->add('cropFactor')
->add('serial') ->add('serial')
->add('purchasePrice') ->add('purchasePrice', MoneyType::class, [
'currency' => 'USD',
])
->add('batteryType') ->add('batteryType')
->add('received') ->add('received')
->add('isWorking') ->add('isWorking')

View File

@ -2,7 +2,9 @@
namespace App\Form; namespace App\Form;
use Symfony\Component\Form\{AbstractType, FormBuilderInterface}; use Symfony\Component\Form\{
AbstractType, FormBuilderInterface
};
use Symfony\Component\OptionsResolver\OptionsResolver; use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\OptionsResolver\Exception\AccessException; use Symfony\Component\OptionsResolver\Exception\AccessException;

View File

@ -4,6 +4,7 @@ namespace App\Form;
use App\Entity\Film; use App\Entity\Film;
use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver; use Symfony\Component\OptionsResolver\OptionsResolver;
@ -20,12 +21,37 @@ class FilmType extends AbstractType
->add('filmAlias') ->add('filmAlias')
->add('filmSpeedAsa') ->add('filmSpeedAsa')
->add('filmSpeedDin') ->add('filmSpeedDin')
->add('filmFormat') ->add('filmFormat', ChoiceType::class, [
->add('filmBase') 'choices' => [
'Small Format' => [
'35mm' => '135',
'110' => '110',
],
'Medium Format' => [
'120' => '120',
'127' => '127',
'620' => '620',
],
]
])
->add('filmBase',ChoiceType::class, [
'choices' => [
'Cellulose Triacetate' => 'Cellulose Triacetate',
'Polyester' => 'Polyester',
'Polyethylene Naphtalate' => 'Polyethylene Naphtalate',
]
])
->add('unusedRolls') ->add('unusedRolls')
->add('rollsInCamera') ->add('rollsInCamera')
->add('developedRolls') ->add('developedRolls')
->add('chemistry') ->add('chemistry', ChoiceType::class, [
'choices' => [
'B & W' => 'B & W',
'C-41' => 'C-41',
'E-6' => 'E-6',
'Other' => 'Other',
]
])
->add('notes'); ->add('notes');
} }

View File

@ -2,7 +2,9 @@
namespace App\Form; namespace App\Form;
use Symfony\Component\Form\{AbstractType, FormBuilderInterface}; use Symfony\Component\Form\{
AbstractType, FormBuilderInterface
};
use Symfony\Component\OptionsResolver\Exception\AccessException; use Symfony\Component\OptionsResolver\Exception\AccessException;
use Symfony\Component\OptionsResolver\OptionsResolver; use Symfony\Component\OptionsResolver\OptionsResolver;

View File

@ -2,7 +2,9 @@
namespace App\Form; namespace App\Form;
use Symfony\Component\Form\{AbstractType, FormBuilderInterface}; use Symfony\Component\Form\{
AbstractType, Extension\Core\Type\ChoiceType, FormBuilderInterface
};
use Symfony\Component\OptionsResolver\Exception\AccessException; use Symfony\Component\OptionsResolver\Exception\AccessException;
use Symfony\Component\OptionsResolver\OptionsResolver; use Symfony\Component\OptionsResolver\OptionsResolver;
@ -20,7 +22,20 @@ class LensesType extends AbstractType
->add('productLine') ->add('productLine')
->add('model') ->add('model')
->add('mount') ->add('mount')
->add('imageSize') ->add('imageSize', ChoiceType::class, [
'choices' => [
'Small Format' => [
'35mm' => '35mm',
'APS-C' => 'APS-C',
'Micro 4/3' => 'Micro 4/3',
],
'Medium Format' => [
'6x6' => '6x6cm',
'6x4.5' => '6x4.5cm',
'4x4' => '4x4cm',
]
]
])
->add('minFStop') ->add('minFStop')
->add('maxFStop') ->add('maxFStop')
->add('minFocalLength') ->add('minFocalLength')

View File

@ -16,7 +16,7 @@ class MoneyType extends Type {
public function convertToPHPValue($value, AbstractPlatform $platform) public function convertToPHPValue($value, AbstractPlatform $platform)
{ {
return new Money($value); return (float)(new Money($value))->__toString();
} }
public function getName(): string public function getName(): string

View File

@ -7,12 +7,12 @@ class Money {
public function __construct($value) public function __construct($value)
{ {
$this->value = str_replace(['$',','], '', $value); $this->value = (float)str_replace(['$',','], '', $value);
} }
public function getValue() public function getValue()
{ {
return str_replace(['$',','], '', $this->value); return (float)str_replace(['$',','], '', $this->value);
} }
public function __toString() public function __toString()

View File

@ -101,6 +101,18 @@
"psr/simple-cache": { "psr/simple-cache": {
"version": "1.0.0" "version": "1.0.0"
}, },
"roave/security-advisories": {
"version": "dev-master"
},
"sensio/framework-extra-bundle": {
"version": "5.2",
"recipe": {
"repo": "github.com/symfony/recipes",
"branch": "master",
"version": "5.2",
"ref": "fb7e19da7f013d0d422fa9bce16f5c510e27609b"
}
},
"symfony/cache": { "symfony/cache": {
"version": "v3.3.13" "version": "v3.3.13"
}, },

View File

@ -17,6 +17,7 @@
<div class="large primary callout"> <div class="large primary callout">
{{ form_start(edit_form) }} {{ form_start(edit_form) }}
{{ form_errors(edit_form) }}
{{ form_widget(edit_form) }} {{ form_widget(edit_form) }}
<button type="submit" class="success button expanded">Update</button> <button type="submit" class="success button expanded">Update</button>
{{ form_end(edit_form) }} {{ form_end(edit_form) }}

View File

@ -1,8 +1,6 @@
{% extends 'base.html.twig' %} {% extends 'base.html.twig' %}
{% block title %} {% block title %}Camera 📷 CRUD - Cameras{% endblock %}
Camera 📷 CRUD - Cameras
{% endblock %}
{% block body %} {% block body %}
<h2>Cameras</h2> <h2>Cameras</h2>
@ -15,9 +13,29 @@
</ul> </ul>
</div> </div>
<div class="small callout warning"> <ul
class="tabs"
data-deep-link="true"
data-update-history="true"
data-deep-link-smudge="true"
data-deep-link-smudge-delay="500"
data-tabs
id="classifications"
>
<li class="tabs-title is-active">
<a href="#not_received" aria-selected="true">Not Yet Received</a>
</li>
<li class="tabs-title">
<a href="#working">Working</a>
</li>
<li class="tabs-title">
<a href="#not_working">Broken / Display Only</a>
</li>
</ul>
<div class="tabs-content" data-tabs-content="classifications">
<div class="tabs-panel is-active" id="not_received">
<table class="hover scroll sortable stack"> <table class="hover scroll sortable stack">
<caption>Not Yet Received</caption>
<thead> <thead>
<tr> <tr>
<th>Actions</th> <th>Actions</th>
@ -60,28 +78,25 @@
</tbody> </tbody>
</table> </table>
</div> </div>
<div class="tabs-panel" id="working">
<div class="small callout secondary">
<table class="hover scroll sortable stack"> <table class="hover scroll sortable stack">
<caption>Received</caption>
<thead> <thead>
<tr> <tr>
<th>Actions</th> <th>Actions</th>
<th>Brand</th> <th>Brand</th>
<th>Mount</th> <th>Mount</th>
<th>Model</th> <th>Model</th>
<th>Film Format</th>
<th>Crop Factor</th> <th>Crop Factor</th>
<th>Is Working?</th>
<th>Serial</th> <th>Serial</th>
<th>Formerly Owned?</th> <th>Formerly Owned?</th>
<th>Purchase Price</th> <th>Purchase Price</th>
<th>Battery Type</th> <th>Battery Type</th>
<th>Film Format</th>
<th>Notes</th> <th>Notes</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
{% for camera in cameras %} {% for camera in working %}
<tr> <tr>
<td> <td>
<ul> <ul>
@ -99,17 +114,65 @@
<td>{{ camera.brand }}</td> <td>{{ camera.brand }}</td>
<td>{{ camera.mount }}</td> <td>{{ camera.mount }}</td>
<td>{{ camera.model }}</td> <td>{{ camera.model }}</td>
<td>{{ camera.filmFormat }}</td>
<td>{{ camera.cropFactor }}</td> <td>{{ camera.cropFactor }}</td>
<td class="text-center">{% if camera.isWorking %}{% else %}&#10007;{% endif %}</td>
<td>{{ camera.serial }}</td> <td>{{ camera.serial }}</td>
<td class="text-center">{% if camera.formerlyOwned %}{% else %}&#10007;{% endif %}</td> <td class="text-center">{% if camera.formerlyOwned %}{% else %}&#10007;{% endif %}</td>
<td>${{ camera.purchasePrice }}</td> <td>${{ camera.purchasePrice }}</td>
<td>{{ camera.batteryType }}</td> <td>{{ camera.batteryType }}</td>
<td>{{ camera.filmFormat }}</td>
<td>{{ camera.notes }}</td> <td>{{ camera.notes }}</td>
</tr> </tr>
{% endfor %} {% endfor %}
</tbody> </tbody>
</table> </table>
</div> </div>
<div class="tabs-panel" id="not_working">
<table class="hover scroll sortable stack">
<thead>
<tr>
<th>Actions</th>
<th>Brand</th>
<th>Mount</th>
<th>Model</th>
<th>Film Format</th>
<th>Crop Factor</th>
<th>Serial</th>
<th>Formerly Owned?</th>
<th>Purchase Price</th>
<th>Battery Type</th>
<th>Notes</th>
</tr>
</thead>
<tbody>
{% for camera in not_working %}
<tr>
<td>
<ul>
<li>
<a href="{{ path('camera_edit', { 'id': camera.id }) }}">
Edit
<span class="edit-icon">&#9998;</span>
</a>
</li>
<li>
<a href="{{ path('camera_show', { 'id': camera.id }) }}">View 👁</a>
</li>
</ul>
</td>
<td>{{ camera.brand }}</td>
<td>{{ camera.mount }}</td>
<td>{{ camera.model }}</td>
<td>{{ camera.filmFormat }}</td>
<td>{{ camera.cropFactor }}</td>
<td>{{ camera.serial }}</td>
<td class="text-center">{% if camera.formerlyOwned %}{% else %}&#10007;{% endif %}</td>
<td>${{ camera.purchasePrice }}</td>
<td>{{ camera.batteryType }}</td>
<td>{{ camera.notes }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
{% endblock %} {% endblock %}

View File

@ -15,7 +15,6 @@
</ul> </ul>
</div> </div>
<div class="small secondary callout">
<table class="hover scroll stack"> <table class="hover scroll stack">
<thead> <thead>
<tr> <tr>
@ -46,5 +45,4 @@
{% endfor %} {% endfor %}
</tbody> </tbody>
</table> </table>
</div>
{% endblock %} {% endblock %}

View File

@ -1,8 +1,6 @@
{% extends 'base.html.twig' %} {% extends 'base.html.twig' %}
{% block title %} {% block title %}Camera 📷 CRUD - Film{% endblock %}
Camera 📷 CRUD - Film
{% endblock %}
{% block body %} {% block body %}
<h2>Film</h2> <h2>Film</h2>
@ -15,9 +13,26 @@
</ul> </ul>
</div> </div>
<div class="small callout warning"> <ul
class="tabs"
data-deep-link="true"
data-update-history="true"
data-deep-link-smudge="true"
data-deep-link-smudge-delay="500"
data-tabs
id="classifications"
>
<li class="tabs-title is-active">
<a href="#in_camera" aria-selected="true">In a camera</a>
</li>
<li class="tabs-title">
<a href="#other">Everything Else</a>
</li>
</ul>
<div class="tabs-content" data-tabs-content="classifications">
<div class="tabs-panel is-active" id="in_camera">
<table class="hover scroll sortable stack"> <table class="hover scroll sortable stack">
<caption>In Camera</caption>
<thead> <thead>
<tr> <tr>
<th>Actions</th> <th>Actions</th>
@ -68,10 +83,8 @@
</tbody> </tbody>
</table> </table>
</div> </div>
<div class="tabs-panel" id="other">
<div class="small callout secondary">
<table class="hover scroll sortable stack"> <table class="hover scroll sortable stack">
<caption>Not in Camera</caption>
<thead> <thead>
<tr> <tr>
<th>Actions</th> <th>Actions</th>
@ -82,10 +95,9 @@
<th>Film Speed</th> <th>Film Speed</th>
<th>Film Format</th> <th>Film Format</th>
<th>Film Base</th> <th>Film Base</th>
<th>Unused Rolls</th> <th class="text-center">In Stock</th>
<th>Rolls in a Camera</th> <th class="text-center">Developed</th>
<th>Developed Rolls</th> <th class="text-right">Chemistry</th>
<th>Chemistry</th>
<th>Notes</th> <th>Notes</th>
</tr> </tr>
</thead> </thead>
@ -112,14 +124,14 @@
<td>{{ film.filmSpeedAsa }}/{{ film.filmSpeedDin }}&deg;</td> <td>{{ film.filmSpeedAsa }}/{{ film.filmSpeedDin }}&deg;</td>
<td>{{ film.filmFormat }}</td> <td>{{ film.filmFormat }}</td>
<td>{{ film.filmBase }}</td> <td>{{ film.filmBase }}</td>
<td>{{ film.unusedRolls }}</td> <td class="text-center">{{ film.unusedRolls }}</td>
<td>{{ film.rollsInCamera }}</td> <td class="text-center">{{ film.developedRolls }}</td>
<td>{{ film.developedRolls }}</td> <td class="text-right">{{ film.chemistry }}</td>
<td>{{ film.chemistry }}</td>
<td>{{ film.notes }}</td> <td>{{ film.notes }}</td>
</tr> </tr>
{% endfor %} {% endfor %}
</tbody> </tbody>
</table> </table>
</div> </div>
</div>
{% endblock %} {% endblock %}

View File

@ -2,16 +2,13 @@
{% block stylesheets %} {% block stylesheets %}
<style> <style>
th {
text-align: right;
}
</style> </style>
{% endblock %} {% endblock %}
{% block body %} {% block body %}
<div class="grid-container"> <div class="grid-container">
<div class="grid-x grid-margin-x"> <div class="grid-x grid-margin-x">
<div class="cell large-6 large-offset-2 medium-8 medium-offset-1"> <div class="cell large-8 large-offset-2 medium-10 medium-offset-1 small-12">
{% block form %}{% endblock %} {% block form %}{% endblock %}
</div> </div>
</div> </div>

View File

@ -0,0 +1,334 @@
{% extends "form_div_layout.html.twig" %}
{# Based on Foundation 5 Doc #}
{# Widgets #}
{% block form_widget_simple -%}
{% if errors|length > 0 -%}
{% set attr = attr|merge({class: (attr.class|default('') ~ ' error')|trim}) %}
{% endif %}
{{- parent() -}}
{%- endblock form_widget_simple %}
{% block textarea_widget -%}
{% if errors|length > 0 -%}
{% set attr = attr|merge({class: (attr.class|default('') ~ ' error')|trim}) %}
{% endif %}
{{- parent() -}}
{%- endblock textarea_widget %}
{% block button_widget -%}
{% set attr = attr|merge({class: (attr.class|default('') ~ ' button')|trim}) %}
{{- parent() -}}
{%- endblock button_widget %}
{% block money_widget -%}
<div class="grid-x grid-margin-x collapse">
{% set prepend = '{{' == money_pattern[0:2] %}
{% if not prepend %}
<div class="small-3 large-2 cell">
<span class="prefix">{{ money_pattern|form_encode_currency }}</span>
</div>
{% endif %}
<div class="small-9 large-10 cell">
{{- block('form_widget_simple') -}}
</div>
{% if prepend %}
<div class="small-3 large-2 cell">
<span class="postfix">{{ money_pattern|form_encode_currency }}</span>
</div>
{% endif %}
</div>
{%- endblock money_widget %}
{% block percent_widget -%}
<div class="grid-x grid-margin-x collapse">
<div class="small-9 large-10 cell">
{{- block('form_widget_simple') -}}
</div>
<div class="small-3 large-2 cell">
<span class="postfix">%</span>
</div>
</div>
{%- endblock percent_widget %}
{% block datetime_widget -%}
{% if widget == 'single_text' %}
{{- block('form_widget_simple') -}}
{% else %}
{% set attr = attr|merge({class: (attr.class|default('') ~ ' row')|trim}) %}
<div class="grid-x grid-margin-x">
<div class="large-7 cell">{{ form_errors(form.date) }}</div>
<div class="large-5 cell">{{ form_errors(form.time) }}</div>
</div>
<div {{ block('widget_container_attributes') }}>
<div class="large-7 cell">{{ form_widget(form.date, { datetime: true } ) }}</div>
<div class="large-5 cell">{{ form_widget(form.time, { datetime: true } ) }}</div>
</div>
{% endif %}
{%- endblock datetime_widget %}
{% block date_widget -%}
{% if widget == 'single_text' %}
{{- block('form_widget_simple') -}}
{% else %}
{% set attr = attr|merge({class: (attr.class|default('') ~ ' row')|trim}) %}
{% if datetime is not defined or not datetime %}
<div {{ block('widget_container_attributes') }}>
{% endif %}
{{- date_pattern|replace({
'{{ year }}': '<div class="large-4 cell">' ~ form_widget(form.year) ~ '</div>',
'{{ month }}': '<div class="large-4 cell">' ~ form_widget(form.month) ~ '</div>',
'{{ day }}': '<div class="large-4 cell">' ~ form_widget(form.day) ~ '</div>',
})|raw -}}
{% if datetime is not defined or not datetime %}
</div>
{% endif %}
{% endif %}
{%- endblock date_widget %}
{% block time_widget -%}
{% if widget == 'single_text' %}
{{- block('form_widget_simple') -}}
{% else %}
{% set attr = attr|merge({class: (attr.class|default('') ~ ' row')|trim}) %}
{% if datetime is not defined or false == datetime %}
<div {{ block('widget_container_attributes') -}}>
{% endif %}
{% if with_seconds %}
<div class="large-4 cell">{{ form_widget(form.hour) }}</div>
<div class="large-4 cell">
<div class="grid-x grid-margin-x collapse">
<div class="small-3 large-2 cell">
<span class="prefix">:</span>
</div>
<div class="small-9 large-10 cell">
{{ form_widget(form.minute) }}
</div>
</div>
</div>
<div class="large-4 cell">
<div class="grid-x grid-margin-x collapse">
<div class="small-3 large-2 cell">
<span class="prefix">:</span>
</div>
<div class="small-9 large-10 cell">
{{ form_widget(form.second) }}
</div>
</div>
</div>
{% else %}
<div class="large-6 cell">{{ form_widget(form.hour) }}</div>
<div class="large-6 cell">
<div class="grid-x grid-margin-x collapse">
<div class="small-3 large-2 cell">
<span class="prefix">:</span>
</div>
<div class="small-9 large-10 cell">
{{ form_widget(form.minute) }}
</div>
</div>
</div>
{% endif %}
{% if datetime is not defined or false == datetime %}
</div>
{% endif %}
{% endif %}
{%- endblock time_widget %}
{% block choice_widget_collapsed -%}
{% if errors|length > 0 -%}
{% set attr = attr|merge({class: (attr.class|default('') ~ ' error')|trim}) %}
{% endif %}
{% if multiple -%}
{% set attr = attr|merge({style: (attr.style|default('') ~ ' height: auto; background-image: none;')|trim}) %}
{% endif %}
{% if required and placeholder is none and not placeholder_in_choices and not multiple -%}
{% set required = false %}
{%- endif -%}
<select {{ block('widget_attributes') }}{% if multiple %} multiple="multiple" data-customforms="disabled"{% endif %}>
{% if placeholder is not none -%}
<option
value=""{% if required and value is empty %} selected="selected"{% endif %}>{{ translation_domain is same as(false) ? placeholder : placeholder|trans({}, translation_domain) }}</option>
{%- endif %}
{%- if preferred_choices|length > 0 -%}
{% set options = preferred_choices %}
{{- block('choice_widget_options') -}}
{% if choices|length > 0 and separator is not none -%}
<option disabled="disabled">{{ separator }}</option>
{%- endif %}
{%- endif -%}
{% set options = choices -%}
{{- block('choice_widget_options') -}}
</select>
{%- endblock choice_widget_collapsed %}
{% block choice_widget_expanded -%}
{% if '-inline' in label_attr.class|default('') %}
<ul class="inline-list">
{% for child in form %}
<li>{{ form_widget(child, {
parent_label_class: label_attr.class|default(''),
}) }}</li>
{% endfor %}
</ul>
{% else %}
<div {{ block('widget_container_attributes') }}>
{% for child in form %}
{{ form_widget(child, {
parent_label_class: label_attr.class|default(''),
}) }}
{% endfor %}
</div>
{% endif %}
{%- endblock choice_widget_expanded %}
{% block checkbox_widget -%}
{% set parent_label_class = parent_label_class|default('') %}
{% if errors|length > 0 -%}
{% set attr = attr|merge({class: (attr.class|default('') ~ ' error')|trim}) %}
{% endif %}
{% if 'checkbox-inline' in parent_label_class %}
{{ form_label(form, null, { widget: parent() }) }}
{% else %}
<div class="checkbox">
{{ form_label(form, null, { widget: parent() }) }}
</div>
{% endif %}
{%- endblock checkbox_widget %}
{% block radio_widget -%}
{% set parent_label_class = parent_label_class|default('') %}
{% if 'radio-inline' in parent_label_class %}
{{ form_label(form, null, { widget: parent() }) }}
{% else %}
{% if errors|length > 0 -%}
{% set attr = attr|merge({class: (attr.class|default('') ~ ' error')|trim}) %}
{% endif %}
<div class="radio">
{{ form_label(form, null, { widget: parent() }) }}
</div>
{% endif %}
{%- endblock radio_widget %}
{# Labels #}
{% block form_label -%}
{% if errors|length > 0 -%}
{% set label_attr = label_attr|merge({class: (label_attr.class|default('') ~ ' error')|trim}) %}
{% endif %}
{{- parent() -}}
{%- endblock form_label %}
{% block choice_label -%}
{% if errors|length > 0 -%}
{% set label_attr = label_attr|merge({class: (label_attr.class|default('') ~ ' error')|trim}) %}
{% endif %}
{# remove the checkbox-inline and radio-inline class, it's only useful for embed labels #}
{% set label_attr = label_attr|merge({class: label_attr.class|default('')|replace({'checkbox-inline': '', 'radio-inline': ''})|trim}) %}
{{- block('form_label') -}}
{%- endblock choice_label %}
{% block checkbox_label -%}
{{- block('checkbox_radio_label') -}}
{%- endblock checkbox_label %}
{% block radio_label -%}
{{- block('checkbox_radio_label') -}}
{%- endblock radio_label %}
{% block checkbox_radio_label -%}
{% if required %}
{% set label_attr = label_attr|merge({class: (label_attr.class|default('') ~ ' required')|trim}) %}
{% endif %}
{% if errors|length > 0 -%}
{% set label_attr = label_attr|merge({class: (label_attr.class|default('') ~ ' error')|trim}) %}
{% endif %}
{% if parent_label_class is defined %}
{% set label_attr = label_attr|merge({class: (label_attr.class|default('') ~ parent_label_class)|trim}) %}
{% endif %}
{% if label is empty %}
{%- if label_format is not empty -%}
{% set label = label_format|replace({
'%name%': name,
'%id%': id,
}) %}
{%- else -%}
{% set label = name|humanize %}
{%- endif -%}
{% endif %}
<label{% for attrname, attrvalue in label_attr %} {{ attrname }}="{{ attrvalue }}"{% endfor %}>
{{ widget|raw }}
{{ translation_domain is same as(false) ? label : label|trans({}, translation_domain) }}
</label>
{%- endblock checkbox_radio_label %}
{# Rows #}
{% block form_row -%}
{%- set widget_attr = {} -%}
{%- if help is not empty -%}
{%- set widget_attr = {attr: {'aria-describedby': id ~"_help"}} -%}
{%- endif -%}
<div class="grid-x grid-margin-x">
<div class="large-12 cell{% if (not compound or force_error|default(false)) and not valid %} error{% endif %}">
{{- form_label(form) -}}
{{- form_widget(form, widget_attr) -}}
{{- form_help(form) -}}
{{- form_errors(form) -}}
</div>
</div>
{%- endblock form_row %}
{% block choice_row -%}
{% set force_error = true %}
{{ block('form_row') }}
{%- endblock choice_row %}
{% block date_row -%}
{% set force_error = true %}
{{ block('form_row') }}
{%- endblock date_row %}
{% block time_row -%}
{% set force_error = true %}
{{ block('form_row') }}
{%- endblock time_row %}
{% block datetime_row -%}
{% set force_error = true %}
{{ block('form_row') }}
{%- endblock datetime_row %}
{% block checkbox_row -%}
<div class="grid-x grid-margin-x">
<div class="large-12 cell{% if not valid %} error{% endif %}">
{{ form_widget(form) }}
{{ form_errors(form) }}
</div>
</div>
{%- endblock checkbox_row %}
{% block radio_row -%}
<div class="grid-x grid-margin-x">
<div class="large-12 cell{% if not valid %} error{% endif %}">
{{ form_widget(form) }}
{{ form_errors(form) }}
</div>
</div>
{%- endblock radio_row %}
{# Errors #}
{% block form_errors -%}
{% if errors|length > 0 -%}
{% if form is not rootform %}<small class="error">{% else %}<div data-alert class="alert-box alert">{% endif %}
{%- for error in errors -%}
{{ error.message }}
{% if not loop.last %}, {% endif %}
{%- endfor -%}
{% if form is not rootform %}</small>{% else %}</div>{% endif %}
{%- endif %}
{%- endblock form_errors %}

View File

@ -1,8 +1,6 @@
{% extends 'base.html.twig' %} {% extends 'base.html.twig' %}
{% block title %} {% block title %}Camera 📷 CRUD - Lenses{% endblock %}
Camera 📷 CRUD - Lenses
{% endblock %}
{% block body %} {% block body %}
<h2>Lenses</h2> <h2>Lenses</h2>
@ -15,9 +13,26 @@
</ul> </ul>
</div> </div>
<div class="small callout warning"> <ul
class="tabs"
data-deep-link="true"
data-update-history="true"
data-deep-link-smudge="true"
data-deep-link-smudge-delay="500"
data-tabs
id="classifications"
>
<li class="tabs-title is-active">
<a href="#not_received" aria-selected="true">Not Yet Received</a>
</li>
<li class="tabs-title">
<a href="#received">Received</a>
</li>
</ul>
<div class="tabs-content" data-tabs-content="classifications">
<div class="tabs-panel is-active" id="not_received">
<table class="hover scroll sortable stack"> <table class="hover scroll sortable stack">
<caption>Not Yet Received</caption>
<thead> <thead>
<tr> <tr>
<th>Actions</th> <th>Actions</th>
@ -74,8 +89,7 @@
</tbody> </tbody>
</table> </table>
</div> </div>
<div class="tabs-panel" id="received">
<div class="small callout secondary">
<table class="hover scroll sortable stack"> <table class="hover scroll sortable stack">
<caption>Received</caption> <caption>Received</caption>
<thead> <thead>
@ -134,6 +148,5 @@
</tbody> </tbody>
</table> </table>
</div> </div>
</div>
{% endblock %} {% endblock %}