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 @@ - -
Actions | -Id | -Brand | -Mount | -Model | -Is Digital? | -Crop Factor | -Is Working? | -Notes | -Serial | -Formerly Owned? | -Purchase Price | -Battery Type | -Film Format | -Received | -
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
-
|
- {{ 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 %} | - -
Actions | +Brand | +Model | +Mount | +Film Format | +Serial | +Purchase Price | +Battery Type | +Notes | +
---|---|---|---|---|---|---|---|---|
+ + | +{{ camera.brand }} | +{{ camera.model }} | +{{ camera.mount }} | +{{ camera.filmFormat }} | +{{ camera.serial }} | +${{ camera.purchasePrice }} | +{{ camera.batteryType }} | +{{ camera.notes }} | +
Actions | +Brand | +Mount | +Model | +Crop Factor | +Is Working? | +Serial | +Formerly Owned? | +Purchase Price | +Battery Type | +Film Format | +Notes | +
---|---|---|---|---|---|---|---|---|---|---|---|
+ + | +{{ 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 }} | +
Actions | -Id | -Type | -Description | -
---|---|---|---|
-
|
- {{ cameraType.id }} | -{{ cameraType.type }} | -{{ cameraType.description }} | -
Actions | +Type | +Description | +
---|---|---|
+ + | +{{ cameraType.type }} | +{{ cameraType.description }} | +
Actions | -Id | -Brand | -Product Line | -Film Name | -Film Alias | -Film Speed | -Film Format | -Film Base | -Unused Rolls | -Rolls in a Camera | -Developed Rolls | -Chemistry | -Notes | -
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
-
|
- {{ 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 }} | -
Actions | +Brand | +Product Line | +Film Name | +Film Alias | +Film Speed | +Film Format | +Film Base | +Unused Rolls | +Rolls in a Camera | +Developed Rolls | +Chemistry | +Notes | +
---|---|---|---|---|---|---|---|---|---|---|---|---|
+ + | +{{ 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 }} | +
Actions | +Brand | +Product Line | +Film Name | +Film Alias | +Film Speed | +Film Format | +Film Base | +Unused Rolls | +Rolls in a Camera | +Developed Rolls | +Chemistry | +Notes | +
---|---|---|---|---|---|---|---|---|---|---|---|---|
+ + | +{{ 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 }} | +
Actions | -Id | -Brand | -Model | -Is Auto Flash? | -Is TTL? | -TTL Type | -Is P-TTL? | -P-TTL type | -Guide Number | -Purchase Price | -Received | -Batteries | -Notes | -Serial | -
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
-
|
- {{ 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 }} | -
Actions | +Brand | +Model | +Is Auto Flash? | +Is TTL? | +TTL Type | +Is P-TTL? | +P-TTL type | +Guide Number | +Purchase Price | +Received | +Batteries | +Serial | +Notes | +
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
+ + | +{{ 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 }} | +
Actions | -Id | -Brand | -Description | -Aperture Range | -Focal Range | -Serial | -Purchase Price | -Notes | -Mount | -Image Size | -Received | -Formerly Owned | -Front Filter Size | -Rear Filter Size | -Is Teleconverter? | -Design Elements / Groups | -Aperture 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 }} | -
Actions | +Brand | +Description | +Aperture Range | +Focal Range | +Serial | +Purchase Price | +Mount | +Image Size | +Formerly Owned | +Front Filter Size | +Rear Filter Size | +Is Teleconverter? | +Design Elements / Groups | +Aperture Blades | +Notes | +
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
+ + | +{{ 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 }} | +
Actions | +Brand | +Product Line | +Description | +Aperture Range | +Focal Range | +Serial | +Purchase Price | +Mount | +Image Size | +Formerly Owned | +Filter (F/R) | +Is Teleconverter? | +Design Elements / Groups | +Aperture Blades | +Notes | +
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
+ + | +{{ 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 }} | +
Actions | -Id | -Brand | -Mount | -Model | -Is Digital? | -Crop Factor | -Is Working? | -Notes | -Serial | -Purchase Price | -Battery Type | -Film Format | -Received | -
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
-
|
- {{ 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 %} | -
Actions | +Brand | +Mount | +Model | +Digital? | +Crop Factor | +Working? | +Serial | +Purchase Price | +Battery Type | +Film Format | +Notes | +
---|---|---|---|---|---|---|---|---|---|---|---|
+ + | +{{ 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 }} | +
Actions | -Id | -Brand | -Model | -Is Auto Flash? | -Is TTL | -TTL Type | -Is P-TTL | -P-TTL Type | -Guide Number | -Purchase Price | -Batteries | -Notes | -Serial | -
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
-
|
- {{ 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 }} | -
Actions | +Brand | +Model | +Is Auto Flash? | +Is TTL | +TTL Type | +Is P-TTL | +P-TTL Type | +Guide Number | +Purchase Price | +Batteries | +Serial | +Notes | +
---|---|---|---|---|---|---|---|---|---|---|---|---|
+ + | +{{ 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 }} | +
Actions | -Id | -Brand | -Coatings | -Product Line | -Model | -Aperture Range | -Focal Range | -Serial | -Purchase Price | -Notes | -Mount | -Image Size | -Front Filter Size | -Rear Filter Size | -Is Teleconverter? | -Design Elements/Groups | -Aperture 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 }} | -
Actions | +Brand | +Coatings | +Product Line | +Model | +Aperture Range | +Focal Range | +Serial | +Purchase Price | +Mount | +Image Size | +Filter (F/R) | +Is Teleconverter? | +Design Elements/Groups | +Aperture Blades | +Notes | +
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
+ + | +{{ 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 }} | +