Template for related info step

pull/10/head
Jens Pelzetter 2021-03-29 21:05:55 +02:00
parent 1577130605
commit b27b5e5dc5
6 changed files with 649 additions and 86 deletions

View File

@ -0,0 +1,75 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package org.librecms.ui.contentsections.documents;
import org.librecms.contentsection.AttachmentList;
import java.util.Collections;
import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors;
import javax.enterprise.context.RequestScoped;
import javax.inject.Named;
/**
*
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/
@RequestScoped
@Named("CmsAttachmentListDetailsModel")
public class AttachmentListDetailsModel {
private String uuid;
private String name;
private Map<String, String> titles;
private Map<String, String> descriptions;
public String getUuid() {
return uuid;
}
public Map<String, String> getTitles() {
return Collections.unmodifiableMap(titles);
}
public Map<String, String> getDescriptions() {
return Collections.unmodifiableMap(descriptions);
}
protected void setAttachmentList(final AttachmentList list) {
Objects.requireNonNull(list);
uuid = list.getUuid();
name = list.getName();
titles = list
.getTitle()
.getValues()
.entrySet()
.stream()
.collect(
Collectors.toMap(
entry -> entry.getKey().toString(),
entry -> entry.getValue()
)
);
descriptions = list
.getDescription()
.getValues()
.entrySet()
.stream()
.collect(
Collectors.toMap(
entry -> entry.getKey().toString(),
entry -> entry.getValue()
)
);
}
}

View File

@ -0,0 +1,93 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package org.librecms.ui.contentsections.documents;
import org.libreccm.l10n.GlobalizationHelper;
import org.librecms.assets.RelatedLink;
import java.util.Collections;
import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors;
import javax.enterprise.context.RequestScoped;
import javax.inject.Inject;
import javax.inject.Named;
/**
*
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/
@RequestScoped
@Named("CmsInternalLinkDetailsModel")
public class InternalLinkDetailsModel {
@Inject
private GlobalizationHelper globalizationHelper;
private String listIdentifier;
private String uuid;
private Map<String, String> title;
private String targetItemUuid;
private String targetItemName;
private String targetItemTitle;
public String getListIdentifier() {
return listIdentifier;
}
protected void setListIdentifier(final String listIdentifier) {
this.listIdentifier = listIdentifier;
}
public String getUuid() {
return uuid;
}
public Map<String, String> getTitle() {
return Collections.unmodifiableMap(title);
}
public String getTargetItemUuid() {
return targetItemUuid;
}
public String getTargetItemName() {
return targetItemName;
}
public String getTargetItemTitle() {
return targetItemTitle;
}
protected void setInternalLink(final RelatedLink link) {
Objects.requireNonNull(link);
uuid = link.getUuid();
title = link
.getTitle()
.getValues()
.entrySet()
.stream()
.collect(
Collectors.toMap(
entry -> entry.getKey().toString(),
entry -> entry.getValue()
)
);
targetItemUuid = link.getTargetItem().getItemUuid();
targetItemName = link.getTargetItem().getDisplayName();
targetItemTitle = globalizationHelper.getValueFromLocalizedString(
link.getTargetItem().getTitle()
);
}
}

View File

@ -21,6 +21,8 @@ public class ItemAttachmentDto {
private String title; private String title;
private boolean internalLink;
public long getAttachmentId() { public long getAttachmentId() {
return attachmentId; return attachmentId;
} }
@ -61,4 +63,14 @@ public class ItemAttachmentDto {
this.title = title; this.title = title;
} }
public boolean isInternalLink() {
return internalLink;
}
public void setInternalLink(final boolean internalLink) {
this.internalLink = internalLink;
}
} }

View File

@ -36,6 +36,7 @@ import javax.mvc.Controller;
import javax.mvc.Models; import javax.mvc.Models;
import javax.transaction.Transactional; import javax.transaction.Transactional;
import javax.ws.rs.FormParam; import javax.ws.rs.FormParam;
import javax.ws.rs.GET;
import javax.ws.rs.POST; import javax.ws.rs.POST;
import javax.ws.rs.Path; import javax.ws.rs.Path;
import javax.ws.rs.PathParam; import javax.ws.rs.PathParam;
@ -59,6 +60,9 @@ public class RelatedInfoStep implements MvcAuthoringStep {
@Inject @Inject
private AssetTypesManager assetTypesManager; private AssetTypesManager assetTypesManager;
@Inject
private AttachmentListDetailsModel listDetailsModel;
@Inject @Inject
private AttachmentListManager listManager; private AttachmentListManager listManager;
@ -68,6 +72,9 @@ public class RelatedInfoStep implements MvcAuthoringStep {
@Inject @Inject
private AttachmentListRepository listRepo; private AttachmentListRepository listRepo;
@Inject
private InternalLinkDetailsModel internalLinkDetailsModel;
@Inject @Inject
private ContentItemRepository itemRepo; private ContentItemRepository itemRepo;
@ -176,7 +183,8 @@ public class RelatedInfoStep implements MvcAuthoringStep {
@Transactional(Transactional.TxType.REQUIRED) @Transactional(Transactional.TxType.REQUIRED)
public String addAttachmentList( public String addAttachmentList(
@FormParam("listName") final String name, @FormParam("listName") final String name,
@FormParam("listTitle") final String title @FormParam("listTitle") final String title,
@FormParam("listDescription") final String description
) { ) {
final AttachmentList list = listManager.createAttachmentList( final AttachmentList list = listManager.createAttachmentList(
document, name document, name
@ -184,12 +192,61 @@ public class RelatedInfoStep implements MvcAuthoringStep {
list.getTitle().addValue( list.getTitle().addValue(
globalizationHelper.getNegotiatedLocale(), title globalizationHelper.getNegotiatedLocale(), title
); );
list.getDescription().addValue(
globalizationHelper.getNegotiatedLocale(), description
);
listRepo.save(list); listRepo.save(list);
return String.format( return String.format(
"redirect:/%s/@documents/%s/@authoringsteps/%s", "redirect:/%s/@documents/%s/@authoringsteps/%s/attachmentslists/%s",
section.getLabel(), section.getLabel(),
getContentItemPath(), getContentItemPath(),
PATH_FRAGMENT PATH_FRAGMENT,
list.getName()
);
}
@GET
@Path("/attachmentlists/{attachmentListIdentifier}/@details")
@Transactional(Transactional.TxType.REQUIRED)
public String showAttachmentListDetails(
@PathParam("attachmentListIdentifier") final String listIdentifierParam
) {
final Optional<AttachmentList> listResult = findAttachmentList(
listIdentifierParam
);
if (!listResult.isPresent()) {
return showAttachmentListNotFound(listIdentifierParam);
}
listDetailsModel.setAttachmentList(listResult.get());
return "org/librecms/ui/documents/relatedinfo-attachmentlist-details.xhtml";
}
@POST
@Path("/attachmentlists/{attachmentListIdentifier}/@remove")
@Transactional(Transactional.TxType.REQUIRED)
public String updateAttachmentList(
@PathParam("attachmentListIdentifier") final String listIdentifierParam,
@FormParam("listName") final String name
) {
final Optional<AttachmentList> listResult = findAttachmentList(
listIdentifierParam
);
if (!listResult.isPresent()) {
return showAttachmentListNotFound(listIdentifierParam);
}
final AttachmentList list = listResult.get();
list.setName(name);
listRepo.save(list);
return String.format(
"redirect:/%s/@documents/%s/@authoringsteps/%s/attachmentslists/%s",
section.getLabel(),
getContentItemPath(),
PATH_FRAGMENT,
list.getName()
); );
} }
@ -197,11 +254,9 @@ public class RelatedInfoStep implements MvcAuthoringStep {
@Path("/attachmentlists/{attachmentListIdentifier}/@remove") @Path("/attachmentlists/{attachmentListIdentifier}/@remove")
@Transactional(Transactional.TxType.REQUIRED) @Transactional(Transactional.TxType.REQUIRED)
public String removeAttachmentList( public String removeAttachmentList(
@PathParam("attachmentListIdentifier") @PathParam("attachmentListIdentifier") final String listIdentifierParam,
final String listIdentifierParam,
@FormParam("confirm") final String confirm @FormParam("confirm") final String confirm
) { ) {
final Optional<AttachmentList> listResult = findAttachmentList( final Optional<AttachmentList> listResult = findAttachmentList(
listIdentifierParam listIdentifierParam
); );
@ -256,10 +311,29 @@ public class RelatedInfoStep implements MvcAuthoringStep {
); );
} }
@POST @GET
@Path("/attachmentlists/{attachmentListIdentifier}/internal-links") @Path("/attachmentlists/{attachmentListIdentifier}/internal-links/@create")
@Transactional(Transactional.TxType.REQUIRED) @Transactional(Transactional.TxType.REQUIRED)
public String createInteralLink( public String createInternalLink(
@PathParam("attachmentListIdentifier")
final String listIdentifierParam
) {
final Optional<AttachmentList> listResult = findAttachmentList(
listIdentifierParam
);
if (!listResult.isPresent()) {
return showAttachmentListNotFound(listIdentifierParam);
}
final AttachmentList list = listResult.get();
models.put("attachmentList", list.getName());
return "org/librecms/ui/documents/relatedinfo-create-internallink.xhtml";
}
@POST
@Path("/attachmentlists/{attachmentListIdentifier}/internal-links/@create")
@Transactional(Transactional.TxType.REQUIRED)
public String createInternalLink(
@PathParam("attachmentListIdentifier") @PathParam("attachmentListIdentifier")
final String listIdentifierParam, final String listIdentifierParam,
@FormParam("targetItemUuid") final String targetItemUuid, @FormParam("targetItemUuid") final String targetItemUuid,
@ -296,11 +370,52 @@ public class RelatedInfoStep implements MvcAuthoringStep {
); );
} }
@GET
@Path(
"/attachmentlists/{attachmentListIdentifier}/internal-links/{interalLinkUuid}/@details")
@Transactional(Transactional.TxType.REQUIRED)
public String showInternalLinkDetails(
@PathParam("attachmentListIdentifier")
final String listIdentifierParam,
@PathParam("internalLinkUuid") final String internalLinkUuid
) {
final Optional<AttachmentList> listResult = findAttachmentList(
listIdentifierParam
);
if (!listResult.isPresent()) {
return showAttachmentListNotFound(listIdentifierParam);
}
final AttachmentList list = listResult.get();
final Optional<RelatedLink> linkResult = list
.getAttachments()
.stream()
.map(ItemAttachment::getAsset)
.filter(asset -> asset instanceof RelatedLink)
.map(asset -> (RelatedLink) asset)
.filter(link -> link.getUuid().equals(internalLinkUuid))
.findAny();
if (!linkResult.isPresent()) {
models.put("contentItem", itemManager.getItemPath(document));
models.put("listIdentifier", listIdentifierParam);
models.put("internalLinkUuid", internalLinkUuid);
return "org/librecms/ui/documents/internal-link-asset-not-found.xhtml";
}
final RelatedLink link = linkResult.get();
internalLinkDetailsModel.setListIdentifier(list.getName());
internalLinkDetailsModel.setInternalLink(link);
return "org/librecms/ui/documents/relatedinfo-create-internallink.xhtml";
}
@POST @POST
@Path( @Path(
"/attachmentlists/{attachmentListIdentifier}/internal-links/{interalLinkUuid}") "/attachmentlists/{attachmentListIdentifier}/internal-links/{interalLinkUuid}")
@Transactional(Transactional.TxType.REQUIRED) @Transactional(Transactional.TxType.REQUIRED)
public String updateInteralLinkTarget( public String updateInternalLinkTarget(
@PathParam("attachmentListIdentifier") @PathParam("attachmentListIdentifier")
final String listIdentifierParam, final String listIdentifierParam,
@PathParam("internalLinkUuid") final String internalLinkUuid, @PathParam("internalLinkUuid") final String internalLinkUuid,
@ -339,7 +454,7 @@ public class RelatedInfoStep implements MvcAuthoringStep {
} }
final RelatedLink link = linkResult.get(); final RelatedLink link = linkResult.get();
link.setTargetItem(document); link.setTargetItem(itemResult.get());
assetRepo.save(link); assetRepo.save(link);
return String.format( return String.format(
@ -354,7 +469,7 @@ public class RelatedInfoStep implements MvcAuthoringStep {
@Path( @Path(
"/attachmentlists/{attachmentListIdentifier}/internal-links/{interalLinkUuid}/title/@add") "/attachmentlists/{attachmentListIdentifier}/internal-links/{interalLinkUuid}/title/@add")
@Transactional(Transactional.TxType.REQUIRED) @Transactional(Transactional.TxType.REQUIRED)
public String addInteralLinkTitle( public String addInternalLinkTitle(
@PathParam("attachmentListIdentifier") @PathParam("attachmentListIdentifier")
final String listIdentifierParam, final String listIdentifierParam,
@PathParam("internalLinkUuid") final String internalLinkUuid, @PathParam("internalLinkUuid") final String internalLinkUuid,
@ -402,7 +517,7 @@ public class RelatedInfoStep implements MvcAuthoringStep {
@Path( @Path(
"/attachmentlists/{attachmentListIdentifier}/internal-links/{interalLinkUuid}/title/@edit/{locale}") "/attachmentlists/{attachmentListIdentifier}/internal-links/{interalLinkUuid}/title/@edit/{locale}")
@Transactional(Transactional.TxType.REQUIRED) @Transactional(Transactional.TxType.REQUIRED)
public String updateInteralLinkTitle( public String updateInternalLinkTitle(
@PathParam("attachmentListIdentifier") @PathParam("attachmentListIdentifier")
final String listIdentifierParam, final String listIdentifierParam,
@PathParam("internalLinkUuid") final String internalLinkUuid, @PathParam("internalLinkUuid") final String internalLinkUuid,
@ -450,7 +565,7 @@ public class RelatedInfoStep implements MvcAuthoringStep {
@Path( @Path(
"/attachmentlists/{attachmentListIdentifier}/internal-links/{interalLinkUuid}/title/@edit/{locale}") "/attachmentlists/{attachmentListIdentifier}/internal-links/{interalLinkUuid}/title/@edit/{locale}")
@Transactional(Transactional.TxType.REQUIRED) @Transactional(Transactional.TxType.REQUIRED)
public String removeInteralLinkTitle( public String removeInternalLinkTitle(
@PathParam("attachmentListIdentifier") @PathParam("attachmentListIdentifier")
final String listIdentifierParam, final String listIdentifierParam,
@PathParam("internalLinkUuid") final String internalLinkUuid, @PathParam("internalLinkUuid") final String internalLinkUuid,
@ -739,6 +854,10 @@ public class RelatedInfoStep implements MvcAuthoringStep {
.getText(assetTypeInfo.getLabelKey()) .getText(assetTypeInfo.getLabelKey())
); );
dto.setAttachmentId(itemAttachment.getAttachmentId()); dto.setAttachmentId(itemAttachment.getAttachmentId());
dto.setInternalLink(
itemAttachment.getAsset() instanceof RelatedLink
&& ((RelatedLink) itemAttachment.getAsset()).getTargetItem() != null
);
dto.setSortKey(itemAttachment.getSortKey()); dto.setSortKey(itemAttachment.getSortKey());
dto.setTitle( dto.setTitle(
globalizationHelper globalizationHelper

View File

@ -6,85 +6,87 @@
xmlns:ui="http://xmlns.jcp.org/jsf/facelets"> xmlns:ui="http://xmlns.jcp.org/jsf/facelets">
<ui:composition template="/WEB-INF/views/org/librecms/ui/contentsection/documents/authoringstep.xhtml"> <ui:composition template="/WEB-INF/views/org/librecms/ui/contentsection/documents/authoringstep.xhtml">
<c:forEach items="#{CmsCategorizationStep.categorizationTrees}" <ui:define name="authoringStep">
var="tree"> <c:forEach items="#{CmsCategorizationStep.categorizationTrees}"
<h2>#{tree.domainTitle}</h2> var="tree">
<h2>#{tree.domainTitle}</h2>
<div class="d-flex"> <div class="d-flex">
<span>#{CmsDefaultStepsMessageBundle['categorization.system.assigned.to']}</span> <span>#{CmsDefaultStepsMessageBundle['categorization.system.assigned.to']}</span>
<button class="btn btn-primary" <button class="btn btn-primary"
data-target="#edit-categorization-#{tree.domainKey}" data-target="#edit-categorization-#{tree.domainKey}"
data-toggle="modal" data-toggle="modal"
type="button"> type="button">
<bootstrap:svgIcon icon="pen" /> <bootstrap:svgIcon icon="pen" />
<span class="sr-only"> <span class="sr-only">
#{CmsDefaultStepsMessageBundle['categorization.system.assigned.edit']} #{CmsDefaultStepsMessageBundle['categorization.system.assigned.edit']}
</span> </span>
</button> </button>
</div> </div>
<div aria-labelledby="edit-categorization-#{tree.domainKey}-title" <div aria-labelledby="edit-categorization-#{tree.domainKey}-title"
aria-hidden="true" aria-hidden="true"
class="modal fade" class="modal fade"
id="edit-categorization-#{tree.domainKey}" id="edit-categorization-#{tree.domainKey}"
tabindex="-1"> tabindex="-1">
<div class="modal-dialog"> <div class="modal-dialog">
<form action="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@authoringSteps/categorization/#{tree.domainKey}" <form action="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@authoringSteps/categorization/#{tree.domainKey}"
class="modal-content" class="modal-content"
method="post"> method="post">
<div class="modal-header"> <div class="modal-header">
<h3 class="modal-title" <h3 class="modal-title"
id="edit-categorization-#{tree.domainKey}-title"> id="edit-categorization-#{tree.domainKey}-title">
#{CmsDefaultStepsMessageBundle.getMessage('categorization.edit.title', tree.domainKey, CmsCategorizationStep.contentItemTitle)} #{CmsDefaultStepsMessageBundle.getMessage('categorization.edit.title', tree.domainKey, CmsCategorizationStep.contentItemTitle)}
<button aria-label="#{CmsDefaultStepsMessageBundle['categorization.edit.cancel']}" <button aria-label="#{CmsDefaultStepsMessageBundle['categorization.edit.cancel']}"
class="close" class="close"
data-dismiss="modal"
type="button">
<bootstrap:svgIcon icon="x-circle" />
</button>
</h3>
</div>
<div class="modal-body">
<ul class="#{tree.root.subCategoryAssigned ? 'collapse' : 'collapse.show'} "
id="#{node.categoryUuid}-subcategories">
<ui:include src="categorization-tree-node.xhtml">
<ui:param name="node"
value="#{tree.root}" />
<ui:param name="isRoot"
value="true" />
</ui:include>
</ul>
</div>
<div class="modal-footer">
<button class="btn btn-warning"
data-dismiss="modal" data-dismiss="modal"
type="button"> type="button">
<bootstrap:svgIcon icon="x-circle" /> #{CmsDefaultStepsMessageBundle['categorization.edit.cancel']}
</button> </button>
</h3> <button class="btn btn-success"
</div> type="submit">
<div class="modal-body"> #{CmsDefaultStepsMessageBundle['categorization.edit.apply']}
<ul class="#{tree.root.subCategoryAssigned ? 'collapse' : 'collapse.show'} " </button>
id="#{node.categoryUuid}-subcategories"> </div>
<ui:include src="categorization-tree-node.xhtml"> </form>
<ui:param name="node"
value="#{tree.root}" />
<ui:param name="isRoot"
value="true" />
</ui:include>
</ul>
</div>
<div class="modal-footer">
<button class="btn btn-warning"
data-dismiss="modal"
type="button">
#{CmsDefaultStepsMessageBundle['categorization.edit.cancel']}
</button>
<button class="btn btn-success"
type="submit">
#{CmsDefaultStepsMessageBundle['categorization.edit.apply']}
</button>
</div>
</form>
</div>
</div>
<c:choose>
<c:when test="#{tree.root.assigned or tree.root.subCategoryAssigned}">
<c:forEach items="#{tree.assignedCategories}"
var="assigned">
#{assigned}
</c:forEach>
</c:when>
<c:otherwise>
<div class="alert alert-info" role="alert">
#{CmsDefaultStepsMessageBundle['categorization.system.assigned.none']}
</div> </div>
</c:otherwise> </div>
</c:choose>
<c:choose>
<c:when test="#{tree.root.assigned or tree.root.subCategoryAssigned}">
<c:forEach items="#{tree.assignedCategories}"
var="assigned">
#{assigned}
</c:forEach>
</c:when>
<c:otherwise>
<div class="alert alert-info" role="alert">
#{CmsDefaultStepsMessageBundle['categorization.system.assigned.none']}
</div>
</c:otherwise>
</c:choose>
</c:forEach> </c:forEach>
</ui:define>
</ui:composition> </ui:composition>
</html> </html>

View File

@ -0,0 +1,262 @@
<!DOCTYPE html [<!ENTITY times '&#215;'>]>
<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:libreccm="http://xmlns.jcp.org/jsf/composite/components/libreccm"
xmlns:ui="http://xmlns.jcp.org/jsf/facelets">
<ui:composition template="/WEB-INF/views/org/librecms/ui/content-section/documents/document.xhtml">
<ui:param name="activePage" value="document" />
<ui:param name="title" value="#{CmsAdminMessages['contentsection.documents.publishstep.title']}" />
<ui:define name="breadcrumb">
<ui:include src="document-breadcrumbs.xhtml" />
<li aria-current="page" class="breadcrumb-item">
#{CmsAdminMessages['contentsection.document.publishstep.title']}
</li>
</ui:define>
<ui:define name="authoringStep">
<div class="text-right">
<button class="btn btn-primary"
data-toggle="modal"
data-target="#add-attachment.ist-dialog"
type="button">
<bootstrap:svgIcon icon="plus-circle" />
<span>#{CmsDefaultStepsMessageBundle['relatedinfo.attachmentlists.add.button.label']}</span>
</button>
</div>
<div aria-hidden="true"
aria-labelledby="add-attachment.ist-dialog-title"
class="modal fade"
id="add-attachmentlist-dialog"
tabindex="-1">
<div class="modal-dialog">
<form action="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@authoringSteps/relatedinfo/attachmentlists/@add"
class="modal-content"
method="post">
<div class="modal-header">
<h3 class="modal-title"
id="add-attachment.ist-dialog-title">#{CmsDefaultStepsMessageBundle['relatedinfo.attachmentlists.add.dialog.title']}</h3>
<button aria-label="#{CmsDefaultStepsMessageBundle['relatedinfo.attachmentlists.add.dialog.close']}"
class="close"
data-dismiss="modal"
type="button">
<bootstrap:svgIcon icon="x-circle" />
</button>
</div>
<div class="modal-body">
<bootstrap:formGroupText
help="#{CmsDefaultStepsMessageBundle['relatedinfo.attachmentlists.add.dialog.name.help']}"
inputId="#add-attachment-list-name"
label="#{CmsDefaultStepsMessageBundle['relatedinfo.attachmentlists.add.dialog.name.label']}"
name="listName"
/>
<bootstrap:formGroupText
help="#{CmsDefaultStepsMessageBundle['relatedinfo.attachmentlists.add.dialog.title.help']}"
inputId="#add-attachment-list-title"
label="#{CmsDefaultStepsMessageBundle['relatedinfo.attachmentlists.add.dialog.title.label']}"
name="listTitle"
/>
<bootstrap:formGroupTextarea
help="#{CmsDefaultStepsMessageBundle['relatedinfo.attachmentlists.add.dialog.description.help']}"
inputId="#add-attachment-list-name"
label="#{CmsDefaultStepsMessageBundle['relatedinfo.attachmentlists.add.dialog.description.label']}"
name="listDescription"
/>
</div>
<div class="modal-footer">
<button class="btn btn-warning"
data-dismiss="modal"
type="button">
#{CmsDefaultStepsMessageBundle['relatedinfo.attachmentlists.add.dialog.close']}
</button>
<button class="btn btn-success"
type="submit">
#{CmsDefaultStepsMessageBundle['relatedinfo.attachmentlists.add.dialog.add_list']}"
</button>
</div>
</form>
</div>
</div>
<div class="text-right">
<button class="btn btn-primary"
data-target="#attachmentlist-#{list.name}-add-attachment-dialog"
data-toggle="modal"
type="button">
<bootstrap:svgIcon icon="plus-circle" />
<span>#{CmsDefaultStepsMessageBundle['relatedinfo.attachmentlists.attachment.add.label']}</span>
</button>
</div>
<div aria-hidden="true"
aria-labelledby="attachmentlist-#{list.name}-add-attachment-dialog-title"
class="modal fade"
id="attachmentlist-#{list.name}-add-attachment-dialog"
tabindex="-1">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h3 class="modal-title"
id="attachmentlist-#{list.name}-add-attachment-dialog-title">
#{CmsDefaultStepsMessageBundle['relatedinfo.attachmentlists.attachment.add.dialog.title']}
</h3>
<button aria-label="#{CmsDefaultStepsMessageBundle['relatedinfo.attachment.add.dialog.close']}"
class="close"
data-dismiss="modal"
type="button">
<bootstrap:svgIcon icon="x-circle" />
</button>
</div>
<div class="modal-body">
<div class="alert alert-info" role="alert">
Not implemented yet
<!-- Requires JavaScript to search for assets -->
</div>
</div>
</div>
</div>
</div>
<!-- ToDo: Button and Dialog for adding internal links -->
<ul>
<c:forEach items="#{CmsRelatedInfoStep.attachmentLists}"
var="list">
<li>
<div class="d-flex">
<span>#{list.name}</span>
<button class="btn btn-info"
data-target="#attachmentlist-#{list.name}-info"
data-toggle="modal"
type="button">
<bootstrap:svgIcon icon="info-circle" />
<span class="sr-only">
#{CmsDefaultStepsMessageBundle['relatedinfo.attachmentlists.row.info_button.label']}"
</span>
</button>
<div aria-hidden="true"
aria-labelledby="attachment-list-#{list.name}-info-title"
class="modal fade"
id="attachmentlist-#{list.name}-info"
tabindex="-1">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h3 class="model-title"
id="attachment-list-#{list.name}-info-title">
#{CmsDefaultStepsMessageBundle['relatedinfo.attachmentlists.row.info_dialog.title']}"
</h3>
<button aria-label="#{CmsDefaultStepsMessageBundle['relatedinfo.attachmentlists.row.info_dialog.close']}"
class="close"
data-dismiss="modal"
type="button">
<bootstrap:svgIcon icon="x-circle" />
</button>
</div>
<div class="modal-body">
#{list.description}
</div>
<div class="modal-footer">
<button class="btn btn-secondary"
data-dismiss="modal"
type="button">
#{CmsDefaultStepsMessageBundle['relatedinfo.attachmentlists.row.info_dialog.close']}
</button>
</div>
</div>
</div>
</div>
<a class="btn btn-primary"
href="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@authoringSteps/relatedinfo/attachmentlists/#{list.name}/@details">
<bootstrap:svgIcon icon="pen" />
<span class="sr-only">
#{CmsDefaultStepsMessageBundle['relatedinfo.attachmentlists.row.details_link.label']}
</span>
</a>
<form action="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@authoringSteps/relatedinfo/attachmentlists/#{list.name}/@moveDown"
method="post">
<button class="btn btn-secondary"
type="submit">
<bootstrap:svgIcon icon="caret-down-fill" />
<span class="sr-only">
#{CmsDefaultStepsMessageBundle['relatedinfo.attachmentlists.row.move_down.label']}
</span>
</button>
</form>
<form action="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@authoringSteps/relatedinfo/attachmentlists/#{list.name}/@moveUp"
method="post">
<button class="btn btn-secondary"
type="submit">
<bootstrap:svgIcon icon="caret-up-fill" />
<span class="sr-only">
#{CmsDefaultStepsMessageBundle['relatedinfo.attachmentlists.row.move_up.label']}
</span>
</button>
</form>
<libreccm:deleteDialog
actionTarget="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@authoringSteps/relatedinfo/attachmentlists/#{list.name}/@remove"
buttonText="#{CmsDefaultStepsMessageBundle['relatedinfo.attachmentlists.row.remove.label']}"
cancelLabel="#{CmsDefaultStepsMessageBundle['relatedinfo.attachmentlists.row.remove.cancel']}"
confirmLabel="#{CmsDefaultStepsMessageBundle['relatedinfo.attachmentlists.row.remove.confirm']}"
dialogId="attachmentlist-#{list.name}-remove-dialog"
dialogTitle="#{CmsDefaultStepsMessageBundle['relatedinfo.attachmentlists.row.remove.title']}"
message="#{CmsDefaultStepsMessageBundle.getMessage('relatedinfo.attachmentlists.row.remove.message', [list.name])}"
/>
</div>
<ul>
<c:forEach items="#{list.attachments}"
var="attachment">
<li class="d-flex">
<span>#{attachment.title}</span>
<c:if test="#{attachment.internalLink}">
<a class="btn btn-secondary"
href="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@authoringSteps/relatedinfo/attachmentlists/#{list.name}/internal-links/#{attachment.uuid}/@details">
<bootstrap:svgIcon icon="pen" />
<span class="sr-only">
#{CmsDefaultStepsMessageBundle['relatedinfo.attachmentlists.row.internal_link.edit.label']}
</span>
</a>
</c:if>
<form action="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@authoringSteps/relatedinfo//attachments/#{attachment.uuid}/@moveDown"
method="post">
<button class="btn btn-secondary"
type="submit">
<bootstrap:svgIcon icon="caret-down-fill" />
<span class="sr-only">
#{CmsDefaultStepsMessageBundle['relatedinfo.attachmentlists.row.attachment.move_down.label']}
</span>
</button>
</form>
<form action="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@authoringSteps/relatedinfo/attachmentlists/#{list.name}/attachments/#{attachment.uuid}/@moveUp"
method="post">
<button class="btn btn-secondary"
type="submit">
<bootstrap:svgIcon icon="caret-up-fill" />
<span class="sr-only">
#{CmsDefaultStepsMessageBundle['relatedinfo.attachmentlists.attachment.row.move_up.label']}
</span>
</button>
</form>
<libreccm:deleteDialog
actionTarget="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@authoringSteps/relatedinfo/attachmentlists/#{list.name}/attachments/#{attachment.uuid}/@remove"
buttonText="#{CmsDefaultStepsMessageBundle['relatedinfo.attachmentlists.attachment.remove.label']}"
cancelLabel="#{CmsDefaultStepsMessageBundle['relatedinfo.attachmentlists.attachment.remove.cancel']}"
confirmLabel="#{CmsDefaultStepsMessageBundle['relatedinfo.attachmentlists.attachment.remove.confirm']}"
dialogId="remove-attachment-#{attachment.uuid}"
dialogTitle="#{CmsDefaultStepsMessageBundle['relatedinfo.attachmentlists.attachment.remove.title']}"
message="#{CmsDefaultStepsMessageBundle.getMessage('relatedinfo.attachmentlists.attachment.remove.message', [attachment.title])}"
/>
</li>
</c:forEach>
</ul>
</li>
</c:forEach>
</ul>
</ui:define>
</ui:composition>
</html>