From f5edb14daa9504d2f0b58e3e788ad9ed465861cc Mon Sep 17 00:00:00 2001 From: MuchQuak Date: Fri, 15 Nov 2024 19:04:57 -0800 Subject: [PATCH] add occurrence editor skeleton outline This code as no functionality it is just for trying out ui components get a feel for things and prep for functionality later --- .../core/collections/list/item.blade.php | 2 +- resources/views/core/icons/edit.blade.php | 3 + .../core/pages/occurrence/editor.blade.php | 602 ++++++++++++++++++ .../core/pages/occurrence/profile.blade.php | 6 + routes/web.php | 11 +- 5 files changed, 622 insertions(+), 2 deletions(-) create mode 100644 resources/views/core/icons/edit.blade.php create mode 100644 resources/views/core/pages/occurrence/editor.blade.php diff --git a/resources/views/core/collections/list/item.blade.php b/resources/views/core/collections/list/item.blade.php index df961b8..1233e83 100644 --- a/resources/views/core/collections/list/item.blade.php +++ b/resources/views/core/collections/list/item.blade.php @@ -12,7 +12,7 @@ @endif
{{ $occurrence->catalogNumber . $occurrence->recordedBy . $occurrence->recordedBy . $occurrence->recordNumber . $occurrence->eventDate}}
{{ implode(' | ', array_filter([$occurrence->locality, $occurrence->decimalLatitude, $occurrence->minimumElevationInMeters], fn ($v) => $v != null)) }}
- Full Record Details + Full Record Details {{-- Icon Container --}}
diff --git a/resources/views/core/icons/edit.blade.php b/resources/views/core/icons/edit.blade.php new file mode 100644 index 0000000..9f38bcb --- /dev/null +++ b/resources/views/core/icons/edit.blade.php @@ -0,0 +1,3 @@ +twMerge('fas fa-edit text-base-content hover:text-base-content/50')}}> + diff --git a/resources/views/core/pages/occurrence/editor.blade.php b/resources/views/core/pages/occurrence/editor.blade.php new file mode 100644 index 0000000..d8d1299 --- /dev/null +++ b/resources/views/core/pages/occurrence/editor.blade.php @@ -0,0 +1,602 @@ +@props(['occurrence']) +@php +function getLocalityStr($occur) { +/* +if($occur->localSecure) { +} +*/ + +$localityArr = [ +$occur->country, +$occur->stateProvince, +$occur->county, +$occur->municipality, +]; + +$locality_attributes = ['Locality' => implode(', ', $localityArr)]; +return implode(', ', $localityArr); + +if($occur->localitySecurity == 1) { +// notice Locality details protected +// Locality details protected +$locality_attributes['protection typically due to rare or threatened status'] = $occurrence->localitySecurityReason; +//Current user has been granted access if $occur->localSecure +} + +return $locality_attributes; +} +//echo '
' . var_export($occurrence, true) . '
'; +$attributes = [ +//'On Loan To' => $occurrence->loan, +//'Related Occurreces' => $occurrence->relation, +'Catalog #' => $occurrence->catalogNumber, +//'Occurrence ID' => $occurrence->occurrenceid, +'Secondary Catalog #' => $occurrence->otherCatalogNumbers, +'Taxon' => $occurrence->sciname, +'Identification Qualifier' => $occurrence->identificationQualifier, +'Family' => $occurrence->family, +'Determiner' => $occurrence->identifiedBy . ($occurrence->dateIdentified ? '(' . $occurrence->dateIdentified .')': ''), +'Taxon Remarks' => $occurrence->taxonRemarks, + +'ID References' => $occurrence->identificationReferences, +'ID Remarks' => $occurrence->identificationRemarks, +//'Determinations' => $occurrence->dets, +'Type Status' => $occurrence->typeStatus, +'Event ID' => $occurrence->eventID, +'Observer' => 'Collector' . $occurrence->recordedBy, +'Number' => $occurrence->recordNumber, +'Date' => implode(' - ', [$occurrence->eventDate, $occurrence->eventDate2, /*$occurrence->eventDateEnd*/]), +'Verbatim Date' => $occurrence->verbatimEventDate, +'Additional Collectors' => $occurrence->associatedCollectors, +'Locality' => getLocalityStr($occurrence), +'Latiude/Longitude' => $occurrence->decimalLatitude .' '. $occurrence->decimalLongitude . ' ' . +$occurrence->coordinateUncertaintyInMeters . $occurrence->geodeticDatum, +'Verbatim Coordinates' => $occurrence->verbatimCoordinates, +'Location Remarks' => $occurrence->locationRemarks, +'Georeference Remarks' => $occurrence->georeferenceRemarks, +'Elevation' => $occurrence->minimumElevationInMeters . ' - ' .$occurrence->maximumElevationInMeters . ' Meters' . ' ' . +$occurrence->verbatimElevation, +'Verbatim Elevation' => $occurrence->verbatimElevation, +'Depth' => $occurrence->minimumDepthInMeters . ' - ' . $occurrence->maximumDepthInMeters . ' Meters', +'Verbatim Depth' => $occurrence->verbatimDepth, +'Information withheld' => $occurrence->informationWithheld, +'Habitat' => $occurrence->habitat, +'substrate' => $occurrence->substrate, +'Associated Taxa' => $occurrence->associatedTaxa, +'Description' => $occurrence->verbatimAttributes, +'Dynamic Properties' => $occurrence->dynamicProperties, +'Reproductive Condition' => $occurrence->reproductiveCondition, +'Life Stage' => $occurrence->lifeStage, +'Sex' => $occurrence->sex, +'Individual Count' => $occurrence->individualCount, +'Sampling Protocol' => $occurrence->samplingProtocol, +'Preparations' => $occurrence->preparations, +'Notes' => implode('; ', [$occurrence->occurrenceRemarks, $occurrence->establishmentMeans, +$occurrence->cultivationStatus? 'Cultivated or Captive' : '']), +'Disposition' => $occurrence->disposition, +'Paleontology Terms' => 'TODO', +'Exsiccati series' => 'TODO', +'Material Samples' => 'TODO', +'Images' => 'TODO', +'Audio' => 'TODO', +//'Collector' => $occurrence->, +//'Number' => $occurrence->, +//'Date' => $occurrence->, +//'Verbatim Date' => $occurrence->, +//'Verbatim Locality' => $occurrence->, +//'Latiude/Longitude' => $occurrence->, +//'Creative Commons' => $occurrence->, +//'Record ID' => $occurrence->, +]; +@endphp + +
+ + New Record +
+ +
+ +
+ BLMAR - BLM Arcata Field Office Herbarium (BLMAR) +
+ +
+ + + + + +
+
+ + + {{-- Occurrence Data --}} +
+ {{-- Collector Info--}} +
+

Collector Info

+ +
+ +
+ + + + + + + + +
+ + {{-- Latest Identification --}} +
+

Latest Identification

+ + + + + + +
+ + {{-- Locality --}} +
+

Locality

+ + + + + + + + +
+ + {{-- Misc --}} +
+

Misc

+ + + + + + + + + + + + + + + +
+ + {{-- Curation --}} +
+

Curation

+ + + + + + + + + + + + + + +
+
Key: {{$occurrence->occid}}
+
Modified: {{ $occurrence->dateLastModified}}
+
Entered By: {{$occurrence->recordEnteredBy ?? 'not recorded'}} {{ + $occurrence->dateEntered?'[' + . $occurrence->dateEntered . ']': ''}}
+
+
+ + {{-- Options shoudl be the same as proccessing Status--}} + +
+

Record Cloning

+ + + {{-- TODO (Logan) Load Options for Cloning --}} + + {{-- TODO (Logan) Prepopulate Catalog numbers work --}} + Create Record(s) +
+ Save Edits +
+ + {{-- Determination History --}} +
+ Determination History + + + Submit Verification Edits + + @php + //Currently Just Test Data + $determinations = [ + ['sciname' => 'Pinus aristata', 'author' => 'Engelm.', 'date'=> 's.d.', 'determiner' => + 'unknown','isCurrent' => true] + ]; + @endphp +
+
+
Determination History
+
+ +
+
+
+ + + @foreach ($determinations as $determination) +
+
+ {{$determination['sciname']}} {{$determination['author']}} + @if($determination['isCurrent']) + Current Determination + @endif + +
+
+
+ Determiner:{{$determination['determiner']}} +
+
+ Date: {{$determination['date']}} +
+
+
+ @endforeach +
+
+ + {{-- Images --}} +
+ Add Media + @php + $media = [ + [ + 'caption' => 'Pine Specimen', + 'creator' => 'Harry', + 'notes' => 'Pine collected for research', + 'tags' => 'plant, image', + 'copywright' => 'sample-copywright', + 'source_url' => '', + 'url' => '', + 'thumbnail_url' => 'https://s3.msi.umn.edu/mbaenrms3fs/images/MIN_JFBM_PLANTS/01003/1003938_tn.jpg', + 'original_url' => '', + 'sort' => 0 + ], + ]; + @endphp + + @foreach ($media as $m) +
+
+ + + +
+
+
+ {{-- TODO (Logan) get edit form outline --}} + +
+
Caption: {{ $m['caption'] }}
+
Creator: {{ $m['creator'] }}
+
Notes: {{ $m['notes'] }}
+
Tags: {{ $m['tags'] }}
+
Source Webpage: {{ $m['source_url'] }}
+
Web URL: {{ $m['url'] }}
+
Large URL: {{ $m['original_url'] }}
+
Thumbnail URL: {{ $m['thumbnail_url'] }}
+
Sort: {{ $m['sort'] }}
+
+
+ @endforeach +
+ + {{-- Linked Resources --}} +
+
+
+

Asssociated Occurrences

+ +
+
+ No associations have been established +
+
+ +
+
+
+

Checklist Voucher Linkages

+
+
+ No voucher linkages have been established +
+
+ + Link to Checklist as Voucher +
+ +
+
+
+

Genetic Resources

+
+
+ No genetic linkages have been established +
+
+ +
Add New Resource
+ + + + + + Add New Genetic Resource +
+
+ + {{-- Traits --}} +
+
+
+
+

Anglosperm Phenolgical Traits

+
+
+ + {{-- TODO (Logan) Update this to have nested attribute tree--}} + + +
Add New Resource
+ + + + + Save Edits + Delete Coding +
+
+ + {{-- Admin --}} +
+
+

History of Interal Edits

+ @php + // For Putting of Skeleton Only + $edits = [ + [ + 'editor' => 'Me Wa', + 'date' => '2024-11-15 22:38', + 'applied_status' => 'Applied', + 'fields_edited' => [ + [ + 'name' => 'omoccuridentifiers', + 'old_value' => 'old value 1', + 'new_value' => 'new value 1', + ], + [ + 'name' => 'omoccuridentifiers', + 'old_value' => 'old value 2', + 'new_value' => 'new value 2', + ], + ] + ], + [ + 'editor' => 'Me Wa', + 'date' => '2024-11-15 22:38', + 'applied_status' => 'Applied', + 'fields_edited' => [ + [ + 'name' => 'omoccuridentifiers', + 'old_value' => 'old value 1', + 'new_value' => 'new value 1', + ], + [ + 'name' => 'omoccuridentifiers', + 'old_value' => 'old value 2', + 'new_value' => 'new value 2', + ], + ] + ] + ]; + @endphp + + @foreach ($edits as $edit) +
+
+
+ Editor: {{$edit['editor']}} +
+
+ Date: {{$edit['date']}} +
+
+
+ Applied Status: {{$edit['applied_status']}} +
+
+ @foreach ($edit['fields_edited'] as $field) +
+
Field: {{$field['name']}}
+
Old Value: {{$field['old_value']}}
+
New Value: {{$field['new_value']}}
+
+ @endforeach +
+
+ +
+ @endforeach +
+ + {{-- Transfer Record --}} +
+

Transfer Specimen

+ + Transfer Record +
+ + {{-- Delete Occurrence Record --}} +
+

Delete Occurrence Record

+

Record first needs to be evaluated before it can be deleted from the system. The evaluation ensures that the deletion of this record will not interfere with the integrity of other linked data. Note that all determination and comments for this occurrence will be automatically deleted. Links to images, and checklist vouchers will have to be individually addressed before can be deleted.

+ Evaluate Record for Deletion +
Image Links:
+
Checklist Voucher Links:
+
+
+
+
diff --git a/resources/views/core/pages/occurrence/profile.blade.php b/resources/views/core/pages/occurrence/profile.blade.php index 5f01039..ce1bf1b 100644 --- a/resources/views/core/pages/occurrence/profile.blade.php +++ b/resources/views/core/pages/occurrence/profile.blade.php @@ -116,6 +116,12 @@ function getLocalityStr($occur) {
BLMAR - BLM Arcata Field Office Herbarium (BLMAR)
+ +
+ + + +
diff --git a/routes/web.php b/routes/web.php index 53cac16..c006d18 100644 --- a/routes/web.php +++ b/routes/web.php @@ -103,7 +103,7 @@ }); //occurrence -Route::get('/occurrence/{clid}', function(int $occid) { +Route::get('/occurrence/{occid}', function(int $occid) { $occurrence = DB::table('omoccurrences as o') ->select('*') ->where('o.occid', '=', $occid) @@ -112,6 +112,15 @@ return view('pages/occurrence/profile', ['occurrence' => $occurrence]); }); +Route::get('/occurrence/{occid}/edit', function(int $occid) { + $occurrence = DB::table('omoccurrences as o') + ->select('*') + ->where('o.occid', '=', $occid) + ->first(); + + return view('pages/occurrence/editor', ['occurrence' => $occurrence]); +}); + /* Login/out routes */ Route::get('/login', LoginController::class); Route::post('/login', [LoginController::class, 'login']);