Menu "Ganti password" menjadi "Pengaturan" + panduan menghubungkan akun Google

- Menu profil kini "Pengaturan" (ikon settings); halaman berjudul Pengaturan dengan
  kartu Akun Google di atas kartu Ganti password.
- Masuk dengan Google yang belum terhubung tidak lagi berupa galat merah: halaman login
  menampilkan pengumuman langkah (masuk NIP/NPM → Pengaturan → Hubungkan akun Google),
  dan masuk NIP/NPM dari halaman itu langsung diteruskan ke Pengaturan #akun-google.
- Uji: pengumuman, penerusan ke Pengaturan, label menu.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Power BI Dev
2026-10-18 08:44:23 +07:00
co-authored by Claude Opus 5.5
parent 080f6bf9ab
commit 602a9c98b9
5 changed files with 59 additions and 28 deletions
+19 -19
View File
@@ -1,14 +1,30 @@
{% extends "base.html" %}
{% import "_ui.html" as ui %}
{% block judul %}Akun — RPS &amp; Portofolio UNTAN{% endblock %}
{% block judul %}Pengaturan — RPS &amp; Portofolio UNTAN{% endblock %}
{% block halaman_judul %}
{{ ui.judul_halaman('Akun Saya', sub=user.nama ~ ' · ' ~ user.username) }}
{{ ui.judul_halaman('Pengaturan', sub=user.nama ~ ' · ' ~ user.username) }}
{% endblock %}
{% block isi %}
<div class="row"><div class="col-lg-6">
{% if pesan %}{% call ui.alert('success') %}{{ pesan }}{% endcall %}{% endif %}
{% if galat %}{% call ui.alert('danger') %}{{ galat }}{% endcall %}{% endif %}
<div class="card">
{% if google_aktif %}
<div class="card mb-6" id="akun-google">
{{ ui.card_header('Akun Google', sub='Masuk tanpa password memakai akun Google kampus (@' ~ google_domain ~ ' dan subdomainnya). Login NIP/NPM tetap bisa dipakai.', ikon='brand-google') }}
<div class="card-body">
{% if google_terhubung %}
<p class="mb-4"><span class="badge bg-label-success me-2"><i class="icon-base ti tabler-circle-check icon-xs"></i> Terhubung</span>{{ email_akun }}</p>
<form method="post" action="/akun/google/putus" onsubmit="return confirm('Putus akun Google? Anda tetap bisa masuk dengan NIP/NPM dan password.')">
<button class="btn btn-label-danger" type="submit"><i class="icon-base ti tabler-unlink icon-sm me-1"></i>Putus akun Google</button>
</form>
{% else %}
<p class="mb-4 text-body-secondary">Belum terhubung.{% if email_akun %} Email terdaftar: <b>{{ email_akun }}</b> — masuk dengan Google memakai email ini akan terhubung otomatis.{% endif %}</p>
<a class="btn btn-primary" href="/auth/google?tujuan=hubung"><i class="icon-base ti tabler-brand-google icon-sm me-1"></i>Hubungkan akun Google</a>
{% endif %}
</div>
</div>
{% endif %}
<div class="card" id="akun-password">
{{ ui.card_header('Ganti password', sub='Password awal sama dengan NIP/NPM. Sebaiknya segera diganti.', ikon='key') }}
<div class="card-body">
<form method="post" action="/akun">
@@ -28,21 +44,5 @@
</form>
</div>
</div>
{% if google_aktif %}
<div class="card mt-6" id="akun-google">
{{ ui.card_header('Akun Google', sub='Masuk tanpa password memakai akun Google kampus (@' ~ google_domain ~ ' dan subdomainnya). Login NIP/NPM tetap bisa dipakai.', ikon='brand-google') }}
<div class="card-body">
{% if google_terhubung %}
<p class="mb-4"><span class="badge bg-label-success me-2"><i class="icon-base ti tabler-circle-check icon-xs"></i> Terhubung</span>{{ email_akun }}</p>
<form method="post" action="/akun/google/putus" onsubmit="return confirm('Putus akun Google? Anda tetap bisa masuk dengan NIP/NPM dan password.')">
<button class="btn btn-label-danger" type="submit"><i class="icon-base ti tabler-unlink icon-sm me-1"></i>Putus akun Google</button>
</form>
{% else %}
<p class="mb-4 text-body-secondary">Belum terhubung.{% if email_akun %} Email terdaftar: <b>{{ email_akun }}</b> — masuk dengan Google memakai email ini akan terhubung otomatis.{% endif %}</p>
<a class="btn btn-primary" href="/auth/google?tujuan=hubung"><i class="icon-base ti tabler-brand-google icon-sm me-1"></i>Hubungkan akun Google</a>
{% endif %}
</div>
</div>
{% endif %}
</div></div>
{% endblock %}