Highlight current authoring step

pull/10/head
Jens Pelzetter 2021-08-07 15:50:40 +02:00
parent c75d718978
commit e3970246c3
15 changed files with 116 additions and 52 deletions

View File

@ -39,7 +39,7 @@ public class AuthoringStepListEntry {
private String description;
/**
* The path fragment of the authoring step.
* The path of the step.
*/
private String path;

View File

@ -348,10 +348,7 @@ public class SelectedDocumentModel {
) {
final MvcAuthoringStepDef stepAnnotation = authoringStepClass
.getAnnotation(MvcAuthoringStepDef.class);
final Path pathAnnotation = authoringStepClass.getAnnotation(
Path.class
);
final LocalizedTextsUtil textsUtil = globalizationHelper
final LocalizedTextsUtil textsUtil = globalizationHelper
.getLocalizedTextsUtil(stepAnnotation.bundle());
final AuthoringStepListEntry entry = new AuthoringStepListEntry();
entry.setDescription(textsUtil.getText(stepAnnotation.descriptionKey()));
@ -360,24 +357,6 @@ public class SelectedDocumentModel {
return entry;
}
private String createStepPath(final String path) {
return path
.replace(
String.format(
"{%s}",
MvcAuthoringSteps.SECTION_IDENTIFIER_PATH_PARAM
),
item.getContentType().getContentSection().getLabel()
)
.replace(
String.format(
"{%s}",
MvcAuthoringSteps.DOCUMENT_PATH_PATH_PARAM
),
itemPath
);
}
private String createStepPath(final Class<?> stepClass) {
final Map<String, String> values = new HashMap<>();
values.put(

View File

@ -114,42 +114,98 @@
<!-- Authoring steps -->
<h2>#{CmsAdminMessages['contentsection.document.authoring.steps.title']}</h2>
<!--<pre>authoringStep = #{authoringStep}</pre>-->
<ul class="list-group">
<c:forEach items="#{CmsSelectedDocumentModel.authoringStepsList}"
var="step">
<li aria-current="#{step.path == authoringStep ? 'true' : ''}"
class="list-group-item #{step.path == authoringStep ? 'active' : ''}">
<a class="list-group-item-action"
href="#{step.path}">
#{step.label}
</a>
</li>
<!--<pre>step.path = #{step.path}</pre>-->
<c:choose>
<c:when test="#{authoringStep == step.path}">
<li aria-current="true"
class="list-group-item active">
#{step.label}
</li>
</c:when>
<c:otherwise>
<li class="list-group-item">
<a class="list-group-item-action"
href="#{step.path}">
#{step.label}
</a>
</li>
</c:otherwise>
</c:choose>
</c:forEach>
<c:if test="#{!CmsSelectedDocumentModel.excludeDefaultAuthoringSteps}">
<li aria-current="#{'categorize' == authoringStep ? 'true' : ''}"
class="list-group-item #{'categorize' == authoringStep ? 'active' : ''}">
<a class="list-group-item-action"
href="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@categorization">
#{CmsAdminMessages['contentsection.document.authoring.steps.categorize.label']}
</a>
</li>
<li aria-current="#{'relatedInfo' == authoringStep ? 'true' : ''}"
class="list-group-item #{'relatedInfo' == authoringStep ? 'active' : ''}">
<a class="list-group-item-action"
href="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@relatedinfo">
#{CmsAdminMessages['contentsection.document.authoring.steps.relatedInfo.label']}
</a>
</li>
<c:choose>
<c:when test="#{authoringStep == 'categorize'}">
<li aria-current="true"
class="list-group-item active">
#{CmsAdminMessages['contentsection.document.authoring.steps.categorize.label']}
</li>
</c:when>
<c:otherwise>
<li class="list-group-item ">
<a class="list-group-item-action"
href="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@categorization">
#{CmsAdminMessages['contentsection.document.authoring.steps.categorize.label']}
</a>
</li>
</c:otherwise>
</c:choose>
<c:choose>
<c:when test="#{authoringStep == 'media'}">
<li aria-current="true"
class="list-group-item active">
#{CmsAdminMessages['contentsection.document.authoring.steps.media.label']}
</li>
</c:when>
<c:otherwise>
<li class="list-group-item">
<a class="list-group-item-action"
href="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@media">
#{CmsAdminMessages['contentsection.document.authoring.steps.media.label']}
</a>
</li>
</c:otherwise>
</c:choose>
<c:choose>
<c:when test="#{authoringStep == 'relatedInfo'}">
<li aria-current="true"
class="list-group-item active">
#{CmsAdminMessages['contentsection.document.authoring.steps.relatedInfo.label']}
</li>
</c:when>
<c:otherwise>
<li class="list-group-item">
<a class="list-group-item-action"
href="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@relatedinfo">
#{CmsAdminMessages['contentsection.document.authoring.steps.relatedInfo.label']}
</a>
</li>
</c:otherwise>
</c:choose>
</c:if>
<li aria-current="#{'publish' == authoringStep ? 'true' : ''}"
class="list-group-item #{'publish' == authoringStep ? 'active' : ''}">
<a class="list-group-item-action"
href="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@publish">
#{CmsAdminMessages['contentsection.document.authoring.steps.publish.label']}
</a>
</li>
<c:choose>
<c:when test="#{authoringStep == 'publish'}">
<li aria-current="true"
class="list-group-item active">
#{CmsAdminMessages['contentsection.document.authoring.steps.publish.label']}
</li>
</c:when>
<c:otherwise>
<li class="list-group-item">
<a class="list-group-item-action"
href="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@publish">
#{CmsAdminMessages['contentsection.document.authoring.steps.publish.label']}
</a>
</li>
</c:otherwise>
</c:choose>
</ul>

View File

@ -6,6 +6,8 @@
xmlns:ui="http://xmlns.jcp.org/jsf/facelets">
<ui:composition template="/WEB-INF/views/org/librecms/ui/contentsection/documents/authoringstep.xhtml">
<ui:param name="authoringStep" value="categorize" />
<ui:define name="authoringStep">
<h1>#{CmsDefaultStepsMessageBundle.getMessage('categorization.title', [CmsSelectedDocumentModel.itemTitle])}</h1>

View File

@ -7,7 +7,11 @@
xmlns:ui="http://xmlns.jcp.org/jsf/facelets">
<ui:composition template="/WEB-INF/views/org/librecms/ui/contentsection/documents/authoringstep.xhtml">
<ui:param name="authoringStep" value="media" />
<ui:define name="authoringStep">
<h1>#{CmsDefaultStepsMessageBundle.getMessage("media.title", [CmsSelectedDocumentModel.itemTitle])}</h1>
<template id="cms-sort-media-error-general">
<div class="alert alert-danger mt-3" role="alert">
#{CmsDefaultStepsMessageBundle['media.sortmedia.errors.general']}
@ -187,7 +191,7 @@
assetPickerId="attach-media-picker-#{list.uuid}"
baseUrl="#{CmsMediaStep.mediaAssetPickerBaseUrl}"
contentSection="#{CmsMediaStep.sectionName}"
formParamName="assetIdentifier"
formParamName="mediaIdentifier"
/>
</div>
</div>

View File

@ -7,6 +7,7 @@
<ui:composition template="/WEB-INF/views/org/librecms/ui/contentsection/documents/document.xhtml">
<ui:param name="activePage" value="document" />
<ui:param name="authoringStep" value="publish" />
<ui:param name="title" value="#{CmsAdminMessages['contentsection.documents.publishstep.title']}" />
<ui:define name="breadcrumb">

View File

@ -7,7 +7,11 @@
xmlns:ui="http://xmlns.jcp.org/jsf/facelets">
<ui:composition template="/WEB-INF/views/org/librecms/ui/contentsection/documents/authoringstep.xhtml">
<ui:param name="authoringStep" value="relatedInfo" />
<ui:define name="authoringStep">
<h1>#{CmsDefaultStepsMessageBundle.getMessage("relatedinfo.title", [CmsSelectedDocumentModel.itemTitle])}</h1>
<template id="cms-sort-attachments-error-general">
<div class="alert alert-danger mt-3" role="alert">
#{CmsDefaultStepsMessageBundle['relatedinfo.sortattachments.errors.general']}

View File

@ -6,6 +6,9 @@
xmlns:ui="http://xmlns.jcp.org/jsf/facelets">
<ui:composition template="/WEB-INF/views/org/librecms/ui/contentsection/documents/authoringstep.xhtml">
<ui:param name="authoringStep"
value="/libreccm/@contentsections/info/documents/test-article/@article-basicproperties" />
<ui:define name="authoringStep">
<h2>#{CmsArticleMessageBundle.getMessage('basicproperties.header', [CmsArticlePropertiesStep.name])}</h2>

View File

@ -7,6 +7,9 @@
xmlns:ui="http://xmlns.jcp.org/jsf/facelets">
<ui:composition template="/WEB-INF/views/org/librecms/ui/contentsection/documents/authoringstep.xhtml">
<ui:param name="authoringStep"
value="/libreccm/@contentsections/info/documents/test-article/@article-text" />
<ui:define name="authoringStep">
<h2>#{CmsArticleMessageBundle['textstep.header']}</h2>

View File

@ -833,3 +833,4 @@ contentsection.configuration.contactentrykey.not_found.title=Contact Data Entry
contentsection.configuration.contactentrykey.not_found=Contact Data Entry Key {0} not found.
contentsection.configuration.contactentrykeys.add.dialog.title=Add Contact Entry Key
contentsection.configuration.contactentrykeys.breadcrumbs=Contact Entry Keys
contentsection.document.authoring.steps.media.label=Media

View File

@ -834,3 +834,4 @@ contentsection.configuration.contactentrykey.not_found.title=Kontaktdaten-Angabe
contentsection.configuration.contactentrykey.not_found=Kontaktdaten-Angabe {0} nicht gefunden.
contentsection.configuration.contactentrykeys.add.dialog.title=M\u00f6gliche Kontaktdaten-Angabe hinzuf\u00fcgen
contentsection.configuration.contactentrykeys.breadcrumbs=Kontaktdaten-Angaben
contentsection.document.authoring.steps.media.label=Medien

View File

@ -335,3 +335,5 @@ contentsection.document.media.breadcrumb=Media
media.medialists.media.not_found.message=No media identified by {1} found in content section {0}.
media.medialist.not_found.title=Media List not found
media.medialist.not_found.message=Content Item {0} has not media list {1}.
media.title=Media for Content Item {0}
relatedinfo.title=Related Info for Content Item {0}

View File

@ -335,3 +335,5 @@ contentsection.document.media.breadcrumb=Medien
media.medialists.media.not_found.message=Kein Medium mit UUID {1} in Content Section {0} gefunden.
media.medialist.not_found.title=Medienliste nicht gefunden
media.medialist.not_found.message=Keine Medienliste {1} f\u00fcr Dokument {0} gefunden.
media.title=Medien f\u00fcr Dokument {0}
relatedinfo.title=Weiterf\u00fchrende Informationen f\u00fcr Dokument {0}

View File

@ -535,3 +535,6 @@ videoasset.editstep.legelmetadata.creator=Creator
categorization.tree.expand=Expand/Hide subcategories
authoringsteps.media.description=Add different media, for example images, videos or audio asset to a content item.
authoringsteps.media.label=Media
contentsection.document.authoring.steps.media.label=Media
relatedinfo.title=Related Info for Content Item {0}
media.title=Media for Content Item {0}

View File

@ -535,3 +535,6 @@ videoasset.editstep.legelmetadata.creator=K\u00fcnstler
categorization.tree.expand=Unterkategorien anzeigen/verbergen
authoringsteps.media.description=F\u00fcgen Sie Medien, z.B. Bilder, Videos oder Audio-Dateien einem Dokument hinzu.
authoringsteps.media.label=Medien
contentsection.document.authoring.steps.media.label=Medien
relatedinfo.title=Weiterf\u00fchrende Informationen f\u00fcr Dokument {0}
media.title=Medien f\u00fcr Dokument {0}