| [09ecc5f] | 1 | <div class="container admin-page">
|
|---|
| [bbf9d1a] | 2 | <h1><%= t('agoog.title') %></h1>
|
|---|
| 3 | <p><a href="/admin/settings" class="btn">← <%= t('agoog.back') %></a></p>
|
|---|
| [09ecc5f] | 4 |
|
|---|
| 5 | <% if (success) { %><div class="alert alert-success"><%= success %></div><% } %>
|
|---|
| 6 | <% if (typeof error !== 'undefined' && error) { %><div class="alert alert-error"><%= error %></div><% } %>
|
|---|
| 7 |
|
|---|
| 8 | <section class="set-card">
|
|---|
| [bbf9d1a] | 9 | <h2><%= t('agoog.card_title') %></h2>
|
|---|
| [c1b757d] | 10 | <p class="set-help"><%- t('agoog.intro') %>
|
|---|
| [bbf9d1a] | 11 | <% if (google && google.configured) { %><strong><%= t('agoog.status_set') %></strong><% } else { %><%= t('agoog.status_unset') %><% } %></p>
|
|---|
| [09ecc5f] | 12 |
|
|---|
| [c1b757d] | 13 | <ol class="gg-steps">
|
|---|
| 14 | <li>
|
|---|
| 15 | <span class="gg-num">1</span>
|
|---|
| 16 | <div class="gg-body"><%- t('agoog.g1') %> <a href="https://console.cloud.google.com/" target="_blank" rel="noopener">Google Cloud Console ↗</a></div>
|
|---|
| 17 | </li>
|
|---|
| 18 | <li>
|
|---|
| 19 | <span class="gg-num">2</span>
|
|---|
| 20 | <div class="gg-body"><%- t('agoog.g2') %></div>
|
|---|
| 21 | </li>
|
|---|
| 22 | <li>
|
|---|
| 23 | <span class="gg-num">3</span>
|
|---|
| 24 | <div class="gg-body"><%- t('agoog.g3') %></div>
|
|---|
| 25 | </li>
|
|---|
| 26 | <li>
|
|---|
| 27 | <span class="gg-num">4</span>
|
|---|
| 28 | <div class="gg-body">
|
|---|
| 29 | <%- t('agoog.g4') %>
|
|---|
| 30 | <% if (google && google.redirectUri) { %>
|
|---|
| 31 | <div class="gg-redirect">
|
|---|
| 32 | <code class="gg-url"><%= google.redirectUri %></code>
|
|---|
| 33 | <button type="button" class="btn gg-copy" data-copy="<%= google.redirectUri %>"><%= t('agoog.copy') %></button>
|
|---|
| 34 | </div>
|
|---|
| 35 | <p class="gg-warn"><%- t('agoog.warn_short') %></p>
|
|---|
| 36 | <% } else { %>
|
|---|
| 37 | <p class="gg-warn" style="color:var(--accent)"><%- t('agoog.need_baseurl') %></p>
|
|---|
| 38 | <% } %>
|
|---|
| 39 | </div>
|
|---|
| 40 | </li>
|
|---|
| 41 | <li>
|
|---|
| 42 | <span class="gg-num">5</span>
|
|---|
| 43 | <div class="gg-body"><%- t('agoog.g5') %></div>
|
|---|
| 44 | </li>
|
|---|
| 45 | </ol>
|
|---|
| 46 | <p class="gg-tip"><%- t('agoog.no_api_note') %></p>
|
|---|
| [09ecc5f] | 47 |
|
|---|
| 48 | <form method="post" action="/admin/settings/google" class="set-form">
|
|---|
| 49 | <label class="set-field">
|
|---|
| [bbf9d1a] | 50 | <span><%= t('agoog.client_id') %></span>
|
|---|
| [09ecc5f] | 51 | <input type="text" name="google_client_id" value="<%= google ? google.clientId : '' %>" placeholder="123-abc.apps.googleusercontent.com" autocomplete="off">
|
|---|
| 52 | </label>
|
|---|
| 53 | <label class="set-field">
|
|---|
| [bbf9d1a] | 54 | <span><%= t('agoog.client_secret') %> <% if (google && google.secretSet) { %><small style="font-weight:400">— <%= t('agoog.client_secret_set') %></small><% } %></span>
|
|---|
| 55 | <input type="password" name="google_client_secret" placeholder="<%= (google && google.secretSet) ? t('agoog.secret_ph_set') : 'GOCSPX-…' %>" autocomplete="off">
|
|---|
| [09ecc5f] | 56 | </label>
|
|---|
| 57 | <div class="set-actions">
|
|---|
| [bbf9d1a] | 58 | <button type="submit" class="btn btn-primary"><%= t('agoog.save') %></button>
|
|---|
| [09ecc5f] | 59 | <% if (google && (google.clientId || google.secretSet)) { %>
|
|---|
| [bbf9d1a] | 60 | <button type="submit" name="clear" value="1" class="btn"><%= t('agoog.disconnect') %></button>
|
|---|
| [09ecc5f] | 61 | <% } %>
|
|---|
| 62 | </div>
|
|---|
| 63 | </form>
|
|---|
| 64 | <% if (typeof premiumEnabled !== 'undefined' && premiumEnabled && !isPremium) { %>
|
|---|
| [bbf9d1a] | 65 | <p class="set-help" style="margin-top:.7rem; color:var(--accent)"><%= t('agoog.premium_locked') %></p>
|
|---|
| [09ecc5f] | 66 | <% } %>
|
|---|
| 67 | </section>
|
|---|
| 68 | </div>
|
|---|
| 69 |
|
|---|
| 70 | <style>
|
|---|
| 71 | .admin-page { max-width: 700px; margin: 3rem auto; padding: 0 1rem; }
|
|---|
| 72 | .admin-page h1 { font-family: var(--font-display, serif); font-size: 2rem; margin: 0 0 0.75rem; }
|
|---|
| 73 | .set-card { background: var(--paper-2); border: 1px solid var(--rule); border-radius: 12px; padding: 1.25rem; }
|
|---|
| 74 | .set-card h2 { font-family: var(--font-display, serif); font-size: 1.25rem; margin: 0 0 0.5rem; }
|
|---|
| 75 | .set-help { color: var(--ink-muted); font-size: 0.9rem; margin: 0 0 1.25rem; }
|
|---|
| 76 | .set-google-guide { margin: 0 0 1rem; border: 1px solid var(--rule); border-radius: 8px; background: var(--paper); }
|
|---|
| 77 | .set-google-guide > summary { cursor: pointer; padding: 0.6rem 0.85rem; font-size: 0.9rem; font-weight: 600; color: var(--accent); list-style: none; }
|
|---|
| 78 | .set-google-guide > summary::-webkit-details-marker { display: none; }
|
|---|
| 79 | .set-google-guide > summary::before { content: "▸ "; }
|
|---|
| 80 | .set-google-guide[open] > summary::before { content: "▾ "; }
|
|---|
| 81 | .set-google-steps { margin: 0; padding: 0 1rem 0.6rem 2rem; font-size: 0.88rem; color: var(--ink); line-height: 1.5; }
|
|---|
| 82 | .set-google-steps li { margin: 0.35rem 0; }
|
|---|
| 83 | .set-google-guide code { background: var(--paper-2); padding: 0.05rem 0.35rem; border-radius: 4px; font-size: 0.85em; }
|
|---|
| 84 | .set-google-guide .set-help { padding: 0 0.85rem; }
|
|---|
| 85 | .set-form { display: flex; flex-direction: column; gap: 1rem; max-width: 460px; }
|
|---|
| 86 | .set-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.25rem; }
|
|---|
| 87 | .set-field { display: flex; flex-direction: column; gap: 0.3rem; }
|
|---|
| 88 | .set-field > span { font-size: 0.8rem; font-weight: 600; color: var(--ink-soft, var(--ink-muted)); }
|
|---|
| 89 | .set-field input {
|
|---|
| 90 | width: 100%; box-sizing: border-box; padding: 0.55rem 0.7rem;
|
|---|
| 91 | border: 1px solid var(--rule); border-radius: 6px; background: var(--paper); color: var(--ink);
|
|---|
| 92 | font: inherit; font-size: 0.95rem;
|
|---|
| 93 | }
|
|---|
| 94 | .set-field input:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
|
|---|
| 95 | .alert { padding: 0.75rem 1rem; border-radius: 6px; margin-bottom: 1rem; }
|
|---|
| 96 | .alert-success { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
|
|---|
| [3ca24f9] | 97 | .set-redirect { border: 1px solid var(--accent); border-radius: 10px; padding: 1rem; margin: 0 0 1.25rem; background: var(--paper); }
|
|---|
| 98 | .set-redirect-label { font-weight: 700; font-size: 0.9rem; margin-bottom: 0.5rem; }
|
|---|
| 99 | .set-redirect-url { display: block; padding: 0.6rem 0.8rem; background: var(--paper-2); border: 1px dashed var(--rule); border-radius: 6px; font-size: 0.9rem; word-break: break-all; }
|
|---|
| 100 | .set-redirect-steps { margin: 0.85rem 0 0; padding-left: 1.3rem; font-size: 0.9rem; line-height: 1.55; color: var(--ink); }
|
|---|
| 101 | .set-redirect-steps li { margin: 0.3rem 0; }
|
|---|
| 102 | .set-redirect-steps a { color: var(--accent); }
|
|---|
| 103 | .set-redirect-warn { margin: 0.85rem 0 0; font-size: 0.85rem; color: var(--ink-muted); }
|
|---|
| 104 | .set-redirect-warn code { background: var(--paper-2); padding: 0.05rem 0.35rem; border-radius: 4px; }
|
|---|
| [c1b757d] | 105 | /* Genummerde, altijd-zichtbare stap-voor-stap-uitleg (beginnervriendelijk) */
|
|---|
| 106 | .gg-steps { list-style: none; margin: 0 0 1rem; padding: 0; display: flex; flex-direction: column; gap: 0.85rem; }
|
|---|
| 107 | .gg-steps > li { display: flex; gap: 0.7rem; align-items: flex-start; }
|
|---|
| 108 | .gg-num { flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 700; font-size: 0.85rem; display: inline-flex; align-items: center; justify-content: center; }
|
|---|
| 109 | .gg-body { font-size: 0.92rem; line-height: 1.5; color: var(--ink); padding-top: 2px; min-width: 0; }
|
|---|
| 110 | .gg-body code { background: var(--paper-2); padding: 0.05rem 0.35rem; border-radius: 4px; font-size: 0.88em; }
|
|---|
| 111 | .gg-redirect { display: flex; gap: 0.5rem; align-items: stretch; margin: 0.5rem 0 0.3rem; flex-wrap: wrap; }
|
|---|
| 112 | .gg-url { flex: 1 1 220px; min-width: 0; padding: 0.5rem 0.7rem; background: var(--paper-2); border: 1px dashed var(--accent); border-radius: 6px; font-size: 0.85rem; word-break: break-all; align-self: center; }
|
|---|
| 113 | .gg-copy { flex: 0 0 auto; }
|
|---|
| 114 | .gg-warn { font-size: 0.82rem; color: var(--ink-muted); margin: 0.3rem 0 0; }
|
|---|
| 115 | .gg-tip { font-size: 0.85rem; color: var(--ink-muted); background: var(--paper); border: 1px solid var(--rule); border-radius: 8px; padding: 0.6rem 0.8rem; margin: 0 0 1.25rem; }
|
|---|
| [09ecc5f] | 116 | </style>
|
|---|
| [c1b757d] | 117 | <script>
|
|---|
| 118 | (function () {
|
|---|
| 119 | if (window.__ggCopyWired) return;
|
|---|
| 120 | window.__ggCopyWired = true;
|
|---|
| 121 | document.addEventListener('click', function (e) {
|
|---|
| 122 | var b = e.target.closest && e.target.closest('.gg-copy');
|
|---|
| 123 | if (!b) return;
|
|---|
| 124 | e.preventDefault();
|
|---|
| 125 | var txt = b.getAttribute('data-copy') || '';
|
|---|
| 126 | var done = function () { var o = b.getAttribute('data-label') || b.textContent; b.setAttribute('data-label', o); b.textContent = '<%= t('agoog.copied') %>'; setTimeout(function () { b.textContent = o; }, 1500); };
|
|---|
| 127 | if (navigator.clipboard && navigator.clipboard.writeText) { navigator.clipboard.writeText(txt).then(done, function () {}); }
|
|---|
| 128 | else { try { var ta = document.createElement('textarea'); ta.value = txt; document.body.appendChild(ta); ta.select(); document.execCommand('copy'); ta.remove(); done(); } catch (_) {} }
|
|---|
| 129 | });
|
|---|
| 130 | })();
|
|---|
| 131 | </script>
|
|---|