Some more bugfixes for event.

pull/15/head
Jens Pelzetter 2022-02-07 21:08:09 +01:00
parent 84c2f9a858
commit dbbb57b1ad
19 changed files with 336 additions and 111 deletions

View File

@ -52,7 +52,7 @@ import javax.ws.rs.PathParam;
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a> * @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/ */
@RequestScoped @RequestScoped
@Path(MvcAuthoringSteps.PATH_PREFIX + "@event-info") @Path(MvcAuthoringSteps.PATH_PREFIX + "event-info")
@Controller @Controller
@MvcAuthoringStepDef( @MvcAuthoringStepDef(
bundle = EventStepsConstants.BUNDLE, bundle = EventStepsConstants.BUNDLE,
@ -277,7 +277,7 @@ public class MvcEventInfoStep extends AbstractMvcAuthoringStep {
if (itemPermissionChecker.canEditItem(getEvent())) { if (itemPermissionChecker.canEditItem(getEvent())) {
final Locale locale = new Locale(localeParam); final Locale locale = new Locale(localeParam);
getEvent().getText().removeValue(locale); getEvent().getEventDate().removeValue(locale);
itemRepo.save(getEvent()); itemRepo.save(getEvent());
return buildRedirectPathForStep(); return buildRedirectPathForStep();
@ -510,7 +510,7 @@ public class MvcEventInfoStep extends AbstractMvcAuthoringStep {
); );
} }
final Locale locale = new Locale(localeParam); final Locale locale = new Locale(localeParam);
getEvent().getText().putValue(locale, value); getEvent().getMainContributor().putValue(locale, value);
itemRepo.save(getEvent()); itemRepo.save(getEvent());
return buildRedirectPathForStep(); return buildRedirectPathForStep();
@ -557,9 +557,9 @@ public class MvcEventInfoStep extends AbstractMvcAuthoringStep {
} }
@POST @POST
@Path("/main-contributor/add") @Path("/main-contributor/edit/{locale}")
@Transactional(Transactional.TxType.REQUIRED) @Transactional(Transactional.TxType.REQUIRED)
public String addMainContributorValue( public String editMainContributorValue(
@PathParam(MvcAuthoringSteps.SECTION_IDENTIFIER_PATH_PARAM) @PathParam(MvcAuthoringSteps.SECTION_IDENTIFIER_PATH_PARAM)
final String sectionIdentifier, final String sectionIdentifier,
@PathParam(MvcAuthoringSteps.DOCUMENT_PATH_PATH_PARAM_NAME) @PathParam(MvcAuthoringSteps.DOCUMENT_PATH_PATH_PARAM_NAME)
@ -675,7 +675,7 @@ public class MvcEventInfoStep extends AbstractMvcAuthoringStep {
); );
} }
final Locale locale = new Locale(localeParam); final Locale locale = new Locale(localeParam);
getEvent().getEventDate().putValue(locale, value); getEvent().getEventType().putValue(locale, value);
itemRepo.save(getEvent()); itemRepo.save(getEvent());
return buildRedirectPathForStep(); return buildRedirectPathForStep();
@ -689,7 +689,7 @@ public class MvcEventInfoStep extends AbstractMvcAuthoringStep {
} }
@GET @GET
@Path("/eventdate/edit/{locale}") @Path("/eventtype/edit/{locale}")
@Transactional(Transactional.TxType.REQUIRED) @Transactional(Transactional.TxType.REQUIRED)
public String editEventTypeValue( public String editEventTypeValue(
@PathParam(MvcAuthoringSteps.SECTION_IDENTIFIER_PATH_PARAM) @PathParam(MvcAuthoringSteps.SECTION_IDENTIFIER_PATH_PARAM)
@ -720,7 +720,7 @@ public class MvcEventInfoStep extends AbstractMvcAuthoringStep {
} }
@POST @POST
@Path("/eventdate/edit/{locale}") @Path("/eventtype/edit/{locale}")
@Transactional(Transactional.TxType.REQUIRED) @Transactional(Transactional.TxType.REQUIRED)
public String editEventTypeValue( public String editEventTypeValue(
@PathParam(MvcAuthoringSteps.SECTION_IDENTIFIER_PATH_PARAM) @PathParam(MvcAuthoringSteps.SECTION_IDENTIFIER_PATH_PARAM)
@ -754,7 +754,7 @@ public class MvcEventInfoStep extends AbstractMvcAuthoringStep {
} }
@POST @POST
@Path("/eventdate/remove/{locale}") @Path("/eventtype/remove/{locale}")
@Transactional(Transactional.TxType.REQUIRED) @Transactional(Transactional.TxType.REQUIRED)
public String removeEventTypeValue( public String removeEventTypeValue(
@PathParam(MvcAuthoringSteps.SECTION_IDENTIFIER_PATH_PARAM) @PathParam(MvcAuthoringSteps.SECTION_IDENTIFIER_PATH_PARAM)
@ -845,7 +845,7 @@ public class MvcEventInfoStep extends AbstractMvcAuthoringStep {
); );
locationModel.setVariants( locationModel.setVariants(
getEvent() getEvent()
.getEventDate() .getLocation()
.getValues() .getValues()
.entrySet() .entrySet()
.stream() .stream()
@ -902,36 +902,36 @@ public class MvcEventInfoStep extends AbstractMvcAuthoringStep {
eventTypeModel.setCanEdit(canEdit); eventTypeModel.setCanEdit(canEdit);
eventTypeModel.setEventTypeValues( eventTypeModel.setEventTypeValues(
getEvent() getEvent()
.getEventType() .getEventType()
.getValues() .getValues()
.entrySet() .entrySet()
.stream() .stream()
.collect( .collect(
Collectors.toMap( Collectors.toMap(
entry -> entry.getKey().toString(), entry -> entry.getKey().toString(),
Map.Entry::getValue Map.Entry::getValue
)
) )
)
); );
eventTypeModel.setVariants( eventTypeModel.setVariants(
getEvent() getEvent()
.getEventType() .getEventType()
.getValues() .getValues()
.entrySet() .entrySet()
.stream() .stream()
.map(CmsEditorUtil::buildVariantRow) .map(CmsEditorUtil::buildVariantRow)
.collect(Collectors.toList()) .collect(Collectors.toList())
); );
final Set<Locale> eventTypeLocales = getEvent() final Set<Locale> eventTypeLocales = getEvent()
.getEventType() .getEventType()
.getAvailableLocales(); .getAvailableLocales();
eventTypeModel.setUnusedLocales( eventTypeModel.setUnusedLocales(
globalizationHelper globalizationHelper
.getAvailableLocales() .getAvailableLocales()
.stream() .stream()
.filter(locale -> !eventTypeLocales.contains(locale)) .filter(locale -> !eventTypeLocales.contains(locale))
.map(Locale::toString) .map(Locale::toString)
.collect(Collectors.toList()) .collect(Collectors.toList())
); );
} }
} }

View File

@ -139,7 +139,7 @@ public class MvcEventInfoStepResources {
// Location // Location
@GET @GET
@Path("/eventdate/wordcount/{locale}") @Path("/location/wordcount/{locale}")
@Produces(MediaType.TEXT_HTML) @Produces(MediaType.TEXT_HTML)
@Transactional(Transactional.TxType.REQUIRED) @Transactional(Transactional.TxType.REQUIRED)
public String getLocationWordCount( public String getLocationWordCount(
@ -181,7 +181,7 @@ public class MvcEventInfoStepResources {
} }
@GET @GET
@Path("/eventdate/{locale}") @Path("/location/{locale}")
@Produces(MediaType.TEXT_HTML) @Produces(MediaType.TEXT_HTML)
@Transactional(Transactional.TxType.REQUIRED) @Transactional(Transactional.TxType.REQUIRED)
public String viewLocationValue( public String viewLocationValue(
@ -217,7 +217,7 @@ public class MvcEventInfoStepResources {
// Main Contributor // Main Contributor
@GET @GET
@Path("/eventdate/wordcount/{locale}") @Path("/main-contributor/wordcount/{locale}")
@Produces(MediaType.TEXT_HTML) @Produces(MediaType.TEXT_HTML)
@Transactional(Transactional.TxType.REQUIRED) @Transactional(Transactional.TxType.REQUIRED)
public String getMainContributorWordCount( public String getMainContributorWordCount(
@ -259,7 +259,7 @@ public class MvcEventInfoStepResources {
} }
@GET @GET
@Path("/eventdate/{locale}") @Path("/main-contributor/{locale}")
@Produces(MediaType.TEXT_HTML) @Produces(MediaType.TEXT_HTML)
@Transactional(Transactional.TxType.REQUIRED) @Transactional(Transactional.TxType.REQUIRED)
public String viewMainContributorValue( public String viewMainContributorValue(
@ -295,7 +295,7 @@ public class MvcEventInfoStepResources {
// Event Type // Event Type
@GET @GET
@Path("/eventdate/wordcount/{locale}") @Path("/eventtype/wordcount/{locale}")
@Produces(MediaType.TEXT_HTML) @Produces(MediaType.TEXT_HTML)
@Transactional(Transactional.TxType.REQUIRED) @Transactional(Transactional.TxType.REQUIRED)
public String getEventTypeWordCount( public String getEventTypeWordCount(
@ -337,7 +337,7 @@ public class MvcEventInfoStepResources {
} }
@GET @GET
@Path("/eventdate/{locale}") @Path("/eventtype/{locale}")
@Produces(MediaType.TEXT_HTML) @Produces(MediaType.TEXT_HTML)
@Transactional(Transactional.TxType.REQUIRED) @Transactional(Transactional.TxType.REQUIRED)
public String viewEventTypeValue( public String viewEventTypeValue(

View File

@ -189,6 +189,13 @@
shortDescription="Info about the available variants. Must be a List of CmsEditorLocaleVariantRow objects." shortDescription="Info about the available variants. Must be a List of CmsEditorLocaleVariantRow objects."
type="java.util.List" type="java.util.List"
/> />
<cc:attribute
name="variantsId"
default=""
required="false"
shortDescription="ID for the variants component. Required if multiple instances of this component are used on the same page."
type="String"
/>
<cc:attribute <cc:attribute
name="viewPageUrl" name="viewPageUrl"
required="true" required="true"
@ -227,7 +234,7 @@
<div class="text-right"> <div class="text-right">
<button <button
class="btn btn-secondary" class="btn btn-secondary"
data-target="##{cc.attrs.editorId}-dialog" data-target="##{cc.attrs.variantsId}-dialog"
data-toggle="modal" data-toggle="modal"
type="button" type="button"
> >
@ -236,10 +243,10 @@
</button> </button>
</div> </div>
<div <div
aria-labelledby="#{cc.attrs.editorId}-dialog-title" aria-labelledby="#{cc.attrs.variantsId}-dialog-title"
aria-hidden="true" aria-hidden="true"
class="modal fade" class="modal fade"
id="#{cc.attrs.editorId}-dialog" id="#{cc.attrs.variantsId}-dialog"
tabindex="-1" tabindex="-1"
> >
<div class="modal-dialog"> <div class="modal-dialog">
@ -255,7 +262,7 @@
> >
<h2 <h2
class="modal-title" class="modal-title"
id="#{cc.attrs.editorId}-dialog-title" id="#{cc.attrs.variantsId}-dialog-title"
> >
#{cc.attrs.addDialogTitle} #{cc.attrs.addDialogTitle}
</h2> </h2>
@ -265,7 +272,7 @@
> >
<h3 <h3
class="modal-title" class="modal-title"
id="#{cc.attrs.editorId}-dialog-title" id="#{cc.attrs.variantsId}-dialog-title"
> >
#{cc.attrs.addDialogTitle} #{cc.attrs.addDialogTitle}
</h3> </h3>
@ -275,7 +282,7 @@
> >
<h4 <h4
class="modal-title" class="modal-title"
id="#{cc.attrs.editorId}-dialog-title" id="#{cc.attrs.variantsId}-dialog-title"
> >
#{cc.attrs.addDialogTitle} #{cc.attrs.addDialogTitle}
</h4> </h4>
@ -285,7 +292,7 @@
> >
<h5 <h5
class="modal-title" class="modal-title"
id="#{cc.attrs.editorId}-dialog-title" id="#{cc.attrs.variantsId}-dialog-title"
> >
#{cc.attrs.addDialogTitle} #{cc.attrs.addDialogTitle}
</h5> </h5>
@ -295,7 +302,7 @@
> >
<h6 <h6
class="modal-title" class="modal-title"
id="#{cc.attrs.editorId}-dialog-title" id="#{cc.attrs.variantsId}-dialog-title"
> >
#{cc.attrs.addDialogTitle} #{cc.attrs.addDialogTitle}
</h6> </h6>
@ -320,13 +327,13 @@
<div class="modal-body"> <div class="modal-body">
<div class="form-group"> <div class="form-group">
<label <label
for="#{cc.attrs.editorId}-form-locale-select" for="#{cc.attrs.variantsId}-form-locale-select"
> >
#{cc.attrs.addDialogLocaleSelectLabel} #{cc.attrs.addDialogLocaleSelectLabel}
</label> </label>
<select <select
aria-describedby="#{cc.attrs.editorId}-form-locale-select-help" aria-describedby="#{cc.attrs.variantsId}-form-locale-select-help"
id="#{cc.attrs.editorId}-form-locale-select" id="#{cc.attrs.variantsId}-form-locale-select"
name="locale" name="locale"
required="true" required="true"
> >
@ -341,7 +348,7 @@
</select> </select>
<small <small
class="form-text text-muted" class="form-text text-muted"
id="#{cc.attrs.editorId}-form-locale-select-help" id="#{cc.attrs.variantsId}-form-locale-select-help"
> >
#{cc.attrs.addDialogLocaleSelectHelp} #{cc.attrs.addDialogLocaleSelectHelp}
</small> </small>
@ -423,7 +430,7 @@
</a> </a>
<button <button
class="btn btn-danger" class="btn btn-danger"
data-target="##{cc.attrs.editorId}-#{variant.locale}-remove-dialog" data-target="##{cc.attrs.variantsId}-#{variant.locale}-remove-dialog"
data-toggle="modal" data-toggle="modal"
type="button" type="button"
> >
@ -435,11 +442,11 @@
</span> </span>
</button> </button>
<div <div
aria-describedby="#{cc.attrs.editorId}-#{variant.locale}-remove-dialog-title" aria-describedby="#{cc.attrs.variantsId}-#{variant.locale}-remove-dialog-title"
aria-hidden="true" aria-hidden="true"
class="modal fade" class="modal fade"
data-backdrop="static" data-backdrop="static"
id="#{cc.attrs.editorId}-#{variant.locale}-remove-dialog" id="#{cc.attrs.variantsId}-#{variant.locale}-remove-dialog"
tabindex="-1" tabindex="-1"
> >
<div class="modal-dialog"> <div class="modal-dialog">

View File

@ -15,7 +15,7 @@
<librecms:cmsEditorVariants <librecms:cmsEditorVariants
addButtonLabel="#{CmsEventMessageBundle['eventdate.editor.add_variant']}" addButtonLabel="#{CmsEventMessageBundle['eventdate.editor.add_variant']}"
addDialogLocaleSelectHelp="#{CmsAdminMessages['text.editor.add.locale.help']}" addDialogLocaleSelectHelp="#{CmsEventMessageBundle['text.editor.add.locale.help']}"
addMethod="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@event-info/eventdate/add" addMethod="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@event-info/eventdate/add"
canEdit="#{CmsSelectedDocumentModel.canEdit}" canEdit="#{CmsSelectedDocumentModel.canEdit}"
editorPageUrl="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@event-info/eventdate/edit" editorPageUrl="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@event-info/eventdate/edit"
@ -26,12 +26,13 @@
title="#{CmsEventMessageBundle['eventdate.editor.header']}" title="#{CmsEventMessageBundle['eventdate.editor.header']}"
unusedLocales="#{CmsEventInfoStepEventDate.unusedLocales}" unusedLocales="#{CmsEventInfoStepEventDate.unusedLocales}"
variants="#{CmsEventInfoStepEventDate.variants}" variants="#{CmsEventInfoStepEventDate.variants}"
viewPageUrl="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@event-info/view" variantsId="eventdate"
viewPageUrl="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@event-info/eventdate/view"
/> />
<librecms:cmsEditorVariants <librecms:cmsEditorVariants
addButtonLabel="#{CmsEventMessageBundle['location.editor.add_variant']}" addButtonLabel="#{CmsEventMessageBundle['location.editor.add_variant']}"
addDialogLocaleSelectHelp="#{CmsAdminMessages['text.editor.add.locale.help']}" addDialogLocaleSelectHelp="#{CmsEventMessageBundle['text.editor.add.locale.help']}"
addMethod="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@event-info/location/add" addMethod="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@event-info/location/add"
canEdit="#{CmsSelectedDocumentModel.canEdit}" canEdit="#{CmsSelectedDocumentModel.canEdit}"
editorPageUrl="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@event-info/location/edit" editorPageUrl="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@event-info/location/edit"
@ -41,12 +42,13 @@
title="#{CmsEventMessageBundle['location.editor.header']}" title="#{CmsEventMessageBundle['location.editor.header']}"
unusedLocales="#{CmsEventInfoStepLocation.unusedLocales}" unusedLocales="#{CmsEventInfoStepLocation.unusedLocales}"
variants="#{CmsEventInfoStepLocation.variants}" variants="#{CmsEventInfoStepLocation.variants}"
viewPageUrl="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@event-info/view" variantsId="location"
viewPageUrl="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@event-info/location/view"
/> />
<librecms:cmsEditorVariants <librecms:cmsEditorVariants
addButtonLabel="#{CmsEventMessageBundle['main_contributor.editor.add_variant']}" addButtonLabel="#{CmsEventMessageBundle['main_contributor.editor.add_variant']}"
addDialogLocaleSelectHelp="#{CmsAdminMessages['text.editor.add.locale.help']}" addDialogLocaleSelectHelp="#{CmsEventMessageBundle['text.editor.add.locale.help']}"
addMethod="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@event-info/main-contributor/add" addMethod="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@event-info/main-contributor/add"
canEdit="#{CmsSelectedDocumentModel.canEdit}" canEdit="#{CmsSelectedDocumentModel.canEdit}"
editorPageUrl="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@event-info/main-contributor/edit" editorPageUrl="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@event-info/main-contributor/edit"
@ -56,12 +58,13 @@
title="#{CmsEventMessageBundle['main_contributor.editor.header']}" title="#{CmsEventMessageBundle['main_contributor.editor.header']}"
unusedLocales="#{CmsEventInfoStepMainContributor.unusedLocales}" unusedLocales="#{CmsEventInfoStepMainContributor.unusedLocales}"
variants="#{CmsEventInfoStepMainContributor.variants}" variants="#{CmsEventInfoStepMainContributor.variants}"
viewPageUrl="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@event-info/view" variantsId="maincontributor"
viewPageUrl="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@event-info/main-contributor/view"
/> />
<librecms:cmsEditorVariants <librecms:cmsEditorVariants
addButtonLabel="#{CmsEventMessageBundle['eventtype.editor.add_variant']}" addButtonLabel="#{CmsEventMessageBundle['eventtype.editor.add_variant']}"
addDialogLocaleSelectHelp="#{CmsAdminMessages['text.editor.add.locale.help']}" addDialogLocaleSelectHelp="#{CmsEventMessageBundle['text.editor.add.locale.help']}"
addMethod="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@event-info/eventtype/add" addMethod="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@event-info/eventtype/add"
canEdit="#{CmsSelectedDocumentModel.canEdit}" canEdit="#{CmsSelectedDocumentModel.canEdit}"
editorPageUrl="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@event-info/eventtype/edit" editorPageUrl="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@event-info/eventtype/edit"
@ -71,7 +74,8 @@
title="#{CmsEventMessageBundle['eventtype.editor.header']}" title="#{CmsEventMessageBundle['eventtype.editor.header']}"
unusedLocales="#{CmsEventInfoStepEventType.unusedLocales}" unusedLocales="#{CmsEventInfoStepEventType.unusedLocales}"
variants="#{CmsEventInfoStepEventType.variants}" variants="#{CmsEventInfoStepEventType.variants}"
viewPageUrl="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@event-info/view" variantsId="eventtype"
viewPageUrl="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@event-info/eventtype/view"
/> />
</ui:define> </ui:define>

View File

@ -8,23 +8,23 @@
<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">
<ui:define name="authoringStep"> <ui:define name="authoringStep">
<div class="d-flex"> <div class="d-flex">
<a class="btn btn-secondary btn-sm align-self-center mr-2" <a class="btn btn-secondary btn-sm align-self-center mr-2"
href="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemTitle}/@event-info"> href="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemName}/@event-info">
<bootstrap:svgIcon icon="caret-left-fill" /> <bootstrap:svgIcon icon="caret-left-fill" />
<span class="sr-only">#{CmsEventMessageBundle['eventinfo_step.back']}</span> <span class="sr-only">#{CmsEventMessageBundle['eventinfo_step.back']}</span>
</a> </a>
<h2>#{CmsEventMessageBundle.getMessage('eventinfo_step.eventdate.header.edit',[CmsSelectedDocumentModel.itemName, CmsEventInfoStepEventDate.selectedLocale])}</h2> <h2>#{CmsEventMessageBundle.getMessage('eventinfo_step.eventdate.header.edit',[CmsSelectedDocumentModel.itemName, CmsEventInfoStepEventDate.selectedLocale])}</h2>
</div> </div>
<c:if test="#{CmsEventInfoStepEventDate.canEdit}"> <c:if test="#{CmsEventInfoStepEventDate.canEdit}">
<librecms:cmsEditor <librecms:cmsEditor
backUrl="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemTitle}/@event-info" backUrl="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemName}/@event-info"
baseUrl="#{mvc.basePath}" baseUrl="#{mvc.basePath}"
canEdit="#{CmsEventInfoStepEventDate.canEdit}" canEdit="#{CmsEventInfoStepEventDate.canEdit}"
contentSection="#{ContentSectionModel.sectionName}" contentSection="#{ContentSectionModel.sectionName}"
editMethod="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemTitle}/@event-info/eventdate/edit" editMethod="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemName}/@event-info/eventdate/edit"
editorId="cms-event-eventdate-editor" editorId="cms-event-eventdate-editor"
objectIdentifier="#{CmsSelectedDocumentModel.itemPath}" objectIdentifier="#{CmsSelectedDocumentModel.itemPath}"
selectedLocale="#{CmsEventInfoStepEventDate.selectedLocale}" selectedLocale="#{CmsEventInfoStepEventDate.selectedLocale}"
@ -32,13 +32,13 @@
variantUrl="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@event-info-resources/eventdate" variantUrl="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@event-info-resources/eventdate"
/> />
</c:if> </c:if>
<ui:define name="scripts">
<script src="#{request.contextPath}/assets/@content-sections/article-text-step.js"></script>
</ui:define> </ui:define>
<ui:define name="scripts">
<script src="#{request.contextPath}/assets/@content-sections/event-info-step-eventdate.js"></script>
</ui:define> </ui:define>
</ui:composition> </ui:composition>
</html> </html>

View File

@ -10,7 +10,7 @@
<ui:define name="authoringStep"> <ui:define name="authoringStep">
<div class="d-flex"> <div class="d-flex">
<a class="btn btn-secondary btn-sm align-self-center mr-2" <a class="btn btn-secondary btn-sm align-self-center mr-2"
href="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemTitle}/@event-info"> href="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemName}/@event-info">
<bootstrap:svgIcon icon="caret-left-fill" /> <bootstrap:svgIcon icon="caret-left-fill" />
<span class="sr-only">#{CmsEventMessageBundle['eventinfo_step.back']}</span> <span class="sr-only">#{CmsEventMessageBundle['eventinfo_step.back']}</span>
</a> </a>

View File

@ -8,23 +8,23 @@
<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">
<ui:define name="authoringStep"> <ui:define name="authoringStep">
<div class="d-flex"> <div class="d-flex">
<a class="btn btn-secondary btn-sm align-self-center mr-2" <a class="btn btn-secondary btn-sm align-self-center mr-2"
href="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemTitle}/@event-info"> href="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemName}/@event-info">
<bootstrap:svgIcon icon="caret-left-fill" /> <bootstrap:svgIcon icon="caret-left-fill" />
<span class="sr-only">#{CmsEventMessageBundle['eventinfo_step.back']}</span> <span class="sr-only">#{CmsEventMessageBundle['eventinfo_step.back']}</span>
</a> </a>
<h2>#{CmsEventMessageBundle.getMessage('eventinfo_step.eventtype.header.edit',[CmsSelectedDocumentModel.itemName, CmsEventInfoStepEventType.selectedLocale])}</h2> <h2>#{CmsEventMessageBundle.getMessage('eventinfo_step.eventtype.header.edit',[CmsSelectedDocumentModel.itemName, CmsEventInfoStepEventType.selectedLocale])}</h2>
</div> </div>
<c:if test="#{CmsEventInfoStepEventType.canEdit}"> <c:if test="#{CmsEventInfoStepEventType.canEdit}">
<librecms:cmsEditor <librecms:cmsEditor
backUrl="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemTitle}/@event-info" backUrl="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemName}/@event-info"
baseUrl="#{mvc.basePath}" baseUrl="#{mvc.basePath}"
canEdit="#{CmsEventInfoStepEventType.canEdit}" canEdit="#{CmsEventInfoStepEventType.canEdit}"
contentSection="#{ContentSectionModel.sectionName}" contentSection="#{ContentSectionModel.sectionName}"
editMethod="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemTitle}/@event-info/eventtype/edit" editMethod="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemName}/@event-info/eventtype/edit"
editorId="cms-event-eventtype-editor" editorId="cms-event-eventtype-editor"
objectIdentifier="#{CmsSelectedDocumentModel.itemPath}" objectIdentifier="#{CmsSelectedDocumentModel.itemPath}"
selectedLocale="#{CmsEventInfoStepEventType.selectedLocale}" selectedLocale="#{CmsEventInfoStepEventType.selectedLocale}"
@ -32,14 +32,14 @@
variantUrl="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@event-info-resources/eventtype" variantUrl="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@event-info-resources/eventtype"
/> />
</c:if> </c:if>
<ui:define name="scripts">
<script src="#{request.contextPath}/assets/@content-sections/article-text-step.js"></script>
</ui:define> </ui:define>
<ui:define name="scripts">
<script src="#{request.contextPath}/assets/@content-sections/event-info-step-eventtype.js"></script>
</ui:define> </ui:define>
</ui:composition> </ui:composition>
</html> </html>

View File

@ -10,7 +10,7 @@
<ui:define name="authoringStep"> <ui:define name="authoringStep">
<div class="d-flex"> <div class="d-flex">
<a class="btn btn-secondary btn-sm align-self-center mr-2" <a class="btn btn-secondary btn-sm align-self-center mr-2"
href="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemTitle}/@event-info"> href="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemName}/@event-info">
<bootstrap:svgIcon icon="caret-left-fill" /> <bootstrap:svgIcon icon="caret-left-fill" />
<span class="sr-only">#{CmsEventMessageBundle['eventinfo_step.back']}</span> <span class="sr-only">#{CmsEventMessageBundle['eventinfo_step.back']}</span>
</a> </a>

View File

@ -8,23 +8,23 @@
<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">
<ui:define name="authoringStep"> <ui:define name="authoringStep">
<div class="d-flex"> <div class="d-flex">
<a class="btn btn-secondary btn-sm align-self-center mr-2" <a class="btn btn-secondary btn-sm align-self-center mr-2"
href="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemTitle}/@event-info"> href="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemName}/@event-info">
<bootstrap:svgIcon icon="caret-left-fill" /> <bootstrap:svgIcon icon="caret-left-fill" />
<span class="sr-only">#{CmsEventMessageBundle['eventinfo_step.back']}</span> <span class="sr-only">#{CmsEventMessageBundle['eventinfo_step.back']}</span>
</a> </a>
<h2>#{CmsEventMessageBundle.getMessage('eventinfo_step.location.header.edit',[CmsSelectedDocumentModel.itemName, CmsEventInfoStepLocation.selectedLocale])}</h2> <h2>#{CmsEventMessageBundle.getMessage('eventinfo_step.location.header.edit',[CmsSelectedDocumentModel.itemName, CmsEventInfoStepLocation.selectedLocale])}</h2>
</div> </div>
<c:if test="#{CmsEventInfoStepLocation.canEdit}"> <c:if test="#{CmsEventInfoStepLocation.canEdit}">
<librecms:cmsEditor <librecms:cmsEditor
backUrl="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemTitle}/@event-info" backUrl="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemName}/@event-info"
baseUrl="#{mvc.basePath}" baseUrl="#{mvc.basePath}"
canEdit="#{CmsEventInfoStepLocation.canEdit}" canEdit="#{CmsEventInfoStepLocation.canEdit}"
contentSection="#{ContentSectionModel.sectionName}" contentSection="#{ContentSectionModel.sectionName}"
editMethod="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemTitle}/@event-info/location/edit" editMethod="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemName}/@event-info/location/edit"
editorId="cms-event-location-editor" editorId="cms-event-location-editor"
objectIdentifier="#{CmsSelectedDocumentModel.itemPath}" objectIdentifier="#{CmsSelectedDocumentModel.itemPath}"
selectedLocale="#{CmsEventInfoStepLocation.selectedLocale}" selectedLocale="#{CmsEventInfoStepLocation.selectedLocale}"
@ -32,14 +32,14 @@
variantUrl="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@event-info-resources/location" variantUrl="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@event-info-resources/location"
/> />
</c:if> </c:if>
<ui:define name="scripts">
<script src="#{request.contextPath}/assets/@content-sections/article-text-step.js"></script>
</ui:define> </ui:define>
<ui:define name="scripts">
<script src="#{request.contextPath}/assets/@content-sections/event-info-step-location.js"></script>
</ui:define> </ui:define>
</ui:composition> </ui:composition>
</html> </html>

View File

@ -10,7 +10,7 @@
<ui:define name="authoringStep"> <ui:define name="authoringStep">
<div class="d-flex"> <div class="d-flex">
<a class="btn btn-secondary btn-sm align-self-center mr-2" <a class="btn btn-secondary btn-sm align-self-center mr-2"
href="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemTitle}/@event-info"> href="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemName}/@event-info">
<bootstrap:svgIcon icon="caret-left-fill" /> <bootstrap:svgIcon icon="caret-left-fill" />
<span class="sr-only">#{CmsEventMessageBundle['eventinfo_step.back']}</span> <span class="sr-only">#{CmsEventMessageBundle['eventinfo_step.back']}</span>
</a> </a>

View File

@ -8,23 +8,23 @@
<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">
<ui:define name="authoringStep"> <ui:define name="authoringStep">
<div class="d-flex"> <div class="d-flex">
<a class="btn btn-secondary btn-sm align-self-center mr-2" <a class="btn btn-secondary btn-sm align-self-center mr-2"
href="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemTitle}/@event-info"> href="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemName}/@event-info">
<bootstrap:svgIcon icon="caret-left-fill" /> <bootstrap:svgIcon icon="caret-left-fill" />
<span class="sr-only">#{CmsEventMessageBundle['eventinfo_step.back']}</span> <span class="sr-only">#{CmsEventMessageBundle['eventinfo_step.back']}</span>
</a> </a>
<h2>#{CmsEventMessageBundle.getMessage('eventinfo_step.main_contributor.header.edit',[CmsSelectedDocumentModel.itemName, CmsEventInfoStepMainContributor.selectedLocale])}</h2> <h2>#{CmsEventMessageBundle.getMessage('eventinfo_step.main_contributor.header.edit',[CmsSelectedDocumentModel.itemName, CmsEventInfoStepMainContributor.selectedLocale])}</h2>
</div> </div>
<c:if test="#{CmsEventInfoStepMainContributor.canEdit}"> <c:if test="#{CmsEventInfoStepMainContributor.canEdit}">
<librecms:cmsEditor <librecms:cmsEditor
backUrl="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemTitle}/@event-info" backUrl="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemName}/@event-info"
baseUrl="#{mvc.basePath}" baseUrl="#{mvc.basePath}"
canEdit="#{CmsEventInfoStepMainContributor.canEdit}" canEdit="#{CmsEventInfoStepMainContributor.canEdit}"
contentSection="#{ContentSectionModel.sectionName}" contentSection="#{ContentSectionModel.sectionName}"
editMethod="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemTitle}/@event-info/main-contributor/edit" editMethod="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemName}/@event-info/main-contributor/edit"
editorId="cms-event-maincontributor-editor" editorId="cms-event-maincontributor-editor"
objectIdentifier="#{CmsSelectedDocumentModel.itemPath}" objectIdentifier="#{CmsSelectedDocumentModel.itemPath}"
selectedLocale="#{CmsEventInfoStepMainContributor.selectedLocale}" selectedLocale="#{CmsEventInfoStepMainContributor.selectedLocale}"
@ -32,14 +32,14 @@
variantUrl="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@event-info-resources/main-contributor" variantUrl="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@event-info-resources/main-contributor"
/> />
</c:if> </c:if>
<ui:define name="scripts">
<script src="#{request.contextPath}/assets/@content-sections/article-text-step.js"></script>
</ui:define> </ui:define>
<ui:define name="scripts">
<script src="#{request.contextPath}/assets/@content-sections/event-info-step-maincontributor.js"></script>
</ui:define> </ui:define>
</ui:composition> </ui:composition>
</html> </html>

View File

@ -10,7 +10,7 @@
<ui:define name="authoringStep"> <ui:define name="authoringStep">
<div class="d-flex"> <div class="d-flex">
<a class="btn btn-secondary btn-sm align-self-center mr-2" <a class="btn btn-secondary btn-sm align-self-center mr-2"
href="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemTitle}/@event-info"> href="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemName}/@event-info">
<bootstrap:svgIcon icon="caret-left-fill" /> <bootstrap:svgIcon icon="caret-left-fill" />
<span class="sr-only">#{CmsEventMessageBundle['eventinfo_step.back']}</span> <span class="sr-only">#{CmsEventMessageBundle['eventinfo_step.back']}</span>
</a> </a>

View File

@ -114,3 +114,4 @@ basicproperties.eventdatetime.edit.dialog.startdate.label=Start
basicproperties.eventdatetime.edit.dialog.enddate.help=The end of the event (date and time) basicproperties.eventdatetime.edit.dialog.enddate.help=The end of the event (date and time)
basicproperties.eventdatetime.edit.dialog.enddate.label=End basicproperties.eventdatetime.edit.dialog.enddate.label=End
basicproperties.eventdatetime.edit.dialog.submit=Submit basicproperties.eventdatetime.edit.dialog.submit=Submit
text.editor.add.locale.help=The language to add.

View File

@ -114,3 +114,4 @@ basicproperties.eventdatetime.edit.dialog.startdate.label=Beginn
basicproperties.eventdatetime.edit.dialog.enddate.help=Ende der Veranstaltung (Datum und Uhrzeit) basicproperties.eventdatetime.edit.dialog.enddate.help=Ende der Veranstaltung (Datum und Uhrzeit)
basicproperties.eventdatetime.edit.dialog.enddate.label=Ende basicproperties.eventdatetime.edit.dialog.enddate.label=Ende
basicproperties.eventdatetime.edit.dialog.submit=Speichern basicproperties.eventdatetime.edit.dialog.submit=Speichern
text.editor.add.locale.help=Die Sprache, die hinzugef\u00fcgt werden soll.

View File

@ -0,0 +1,52 @@
import { CmsEditorBuilder, CmsEditor } from "./cms-editor";
document.addEventListener("DOMContentLoaded", (event) => {
const editorElem = document.querySelector("#cms-event-eventdate-editor");
if (editorElem) {
const saveUrl = editorElem.getAttribute("data-save-url");
const variantUrl = editorElem.getAttribute("data-variant-url");
if (!saveUrl) {
console.error("saveUrl is null");
return;
}
if (!variantUrl) {
console.error("variantUrl is null");
return;
}
const builder = new CmsEditorBuilder(
editorElem as HTMLElement,
saveUrl,
variantUrl
);
builder
.buildEditor()
.then((editor) => {
const submitButton = document.querySelector(
".cms-editor-save-button"
);
if (submitButton) {
submitButton.addEventListener("click", (event) => {
event.preventDefault();
console.log("HTML output of editor: ");
console.log(editor.getEditor().getHTML());
});
} else {
console.error("Save button not found.")
}
})
.catch((error) => {
console.error(error);
console.trace(error);
});
} else {
console.error("Editor element not found.")
}
});

View File

@ -0,0 +1,52 @@
import { CmsEditorBuilder, CmsEditor } from "./cms-editor";
document.addEventListener("DOMContentLoaded", (event) => {
const editorElem = document.querySelector("#cms-event-eventtype-editor");
if (editorElem) {
const saveUrl = editorElem.getAttribute("data-save-url");
const variantUrl = editorElem.getAttribute("data-variant-url");
if (!saveUrl) {
console.error("saveUrl is null");
return;
}
if (!variantUrl) {
console.error("variantUrl is null");
return;
}
const builder = new CmsEditorBuilder(
editorElem as HTMLElement,
saveUrl,
variantUrl
);
builder
.buildEditor()
.then((editor) => {
const submitButton = document.querySelector(
".cms-editor-save-button"
);
if (submitButton) {
submitButton.addEventListener("click", (event) => {
event.preventDefault();
console.log("HTML output of editor: ");
console.log(editor.getEditor().getHTML());
});
} else {
console.error("Save button not found.")
}
})
.catch((error) => {
console.error(error);
console.trace(error);
});
} else {
console.error("Editor element not found.")
}
});

View File

@ -0,0 +1,52 @@
import { CmsEditorBuilder, CmsEditor } from "./cms-editor";
document.addEventListener("DOMContentLoaded", (event) => {
const editorElem = document.querySelector("#cms-event-location-editor");
if (editorElem) {
const saveUrl = editorElem.getAttribute("data-save-url");
const variantUrl = editorElem.getAttribute("data-variant-url");
if (!saveUrl) {
console.error("saveUrl is null");
return;
}
if (!variantUrl) {
console.error("variantUrl is null");
return;
}
const builder = new CmsEditorBuilder(
editorElem as HTMLElement,
saveUrl,
variantUrl
);
builder
.buildEditor()
.then((editor) => {
const submitButton = document.querySelector(
".cms-editor-save-button"
);
if (submitButton) {
submitButton.addEventListener("click", (event) => {
event.preventDefault();
console.log("HTML output of editor: ");
console.log(editor.getEditor().getHTML());
});
} else {
console.error("Save button not found.")
}
})
.catch((error) => {
console.error(error);
console.trace(error);
});
} else {
console.error("Editor element not found.")
}
});

View File

@ -0,0 +1,52 @@
import { CmsEditorBuilder, CmsEditor } from "./cms-editor";
document.addEventListener("DOMContentLoaded", (event) => {
const editorElem = document.querySelector("#cms-event-maincontributor-editor");
if (editorElem) {
const saveUrl = editorElem.getAttribute("data-save-url");
const variantUrl = editorElem.getAttribute("data-variant-url");
if (!saveUrl) {
console.error("saveUrl is null");
return;
}
if (!variantUrl) {
console.error("variantUrl is null");
return;
}
const builder = new CmsEditorBuilder(
editorElem as HTMLElement,
saveUrl,
variantUrl
);
builder
.buildEditor()
.then((editor) => {
const submitButton = document.querySelector(
".cms-editor-save-button"
);
if (submitButton) {
submitButton.addEventListener("click", (event) => {
event.preventDefault();
console.log("HTML output of editor: ");
console.log(editor.getEditor().getHTML());
});
} else {
console.error("Save button not found.")
}
})
.catch((error) => {
console.error(error);
console.trace(error);
});
} else {
console.error("Editor element not found.")
}
});

View File

@ -7,6 +7,10 @@ module.exports = {
entry: { entry: {
"cms-admin": "./src/main/typescript/content-sections/cms-admin.ts", "cms-admin": "./src/main/typescript/content-sections/cms-admin.ts",
"article-text-step": "./src/main/typescript/content-sections/article-text-step.ts", "article-text-step": "./src/main/typescript/content-sections/article-text-step.ts",
"event-info-step-eventdate": "./src/main/typescript/content-sections/event-info-step-eventdate.ts",
"event-info-step-eventtype": "./src/main/typescript/content-sections/event-info-step-eventtype.ts",
"event-info-step-location": "./src/main/typescript/content-sections/event-info-step-location.ts",
"event-info-step-maincontributor": "./src/main/typescript/content-sections/event-info-step-maincontributor.ts",
"mpa-section-edit-text": "./src/main/typescript/content-sections/mpa-section-edit-text.ts" "mpa-section-edit-text": "./src/main/typescript/content-sections/mpa-section-edit-text.ts"
}, },
output: { output: {