From c3fe231ebbe6da7aad1357f44ad71f6cafdc2cac Mon Sep 17 00:00:00 2001 From: srosse <stephane.rosse@frentix.com> Date: Wed, 3 Jun 2020 08:57:44 +0200 Subject: [PATCH] OO-4723: only show download submitted files if files can be submitted --- .../nodes/gta/ui/GTACoachSelectionController.java | 9 +++++++++ .../nodes/gta/ui/_content/coach_selection.html | 13 +++++++------ 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/src/main/java/org/olat/course/nodes/gta/ui/GTACoachSelectionController.java b/src/main/java/org/olat/course/nodes/gta/ui/GTACoachSelectionController.java index 33af6df953a..ba89382bb01 100644 --- a/src/main/java/org/olat/course/nodes/gta/ui/GTACoachSelectionController.java +++ b/src/main/java/org/olat/course/nodes/gta/ui/GTACoachSelectionController.java @@ -107,6 +107,7 @@ public class GTACoachSelectionController extends BasicController implements Acti downloadButton = LinkFactory.createButton("bulk.download.title", mainVC, this); downloadButton.setTranslator(getTranslator()); + downloadButton.setVisible(isDownloadAvailable()); PublisherData publisherData = gtaManager.getPublisherData(courseEnv, gtaNode, markedOnly); SubscriptionContext subsContext = gtaManager.getSubscriptionContext(courseEnv, gtaNode, markedOnly); @@ -141,6 +142,14 @@ public class GTACoachSelectionController extends BasicController implements Acti putInitialPanel(mainVC); } + + private boolean isDownloadAvailable() { + ModuleConfiguration config = gtaNode.getModuleConfiguration(); + return config.getBooleanSafe(GTACourseNode.GTASK_SUBMIT) + || config.getBooleanSafe(GTACourseNode.GTASK_REVIEW_AND_CORRECTION) + || config.getBooleanSafe(GTACourseNode.GTASK_REVISION_PERIOD) + || config.getBooleanSafe(GTACourseNode.GTASK_GRADING); + } @Override protected void doDispose() { diff --git a/src/main/java/org/olat/course/nodes/gta/ui/_content/coach_selection.html b/src/main/java/org/olat/course/nodes/gta/ui/_content/coach_selection.html index b1b042b01dc..bde413a3b77 100644 --- a/src/main/java/org/olat/course/nodes/gta/ui/_content/coach_selection.html +++ b/src/main/java/org/olat/course/nodes/gta/ui/_content/coach_selection.html @@ -16,14 +16,15 @@ $r.render("selection") #elseif($r.available("list")) + #if($r.available("contextualSubscription") || $r.available("bulk.download.title")) <div class="o_button_group o_button_group_right"> - $r.render("bulk.download.title") - + #if($r.available("bulk.download.title")) + $r.render("bulk.download.title") + #end #if($r.available("contextualSubscription")) - <div style="display:inline-block;"> - $r.render("contextualSubscription") - </div> - </div> + <div style="display:inline-block;">$r.render("contextualSubscription")</div> + #end + </div> #end $r.render("list") #end -- GitLab