Child: [46a341] (diff)

Download this file

bin.html    71 lines (64 with data), 2.3 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
{% extends g.theme.master %}
{% do g.register_forge_css('css/hilite.css') %}
{% do g.register_app_css('css/tracker.css') %}
{% block title %}{{c.project.name}} / {{app.config.options.mount_label}} / Saved Search Bins{% endblock %}
{% block head %}
<link rel="alternate" type="application/rss+xml" title="RSS" href="feed.rss"/>
<link rel="alternate" type="application/atom+xml" title="Atom" href="feed.atom"/>
{% endblock %}
{% block header %}Saved Search Bins{% endblock %}
{% block edit_box %}
<div class="editbox" style="display:none">
{{c.bin_form.display(
value=dict(),
action=c.project.url()+'admin/'+app.config.options.mount_point+'/bins/save_bin'
)}}
</div>
{% endblock %}
{% block content %}
{% if bins.__len__() %}
<table>
<thead>
<tr>
<th>Name</th>
<th>Terms</th>
<th>&nbsp;</th>
</tr>
</thead>
<tbody class="bin-list">
{% for bin in bins %}
<tr{% if loop.index0 % 2 == 0 %} class="even"{% endif %}>
<td><a href="{{bin.url()}}">{{bin.summary}}</a></td>
<td>{{bin.terms}}</td>
<td>
<a href="delbin?summary={{bin.summary}}" class="btn">Delete</a>
<a href="#" class="btn bin_edit_activate">Edit</a>
<input type="hidden" name="summary" value="{{bin.summary}}">
<input type="hidden" name="terms" value="{{bin.terms}}">
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
No saved search bins have been created yet.
{% endif %}
{% endblock %}
{% block extra_js %}
<script type="text/javascript">
var form_holder = $('div.editbox');
$('a.bin_edit_activate').click(function(){
form_holder.show();
var editable_holder = $(this).closest('td');
var summary = editable_holder.find('input[name=summary]').val();
form_holder.find('input[name=bin_form.summary]').val(summary);
form_holder.find('input[name=bin_form.old_summary]').val(summary);
form_holder.find('input[name=bin_form.terms]').val(editable_holder.find('input[name=terms]').val());
return false;
});
$('#cancel_new_bin').click(function(){
form_holder.hide();
return false;
});
</script>
{% endblock %}