XHTML for editing the properties of a collected volume.

pull/1/head
Jens Pelzetter 2022-07-23 13:58:55 +02:00
parent 5e47f19dee
commit cdf9ff8d94
7 changed files with 243 additions and 116 deletions

View File

@ -9,10 +9,20 @@ import java.util.Comparator;
public class ArticleInCollectedVolumeRow
implements Comparable<ArticleInCollectedVolumeRow> {
private String articleUuid;
private String title;
private String chapter;
public String getArticleUuid() {
return articleUuid;
}
public void setArticleUuid(final String articleUuid) {
this.articleUuid = articleUuid;
}
public String getTitle() {
return title;
}

View File

@ -279,6 +279,7 @@ public class CollectedVolumePropertiesStep
) {
final ArticleInCollectedVolumeRow row
= new ArticleInCollectedVolumeRow();
row.setArticleUuid(article.getUuid());
row.setTitle(
globalizationHelper.getValueFromLocalizedString(
article.getTitle()

View File

@ -1,5 +1,7 @@
package org.scientificcms.publications.ui.contenttypes;
import org.scientificcms.publications.ArticleInCollectedVolume;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
@ -25,6 +27,8 @@ public class CollectedVolumePropertiesStepModel {
this.articles = new ArrayList<>(articles);
}
public String getArticleType() {
return ArticleInCollectedVolume.class.getName();
}
}

View File

@ -0,0 +1,85 @@
<!DOCTYPE html [<!ENTITY times '&#215;'>]>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:bootstrap="http://xmlns.jcp.org/jsf/composite/components/bootstrap"
xmlns:c="http://xmlns.jcp.org/jsp/jstl/core"
xmlns:libreccm="http://xmlns.jcp.org/jsf/composite/components/libreccm"
xmlns:librecms="http://xmlns.jcp.org/jsf/composite/components/librecms"
xmlns:scicms="http://xmlns.jcp.org/jsf/composite/components/scicms"
xmlns:ui="http://xmlns.jcp.org/jsf/facelets">
<ui:composition template="/WEB-INF/views/org/scientificcms/contenttypes/ui/edit-publication-with-publisher.xhtml">
<ui:param name="authoringStep"
value="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@collectedvolume-basicproperties" />
<ui:param name="authoringStepTitle"
value="#{SciPublicationsUiMessageBundle.getMessage('collectedvolume.basicproperties.header', [SciCmsPublicationPropertiesStepModel.name])}" />
<ui:define name="publicationWithPublisherProperties">
<c:if test="#{CmsSelectedDocumentModel.canEdit}">
<scicms:publicationPickerButton
buttonText="#{SciPublicationsUiMessageBundle['collectedvolume.basicproperties.articles.add.label']}"
publicationPickerId="article-picker"
/>
<scicms:publicationPicker
actionUrl="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@collectedvolume-basicproperties/articles"
baseUrl="#{SciCmsPublicationPropertiesStepModel.baseUrl}"
contentSection="#{ContentSectionModel.sectionName}"
formParamName="articleIdentifier"
publicationPickerId="article-picker"
publicationType="#{SciCmsCollectedVolumePropertiesStepModel.articleType}"
/>
</c:if>
<c:choose>
<c:when test="#{SciCmsCollectedVolumePropertiesStepModel.articles.isEmpty()}">
<p>#{SciPublicationsUiMessageBundle['collectedvolume.aricles.none']}</p>
</c:when>
<c:otherwise>
<table class="articles-table">
<thead>
<tr>
<th>#{SciPublicationsUiMessageBundle['collectedvolume.basicproperties.articles.title']}</th>
<th>#{SciPublicationsUiMessageBundle['collectedvolume.basicproperties.articles.chapter']}</th>
<th colspan="2">
#{SciPublicationsUiMessageBundle['collectedvolume.basicproperties.articles.actions']}
</th>
</tr>
</thead>
<tbody>
<c:forEach items="#{SciCmsCollectedVolumePropertiesStepModel.articles}"
var="article">
<tr>
<td>#{article.title}</td>
<td>#{article.chapter}</td>
<td>
<a class="btn btn-secondary"
href="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@articleincollectedvolume-basicproperties">
<bootstrap:svgIcon icon="pen" />
<span class="sr-only">
#{SciPublicationsUiMessageBundle['collectedvolume.basicproperties.articles.actions.edit']}
</span>
</a>
</td>
<td>
<libreccm:deleteDialog
actionTarget="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@collectedvolume-basicproperties/articles/#{article.articleUuid}/remove"
buttonText="#{SciPublicationsUiMessageBundle['collectedvolume.basicproperties.articles.actions.remove']}"
cancelLabel="#{SciPublicationsUiMessageBundle['collectedvolume.basicproperties.articles.actions.remove.cancel']}"
confirmLabel="#{SciPublicationsUiMessageBundle['collectedvolume.basicproperties.articles.actions.remove.confirm']}"
dialogId="article-#{article.articleUuid}-remove-dialog"
dialogTitle="#{SciPublicationsUiMessageBundle['collectedvolume.basicproperties.articles.actions.remove.title']}"
message="#{SciPublicationsUiMessageBundle.getMessage('collectedvolume.basicproperties.articles.actions.remove.message', [SciCmsPublicationPropertiesStepModel.name, article.title])}"
/>
</td>
</tr>
</c:forEach>
</tbody>
</table>
</c:otherwise>
</c:choose>
</ui:define>
</ui:composition>
</html>

View File

@ -261,11 +261,13 @@
name="editor"
/>
</librecms:assetPicker>
<c:choose>
<c:when test="#{SciCmsPublicationPropertiesStepModel.authors.isEmpty()}">
<p>#{SciPublicationsUiMessageBundle['basicproperties.authors.none']}</p>
</c:when>
<c:otherwise>
</c:if>
<c:choose>
<c:when test="#{SciCmsPublicationPropertiesStepModel.authors.isEmpty()}">
<p>#{SciPublicationsUiMessageBundle['basicproperties.authors.none']}</p>
</c:when>
<c:otherwise>
<c:if test="#{CmsSelectedDocumentModel.canEdit}">
<button class="btn btn-secondary authors-save-order-button"
disabled="disabled"
type="button">
@ -280,116 +282,117 @@
</span>
<span>#{SciPublicationsUiMessageBundle['authors.order.save']}</span>
</button>
<table id="authors-table"
data-saveUrl="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@publication-authors/save-order">
<thead>
<tr>
<th>#{SciPublicationsUiMessageBundle['basicproperties.authors.table.name']}</th>
<th>
#{SciPublicationsUiMessageBundle['basicproperties.authors.table.editor']}
</th>
<th colspan="2">
#{SciPublicationsUiMessageBundle['basicproperties.authors.table.actions']}
</th>
</tr>
</thead>
<tbody>
<c:forEach items="#{SciCmsPublicationPropertiesStepModel.authors}"
var="author">
<tr class="publication-author"
id="#{author.authorshipId}"
data-id="#{author.authorshipId}">
<td>
<button class="btn btn-secondary cms-sort-handle mr-2"
type="button">
<bootstrap:svgIcon icon="arrows-move" />
<span class="sr-only">#{SciPublicationsUiMessageBundle['basicproperties.authors.move']}</span>
</button>
#{author.authorName}
</td>
<td>
<c:choose>
<c:when test="#{author.editor}">
#{SciPublicationsUiMessageBundle['basicproperties.authors.table.editor.yes']}
</c:when>
<c:otherwise>
#{SciPublicationsUiMessageBundle['basicproperties.authors.table.editor.no']}
</c:otherwise>
</c:choose>
</td>
<td>
<button class="btn btn-secondary"
data-toggle="modal"
data-target="#authorship-edit-#{author.authorshipUuid}"
type="button">
<bootstrap:svgIcon icon="pen" />
<span class="sr-only">
#{SciPublicationsUiMessageBundle['basicproperties.authors.edit.label']}
</span>
</button>
<div aria-hidden="true"
aria-labelledby="authorship-edit-#{author.authorshipUuid}-title"
class="modal fade"
id="authorship-edit-#{author.authorshipUuid}"
tabindex="-1">
<div class="modal-dialog">
<form action="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@#{SciCmsPublicationPropertiesStepModel.editStepUrlFragment}/authors/#{author.authorshipUuid}"
class="modal-content"
method="post">
<div class="modal-header">
<h4 class="modal-title"
id="authorship-edit-#{author.authorshipUuid}-title">
#{SciPublicationsUiMessageBundle.getMessage('basicproperties.authors.editdialog.title', [author.authorName])}
</h4>
<button aria-label="{SciPublicationsUiMessageBundle['basicproperties.authors.editdialog.cancel']}"
class="close"
data-dismiss="modal"
type="button">
<bootstrap:svgIcon icon="x" />
</button>
</div>
<div class="modal-body">
<bootstrap:formCheck
checked="#{author.editor}"
inputId="#{author.authorshipUuid}-editor"
label="#{SciPublicationsUiMessageBundle['basicproperties.authors.editdialog.editor.label']}"
name="editor"
value="true"
/>
</div>
<div class="modal-footer">
<button class="btn btn-warning"
data-dismiss="modal"
type="button">
#{SciPublicationsUiMessageBundle['basicproperties.authors.editdialog.cancel']}
</button>
<button class="btn btn-success"
type="submit">
#{SciPublicationsUiMessageBundle['basicproperties.authors.editdialog.submit']}
</button>
</div>
</form>
</div>
</c:if>
<table id="authors-table"
data-saveUrl="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@publication-authors/save-order">
<thead>
<tr>
<th>#{SciPublicationsUiMessageBundle['basicproperties.authors.table.name']}</th>
<th>
#{SciPublicationsUiMessageBundle['basicproperties.authors.table.editor']}
</th>
<th colspan="2">
#{SciPublicationsUiMessageBundle['basicproperties.authors.table.actions']}
</th>
</tr>
</thead>
<tbody>
<c:forEach items="#{SciCmsPublicationPropertiesStepModel.authors}"
var="author">
<tr class="publication-author"
id="#{author.authorshipId}"
data-id="#{author.authorshipId}">
<td>
<button class="btn btn-secondary cms-sort-handle mr-2"
type="button">
<bootstrap:svgIcon icon="arrows-move" />
<span class="sr-only">#{SciPublicationsUiMessageBundle['basicproperties.authors.move']}</span>
</button>
#{author.authorName}
</td>
<td>
<c:choose>
<c:when test="#{author.editor}">
#{SciPublicationsUiMessageBundle['basicproperties.authors.table.editor.yes']}
</c:when>
<c:otherwise>
#{SciPublicationsUiMessageBundle['basicproperties.authors.table.editor.no']}
</c:otherwise>
</c:choose>
</td>
<td>
<button class="btn btn-secondary"
data-toggle="modal"
data-target="#authorship-edit-#{author.authorshipUuid}"
type="button">
<bootstrap:svgIcon icon="pen" />
<span class="sr-only">
#{SciPublicationsUiMessageBundle['basicproperties.authors.edit.label']}
</span>
</button>
<div aria-hidden="true"
aria-labelledby="authorship-edit-#{author.authorshipUuid}-title"
class="modal fade"
id="authorship-edit-#{author.authorshipUuid}"
tabindex="-1">
<div class="modal-dialog">
<form action="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@#{SciCmsPublicationPropertiesStepModel.editStepUrlFragment}/authors/#{author.authorshipUuid}"
class="modal-content"
method="post">
<div class="modal-header">
<h4 class="modal-title"
id="authorship-edit-#{author.authorshipUuid}-title">
#{SciPublicationsUiMessageBundle.getMessage('basicproperties.authors.editdialog.title', [author.authorName])}
</h4>
<button aria-label="{SciPublicationsUiMessageBundle['basicproperties.authors.editdialog.cancel']}"
class="close"
data-dismiss="modal"
type="button">
<bootstrap:svgIcon icon="x" />
</button>
</div>
<div class="modal-body">
<bootstrap:formCheck
checked="#{author.editor}"
inputId="#{author.authorshipUuid}-editor"
label="#{SciPublicationsUiMessageBundle['basicproperties.authors.editdialog.editor.label']}"
name="editor"
value="true"
/>
</div>
<div class="modal-footer">
<button class="btn btn-warning"
data-dismiss="modal"
type="button">
#{SciPublicationsUiMessageBundle['basicproperties.authors.editdialog.cancel']}
</button>
<button class="btn btn-success"
type="submit">
#{SciPublicationsUiMessageBundle['basicproperties.authors.editdialog.submit']}
</button>
</div>
</form>
</div>
</td>
<td>
<libreccm:deleteDialog
actionTarget="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@#{SciCmsPublicationPropertiesStepModel.editStepUrlFragment}/authors/#{author.authorshipUuid}/remove"
buttonText="#{SciPublicationsUiMessageBundle['basicproperties.authors.remove.label']}"
cancelLabel="#{SciPublicationsUiMessageBundle['basicproperties.authors.remove.cancel']}"
confirmLabel="#{SciPublicationsUiMessageBundle['basicproperties.authors.remove.confirm']}"
dialogId="remove-author-#{author.authorshipUuid}"
dialogTitle="#{SciPublicationsUiMessageBundle.getMessage('basicproperties.authors.remove.title', [author.authorName])}"
message="#{SciPublicationsUiMessageBundle.getMessage('basicproperties.authors.remove.text', [author.authorName])}"
/>
</td>
</tr>
</c:forEach>
</tbody>
</table>
</c:otherwise>
</c:choose>
</c:if>
</div>
</td>
<td>
<libreccm:deleteDialog
actionTarget="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@#{SciCmsPublicationPropertiesStepModel.editStepUrlFragment}/authors/#{author.authorshipUuid}/remove"
buttonText="#{SciPublicationsUiMessageBundle['basicproperties.authors.remove.label']}"
cancelLabel="#{SciPublicationsUiMessageBundle['basicproperties.authors.remove.cancel']}"
confirmLabel="#{SciPublicationsUiMessageBundle['basicproperties.authors.remove.confirm']}"
dialogId="remove-author-#{author.authorshipUuid}"
dialogTitle="#{SciPublicationsUiMessageBundle.getMessage('basicproperties.authors.remove.title', [author.authorName])}"
message="#{SciPublicationsUiMessageBundle.getMessage('basicproperties.authors.remove.text', [author.authorName])}"
/>
</td>
</tr>
</c:forEach>
</tbody>
</table>
</c:otherwise>
</c:choose>
<ui:insert name="publicationProperties" />
</ui:define>

View File

@ -434,3 +434,15 @@ collectedvolume.createstep.description=Create a new collected volume.
collectedvolume.createform.submit=Create collected volume
articleincollectedvolume.createform.submit=Create article in collected volume
articleincollectedvolume.createform.title=Create a new article in a collected volume
collectedvolume.basicproperties.header=Edit basic properties of collected volume {0}
collectedvolume.basicproperties.articles.add.label=Add article to collected volume
collectedvolume.aricles.none=This collected volume has no articles yet.
collectedvolume.basicproperties.articles.title=Title
collectedvolume.basicproperties.articles.chapter=Chapter
collectedvolume.basicproperties.articles.actions=Actions
collectedvolume.basicproperties.articles.actions.edit=Edit article
collectedvolume.basicproperties.articles.actions.remove=Remove article
collectedvolume.basicproperties.articles.actions.cancel=Cancel
collectedvolume.basicproperties.articles.actions.remove.confirm=Remove article
collectedvolume.basicproperties.articles.actions.remove.title=Confirm removal of article
collectedvolume.basicproperties.articles.actions.remove.message=Are you sure to remove the article {1} from the collected volume {0}.

View File

@ -434,3 +434,15 @@ collectedvolume.createstep.description=Einen neuen Sammelband anlegen.
collectedvolume.createform.submit=Sammelband anlegen
articleincollectedvolume.createform.submit=Sammelbandartikel anlegen
articleincollectedvolume.createform.title=Einen neuen Sammelbandartikel anlegen
collectedvolume.basicproperties.header=Basiseigenschaften des Sammelbands {0} bearbeiten
collectedvolume.basicproperties.articles.add.label=Einen Artikel zum Sammelband hinzuf\u00fcgen
collectedvolume.aricles.none=Diesem Sammelband wurden noch keine Publikationen zugeordnet.
collectedvolume.basicproperties.articles.title=Titel
collectedvolume.basicproperties.articles.chapter=Kapitel
collectedvolume.basicproperties.articles.actions=Aktionen
collectedvolume.basicproperties.articles.actions.edit=Artikel bearbeiten
collectedvolume.basicproperties.articles.actions.remove=Artikel entfernen
collectedvolume.basicproperties.articles.actions.cancel=Abbrechen
collectedvolume.basicproperties.articles.actions.remove.confirm=Artikel entfernen
collectedvolume.basicproperties.articles.actions.remove.title=Entfernen des Artikels best\u00e4tigen
collectedvolume.basicproperties.articles.actions.remove.message=Sind Sie sicher dass Sie den Artikel {1} aus dem Sammelband {0} entfernen wollen?