Skip to content
Snippets Groups Projects
Commit d9d3100d authored by gnaegi's avatar gnaegi
Browse files

OO-1571 beautify efficiency statement

parent 35f5d22a
No related branches found
No related tags found
No related merge requests found
......@@ -128,6 +128,7 @@ public class Table extends AbstractComponent {
private boolean selectedRowUnselectable = false;
private boolean sortingEnabled = true;
private boolean displayTableHeader = true;
private boolean displayTableGrid = false; // default
private boolean pageingEnabled = true;
private Integer currentPageId;
private int resultsPerPage;
......@@ -636,6 +637,20 @@ public class Table extends AbstractComponent {
this.displayTableHeader = displayTableHeader;
}
/**
* Option to display a table grid
* @param enabled true: show the table grid; false: don't show table grid (default)
*/
protected void setDisplayTableGrid(boolean enabled) {
this.displayTableGrid = enabled;
}
/**
* @return true: show the table grid; false: don't show table grid (default)
*/
protected boolean isDisplayTableGrid() {
return this.displayTableGrid;
}
/**
* @param cd
* @return true if the columndescriptor is visible
......
......@@ -244,6 +244,7 @@ public class TableController extends BasicController {
table.setResultsPerPage(tableConfig.getResultsPerPage());
table.setMultiSelect(tableConfig.isMultiSelect());
table.enableShowAllLink(tableConfig.isShowAllLinkEnabled());
table.setDisplayTableGrid(tableConfig.isDisplayTableGrid());
// table is embedded in a velocity page that renders the surrounding layout
......
......@@ -46,6 +46,7 @@ public class TableGuiConfiguration {
private String preferencesKey;
private boolean displayTableHeader = true;
private boolean displayTableGrid = false; // default
private boolean sortingEnabled = true;
private boolean selectedRowUnselectable = false;
private boolean multiSelect = false;
......@@ -240,4 +241,18 @@ public class TableGuiConfiguration {
return tableExporter;
}
/**
* Option to display a table grid
* @param enabled true: show the table grid; false: don't show table grid (default)
*/
public void setDisplayTableGrid(boolean enabled) {
this.displayTableGrid = enabled;
}
/**
* @return true: show the table grid; false: don't show table grid (default)
*/
public boolean isDisplayTableGrid() {
return this.displayTableGrid;
}
}
......@@ -103,7 +103,9 @@ public class TableRenderer extends DefaultComponentRenderer {
// Render table wrapper and table
String formName = renderMultiselectForm(target, source, ubu, iframePostEnabled);
target.append("<div class=\"o_table_wrapper\" id=\"o_table_wrapper_").append(table.hashCode()).append("\">")
.append("<table id=\"o_table").append(table.hashCode()).append("\" class=\"o_table table table-striped table-condensed table-hover").append(CLOSE_HTML_BRACE);
.append("<table id=\"o_table").append(table.hashCode()).append("\" class=\"o_table table table-striped table-condensed table-hover")
.append(" table-bordered", table.isDisplayTableGrid())
.append(CLOSE_HTML_BRACE);
appendHeaderLinks(target, translator, table, formName, cols);
appendDataRows(renderer, target, ubu, table, iframePostEnabled, cols, selRowUnSelectable, selRowId, startRowId, endRowId);
target.append("</table><div class='o_table_footer'>");
......
......@@ -192,14 +192,13 @@ public class IdentityAssessmentOverviewController extends BasicController {
TableGuiConfiguration tableConfig = new TableGuiConfiguration();
tableConfig.setDownloadOffered(false);
//fxdiff VCRP-4: assessment overview with max score
tableConfig.setSortingEnabled(true);
tableConfig.setDisplayTableHeader(true);
tableConfig.setDisplayRowCount(false);
tableConfig.setPageingEnabled(false);
tableConfig.setTableEmptyMessage(translate("nodesoverview.emptylist"));
//fxdiff VCRP-4: assessment overview with max score
tableConfig.setPreferencesOffered(true, "assessmentIdentityNodeList");
tableConfig.setDisplayTableGrid(true);
removeAsListenerAndDispose(tableFilterCtr);
if (allowTableFiltering) {
......
#if ($collectwizard)
<script type="text/javascript">
<!--
## resize the window if collector-wizard is shown
jQuery(function(){
window.resizeTo(1100,650);
});
//-->
</script>
#end
<div class="o_efficiencystatement container-fluid">
#if($r.available("collectArtefactLink"))
<div class="pull-right">$r.render("collectArtefactLink")</div>
#end
<h3><i class="o_icon o_icon_certificate"> </i> $r.translate("efficiencystatement.title")</h3>
<div class="row form-horizontal">
<div class="col-md-6">
<div class="form-group">
<label class="col-sm-3 control-label">$r.translate("username")</label>
<div class="col-sm-9">
<div class="input-group">
<p class="form-control-static">$username</p>
<div class="input-group-btn">
#if($r.available("home.link"))
$r.render("home.link")
#end
#if($r.available("contact.link"))
$r.render("contact.link")
#end
</div>
</div>
</div>
</div>
#foreach( $propertyHandler in $userPropertyHandlers )
#if ($propertyHandler.getUserPropertyAsHTML($user, $locale) && $propertyHandler.getUserPropertyAsHTML($user, $locale) != "")
<div class="form-group">
<label class="col-sm-3 control-label">$r.translate($propertyHandler.i18nFormElementLabelKey())</label>
<div class="col-sm-9">
<p class="form-control-static">
#if($propertyHandler.name == "email")
$propertyHandler.getUserProperty($user, $locale)
#else
$propertyHandler.getUserPropertyAsHTML($user, $locale)
#end
</p>
</div>
</div>
#end
#end
</div>
<div class="col-md-6">
#if($courseTitle)
<div class="form-group">
<label class="col-sm-3 control-label">$r.translate("course")</label>
<div class="col-sm-9">
<div class="input-group">
<p class="form-control-static">$courseTitle</p>
#if($r.available("course.link"))
<span class="input-group-btn">$r.render("course.link")</span>
#end
</div>
</div>
</div>
#end
#if($date)
<div class="form-group">
<label class="col-sm-3 control-label">$r.translate("date")</label>
<div class="col-sm-9">
<p class="form-control-static">$date</p>
</div>
</div>
#end
#if($groupName)
<div class="form-group">
<label class="col-sm-3 control-label">$r.translate("group")</label>
<div class="col-sm-9">
<div class="input-group">
<p class="form-control-static">$groupName</p>
#if($r.available("group.link"))
<span class="input-group-btn">$r.render("group.link")</span>
#end
</div>
</div>
</div>
#end
</div>
</div>
<div class="row">$r.render("assessmentOverviewTable")</div>
</div>
\ No newline at end of file
......@@ -215,7 +215,7 @@ public class CertificateAndEfficiencyStatementController extends BasicController
}
if(courseRepoEntry != null && links) {
courseLink = LinkFactory.createButton("course.link", mainVC, this);
courseLink = LinkFactory.createButtonXSmall("course.link", mainVC, this);
courseLink.setIconLeftCSS("o_icon o_CourseModule_icon");
mainVC.put("course.link", courseLink);
}
......@@ -241,7 +241,7 @@ public class CertificateAndEfficiencyStatementController extends BasicController
if(group != null) {
mainVC.contextPut("groupName", StringHelper.escapeHtml(group.getName()));
if(links) {
groupLink = LinkFactory.createButton("group.link", mainVC, this);
groupLink = LinkFactory.createButtonXSmall("group.link", mainVC, this);
groupLink.setIconLeftCSS("o_icon o_icon_group");
mainVC.put("group.link", groupLink);
}
......
......@@ -13,79 +13,85 @@ jQuery(function(){
#if($r.available("collectArtefactLink"))
<div class="pull-right">$r.render("collectArtefactLink")</div>
#end
<h3><i class="o_icon o_icon_certificate"> </i> $r.translate("efficiencystatement.title")</h3>
<div class="row form-horizontal">
<div class="col-md-6">
<div class="form-group">
<label class="col-sm-3 control-label">$r.translate("username")</label>
<div class="col-sm-9">
<div class="input-group">
<p class="form-control-static">$username</p>
<div class="input-group-btn">
#if($r.available("home.link"))
$r.render("home.link")
#end
#if($r.available("contact.link"))
$r.render("contact.link")
#end
</div>
</div>
</div>
</div>
<h3><i class="o_icon o_icon_certificate"> </i> $r.translate("efficiencystatement.title")</h3>
<div class="row">
#if($r.available("home.link") || $r.available("contact.link"))
<div class="o_button_group_right o_block_bottom">
<div class=" btn-group">
#if($r.available("home.link"))
$r.render("home.link")
#end
#if($r.available("contact.link"))
$r.render("contact.link")
#end
</div>
</div>
#end
<div class="row">
<div class="col-xs-12 col-sm-6">
<table class="table table-bordered table-condensed table-striped">
<tbody>
<tr>
<th style="width: 30%;">$r.translate("username")</th>
<td>$username</td>
</tr>
#foreach( $propertyHandler in $userPropertyHandlers )
#if ($propertyHandler.getUserPropertyAsHTML($user, $locale) && $propertyHandler.getUserPropertyAsHTML($user, $locale) != "")
<div class="form-group">
<label class="col-sm-3 control-label">$r.translate($propertyHandler.i18nFormElementLabelKey())</label>
<div class="col-sm-9">
<p class="form-control-static">
#if($propertyHandler.name == "email")
$propertyHandler.getUserProperty($user, $locale)
#else
$propertyHandler.getUserPropertyAsHTML($user, $locale)
#end
</p>
</div>
</div>
<tr>
<th>
$r.translate($propertyHandler.i18nFormElementLabelKey())
</th>
<td>
#if($propertyHandler.name == "email")
$propertyHandler.getUserProperty($user, $locale)
#else
$propertyHandler.getUserPropertyAsHTML($user, $locale)
#end
</td>
</tr>
#end
#end
</tbody>
</table>
</div>
<div class="col-md-6">
<div class="col-xs-12 col-sm-6">
<table class="table table-bordered table-condensed table-striped">
<tbody>
#if($courseTitle)
<div class="form-group">
<label class="col-sm-3 control-label">$r.translate("course")</label>
<div class="col-sm-9">
<div class="input-group">
<p class="form-control-static">$courseTitle</p>
#if($r.available("course.link"))
<span class="input-group-btn">$r.render("course.link")</span>
#end
</div>
</div>
</div>
<tr>
<th style="width: 30%;">$r.translate("course")</th>
<td>$courseTitle
#if($r.available("course.link"))
<div>$r.render("course.link")</div>
#end
</td>
</tr>
#end
#if($date)
<div class="form-group">
<label class="col-sm-3 control-label">$r.translate("date")</label>
<div class="col-sm-9">
<p class="form-control-static">$date</p>
</div>
</div>
<tr>
<th style="width: 30%;">$r.translate("date")</th>
<td>$date</td>
</tr>
#end
#if($groupName)
<div class="form-group">
<label class="col-sm-3 control-label">$r.translate("group")</label>
<div class="col-sm-9">
<div class="input-group">
<p class="form-control-static">$groupName</p>
#if($r.available("group.link"))
<span class="input-group-btn">$r.render("group.link")</span>
#end
</div>
</div>
</div>
<tr>
<th style="width: 30%;">$r.translate("group")</th>
<td>
$groupName
#if($r.available("group.link"))
<div>$r.render("group.link")</div>
#end
</td>
</tr>
#end
</tbody>
</table>
</div>
</div>
</div></div>
<div class="row">
#if($r.available("segments"))
$r.render("segments")
......
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