...
This commit is contained in:
39
actix_mvc_app/src/views/auth/login.html
Normal file
39
actix_mvc_app/src/views/auth/login.html
Normal file
@@ -0,0 +1,39 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}Login - Actix MVC App{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-6">
|
||||
<div class="card shadow">
|
||||
<div class="card-header bg-primary text-white">
|
||||
<h4 class="mb-0">Login</h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
{% if error %}
|
||||
<div class="alert alert-danger" role="alert">
|
||||
{{ error }}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<form method="post" action="/login">
|
||||
<div class="mb-3">
|
||||
<label for="email" class="form-label">Email address</label>
|
||||
<input type="email" class="form-control" id="email" name="email" value="{{ email | default(value='') }}" required>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="password" class="form-label">Password</label>
|
||||
<input type="password" class="form-control" id="password" name="password" required>
|
||||
</div>
|
||||
<div class="d-grid">
|
||||
<button type="submit" class="btn btn-primary">Login</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="card-footer text-center">
|
||||
<p class="mb-0">Don't have an account? <a href="/register">Register</a></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
52
actix_mvc_app/src/views/auth/register.html
Normal file
52
actix_mvc_app/src/views/auth/register.html
Normal file
@@ -0,0 +1,52 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}Register - Actix MVC App{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-6">
|
||||
<div class="card shadow">
|
||||
<div class="card-header bg-primary text-white">
|
||||
<h4 class="mb-0">Register</h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
{% if errors %}
|
||||
<div class="alert alert-danger" role="alert">
|
||||
<ul class="mb-0">
|
||||
{% for error in errors %}
|
||||
<li>{{ error }}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<form method="post" action="/register">
|
||||
<div class="mb-3">
|
||||
<label for="name" class="form-label">Full Name</label>
|
||||
<input type="text" class="form-control" id="name" name="name" value="{{ name | default(value='') }}" required>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="email" class="form-label">Email address</label>
|
||||
<input type="email" class="form-control" id="email" name="email" value="{{ email | default(value='') }}" required>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="password" class="form-label">Password</label>
|
||||
<input type="password" class="form-control" id="password" name="password" required>
|
||||
<div class="form-text">Password must be at least 8 characters long.</div>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="password_confirmation" class="form-label">Confirm Password</label>
|
||||
<input type="password" class="form-control" id="password_confirmation" name="password_confirmation" required>
|
||||
</div>
|
||||
<div class="d-grid">
|
||||
<button type="submit" class="btn btn-primary">Register</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="card-footer text-center">
|
||||
<p class="mb-0">Already have an account? <a href="/login">Login</a></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
@@ -5,6 +5,7 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>{% block title %}Actix MVC App{% endblock %}</title>
|
||||
<link rel="stylesheet" href="/static/css/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="https://unpkg.com/unpoly@3.7.2/unpoly.min.css">
|
||||
{% block extra_css %}{% endblock %}
|
||||
</head>
|
||||
<body>
|
||||
@@ -15,7 +16,7 @@
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
<div class="collapse navbar-collapse" id="navbarNav">
|
||||
<ul class="navbar-nav ms-auto">
|
||||
<ul class="navbar-nav me-auto">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link {% if active_page == 'home' %}active{% endif %}" href="/">Home</a>
|
||||
</li>
|
||||
@@ -25,6 +26,34 @@
|
||||
<li class="nav-item">
|
||||
<a class="nav-link {% if active_page == 'contact' %}active{% endif %}" href="/contact">Contact</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link {% if active_page == 'tickets' %}active{% endif %}" href="/tickets">Support Tickets</a>
|
||||
</li>
|
||||
</ul>
|
||||
<ul class="navbar-nav ms-auto">
|
||||
{% if user and user.id %}
|
||||
<li class="nav-item dropdown">
|
||||
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false">
|
||||
{{ user.name }}
|
||||
</a>
|
||||
<ul class="dropdown-menu dropdown-menu-end" aria-labelledby="navbarDropdown">
|
||||
<li><a class="dropdown-item" href="/tickets/new">New Ticket</a></li>
|
||||
<li><a class="dropdown-item" href="/tickets/my">My Tickets</a></li>
|
||||
{% if user.role == "Admin" %}
|
||||
<li><a class="dropdown-item" href="/admin">Admin Panel</a></li>
|
||||
{% endif %}
|
||||
<li><hr class="dropdown-divider"></li>
|
||||
<li><a class="dropdown-item" href="/logout">Logout</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
{% else %}
|
||||
<li class="nav-item">
|
||||
<a class="nav-link {% if active_page == 'login' %}active{% endif %}" href="/login">Login</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link {% if active_page == 'register' %}active{% endif %}" href="/register">Register</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
@@ -49,6 +78,8 @@
|
||||
</footer>
|
||||
|
||||
<script src="/static/js/bootstrap.bundle.min.js"></script>
|
||||
<script src="https://unpkg.com/unpoly@3.7.2/unpoly.min.js"></script>
|
||||
<script src="https://unpkg.com/unpoly@3.7.2/unpoly-bootstrap5.min.js"></script>
|
||||
{% block extra_js %}{% endblock %}
|
||||
</body>
|
||||
</html>
|
131
actix_mvc_app/src/views/tickets/list.html
Normal file
131
actix_mvc_app/src/views/tickets/list.html
Normal file
@@ -0,0 +1,131 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}Support Tickets - Actix MVC App{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="d-flex justify-content-between align-items-center mb-4">
|
||||
<h1>Support Tickets</h1>
|
||||
<a href="/tickets/new" class="btn btn-primary">New Ticket</a>
|
||||
</div>
|
||||
|
||||
<div class="card shadow mb-4">
|
||||
<div class="card-header bg-light">
|
||||
<h5 class="mb-0">Filter Tickets</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form action="/tickets" method="get" up-target="#tickets-container" up-transition="cross-fade">
|
||||
<div class="row g-3">
|
||||
<div class="col-md-4">
|
||||
<label for="status" class="form-label">Status</label>
|
||||
<select class="form-select" id="status" name="status" up-autosubmit>
|
||||
<option value="">All Statuses</option>
|
||||
<option value="open" {% if status == "open" %}selected{% endif %}>Open</option>
|
||||
<option value="in_progress" {% if status == "in_progress" %}selected{% endif %}>In Progress</option>
|
||||
<option value="waiting_for_customer" {% if status == "waiting_for_customer" %}selected{% endif %}>Waiting for Customer</option>
|
||||
<option value="resolved" {% if status == "resolved" %}selected{% endif %}>Resolved</option>
|
||||
<option value="closed" {% if status == "closed" %}selected{% endif %}>Closed</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label for="priority" class="form-label">Priority</label>
|
||||
<select class="form-select" id="priority" name="priority" up-autosubmit>
|
||||
<option value="">All Priorities</option>
|
||||
<option value="low" {% if priority == "low" %}selected{% endif %}>Low</option>
|
||||
<option value="medium" {% if priority == "medium" %}selected{% endif %}>Medium</option>
|
||||
<option value="high" {% if priority == "high" %}selected{% endif %}>High</option>
|
||||
<option value="critical" {% if priority == "critical" %}selected{% endif %}>Critical</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label for="search" class="form-label">Search</label>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control" id="search" name="search" value="{{ search | default(value='') }}" placeholder="Search tickets...">
|
||||
<button class="btn btn-outline-secondary" type="submit">
|
||||
<i class="bi bi-search"></i> Search
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="tickets-container">
|
||||
{% if tickets | length > 0 %}
|
||||
<div class="table-responsive">
|
||||
<table class="table table-hover">
|
||||
<thead class="table-light">
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>Title</th>
|
||||
<th>Status</th>
|
||||
<th>Priority</th>
|
||||
<th>Created</th>
|
||||
<th>Updated</th>
|
||||
<th>Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for ticket in tickets %}
|
||||
<tr>
|
||||
<td>{{ ticket.id | truncate(length=8) }}</td>
|
||||
<td>
|
||||
<a href="/tickets/{{ ticket.id }}" up-layer="new modal" up-size="large">
|
||||
{{ ticket.title }}
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<span class="badge
|
||||
{% if ticket.status == 'Open' %}bg-danger{% endif %}
|
||||
{% if ticket.status == 'In Progress' %}bg-warning{% endif %}
|
||||
{% if ticket.status == 'Waiting for Customer' %}bg-info{% endif %}
|
||||
{% if ticket.status == 'Resolved' %}bg-success{% endif %}
|
||||
{% if ticket.status == 'Closed' %}bg-secondary{% endif %}
|
||||
">
|
||||
{{ ticket.status }}
|
||||
</span>
|
||||
</td>
|
||||
<td>
|
||||
<span class="badge
|
||||
{% if ticket.priority == 'Low' %}bg-success{% endif %}
|
||||
{% if ticket.priority == 'Medium' %}bg-info{% endif %}
|
||||
{% if ticket.priority == 'High' %}bg-warning{% endif %}
|
||||
{% if ticket.priority == 'Critical' %}bg-danger{% endif %}
|
||||
">
|
||||
{{ ticket.priority }}
|
||||
</span>
|
||||
</td>
|
||||
<td>{{ ticket.created_at | date(format="%Y-%m-%d %H:%M") }}</td>
|
||||
<td>{{ ticket.updated_at | date(format="%Y-%m-%d %H:%M") }}</td>
|
||||
<td>
|
||||
<a href="/tickets/{{ ticket.id }}" class="btn btn-sm btn-outline-primary" up-layer="new modal" up-size="large">
|
||||
View
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="alert alert-info">
|
||||
<h4 class="alert-heading">No tickets found!</h4>
|
||||
<p>There are no tickets matching your filter criteria. Try adjusting your filters or create a new ticket.</p>
|
||||
<hr>
|
||||
<p class="mb-0">
|
||||
<a href="/tickets/new" class="btn btn-primary">Create New Ticket</a>
|
||||
</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block extra_js %}
|
||||
<script>
|
||||
// Initialize Unpoly event handlers
|
||||
up.on('up:fragment:inserted', function(event) {
|
||||
// This will run whenever a fragment is updated via Unpoly
|
||||
console.log('Fragment updated:', event.target);
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
89
actix_mvc_app/src/views/tickets/my_tickets.html
Normal file
89
actix_mvc_app/src/views/tickets/my_tickets.html
Normal file
@@ -0,0 +1,89 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}My Tickets - Actix MVC App{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="d-flex justify-content-between align-items-center mb-4">
|
||||
<h1>My Support Tickets</h1>
|
||||
<a href="/tickets/new" class="btn btn-primary">New Ticket</a>
|
||||
</div>
|
||||
|
||||
<div id="my-tickets-container">
|
||||
{% if tickets | length > 0 %}
|
||||
<div class="table-responsive">
|
||||
<table class="table table-hover">
|
||||
<thead class="table-light">
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>Title</th>
|
||||
<th>Status</th>
|
||||
<th>Priority</th>
|
||||
<th>Created</th>
|
||||
<th>Updated</th>
|
||||
<th>Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for ticket in tickets %}
|
||||
<tr>
|
||||
<td>{{ ticket.id | truncate(length=8) }}</td>
|
||||
<td>
|
||||
<a href="/tickets/{{ ticket.id }}" up-layer="new modal" up-size="large">
|
||||
{{ ticket.title }}
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<span class="badge
|
||||
{% if ticket.status == 'Open' %}bg-danger{% endif %}
|
||||
{% if ticket.status == 'In Progress' %}bg-warning{% endif %}
|
||||
{% if ticket.status == 'Waiting for Customer' %}bg-info{% endif %}
|
||||
{% if ticket.status == 'Resolved' %}bg-success{% endif %}
|
||||
{% if ticket.status == 'Closed' %}bg-secondary{% endif %}
|
||||
">
|
||||
{{ ticket.status }}
|
||||
</span>
|
||||
</td>
|
||||
<td>
|
||||
<span class="badge
|
||||
{% if ticket.priority == 'Low' %}bg-success{% endif %}
|
||||
{% if ticket.priority == 'Medium' %}bg-info{% endif %}
|
||||
{% if ticket.priority == 'High' %}bg-warning{% endif %}
|
||||
{% if ticket.priority == 'Critical' %}bg-danger{% endif %}
|
||||
">
|
||||
{{ ticket.priority }}
|
||||
</span>
|
||||
</td>
|
||||
<td>{{ ticket.created_at | date(format="%Y-%m-%d %H:%M") }}</td>
|
||||
<td>{{ ticket.updated_at | date(format="%Y-%m-%d %H:%M") }}</td>
|
||||
<td>
|
||||
<a href="/tickets/{{ ticket.id }}" class="btn btn-sm btn-outline-primary" up-layer="new modal" up-size="large">
|
||||
View
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="alert alert-info">
|
||||
<h4 class="alert-heading">No tickets found!</h4>
|
||||
<p>You haven't created any support tickets yet.</p>
|
||||
<hr>
|
||||
<p class="mb-0">
|
||||
<a href="/tickets/new" class="btn btn-primary">Create Your First Ticket</a>
|
||||
</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block extra_js %}
|
||||
<script>
|
||||
// Initialize Unpoly event handlers
|
||||
up.on('up:fragment:inserted', function(event) {
|
||||
// This will run whenever a fragment is updated via Unpoly
|
||||
console.log('Fragment updated:', event.target);
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
56
actix_mvc_app/src/views/tickets/new.html
Normal file
56
actix_mvc_app/src/views/tickets/new.html
Normal file
@@ -0,0 +1,56 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}New Support Ticket - Actix MVC App{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-8">
|
||||
<div class="card shadow">
|
||||
<div class="card-header bg-primary text-white">
|
||||
<h4 class="mb-0">Create New Support Ticket</h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
{% if errors %}
|
||||
<div class="alert alert-danger" role="alert">
|
||||
<ul class="mb-0">
|
||||
{% for error in errors %}
|
||||
<li>{{ error }}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<form method="post" action="/tickets/new">
|
||||
<div class="mb-3">
|
||||
<label for="title" class="form-label">Title</label>
|
||||
<input type="text" class="form-control" id="title" name="title" value="{{ form.title | default(value='') }}" required>
|
||||
<div class="form-text">Provide a brief summary of your issue</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="priority" class="form-label">Priority</label>
|
||||
<select class="form-select" id="priority" name="priority">
|
||||
<option value="low" {% if form.priority == "low" %}selected{% endif %}>Low</option>
|
||||
<option value="medium" {% if form.priority == "medium" or not form.priority %}selected{% endif %}>Medium</option>
|
||||
<option value="high" {% if form.priority == "high" %}selected{% endif %}>High</option>
|
||||
<option value="critical" {% if form.priority == "critical" %}selected{% endif %}>Critical</option>
|
||||
</select>
|
||||
<div class="form-text">Select the priority level for your issue</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="description" class="form-label">Description</label>
|
||||
<textarea class="form-control" id="description" name="description" rows="6" required>{{ form.description | default(value='') }}</textarea>
|
||||
<div class="form-text">Please provide detailed information about your issue</div>
|
||||
</div>
|
||||
|
||||
<div class="d-flex justify-content-between">
|
||||
<a href="/tickets" class="btn btn-outline-secondary">Cancel</a>
|
||||
<button type="submit" class="btn btn-primary">Create Ticket</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
140
actix_mvc_app/src/views/tickets/show.html
Normal file
140
actix_mvc_app/src/views/tickets/show.html
Normal file
@@ -0,0 +1,140 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}Ticket #{{ ticket.id | truncate(length=8) }} - Actix MVC App{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="container" up-main>
|
||||
<div class="d-flex justify-content-between align-items-center mb-4">
|
||||
<h1>Ticket #{{ ticket.id | truncate(length=8) }}</h1>
|
||||
<div>
|
||||
<a href="/tickets" class="btn btn-outline-secondary">Back to Tickets</a>
|
||||
{% if user.role == "Admin" %}
|
||||
<div class="dropdown d-inline-block ms-2">
|
||||
<button class="btn btn-outline-primary dropdown-toggle" type="button" id="statusDropdown" data-bs-toggle="dropdown" aria-expanded="false">
|
||||
Update Status
|
||||
</button>
|
||||
<ul class="dropdown-menu" aria-labelledby="statusDropdown">
|
||||
<li><a class="dropdown-item" href="/tickets/{{ ticket.id }}/status/open" up-target="#ticket-details" up-transition="cross-fade">Open</a></li>
|
||||
<li><a class="dropdown-item" href="/tickets/{{ ticket.id }}/status/in_progress" up-target="#ticket-details" up-transition="cross-fade">In Progress</a></li>
|
||||
<li><a class="dropdown-item" href="/tickets/{{ ticket.id }}/status/waiting_for_customer" up-target="#ticket-details" up-transition="cross-fade">Waiting for Customer</a></li>
|
||||
<li><a class="dropdown-item" href="/tickets/{{ ticket.id }}/status/resolved" up-target="#ticket-details" up-transition="cross-fade">Resolved</a></li>
|
||||
<li><a class="dropdown-item" href="/tickets/{{ ticket.id }}/status/closed" up-target="#ticket-details" up-transition="cross-fade">Closed</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="ticket-details" class="row">
|
||||
<div class="col-md-8">
|
||||
<div class="card shadow mb-4">
|
||||
<div class="card-header bg-light">
|
||||
<h5 class="mb-0">{{ ticket.title }}</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="mb-4">
|
||||
{{ ticket.description | replace(from="\n", to="<br>") | safe }}
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
|
||||
<h5 class="mb-3">Comments</h5>
|
||||
|
||||
{% if comments | length > 0 %}
|
||||
<div class="comments-container">
|
||||
{% for comment in comments %}
|
||||
<div class="comment mb-3 p-3 border rounded {% if comment.is_support_response %}bg-light{% endif %}">
|
||||
<div class="d-flex justify-content-between mb-2">
|
||||
<strong>
|
||||
{% if comment.is_support_response %}
|
||||
<span class="badge bg-info">Support Team</span>
|
||||
{% else %}
|
||||
<span class="badge bg-secondary">Customer</span>
|
||||
{% endif %}
|
||||
</strong>
|
||||
<small class="text-muted">{{ comment.created_at | date(format="%Y-%m-%d %H:%M") }}</small>
|
||||
</div>
|
||||
<div>
|
||||
{{ comment.content | replace(from="\n", to="<br>") | safe }}
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="alert alert-info">
|
||||
No comments yet.
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<form method="post" action="/tickets/{{ ticket.id }}/comment" class="mt-4" up-target=".comments-container" up-transition="move-down">
|
||||
<div class="mb-3">
|
||||
<label for="content" class="form-label">Add a Comment</label>
|
||||
<textarea class="form-control" id="content" name="content" rows="3" required></textarea>
|
||||
</div>
|
||||
<div class="d-grid">
|
||||
<button type="submit" class="btn btn-primary">Submit Comment</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="card shadow mb-4">
|
||||
<div class="card-header bg-light">
|
||||
<h5 class="mb-0">Ticket Details</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<dl class="row">
|
||||
<dt class="col-sm-4">Status</dt>
|
||||
<dd class="col-sm-8">
|
||||
<span class="badge
|
||||
{% if ticket.status == 'Open' %}bg-danger{% endif %}
|
||||
{% if ticket.status == 'In Progress' %}bg-warning{% endif %}
|
||||
{% if ticket.status == 'Waiting for Customer' %}bg-info{% endif %}
|
||||
{% if ticket.status == 'Resolved' %}bg-success{% endif %}
|
||||
{% if ticket.status == 'Closed' %}bg-secondary{% endif %}
|
||||
">
|
||||
{{ ticket.status }}
|
||||
</span>
|
||||
</dd>
|
||||
|
||||
<dt class="col-sm-4">Priority</dt>
|
||||
<dd class="col-sm-8">
|
||||
<span class="badge
|
||||
{% if ticket.priority == 'Low' %}bg-success{% endif %}
|
||||
{% if ticket.priority == 'Medium' %}bg-info{% endif %}
|
||||
{% if ticket.priority == 'High' %}bg-warning{% endif %}
|
||||
{% if ticket.priority == 'Critical' %}bg-danger{% endif %}
|
||||
">
|
||||
{{ ticket.priority }}
|
||||
</span>
|
||||
</dd>
|
||||
|
||||
<dt class="col-sm-4">Created</dt>
|
||||
<dd class="col-sm-8">{{ ticket.created_at | date(format="%Y-%m-%d %H:%M") }}</dd>
|
||||
|
||||
<dt class="col-sm-4">Updated</dt>
|
||||
<dd class="col-sm-8">{{ ticket.updated_at | date(format="%Y-%m-%d %H:%M") }}</dd>
|
||||
|
||||
{% if ticket.assigned_to %}
|
||||
<dt class="col-sm-4">Assigned To</dt>
|
||||
<dd class="col-sm-8">Agent #{{ ticket.assigned_to }}</dd>
|
||||
{% endif %}
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block extra_js %}
|
||||
<script>
|
||||
// Initialize Unpoly event handlers for ticket view
|
||||
up.on('up:fragment:inserted', function(event) {
|
||||
// This will run whenever a fragment is updated via Unpoly
|
||||
console.log('Fragment updated in ticket view:', event.target);
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
Reference in New Issue
Block a user