Fix titles, add rollsInCamera field to Film type

This commit is contained in:
Timothy Warren 2018-02-26 15:25:15 -05:00
parent ffd9ef5952
commit c4a591c71a
35 changed files with 173 additions and 16 deletions

23
composer.lock generated
View File

@ -2355,16 +2355,16 @@
}, },
{ {
"name": "symfony/maker-bundle", "name": "symfony/maker-bundle",
"version": "v1.0.2", "version": "v1.1.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/maker-bundle.git", "url": "https://github.com/symfony/maker-bundle.git",
"reference": "bf97703ddb68c6b37bd6bab5f5ebd5c7542ca1ef" "reference": "ba427289009de6f0fd51fb51186eeaa70ab3a33d"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/maker-bundle/zipball/bf97703ddb68c6b37bd6bab5f5ebd5c7542ca1ef", "url": "https://api.github.com/repos/symfony/maker-bundle/zipball/ba427289009de6f0fd51fb51186eeaa70ab3a33d",
"reference": "bf97703ddb68c6b37bd6bab5f5ebd5c7542ca1ef", "reference": "ba427289009de6f0fd51fb51186eeaa70ab3a33d",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -2377,6 +2377,7 @@
"symfony/http-kernel": "^3.4|^4.0" "symfony/http-kernel": "^3.4|^4.0"
}, },
"require-dev": { "require-dev": {
"allocine/twigcs": "^3.0",
"friendsofphp/php-cs-fixer": "^2.8", "friendsofphp/php-cs-fixer": "^2.8",
"symfony/phpunit-bridge": "^3.4|^4.0", "symfony/phpunit-bridge": "^3.4|^4.0",
"symfony/process": "^3.4|^4.0" "symfony/process": "^3.4|^4.0"
@ -2402,13 +2403,15 @@
"homepage": "https://symfony.com/contributors" "homepage": "https://symfony.com/contributors"
} }
], ],
"description": "Symfony Maker helps you create empty commands, controllers, form classes, tests and more so you can forget about writing boilerplate code.",
"homepage": "https://symfony.com/doc/current/bundles/SymfonyMakerBundle/index.html",
"keywords": [ "keywords": [
"code generator", "code generator",
"generator", "generator",
"scaffold", "scaffold",
"scaffolding" "scaffolding"
], ],
"time": "2017-12-04T17:50:28+00:00" "time": "2018-02-21T19:43:12+00:00"
}, },
{ {
"name": "symfony/monolog-bridge", "name": "symfony/monolog-bridge",
@ -3536,16 +3539,16 @@
}, },
{ {
"name": "symfony/flex", "name": "symfony/flex",
"version": "v1.0.68", "version": "v1.0.70",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/flex.git", "url": "https://github.com/symfony/flex.git",
"reference": "0241b2acbb58df29e633b03fb56eb349a207613f" "reference": "1f00c05d35523dc0ac52e4a457989a069be5a7a4"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/flex/zipball/0241b2acbb58df29e633b03fb56eb349a207613f", "url": "https://api.github.com/repos/symfony/flex/zipball/1f00c05d35523dc0ac52e4a457989a069be5a7a4",
"reference": "0241b2acbb58df29e633b03fb56eb349a207613f", "reference": "1f00c05d35523dc0ac52e4a457989a069be5a7a4",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -3578,7 +3581,7 @@
"email": "fabien.potencier@gmail.com" "email": "fabien.potencier@gmail.com"
} }
], ],
"time": "2018-01-31T19:34:57+00:00" "time": "2018-02-22T07:00:47+00:00"
} }
], ],
"aliases": [], "aliases": [],

View File

@ -75,28 +75,35 @@ class Film {
* *
* @ORM\Column(name="film_base", type="string", nullable=false, options={"default"="Cellulose Triacetate"}) * @ORM\Column(name="film_base", type="string", nullable=false, options={"default"="Cellulose Triacetate"})
*/ */
private $filmBase; private $filmBase = 'Cellulose Triacetate';
/** /**
* @var int * @var int
* *
* @ORM\Column(name="unused_rolls", type="integer", nullable=false, options={"default"=0}) * @ORM\Column(name="unused_rolls", type="integer", nullable=false, options={"default"=0})
*/ */
private $unusedRolls; private $unusedRolls = 0;
/**
* @var int
*
* @ORM\Column(name="rolls_in_camera", type="integer", nullable=false, options={"default"=0})
*/
private $rollsInCamera = 0;
/** /**
* @var int * @var int
* *
* @ORM\Column(name="developed_rolls", type="integer", nullable=false, options={"default"=0}) * @ORM\Column(name="developed_rolls", type="integer", nullable=false, options={"default"=0})
*/ */
private $developedRolls; private $developedRolls = 0;
/** /**
* @var string * @var string
* *
* @ORM\Column(name="chemistry", type="string", nullable=false, options={"default"="C-41"}) * @ORM\Column(name="chemistry", type="string", nullable=false, options={"default"="C-41"})
*/ */
private $chemistry; private $chemistry = 'C-41';
/** /**
* @var string * @var string
@ -275,6 +282,24 @@ class Film {
return $this; return $this;
} }
/**
* @return int
*/
public function getRollsInCamera(): ?int
{
return $this->rollsInCamera;
}
/**
* @param int $rollsInCamera
* @return self
*/
public function setRollsInCamera(int $rollsInCamera): self
{
$this->rollsInCamera = $rollsInCamera;
return $this;
}
/** /**
* @return int * @return int
*/ */

View File

@ -23,6 +23,7 @@ class FilmType extends AbstractType
->add('filmFormat') ->add('filmFormat')
->add('filmBase') ->add('filmBase')
->add('unusedRolls') ->add('unusedRolls')
->add('rollsInCamera')
->add('developedRolls') ->add('developedRolls')
->add('chemistry') ->add('chemistry')
->add('notes'); ->add('notes');

View File

@ -5,7 +5,7 @@
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<meta http-equiv="x-ua-compatible" content="ie=edge"> <meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{% block title %}Welcome!{% endblock %}</title> <title>{% block title %}Camera 📷 CRUD{% endblock %}</title>
<link rel="stylesheet" href="/css/foundation.min.css" /> <link rel="stylesheet" href="/css/foundation.min.css" />
<link rel="stylesheet" href="/css/app.css" /> <link rel="stylesheet" href="/css/app.css" />
{% block stylesheets %}{% endblock %} {% block stylesheets %}{% endblock %}

View File

@ -1,5 +1,9 @@
{% extends 'form.html.twig' %} {% extends 'form.html.twig' %}
{% block title %}
Camera 📷 CRUD - Cameras - Edit
{% endblock %}
{% block form %} {% block form %}
<h1>Edit Camera</h1> <h1>Edit Camera</h1>

View File

@ -1,5 +1,9 @@
{% extends 'base.html.twig' %} {% extends 'base.html.twig' %}
{% block title %}
Camera 📷 CRUD - Cameras
{% endblock %}
{% block body %} {% block body %}
<h2>Cameras</h2> <h2>Cameras</h2>

View File

@ -1,5 +1,9 @@
{% extends 'form.html.twig' %} {% extends 'form.html.twig' %}
{% block title %}
Camera 📷 CRUD - Cameras - Add
{% endblock %}
{% block form %} {% block form %}
<h2>Add a Camera</h2> <h2>Add a Camera</h2>

View File

@ -1,5 +1,9 @@
{% extends 'form.html.twig' %} {% extends 'form.html.twig' %}
{% block title %}
Camera 📷 CRUD - Camera - Show
{% endblock %}
{% block form %} {% block form %}
<h2>Camera</h2> <h2>Camera</h2>

View File

@ -1,5 +1,9 @@
{% extends 'form.html.twig' %} {% extends 'form.html.twig' %}
{% block title %}
Camera 📷 CRUD - Camera Type - Edit
{% endblock %}
{% block form %} {% block form %}
<h2>Edit Camera Type</h2> <h2>Edit Camera Type</h2>

View File

@ -1,5 +1,9 @@
{% extends 'base.html.twig' %} {% extends 'base.html.twig' %}
{% block title %}
Camera 📷 CRUD - Camera Types
{% endblock %}
{% block body %} {% block body %}
<h2>Camera Types</h2> <h2>Camera Types</h2>

View File

@ -1,5 +1,9 @@
{% extends 'form.html.twig' %} {% extends 'form.html.twig' %}
{% block title %}
Camera 📷 CRUD - Camera Type - Add
{% endblock %}
{% block form %} {% block form %}
<h2>Add a Camera Type</h2> <h2>Add a Camera Type</h2>

View File

@ -1,5 +1,9 @@
{% extends 'form.html.twig' %} {% extends 'form.html.twig' %}
{% block title %}
Camera 📷 CRUD - Camera Type - Show
{% endblock %}
{% block form %} {% block form %}
<h2>Camera Type</h2> <h2>Camera Type</h2>

View File

@ -1,5 +1,9 @@
{% extends 'base.html.twig' %} {% extends 'base.html.twig' %}
{% block title %}
Camera 📷 CRUD
{% endblock %}
{% block body %} {% block body %}
<div class="grid-container"></div> <div class="grid-container"></div>
{% endblock %} {% endblock %}

View File

@ -1,5 +1,9 @@
{% extends 'form.html.twig' %} {% extends 'form.html.twig' %}
{% block title %}
Camera 📷 CRUD - Film - Edit
{% endblock %}
{% block form %} {% block form %}
<h1>Edit Film</h1> <h1>Edit Film</h1>

View File

@ -1,5 +1,9 @@
{% extends 'base.html.twig' %} {% extends 'base.html.twig' %}
{% block title %}
Camera 📷 CRUD - Film
{% endblock %}
{% block body %} {% block body %}
<h2>Film</h2> <h2>Film</h2>
@ -24,6 +28,7 @@
<th>Film Format</th> <th>Film Format</th>
<th>Film Base</th> <th>Film Base</th>
<th>Unused Rolls</th> <th>Unused Rolls</th>
<th>Rolls in a Camera</th>
<th>Developed Rolls</th> <th>Developed Rolls</th>
<th>Chemistry</th> <th>Chemistry</th>
<th>Notes</th> <th>Notes</th>
@ -48,6 +53,7 @@
<td>{{ film.filmFormat }}</td> <td>{{ film.filmFormat }}</td>
<td>{{ film.filmBase }}</td> <td>{{ film.filmBase }}</td>
<td>{{ film.unusedRolls }}</td> <td>{{ film.unusedRolls }}</td>
<td>{{ film.rollsInCamera }}</td>
<td>{{ film.developedRolls }}</td> <td>{{ film.developedRolls }}</td>
<td>{{ film.chemistry }}</td> <td>{{ film.chemistry }}</td>
<td>{{ film.notes }}</td> <td>{{ film.notes }}</td>

View File

@ -1,5 +1,9 @@
{% extends 'form.html.twig' %} {% extends 'form.html.twig' %}
{% block title %}
Camera 📷 CRUD - Film - Add
{% endblock %}
{% block form %} {% block form %}
<h2>Add a Film</h2> <h2>Add a Film</h2>

View File

@ -1,5 +1,9 @@
{% extends 'form.html.twig' %} {% extends 'form.html.twig' %}
{% block title %}
Camera 📷 CRUD - Film - Show
{% endblock %}
{% block form %} {% block form %}
<h2>Film</h2> <h2>Film</h2>
@ -61,6 +65,10 @@
<th># of Unused Rolls</th> <th># of Unused Rolls</th>
<td>{{ film.unusedRolls }}</td> <td>{{ film.unusedRolls }}</td>
</tr> </tr>
<tr>
<th># of Rolls in a Camera</th>
<td>{{ film.rollsInCamera }}</td>
</tr>
<tr> <tr>
<th># of Developed Rolls</th> <th># of Developed Rolls</th>
<td>{{ film.developedRolls }}</td> <td>{{ film.developedRolls }}</td>

View File

@ -1,5 +1,9 @@
{% extends 'form.html.twig' %} {% extends 'form.html.twig' %}
{% block title %}
Camera 📷 CRUD - Flash - Edit
{% endblock %}
{% block form %} {% block form %}
<h2>Flash edit</h2> <h2>Flash edit</h2>

View File

@ -1,5 +1,9 @@
{% extends 'base.html.twig' %} {% extends 'base.html.twig' %}
{% block title %}
Camera 📷 CRUD - Flashes
{% endblock %}
{% block body %} {% block body %}
<h2>Flashes list</h2> <h2>Flashes list</h2>

View File

@ -1,5 +1,9 @@
{% extends 'form.html.twig' %} {% extends 'form.html.twig' %}
{% block title %}
Camera 📷 CRUD - Flash - Add
{% endblock %}
{% block form %} {% block form %}
<h2>Add a Flash</h2> <h2>Add a Flash</h2>

View File

@ -1,5 +1,9 @@
{% extends 'form.html.twig' %} {% extends 'form.html.twig' %}
{% block title %}
Camera 📷 CRUD - Flash - Show
{% endblock %}
{% block form %} {% block form %}
<h2>Flash</h2> <h2>Flash</h2>

View File

@ -1,4 +1,4 @@
<h1>Camera Collection Admin</h1> <h1>Camera Collection CRUD</h1>
<div class="top-bar"> <div class="top-bar">
<div class="top-bar-left"> <div class="top-bar-left">
<ul class="menu"> <ul class="menu">
@ -12,6 +12,8 @@
<li class="{{ route starts with 'lens_' ? 'is-active' }}"> <li class="{{ route starts with 'lens_' ? 'is-active' }}">
<a href="{{ path('lens_index') }}">Lenses</a> <a href="{{ path('lens_index') }}">Lenses</a>
</li> </li>
</ul>
<ul class="menu">
<li class="menu-text">Previously Owned</li> <li class="menu-text">Previously Owned</li>
<li class="{{ route starts with 'previously-owned-camera' ? 'is-active' }}"> <li class="{{ route starts with 'previously-owned-camera' ? 'is-active' }}">
<a href="{{ path('previously-owned-camera_index') }}">Cameras</a> <a href="{{ path('previously-owned-camera_index') }}">Cameras</a>

View File

@ -1,5 +1,9 @@
{% extends 'form.html.twig' %} {% extends 'form.html.twig' %}
{% block title %}
Camera 📷 CRUD - Lens - Edit
{% endblock %}
{% block form %} {% block form %}
<h2>Edit Lens</h2> <h2>Edit Lens</h2>

View File

@ -1,5 +1,9 @@
{% extends 'base.html.twig' %} {% extends 'base.html.twig' %}
{% block title %}
Camera 📷 CRUD - Lenses
{% endblock %}
{% block body %} {% block body %}
<h2>Lenses</h2> <h2>Lenses</h2>

View File

@ -1,5 +1,9 @@
{% extends 'form.html.twig' %} {% extends 'form.html.twig' %}
{% block title %}
Camera 📷 CRUD - Lens - Add
{% endblock %}
{% block form %} {% block form %}
<h2>Add a Lens</h2> <h2>Add a Lens</h2>

View File

@ -1,5 +1,9 @@
{% extends 'form.html.twig' %} {% extends 'form.html.twig' %}
{% block title %}
Camera 📷 CRUD - Lens - Show
{% endblock %}
{% block form %} {% block form %}
<h2>Lens</h2> <h2>Lens</h2>

View File

@ -1,5 +1,9 @@
{% extends 'form.html.twig' %} {% extends 'form.html.twig' %}
{% block title %}
Camera 📷 CRUD - Previously Owned Camera - Edit
{% endblock %}
{% block form %} {% block form %}
<h2>Edit Camera</h2> <h2>Edit Camera</h2>

View File

@ -1,5 +1,9 @@
{% extends 'base.html.twig' %} {% extends 'base.html.twig' %}
{% block title %}
Camera 📷 CRUD - Previously Owned Cameras
{% endblock %}
{% block body %} {% block body %}
<h2>Previously Owned Cameras</h2> <h2>Previously Owned Cameras</h2>

View File

@ -1,5 +1,9 @@
{% extends 'form.html.twig' %} {% extends 'form.html.twig' %}
{% block title %}
Camera 📷 CRUD - Previously Owned Camera - Show
{% endblock %}
{% block form %} {% block form %}
<h2>Previously Owned Camera</h2> <h2>Previously Owned Camera</h2>

View File

@ -1,5 +1,9 @@
{% extends 'form.html.twig' %} {% extends 'form.html.twig' %}
{% block title %}
Camera 📷 CRUD - Previously Owned Flash - Edit
{% endblock %}
{% block form %} {% block form %}
<h2>Edit Previously Owned Flash</h2> <h2>Edit Previously Owned Flash</h2>

View File

@ -1,5 +1,9 @@
{% extends 'base.html.twig' %} {% extends 'base.html.twig' %}
{% block title %}
Camera 📷 CRUD - Previously Owned Flashes
{% endblock %}
{% block body %} {% block body %}
<h2>Previously Owned Flashes</h2> <h2>Previously Owned Flashes</h2>

View File

@ -1,5 +1,9 @@
{% extends 'form.html.twig' %} {% extends 'form.html.twig' %}
{% block title %}
Camera 📷 CRUD - Previously Owned Flash - Show
{% endblock %}
{% block form %} {% block form %}
<h2>Previously Owned Flash</h2> <h2>Previously Owned Flash</h2>

View File

@ -1,5 +1,9 @@
{% extends 'form.html.twig' %} {% extends 'form.html.twig' %}
{% block title %}
Camera 📷 CRUD - Previously Owned Lens - Edit
{% endblock %}
{% block form %} {% block form %}
<h2>Edit Lens</h2> <h2>Edit Lens</h2>

View File

@ -1,5 +1,9 @@
{% extends 'base.html.twig' %} {% extends 'base.html.twig' %}
{% block title %}
Camera 📷 CRUD - Previously Owned Lenses
{% endblock %}
{% block body %} {% block body %}
<h2>Previously Owned Lenses</h2> <h2>Previously Owned Lenses</h2>

View File

@ -1,5 +1,9 @@
{% extends 'form.html.twig' %} {% extends 'form.html.twig' %}
{% block title %}
Camera 📷 CRUD - Previously Owned Lens - Edit
{% endblock %}
{% block form %} {% block form %}
<h2>Previously Owned Lens</h2> <h2>Previously Owned Lens</h2>