Browse Source

Move agency profile menu to dashboard tab

pull/1/head
Nafies Luthfi 8 years ago
parent
commit
766a26c0cb
  1. 1
      resources/views/layouts/partials/sidebar.blade.php
  2. 5
      resources/views/pages/partials/dashboard-nav-tabs.blade.php
  3. 7
      resources/views/users/agency/show.blade.php
  4. 9
      tests/Feature/Users/UserProfileTest.php

1
resources/views/layouts/partials/sidebar.blade.php

@ -16,7 +16,6 @@
<ul class="nav" id="side-menu">
<li>{!! html_link_to_route('home', trans('nav_menu.dashboard'), [], ['icon' => 'dashboard']) !!}</li>
@can('manage', auth()->user()->agency)
<li>{!! html_link_to_route('users.agency.show', trans('nav_menu.agency'), [], ['icon' => 'user']) !!}</li>
<li>{!! html_link_to_route('features.index', trans('feature.on_progress'), [], ['icon' => 'tasks']) !!}</li>
<li>
{!! html_link_to_route('projects.index', trans('project.projects') . ' <span class="fa arrow"></span>', [], ['icon' => 'table']) !!}

5
resources/views/pages/partials/dashboard-nav-tabs.blade.php

@ -6,5 +6,10 @@
<li class="{{ Request::segment(1) == 'profile' ? 'active' : '' }}">
{!! link_to_route('users.profile.show', trans('auth.profile')) !!}
</li>
@can('manage', auth()->user()->agency)
<li class="{{ Request::segment(1) == 'agency' ? 'active' : '' }}">
{!! link_to_route('users.agency.show', trans('auth.agency')) !!}
</li>
@endcan
</ul>
<br>

7
resources/views/users/agency/show.blade.php

@ -1,11 +1,8 @@
@extends('layouts.app')
@extends('layouts.dashboard')
@section('title', trans('agency.agency'))
@section('content')
<ul class="breadcrumb hidden-print">
<li class="active">{{ trans('agency.agency') }}</li>
</ul>
@section('content-dashboard')
<div class="row">
<div class="col-md-8 col-md-offset-2">
<div class="panel panel-default">

9
tests/Feature/Users/UserProfileTest.php

@ -2,7 +2,6 @@
namespace Tests\Feature\Users;
use App\Entities\Agencies\Agency;
use Tests\TestCase;
class UserProfileTest extends TestCase
@ -47,8 +46,7 @@ class UserProfileTest extends TestCase
/** @test */
public function a_user_can_visit_their_agency_page()
{
$user = $this->userSigningIn();
$agency = factory(Agency::class)->create(['owner_id' => $user]);
$user = $this->adminUserSigningIn();
$this->visit(route('users.agency.show'));
$this->seePageIs(route('users.agency.show'));
}
@ -56,8 +54,7 @@ class UserProfileTest extends TestCase
/** @test */
public function a_user_can_update_their_agency_data()
{
$user = $this->userSigningIn();
$agency = factory(Agency::class)->create(['owner_id' => $user]);
$user = $this->adminUserSigningIn();
$this->visit(route('users.agency.edit'));
$this->submitForm(trans('agency.update'), [
@ -72,7 +69,7 @@ class UserProfileTest extends TestCase
$this->seePageIs(route('users.agency.show'));
$this->seeInDatabase('agencies', [
'id' => $agency->id,
'id' => $user->agency->id,
'name' => 'Nama Agensi Saya',
'email' => 'nama_agensi@domain.com',
'address' => 'Jln. Kalimantan, No. 20, Kota',

Loading…
Cancel
Save