blob: 6a2adddec99c35a3153178bfbd95811ffcc88611 (
plain)
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
|
{%extends "base.html"%}
{%load selectable_tags%}
{%load commitfest%}
{%block contents%}
<form class="form-horizontal {{extraformclass}}" method="POST" action=".">{%csrf_token%}
{%if form.errors%}
<div class="alert">Please correct the errors below, and re-submit the form.</div>
{%endif%}
{%if form.non_field_errors%}
<div class="alert alert-danger">{{form.non_field_errors}}</div>
{%endif%}
{%if note%}
<div class="alert alert-info">{{note|safe}}</div>
{%endif%}
{%for field in form%}
{%if not field.is_hidden%}
<div class="form-group">
{{field|label_class:"control-label col-lg-1"}}
<div class="col-lg-11 controls">
{%if field.errors %}
{%for e in field.errors%}
<div class="alert alert-danger">{{e}}</div>
{%endfor%}
{%endif%}
{{field|field_class:"form-control"}}
{%if field.help_text%}<br/>{{field.help_text|safe}}{%endif%}</div>
</div>
{%else%}
{{field}}
{%endif%}
{%endfor%}
<div class="form-group">
<div class="col-lg-12">
<div class="control"><input type="submit" class="btn btn-default" value="{{savebutton|default:"Save"}}"></div>
</div>
</div>
</form>
{%if threadbrowse %}
{%include "thread_attach.inc" %}
{%endif%}
<div class="modal fade" id="searchUserModal" role="dialog">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3>Search user</h3>
</div>
<div class="modal-body">
<form class="form-inline" style="margin-bottom: 5px;">
<div class="input-append">
<input id="searchUserSearchField" type="text" class="span2 search-query" autocomplete="off">
<button id="searchUserSearchButton" onclick="return findUsers()" class="btn btn-default">Search</button>
</div>
</form>
<div>Search for users above and then pick one in the list below:</div>
<div id="searchUserListWrap">
<select id="searchUserList" size="6" style="width:100%;" onchange="searchUserListChanged()"></select>
</div>
</div>
<div class="modal-footer">
<a href="#" class="btn btn-default" data-dismiss="modal">Close</a>
<a href="#" id="doSelectUserButton" class="btn btn-default btn-primary disabled">Add user to system</a>
</div>
</div>
</div>
</div>
{%endblock%}
{%block morescript%}
<script>
/* Set up djselectable to use bootstrap buttons */
$.ui.djselectable.prototype._comboButtonTemplate = function (input) {
var icon = $("<i>").addClass("glyphicon glyphicon-chevron-down");
// Remove current classes on the text input
$(input).attr("class", "");
// Wrap with input-append
$(input).wrap('<div class="input-append" />');
// Return button link with the chosen icon
return $("<a>").append(icon).addClass("btn btn-default btn-xs");
};
$.ui.djselectable.prototype._removeButtonTemplate = function (item) {
var icon = $("<i>").addClass("glyphicon glyphicon-remove-sign");
// Return button link with the chosen icon
return $("<a>").append(icon).addClass("btn btn-default btn-xs selectable-deck-remove");
};
/* Set up userid selectables to be searchable */
$('input[data-selectable-url="/selectable/commitfest-userlookup/"]').each(function() {
$(this).after(
$('<a href="#" class="btn btn-default btn-sm">Import user not listed</a>').click(function () {
search_and_store_user();
return false;
})
);
});
$('#searchUserModal').on('shown.bs.modal', function() {
$('#searchUserSearchField').focus();
});
/* Build our button callbacks */
$(document).ready(function() {
$('button.attachThreadButton').each(function (i,o) {
var b = $(o);
b.click(function() {
$('#attachThreadAttachOnly').val('1');
browseThreads(function(msgid) {
b.prev().val(msgid);
return true;
});
return false;
});
});
});
</script>
{%endblock%}
|