MarseyWorld/files/templates/modals/award.html

114 lines
5.0 KiB
HTML

<script defer src="{{'js/award_modal.js' | asset}}"></script>
<div class="modal fade" id="awardModal" tabindex="-1">
<div class="modal-dialog modal-dialog-scrollable modal-dialog-centered awardmodal">
<div class="modal-content">
<div class="modal-header d-mob-none">
<h5 class="modal-title">Give Award</h5>
<button type="button" class="close" data-bs-dismiss="modal">
<span><i class="fas fa-times"></i></span>
</button>
</div>
<div id="awardModalBody" class="modal-body pt-2 mb-3" style="overflow-x: hidden">
<div id="award-tabs" class="row pt-1 pb-4" style="justify-content: center">
<button id="effect-content-tab" class="btn btn-primary btn-block m-0 shop-tab award-tab active" data-nonce="{{g.nonce}}" data-onclick="switchAwardTab()">
<span class="mr-auto ml-auto"><i class="fas fa-gift mr-2"></i>EFFECT ON CONTENT</span>
</button>
<button id="effect-author-tab" class="btn btn-primary btn-block m-0 shop-tab award-tab" data-nonce="{{g.nonce}}" data-onclick="switchAwardTab()">
<span class="mr-auto ml-auto"><i class="fas fa-gift mr-2"></i>EFFECT ON AUTHOR</span>
</button>
<button type="button" class="close d-md-none pl-3 pr-2" data-bs-dismiss="modal">
<span><i class="fas fa-times"></i></span>
</button>
</div>
<div class="awards-wrapper" style="text-align:center">
{% macro iterate_awards(awards) %}
{% for award in awards %}
{% set price = (award.price*v.award_discount)|int %}
{% if v.house.endswith(' Founder') and award.kind in ("earlylife", "rainbow", "sharpen", "owoify", "bite") %}
{% set price = (price*0.75)|int %}
{% endif %}
{% if award.kind == 'grass' %}
{% set currency = 'coins' %}
{% elif award.kind == 'benefactor' %}
{% set currency = 'marseybux' %}
{% else %}
{% set currency = 'coins/marseybux' %}
{% endif %}
<div data-bs-toggle="tooltip" data-bs-placement="bottom" title="Price: <s>{{award.price | commas}}</s> {{price | commas}} {{currency}} - {{award.description}}" id="{{award.kind}}" data-positive="{{award.positive}}" data-nonce="{{g.nonce}}" data-onclick="pick('{{award.kind}}', {{price}}, {{v.coins}}, {{v.marseybux}})" data-bs-html="true">
<i class="{{award.icon}} {{award.color}}"></i>
<div class="pt-1 award-name">{{award.title}}</div>
<span id="{{award.kind}}-owned" class="d-none">{{award.owned}}</span>
<div id="{{award.kind}}-owned-block" class="text-muted award-owned">
{% if award.owned %}
{{award.owned}} owned
{% else %}
Price: {{price | commas}}
{% endif %}
</div>
</div>
{% endfor %}
{% endmacro %}
<div id="effect-content-section" class="award-section">
{{iterate_awards(v.awards_content_effect)}}
</div>
<div id="effect-author-section" class="award-section d-none">
{{iterate_awards(v.awards_author_effect)}}
</div>
</div>
<input autocomplete="off" id="kind" hidden>
<div id="phrase_section" class="d-none mb-3">
<label for="note" class="pt-4">The phrase the recipient will have to say:</label>
<div class="input-group">
<select autocomplete="off" id='chud_phrase' class="form-control">
{% for entry in CHUD_PHRASES %}
<option value="{{entry}}">
{{entry}}
</option>
{% endfor %}
</select>
</div>
</div>
<div class="row pt-1">
<div id="note_section" class="col mb-3">
<label id="notelabel" for="note">Note (optional):</label>
<textarea autocomplete="off" id="note" maxlength="200" class="form-control" placeholder="Note to include in award notification..."></textarea>
{{macros.emoji_btn('note', 'awardModal')}}
{{macros.gif_btn('note', 'awardModal')}}
</div>
<div id="emoji_behavior_section" class="col d-none mb-3 pb-3">
<label id="emoji_behavior_label" for="emoji_behavior">Emoji behavior:</label>
<div class="input-group">
<select autocomplete="off" id='emoji_behavior' class="form-control pr-2" style="min-height:35px;min-width:min(300px,80vw)">
<option value="bouncing">
bouncing
</option>
<option value="horizontal">
horizontal
</option>
</select>
</div>
</div>
</div>
<button type="button" id="giveaward" class="awardbtn btn btn-primary fl-r" data-nonce="{{g.nonce}}" data-onclick="giveaward(this)" data-bs-dismiss="modal">Give Award</button>
<button type="button" id="buyandgiveaward" class="awardbtn btn btn-primary fl-r d-none" data-nonce="{{g.nonce}}" data-areyousure="giveaward(this)" data-onclick="areyousure(this)" data-dismiss="modal">Give Award</button>
<input autocomplete="off" type="number" step="any" min="1" max="30" inputmode="numeric" id="award_quantity" class="form-control d-inline-block mr-1 fl-r text-center" style="width:40px" value="1" required>
<span id="award_price" class="fl-r mt-2 mr-3 text-small-sm"></span>
</div>
</div>
</div>
</div>