Add new models and page for motions

This commit is contained in:
2025-12-27 16:51:57 +01:00
parent 3ef975ad39
commit 45fe15eef2
36 changed files with 3753 additions and 355 deletions

View File

@@ -6,30 +6,117 @@
Riksdagen App
</h1>
<p class="text-lg text-gray-600 max-w-2xl mx-auto">
Utforska information om riksdagsledamöter, deras röster och uppdrag i Sveriges riksdag
Utforska information om riksdagsledamöter, deras röster och
uppdrag i Sveriges riksdag
</p>
</div>
<!-- Navigation Cards -->
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6 max-w-6xl mx-auto">
<div
class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6 max-w-6xl mx-auto"
>
<!-- Person Search Card -->
<a wire:navigate href="{{ route('person.search') }}" class="group">
<div class="bg-white rounded-lg shadow-md hover:shadow-xl transition-all duration-300 transform hover:-translate-y-1 border border-gray-200 overflow-hidden">
<div
class="bg-white rounded-lg shadow-md hover:shadow-xl transition-all duration-300 transform hover:-translate-y-1 border border-gray-200 overflow-hidden"
>
<div class="p-6">
<div class="w-12 h-12 bg-blue-100 rounded-lg flex items-center justify-center mb-4 group-hover:bg-blue-200 transition-colors">
<svg class="w-6 h-6 text-blue-600" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"></path>
<div
class="w-12 h-12 bg-blue-100 rounded-lg flex items-center justify-center mb-4 group-hover:bg-blue-200 transition-colors"
>
<svg
class="w-6 h-6 text-blue-600"
fill="none"
stroke="currentColor"
viewBox="0 0 24 24"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"
></path>
</svg>
</div>
<h3 class="text-xl font-semibold text-gray-900 mb-2">Ledamöter</h3>
<h3 class="text-xl font-semibold text-gray-900 mb-2">
Ledamöter
</h3>
<p class="text-gray-600 mb-4">
Sök och utforska information om riksdagsledamöter, deras rösthistorik och uppdrag
Sök och utforska information om riksdagsledamöter,
deras rösthistorik och uppdrag
</p>
<div class="flex items-center text-blue-600 group-hover:text-blue-700">
<span class="text-sm font-medium">Sök ledamöter</span>
<svg class="w-4 h-4 ml-2 transform group-hover:translate-x-1 transition-transform" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7"></path>
<div
class="flex items-center text-blue-600 group-hover:text-blue-700"
>
<span class="text-sm font-medium">
Sök ledamöter
</span>
<svg
class="w-4 h-4 ml-2 transform group-hover:translate-x-1 transition-transform"
fill="none"
stroke="currentColor"
viewBox="0 0 24 24"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M9 5l7 7-7 7"
></path>
</svg>
</div>
</div>
</div>
</a>
<!-- Motion Search Card -->
<a wire:navigate href="{{ route('motion.search') }}" class="group">
<div
class="bg-white rounded-lg h-full shadow-md hover:shadow-xl transition-all duration-300 transform hover:-translate-y-1 border border-gray-200 overflow-hidden"
>
<div class="p-6">
<div
class="w-12 h-12 bg-green-100 rounded-lg flex items-center justify-center mb-4 group-hover:bg-green-200 transition-colors"
>
<svg
class="w-6 h-6 text-green-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>
<h3 class="text-xl font-semibold text-gray-900 mb-2">
Motioner
</h3>
<p class="text-gray-600 mb-4">
Sök bland motioner som lämnats till riksdagen av
ledamöterna
</p>
<div
class="flex items-center text-green-600 group-hover:text-green-700"
>
<span class="text-sm font-medium">
Sök motioner
</span>
<svg
class="w-4 h-4 ml-2 transform group-hover:translate-x-1 transition-transform"
fill="none"
stroke="currentColor"
viewBox="0 0 24 24"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M9 5l7 7-7 7"
></path>
</svg>
</div>
</div>
@@ -37,16 +124,33 @@
</a>
<!-- Placeholder Card 1 -->
<div class="bg-white rounded-lg shadow-md border border-gray-200 overflow-hidden opacity-60">
<div
class="bg-white rounded-lg shadow-md border border-gray-200 overflow-hidden opacity-60"
>
<div class="p-6">
<div class="w-12 h-12 bg-gray-100 rounded-lg flex items-center justify-center mb-4">
<svg class="w-6 h-6 text-gray-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5H7a2 2 0 00-2 2v10a2 2 0 002 2h8a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"></path>
<div
class="w-12 h-12 bg-gray-100 rounded-lg flex items-center justify-center mb-4"
>
<svg
class="w-6 h-6 text-gray-400"
fill="none"
stroke="currentColor"
viewBox="0 0 24 24"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M9 5H7a2 2 0 00-2 2v10a2 2 0 002 2h8a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"
></path>
</svg>
</div>
<h3 class="text-xl font-semibold text-gray-500 mb-2">Propositioner</h3>
<h3 class="text-xl font-semibold text-gray-500 mb-2">
Propositioner
</h3>
<p class="text-gray-400 mb-4">
Sök och läs propositioner och andra dokument från riksdagen
Sök och läs propositioner och andra dokument från
riksdagen
</p>
<div class="flex items-center text-gray-400">
<span class="text-sm font-medium">Kommer snart</span>
@@ -55,14 +159,30 @@
</div>
<!-- Placeholder Card 2 -->
<div class="bg-white rounded-lg shadow-md border border-gray-200 overflow-hidden opacity-60">
<div
class="bg-white rounded-lg shadow-md border border-gray-200 overflow-hidden opacity-60"
>
<div class="p-6">
<div class="w-12 h-12 bg-gray-100 rounded-lg flex items-center justify-center mb-4">
<svg class="w-6 h-6 text-gray-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z"></path>
<div
class="w-12 h-12 bg-gray-100 rounded-lg flex items-center justify-center mb-4"
>
<svg
class="w-6 h-6 text-gray-400"
fill="none"
stroke="currentColor"
viewBox="0 0 24 24"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z"
></path>
</svg>
</div>
<h3 class="text-xl font-semibold text-gray-500 mb-2">Statistik</h3>
<h3 class="text-xl font-semibold text-gray-500 mb-2">
Statistik
</h3>
<p class="text-gray-400 mb-4">
Se röststatistik och analyser för partier och ledamöter
</p>
@@ -72,33 +192,31 @@
</div>
</div>
<!-- Placeholder Card 3 -->
<div class="bg-white rounded-lg shadow-md border border-gray-200 overflow-hidden opacity-60">
<div class="p-6">
<div class="w-12 h-12 bg-gray-100 rounded-lg flex items-center justify-center mb-4">
<svg class="w-6 h-6 text-gray-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"></path>
</svg>
</div>
<h3 class="text-xl font-semibold text-gray-500 mb-2">Kalender</h3>
<p class="text-gray-400 mb-4">
Se kommande voteringar och riksdagsmöten
</p>
<div class="flex items-center text-gray-400">
<span class="text-sm font-medium">Kommer snart</span>
</div>
</div>
</div>
<!-- Placeholder Card 4 -->
<div class="bg-white rounded-lg shadow-md border border-gray-200 overflow-hidden opacity-60">
<div
class="bg-white rounded-lg shadow-md border border-gray-200 overflow-hidden opacity-60"
>
<div class="p-6">
<div class="w-12 h-12 bg-gray-100 rounded-lg flex items-center justify-center mb-4">
<svg class="w-6 h-6 text-gray-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z"></path>
<div
class="w-12 h-12 bg-gray-100 rounded-lg flex items-center justify-center mb-4"
>
<svg
class="w-6 h-6 text-gray-400"
fill="none"
stroke="currentColor"
viewBox="0 0 24 24"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z"
></path>
</svg>
</div>
<h3 class="text-xl font-semibold text-gray-500 mb-2">Partier</h3>
<h3 class="text-xl font-semibold text-gray-500 mb-2">
Partier
</h3>
<p class="text-gray-400 mb-4">
Utforska partier och deras ståndpunkter i olika frågor
</p>
@@ -109,14 +227,30 @@
</div>
<!-- Placeholder Card 5 -->
<div class="bg-white rounded-lg shadow-md border border-gray-200 overflow-hidden opacity-60">
<div
class="bg-white rounded-lg shadow-md border border-gray-200 overflow-hidden opacity-60"
>
<div class="p-6">
<div class="w-12 h-12 bg-gray-100 rounded-lg flex items-center justify-center mb-4">
<svg class="w-6 h-6 text-gray-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"></path>
<div
class="w-12 h-12 bg-gray-100 rounded-lg flex items-center justify-center mb-4"
>
<svg
class="w-6 h-6 text-gray-400"
fill="none"
stroke="currentColor"
viewBox="0 0 24 24"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"
></path>
</svg>
</div>
<h3 class="text-xl font-semibold text-gray-500 mb-2">Sök Allmänt</h3>
<h3 class="text-xl font-semibold text-gray-500 mb-2">
Sök Allmänt
</h3>
<p class="text-gray-400 mb-4">
Sök i alla riksdagens dokument och voteringar
</p>
@@ -125,7 +259,6 @@
</div>
</div>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,361 @@
<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 class="font-medium text-gray-900">Sök Motioner</li>
</ol>
</div>
</nav>
<!-- Header -->
<div class="text-center mb-8">
<h1 class="text-4xl font-bold text-gray-900 mb-4">Sök Motioner</h1>
<p class="text-lg text-gray-600">
Sök bland alla motioner som lämnats till riksdagen
</p>
</div>
<!-- Search Form -->
<div
class="bg-white rounded-lg shadow-md border border-gray-200 p-6 mb-8"
>
<div class="grid grid-cols-1 md:grid-cols-3 gap-4">
<!-- Query Search -->
<div>
<label
for="query"
class="block text-sm font-medium text-gray-700 mb-2"
>
Sökfras
</label>
<input
type="text"
id="query"
wire:model.live.debounce.500ms="query"
class="w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 text-black"
placeholder="Sök efter nyckelord..."
/>
</div>
<!-- Party Select -->
<div>
<label
for="party"
class="block text-sm font-medium text-gray-700 mb-2"
>
Parti
</label>
<select
id="party"
wire:model.live="party"
class="w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 text-black"
>
<option value="">Alla partier</option>
@foreach ($this->parties as $code => $name)
<option value="{{ $code }}">{{ $name }}</option>
@endforeach
</select>
</div>
<!-- Date Interval -->
<div>
<label
for="dateInterval"
class="block text-sm font-medium text-gray-700 mb-2"
>
Riksdagsår
</label>
<select
id="dateInterval"
wire:model.live="dateInterval"
class="w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 text-black"
>
<option value="">Alla år</option>
@foreach ($this->dateIntervals as $interval => $label)
<option value="{{ $interval }}">
{{ $label }}
</option>
@endforeach
</select>
</div>
</div>
<!-- Clear Filters Button -->
<div class="mt-4 flex justify-end">
<button
wire:click="clearFilters"
class="px-4 py-2 text-sm font-medium text-gray-700 bg-gray-100 border border-gray-300 rounded-md hover:bg-gray-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-gray-500"
>
Rensa filter
</button>
</div>
</div>
<!-- Loading State -->
<div class="hidden" wire:loading.block>
<div class="flex justify-center items-center py-16">
<div
class="w-12 h-12 border-4 border-t-blue-600 border-blue-200 rounded-full animate-spin"
></div>
<span class="ml-4 text-gray-600 font-medium">
Söker motioner...
</span>
</div>
</div>
<!-- Results -->
@if (! $loading)
@if ($this->motions->isNotEmpty())
<!-- Results Header -->
<div
class="bg-white rounded-lg shadow-md border border-gray-200 p-4 mb-6"
>
<div class="flex justify-between items-center">
<h2 class="text-lg font-medium text-gray-900">
Hittade {{ number_format($this->totalResults) }}
motioner
</h2>
<div class="text-sm text-gray-500">
Sida {{ $this->getPage() }} av
{{ $paginatedMotions->lastPage() }}
</div>
</div>
</div>
<!-- Motion Cards -->
<div class="space-y-4 mb-8">
@foreach ($paginatedMotions as $motion)
<div
class="bg-white rounded-lg shadow-md border border-gray-200 p-6 hover:shadow-lg transition-shadow"
>
<div
class="flex flex-col lg:flex-row lg:items-start gap-4"
>
<div class="flex-1">
<div
class="flex items-start justify-between mb-3"
>
<div>
<h3
class="text-lg font-semibold text-gray-900 mb-1"
>
<a
wire:navigate
href="{{ route('motion.show', $motion->dok_id) }}"
class="hover:text-blue-600 transition-colors"
>
{{ $motion->titel }}
</a>
</h3>
@if (! empty($motion->undertitel))
<p
class="text-sm text-gray-600 mb-2"
>
{{ $motion->undertitel }}
</p>
@endif
</div>
<span
class="inline-flex px-3 py-1 text-xs font-semibold rounded-full {{ $motion->subtyp == 'Partimotion' ? 'bg-blue-100 text-blue-800' : 'bg-green-100 text-green-800' }}"
>
{{ $motion->subtyp }}
</span>
</div>
<div
class="grid grid-cols-2 lg:grid-cols-4 gap-4 mb-4"
>
<div>
<span
class="text-xs font-medium text-gray-500 uppercase"
>
Beteckning
</span>
<p
class="text-sm font-medium text-gray-900"
>
{{ $motion->rm }}:{{ $motion->beteckning }}
</p>
</div>
<div>
<span
class="text-xs font-medium text-gray-500 uppercase"
>
Datum
</span>
<p class="text-sm text-gray-900">
{{ \Carbon\Carbon::parse($motion->datum)->format('Y-m-d') }}
</p>
</div>
<div>
<span
class="text-xs font-medium text-gray-500 uppercase"
>
Status
</span>
<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>
<span
class="text-xs font-medium text-gray-500 uppercase"
>
Utskott
</span>
<p class="text-sm text-gray-900">
{{ $motion->organ ?: '-' }}
</p>
</div>
</div>
@if (! empty($motion->summary))
<p
class="text-sm text-gray-700 line-clamp-3 mb-4"
>
{!! strip_tags($motion->summary, '<mark>') !!}
</p>
@endif
</div>
<!-- Actions -->
<div
class="flex-shrink-0 flex flex-row lg:flex-col gap-2"
>
<a
wire:navigate
href="{{ route('motion.show', $motion->dok_id) }}"
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 text-center"
>
Visa detaljer
</a>
@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-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 text-center"
>
Läs motion
</a>
@endif
</div>
</div>
</div>
@endforeach
</div>
<!-- Pagination -->
<div
class="bg-white rounded-lg shadow-md border border-gray-200 p-4"
>
@if ($paginatedMotions)
{{ $paginatedMotions->links() }}
@endif
</div>
@elseif (! empty($query) || ! empty($party) || ! empty($dateInterval))
<!-- No Results -->
<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="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>
<h3 class="text-lg font-medium text-gray-900 mb-2">
Inga motioner hittades
</h3>
<p class="text-gray-600 mb-4">
Försök ändra dina sökkriterier.
</p>
<button
wire:click="clearFilters"
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"
>
Rensa filter
</button>
</div>
@else
<!-- Initial State -->
<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="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"
></path>
</svg>
<h3 class="text-lg font-medium text-gray-900 mb-2">
Börja din sökning
</h3>
<p class="text-gray-600">
Använd sökfälten ovan för att hitta motioner.
</p>
</div>
@endif
@endif
</div>
</div>

View 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 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>

View File

@@ -88,43 +88,46 @@
@foreach ($persons as $person)
<div
class="bg-gray-50 rounded-lg p-4 hover:bg-gray-100 transition-colors border border-gray-200">
<div class="flex items-center">
<img src="{{ $person->bild_url_80 ?? '' }}" alt="{{ $person->tilltalsnamn }}"
class="w-16 h-16 rounded-lg object-cover mr-4 border border-gray-300">
<div class="flex-1">
<a wire:navigate href="{{ route('person.show', $person->intressent_id) }}"
class="text-xl font-bold text-blue-600 hover:text-blue-700 transition-colors">
{{ $person->tilltalsnamn }} {{ $person->efternamn }} ({{ $person->parti }})
</a>
<div class="text-gray-600 mt-1 flex items-center gap-2">
<img src="{{ App\Enums\Parties::from($person->parti)->logo() }}"
width="32">
{{ $person->valkrets }}
<a wire:navigate href="{{ route('person.show', $person->intressent_id) }}">
<div class="flex items-center">
<img src="{{ $person->bild_url_80 ?? '' }}" alt="{{ $person->tilltalsnamn }}"
class="w-16 h-16 rounded-lg object-cover mr-4 border border-gray-300">
<div class="flex-1">
<span class="text-xl font-bold text-black transition-colors">
{{ $person->tilltalsnamn }} {{ $person->efternamn }}
({{ $person->parti }})
</span>
<div class="text-gray-600 mt-1 flex items-center gap-2">
<img src="{{ App\Enums\Parties::from($person->parti)->logo() }}"
width="32">
{{ $person->valkrets }}
</div>
<div class="text-sm text-gray-500 mt-1">{{ $person->status }}</div>
</div>
<div class="text-sm text-gray-500 mt-1">{{ $person->status }}</div>
<svg class="w-5 h-5 text-gray-400" fill="none" stroke="currentColor"
viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M9 5l7 7-7 7"></path>
</svg>
</div>
<svg class="w-5 h-5 text-gray-400" fill="none" stroke="currentColor"
viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M9 5l7 7-7 7"></path>
</svg>
</div>
</a>
</div>
@endforeach
</div>
</div>
@elseif ($results && (!isset($results->personlista->person) || empty($results->personlista->person)))
<div class="bg-yellow-50 border border-yellow-200 rounded-lg p-6 max-w-4xl mx-auto">
<div class="flex items-center">
<svg class="w-5 h-5 text-yellow-600 mr-2" 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>
<span class="text-yellow-800 font-medium">Inga ledamöter hittades med de angivna
sökkriterier.</span>
</div>
</div>
@endif
</div>
@elseif ($results && (!isset($results->personlista->person) || empty($results->personlista->person)))
<div class="bg-yellow-50 border border-yellow-200 rounded-lg p-6 max-w-4xl mx-auto">
<div class="flex items-center">
<svg class="w-5 h-5 text-yellow-600 mr-2" 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>
<span class="text-yellow-800 font-medium">Inga ledamöter hittades med de angivna sökkriterier.</span>
</div>
</div>
@endif
</div>
</div>
</div>

File diff suppressed because it is too large Load Diff