<commit_before><table align="center" width="95%">

<tr>
  <td class="formTitle"><a href="${urlHandlers.UHRoomBookingAdmin.getURL()}">&lt;&lt;Back</a></td>
</tr>
% if actionSucceeded:
<tr>
  <td>
    <div class="successfulAction">
    <span class="actionSucceeded"> ${ _("Action succeeded.")}</span>  ${ _("A new room has been added.")}
    </div>
  </td>
</tr>
% endif
<tr>
  <td>
<!-- ==================== General Options ====================== -->
<!-- =========================================================== -->
    <table style="margin-top: 20px;">
    <tr>
      <td colspan="2" class="groupTitle">Location data</td>
    </tr>
    <tr>
      <td class="titleUpCellTD" style="width: 160px;"><span class="titleCellFormat">Name</span></td>
      <td bgcolor="white" valign="top" class="blacktext" style="padding-left: 12px;">${location.friendlyName}</td>
    </tr>
    <tr>
      <td class="titleUpCellTD" style="width: 160px;"><span class="titleCellFormat">Plugin</span></td>
      <td bgcolor="white" valign="top" class="blacktext" style="padding-left: 12px;">${location.factory.getName()}</td>
    </tr>
    <tr>
      <td class="titleUpCellTD" style="width: 160px;"><span class="titleCellFormat">Available Rooms</span></td>
      <td bgcolor="white" valign="top" class="blacktext" style="padding-left: 12px;">
        ${len(Rooms)} rooms found in this location.
        <% url = urlHandlers.UHRoomBookingRoomDetails.getURL() %>
        <form method="post" action="${url}">
        <input type="hidden" name="roomLocation" value="${location.friendlyName}">
        <select name="roomID">
          % for room in Rooms:
            <option value="${room.id}" class="${roomClass( room )}">${ room.getFullName() }</option>
          % endfor
        </select>
        <input class="btn" type="submit" value="Details"/>
        <input class="btn" type="submit" value="Modify" onClick="this.form.action='${ urlHandlers.UHRoomBookingRoomForm.getURL( )}'; this.form.submit();"/>
        <input class="btn" type="submit" value="Delete" onClick="if (confirm('Are you sure you want to delete this room? All related bookings will also be deleted. this action is PERMANENT!')) {this.form.action='${ urlHandlers.UHRoomBookingDeleteRoom.getURL( )}'; this.form.submit();} else { return false; }"/>
        </form>
        <form method="post" action="${urlHandlers.UHRoomBookingRoomForm.getURL( )}">
        <input type="hidden" name="roomLocation" value="${location.friendlyName}">
        <input class="btn" type="submit" value="New Room"/>
        </form>
      </td>
    </tr>
    </table>

    <br/>

    <table>
    <tr>
      <td colspan="2" class="groupTitle">General options</td>
    </tr>
    <tr>
      <td class="titleUpCellTD" style="width: 160px;"><span class="titleCellFormat">Possible equipment</span></td>
      <td bgcolor="white" valign="top" class="blacktext" style="padding-left: 12px;">
        % if AttsManager.supportsAttributeManagement():
            <p style="color: Green;">This location supports dynamic equipment management.</p>
            <form action="${urlHandlers.UHRoomBookingSaveEquipment.getURL(location) }" method="POST">
              <p>
                <input type="text" id="newEquipmentName" name="newEquipmentName" value="" size="28" />
                <input type="submit" class="btn" value="Add" />
              </p>
            </form>
            <form action="${urlHandlers.UHRoomBookingDeleteEquipment.getURL(location) }" method="POST">
              <p>
                <select name="removeEquipmentName" id="removeEquipmentName">
                    % for eq in possibleEquipment:
                        <option value="${eq}">${eq}</option>
                    % endfor
                </select>
                <input type="submit" class="btn" value="Remove" />
              </p>
            </form>
            <p>Information:</p>
            <ul style="text-align:justify; font-size: smaller;">
                <li>Use this to define set of possible equipment for room in the active location.</li>
                <li>On the room searching form, user will be able to choose equipment from this set.</li>
                <li>On new room creation form, you will be able to choose equipment from this set.</li>
            </ul>
        % endif
        % if not AttsManager.supportsAttributeManagement():
            <span style="color: Red;">This location does not support dynamic equipment management.</span><br />
        % endif
      </td>
    </tr>
    <tr><td>&nbsp;</td></tr>
    <tr>
      <td class="titleUpCellTD" style="width: 160px;"><span class="titleCellFormat">Custom room attributes</span></td>
      <td bgcolor="white" valign="top" class="blacktext" style="padding-left: 12px;">
        % if AttsManager.supportsAttributeManagement():
            <p style="color: Green;">This location supports dynamic attributes management.</p>
            <form action="${urlHandlers.UHRoomBookingSaveCustomAttributes.getURL(location)}" method="post">
                <table>
                <tr>
                    <td style="width: 200px;"><b>Name</b></td><td style="width: 70px;"><b>Required</b></td><td style="width: 70px;"><b>Hidden</b></td><td style="width: 260px;"><b>Actions</b></td>
                </tr>
                % for at in AttsManager.getAttributes(location = location.friendlyName):
                    <tr>
                        <td>${ at['name'] }</td>
                        <td><input type="checkbox" name="${ 'cattr_req_' + at['name'] }" ${'checked="checked"' if at['required'] else ""} /></td>
                        <td><input type="checkbox" name="${ 'cattr_hid_' + at['name'] }" ${'checked="checked"' if at.get('hidden',False) else ""} /></td>
                        <td><input type="button" class="btn" value="Remove" onclick="document.location = '${ urlHandlers.UHRoomBookingDeleteCustomAttribute.getURL( location, removeCustomAttributeName = at['name'] ) }'; return false;" /></td>
                    </tr>
                % endfor
                <tr>
                    <td><input type="text" name="newCustomAttributeName" id="newCustomAttributeName" /></td>
                    <td><input type="checkbox" name="newCustomAttributeIsRequired" id="newCustomAttributeIsRequired" /></td>
                    <td><input type="checkbox" name="newCustomAttributeIsHidden" id="newCustomAttributeIsHidden" /></td>
                    <td><input type="submit" class="btn" value="Add new" /></td>
                </tr>
                <tr>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td>
                        <input type="submit" class="btn" value="Save" />${inlineContextHelp('Updates `required` and `hidden` for all existing attributes.' )}
                    </td>
                </tr>
                </table>
            </form>
            <p>Information:</p>
            <ul style="text-align:justify; font-size: smaller;">
                <li>Use this to define room attribues that are specific to the location.</il>
                <li>Custom attributes are subject to free-text search. This means that they <b>will</b> work with "Room description must contain" box on a searching form.</li>
                <li>Custom attributes does not have type. They are kept as free text. It is impossible to add any kind of validation without coding.</li>
            </ul>
        % endif
        % if not AttsManager.supportsAttributeManagement():
            <span style="color: Red;">This location does not support dynamic attributes management.</span><br />
        % endif
      </td>
    </tr>

    <tr><td>&nbsp;</td></tr>
    <tr>
      <td class="titleUpCellTD" style="width: 160px;"><span class="titleCellFormat">Room map attributes</span></td>
      <td bgcolor="white" valign="top" class="blacktext" style="padding-left: 12px;">
        <div id="AspectsListHolder"></div>
      </td>
    </tr>

    </table>
    <br>

<script type="text/javascript">

var newAspectsHandler = function(newAspect, setResult) {
    indicoRequest(
        'roomBooking.mapaspects.create',
        {
            location: '${location.friendlyName}',
            aspect: newAspect
        },
        function(result,error) {
            if (!error) {
                setResult(true);
            } else {
                IndicoUtil.errorReport(error);
                setResult(false);
            }
        }
    );
}

var editAspectHandler = function(oldAspect, setResult, newAspect) {
    indicoRequest(
        'roomBooking.mapaspects.update',
        {
            location: '${location.friendlyName}',
            aspect: newAspect
        },
        function(result,error) {
            if (!error) {
                setResult(true);
            } else {
                IndicoUtil.errorReport(error);
                setResult(false);
            }
        }
    );
}

var removeAspectHandler = function(aspect, setResult) {
    indicoRequest(
        'roomBooking.mapaspects.remove',
        {
            location: '${location.friendlyName}',
            aspectId: aspect.get('id')
        },
        function(result,error) {
            if (!error) {
                setResult(true);
            } else {
                IndicoUtil.errorReport(error);
                setResult(false);
            }
        }<commit_msg>[IMP] Show loading dialog for map aspects<commit_after><table align="center" width="95%">

<tr>
  <td class="formTitle"><a href="${urlHandlers.UHRoomBookingAdmin.getURL()}">&lt;&lt;Back</a></td>
</tr>
% if actionSucceeded:
<tr>
  <td>
    <div class="successfulAction">
    <span class="actionSucceeded"> ${ _("Action succeeded.")}</span>  ${ _("A new room has been added.")}
    </div>
  </td>
</tr>
% endif
<tr>
  <td>
<!-- ==================== General Options ====================== -->
<!-- =========================================================== -->
    <table style="margin-top: 20px;">
    <tr>
      <td colspan="2" class="groupTitle">Location data</td>
    </tr>
    <tr>
      <td class="titleUpCellTD" style="width: 160px;"><span class="titleCellFormat">Name</span></td>
      <td bgcolor="white" valign="top" class="blacktext" style="padding-left: 12px;">${location.friendlyName}</td>
    </tr>
    <tr>
      <td class="titleUpCellTD" style="width: 160px;"><span class="titleCellFormat">Plugin</span></td>
      <td bgcolor="white" valign="top" class="blacktext" style="padding-left: 12px;">${location.factory.getName()}</td>
    </tr>
    <tr>
      <td class="titleUpCellTD" style="width: 160px;"><span class="titleCellFormat">Available Rooms</span></td>
      <td bgcolor="white" valign="top" class="blacktext" style="padding-left: 12px;">
        ${len(Rooms)} rooms found in this location.
        <% url = urlHandlers.UHRoomBookingRoomDetails.getURL() %>
        <form method="post" action="${url}">
        <input type="hidden" name="roomLocation" value="${location.friendlyName}">
        <select name="roomID">
          % for room in Rooms:
            <option value="${room.id}" class="${roomClass( room )}">${ room.getFullName() }</option>
          % endfor
        </select>
        <input class="btn" type="submit" value="Details"/>
        <input class="btn" type="submit" value="Modify" onClick="this.form.action='${ urlHandlers.UHRoomBookingRoomForm.getURL( )}'; this.form.submit();"/>
        <input class="btn" type="submit" value="Delete" onClick="if (confirm('Are you sure you want to delete this room? All related bookings will also be deleted. this action is PERMANENT!')) {this.form.action='${ urlHandlers.UHRoomBookingDeleteRoom.getURL( )}'; this.form.submit();} else { return false; }"/>
        </form>
        <form method="post" action="${urlHandlers.UHRoomBookingRoomForm.getURL( )}">
        <input type="hidden" name="roomLocation" value="${location.friendlyName}">
        <input class="btn" type="submit" value="New Room"/>
        </form>
      </td>
    </tr>
    </table>

    <br/>

    <table>
    <tr>
      <td colspan="2" class="groupTitle">General options</td>
    </tr>
    <tr>
      <td class="titleUpCellTD" style="width: 160px;"><span class="titleCellFormat">Possible equipment</span></td>
      <td bgcolor="white" valign="top" class="blacktext" style="padding-left: 12px;">
        % if AttsManager.supportsAttributeManagement():
            <p style="color: Green;">This location supports dynamic equipment management.</p>
            <form action="${urlHandlers.UHRoomBookingSaveEquipment.getURL(location) }" method="POST">
              <p>
                <input type="text" id="newEquipmentName" name="newEquipmentName" value="" size="28" />
                <input type="submit" class="btn" value="Add" />
              </p>
            </form>
            <form action="${urlHandlers.UHRoomBookingDeleteEquipment.getURL(location) }" method="POST">
              <p>
                <select name="removeEquipmentName" id="removeEquipmentName">
                    % for eq in possibleEquipment:
                        <option value="${eq}">${eq}</option>
                    % endfor
                </select>
                <input type="submit" class="btn" value="Remove" />
              </p>
            </form>
            <p>Information:</p>
            <ul style="text-align:justify; font-size: smaller;">
                <li>Use this to define set of possible equipment for room in the active location.</li>
                <li>On the room searching form, user will be able to choose equipment from this set.</li>
                <li>On new room creation form, you will be able to choose equipment from this set.</li>
            </ul>
        % endif
        % if not AttsManager.supportsAttributeManagement():
            <span style="color: Red;">This location does not support dynamic equipment management.</span><br />
        % endif
      </td>
    </tr>
    <tr><td>&nbsp;</td></tr>
    <tr>
      <td class="titleUpCellTD" style="width: 160px;"><span class="titleCellFormat">Custom room attributes</span></td>
      <td bgcolor="white" valign="top" class="blacktext" style="padding-left: 12px;">
        % if AttsManager.supportsAttributeManagement():
            <p style="color: Green;">This location supports dynamic attributes management.</p>
            <form action="${urlHandlers.UHRoomBookingSaveCustomAttributes.getURL(location)}" method="post">
                <table>
                <tr>
                    <td style="width: 200px;"><b>Name</b></td><td style="width: 70px;"><b>Required</b></td><td style="width: 70px;"><b>Hidden</b></td><td style="width: 260px;"><b>Actions</b></td>
                </tr>
                % for at in AttsManager.getAttributes(location = location.friendlyName):
                    <tr>
                        <td>${ at['name'] }</td>
                        <td><input type="checkbox" name="${ 'cattr_req_' + at['name'] }" ${'checked="checked"' if at['required'] else ""} /></td>
                        <td><input type="checkbox" name="${ 'cattr_hid_' + at['name'] }" ${'checked="checked"' if at.get('hidden',False) else ""} /></td>
                        <td><input type="button" class="btn" value="Remove" onclick="document.location = '${ urlHandlers.UHRoomBookingDeleteCustomAttribute.getURL( location, removeCustomAttributeName = at['name'] ) }'; return false;" /></td>
                    </tr>
                % endfor
                <tr>
                    <td><input type="text" name="newCustomAttributeName" id="newCustomAttributeName" /></td>
                    <td><input type="checkbox" name="newCustomAttributeIsRequired" id="newCustomAttributeIsRequired" /></td>
                    <td><input type="checkbox" name="newCustomAttributeIsHidden" id="newCustomAttributeIsHidden" /></td>
                    <td><input type="submit" class="btn" value="Add new" /></td>
                </tr>
                <tr>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td>
                        <input type="submit" class="btn" value="Save" />${inlineContextHelp('Updates `required` and `hidden` for all existing attributes.' )}
                    </td>
                </tr>
                </table>
            </form>
            <p>Information:</p>
            <ul style="text-align:justify; font-size: smaller;">
                <li>Use this to define room attribues that are specific to the location.</il>
                <li>Custom attributes are subject to free-text search. This means that they <b>will</b> work with "Room description must contain" box on a searching form.</li>
                <li>Custom attributes does not have type. They are kept as free text. It is impossible to add any kind of validation without coding.</li>
            </ul>
        % endif
        % if not AttsManager.supportsAttributeManagement():
            <span style="color: Red;">This location does not support dynamic attributes management.</span><br />
        % endif
      </td>
    </tr>

    <tr><td>&nbsp;</td></tr>
    <tr>
      <td class="titleUpCellTD" style="width: 160px;"><span class="titleCellFormat">Room map attributes</span></td>
      <td bgcolor="white" valign="top" class="blacktext" style="padding-left: 12px;">
        <div id="AspectsListHolder"></div>
      </td>
    </tr>

    </table>
    <br>

<script type="text/javascript">

var newAspectsHandler = function(newAspect, setResult) {
    var killProgress = IndicoUI.Dialogs.Util.progress();
    indicoRequest(
        'roomBooking.mapaspects.create',
        {
            location: '${location.friendlyName}',
            aspect: newAspect
        },
        function(result,error) {
            killProgress();
            if (!error) {
                setResult(true);
            } else {
                IndicoUtil.errorReport(error);
                setResult(false);
            }
        }
    );
}

var editAspectHandler = function(oldAspect, setResult, newAspect) {
    var killProgress = IndicoUI.Dialogs.Util.progress();
    indicoRequest(
        'roomBooking.mapaspects.update',
        {
            location: '${location.friendlyName}',
            aspect: newAspect
        },
        function(result,error) {
            killProgress();
            if (!error) {
                setResult(true);
            } else {
                IndicoUtil.errorReport(error);
                setResult(false);
            }
        }
    );
}

var removeAspectHandler = function(aspect, setResult) {
    var killProgress = IndicoUI.Dialogs.Util.progress();
    indicoRequest(
        'roomBooking.mapaspects.remove',
        {
            location: '${location.friendlyName}',
            aspectId: aspect.get('id')
        },
        function(result,error) {
            killProgress();
            if (!error) {
                setResult(true);
            } else {
                IndicoUtil.errorReport(error);
                setResult(false);
            }
        }
{'fraction_non_alphanumeric': 0.16786595934660434, 'fraction_numerical': 0.005042281632438679, 'mean_word_length': 2.3538840937114673, 'pattern_counts': {'":': 0, '<': 431, '<?xml version=': 0, '>': 431, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6958592', 'n_tokens_mistral': 5579, 'n_tokens_neox': 5260, 'n_words': 1190}