Browse Source

Add issue pic and creator information

pull/37/head
Nafies Luthfi 7 years ago
parent
commit
9e2e840f64
  1. 2
      app/Http/Controllers/Projects/IssueController.php
  2. 8
      resources/views/projects/issues.blade.php
  3. 2
      resources/views/projects/issues/show.blade.php

2
app/Http/Controllers/Projects/IssueController.php

@ -12,7 +12,7 @@ class IssueController extends Controller
{
public function index(Project $project)
{
$issues = $project->issues;
$issues = $project->issues()->with(['pic', 'creator'])->get();
return view('projects.issues', compact('project', 'issues'));
}

8
resources/views/projects/issues.blade.php

@ -11,6 +11,8 @@
<thead>
<th>{{ __('app.table_no') }}</th>
<th>{{ __('issue.title') }}</th>
<th>{{ __('issue.pic') }}</th>
<th>{{ __('issue.creator') }}</th>
<th class="text-center">{{ __('app.action') }}</th>
</thead>
<tbody>
@ -21,17 +23,19 @@
<tr id="{{ $issue->id }}">
<td>{{ $no }}</td>
<td>{{ $issue->title }}</td>
<td>{{ $issue->pic->name }}</td>
<td>{{ $issue->creator->name }}</td>
<td class="text-center">
{{ link_to_route(
'projects.issues.show',
__('app.show'),
[$project, $issue],
['class' => 'small', 'title' => __('issue.show')]
['title' => __('issue.show')]
) }}
</td>
</tr>
@empty
<tr><td colspan="3">{{ __('issue.empty') }}</td></tr>
<tr><td colspan="5">{{ __('issue.empty') }}</td></tr>
@endforelse
</tbody>
</table>

2
resources/views/projects/issues/show.blade.php

@ -12,6 +12,8 @@
<tbody>
<tr><th class="col-md-4">{{ __('issue.title') }}</th><td class="col-md-8">{{ $issue->title }}</td></tr>
<tr><th>{{ __('issue.body') }}</th><td>{{ $issue->body }}</td></tr>
<tr><th>{{ __('issue.pic') }}</th><td>{{ $issue->pic->name }}</td></tr>
<tr><th>{{ __('app.created_by') }}</th><td>{{ $issue->creator->name }}</td></tr>
</tbody>
</table>
<div class="panel-footer">

Loading…
Cancel
Save