Browse Source

Add page breadcrumb on user profile page

pull/6/head
Nafies Luthfi 8 years ago
parent
commit
165c64d706
  1. 2
      app/Entities/Users/User.php
  2. 1
      resources/views/layouts/user.blade.php
  3. 2
      resources/views/users/index.blade.php
  4. 5
      resources/views/users/partials/breadcrumb.blade.php
  5. 2
      tests/Feature/ManageJobsTest.php

2
app/Entities/Users/User.php

@ -20,7 +20,7 @@ class User extends Authenticatable
public function nameLink() public function nameLink()
{ {
return link_to_route('users.show', $this->name, [$this->id], ['target' => '_blank']);
return link_to_route('users.show', $this->name, [$this]);
} }
/** /**

1
resources/views/layouts/user.blade.php

@ -5,6 +5,7 @@
@endsection @endsection
@section('content') @section('content')
@include('users.partials.breadcrumb')
<h1 class="page-header"> <h1 class="page-header">
<div class="pull-right"> <div class="pull-right">
{!! link_to_route('users.edit', trans('user.edit'), [$user], ['id' => 'edit-user-' . $user->id, 'class' => 'btn btn-warning']) !!} {!! link_to_route('users.edit', trans('user.edit'), [$user], ['id' => 'edit-user-' . $user->id, 'class' => 'btn btn-warning']) !!}

2
resources/views/users/index.blade.php

@ -25,7 +25,7 @@
@forelse($users as $key => $user) @forelse($users as $key => $user)
<tr> <tr>
<td>{{ 1 + $key }}</td> <td>{{ 1 + $key }}</td>
<td>{{ $user->name }}</td>
<td>{{ $user->nameLink() }}</td>
<td>{{ $user->email }}</td> <td>{{ $user->email }}</td>
<td>{!! $user->roleList() !!}</td> <td>{!! $user->roleList() !!}</td>
<td> <td>

5
resources/views/users/partials/breadcrumb.blade.php

@ -0,0 +1,5 @@
<ul class="breadcrumb hidden-print">
<li>{{ link_to_route('users.index',trans('user.list'), ['status' => request('status', $user->status_id)]) }}</li>
<li>{{ $user->nameLink() }}</li>
<li class="active">@yield('subtitle', trans('user.profile'))</li>
</ul>

2
tests/Feature/ManageJobsTest.php

@ -130,7 +130,7 @@ class ManageJobsTest extends TestCase
$this->visit(route('projects.jobs.index', $project->id)); $this->visit(route('projects.jobs.index', $project->id));
$this->click('show-job-'.$job->id); $this->click('show-job-'.$job->id);
$this->seePageIs(route('jobs.show', $project->id)); $this->seePageIs(route('jobs.show', $project->id));
$this->see(trans('job.show'));
$this->see(trans('job.detail'));
$this->see($job->name); $this->see($job->name);
$this->see(formatRp($job->price)); $this->see(formatRp($job->price));
$this->see($job->worker->name); $this->see($job->worker->name);

Loading…
Cancel
Save