Several bugfixes for the authoring steps of SciProject

pull/1/head
Jens Pelzetter 2022-04-23 15:04:45 +02:00
parent 8c2ae8bd1d
commit c34b6bdedb
6 changed files with 216 additions and 182 deletions

View File

@ -147,7 +147,8 @@ public class SciProject extends ContentItem implements Serializable {
private List<Contact> contacts; private List<Contact> contacts;
@OneToMany(mappedBy = "project", cascade = CascadeType.ALL) @OneToMany(mappedBy = "project", cascade = CascadeType.ALL)
@OrderBy("member.personName ASC") // @OrderBy("member.personName ASC")
@OrderBy("member ASC")
private List<Membership> members; private List<Membership> members;
@OneToMany(mappedBy = "project", cascade = CascadeType.ALL) @OneToMany(mappedBy = "project", cascade = CascadeType.ALL)

View File

@ -227,6 +227,8 @@ public class SciProjectPropertiesStep extends AbstractMvcAuthoringStep {
getDocument().setDisplayName(name); getDocument().setDisplayName(name);
itemRepo.save(getDocument()); itemRepo.save(getDocument());
updateDocumentPath();
return buildRedirectPathForStep(); return buildRedirectPathForStep();
} else { } else {
return documentUi.showAccessDenied( return documentUi.showAccessDenied(
@ -506,7 +508,7 @@ public class SciProjectPropertiesStep extends AbstractMvcAuthoringStep {
* @return A redirect to this authoring step. * @return A redirect to this authoring step.
*/ */
@POST @POST
@Path("/short-description/{locale}") @Path("/short-description/@edit/{locale}")
@Transactional(Transactional.TxType.REQUIRED) @Transactional(Transactional.TxType.REQUIRED)
@AuthorizationRequired @AuthorizationRequired
public String editShortDescription( public String editShortDescription(
@ -552,7 +554,7 @@ public class SciProjectPropertiesStep extends AbstractMvcAuthoringStep {
* @return A redirect to this authoring step. * @return A redirect to this authoring step.
*/ */
@POST @POST
@Path("/short-description/remove/{locale}") @Path("/short-description/@remove/{locale}")
@Transactional(Transactional.TxType.REQUIRED) @Transactional(Transactional.TxType.REQUIRED)
@AuthorizationRequired @AuthorizationRequired
public String removeShortDescription( public String removeShortDescription(

View File

@ -190,7 +190,7 @@
<dl> <dl>
<dt>#{SciProjectMessageBundle['basicproperties.end.label']}</dt> <dt>#{SciProjectMessageBundle['basicproperties.end.label']}</dt>
<dd> <dd>
#{SciProjectPropertiesStep.end} #{SciProjectPropertiesStep.endDate}
</dd> </dd>
</dl> </dl>
<div aria-hidden="true" <div aria-hidden="true"
@ -256,7 +256,7 @@
editDialogValueHelp="#{SciProjectMessageBundle['basicproperties.shortdescription.edit.value.help']}" editDialogValueHelp="#{SciProjectMessageBundle['basicproperties.shortdescription.edit.value.help']}"
editDialogValueLabel="#{SciProjectMessageBundle['basicproperties.shortdescription.edit.value.label']}" editDialogValueLabel="#{SciProjectMessageBundle['basicproperties.shortdescription.edit.value.label']}"
editMethod="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@sciproject-basicproperties/short-description/@edit" editMethod="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@sciproject-basicproperties/short-description/@edit"
editorId="title-editor" editorId="summary-editor"
hasUnusedLocales="#{!SciProjectPropertiesStep.unusedShortDescriptionLocales.isEmpty()}" hasUnusedLocales="#{!SciProjectPropertiesStep.unusedShortDescriptionLocales.isEmpty()}"
headingLevel="3" headingLevel="3"
objectIdentifier="#{CmsSelectedDocumentModel.itemPath}" objectIdentifier="#{CmsSelectedDocumentModel.itemPath}"

View File

@ -55,91 +55,99 @@
name="type" name="type"
/> />
</librecms:assetPicker> </librecms:assetPicker>
<table> <c:choose>
<thead> <c:when test="#{SciProjectDescriptionContacts.contacts.isEmpty()}">
<tr> <p>#{SciProjectMessageBundle['contacts.none']}</p>
<th scope="col">#{SciProjectMessageBundle['contacts.cols.contactable']}</th> </c:when>
<th scope="col">#{SciProjectMessageBundle['contacts.cols.type']}</th> <c:otherwise>
<th colspan="2"
scope="col"
>#{SciProjectMessageBundle['contacts.cols.actions']}</th>
</tr>
</thead>
<tbody>
<c:forEach items="#{SciProjectDescriptionContacts.contacts}"
var="contact">
<tr id="#{contact.contactId}">
<td>#{contact.contactable}</td>
<td>#{contact.contactType}</td>
<td>
<button class="btn btn-secondary"
data-toggle="modal"
data-target="#contact-edit-dialog"
type="button">
<bootstrap:svgIcon icon="pen" />
<span>#{SciProjectMessageBundle['contacts.edit.label']}</span>
</button>
<div aria-hidden="true"
aria-labelledby="contact-edit-dialog-title"
class="modal fade"
id="contact-edit-dialog"
tabindex="-1">
<div class="modal-dialog">
<form class="modal-content">
<div class="modal-header">
<h4 class="modal-title"
id="contact-edit-dialog-title">
#{SciProjectMessageBundle['contacts.edit.title']}
</h4>
<button
aria-label="#{SciProjectMessageBundle['contacts.edit.cancel']}"
class="close"
data-dismiss="modal"
type="button">
<bootstrap:svgIcon icon="x"/>
</button>
</div>
<div class="modal-body">
<bootstrap:formGroupText
help="#{SciProjectMessageBundle['contacts.edit.type.help']}"
inputId="type-edit"
label="#{SciProjectMessageBundle['contacts.edit.type.label']}"
name="type"
/>
</div>
<div class="modal-footer">
<button class="btn btn-warning"
data-dismiss="modal"
type="button">
#{SciProjectMessageBundle['contacts.edit.cancel']}
</button>
<button class="btn btn-success"
type="submit">
#{SciProjectMessageBundle['contacts.edit.submit']}
</button>
</div>
</form>
</div>
</div>
</td>
<td>
<libreccm:deleteDialog
actionTarget="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@sciproject-description/contacts/remove/#{contact.contactId}"
buttonText="#{SciProjectMessageBundle['contacts.delete.label']}"
cancelLabel="#{SciProjectMessageBundle['contacts.delete.cancel']}"
confirmLabel="#{SciProjectMessageBundle['contacts.delete.confirm']}"
dialogId="contact-delete-dialog"
dialogTitle="#{SciProjectMessageBundle['contacts.delete.title']}"
message="#{SciProjectMessageBundle.getMessage('contacts.delete.message', [contact.contactable, contact.contactType])}"
/> <table>
</td> <thead>
</tr> <tr>
</c:forEach> <th scope="col">#{SciProjectMessageBundle['contacts.cols.contactable']}</th>
</tbody> <th scope="col">#{SciProjectMessageBundle['contacts.cols.type']}</th>
</table> <th colspan="2"
scope="col"
>#{SciProjectMessageBundle['contacts.cols.actions']}</th>
</tr>
</thead>
<tbody>
<c:forEach items="#{SciProjectDescriptionContacts.contacts}"
var="contact">
<tr id="#{contact.contactId}">
<td>#{contact.contactable}</td>
<td>#{contact.contactType}</td>
<td>
<button class="btn btn-secondary"
data-toggle="modal"
data-target="#contact-edit-dialog"
type="button">
<bootstrap:svgIcon icon="pen" />
<span>#{SciProjectMessageBundle['contacts.edit.label']}</span>
</button>
<div aria-hidden="true"
aria-labelledby="contact-edit-dialog-title"
class="modal fade"
id="contact-edit-dialog"
tabindex="-1">
<div class="modal-dialog">
<form class="modal-content">
<div class="modal-header">
<h4 class="modal-title"
id="contact-edit-dialog-title">
#{SciProjectMessageBundle['contacts.edit.title']}
</h4>
<button
aria-label="#{SciProjectMessageBundle['contacts.edit.cancel']}"
class="close"
data-dismiss="modal"
type="button">
<bootstrap:svgIcon icon="x"/>
</button>
</div>
<div class="modal-body">
<bootstrap:formGroupText
help="#{SciProjectMessageBundle['contacts.edit.type.help']}"
inputId="type-edit"
label="#{SciProjectMessageBundle['contacts.edit.type.label']}"
name="type"
/>
</div>
<div class="modal-footer">
<button class="btn btn-warning"
data-dismiss="modal"
type="button">
#{SciProjectMessageBundle['contacts.edit.cancel']}
</button>
<button class="btn btn-success"
type="submit">
#{SciProjectMessageBundle['contacts.edit.submit']}
</button>
</div>
</form>
</div>
</div>
</td>
<td>
<libreccm:deleteDialog
actionTarget="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@sciproject-description/contacts/remove/#{contact.contactId}"
buttonText="#{SciProjectMessageBundle['contacts.delete.label']}"
cancelLabel="#{SciProjectMessageBundle['contacts.delete.cancel']}"
confirmLabel="#{SciProjectMessageBundle['contacts.delete.confirm']}"
dialogId="contact-delete-dialog"
dialogTitle="#{SciProjectMessageBundle['contacts.delete.title']}"
message="#{SciProjectMessageBundle.getMessage('contacts.delete.message', [contact.contactable, contact.contactType])}"
/>
</td>
</tr>
</c:forEach>
</tbody>
</table>
</c:otherwise>
</c:choose>
<h3>#{SciProjectMessageBundle['memberships.header']}</h3> <h3>#{SciProjectMessageBundle['memberships.header']}</h3>
<div class="mb-2"> <div class="mb-2">
@ -176,102 +184,109 @@
/> />
</librecms:assetPicker> </librecms:assetPicker>
<table> <c:choose>
<thead> <c:when test="#{SciProjectDescriptionMembers.members.isEmpty()}">
<tr> <p>#{SciProjectMessageBundle['memberships.none']}</p>
<th scope="col">#{SciProjectMessageBundle['memberships.cols.name']}</th> </c:when>
<th scope="col">#{SciProjectMessageBundle['memberships.cols.role']}</th> <c:otherwise>
<th scope="col">#{SciProjectMessageBundle['memberships.cols.status']}</th> <table>
<th colspan="2" <thead>
scope="col">#{SciProjectMessageBundle['memberships.cols.actions']}</th> <tr>
</tr> <th scope="col">#{SciProjectMessageBundle['memberships.cols.name']}</th>
</thead> <th scope="col">#{SciProjectMessageBundle['memberships.cols.role']}</th>
<tbody id="members-list"> <th scope="col">#{SciProjectMessageBundle['memberships.cols.status']}</th>
<c:forEach items="#{SciProjectDescriptionMembers.members}" <th colspan="2"
var="member"> scope="col">#{SciProjectMessageBundle['memberships.cols.actions']}</th>
<tr> </tr>
<td> </thead>
#{member.name} <tbody id="members-list">
</td> <c:forEach items="#{SciProjectDescriptionMembers.members}"
<td> var="member">
#{member.role} <tr>
</td> <td>
<td> #{member.name}
#{member.status} </td>
</td> <td>
<td> #{member.role}
<button class="btn btn-secondary" </td>
data-toggle="modal" <td>
data-target="#membership-edit-dialog" #{member.status}
type="button"> </td>
<bootstrap:svgIcon icon="pen"/> <td>
<span class="sr-only">#{SciProjectMessageBundle['memberships.edit.label']}</span> <button class="btn btn-secondary"
</button> data-toggle="modal"
<div aria-hidden="true" data-target="#membership-edit-dialog"
aria-labelledby="membership-edit-dialog-title" type="button">
class="modal fade" <bootstrap:svgIcon icon="pen"/>
id="membership-edit-dialog" <span class="sr-only">#{SciProjectMessageBundle['memberships.edit.label']}</span>
tabindex="-1"> </button>
<div class="modal-dialog"> <div aria-hidden="true"
<form class="modal-content"> aria-labelledby="membership-edit-dialog-title"
<div class="modal-header"> class="modal fade"
<h4 class="modal-title" id="membership-edit-dialog"
id="membership-edit-dialog-title"> tabindex="-1">
</h4> <div class="modal-dialog">
<button <form class="modal-content">
aria-label="#{SciProjectMessageBundle['memberships.edit.cancel']}" <div class="modal-header">
class="close" <h4 class="modal-title"
data-dismiss="modal" id="membership-edit-dialog-title">
type="button"> </h4>
<bootstrap:svgIcon icon="x"/> <button
</button> aria-label="#{SciProjectMessageBundle['memberships.edit.cancel']}"
</div> class="close"
<div class="modal-body"> data-dismiss="modal"
<bootstrap:formGroupText type="button">
help="#{SciProjectMessageBundle['memberships.edit.role.help']}" <bootstrap:svgIcon icon="x"/>
inputId="type" </button>
label="#{SciProjectMessageBundle['memberships.edit.role.label']}" </div>
name="type-edit" <div class="modal-body">
/> <bootstrap:formGroupText
help="#{SciProjectMessageBundle['memberships.edit.role.help']}"
inputId="type"
label="#{SciProjectMessageBundle['memberships.edit.role.label']}"
name="type-edit"
/>
<bootstrap:formGroupSelect <bootstrap:formGroupSelect
help="#{SciProjectMessageBundle['memberships.edit.status.help']}" help="#{SciProjectMessageBundle['memberships.edit.status.help']}"
inputId="status" inputId="status"
label="#{SciProjectMessageBundle['memberships.edit.status.label']}" label="#{SciProjectMessageBundle['memberships.edit.status.label']}"
name="status-edit" name="status-edit"
options="#{SciProjectDescriptionMembers.statusValues}" options="#{SciProjectDescriptionMembers.statusValues}"
/> />
</div>
<div class="modal-footer">
<button class="btn btn-warning"
data-dismiss="modal"
type="button">
#{SciProjectMessageBundle['members.edit.cancel']}
</button>
<button class="btn btn-success"
type="submit">
#{SciProjectMessageBundle['members.edit.submit']}
</button>
</div>
</form>
</div> </div>
<div class="modal-footer"> </div>
<button class="btn btn-warning" </td>
data-dismiss="modal" <td>
type="button"> <libreccm:deleteDialog
#{SciProjectMessageBundle['members.edit.cancel']} actionTarget="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@sciproject-description/members/remove/#{member.membershipId}"
</button> buttonText="#{SciProjectMessageBundle['memberships.delete.label']}"
<button class="btn btn-success" cancelLabel="#{SciProjectMessageBundle['memberships.delete.cancel']}"
type="submit"> confirmLabel="#{SciProjectMessageBundle['memberships.delete.confirm']}"
#{SciProjectMessageBundle['members.edit.submit']} dialogId="membership-delete-dialog"
</button> dialogTitle="#{SciProjectMessageBundle['memberships.delete.title']}"
</div> message="#{SciProjectMessageBundle.getMessage('memberships.delete.message', [member.name])}"
</form> />
</div> </td>
</div> </tr>
</td> </c:forEach>
<td> </tbody>
<libreccm:deleteDialog </table>
actionTarget="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@sciproject-description/members/remove/#{member.membershipId}" </c:otherwise>
buttonText="#{SciProjectMessageBundle['memberships.delete.label']}" </c:choose>
cancelLabel="#{SciProjectMessageBundle['memberships.delete.cancel']}"
confirmLabel="#{SciProjectMessageBundle['memberships.delete.confirm']}"
dialogId="membership-delete-dialog"
dialogTitle="#{SciProjectMessageBundle['memberships.delete.title']}"
message="#{SciProjectMessageBundle.getMessage('memberships.delete.message', [member.name])}"
/>
</td>
</tr>
</c:forEach>
</tbody>
</table>
</ui:define> </ui:define>

View File

@ -163,3 +163,11 @@ createform.cancel=Cancel
createform.submit=Create project createform.submit=Create project
createform.summary.help=A summary of the description of the research project. createform.summary.help=A summary of the description of the research project.
createform.summary.label=Summary createform.summary.label=Summary
authoringsteps.basicproperties.description=Basic properties of the research project description.
authoringsteps.basicproperties.label=Basic properties
authoringsteps.projectfunding.description=Information about the the funding of the research project.
authoringsteps.projectfunding.label=Funding
authoringsteps.projectdescription.description=Detailed description of the research project.
authoringsteps.projectdescription.label=Description
memberships.none=No memberships assigned yet.
contacts.none=No contacts assigned yet.

View File

@ -163,3 +163,11 @@ createform.cancel=Abbrechen
createform.submit=Projekt anlegen createform.submit=Projekt anlegen
createform.summary.help=Eine Zusammenfassung der Beschreibung des Forschungsprojektes. createform.summary.help=Eine Zusammenfassung der Beschreibung des Forschungsprojektes.
createform.summary.label=Zusammenfassung createform.summary.label=Zusammenfassung
authoringsteps.basicproperties.description=Basiseigenschaften der Beschreibung des Forschungsprojektes.
authoringsteps.basicproperties.label=Basiseigenschaften
authoringsteps.projectfunding.description=Information about the the funding of the research project.
authoringsteps.projectfunding.label=Finanzierung
authoringsteps.projectdescription.description=Ausf\u00fchrliche Beschreibung des Forschungsprojektes.
authoringsteps.projectdescription.label=Beschreibung
memberships.none=Es wurden noch keine Mitglieder hinzugef\u00fcgt.
contacts.none=Es wurden noch keine Kontakte hinzugef\u00fcgt.