Files
lifeos-prod/templates/weblink_form.html
2026-03-03 00:44:33 +00:00

53 lines
2.5 KiB
HTML

{% extends "base.html" %}
{% block content %}
<div class="page-header">
<h1 class="page-title">{{ page_title }}</h1>
</div>
<div class="card">
<form method="post" action="{{ '/weblinks/' ~ item.id ~ '/edit' if item else '/weblinks/create' }}">
<div class="form-grid">
<div class="form-group full-width">
<label class="form-label">Label *</label>
<input type="text" name="label" class="form-input" required
value="{{ item.label if item else '' }}" placeholder="Display name...">
</div>
<div class="form-group full-width">
<label class="form-label">URL *</label>
<input type="url" name="url" class="form-input" required
value="{{ item.url if item else '' }}" placeholder="https://...">
</div>
<div class="form-group">
<label class="form-label">Folder</label>
<select name="folder_id" class="form-select">
<option value="">None</option>
{% for f in folders %}
<option value="{{ f.id }}" {{ 'selected' if prefill_folder_id == f.id|string }}>{{ f.name }}</option>
{% endfor %}
</select>
</div>
<div class="form-group">
<label class="form-label">Tags</label>
<input type="text" name="tags" class="form-input" placeholder="tag1, tag2, ..."
value="{{ item.tags|join(', ') if item and item.tags else '' }}">
</div>
<div class="form-group full-width">
<label class="form-label">Description</label>
<textarea name="description" class="form-textarea" rows="2">{{ item.description if item and item.description else '' }}</textarea>
</div>
</div>
{% if prefill_task_id is defined and prefill_task_id %}<input type="hidden" name="task_id" value="{{ prefill_task_id }}">{% endif %}
{% if prefill_meeting_id is defined and prefill_meeting_id %}<input type="hidden" name="meeting_id" value="{{ prefill_meeting_id }}">{% endif %}
<div class="form-actions">
<button type="submit" class="btn btn-primary">{{ 'Save Changes' if item else 'Add Link' }}</button>
<a href="{{ '/tasks/' ~ prefill_task_id ~ '?tab=links' if prefill_task_id is defined and prefill_task_id else '/weblinks' }}" class="btn btn-secondary">Cancel</a>
</div>
</form>
</div>
{% endblock %}