<!-- we show order made and give the option to go to the user area-->
<div class="centerelements" data-container>
  <div class="msgbox" style="position:relative;" data-tit>
    <div data-butedit class="btmiddleright"></div>
    <span data-value></span>
  </div>
  <div data-order></div>
  <div>
    <span style="position:relative;">
      <div data-id="butedit" class="btmiddleright"></div>
      <input type="hidden" name="customsubject" disabled="true">
      <script>
        const myNode=thisNode.getNextChild("mails").getNextChild("newordercustomer").getNextChild("subject").getRelationship("siteelementsdata").getChild();
        myNode.writeProp(thisElement);
        //adding the edition pencil
        if (webuser.isWebAdmin() || webuser.isSystemAdmin() || webuser.isOrdersAdmin()) {
          const {visibleOnMouseOver}=await import('./' + CLIENT_MODULES_PATH + 'frontutils.mjs');
          visibleOnMouseOver(thisElement.parentElement.querySelector('[data-id=butedit]'), thisElement.parentElement);
          myNode.appendView(thisElement.parentElement.querySelector('[data-id=butedit]'), "butedit", {editElement: thisElement});
          thisElement.type="text";
        }
      </script>
    </span>
    <span style="position:relative;">
      <div data-id="butedit" class="btmiddleright"></div>
      <textarea name="custommessage" style="visibility:hidden;" disabled="true"></textarea>
      <script>
        const myNode=thisNode.getNextChild("mails").getNextChild("newordercustomer").getNextChild("message").getRelationship("siteelementsdata").getChild();
        myNode.writeProp(thisElement);
        //adding the edition pencil
        if (webuser.isWebAdmin() || webuser.isSystemAdmin() || webuser.isOrdersAdmin()) {
          const {visibleOnMouseOver}=await import('./' + CLIENT_MODULES_PATH + 'frontutils.mjs');
          visibleOnMouseOver(thisElement.parentElement.querySelector('[data-id=butedit]'), thisElement.parentElement);
          myNode.appendView(thisElement.parentElement.querySelector('[data-id=butedit]'), "butedit", {editElement: thisElement});
          thisElement.style.visibility="visible"
        }
      </script>
    </span>
    <span style="position:relative;">
      <div data-id="butedit" class="btmiddleright"></div>
      <input type="hidden" name="adminsubject" disabled="true">
      <script>
        const myNode=thisNode.getNextChild("mails").getNextChild("neworderadmin").getNextChild("subject").getRelationship("siteelementsdata").getChild();
        myNode.writeProp(thisElement);
        //adding the edition pencil
        if (webuser.isWebAdmin() || webuser.isSystemAdmin() || webuser.isOrdersAdmin()) {
          const {visibleOnMouseOver}=await import('./' + CLIENT_MODULES_PATH + 'frontutils.mjs');
          visibleOnMouseOver(thisElement.parentElement.querySelector('[data-id=butedit]'), thisElement.parentElement);
          myNode.appendView(thisElement.parentElement.querySelector('[data-id=butedit]'), "butedit", {editElement: thisElement});
          thisElement.type="text";
        }
      </script>
    </span>
    <span style="position:relative;">
      <div data-id="butedit" class="btmiddleright"></div>
      <textarea name="adminmessage" style="visibility:hidden;" disabled="true"></textarea>
      <script>
        const myNode=thisNode.getNextChild("mails").getNextChild("neworderadmin").getNextChild("message").getRelationship("siteelementsdata").getChild();
        myNode.writeProp(thisElement);
        //adding the edition pencil
        if (webuser.isWebAdmin() || webuser.isSystemAdmin() || webuser.isOrdersAdmin()) {
          const {visibleOnMouseOver}=await import('./' + CLIENT_MODULES_PATH + 'frontutils.mjs');
          visibleOnMouseOver(thisElement.parentElement.querySelector('[data-id=butedit]'), thisElement.parentElement);
          myNode.appendView(thisElement.parentElement.querySelector('[data-id=butedit]'), "butedit", {editElement: thisElement});
          thisElement.style.visibility="visible"
        }
      </script>
    </span>
  </div>
  <script>
    const {default: config} = await import('./' + CLIENT_CONFIG_PATH + 'main.mjs');
    //We send notifications:
    if (config.newordermailcustomer_On) {
      new user().sendmail(webuser.props.username, thisElement.querySelector("[name=customsubject]").value, thisElement.querySelector("[name=custommessage]").value, 'USER_ORDERSADMIN');
    }
    //We send notifications:
    if (config.newordermailadmin_On) {
      new user().sendmail('USER_ORDERSADMIN', thisElement.querySelector("[name=adminsubject]").value, thisElement.querySelector("[name=adminmessage]").value, webuser.props.username);
    }
  </script>
</div>