Skip to content

Commit

Permalink
adding the show page for companies
Browse files Browse the repository at this point in the history
  • Loading branch information
jovialcore committed Oct 11, 2023
1 parent 2c95e6e commit 33cce27
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 3 deletions.
5 changes: 3 additions & 2 deletions app/Http/Controllers/CompanyController.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,10 @@ public function store(Request $request, Company $company): RedirectResponse
return to_route('admin.company.index');
}

public function show(int $id): RedirectResponse
public function show(int $id): View
{

$company = $this->companyService->showCompany($id);
return to_route('admin.company.show', $company);
return view('admin.company.show', $company);
}
}
2 changes: 1 addition & 1 deletion resources/views/admin/company/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class="avatar avatar-xs pull-up" title="Lilian Fuller">
<i class="bx bx-dots-vertical-rounded"></i>
</button>
<div class="dropdown-menu">
<a class="dropdown-item" href="javascript:void(0);"><i
<a class="dropdown-item" href="{{route('admin.company.show', 1)}}"><i
class="bx bx-edit-alt me-1"></i>View</a>
<a class="dropdown-item" href="javascript:void(0);"><i
class="bx bx-trash me-1"></i>
Expand Down
47 changes: 47 additions & 0 deletions resources/views/admin/company/showCompany.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
@extends('layouts.app')
@section('content')
<div class="col-md-11 mx-auto">
<div class="card">
<h5 class="card-header">{{$company->name}}</h5>

<div class="card-body">
<div class="d-flex align-items-start align-items-sm-center gap-4">
<img src="../assets/img/avatars/1.png" alt="user-avatar" class="d-block rounded" height="100"
width="100" id="uploadedAvatar" />
<div class="button-wrapper">
<label for="upload" class="btn btn-primary me-2 mb-4" tabindex="0">
<span class="d-none d-sm-block">Upload new photo</span>
<i class="bx bx-upload d-block d-sm-none"></i>
<input type="file" id="upload" class="account-file-input" hidden
accept="image/png, image/jpeg" />
</label>
<button type="button" class="btn btn-outline-secondary account-image-reset mb-4">
<i class="bx bx-reset d-block d-sm-none"></i>
<span class="d-none d-sm-block">Reset</span>
</button>

<p class="text-muted mb-0">Allowed JPG, GIF or PNG. Max size of 800K</p>
</div>
</div>
</div>
<hr class="my-0" />
<div class="card-body">
<div class="mb-3 col-12 mb-0">
<div class="alert alert-warning">
<h6 class="alert-heading fw-bold mb-1">Are you sure you want to delete your account?</h6>
<p class="mb-0">Once you delete your account, there is no going back. Please be certain.
</p>
</div>
</div>
<form id="formAccountDeactivation" onsubmit="return false">
<div class="form-check mb-3">
<input class="form-check-input" type="checkbox" name="accountActivation" id="accountActivation" />
<label class="form-check-label" for="accountActivation">I confirm my account
deactivation</label>
</div>
<button type="submit" class="btn btn-danger deactivate-account">Deactivate Account</button>
</form>
</div>
</div>
</div>
@endsection
2 changes: 2 additions & 0 deletions routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@

Route::post('/companies/store', [App\Http\Controllers\CompanyController::class, 'store'])->name('admin.company.store');

Route::get('/companies/show/{id}', [App\Http\Controllers\CompanyController::class, 'show'])->name('admin.company.show');

Route::post('/preview/confirm/results/{company}', [App\Http\Controllers\DataControlController::class, 'confirmResults'])->name('admin.preview.result.confirm');
});

Expand Down

0 comments on commit 33cce27

Please sign in to comment.