Skip to content

Commit

Permalink
collection/list progress
Browse files Browse the repository at this point in the history
  • Loading branch information
MuchQuak committed Oct 16, 2024
1 parent 26e926a commit 89e8f08
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 21 deletions.
2 changes: 1 addition & 1 deletion resources/views/core/breadcrumbs.blade.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@props(['items' => []])
<nav class="flex justify-between px-3.5 py-1 border border-base-300 rounded-md">
<nav class="flex justify-between px-3.5 py-1 border border-base-300 rounded-md w-fit">
<ol class="inline-flex items-center mb-3 space-x-1 text-xs text-base-content/50 sm:mb-0">
@empty($slot)
{{ $slot }}
Expand Down
22 changes: 16 additions & 6 deletions resources/views/core/collections/list/item.blade.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@props(['taxa' => ''])
@props(['occurrence' => null])
<div class="flex items-center gap-4 p-4 rounded-md border border-base-300 relative">
<div class="grid grid-cols-1 gap-2">
<img class="w-16 mx-auto" src="https://cch2.org/portal/content/collicon/blmar.jpg">
Expand All @@ -7,17 +7,27 @@
</div>
</div>
<div class="grid grid-cols-1">
<div>Taxa Name (Author)</div>
<div>Catalog # | Creator | Collector Number | date</div>
<div>Locality | Coordinates | Elevation </div>
<x-link href="#">Full Record Details</x-link>
@if($occurrence->sciname && $occurrence->scientificNameAuthorship)
<div>{{ $occurrence->sciname . '(' . $occurrence->scientificNameAuthorship . ')'}}</div>
@endif
<div>{{ $occurrence->catalogNumber . $occurrence->recordedBy . $occurrence->recordedBy . $occurrence->recordNumber . $occurrence->eventDate}}</div>
<div>{{ implode(' | ', array_filter([$occurrence->locality, $occurrence->decimalLatitude, $occurrence->minimumElevationInMeters], fn ($v) => $v != null)) }}</div>
<x-link href="{{url( config('portal.name') . '/collections/individual/index.php?occid=' . $occurrence->occid) }}" target="_blank">Full Record Details</x-link>
</div>
{{-- Icon Container --}}
<div class="absolute right-0 top-0 p-4 flex items-center gap-2">
@if($occurrence->image_cnt)
<i class="text-xl fas fa-camera"></i>
@endif

@if($occurrence->audio_cnt)
<i class="text-xl fas fa-file-audio"></i>
<a href="#">
@endif

@if (Auth::check())
<a href="{{url( config('portal.name') . '/collections/editor/occurrenceeditor.php?occid=' . $occurrence->occid)}}">
<i class="text-xl fas fa-edit hover:text-base-content/50 cursor-pointer"></i>
</a>
@endif
</div>
</div>
48 changes: 35 additions & 13 deletions resources/views/core/pages/collections/list.blade.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
@props(['occurrences' => [1, 2, 3, 1, 2, 3,1, 2, 3,1, 2, 3]])
<x-layout class="grid grid-col-1 gap-4">
@props(['occurrences' => []])
<x-layout class="grid grid-col-1 gap-4 grow-0">
<div>
<x-breadcrumbs :items="[
['title' => 'Home', 'href' => url('') ],
['title' => 'Search Criteria', 'href' => url(config('portal.name') . '/collections/search/index.php') ],
'Specimen Records'
]" />
</div>
<x-tabs :tabs="['Species List', 'Occurrence Records', 'Maps']" active="1">
{{-- Species --}}
<div class="flex items-center gap-4 h-60">
Expand All @@ -10,32 +17,47 @@
</x-button>
<x-button class="w-fit">
<a href="checklistsymbiota.php?taxatype=&taxa=&usethes=&taxonfilter=0&interface=key">

Open in Interactive Key Interface
</a>
</x-button>
<x-button class="w-fit">
<a href="download/index.php?taxatype=&taxa=&usethes=&taxonFilterCode=0&dltype=checklist">
<i class="fa-solid fa-download"></i>
Download Checklist Data
</a>
</x-button>
</div>

{{-- Occurrence Records --}}
<div class="grid grid-col-1 gap-4">
<div>
Dataset: All collections
Taxa: (Taxa list)
Search Criteria: ( Figure out what this is for )
</div>
<div class="flex items-center gap-4">
<x-button class="w-fit">Table Button ( Table Display )</x-button>
<x-button class="w-fit">Download ( Download Specimen Data )</x-button>
<x-button class="w-fit">Link ( Copy to Url )</x-button>
<div class="flex flex-wrap">
<div>
<div>Dataset: All collections</div>
<div>Taxa: (Taxa list)</div>
<div>Search Criteria: ( Figure out what this is for )</div>
</div>
<div class="flex items-center gap-4 grow justify-end">
<x-tooltip text="Display as Table">
<x-button class="w-fit">
<i class="text-xl fa-solid fa-table-list"></i>
</x-button>
</x-tooltip>
<x-tooltip text="Download Specimen Data">
<x-button class="w-fit">
<i class="text-xl fa-solid fa-download"></i>
</x-button>
</x-tooltip>
<x-tooltip text="Copy Search Url to clipboard">
<x-button class="w-fit">
<i class="text-xl fa-regular fa-copy"></i>
</x-button>
</x-tooltip>
</div>

</div>
<div class="grid grid-col-1 gap-4">
@foreach ($occurrences as $occurrence)
<x-collections.list.item />
<x-collections.list.item :occurrence="$occurrence" />
@endforeach
</div>
</div>
Expand Down
24 changes: 23 additions & 1 deletion routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use App\Http\Controllers\MarkdownController;
use App\Http\Controllers\RegistrationController;
use Illuminate\Database\Query\Builder;
use Illuminate\Database\Query\JoinClause;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Blade;
use Illuminate\Support\Facades\Cookie;
Expand All @@ -31,10 +32,30 @@

/* In Progress Skeletons */
Route::view('/collections/search', 'pages/collections');
Route::view('/collections/list', 'pages/collections/list');
Route::view('/occurrence', 'pages/occurrence/profile');
Route::view('/taxon', 'pages/taxon/profile');

// Collection
Route::get('/collections/list', function(Request $request) {
$params = $request->all();
$media_cnt = DB::table('media as m')->select(
'm.occid',
DB::raw('sum(if(media_type = "image", 1, 0)) as image_cnt'),
DB::raw('sum(if(media_type = "audio", 1, 0)) as audio_cnt')
)->groupBy('m.occid');

$occurrences = DB::table('omoccurrences as o')
->select('o.*','image_cnt','audio_cnt')
->leftJoinSub($media_cnt, 'media_cnt', function(JoinClause $join) {
$join->on('media_cnt.occid', '=', 'o.occid');
})
->limit(30)
->get();

return view('pages/collections/list', ['occurrences' => $occurrences]);
});

// Checklist
Route::get('/checklist/{clid}', function(int $clid) {
$checklist = DB::table('fmchecklists as c')
->select('*')
Expand All @@ -44,6 +65,7 @@
return view('pages/checklist/profile', ['checklist' => $checklist]);
});


Route::get('/checklists', function (Request $request){
$checklists = DB::table('fmchecklists as c')
->select('proj.pid', 'c.clid', 'c.name', 'projname', 'mapChecklist')
Expand Down

0 comments on commit 89e8f08

Please sign in to comment.