62 lines
2.9 KiB
HTML
62 lines
2.9 KiB
HTML
{% extends "tenant/layouts/base.html" %}
|
|
{% block title %}{{ 'Edit' if mode == 'edit' else 'New' }} Location{% endblock %}
|
|
{% block content %}
|
|
<div class="row justify-content-center">
|
|
<div class="col-md-6">
|
|
<div class="card shadow-sm">
|
|
<div class="card-header fw-semibold">{{ 'Edit' if mode == 'edit' else 'New' }} Location</div>
|
|
<div class="card-body">
|
|
{% if error %}<div class="alert alert-danger py-2">{{ error }}</div>{% endif %}
|
|
<form method="POST" novalidate>
|
|
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
|
|
<div class="mb-3">
|
|
<label class="form-label">Name <span class="text-danger">*</span></label>
|
|
<input type="text" class="form-control" name="name"
|
|
value="{{ location.name if location else '' }}" required autofocus>
|
|
</div>
|
|
<div class="mb-3">
|
|
<label class="form-label">Address</label>
|
|
<input type="text" class="form-control" name="address"
|
|
value="{{ location.address if location else '' }}">
|
|
</div>
|
|
<div class="row g-2 mb-3">
|
|
<div class="col">
|
|
<label class="form-label">Phone</label>
|
|
<input type="tel" class="form-control" name="phone"
|
|
value="{{ location.phone if location else '' }}">
|
|
</div>
|
|
<div class="col">
|
|
<label class="form-label">Email</label>
|
|
<input type="email" class="form-control" name="email"
|
|
value="{{ location.email if location else '' }}">
|
|
</div>
|
|
</div>
|
|
<div class="mb-3">
|
|
<label class="form-label">Timezone</label>
|
|
<input type="text" class="form-control" name="timezone"
|
|
value="{{ location.timezone if location else 'America/New_York' }}">
|
|
</div>
|
|
{% if mode == 'edit' %}
|
|
<div class="mb-3 d-flex gap-3">
|
|
<div class="form-check form-switch">
|
|
<input class="form-check-input" type="checkbox" name="is_active" value="1"
|
|
id="is_active" {{ 'checked' if location and location.is_active }}>
|
|
<label class="form-check-label" for="is_active">Active</label>
|
|
</div>
|
|
<div class="form-check form-switch">
|
|
<input class="form-check-input" type="checkbox" name="is_primary" value="1"
|
|
id="is_primary" {{ 'checked' if location and location.is_primary }}>
|
|
<label class="form-check-label" for="is_primary">Set as Primary</label>
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
<div class="d-flex gap-2">
|
|
<button type="submit" class="btn btn-primary">Save</button>
|
|
<a href="{{ url_for('locations.index') }}" class="btn btn-outline-secondary">Cancel</a>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endblock %} |