Recipe - Group Viewer Meeting Details Accordion (Locations + Schedules + Links) - QoL
Skill level: Beginner
Organization: Houston's First Baptist Church
Requires Rock: 1.5.0
{# strip images & classes from the HTML but otherwise leave structure #}
Why
Add a clean “Meeting Details” panel to the Group Viewer so checkin admins and staff that need to can see each Location with its linked Schedules at a glance. Click the location pin to jump to the Location; click a schedule to jump straight to that Schedule’s admin page.
What you get
- Location icon links to the Location admin page
- Schedule links go straight to Schedule admin
Setup
- Add an HTML Content block to your Group Viewer page (I put mine under the group details).
- Paste the Lava below, change the url for the links to match your environment and save.
- Make sure to set the security for those you want to see these details since they link to the checkin schedule and location settings pages
Lava
{% assign group = Group %}
{% assign groupId = 'Global' | PageParameter:'GroupId' | ToInteger %}
{% if groupId > 0 %}
{% assign group = groupId | GroupById %}
{% else %}
<div class="alert alert-warning">No group context found.</div>
{% return %}
{% endif %}
{% assign gl = group.GroupLocations | Sort:'Order,Location.Name' %}
{% if gl == empty %}
{% return %}
{% endif %}
{% assign accId = 'gl-acc-' | Append: group.Id %}
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Meeting Details</h3>
</div>
<div class="panel-body">
<div class="panel-group" id="{{ accId }}" role="tablist" aria-multiselectable="true">
{% for x in gl %}
{% assign loc = x.Location %}
{% assign schedules = x.Schedules | Sort:'Name' %}
{% assign scount = schedules | Size %}
{% assign cid = 'collapse-' | Append: x.Id %}
{% assign hid = 'heading-' | Append: x.Id %}
<div class="panel panel-default">
<div class="panel-heading" role="tab" id="{{ hid }}" data-toggle="collapse" data-parent="#{{ accId }}" data-target="#{{ cid }}">
<h4 class="panel-title" style="margin:0;">
{% if loc and loc.Id %}
{% comment %}Make sure to adjust this path to the relevant one for your environment{% endcomment %}
<a href="https://rock.yourchurch.org/admin/checkin/named-locations?LocationId={{ loc.Id }}" title="Open location" onclick="event.stopPropagation();" class="text-muted">
<i class="fa fa-map-marker"></i>
</a>
{% endif %}
<a class="collapsed" role="button" href="#{{ cid }}" aria-expanded="false" aria-controls="{{ cid }}">
{{ loc.Name }}
</a>
{% if scount > 0 %}
<span class="small text-muted pull-right">{{ scount }} schedule{% if scount != 1 %}s{% endif %}</span>
{% endif %}
</h4>
</div>
<div id="{{ cid }}" class="panel-collapse collapse" role="tabpanel" aria-labelledby="{{ hid }}">
<div class="panel-body">
{% if loc.FormattedAddress %}
<div class="small text-muted">{{ loc.FormattedAddress }}</div>
{% endif %}
{% if schedules != empty %}
<ul class="list-unstyled">
{% for s in schedules %}
{% comment %}Make sure to adjust this path to the relevant one for your environment{% endcomment %}
<li><i class="fa fa-calendar-o"></i> <a href="https://rock.yourchurch.org/admin/checkin/schedules?ScheduleId={{ s.Id }}">{{ s.Name }}</a></li>
{% endfor %}
</ul>
{% else %}
<div class="text-muted">No schedules linked to this location.</div>
{% endif %}
</div>
</div>
</div>
{% endfor %}
</div>
</div>
</div>
Troubleshooting
- No group context: ensure the URL has
?GroupId= or ?GroupGuid=, or set the Context Entity to Group.
Download related file (groupViewerMeetingDetails.lava)