HH/templates/organizations/manager_review_question_form.html
ismail 7369d08012
All checks were successful
Build and Push Docker Image / build (push) Successful in 4m14s
feat: unified reference numbers + feedback modules QA audit
Reference numbers (unified scheme PREFIX-YYYYMM-HOSP-NNNN, e.g. CMP-202606-HHN-0001):
- new ReferenceSequence model + generate_reference() helper (apps/core)
- Complaint/Inquiry/Observation/Appreciation/Suggestion emit unified refs via save()
- prefix-based auto-routing in public track API (CMP/INQ/OBS trackable; APR/SGT internal-only)
- removed legacy CMP-/INQ- generators in ui_views, integrations, px_sources
- migrations: core.0003_referencesequence, appreciation.0006, feedback.0008, observations.0012
- unit tests (format, sanitization, monthly reset, 40-thread concurrency)

QA audit:
- isolated E2E hospital sandbox mirroring HH-N + 10 role users (create_e2e_isolated_env)
- feedback-modules-audit.spec.ts + audit helper (headed, run-to-completion)
- reports/feedback-modules-qa-report.md

Also bundles accumulated in-progress work across complaints, observations,
organizations, templates, and other modules.
2026-06-14 14:29:23 +03:00

89 lines
4.9 KiB
HTML

{% extends "layouts/base.html" %}
{% load i18n %}
{% block title %}{% if question %}{% trans "Edit Question" %}{% else %}{% trans "Create Question" %}{% endif %} - PX360{% endblock %}
{% block content %}
<div class="p-6 max-w-2xl mx-auto">
<div class="flex items-center gap-2 text-sm text-slate-500 mb-4">
<a href="{% url 'organizations:manager_review_questions' %}" class="hover:text-navy transition">{% trans "Manager Review Questions" %}</a>
<i data-lucide="chevron-right" class="w-4 h-4"></i>
<span class="text-navy font-semibold">{% if question %}{% trans "Edit" %}{% else %}{% trans "Create" %}{% endif %}</span>
</div>
<div class="flex items-center gap-3 mb-6">
<div class="w-10 h-10 bg-navy/10 rounded-xl flex items-center justify-center">
<i data-lucide="help-circle" class="w-5 h-5 text-navy"></i>
</div>
<h1 class="text-xl font-bold text-navy">{% if question %}{% trans "Edit Question" %}{% else %}{% trans "Create Question" %}{% endif %}</h1>
</div>
<form method="post" class="bg-white rounded-2xl border border-slate-200 p-6 space-y-5">
{% csrf_token %}
<div>
<label class="block text-sm font-semibold text-slate-700 mb-2">
{% trans "Question Text (English)" %} <span class="text-red-500">*</span>
</label>
<textarea name="text_en" rows="2" required
class="w-full px-4 py-3 border-2 border-slate-200 rounded-xl text-sm focus:outline-none focus:border-navy focus:ring-2 focus:ring-navy/20 resize-none"
placeholder="{% trans 'Enter the question in English...' %}">{{ question.text_en|default:'' }}</textarea>
</div>
<div>
<label class="block text-sm font-semibold text-slate-700 mb-2">
{% trans "Question Text (Arabic)" %}
</label>
<textarea name="text_ar" rows="2" dir="rtl"
class="w-full px-4 py-3 border-2 border-slate-200 rounded-xl text-sm focus:outline-none focus:border-navy focus:ring-2 focus:ring-navy/20 resize-none"
placeholder="{% trans 'أدخل السؤال باللغة العربية...' %}">{{ question.text_ar|default:'' }}</textarea>
</div>
<div class="grid grid-cols-2 gap-4">
<div>
<label class="block text-sm font-semibold text-slate-700 mb-2">{% trans "Question Type" %}</label>
<select name="question_type"
class="w-full px-4 py-2.5 border-2 border-slate-200 rounded-xl text-sm focus:outline-none focus:border-navy focus:ring-2 focus:ring-navy/20">
{% for value, label in question_types %}
<option value="{{ value }}" {% if question.question_type == value %}selected{% endif %}>{{ label }}</option>
{% endfor %}
</select>
</div>
<div>
<label class="block text-sm font-semibold text-slate-700 mb-2">{% trans "Order" %}</label>
<input type="number" name="order" value="{{ question.order|default:'0' }}" min="0"
class="w-full px-4 py-2.5 border-2 border-slate-200 rounded-xl text-sm focus:outline-none focus:border-navy focus:ring-2 focus:ring-navy/20">
</div>
</div>
<div>
<label class="block text-sm font-semibold text-slate-700 mb-2">
{% trans "Choices (for Multiple Choice)" %}
</label>
<input type="text" name="choices_json"
value="{% if question.choices_json %}{{ question.choices_json|safe }}{% endif %}"
class="w-full px-4 py-2.5 border-2 border-slate-200 rounded-xl text-sm focus:outline-none focus:border-navy focus:ring-2 focus:ring-navy/20"
placeholder='{% trans "e.g. Option A, Option B, Option C" %}'>
<p class="text-xs text-slate-400 mt-1">{% trans "Comma-separated values or JSON array. Only used for Multiple Choice type." %}</p>
</div>
<div class="flex items-center gap-2">
<input type="checkbox" name="is_active" id="is_active" {% if question.is_active or not question %}checked{% endif %}
class="w-4 h-4 text-navy border-slate-300 rounded focus:ring-navy">
<label for="is_active" class="text-sm font-semibold text-slate-700">{% trans "Active" %}</label>
</div>
<div class="flex gap-3 pt-2">
<button type="submit"
class="px-6 py-2.5 bg-gradient-to-r from-navy to-blue text-white font-semibold rounded-xl hover:opacity-90 transition">
{% if question %}{% trans "Update" %}{% else %}{% trans "Create" %}{% endif %}
</button>
<a href="{% url 'organizations:manager_review_questions' %}"
class="px-6 py-2.5 bg-slate-100 text-slate-700 font-semibold rounded-xl hover:bg-slate-200 transition">
{% trans "Cancel" %}
</a>
</div>
</form>
</div>
{% endblock %}