Release/ArtigosPDF #22
@ -162,7 +162,7 @@ jobs:
|
|||||||
|
|
||||||
# Build para a plataforma correta
|
# Build para a plataforma correta
|
||||||
if [ "${{ steps.settings.outputs.deploy_target }}" = "production" ]; then
|
if [ "${{ steps.settings.outputs.deploy_target }}" = "production" ]; then
|
||||||
# Build para produção (main branch)
|
# Build para produção (main branch) - Usa Configuration=Release (padrão)
|
||||||
docker buildx build \
|
docker buildx build \
|
||||||
--platform ${{ steps.settings.outputs.platform }} \
|
--platform ${{ steps.settings.outputs.platform }} \
|
||||||
--file ${{ steps.settings.outputs.dockerfile }} \
|
--file ${{ steps.settings.outputs.dockerfile }} \
|
||||||
@ -171,12 +171,13 @@ jobs:
|
|||||||
--progress=plain \
|
--progress=plain \
|
||||||
.
|
.
|
||||||
else
|
else
|
||||||
# Build para staging (Release branches)
|
# Build para staging (Release branches) - Usa Configuration=Testing para habilitar código de teste
|
||||||
docker buildx build \
|
docker buildx build \
|
||||||
--platform ${{ steps.settings.outputs.platform }} \
|
--platform ${{ steps.settings.outputs.platform }} \
|
||||||
--file ${{ steps.settings.outputs.dockerfile }} \
|
--file ${{ steps.settings.outputs.dockerfile }} \
|
||||||
--tag ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.settings.outputs.tag }} \
|
--tag ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.settings.outputs.tag }} \
|
||||||
--push \
|
--push \
|
||||||
|
--build-arg BUILD_CONFIGURATION=Testing \
|
||||||
--build-arg VERSION=${{ steps.settings.outputs.version || 'latest' }} \
|
--build-arg VERSION=${{ steps.settings.outputs.version || 'latest' }} \
|
||||||
--build-arg COMMIT=${{ steps.settings.outputs.commit }} \
|
--build-arg COMMIT=${{ steps.settings.outputs.commit }} \
|
||||||
--progress=plain \
|
--progress=plain \
|
||||||
|
|||||||
@ -5,15 +5,17 @@ EXPOSE 8080
|
|||||||
EXPOSE 8443
|
EXPOSE 8443
|
||||||
|
|
||||||
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
|
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
|
||||||
|
ARG BUILD_CONFIGURATION=Release
|
||||||
WORKDIR /src
|
WORKDIR /src
|
||||||
COPY ["src/BCards.Web/BCards.Web.csproj", "src/BCards.Web/"]
|
COPY ["src/BCards.Web/BCards.Web.csproj", "src/BCards.Web/"]
|
||||||
RUN dotnet restore "src/BCards.Web/BCards.Web.csproj"
|
RUN dotnet restore "src/BCards.Web/BCards.Web.csproj"
|
||||||
COPY . .
|
COPY . .
|
||||||
WORKDIR "/src/src/BCards.Web"
|
WORKDIR "/src/src/BCards.Web"
|
||||||
RUN dotnet build "BCards.Web.csproj" -c Release -o /app/build
|
RUN dotnet build "BCards.Web.csproj" -c ${BUILD_CONFIGURATION} -o /app/build
|
||||||
|
|
||||||
FROM build AS publish
|
FROM build AS publish
|
||||||
RUN dotnet publish "BCards.Web.csproj" -c Release -o /app/publish /p:UseAppHost=false
|
ARG BUILD_CONFIGURATION=Release
|
||||||
|
RUN dotnet publish "BCards.Web.csproj" -c ${BUILD_CONFIGURATION} -o /app/publish /p:UseAppHost=false
|
||||||
|
|
||||||
FROM base AS final
|
FROM base AS final
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|||||||
@ -572,6 +572,13 @@ builder.Services.AddHttpClient<CriticalServicesHealthCheck>(client =>
|
|||||||
client.DefaultRequestHeaders.Add("User-Agent", "BCards-CriticalCheck/1.0");
|
client.DefaultRequestHeaders.Add("User-Agent", "BCards-CriticalCheck/1.0");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
builder.Services.AddHsts(options =>
|
||||||
|
{
|
||||||
|
options.MaxAge = TimeSpan.FromDays(365);
|
||||||
|
options.IncludeSubDomains = true;
|
||||||
|
options.Preload = true;
|
||||||
|
});
|
||||||
|
|
||||||
var app = builder.Build();
|
var app = builder.Build();
|
||||||
|
|
||||||
app.UseForwardedHeaders();
|
app.UseForwardedHeaders();
|
||||||
|
|||||||
@ -239,6 +239,35 @@
|
|||||||
</h2>
|
</h2>
|
||||||
<div id="collapseDocuments" class="accordion-collapse collapse" aria-labelledby="headingDocuments" data-bs-parent="#pageWizard">
|
<div id="collapseDocuments" class="accordion-collapse collapse" aria-labelledby="headingDocuments" data-bs-parent="#pageWizard">
|
||||||
<div class="accordion-body">
|
<div class="accordion-body">
|
||||||
|
@if (!Model.AllowDocumentUpload)
|
||||||
|
{
|
||||||
|
<!-- Alerta amarelo APENAS para quem NÃO tem Premium -->
|
||||||
|
<div class="alert alert-warning border-start border-4 border-warning d-flex align-items-start mb-4">
|
||||||
|
<i class="fas fa-crown me-3 mt-1 text-warning" style="font-size: 1.2rem;"></i>
|
||||||
|
<div class="flex-grow-1">
|
||||||
|
<h6 class="mb-1 fw-bold">
|
||||||
|
<i class="fas fa-file-pdf me-1"></i> Anexar PDFs é exclusivo dos planos Premium
|
||||||
|
</h6>
|
||||||
|
<p class="mb-2 small text-muted">
|
||||||
|
Compartilhe apresentações, catálogos, portfólios e documentos diretamente na sua página profissional.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<div class="d-flex align-items-center gap-2 flex-wrap mb-3">
|
||||||
|
<span class="badge bg-light text-dark border">
|
||||||
|
<i class="fas fa-check-circle text-success me-1"></i> Plano Premium: até 5 PDFs
|
||||||
|
</span>
|
||||||
|
<span class="badge bg-light text-dark border">
|
||||||
|
<i class="fas fa-check-circle text-success me-1"></i> Plano Premium + Afiliados: até 10 PDFs
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<a asp-controller="Home" asp-action="Pricing" class="btn btn-warning btn-sm">
|
||||||
|
<i class="fas fa-arrow-up me-1"></i>Fazer upgrade e desbloquear PDFs
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
|
||||||
@if (Model.AllowDocumentUpload)
|
@if (Model.AllowDocumentUpload)
|
||||||
{
|
{
|
||||||
<p class="text-muted mb-3">Anexe PDFs com apresentações, catálogos ou materiais exclusivos para quem acessar sua página Premium.</p>
|
<p class="text-muted mb-3">Anexe PDFs com apresentações, catálogos ou materiais exclusivos para quem acessar sua página Premium.</p>
|
||||||
@ -2594,6 +2623,63 @@
|
|||||||
@:}
|
@:}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ========================================
|
||||||
|
// Sistema de Confirmação ao Sair da Página
|
||||||
|
// ========================================
|
||||||
|
let formChanged = false;
|
||||||
|
let isSubmitting = false;
|
||||||
|
|
||||||
|
$(document).ready(function() {
|
||||||
|
// Marcar formulário como alterado quando qualquer campo mudar
|
||||||
|
$('form :input').on('change input', function() {
|
||||||
|
if (!isSubmitting) {
|
||||||
|
formChanged = true;
|
||||||
|
console.log('Formulário alterado detectado');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// Quando submeter o formulário, desabilitar aviso
|
||||||
|
$('form').on('submit', function() {
|
||||||
|
console.log('Formulário submetido - desabilitando avisos');
|
||||||
|
isSubmitting = true;
|
||||||
|
formChanged = false;
|
||||||
|
});
|
||||||
|
|
||||||
|
// Aviso ao tentar fechar/recarregar a página
|
||||||
|
window.addEventListener('beforeunload', function(e) {
|
||||||
|
if (formChanged && !isSubmitting) {
|
||||||
|
console.log('beforeunload: Tentativa de sair com alterações não salvas');
|
||||||
|
e.preventDefault();
|
||||||
|
e.returnValue = ''; // Chrome requer isso
|
||||||
|
return 'Você tem alterações não salvas. Deseja realmente sair?';
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// Interceptar cliques em links de navegação (incluindo Dashboard)
|
||||||
|
$(document).on('click', 'a:not(.no-confirm)', function(e) {
|
||||||
|
if (formChanged && !isSubmitting) {
|
||||||
|
const href = $(this).attr('href');
|
||||||
|
|
||||||
|
// Não avisar para links externos, âncoras ou JavaScript
|
||||||
|
if (href && !href.startsWith('#') && !href.startsWith('javascript:')) {
|
||||||
|
console.log('Link clicado com alterações não salvas:', href);
|
||||||
|
|
||||||
|
if (!confirm('Você tem alterações não salvas. Deseja realmente sair desta página?')) {
|
||||||
|
e.preventDefault();
|
||||||
|
console.log('Usuário cancelou navegação');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Usuário confirmou, permitir navegação
|
||||||
|
console.log('Usuário confirmou saída');
|
||||||
|
formChanged = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
console.log('Sistema de confirmação ao sair inicializado');
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user