RockRX 2026 Rock, Paper, Passport Takeaways

Click HERE for the presentation slide deck.



Code 1SQL Query to Find the Team Donation Group Role Id

After creating your "Team Donation Group Role", use the SQL query below in your SQL Editor to find the Id number to use in the Team Member HTML block.

SQL
SELECT
  gtr.[Id] AS [GroupRoleId],
  gtr.[Name],
  gtr.[IsLeader],
  gtr.[CanView],
  gtr.[CanEdit],
  gtr.[CanManageMembers],
  gtr.[Order]
FROM [GroupTypeRole] gtr
WHERE gtr.[GroupTypeId] = 31
ORDER BY gtr.[Order], gtr.[Name]
↑ Back to top

Code 2Group Fundraising Progress Total HTML Block

The code below generates the Group Fundraising Progress bar.

Sample screenshot of the Group Fundraising Progress bar
Lava
{% assign groupId = 'Global' | PageParameter:'GroupId' | AsInteger | Default:0 %}
{% comment %}To hardcode this page you would change the line above to {% assign groupId = XXXXX  %} with the XXXXX as YOUR Group Id number.
  Casting through AsInteger also protects the {% sql %} block below from SQL injection via the querystring.{% endcomment %}
{% assign group = groupId | GroupById %}
{% assign accountId = group | Attribute:'FinancialAccount','Id' | AsInteger | Default:0 %}
<!-- Query total raised for the group across all members -->
{% sql %}
    SELECT
        ISNULL(SUM(ftd.Amount), 0) AS TotalRaised
    FROM [FinancialTransactionDetail] ftd
    INNER JOIN [FinancialTransaction] ft ON ft.Id = ftd.TransactionId
    INNER JOIN [GroupMember] gm ON gm.Id = ftd.EntityId
    WHERE ftd.EntityTypeId = 90
      AND gm.GroupId = {{ groupId }}
      AND gm.GroupMemberStatus = 1
      AND ftd.AccountId = {{ accountId }}
{% endsql %}
{% assign totalRaised = results[0].TotalRaised | AsDecimal | Default:0 %}
<!-- Sum each member's individual goal attribute value -->
{% sql %}
    SELECT ISNULL(SUM(COALESCE(mg.Goal, gg.Goal, 0)), 0) AS TotalGoal
    FROM [GroupMember] gm
    OUTER APPLY (
        SELECT TOP 1 TRY_CAST(avm.Value AS DECIMAL(18,2)) AS Goal
        FROM [Attribute] am
        INNER JOIN [AttributeValue] avm ON avm.AttributeId = am.Id AND avm.EntityId = gm.Id
        WHERE am.[Key] = 'IndividualFundraisingGoal'
          AND am.EntityTypeId = (SELECT Id FROM EntityType WHERE Name = 'Rock.Model.GroupMember')
          AND am.EntityTypeQualifierColumn = 'GroupTypeId'
          AND am.EntityTypeQualifierValue = '{{ group.GroupTypeId }}'
          AND TRY_CAST(avm.Value AS DECIMAL(18,2)) > 0
    ) mg
    OUTER APPLY (
        SELECT TOP 1 TRY_CAST(COALESCE(avg.Value, ag.DefaultValue) AS DECIMAL(18,2)) AS Goal
        FROM [Attribute] ag
        LEFT JOIN [AttributeValue] avg ON avg.AttributeId = ag.Id AND avg.EntityId = {{ groupId }}
        WHERE ag.[Key] = 'IndividualFundraisingGoal'
          AND ag.EntityTypeId = (SELECT Id FROM EntityType WHERE Name = 'Rock.Model.Group')
          AND ag.EntityTypeQualifierColumn = 'GroupTypeId'
          AND ag.EntityTypeQualifierValue = '{{ group.GroupTypeId }}'
    ) gg
    WHERE gm.GroupId = {{ groupId }}
      AND gm.GroupMemberStatus = 1
      AND gm.IsArchived = 0
{% endsql %}
{% assign totalGoal = results[0].TotalGoal | AsDecimal | Default:0 %}
<!-- Calculate percent -->
{% if totalGoal > 0 %}
    {% assign percentMet = totalRaised | DividedBy:totalGoal | Times:100 %}
{% else %}
    {% assign percentMet = 0 %}
{% endif %}
{% assign percentWidth = percentMet | AtMost:100 %}
{% assign percentRounded = percentMet | Floor %}
{% assign amountLeft = totalGoal | Minus:totalRaised %}
<div class="well text-center margin-t-md">
    <h2 class="mt-0" style="color: #333;">{{ group.Name }}</h2>
    <h4 class="mt-0">Total Raised Year to Date:</h4>
    <h2 style="color: #006ab6;">{{ totalRaised | FormatAsCurrency }}</h2>
    <hr />
    <div class="row">
        <div class="col-md-12 text-left">
            <label class="pull-left"><strong>Total For All Group Members</strong></label>
            <label class="pull-right"><strong>{{ totalRaised | FormatAsCurrency }} / {{ totalGoal | FormatAsCurrency }}</strong></label>
            <div class="clearfix"></div>
            <div class="progress" style="height: 30px; border-radius: 4px; margin-bottom: 10px;">
                {% if percentWidth > 0 %}
                    <div aria-valuemax="100" aria-valuemin="0" aria-valuenow="{{ percentRounded }}"
                         class="progress-bar" role="progressbar" style="width: {{ percentWidth }}%; height: 30px; line-height: 30px; font-size: 14px; font-weight: bold;">
                        {{ percentRounded }}% Complete
                    </div>
                {% else %}
                    <div aria-valuemax="100" aria-valuemin="0" aria-valuenow="0"
                         class="progress-bar" role="progressbar" style="width: 2%; min-width: 2px; height: 30px; line-height: 30px;">
                        <span class="sr-only">0% Complete</span>
                    </div>
                {% endif %}
            </div>
            <div class="margin-t-md text-center">
                {% if amountLeft > 0 %}
                    <h3 style="color: #333; margin-top: 0;">
                        {{ amountLeft | FormatAsCurrency }} <small style="color: #333;">still needed to reach the group goal of {{ totalGoal | FormatAsCurrency }}</small>
                    </h3>
                {% else %}
                    <h3 style="color: #006ab6; margin-top: 0;">
                     🎉 Goal reached! {{ totalRaised | FormatAsCurrency }} raised of {{ totalGoal | FormatAsCurrency }} goal.
                    </h3>
                {% endif %}
            </div>
        </div>
    </div>
</div>
↑ Back to top

Code 3Group Member List Block

The code below generates the pictures of the group members and their individual OR family fundraising progress based on the Participation Type set on the group.
*Remember to change the Team Donation Group Role Id in the code.

Sample screenshot of the Group Member List
Lava
<center><h2>Please select a team member below to donate directly to their trip fund or select the <i>Mission Team Icon</i> to make an all team donation.</h2></center><br><br>

<style>
    .fundraiser-card-col {
        margin-bottom: 30px;
    }
    .fundraiser-card {
        border-radius: 8px;
        overflow: hidden;
        box-shadow: 0 4px 6px rgba(0,0,0,0.15);
        max-width: 32rem;
        margin: 0 auto;
        background: #fff;
    }
    .fundraiser-card-body {
        padding: 24px 16px;
    }
    .fundraiser-name {
        font-weight: bold;
        font-size: 18px;
        margin: 0 0 4px 0;
    }
    .fundraiser-row {
        display: flex;
        flex-wrap: wrap;
    }
</style>

{% assign groupId = 'Global' | PageParameter:'GroupId' | AsInteger | Default:0 %}
{% comment %}To hardcode this page eliminate the line above with the PageParameter and set the line below as {% group where:'Id == XXXXX' %}
  with the XXXXX as YOUR Group Id number. Casting through AsInteger also protects the {% sql %} blocks below from SQL injection via the
  querystring.{% endcomment %}
{% group where:'Id == {{ groupId }}' %}
    {% assign groupTypeId = group.GroupTypeId %}
    {% assign accountId = group | Attribute:'FinancialAccount','Id' | AsInteger | Default:0 %}
    {% assign participationMode = group | Attribute:'ParticipationType' %}
{% endgroup %}
{% if groupId > 0 %}
<div class="row fundraiser-row">
    {% groupmember where:'GroupId == {{ groupId }} && GroupRoleId == 65' %} <!--Change this to your Team Donation Group Role Id -->
    {% assign teamProfiles = groupmemberItems %}
    {% endgroupmember %}
    {% groupmember where:'GroupId == {{ groupId }} && GroupRoleId != 65' %} <!--Change this to your Team Donation Group Role Id -->
    {% assign regularMembers = groupmemberItems | OrderBy:'Person.LastName,Person.NickName' %}
    {% endgroupmember %}
    {% assign renderList = teamProfiles | Concat:regularMembers %}
    {% for member in renderList %}
        {% if member.GroupMemberStatus == "Inactive" %}{% continue %}{% endif %}
        {% assign memberPerson   = member.Person %}
        {% assign photoUrl       = member.Person.PhotoUrl %}

        {% comment %}
          Member goal: member-level override (qualified to this group type) first, then the group-level default.
          OUTER APPLY + TOP 1 guarantees exactly one row, so no duplicate attributes can sneak in.
        {% endcomment %}
        {% sql %}
            SELECT COALESCE(mg.Goal, gg.Goal, 0) AS MemberGoal
            FROM [GroupMember] gm
            OUTER APPLY (
                SELECT TOP 1 TRY_CAST(avm.Value AS DECIMAL(18,2)) AS Goal
                FROM [Attribute] am
                INNER JOIN [AttributeValue] avm ON avm.AttributeId = am.Id AND avm.EntityId = gm.Id
                WHERE am.[Key] = 'IndividualFundraisingGoal'
                  AND am.EntityTypeId = (SELECT Id FROM EntityType WHERE Name = 'Rock.Model.GroupMember')
                  AND am.EntityTypeQualifierColumn = 'GroupTypeId'
                  AND am.EntityTypeQualifierValue = '{{ groupTypeId }}'
                  AND TRY_CAST(avm.Value AS DECIMAL(18,2)) > 0
            ) mg
            OUTER APPLY (
                SELECT TOP 1 TRY_CAST(COALESCE(avg.Value, ag.DefaultValue) AS DECIMAL(18,2)) AS Goal
                FROM [Attribute] ag
                LEFT JOIN [AttributeValue] avg ON avg.AttributeId = ag.Id AND avg.EntityId = {{ groupId }}
                WHERE ag.[Key] = 'IndividualFundraisingGoal'
                  AND ag.EntityTypeId = (SELECT Id FROM EntityType WHERE Name = 'Rock.Model.Group')
                  AND ag.EntityTypeQualifierColumn = 'GroupTypeId'
                  AND ag.EntityTypeQualifierValue = '{{ groupTypeId }}'
            ) gg
            WHERE gm.Id = {{ member.Id }}
        {% endsql %}
        {% assign memberGoal = results[0].MemberGoal | AsDecimal | Default:0 %}

        {% sql %}
            SELECT ISNULL(SUM(ftd.Amount), 0) AS AmountRaised
            FROM [FinancialTransactionDetail] ftd
            INNER JOIN [FinancialTransaction] ft ON ft.Id = ftd.TransactionId
            WHERE ftd.EntityTypeId = 90
              AND ftd.EntityId = {{ member.Id }}
              AND ftd.AccountId = {{ accountId }}
        {% endsql %}
        {% assign memberRaised = results[0].AmountRaised | AsDecimal | Default:0 %}
        {% if memberGoal > 0 %}
            {% assign memberPercent = memberRaised | DividedBy:memberGoal | Times:100 %}
        {% else %}
            {% assign memberPercent = 0 %}
        {% endif %}
        {% assign memberPercentWidth   = memberPercent | AtMost:100 %}
        {% assign memberPercentRounded = memberPercent | Floor %}
        {% if memberPercent >= 100 %}
            {% assign memberBarClass = 'progress-bar' %}
        {% else %}
            {% assign memberBarClass = 'progress-bar progress-bar-success' %}
        {% endif %}

        {% assign showFamilyBar        = false %}
        {% assign familyGoal           = 0 %}
        {% assign familyRaised         = 0 %}
        {% assign familyPercentWidth   = 0 %}
        {% assign familyPercentRounded = 0 %}
        {% assign familyBarClass       = 'progress-bar progress-bar-success' %}
        {% if participationMode == 'Family' %}
            {% comment %}
              Family totals: each member's raised amount and goal are calculated separately (OUTER APPLY)
              and then summed, so a member with multiple gifts no longer has their goal counted multiple times.
            {% endcomment %}
            {% sql %}
                SELECT
                    COUNT(*)                                      AS FamilyMemberCount,
                    ISNULL(SUM(r.Raised), 0)                      AS FamilyRaised,
                    ISNULL(SUM(COALESCE(mg.Goal, gg.Goal, 0)), 0) AS FamilyGoal
                FROM [GroupMember] gm
                INNER JOIN [Person] p ON p.Id = gm.PersonId
                OUTER APPLY (
                    SELECT ISNULL(SUM(ftd.Amount), 0) AS Raised
                    FROM [FinancialTransactionDetail] ftd
                    WHERE ftd.EntityTypeId = 90
                      AND ftd.EntityId = gm.Id
                      AND ftd.AccountId = {{ accountId }}
                ) r
                OUTER APPLY (
                    SELECT TOP 1 TRY_CAST(avm.Value AS DECIMAL(18,2)) AS Goal
                    FROM [Attribute] am
                    INNER JOIN [AttributeValue] avm ON avm.AttributeId = am.Id AND avm.EntityId = gm.Id
                    WHERE am.[Key] = 'IndividualFundraisingGoal'
                      AND am.EntityTypeId = (SELECT Id FROM EntityType WHERE Name = 'Rock.Model.GroupMember')
                      AND am.EntityTypeQualifierColumn = 'GroupTypeId'
                      AND am.EntityTypeQualifierValue = '{{ groupTypeId }}'
                      AND TRY_CAST(avm.Value AS DECIMAL(18,2)) > 0
                ) mg
                OUTER APPLY (
                    SELECT TOP 1 TRY_CAST(COALESCE(avg.Value, ag.DefaultValue) AS DECIMAL(18,2)) AS Goal
                    FROM [Attribute] ag
                    LEFT JOIN [AttributeValue] avg ON avg.AttributeId = ag.Id AND avg.EntityId = {{ groupId }}
                    WHERE ag.[Key] = 'IndividualFundraisingGoal'
                      AND ag.EntityTypeId = (SELECT Id FROM EntityType WHERE Name = 'Rock.Model.Group')
                      AND ag.EntityTypeQualifierColumn = 'GroupTypeId'
                      AND ag.EntityTypeQualifierValue = '{{ groupTypeId }}'
                ) gg
                WHERE gm.GroupId = {{ groupId }}
                  AND gm.GroupMemberStatus = 1
                  AND gm.IsArchived = 0
                  AND p.PrimaryFamilyId = (SELECT PrimaryFamilyId FROM Person WHERE Id = {{ memberPerson.Id }})
            {% endsql %}
            {% assign familyMemberCount = results[0].FamilyMemberCount | AsInteger | Default:1 %}
            {% if familyMemberCount > 1 %}
                {% assign showFamilyBar = true %}
                {% assign familyRaised = results[0].FamilyRaised | AsDecimal | Default:0 %}
                {% assign familyGoal   = results[0].FamilyGoal   | AsDecimal | Default:0 %}
                {% if familyGoal > 0 %}
                    {% assign familyPercent = familyRaised | DividedBy:familyGoal | Times:100 %}
                {% else %}
                    {% assign familyPercent = 0 %}
                {% endif %}
                {% assign familyPercentWidth   = familyPercent | AtMost:100 %}
                {% assign familyPercentRounded = familyPercent | Floor %}
                {% if familyPercent >= 100 %}
                    {% assign familyBarClass = 'progress-bar' %}
                {% endif %}
            {% endif %}
        {% endif %}

        <div class="col-xs-12 col-sm-6 col-md-3 fundraiser-card-col">
            <div class="fundraiser-card">
                {% if photoUrl != "" %}
                <div style="width: 100%; padding-bottom: 100%; position: relative; background-image: url('{{ photoUrl }}&h=500&w=500&mode=crop&anchor=middle&scale=both'); background-size: cover; background-position: center; background-repeat: no-repeat;"
                  role="img" aria-label="{{ memberPerson.NickName }} {{ memberPerson.LastName }} Picture"></div>
                {% endif %}
                <div class="fundraiser-card-body">
                    <h5 class="fundraiser-name">{{ memberPerson.NickName }} {{ memberPerson.LastName }}</h5>
                    {% if showFamilyBar and familyGoal > 0 %}
                        <div class="margin-b-sm">
                            <div class="clearfix" style="margin-bottom: 2px;">
                                <small class="pull-left text-muted"><strong>{{ memberPerson.LastName }} Family:</strong> {{ familyRaised | FormatAsCurrency }} raised</small>
                                <small class="pull-right text-muted">Goal: {{ familyGoal | FormatAsCurrency }}</small>
                            </div>
                            <div class="progress" style="height: 14px; border-radius: 4px; margin-bottom: 4px;">
                                {% if familyPercentWidth > 0 %}
                                    <div class="{{ familyBarClass }}" role="progressbar" aria-valuenow="{{ familyPercentRounded }}"
                                      aria-valuemin="0" aria-valuemax="100" style="width: {{ familyPercentWidth }}%; height: 14px; line-height: 14px; font-size: 11px; font-weight: bold;">{{ familyPercentRounded }}%</div>
                                {% else %}
                                    <div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="0" aria-valuemin="0"
                                      aria-valuemax="100" style="width: 2%; min-width: 2px; height: 14px;"><span class="sr-only">0%</span></div>
                                {% endif %}
                            </div>
                        </div>
                    {% elsif memberGoal > 0 %}
                        <div class="margin-b-sm">
                            <div class="clearfix" style="margin-bottom: 2px;">
                                <small class="pull-left text-muted">{{ memberRaised | FormatAsCurrency }} raised</small>
                                <small class="pull-right text-muted">Goal: {{ memberGoal | FormatAsCurrency }}</small>
                            </div>
                            <div class="progress" style="height: 14px; border-radius: 4px; margin-bottom: 4px;">
                                {% if memberPercentWidth > 0 %}
                                    <div class="{{ memberBarClass }}" role="progressbar" aria-valuenow="{{ memberPercentRounded }}"
                                      aria-valuemin="0" aria-valuemax="100" style="width: {{ memberPercentWidth }}%; height: 14px; line-height: 14px; font-size: 11px; font-weight: bold;">{{ memberPercentRounded }}%</div>
                                {% else %}
                                    <div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="0" aria-valuemin="0"
                                      aria-valuemax="100" style="width: 2%; min-width: 2px; height: 14px;"><span class="sr-only">0%</span></div>
                                {% endif %}
                            </div>
                        </div>
                    {% endif %}
                    {% capture link %}{{ 'Global' | Attribute:'PublicApplicationRoot' }}page/473?GroupId={{ groupId }}&GroupMemberId={{ member.Id }}{% endcapture %}
                    <p><a href="{{ link }}" class="btn btn-primary">View Participant Page</a></p>
                </div>
            </div>
        </div>
    {% endfor %}
</div>
{% else %}
    {% if CurrentPersonCanEdit %}
        <div class="alert alert-warning" role="alert">
            <p><strong>Group id is not set.</strong><br />Make sure to add a Group ID.</p>
        </div>
    {% endif %}
{% endif %}
↑ Back to top

Code 4Participant Page – Custom Progress Block

The code below generates the custom fundraising block on the Trip Participant's page. It will show their individual AND/OR family fundraising progress based on the Participation Type set on the group.
*Make sure to comment out the lava listed in the "Progress Lava Template" on the "Fundraising Opportunity Participant Block" on the same page.

Sample screenshot of the Participant Page progress block
Lava
{% comment %}
Rewritten to run in a plain HTML block (no Fundraising Opportunity Participant block merge fields available).
Everything the block used to hand us -- GroupMember, Person, PercentMet, AmountLeft -- is now derived from PageParameter.GroupId /
  PageParameter.GroupMemberId directly.
{% endcomment %}
{% assign groupId = PageParameter.GroupId | AsInteger | Default:0 %}
{% assign groupMemberId = PageParameter.GroupMemberId | AsInteger | Default:0 %}
{% assign group = groupId | GroupById %}
{% assign accountId = group | Attribute:'FinancialAccount','Id' | AsInteger | Default:0 %}
{% assign ParticipationMode = group | Attribute:'ParticipationType' %}
    {% capture link %}
        /page/474?GroupId={{ groupId }}&GroupMemberId={{ groupMemberId }}&AccountIds={{ accountId }}
        {% endcapture %} <!--Verify page number for your instance -->

<!-- Pull the GroupMember's Person, since we no longer get GroupMember.Person from the block.
     Matching on GroupId too means a GroupMemberId from a different group can't be loaded by editing the URL. -->
{% sql %}
    SELECT PersonId FROM GroupMember WHERE Id = {{ groupMemberId }} AND GroupId = {{ groupId }}
{% endsql %}
{% assign personId = results[0].PersonId | AsInteger | Default:0 %}
{% if personId == 0 %}
    <div class="alert alert-warning" role="alert">This participant could not be found.</div>
{% else %}
{% assign person = personId | PersonById %}
{% capture MakeDonationButtonText %}Contribute to {{ person.NickName }}'s Trip{% endcapture %}

<!-- DisablePublicContributionRequests (GroupMember attribute, no group-type qualifier in original) -->
{% sql %}
    SELECT COALESCE(av.Value, a.DefaultValue) as Value
    FROM Attribute a
    LEFT JOIN AttributeValue av ON av.AttributeId = a.Id AND av.EntityId = {{ groupMemberId }}
    WHERE a.[Key] = 'DisablePublicContributionRequests'
    AND a.EntityTypeId = (SELECT Id FROM EntityType WHERE Name = 'Rock.Model.GroupMember')
{% endsql %}
{% assign disablePublicContributionRequests = results[0].Value %}

<!-- This member's fundraising goal: member-level override, falling back to DefaultValue on the attribute itself -->
{% sql %}
    SELECT COALESCE(av.Value, a.DefaultValue) as Value
    FROM Attribute a
    LEFT JOIN AttributeValue av ON av.AttributeId = a.Id AND av.EntityId = {{ groupMemberId }}
    WHERE a.[Key] = 'IndividualFundraisingGoal'
    AND a.EntityTypeId = (SELECT Id FROM EntityType WHERE Name = 'Rock.Model.GroupMember')
    AND a.EntityTypeQualifierColumn = 'GroupTypeId'
    AND a.EntityTypeQualifierValue = '{{ group.GroupTypeId }}'
{% endsql %}
{% assign individualGoal = results[0].Value | AsDecimal | Default:0 %}

<!-- If still 0, fall back to the group-level default (same as original code's second SQL call) -->
{% if individualGoal == 0 %}
    {% sql %}
        SELECT COALESCE(av.Value, a.DefaultValue) as Value
        FROM Attribute a
        LEFT JOIN AttributeValue av ON av.AttributeId = a.Id AND av.EntityId = {{ groupId }}
        WHERE a.[Key] = 'IndividualFundraisingGoal'
        AND a.EntityTypeId = (SELECT Id FROM EntityType WHERE Name = 'Rock.Model.Group')
        AND a.EntityTypeQualifierColumn = 'GroupTypeId'
        AND a.EntityTypeQualifierValue = '{{ group.GroupTypeId }}'
    {% endsql %}
    {% assign individualGoal = results[0].Value | AsDecimal | Default:0 %}
{% endif %}

<!-- This member's actual contributions against the fundraising account -->
{% assign individualContributions = 0 %}
{% assign individualAmountLeft = 0 %}
{% assign individualPercentMet = 0 %}
{% if individualGoal > 0 %}
    {% sql %}
        SELECT ISNULL(SUM(ftd.Amount), 0) as TotalAmount
        FROM FinancialTransactionDetail ftd
        INNER JOIN FinancialTransaction ft ON ft.Id = ftd.TransactionId
        WHERE ftd.EntityTypeId = 90
        AND ftd.EntityId = {{ groupMemberId }}
        AND ftd.AccountId = {{ accountId }}
    {% endsql %}
    {% assign individualContributions = results[0].TotalAmount | AsDecimal | Default:0 %}
    {% assign individualAmountLeft = individualGoal | Minus:individualContributions %}
    {% assign individualPercentMet = individualContributions | DividedBy:individualGoal | Times:100 %}
{% endif %}
{% assign individualPercentWidth = individualPercentMet | AtMost:100 %}
{% assign individualPercentRounded = individualPercentMet | Floor %}
{% comment %} Family totals: only relevant in Family mode {% endcomment %}
{% assign familyMemberCount = 0 %}
{% assign familyTotalGoal = 0 %}
{% assign familyTotalRaised = 0 %}
{% assign familyAmountLeft = 0 %}
{% assign familyPercentMet = 0 %}
{% assign familyMemberIds = '' %}
{% if ParticipationMode == 'Family' %}
    {% for member in group.Members %}
        {% if member.GroupMemberStatus != 'Active' or member.IsArchived == true %}{% continue %}{% endif %}
        {% if member.Person.PrimaryFamilyId == person.PrimaryFamilyId %}
            {% assign familyMemberCount = familyMemberCount | Plus:1 %}
            {% assign familyMemberIds = familyMemberIds | Append:member.Id | Append:',' %}
            {% sql %}
                SELECT COALESCE(av.Value, a.DefaultValue) as Value
                FROM Attribute a
                LEFT JOIN AttributeValue av ON av.AttributeId = a.Id AND av.EntityId = {{ member.Id }}
                WHERE a.[Key] = 'IndividualFundraisingGoal'
                AND a.EntityTypeId = (SELECT Id FROM EntityType WHERE Name = 'Rock.Model.GroupMember')
                AND a.EntityTypeQualifierColumn = 'GroupTypeId'
                AND a.EntityTypeQualifierValue = '{{ group.GroupTypeId }}'
            {% endsql %}
            {% assign memberGoal = results[0].Value | AsDecimal | Default:0 %}
            {% if memberGoal == 0 %}
                {% sql %}
                    SELECT COALESCE(av.Value, a.DefaultValue) as Value
                    FROM Attribute a
                    LEFT JOIN AttributeValue av ON av.AttributeId = a.Id AND av.EntityId = {{ groupId }}
                    WHERE a.[Key] = 'IndividualFundraisingGoal'
                    AND a.EntityTypeId = (SELECT Id FROM EntityType WHERE Name = 'Rock.Model.Group')
                    AND a.EntityTypeQualifierColumn = 'GroupTypeId'
                    AND a.EntityTypeQualifierValue = '{{ group.GroupTypeId }}'
                {% endsql %}
                {% assign memberGoal = results[0].Value | AsDecimal | Default:0 %}
            {% endif %}
            {% assign familyTotalGoal = familyTotalGoal | Plus:memberGoal %}
        {% endif %}
    {% endfor %}
    {% assign familyMemberIds = familyMemberIds | TrimEnd:',' %}
    {% if familyMemberIds != '' %}
        {% sql %}
            SELECT ISNULL(SUM(ftd.Amount), 0) as TotalAmount
            FROM FinancialTransactionDetail ftd
            INNER JOIN FinancialTransaction ft ON ft.Id = ftd.TransactionId
            WHERE ftd.EntityTypeId = 90
            AND ftd.EntityId IN ({{ familyMemberIds }})
            AND ftd.AccountId = {{ accountId }}
        {% endsql %}
        {% assign familyTotalRaised = results[0].TotalAmount | AsDecimal | Default:0 %}
    {% endif %}
    {% assign familyAmountLeft = familyTotalGoal | Minus:familyTotalRaised %}
    {% if familyTotalGoal > 0 %}
        {% assign familyPercentMet = familyTotalRaised | DividedBy:familyTotalGoal | Times:100 %}
    {% endif %}
{% endif %}
{% assign familyPercentWidth = familyPercentMet | AtMost:100 %}
{% assign familyPercentRounded = familyPercentMet | Floor %}
<div class="well margin-t-md">
    {% if ParticipationMode != 'Family' %}
        <div class="row">
            <div class="col-md-12">
                <img class="pull-left margin-r-md img-circle" src="{{ person.PhotoUrl }}" width="75" />
                <h4 class="mt-0">{{ person.FullName }}'s Individual Progress</h4>
                <label>Individual Fundraising Progress</label>
                    <label class="pull-right">
                    {% if individualAmountLeft >= 0 %}
                        Amount needed to reach personal goal: {{ individualAmountLeft | FormatAsCurrency }}
                    {% else %}
                        Goal Met: {{ individualPercentRounded }}%
                    {% endif %}
                </label>
                <div class="clearfix"></div>
                <small class="text-muted">{{ individualContributions | FormatAsCurrency }} raised of {{ individualGoal | FormatAsCurrency }} goal</small>
                <div class="progress">
                    {% if individualPercentWidth > 0 %}
                        <div aria-valuemax="100" aria-valuemin="0" aria-valuenow="{{ individualPercentRounded }}" class="progress-bar"
                          role="progressbar" style="width: {{ individualPercentWidth }}%;">
                            <span class="sr-only">{{ individualPercentRounded }}% Complete</span>
                        </div>
                    {% else %}
                        <div aria-valuemax="100" aria-valuemin="0" aria-valuenow="0" class="progress-bar" role="progressbar" style="width: 2%; min-width: 0px;">
                            <span class="sr-only">0% Complete</span>
                        </div>
                    {% endif %}
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-md-12">
                <div class="actions pull-right">
                    <a href="{{ link }}&ParticipationMode=1" class="btn btn-sm btn-primary">{{ MakeDonationButtonText }}</a>
                </div>
            </div>
        </div>
    {% else %}
        {% if familyMemberCount > 1 %}
            <div class="row">
                <div class="col-md-12">
                    <img class="pull-left margin-r-md img-circle" src="{{ person.PhotoUrl }}" width="75" />
                    <h4 class="mt-0">{{ person.FullName }}'s Individual Progress</h4>
                    <label>Individual Fundraising Progress</label>
                    <label class="pull-right">
                        {% if individualAmountLeft >= 0 %}
                            Amount needed to reach personal goal: {{ individualAmountLeft | FormatAsCurrency }}
                        {% else %}
                            Goal Met: {{ individualPercentRounded }}%
                        {% endif %}
                    </label>
                    <div class="clearfix"></div>
                    <small class="text-muted">{{ individualContributions | FormatAsCurrency }} raised of {{ individualGoal | FormatAsCurrency }} goal</small>
                    <div class="progress">
                        {% if individualPercentWidth > 0 %}
                            <div aria-valuemax="100" aria-valuemin="0" aria-valuenow="{{ individualPercentRounded }}" class="progress-bar progress-bar-info" role="progressbar" style="width: {{ individualPercentWidth }}%;">
                                <span class="sr-only">{{ individualPercentRounded }}% Complete</span>
                            </div>
                        {% else %}
                            <div aria-valuemax="100" aria-valuemin="0" aria-valuenow="0" class="progress-bar progress-bar-info"
                              role="progressbar" style="width: 2%; min-width: 0px;">
                                <span class="sr-only">0% Complete</span>
                            </div>
                        {% endif %}
                    </div>
                </div>
            </div>
            <div class="row margin-t-md">
                <div class="col-md-12">
                    <h4 class="mt-0">{{ person.LastName }} Family Combined Fundraising</h4>
                    <label>Family Fundraising Progress</label>
                    <label class="pull-right">
                        {% if familyAmountLeft >= 0 %}
                            Total amount needed for the family to reach their combined goal: {{ familyAmountLeft | FormatAsCurrency }}
                        {% else %}
                            Goal Met: {{ familyPercentRounded }}%
                        {% endif %}
                    </label>
                    <div class="clearfix"></div>
                    <small class="text-muted">{{ familyTotalRaised | FormatAsCurrency }} raised of {{ familyTotalGoal | FormatAsCurrency }} goal</small>
                    <div class="progress">
                        {% if familyPercentWidth > 0 %}
                            <div aria-valuemax="100" aria-valuemin="0" aria-valuenow="{{ familyPercentRounded }}" class="progress-bar progress-bar-success" role="progressbar" style="width: {{ familyPercentWidth }}%;">
                                <span class="sr-only">{{ familyPercentRounded }}% Complete</span>
                            </div>
                        {% else %}
                            <div aria-valuemax="100" aria-valuemin="0" aria-valuenow="0" class="progress-bar progress-bar-success"
                              role="progressbar" style="width: 2%; min-width: 0px;">
                                <span class="sr-only">0% Complete</span>
                            </div>
                        {% endif %}
                    </div>
                </div>
            </div>
        {% else %}
            <div class="row">
                <div class="col-md-12">
                    <img class="pull-left margin-r-md img-circle" src="{{ person.PhotoUrl }}" width="75" />
                    <h4 class="mt-0">{{ person.FullName }}'s Individual Progress</h4>
                    <label>Individual Fundraising Progress</label>
                    <label class="pull-right">
                        {% if familyAmountLeft >= 0 %}
                            Amount needed to reach personal goal: {{ familyAmountLeft | FormatAsCurrency }}
                        {% else %}
                            Goal Met: {{ familyPercentRounded }}%
                        {% endif %}
                    </label>
                    <div class="clearfix"></div>
                    <small class="text-muted">{{ familyTotalRaised | FormatAsCurrency }} raised of {{ familyTotalGoal | FormatAsCurrency }} goal</small>
                    <div class="progress">
                        {% if familyPercentWidth > 0 %}
                            <div aria-valuemax="100" aria-valuemin="0" aria-valuenow="{{ familyPercentRounded }}" class="progress-bar"
                              role="progressbar" style="width: {{ familyPercentWidth }}%;">
                                <span class="sr-only">{{ familyPercentRounded }}% Complete</span>
                            </div>
                        {% else %}
                            <div aria-valuemax="100" aria-valuemin="0" aria-valuenow="0" class="progress-bar" role="progressbar" style="width: 2%; min-width: 0px;">
                                <span class="sr-only">0% Complete</span>
                            </div>
                        {% endif %}
                    </div>
                </div>
            </div>
        {% endif %}
        <div class="row">
            <div class="col-md-12">
                <div class="actions pull-right">
                    <a href="{{ link }}&ParticipationMode=2" class="btn btn-sm btn-primary">{{ MakeDonationButtonText }}</a>
                </div>
            </div>
        </div>
    {% endif %}
</div>
{% endif %}
↑ Back to top

Code 5Leader Entry Point – My Account Block

Group List "Personalized Lava" custom template.

Sample screenshot of the Leader Entry Point group list
Lava
{% comment %}{% include '/Themes/ColoradoCommunity-CompassChild/Assets/Lava/GroupListSidebar.lava' %}{% endcomment %}
<div class="panel panel-default">
  <div class="panel-heading">
    {% if ShowInactive -%}{% assign inactiveParamVal = 'Global' | PageParameter:InactiveParameter -%}
    <div class="pull-right btn-group btn-toggle">
      <a class="btn btn-default btn-xs {% if inactiveParamVal == '0' or InitialActive == '1' and inactiveParamVal == '' %}active{% endif %}"
        href="{{ 'Global' | Page:'Path' }}?{{ InactiveParameter }}=0">Active</a>
      <a class="btn btn-default btn-xs {% if inactiveParamVal == '1' or InitialActive == 0 and inactiveParamVal == '' %}active{% endif %}"
        href="{{ 'Global' | Page:'Path' }}?{{ InactiveParameter }}=1">All</a>
    </div>
    {% endif -%}
    Mission Team Participant Pages
  </div>
  {% assign groupCount = Groups | Size %}
  <ul class="list-group list-group-panel">
    {% if groupCount == 0 %}
        <li class="list-group-item">No Groups Available To List</li>
    {% endif %}

    {% for group in Groups %}
        {% capture isLeaderIcon -%}
            {% if group.IsLeader -%}
            <i class='fa fa-asterisk'></i>
            {% endif -%}
        {% endcapture -%}

        {% capture content %}
            {{ group.Group.Name }} <small>({{ group.Role }}{{ isLeaderIcon }})</small>
            {% if group.IsLeader -%}
                {% assign pending = 0 -%}
                {% for member in group.Group.Members -%}
                    {% if member.GroupMemberStatus == 'Pending' -%}
                    {% assign pending = pending | Plus:1 -%}
                    {% endif -%}
                {% endfor -%}
                {% if pending != 0 -%}
                <span title="number of pending members" class="badge badge-danger">{{ pending }}</span>
                {% endif -%}
            {% endif -%}
        {% endcapture %}
    <li class="list-group-item">
      {% if group.Group.IsActive == true %}
      <a href="{{ LinkedPages.DetailPage }}?GroupId={{group.Group.Id}}" class="js-group-item" data-toggle="tooltip" data-placement="top"
        title="{{ group.GroupType }}">
        {{ content }}
      </a>
      {% else %}
      <div class="js-group-item text-muted" data-toggle="tooltip" data-placement="top" title="{{ group.GroupType }}">
        {{ content }}
      </div>
      {% endif %}
    </li>
    {% endfor %}
  </ul>
</div>
↑ Back to top

Code 6Leader Toolbox – Requirements Button

The code below generates the Group Requirements & Spiritual Gifts Button.

Sample screenshot of the Requirements button
Lava
{% assign groupId = 'Global' | PageParameter:'GroupId' | AsInteger | Default:0 %}
<br>
<a href="/page/862?GroupId={{ groupId }}" class="btn btn-primary">Group Requirements & Spiritual Gifts</a> <!-- Update the page number to the page you created for the Group Requirements & Spiritual Gifts grid -->
↑ Back to top

Code 7Group Requirements & Spiritual Gifts Grid

The code below generates the Group Requirements Grid.

Sample screenshot of the Group Requirements grid
Lava
<!-- Mission Team Grid Final HTML-->
{% assign groupId = 'Global' | PageParameter:'GroupId' | AsInteger | Default:0 %}
{% assign group = groupId | GroupById %}

{% if group == null or group == empty %}
    <div class="alert alert-warning" role="alert">No group was found. Make sure the page link includes a valid GroupId.</div>
{% else %}
<div class="card card-family-member mb-3">
    <div class="card-header d-flex align-items-center">
        <span class="card-title mb-0"><h4>{{ group.Name }} Group Members</h4></span>
    </div>

    <div class="card-body">
        <div class="table-responsive">
            <table class="table table-striped table-hover">
                <thead>
                    <tr>
                        <th>Photo</th>
                        <th>Name</th>
                        <th>Role</th>
                        <th>Dominant Spiritual Gifts</th> <!-- Remove this line to remove the Spiritual Gifts column -->
                        <th>Group Requirements (Green=Complete, Red=Not Complete)</th>
                    </tr>
                </thead>
                <tbody>
                    {% assign groupRequirements = group.GroupRequirements %}
                    {% assign groupTypeRequirements = group.GroupType.GroupRequirements %}

                    {% for member in group.Members %}
                    {% if member.GroupMemberStatus == 'Inactive' %}{% continue %}{% endif %}
                    {% assign p = member.Person %}
                    <tr>
                        <td>
                            {% if p.PhotoId != null and p.PhotoId != empty %}
                                <img src="/GetAvatar.ashx?PhotoId={{ p.PhotoId }}" alt="{{ p.FullName }}" class="avatar" style="width:40px;height:40px;border-radius:50%;" />
                            {% else %}
                                <span class="avatar" style="display:inline-block;width:40px;height:40px;background:#eee;border-radius:50%;text-align:center;line-height:40px;">
                                    <i class="fa fa-user text-muted"></i>
                                </span>
                            {% endif %}
                        </td>
                        <td>{{ p.FullName }}</td>
                        <td>{{ member.GroupRole.Name }}</td>
                        <td>{{ p | Attribute:'core_DominantGifts' }}</td> <!-- Remove this line to remove the Spiritual Gifts column -->
                        <td>
                        {% for requirement in groupRequirements %}
                            {% assign groupMemberRequirement = member.GroupMemberRequirements | Where:'GroupRequirementId',requirement.Id | First %}
                            {% assign appliesToMember = false %}
                            {% if requirement.GroupRoleId == null or requirement.GroupRoleId == member.GroupRoleId %}
                                {% assign appliesToMember = true %}
                            {% endif %}

                            {% if groupMemberRequirement != null %}
                                {% if groupMemberRequirement.RequirementMetDateTime != null %}
                                    <span class="label label-success">{{ requirement.GroupRequirementType.Name }}</span>
                                {% else %}
                                    <span class="label label-danger">{{ requirement.GroupRequirementType.Name }}</span>
                                {% endif %}
                            {% elsif appliesToMember %}
                                <span class="label label-danger">{{ requirement.GroupRequirementType.Name }}</span>
                            {% endif %}
                        {% endfor %}

                        {% for requirement in groupTypeRequirements %}
                            {% assign groupMemberRequirement = member.GroupMemberRequirements | Where:'GroupRequirementId',requirement.Id | First %}
                            {% assign appliesToMember = false %}
                            {% if requirement.GroupRoleId == null or requirement.GroupRoleId == member.GroupRoleId %}
                                {% assign appliesToMember = true %}
                            {% endif %}

                            {% if groupMemberRequirement != null %}
                                {% if groupMemberRequirement.RequirementMetDateTime != null %}
                                    <span class="label label-success">{{ requirement.GroupRequirementType.Name }}</span>
                                {% else %}
                                    <span class="label label-danger">{{ requirement.GroupRequirementType.Name }}</span>
                                {% endif %}
                            {% elsif appliesToMember %}
                                <span class="label label-danger">{{ requirement.GroupRequirementType.Name }}</span>
                            {% endif %}
                        {% endfor %}
                        </td>
                    </tr>
                    {% endfor %}
                </tbody>
            </table>
        </div>
    </div>
</div>
{% endif %}
↑ Back to top