Vorgaben: 20 GB je Transfer, Frist 1 Tag
Bei nur einer Frist entfällt das Auswahlfeld; die Frist steht dann im Hinweis unter der Dateiauswahl. Ohne DEFAULT_EXPIRY_DAYS ist die kürzeste Frist vorausgewählt. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
1 parent
278194b707
commit
90500811df
7 files changed
+45
-22
No files matched your search
@@ -470,18 +470,14 @@ h1 {
|
||||
|
||||
/* ------------------------------------------------------------ Felder */
|
||||
|
||||
/* Zwei Felder nebeneinander, wenn Platz ist; ein einzelnes nimmt die ganze Breite. */
|
||||
.fields {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
|
||||
gap: 1rem;
|
||||
margin-top: 1.5rem;
|
||||
}
|
||||
|
||||
@media (min-width: 34rem) {
|
||||
.fields {
|
||||
grid-template-columns: 1fr 1fr;
|
||||
}
|
||||
}
|
||||
|
||||
.field > label:first-child {
|
||||
display: block;
|
||||
margin-bottom: 0.35rem;
|
||||
|
||||
+20
-1
@@ -17,6 +17,8 @@ const TEXT = {
|
||||
days: (n) => (n === 1 ? '1 Tag' : `${n} Tage`),
|
||||
files: (n) => (n === 1 ? '1 Datei' : `${n} Dateien`),
|
||||
limitHint: 'Bis zu {size} pro Transfer',
|
||||
limitHintFixed: 'Bis zu {size} pro Transfer · wird {after} gelöscht',
|
||||
afterDays: (n) => (n === 1 ? 'nach 1 Tag' : `nach ${n} Tagen`),
|
||||
remove: '„{name}“ entfernen',
|
||||
tooLarge: 'Zusammen sind das {size} – erlaubt sind höchstens {max}.',
|
||||
tooMany: 'Das sind {count} Dateien – erlaubt sind höchstens {max}.',
|
||||
@@ -49,6 +51,8 @@ const TEXT = {
|
||||
days: (n) => (n === 1 ? '1 day' : `${n} days`),
|
||||
files: (n) => (n === 1 ? '1 file' : `${n} files`),
|
||||
limitHint: 'Up to {size} per transfer',
|
||||
limitHintFixed: 'Up to {size} per transfer · deleted {after}',
|
||||
afterDays: (n) => (n === 1 ? 'after 1 day' : `after ${n} days`),
|
||||
remove: 'Remove “{name}”',
|
||||
tooLarge: 'That is {size} in total – the limit is {max}.',
|
||||
tooMany: 'That is {count} files – the limit is {max}.',
|
||||
@@ -94,6 +98,8 @@ const el = {
|
||||
dropzone: $('dropzone'),
|
||||
fileInput: $('file-input'),
|
||||
limitHint: $('limit-hint'),
|
||||
fields: $('fields'),
|
||||
expiryField: $('expiry-field'),
|
||||
selection: $('selection'),
|
||||
fileList: $('file-list'),
|
||||
selectionTotal: $('selection-total'),
|
||||
@@ -273,7 +279,19 @@ function show(step) {
|
||||
|
||||
function renderSelect() {
|
||||
const cfg = state.config;
|
||||
el.limitHint.textContent = cfg ? t('limitHint', { size: formatBytes(cfg.maxTransferBytes) }) : '';
|
||||
// Gibt es nur eine Frist, steht sie im Hinweis; ein Auswahlfeld wäre überflüssig.
|
||||
const fixedExpiry = cfg && cfg.expiryDays.length === 1 ? cfg.expiryDays[0] : null;
|
||||
if (!cfg) {
|
||||
el.limitHint.textContent = '';
|
||||
} else if (fixedExpiry !== null) {
|
||||
el.limitHint.textContent = t('limitHintFixed', {
|
||||
size: formatBytes(cfg.maxTransferBytes),
|
||||
after: t('afterDays', fixedExpiry),
|
||||
});
|
||||
} else {
|
||||
el.limitHint.textContent = t('limitHint', { size: formatBytes(cfg.maxTransferBytes) });
|
||||
}
|
||||
el.expiryField.hidden = !cfg || fixedExpiry !== null;
|
||||
|
||||
// Fristen: Auswahl beim Neuzeichnen behalten
|
||||
if (cfg) {
|
||||
@@ -292,6 +310,7 @@ function renderSelect() {
|
||||
const codeNeeded = !cfg || cfg.codeRequired;
|
||||
el.codeField.hidden = !codeNeeded;
|
||||
el.codeHint.hidden = !codeNeeded;
|
||||
el.fields.hidden = el.expiryField.hidden && el.codeField.hidden;
|
||||
|
||||
el.selection.hidden = state.files.length === 0;
|
||||
el.fileList.replaceChildren(
|
||||
|
||||
Reference in new issue
Block a user