[Rt-commit] rtir branch, 4.2-theme/migrate-to-elevator-themes, updated. 4.0.1rc1-103-gbbf50daa
Blaine Motsinger
blaine at bestpractical.com
Thu Sep 19 17:30:53 EDT 2019
The branch, 4.2-theme/migrate-to-elevator-themes has been updated
via bbf50daa950a7807f5c786c0d629c5688bbaf1b7 (commit)
from f02a074400ca4305791e76db6bdcbb298121593f (commit)
Summary of changes:
html/RTIR/Elements/CreateInRTIRQueueModal | 49 ++++++++++++++++++++++---------
static/js/rtir.js | 15 ++++++----
2 files changed, 45 insertions(+), 19 deletions(-)
- Log -----------------------------------------------------------------
commit bbf50daa950a7807f5c786c0d629c5688bbaf1b7
Author: Blaine Motsinger <blaine at bestpractical.com>
Date: Thu Sep 19 16:28:19 2019 -0500
Migrate modals to new elevator themes
diff --git a/html/RTIR/Elements/CreateInRTIRQueueModal b/html/RTIR/Elements/CreateInRTIRQueueModal
index f0e643a0..8754d493 100644
--- a/html/RTIR/Elements/CreateInRTIRQueueModal
+++ b/html/RTIR/Elements/CreateInRTIRQueueModal
@@ -45,24 +45,45 @@
%# those contributions and any derivatives thereof.
%#
%# END BPS TAGGED BLOCK }}}
-<form action="<% RT::IR->HREFTo('Create.html') %>" id="CreateInQueue">
+<div class="modal-dialog modal-dialog-centered" role="document">
+ <div class="modal-content">
+ <div class="modal-header">
+ <h5 class="modal-title"><&|/l, $ticket_type &>Create [_1]</&></h5>
+ <a href="javascript:void(0)" class="close" data-dismiss="modal" aria-label="Close">
+ <span aria-hidden="true">×</span>
+ </a>
+ </div>
+ <div class="modal-body">
+ <form action="<% RT::IR->HREFTo('Create.html') %>" id="CreateInQueue">
% if ($Incident) {
-<input type="hidden" name="Incident" value="<%$Incident%>"/>
+ <input type="hidden" name="Incident" value="<%$Incident%>"/>
% }
% if ($Child) {
-<input type="hidden" name="Child" value="<%$Child%>"/>
+ <input type="hidden" name="Child" value="<%$Child%>"/>
% }
- <&|/l_unsafe, $ticket_type,
- $m->scomp('/RTIR/Elements/SelectRTIRQueue',
- Name => 'Queue',
- Lifecycle => $Lifecycle,
- ShowNullOption => 0,
- LimitToConstituency => $limit_to_constituency,
- Constituency => $m->{'RTIR_ConstituencyFilter'} || $linked_constituency)
-
- &>Create a new [_1] in the queue [_2]</&>
- <& /Elements/Submit, Label => loc("Go"), Caption => loc("This will take you to a partially prefilled [_1] creation form.", $ticket_type) &>
-</form>
+ <div class="form-row">
+ <div class="col-md-12 text-center">
+ <&|/l, $ticket_type &>Create a new [_1] in the queue</&>:
+ <div class="d-inline-block">
+ <& /RTIR/Elements/SelectRTIRQueue,
+ Name => 'Queue',
+ Lifecycle => $Lifecycle,
+ ShowNullOption => 0,
+ LimitToConstituency => $limit_to_constituency,
+ Constituency => $m->{'RTIR_ConstituencyFilter'} || $linked_constituency
+ &>
+ </div>
+ </div>
+ </div>
+ <div class="form-row">
+ <div class="col-md-12">
+ <& /Elements/Submit, Label => loc("Go"), Caption => loc("This will take you to a partially prefilled [_1] creation form.", $ticket_type) &>
+ </div>
+ </div>
+ </form>
+ </div>
+ </div>
+</div>
<%INIT>
$Lifecycle = $Lifecycle->[0] if (ref $Lifecycle eq 'ARRAY');
diff --git a/static/js/rtir.js b/static/js/rtir.js
index 79c08de9..92616cb0 100644
--- a/static/js/rtir.js
+++ b/static/js/rtir.js
@@ -26,13 +26,18 @@ jQuery(function() {
var queues = jQuery(html).find("select[name='Queue'] > option");
if (queues.length === 1) {
window.location.href = RT.Config .WebHomePath + '/RTIR/Create.html?Queue=' + queues.first().val() + '&' + queryString;
- return;
+ return;
}
- jQuery("<div class='modal'></div>")
- .append(html).appendTo("body")
- .bind('modal:close', function(ev,modal) { modal.elm.remove(); })
- .modal();
+ var modal = jQuery("<div class='modal'></div>");
+ modal.append(html).appendTo("body");
+ modal.bind('modal:close', function(ev) { modal.remove(); })
+ modal.on('hide.bs.modal', function(ev) { modal.remove(); })
+ modal.modal('show');
+
+ // We need to refresh the select picker plugin on AJAX calls
+ // since the plugin only runs on page load.
+ jQuery('.selectpicker').selectpicker('refresh');
}
);
};
-----------------------------------------------------------------------
More information about the rt-commit
mailing list