Download app/templates/verify.html from ed29/xertify: direct link, hf CLI and curl.
- Browser
- Download file 7.96 kB
-
https://huggingface.co/spaces/ed29/xertify/resolve/main/app/templates/verify.html
- Command line
-
hf download hf://spaces/ed29/xertify/app/templates/verify.html
-
curl -L -o verify.html https://huggingface.co/spaces/ed29/xertify/resolve/main/app/templates/verify.html
7.96 kB
| <html lang="es"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1"> | |
| <title>Diploma Verificado</title> | |
| <style> | |
| body { | |
| margin: 0; | |
| font-family: "Segoe UI", sans-serif; | |
| background: linear-gradient(120deg, #0f172a, #1e293b); | |
| color: #e2e8f0; | |
| display: flex; | |
| justify-content: center; | |
| align-items: flex-start; | |
| padding-top: 40px; | |
| min-height: 100vh; | |
| } | |
| .card { | |
| background: #0f172a; | |
| border-radius: 14px; | |
| width: 90%; | |
| max-width: 600px; | |
| padding: 2rem 2.5rem; | |
| box-shadow: 0 0 35px rgba(0, 0, 0, 0.45); | |
| animation: fadeIn 0.5s ease-out; | |
| } | |
| h2 { | |
| text-align: center; | |
| font-size: 26px; | |
| margin-top: 0; | |
| margin-bottom: 18px; | |
| color: #34d399; | |
| } | |
| .field { | |
| margin: 10px 0; | |
| font-size: 15px; | |
| } | |
| .label { | |
| font-weight: 600; | |
| color: #93c5fd; | |
| } | |
| .value { | |
| color: #f1f5f9; | |
| } | |
| .copy-btn { | |
| display: inline-block; | |
| margin-top: 25px; | |
| margin-left: 12px; | |
| background: #10b981; | |
| padding: 12px 18px; | |
| color: #fff; | |
| border: none; | |
| border-radius: 8px; | |
| font-weight: 700; | |
| cursor: pointer; | |
| transition: 0.15s; | |
| font-size: 13px; | |
| } | |
| .copy-btn:hover { | |
| background: #059669; | |
| transform: translateY(-2px); | |
| } | |
| .toast { | |
| position: fixed; | |
| right: 20px; | |
| bottom: 20px; | |
| background: rgba(0, 0, 0, 0.85); | |
| color: #fff; | |
| padding: 10px 14px; | |
| border-radius: 8px; | |
| box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4); | |
| font-weight: 600; | |
| z-index: 1100; | |
| opacity: 0; | |
| transform: translateY(8px); | |
| transition: all 220ms ease; | |
| } | |
| .toast.show { | |
| opacity: 1; | |
| transform: translateY(0); | |
| } | |
| a.download { | |
| display: inline-block; | |
| margin-top: 25px; | |
| background: #3b82f6; | |
| padding: 12px 18px; | |
| color: #fff; | |
| text-decoration: none; | |
| border-radius: 8px; | |
| font-weight: 600; | |
| transition: 0.2s; | |
| text-align: center; | |
| } | |
| a.download:hover { | |
| background: #2563eb; | |
| transform: translateY(-2px); | |
| } | |
| @keyframes fadeIn { | |
| from { | |
| opacity: 0; | |
| transform: translateY(20px); | |
| } | |
| to { | |
| opacity: 1; | |
| transform: translateY(0); | |
| } | |
| } | |
| /* Responsive tweaks */ | |
| @media (max-width: 680px) { | |
| body { padding: 12px; align-items: flex-start; } | |
| .card { width: 100%; max-width: 100%; padding: 1rem; box-sizing: border-box; } | |
| h2 { font-size: 20px; } | |
| .copy-btn, a.download { padding: 10px 12px; font-size: 14px; } | |
| } | |
| </style> | |
| </head> | |
| <body> | |
| <div class="card"> | |
| <h2>Diploma verificado ✔️</h2> | |
| <p class="field"><span class="label">Nombre:</span> <span class="value" data-field="student_name">{{ student_name | |
| }}</span></p> | |
| <p class="field"><span class="label">Cédula:</span> <span class="value" data-field="student_id">{{ student_id | |
| }}</span></p> | |
| <p class="field"><span class="label">Centro:</span> <span class="value" data-field="center_name">{{ center_name | |
| }}</span></p> | |
| <p class="field"><span class="label">Nombre del Título Obtenido:</span> <span class="value" data-field="title">{{ | |
| title }}</span></p> | |
| <p class="field"><span class="label">Año de la Graduación:</span> <span class="value" | |
| data-field="graduation_year">{{ graduation_year }}</span></p> | |
| <p class="field"><span class="label">Número de registro:</span> <span class="value" | |
| data-field="registration_number">{{ registration_number }}</span></p> | |
| <p class="field"><span class="label">Director:</span> <span class="value" data-field="director">{{ director | |
| }}</span></p> | |
| <p class="field"><span class="label">Directora provincial:</span> <span class="value" | |
| data-field="provincial_director">{{ provincial_director }}</span></p> | |
| <p class="field"><span class="label">Profesor:</span> <span class="value" data-field="professor">{{ professor | |
| }}</span></p> | |
| <!--<p class="field"><span class="label">ID:</span> <span class="value">{{ diploma_id }}</span></p>--> | |
| {% if pdf_url %} | |
| <p class="field"><span class="label">Adjunto PDF:</span> | |
| <span class="value" data-field="pdf"> | |
| {% if pdf_url %} | |
| <a class="download" href="{{ pdf_url }}">Ver PDF adjunto</a> | |
| {% elif pdf %} | |
| {{ pdf }} | |
| {% else %} | |
| (sin adjunto) | |
| {% endif %} | |
| </span> | |
| </p> | |
| {% endif %} | |
| <div style="margin-top:8px; display:flex; gap:10px; align-items:center;"> | |
| <a class="download" href="{{ download_url }}">Descargar PDF (seguro)</a> | |
| <button class="copy-btn" id="copy-all-btn" type="button" title="Copiar resumen">Copiar resumen</button> | |
| </div> | |
| </div> | |
| <script> | |
| function showTempMessage(btn, msg = 'Copiado!', timeout = 1400) { | |
| const old = btn.textContent; | |
| btn.textContent = msg; | |
| setTimeout(() => btn.textContent = old, timeout); | |
| } | |
| async function copyText(text, btn) { | |
| const old = btn.textContent; | |
| try { | |
| if (navigator.clipboard && navigator.clipboard.writeText) { | |
| await navigator.clipboard.writeText(text); | |
| } else { | |
| const ta = document.createElement('textarea'); | |
| ta.value = text; | |
| ta.setAttribute('readonly', ''); | |
| ta.style.position = 'fixed'; | |
| ta.style.left = '-9999px'; | |
| document.body.appendChild(ta); | |
| ta.select(); | |
| document.execCommand('copy'); | |
| document.body.removeChild(ta); | |
| } | |
| showTempMessage(btn); | |
| } catch (err) { | |
| console.error('Copy failed', err); | |
| btn.textContent = 'Error'; | |
| setTimeout(() => btn.textContent = old, 1400); | |
| } | |
| } | |
| // Build the summary text from visible data-fields | |
| function buildSummary() { | |
| const map = [ | |
| ['Nombre del Estudiante', 'student_name'], | |
| ['Cédula', 'student_id'], | |
| ['Centro de Enseñanza Superior', 'center_name'], | |
| ['Nombre del Título Obtenido', 'title'], | |
| ['Año de la Graduación', 'graduation_year'], | |
| ['Número de Registro', 'registration_number'], | |
| ['Director del Centro Educativo', 'director'], | |
| ['Directora Provincial', 'provincial_director'], | |
| ['Profesor', 'professor'], | |
| ['Adjunto PDF', 'pdf'] | |
| ]; | |
| const parts = []; | |
| map.forEach(([label, key]) => { | |
| const el = document.querySelector(`[data-field='${key}']`); | |
| if (el && el.textContent && el.textContent.trim()) parts.push(`${label}: ${el.textContent.trim()}`); | |
| }); | |
| return parts.join('\n'); | |
| } | |
| // show a small toast notification | |
| function showToast(text, timeout = 1400) { | |
| let t = document.getElementById('copy-toast'); | |
| if (!t) { | |
| t = document.createElement('div'); | |
| t.id = 'copy-toast'; | |
| t.className = 'toast'; | |
| document.body.appendChild(t); | |
| } | |
| t.textContent = text; | |
| t.classList.add('show'); | |
| setTimeout(() => t.classList.remove('show'), timeout); | |
| } | |
| const copyAll = document.getElementById('copy-all-btn'); | |
| if (copyAll) { | |
| copyAll.addEventListener('click', function () { | |
| const text = buildSummary(); | |
| if (!text) { showToast('No hay datos para copiar'); return; } | |
| copyText(text, this); | |
| showToast('Resumen copiado'); | |
| }); | |
| } | |
| // top button that also copies the same summary (if present) | |
| const topBtn = document.getElementById('copy-top-btn'); | |
| if (topBtn) { | |
| topBtn.addEventListener('click', function () { | |
| const text = buildSummary(); | |
| if (!text) { showToast('No hay datos para copiar'); return; } | |
| copyText(text, this); | |
| showToast('Datos copiados'); | |
| }); | |
| } | |
| </script> | |
| </body> | |
| </html> |