Related Link step
parent
33c72859ee
commit
30320485d4
|
|
@ -106,7 +106,7 @@ public class ItemAttachmentDto {
|
|||
return internalLink;
|
||||
}
|
||||
|
||||
public void setInternalLink(final boolean internalLink) {
|
||||
public void setLink(final boolean internalLink) {
|
||||
this.internalLink = internalLink;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -943,7 +943,7 @@ public class RelatedInfoStep extends AbstractMvcAuthoringStep {
|
|||
@GET
|
||||
@Path("/attachmentlists/{attachmentListIdentifier}/links/@create")
|
||||
@Transactional(Transactional.TxType.REQUIRED)
|
||||
public String createInternalLink(
|
||||
public String createLink(
|
||||
@PathParam(MvcAuthoringSteps.SECTION_IDENTIFIER_PATH_PARAM)
|
||||
final String sectionIdentifier,
|
||||
@PathParam(MvcAuthoringSteps.DOCUMENT_PATH_PATH_PARAM_NAME)
|
||||
|
|
@ -990,7 +990,6 @@ public class RelatedInfoStep extends AbstractMvcAuthoringStep {
|
|||
* @param documentPath
|
||||
* @param listIdentifierParam The identifier of the list to which the
|
||||
* attachment is added.
|
||||
* @param name
|
||||
* @param locale
|
||||
* @param title The title of the new internal link for the
|
||||
* language return by {@link GlobalizationHelper#getNegotiatedLocale()
|
||||
|
|
@ -1002,17 +1001,15 @@ public class RelatedInfoStep extends AbstractMvcAuthoringStep {
|
|||
@Path(
|
||||
"/attachmentlists/{attachmentListIdentifier}/links/@create")
|
||||
@Transactional(Transactional.TxType.REQUIRED)
|
||||
public String createInternalLink(
|
||||
public String createLink(
|
||||
@PathParam(MvcAuthoringSteps.SECTION_IDENTIFIER_PATH_PARAM)
|
||||
final String sectionIdentifier,
|
||||
@PathParam(MvcAuthoringSteps.DOCUMENT_PATH_PATH_PARAM_NAME)
|
||||
final String documentPath,
|
||||
@PathParam("attachmentListIdentifier")
|
||||
final String listIdentifierParam,
|
||||
@FormParam("targetItemUuid")
|
||||
final String targetItemUuid,
|
||||
@FormParam("name")
|
||||
final String name,
|
||||
// @FormParam("name")
|
||||
// final String name,
|
||||
@FormParam("locale")
|
||||
final String locale,
|
||||
@FormParam("title")
|
||||
|
|
@ -1037,18 +1034,21 @@ public class RelatedInfoStep extends AbstractMvcAuthoringStep {
|
|||
}
|
||||
final AttachmentList list = listResult.get();
|
||||
|
||||
final Optional<ContentItem> itemResult = itemRepo.findByUuid(
|
||||
targetItemUuid
|
||||
);
|
||||
if (!itemResult.isPresent()) {
|
||||
models.put("targetItemUuid", targetItemUuid);
|
||||
return "org/librecms/ui/contentsection/documents/target-item-not-found.xhtml";
|
||||
}
|
||||
|
||||
// final Optional<ContentItem> itemResult = itemRepo.findByUuid(
|
||||
// targetItemUuid
|
||||
// );
|
||||
// if (!itemResult.isPresent()) {
|
||||
// models.put("targetItemUuid", targetItemUuid);
|
||||
// return "org/librecms/ui/contentsection/documents/target-item-not-found.xhtml";
|
||||
// }
|
||||
final RelatedLink relatedLink = new RelatedLink();
|
||||
relatedLink.getTitle().addValue(
|
||||
globalizationHelper.getNegotiatedLocale(), title
|
||||
);
|
||||
relatedLink.setDisplayName(
|
||||
title
|
||||
.toLowerCase(Locale.ROOT)
|
||||
.replaceAll("\\s*", "-"));
|
||||
|
||||
attachmentManager.attachAsset(relatedLink, list);
|
||||
return buildRedirectPathForStep(
|
||||
|
|
@ -1126,7 +1126,7 @@ public class RelatedInfoStep extends AbstractMvcAuthoringStep {
|
|||
if (!linkResult.isPresent()) {
|
||||
models.put("contentItem", getDocumentPath());
|
||||
models.put("listIdentifier", listIdentifierParam);
|
||||
models.put("internalLinkUuid", linkUuid);
|
||||
models.put("linkUuid", linkUuid);
|
||||
return "org/librecms/ui/contentsection/documents/link-asset-not-found.xhtml";
|
||||
}
|
||||
|
||||
|
|
@ -1139,7 +1139,7 @@ public class RelatedInfoStep extends AbstractMvcAuthoringStep {
|
|||
link.getBookmark().getDisplayName()
|
||||
);
|
||||
linkDetailsModel.setBookmarkUuid(link.getBookmark().getUuid());
|
||||
} else {
|
||||
} else if (link.getTargetItem() != null){
|
||||
linkDetailsModel.setLinkType("internal");
|
||||
linkDetailsModel.setTargetItemName(
|
||||
link.getTargetItem().getDisplayName()
|
||||
|
|
@ -1152,7 +1152,10 @@ public class RelatedInfoStep extends AbstractMvcAuthoringStep {
|
|||
linkDetailsModel.setTargetItemUuid(
|
||||
link.getTargetItem().getUuid()
|
||||
);
|
||||
} else {
|
||||
linkDetailsModel.setLinkType("");
|
||||
}
|
||||
|
||||
linkDetailsModel.setTitle(
|
||||
link
|
||||
.getTitle()
|
||||
|
|
@ -1196,25 +1199,25 @@ public class RelatedInfoStep extends AbstractMvcAuthoringStep {
|
|||
* @param documentPath
|
||||
* @param listIdentifierParam The identifier of the {@link AttachmentList}
|
||||
* to which the link belongs.
|
||||
* @param internalLinkUuid The UUID of the link.
|
||||
* @param linkUuid The UUID of the link.
|
||||
* @param targetItemUuid The UUID of the new target item.
|
||||
*
|
||||
* @return A redirect to the details view of the link.
|
||||
*/
|
||||
@POST
|
||||
@Path(
|
||||
"/attachmentlists/{attachmentListIdentifier}/links/{interalLinkUuid}"
|
||||
"/attachmentlists/{attachmentListIdentifier}/links/{linkUuid}"
|
||||
)
|
||||
@Transactional(Transactional.TxType.REQUIRED)
|
||||
public String updateInternalLinkTarget(
|
||||
public String updateLinkTarget(
|
||||
@PathParam(MvcAuthoringSteps.SECTION_IDENTIFIER_PATH_PARAM)
|
||||
final String sectionIdentifier,
|
||||
@PathParam(MvcAuthoringSteps.DOCUMENT_PATH_PATH_PARAM_NAME)
|
||||
final String documentPath,
|
||||
@PathParam("attachmentListIdentifier")
|
||||
final String listIdentifierParam,
|
||||
@PathParam("internalLinkUuid")
|
||||
final String internalLinkUuid,
|
||||
@PathParam("linkUuid")
|
||||
final String linkUuid,
|
||||
@FormParam("targetItemUuid")
|
||||
final String targetItemUuid
|
||||
) {
|
||||
|
|
@ -1251,13 +1254,13 @@ public class RelatedInfoStep extends AbstractMvcAuthoringStep {
|
|||
.map(ItemAttachment::getAsset)
|
||||
.filter(asset -> asset instanceof RelatedLink)
|
||||
.map(asset -> (RelatedLink) asset)
|
||||
.filter(link -> link.getUuid().equals(internalLinkUuid))
|
||||
.filter(link -> link.getUuid().equals(linkUuid))
|
||||
.findAny();
|
||||
|
||||
if (!linkResult.isPresent()) {
|
||||
models.put("contentItem", getDocumentPath());
|
||||
models.put("listIdentifier", listIdentifierParam);
|
||||
models.put("internalLinkUuid", internalLinkUuid);
|
||||
models.put("linkUuid", linkUuid);
|
||||
return "org/librecms/ui/contentsection/documents/internal-link-asset-not-found.xhtml";
|
||||
}
|
||||
|
||||
|
|
@ -1284,7 +1287,7 @@ public class RelatedInfoStep extends AbstractMvcAuthoringStep {
|
|||
* @param documentPath
|
||||
* @param listIdentifierParam The identifier of the {@link AttachmentList}
|
||||
* to which the link belongs.
|
||||
* @param internalLinkUuid The UUID of the link.
|
||||
* @param linkUuid The UUID of the link.
|
||||
* @param localeParam The locale of the new title value.
|
||||
* @param value The localized value.
|
||||
*
|
||||
|
|
@ -1292,17 +1295,17 @@ public class RelatedInfoStep extends AbstractMvcAuthoringStep {
|
|||
*/
|
||||
@POST
|
||||
@Path(
|
||||
"/attachmentlists/{attachmentListIdentifier}/links/{interalLinkUuid}/title/@add")
|
||||
"/attachmentlists/{attachmentListIdentifier}/links/{linkUuid}/title/@add")
|
||||
@Transactional(Transactional.TxType.REQUIRED)
|
||||
public String addInternalLinkTitle(
|
||||
public String addLinkTitle(
|
||||
@PathParam(MvcAuthoringSteps.SECTION_IDENTIFIER_PATH_PARAM)
|
||||
final String sectionIdentifier,
|
||||
@PathParam(MvcAuthoringSteps.DOCUMENT_PATH_PATH_PARAM_NAME)
|
||||
final String documentPath,
|
||||
@PathParam("attachmentListIdentifier")
|
||||
final String listIdentifierParam,
|
||||
@PathParam("internalLinkUuid")
|
||||
final String internalLinkUuid,
|
||||
@PathParam("linkUuid")
|
||||
final String linkUuid,
|
||||
@FormParam("locale")
|
||||
final String localeParam,
|
||||
@FormParam("value")
|
||||
|
|
@ -1333,13 +1336,13 @@ public class RelatedInfoStep extends AbstractMvcAuthoringStep {
|
|||
.map(ItemAttachment::getAsset)
|
||||
.filter(asset -> asset instanceof RelatedLink)
|
||||
.map(asset -> (RelatedLink) asset)
|
||||
.filter(link -> link.getUuid().equals(internalLinkUuid))
|
||||
.filter(link -> link.getUuid().equals(linkUuid))
|
||||
.findAny();
|
||||
|
||||
if (!linkResult.isPresent()) {
|
||||
models.put("contentItem", getDocumentPath());
|
||||
models.put("listIdentifierParam", listIdentifierParam);
|
||||
models.put("internalLinkUuid", internalLinkUuid);
|
||||
models.put("linkUuid", linkUuid);
|
||||
return "org/librecms/ui/contentsection/documents/internal-link-asset-not-found.xhtml";
|
||||
}
|
||||
|
||||
|
|
@ -1367,7 +1370,7 @@ public class RelatedInfoStep extends AbstractMvcAuthoringStep {
|
|||
* @param documentPath
|
||||
* @param listIdentifierParam The identifier of the {@link AttachmentList}
|
||||
* to which the link belongs.
|
||||
* @param internalLinkUuid The UUID of the link.
|
||||
* @param linkUuid The UUID of the link.
|
||||
* @param localeParam The locale of the title value to update.
|
||||
* @param value The localized value.
|
||||
*
|
||||
|
|
@ -1375,17 +1378,17 @@ public class RelatedInfoStep extends AbstractMvcAuthoringStep {
|
|||
*/
|
||||
@POST
|
||||
@Path(
|
||||
"/attachmentlists/{attachmentListIdentifier}/links/{interalLinkUuid}/title/@edit/{locale}")
|
||||
"/attachmentlists/{attachmentListIdentifier}/links/{linkUuid}/title/@edit/{locale}")
|
||||
@Transactional(Transactional.TxType.REQUIRED)
|
||||
public String updateInternalLinkTitle(
|
||||
public String updateLinkTitle(
|
||||
@PathParam(MvcAuthoringSteps.SECTION_IDENTIFIER_PATH_PARAM)
|
||||
final String sectionIdentifier,
|
||||
@PathParam(MvcAuthoringSteps.DOCUMENT_PATH_PATH_PARAM_NAME)
|
||||
final String documentPath,
|
||||
@PathParam("attachmentListIdentifier")
|
||||
final String listIdentifierParam,
|
||||
@PathParam("internalLinkUuid")
|
||||
final String internalLinkUuid,
|
||||
@PathParam("linkUuid")
|
||||
final String linkUuid,
|
||||
@PathParam("locale")
|
||||
final String localeParam,
|
||||
@FormParam("value")
|
||||
|
|
@ -1416,13 +1419,13 @@ public class RelatedInfoStep extends AbstractMvcAuthoringStep {
|
|||
.map(ItemAttachment::getAsset)
|
||||
.filter(asset -> asset instanceof RelatedLink)
|
||||
.map(asset -> (RelatedLink) asset)
|
||||
.filter(link -> link.getUuid().equals(internalLinkUuid))
|
||||
.filter(link -> link.getUuid().equals(linkUuid))
|
||||
.findAny();
|
||||
|
||||
if (!linkResult.isPresent()) {
|
||||
models.put("contentItem", getDocumentPath());
|
||||
models.put("listIdentifierParam", listIdentifierParam);
|
||||
models.put("internalLinkUuid", internalLinkUuid);
|
||||
models.put("linkUuid", linkUuid);
|
||||
return "org/librecms/ui/contentsection/documents/internal-link-asset-not-found.xhtml";
|
||||
}
|
||||
|
||||
|
|
@ -1450,25 +1453,25 @@ public class RelatedInfoStep extends AbstractMvcAuthoringStep {
|
|||
* @param documentPath
|
||||
* @param listIdentifierParam The identifier of the {@link AttachmentList}
|
||||
* to which the link belongs.
|
||||
* @param internalLinkUuid The UUID of the link.
|
||||
* @param linkUuid The UUID of the link.
|
||||
* @param localeParam The locale of the value to remove.
|
||||
*
|
||||
* @return A redirect to the details view of the link.
|
||||
*/
|
||||
@POST
|
||||
@Path(
|
||||
"/attachmentlists/{attachmentListIdentifier}/links/{interalLinkUuid}/title/@remove/{locale}"
|
||||
"/attachmentlists/{attachmentListIdentifier}/links/{linkUuid}/title/@remove/{locale}"
|
||||
)
|
||||
@Transactional(Transactional.TxType.REQUIRED)
|
||||
public String removeInternalLinkTitle(
|
||||
public String removeLinkTitle(
|
||||
@PathParam(MvcAuthoringSteps.SECTION_IDENTIFIER_PATH_PARAM)
|
||||
final String sectionIdentifier,
|
||||
@PathParam(MvcAuthoringSteps.DOCUMENT_PATH_PATH_PARAM_NAME)
|
||||
final String documentPath,
|
||||
@PathParam("attachmentListIdentifier")
|
||||
final String listIdentifierParam,
|
||||
@PathParam("internalLinkUuid")
|
||||
final String internalLinkUuid,
|
||||
@PathParam("linkUuid")
|
||||
final String linkUuid,
|
||||
@PathParam("locale")
|
||||
final String localeParam
|
||||
) {
|
||||
|
|
@ -1497,13 +1500,13 @@ public class RelatedInfoStep extends AbstractMvcAuthoringStep {
|
|||
.map(ItemAttachment::getAsset)
|
||||
.filter(asset -> asset instanceof RelatedLink)
|
||||
.map(asset -> (RelatedLink) asset)
|
||||
.filter(link -> link.getUuid().equals(internalLinkUuid))
|
||||
.filter(link -> link.getUuid().equals(linkUuid))
|
||||
.findAny();
|
||||
|
||||
if (!linkResult.isPresent()) {
|
||||
models.put("contentItem", getDocumentPath());
|
||||
models.put("listIdentifierParam", listIdentifierParam);
|
||||
models.put("internalLinkUuid", internalLinkUuid);
|
||||
models.put("linkUuid", linkUuid);
|
||||
return "org/librecms/ui/contentsection/documents/internal-link-asset-not-found.xhtml";
|
||||
}
|
||||
|
||||
|
|
@ -1950,7 +1953,7 @@ public class RelatedInfoStep extends AbstractMvcAuthoringStep {
|
|||
.getText(assetTypeInfo.getLabelKey())
|
||||
);
|
||||
dto.setAttachmentId(itemAttachment.getAttachmentId());
|
||||
dto.setInternalLink(
|
||||
dto.setLink(
|
||||
itemAttachment.getAsset() instanceof RelatedLink
|
||||
&& ((RelatedLink) itemAttachment.getAsset()).getTargetItem()
|
||||
!= null
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@
|
|||
class="modal-content"
|
||||
method="post">
|
||||
<div class="modal-header">
|
||||
<h4>
|
||||
<h4 id="name-edit-dialog-title">
|
||||
#{CmsDefaultStepsMessageBundle.getMessage('relatedinfo.attachmentlist.details.name_edit_dialog.title', [CmsAttachmentListDetailsModel.name])}
|
||||
</h4>
|
||||
<button aria-label="#{CmsDefaultStepsMessageBundle['relatedinfo.attachmentlist.details.name_edit_dialog.close']}"
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
<a class="btn btn-secondary mr-3"
|
||||
href="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@relatedinfo">
|
||||
<bootstrap:svgIcon icon="arrow-left-circle" />
|
||||
<span>#{CmsDefaultStepsMessageBundle['relatedinfo.links.create.back']}</span>
|
||||
<span class="sr-only">#{CmsDefaultStepsMessageBundle['relatedinfo.links.create.back']}</span>
|
||||
</a>
|
||||
<h3>
|
||||
#{CmsDefaultStepsMessageBundle.getMessage('relatedinfo.links.create.title', [CmsAttachmentListDetailsModel.name])}
|
||||
|
|
@ -26,22 +26,22 @@
|
|||
</div>
|
||||
</c:forEach>
|
||||
|
||||
<form action="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@relatedinfo/attachmentlists/#{CmsAttachmentListDetailsModel.name}/links/@create"
|
||||
<form action="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@relatedinfo/attachmentlists/#{attachmentList}/links/@create"
|
||||
method="post">
|
||||
<bootstrap:formGroupText
|
||||
help="#{CmsAssetsStepsDefaultMessagesBundle['createform.name.help']}"
|
||||
<!-- <bootstrap:formGroupText
|
||||
help="#{CmsDefaultStepsMessageBundle['relatedinfo.links.name.help']}"
|
||||
inputId="name"
|
||||
label="#{CmsAssetsStepsDefaultMessagesBundle['createform.name.label']}"
|
||||
label="#{CmsDefaultStepsMessageBundle['relatedinfo.links.name.label']}"
|
||||
name="name"
|
||||
pattern="^([a-zA-Z0-9_-]*)$"
|
||||
required="true"
|
||||
value="#{CmsBookmarkCreateStep.name}"
|
||||
/>
|
||||
/>-->
|
||||
|
||||
<bootstrap:formGroupSelect
|
||||
help="#{CmsAssetsStepsDefaultMessagesBundle['createform.initial_locale.help']}"
|
||||
help="#{CmsDefaultStepsMessageBundle['relatedinfo.links.initial_locale.help']}"
|
||||
inputId="locale"
|
||||
label="#{CmsAssetsStepsDefaultMessagesBundle['createform.initial_locale.label']}"
|
||||
label="#{CmsDefaultStepsMessageBundle['relatedinfo.links.initial_locale.label']}"
|
||||
name="locale"
|
||||
options="#{CmsBookmarkCreateStep.availableLocales}"
|
||||
required="true"
|
||||
|
|
@ -49,14 +49,14 @@
|
|||
/>
|
||||
|
||||
<bootstrap:formGroupText
|
||||
help="#{CmsAssetsStepsDefaultMessagesBundle['createform.title.help']}"
|
||||
help="#{CmsDefaultStepsMessageBundle['relatedinfo.links.title.help']}"
|
||||
inputId="title"
|
||||
label="#{CmsAssetsStepsDefaultMessagesBundle['createform.title.label']}"
|
||||
label="#{CmsDefaultStepsMessageBundle['relatedinfo.links.title.label']}"
|
||||
name="title"
|
||||
required="true"
|
||||
/>
|
||||
|
||||
<!-- <fieldset aria-describedby="linktype-help"
|
||||
<!-- <fieldset aria-describedby="linktype-help"
|
||||
class="form-group">
|
||||
<div class="row">
|
||||
<legend class="col-form-label col-sm-2 pt-0">#{CmsDefaultStepsMessageBundle['relatedinfo.links.type.label']}</legend>
|
||||
|
|
@ -85,6 +85,18 @@
|
|||
</div>
|
||||
</fieldset>-->
|
||||
|
||||
<div class="buttons">
|
||||
<a class="btn btn-warning"
|
||||
href="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@relatedinfo"
|
||||
type="button">
|
||||
#{CmsDefaultStepsMessageBundle['relatedinfo.links.create.cancel']}
|
||||
</a>
|
||||
<button class="btn btn-success"
|
||||
type="submit">
|
||||
#{CmsDefaultStepsMessageBundle['relatedinfo.links.create.submit']}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
</ui:define>
|
||||
|
|
|
|||
|
|
@ -8,22 +8,43 @@
|
|||
<ui:composition template="/WEB-INF/views/org/librecms/ui/contentsection/documents/authoringstep.xhtml">
|
||||
|
||||
<ui:param name="activePage" value="document" />
|
||||
<ui:param name="title" value="#{CmsDefaultStepsMessageBundle['contentsection.documents.relatedinfo.internallink.details.title']}" />
|
||||
<ui:param name="title" value="#{CmsDefaultStepsMessageBundle['contentsection.documents.relatedinfo.link.details.title']}" />
|
||||
|
||||
<ui:define name="authoringStep">
|
||||
<h2>
|
||||
#{CmsDefaultStepsMessageBundle['relatedinfo.link.details.title']}
|
||||
</h2>
|
||||
|
||||
<libreccm:localizedStringEditor addMethod="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@authoringSteps/relatedinfo/attachmentlists/#{list.name}/internal-links/#{CmsInternalLinkDetailsModel.uuid}/title/@add"
|
||||
editMethod="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@authoringSteps/relatedinfo/attachmentlists/#{list.name}//internal-links/#{CmsInternalLinkDetailsModel.uuid}/title/@edit"
|
||||
editorId="list-title-editor"
|
||||
hasUnusedLocales="#{!CmsAttachmentListDetailsModel.unusedDescriptionLocales.isEmpty()}"
|
||||
objectIdentifier="#{CmsAttachmentListDetailsModel.name}"
|
||||
removeMethod="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@authoringSteps/relatedinfo/attachmentlists/#{list.name}//internal-links/#{CmsInternalLinkDetailsModel.uuid}/title/@remove"
|
||||
title="CmsDefaultStepsMessageBundle['relatedinfo.internallink.details.title_editor.title']}"
|
||||
unusedLocales="#{CmsAttachmentListDetailsModel.unusedDescriptionLocales}"
|
||||
values="#{CmsAttachmentListDetailsModel.titles}"
|
||||
<libreccm:localizedStringEditor
|
||||
addButtonLabel="#{CmsDefaultStepsMessageBundle['contentsection.documents.relatedinfo.link.title.add.button_label']}"
|
||||
addDialogCancelLabel="#{CmsDefaultStepsMessageBundle['contentsection.documents.relatedinfo.link.title.add.cancel']}"
|
||||
addDialogLocaleSelectHelp="#{CmsDefaultStepsMessageBundle['contentsection.documents.relatedinfo.link.title.add.locale.help']}"
|
||||
addDialogLocaleSelectLabel="#{CmsDefaultStepsMessageBundle['contentsection.documents.relatedinfo.link.title.add.locale.label']}"
|
||||
addDialogSubmitLabel="#{CmsDefaultStepsMessageBundle['contentsection.documents.relatedinfo.link.title.add.submit.label']}"
|
||||
addDialogTitle="#{CmsDefaultStepsMessageBundle['contentsection.documents.relatedinfo.link.title.add_dialog.title']}"
|
||||
addDialogValueHelp="#{CmsDefaultStepsMessageBundle['contentsection.documents.relatedinfo.link.title.add.value.help']}"
|
||||
addDialogValueLabel="#{CmsDefaultStepsMessageBundle['contentsection.documents.relatedinfo.link.title.add.value.label']}"
|
||||
addMethod="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@authoringSteps/relatedinfo/attachmentlists/#{CmsLinkDetailsModel.listIdentifier}/links/#{CmsLinkDetailsModel.uuid}/title/@add"
|
||||
editButtonLabel="#{CmsDefaultStepsMessageBundle['contentsection.documents.relatedinfo.link.title.edit.button_label']}"
|
||||
editDialogCancelLabel="#{CmsDefaultStepsMessageBundle['contentsection.documents.relatedinfo.link.title.edit.cancel']}"
|
||||
editDialogSubmitLabel="#{CmsDefaultStepsMessageBundle['contentsection.documents.relatedinfo.link.title.edit.submit']}"
|
||||
editDialogTitle="#{CmsDefaultStepsMessageBundle['contentsection.documents.relatedinfo.link.title.edit_dialog.title']}"
|
||||
editDialogValueHelp="#{CmsDefaultStepsMessageBundle['contentsection.documents.relatedinfo.link.title.edit.value.help']}"
|
||||
editDialogValueLabel="#{CmsDefaultStepsMessageBundle['contentsection.documents.relatedinfo.link.title.edit.value.label']}"
|
||||
editMethod="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@authoringSteps/relatedinfo/attachmentlists/#{CmsLinkDetailsModel.listIdentifier}/links/#{CmsLinkDetailsModel.uuid}/title/@edit"
|
||||
editorId="link-title-editor"
|
||||
hasUnusedLocales="#{!CmsLinkDetailsModel.unusedTitleLocales.isEmpty()}"
|
||||
headingLevel="3"
|
||||
objectIdentifier="#{CmsLinkDetailsModel.uuid}"
|
||||
removeButtonLabel="#{CmsDefaultStepsMessageBundle['contentsection.documents.relatedinfo.link.title.remove.button_label']}"
|
||||
removeDialogCancelLabel="#{CmsDefaultStepsMessageBundle['contentsection.documents.relatedinfo.link.title.remove.cancel']}"
|
||||
removeDialogSubmitLabel="#{CmsDefaultStepsMessageBundle['contentsection.documents.relatedinfo.link.title.remove.submit']}"
|
||||
removeDialogText="#{CmsDefaultStepsMessageBundle['contentsection.documents.relatedinfo.link.title.remove.text']}"
|
||||
removeDialogTitle="#{CmsDefaultStepsMessageBundle['contentsection.documents.relatedinfo.link.title.remove.title']}"
|
||||
removeMethod="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@authoringSteps/relatedinfo/attachmentlists/#{CmsLinkDetailsModel.listIdentifier}/links/#{CmsLinkDetailsModel.uuid}/title/@remove"
|
||||
title="#{CmsDefaultStepsMessageBundle['relatedinfo.link.details.title_editor.title']}"
|
||||
unusedLocales="#{CmsLinkDetailsModel.unusedTitleLocales}"
|
||||
values="#{CmsLinkDetailsModel.title}"
|
||||
/>
|
||||
|
||||
<form>
|
||||
|
|
@ -32,9 +53,9 @@
|
|||
<div class="row">
|
||||
<legend class="col-form-label col-sm-2 pt-0">#{CmsDefaultStepsMessageBundle['relatedinfo.links.type.label']}</legend>
|
||||
<div class="col-sm-10">
|
||||
<div class="from-check">
|
||||
<div class="form-check">
|
||||
<input
|
||||
checked="#{"internal".equals(selectedType)}"
|
||||
checked="#{'internal'.equals(selectedType)}"
|
||||
class="form-check-input link-type-select"
|
||||
id="linktype-internal"
|
||||
name="linkType"
|
||||
|
|
@ -42,12 +63,14 @@
|
|||
value="internal"
|
||||
/>
|
||||
<label for="linktype-internal">#{CmsDefaultStepsMessageBundle['relatedinfo.links.type.internal']}</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input
|
||||
checked="#{"external".equals(selectedType)}"
|
||||
checked="#{'external'.equals(selectedType)}"
|
||||
class="form-check-input link-type-select"
|
||||
id="linktype-internal"
|
||||
name="linkType"
|
||||
type="external"
|
||||
type="radio"
|
||||
value="external"
|
||||
/>
|
||||
<label for="linktype-internal">#{CmsDefaultStepsMessageBundle['relatedinfo.links.type.external']}</label>
|
||||
|
|
@ -75,18 +98,15 @@
|
|||
buttonText="#{CmsDefaultStepsMessageBundle['relatedinfo.link.details.title.target.select_bookmark']}"
|
||||
/>
|
||||
<librecms:assetPicker
|
||||
actionUrl="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@relatedinfo/attachmentlists/#{CmsAttachmentListDetailsModel.name}/links/#{CmsLinkDetailsModel.uuid}/details/@set-target-bookmark"
|
||||
actionUrl="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@relatedinfo/attachmentlists/#{CmsLinkDetailsModel.listIdentifier}/links/#{CmsLinkDetailsModel.uuid}/details/@set-target-bookmark"
|
||||
assetType="#{CmsLinkDetailsModel.bookmarkType}"
|
||||
assetPickerId="bookmark-picker"
|
||||
baseUrl="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@relatedinfo-service"
|
||||
contentSection="#{CmsLinkDetailsModel.sectionName}"
|
||||
formParamName="bookmarkIdentifier"
|
||||
/>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</ui:define>
|
||||
|
||||
</ui:composition>
|
||||
|
|
|
|||
|
|
@ -166,3 +166,41 @@ relatedinfo.attachmentlists.info.dialog.title=Attachment List {0} Info
|
|||
relatedinfo.attachmentlists.info.dialog.title.label=Title
|
||||
relatedinfo.attachmentlists.info.dialog.description.label=Description
|
||||
relatedinfo.attachmentlists.info.dialog.close=Close
|
||||
relatedinfo.links.create.back=Back
|
||||
relatedinfo.links.create.title=Create a new related link
|
||||
relatedinfo.links.name.help=The internal name of the related link. Can only contain the letter a to z, A to Z, numbers, the dash ("-") and the underscore ("_").
|
||||
relatedinfo.links.name.label=Name
|
||||
relatedinfo.links.initial_locale.help=The locale of the title entered below.
|
||||
relatedinfo.links.initial_locale.label=Locale
|
||||
relatedinfo.links.title.help=The title of the related link.
|
||||
relatedinfo.links.title.label=Title
|
||||
relatedinfo.links.create.cancel=Cancel
|
||||
relatedinfo.links.create.submit=Create link
|
||||
contentsection.documents.relatedinfo.link.details.title=Related Link Details
|
||||
relatedinfo.link.details.title=Related Link Details
|
||||
contentsection.documents.relatedinfo.link.title.add.button_label=Add localized title
|
||||
contentsection.documents.relatedinfo.link.title.add.cancel=Cancel
|
||||
contentsection.documents.relatedinfo.link.title.add.locale.help=The locale of the localized title.
|
||||
contentsection.documents.relatedinfo.link.title.add.locale.label=Locale
|
||||
contentsection.documents.relatedinfo.link.title.add.submit.label=Add localized title
|
||||
contentsection.documents.relatedinfo.link.title.add_dialog.title=Add localized title
|
||||
contentsection.documents.relatedinfo.link.title.add.value.help=The localized title of the link.
|
||||
contentsection.documents.relatedinfo.link.title.add.value.label=Title
|
||||
contentsection.documents.relatedinfo.link.title.edit.button_label=Edit localized title
|
||||
contentsection.documents.relatedinfo.link.title.edit.cancel=Cancel
|
||||
contentsection.documents.relatedinfo.link.title.edit.submit=Save
|
||||
contentsection.documents.relatedinfo.link.title.edit_dialog.title=Edit localized title
|
||||
contentsection.documents.relatedinfo.link.title.edit.value.help=The localized title of the link.
|
||||
contentsection.documents.relatedinfo.link.title.edit.value.label=Title
|
||||
contentsection.documents.relatedinfo.link.title.remove.button_label=Remove localized title
|
||||
contentsection.documents.relatedinfo.link.title.remove.cancel=Cancel
|
||||
contentsection.documents.relatedinfo.link.title.remove.submit=Remove
|
||||
contentsection.documents.relatedinfo.link.title.remove.text=Are you sure to remove the following localized title:
|
||||
contentsection.documents.relatedinfo.link.title.remove.title=Remove localized title
|
||||
relatedinfo.link.details.title_editor.title=Title
|
||||
relatedinfo.links.type.label=Type
|
||||
relatedinfo.links.type.internal=Internal link
|
||||
relatedinfo.links.type.external=External link
|
||||
relatedinfo.links.type.help=The type of the link. Internal links are linked with another document (content item). External links link to an URL.
|
||||
relatedinfo.link.details.title.target=Target of the related link
|
||||
relatedinfo.link.details.title.target.select_bookmark=Select bookmark
|
||||
|
|
|
|||
|
|
@ -166,3 +166,41 @@ relatedinfo.attachmentlists.info.dialog.title=Anhangliste {0} Info
|
|||
relatedinfo.attachmentlists.info.dialog.title.label=Titel
|
||||
relatedinfo.attachmentlists.info.dialog.description.label=Beschreibung
|
||||
relatedinfo.attachmentlists.info.dialog.close=Schlie\u00dfen
|
||||
relatedinfo.links.create.back=Zur\u00fcck
|
||||
relatedinfo.links.create.title=Neuen weiterf\u00fchrenden Link erzeugen
|
||||
relatedinfo.links.name.help=Der interne Name des Links. Darf nur die Buchstaben a bis z, A bis Z, Ziffern, die Bindestrich ("-") und den Unterstrich ("_") enthalten.
|
||||
relatedinfo.links.name.label=Name
|
||||
relatedinfo.links.initial_locale.help=Die Sprache des Titels.
|
||||
relatedinfo.links.initial_locale.label=Sprache
|
||||
relatedinfo.links.title.help=Der Titel des weiterf\u00fchrenden Links.
|
||||
relatedinfo.links.title.label=Titel
|
||||
relatedinfo.links.create.cancel=Abbrechen
|
||||
relatedinfo.links.create.submit=Link anlegen
|
||||
contentsection.documents.relatedinfo.link.details.title=Weiterf\u00fchrender Link Details
|
||||
relatedinfo.link.details.title=Weiterf\u00fchrender Link Details
|
||||
contentsection.documents.relatedinfo.link.title.add.button_label=Lokalisierten Titel hinzuf\u00fcgen
|
||||
contentsection.documents.relatedinfo.link.title.add.cancel=Abbrechen
|
||||
contentsection.documents.relatedinfo.link.title.add.locale.help=Die Sprache des lokalisierten Titels.
|
||||
contentsection.documents.relatedinfo.link.title.add.locale.label=Sprache
|
||||
contentsection.documents.relatedinfo.link.title.add.submit.label=Lokalisierten Titel hinzuf\u00fcgen
|
||||
contentsection.documents.relatedinfo.link.title.add_dialog.title=Lokalisierten Titel hinzuf\u00fcgen
|
||||
contentsection.documents.relatedinfo.link.title.add.value.help=Der lokalisierte Titel des Links.
|
||||
contentsection.documents.relatedinfo.link.title.add.value.label=Titel
|
||||
contentsection.documents.relatedinfo.link.title.edit.button_label=Lokaliserten Titel bearbeiten
|
||||
contentsection.documents.relatedinfo.link.title.edit.cancel=Abbrechen
|
||||
contentsection.documents.relatedinfo.link.title.edit.submit=Speichern
|
||||
contentsection.documents.relatedinfo.link.title.edit_dialog.title=Lokaliserten Titel bearbeiten
|
||||
contentsection.documents.relatedinfo.link.title.edit.value.help=Der lokalisierte Titel des Links.
|
||||
contentsection.documents.relatedinfo.link.title.edit.value.label=Titel
|
||||
contentsection.documents.relatedinfo.link.title.remove.button_label=Lokalisierten Titel entfernen
|
||||
contentsection.documents.relatedinfo.link.title.remove.cancel=Abbrechen
|
||||
contentsection.documents.relatedinfo.link.title.remove.submit=Entfernen
|
||||
contentsection.documents.relatedinfo.link.title.remove.text=Sind Sie sicher, dass Sie den folgenden lokaliserten Titel entfernen wollen:
|
||||
contentsection.documents.relatedinfo.link.title.remove.title=Lokalisierten Titel entfernen
|
||||
relatedinfo.link.details.title_editor.title=Titel
|
||||
relatedinfo.links.type.label=Typ
|
||||
relatedinfo.links.type.internal=Interner Link
|
||||
relatedinfo.links.type.external=Externener Link
|
||||
relatedinfo.links.type.help=Der Typ des Links. Interne Links verweisen auf ein anderes Dokument (Content Item). Externe Links verweisen auf eine URL.
|
||||
relatedinfo.link.details.title.target=Ziel des weiterf\u00fchrenden Links
|
||||
relatedinfo.link.details.title.target.select_bookmark=Lesezeichen ausw\u00e4hlen
|
||||
|
|
|
|||
|
|
@ -2,7 +2,20 @@ document.addEventListener("DOMContentLoaded", function(event) {
|
|||
const linkTypes = document.querySelectorAll(".link-type-select");
|
||||
|
||||
for(let i = 0; i < linkTypes.length; i++) {
|
||||
linkTypes[i].addEventListener("selected", function(event) {
|
||||
if (linkTypes[i].getAttribute("selected") === "selected") {
|
||||
const selectedTypeElem = document.querySelector(
|
||||
`#relatedlink-target-${linkTypes[i].getAttribute("value")}`
|
||||
);
|
||||
if (selectedTypeElem) {
|
||||
const types = document.querySelectorAll(".relatedlink-target");
|
||||
for(let j = 0; j < types.length; j++) {
|
||||
types[j].classList.add("d-none");
|
||||
}
|
||||
selectedTypeElem.classList.remove("d-none");
|
||||
}
|
||||
}
|
||||
|
||||
linkTypes[i].addEventListener("input", function(event) {
|
||||
const target = event.currentTarget as HTMLElement;
|
||||
const value = target.getAttribute("value");
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue