source: remit/remit_templates/vouchers/reimbursementrequest_list.html @ af48a00

client
Last change on this file since af48a00 was af48a00, checked in by Alex Dehnert <adehnert@…>, 15 years ago

JS select none/all/invert on request list page

  • Property mode set to 100644
File size: 3.6 KB
Line 
1{% extends "base.html" %}
2{% load misc %}
3
4{% block title %}List reimbursement requests{% endblock %}
5{% block content %}
6
7<h2>List Reimbursement Requests</h2>
8
9{%if useronly%}
10<p>Displaying only vouchers related to you.</p>
11{%else%}
12<p>You have permission to list all vouchers.</p>
13{%endif%}
14
15<form method='get' action=''>
16<h3>Filter and Sort</h3>
17
18<table class='pretty-table'>
19<tr>
20    <th>Approval Status</th>
21    <td><select name='approval_status'>
22    <option value='all'{%ifequal approval_status "all"%} selected='selected'{%endifequal%}>All</option>
23    {% for id,label in approval_states %}
24    <option value='{{id}}'{%ifequal approval_status id%} selected='selected'{%endifequal%}>{{label}}</option>
25    {% endfor %}
26    </select></td>
27</tr>
28<tr>
29    <th>Order</th>
30    <td><select name='order'>
31    {% for name,label,cols in orders %}
32    <option value='{{name}}'{%ifequal order name%} selected='selected'{%endifequal%}>{{label}}</option>
33    {% endfor %}
34    </select></td>
35</tr>
36<tr>
37    <th colspan='2'><input type='submit' name='submit' value='Submit' /></th>
38</tr>
39</table>
40</form>
41
42<p><br /></p>
43
44<form method='post' action=''>
45<h3>Request List</h3>
46
47<table class='pretty-table' id='request-list'>
48<tr>
49    <th>#</th>
50    <th>Name</th>
51    <th>Amount</th>
52    <th>Check to</th>
53    <th>Accounts</th>
54    <th>Approval state (date)</th>
55</tr>
56{% for object in object_list %}
57<tr>
58    <td>
59        <input type='checkbox' name='select' value='{{object.pk}}'{%ifin object.pk selected_ids %} checked='checked'{%endifin%}></input>
60        <a href='{% url review_request object.pk %}'>{{ object.pk }}</a>
61    </td>
62    <td>
63        <a href='{% url review_request object.pk %}'>{{ object.name }}</a>
64        {% if object.documentation %}<br />(has docs){%endif%}
65    </td>
66    <td>
67        ${{ object.amount }}
68    </td>
69    <td>
70        {{ object.check_to_first_name }} {{ object.check_to_last_name }}<br />
71        <a href='mailto:{{ object.check_to_email }}'>{{ object.check_to_email }}</a><br />
72        (Submitter {{ object.submitter }})
73    </td>
74    <td>
75        Term: {{ object.budget_term }}<br />
76        Budget: {{ object.budget_area|budgetarea_pathstr:3 }}<br />
77        GL: {{ object.expense_area|budgetarea_pathstr:2 }}
78    </td>
79    <td class='request-status-{{ object.approval_status|approval_status_class}}'>
80        {{ object.approval_status|approval_status }} ({{ object.approval_time }})
81    </td>
82</tr>
83{% endfor %}
84</table>
85
86<ul class='select-modifiers'>
87<li><a id='select-all'   href='#'>Select All</a></li>
88<li><a id='select-none'  href='#'>Select None</a></li>
89<li><a id='select-other' href='#'>Invert Selection</a></li>
90</ul>
91
92<script type='text/javascript'>
93$('#select-all').click(function(){
94    $('#request-list input:checkbox').attr('checked', 'checked');
95    return false;
96});
97$('#select-none').click(function(){
98    $('#request-list input:checkbox').removeAttr('checked');
99    return false;
100});
101$('#select-other').click(function(){
102    $('#request-list input:checkbox').each(function(){
103        this.checked = !this.checked;
104    });
105    return false;
106});
107</script>
108
109<h3>Bulk Actions</h3>
110
111<p>
112    <select name='action'>
113        <option value="none" selected="selected">-----------</option>
114        {% for action in actions %}
115        <option value='{{action.name}}'>{{action.label}}</option>
116        {%endfor%}
117    </select>
118    <input type='submit' name='apply-action' value='Apply' />
119</p>
120
121{%if action_message%}
122<p>{{action_message}}</p>
123{% if action_errors %}
124<p>Errors:</p>
125<table class='pretty-table'>
126<tr>
127    <th>ID</th>
128    <th>Message</th>
129{% for err in action_errors %}
130<tr><th>{{err.0.pk}}</th><td>{{err.1}}</td></tr>
131{%endfor%}
132</ul>
133{%endif%}
134{%endif%}
135</form>
136
137{% endblock %}
Note: See TracBrowser for help on using the repository browser.