Editing names for articles
parent
e010e5a653
commit
12a3d14233
|
|
@ -39,7 +39,6 @@ public class CmsMvcAuthoringSteps implements MvcAuthoringSteps {
|
|||
classes.add(ExampleAuthoringStep.class);
|
||||
|
||||
classes.add(CategorizationStep.class);
|
||||
classes.add(PublishStep.class);
|
||||
classes.add(RelatedInfoStep.class);
|
||||
classes.add(MvcArticlePropertiesStep.class);
|
||||
classes.add(MvcArticleTextBodyStep.class);
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@ import java.util.Optional;
|
|||
|
||||
import javax.enterprise.context.Dependent;
|
||||
import javax.inject.Inject;
|
||||
import javax.mvc.Models;
|
||||
import javax.ws.rs.Path;
|
||||
|
||||
/**
|
||||
|
|
@ -58,6 +59,9 @@ public class MvcAuthoringStepService {
|
|||
@Inject
|
||||
private GlobalizationHelper globalizationHelper;
|
||||
|
||||
@Inject
|
||||
private Models models;
|
||||
|
||||
@Inject
|
||||
private SelectedDocumentModel documentModel;
|
||||
|
||||
|
|
@ -166,6 +170,12 @@ public class MvcAuthoringStepService {
|
|||
documentModel.setContentItem(document);
|
||||
|
||||
this.documentPath = itemManager.getItemPath(document);
|
||||
|
||||
models.put("activeDocumentTab", "editTab");
|
||||
}
|
||||
|
||||
public void updateDocumentPath() {
|
||||
documentPath = itemManager.getItemPath(document);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -193,8 +203,9 @@ public class MvcAuthoringStepService {
|
|||
section.getLabel()
|
||||
)
|
||||
.replace(
|
||||
String.format("{%s}",
|
||||
MvcAuthoringSteps.DOCUMENT_PATH_PATH_PARAM_NAME
|
||||
String.format(
|
||||
"{%s}",
|
||||
MvcAuthoringSteps.DOCUMENT_PATH_PATH_PARAM
|
||||
),
|
||||
documentPath
|
||||
)
|
||||
|
|
|
|||
|
|
@ -357,7 +357,7 @@ public class SelectedDocumentModel {
|
|||
.replace(
|
||||
String.format(
|
||||
"{%s}",
|
||||
MvcAuthoringSteps.SECTION_IDENTIFIER_PATH_PARAM
|
||||
MvcAuthoringSteps.DOCUMENT_PATH_PATH_PARAM
|
||||
),
|
||||
itemPath
|
||||
);
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ import javax.ws.rs.PathParam;
|
|||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
@RequestScoped
|
||||
@Path(MvcAuthoringSteps.PATH_PREFIX + "basicproperties")
|
||||
@Path(MvcAuthoringSteps.PATH_PREFIX + "article-basicproperties")
|
||||
@Controller
|
||||
@Named("CmsArticlePropertiesStep")
|
||||
@MvcAuthoringStep(
|
||||
|
|
@ -243,12 +243,16 @@ public class MvcArticlePropertiesStep {
|
|||
stepService.getDocument().setDisplayName(name);
|
||||
itemRepo.save(stepService.getDocument());
|
||||
|
||||
return stepService.buildRedirectPathForStep(getClass());
|
||||
stepService.updateDocumentPath();
|
||||
|
||||
return stepService.buildRedirectPathForStep(
|
||||
MvcArticlePropertiesStep.class
|
||||
);
|
||||
} else {
|
||||
return documentUi.showAccessDenied(
|
||||
stepService.getContentSection(),
|
||||
stepService.getDocument(),
|
||||
stepService.getLabel(getClass())
|
||||
stepService.getLabel(MvcArticlePropertiesStep.class)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@
|
|||
<ui:composition template="/WEB-INF/views/org/librecms/ui/contentsection/contentsection.xhtml">
|
||||
|
||||
<ui:define name="main">
|
||||
<div class="row">
|
||||
|
||||
<ul class="nav nav-tabs">
|
||||
<li class="nav-item">
|
||||
|
|
@ -22,28 +21,30 @@
|
|||
</li>
|
||||
</ul>
|
||||
|
||||
<div class="row p-3">
|
||||
<div class="col-sm-3">
|
||||
<!-- Workflow widget -->
|
||||
<h2>#{CmsAdminMessages['contentsection.document.authoring.workflow.title']}</h2>
|
||||
<p>
|
||||
#{CmsAdminMessages['contentsection.document.authoring.workflow.active_workflow_label']}:
|
||||
#{CmsSelectedDocumentModel.workflowName}
|
||||
<button class="btn btn-secondary"
|
||||
<button class="btn btn-secondary btn-sm"
|
||||
disabled="#{!CmsSelectedDocumentModel.canChangeWorkflow ? 'disabled': ''}"
|
||||
type="button">
|
||||
#{CmsAdminMessages['contentsection.document.authoring.workflow.change_workflow']}:
|
||||
#{CmsAdminMessages['contentsection.document.authoring.workflow.change_workflow']}
|
||||
</button>
|
||||
</p>
|
||||
<p>
|
||||
#{CmsAdminMessages['contentsection.document.authoring.workflow.active_task']}: }
|
||||
#{CmsAdminMessages['contentsection.document.authoring.workflow.active_task']}
|
||||
<c:choose>
|
||||
<c:when test="#{CmsSelectedDocumentModel.currentTask != null}">
|
||||
#{CmsSelectedDocumentModel.currentTask.label}
|
||||
</c:when>
|
||||
<c:otherwise>
|
||||
#{CmsAdminMessages['contentsection.document.authoring.workflow.active_task.none']}: }
|
||||
#{CmsAdminMessages['contentsection.document.authoring.workflow.active_task.none']}
|
||||
</c:otherwise>
|
||||
</c:choose>
|
||||
<c:if test="#{CmsSelectedDocumentModel.currentTask != null}">
|
||||
<c:choose>
|
||||
<c:when test="#{CmsSelectedDocumentModel.currentTask.assignedToCurrentUser and CmsSelectedDocumentModel.currentTask.locked}">
|
||||
<form action="#{mvc.basePath}/documents/#{CmsSelectedDocumentModel.itemPath}/@workflow/tasks/UUID-#{CmsSelectedDocumentModel.currentTask.taskUuid}/@unlock"
|
||||
|
|
@ -51,7 +52,7 @@
|
|||
<input name="returnUrl"
|
||||
type="hidden"
|
||||
value="#{mvc.basePath}/documents/#{CmsSelectedDocumentModel.itemPath}/@authoringsteps/#{authoringStep}" />
|
||||
<button class="btn btn-secondary"
|
||||
<button class="btn btn-secondary btn-sm"
|
||||
type="submit">
|
||||
#{CmsAdminMessages['contentsection.document.authoring.workflow.active_task.release']}
|
||||
</button>
|
||||
|
|
@ -61,7 +62,7 @@
|
|||
<input name="returnUrl"
|
||||
type="hidden"
|
||||
value="#{mvc.basePath}/documents/#{CmsSelectedDocumentModel.itemPath}/@authoringsteps/#{authoringStep}" />
|
||||
<button class="btn btn-secondary"
|
||||
<button class="btn btn-secondary btn-sm"
|
||||
type="submit">
|
||||
#{CmsAdminMessages['contentsection.document.authoring.workflow.active_task.finish']}
|
||||
</button>
|
||||
|
|
@ -73,7 +74,7 @@
|
|||
<input name="returnUrl"
|
||||
type="hidden"
|
||||
value="#{mvc.basePath}/documents/#{CmsSelectedDocumentModel.itemPath}/@authoringsteps/#{authoringStep}" />
|
||||
<button class="btn btn-secondary"
|
||||
<button class="btn btn-secondary btn-sm"
|
||||
type="submit">
|
||||
#{CmsAdminMessages['contentsection.document.authoring.workflow.active_task.takeover']}
|
||||
</button>
|
||||
|
|
@ -84,13 +85,14 @@
|
|||
<input name="returnUrl"
|
||||
type="hidden"
|
||||
value="#{mvc.basePath}/documents/#{CmsSelectedDocumentModel.itemPath}/@authoringsteps/#{authoringStep}" />
|
||||
<button class="btn btn-secondary"
|
||||
<button class="btn btn-secondary btn-sm"
|
||||
type="button">
|
||||
#{CmsAdminMessages['contentsection.document.authoring.workflow.active_task.lock']}: }
|
||||
#{CmsAdminMessages['contentsection.document.authoring.workflow.active_task.lock']}
|
||||
</button>
|
||||
</form>
|
||||
</c:when>
|
||||
</c:choose>
|
||||
</c:if>
|
||||
</p>
|
||||
|
||||
<!-- Authoring steps -->
|
||||
|
|
@ -111,14 +113,14 @@
|
|||
<li aria-current="#{'categorize' == authoringStep ? 'true' : ''}"
|
||||
class="list-group-item #{'categorize' == authoringStep ? 'active' : ''}">
|
||||
<a class="list-group-item-action"
|
||||
href="#{mvc.basePath}/documents/#{CmsSelectedDocumentModel.itemPath}/@authoringsteps/categorize">
|
||||
href="#{mvc.basePath}/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}/documents/#{CmsSelectedDocumentModel.itemPath}/@authoringsteps/relatedInfo">
|
||||
href="#{mvc.basePath}/documents/#{CmsSelectedDocumentModel.itemPath}/@relatedinfo">
|
||||
#{CmsAdminMessages['contentsection.document.authoring.steps.relatedInfo.label']}
|
||||
</a>
|
||||
</li>
|
||||
|
|
|
|||
|
|
@ -7,57 +7,89 @@
|
|||
<ui:composition template="/WEB-INF/views/org/librecms/ui/contentsection/documents/authoringstep.xhtml">
|
||||
|
||||
<ui:define name="authoringStep">
|
||||
<h2>#{CmsArticleMessageBundle['basicproperties.name.header']}</h2>
|
||||
<h2>#{CmsArticleMessageBundle.getMessage('basicproperties.header', [CmsArticlePropertiesStep.name])}</h2>
|
||||
|
||||
<h3>#{CmsArticleMessageBundle.getMessage('basicproperties.name.header')}</h3>
|
||||
<div class="d-flex">
|
||||
<pre>
|
||||
#{CmsArticlePropertiesStep.name}
|
||||
</pre>
|
||||
<button class="btn btn-primary"
|
||||
<pre class="mr-2">#{CmsArticlePropertiesStep.name}</pre>
|
||||
<button class="btn btn-primary btn-sm"
|
||||
data-toggle="modal"
|
||||
data-target="name-edit-dialog"
|
||||
data-target="#name-edit-dialog"
|
||||
type="button">
|
||||
<bootstrap:svgIcon icon="pen" />
|
||||
<span class="sr-only">
|
||||
#{CmsArticleMessageBundle['basicproperties.name.edit']}
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
<div aria-hidden="true"
|
||||
aria-labelledby="name-edit-dialog-title"
|
||||
class="modal fade"
|
||||
id="name-edit-dialog"
|
||||
tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<form action="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@authoringsteps/basicproperties/name"
|
||||
<form action="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents#{CmsSelectedDocumentModel.itemPath}/@article-basicproperties/name"
|
||||
class="modal-content"
|
||||
method="post">
|
||||
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title"
|
||||
id="name-edit-dialog-title">
|
||||
#{CmsArticleMessageBundle['basicproperties.name.edit.title']}
|
||||
</h4>
|
||||
<button aria-label="#{CmsArticleMessageBundle['basicproperties.name.edit.close']}"
|
||||
class="close"
|
||||
data-dismiss="modal"
|
||||
type="button">
|
||||
<bootstrap:svgIcon icon="x-circle" />
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<bootstrap:formGroupText
|
||||
help="#{CmsArticleMessageBundle['basicproperties.name.help']}"
|
||||
inputId="name"
|
||||
label="#{CmsArticleMessageBundle['basicproperties.name.label']}"
|
||||
name="name"
|
||||
pattern="^([a-zA-Z0-9_-]*)$"
|
||||
required="true"
|
||||
value="#{CmsArticlePropertiesStep.name}"/>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button class="btn btn-warning"
|
||||
data-dismiss="modal"
|
||||
type="button">
|
||||
#{CmsArticleMessageBundle['basicproperties.name.edit.close']}
|
||||
</button>
|
||||
<button class="btn btn-success"
|
||||
type="submit">
|
||||
#{CmsArticleMessageBundle['basicproperties.name.edit.submit']}
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<libreccm:localizedStringEditor
|
||||
addMethod="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@authoringsteps/basicproperties/title/@add"
|
||||
editMethod="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@authoringsteps/basicproperties/title/@edit"
|
||||
addMethod="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@article-basicproperties/title/@add"
|
||||
editMethod="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@article-basicproperties/title/@edit"
|
||||
editorId="title-editor"
|
||||
hasUnusedLocales="#{!CmsArticlePropertiesStep.unusedTitleLocales.isEmpty()}"
|
||||
headingLevel="3"
|
||||
objectIdentifier="#{CmsSelectedDocumentModel.itemPath}"
|
||||
removeMethod="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@authoringsteps/basicproperties/title/@remove"
|
||||
removeMethod="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@article-basicproperties/title/@remove"
|
||||
title="#{CmsArticleMessageBundle['basicproperties.title.header']}"
|
||||
unusedLocales="#{CmsArticlePropertiesStep.unusedTitleLocales}"
|
||||
values="#{CmsArticlePropertiesStep.titleValues}"
|
||||
/>
|
||||
|
||||
<libreccm:localizedStringEditor
|
||||
addMethod="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@authoringsteps/basicproperties/description/@add"
|
||||
editMethod="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@authoringsteps/basicproperties/description/@edit"
|
||||
addMethod="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@article-basicproperties/description/@add"
|
||||
editMethod="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@article-basicproperties/description/@edit"
|
||||
editorId="description-editor"
|
||||
hasUnusedLocales="#{!CmsArticlePropertiesStep.unusedTitleLocales.isEmpty()}"
|
||||
headingLevel="3"
|
||||
objectIdentifier="#{CmsSelectedDocumentModel.itemPath}"
|
||||
removeMethod="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@authoringsteps/basicproperties/description/@remove"
|
||||
removeMethod="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@article-basicproperties/description/@remove"
|
||||
title="#{CmsArticleMessageBundle['basicproperties.description.header']}"
|
||||
unusedLocales="#{CmsArticlePropertiesStep.unusedTitleLocales}"
|
||||
values="#{CmsArticlePropertiesStep.descriptionValues}"
|
||||
|
|
|
|||
|
|
@ -742,7 +742,7 @@ contentsection.document.authoring.workflow.active_task.none=Keine aktive Aufgabe
|
|||
contentsection.document.authoring.workflow.active_task.release=Freigeben
|
||||
contentsection.document.authoring.workflow.active_task.finish=Abschlie\u00dfen
|
||||
contentsection.document.authoring.workflow.active_task.takeover=\u00dcbernehmen
|
||||
contentsection.document.authoring.workflow.active_task.lock=Reserveren
|
||||
contentsection.document.authoring.workflow.active_task.lock=Reservieren
|
||||
contentsection.document.authoring.steps.title=Bearbeitungsschritte
|
||||
contentsection.document.authoring.steps.categorize.label=Dokument kategorisieren
|
||||
contentsection.document.authoring.steps.relatedInfo.label=Weiterf\u00fchrende Informationen
|
||||
|
|
|
|||
|
|
@ -24,10 +24,16 @@ createform.cancel=Cancel
|
|||
createform.submit=Create Article
|
||||
textstep.header=Text of the Article
|
||||
text.editor.header=Main Text
|
||||
basicproperties.name.header=Basic Properties
|
||||
basicproperties.name.header=Name of the article
|
||||
basicproperties.name.edit=Edit
|
||||
basicproperties.title.header=Title
|
||||
basicproperties.description.header=Summary
|
||||
createform.title=Create new article
|
||||
createform.summary.label=Summary
|
||||
createstep.workflow.none_selected=No workflow selected
|
||||
basicproperties.name.help=The name of the article. Must only constain the letters a to z, A to Z, numbers, the dash and the underscore.
|
||||
basicproperties.name.label=Name
|
||||
basicproperties.header=Basic Properties of Article {0}
|
||||
basicproperties.name.edit.title=Edit name
|
||||
basicproperties.name.edit.close=Cancel
|
||||
basicproperties.name.edit.submit=Save
|
||||
|
|
|
|||
|
|
@ -24,10 +24,16 @@ createform.cancel=Abbrechen
|
|||
createform.submit=Artikel anlegen
|
||||
textstep.header=Haupttext des Artikels
|
||||
text.editor.header=Haupttext
|
||||
basicproperties.name.header=Basiseigenschaften
|
||||
basicproperties.name.header=Name des Artikels
|
||||
basicproperties.name.edit=Bearbeiten
|
||||
basicproperties.title.header=Titel
|
||||
basicproperties.description.header=Zusammenfassung
|
||||
createform.title=Neuen Artikel anlegen
|
||||
createform.summary.label=Zusammenfassung
|
||||
createstep.workflow.none_selected=Es wurde keine Arbeitsablauf ausgew\u00e4hlt
|
||||
basicproperties.name.help=Der Name des Artikels. Darf nur die Buchstaben A bis Z, a bis z, Ziffern, den Bindestrich und den Unterstrich enthalten.
|
||||
basicproperties.name.label=Name
|
||||
basicproperties.header=Basiseigenschaften des Artikels {0}
|
||||
basicproperties.name.edit.title=Name bearbeiten
|
||||
basicproperties.name.edit.close=Abbrechen
|
||||
basicproperties.name.edit.submit=Speichern
|
||||
|
|
|
|||
Loading…
Reference in New Issue