83 lines
2.9 KiB
Plaintext
83 lines
2.9 KiB
Plaintext
@using QRRapidoApp.Services
|
|
@model dynamic
|
|
@inject AdDisplayService AdService
|
|
@{
|
|
var userId = User?.FindFirst(System.Security.Claims.ClaimTypes.NameIdentifier)?.Value;
|
|
var showAds = await AdService.ShouldShowAds(userId);
|
|
var position = ViewBag.position ?? Model?.position ?? "header";
|
|
}
|
|
|
|
@if (showAds)
|
|
{
|
|
@switch (position)
|
|
{
|
|
case "header":
|
|
<div class="ad-container ad-header mb-4">
|
|
<div class="ad-label">Publicidade</div>
|
|
<ins class="adsbygoogle"
|
|
style="display:inline-block;width:728px;height:90px"
|
|
data-ad-client="ca-pub-XXXXXXXXXX"
|
|
data-ad-slot="XXXXXXXXXX"></ins>
|
|
</div>
|
|
break;
|
|
|
|
case "sidebar":
|
|
<div class="ad-container ad-sidebar mb-4">
|
|
<div class="ad-label">Publicidade</div>
|
|
<ins class="adsbygoogle"
|
|
style="display:inline-block;width:300px;height:250px"
|
|
data-ad-client="ca-pub-XXXXXXXXXX"
|
|
data-ad-slot="YYYYYYYYYY"></ins>
|
|
</div>
|
|
break;
|
|
|
|
case "footer":
|
|
<div class="ad-container ad-footer mt-5 mb-4">
|
|
<div class="ad-label">Publicidade</div>
|
|
<ins class="adsbygoogle"
|
|
style="display:inline-block;width:728px;height:90px"
|
|
data-ad-client="ca-pub-XXXXXXXXXX"
|
|
data-ad-slot="ZZZZZZZZZZ"></ins>
|
|
</div>
|
|
break;
|
|
|
|
case "content":
|
|
<div class="ad-container ad-content my-4">
|
|
<div class="ad-label">Publicidade</div>
|
|
<ins class="adsbygoogle"
|
|
style="display:block"
|
|
data-ad-client="ca-pub-XXXXXXXXXX"
|
|
data-ad-slot="WWWWWWWWWW"
|
|
data-ad-format="auto"
|
|
data-full-width-responsive="true"></ins>
|
|
</div>
|
|
break;
|
|
}
|
|
|
|
<script>
|
|
(adsbygoogle = window.adsbygoogle || []).push({});
|
|
</script>
|
|
}
|
|
else if (User.Identity.IsAuthenticated)
|
|
{
|
|
var isPremium = await AdService.HasValidPremiumSubscription(userId);
|
|
if (isPremium)
|
|
{
|
|
<!-- Premium User Message -->
|
|
<div class="alert alert-success ad-free-notice mb-3">
|
|
<i class="fas fa-crown text-warning"></i>
|
|
<span><strong>✨ Usuário Premium - Sem anúncios!</strong></span>
|
|
</div>
|
|
}
|
|
else
|
|
{
|
|
<!-- Upgrade to Premium Message -->
|
|
<div class="alert alert-info upgrade-notice mb-3">
|
|
<i class="fas fa-star text-warning"></i>
|
|
<span><strong>Faça upgrade para Premium e remova os anúncios!</strong></span>
|
|
<a href="/Premium/Upgrade" class="btn btn-sm btn-warning ms-2">
|
|
<i class="fas fa-crown"></i> Premium: Sem anúncios + Histórico + QR ilimitados
|
|
</a>
|
|
</div>
|
|
}
|
|
} |