329 lines
14 KiB
PHP
329 lines
14 KiB
PHP
@extends('pemerintah.main')
|
|
|
|
@section('content')
|
|
<style>
|
|
.information {
|
|
padding: 20px;
|
|
background-color: #f9f9f9;
|
|
border-radius: 10px;
|
|
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
|
|
}
|
|
|
|
.project-info-header {
|
|
display: flex;
|
|
/* Use flexbox for layout */
|
|
justify-content: space-between;
|
|
/* Space between the header and button */
|
|
align-items: center;
|
|
/* Align items vertically centered */
|
|
margin-bottom: 15px;
|
|
/* Space below the header */
|
|
}
|
|
|
|
.btn.cmn-btn {
|
|
padding: 10px 20px;
|
|
/* Adjust padding for the button */
|
|
border: none;
|
|
/* Remove border */
|
|
border-radius: 25px;
|
|
/* Rounded button */
|
|
background-color: #007bff;
|
|
/* Button background color */
|
|
color: white;
|
|
/* Button text color */
|
|
font-size: 1em;
|
|
/* Font size */
|
|
cursor: pointer;
|
|
/* Pointer cursor on hover */
|
|
transition: background-color 0.3s;
|
|
/* Smooth transition for hover */
|
|
}
|
|
|
|
.btn.cmn-btn:hover {
|
|
background-color: #0056b3;
|
|
/* Darker color on hover */
|
|
}
|
|
|
|
.project-details {
|
|
list-style: none;
|
|
padding: 0;
|
|
margin: 0;
|
|
line-height: 1.6;
|
|
}
|
|
|
|
.project-details li {
|
|
padding: 5px 0;
|
|
border-bottom: 1px solid #e0e0e0;
|
|
}
|
|
|
|
.project-details li:last-child {
|
|
border-bottom: none;
|
|
/* Remove border for the last item */
|
|
}
|
|
|
|
h3 {
|
|
margin: 0;
|
|
/* Remove margin for the header */
|
|
color: #333;
|
|
/* Darker text color */
|
|
}
|
|
|
|
.user-profile-card {
|
|
display: flex;
|
|
align-items: center;
|
|
padding: 10px;
|
|
border: 1px solid #ddd;
|
|
/* Light border */
|
|
border-radius: 8px;
|
|
/* Rounded corners */
|
|
background-color: #fff;
|
|
/* White background */
|
|
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
|
|
/* Subtle shadow */
|
|
transition: transform 0.2s;
|
|
/* Animation on hover */
|
|
}
|
|
|
|
.user-profile-card:hover {
|
|
transform: scale(1.02);
|
|
/* Slightly enlarge on hover */
|
|
}
|
|
|
|
.user-profile-image {
|
|
flex-shrink: 0;
|
|
/* Prevent shrinking */
|
|
margin-right: 10px;
|
|
/* Space between image and text */
|
|
}
|
|
|
|
.profile-pic {
|
|
width: 50px;
|
|
/* Fixed size */
|
|
height: 50px;
|
|
/* Fixed size */
|
|
border-radius: 50%;
|
|
/* Circular image */
|
|
object-fit: cover;
|
|
/* Cover to maintain aspect ratio */
|
|
border: 2px solid #007bff;
|
|
/* Border color */
|
|
}
|
|
|
|
.user-profile-info {
|
|
flex-grow: 1;
|
|
/* Allow info section to take up remaining space */
|
|
}
|
|
|
|
.user-profile-info p {
|
|
margin: 0;
|
|
/* Remove default margin */
|
|
font-size: 14px;
|
|
/* Adjust font size */
|
|
}
|
|
</style>
|
|
|
|
<!-- Page Title -->
|
|
<div class="page-title-area">
|
|
<div class="d-table">
|
|
<div class="d-table-cell">
|
|
<div class="container">
|
|
<div class="title-item">
|
|
<h2>{{ $project->judul_project }}</h2>
|
|
<ul>
|
|
<li>
|
|
<a>{{ $project->kategori }}</a>
|
|
</li>
|
|
<li>
|
|
<i class='bx bx-chevrons-right'></i>
|
|
</li>
|
|
<li>
|
|
<span>{{ $project->bidang_sub_sektor_ekonomi_kreatif }}</span>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<!-- End Page Title -->
|
|
|
|
<!-- Project Details -->
|
|
<div class="project-details-area ptb-100">
|
|
<div class="container">
|
|
<div class="row">
|
|
<div class="col-lg-8">
|
|
<div class="details-item">
|
|
<div class="details-img">
|
|
<img src="{{ asset('storage/' . $project->foto_proyek) }}" alt="Project Details"
|
|
class="project-image">
|
|
|
|
<div class="project-description">
|
|
<h3>Latar Belakang</h3>
|
|
<p>{{ $project->latar_belakang }}</p>
|
|
|
|
<h3>Deskripsi</h3>
|
|
<p class="one-p">{{ $project->deskripsi_kolaborasi }}</p>
|
|
|
|
<h3>Solusi Proyek</h3>
|
|
<p class="one-p">{!! $project->solusi_project !!}</p>
|
|
|
|
<h3>Penerima Manfaat</h3>
|
|
<p class="one-p">{!! $project->penerima_manfaat_pengguna_project !!}</p>
|
|
|
|
<h3>Rincian Kebutuhan</h3>
|
|
<p class="one-p">{!! $project->rincian_kebutuhan !!}</p>
|
|
|
|
<h3>Parameter Kesuksesan</h3>
|
|
<p class="one-p">{!! $project->parameter_kesuksesan !!}</p>
|
|
|
|
<h3>Rencana Implementasi</h3>
|
|
<p class="one-p">{!! $project->proyekInvestor->rencana_implementasi !!}</p>
|
|
|
|
|
|
<h3>Benefit Pendanaan</h3>
|
|
<p class="one-p">{!! $project->proyekInvestor->benefit_project !!}</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-lg-4">
|
|
<div class="widget-area">
|
|
<div class="information widget-item">
|
|
<div class="project-info-header">
|
|
<h3>Project Information</h3>
|
|
<button class="btn cmn-btn" type="submit">
|
|
{{ $project->proyekInvestor->status_proyekInvestor }}
|
|
</button>
|
|
</div>
|
|
<ul>
|
|
<li>
|
|
<span>Batas Terima Tawaran:</span>
|
|
{{ $project->batas_terima_tawaran }}
|
|
</li>
|
|
<li>
|
|
<span>Tanggal Mulai:</span>
|
|
{{ $project->tanggal_mulai }}
|
|
</li>
|
|
<li>
|
|
<span>Tanggal Berakhir:</span>
|
|
{{ $project->tanggal_berakhir }}
|
|
</li>
|
|
<!-- New Fields -->
|
|
<li>
|
|
@if ($project->dokumen_pendukung)
|
|
<div class="mb-3">
|
|
<h5>Dokumen Pendukung</h5>
|
|
<a href="{{ Storage::url($project->dokumen_pendukung) }}"
|
|
download="{{ basename($project->dokumen_pendukung) }}"
|
|
class="btn btn-primary">Download</a>
|
|
</div>
|
|
@endif
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
|
|
<!-- User Profile Section -->
|
|
|
|
<div class="widget-area">
|
|
<!-- User Profile Section -->
|
|
<div class="user-profile widget-item" style="cursor: pointer;">
|
|
<a href="{{ route('profile.detail', ['id' => $project->user->id]) }}"
|
|
style="text-decoration: none; color: inherit;">
|
|
<div class="user-profile-card">
|
|
<div class="user-profile-image">
|
|
@php
|
|
// Get the user detail foto based on the user's role
|
|
$userFoto = null;
|
|
switch ($project->user->role) {
|
|
case 'pemerintah':
|
|
$userFoto =
|
|
$project->user->pemerintahDetails->foto ?? 'default.jpg'; // Use a default image if not found
|
|
break;
|
|
case 'umkm':
|
|
$userFoto = $project->user->umkmDetails->foto ?? 'default.jpg'; // Use a default image if not found
|
|
break;
|
|
case 'investor':
|
|
$userFoto =
|
|
$project->user->investorDetails->foto ?? 'default.jpg'; // Use a default image if not found
|
|
break;
|
|
case 'akademisi':
|
|
$userFoto =
|
|
$project->user->akademisiDetails->foto ?? 'default.jpg'; // Use a default image if not found
|
|
break;
|
|
case 'komunitas':
|
|
$userFoto =
|
|
$project->user->komunitasDetails->foto ?? 'default.jpg'; // Use a default image if not found
|
|
break;
|
|
default:
|
|
$userFoto = 'default.jpg'; // Fallback default image
|
|
break;
|
|
}
|
|
@endphp
|
|
<img src="{{ asset('storage/' . $userFoto) }}" alt="User Profile Picture"
|
|
class="profile-pic">
|
|
</div>
|
|
<div class="user-profile-info">
|
|
<p><strong>Name:</strong> {{ $project->user->full_name }}</p>
|
|
<p><strong>Role:</strong> {{ $project->user->role }}</p>
|
|
<p><strong>Institution:</strong>
|
|
@if ($project->user->role == 'pemerintah')
|
|
{{ $project->user->pemerintahDetails->institution_name ?? 'N/A' }}
|
|
@elseif($project->user->role == 'umkm')
|
|
{{ $project->user->umkmDetails->umkm_name ?? 'N/A' }}
|
|
@elseif($project->user->role == 'investor')
|
|
{{ $project->user->investorDetails->company_name ?? 'N/A' }}
|
|
@elseif($project->user->role == 'akademisi')
|
|
{{ $project->user->akademisiDetails->institution_name ?? 'N/A' }}
|
|
@elseif($project->user->role == 'komunitas')
|
|
{{ $project->user->komunitasDetails->community_name ?? 'N/A' }}
|
|
@else
|
|
N/A
|
|
@endif
|
|
</p>
|
|
</div>
|
|
</div>
|
|
</a>
|
|
</div>
|
|
|
|
</div>
|
|
<br><br>
|
|
|
|
<div class="newsletter widget-item">
|
|
@php
|
|
// Ambil status follow untuk pengguna yang sedang login dan proyek yang bersangkutan
|
|
$follow = App\Models\Follow::where('user_id', auth()->id())
|
|
->where('project_id', $project->id)
|
|
->first();
|
|
@endphp
|
|
|
|
<form id="followForm" method="POST" action="{{ route('follow.store') }}">
|
|
@csrf
|
|
<input type="hidden" name="user_id" value="{{ auth()->id() }}"> <!-- ID pengguna yang sedang login -->
|
|
<input type="hidden" name="followed_user_id" value="{{ $project->user->id }}"> <!-- ID pemilik proyek -->
|
|
<input type="hidden" name="project_id" value="{{ $project->id }}"> <!-- ID proyek yang diikuti -->
|
|
|
|
@if ($follow)
|
|
@if ($follow->status === 'pending')
|
|
<button type="button" class="btn cmn-btn" disabled>Meminta</button>
|
|
@elseif ($follow->status === 'accepted')
|
|
<button type="button" class="btn cmn-btn" disabled>Diikuti</button>
|
|
@elseif ($follow->status === 'declined')
|
|
<button type="button" class="btn cmn-btn" disabled>Ditolak</button>
|
|
@endif
|
|
@else
|
|
<button type="submit" class="btn cmn-btn">Follow</button>
|
|
@endif
|
|
</form>
|
|
</div>
|
|
<div class="call widget-item">
|
|
<h3>Kontak</h3>
|
|
<a>{{ $project->kontak }}</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<!-- End Project Details -->
|
|
@endsection
|