Fehlerbehebung & Start Vector Search
This commit is contained in:
@@ -1,3 +1,150 @@
|
||||
<div class="container mx-auto p-4">
|
||||
<div class="bg-white rounded-lg shadow-md p-6">
|
||||
<h1 class="text-2xl font-semibold mb-6">Edit Listing</h1>
|
||||
@if(listing){
|
||||
<form #listingForm="ngForm">
|
||||
<div class="mb-4">
|
||||
<label for="listingsCategory" class="block text-sm font-bold text-gray-700 mb-1">Listing category</label>
|
||||
<ng-select [readonly]="mode === 'edit'" [items]="selectOptions?.listingCategories" bindLabel="name" bindValue="value" [(ngModel)]="listing.listingsCategory" name="listingsCategory"> </ng-select>
|
||||
</div>
|
||||
|
||||
<div class="mb-4">
|
||||
<label for="title" class="block text-sm font-bold text-gray-700 mb-1">Title of Listing</label>
|
||||
<input type="text" id="title" [(ngModel)]="listing.title" name="title" class="w-full p-2 border border-gray-300 rounded-md" />
|
||||
</div>
|
||||
|
||||
<div class="mb-4">
|
||||
<label for="description" class="block text-sm font-bold text-gray-700 mb-1">Description</label>
|
||||
<quill-editor [(ngModel)]="listing.description" name="description" [modules]="quillModules"></quill-editor>
|
||||
</div>
|
||||
|
||||
<div class="mb-4">
|
||||
<label for="type" class="block text-sm font-bold text-gray-700 mb-1">Type of business</label>
|
||||
<ng-select [items]="typesOfBusiness" bindLabel="name" bindValue="value" [(ngModel)]="listing.type" name="type"> </ng-select>
|
||||
</div>
|
||||
|
||||
<div class="flex mb-4 space-x-4">
|
||||
<div class="w-1/2">
|
||||
<label for="state" class="block text-sm font-bold text-gray-700 mb-1">State</label>
|
||||
<ng-select [items]="selectOptions?.states" bindLabel="name" bindValue="value" [(ngModel)]="listing.state" name="state"> </ng-select>
|
||||
</div>
|
||||
<div class="w-1/2">
|
||||
<label for="city" class="block text-sm font-bold text-gray-700 mb-1">City</label>
|
||||
<input type="text" id="city" [(ngModel)]="listing.city" name="city" class="w-full p-2 border border-gray-300 rounded-md" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex mb-4 space-x-4">
|
||||
<div class="w-1/2">
|
||||
<label for="price" class="block text-sm font-bold text-gray-700 mb-1">Price</label>
|
||||
<input
|
||||
type="text"
|
||||
id="price"
|
||||
[(ngModel)]="listing.price"
|
||||
name="price"
|
||||
class="w-full p-2 border border-gray-300 rounded-md"
|
||||
[options]="{ prefix: '$', thousands: ',', decimal: '.', precision: 0, align: 'left' }"
|
||||
currencyMask
|
||||
/>
|
||||
</div>
|
||||
<div class="w-1/2">
|
||||
<label for="salesRevenue" class="block text-sm font-bold text-gray-700 mb-1">Sales Revenue</label>
|
||||
<input
|
||||
type="text"
|
||||
id="salesRevenue"
|
||||
[(ngModel)]="listing.salesRevenue"
|
||||
name="salesRevenue"
|
||||
class="w-full p-2 border border-gray-300 rounded-md"
|
||||
[options]="{ prefix: '$', thousands: ',', decimal: '.', precision: 0, align: 'left' }"
|
||||
currencyMask
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-4">
|
||||
<label for="cashFlow" class="block text-sm font-bold text-gray-700 mb-1">Cash Flow</label>
|
||||
<input
|
||||
type="text"
|
||||
id="cashFlow"
|
||||
[(ngModel)]="listing.cashFlow"
|
||||
name="cashFlow"
|
||||
class="w-full p-2 border border-gray-300 rounded-md"
|
||||
[options]="{ prefix: '$', thousands: ',', decimal: '.', precision: 0, align: 'left' }"
|
||||
currencyMask
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="flex mb-4 space-x-4">
|
||||
<div class="w-1/2">
|
||||
<label for="established" class="block text-sm font-bold text-gray-700 mb-1">Years Established Since</label>
|
||||
<input type="number" id="established" [(ngModel)]="listing.established" name="established" class="w-full p-2 border border-gray-300 rounded-md" />
|
||||
</div>
|
||||
<div class="w-1/2">
|
||||
<label for="employees" class="block text-sm font-bold text-gray-700 mb-1">Employees</label>
|
||||
<input type="number" id="employees" [(ngModel)]="listing.employees" name="employees" class="w-full p-2 border border-gray-300 rounded-md" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex mb-4 space-x-4">
|
||||
<div class="flex items-center">
|
||||
<input type="checkbox" id="realEstateIncluded" [(ngModel)]="listing.realEstateIncluded" name="realEstateIncluded" class="mr-2" />
|
||||
<label for="realEstateIncluded" class="text-sm font-bold text-gray-700">Real Estate Included</label>
|
||||
</div>
|
||||
<div class="flex items-center">
|
||||
<input type="checkbox" id="leasedLocation" [(ngModel)]="listing.leasedLocation" name="leasedLocation" class="mr-2" />
|
||||
<label for="leasedLocation" class="text-sm font-bold text-gray-700">Leased Location</label>
|
||||
</div>
|
||||
<div class="flex items-center">
|
||||
<input type="checkbox" id="franchiseResale" [(ngModel)]="listing.franchiseResale" name="franchiseResale" class="mr-2" />
|
||||
<label for="franchiseResale" class="text-sm font-bold text-gray-700">Franchise Re-Sale</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-4">
|
||||
<label for="supportAndTraining" class="block text-sm font-bold text-gray-700 mb-1">Support & Training</label>
|
||||
<input type="text" id="supportAndTraining" [(ngModel)]="listing.supportAndTraining" name="supportAndTraining" class="w-full p-2 border border-gray-300 rounded-md" />
|
||||
</div>
|
||||
|
||||
<div class="mb-4">
|
||||
<label for="reasonForSale" class="block text-sm font-bold text-gray-700 mb-1">Reason for Sale</label>
|
||||
<input type="text" id="reasonForSale" [(ngModel)]="listing.reasonForSale" name="reasonForSale" class="w-full p-2 border border-gray-300 rounded-md" />
|
||||
</div>
|
||||
|
||||
<div class="flex mb-4 space-x-4">
|
||||
<div class="w-1/2">
|
||||
<label for="brokerLicencing" class="block text-sm font-bold text-gray-700 mb-1">Broker Licensing</label>
|
||||
<input type="text" id="brokerLicencing" [(ngModel)]="listing.brokerLicencing" name="brokerLicencing" class="w-full p-2 border border-gray-300 rounded-md" />
|
||||
</div>
|
||||
<div class="w-1/2">
|
||||
<label for="internalListingNumber" class="block text-sm font-bold text-gray-700 mb-1">Internal Listing Number</label>
|
||||
<input type="number" id="internalListingNumber" [(ngModel)]="listing.internalListingNumber" name="internalListingNumber" class="w-full p-2 border border-gray-300 rounded-md" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-4">
|
||||
<label for="internals" class="block text-sm font-bold text-gray-700 mb-1">Internal Notes (Will not be shown on the listing, for your records only.)</label>
|
||||
<textarea id="internals" [(ngModel)]="listing.internals" name="internals" class="w-full p-2 border border-gray-300 rounded-md" rows="3"></textarea>
|
||||
</div>
|
||||
|
||||
<div class="flex items-center mb-4">
|
||||
<label class="flex items-center cursor-pointer">
|
||||
<div class="relative">
|
||||
<input type="checkbox" [(ngModel)]="listing.draft" name="draft" class="hidden" />
|
||||
<div class="toggle-bg block w-12 h-6 rounded-full bg-gray-600 transition"></div>
|
||||
</div>
|
||||
<div class="ml-3 text-gray-700 font-medium">Draft Mode (Will not be shown as public listing)</div>
|
||||
</label>
|
||||
</div>
|
||||
@if (mode==='create'){
|
||||
<button (click)="save()" class="bg-blue-500 text-white px-4 py-2 rounded-md hover:bg-blue-600">Post Listing</button>
|
||||
} @else {
|
||||
<button (click)="save()" class="bg-blue-500 text-white px-4 py-2 rounded-md hover:bg-blue-600">Update Listing</button>
|
||||
}
|
||||
</form>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- <div class="surface-ground px-4 py-8 md:px-6 lg:px-8">
|
||||
<div class="p-fluid flex flex-column lg:flex-row">
|
||||
<menu-account></menu-account>
|
||||
@@ -156,153 +303,3 @@
|
||||
</div>
|
||||
<p-toast></p-toast>
|
||||
<p-confirmDialog></p-confirmDialog> -->
|
||||
|
||||
<div class="container mx-auto p-4">
|
||||
<div class="bg-white rounded-lg shadow-md p-6">
|
||||
<h1 class="text-2xl font-semibold mb-6">Edit Listing</h1>
|
||||
@if(listing){
|
||||
<form #listingForm="ngForm">
|
||||
<div class="mb-4">
|
||||
<label for="listingsCategory" class="block text-sm font-bold text-gray-700 mb-1">Listing category</label>
|
||||
<select id="listingsCategory" [(ngModel)]="listing.listingsCategory" name="listingsCategory" class="w-full p-2 border border-gray-300 rounded-md">
|
||||
<option value="business">Business</option>
|
||||
<option value="commercialProperty">Commercial Property</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="mb-4">
|
||||
<label for="title" class="block text-sm font-bold text-gray-700 mb-1">Title of Listing</label>
|
||||
<input type="text" id="title" [(ngModel)]="listing.title" name="title" class="w-full p-2 border border-gray-300 rounded-md" />
|
||||
</div>
|
||||
|
||||
<div class="mb-4">
|
||||
<label for="description" class="block text-sm font-bold text-gray-700 mb-1">Description</label>
|
||||
<quill-editor [(ngModel)]="listing.description" name="description" [modules]="quillModules"></quill-editor>
|
||||
</div>
|
||||
|
||||
<div class="mb-4">
|
||||
<label for="type" class="block text-sm font-bold text-gray-700 mb-1">Type of business</label>
|
||||
<ng-select [items]="typesOfBusiness" bindLabel="name" bindValue="value" [(ngModel)]="listing.type" name="type"> </ng-select>
|
||||
</div>
|
||||
|
||||
<div class="flex mb-4 space-x-4">
|
||||
<div class="w-1/2">
|
||||
<label for="state" class="block text-sm font-bold text-gray-700 mb-1">State</label>
|
||||
<ng-select [items]="selectOptions?.states" bindLabel="name" bindValue="value" [(ngModel)]="listing.state" name="state"> </ng-select>
|
||||
</div>
|
||||
<div class="w-1/2">
|
||||
<label for="city" class="block text-sm font-bold text-gray-700 mb-1">City</label>
|
||||
<input type="text" id="city" [(ngModel)]="listing.city" name="city" class="w-full p-2 border border-gray-300 rounded-md" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex mb-4 space-x-4">
|
||||
<div class="w-1/2">
|
||||
<label for="price" class="block text-sm font-bold text-gray-700 mb-1">Price</label>
|
||||
<input
|
||||
type="text"
|
||||
id="price"
|
||||
[(ngModel)]="listing.price"
|
||||
name="price"
|
||||
class="w-full p-2 border border-gray-300 rounded-md"
|
||||
[options]="{ prefix: '$', thousands: ',', decimal: '.', precision: 0, align: 'left' }"
|
||||
currencyMask
|
||||
/>
|
||||
</div>
|
||||
<div class="w-1/2">
|
||||
<label for="salesRevenue" class="block text-sm font-bold text-gray-700 mb-1">Sales Revenue</label>
|
||||
<input
|
||||
type="text"
|
||||
id="salesRevenue"
|
||||
[(ngModel)]="listing.salesRevenue"
|
||||
name="salesRevenue"
|
||||
class="w-full p-2 border border-gray-300 rounded-md"
|
||||
[options]="{ prefix: '$', thousands: ',', decimal: '.', precision: 0, align: 'left' }"
|
||||
currencyMask
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-4">
|
||||
<label for="cashFlow" class="block text-sm font-bold text-gray-700 mb-1">Cash Flow</label>
|
||||
<input
|
||||
type="text"
|
||||
id="cashFlow"
|
||||
[(ngModel)]="listing.cashFlow"
|
||||
name="cashFlow"
|
||||
class="w-full p-2 border border-gray-300 rounded-md"
|
||||
[options]="{ prefix: '$', thousands: ',', decimal: '.', precision: 0, align: 'left' }"
|
||||
currencyMask
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="flex mb-4 space-x-4">
|
||||
<div class="w-1/2">
|
||||
<label for="established" class="block text-sm font-bold text-gray-700 mb-1">Years Established Since</label>
|
||||
<input type="number" id="established" [(ngModel)]="listing.established" name="established" class="w-full p-2 border border-gray-300 rounded-md" />
|
||||
</div>
|
||||
<div class="w-1/2">
|
||||
<label for="employees" class="block text-sm font-bold text-gray-700 mb-1">Employees</label>
|
||||
<input type="number" id="employees" [(ngModel)]="listing.employees" name="employees" class="w-full p-2 border border-gray-300 rounded-md" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex mb-4 space-x-4">
|
||||
<div class="flex items-center">
|
||||
<input type="checkbox" id="realEstateIncluded" [(ngModel)]="listing.realEstateIncluded" name="realEstateIncluded" class="mr-2" />
|
||||
<label for="realEstateIncluded" class="text-sm font-bold text-gray-700">Real Estate Included</label>
|
||||
</div>
|
||||
<div class="flex items-center">
|
||||
<input type="checkbox" id="leasedLocation" [(ngModel)]="listing.leasedLocation" name="leasedLocation" class="mr-2" />
|
||||
<label for="leasedLocation" class="text-sm font-bold text-gray-700">Leased Location</label>
|
||||
</div>
|
||||
<div class="flex items-center">
|
||||
<input type="checkbox" id="franchiseResale" [(ngModel)]="listing.franchiseResale" name="franchiseResale" class="mr-2" />
|
||||
<label for="franchiseResale" class="text-sm font-bold text-gray-700">Franchise Re-Sale</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-4">
|
||||
<label for="supportAndTraining" class="block text-sm font-bold text-gray-700 mb-1">Support & Training</label>
|
||||
<input type="text" id="supportAndTraining" [(ngModel)]="listing.supportAndTraining" name="supportAndTraining" class="w-full p-2 border border-gray-300 rounded-md" />
|
||||
</div>
|
||||
|
||||
<div class="mb-4">
|
||||
<label for="reasonForSale" class="block text-sm font-bold text-gray-700 mb-1">Reason for Sale</label>
|
||||
<input type="text" id="reasonForSale" [(ngModel)]="listing.reasonForSale" name="reasonForSale" class="w-full p-2 border border-gray-300 rounded-md" />
|
||||
</div>
|
||||
|
||||
<div class="flex mb-4 space-x-4">
|
||||
<div class="w-1/2">
|
||||
<label for="brokerLicencing" class="block text-sm font-bold text-gray-700 mb-1">Broker Licensing</label>
|
||||
<input type="text" id="brokerLicencing" [(ngModel)]="listing.brokerLicencing" name="brokerLicencing" class="w-full p-2 border border-gray-300 rounded-md" />
|
||||
</div>
|
||||
<div class="w-1/2">
|
||||
<label for="internalListingNumber" class="block text-sm font-bold text-gray-700 mb-1">Internal Listing Number</label>
|
||||
<input type="number" id="internalListingNumber" [(ngModel)]="listing.internalListingNumber" name="internalListingNumber" class="w-full p-2 border border-gray-300 rounded-md" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-4">
|
||||
<label for="internals" class="block text-sm font-bold text-gray-700 mb-1">Internal Notes (Will not be shown on the listing, for your records only.)</label>
|
||||
<textarea id="internals" [(ngModel)]="listing.internals" name="internals" class="w-full p-2 border border-gray-300 rounded-md" rows="3"></textarea>
|
||||
</div>
|
||||
|
||||
<div class="flex items-center mb-4">
|
||||
<label class="flex items-center cursor-pointer">
|
||||
<div class="relative">
|
||||
<input type="checkbox" [(ngModel)]="listing.draft" name="draft" class="hidden" />
|
||||
<div class="toggle-bg block w-12 h-6 rounded-full bg-gray-600 transition"></div>
|
||||
</div>
|
||||
<div class="ml-3 text-gray-700 font-medium">Draft Mode (Will not be shown as public listing)</div>
|
||||
</label>
|
||||
</div>
|
||||
@if (mode==='create'){
|
||||
<button (click)="save()" class="bg-blue-500 text-white px-4 py-2 rounded-md hover:bg-blue-600">Post Listing</button>
|
||||
} @else {
|
||||
<button (click)="save()" class="bg-blue-500 text-white px-4 py-2 rounded-md hover:bg-blue-600">Update Listing</button>
|
||||
}
|
||||
</form>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user