Skip to content
Snippets Groups Projects
Commit 49819f72 authored by srosse's avatar srosse
Browse files

OO-1447: show label and softkey in details, in list and in edit controller

parent 44975169
No related branches found
No related tags found
No related merge requests found
......@@ -93,9 +93,9 @@ public class LifecycleEditController extends FormBasicController {
protected boolean validateFormLogic(UserRequest ureq) {
boolean allOk = true;
softKeyEl.clearError();
if(!StringHelper.containsNonWhitespace(softKeyEl.getValue())) {
softKeyEl.setErrorKey("form.mandatory.hover", null);
labelEl.clearError();
if(!StringHelper.containsNonWhitespace(labelEl.getValue())) {
labelEl.setErrorKey("form.mandatory.hover", null);
allOk = false;
}
......
......@@ -239,7 +239,17 @@ public class RepositoryEditDescriptionController extends FormBasicController {
int count = 0;
for(RepositoryEntryLifecycle cycle:cycles) {
publicKeys[count] = cycle.getKey().toString();
publicValues[count++] = cycle.getLabel();
StringBuilder sb = new StringBuilder(32);
boolean labelAvailable = StringHelper.containsNonWhitespace(cycle.getLabel());
if(labelAvailable) {
sb.append(cycle.getLabel());
}
if(StringHelper.containsNonWhitespace(cycle.getSoftKey())) {
if(labelAvailable) sb.append(" - ");
sb.append(cycle.getSoftKey());
}
publicValues[count++] = sb.toString();
}
publicDatesEl = uifactory.addDropdownSingleselect("cif.public.dates", descCont, publicKeys, publicValues, null);
......
......@@ -62,7 +62,7 @@ class RepositoryEntryDataModel extends DefaultFlexiTableDataSourceModel<Reposito
case displayName: return item.getDisplayName();
case externalId: return item.getExternalId();
case externalRef: return item.getExternalRef();
case lifecycleLabel: return item.getLifecycle();
case lifecycleLabel: return item.getLifecycleLabel();
case lifecycleSoftkey: return item.getLifecycleSoftKey();
case lifecycleStart: return item.getLifecycleStart();
case lifecycleEnd: return item.getLifecycleEnd();
......
......@@ -65,8 +65,8 @@ public class RepositoryEntryRow implements RepositoryEntryRef {
private Double averageRating;
private long numOfRatings;
private long numOfComments;
private String lifecycle;
private String lifecycleLabel;
private String lifecycleSoftKey;
private Date lifecycleStart;
private Date lifecycleEnd;
......@@ -123,7 +123,7 @@ public class RepositoryEntryRow implements RepositoryEntryRef {
setLifecycleStart(reLifecycle.getValidFrom());
setLifecycleEnd(reLifecycle.getValidTo());
if(!reLifecycle.isPrivateCycle()) {
setLifecycle(reLifecycle.getLabel());
setLifecycleLabel(reLifecycle.getLabel());
setLifecycleSoftKey(reLifecycle.getSoftKey());
}
}
......@@ -246,14 +246,6 @@ public class RepositoryEntryRow implements RepositoryEntryRef {
this.numOfComments = numOfComments;
}
public String getLifecycle() {
return lifecycle;
}
public void setLifecycle(String lifecycle) {
this.lifecycle = lifecycle;
}
public String getLifecycleSoftKey() {
return lifecycleSoftKey;
}
......@@ -262,6 +254,14 @@ public class RepositoryEntryRow implements RepositoryEntryRef {
this.lifecycleSoftKey = lifecycleSoftKey;
}
public String getLifecycleLabel() {
return lifecycleLabel;
}
public void setLifecycleLabel(String lifecycleLabel) {
this.lifecycleLabel = lifecycleLabel;
}
public Date getLifecycleStart() {
return lifecycleStart;
}
......
......@@ -38,12 +38,19 @@
<div class="#if($hasMetaData) col-xs-6 col-sm-12 #else col-sm-6 #end o_subcolumn">
<div class="o_overview">
<h3>$r.translate("details.overview")</h3>
#if($v.lifecycle || $v.lifecycle.softKey || $row.lifecycle.start || $row.lifecycle.end)
#if($v.lifecycle || $v.lifecycle.softKey || $v.lifecycle.label || $row.lifecycle.start || $row.lifecycle.end)
<div title="$r.translateInAttribute("cif.dates")">
<i class="o_icon o_icon_lifecycle"></i>
#if($!v.lifecycle.private && $v.lifecycle.softKey) $v.lifecycle.softKey #end
#if($v.lifecycle.validFrom) $r.formatDate($v.lifecycle.validFrom) #end
#if($v.lifecycle.validTo) - $r.formatDate($v.lifecycle.validTo) #end
#if(!$v.lifecycle.privateCycle)
#if($v.lifecycle.label and !$v.lifecycle.label.isEmpty()) $v.lifecycle.label #end
#if($v.lifecycle.softKey and !$v.lifecycle.softKey.isEmpty())
#if($v.lifecycle.label and !$v.lifecycle.label.isEmpty()) - #end
$v.lifecycle.softKey
#end
#else
#if($v.lifecycle.validFrom) $r.formatDate($v.lifecycle.validFrom) #end
#if($v.lifecycle.validTo) - $r.formatDate($v.lifecycle.validTo) #end
#end
</div>
#end
#if($v.expenditureOfWork && !$v.expenditureOfWork.empty)
......
......@@ -20,13 +20,19 @@
#if($row.authors && !$row.authors.empty)
<div class="o_author"><span class="text-muted">$r.translate("course.made.by")</span> $row.authors</div>
#end
#if($row.lifecycle || $row.lifecycleSoftKey || $row.lifecycleStart || $row.lifecycleEnd)
#if($row.lifecycle || $row.lifecycleSoftKey || $row.lifecycleLabel || $row.lifecycleStart || $row.lifecycleEnd)
<div class="o_lifecycle #if ($row.isActive()) o_active #end">
<i class="o_icon o_icon_lifecycle"></i>
#if($row.lifecycle) $row.lifecycle #end
#if($row.lifecycleSoftKey) $row.lifecycleSoftKey #end
#if($row.lifecycleStart) $r.formatDate($row.lifecycleStart) #end
#if($row.lifecycleEnd) - $r.formatDate($row.lifecycleEnd) #end
#if($row.lifecycleSoftKey || $row.lifecycleLabel)
#if($row.lifecycleLabel and !$row.lifecycleLabel.isEmpty()) $row.lifecycleLabel #end
#if($row.lifecycleSoftKey and !$row.lifecycleSoftKey.isEmpty())
#if($row.lifecycleLabel and !$row.lifecycleLabel.isEmpty()) - #end
$row.lifecycleSoftKey
#end
#else
#if($row.lifecycleStart) $r.formatDate($row.lifecycleStart) #end
#if($row.lifecycleEnd) - $r.formatDate($row.lifecycleEnd) #end
#end
</div>
#end
<div class="o_desc">
......
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