Template for related info step
parent
1577130605
commit
b27b5e5dc5
|
|
@ -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()
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -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()
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -21,6 +21,8 @@ public class ItemAttachmentDto {
|
|||
|
||||
private String title;
|
||||
|
||||
private boolean internalLink;
|
||||
|
||||
public long getAttachmentId() {
|
||||
return attachmentId;
|
||||
}
|
||||
|
|
@ -61,4 +63,14 @@ public class ItemAttachmentDto {
|
|||
this.title = title;
|
||||
}
|
||||
|
||||
public boolean isInternalLink() {
|
||||
return internalLink;
|
||||
}
|
||||
|
||||
public void setInternalLink(final boolean internalLink) {
|
||||
this.internalLink = internalLink;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@ import javax.mvc.Controller;
|
|||
import javax.mvc.Models;
|
||||
import javax.transaction.Transactional;
|
||||
import javax.ws.rs.FormParam;
|
||||
import javax.ws.rs.GET;
|
||||
import javax.ws.rs.POST;
|
||||
import javax.ws.rs.Path;
|
||||
import javax.ws.rs.PathParam;
|
||||
|
|
@ -59,6 +60,9 @@ public class RelatedInfoStep implements MvcAuthoringStep {
|
|||
@Inject
|
||||
private AssetTypesManager assetTypesManager;
|
||||
|
||||
@Inject
|
||||
private AttachmentListDetailsModel listDetailsModel;
|
||||
|
||||
@Inject
|
||||
private AttachmentListManager listManager;
|
||||
|
||||
|
|
@ -68,6 +72,9 @@ public class RelatedInfoStep implements MvcAuthoringStep {
|
|||
@Inject
|
||||
private AttachmentListRepository listRepo;
|
||||
|
||||
@Inject
|
||||
private InternalLinkDetailsModel internalLinkDetailsModel;
|
||||
|
||||
@Inject
|
||||
private ContentItemRepository itemRepo;
|
||||
|
||||
|
|
@ -176,7 +183,8 @@ public class RelatedInfoStep implements MvcAuthoringStep {
|
|||
@Transactional(Transactional.TxType.REQUIRED)
|
||||
public String addAttachmentList(
|
||||
@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(
|
||||
document, name
|
||||
|
|
@ -184,12 +192,61 @@ public class RelatedInfoStep implements MvcAuthoringStep {
|
|||
list.getTitle().addValue(
|
||||
globalizationHelper.getNegotiatedLocale(), title
|
||||
);
|
||||
list.getDescription().addValue(
|
||||
globalizationHelper.getNegotiatedLocale(), description
|
||||
);
|
||||
listRepo.save(list);
|
||||
return String.format(
|
||||
"redirect:/%s/@documents/%s/@authoringsteps/%s",
|
||||
"redirect:/%s/@documents/%s/@authoringsteps/%s/attachmentslists/%s",
|
||||
section.getLabel(),
|
||||
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")
|
||||
@Transactional(Transactional.TxType.REQUIRED)
|
||||
public String removeAttachmentList(
|
||||
@PathParam("attachmentListIdentifier")
|
||||
final String listIdentifierParam,
|
||||
@PathParam("attachmentListIdentifier") final String listIdentifierParam,
|
||||
@FormParam("confirm") final String confirm
|
||||
) {
|
||||
|
||||
final Optional<AttachmentList> listResult = findAttachmentList(
|
||||
listIdentifierParam
|
||||
);
|
||||
|
|
@ -256,10 +311,29 @@ public class RelatedInfoStep implements MvcAuthoringStep {
|
|||
);
|
||||
}
|
||||
|
||||
@POST
|
||||
@Path("/attachmentlists/{attachmentListIdentifier}/internal-links")
|
||||
@GET
|
||||
@Path("/attachmentlists/{attachmentListIdentifier}/internal-links/@create")
|
||||
@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")
|
||||
final String listIdentifierParam,
|
||||
@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
|
||||
@Path(
|
||||
"/attachmentlists/{attachmentListIdentifier}/internal-links/{interalLinkUuid}")
|
||||
@Transactional(Transactional.TxType.REQUIRED)
|
||||
public String updateInteralLinkTarget(
|
||||
public String updateInternalLinkTarget(
|
||||
@PathParam("attachmentListIdentifier")
|
||||
final String listIdentifierParam,
|
||||
@PathParam("internalLinkUuid") final String internalLinkUuid,
|
||||
|
|
@ -339,7 +454,7 @@ public class RelatedInfoStep implements MvcAuthoringStep {
|
|||
}
|
||||
|
||||
final RelatedLink link = linkResult.get();
|
||||
link.setTargetItem(document);
|
||||
link.setTargetItem(itemResult.get());
|
||||
assetRepo.save(link);
|
||||
|
||||
return String.format(
|
||||
|
|
@ -354,7 +469,7 @@ public class RelatedInfoStep implements MvcAuthoringStep {
|
|||
@Path(
|
||||
"/attachmentlists/{attachmentListIdentifier}/internal-links/{interalLinkUuid}/title/@add")
|
||||
@Transactional(Transactional.TxType.REQUIRED)
|
||||
public String addInteralLinkTitle(
|
||||
public String addInternalLinkTitle(
|
||||
@PathParam("attachmentListIdentifier")
|
||||
final String listIdentifierParam,
|
||||
@PathParam("internalLinkUuid") final String internalLinkUuid,
|
||||
|
|
@ -402,7 +517,7 @@ public class RelatedInfoStep implements MvcAuthoringStep {
|
|||
@Path(
|
||||
"/attachmentlists/{attachmentListIdentifier}/internal-links/{interalLinkUuid}/title/@edit/{locale}")
|
||||
@Transactional(Transactional.TxType.REQUIRED)
|
||||
public String updateInteralLinkTitle(
|
||||
public String updateInternalLinkTitle(
|
||||
@PathParam("attachmentListIdentifier")
|
||||
final String listIdentifierParam,
|
||||
@PathParam("internalLinkUuid") final String internalLinkUuid,
|
||||
|
|
@ -450,7 +565,7 @@ public class RelatedInfoStep implements MvcAuthoringStep {
|
|||
@Path(
|
||||
"/attachmentlists/{attachmentListIdentifier}/internal-links/{interalLinkUuid}/title/@edit/{locale}")
|
||||
@Transactional(Transactional.TxType.REQUIRED)
|
||||
public String removeInteralLinkTitle(
|
||||
public String removeInternalLinkTitle(
|
||||
@PathParam("attachmentListIdentifier")
|
||||
final String listIdentifierParam,
|
||||
@PathParam("internalLinkUuid") final String internalLinkUuid,
|
||||
|
|
@ -739,6 +854,10 @@ public class RelatedInfoStep implements MvcAuthoringStep {
|
|||
.getText(assetTypeInfo.getLabelKey())
|
||||
);
|
||||
dto.setAttachmentId(itemAttachment.getAttachmentId());
|
||||
dto.setInternalLink(
|
||||
itemAttachment.getAsset() instanceof RelatedLink
|
||||
&& ((RelatedLink) itemAttachment.getAsset()).getTargetItem() != null
|
||||
);
|
||||
dto.setSortKey(itemAttachment.getSortKey());
|
||||
dto.setTitle(
|
||||
globalizationHelper
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
xmlns:ui="http://xmlns.jcp.org/jsf/facelets">
|
||||
<ui:composition template="/WEB-INF/views/org/librecms/ui/contentsection/documents/authoringstep.xhtml">
|
||||
|
||||
<ui:define name="authoringStep">
|
||||
<c:forEach items="#{CmsCategorizationStep.categorizationTrees}"
|
||||
var="tree">
|
||||
<h2>#{tree.domainTitle}</h2>
|
||||
|
|
@ -85,6 +86,7 @@
|
|||
|
||||
|
||||
</c:forEach>
|
||||
</ui:define>
|
||||
|
||||
</ui:composition>
|
||||
</html>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,262 @@
|
|||
<!DOCTYPE html [<!ENTITY times '×'>]>
|
||||
<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>
|
||||
Loading…
Reference in New Issue