diff --git a/horizon/static/horizon/js/horizon.modals.js b/horizon/static/horizon/js/horizon.modals.js index a0535de340..1cce0b3696 100644 --- a/horizon/static/horizon/js/horizon.modals.js +++ b/horizon/static/horizon/js/horizon.modals.js @@ -42,8 +42,11 @@ horizon.modals.create = function (title, body, confirm, cancel) { horizon.modals.success = function (data) { var modal; - $('#modal_wrapper').append(data); - modal = $('.modal:last'); + var modal_wrapper = $('#modal_wrapper'); + // Moves the modal_wrapper to the bottom. This shows it over other dialogs. + modal_wrapper.parent().append(modal_wrapper); + modal_wrapper.append(data); + modal = $('#modal_wrapper > .modal:last'); modal.modal(); $(modal).trigger("new_modal", modal); return modal; diff --git a/openstack_dashboard/dashboards/project/images/images/views.py b/openstack_dashboard/dashboards/project/images/images/views.py index d803168662..0cdd5e7ca4 100644 --- a/openstack_dashboard/dashboards/project/images/images/views.py +++ b/openstack_dashboard/dashboards/project/images/images/views.py @@ -49,6 +49,23 @@ class CreateView(forms.ModalFormView): success_url = reverse_lazy("horizon:project:images:index") page_title = _("Create An Image") + def get_initial(self): + initial = {} + for name in [ + 'name', + 'description', + 'image_url', + 'source_type', + 'architecture', + 'disk_format', + 'minimum_disk', + 'minimum_ram' + ]: + tmp = self.request.GET.get(name) + if tmp: + initial[name] = tmp + return initial + class UpdateView(forms.ModalFormView): form_class = project_forms.UpdateImageForm diff --git a/openstack_dashboard/dashboards/project/stacks/views.py b/openstack_dashboard/dashboards/project/stacks/views.py index dc34564ebe..5b0f21dd97 100644 --- a/openstack_dashboard/dashboards/project/stacks/views.py +++ b/openstack_dashboard/dashboards/project/stacks/views.py @@ -95,6 +95,17 @@ class SelectTemplateView(forms.ModalFormView): success_url = reverse_lazy('horizon:project:stacks:launch') page_title = _("Select Template") + def get_initial(self): + initial = {} + for name in [ + 'template_url', + 'template_source' + ]: + tmp = self.request.GET.get(name) + if tmp: + initial[name] = tmp + return initial + def get_form_kwargs(self): kwargs = super(SelectTemplateView, self).get_form_kwargs() kwargs['next_view'] = CreateStackView diff --git a/openstack_dashboard/static/app/tech-debt/image-form.controller.js b/openstack_dashboard/static/app/tech-debt/image-form.controller.js index 9b3237ef25..e5eca99de5 100644 --- a/openstack_dashboard/static/app/tech-debt/image-form.controller.js +++ b/openstack_dashboard/static/app/tech-debt/image-form.controller.js @@ -18,9 +18,12 @@ .module('horizon.app.tech-debt') .controller('ImageFormController', ImageFormController); - function ImageFormController() { - var ctrl = this; + ImageFormController.$inject = ['$element']; + function ImageFormController($element) { + var ctrl = this; + ctrl.copyFrom = $element('.image_url').val(); + ctrl.diskFormat = $element('.disk_format').val(); ctrl.selectImageFormat = function (path) { if (!path) { return; } var format = path.substr(path.lastIndexOf(".") + 1)