From 72fd38bef7b1b1bad4af15ff0a185f332e9a2dd5 Mon Sep 17 00:00:00 2001 From: Jens Pelzetter Date: Sun, 15 Nov 2020 14:36:02 +0100 Subject: [PATCH] Composite components for UI --- .../categories/CategorySystemsController.java | 30 +- .../components/bootstrap/svgIcon.xhtml | 18 + .../libreccm/localizedStringEditor.xhtml | 504 ++++++++++++++++++ .../categories/categorysystem-details.xhtml | 371 +++---------- .../org/libreccm/ui/AdminBundle.properties | 4 +- .../org/libreccm/ui/AdminBundle_de.properties | 2 +- 6 files changed, 614 insertions(+), 315 deletions(-) create mode 100644 ccm-core/src/main/resources/META-INF/resources/components/bootstrap/svgIcon.xhtml create mode 100644 ccm-core/src/main/resources/META-INF/resources/components/libreccm/localizedStringEditor.xhtml diff --git a/ccm-core/src/main/java/org/libreccm/ui/admin/categories/CategorySystemsController.java b/ccm-core/src/main/java/org/libreccm/ui/admin/categories/CategorySystemsController.java index 960982742..866b47262 100644 --- a/ccm-core/src/main/java/org/libreccm/ui/admin/categories/CategorySystemsController.java +++ b/ccm-core/src/main/java/org/libreccm/ui/admin/categories/CategorySystemsController.java @@ -252,12 +252,11 @@ public class CategorySystemsController { } @POST - @Path("/{categorySystemIdentifier}/title/add") + @Path("/{identifier}/title/add") @AuthorizationRequired @Transactional(Transactional.TxType.REQUIRED) public String addTitle( - @PathParam("categorySystemIdentifier") - final String categorySystemIdentifier, + @PathParam("identifier") final String categorySystemIdentifier, @FormParam("locale") final String localeParam, @FormParam("value") final String value ) { @@ -309,12 +308,11 @@ public class CategorySystemsController { } @POST - @Path("/{categorySystemIdentifier}/title/${locale}/edit") + @Path("/{identifier}/title/${locale}/edit") @AuthorizationRequired @Transactional(Transactional.TxType.REQUIRED) public String editTitle( - @PathParam("categorySystemIdentifier") - final String categorySystemIdentifier, + @PathParam("identifier") final String categorySystemIdentifier, @PathParam("locale") final String localeParam, @FormParam("value") final String value ) { @@ -366,12 +364,11 @@ public class CategorySystemsController { } @POST - @Path("/{categorySystemIdentifier}/title/${locale}/remove") + @Path("/{identifier}/title/${locale}/remove") @AuthorizationRequired @Transactional(Transactional.TxType.REQUIRED) public String removeTitle( - @PathParam("categorySystemIdentifier") - final String categorySystemIdentifier, + @PathParam("identifier") final String categorySystemIdentifier, @PathParam("locale") final String localeParam, @FormParam("confirmed") final String confirmed @@ -427,12 +424,11 @@ public class CategorySystemsController { } @POST - @Path("/{categorySystemIdentifier}/description/add") + @Path("/{identifier}/description/add") @AuthorizationRequired @Transactional(Transactional.TxType.REQUIRED) public String addDescription( - @PathParam("categorySystemIdentifier") - final String categorySystemIdentifier, + @PathParam("identifier") final String categorySystemIdentifier, @FormParam("locale") final String localeParam, @FormParam("value") final String value ) { @@ -485,13 +481,12 @@ public class CategorySystemsController { @POST @Path( - "categorysystems/{categorySystemIdentifier}/description/${locale}/edit" + "categorysystems/{identifier}/description/${locale}/edit" ) @AuthorizationRequired @Transactional(Transactional.TxType.REQUIRED) public String editDescription( - @PathParam("categorySystemIdentifier") - final String categorySystemIdentifier, + @PathParam("identifier") final String categorySystemIdentifier, @PathParam("locale") final String localeParam, @FormParam("value") final String value ) { @@ -544,12 +539,11 @@ public class CategorySystemsController { @POST @Path( - "categorysystems/{categorySystemIdentifier}/description/${locale}/remove") + "categorysystems/{identifier}/description/${locale}/remove") @AuthorizationRequired @Transactional(Transactional.TxType.REQUIRED) public String removeDescription( - @PathParam("categorySystemIdentifier") - final String categorySystemIdentifier, + @PathParam("identifier") final String categorySystemIdentifier, @PathParam("locale") final String localeParam, @FormParam("confirmed") final String confirmed diff --git a/ccm-core/src/main/resources/META-INF/resources/components/bootstrap/svgIcon.xhtml b/ccm-core/src/main/resources/META-INF/resources/components/bootstrap/svgIcon.xhtml new file mode 100644 index 000000000..c8751f49e --- /dev/null +++ b/ccm-core/src/main/resources/META-INF/resources/components/bootstrap/svgIcon.xhtml @@ -0,0 +1,18 @@ + + + + + + + + + + + diff --git a/ccm-core/src/main/resources/META-INF/resources/components/libreccm/localizedStringEditor.xhtml b/ccm-core/src/main/resources/META-INF/resources/components/libreccm/localizedStringEditor.xhtml new file mode 100644 index 000000000..c2d96cc5d --- /dev/null +++ b/ccm-core/src/main/resources/META-INF/resources/components/libreccm/localizedStringEditor.xhtml @@ -0,0 +1,504 @@ +]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +

#{cc.attrs.title}

+
+ +

#{cc.attrs.title}

+
+ +

#{cc.attrs.title}

+
+ +

#{cc.attrs.title}

+
+ +
#{cc.attrs.title}
+
+ +
#{cc.attrs.title}
+
+ +
#{cc.attrs.title}
+
+
+ +
+
+ +
+ +
+
+ + +

+ #{cc.attrs.emptyText} +

+
+ + + + + + + + + + + + + + + + + + + +
#{cc.attrs.tableLocaleHeading}#{cc.attrs.tableValueHeading}#{cc.attrs.tableActionsHeading}
#{entry.key}#{entry.value} +
+ +
+ +
+
+ +
+ +
+
+
+
+
+ + diff --git a/ccm-core/src/main/resources/WEB-INF/views/org/libreccm/ui/admin/categories/categorysystem-details.xhtml b/ccm-core/src/main/resources/WEB-INF/views/org/libreccm/ui/admin/categories/categorysystem-details.xhtml index 9687a8c00..1597d3401 100644 --- a/ccm-core/src/main/resources/WEB-INF/views/org/libreccm/ui/admin/categories/categorysystem-details.xhtml +++ b/ccm-core/src/main/resources/WEB-INF/views/org/libreccm/ui/admin/categories/categorysystem-details.xhtml @@ -1,9 +1,10 @@ ]> + xmlns:libreccm="http://xmlns.jcp.org/jsf/composite/components/libreccm" + xmlns:ui="http://xmlns.jcp.org/jsf/facelets"> @@ -77,272 +78,79 @@ -

- #{AdminMessages['categorysystems.details.title.heading']} -

- -
-
- -
- -
-
- - -

- #{AdminMessages['categorysystems.details.title.none']} -

-
- - - - - - - - - - - - - - - - - - - -
#{AdminMessages['categorysystems.details.title.table.headings.locale']}#{AdminMessages['categorysystems.details.title.table.headings.value']}#{AdminMessages['categorysystems.details.title.table.headings.actions']}
- #{entry.key} - - #{entry.value} - -
- -
- -
-
- -
- -
-
-
- -

+

#{AdminMessages['categorysystems.details.owners.heading']} @@ -606,12 +399,7 @@ data-target="#categorysystem-owner-add" data-toggle="modal" type="button"> - - - + #{AdminMessages['categorysystems.details.owners.add']} @@ -720,12 +508,7 @@ data-target="#categorysystem-owner-#{owner.uuid}-remove" data-toggle="modal" type="button"> - - - + #{AdminMessages['categorysystems.details.owners.remove']} diff --git a/ccm-core/src/main/resources/org/libreccm/ui/AdminBundle.properties b/ccm-core/src/main/resources/org/libreccm/ui/AdminBundle.properties index 1b6a15cbf..7def2b78c 100644 --- a/ccm-core/src/main/resources/org/libreccm/ui/AdminBundle.properties +++ b/ccm-core/src/main/resources/org/libreccm/ui/AdminBundle.properties @@ -315,7 +315,7 @@ categorysystems.details.title.edit.dialog.value.help=The new value for the title categorysystems.details.title.edit.dialog.submit=Save categorysystems.details.title.table.actions.remove.dialog.title=Remove localized title categorysystems.details.title.remove.dialog.close=Cancel -categorysystems.details.title.remove.dialog.message=Are your sure to delete title "{1}" for locale? +categorysystems.details.title.remove.dialog.message=Are your sure to remove the following localized value for the title: categorysystems.details.title.remove.dialog.submit=Delete title categorysystems.details.description.add.dialog.title=Add localized description categorysystems.details.description.add.dialog.locale.label=Locale @@ -331,7 +331,7 @@ categorysystems.details.description.edit.dialog.value.help=The localized descrip categorysystems.details.description.edit.dialog.submit=Save categorysystems.details.description.table.actions.remove.dialog.title=Removed localized description categorysystems.details.description.remove.dialog.close=Cancel -categorysystems.details.description.remove.dialog.message=Are your sure to delete the description for locale {0}? +categorysystems.details.description.remove.dialog.message=Are your sure to delete the following localized value for the description: categorysystems.details.description.remove.dialog.submit=Remove localized description categorysstems.details.owner.add.dialog.title=Add Application Mapping categorysystems.details.owner.add.dialog.application.label=Application diff --git a/ccm-core/src/main/resources/org/libreccm/ui/AdminBundle_de.properties b/ccm-core/src/main/resources/org/libreccm/ui/AdminBundle_de.properties index 65ffc1657..8dd46c8eb 100644 --- a/ccm-core/src/main/resources/org/libreccm/ui/AdminBundle_de.properties +++ b/ccm-core/src/main/resources/org/libreccm/ui/AdminBundle_de.properties @@ -315,7 +315,7 @@ categorysystems.details.title.edit.dialog.value.help=Neuer Wert f\u00fcr den Tit categorysystems.details.title.edit.dialog.submit=Speichern categorysystems.details.title.table.actions.remove.dialog.title=Lokalisierten Titel entfernen categorysystems.details.title.remove.dialog.close=Abbrechen -categorysystems.details.title.remove.dialog.message=Sind Sie sicher, dass Sie den Titel "{1}" f\u00fcr die Sprache {0} entfernen wollen? +categorysystems.details.title.remove.dialog.message=Sind Sie sicher, dass die folgende Lokalisierung f\u00fcr den Titel entfernen wollen? categorysystems.details.title.remove.dialog.submit=Titel entfernen categorysystems.details.description.add.dialog.title=Lokalisierte Beschreibung hinzuf\u00fcgen categorysystems.details.description.add.dialog.locale.label=Sprache