2021-07-21 00:08:57 +00:00
|
|
|
@page
|
2021-08-05 06:22:19 +00:00
|
|
|
@using Props.Services.Content
|
|
|
|
@model SearchModel
|
2021-08-07 22:20:46 +00:00
|
|
|
@inject ITextualManager<SearchModel> ContentManager
|
2021-08-05 06:22:19 +00:00
|
|
|
|
2021-07-21 00:08:57 +00:00
|
|
|
@{
|
|
|
|
ViewData["Title"] = "Search";
|
|
|
|
ViewData["Specific"] = "Search";
|
|
|
|
}
|
|
|
|
|
2021-08-07 22:20:46 +00:00
|
|
|
<form method="GET">
|
|
|
|
<div class="mt-4 mb-3 less-concise mx-auto">
|
2021-07-21 00:08:57 +00:00
|
|
|
<div class="input-group">
|
2021-08-05 06:22:19 +00:00
|
|
|
<input type="text" class="form-control border-primary" placeholder="What are you looking for?"
|
2021-08-07 22:20:46 +00:00
|
|
|
aria-label="Search" aria-describedby="search-btn" id="search-bar" value="@Model.SearchQuery" name="q">
|
2021-08-05 06:22:19 +00:00
|
|
|
<button class="btn btn-outline-secondary" type="button" id="configuration-toggle" data-bs-toggle="collapse"
|
|
|
|
data-bs-target="#configuration"><i class="bi bi-sliders"></i></button>
|
2021-08-07 22:20:46 +00:00
|
|
|
<button class="btn btn-primary" type="submit" id="search-btn">Search</button>
|
2021-07-21 00:08:57 +00:00
|
|
|
</div>
|
2021-07-22 21:12:27 +00:00
|
|
|
</div>
|
|
|
|
|
2021-08-07 22:20:46 +00:00
|
|
|
<div class="collapse tear" id="configuration">
|
|
|
|
<div class="container my-3">
|
2021-07-23 02:24:39 +00:00
|
|
|
<div class="d-flex">
|
|
|
|
<h1 class="my-2 display-2 me-auto">Configuration</h1>
|
2021-08-05 06:22:19 +00:00
|
|
|
<button class="btn align-self-start" type="button" id="configuration-close" data-bs-toggle="collapse"
|
|
|
|
data-bs-target="#configuration"><i class="bi bi-x-lg"></i></button>
|
2021-07-23 02:24:39 +00:00
|
|
|
</div>
|
|
|
|
<div class="row justify-content-md-center">
|
2021-07-24 19:47:40 +00:00
|
|
|
<section class="col-lg px-4">
|
2021-07-23 02:24:39 +00:00
|
|
|
<h3>Price</h3>
|
|
|
|
<div class="mb-3">
|
|
|
|
<label for="max-price" class="form-label">Maximum Price</label>
|
|
|
|
<div class="input-group">
|
|
|
|
<div class="input-group-text">
|
2021-08-05 06:22:19 +00:00
|
|
|
<input class="form-check-input mt-0" type="checkbox" id="max-price-enabled"
|
2021-08-07 22:20:46 +00:00
|
|
|
checked="@Model.ActiveSearchOutline.Filters.EnableUpperPrice"
|
|
|
|
name="ActiveSearchOutline.Filters.EnableUpperPrice">
|
2021-07-23 02:24:39 +00:00
|
|
|
</div>
|
|
|
|
<span class="input-group-text">$</span>
|
2021-08-07 22:20:46 +00:00
|
|
|
<input type="number" class="form-control" min="0" id="max-price"
|
|
|
|
value="@Model.ActiveSearchOutline.Filters.UpperPrice"
|
|
|
|
name="ActiveSearchOutline.Filters.UpperPrice">
|
2021-07-23 02:24:39 +00:00
|
|
|
<span class="input-group-text">.00</span>
|
2021-07-22 21:12:27 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
2021-07-23 02:24:39 +00:00
|
|
|
<div class="mb-3">
|
|
|
|
<label for="min-price" class="form-label">Minimum Price</label>
|
|
|
|
<div class="input-group">
|
|
|
|
<span class="input-group-text">$</span>
|
2021-08-07 22:20:46 +00:00
|
|
|
<input type="number" class="form-control" min="0" id="min-price"
|
|
|
|
value="@Model.ActiveSearchOutline.Filters.LowerPrice"
|
|
|
|
name="ActiveSearchOutline.Filters.LowerPrice">
|
2021-07-23 02:24:39 +00:00
|
|
|
<span class="input-group-text">.00</span>
|
|
|
|
</div>
|
2021-07-22 21:12:27 +00:00
|
|
|
</div>
|
2021-07-23 02:24:39 +00:00
|
|
|
<div class="mb-3">
|
|
|
|
<label for="max-shipping" class="form-label">Maximum Shipping Fee</label>
|
|
|
|
<div class="input-group">
|
|
|
|
<div class="input-group-text">
|
2021-08-07 22:20:46 +00:00
|
|
|
<input class="form-check-input mt-0" type="checkbox" id="max-shipping-enabled"
|
|
|
|
checked="@Model.ActiveSearchOutline.Filters.EnableMaxShippingFee"
|
|
|
|
name="ActiveSearchOutline.Filters.EnableMaxShippingFee">
|
2021-07-23 02:24:39 +00:00
|
|
|
</div>
|
|
|
|
<span class="input-group-text">$</span>
|
2021-08-07 22:20:46 +00:00
|
|
|
<input type="number" class="form-control" min="0" id="max-shipping"
|
|
|
|
value="@Model.ActiveSearchOutline.Filters.MaxShippingFee"
|
|
|
|
name="ActiveSearchOutline.Filters.MaxShippingFee">
|
2021-07-23 02:24:39 +00:00
|
|
|
<span class="input-group-text">.00</span>
|
2021-07-22 21:12:27 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
2021-07-23 02:24:39 +00:00
|
|
|
<div class="mb-3">
|
|
|
|
<div class="form-check">
|
2021-08-05 06:22:19 +00:00
|
|
|
<input class="form-check-input" type="checkbox" id="keep-unknown-shipping"
|
2021-08-07 22:20:46 +00:00
|
|
|
checked="@Model.ActiveSearchOutline.Filters.KeepUnknownShipping"
|
|
|
|
name="ActiveSearchOutline.Filters.KeepUnknownShipping">
|
2021-07-23 02:24:39 +00:00
|
|
|
<label class="form-check-label" for="keep-unknown-shipping">Keep Unknown Shipping</label>
|
|
|
|
</div>
|
2021-07-22 21:12:27 +00:00
|
|
|
</div>
|
2021-07-23 02:24:39 +00:00
|
|
|
</section>
|
2021-07-24 19:47:40 +00:00
|
|
|
<section class="col-lg px-4">
|
2021-07-23 02:24:39 +00:00
|
|
|
<h3>Metrics</h3>
|
|
|
|
<div class="mb-3">
|
|
|
|
<label for="min-purchases" class="form-label">Minimum Purchases</label>
|
|
|
|
<div class="input-group">
|
2021-08-07 22:20:46 +00:00
|
|
|
<input type="number" class="form-control" min="0" id="min-purchases"
|
|
|
|
value="@Model.ActiveSearchOutline.Filters.MinPurchases"
|
|
|
|
name="ActiveSearchOutline.Filters.MinPurchases">
|
2021-07-23 02:24:39 +00:00
|
|
|
<span class="input-group-text">Purchases</span>
|
|
|
|
</div>
|
2021-07-22 21:12:27 +00:00
|
|
|
</div>
|
2021-07-23 02:24:39 +00:00
|
|
|
<div class="mb-3">
|
|
|
|
<div class="form-check">
|
2021-08-05 06:22:19 +00:00
|
|
|
<input class="form-check-input" type="checkbox" id="keep-unknown-purchases"
|
2021-08-07 22:20:46 +00:00
|
|
|
checked="@Model.ActiveSearchOutline.Filters.KeepUnknownPurchaseCount"
|
|
|
|
name="ActiveSearchOutline.Filters.KeepUnknownPurchaseCount">
|
2021-07-23 02:24:39 +00:00
|
|
|
<label class="form-check-label" for="keep-unknown-purchases">Keep Unknown Purchases</label>
|
|
|
|
</div>
|
2021-07-22 21:12:27 +00:00
|
|
|
</div>
|
2021-07-23 02:24:39 +00:00
|
|
|
<div class="mb-3">
|
|
|
|
<label for="min-reviews" class="form-label">Minimum Reviews</label>
|
|
|
|
<div class="input-group">
|
2021-08-07 22:20:46 +00:00
|
|
|
<input type="number" class="form-control" min="0" id="min-reviews"
|
|
|
|
value="@Model.ActiveSearchOutline.Filters.MinReviews"
|
|
|
|
name="ActiveSearchOutline.Filters.MinReviews">
|
2021-07-23 02:24:39 +00:00
|
|
|
<span class="input-group-text">Reviews</span>
|
|
|
|
</div>
|
2021-07-22 21:12:27 +00:00
|
|
|
</div>
|
2021-07-23 02:24:39 +00:00
|
|
|
<div class="mb-3">
|
|
|
|
<div class="form-check">
|
2021-08-05 06:22:19 +00:00
|
|
|
<input class="form-check-input" type="checkbox" id="keep-unknown-reviews"
|
2021-08-07 22:20:46 +00:00
|
|
|
checked="@Model.ActiveSearchOutline.Filters.KeepUnknownReviewCount"
|
|
|
|
name="ActiveSearchOutline.Filters.KeepUnknownReviewCount">
|
2021-08-05 06:22:19 +00:00
|
|
|
<label class="form-check-label" for="keep-unknown-reviews">Keep Unknown Number of
|
|
|
|
Reviews</label>
|
2021-07-23 02:24:39 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="mb-1">
|
|
|
|
<label for="min-rating" class="form-label">Minimum Rating</label>
|
2021-08-05 06:22:19 +00:00
|
|
|
<input type="range" class="form-range" id="min-rating" min="0" max="100" step="1"
|
2021-08-07 22:20:46 +00:00
|
|
|
value="@Model.ActiveSearchOutline.Filters.MinRating"
|
|
|
|
name="ActiveSearchOutline.Filters.MinRating">
|
|
|
|
<div id="min-rating-display" class="form-text"></div>
|
2021-07-23 02:24:39 +00:00
|
|
|
</div>
|
|
|
|
<div class="mb-3">
|
|
|
|
<div class="form-check">
|
2021-08-07 22:20:46 +00:00
|
|
|
<input class="form-check-input" type="checkbox" id="keep-unrated"
|
|
|
|
checked="@Model.ActiveSearchOutline.Filters.KeepUnrated"
|
|
|
|
name="ActiveSearchOutline.Filters.KeepUnrated">
|
2021-07-23 02:24:39 +00:00
|
|
|
<label class="form-check-label" for="keep-unrated">Keep Unrated Items</label>
|
|
|
|
</div>
|
2021-07-22 21:12:27 +00:00
|
|
|
</div>
|
2021-07-23 02:24:39 +00:00
|
|
|
</section>
|
2021-07-24 19:47:40 +00:00
|
|
|
<section class="col-lg px-4">
|
2021-07-23 02:24:39 +00:00
|
|
|
<h3>Shops Enabled</h3>
|
|
|
|
<div class="mb-3 px-3" id="shop-checkboxes">
|
2021-08-07 22:20:46 +00:00
|
|
|
@foreach (string shopName in Model.SearchManager.ShopManager.GetAllShopNames())
|
|
|
|
{
|
2021-08-05 06:22:19 +00:00
|
|
|
<div class="form-check">
|
2021-08-07 22:20:46 +00:00
|
|
|
<input class="form-check-input" type="checkbox" id="@($"{shopName}-enabled")"
|
|
|
|
checked="@Model.ActiveSearchOutline.Enabled[shopName]">
|
|
|
|
<label class="form-check-label" for="@($"{shopName}-enabled")">@shopName</label>
|
2021-08-05 06:22:19 +00:00
|
|
|
</div>
|
2021-08-07 22:20:46 +00:00
|
|
|
}
|
2021-07-22 21:12:27 +00:00
|
|
|
</div>
|
2021-07-23 02:24:39 +00:00
|
|
|
</section>
|
|
|
|
</div>
|
2021-07-22 21:12:27 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
2021-08-07 22:20:46 +00:00
|
|
|
</form>
|
2021-07-22 21:12:27 +00:00
|
|
|
|
2021-08-05 06:22:19 +00:00
|
|
|
<div id="content-pages" class="multipage mt-3 invisible">
|
|
|
|
<ul class="nav nav-pills selectors">
|
|
|
|
<li class="nav-item" role="presentation">
|
|
|
|
<button type="button" data-bs-toggle="pill" data-bs-target="#quick-picks-slide"><i
|
|
|
|
class="bi bi-stopwatch"></i></button>
|
|
|
|
</li>
|
|
|
|
<li class="nav-item" role="presentation">
|
|
|
|
<button type="button" data-bs-toggle="pill" data-bs-target="#results-slide"><i
|
|
|
|
class="bi bi-view-list"></i></button>
|
|
|
|
</li>
|
|
|
|
<li class="nav-item" role="presentation">
|
|
|
|
<button type="button" data-bs-toggle="pill" data-bs-target="#info-slide"><i
|
|
|
|
class="bi bi-info-lg"></i></button>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
<div class="multipage-slides tab-content">
|
|
|
|
<div class="multipage-slide tab-pane fade" id="quick-picks-slide">
|
|
|
|
<div class="multipage-title">
|
|
|
|
<h1 class="display-2"><i class="bi bi-stopwatch"></i> Quick Picks</h1>
|
|
|
|
@if (Model.SearchResults != null)
|
|
|
|
{
|
|
|
|
<p>@ContentManager.Json.quickPicks.searched</p>
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
<p>@ContentManager.Json.quickPicks.prompt</p>
|
|
|
|
}
|
|
|
|
<hr class="less-concise">
|
|
|
|
</div>
|
|
|
|
<div class="multipage-content">
|
|
|
|
@if (Model.SearchResults != null)
|
|
|
|
{
|
|
|
|
@if (Model.BestRatingPriceRatio != null)
|
|
|
|
{
|
|
|
|
<p>We found this product to have the best rating to price ratio.</p>
|
|
|
|
}
|
|
|
|
|
|
|
|
@if (Model.TopRated != null)
|
|
|
|
{
|
|
|
|
<p>This listing was the one that had the highest rating.</p>
|
|
|
|
}
|
|
|
|
|
|
|
|
@if (Model.MostPurchases != null)
|
|
|
|
{
|
|
|
|
<p>This listing has the most purchases.</p>
|
|
|
|
}
|
|
|
|
|
|
|
|
@if (Model.MostReviews != null)
|
|
|
|
{
|
|
|
|
<p>This listing had the most reviews.</p>
|
|
|
|
}
|
|
|
|
|
|
|
|
@if (Model.BestPrice != null)
|
|
|
|
{
|
2021-08-07 22:20:46 +00:00
|
|
|
<p>Here's the listing with the lowest price.</p>
|
|
|
|
<div>
|
|
|
|
@Model.BestPrice.Name
|
|
|
|
</div>
|
2021-08-05 06:22:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@* TODO: Add display for top results. *@
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
<div class="text-center less-concise text-muted flex-grow-1 justify-content-center d-flex flex-column">
|
|
|
|
<h2>@ContentManager.Json.notSearched</h2>
|
|
|
|
</div>
|
|
|
|
}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="multipage-slide tab-pane fade" id="results-slide" x-data>
|
|
|
|
<div class="multipage-title">
|
|
|
|
<h2><i class="bi bi-view-list"></i> Results</h2>
|
|
|
|
@if (Model.SearchResults != null)
|
|
|
|
{
|
|
|
|
<p>@ContentManager.Json.results.searched</p>
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
<p>@ContentManager.Json.results.prompt</p>
|
|
|
|
}
|
|
|
|
<hr class="less-concise">
|
|
|
|
</div>
|
|
|
|
<div class="multipage-content">
|
|
|
|
@if (Model.SearchResults != null)
|
|
|
|
{
|
|
|
|
@* TODO: Display results with UI for sorting and changing views. *@
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
<div class="text-center less-concise text-muted flex-grow-1 justify-content-center d-flex flex-column">
|
|
|
|
<h2>@ContentManager.Json.notSearched</h2>
|
|
|
|
</div>
|
|
|
|
}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="multipage-slide tab-pane fade" id="info-slide">
|
|
|
|
<div class="multipage-content">
|
|
|
|
<div class="less-concise text-muted flex-grow-1 justify-content-center d-flex flex-column">
|
|
|
|
<h1 class="display-3"><i class="bi bi-info-circle"></i> Get Started!</h1>
|
|
|
|
<ol>
|
|
|
|
@foreach (string instruction in ContentManager.Json.instructions)
|
|
|
|
{
|
|
|
|
<li>@instruction</li>
|
|
|
|
}
|
|
|
|
</ol>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|