| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- {% extends 'layout.twig' %}
- {% block title %}{{ consumer.name }} — Consumer — IRDB{% endblock %}
- {% block content %}
- <div class="mx-auto max-w-3xl">
- <a href="/app/consumers" class="text-sm text-slate-500 hover:underline dark:text-slate-400">← Back to consumers</a>
- <h1 class="mt-3 text-2xl font-semibold tracking-tight font-mono">{{ consumer.name }}</h1>
- <form method="post" action="/app/consumers/{{ consumer.id }}" class="mt-6 rounded-2xl border border-slate-200 bg-white p-5 shadow-sm dark:border-slate-800 dark:bg-slate-900">
- <input type="hidden" name="csrf_token" value="{{ csrf_token }}">
- <div class="grid grid-cols-1 gap-3 md:grid-cols-2 text-sm">
- <div>
- <label for="c-name" class="block text-xs font-medium text-slate-600 dark:text-slate-400">Name</label>
- <input type="text" id="c-name" name="name" value="{{ consumer.name }}" {% if not can_write %}readonly{% endif %}
- class="mt-1 w-full rounded-md border border-slate-300 bg-white px-2 py-1.5 font-mono dark:border-slate-700 dark:bg-slate-950">
- </div>
- <div>
- <label for="c-policy" class="block text-xs font-medium text-slate-600 dark:text-slate-400">Policy</label>
- <select id="c-policy" name="policy_id" {% if not can_write %}disabled{% endif %}
- class="mt-1 w-full rounded-md border border-slate-300 bg-white px-2 py-1.5 dark:border-slate-700 dark:bg-slate-950">
- {% for p in policies %}
- <option value="{{ p.id }}" {% if consumer.policy_id == p.id %}selected{% endif %}>{{ p.name }}</option>
- {% endfor %}
- </select>
- </div>
- <div class="md:col-span-2">
- <label for="c-desc" class="block text-xs font-medium text-slate-600 dark:text-slate-400">Description</label>
- <input type="text" id="c-desc" name="description" value="{{ consumer.description|default('') }}" {% if not can_write %}readonly{% endif %}
- class="mt-1 w-full rounded-md border border-slate-300 bg-white px-2 py-1.5 dark:border-slate-700 dark:bg-slate-950">
- </div>
- <div class="md:col-span-2">
- <label class="flex items-center gap-2 text-xs text-slate-600 dark:text-slate-400">
- <input type="checkbox" name="is_active" value="1" {% if consumer.is_active %}checked{% endif %} {% if not can_write %}disabled{% endif %}>
- active
- </label>
- </div>
- </div>
- {% if can_write %}
- <div class="mt-4 flex justify-end">
- <button type="submit" class="rounded-md bg-indigo-600 px-3 py-1.5 text-sm font-medium text-white hover:bg-indigo-500">Save</button>
- </div>
- {% endif %}
- </form>
- </div>
- {% endblock %}
|