Skip to content

Commit

Permalink
SAK-43065 PostEm: When the tool has no items the UI looks wrong. (sak…
Browse files Browse the repository at this point in the history
  • Loading branch information
Miguel Pellicer authored Jan 27, 2020
1 parent 4721267 commit fd7b752
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,7 @@ public class PostemTool {
protected boolean displayErrors;

protected boolean userPressedBack = false;

protected boolean gradebooksExist = true;


private static final int TEMPLATE_MAX_LENGTH = 4000;
private static final int TITLE_MAX_LENGTH = 255;
private static final int HEADING_MAX_LENGTH = 500;
Expand Down Expand Up @@ -177,18 +175,14 @@ public ArrayList getGradebooks() {
} catch (Exception e) {
gradebooks = null;
}

if (gradebooks != null && gradebooks.size() > 0)
gradebooksExist = true;
else
gradebooksExist = false;

return gradebooks;

}

public boolean getGradebooksExist() {
return gradebooksExist;
this.gradebooks = this.getGradebooks();
return this.gradebooks != null && !this.gradebooks.isEmpty();
}

public String getCsv() {
Expand Down
8 changes: 4 additions & 4 deletions postem/postem-app/src/webapp/postem/main.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
rendered="#{PostemTool.editable}"/>
</sakai:tool_bar>
<sakai:view_content>
<sakai:flat_list value="#{PostemTool.gradebooks}" var="gradebook" binding="#{PostemTool.gradebookTable}" styleClass="table table-bordered table-striped">

<sakai:flat_list rendered="#{PostemTool.gradebooksExist}" value="#{PostemTool.gradebooks}" var="gradebook" binding="#{PostemTool.gradebookTable}" styleClass="table table-bordered table-striped">
<h:column>
<f:facet name="header">
<h:commandLink action="#{PostemTool.toggleTitleSort}" title="#{msgs.sort_title}">
Expand Down Expand Up @@ -110,8 +110,8 @@
</h:commandLink>
</h:column>
</sakai:flat_list>
<h:outputText styleClass="instruction" value="#{msgs.no_gradebooks}" rendered="#{!PostemTool.gradebooksExist}" />

<h:outputText styleClass="sak-banner-warn" value="#{msgs.no_gradebooks}" rendered="#{!PostemTool.gradebooksExist}" />
</sakai:view_content>

</h:form>
Expand Down

0 comments on commit fd7b752

Please sign in to comment.