|
1 | 1 | {% extends "base.html" %} |
2 | | -{% load bootstrap_tags %} |
3 | | -{% block title %} |
4 | | -Edit Ticket | {{ ticket.id }} |
| 2 | +{% load static from staticfiles %} |
| 3 | +{% load crispy_forms_tags %} |
| 4 | +{% block title %}TrackIt | Edit Ticket | {{ ticket.id }}{% endblock %} |
| 5 | +{% block head %} |
| 6 | +<link rel="stylesheet" href="{% static 'css/bootstrap-tagsinput.css' %}"> |
5 | 7 | {% endblock %} |
6 | 8 | {% block page_heading %} |
7 | | -<h2>Edit Ticket | {{ ticket.id }}</h2> |
| 9 | +<i class="material-icons">edit</i> Edit Ticket | {{ ticket.id }} |
8 | 10 | <hr> |
9 | 11 | {% endblock %} |
| 12 | +{% block container-class %}edit-ticket-container{% endblock %} |
10 | 13 | {% block content %} |
11 | | -<div class="row"> |
12 | | - <div class="col col-8"> |
13 | | - <form method="post" enctype="multipart/form-data"> |
14 | | - {% csrf_token %} |
15 | | - {{ form | as_bootstrap }} |
16 | | - <button class="btn btn-primary" type="submit">Submit</button> |
17 | | - </form> |
18 | | - <a class="btn" href="{% url 'tickets' %}">Cancel</a> |
| 14 | +<div class="jumbotron mx-auto" style="max-width: 1400px;"> |
| 15 | + <div class="row"> |
| 16 | + <div class="col-12"> |
| 17 | + <form method="post" enctype="multipart/form-data"> |
| 18 | + {% csrf_token %} |
| 19 | + <div class="row"> |
| 20 | + <div class="col-md-12 col-lg-6"> |
| 21 | + {{ form.summary | as_crispy_field }} |
| 22 | + </div> |
| 23 | + <div class="col-12"> |
| 24 | + {{ form.description | as_crispy_field }} |
| 25 | + </div> |
| 26 | + <div class="col-sm-12 col-md-4 col-lg-3"> |
| 27 | + {{ form.ticket_type | as_crispy_field }} |
| 28 | + </div> |
| 29 | + <div class="col-sm-12 col-md-4 col-lg-3"> |
| 30 | + {{ form.priority | as_crispy_field }} |
| 31 | + </div> |
| 32 | + <div class="col-sm-12 col-md-4 col-lg-3"> |
| 33 | + {{ form.status | as_crispy_field }} |
| 34 | + </div> |
| 35 | + </div> |
| 36 | + <div class="row"> |
| 37 | + <div class="col-12 col-md-8 col-lg-6"> |
| 38 | + {{ form.tags | as_crispy_field }} |
| 39 | + </div> |
| 40 | + <div class="col-12 col-md-4 col-lg-3"> |
| 41 | + {% if user.is_staff %} |
| 42 | + <!-- If user is Staff, Assigned To field is enabled --> |
| 43 | + {{ form.assigned_to | as_crispy_field }} |
| 44 | + {% else %} |
| 45 | + <!-- Assigned To field Disabled --> |
| 46 | + <div class="form-group" id="div_id_summary" data-toggle="tooltip" |
| 47 | + title="Only staff can reassign tickets." data-placement="right"> |
| 48 | + <label for="id_assigned"> |
| 49 | + Assigned To |
| 50 | + </label> |
| 51 | + <div class=""> |
| 52 | + <input class="textinput textInput form-control" id="id_assigned" maxlength="300" name="assigned" |
| 53 | + placeholder="{{ ticket.assigned_to }}" type="text" disabled> |
| 54 | + </div> |
| 55 | + </div> |
| 56 | + {% endif %} |
| 57 | + </div> |
| 58 | + </div> |
| 59 | + <div class="row"> |
| 60 | + <div class="col-12"> |
| 61 | + {{ form.screenshot | as_crispy_field }} |
| 62 | + </div> |
| 63 | + </div> |
| 64 | + <hr> |
| 65 | + <button class="btn btn-primary" type="submit"><span class="material-icons align-bottom">send</span> Submit |
| 66 | + Changes</button> |
| 67 | + <a class="float-right" href="{% url 'tickets' %}">Cancel</a> |
| 68 | + </form> |
| 69 | + </div> |
19 | 70 | </div> |
20 | 71 | </div> |
21 | 72 | {% endblock %} |
| 73 | + |
| 74 | +{% block scripts %} |
| 75 | +<!-- Bootstrap tags input js --> |
| 76 | +<script type="text/javascript" src="{% static 'js/bootstrap-tagsinput.js' %}"></script> |
| 77 | +{% endblock %} |
0 commit comments