Skip to content

Commit

Permalink
added nav bar with pils nect i list the company and creating an in sc…
Browse files Browse the repository at this point in the history
…roller- will add search in the future
  • Loading branch information
jovialcore committed Oct 11, 2023
1 parent 33cce27 commit 96b0235
Show file tree
Hide file tree
Showing 7 changed files with 199 additions and 51 deletions.
5 changes: 4 additions & 1 deletion app/Http/Controllers/CompanyController.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ public function show(int $id): View
{

$company = $this->companyService->showCompany($id);
return view('admin.company.show', $company);



return view('admin.company.show', ['company' => $company ]);
}
}
4 changes: 3 additions & 1 deletion app/Services/CompanyService.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace App\Services;

use App\Models\Company;
use App\Traits\companyPreviewTrait;
use Illuminate\Contracts\View\View;
use Illuminate\Support\Facades\DB;
use Illuminate\Http\Request;
Expand All @@ -13,6 +14,7 @@
class CompanyService
{

use companyPreviewTrait;
public function getAllCompanies(): array
{
$companies = Company::all();
Expand Down Expand Up @@ -50,7 +52,7 @@ public function storeCompanyData(Request $request, Company $company): Company

public function showCompany(int $id): Company
{
$company = Company::find($id);
$company = $this->companyWithTechData()->find($id);
return $company;
}
}
15 changes: 15 additions & 0 deletions app/Traits/companyPreviewTrait.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace App\Traits;

use App\Models\Company;
Expand Down Expand Up @@ -29,4 +31,17 @@ public function oldSourcedData($company)
});
}])->where('name', $company)->first();
}

public function companyWithTechData()
{

return Company::with(['plangs' => function ($query) {
$query->where('is_draft', 1)->where('is_published', 0)->with('frameworks', function ($query) {
$query->withWhereHas('companies', function ($query) {
// I don't now why I can't access the pivot of frameworks directly on frameworks collection exceptI use withWhereHas on Companies -- should look into it some time in future but for now, lets make do with how it is working now
$query->where('is_draft', 1)->where('is_published', 0);
});
});
}]);
}
}
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="{{route('admin.company.show', 1)}}"><i
<a class="dropdown-item" href="{{route('admin.company.show', $company->id)}}"><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
175 changes: 175 additions & 0 deletions resources/views/admin/company/show.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,175 @@
@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">
<div class="">
<img src="{{ $company->logo }}" alt="user-avatar" class="d-block rounded" height="100" width="100"
id="uploadedAvatar" />
</div>
<div class="button-wrapper">
<p class="text-dark mb-0">{{ $company->about }}</p>
</div>
</div>
</div>

<hr class="my-0" />
</div>

<div class="col-xl-12 mt-3">
<div class="nav-align-top mb-4">
<ul class="nav nav-tabs" role="tablist">
<li class="nav-item">
<button type="button" class="nav-link active" role="tab" data-bs-toggle="tab"
data-bs-target="#navs-top-backend" aria-controls="navs-top-home" aria-selected="true">
Backend
</button>
</li>
<li class="nav-item">
<button type="button" class="nav-link" role="tab" data-bs-toggle="tab"
data-bs-target="#navs-top-profile" aria-controls="navs-top-profile" aria-selected="false">
Frontend
</button>
</li>
<li class="nav-item">
<button type="button" class="nav-link" role="tab" data-bs-toggle="tab"
data-bs-target="#navs-top-messages" aria-controls="navs-top-messages" aria-selected="false">
Devops
</button>
</li>
</ul>
<div class="tab-content">
<div class="tab-pane fade show active" id="navs-top-backend" role="tabpanel">
<div class="card">
<h5 class="card-header">Connected Accounts</h5>
<div class="card-body">
<p>Display content from your connected accounts on your site</p>
<!-- Connections -->
<div class="d-flex mb-3">
<div class="flex-shrink-0">
<img src="../assets/img/icons/brands/google.png" alt="google" class="me-3"
height="30" />
</div>
<div class="flex-grow-1 row">
<div class="col-9 mb-sm-0 mb-2">
<h6 class="mb-0">Google</h6>
<small class="text-muted">Calendar and contacts</small>
</div>
<div class="col-3 text-end">
<div class="form-check form-switch">
<input class="form-check-input float-end" type="checkbox" role="switch" />
</div>
</div>
</div>
</div>
<div class="d-flex mb-3">
<div class="flex-shrink-0">
<img src="../assets/img/icons/brands/slack.png" alt="slack" class="me-3"
height="30" />
</div>
<div class="flex-grow-1 row">
<div class="col-9 mb-sm-0 mb-2">
<h6 class="mb-0">Slack</h6>
<small class="text-muted">Communication</small>
</div>
<div class="col-3 text-end">
<div class="form-check form-switch">
<input class="form-check-input float-end" type="checkbox" role="switch"
checked />
</div>
</div>
</div>
</div>
<div class="d-flex mb-3">
<div class="flex-shrink-0">
<img src="../assets/img/icons/brands/github.png" alt="github" class="me-3"
height="30" />
</div>
<div class="flex-grow-1 row">
<div class="col-9 mb-sm-0 mb-2">
<h6 class="mb-0">Github</h6>
<small class="text-muted">Manage your Git repositories</small>
</div>
<div class="col-3 text-end">
<div class="form-check form-switch">
<input class="form-check-input float-end" type="checkbox" role="switch" />
</div>
</div>
</div>
</div>
<div class="d-flex mb-3">
<div class="flex-shrink-0">
<img src="../assets/img/icons/brands/mailchimp.png" alt="mailchimp" class="me-3"
height="30" />
</div>
<div class="flex-grow-1 row">
<div class="col-9 mb-sm-0 mb-2">
<h6 class="mb-0">Mailchimp</h6>
<small class="text-muted">Email marketing service</small>
</div>
<div class="col-3 text-end">
<div class="form-check form-switch">
<input class="form-check-input float-end" type="checkbox" role="switch"
checked />
</div>
</div>
</div>
</div>
<div class="d-flex">
<div class="flex-shrink-0">
<img src="../assets/img/icons/brands/asana.png" alt="asana" class="me-3"
height="30" />
</div>
<div class="flex-grow-1 row">
<div class="col-9 mb-sm-0 mb-2">
<h6 class="mb-0">Asana</h6>
<small class="text-muted">Communication</small>
</div>
<div class="col-3 text-end">
<div class="form-check form-switch">
<input class="form-check-input float-end" type="checkbox" role="switch"
checked />
</div>
</div>
</div>
</div>
<!-- /Connections -->
</div>
</div>
</div>
<div class="tab-pane fade" id="navs-top-profile" role="tabpanel">
<p>
Donut dragée jelly pie halvah. Danish gingerbread bonbon cookie wafer candy oat cake ice
cream. Gummies halvah tootsie roll muffin biscuit icing dessert gingerbread. Pastry ice
cream
cheesecake fruitcake.
</p>
<p class="mb-0">
Jelly-o jelly beans icing pastry cake cake lemon drops. Muffin muffin pie tiramisu
halvah
cotton candy liquorice caramels.
</p>
</div>
<div class="tab-pane fade" id="navs-top-messages" role="tabpanel">
<p>
Oat cake chupa chups dragée donut toffee. Sweet cotton candy jelly beans macaroon
gummies
cupcake gummi bears cake chocolate.
</p>
<p class="mb-0">
Cake chocolate bar cotton candy apple pie tootsie roll ice cream apple pie brownie cake.
Sweet
roll icing sesame snaps caramels danish toffee. Brownie biscuit dessert dessert. Pudding
jelly
jelly-o tart brownie jelly.
</p>
</div>
</div>
</div>
</div>

</div>
@endsection
47 changes: 0 additions & 47 deletions resources/views/admin/company/showCompany.blade.php

This file was deleted.

2 changes: 1 addition & 1 deletion routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

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::get('/companies/{id}/show', [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 96b0235

Please sign in to comment.