optical changes

shift-build-2464
Nadim Salloum 2021-05-27 00:40:31 +03:00
parent 62c9ce7525
commit 3691cb613a
8 changed files with 120 additions and 128 deletions

View File

@ -224,7 +224,7 @@ class CarController extends Controller
'name' => $car->name,
'initial_date' => $car->initial_date_formatted,
'colour' => $car->colour,
'last_check_date' => $car->last_check_date,
'last_check_date' => $car->last_check_date_formatted,
'kilometers' => $car->kilometers,
'known_damage' => $car->known_damage,
'notes' => $car->notes,
@ -322,6 +322,6 @@ class CarController extends Controller
public function restore(Car $car)
{
$car->restore();
return Redirect::back()->with('success', 'Auto wiederhergestellt.');
return Redirect::route('cars.show', $car)->with('success', 'Auto wiederhergestellt.');
}
}

View File

@ -42,6 +42,20 @@ class Car extends Model
return Carbon::parse($this->initial_date)->format('d.m.Y');
}
public function getLastCheckDateFormattedAttribute()
{
return Carbon::parse($this->last_check_date)->format('d.m.Y');
}
public function getDeletedAtAttribute($deleted_at)
{
if ($deleted_at) {
return Carbon::parse($deleted_at)->format('d.m.Y');
}
return null;
}
public function brand()
{
return $this->carModel->brand();
@ -91,11 +105,6 @@ class Car extends Model
// return $query->whereDate('sold_at', '>=', Carbon::today()->format('Y'));
// }
public function scopeOrderByInitialDate($query)
{
$query->orderBy('initial_date');
}
public function buyContracts()
{
return $this->hasMany(Contract::class)->buyContracts();

View File

@ -2,11 +2,12 @@
namespace App\Providers;
use Illuminate\Cache\RateLimiting\Limit;
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
use App\Models\Car;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\RateLimiter;
use Illuminate\Support\Facades\Route;
use Illuminate\Cache\RateLimiting\Limit;
use Illuminate\Support\Facades\RateLimiter;
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
class RouteServiceProvider extends ServiceProvider
{
@ -46,6 +47,13 @@ class RouteServiceProvider extends ServiceProvider
Route::middleware('web')
->namespace($this->namespace)
->group(base_path('routes/web.php'));
Route::bind('car', function ($value) {
if (in_array(Route::currentRouteName(), ['cars.show', 'cars.restore'])) {
return Car::withTrashed()->find($value);
}
return Car::find($value);
});
});
}

View File

@ -80,7 +80,7 @@ return [
|
*/
'locale' => 'de',
'locale' => 'de_CH',
/*
|--------------------------------------------------------------------------

156
public/js/app.js vendored
View File

@ -20323,7 +20323,7 @@ __webpack_require__.r(__webpack_exports__);
/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
var _hoisted_1 = {
"class": "py-6 grid grid-cols-12 gap-3 w-full"
"class": "py-3 grid grid-cols-12 gap-3 w-full"
};
var _hoisted_2 = {
key: 0,
@ -20393,7 +20393,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
/* PROPS */
, ["car"])])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)("div", _hoisted_4, [_hoisted_5, (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)("div", _hoisted_6, [$props.contract.date ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)("div", _hoisted_7, " Datum: " + (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($props.contract.date), 1
/* TEXT */
)) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), $props.contract.insurance_type ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)("div", _hoisted_8, " Versicherungstyp: " + (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($props.contract.insurance_type), 1
)) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), $props.contract.insurance_type ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)("div", _hoisted_8, " Versicherung: " + (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($props.contract.insurance_type), 1
/* TEXT */
)) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), $props.contract.price ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)("div", _hoisted_9, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($props.contract.price), 1
/* TEXT */
@ -20416,7 +20416,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
/* PROPS */
, ["href"])])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)("div", _hoisted_12, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)("div", _hoisted_13, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)("a", {
href: _ctx.route('contracts.print', $props.contract.id),
"class": "inline-flex items-center px-4 py-2 bg-gray-800 border border-transparent rounded-md font-semibold text-xs text-white uppercase tracking-widest hover:bg-gray-700 active:bg-gray-900 focus:outline-none focus:border-gray-900 focus:ring focus:ring-gray-300 disabled:opacity-25 transition"
"class": "justify-center inline-flex items-center px-4 py-2 bg-gray-800 border border-transparent rounded-md font-semibold text-xs text-white uppercase tracking-widest hover:bg-gray-700 active:bg-gray-900 focus:outline-none focus:border-gray-900 focus:ring focus:ring-gray-300 disabled:opacity-25 transition"
}, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_unicon, {
fill: "white",
"class": "mr-1",
@ -20714,22 +20714,6 @@ var _hoisted_14 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNo
var _hoisted_15 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)(" Verkäufer ");
var _hoisted_16 = {
"class": "mb-4 px-4"
};
var _hoisted_17 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)("p", {
"class": "text-sm font-semibold mb-1 text-gray-400 flex items-center"
}, " Verträge ", -1
/* HOISTED */
);
var _hoisted_18 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)(" Alle Verträge ");
var _hoisted_19 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)(" Ankaufverträge ");
var _hoisted_20 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)(" Verkaufverträge ");
function render(_ctx, _cache, $props, $setup, $data, $options) {
var _component_unicon = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("unicon");
@ -20889,57 +20873,6 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
_: 1
/* STABLE */
}, 8
/* PROPS */
, ["href", "active"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)("div", _hoisted_16, [_hoisted_17, (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_jet_nav_link, {
href: _ctx.route('contracts'),
active: _ctx.route().current('contracts')
}, {
"default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_unicon, {
"class": "mr-2",
height: "22",
width: "22",
name: "car-sideview"
}), _hoisted_18];
}),
_: 1
/* STABLE */
}, 8
/* PROPS */
, ["href", "active"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_jet_nav_link, {
href: _ctx.route('contracts.buy_contracts'),
active: _ctx.route().current('contracts.buy_contracts')
}, {
"default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_unicon, {
"class": "mr-2 ml-3",
height: "22",
width: "22",
name: "angle-right"
}), _hoisted_19];
}),
_: 1
/* STABLE */
}, 8
/* PROPS */
, ["href", "active"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_jet_nav_link, {
href: _ctx.route('contracts.sell_contracts'),
active: _ctx.route().current('contracts.sell_contracts')
}, {
"default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_unicon, {
"class": "mr-2 ml-3",
height: "22",
width: "22",
name: "angle-right"
}), _hoisted_20];
}),
_: 1
/* STABLE */
}, 8
/* PROPS */
, ["href", "active"])])], 2
@ -24854,7 +24787,7 @@ var _hoisted_3 = {
"class": "col-span-6 xs:col-span-12"
};
var _hoisted_4 = {
"class": "col-span-2 xs:col-span-12"
"class": "col-span-3 xs:col-span-12"
};
var _hoisted_5 = {
"class": "w-full flex flex-col"
@ -24867,7 +24800,7 @@ var _hoisted_7 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNod
var _hoisted_8 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)(" wiederherstellen ");
var _hoisted_9 = {
key: 2
key: 3
};
var _hoisted_10 = {
"class": "py-12 grid grid-cols-12 gap-12 w-full"
@ -24876,20 +24809,32 @@ var _hoisted_11 = {
"class": "w-full sm:px-6 lg:px-8 col-span-6 xs:col-span-12"
};
var _hoisted_12 = {
"class": "whitespace-nowrap mb-3"
"class": "whitespace-nowrap"
};
var _hoisted_13 = {
"class": "mb-1 font-bold text-3xl"
"class": "font-bold text-3xl"
};
var _hoisted_14 = {
key: 0
};
var _hoisted_15 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)(" Neuer Ankaufsvertrag ");
var _hoisted_16 = {
"class": "w-full sm:px-6 lg:px-8 col-span-6 xs:col-span-12"
};
var _hoisted_15 = {
"class": "whitespace-nowrap mb-3"
var _hoisted_17 = {
"class": "whitespace-nowrap"
};
var _hoisted_16 = {
"class": "mb-1 font-bold text-3xl"
var _hoisted_18 = {
"class": "font-bold text-3xl"
};
var _hoisted_19 = {
key: 0
};
var _hoisted_20 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)(" Neuer Verkaufssvertrag ");
function render(_ctx, _cache, $props, $setup, $data, $options) {
var _component_bread_crumb = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("bread-crumb");
@ -24921,9 +24866,10 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
car: $props.car
}, null, 8
/* PROPS */
, ["car"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)("div", _hoisted_4, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)("div", _hoisted_5, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_inertia_link, {
, ["car"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)("div", _hoisted_4, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)("div", _hoisted_5, [!$props.car.deleted_at ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_inertia_link, {
key: 0,
href: _ctx.route('cars.edit', $props.car.id),
"class": "mb-5 inline-flex items-center px-4 py-2 bg-gray-800 border border-transparent rounded-md font-semibold text-xs text-white uppercase tracking-widest hover:bg-gray-700 active:bg-gray-900 focus:outline-none focus:border-gray-900 focus:ring focus:ring-gray-300 disabled:opacity-25 transition"
"class": "justify-center mb-5 inline-flex items-center px-4 py-2 bg-gray-800 border border-transparent rounded-md font-semibold text-xs text-white uppercase tracking-widest hover:bg-gray-700 active:bg-gray-900 focus:outline-none focus:border-gray-900 focus:ring focus:ring-gray-300 disabled:opacity-25 transition"
}, {
"default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_unicon, {
@ -24939,10 +24885,10 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
}, 8
/* PROPS */
, ["href"]), !$props.car.deleted_at ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_inertia_link, {
key: 0,
, ["href"])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), !$props.car.deleted_at ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_inertia_link, {
key: 1,
href: _ctx.route('cars.destroy', $props.car.id),
"class": "mb-5 inline-flex items-center px-4 py-2 bg-red-800 border border-transparent rounded-md font-semibold text-xs text-white uppercase tracking-widest hover:bg-red-700 active:bg-red-900 focus:outline-none focus:border-red-900 focus:ring focus:ring-red-300 disabled:opacity-25 transition"
"class": "justify-center mb-5 inline-flex items-center px-4 py-2 bg-red-800 border border-transparent rounded-md font-semibold text-xs text-white uppercase tracking-widest hover:bg-red-700 active:bg-red-900 focus:outline-none focus:border-red-900 focus:ring focus:ring-red-300 disabled:opacity-25 transition"
}, {
"default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_unicon, {
@ -24959,9 +24905,9 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
}, 8
/* PROPS */
, ["href"])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), $props.car.deleted_at ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_inertia_link, {
key: 1,
key: 2,
href: _ctx.route('cars.restore', $props.car.id),
"class": "mb-5 inline-flex items-center px-4 py-2 bg-red-800 border border-transparent rounded-md font-semibold text-xs text-white uppercase tracking-widest hover:bg-red-700 active:bg-red-900 focus:outline-none focus:border-red-900 focus:ring focus:ring-red-300 disabled:opacity-25 transition"
"class": "justify-center mb-5 inline-flex items-center px-4 py-2 bg-green-800 border border-transparent rounded-md font-semibold text-xs text-white uppercase tracking-widest hover:bg-green-700 active:bg-green-900 focus:outline-none focus:border-red-900 focus:ring focus:ring-green-300 disabled:opacity-25 transition"
}, {
"default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_unicon, {
@ -24991,7 +24937,25 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
, ["contract"])]);
}), 128
/* KEYED_FRAGMENT */
))]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)("div", _hoisted_14, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)("div", _hoisted_15, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)("h1", _hoisted_16, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($props.car.sell_contracts.total > 1 ? $props.car.sell_contracts.total + ' Verkaufsverträge' : 'Verkaufsvertrag'), 1
)), !$props.car.deleted_at && $props.car.buy_contracts.total <= $props.car.sell_contracts.total ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)("div", _hoisted_14, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_inertia_link, {
href: _ctx.route('cars.edit', $props.car.id),
"class": "py-6 w-full mt-12 inline-flex items-center px-4 bg-green-800 border border-transparent rounded-md font-semibold justify-center text-md text-white uppercase tracking-widest hover:bg-green-700 focus:outline-none focus:border-green-900 focus:ring focus:ring-green-300 disabled:opacity-25 transition"
}, {
"default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_unicon, {
fill: "white",
"class": "mr-1",
height: "22",
width: "22",
name: "plus-circle"
}), _hoisted_15];
}),
_: 1
/* STABLE */
}, 8
/* PROPS */
, ["href"])])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)("div", _hoisted_16, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)("div", _hoisted_17, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)("h1", _hoisted_18, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($props.car.sell_contracts.total > 1 ? $props.car.sell_contracts.total + ' Verkaufsverträge' : 'Verkaufsvertrag'), 1
/* TEXT */
)]), ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderList)($props.car.sell_contracts.data, function (contract) {
return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)("div", {
@ -25003,7 +24967,25 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
, ["contract"])]);
}), 128
/* KEYED_FRAGMENT */
))])])];
)), !$props.car.deleted_at && $props.car.buy_contracts.total > $props.car.sell_contracts.total ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)("div", _hoisted_19, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_inertia_link, {
href: _ctx.route('cars.edit', $props.car.id),
"class": "py-6 w-full mt-12 inline-flex items-center px-4 bg-green-800 border border-transparent rounded-md font-semibold justify-center text-md text-white uppercase tracking-widest hover:bg-green-700 focus:outline-none focus:border-green-900 focus:ring focus:ring-green-300 disabled:opacity-25 transition"
}, {
"default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_unicon, {
fill: "white",
"class": "mr-1",
height: "22",
width: "22",
name: "plus-circle"
}), _hoisted_20];
}),
_: 1
/* STABLE */
}, 8
/* PROPS */
, ["href"])])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)])])];
}),
_: 1
/* STABLE */

View File

@ -1,5 +1,5 @@
<template>
<div class="py-6 grid grid-cols-12 gap-3 w-full">
<div class="py-3 grid grid-cols-12 gap-3 w-full">
<div v-if="contract.contact" class="col-span-6 xs:col-span-12">
<h3>{{ meta.contact }}</h3>
@ -16,7 +16,7 @@
Datum: {{ contract.date }}
</div>
<div v-if="contract.insurance_type">
Versicherungstyp: {{ contract.insurance_type }}
Versicherung: {{ contract.insurance_type }}
</div>
<div v-if="contract.price" class="pt-8 font-bold text-2xl">
{{ contract.price }}
@ -30,7 +30,7 @@
</div>
<div class="absolute left-0 right-0 bottom-0">
<div class="w-full flex flex-col">
<a :href="route('contracts.print', contract.id)" class="inline-flex items-center px-4 py-2 bg-gray-800 border border-transparent rounded-md font-semibold text-xs text-white uppercase tracking-widest hover:bg-gray-700 active:bg-gray-900 focus:outline-none focus:border-gray-900 focus:ring focus:ring-gray-300 disabled:opacity-25 transition" >
<a :href="route('contracts.print', contract.id)" class="justify-center inline-flex items-center px-4 py-2 bg-gray-800 border border-transparent rounded-md font-semibold text-xs text-white uppercase tracking-widest hover:bg-gray-700 active:bg-gray-900 focus:outline-none focus:border-gray-900 focus:ring focus:ring-gray-300 disabled:opacity-25 transition" >
<unicon fill="white" class="mr-1" height="22" width="22" name="file-download"></unicon>
drucken
</a>

View File

@ -57,24 +57,6 @@
Verkäufer
</jet-nav-link>
</div>
<div class="mb-4 px-4">
<p class="text-sm font-semibold mb-1 text-gray-400 flex items-center">
Verträge
</p>
<jet-nav-link :href="route('contracts')" :active="route().current('contracts')">
<unicon class="mr-2" height="22" width="22" name="car-sideview"></unicon>
Alle Verträge
</jet-nav-link>
<jet-nav-link :href="route('contracts.buy_contracts')" :active="route().current('contracts.buy_contracts')">
<unicon class="mr-2 ml-3" height="22" width="22" name="angle-right"></unicon>
Ankaufverträge
</jet-nav-link>
<jet-nav-link :href="route('contracts.sell_contracts')" :active="route().current('contracts.sell_contracts')">
<unicon class="mr-2 ml-3" height="22" width="22" name="angle-right"></unicon>
Verkaufverträge
</jet-nav-link>
</div>
</div>
</template>

View File

@ -10,17 +10,17 @@
<div class="col-span-6 xs:col-span-12">
<car-card :car="car" />
</div>
<div class="col-span-2 xs:col-span-12">
<div class="col-span-3 xs:col-span-12">
<div class="w-full flex flex-col">
<inertia-link :href="route('cars.edit', car.id)" class="mb-5 inline-flex items-center px-4 py-2 bg-gray-800 border border-transparent rounded-md font-semibold text-xs text-white uppercase tracking-widest hover:bg-gray-700 active:bg-gray-900 focus:outline-none focus:border-gray-900 focus:ring focus:ring-gray-300 disabled:opacity-25 transition" >
<inertia-link v-if="!car.deleted_at" :href="route('cars.edit', car.id)" class="justify-center mb-5 inline-flex items-center px-4 py-2 bg-gray-800 border border-transparent rounded-md font-semibold text-xs text-white uppercase tracking-widest hover:bg-gray-700 active:bg-gray-900 focus:outline-none focus:border-gray-900 focus:ring focus:ring-gray-300 disabled:opacity-25 transition" >
<unicon fill="white" class="mr-1" height="22" width="22" name="pen"></unicon>
bearbeiten
</inertia-link>
<inertia-link v-if="!car.deleted_at" :href="route('cars.destroy', car.id)" class="mb-5 inline-flex items-center px-4 py-2 bg-red-800 border border-transparent rounded-md font-semibold text-xs text-white uppercase tracking-widest hover:bg-red-700 active:bg-red-900 focus:outline-none focus:border-red-900 focus:ring focus:ring-red-300 disabled:opacity-25 transition" >
<inertia-link v-if="!car.deleted_at" :href="route('cars.destroy', car.id)" class="justify-center mb-5 inline-flex items-center px-4 py-2 bg-red-800 border border-transparent rounded-md font-semibold text-xs text-white uppercase tracking-widest hover:bg-red-700 active:bg-red-900 focus:outline-none focus:border-red-900 focus:ring focus:ring-red-300 disabled:opacity-25 transition" >
<unicon fill="white" class="mr-1" height="22" width="22" name="trash-alt"></unicon>
löschen
</inertia-link>
<inertia-link v-if="car.deleted_at" :href="route('cars.restore', car.id)" class="mb-5 inline-flex items-center px-4 py-2 bg-red-800 border border-transparent rounded-md font-semibold text-xs text-white uppercase tracking-widest hover:bg-red-700 active:bg-red-900 focus:outline-none focus:border-red-900 focus:ring focus:ring-red-300 disabled:opacity-25 transition" >
<inertia-link v-if="car.deleted_at" :href="route('cars.restore', car.id)" class="justify-center mb-5 inline-flex items-center px-4 py-2 bg-green-800 border border-transparent rounded-md font-semibold text-xs text-white uppercase tracking-widest hover:bg-green-700 active:bg-green-900 focus:outline-none focus:border-red-900 focus:ring focus:ring-green-300 disabled:opacity-25 transition" >
<unicon fill="white" class="mr-1" height="22" width="22" name="trash-alt"></unicon>
wiederherstellen
</inertia-link>
@ -33,21 +33,32 @@
</div>
<div class="py-12 grid grid-cols-12 gap-12 w-full">
<div class="w-full sm:px-6 lg:px-8 col-span-6 xs:col-span-12">
<div class="whitespace-nowrap mb-3">
<h1 class="mb-1 font-bold text-3xl">{{ car.buy_contracts.total > 1 ? car.buy_contracts.total + ' Ankaufsverträge' : 'Ankaufsvertrag' }}</h1>
<div class="whitespace-nowrap">
<h1 class="font-bold text-3xl">{{ car.buy_contracts.total > 1 ? car.buy_contracts.total + ' Ankaufsverträge' : 'Ankaufsvertrag' }}</h1>
</div>
<div v-for="contract in car.buy_contracts.data" :key="contract.id">
<buy-contract-card :contract="contract"/>
</div>
<div v-if="!car.deleted_at && car.buy_contracts.total <= car.sell_contracts.total">
<inertia-link :href="route('cars.edit', car.id)" class="py-6 w-full mt-12 inline-flex items-center px-4 bg-green-800 border border-transparent rounded-md font-semibold justify-center text-md text-white uppercase tracking-widest hover:bg-green-700 focus:outline-none focus:border-green-900 focus:ring focus:ring-green-300 disabled:opacity-25 transition" >
<unicon fill="white" class="mr-1" height="22" width="22" name="plus-circle"></unicon>
Neuer Ankaufsvertrag
</inertia-link>
</div>
</div>
<div class="w-full sm:px-6 lg:px-8 col-span-6 xs:col-span-12">
<div class="whitespace-nowrap mb-3">
<h1 class="mb-1 font-bold text-3xl">{{ car.sell_contracts.total > 1 ? car.sell_contracts.total + ' Verkaufsverträge' : 'Verkaufsvertrag' }}</h1>
<div class="whitespace-nowrap">
<h1 class="font-bold text-3xl">{{ car.sell_contracts.total > 1 ? car.sell_contracts.total + ' Verkaufsverträge' : 'Verkaufsvertrag' }}</h1>
</div>
<div v-for="contract in car.sell_contracts.data" :key="contract.id">
<sell-contract-card :contract="contract"/>
</div>
<div v-if="!car.deleted_at && car.buy_contracts.total > car.sell_contracts.total">
<inertia-link :href="route('cars.edit', car.id)" class="py-6 w-full mt-12 inline-flex items-center px-4 bg-green-800 border border-transparent rounded-md font-semibold justify-center text-md text-white uppercase tracking-widest hover:bg-green-700 focus:outline-none focus:border-green-900 focus:ring focus:ring-green-300 disabled:opacity-25 transition" >
<unicon fill="white" class="mr-1" height="22" width="22" name="plus-circle"></unicon>
Neuer Verkaufssvertrag
</inertia-link>
</div>
</div>
</div>
</layout>