Removal and editing of contacts of a SciProject

pull/1/head
Jens Pelzetter 2022-05-11 20:24:59 +02:00
parent cbfdf563f1
commit 06d7839b70
5 changed files with 22 additions and 17 deletions

View File

@ -29,7 +29,7 @@ import javax.ws.rs.core.Response;
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/
@RequestScoped
@Path(MvcAuthoringSteps.PATH_PREFIX + "sciproject-description/contacts")
@Path(MvcAuthoringSteps.PATH_PREFIX + "sciproject-description-contacts")
public class SciProjectDescriptionContacts {
@Inject

View File

@ -461,7 +461,7 @@ public class SciProjectDescriptionStep extends AbstractMvcAuthoringStep {
}
@POST
@Path("/contacts/remove")
@Path("/contacts/{contactId}/remove")
@Transactional(Transactional.TxType.REQUIRED)
@AuthorizationRequired
public String removeContact(
@ -469,7 +469,7 @@ public class SciProjectDescriptionStep extends AbstractMvcAuthoringStep {
final String sectionIdentifier,
@PathParam(MvcAuthoringSteps.DOCUMENT_PATH_PATH_PARAM_NAME)
final String documentPath,
@FormParam("contactId")
@PathParam("contactId")
final String contactId
) {
try {

View File

@ -66,6 +66,7 @@
assetPickerId="contacts-picker"
baseUrl="#{SciProjectDescriptionContacts.baseUrl}"
contentSection="#{ContentSectionModel.sectionName}"
dialogTitle="#{SciProjectMessageBundle['contact.add.title']}"
formParamName="contactableUuid">
<bootstrap:formGroupText
help="#{SciProjectMessageBundle['contacts.type.help']}"
@ -94,7 +95,7 @@
</c:when>
<c:otherwise>
<table id="sciproject-contacts-table"
data-saveUrl="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@sciproject-description/contacts/save-order">
data-saveUrl="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@sciproject-description-contacts/save-order">
<thead>
<tr>
<th scope="col">#{SciProjectMessageBundle['contacts.cols.contactable']}</th>
@ -124,21 +125,23 @@
<td>
<button class="btn btn-secondary"
data-toggle="modal"
data-target="#contact-edit-dialog"
data-target="#contact-edit-dialog-#{contact.contactId}"
type="button">
<bootstrap:svgIcon icon="pen" />
<span>#{SciProjectMessageBundle['contacts.edit.label']}</span>
</button>
<div aria-hidden="true"
aria-labelledby="contact-edit-dialog-title"
aria-labelledby="contact-edit-dialog-#{contact.contactId}-title"
class="modal fade"
id="contact-edit-dialog"
id="contact-edit-dialog-#{contact.contactId}"
tabindex="-1">
<div class="modal-dialog">
<form class="modal-content">
<form action="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@sciproject-description/contacts/edit/#{contact.contactId}"
class="modal-content"
method="post">
<div class="modal-header">
<h4 class="modal-title"
id="contact-edit-dialog-title">
id="contact-edit-dialog-#{contact.contactId}-title">
#{SciProjectMessageBundle['contacts.edit.title']}
</h4>
<button
@ -155,7 +158,7 @@
inputId="type-edit"
label="#{SciProjectMessageBundle['contacts.edit.type.label']}"
name="type"
value="#{contact.contactType}"
/>
</div>
<div class="modal-footer">
@ -175,11 +178,11 @@
</td>
<td>
<libreccm:deleteDialog
actionTarget="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@sciproject-description/contacts/remove/#{contact.contactId}"
actionTarget="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@sciproject-description/contacts/#{contact.contactId}/remove"
buttonText="#{SciProjectMessageBundle['contacts.delete.label']}"
cancelLabel="#{SciProjectMessageBundle['contacts.delete.cancel']}"
confirmLabel="#{SciProjectMessageBundle['contacts.delete.confirm']}"
dialogId="contact-delete-dialog"
dialogId="contact-delete-dialog-#{contact.contactId}"
dialogTitle="#{SciProjectMessageBundle['contacts.delete.title']}"
message="#{SciProjectMessageBundle.getMessage('contacts.delete.message', [contact.contactable, contact.contactType])}"

View File

@ -79,11 +79,11 @@ contacts.cols.contactable=Contact
contacts.cols.type=Type
contacts.cols.actions=Actions
contacts.edit.label=Edit
contacts.edit.title=Add a contact
contacts.edit.title=Edit contact
contacts.edit.cancel=Cancel
contacts.edit.type.help=The type of the contact.
contacts.edit.type.label=Type
contacts.edit.submit=Add
contacts.edit.submit=Save
contacts.delete.label=Remove
contacts.delete.cancel=Cancel
contacts.delete.confirm=Remove
@ -177,3 +177,4 @@ contacts.order.save.inprogress=Saving...
contacts.order.save=Save order
contacts.sort.errors.general=Error sorting contacts.
contacts.sort.errors.save=Failed to save contacts order.
contact.add.title=Add contact

View File

@ -79,11 +79,11 @@ contacts.cols.contactable=Kontakt
contacts.cols.type=Typ
contacts.cols.actions=Aktionen
contacts.edit.label=Bearbeiten
contacts.edit.title=Kontakt hinzuf\u00fcgen
contacts.edit.title=Kontakt bearbeiten
contacts.edit.cancel=Abbrechen
contacts.edit.type.help=Der Typ des Kontaktes.
contacts.edit.type.label=Typ
contacts.edit.submit=Hinzuf\u00fcgen
contacts.edit.submit=Speichern
contacts.delete.label=Entfernen
contacts.delete.cancel=Abbrechen
contacts.delete.confirm=Entfernen
@ -177,3 +177,4 @@ contacts.order.save.inprogress=Speichern...
contacts.order.save=Sortierung speichern
contacts.sort.errors.general=Fehler f\u00fcr Sortierung der Kontakte.
contacts.sort.errors.save=Fehler beim Speichern der Sortierung der Kontakte.
contact.add.title=Kontakt hinzuf\u00fcgen