diff --git a/public/css/app.css b/public/css/app.css index b83ff20..37678d3 100644 --- a/public/css/app.css +++ b/public/css/app.css @@ -6,13 +6,13 @@ table th, .descend { vertical-align:text-bottom; } -table thead th::before { +table.sortable thead th::before { content: " ↕\00a0"; } -table thead .ascend::before { +table.sortable thead .ascend::before { content: " ↑\00a0"; } -table thead .descend::before { +table.sortable thead .descend::before { content: " ↓\00a0"; } @@ -24,9 +24,22 @@ table { overflow: scroll; } +table.scroll { + display: table; +} + /* ---------------------------------------------------------------------------- Text Areas ---------------------------------------------------------------------------- */ textarea { height: 12rem; } + +/* ---------------------------------------------------------------------------- + Miscellaneous +---------------------------------------------------------------------------- */ + +.edit-icon { + display: inline-block; + transform: rotateZ(90deg); +} diff --git a/public/js/app.js b/public/js/app.js index 5bd79bd..e3a912a 100644 --- a/public/js/app.js +++ b/public/js/app.js @@ -1,9 +1,13 @@ $(document).foundation(); (function() { - var tables = document.getElementsByTagName('table'); + var tables = document.querySelectorAll('table.sortable'); + var i = 0; + var len = tables.length; - if (tables.length > 0) { - tsorter.create(tables[0], 1); + if (len > 0) { + for (;i < len; i++) { + tsorter.create(tables[i], 1); + } } }()); diff --git a/src/App.php b/src/App.php index 3f9e46c..348e187 100644 --- a/src/App.php +++ b/src/App.php @@ -1,4 +1,4 @@ -itemListView('camera/index.html.twig','cameras', [ - 'received' => 'DESC', + $em = $this->getDoctrine()->getManager(); + + $receivedItems = $em->getRepository(self::ENTITY)->findBy([ + 'received' => true + ], [ 'brand' => 'ASC', 'mount' => 'ASC', 'model' => 'ASC', ]); + $newItems = $em->getRepository(self::ENTITY)->findBy([ + 'received' => false + ], [ + 'brand' => 'ASC', + 'mount' => 'ASC', + 'model' => 'ASC', + ]); + + return $this->render('camera/index.html.twig', [ + 'not_received' => $newItems, + 'cameras' => $receivedItems, + ]); } /** diff --git a/src/Controller/CameraTypeController.php b/src/Controller/CameraTypeController.php index d6207f7..647e341 100644 --- a/src/Controller/CameraTypeController.php +++ b/src/Controller/CameraTypeController.php @@ -1,4 +1,4 @@ -itemListView('film/index.html.twig', 'films', [ - 'rollsInCamera' => 'DESC', + + $repo = $this->getDoctrine()->getManager()->getRepository(self::ENTITY); + + $criteria = Criteria::create() + ->where(Criteria::expr()->gt('rollsInCamera', 0)) + ->orderBy([ + 'filmFormat' => Criteria::ASC, + 'brand' => Criteria::ASC, + 'rollsInCamera' => Criteria::DESC, + 'productLine' => Criteria::ASC, + ]); + + $inCamera = $repo->matching($criteria); + + $notInCamera = $repo->findBy([ + 'rollsInCamera' => 0, + ], [ 'brand' => 'ASC', 'productLine' => 'ASC', 'filmFormat' => 'ASC', ]); + + return $this->render('film/index.html.twig', [ + 'in_camera' => $inCamera, + 'films' => $notInCamera, + ]); } /** diff --git a/src/Controller/FlashController.php b/src/Controller/FlashController.php index 6aa1905..eae6ff4 100644 --- a/src/Controller/FlashController.php +++ b/src/Controller/FlashController.php @@ -1,4 +1,4 @@ -itemListView('lenses/index.html.twig', 'lenses', [ - 'received' => 'DESC', + $em = $this->getDoctrine()->getManager(); + + $receivedItems = $em->getRepository(self::ENTITY)->findBy([ + 'received' => true + ], [ 'brand' => 'ASC', 'productLine' => 'ASC', 'mount' => 'ASC', 'minFocalLength' => 'ASC', 'maxFStop' => 'ASC', ]); + $newItems = $em->getRepository(self::ENTITY)->findBy([ + 'received' => false + ], [ + 'brand' => 'ASC', + 'productLine' => 'ASC', + 'mount' => 'ASC', + 'minFocalLength' => 'ASC', + 'maxFStop' => 'ASC', + ]); + + return $this->render('lenses/index.html.twig', [ + 'not_received' => $newItems, + 'lenses' => $receivedItems, + ]); } /** diff --git a/src/Controller/PreviouslyOwnedCameraController.php b/src/Controller/PreviouslyOwnedCameraController.php index bc48482..ea885fe 100644 --- a/src/Controller/PreviouslyOwnedCameraController.php +++ b/src/Controller/PreviouslyOwnedCameraController.php @@ -1,4 +1,4 @@ - - - - - - - - - - - - - - - - - - - - - - - {% for camera in cameras %} - - - - - - - - - - - - - - - - - - - {% endfor %} - -
ActionsIdBrandMountModelIs Digital?Crop FactorIs Working?NotesSerialFormerly Owned?Purchase PriceBattery TypeFilm FormatReceived
- - {{ camera.id }}{{ camera.brand }}{{ camera.mount }}{{ camera.model }}{% if camera.isDigital %}Yes{% else %}No{% endif %}{{ camera.cropFactor }}{% if camera.isWorking %}Yes{% else %}No{% endif %}{{ camera.notes }}{{ camera.serial }}{% if camera.formerlyOwned %}Yes{% else %}No{% endif %}${{ camera.purchasePrice }}{{ camera.batteryType }}{{ camera.filmFormat }}{% if camera.received %}Yes{% else %}No{% endif %}
- +
+ + + + + + + + + + + + + + + + + {% for camera in not_received %} + + + + + + + + + + + + {% endfor %} + +
Not Yet Received
ActionsBrandModelMountFilm FormatSerialPurchase PriceBattery TypeNotes
+ + {{ camera.brand }}{{ camera.model }}{{ camera.mount }}{{ camera.filmFormat }}{{ camera.serial }}${{ camera.purchasePrice }}{{ camera.batteryType }}{{ camera.notes }}
+
+
+ + + + + + + + + + + + + + + + + + + + {% for camera in cameras %} + + + + + + + + + + + + + + + {% endfor %} + +
Received
ActionsBrandMountModelCrop FactorIs Working?SerialFormerly Owned?Purchase PriceBattery TypeFilm FormatNotes
+ + {{ camera.brand }}{{ camera.mount }}{{ camera.model }}{{ camera.cropFactor }}{% if camera.isWorking %}✔{% else %}✗{% endif %}{{ camera.serial }}{% if camera.formerlyOwned %}✔{% else %}✗{% endif %}${{ camera.purchasePrice }}{{ camera.batteryType }}{{ camera.filmFormat }}{{ camera.notes }}
+
{% endblock %} diff --git a/templates/cameratype/index.html.twig b/templates/cameratype/index.html.twig index 8bb6706..eb8fcb8 100644 --- a/templates/cameratype/index.html.twig +++ b/templates/cameratype/index.html.twig @@ -15,30 +15,36 @@ - - - - - - - - - - - {% for cameraType in cameraTypes %} - - - - - - - {% endfor %} - -
ActionsIdTypeDescription
- - {{ cameraType.id }}{{ cameraType.type }}{{ cameraType.description }}
+
+ + + + + + + + + + {% for cameraType in cameraTypes %} + + + + + + {% endfor %} + +
ActionsTypeDescription
+ + {{ cameraType.type }}{{ cameraType.description }}
+
{% endblock %} diff --git a/templates/default/index.html.twig b/templates/default/index.html.twig index da4d7fa..20216d8 100644 --- a/templates/default/index.html.twig +++ b/templates/default/index.html.twig @@ -4,7 +4,3 @@ Camera 📷 CRUD {% endblock %} -{% block body %} -
-{% endblock %} - diff --git a/templates/film/index.html.twig b/templates/film/index.html.twig index a49dc15..fec32cf 100644 --- a/templates/film/index.html.twig +++ b/templates/film/index.html.twig @@ -15,52 +15,111 @@ - - - - - - - - - - - - - - - - - - - - - {% for film in films %} - - - - - - - - - - - - - - - - - {% endfor %} - -
ActionsIdBrandProduct LineFilm NameFilm AliasFilm SpeedFilm FormatFilm BaseUnused RollsRolls in a CameraDeveloped RollsChemistryNotes
- - {{ film.id }}{{ film.brand }}{{ film.productLine }}{{ film.filmName }}{{ film.filmAlias }}{{ film.filmSpeedAsa }}/{{ film.filmSpeedDin }}°{{ film.filmFormat }}{{ film.filmBase }}{{ film.unusedRolls }}{{ film.rollsInCamera }}{{ film.developedRolls }}{{ film.chemistry }}{{ film.notes }}
- +
+ + + + + + + + + + + + + + + + + + + + + {% for film in in_camera %} + + + + + + + + + + + + + + + + {% endfor %} + +
In Camera
ActionsBrandProduct LineFilm NameFilm AliasFilm SpeedFilm FormatFilm BaseUnused RollsRolls in a CameraDeveloped RollsChemistryNotes
+ + {{ film.brand }}{{ film.productLine }}{{ film.filmName }}{{ film.filmAlias }}{{ film.filmSpeedAsa }}/{{ film.filmSpeedDin }}°{{ film.filmFormat }}{{ film.filmBase }}{{ film.unusedRolls }}{{ film.rollsInCamera }}{{ film.developedRolls }}{{ film.chemistry }}{{ film.notes }}
+
+
+ + + + + + + + + + + + + + + + + + + + + {% for film in films %} + + + + + + + + + + + + + + + + {% endfor %} + +
Not in Camera
ActionsBrandProduct LineFilm NameFilm AliasFilm SpeedFilm FormatFilm BaseUnused RollsRolls in a CameraDeveloped RollsChemistryNotes
+ + {{ film.brand }}{{ film.productLine }}{{ film.filmName }}{{ film.filmAlias }}{{ film.filmSpeedAsa }}/{{ film.filmSpeedDin }}°{{ film.filmFormat }}{{ film.filmBase }}{{ film.unusedRolls }}{{ film.rollsInCamera }}{{ film.developedRolls }}{{ film.chemistry }}{{ film.notes }}
+
{% endblock %} diff --git a/templates/flash/index.html.twig b/templates/flash/index.html.twig index 987f0ae..b26c12c 100644 --- a/templates/flash/index.html.twig +++ b/templates/flash/index.html.twig @@ -5,7 +5,7 @@ {% endblock %} {% block body %} -

Flashes list

+

Flashes

- - - - - - - - - - - - - - - - - - - - - - {% for flash in flashes %} - - - - - - - - - - - - - - - - - - {% endfor %} - -
ActionsIdBrandModelIs Auto Flash?Is TTL?TTL TypeIs P-TTL?P-TTL typeGuide NumberPurchase PriceReceivedBatteriesNotesSerial
- - {{ flash.id }}{{ flash.brand }}{{ flash.model }}{% if flash.isAutoFlash %}Yes{% else %}No{% endif %}{% if flash.isTtl %}Yes{% else %}No{% endif %}{{ flash.ttlType }}{% if flash.isPTtl %}Yes{% else %}No{% endif %}{{ flash.pTtlType }}{{ flash.guideNumber }}${{ flash.purchasePrice }}{% if flash.received %}Yes{% else %}No{% endif %}{{ flash.batteries }}{{ flash.notes }}{{ flash.serial }}
+
+ + + + + + + + + + + + + + + + + + + + + {% for flash in flashes %} + + + + + + + + + + + + + + + + + {% endfor %} + +
ActionsBrandModelIs Auto Flash?Is TTL?TTL TypeIs P-TTL?P-TTL typeGuide NumberPurchase PriceReceivedBatteriesSerialNotes
+ + {{ flash.brand }}{{ flash.model }}{% if flash.isAutoFlash %}✔{% else %}✗{% endif %}{% if flash.isTtl %}✔{% else %}✗{% endif %}{{ flash.ttlType }}{% if flash.isPTtl %}✔{% else %}✗{% endif %}{{ flash.pTtlType }}{{ flash.guideNumber }}${{ flash.purchasePrice }}{% if flash.received %}✔{% else %}✗{% endif %}{{ flash.batteries }}{{ flash.serial }}{{ flash.notes }}
+
{% endblock %} diff --git a/templates/lenses/index.html.twig b/templates/lenses/index.html.twig index fb3c0f0..4a56d57 100644 --- a/templates/lenses/index.html.twig +++ b/templates/lenses/index.html.twig @@ -15,60 +15,125 @@ - - - - - - - - - - - - - - - - - - - - - - - - - {% for lense in lenses %} - - - - - - - - - - - - - - - - - - - - - {% endfor %} - -
ActionsIdBrandDescriptionAperture RangeFocal RangeSerialPurchase PriceNotesMountImage SizeReceivedFormerly OwnedFront Filter SizeRear Filter SizeIs Teleconverter?Design Elements / GroupsAperture Blades
- - {{ lense.id }}{{ lense.brand }}{{ lense.coatings }} {{ lense.productLine }} {{ lense.model }}{{ lense.minFStop }} — {{ lense.maxFStop }}{{ lense.minFocalLength }} — {{ lense.maxFocalLength }}{{ lense.serial }}${{ lense.purchasePrice }}{{ lense.notes }}{{ lense.mount }}{{ lense.imageSize }}{% if lense.received %}Yes{% else %}No{% endif %}{% if lense.formerlyOwned %}Yes{% else %}No{% endif %}{{ lense.frontFilterSize }}{{ lense.rearFilterSize }}{% if lense.isTeleconverter %}Yes{% else %}No{% endif %}{{ lense.designElements }} / {{ lense.designGroups }}{{ lense.apertureBlades }}
+
+ + + + + + + + + + + + + + + + + + + + + + + + {% for lens in not_received %} + + + + + + + + + + + + + + + + + + + {% endfor %} + +
Not Yet Received
ActionsBrandDescriptionAperture RangeFocal RangeSerialPurchase PriceMountImage SizeFormerly OwnedFront Filter SizeRear Filter SizeIs Teleconverter?Design Elements / GroupsAperture BladesNotes
+ + {{ lens.brand }}{{ lens.coatings }} {{ lens.productLine }} {{ lens.model }}{{ lens.minFStop }} — {{ lens.maxFStop }}{{ lens.minFocalLength }} — {{ lens.maxFocalLength }}{{ lens.serial }}${{ lens.purchasePrice }}{{ lens.mount }}{{ lens.imageSize }}{% if lens.formerlyOwned %}✔{% else %}✗{% endif %}{{ lens.frontFilterSize }}{{ lens.rearFilterSize }}{% if lens.isTeleconverter %}✔{% else %}✗{% endif %}{{ lens.designElements }} / {{ lens.designGroups }}{{ lens.apertureBlades }}{{ lens.notes }}
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + {% for lens in lenses %} + + + + + + + + + + + + + + + + + + + {% endfor %} + +
Received
ActionsBrandProduct LineDescriptionAperture RangeFocal RangeSerialPurchase PriceMountImage SizeFormerly OwnedFilter (F/R)Is Teleconverter?Design Elements / GroupsAperture BladesNotes
+ + {{ lens.brand }}{{ lens.productLine }}{{ lens.coatings }} {{ lens.model }}{{ lens.minFStop }} — {{ lens.maxFStop }}{{ lens.minFocalLength }} — {{ lens.maxFocalLength }}{{ lens.serial }}${{ lens.purchasePrice }}{{ lens.mount }}{{ lens.imageSize }}{% if lens.formerlyOwned %}✔{% else %}✗{% endif %}{{ lens.frontFilterSize }} / {{ lens.rearFilterSize }}{% if lens.isTeleconverter %}✔{% else %}✗{% endif %}{{ lens.designElements }} / {{ lens.designGroups }}{{ lens.apertureBlades }}{{ lens.notes }}
+
{% endblock %} diff --git a/templates/previouslyownedcamera/index.html.twig b/templates/previouslyownedcamera/index.html.twig index 0dea5c6..8cbf516 100644 --- a/templates/previouslyownedcamera/index.html.twig +++ b/templates/previouslyownedcamera/index.html.twig @@ -7,50 +7,54 @@ {% block body %}

Previously Owned Cameras

- - - - - - - - - - - - - - - - - - - - - {% for previouslyOwnedCamera in previouslyOwnedCameras %} - - - - - - - - - - - - - - - - - {% endfor %} - -
ActionsIdBrandMountModelIs Digital?Crop FactorIs Working?NotesSerialPurchase PriceBattery TypeFilm FormatReceived
- - {{ previouslyOwnedCamera.id }}{{ previouslyOwnedCamera.brand }}{{ previouslyOwnedCamera.mount }}{{ previouslyOwnedCamera.model }}{% if previouslyOwnedCamera.isDigital %}Yes{% else %}No{% endif %}{{ previouslyOwnedCamera.cropFactor }}{% if previouslyOwnedCamera.isWorking %}Yes{% else %}No{% endif %}{{ previouslyOwnedCamera.notes }}{{ previouslyOwnedCamera.serial }}${{ previouslyOwnedCamera.purchasePrice }}{{ previouslyOwnedCamera.batteryType }}{{ previouslyOwnedCamera.filmFormat }}{% if previouslyOwnedCamera.received %}Yes{% else %}No{% endif %}
+
+ + + + + + + + + + + + + + + + + + + {% for previouslyOwnedCamera in previouslyOwnedCameras %} + + + + + + + + + + + + + + + {% endfor %} + +
ActionsBrandMountModelDigital?Crop FactorWorking?SerialPurchase PriceBattery TypeFilm FormatNotes
+ + {{ previouslyOwnedCamera.brand }}{{ previouslyOwnedCamera.mount }}{{ previouslyOwnedCamera.model }}{% if previouslyOwnedCamera.isDigital %}✔{% else %}✗{% endif %}{{ previouslyOwnedCamera.cropFactor }}{% if previouslyOwnedCamera.isWorking %}✔{% else %}✗{% endif %}{{ previouslyOwnedCamera.serial }}${{ previouslyOwnedCamera.purchasePrice }}{{ previouslyOwnedCamera.batteryType }}{{ previouslyOwnedCamera.filmFormat }}{{ previouslyOwnedCamera.notes }}
+
{% endblock %} diff --git a/templates/previouslyownedflash/index.html.twig b/templates/previouslyownedflash/index.html.twig index 9181587..4fd7310 100644 --- a/templates/previouslyownedflash/index.html.twig +++ b/templates/previouslyownedflash/index.html.twig @@ -7,50 +7,57 @@ {% block body %}

Previously Owned Flashes

- - - - - - - - - - - - - - - - - - - - - {% for previouslyOwnedFlash in previouslyOwnedFlashes %} - - - - - - - - - - - - - - - - - {% endfor %} - -
ActionsIdBrandModelIs Auto Flash?Is TTLTTL TypeIs P-TTLP-TTL TypeGuide NumberPurchase PriceBatteriesNotesSerial
- - {{ previouslyOwnedFlash.id }}{{ previouslyOwnedFlash.brand }}{{ previouslyOwnedFlash.model }}{% if previouslyOwnedFlash.isAutoFlash %}Yes{% else %}No{% endif %}{% if previouslyOwnedFlash.isTtl %}Yes{% else %}No{% endif %}{{ previouslyOwnedFlash.ttlType }}{% if previouslyOwnedFlash.isPTtl %}Yes{% else %}No{% endif %}{{ previouslyOwnedFlash.pTtlType }}{{ previouslyOwnedFlash.guideNumber }}${{ previouslyOwnedFlash.purchasePrice }}{{ previouslyOwnedFlash.batteries }}{{ previouslyOwnedFlash.notes }}{{ previouslyOwnedFlash.serial }}
+
+ + + + + + + + + + + + + + + + + + + + {% for previouslyOwnedFlash in previouslyOwnedFlashes %} + + + + + + + + + + + + + + + + {% endfor %} + +
ActionsBrandModelIs Auto Flash?Is TTLTTL TypeIs P-TTLP-TTL TypeGuide NumberPurchase PriceBatteriesSerialNotes
+ + {{ previouslyOwnedFlash.brand }}{{ previouslyOwnedFlash.model }}{% if previouslyOwnedFlash.isAutoFlash %}✔{% else %}✗{% endif %}{% if previouslyOwnedFlash.isTtl %}✔{% else %}✗{% endif %}{{ previouslyOwnedFlash.ttlType }}{% if previouslyOwnedFlash.isPTtl %}✔{% else %}✗{% endif %}{{ previouslyOwnedFlash.pTtlType }}{{ previouslyOwnedFlash.guideNumber }}${{ previouslyOwnedFlash.purchasePrice }}{{ previouslyOwnedFlash.batteries }}{{ previouslyOwnedFlash.serial }}{{ previouslyOwnedFlash.notes }}
+
{% endblock %} diff --git a/templates/previouslyownedlenses/index.html.twig b/templates/previouslyownedlenses/index.html.twig index 627941b..a2139c0 100644 --- a/templates/previouslyownedlenses/index.html.twig +++ b/templates/previouslyownedlenses/index.html.twig @@ -7,58 +7,63 @@ {% block body %}

Previously Owned Lenses

- - - - - - - - - - - - - - - - - - - - - - - - - {% for previouslyOwnedLense in previouslyOwnedLenses %} - - - - - - - - - - - - - - - - - - - - - {% endfor %} - -
ActionsIdBrandCoatingsProduct LineModelAperture RangeFocal RangeSerialPurchase PriceNotesMountImage SizeFront Filter SizeRear Filter SizeIs Teleconverter?Design Elements/GroupsAperture Blades
- - {{ previouslyOwnedLense.id }}{{ previouslyOwnedLense.brand }}{{ previouslyOwnedLense.coatings }}{{ previouslyOwnedLense.productLine }}{{ previouslyOwnedLense.model }}{{ previouslyOwnedLense.minFStop }} — {{ previouslyOwnedLense.maxFStop }}{{ previouslyOwnedLense.minFocalLength }} — {{ previouslyOwnedLense.maxFocalLength }}{{ previouslyOwnedLense.serial }}${{ previouslyOwnedLense.purchasePrice }}{{ previouslyOwnedLense.notes }}{{ previouslyOwnedLense.mount }}{{ previouslyOwnedLense.imageSize }}{{ previouslyOwnedLense.frontFilterSize }}{{ previouslyOwnedLense.rearFilterSize }}{% if previouslyOwnedLense.isTeleconverter %}Yes{% else %}No{% endif %}{{ previouslyOwnedLense.designElements }}/{{ previouslyOwnedLense.designGroups }}{{ previouslyOwnedLense.apertureBlades }}
+
+ + + + + + + + + + + + + + + + + + + + + + + {% for previouslyOwnedLense in previouslyOwnedLenses %} + + + + + + + + + + + + + + + + + + + {% endfor %} + +
ActionsBrandCoatingsProduct LineModelAperture RangeFocal RangeSerialPurchase PriceMountImage SizeFilter (F/R)Is Teleconverter?Design Elements/GroupsAperture BladesNotes
+ + {{ previouslyOwnedLense.brand }}{{ previouslyOwnedLense.coatings }}{{ previouslyOwnedLense.productLine }}{{ previouslyOwnedLense.model }}{{ previouslyOwnedLense.minFStop }} — {{ previouslyOwnedLense.maxFStop }}{{ previouslyOwnedLense.minFocalLength }} — {{ previouslyOwnedLense.maxFocalLength }}{{ previouslyOwnedLense.serial }}${{ previouslyOwnedLense.purchasePrice }}{{ previouslyOwnedLense.mount }}{{ previouslyOwnedLense.imageSize }}{{ previouslyOwnedLense.frontFilterSize }} / {{ previouslyOwnedLense.rearFilterSize }}{% if previouslyOwnedLense.isTeleconverter %}✔{% else %}✗{% endif %}{{ previouslyOwnedLense.designElements }}/{{ previouslyOwnedLense.designGroups }}{{ previouslyOwnedLense.apertureBlades }}{{ previouslyOwnedLense.notes }}
+
{% endblock %}