Add new models and page for motions
This commit is contained in:
486
resources/views/livewire/motion/show.blade.php
Normal file
486
resources/views/livewire/motion/show.blade.php
Normal file
@@ -0,0 +1,486 @@
|
||||
<div class="min-h-screen bg-gradient-to-br from-blue-50 to-indigo-100">
|
||||
<div class="container mx-auto py-12 px-4">
|
||||
<!-- Breadcrumb Navigation -->
|
||||
<nav class="mb-8" aria-label="Breadcrumb">
|
||||
<div
|
||||
class="bg-white rounded-lg shadow-sm border border-gray-200 px-4 py-3"
|
||||
>
|
||||
<ol class="flex items-center space-x-2 text-sm text-gray-600">
|
||||
<li>
|
||||
<a
|
||||
wire:navigate
|
||||
href="{{ route('home') }}"
|
||||
class="text-blue-600 hover:text-blue-700 flex items-center"
|
||||
>
|
||||
<svg
|
||||
class="w-4 h-4 mr-1"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
viewBox="0 0 24 24"
|
||||
>
|
||||
<path
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
stroke-width="2"
|
||||
d="M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6"
|
||||
></path>
|
||||
</svg>
|
||||
Hem
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<svg
|
||||
class="w-4 h-4 text-gray-400"
|
||||
fill="currentColor"
|
||||
viewBox="0 0 20 20"
|
||||
>
|
||||
<path
|
||||
fill-rule="evenodd"
|
||||
d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z"
|
||||
clip-rule="evenodd"
|
||||
></path>
|
||||
</svg>
|
||||
</li>
|
||||
<li>
|
||||
<a
|
||||
wire:navigate
|
||||
href="{{ route('motion.search') }}"
|
||||
class="text-blue-600 hover:text-blue-700"
|
||||
>
|
||||
Sök Motioner
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<svg
|
||||
class="w-4 h-4 text-gray-400"
|
||||
fill="currentColor"
|
||||
viewBox="0 0 20 20"
|
||||
>
|
||||
<path
|
||||
fill-rule="evenodd"
|
||||
d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z"
|
||||
clip-rule="evenodd"
|
||||
></path>
|
||||
</svg>
|
||||
</li>
|
||||
<li class="font-medium text-gray-900">
|
||||
Motion
|
||||
{{ $motion->rm ?? '' }}:{{ $motion->beteckning ?? $motionId }}
|
||||
</li>
|
||||
</ol>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
@if ($motion)
|
||||
<!-- Motion Header -->
|
||||
<div
|
||||
class="bg-white rounded-lg shadow-md border border-gray-200 p-8 mb-8"
|
||||
>
|
||||
<div class="flex flex-col lg:flex-row lg:items-start gap-6">
|
||||
<div class="flex-1">
|
||||
<div class="flex items-start justify-between mb-4">
|
||||
<div>
|
||||
<h1
|
||||
class="text-3xl font-bold text-gray-900 mb-2"
|
||||
>
|
||||
{{ $motion->titel }}
|
||||
</h1>
|
||||
@if (! empty($motion->undertitel))
|
||||
<p class="text-lg text-gray-600 mb-4">
|
||||
{{ $motion->undertitel }}
|
||||
</p>
|
||||
@endif
|
||||
</div>
|
||||
<span
|
||||
class="inline-flex px-3 py-1 text-sm font-semibold rounded-full {{ $motion->subtyp == 'Partimotion' ? 'bg-blue-100 text-blue-800' : 'bg-green-100 text-green-800' }}"
|
||||
>
|
||||
{{ $motion->subtyp }}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<!-- Motion Details Grid -->
|
||||
<div
|
||||
class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4 mb-6"
|
||||
>
|
||||
<div class="bg-gray-50 rounded-lg p-4">
|
||||
<div
|
||||
class="text-sm font-medium text-gray-500 mb-1"
|
||||
>
|
||||
Beteckning
|
||||
</div>
|
||||
<div class="text-gray-900 font-semibold">
|
||||
{{ $motion->rm }}:{{ $motion->beteckning }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="bg-gray-50 rounded-lg p-4">
|
||||
<div
|
||||
class="text-sm font-medium text-gray-500 mb-1"
|
||||
>
|
||||
Datum
|
||||
</div>
|
||||
<div class="text-gray-900">
|
||||
{{ \Carbon\Carbon::parse($motion->datum)->format('Y-m-d') }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="bg-gray-50 rounded-lg p-4">
|
||||
<div
|
||||
class="text-sm font-medium text-gray-500 mb-1"
|
||||
>
|
||||
Status
|
||||
</div>
|
||||
<span
|
||||
class="inline-flex px-2 py-1 text-xs font-semibold rounded-full {{
|
||||
$motion->status == 'Hänvisad'
|
||||
? 'bg-yellow-100 text-yellow-800'
|
||||
: ($motion->status == 'Avslutad'
|
||||
? 'bg-green-100 text-green-800'
|
||||
: 'bg-gray-100 text-gray-800')
|
||||
}}"
|
||||
>
|
||||
{{ $motion->status }}
|
||||
</span>
|
||||
</div>
|
||||
<div class="bg-gray-50 rounded-lg p-4">
|
||||
<div
|
||||
class="text-sm font-medium text-gray-500 mb-1"
|
||||
>
|
||||
Utskott
|
||||
</div>
|
||||
<div class="text-gray-900">
|
||||
{{ $motion->organ ?: 'Ej tilldelat' }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Action Buttons -->
|
||||
<div class="flex flex-wrap gap-3">
|
||||
@if (! empty($motion->dokument_url_html))
|
||||
<a
|
||||
href="https:{{ $motion->dokument_url_html }}"
|
||||
target="_blank"
|
||||
class="px-4 py-2 text-sm font-medium text-white bg-blue-600 rounded-md hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500"
|
||||
>
|
||||
<svg
|
||||
class="w-4 h-4 inline mr-1"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
viewBox="0 0 24 24"
|
||||
>
|
||||
<path
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
stroke-width="2"
|
||||
d="M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"
|
||||
></path>
|
||||
</svg>
|
||||
Läs fullständig motion
|
||||
</a>
|
||||
@endif
|
||||
|
||||
<a
|
||||
href="{{ $this->riksdagenUrl }}"
|
||||
target="_blank"
|
||||
class="px-4 py-2 text-sm font-medium text-gray-700 bg-gray-100 rounded-md hover:bg-gray-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-gray-500"
|
||||
>
|
||||
<svg
|
||||
class="w-4 h-4 inline mr-1"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
viewBox="0 0 24 24"
|
||||
>
|
||||
<path
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
stroke-width="2"
|
||||
d="M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"
|
||||
></path>
|
||||
</svg>
|
||||
Visa på riksdag.se
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Motion Summary -->
|
||||
@if (! empty($motion->summary))
|
||||
<div
|
||||
class="bg-white rounded-lg shadow-md border border-gray-200 p-6 mb-8"
|
||||
>
|
||||
<div class="flex items-center mb-4">
|
||||
<div
|
||||
class="w-10 h-10 bg-blue-100 rounded-lg flex items-center justify-center mr-3"
|
||||
>
|
||||
<svg
|
||||
class="w-5 h-5 text-blue-600"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
viewBox="0 0 24 24"
|
||||
>
|
||||
<path
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
stroke-width="2"
|
||||
d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"
|
||||
></path>
|
||||
</svg>
|
||||
</div>
|
||||
<h2 class="text-xl font-bold text-gray-900">
|
||||
Sammanfattning
|
||||
</h2>
|
||||
</div>
|
||||
<div
|
||||
class="prose max-w-none text-gray-700 whitespace-pre-line"
|
||||
>
|
||||
{!! strip_tags($motion->summary, '<mark>') !!}
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<!-- Authors Section -->
|
||||
@if ($this->authors->isNotEmpty())
|
||||
<div
|
||||
class="bg-white rounded-lg shadow-md border border-gray-200 p-6 mb-8"
|
||||
>
|
||||
<div class="flex items-center mb-4">
|
||||
<div
|
||||
class="w-10 h-10 bg-green-100 rounded-lg flex items-center justify-center mr-3"
|
||||
>
|
||||
<svg
|
||||
class="w-5 h-5 text-green-600"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
viewBox="0 0 24 24"
|
||||
>
|
||||
<path
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
stroke-width="2"
|
||||
d="M12 4.354a4 4 0 110 5.292M15 21H3v-1a6 6 0 0112 0v1zm0 0h6v-1a6 6 0 00-9-5.197m13.5-9a2.5 2.5 0 11-5 0 2.5 2.5 0 015 0z"
|
||||
></path>
|
||||
</svg>
|
||||
</div>
|
||||
<h2 class="text-xl font-bold text-gray-900">
|
||||
Motionärer ({{ $this->authors->count() }})
|
||||
</h2>
|
||||
</div>
|
||||
<div
|
||||
class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4"
|
||||
>
|
||||
@foreach ($this->authors as $author)
|
||||
<div class="bg-gray-50 rounded-lg p-4">
|
||||
<div class="flex items-center justify-between">
|
||||
<div>
|
||||
<div
|
||||
class="font-semibold text-gray-900"
|
||||
>
|
||||
{{ $author->namn }}
|
||||
</div>
|
||||
<div class="text-sm text-gray-600">
|
||||
{{ $author->partibet }}
|
||||
</div>
|
||||
</div>
|
||||
<a
|
||||
wire:navigate
|
||||
href="{{ route('person.show', $author->intressent_id) }}"
|
||||
class="text-blue-600 hover:text-blue-700 text-sm font-medium"
|
||||
>
|
||||
Visa profil
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<!-- File Attachments -->
|
||||
@if ($this->attachments->isNotEmpty())
|
||||
<div
|
||||
class="bg-white rounded-lg shadow-md border border-gray-200 p-6 mb-8"
|
||||
>
|
||||
<div class="flex items-center mb-4">
|
||||
<div
|
||||
class="w-10 h-10 bg-purple-100 rounded-lg flex items-center justify-center mr-3"
|
||||
>
|
||||
<svg
|
||||
class="w-5 h-5 text-purple-600"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
viewBox="0 0 24 24"
|
||||
>
|
||||
<path
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
stroke-width="2"
|
||||
d="M15.172 7l-6.586 6.586a2 2 0 102.828 2.828l6.414-6.586a4 4 0 00-5.656-5.656l-6.415 6.585a6 6 0 108.486 8.486L20.5 13"
|
||||
></path>
|
||||
</svg>
|
||||
</div>
|
||||
<h2 class="text-xl font-bold text-gray-900">Bilagor</h2>
|
||||
</div>
|
||||
<div class="space-y-3">
|
||||
@foreach ($this->attachments as $file)
|
||||
<div
|
||||
class="flex items-center justify-between p-4 bg-gray-50 rounded-lg"
|
||||
>
|
||||
<div class="flex items-center">
|
||||
<div class="flex-shrink-0">
|
||||
@if ($file->typ == 'pdf')
|
||||
<svg
|
||||
class="w-8 h-8 text-red-600"
|
||||
fill="currentColor"
|
||||
viewBox="0 0 20 20"
|
||||
>
|
||||
<path
|
||||
fill-rule="evenodd"
|
||||
d="M4 4a2 2 0 012-2h4.586A2 2 0 0112 2.586L15.414 6A2 2 0 0116 7.414V16a2 2 0 01-2 2H6a2 2 0 01-2-2V4zm2 6a1 1 0 011-1h6a1 1 0 110 2H7a1 1 0 01-1-1zm1 3a1 1 0 100 2h6a1 1 0 100-2H7z"
|
||||
clip-rule="evenodd"
|
||||
></path>
|
||||
</svg>
|
||||
@elseif ($file->typ == 'docx')
|
||||
<svg
|
||||
class="w-8 h-8 text-blue-600"
|
||||
fill="currentColor"
|
||||
viewBox="0 0 20 20"
|
||||
>
|
||||
<path
|
||||
fill-rule="evenodd"
|
||||
d="M4 4a2 2 0 012-2h4.586A2 2 0 0112 2.586L15.414 6A2 2 0 0116 7.414V16a2 2 0 01-2 2H6a2 2 0 01-2-2V4zm2 6a1 1 0 011-1h6a1 1 0 110 2H7a1 1 0 01-1-1zm1 3a1 1 0 100 2h6a1 1 0 100-2H7z"
|
||||
clip-rule="evenodd"
|
||||
></path>
|
||||
</svg>
|
||||
@else
|
||||
<svg
|
||||
class="w-8 h-8 text-gray-600"
|
||||
fill="currentColor"
|
||||
viewBox="0 0 20 20"
|
||||
>
|
||||
<path
|
||||
fill-rule="evenodd"
|
||||
d="M4 4a2 2 0 012-2h4.586A2 2 0 0112 2.586L15.414 6A2 2 0 0116 7.414V16a2 2 0 01-2 2H6a2 2 0 01-2-2V4zm2 6a1 1 0 011-1h6a1 1 0 110 2H7a1 1 0 01-1-1zm1 3a1 1 0 100 2h6a1 1 0 100-2H7z"
|
||||
clip-rule="evenodd"
|
||||
></path>
|
||||
</svg>
|
||||
@endif
|
||||
</div>
|
||||
<div class="ml-4">
|
||||
<div
|
||||
class="text-sm font-medium text-gray-900"
|
||||
>
|
||||
{{ $file->namn }}
|
||||
</div>
|
||||
<div class="text-sm text-gray-500">
|
||||
{{ strtoupper($file->typ) }} •
|
||||
{{ number_format($file->storlek / 1024, 1) }}
|
||||
KB
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<a
|
||||
href="{{ $file->url }}"
|
||||
target="_blank"
|
||||
class="px-3 py-1 text-sm font-medium text-blue-600 bg-blue-50 rounded-md hover:bg-blue-100 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500"
|
||||
>
|
||||
Ladda ner
|
||||
</a>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<!-- Additional Information -->
|
||||
<div
|
||||
class="bg-white rounded-lg shadow-md border border-gray-200 p-6"
|
||||
>
|
||||
<div class="flex items-center mb-4">
|
||||
<div
|
||||
class="w-10 h-10 bg-gray-100 rounded-lg flex items-center justify-center mr-3"
|
||||
>
|
||||
<svg
|
||||
class="w-5 h-5 text-gray-600"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
viewBox="0 0 24 24"
|
||||
>
|
||||
<path
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
stroke-width="2"
|
||||
d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"
|
||||
></path>
|
||||
</svg>
|
||||
</div>
|
||||
<h2 class="text-xl font-bold text-gray-900">
|
||||
Teknisk information
|
||||
</h2>
|
||||
</div>
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
|
||||
<div class="bg-gray-50 rounded-lg p-4">
|
||||
<div class="text-sm font-medium text-gray-500 mb-1">
|
||||
Dokument-ID
|
||||
</div>
|
||||
<div class="text-gray-900 font-mono">
|
||||
{{ $motion->dok_id }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="bg-gray-50 rounded-lg p-4">
|
||||
<div class="text-sm font-medium text-gray-500 mb-1">
|
||||
Publicerad
|
||||
</div>
|
||||
<div class="text-gray-900">
|
||||
{{ \Carbon\Carbon::parse($motion->publicerad)->format('Y-m-d') }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="bg-gray-50 rounded-lg p-4">
|
||||
<div class="text-sm font-medium text-gray-500 mb-1">
|
||||
Systemdatum
|
||||
</div>
|
||||
<div class="text-gray-900">
|
||||
{{ \Carbon\Carbon::parse($motion->systemdatum)->format('Y-m-d H:i') }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="bg-gray-50 rounded-lg p-4">
|
||||
<div class="text-sm font-medium text-gray-500 mb-1">
|
||||
Källa
|
||||
</div>
|
||||
<div class="text-gray-900">{{ $motion->kalla }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@else
|
||||
<!-- Motion Not Found -->
|
||||
<div
|
||||
class="bg-white rounded-lg shadow-md border border-gray-200 p-8 text-center"
|
||||
>
|
||||
<svg
|
||||
class="w-16 h-16 text-gray-400 mx-auto mb-4"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
viewBox="0 0 24 24"
|
||||
>
|
||||
<path
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
stroke-width="2"
|
||||
d="M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"
|
||||
></path>
|
||||
</svg>
|
||||
<h3 class="text-lg font-medium text-gray-900 mb-2">
|
||||
Motion inte hittad
|
||||
</h3>
|
||||
<p class="text-gray-600 mb-4">
|
||||
Motionen med ID {{ $motionId }} kunde inte hittas.
|
||||
</p>
|
||||
<a
|
||||
wire:navigate
|
||||
href="{{ route('motion.search') }}"
|
||||
class="px-4 py-2 text-sm font-medium text-white bg-blue-600 rounded-md hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500"
|
||||
>
|
||||
Tillbaka till sökning
|
||||
</a>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user