Some checks failed
ci / cargo test (abacus) (push) Has been cancelled
ci / cargo test (agent-runtime) (push) Has been cancelled
ci / cargo test (context-passport) (push) Has been cancelled
ci / cargo test (game-economy) (push) Has been cancelled
ci / cargo test (ledgerline) (push) Has been cancelled
ci / cargo test (mint) (push) Has been cancelled
ci / cargo test (rago) (push) Has been cancelled
ci / cargo test (relay) (push) Has been cancelled
ci / node suites (push) Has been cancelled
ci / cargo test (toolgate) (push) Has been cancelled
ci / cargo test (turnstile) (push) Has been cancelled
ci / cargo test (vend) (push) Has been cancelled
apps/gitea -> apps/rithub-server; compose services/containers renamed (rithub-server-app/postgres/act-runner) with explicit project name and volume names pinned to the exact existing Docker volumes (no data loss); our own GITEA_* compose/env var names -> RIT_*; new rit-admin CLI wrapper on railyard-box; giteaSession.mjs/giteaOAuth.mjs/giteaInfo.mjs -> ritSession/ritOAuth/ritInfo across 6 apps; GiteaForgeAdapter -> RitForgeAdapter + giteaSyncService/importGiteaRepos/syncGiteaRepos -> rit* in ritgram (tsc clean); apps/console/lib/gitea.ts -> lib/ritProvision.ts; Go internal/giteaclient -> internal/ritclient in rithub-async-import (go build/test clean); new /auth/rit + /forges/rit/connect routes with /gitea back-compat aliases; locale/swagger/footer/captcha template text scrubbed of remaining "Gitea" strings. Deployed to railyard-box: old containers stopped/removed, /srv/railyard-gitea renamed to /srv/rithub-server with a symlink kept, docker compose up -d from the new path, act_runner network-alias fix for its persisted instance URL. Live-verified: docker compose config diff showed zero unintended value changes, DB row counts unchanged (19 users, 635 repos), full route regression 200/expected, 0 "gitea" in headers/bodies on every checked page, real git clone+push over HTTPS and SSH with a disposable account (deleted after). Deferred on purpose (documented in plans/railyard.md): the forge discriminator / DB column names / Postgres role+volume names (data migrations, not a naming change) and the upstream GITEA__ env-to-ini keys and X-Gitea-* wire headers (hardcoded in the vendored engine binary). See plans/railyard.md RIT-OPS/RIT-BRD entry for the full old->new map and live evidence. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
135 lines
11 KiB
Cheetah
135 lines
11 KiB
Cheetah
{{/*
|
|
Rithub share card — "SHARE EVERYWHERE + REASONS TO SHARE"
|
|
(plans/growth-loops-2026-11-19.md, Rithub share-everywhere row #1).
|
|
Shown once: included from templates/user/dashboard/dashboard.tmpl's
|
|
>=1-repo branch (the complement of the 0-repo "Bring your code" screen
|
|
at templates/shared/bring_your_code.tmpl) — the moment a signed-in
|
|
user's dashboard first flips from that onboarding screen to the real
|
|
dashboard IS the first time they have >=1 imported repo, so no extra
|
|
state/route is needed server-side. Client-side localStorage gate below
|
|
makes it a true one-time card (not shown again on later visits), per
|
|
the "max one share prompt per page view, dismissible" rule.
|
|
|
|
No Go fork, no new routes — template + CSS (.rithub-share-* in
|
|
theme-rithub.css) + inline JS only, same pattern as every other
|
|
apps/gitea/custom override in this repo.
|
|
|
|
Share destinations per the spec: X, LinkedIn, Bluesky, Reddit, Hacker
|
|
News, WhatsApp, Telegram, copy link, More (navigator.share). Every
|
|
link carries ?ref=<username> so rithub.dev can attribute signups back
|
|
to the sharer (see scripts/ref-count.py). Icon-only, monochrome,
|
|
no emoji, no gradients (plans/gtm/APPLE-DESIGN-RULES-2026-11-17.md).
|
|
Never posts on the user's behalf — every button opens the target
|
|
site's own share-intent URL (or the OS share sheet) for the user to
|
|
send themselves.
|
|
*/}}
|
|
<section class="rithub-share-card" id="rithub-share-card" data-username="{{.SignedUser.Name}}" data-count="{{.SignedUser.NumRepos}}" hidden>
|
|
<button type="button" class="rithub-share-card-dismiss" id="rithub-share-card-dismiss" aria-label="Dismiss" title="Dismiss">
|
|
<svg viewBox="0 -960 960 960" width="16" height="16" aria-hidden="true" focusable="false"><path fill="currentColor" d="M480-424 284-228q-11 11-28 11t-28-11q-11-11-11-28t11-28l196-196-196-196q-11-11-11-28t11-28q11-11 28-11t28 11l196 196 196-196q11-11 28-11t28 11q11 11 11 28t-11 28L536-480l196 196q11 11 11 28t-11 28q-11 11-28 11t-28-11L480-424Z"/></svg>
|
|
</button>
|
|
<div class="rithub-share-card-icon">
|
|
<svg viewBox="0 -960 960 960" width="20" height="20" aria-hidden="true" focusable="false"><path fill="currentColor" d="M199-199q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80q-83 0-156-31.5T199-199Zm78-39q21-80 85-131t118-51q54 0 118 51t85 131q45-37 71-91.5T880-480q0-166-117-283T480-880q-166 0-283 117T80-480q0 60 26 114.5t71 91.5Z"/></svg>
|
|
</div>
|
|
<p class="rithub-share-card-text" id="rithub-share-card-text"></p>
|
|
<div class="rithub-share-row" role="group" aria-label="Share">
|
|
<a class="rithub-share-btn" data-share="x" href="#" target="_blank" rel="noopener noreferrer" aria-label="Share on X" title="X">
|
|
<svg viewBox="0 0 24 24" width="16" height="16" aria-hidden="true" focusable="false"><path fill="currentColor" d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"/></svg>
|
|
</a>
|
|
<a class="rithub-share-btn" data-share="linkedin" href="#" target="_blank" rel="noopener noreferrer" aria-label="Share on LinkedIn" title="LinkedIn">
|
|
<svg viewBox="0 0 24 24" width="16" height="16" aria-hidden="true" focusable="false"><path fill="currentColor" d="M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433a2.062 2.062 0 1 1 0-4.124 2.062 2.062 0 0 1 0 4.124zM7.114 20.452H3.558V9h3.556v11.452z"/></svg>
|
|
</a>
|
|
<a class="rithub-share-btn" data-share="bluesky" href="#" target="_blank" rel="noopener noreferrer" aria-label="Share on Bluesky" title="Bluesky">
|
|
<svg viewBox="0 0 24 24" width="16" height="16" aria-hidden="true" focusable="false"><path fill="currentColor" d="M12 10.8C10.74 8.3 7.26 3.6 4.2 1.5 1.26-0.5 0.18 0.15 0.4 1.6 0.63 3.05 1.5 9.65 2.1 11.7 3 15 6 16.5 8.8 16.2 6 16.6 3.6 17.7 2.7 20.8c1.5 1 4.7 0.6 7.3-3 2.6 3.6 5.8 4 7.3 3-0.9-3.1-3.3-4.2-6.1-4.6 2.8 0.3 5.8-1.2 6.7-4.5 0.6-2.05 1.47-8.65 1.7-10.1 0.22-1.45-0.86-2.1-3.8-0.1C16.74 3.6 13.26 8.3 12 10.8Z"/></svg>
|
|
</a>
|
|
<a class="rithub-share-btn" data-share="reddit" href="#" target="_blank" rel="noopener noreferrer" aria-label="Share on Reddit" title="Reddit">
|
|
<svg viewBox="0 0 24 24" width="16" height="16" aria-hidden="true" focusable="false"><path fill="currentColor" d="M12 2a1.75 1.75 0 0 0-1.75 1.75c0 .68.39 1.27.96 1.56l-.4 1.9C8.4 7.4 6.3 8.47 4.78 9.9A1.5 1.5 0 1 0 3.9 12.5c.06 0 .12 0 .18-.01A5.9 5.9 0 0 0 4 14c0 3.31 3.58 6 8 6s8-2.69 8-6a5.9 5.9 0 0 0-.08-1.51c.06.01.12.01.18.01a1.5 1.5 0 1 0-.88-2.6c-1.52-1.43-3.62-2.5-5.98-2.74l-.36-1.7c.75-.19 1.3-.87 1.3-1.7A1.75 1.75 0 0 0 12 2Zm-3 9.5a1.25 1.25 0 1 1 0 2.5 1.25 1.25 0 0 1 0-2.5Zm6 0a1.25 1.25 0 1 1 0 2.5 1.25 1.25 0 0 1 0-2.5Zm-6.2 4.1a.5.5 0 0 1 .7.1c.4.52 1.35.9 2.5.9s2.1-.38 2.5-.9a.5.5 0 1 1 .8.6c-.6.78-1.86 1.3-3.3 1.3s-2.7-.52-3.3-1.3a.5.5 0 0 1 .1-.7Z"/></svg>
|
|
</a>
|
|
<a class="rithub-share-btn" data-share="hn" href="#" target="_blank" rel="noopener noreferrer" aria-label="Share on Hacker News" title="Hacker News">
|
|
<svg viewBox="0 0 24 24" width="16" height="16" aria-hidden="true" focusable="false"><path fill="currentColor" d="M1.5 2h21l-7.5 13.09V22h-6v-6.91z"/></svg>
|
|
</a>
|
|
<a class="rithub-share-btn" data-share="whatsapp" href="#" target="_blank" rel="noopener noreferrer" aria-label="Share on WhatsApp" title="WhatsApp">
|
|
<svg viewBox="0 0 24 24" width="16" height="16" aria-hidden="true" focusable="false"><path fill="currentColor" d="M17.47 14.38c-.3-.15-1.76-.87-2.03-.97-.27-.1-.47-.15-.67.15-.2.3-.77.97-.95 1.17-.17.2-.35.22-.65.07-1.77-.88-2.93-1.57-4.1-3.57-.31-.53.31-.49.88-1.64.1-.2.05-.37-.05-.52-.1-.15-.67-1.62-.92-2.22-.25-.6-.5-.52-.67-.52-.17 0-.37-.02-.57-.02s-.52.07-.8.37c-.27.3-1.05 1.02-1.05 2.5s1.08 2.9 1.23 3.1c.15.2 2.08 3.18 5.05 4.33 2.97 1.15 2.97.77 3.5.72.53-.05 1.73-.7 1.98-1.37.25-.67.25-1.25.17-1.37-.07-.12-.27-.2-.57-.37ZM12.02 2C6.5 2 2 6.47 2 12c0 2.02.6 3.9 1.63 5.47L2 22l4.72-1.52A9.95 9.95 0 0 0 12.02 22c5.52 0 10-4.47 10-10s-4.48-10-10-10Zm0 18.17c-1.8 0-3.47-.55-4.87-1.5l-.35-.22-3.03.97.98-2.95-.23-.37A8.17 8.17 0 0 1 3.83 12c0-4.52 3.67-8.17 8.19-8.17 4.5 0 8.17 3.65 8.17 8.17 0 4.52-3.67 8.17-8.17 8.17Z"/></svg>
|
|
</a>
|
|
<a class="rithub-share-btn" data-share="telegram" href="#" target="_blank" rel="noopener noreferrer" aria-label="Share on Telegram" title="Telegram">
|
|
<svg viewBox="0 0 24 24" width="16" height="16" aria-hidden="true" focusable="false"><path fill="currentColor" d="M21.9 4.1c-.3-.25-.75-.3-1.3-.1L2.9 10.6c-.55.2-.6.5-.6.7 0 .2.1.5.65.72l4.5 1.5 1.75 5.65c.1.3.3.45.55.47.03 0 .07.01.1.01.2 0 .4-.1.55-.27l2.5-2.6 4.6 3.4c.15.12.35.2.55.2.13 0 .27-.03.4-.1.25-.13.42-.37.47-.65l3.1-15c.08-.47-.08-.85-.37-1.03Z"/></svg>
|
|
</a>
|
|
<button class="rithub-share-btn" type="button" data-share="copy" aria-label="Copy link" title="Copy link">
|
|
<svg class="rithub-share-copy-icon" viewBox="0 -960 960 960" width="16" height="16" aria-hidden="true" focusable="false"><path fill="currentColor" d="M360-240q-33 0-56.5-23.5T280-320v-480q0-33 23.5-56.5T360-880h360q33 0 56.5 23.5T800-800v480q0 33-23.5 56.5T720-240H360Zm0-80h360v-480H360v480ZM200-80q-33 0-56.5-23.5T120-160v-560h80v560h440v80H200Z"/></svg>
|
|
<svg class="rithub-share-copied-icon" viewBox="0 -960 960 960" width="16" height="16" aria-hidden="true" focusable="false" hidden><path fill="currentColor" d="M382-240 154-468l57-57 171 171 367-367 57 57-424 424Z"/></svg>
|
|
</button>
|
|
<button class="rithub-share-btn" type="button" id="rithub-share-more" aria-label="More share options" title="More" hidden>
|
|
<svg viewBox="0 -960 960 960" width="16" height="16" aria-hidden="true" focusable="false"><path fill="currentColor" d="M440-200v-376L336-472l-56-56 200-200 200 200-56 56-104-104v376h-80ZM240-80q-33 0-56.5-23.5T160-160v-120h80v120h480v-120h80v120q0 33-23.5 56.5T720-80H240Z"/></svg>
|
|
</button>
|
|
</div>
|
|
</section>
|
|
<script>
|
|
(function () {
|
|
try {
|
|
var card = document.getElementById('rithub-share-card');
|
|
if (!card) return;
|
|
var KEY = 'rithub.shareCardSeen';
|
|
if (window.localStorage && window.localStorage.getItem(KEY) === '1') return;
|
|
var username = card.getAttribute('data-username') || '';
|
|
var count = parseInt(card.getAttribute('data-count'), 10) || 1;
|
|
var shareUrl = 'https://rithub.dev/?ref=' + encodeURIComponent(username);
|
|
var text = count > 1
|
|
? ('I moved ' + count + ' repos off GitHub in one click — Rithub')
|
|
: 'I moved my repo off GitHub in one click — Rithub';
|
|
var textEl = document.getElementById('rithub-share-card-text');
|
|
if (textEl) textEl.textContent = text;
|
|
var links = {
|
|
x: 'https://x.com/intent/post?url=' + encodeURIComponent(shareUrl) + '&text=' + encodeURIComponent(text),
|
|
linkedin: 'https://www.linkedin.com/sharing/share-offsite/?url=' + encodeURIComponent(shareUrl),
|
|
bluesky: 'https://bsky.app/intent/compose?text=' + encodeURIComponent(text + ' ' + shareUrl),
|
|
reddit: 'https://www.reddit.com/submit?url=' + encodeURIComponent(shareUrl) + '&title=' + encodeURIComponent(text),
|
|
hn: 'https://news.ycombinator.com/submitlink?u=' + encodeURIComponent(shareUrl) + '&t=' + encodeURIComponent(text),
|
|
whatsapp: 'https://wa.me/?text=' + encodeURIComponent(text + ' ' + shareUrl),
|
|
telegram: 'https://t.me/share/url?url=' + encodeURIComponent(shareUrl) + '&text=' + encodeURIComponent(text)
|
|
};
|
|
Array.prototype.forEach.call(card.querySelectorAll('[data-share]'), function (el) {
|
|
var key = el.getAttribute('data-share');
|
|
if (links[key]) el.setAttribute('href', links[key]);
|
|
});
|
|
function markSeen() {
|
|
try { window.localStorage.setItem(KEY, '1'); } catch (e) {}
|
|
}
|
|
var copyBtn = card.querySelector('[data-share="copy"]');
|
|
if (copyBtn) {
|
|
copyBtn.addEventListener('click', function () {
|
|
if (navigator.clipboard && navigator.clipboard.writeText) {
|
|
navigator.clipboard.writeText(shareUrl).catch(function () {});
|
|
}
|
|
copyBtn.setAttribute('data-copied', '1');
|
|
var icon1 = copyBtn.querySelector('.rithub-share-copy-icon');
|
|
var icon2 = copyBtn.querySelector('.rithub-share-copied-icon');
|
|
if (icon1) icon1.hidden = true;
|
|
if (icon2) icon2.hidden = false;
|
|
setTimeout(function () {
|
|
copyBtn.removeAttribute('data-copied');
|
|
if (icon1) icon1.hidden = false;
|
|
if (icon2) icon2.hidden = true;
|
|
}, 1500);
|
|
});
|
|
}
|
|
var moreBtn = document.getElementById('rithub-share-more');
|
|
if (moreBtn && navigator.share) {
|
|
moreBtn.hidden = false;
|
|
moreBtn.addEventListener('click', function () {
|
|
navigator.share({ title: 'Rithub', text: text, url: shareUrl }).catch(function () {});
|
|
});
|
|
}
|
|
var dismiss = document.getElementById('rithub-share-card-dismiss');
|
|
if (dismiss) {
|
|
dismiss.addEventListener('click', function () {
|
|
markSeen();
|
|
card.hidden = true;
|
|
});
|
|
}
|
|
Array.prototype.forEach.call(card.querySelectorAll('[data-share]'), function (el) {
|
|
el.addEventListener('click', markSeen);
|
|
});
|
|
card.hidden = false;
|
|
} catch (e) {}
|
|
})();
|
|
</script>
|