Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
gammamatrix committed Dec 28, 2024
1 parent 5bbbb7b commit 065a1cb
Show file tree
Hide file tree
Showing 13 changed files with 603 additions and 61 deletions.
170 changes: 170 additions & 0 deletions resources/views/io/list-tickets.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,170 @@
@php
if (!isset($withParent)) {
$withParent = true;
}
if (!isset($withProject)) {
$withProject = true;
}
@endphp
<div class="card">

<div class="card-header">
@if (!empty($modelColumn) && !empty($modelLabel))
<a class="btn btn-info float-end"
href="{{ route('playground.matrix.resource.tickets.create', [$modelColumn => $data->id, '_return_url' => $routeShow]) }}"
alt=" {{ __('Create a new ticket for the :model_label', ['model_label' => $modelLabel]) }}">
{{ __('Create') }}
</a>
@endif
<h2>{{ __($headerLabel ?? 'Tickets') }}</h2>
</div>

@if (!empty($tickets))
<div class="card-body">
<div class="table-responsive">
<table class="table">
<thead>
<tr>
<th>
Ticket
</th>
<th>
Title
</th>
<th>
Type
</th>
@if($withParent)
<th>
Parent
</th>
@endif
@if($withProject)
<th>
Project
</th>
@endif
<th>
Epic
</th>
<th>
Label
</th>
<th>
State
</th>
<th>
Created
</th>
<th>
Updated
</th>
<th>
Owner
</th>
<th>
Reporter
</th>
<th>
Team
</th>
<th>
Sprint
</th>
</tr>
</thead>
<tbody>
@foreach ($tickets as $ticket)
<tr>
<td>
@if ($ticket->key)
{{ $ticket->key }}
@else
<a class="btn btn-info" href="{{route('playground.matrix.resource.tickets.edit', ['ticket' => $ticket->id])}}">
Edit
</a>
@endif
</td>
<td>
{{ $ticket->title }}
</td>
<td>
@if ($ticket->ticket_type)
<a href="{{route('playground.matrix.resource.tickets', ['filter' => ['ticket_type' => $ticket->ticket_type]])}}">
{{ $ticket->ticket_type }}
</a>
@endif
</td>
@if($withParent)
<td>
@if ($ticket->parent_id)
<a href="{{route('playground.matrix.resource.tickets.show', ['ticket' => $ticket->parent_id])}}">
{{ $ticket->parent()->first()->label_or_title }}
</a>
@endif
</td>
@endif
@if($withProject)
<td>
@if ($ticket->project_id)
<a href="{{route('playground.matrix.resource.projects.show', ['project' => $ticket->project_id])}}">
{{ $ticket->project()->first()->label_or_title }}
</a>
@endif
</td>
@endif
<td>
@if ($ticket->epic_id)
<a href="{{route('playground.matrix.resource.epics.show', ['epic' => $ticket->epic_id])}}">
{{ $ticket->epic()->first()->label_or_title }}
</a>
@endif
</td>
<td>
{{ $ticket->label }}
</td>
<td>
{{ $ticket->state }}
</td>
<td>
<time
datetime="{{ $ticket->created_at?->toW3cString() }}">{{ $ticket->created_at?->toDayDateTimeString() }}</time>
</td>
<td>
<time
datetime="{{ $ticket->updated_at?->toW3cString() }}">{{ $ticket->updated_at?->toDayDateTimeString() }}</time>
</td>
<td>
@if ($ticket->owned_by_id)
{{ $ticket->owner()->first()->name }}
@endif
</td>
<td>
@if ($ticket->reported_by_id)
{{ $ticket->reportedBy()->first()->name }}
@endif
</td>
<td>
@if ($ticket->team_id)
<a href="{{route('playground.matrix.resource.teams.show', ['team' => $ticket->team_id])}}">
{{ $ticket->team()->first()->title }}
</a>
@endif
</td>
<td>
@if ($ticket->sprint_id)
<a href="{{route('playground.matrix.resource.sprints.show', ['sprint' => $ticket->sprint_id])}}">
{{ $ticket->sprint()->first()->title }}
</a>
@endif
</td>
</tr>
@endforeach
</tbody>
</table>
</div>

</div>
@endif

</div>
2 changes: 1 addition & 1 deletion resources/views/io/manage-version.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
{{ __('Create') }}
</a>
@endif
<h2>{{ __('Create') }}Version</h2>
<h2>{{ __('Version') }}</h2>
</div>

@if($data->version_id)
Expand Down
29 changes: 21 additions & 8 deletions resources/views/project/detail.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
$routeShow = !$data ? '' : route(sprintf('%1$s.show', $meta['info']['model_route']), [$meta['info']['model_slug'] => $data->getAttributeValue('id')]);
$modelLabel = $meta['info']['model_label'];
$modelColumn = 'project_id';
$modulelLabel = $meta['info']['module_label'];
$flags = [
'active' => ['column' => 'active', 'label' => 'Active', 'icon' => 'fa-solid fa-person-running', 'badge' => 'text-bg-success'],
Expand Down Expand Up @@ -32,23 +33,31 @@
?>
@extends('playground::layouts.resource.detail', [
'withInfo' => false,
'withAccordion' => true,
'withCard' => false,
])

@section('detail-information-flags')
@include('playground::layouts.resource.detail-flags')
@endsection

@section('detail-card-body-header')
<div class="row">
@section('detail-accordion-body-header')
<div class="row mb-3">
<div class="col-sm-6 col-md-4 mb-3">
@include('playground-matrix-resource::io/manage-sprint')
</div>
<div class="col-sm-6 col-md-4 mb-3">
@include('playground-matrix-resource::io/manage-epic')
</div>
<div class="col-sm-6 col-md-4 mb-3">
@include('playground-matrix-resource::io/manage-ticket')
</div>
<div class="col-sm-6 col-md-4 mb-3">
@include('playground-matrix-resource::io/manage-version')
</div>
<div class="col-sm-6 col-md-4 mb-3">
@include('playground-matrix-resource::io/manage-milestone')
</div>
<div class="col-sm-6 col-md-4 mb-3">
@include('playground-matrix-resource::io/manage-board')
</div>
Expand All @@ -67,18 +76,12 @@
<div class="col-sm-6 col-md-4 mb-3">
@include('playground-matrix-resource::io/manage-release')
</div>
<div class="col-sm-6 col-md-4 mb-3">
@include('playground-matrix-resource::io/manage-roadmap')
</div>
<div class="col-sm-6 col-md-4 mb-3">
@include('playground-matrix-resource::io/manage-tag')
</div>
<div class="col-sm-6 col-md-4 mb-3">
@include('playground-matrix-resource::io/manage-team')
</div>
<div class="col-sm-6 col-md-4 mb-3">
@include('playground-matrix-resource::io/manage-version')
</div>
<div class="col-sm-6 col-md-4 mb-3">
@include('playground-matrix-resource::io/manage-source')
</div>
Expand All @@ -87,3 +90,13 @@
</div>
</div>
@endsection

@section('section-primary')
<div class="my-3">
@include('playground-matrix-resource::io/list-tickets', [
'headerLabel' => 'Project Tickets',
'tickets' => Playground\Matrix\Models\Ticket::where('project_id', $data->id)->get(),
'withProject' => false,
])
</div>
@endsection
Loading

0 comments on commit 065a1cb

Please sign in to comment.