Skip to content

Commit

Permalink
SAK-46050 membership > enrolments > rosters attached to multiple site…
Browse files Browse the repository at this point in the history
…s get squished together (sakaiproject#9626)
  • Loading branch information
bjones86 authored Aug 20, 2021
1 parent 70e6833 commit 5f72db6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
import org.sakaiproject.site.api.SiteService;
import org.sakaiproject.user.api.UserDirectoryService;
import org.sakaiproject.util.ParameterParser;
import org.sakaiproject.util.comparator.AlphaNumericComparator;

/**
* Handles most aspects of the 'My Official Course Enrolments' page in the Membership tool.
Expand Down Expand Up @@ -421,6 +422,7 @@ public Enrolment( String sectionTitle, String sessionEID, List<SiteTitleUrlWrapp
this.sectionTitle = sectionTitle;
this.sessionEID = sessionEID;
this.siteWrappers = siteWrappers;
Collections.sort( siteWrappers, Comparator.comparing( SiteTitleUrlWrapper::getSiteTitle, new AlphaNumericComparator() ) );
}

// Getters
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,21 @@
<td headers="section">$enrolment.getSectionTitle()</td>
<td headers="worksite">
#if ($enrolment.siteWrappers.size() > 0)
#foreach( $site in $enrolment.siteWrappers )
#if ($enrolment.siteWrappers.size() == 1)
#set ($site = $enrolment.siteWrappers.get(0))
<a href="$site.getSiteURL()" target="_top" title="$tlang.getString( "mb.gotosite" ) $formattedText.escapeHtml( $site.getSiteTitle() )">
$formattedText.escapeHtml( $site.getSiteTitle() )
</a>
#else
<ul>
#foreach( $site in $enrolment.siteWrappers )
<li>
<a href="$site.getSiteURL()" target="_top" title="$tlang.getString( "mb.gotosite" ) $formattedText.escapeHtml( $site.getSiteTitle() )">
$formattedText.escapeHtml( $site.getSiteTitle() )
</a>
</li>
#end
</ul>
#end
#else
$tlang.getString('mb.enrolments.siteNotAvailable')
Expand Down

0 comments on commit 5f72db6

Please sign in to comment.