Skip to content

Commit

Permalink
+ (Event) Added a registration instance status to help display whethe…
Browse files Browse the repository at this point in the history
…r the registration is currently open or not.
  • Loading branch information
jonedmiston committed Sep 15, 2023
1 parent 64f9ece commit 4bd746c
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
1 change: 1 addition & 0 deletions RockWeb/Blocks/Event/RegistrationInstanceDetail.ascx
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
<div class="panel-labels">
<Rock:HighlightLabel ID="hlInactive" runat="server" LabelType="Danger" Text="Inactive" />
<Rock:HighlightLabel ID="hlType" runat="server" LabelType="Type" />
<Rock:HighlightLabel ID="hlStatus" runat="server" LabelType="Type" />
</div>
<asp:Panel runat="server" ID="pnlFollowing" CssClass="panel-follow-status js-follow-status" data-toggle="tooltip" data-placement="top" title="Click to Follow"></asp:Panel>
</div>
Expand Down
30 changes: 30 additions & 0 deletions RockWeb/Blocks/Event/RegistrationInstanceDetail.ascx.cs
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,21 @@ private void ShowDetail()
hlType.Visible = registrationInstance.RegistrationTemplate != null;
hlType.Text = registrationInstance.RegistrationTemplate != null ? registrationInstance.RegistrationTemplate.Name : string.Empty;

// Display the status of whether the registration is open or not
var registrationIsOpen = ( registrationInstance.StartDateTime == null || registrationInstance.StartDateTime.Value <= RockDateTime.Now )
&& ( registrationInstance.EndDateTime == null || registrationInstance.EndDateTime.Value >= RockDateTime.Now );

if ( registrationIsOpen )
{
hlStatus.Text = "Open";
hlStatus.LabelType = LabelType.Success;
}
else
{
hlStatus.Text = "Closed";
hlStatus.LabelType = LabelType.Type;
}

lWizardTemplateName.Text = hlType.Text;

pnlDetails.Visible = true;
Expand Down Expand Up @@ -646,6 +661,21 @@ private void ShowReadonlyDetails( RegistrationInstance registrationInstance, boo
lDefaultPaymentAmount.Visible = false;
}

// Display the status of whether the registration is open or not
var registrationIsOpen = ( registrationInstance.StartDateTime == null || registrationInstance.StartDateTime.Value <= RockDateTime.Now )
&& ( registrationInstance.EndDateTime == null || registrationInstance.EndDateTime.Value >= RockDateTime.Now );

if ( registrationIsOpen )
{
hlStatus.Text = "Open";
hlStatus.LabelType = LabelType.Success;
}
else
{
hlStatus.Text = "Closed";
hlStatus.LabelType = LabelType.Type;
}

lAccount.Visible = registrationInstance.Account != null;
lAccount.Text = registrationInstance.Account != null ? registrationInstance.Account.Name : string.Empty;

Expand Down

0 comments on commit 4bd746c

Please sign in to comment.