feat(connexions): ecran d'aide a la premiere connexion (app/templates/onboarding.html)
This commit is contained in:
@@ -0,0 +1,77 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="fr" data-theme="dark">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="csrf-token" content="{{ csrf_token }}">
|
||||
<title>Connecter ton gestionnaire de sources — Kanbante</title>
|
||||
<link rel="stylesheet" href="/static/css/style.css?v={{ version }}">
|
||||
</head>
|
||||
<body>
|
||||
{% include "_header.html" %}
|
||||
|
||||
<main class="focus-main">
|
||||
<div class="page-head">
|
||||
<h1>Bienvenue dans Kanbante</h1>
|
||||
<p class="page-sub">Kanbante affiche les tableaux Kanban des dépôts de <strong>ton</strong> gestionnaire de sources. Aucune connexion n'est encore configurée pour ton compte : connecte la tienne pour commencer — elle ne servira qu'à toi.</p>
|
||||
</div>
|
||||
{% if msg %}<p class="chip-ok">{{ msg }}</p>{% endif %}
|
||||
{% if err %}<p class="chip-warn">{{ err }}</p>{% endif %}
|
||||
|
||||
<section class="briefing-card">
|
||||
<h2>Comment ça marche</h2>
|
||||
<ol>
|
||||
<li><strong>Choisis ta forge</strong> : Gitea (par exemple l'instance de la suite, <code>{{ gitea_base }}</code>) ou GitHub.</li>
|
||||
<li><strong>Crée un jeton d'accès</strong> dans ta forge, avec la portée « repo » (lecture et écriture des dépôts et des issues). Les boutons ci-dessous ouvrent directement la bonne page.</li>
|
||||
<li><strong>Colle le jeton ici</strong> : on teste la connexion avant de l'enregistrer. Le jeton est chiffré au repos et ne sera jamais réaffiché ; tu pourras le remplacer ou supprimer la connexion depuis ton profil.</li>
|
||||
</ol>
|
||||
<p>
|
||||
<a class="btn-mini" href="{{ gitea_base }}/user/settings/applications" target="_blank" rel="noopener">Créer un jeton Gitea</a>
|
||||
<a class="btn-mini" href="https://github.com/settings/tokens/new?scopes=repo&description=Kanbante" target="_blank" rel="noopener">Créer un jeton GitHub</a>
|
||||
</p>
|
||||
</section>
|
||||
|
||||
<section class="briefing-card">
|
||||
<h2>Ta première connexion</h2>
|
||||
<form method="post" action="/onboarding/connect" class="admin-form">
|
||||
<input type="hidden" name="csrf_token" value="{{ csrf_token }}">
|
||||
<label>Type
|
||||
<select name="kind" id="ob-kind">
|
||||
<option value="gitea" {% if form.get('kind') != 'github' %}selected{% endif %}>Gitea</option>
|
||||
<option value="github" {% if form.get('kind') == 'github' %}selected{% endif %}>GitHub</option>
|
||||
</select>
|
||||
</label>
|
||||
<label>Nom <input type="text" name="name" id="ob-name" value="{{ form.get('name', '') }}" placeholder="Mon Gitea"></label>
|
||||
<label>URL de base <input type="text" name="base_url" id="ob-url" required value="{{ form.get('base_url', '') }}" placeholder="{{ gitea_base }}"></label>
|
||||
<label>Jeton d'accès <input type="password" name="token" required autocomplete="off"></label>
|
||||
<button type="submit" class="btn-save btn-inline">Tester et connecter</button>
|
||||
</form>
|
||||
<p class="muted">Après la connexion, tes dépôts apparaîtront ici même. Tu pourras ajouter d'autres forges depuis ton profil (« Mes connexions personnelles »).</p>
|
||||
</section>
|
||||
</main>
|
||||
<script>
|
||||
// Pré-remplissage selon la forge choisie : l'instance
|
||||
// Gitea de la suite, ou l'API publique GitHub.
|
||||
(function () {
|
||||
var kind = document.getElementById("ob-kind");
|
||||
var url = document.getElementById("ob-url");
|
||||
var name = document.getElementById("ob-name");
|
||||
var gitea = "{{ gitea_base }}";
|
||||
function sync() {
|
||||
if (!url.value) {
|
||||
url.value = kind.value === "github" ? "https://api.github.com" : gitea;
|
||||
}
|
||||
if (!name.value) {
|
||||
name.value = kind.value === "github" ? "Mon GitHub" : "Mon Gitea";
|
||||
}
|
||||
}
|
||||
kind.addEventListener("change", function () {
|
||||
url.value = "";
|
||||
name.value = "";
|
||||
sync();
|
||||
});
|
||||
sync();
|
||||
})();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user