fixes
This commit is contained in:
parent
19f8700b78
commit
457f3c8268
@ -103,7 +103,10 @@ impl MarketplaceController {
|
|||||||
AssetType::NFT.as_str(),
|
AssetType::NFT.as_str(),
|
||||||
AssetType::RealEstate.as_str(),
|
AssetType::RealEstate.as_str(),
|
||||||
AssetType::IntellectualProperty.as_str(),
|
AssetType::IntellectualProperty.as_str(),
|
||||||
AssetType::PhysicalAsset.as_str(),
|
AssetType::Commodity.as_str(),
|
||||||
|
AssetType::Share.as_str(),
|
||||||
|
AssetType::Bond.as_str(),
|
||||||
|
AssetType::Other.as_str(),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
render_template(&tmpl, "marketplace/listings.html", &context)
|
render_template(&tmpl, "marketplace/listings.html", &context)
|
||||||
@ -146,9 +149,22 @@ impl MarketplaceController {
|
|||||||
.take(4)
|
.take(4)
|
||||||
.collect();
|
.collect();
|
||||||
|
|
||||||
|
// Get highest bid amount and minimum bid for auction listings
|
||||||
|
let (highest_bid_amount, minimum_bid) = if listing.listing_type == ListingType::Auction {
|
||||||
|
if let Some(bid) = listing.highest_bid() {
|
||||||
|
(Some(bid.amount), bid.amount + 1.0)
|
||||||
|
} else {
|
||||||
|
(None, listing.price + 1.0)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
(None, 0.0)
|
||||||
|
};
|
||||||
|
|
||||||
context.insert("active_page", &"marketplace");
|
context.insert("active_page", &"marketplace");
|
||||||
context.insert("listing", listing);
|
context.insert("listing", listing);
|
||||||
context.insert("similar_listings", &similar_listings);
|
context.insert("similar_listings", &similar_listings);
|
||||||
|
context.insert("highest_bid_amount", &highest_bid_amount);
|
||||||
|
context.insert("minimum_bid", &minimum_bid);
|
||||||
|
|
||||||
// Add current user info for bid/purchase forms
|
// Add current user info for bid/purchase forms
|
||||||
let user_id = "user-123";
|
let user_id = "user-123";
|
||||||
@ -311,7 +327,7 @@ impl MarketplaceController {
|
|||||||
tmpl: web::Data<Tera>,
|
tmpl: web::Data<Tera>,
|
||||||
path: web::Path<String>,
|
path: web::Path<String>,
|
||||||
) -> Result<HttpResponse> {
|
) -> Result<HttpResponse> {
|
||||||
let listing_id = path.into_inner();
|
let _listing_id = path.into_inner();
|
||||||
|
|
||||||
// In a real application, we would:
|
// In a real application, we would:
|
||||||
// 1. Find the listing in the database
|
// 1. Find the listing in the database
|
||||||
@ -344,7 +360,10 @@ impl MarketplaceController {
|
|||||||
AssetType::NFT => 500.0 + (i as f64 * 100.0),
|
AssetType::NFT => 500.0 + (i as f64 * 100.0),
|
||||||
AssetType::RealEstate => 50000.0 + (i as f64 * 10000.0),
|
AssetType::RealEstate => 50000.0 + (i as f64 * 10000.0),
|
||||||
AssetType::IntellectualProperty => 2000.0 + (i as f64 * 500.0),
|
AssetType::IntellectualProperty => 2000.0 + (i as f64 * 500.0),
|
||||||
AssetType::PhysicalAsset => 1000.0 + (i as f64 * 200.0),
|
AssetType::Commodity => 1000.0 + (i as f64 * 200.0),
|
||||||
|
AssetType::Share => 300.0 + (i as f64 * 50.0),
|
||||||
|
AssetType::Bond => 1500.0 + (i as f64 * 300.0),
|
||||||
|
AssetType::Other => 800.0 + (i as f64 * 150.0),
|
||||||
};
|
};
|
||||||
|
|
||||||
let mut listing = Listing::new(
|
let mut listing = Listing::new(
|
||||||
@ -382,7 +401,10 @@ impl MarketplaceController {
|
|||||||
AssetType::NFT => 400.0 + (i as f64 * 50.0),
|
AssetType::NFT => 400.0 + (i as f64 * 50.0),
|
||||||
AssetType::RealEstate => 40000.0 + (i as f64 * 5000.0),
|
AssetType::RealEstate => 40000.0 + (i as f64 * 5000.0),
|
||||||
AssetType::IntellectualProperty => 1500.0 + (i as f64 * 300.0),
|
AssetType::IntellectualProperty => 1500.0 + (i as f64 * 300.0),
|
||||||
AssetType::PhysicalAsset => 800.0 + (i as f64 * 100.0),
|
AssetType::Commodity => 800.0 + (i as f64 * 100.0),
|
||||||
|
AssetType::Share => 250.0 + (i as f64 * 40.0),
|
||||||
|
AssetType::Bond => 1200.0 + (i as f64 * 250.0),
|
||||||
|
AssetType::Other => 600.0 + (i as f64 * 120.0),
|
||||||
};
|
};
|
||||||
|
|
||||||
let mut listing = Listing::new(
|
let mut listing = Listing::new(
|
||||||
@ -435,7 +457,10 @@ impl MarketplaceController {
|
|||||||
AssetType::NFT => 600.0 + (i as f64 * 150.0),
|
AssetType::NFT => 600.0 + (i as f64 * 150.0),
|
||||||
AssetType::RealEstate => 60000.0 + (i as f64 * 15000.0),
|
AssetType::RealEstate => 60000.0 + (i as f64 * 15000.0),
|
||||||
AssetType::IntellectualProperty => 2500.0 + (i as f64 * 600.0),
|
AssetType::IntellectualProperty => 2500.0 + (i as f64 * 600.0),
|
||||||
AssetType::PhysicalAsset => 1200.0 + (i as f64 * 300.0),
|
AssetType::Commodity => 1200.0 + (i as f64 * 300.0),
|
||||||
|
AssetType::Share => 350.0 + (i as f64 * 70.0),
|
||||||
|
AssetType::Bond => 1800.0 + (i as f64 * 350.0),
|
||||||
|
AssetType::Other => 1000.0 + (i as f64 * 200.0),
|
||||||
};
|
};
|
||||||
|
|
||||||
let listing = Listing::new(
|
let listing = Listing::new(
|
||||||
@ -469,7 +494,10 @@ impl MarketplaceController {
|
|||||||
AssetType::NFT => 550.0 + (i as f64 * 120.0),
|
AssetType::NFT => 550.0 + (i as f64 * 120.0),
|
||||||
AssetType::RealEstate => 55000.0 + (i as f64 * 12000.0),
|
AssetType::RealEstate => 55000.0 + (i as f64 * 12000.0),
|
||||||
AssetType::IntellectualProperty => 2200.0 + (i as f64 * 550.0),
|
AssetType::IntellectualProperty => 2200.0 + (i as f64 * 550.0),
|
||||||
AssetType::PhysicalAsset => 1100.0 + (i as f64 * 220.0),
|
AssetType::Commodity => 1100.0 + (i as f64 * 220.0),
|
||||||
|
AssetType::Share => 320.0 + (i as f64 * 60.0),
|
||||||
|
AssetType::Bond => 1650.0 + (i as f64 * 330.0),
|
||||||
|
AssetType::Other => 900.0 + (i as f64 * 180.0),
|
||||||
};
|
};
|
||||||
|
|
||||||
let sale_price = price * 0.95; // Slight discount on sale
|
let sale_price = price * 0.95; // Slight discount on sale
|
||||||
@ -515,7 +543,10 @@ impl MarketplaceController {
|
|||||||
AssetType::NFT => 450.0 + (i as f64 * 80.0),
|
AssetType::NFT => 450.0 + (i as f64 * 80.0),
|
||||||
AssetType::RealEstate => 45000.0 + (i as f64 * 8000.0),
|
AssetType::RealEstate => 45000.0 + (i as f64 * 8000.0),
|
||||||
AssetType::IntellectualProperty => 1800.0 + (i as f64 * 400.0),
|
AssetType::IntellectualProperty => 1800.0 + (i as f64 * 400.0),
|
||||||
AssetType::PhysicalAsset => 900.0 + (i as f64 * 180.0),
|
AssetType::Commodity => 900.0 + (i as f64 * 180.0),
|
||||||
|
AssetType::Share => 280.0 + (i as f64 * 45.0),
|
||||||
|
AssetType::Bond => 1350.0 + (i as f64 * 270.0),
|
||||||
|
AssetType::Other => 750.0 + (i as f64 * 150.0),
|
||||||
};
|
};
|
||||||
|
|
||||||
let mut listing = Listing::new(
|
let mut listing = Listing::new(
|
||||||
|
@ -35,8 +35,8 @@
|
|||||||
<select class="form-select" id="asset_id" name="asset_id" required>
|
<select class="form-select" id="asset_id" name="asset_id" required>
|
||||||
<option value="" selected disabled>Choose an asset to list</option>
|
<option value="" selected disabled>Choose an asset to list</option>
|
||||||
{% for asset in assets %}
|
{% for asset in assets %}
|
||||||
<option value="{{ asset.id }}" data-type="{{ asset.asset_type.as_str() }}" data-image="{{ asset.image_url }}">
|
<option value="{{ asset.id }}" data-type="{{ asset.asset_type }}" data-image="{{ asset.image_url }}">
|
||||||
{{ asset.name }} ({{ asset.asset_type.as_str() }})
|
{{ asset.name }} ({{ asset.asset_type }})
|
||||||
</option>
|
</option>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</select>
|
</select>
|
||||||
|
@ -116,8 +116,8 @@
|
|||||||
<h5 class="card-title">{{ listing.title }}</h5>
|
<h5 class="card-title">{{ listing.title }}</h5>
|
||||||
<p class="card-text text-truncate">{{ listing.description }}</p>
|
<p class="card-text text-truncate">{{ listing.description }}</p>
|
||||||
<div class="d-flex justify-content-between align-items-center">
|
<div class="d-flex justify-content-between align-items-center">
|
||||||
<span class="badge bg-primary">{{ listing.listing_type.as_str() }}</span>
|
<span class="badge bg-primary">{{ listing.listing_type }}</span>
|
||||||
<span class="badge bg-secondary">{{ listing.asset_type.as_str() }}</span>
|
<span class="badge bg-secondary">{{ listing.asset_type }}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="card-footer">
|
<div class="card-footer">
|
||||||
@ -178,20 +178,20 @@
|
|||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
{% if listing.asset_type.as_str() == "Token" %}
|
{% if listing.asset_type == "Token" %}
|
||||||
<span class="badge bg-primary">{{ listing.asset_type.as_str() }}</span>
|
<span class="badge bg-primary">{{ listing.asset_type }}</span>
|
||||||
{% elif listing.asset_type.as_str() == "NFT" %}
|
{% elif listing.asset_type == "NFT" %}
|
||||||
<span class="badge bg-info">{{ listing.asset_type.as_str() }}</span>
|
<span class="badge bg-info">{{ listing.asset_type }}</span>
|
||||||
{% elif listing.asset_type.as_str() == "RealEstate" %}
|
{% elif listing.asset_type == "RealEstate" %}
|
||||||
<span class="badge bg-success">Real Estate</span>
|
<span class="badge bg-success">Real Estate</span>
|
||||||
{% elif listing.asset_type.as_str() == "IntellectualProperty" %}
|
{% elif listing.asset_type == "IntellectualProperty" %}
|
||||||
<span class="badge bg-warning text-dark">IP</span>
|
<span class="badge bg-warning text-dark">IP</span>
|
||||||
{% else %}
|
{% else %}
|
||||||
<span class="badge bg-secondary">{{ listing.asset_type.as_str() }}</span>
|
<span class="badge bg-secondary">{{ listing.asset_type }}</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
<td>${{ listing.price }}</td>
|
<td>${{ listing.price }}</td>
|
||||||
<td>{{ listing.listing_type.as_str() }}</td>
|
<td>{{ listing.listing_type }}</td>
|
||||||
<td>{{ listing.seller_name }}</td>
|
<td>{{ listing.seller_name }}</td>
|
||||||
<td>{{ listing.created_at|date }}</td>
|
<td>{{ listing.created_at|date }}</td>
|
||||||
<td>
|
<td>
|
||||||
|
@ -27,15 +27,15 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<div class="d-grid gap-2">
|
<div class="d-grid gap-2">
|
||||||
{% if listing.listing_type.as_str() == "Fixed Price" %}
|
{% if listing.listing_type == "Fixed Price" %}
|
||||||
<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#purchaseModal">
|
<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#purchaseModal">
|
||||||
<i class="bi bi-cart"></i> Purchase Now
|
<i class="bi bi-cart"></i> Purchase Now
|
||||||
</button>
|
</button>
|
||||||
{% elif listing.listing_type.as_str() == "Auction" %}
|
{% elif listing.listing_type == "Auction" %}
|
||||||
<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#bidModal">
|
<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#bidModal">
|
||||||
<i class="bi bi-hammer"></i> Place Bid
|
<i class="bi bi-hammer"></i> Place Bid
|
||||||
</button>
|
</button>
|
||||||
{% elif listing.listing_type.as_str() == "Exchange" %}
|
{% elif listing.listing_type == "Exchange" %}
|
||||||
<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#offerModal">
|
<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#offerModal">
|
||||||
<i class="bi bi-arrow-left-right"></i> Make Exchange Offer
|
<i class="bi bi-arrow-left-right"></i> Make Exchange Offer
|
||||||
</button>
|
</button>
|
||||||
@ -59,16 +59,16 @@
|
|||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<p><strong>Asset Name:</strong> {{ listing.asset_name }}</p>
|
<p><strong>Asset Name:</strong> {{ listing.asset_name }}</p>
|
||||||
<p><strong>Asset Type:</strong>
|
<p><strong>Asset Type:</strong>
|
||||||
{% if listing.asset_type.as_str() == "Token" %}
|
{% if listing.asset_type == "Token" %}
|
||||||
<span class="badge bg-primary">{{ listing.asset_type.as_str() }}</span>
|
<span class="badge bg-primary">{{ listing.asset_type }}</span>
|
||||||
{% elif listing.asset_type.as_str() == "NFT" %}
|
{% elif listing.asset_type == "NFT" %}
|
||||||
<span class="badge bg-info">{{ listing.asset_type.as_str() }}</span>
|
<span class="badge bg-info">{{ listing.asset_type }}</span>
|
||||||
{% elif listing.asset_type.as_str() == "RealEstate" %}
|
{% elif listing.asset_type == "RealEstate" %}
|
||||||
<span class="badge bg-success">Real Estate</span>
|
<span class="badge bg-success">Real Estate</span>
|
||||||
{% elif listing.asset_type.as_str() == "IntellectualProperty" %}
|
{% elif listing.asset_type == "IntellectualProperty" %}
|
||||||
<span class="badge bg-warning text-dark">Intellectual Property</span>
|
<span class="badge bg-warning text-dark">Intellectual Property</span>
|
||||||
{% else %}
|
{% else %}
|
||||||
<span class="badge bg-secondary">{{ listing.asset_type.as_str() }}</span>
|
<span class="badge bg-secondary">{{ listing.asset_type }}</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</p>
|
</p>
|
||||||
<p><strong>Asset ID:</strong> <code>{{ listing.asset_id }}</code></p>
|
<p><strong>Asset ID:</strong> <code>{{ listing.asset_id }}</code></p>
|
||||||
@ -89,8 +89,11 @@
|
|||||||
Listing Details
|
Listing Details
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<span class="badge bg-{{ listing.status.as_str() == 'Active' ? 'success' : 'secondary' }}">
|
{% if listing.status == 'Active' %}
|
||||||
{{ listing.status.as_str() }}
|
<span class="badge bg-success">{{ listing.status }}</span>
|
||||||
|
{% else %}
|
||||||
|
<span class="badge bg-secondary">{{ listing.status }}</span>
|
||||||
|
{% endif %}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -100,7 +103,7 @@
|
|||||||
|
|
||||||
<div class="d-flex justify-content-between align-items-center mb-3">
|
<div class="d-flex justify-content-between align-items-center mb-3">
|
||||||
<div>
|
<div>
|
||||||
<span class="badge bg-primary">{{ listing.listing_type.as_str() }}</span>
|
<span class="badge bg-primary">{{ listing.listing_type }}</span>
|
||||||
{% if listing.featured %}
|
{% if listing.featured %}
|
||||||
<span class="badge bg-warning text-dark">Featured</span>
|
<span class="badge bg-warning text-dark">Featured</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@ -143,7 +146,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Bids Section (for Auctions) -->
|
<!-- Bids Section (for Auctions) -->
|
||||||
{% if listing.listing_type.as_str() == "Auction" %}
|
{% if listing.listing_type == "Auction" %}
|
||||||
<div class="card mb-4">
|
<div class="card mb-4">
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
<i class="bi bi-list-ol"></i>
|
<i class="bi bi-list-ol"></i>
|
||||||
@ -168,8 +171,11 @@
|
|||||||
<td>${{ bid.amount }}</td>
|
<td>${{ bid.amount }}</td>
|
||||||
<td>{{ bid.created_at|date }}</td>
|
<td>{{ bid.created_at|date }}</td>
|
||||||
<td>
|
<td>
|
||||||
<span class="badge bg-{{ bid.status.as_str() == 'Active' ? 'success' : 'secondary' }}">
|
{% if bid.status == 'Active' %}
|
||||||
{{ bid.status.as_str() }}
|
<span class="badge bg-success">{{ bid.status }}</span>
|
||||||
|
{% else %}
|
||||||
|
<span class="badge bg-secondary">{{ bid.status }}</span>
|
||||||
|
{% endif %}
|
||||||
</span>
|
</span>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@ -177,7 +183,7 @@
|
|||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<p class="mt-2"><strong>Current Highest Bid:</strong> ${{ listing.highest_bid().amount }}</p>
|
<p class="mt-2"><strong>Current Highest Bid:</strong> ${{ listing.highest_bid_amount }}</p>
|
||||||
{% else %}
|
{% else %}
|
||||||
<p>No bids yet. Be the first to bid!</p>
|
<p>No bids yet. Be the first to bid!</p>
|
||||||
<p><strong>Starting Price:</strong> ${{ listing.price }}</p>
|
<p><strong>Starting Price:</strong> ${{ listing.price }}</p>
|
||||||
@ -212,8 +218,8 @@
|
|||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<h5 class="card-title">{{ similar.title }}</h5>
|
<h5 class="card-title">{{ similar.title }}</h5>
|
||||||
<div class="d-flex justify-content-between align-items-center">
|
<div class="d-flex justify-content-between align-items-center">
|
||||||
<span class="badge bg-primary">{{ similar.listing_type.as_str() }}</span>
|
<span class="badge bg-primary">{{ similar.listing_type }}</span>
|
||||||
<span class="badge bg-secondary">{{ similar.asset_type.as_str() }}</span>
|
<span class="badge bg-secondary">{{ similar.asset_type }}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="card-footer">
|
<div class="card-footer">
|
||||||
@ -293,9 +299,9 @@
|
|||||||
<ul>
|
<ul>
|
||||||
<li>Asset: {{ listing.asset_name }}</li>
|
<li>Asset: {{ listing.asset_name }}</li>
|
||||||
<li>Starting Price: ${{ listing.price }} {{ listing.currency }}</li>
|
<li>Starting Price: ${{ listing.price }} {{ listing.currency }}</li>
|
||||||
{% if listing.highest_bid() %}
|
{% if listing.highest_bid_amount %}
|
||||||
<li>Current Highest Bid: ${{ listing.highest_bid().amount }} {{ listing.currency }}</li>
|
<li>Current Highest Bid: ${{ listing.highest_bid_amount }} {{ listing.currency }}</li>
|
||||||
<li>Minimum Bid: ${{ listing.highest_bid().amount + 1 }} {{ listing.currency }}</li>
|
<li>Minimum Bid: ${{ listing.highest_bid_amount + 1 }} {{ listing.currency }}</li>
|
||||||
{% else %}
|
{% else %}
|
||||||
<li>Minimum Bid: ${{ listing.price + 1 }} {{ listing.currency }}</li>
|
<li>Minimum Bid: ${{ listing.price + 1 }} {{ listing.currency }}</li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@ -306,7 +312,7 @@
|
|||||||
<label for="bid-amount" class="form-label">Your Bid Amount ({{ listing.currency }})</label>
|
<label for="bid-amount" class="form-label">Your Bid Amount ({{ listing.currency }})</label>
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<span class="input-group-text">$</span>
|
<span class="input-group-text">$</span>
|
||||||
<input type="number" class="form-control" id="bid-amount" name="amount" step="0.01" min="{{ listing.highest_bid() ? listing.highest_bid().amount + 1 : listing.price + 1 }}" required>
|
<input type="number" class="form-control" id="bid-amount" name="amount" step="0.01" min="{{ minimum_bid }}" required>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -78,8 +78,8 @@
|
|||||||
{% if listings|length > 0 %}
|
{% if listings|length > 0 %}
|
||||||
{% for listing in listings %}
|
{% for listing in listings %}
|
||||||
<div class="col-xl-3 col-lg-4 col-md-6 mb-4 listing-item"
|
<div class="col-xl-3 col-lg-4 col-md-6 mb-4 listing-item"
|
||||||
data-asset-type="{{ listing.asset_type.as_str() }}"
|
data-asset-type="{{ listing.asset_type }}"
|
||||||
data-listing-type="{{ listing.listing_type.as_str() }}"
|
data-listing-type="{{ listing.listing_type }}"
|
||||||
data-price="{{ listing.price }}">
|
data-price="{{ listing.price }}">
|
||||||
<div class="card h-100">
|
<div class="card h-100">
|
||||||
{% if listing.featured %}
|
{% if listing.featured %}
|
||||||
@ -96,17 +96,17 @@
|
|||||||
<h5 class="card-title">{{ listing.title }}</h5>
|
<h5 class="card-title">{{ listing.title }}</h5>
|
||||||
<p class="card-text text-truncate">{{ listing.description }}</p>
|
<p class="card-text text-truncate">{{ listing.description }}</p>
|
||||||
<div class="d-flex justify-content-between align-items-center mb-2">
|
<div class="d-flex justify-content-between align-items-center mb-2">
|
||||||
<span class="badge bg-primary">{{ listing.listing_type.as_str() }}</span>
|
<span class="badge bg-primary">{{ listing.listing_type }}</span>
|
||||||
{% if listing.asset_type.as_str() == "Token" %}
|
{% if listing.asset_type == "Token" %}
|
||||||
<span class="badge bg-primary">{{ listing.asset_type.as_str() }}</span>
|
<span class="badge bg-primary">{{ listing.asset_type }}</span>
|
||||||
{% elif listing.asset_type.as_str() == "NFT" %}
|
{% elif listing.asset_type == "NFT" %}
|
||||||
<span class="badge bg-info">{{ listing.asset_type.as_str() }}</span>
|
<span class="badge bg-info">{{ listing.asset_type }}</span>
|
||||||
{% elif listing.asset_type.as_str() == "RealEstate" %}
|
{% elif listing.asset_type == "RealEstate" %}
|
||||||
<span class="badge bg-success">Real Estate</span>
|
<span class="badge bg-success">Real Estate</span>
|
||||||
{% elif listing.asset_type.as_str() == "IntellectualProperty" %}
|
{% elif listing.asset_type == "IntellectualProperty" %}
|
||||||
<span class="badge bg-warning text-dark">IP</span>
|
<span class="badge bg-warning text-dark">IP</span>
|
||||||
{% else %}
|
{% else %}
|
||||||
<span class="badge bg-secondary">{{ listing.asset_type.as_str() }}</span>
|
<span class="badge bg-secondary">{{ listing.asset_type }}</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
<div class="d-flex justify-content-between align-items-center">
|
<div class="d-flex justify-content-between align-items-center">
|
||||||
@ -159,8 +159,8 @@
|
|||||||
{% if listings|length > 0 %}
|
{% if listings|length > 0 %}
|
||||||
{% for listing in listings %}
|
{% for listing in listings %}
|
||||||
<tr class="listing-item"
|
<tr class="listing-item"
|
||||||
data-asset-type="{{ listing.asset_type.as_str() }}"
|
data-asset-type="{{ listing.asset_type }}"
|
||||||
data-listing-type="{{ listing.listing_type.as_str() }}"
|
data-listing-type="{{ listing.listing_type }}"
|
||||||
data-price="{{ listing.price }}">
|
data-price="{{ listing.price }}">
|
||||||
<td>
|
<td>
|
||||||
<div class="d-flex align-items-center">
|
<div class="d-flex align-items-center">
|
||||||
@ -173,20 +173,20 @@
|
|||||||
</td>
|
</td>
|
||||||
<td>{{ listing.title }}</td>
|
<td>{{ listing.title }}</td>
|
||||||
<td>
|
<td>
|
||||||
{% if listing.asset_type.as_str() == "Token" %}
|
{% if listing.asset_type == "Token" %}
|
||||||
<span class="badge bg-primary">{{ listing.asset_type.as_str() }}</span>
|
<span class="badge bg-primary">{{ listing.asset_type }}</span>
|
||||||
{% elif listing.asset_type.as_str() == "NFT" %}
|
{% elif listing.asset_type == "NFT" %}
|
||||||
<span class="badge bg-info">{{ listing.asset_type.as_str() }}</span>
|
<span class="badge bg-info">{{ listing.asset_type }}</span>
|
||||||
{% elif listing.asset_type.as_str() == "RealEstate" %}
|
{% elif listing.asset_type == "RealEstate" %}
|
||||||
<span class="badge bg-success">Real Estate</span>
|
<span class="badge bg-success">Real Estate</span>
|
||||||
{% elif listing.asset_type.as_str() == "IntellectualProperty" %}
|
{% elif listing.asset_type == "IntellectualProperty" %}
|
||||||
<span class="badge bg-warning text-dark">IP</span>
|
<span class="badge bg-warning text-dark">IP</span>
|
||||||
{% else %}
|
{% else %}
|
||||||
<span class="badge bg-secondary">{{ listing.asset_type.as_str() }}</span>
|
<span class="badge bg-secondary">{{ listing.asset_type }}</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
<td>${{ listing.price }}</td>
|
<td>${{ listing.price }}</td>
|
||||||
<td>{{ listing.listing_type.as_str() }}</td>
|
<td>{{ listing.listing_type }}</td>
|
||||||
<td>{{ listing.seller_name }}</td>
|
<td>{{ listing.seller_name }}</td>
|
||||||
<td>{{ listing.created_at|date }}</td>
|
<td>{{ listing.created_at|date }}</td>
|
||||||
<td>
|
<td>
|
||||||
|
@ -58,17 +58,17 @@
|
|||||||
<td>{{ listing.title }}</td>
|
<td>{{ listing.title }}</td>
|
||||||
<td>${{ listing.price }}</td>
|
<td>${{ listing.price }}</td>
|
||||||
<td>
|
<td>
|
||||||
<span class="badge bg-primary">{{ listing.listing_type.as_str() }}</span>
|
<span class="badge bg-primary">{{ listing.listing_type }}</span>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
{% if listing.status.as_str() == "Active" %}
|
{% if listing.status == "Active" %}
|
||||||
<span class="badge bg-success">{{ listing.status.as_str() }}</span>
|
<span class="badge bg-success">{{ listing.status }}</span>
|
||||||
{% elif listing.status.as_str() == "Sold" %}
|
{% elif listing.status == "Sold" %}
|
||||||
<span class="badge bg-info">{{ listing.status.as_str() }}</span>
|
<span class="badge bg-info">{{ listing.status }}</span>
|
||||||
{% elif listing.status.as_str() == "Cancelled" %}
|
{% elif listing.status == "Cancelled" %}
|
||||||
<span class="badge bg-danger">{{ listing.status.as_str() }}</span>
|
<span class="badge bg-danger">{{ listing.status }}</span>
|
||||||
{% elif listing.status.as_str() == "Expired" %}
|
{% elif listing.status == "Expired" %}
|
||||||
<span class="badge bg-warning text-dark">{{ listing.status.as_str() }}</span>
|
<span class="badge bg-warning text-dark">{{ listing.status }}</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
<td>{{ listing.created_at|date }}</td>
|
<td>{{ listing.created_at|date }}</td>
|
||||||
@ -85,7 +85,7 @@
|
|||||||
<a href="/marketplace/{{ listing.id }}" class="btn btn-sm btn-outline-primary">
|
<a href="/marketplace/{{ listing.id }}" class="btn btn-sm btn-outline-primary">
|
||||||
<i class="bi bi-eye"></i>
|
<i class="bi bi-eye"></i>
|
||||||
</a>
|
</a>
|
||||||
{% if listing.status.as_str() == "Active" %}
|
{% if listing.status == "Active" %}
|
||||||
<form action="/marketplace/{{ listing.id }}/cancel" method="post" class="d-inline">
|
<form action="/marketplace/{{ listing.id }}/cancel" method="post" class="d-inline">
|
||||||
<button type="submit" class="btn btn-sm btn-outline-danger" onclick="return confirm('Are you sure you want to cancel this listing?')">
|
<button type="submit" class="btn btn-sm btn-outline-danger" onclick="return confirm('Are you sure you want to cancel this listing?')">
|
||||||
<i class="bi bi-x-circle"></i>
|
<i class="bi bi-x-circle"></i>
|
||||||
|
Loading…
Reference in New Issue
Block a user