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;
@OneToMany(mappedBy = "project", cascade = CascadeType.ALL)
@OrderBy("member.personName ASC")
// @OrderBy("member.personName ASC")
@OrderBy("member ASC")
private List<Membership> members;
@OneToMany(mappedBy = "project", cascade = CascadeType.ALL)

View File

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

View File

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

View File

@ -55,91 +55,99 @@
name="type"
/>
</librecms:assetPicker>
<table>
<thead>
<tr>
<th scope="col">#{SciProjectMessageBundle['contacts.cols.contactable']}</th>
<th scope="col">#{SciProjectMessageBundle['contacts.cols.type']}</th>
<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"
<c:choose>
<c:when test="#{SciProjectDescriptionContacts.contacts.isEmpty()}">
<p>#{SciProjectMessageBundle['contacts.none']}</p>
</c:when>
<c:otherwise>
/>
</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>
<table>
<thead>
<tr>
<th scope="col">#{SciProjectMessageBundle['contacts.cols.contactable']}</th>
<th scope="col">#{SciProjectMessageBundle['contacts.cols.type']}</th>
<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>
<div class="mb-2">
@ -176,105 +184,112 @@
/>
</librecms:assetPicker>
<table>
<thead>
<tr>
<th scope="col">#{SciProjectMessageBundle['memberships.cols.name']}</th>
<th scope="col">#{SciProjectMessageBundle['memberships.cols.role']}</th>
<th scope="col">#{SciProjectMessageBundle['memberships.cols.status']}</th>
<th colspan="2"
scope="col">#{SciProjectMessageBundle['memberships.cols.actions']}</th>
</tr>
</thead>
<tbody id="members-list">
<c:forEach items="#{SciProjectDescriptionMembers.members}"
var="member">
<tr>
<td>
#{member.name}
</td>
<td>
#{member.role}
</td>
<td>
#{member.status}
</td>
<td>
<button class="btn btn-secondary"
data-toggle="modal"
data-target="#membership-edit-dialog"
type="button">
<bootstrap:svgIcon icon="pen"/>
<span class="sr-only">#{SciProjectMessageBundle['memberships.edit.label']}</span>
</button>
<div aria-hidden="true"
aria-labelledby="membership-edit-dialog-title"
class="modal fade"
id="membership-edit-dialog"
tabindex="-1">
<div class="modal-dialog">
<form class="modal-content">
<div class="modal-header">
<h4 class="modal-title"
id="membership-edit-dialog-title">
</h4>
<button
aria-label="#{SciProjectMessageBundle['memberships.edit.cancel']}"
class="close"
data-dismiss="modal"
type="button">
<bootstrap:svgIcon icon="x"/>
</button>
</div>
<div class="modal-body">
<bootstrap:formGroupText
help="#{SciProjectMessageBundle['memberships.edit.role.help']}"
inputId="type"
label="#{SciProjectMessageBundle['memberships.edit.role.label']}"
name="type-edit"
/>
<c:choose>
<c:when test="#{SciProjectDescriptionMembers.members.isEmpty()}">
<p>#{SciProjectMessageBundle['memberships.none']}</p>
</c:when>
<c:otherwise>
<table>
<thead>
<tr>
<th scope="col">#{SciProjectMessageBundle['memberships.cols.name']}</th>
<th scope="col">#{SciProjectMessageBundle['memberships.cols.role']}</th>
<th scope="col">#{SciProjectMessageBundle['memberships.cols.status']}</th>
<th colspan="2"
scope="col">#{SciProjectMessageBundle['memberships.cols.actions']}</th>
</tr>
</thead>
<tbody id="members-list">
<c:forEach items="#{SciProjectDescriptionMembers.members}"
var="member">
<tr>
<td>
#{member.name}
</td>
<td>
#{member.role}
</td>
<td>
#{member.status}
</td>
<td>
<button class="btn btn-secondary"
data-toggle="modal"
data-target="#membership-edit-dialog"
type="button">
<bootstrap:svgIcon icon="pen"/>
<span class="sr-only">#{SciProjectMessageBundle['memberships.edit.label']}</span>
</button>
<div aria-hidden="true"
aria-labelledby="membership-edit-dialog-title"
class="modal fade"
id="membership-edit-dialog"
tabindex="-1">
<div class="modal-dialog">
<form class="modal-content">
<div class="modal-header">
<h4 class="modal-title"
id="membership-edit-dialog-title">
</h4>
<button
aria-label="#{SciProjectMessageBundle['memberships.edit.cancel']}"
class="close"
data-dismiss="modal"
type="button">
<bootstrap:svgIcon icon="x"/>
</button>
</div>
<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
help="#{SciProjectMessageBundle['memberships.edit.status.help']}"
inputId="status"
label="#{SciProjectMessageBundle['memberships.edit.status.label']}"
name="status-edit"
options="#{SciProjectDescriptionMembers.statusValues}"
/>
<bootstrap:formGroupSelect
help="#{SciProjectMessageBundle['memberships.edit.status.help']}"
inputId="status"
label="#{SciProjectMessageBundle['memberships.edit.status.label']}"
name="status-edit"
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 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>
</td>
<td>
<libreccm:deleteDialog
actionTarget="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@sciproject-description/members/remove/#{member.membershipId}"
buttonText="#{SciProjectMessageBundle['memberships.delete.label']}"
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>
</div>
</td>
<td>
<libreccm:deleteDialog
actionTarget="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@sciproject-description/members/remove/#{member.membershipId}"
buttonText="#{SciProjectMessageBundle['memberships.delete.label']}"
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>
</c:otherwise>
</c:choose>
</ui:define>
<ui:define name="scripts">
<script src="#{request.contextPath}/assets/@content-sections/sciproject-contacts.js" />
<script src="#{request.contextPath}/assets/@content-sections/sciproject-members.js" />

View File

@ -163,3 +163,11 @@ createform.cancel=Cancel
createform.submit=Create project
createform.summary.help=A summary of the description of the research project.
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.summary.help=Eine Zusammenfassung der Beschreibung des Forschungsprojektes.
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.