Skip to content
Snippets Groups Projects
Commit 80dd452b authored by srosse's avatar srosse
Browse files

OO-1068: fix HTML errors in details page of repository entry and link to...

OO-1068: fix HTML errors in details page of repository entry and link to authors which shared the same id, fix duplicates id in my courses
parent 97230a87
No related branches found
No related tags found
No related merge requests found
......@@ -21,7 +21,9 @@ package org.olat.repository.ui.list;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import org.olat.NewControllerFactory;
import org.olat.basesecurity.GroupRoles;
......@@ -426,12 +428,16 @@ public class RepositoryEntryDetailsController extends FormBasicController {
//add the list of owners
List<Identity> authors = repositoryService.getMembers(entry, GroupRoles.owner.name());
List<String> authorLinkNames = new ArrayList<String>(authors.size());
Set<Long> duplicates = new HashSet<>(authors.size() * 2 + 1);
int counter = 0;
for(Identity author:authors) {
String authorName = userManager.getUserDisplayName(author);
FormLink authorLink = uifactory.addFormLink("owner-" + counter, "owner", authorName, null, formLayout, Link.NONTRANSLATED | Link.LINK);
authorLink.setUserObject(author.getKey());
authorLinkNames.add(authorLink.getComponent().getComponentName());
if(!duplicates.contains(author.getKey())) {
String authorName = userManager.getUserDisplayName(author);
FormLink authorLink = uifactory.addFormLink("owner-" + ++counter, "owner", authorName, null, formLayout, Link.NONTRANSLATED | Link.LINK);
authorLink.setUserObject(author.getKey());
authorLinkNames.add(authorLink.getComponent().getComponentName());
duplicates.add(author.getKey());
}
}
layoutCont.contextPut("authorlinknames", authorLinkNames);
}
......
......@@ -118,13 +118,13 @@
<tr class="o_recent">
<th>$r.translate("cif.lastusage"):</th>
<td>$r.formatDateAndTime($recentLaunch)
<tr>
</tr>
#end
#if($r.available("mark"))
<tr class="o_bookmark">
<th>$r.translate("details.bookmark.label"):</th>
<td>$r.render("mark")</td>
<tr>
</tr>
#end
#if($groups && $groups.size() > 0)
<tr class="o_groups">
......
<div id="$r.getCId()" #if($row.selected) class="o_selected" #end>
<div #if($row.selected) class="o_selected" #end>
<div class="o_visual">
#if($row.isThumbnailAvailable())
<img src="${row.getThumbnailRelPath()}" />
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment