Some additional components
parent
97ace91f7a
commit
f2455c3160
|
|
@ -38,6 +38,7 @@ import javax.enterprise.context.RequestScoped;
|
|||
import javax.inject.Inject;
|
||||
import javax.mvc.Controller;
|
||||
import javax.mvc.Models;
|
||||
import javax.mvc.MvcContext;
|
||||
import javax.transaction.Transactional;
|
||||
import javax.ws.rs.FormParam;
|
||||
import javax.ws.rs.GET;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,79 @@
|
|||
<!DOCTYPE html [<!ENTITY times '×'>]>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"
|
||||
xmlns:bootstrap="http://xmlns.jcp.org/jsf/composite/components/bootstrap"
|
||||
xmlns:cc="http://xmlns.jcp.org/jsf/composite"
|
||||
xmlns:c="http://xmlns.jcp.org/jsp/jstl/core">
|
||||
<cc:interface shortDescription="Component for showing messages (org.libreccm.ui.Message).">
|
||||
<cc:attribute name="actionTarget"
|
||||
required="true"
|
||||
shortDescription="URL to which the form is send." />
|
||||
<cc:attribute name="buttonClass"
|
||||
default="btn-secondary"
|
||||
required="false"
|
||||
shortDescription="Bootstrap button context class to use for the button toggleing the modal form, eg. button-info."
|
||||
type="String" />
|
||||
<cc:attribute name="buttonIcon"
|
||||
default=""
|
||||
required="false"
|
||||
shortDescription="Name of the icon to use in the button. If empty no icon will be used."
|
||||
type="String" />
|
||||
<cc:attribute name="buttonText"
|
||||
required="true"
|
||||
shortDescription="Text for the button toggleing the modal form."
|
||||
type="String" />
|
||||
<cc:attribute name="buttonTextClass"
|
||||
default=""
|
||||
required="false"
|
||||
shortDescription="Class used for aligning the button. Either text-left, text-center or text-right."
|
||||
type="String" />
|
||||
<cc:attribute name="dialogId"
|
||||
required="true"
|
||||
shortDescription="ID for the dialog."
|
||||
type="String" />
|
||||
<cc:attribute name="method"
|
||||
default="post"
|
||||
required="false"
|
||||
shortDescription="Method used to send to form. Defaults to POST."
|
||||
type="String" />
|
||||
<cc:facet name="body" required="true" />
|
||||
<cc:facet name="footer" required="true"/>
|
||||
<cc:facet name="title" required="true" />
|
||||
</cc:interface>
|
||||
<cc:implementation>
|
||||
<div class="#{cc.attrs.buttonTextClass}">
|
||||
<button aria-labelledby="#{cc.attrs.dialogId}-title"
|
||||
class="btn #{cc.attrs.buttonClass}"
|
||||
data-target="##{cc.attrs.dialogId}"
|
||||
data-toggle="modal"
|
||||
type="button">
|
||||
<c:if test="#{!cc.attrs.buttonIcon.isEmpty()}">
|
||||
<bootstrap:svgIcon icon="#{cc.attrs.buttonIcon}" />
|
||||
</c:if>
|
||||
<span>#{cc.attrs.buttonText}</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal fade"
|
||||
data-backdrop="static"
|
||||
id="#{cc.attrs.dialogId}"
|
||||
tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<form action="#{cc.attrs.actionTarget}"
|
||||
class="modal-content"
|
||||
method="#{cc.attrs.method}">
|
||||
<div class="modal-header">
|
||||
<div class="modal-title"
|
||||
id="#{cc.attrs.dialogId}-title">
|
||||
<cc:renderFacet name="title" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<cc:renderFacet name="body" />
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<cc:renderFacet name="footer" />
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</cc:implementation>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
<!DOCTYPE html [<!ENTITY times '×'>]>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"
|
||||
xmlns:cc="http://xmlns.jcp.org/jsf/composite"
|
||||
xmlns:c="http://xmlns.jcp.org/jsp/jstl/core">
|
||||
<cc:interface shortDescription="Component for showing messages (org.libreccm.ui.Message).">
|
||||
<cc:attribute name="messages"
|
||||
required="true"
|
||||
shortDescription="The messages to show"
|
||||
type="java.util.Collection" />
|
||||
</cc:interface>
|
||||
<cc:implementation>
|
||||
<div>
|
||||
<c:forEach items="#{cc.attrs.message}" var="message">
|
||||
<div class="alert alert-#{message.messageTypeClass}"
|
||||
role="alert">
|
||||
#{message.message}
|
||||
</div>
|
||||
</c:forEach>
|
||||
</div>
|
||||
</cc:implementation>
|
||||
</html>
|
||||
|
|
@ -4,7 +4,8 @@
|
|||
xmlns:c="http://xmlns.jcp.org/jsp/jstl/core"
|
||||
xmlns:h="http://xmlns.jcp.org/jsf/html"
|
||||
xmlns:libreccm="http://xmlns.jcp.org/jsf/composite/components/libreccm"
|
||||
xmlns:ui="http://xmlns.jcp.org/jsf/facelets">
|
||||
xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
|
||||
xmlns:f="http://xmlns.jcp.org/jsf/core">
|
||||
<ui:composition template="/WEB-INF/views/org/libreccm/ui/admin/ccm-admin.xhtml">
|
||||
|
||||
<ui:param name="activePage" value="categories" />
|
||||
|
|
@ -25,6 +26,8 @@
|
|||
<div class="container">
|
||||
<h1>#{AdminMessages.getMessage('categorysystems.details.title', [CategorySystemDetailsModel.domainKey])}</h1>
|
||||
|
||||
<libreccm:messages messages="#{CategorySystemDetailsModel.messages}" />
|
||||
|
||||
<dl>
|
||||
<div>
|
||||
<dt>
|
||||
|
|
@ -154,35 +157,15 @@
|
|||
#{AdminMessages['categorysystems.details.owners.heading']}
|
||||
</h2>
|
||||
<div class="mb-2">
|
||||
<div class="text-right">
|
||||
<button class="btn btn-secondary"
|
||||
data-target="#categorysystem-owner-add"
|
||||
data-toggle="modal"
|
||||
type="button">
|
||||
<bootstrap:svgIcon icon="plus-circle" />
|
||||
<span>#{AdminMessages['categorysystems.details.owners.add']}</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal fade"
|
||||
data-backdrop="static"
|
||||
id="categorysystem-owner-add"
|
||||
tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<form action="#{mvc.uri('CategorySystemsController#addOwner', {'categorySystemIdentifier': CategorySystemDetailsModel.identifier })}"
|
||||
class="modal-content"
|
||||
method="post">
|
||||
<div class="modal-header">
|
||||
<h3 class="modal-title">
|
||||
#{AdminMessages['categorysstems.details.owner.add.dialog.title']}
|
||||
</h3>
|
||||
<button aria-label="#{AdminMessages['categorysystems.details.owner.add.dialog.close']}"
|
||||
class="close"
|
||||
data-dismiss="modal"
|
||||
type="button">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<bootstrap:modalForm actionTarget="#{mvc.uri('CategorySystemsController#addOwner', {'categorySystemIdentifier': CategorySystemDetailsModel.identifier })}"
|
||||
buttonIcon="plus-circle"
|
||||
buttonText="#{AdminMessages['categorysystems.details.owners.add']}"
|
||||
buttonTextClass="text-right"
|
||||
dialogId="categorysystem-owner-add">
|
||||
<f:facet name="title">
|
||||
<h3>#{AdminMessages['categorysstems.details.owner.add.dialog.title']}</h3>
|
||||
</f:facet>
|
||||
<f:facet name="body">
|
||||
<div class="form-group">
|
||||
<label for="categorysystem-owner-add-application">
|
||||
#{AdminMessages['categorysystems.details.owner.add.dialog.application.label']}
|
||||
|
|
@ -216,7 +199,8 @@
|
|||
#{AdminMessages['categorysystems.details.owner.add.dialog.context.help']}
|
||||
</small>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
</f:facet>
|
||||
<f:facet name="footer">
|
||||
<button class="btn btn-secondary"
|
||||
data-dismiss="modal"
|
||||
type="button" >
|
||||
|
|
@ -225,11 +209,8 @@
|
|||
<button type="submit" class="btn btn-primary">
|
||||
#{AdminMessages['categorysystems.details.owner.add.dialog.submit']}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</f:facet>
|
||||
</bootstrap:modalForm>
|
||||
</div>
|
||||
<c:choose>
|
||||
<c:when test="#{CategorySystemDetailsModel.getOwners().isEmpty()}">
|
||||
|
|
|
|||
Loading…
Reference in New Issue