templates/user_profile/opened-crates.html.twig line 1
{% extends 'base.html.twig' %}
{% block title %}Profile{% endblock %}
{% block body %}
<div class="grid-container fluid full-width" style="padding: 50px 0 50px 0;">
<div class="grid-x grid-padding-y grid-padding-x">
<div class="small-12 cell">
<div class="grid-container" style="max-width: 1200px;">
<div class="grid-x">
<div class="small-12 large-2 cell" style="text-align: center;">
<img class="user-profile-avatar" style="display: block;" src="{{ asset('build/images/web/icon-profile-otter.png') }}" />
<h2 style="text-align: center; padding: 0; margin: 0;">{{ user.username ? user.username : '' }}</h2>
{% if user.activeWallet is defined and user.activeWallet.address is defined %}
<a href="https://explorer.thetatoken.org/account/{{ user.activeWallet.address }}" target="_blank"><span style="font-weight: normal; font-size: 1em; color: #999; font-family: sans-serif;">{{ user.activeWallet.address ? user.activeWallet.address|slice(0,6) ~ '...' ~ user.activeWallet.address|slice(37,42) : '' }}</span></a>
{% endif %}
</div>
<div class="small-12 large-8 cell">
<div class="grid-x">
<div class="small-12 large-offset-1 cell">
<span class='family-orgovan' style="font-size: 3em;">{{ user.experience|number_format(0,'.',',') }}</span>
<span style="font-size: 2em; font-weight: bold; color: goldenrod;"> <em>{{ currentRank }}</em></span>
</div>
<div class="small-12 large-offset-1 cell">
<div class="grid-x">
{% set luck, distance, tension = 0, 3, 0 %}
{% for gear in userGear %}
<div class="small-12 large-1 cell" style="padding:5px;">
{% if gear.inventoryEquipment is not null %}
{% set luck = luck + gear.inventoryEquipment.statStar %}
{% set distance = distance + gear.inventoryEquipment.statRectangle %}
{% set tension = tension + gear.inventoryEquipment.statCircle %}
<img style="border-radius: 10px;" src="{{ asset('https://tinyknightgames.s3.us-east-2.amazonaws.com' ~ gear.inventoryEquipment.template.imageUrl) }}" alt="{{ gear.inventoryEquipment.template.name }}"/></a>
{% endif %}
{% if gear.nftMetadata is not null %}
{% set luck = luck + gear.nftMetadata.statStar %}
{% set distance = distance + gear.nftMetadata.statRectangle %}
{% set tension = tension + gear.nftMetadata.statCircle %}
{% if gear.nftMetadata.nftMetadataQuest.progress > gear.nftMetadata.nftMetadataQuest.goal %}
{% set luck = luck + gear.nftMetadata.nftMetadataQuest.statStarMod %}
{% set distance = distance + gear.nftMetadata.nftMetadataQuest.statRectangleMod %}
{% set tension = tension + gear.nftMetadata.nftMetadataQuest.statCircleMod %}
{% endif %}
<a href="{{ path('explorer_asset_detail', { id: gear.nftMetadata.nftHub.id }) }}"><img style="border:3px solid #fff; border-radius: 7px;" src="{{ asset(gear.nftMetadata.imageUrl) }}" alt="{{ gear.nftMetadata.name }}"/></a>
{% endif %}
</div>
{% endfor %}
<div class="small-12 large-5 end cell"></div>
<div class="small-12 large-2 cell">
<div style="background: purple; margin: 5px; padding: 5px; border-radius: 5px; font-size: .9em; font-weight: bold; text-align: center;">
L: {{ luck }}
</div>
</div>
<div class="small-12 large-2 cell">
<div style="background: purple; margin: 5px; padding: 5px; border-radius: 5px; font-size: .9em; font-weight: bold; text-align: center;">
D: {{ distance }}
</div>
</div>
<div class="small-12 large-2 cell">
<div style="background: purple; margin: 5px; padding: 5px; border-radius: 5px; font-size: .9em; font-weight: bold; text-align: center;">
T: {{ tension }}
</div>
</div>
</div>
</div>
<div class="small-12 large-offset-1 cell" style="background: #222; border-radius: 10px; padding: 15px; margin-top: 15px;">
<div class="grid-container">
<div class="grid-x">
{% if userRecords is not null %}
<div class="small-12 large-3">
<p class="user-profile-record-num">{{ userRecords.totalCaught ? userRecords.totalCaught|number_format(0,'.',',') : 0 }}</p>
<p class="user-profile-record-label">Caught</p>
</div>
<div class="small-12 large-3">
<p class="user-profile-record-num">{{ userRecords.totalSalvaged ? userRecords.totalSalvaged|number_format(0,'.',',') : 0 }}</p>
<p class="user-profile-record-label">Salvaged</p>
</div>
<div class="small-12 large-3">
<p class="user-profile-record-num">{{ userRecords.totalCrafted ? userRecords.totalCrafted|number_format(0,'.',',') : 0 }}</p>
<p class="user-profile-record-label">Crafted Items</p>
</div>
<div class="small-12 large-3">
<p class="user-profile-record-num">{{ userRecords.totalConverted ? userRecords.totalConverted|number_format(0,'.',',') : 0 }}</p>
<p class="user-profile-record-label">Converted to NFT</p>
</div>
{% endif %}
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="grid-container" style="margin-top: 50px; margin-bottom: 50px;">
<div class="grid-x" >
<div class="small-12 medium-2 cell">
<ul class="vertical menu">
<li><a href="{{ path('user_profile', { userId: user.id, domain: app_domain }) }}">NFT Inventory</a></li>
<li><a href="{{ path('user_profile_crates', { userId: user.id, domain: app_domain }) }}">Ancient Crates</a></li>
<li><a href="{{ path('user_profile_opened_crates', { userId: user.id, domain: app_domain }) }}">Opened Crates</a></li>
<li>Market</li>
<li><a href="{{ path('user_sent_offers', { userId: user.id }) }}">Sent Offers</a></li>
<li><a href="{{ path('user_received_offers', { userId: user.id }) }}">Received Offers</a></li>
<li><a href="{{ path('user_active_listings', { userId: user.id }) }}">Active Listings</a></li>
<li><a href="{{ path('user_sold_listings', { userId: user.id }) }}">Sold Listings</a></li>
<li><a href="{{ path('user_purchased_listings', { userId: user.id }) }}">Purchased Listings</a></li>
<li><a href="{{ path('user_withdrawal_history', { userId: user.id }) }}">Withdrawal History</a></li>
</ul>
</div>
<div class="small-12 medium-10 cell">
<turbo-frame>
<div class="grid-x">
<div class="small-12 cell">
<h2>Opened Ancient Crates ({{ openedNftCrates|length }})</h2>
</div>
{% if openedNftCrates is empty %}
<div class="small-12 cell">
<p>You do not have any opened Ancient Crates. Earn crates by playing <em>Occult of the Oculi</em>.</p>
</div>
{% else %}
{% for crate in openedNftCrates %}
<div class="small-12 medium-4 cell">
<div style="padding: 5px; background: #302737; border-radius:3px; margin-bottom: 5px;">
<a href="{{ path('explorer_asset_detail', { id: crate.nftHub.id }) }}"><img style="height: 50px; width: 50px; margin-right: 10px;" src="https://tinyknightgames.s3.us-east-2.amazonaws.com/public/template/nft/Crate.png" /></a>
<span style="font-weight: bold;">{{ crate.openedBy.user.username is defined ? crate.openedBy.user.username|slice(0,10) : crate.openedBy.address|slice(0,6) }}</span>
</div>
</div>
<div class="small-12 medium-1 cell" style="text-align: center; padding-top: 20px;">
<svg xmlns="http://www.w3.org/2000/svg" width="23.828" height="14.769" style=" margin: 0 5px; filter: invert(96%) sepia(78%) saturate(2%) hue-rotate(181deg) brightness(111%) contrast(100%);"><path d="m13.616 2.828 2.585 2.586H0v4h16.143l-2.527 2.526 2.828 2.829 7.384-7.384L16.444 0l-2.828 2.828z"/></svg>
</div>
<div class="small-12 medium-6 cell">
<div style="padding: 5px; background: #302737; border-radius:3px; margin-bottom: 5px;">
{% for nft in crate.nftHub.children %}
<a href="{{ path('explorer_asset_detail', { id: nft.id}) }}"><img style="height: 50px; width: 50px; margin-right: 10px;" src="{{ nft.nftMetadata.imageUrl }}" /></a>
<span style="font-weight: bold; font-color: #f2f2f2;">#{{ nft.nftMetadata.mint }}</span> {{ nft.nftMetadata.name|slice(0,24) ~ '...' }}
{% endfor %}
</div>
</div>
{% endfor %}
{% endif %}
</div>
</turbo-frame>
</div>
</div>
</div>
{% endblock %}