terms: per-term installer visibility toggles + universal delete (v0.3.4)

- _meta.json: customLabels -> terms.{label,showInInstaller,showInInstallerRp}
- Drop builtin protection; any term kind can be deleted/added/toggled
- New public route /manifest/terms/<pack>/index.json for installer term lists
- Installers fetch terms:list dynamically; skip agreement step if list empty
- Term editor: 2 visibility checkboxes (설치기 / 리소스팩 설치기), multi-select
- Migration from old schema preserves custom labels (default: visible in both)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-05-20 10:14:42 +09:00
parent 05dc9d7166
commit 9ba5dc6b7b
14 changed files with 445 additions and 130 deletions

View File

@@ -21,11 +21,19 @@
.termsRow .termsRowLabel h2 { margin: 0; font-size: 16px; }
.termsRow .termsRowSub { color: var(--text-muted); font-size: 12px; margin-top: 2px; }
.termsRow .termsRowActions { display: flex; gap: 8px; align-items: center; }
.builtinBadge {
display: inline-block; padding: 2px 8px; border-radius: 999px;
background: rgba(255,255,255,0.08); color: var(--text-muted);
.visibilityBadges {
display: flex; gap: 6px; flex-wrap: wrap;
}
.visibilityBadge {
display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 999px;
background: rgba(76, 175, 80, 0.15); color: #8ed68f;
border: 1px solid rgba(76, 175, 80, 0.35);
font-size: 11px;
}
.visibilityBadge.off {
background: rgba(255,255,255,0.05); color: var(--text-muted);
border-color: rgba(255,255,255,0.12);
}
.termsSideBySide {
display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 24px;
}
@@ -76,21 +84,20 @@
<a class="termsRowMain" href="/op/agreement/<%= packKey %>/<%= item.kind %>" style="text-decoration:none; color:inherit;">
<div class="termsRowLabel">
<h2><%= item.label %></h2>
<% if (item.builtin) { %>
<span class="builtinBadge"><%= t('terms.builtinBadge') %></span>
<% } %>
<span class="visibilityBadges">
<span class="visibilityBadge <%= item.showInInstaller ? '' : 'off' %>"><%= t('terms.visibilityInstallerShort') %></span>
<span class="visibilityBadge <%= item.showInInstallerRp ? '' : 'off' %>"><%= t('terms.visibilityInstallerRpShort') %></span>
</span>
</div>
<div class="termsRowSub"><%= item.kind %>.md</div>
</a>
<div class="termsRowActions">
<a class="secondaryButton" href="/op/agreement/<%= packKey %>/<%= item.kind %>"><%= t('terms.edit') %></a>
<% if (!item.builtin) { %>
<form method="post" action="/op/agreement/<%= packKey %>/<%= item.kind %>/delete"
onsubmit="return confirm('<%= t('terms.deleteConfirm', { label: item.label }).replace(/'/g, "\\'") %>');"
style="margin:0;">
<button type="submit" class="dangerButton"><%= t('terms.deleteButton') %></button>
</form>
<% } %>
<form method="post" action="/op/agreement/<%= packKey %>/<%= item.kind %>/delete"
onsubmit="return confirm('<%= t('terms.deleteConfirm', { label: item.label }).replace(/'/g, "\\'") %>');"
style="margin:0;">
<button type="submit" class="dangerButton"><%= t('terms.deleteButton') %></button>
</form>
</div>
</article>
<% }) %>

View File

@@ -29,6 +29,19 @@
<span class="statusText" id="status"></span>
</div>
<!-- 표시 대상 토글: 어느 인스톨러에서 이 약관을 보여줄지 (중복 선택 가능). -->
<fieldset class="termsVisibility" style="margin-top:16px; padding:10px 14px; border:1px solid var(--border, #30363d); border-radius:8px;">
<legend style="padding:0 6px; font-size:12px; color:var(--text-muted);"><%= t('terms.visibilityHeading') %></legend>
<label style="display:inline-flex; align-items:center; gap:6px; margin-right:18px;">
<input type="checkbox" id="visInstaller" <%= showInInstaller ? 'checked' : '' %> />
<span><%= t('terms.visibilityInstaller') %></span>
</label>
<label style="display:inline-flex; align-items:center; gap:6px;">
<input type="checkbox" id="visInstallerRp" <%= showInInstallerRp ? 'checked' : '' %> />
<span><%= t('terms.visibilityInstallerRp') %></span>
</label>
</fieldset>
<p class="muted" style="font-size:12px;"><%= t('terms.slashHint') %></p>
<div id="editorWrap" class="termsEditorWrap">