Browse Source
Update job detail layout
Update job detail layout
Add job view layout Add nav-tabs on job detail page Update job show view to extends job layout Add job comments view that extends job layoutpull/13/head
8 changed files with 132 additions and 61 deletions
-
24app/Http/Controllers/Jobs/CommentsController.php
-
54resources/views/jobs/comments.blade.php
-
2resources/views/jobs/partials/comment-section.blade.php
-
12resources/views/jobs/partials/nav-tabs.blade.php
-
60resources/views/jobs/show.blade.php
-
22resources/views/layouts/job.blade.php
-
1routes/web/projects.php
-
18tests/Feature/Projects/JobCommentsTest.php
@ -0,0 +1,54 @@ |
|||
@extends('layouts.job') |
|||
|
|||
@section('subtitle', __('comment.list')) |
|||
|
|||
@section('content-job') |
|||
<div class="row"> |
|||
<div class="col-md-8 col-md-offset-1"> |
|||
{{ $comments->links() }} |
|||
@include('jobs.partials.comment-section') |
|||
{{ $comments->links() }} |
|||
</div> |
|||
</div> |
|||
|
|||
@if (Request::get('action') == 'comment-edit' && $editableComment) |
|||
<div id="commentModal" class="modal" role="dialog"> |
|||
<div class="modal-dialog"> |
|||
<!-- Modal content--> |
|||
<div class="modal-content"> |
|||
<div class="modal-header"> |
|||
{{ link_to_route('jobs.comments.index', '×', [$job] + request(['page']), ['class' => 'close']) }} |
|||
<h4 class="modal-title">{{ __('comment.edit') }}</h4> |
|||
</div> |
|||
{!! Form::model($editableComment, ['route' => ['jobs.comments.update', $job, $editableComment->id],'method' => 'patch']) !!} |
|||
<div class="modal-body"> |
|||
{!! FormField::textarea('body', ['label' => __('comment.body')]) !!} |
|||
{{ Form::hidden('page', request('page')) }} |
|||
</div> |
|||
<div class="modal-footer"> |
|||
{!! Form::submit(__('comment.update'), ['class' => 'btn btn-success']) !!} |
|||
{{ link_to_route('jobs.comments.index', __('app.cancel'), [$job] + request(['page']), ['class' => 'btn btn-default']) }} |
|||
</div> |
|||
{!! Form::close() !!} |
|||
</div> |
|||
</div> |
|||
</div> |
|||
@endif |
|||
@endsection |
|||
|
|||
@section('ext_css') |
|||
<style> |
|||
ul.pagination { margin-top: 0px } |
|||
</style> |
|||
@endsection |
|||
|
|||
@section('script') |
|||
<script> |
|||
(function () { |
|||
$('#commentModal').modal({ |
|||
show: true, |
|||
backdrop: 'static', |
|||
}); |
|||
})(); |
|||
</script> |
|||
@endsection |
|||
@ -0,0 +1,12 @@ |
|||
<!-- Nav tabs --> |
|||
<ul class="nav nav-tabs"> |
|||
<li class="{{ Request::segment(3) == null ? 'active' : '' }}"> |
|||
{!! link_to_route('jobs.show', __('job.detail'), $job) !!} |
|||
</li> |
|||
@can('view-comments', $job) |
|||
<li class="{{ Request::segment(3) == 'comments' ? 'active' : '' }}"> |
|||
{!! link_to_route('jobs.comments.index', __('comment.list').' ('.$job->comments->count().')', $job) !!} |
|||
</li> |
|||
@endcan |
|||
</ul> |
|||
<br> |
|||
@ -0,0 +1,22 @@ |
|||
@extends('layouts.app') |
|||
|
|||
@section('title') |
|||
@yield('subtitle', __('job.detail')) - {{ $job->name }} |
|||
@endsection |
|||
|
|||
@section('content') |
|||
@include('jobs.partials.breadcrumb') |
|||
|
|||
<h1 class="page-header"> |
|||
<div class="pull-right"> |
|||
@yield('action-buttons') |
|||
{{ link_to_route('projects.jobs.index', __('job.back_to_index'), [$job->project_id, '#' . $job->id], ['class' => 'btn btn-default']) }} |
|||
</div> |
|||
{{ $job->name }} <small>@yield('subtitle', __('job.detail'))</small> |
|||
</h1> |
|||
|
|||
@include('jobs.partials.nav-tabs') |
|||
|
|||
@yield('content-job') |
|||
|
|||
@endsection |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue