The Problem

Bema's Room management plug-in has been very helpful. One issue we have found is that on the review page when submitting a new reservation, the submit button is off the page. As a result our users often haven't submitted items they thought were submitted

The Solution

Instead of trying to skip that page, since I want users to review their reservation first. I added an HTML block on the main room reservation page, and one to the reservation detail page.

  • The block on the main page is a list of drafts for the current person. I chose to use the Admin Contact but the Event Contact also works.
  • The block on the detail page has large red warning stating that the reservation is still a draft, until they hit submit.

Main Page HTML Block

  1. Add an HTML block to the main section above the Reservation Lava block
  2. make sure to select Rock Entity on the enable lava commands under settings
  3. Add the code below:
  4.             
                
    "<div id="drafts"> {% reservation where:'ApprovalState == 0 && AdministrativeContactPersonAliasId == {{Person.PrimaryAliasId}}' %} {% assign size = reservationItems | Size %}
            {% if size > 0 %}
                <h3>Your Drafts</h3>
                <h6 style="color:red">Note: These are not sent for approval until you hit submit</h6>
                <ul>
                    {% for item in reservationItems %}
                        <li><a href="https://rock.thecompass.net/ReservationDetail?ReservationId={{item.Id}}">{{item.Name}} - Last Modified: {{item.ModifiedDateTime | Date:'M/d/yy'}}</a><br></li>
                    {% endfor %}<br><br>
                </ul>
            {% endif %}
        {% endreservation %}
    </div>" 
                
            
    To Change to Event Contact change "AdministrativeContactPersonAliasId" with "EventContactPersonAliasId" mainpagedrafts.png

Detail Page HTML Block

  1. Add an HTML block to the main section above the Reservation Lava block
  2. make sure to select Rock Entity on the enable lava commands under settings
  3. Add the Code Below
  4.             
                
    " {% assign id = 'Global' | PageParameter:'ReservationId' %}
    
        {% if id != '' %}
            
            {% reservation id:'{{id}}' %}
                {% if reservation.ApprovalState == 0 %}
                    <h1 style="color:red;text-align:center;">NOTE: This Reservation may still be a draft and not yet submitted.</h1>
                {% endif %}
            {% endreservation %}
        {% endif %}"
                
            
    reservationdetail.png
  5. One Issue is that when the hit submit the page doesn't refresh so the message won't go away until the page refreshes
  6. Add this script to the pre-HTML of the Reservation Detail Block
  7.             
                
    <script>
        $(function(){
            $(document).ready(function() {
                $('a[id*="_btnSubmit"]').on('click',function()
                {
                    setTimeout(() => {location.reload(true);},1000);
                });
        });
    </script>
                
            
  8. You have to refresh the page before the script will work.