parent
fee5cf81a4
commit
c8f5c50967
|
|
@ -18,6 +18,8 @@
|
||||||
*/
|
*/
|
||||||
package org.libreccm.ui.admin;
|
package org.libreccm.ui.admin;
|
||||||
|
|
||||||
|
import java.util.Comparator;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Model for the data of an admin page.
|
* Model for the data of an admin page.
|
||||||
*
|
*
|
||||||
|
|
@ -25,7 +27,7 @@ package org.libreccm.ui.admin;
|
||||||
*
|
*
|
||||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
*/
|
*/
|
||||||
public class AdminPageModel {
|
public class AdminPageModel implements Comparable<AdminPageModel> {
|
||||||
|
|
||||||
private String uriIdentifier;
|
private String uriIdentifier;
|
||||||
|
|
||||||
|
|
@ -35,11 +37,13 @@ public class AdminPageModel {
|
||||||
|
|
||||||
private String icon;
|
private String icon;
|
||||||
|
|
||||||
|
private long position;
|
||||||
|
|
||||||
public String getUriIdentifier() {
|
public String getUriIdentifier() {
|
||||||
return uriIdentifier;
|
return uriIdentifier;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setUriIdentifier(final String uriIdentifier) {
|
protected void setUriIdentifier(final String uriIdentifier) {
|
||||||
this.uriIdentifier = uriIdentifier;
|
this.uriIdentifier = uriIdentifier;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -47,7 +51,7 @@ public class AdminPageModel {
|
||||||
return label;
|
return label;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setLabel(final String label) {
|
protected void setLabel(final String label) {
|
||||||
this.label = label;
|
this.label = label;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -55,7 +59,7 @@ public class AdminPageModel {
|
||||||
return description;
|
return description;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDescription(final String description) {
|
protected void setDescription(final String description) {
|
||||||
this.description = description;
|
this.description = description;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -63,8 +67,26 @@ public class AdminPageModel {
|
||||||
return icon;
|
return icon;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setIcon(final String icon) {
|
protected void setIcon(final String icon) {
|
||||||
this.icon = icon;
|
this.icon = icon;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public long getPosition() {
|
||||||
|
return position;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void setPosition(final long position) {
|
||||||
|
this.position = position;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int compareTo(final AdminPageModel other) {
|
||||||
|
return Comparator
|
||||||
|
.nullsFirst(
|
||||||
|
Comparator
|
||||||
|
.comparing(AdminPageModel::getPosition)
|
||||||
|
.thenComparing(AdminPageModel::getLabel)
|
||||||
|
).compare(this, other);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -89,6 +89,7 @@ public class AdminPagesModel {
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
model.setIcon(fromAdminPage.getIcon());
|
model.setIcon(fromAdminPage.getIcon());
|
||||||
|
model.setPosition(fromAdminPage.getPosition());
|
||||||
return model;
|
return model;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,10 @@
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml"
|
<html xmlns="http://www.w3.org/1999/xhtml"
|
||||||
|
xmlns:bootstrap="http://xmlns.jcp.org/jsf/composite/components/bootstrap"
|
||||||
xmlns:c="http://xmlns.jcp.org/jsp/jstl/core"
|
xmlns:c="http://xmlns.jcp.org/jsp/jstl/core"
|
||||||
xmlns:h="http://xmlns.jcp.org/jsf/html"
|
xmlns:h="http://xmlns.jcp.org/jsf/html"
|
||||||
xmlns:ui="http://xmlns.jcp.org/jsf/facelets">
|
xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
|
||||||
|
xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||||
<ui:composition template="/WEB-INF/views/org/libreccm/ui/admin/ccm-admin.xhtml">
|
<ui:composition template="/WEB-INF/views/org/libreccm/ui/admin/ccm-admin.xhtml">
|
||||||
|
|
||||||
<ui:param name="activePage" value="/" />
|
<ui:param name="activePage" value="/" />
|
||||||
|
|
@ -12,9 +14,37 @@
|
||||||
</ui:define>
|
</ui:define>
|
||||||
|
|
||||||
<ui:define name="main">
|
<ui:define name="main">
|
||||||
<div class="container">
|
<div class="container-fluid">
|
||||||
<h1>#{AdminMessages['dashboard.label']}</h1>
|
<h1>#{AdminMessages['dashboard.label']}</h1>
|
||||||
<p>Placeholder</p>
|
<div class="row row-cols-1 row-cols-sm-1 row-cols-sm-2 row-cols-md-3 row-cols-lg-4 row-cols-xl-5">
|
||||||
|
<c:forEach begin="1"
|
||||||
|
items="#{AdminPagesModel.adminPages}"
|
||||||
|
var="page">
|
||||||
|
<div class="col mb-4">
|
||||||
|
<div aria-describedby="admin-page-#{page.position}-body"
|
||||||
|
class="card pt-2"
|
||||||
|
id="admin-page-#{page.position}">
|
||||||
|
<svg aria-hidden="true"
|
||||||
|
class="card-img-top"
|
||||||
|
fill="currentColor">
|
||||||
|
<use xlink:href="#{request.contextPath}/assets/bootstrap/bootstrap-icons.svg##{page.icon}" />
|
||||||
|
</svg>
|
||||||
|
<div class="card-body"
|
||||||
|
id="admin-page-#{page.uriIdentifier}-body">
|
||||||
|
<h2 class="card-title">
|
||||||
|
<a class="stretched-link"
|
||||||
|
href="#{mvc.uri(page.uriIdentifier)}">
|
||||||
|
#{page.label}
|
||||||
|
</a>
|
||||||
|
</h2>
|
||||||
|
<p class="card-text">
|
||||||
|
#{page.description}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</c:forEach>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</ui:define>
|
</ui:define>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue