Kanchan Chauhan | b3fe6a4 | 2016-03-16 18:01:22 +0530 | [diff] [blame] | 1 | {% extends "templates/web.html" %} |
| 2 | {% block title %} {{ doc.name }} {% endblock %} |
| 3 | {% block breadcrumbs %} |
Rushabh Mehta | a334062 | 2016-06-23 18:25:50 +0530 | [diff] [blame] | 4 | <div class="page-breadcrumbs" data-html-block="breadcrumbs"> |
Kanchan Chauhan | b3fe6a4 | 2016-03-16 18:01:22 +0530 | [diff] [blame] | 5 | <ul class="breadcrumb"> |
| 6 | <li> |
Rushabh Mehta | 86f8ab9 | 2016-12-05 15:02:24 +0530 | [diff] [blame] | 7 | <span class="fa fa-angle-left"></span> |
Kanchan Chauhan | b3fe6a4 | 2016-03-16 18:01:22 +0530 | [diff] [blame] | 8 | <a href="/projects?project={{ doc.project }}">{{ doc.project }}</a> |
Rushabh Mehta | a334062 | 2016-06-23 18:25:50 +0530 | [diff] [blame] | 9 | </li> |
Kanchan Chauhan | b3fe6a4 | 2016-03-16 18:01:22 +0530 | [diff] [blame] | 10 | </ul> |
| 11 | </div> |
| 12 | {% endblock %} |
| 13 | {% block page_content %} |
Rushabh Mehta | a334062 | 2016-06-23 18:25:50 +0530 | [diff] [blame] | 14 | <div class="row"> |
Kanchan Chauhan | b3fe6a4 | 2016-03-16 18:01:22 +0530 | [diff] [blame] | 15 | <div class=" col-sm-8 "> |
| 16 | <h1> {{ doc.subject }} </h1> |
| 17 | </div> |
Rushabh Mehta | a334062 | 2016-06-23 18:25:50 +0530 | [diff] [blame] | 18 | |
Kanchan Chauhan | b3fe6a4 | 2016-03-16 18:01:22 +0530 | [diff] [blame] | 19 | <div class="col-sm-4"> |
Rushabh Mehta | a334062 | 2016-06-23 18:25:50 +0530 | [diff] [blame] | 20 | <div class="page-header-actions-block" data-html-block="header-actions"> |
Kanchan Chauhan | b3fe6a4 | 2016-03-16 18:01:22 +0530 | [diff] [blame] | 21 | <button type="submit" class="btn btn-primary btn-sm btn-form-submit"> |
| 22 | Update</button> |
| 23 | <a href="tasks" class="btn btn-default btn-sm"> |
| 24 | Cancel</a> |
| 25 | </div> |
| 26 | </div> |
| 27 | </div> |
| 28 | |
| 29 | <div class="page-content-block"> |
| 30 | <form role="form" data-web-form="tasks"> |
Rushabh Mehta | a334062 | 2016-06-23 18:25:50 +0530 | [diff] [blame] | 31 | |
Kanchan Chauhan | b3fe6a4 | 2016-03-16 18:01:22 +0530 | [diff] [blame] | 32 | <input type="hidden" name="web_form" value="tasks"> |
| 33 | <input type="hidden" name="doctype" value="Task"> |
| 34 | <input type="hidden" name="name" value="TASK00056"> |
| 35 | |
| 36 | <div class="row"> |
| 37 | <div class="col-sm-12" style="max-width: 500px;"> |
Rushabh Mehta | a334062 | 2016-06-23 18:25:50 +0530 | [diff] [blame] | 38 | <div class="form-group"> |
Kanchan Chauhan | b3fe6a4 | 2016-03-16 18:01:22 +0530 | [diff] [blame] | 39 | <label for="project" class="control-label text-muted small">Project</label> |
Rushabh Mehta | a334062 | 2016-06-23 18:25:50 +0530 | [diff] [blame] | 40 | <input type="text" class="form-control" name="project" readonly value= "{{ doc.project }}"> |
Kanchan Chauhan | b3fe6a4 | 2016-03-16 18:01:22 +0530 | [diff] [blame] | 41 | </div> |
| 42 | |
| 43 | <div class="form-group"> |
| 44 | <label for="subject" class="control-label text-muted small">Subject</label> |
| 45 | <input type="text" class="form-control" name="subject" readonly value="{{ doc.subject }}"> |
| 46 | </div> |
Rushabh Mehta | a334062 | 2016-06-23 18:25:50 +0530 | [diff] [blame] | 47 | |
Kanchan Chauhan | b3fe6a4 | 2016-03-16 18:01:22 +0530 | [diff] [blame] | 48 | <div class="form-group"> |
| 49 | <label for="description" class="control-label text-muted small">Details</label> |
| 50 | <textarea class="form-control" style="height: 200px;" name="description">{{ doc.description }}</textarea> |
Rushabh Mehta | a334062 | 2016-06-23 18:25:50 +0530 | [diff] [blame] | 51 | </div> |
| 52 | |
Kanchan Chauhan | b3fe6a4 | 2016-03-16 18:01:22 +0530 | [diff] [blame] | 53 | <div class="form-group"> |
| 54 | <label for="priority" class="control-label text-muted small">Priority</label> |
| 55 | <input type="text" class="form-control" name="priority" readonly value="{{ doc.priority }}"> |
| 56 | </div> |
Rushabh Mehta | a334062 | 2016-06-23 18:25:50 +0530 | [diff] [blame] | 57 | |
Kanchan Chauhan | b3fe6a4 | 2016-03-16 18:01:22 +0530 | [diff] [blame] | 58 | <div class="form-group"> |
| 59 | <label for="exp_start_date" class="control-label text-muted small">Expected Start Date</label> |
| 60 | <input type="text" class="form-control hasDatepicker" name="exp_start_date" readonly value="{{ doc.exp_start_date }}"> |
| 61 | </div> |
Rushabh Mehta | a334062 | 2016-06-23 18:25:50 +0530 | [diff] [blame] | 62 | |
Kanchan Chauhan | b3fe6a4 | 2016-03-16 18:01:22 +0530 | [diff] [blame] | 63 | <div class="form-group"> |
| 64 | <label for="exp_end_date" class="control-label text-muted small">Expected End Date</label> |
| 65 | <input type="text" class="form-control hasDatepicker" name="exp_end_date" readonly value="{{ doc.exp_end_date }}"> |
| 66 | </div> |
| 67 | |
| 68 | <div class="form-group"> |
| 69 | <label for="status" class="control-label text-muted small">Status</label> |
| 70 | <select class="form-control" name="status" id="status" data-label="Status" data-fieldtype="Select"> |
| 71 | <option value="Open" selected="selected"> |
| 72 | Open</option><option value="Working"> |
| 73 | Working</option><option value="Pending Review"> |
| 74 | Pending Review</option><option value="Overdue"> |
| 75 | Overdue</option><option value="Closed"> |
| 76 | Closed</option><option value="Cancelled"> |
| 77 | Cancelled</option> |
| 78 | </select> |
| 79 | </div> |
| 80 | </div> |
Rushabh Mehta | a334062 | 2016-06-23 18:25:50 +0530 | [diff] [blame] | 81 | </div> |
Kanchan Chauhan | b3fe6a4 | 2016-03-16 18:01:22 +0530 | [diff] [blame] | 82 | </form> |
| 83 | </div> |
| 84 | |
| 85 | <div class="comments"> |
| 86 | <h3>Comments</h3> |
| 87 | <div class="no-comment"> |
| 88 | {% for comment in comments %} |
Rushabh Mehta | 397e508 | 2017-01-21 16:57:24 +0530 | [diff] [blame] | 89 | <p class="text-muted">{{comment.sender_full_name}}: |
| 90 | {{comment.subject}} on {{comment.creation.strftime('%Y-%m-%d')}}</p> |
Kanchan Chauhan | b3fe6a4 | 2016-03-16 18:01:22 +0530 | [diff] [blame] | 91 | {% endfor %} |
| 92 | </div> |
| 93 | <div class="comment-form-wrapper"> |
| 94 | <a class="add-comment btn btn-default btn-sm">Add Comment</a> |
| 95 | <div style="display: none;" id="comment-form"> |
| 96 | <p>Add Comment</p> |
Rushabh Mehta | a334062 | 2016-06-23 18:25:50 +0530 | [diff] [blame] | 97 | <form> |
Kanchan Chauhan | b3fe6a4 | 2016-03-16 18:01:22 +0530 | [diff] [blame] | 98 | <fieldset> |
| 99 | <textarea class="form-control" name="comment" rows="5" placeholder="Comment"></textarea> |
| 100 | <p> |
| 101 | <button class="btn btn-primary btn-sm" id="submit-comment">Submit</button> |
| 102 | </p> |
| 103 | </fieldset> |
| 104 | </form> |
| 105 | </div> |
| 106 | </div> |
| 107 | </div> |
| 108 | <script> |
| 109 | frappe.ready(function() { |
| 110 | var n_comments = $(".comment-row").length; |
| 111 | $(".add-comment").click(function() { |
| 112 | $(this).toggle(false); |
| 113 | $("#comment-form").toggle(); |
| 114 | $("#comment-form textarea").val(""); |
| 115 | }) |
| 116 | $("#submit-comment").click(function() { |
| 117 | var args = { |
| 118 | comment_by_fullname: "test", |
| 119 | comment_by: "admin@localhost.com", |
| 120 | comment: $("[name='comment']").val(), |
| 121 | reference_doctype: "Task", |
| 122 | reference_name: "TASK00069", |
| 123 | comment_type: "Comment", |
Rushabh Mehta | a334062 | 2016-06-23 18:25:50 +0530 | [diff] [blame] | 124 | route: "tasks", |
Kanchan Chauhan | b3fe6a4 | 2016-03-16 18:01:22 +0530 | [diff] [blame] | 125 | } |
| 126 | |
| 127 | frappe.call({ |
| 128 | btn: this, |
| 129 | type: "POST", |
| 130 | method: "frappe.templates.includes.comments.comments.add_comment", |
| 131 | args: args, |
| 132 | callback: function(r) { |
| 133 | if(r.exc) { |
| 134 | if(r._server_messages) |
| 135 | frappe.msgprint(r._server_messages); |
| 136 | } else { |
| 137 | $(r.message).appendTo("#comment-list"); |
| 138 | $(".no-comment, .add-comment").toggle(false); |
| 139 | $("#comment-form") |
| 140 | .replaceWith('<div class="text-muted">Thank you for your comment!</div>') |
| 141 | } |
| 142 | } |
| 143 | }) |
| 144 | |
| 145 | return false; |
| 146 | }) |
| 147 | }); |
| 148 | </script> |
Rushabh Mehta | a334062 | 2016-06-23 18:25:50 +0530 | [diff] [blame] | 149 | |
Kanchan Chauhan | b3fe6a4 | 2016-03-16 18:01:22 +0530 | [diff] [blame] | 150 | {% endblock %} |