-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #30 from HE-Arc/29-timeline-deletion
Added deletion and removed redundant function in formfunction.js
- Loading branch information
Showing
5 changed files
with
39 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 18 additions & 5 deletions
23
timeliner/resources/views/timeline/partials/timeline.blade.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,30 @@ | ||
@php | ||
use App\Models\Ownership; | ||
@endphp | ||
<div class="timeline-for-list-template"> | ||
<div class="row"> | ||
<div class="col"> | ||
<div class="row align-items-stretch d-flex"> | ||
<div class="col-11 p-0"> | ||
<div class="card mb-4"> | ||
<div class="card-body"> | ||
@if(! $timeline->private) <!-- if public, show title with a globe icon --> | ||
<h5 class="card-title bi bi-globe"> {{ $timeline->name}}</h5> | ||
<h5 class="card-title bi bi-globe"> {{ $timeline->name }}</h5> | ||
@else | ||
<h5 class="card-title bi bi-lock-fill"> {{ $timeline->name }}</h5> | ||
@endif | ||
<p class="card-text">{{$timeline->description}}</p> | ||
<a href="timeline/{{ $timeline->id }}" class="btn btn-primary stretched-link bi bi-eye"> View</a> | ||
<p class="card-text">{{ $timeline->description }}</p> | ||
<a href="{{ route("timeline.show", $timeline->id) }}" class="btn btn-primary stretched-link bi bi-eye"> View</a> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
@auth | ||
@if (Ownership::find($timeline->id . Auth::user()->id)) | ||
<form class="d-flex align-items-stretch mb-4" action="{{ route('timeline.destroy', $timeline->id) }}" method="POST" onsubmit="return confirm('Are you sure you want to delete this timeline?');"> | ||
@csrf | ||
@method('DELETE') | ||
<button type="submit" class="btn btn-danger bi bi-trash d-flex align-items-center justify-content-center"></button> | ||
</form> | ||
@endif | ||
@endauth | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters