Files
Assetmanager/app/templates/assets_bulk_edit.html
T
RolandandClaude Opus 5.5 261b4f2029 Version 0.5.5.93: custom fields in lists, MeshCentral sync flag for statuses
- Show custom field values in asset list, dashboard and list Excel export
- New status flag to exclude assets (e.g. scrapped) from MeshCentral sync
- Require a secure SESSION_SECRET with a readable startup message
- Add SESSION_COOKIE_SECURE and refresh session permissions per request
- Translate HTTP errors and remaining fixed UI texts

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 22:06:56 +01:00

57 lines
3.5 KiB
HTML
Executable File
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{% extends 'base.html' %}
{% block content %}
<div class="toolbar"><div><h1>{{ t('assets.bulk_edit.title') }}</h1><p class="muted">{{ t('assets.bulk_edit.applies_to', count=assets|length) }}</p></div><a class="button button-secondary" href="/assets{% if category_id %}?category_id={{ category_id }}{% endif %}">{{ t('common.cancel') }}</a></div>
<section class="panel bulk-edit-panel">
<form method="post" action="/assets/bulk-edit/apply" id="bulk-edit-apply-form">
{% for id in asset_ids %}<input type="hidden" name="asset_ids" value="{{ id }}">{% endfor %}
{% if category_id %}<input type="hidden" name="category_id" value="{{ category_id }}">{% endif %}
<div class="form-grid">
<label>{{ t('common.field') }}
<select name="field_name" id="bulk-field" required>
<option value="">{{ t('common.please_select') }}</option>
{% for field in fields %}<option value="{{ field.field_name }}">{{ field.label }}</option>{% endfor %}
</select>
</label>
<label>{{ t('history.new_value') }}
<input name="new_value" id="bulk-value" autocomplete="off">
<select id="bulk-status-value" class="hidden-control">
<option value="">{{ t('assets.bulk_edit.empty_value') }}</option>
{% for status in status_options %}<option value="{{ status.name }}">{{ status.name }}</option>{% endfor %}
</select>
<select id="bulk-parent-value" class="hidden-control">
<option value="">{{ t('assets.bulk_edit.no_parent') }}</option>
{% for parent in parent_candidates %}<option value="{{ parent.id }}">{{ parent.name }}{% if parent.asset_tag %} – {{ parent.asset_tag }}{% endif %} ({{ parent.category.name }})</option>{% endfor %}
</select>
<select id="bulk-category-value" class="hidden-control">
<option value="">{{ t('assets.bulk_edit.select_category') }}</option>
{% for category in categories %}<option value="{{ category.id }}">{{ category.name }}</option>{% endfor %}
</select>
</label>
</div>
<p class="muted">{{ t('assets.bulk_edit.help') }}</p>
<details><summary>{{ t('assets.bulk_edit.show_selected') }}</summary><ul class="compact-list">{% for asset in assets %}<li>{{ asset.name }} <span class="muted">({{ asset.category.name }})</span></li>{% endfor %}</ul></details>
<div class="form-actions"><a class="button button-secondary" href="/assets{% if category_id %}?category_id={{ category_id }}{% endif %}">{{ t('common.cancel') }}</a><button type="submit">💾 {{ t('assets.bulk_edit.save_for', count=assets|length) }}</button></div>
</form>
</section>
<script>
(() => {
const field = document.getElementById('bulk-field');
const input = document.getElementById('bulk-value');
const status = document.getElementById('bulk-status-value');
const parent = document.getElementById('bulk-parent-value');
const category = document.getElementById('bulk-category-value');
const controls = [input, status, parent, category];
field.addEventListener('change', () => {
const selected = field.value;
const active = selected === 'status' ? status : selected === 'parent_asset_id' ? parent : selected === 'category_id' ? category : input;
controls.forEach(control => {
control.classList.toggle('hidden-control', control !== active);
if (control === active) control.name = 'new_value'; else control.removeAttribute('name');
});
const dateFields = ['assigned_on','purchase_date','warranty_until'];
input.type = dateFields.includes(selected) ? 'date' : 'text';
});
})();
</script>
{% endblock %}