Lines 65-102
Link Here
|
65 |
</div> <!-- /.col-sm-2.col-sm-pull-10 --> |
65 |
</div> <!-- /.col-sm-2.col-sm-pull-10 --> |
66 |
</div> <!-- /.row --> |
66 |
</div> <!-- /.row --> |
67 |
|
67 |
|
68 |
<!-- Add concern modal --> |
68 |
[% INCLUDE 'modals/add_catalog_concern.inc' %] |
69 |
<div class="modal" id="addConcernModal" tabindex="-1" role="dialog" aria-labelledby="addConcernLabel"> |
|
|
70 |
<div class="modal-dialog" role="document"> |
71 |
<div class="modal-content"> |
72 |
<div class="modal-header"> |
73 |
<button type="button" class="closebtn" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> |
74 |
<h4 class="modal-title" id="addConcernLabel">Add concern</h4> |
75 |
</div> |
76 |
<div class="modal-body"> |
77 |
<fieldset class="rows"> |
78 |
<ol> |
79 |
<li> |
80 |
<label class="required" for="biblio_id">Biblio: </label> |
81 |
<input type="text" name="biblio_id" id="biblio_add"> |
82 |
<span class="required">Required</span> |
83 |
</li> |
84 |
<li> |
85 |
<label class="required" for="message">Please describe your concern: </label> |
86 |
<textarea id="message_add" name="message" required="required"></textarea> |
87 |
<span class="required">Required</span> |
88 |
<p id="helpBlock" class="help-block">A short summary of what the library policy is for dealing with such concerns and what constitutes a valid concern</p> |
89 |
</li> |
90 |
</ol> |
91 |
</fieldset> |
92 |
</div> <!-- /.modal-body --> |
93 |
<div class="modal-footer"> |
94 |
<button type="submit" class="btn btn-default" id="addConfirm">Confirm</button> |
95 |
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button> |
96 |
</div> <!-- /.modal-footer --> |
97 |
</div> <!-- /.modal-content --> |
98 |
</div> <!-- /.modal-dialog --> |
99 |
</div> <!-- /#addConcernModal --> |
100 |
|
69 |
|
101 |
<!-- Resolve concern modal --> |
70 |
<!-- Resolve concern modal --> |
102 |
<div class="modal" id="resolveConcernModal" tabindex="-1" role="dialog" aria-labelledby="resolveConcernLabel"> |
71 |
<div class="modal" id="resolveConcernModal" tabindex="-1" role="dialog" aria-labelledby="resolveConcernLabel"> |
Lines 137-142
Link Here
|
137 |
[% INCLUDE 'js-date-format.inc' %] |
106 |
[% INCLUDE 'js-date-format.inc' %] |
138 |
[% INCLUDE 'js-patron-format.inc' %] |
107 |
[% INCLUDE 'js-patron-format.inc' %] |
139 |
[% INCLUDE 'js-biblio-format.inc' %] |
108 |
[% INCLUDE 'js-biblio-format.inc' %] |
|
|
109 |
[% Asset.js("js/modals/add_catalog_concern.js") | $raw %] |
140 |
<script> |
110 |
<script> |
141 |
$(document).ready(function() { |
111 |
$(document).ready(function() { |
142 |
|
112 |
|
Lines 262-292
Link Here
|
262 |
$("#concern_resolve_error").html(_("Error resolving concern #%s. Check the logs.").format(concern_id)).show(); |
232 |
$("#concern_resolve_error").html(_("Error resolving concern #%s. Check the logs.").format(concern_id)).show(); |
263 |
}); |
233 |
}); |
264 |
}); |
234 |
}); |
265 |
|
|
|
266 |
$('#addConcernModal').on('click', '#addConfirm', function(e) { |
267 |
let biblio_id = $('#biblio_add').val(); |
268 |
let message = $('#message_add').val(); |
269 |
|
270 |
params = { |
271 |
message: message, |
272 |
biblio_id: biblio_id, |
273 |
reporter_id: logged_in_user_borrowernumber, |
274 |
}; |
275 |
|
276 |
$.ajax({ |
277 |
url: '/api/v1/catalog/concerns', |
278 |
type: 'POST', |
279 |
data: JSON.stringify(params), |
280 |
success: function(data) { |
281 |
$('#AddConcernModal').modal('hide'); |
282 |
|
283 |
if ( $.fn.dataTable.isDataTable("#table_concerns") ) { |
284 |
$("#table_concerns").DataTable().ajax.reload(); |
285 |
} |
286 |
}, |
287 |
contentType: "json" |
288 |
}); |
289 |
}); |
290 |
}); |
235 |
}); |
291 |
</script> |
236 |
</script> |
292 |
[% END %] |
237 |
[% END %] |