From 31dfe6a495c9ae2e8514719e209cf9ef39c5ae8e Mon Sep 17 00:00:00 2001
From: Te Hung Tseng <te-hung.tseng@ess.eu>
Date: Fri, 19 Mar 2021 13:22:48 +0100
Subject: [PATCH] Added a warning message for create vm due to ppl pressing it
 serveral times

---
 app/templates/_helpers.html          | 4 ++--
 app/templates/network/view_host.html | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/app/templates/_helpers.html b/app/templates/_helpers.html
index cf28011..90df01d 100644
--- a/app/templates/_helpers.html
+++ b/app/templates/_helpers.html
@@ -184,7 +184,7 @@
 </div>
 {%- endmacro %}
 
-{% macro submit_button_with_confirmation(title, message) -%}
+{% macro submit_button_with_confirmation(title, message, message2) -%}
 <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#submitModal" }}>
   {{ title }}
 </button>
@@ -194,7 +194,7 @@
   <div class="modal-dialog" role="document">
     <div class="modal-content">
       <div class="modal-header">
-        <h6 class="modal-title">{{ message }}</h6>
+        <h6 class="modal-title">{{ message }} {% if message2 is defined %}<br/><br/><br/> {{ message2 }} {% endif %}</h6>
         <button type="button" class="close" data-dismiss="modal" aria-label="Close">
           <span aria-hidden="true">&times;</span>
         </button>
diff --git a/app/templates/network/view_host.html b/app/templates/network/view_host.html
index 0e86bd8..8c53b9d 100644
--- a/app/templates/network/view_host.html
+++ b/app/templates/network/view_host.html
@@ -80,7 +80,7 @@
           {% if current_user.is_admin %}
           {{ render_field(form.skip_post_install_job, label_size='5', input_size='7') }}
           {% endif %}
-          {{ submit_button_with_confirmation('Create ' + vm_type, 'Do you really want to create the ' + vm_type + ' ' + host.name + '?') }}
+          {{ submit_button_with_confirmation('Create ' + vm_type, 'Do you really want to create the ' + vm_type + ' ' + host.name + '?', 'Note: If you are experiencing issues with the VM, pressing "Create VM" once more will not resolve anything and you should instead contact the INFRA team or create a JIRA ticket to resolve this.') }}
         </form>
       </div>
     {% elif host.device_type.name in config.ALLOWED_SET_BOOT_PROFILE_DEVICE_TYPES %}
-- 
GitLab