Fixed remaining links in @admin

Jens Pelzetter 2021-01-14 20:14:52 +01:00
parent fe52bfb1b8
commit 573af19c5f
15 changed files with 85 additions and 62 deletions

View File

@ -47,6 +47,11 @@ public class ContentSectionApplicationController
@Inject @Inject
private ContentSectionRepository sectionRepository; private ContentSectionRepository sectionRepository;
@Override
public String getControllerLink() {
return "applications/content-sections";
}
@GET @GET
@Path("/") @Path("/")
@AuthorizationRequired @AuthorizationRequired

View File

@ -28,4 +28,6 @@ public interface ApplicationController {
String getApplication(); String getApplication();
String getControllerLink();
} }

View File

@ -32,6 +32,8 @@ import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import javax.enterprise.context.RequestScoped; import javax.enterprise.context.RequestScoped;
import javax.enterprise.inject.Any;
import javax.enterprise.inject.Instance;
import javax.inject.Inject; import javax.inject.Inject;
import javax.mvc.Controller; import javax.mvc.Controller;
import javax.mvc.Models; import javax.mvc.Models;
@ -49,6 +51,10 @@ import javax.ws.rs.Path;
@Path("/applications") @Path("/applications")
public class ApplicationsController { public class ApplicationsController {
@Inject
@Any
private Instance<ApplicationController> applicationControllers;
@Inject @Inject
private ApplicationManager appManager; private ApplicationManager appManager;
@ -115,17 +121,24 @@ public class ApplicationsController {
final Class<? extends ApplicationController> controllerClass final Class<? extends ApplicationController> controllerClass
= applicationType.applicationController(); = applicationType.applicationController();
if (!DefaultApplicationController.class.isAssignableFrom( final Instance<? extends ApplicationController> controllerInstance
controllerClass = applicationControllers.select(controllerClass);
)) {
item.setControllerLink( if (hasControllerLink(controllerClass, controllerInstance)) {
String.format( final ApplicationController controller = controllerInstance.get();
"%s#getApplication", item.setControllerLink(controller.getControllerLink());
controllerClass.getSimpleName())
);
} }
return item; return item;
} }
private boolean hasControllerLink(
final Class<? extends ApplicationController> controllerClass,
final Instance<? extends ApplicationController> controllerInstance
) {
return !DefaultApplicationController.class
.isAssignableFrom(controllerClass)
&& controllerInstance.isResolvable();
}
} }

View File

@ -40,4 +40,9 @@ public class DefaultApplicationController implements ApplicationController {
return ""; return "";
} }
@Override
public String getControllerLink() {
return "application";
}
} }

View File

@ -448,7 +448,7 @@ public class CategoriesController {
* @return Redirect to the details page of the category. * @return Redirect to the details page of the category.
*/ */
@POST @POST
@Path("/{identifier}/title/{locale}/edit") @Path("/{identifier}/title/edit/{locale}")
@AuthorizationRequired @AuthorizationRequired
@Transactional(Transactional.TxType.REQUIRED) @Transactional(Transactional.TxType.REQUIRED)
public String editTitle( public String editTitle(
@ -505,7 +505,7 @@ public class CategoriesController {
* @return Redirect to the details page of the category. * @return Redirect to the details page of the category.
*/ */
@POST @POST
@Path("/{identifier}/title/{locale}/remove") @Path("/{identifier}/title/remove/{locale}")
@AuthorizationRequired @AuthorizationRequired
@Transactional(Transactional.TxType.REQUIRED) @Transactional(Transactional.TxType.REQUIRED)
public String removeTitle( public String removeTitle(
@ -621,7 +621,7 @@ public class CategoriesController {
* @return Redirect to the details page of the category. * @return Redirect to the details page of the category.
*/ */
@POST @POST
@Path("/{identifier}/description/{locale}/edit") @Path("/{identifier}/description/edit/{locale}")
@Consumes(MediaType.APPLICATION_FORM_URLENCODED) @Consumes(MediaType.APPLICATION_FORM_URLENCODED)
@AuthorizationRequired @AuthorizationRequired
@Transactional(Transactional.TxType.REQUIRED) @Transactional(Transactional.TxType.REQUIRED)
@ -679,7 +679,7 @@ public class CategoriesController {
* @return Redirect to the details page of the category. * @return Redirect to the details page of the category.
*/ */
@POST @POST
@Path("/{identifier}/description/{locale}/remove") @Path("/{identifier}/description/remove/{locale}")
@AuthorizationRequired @AuthorizationRequired
@Transactional(Transactional.TxType.REQUIRED) @Transactional(Transactional.TxType.REQUIRED)
public String removeDescription( public String removeDescription(

View File

@ -354,7 +354,7 @@ public class CategorySystemsController {
* @return Redirect to the details page of the category system. * @return Redirect to the details page of the category system.
*/ */
@POST @POST
@Path("/{identifier}/title/${locale}/edit") @Path("/{identifier}/title/edit/{locale}")
@AuthorizationRequired @AuthorizationRequired
@Transactional(Transactional.TxType.REQUIRED) @Transactional(Transactional.TxType.REQUIRED)
public String editTitle( public String editTitle(
@ -414,18 +414,18 @@ public class CategorySystemsController {
* *
* @param categorySystemIdentifier Identifier of the category system. * @param categorySystemIdentifier Identifier of the category system.
* @param localeParam The locale of the title. * @param localeParam The locale of the title.
* @param confirmed Has the deletion been confirmed?
* *
* @return Redirect to the details page of the category system. * @return Redirect to the details page of the category system.
*/ */
@POST @POST
@Path("/{identifier}/title/${locale}/remove") @Path("/{identifier}/title/remove/{locale}")
@AuthorizationRequired @AuthorizationRequired
@Transactional(Transactional.TxType.REQUIRED) @Transactional(Transactional.TxType.REQUIRED)
public String removeTitle( public String removeTitle(
@PathParam("identifier") final String categorySystemIdentifier, @PathParam("identifier") final String categorySystemIdentifier,
@PathParam("locale") final String localeParam, @PathParam("locale") final String localeParam,
@FormParam("confirmed") @FormParam("confirmed") final String confirmed
final String confirmed
) { ) {
final Identifier identifier = identifierParser.parseIdentifier( final Identifier identifier = identifierParser.parseIdentifier(
@ -553,7 +553,7 @@ public class CategorySystemsController {
*/ */
@POST @POST
@Path( @Path(
"categorysystems/{identifier}/description/${locale}/edit" "categorysystems/{identifier}/description/edit/{locale}"
) )
@AuthorizationRequired @AuthorizationRequired
@Transactional(Transactional.TxType.REQUIRED) @Transactional(Transactional.TxType.REQUIRED)
@ -619,7 +619,7 @@ public class CategorySystemsController {
*/ */
@POST @POST
@Path( @Path(
"categorysystems/{identifier}/description/${locale}/remove") "categorysystems/{identifier}/description/remove/{locale}")
@AuthorizationRequired @AuthorizationRequired
@Transactional(Transactional.TxType.REQUIRED) @Transactional(Transactional.TxType.REQUIRED)
public String removeDescription( public String removeDescription(
@ -770,7 +770,7 @@ public class CategorySystemsController {
* *
* @param categorySystemIdentifier Identifier of teh category system. * @param categorySystemIdentifier Identifier of teh category system.
* @param applicationUuid UUID of the owner to remove. * @param applicationUuid UUID of the owner to remove.
* @param confirmed Was the deletion confirmed by the user? * @param confirmed Was the deletion confirmed by the user?
* *
* @return Redirect to the details page of the category system. * @return Redirect to the details page of the category system.
*/ */

View File

@ -6,7 +6,7 @@
<cc:interface shortDescription="A editor component for localized strings."> <cc:interface shortDescription="A editor component for localized strings.">
<cc:attribute name="addMethod" <cc:attribute name="addMethod"
required="true" required="true"
shortDescription="Name of the endpoiint to which the POST request from the add form is send. The URL must contain a path parameter named identifier. Two values are submitted: locale and value." shortDescription="URL of the endpoint for adding localized string values."
type="String" /> type="String" />
<cc:attribute name="addButtonLabel" <cc:attribute name="addButtonLabel"
default="Add" default="Add"
@ -76,7 +76,7 @@
type="String" /> type="String" />
<cc:attribute name="editMethod" <cc:attribute name="editMethod"
required="true" required="true"
shortDescription="Name of the endpoiint to which the POST request from the edit form is send. The URL must contain a path parameter named identifier, and a path parameter named locale. The new value is submitted as form parameter with the name value." shortDescription="URL of the endpoint for editing/updating a value. The value of the locale to update is added after the provided URL, eg. /de for updating the german value."
type="String" /> type="String" />
<cc:attribute name="hasUnusedLocales" <cc:attribute name="hasUnusedLocales"
required="true" required="true"
@ -127,7 +127,7 @@
type="String" /> type="String" />
<cc:attribute name="removeMethod" <cc:attribute name="removeMethod"
required="true" required="true"
shortDescription="Name of the endpoint to which the POST request from the remove form is send. The URL must contain a path parameter named identifier, and a path parameter named locale." shortDescription="URL of the endpoint for remvoving a value. The locale of the value to remove is added to the end of the URL. Eg. /de for removing the value for the locale de."
type="String" /> type="String" />
<cc:attribute name="tableActionsHeading" <cc:attribute name="tableActionsHeading"
default="Actions" default="Actions"
@ -207,7 +207,7 @@
id="#{cc.attrs.editorId}-dialog" id="#{cc.attrs.editorId}-dialog"
tabindex="-1"> tabindex="-1">
<div class="modal-dialog"> <div class="modal-dialog">
<form action="#{mvc.uri(cc.attrs.addMethod, { 'identifier': cc.attrs.objectIdentifier})}" <form action="#{cc.attrs.addMethod}"
class="modal-content" class="modal-content"
method="post"> method="post">
<div class="modal-header"> <div class="modal-header">
@ -346,7 +346,7 @@
tabindex="-1"> tabindex="-1">
<div class="modal-dialog"> <div class="modal-dialog">
<form accept-charset="UTF-8" <form accept-charset="UTF-8"
action="#{mvc.uri(cc.attrs.editMethod, { 'identifier': cc.attrs.objectIdentifier, 'locale': entry.key })}" action="#{cc.attrs.editMethod}/#{entry.key}"
class="modal-content" class="modal-content"
method="post"> method="post">
<div class="modal-header"> <div class="modal-header">
@ -444,7 +444,7 @@
id="#{cc.attrs.editorId}-#{entry.key}-remove-dialog" id="#{cc.attrs.editorId}-#{entry.key}-remove-dialog"
tabindex="-1"> tabindex="-1">
<div class="modal-dialog"> <div class="modal-dialog">
<form action="#{mvc.uri(cc.attrs.removeMethod, {'identifier': cc.attrs.objectIdentifier, 'locale': entry.key})}" <form action="#{cc.attrs.removeMethod}/#{entry.key}"
class="modal-content" class="modal-content"
method="post"> method="post">
<div class="modal-header"> <div class="modal-header">

View File

@ -24,7 +24,7 @@
<h2> <h2>
<c:choose> <c:choose>
<c:when test="#{type.controllerLink != null}"> <c:when test="#{type.controllerLink != null}">
<a href="#{mvc.uri(type.controllerLink)}">#{type.title}</a> <a href="#{mvc.basePath}/#{type.controllerLink}">#{type.title}</a>
</c:when> </c:when>
<c:otherwise> <c:otherwise>
<span>#{type.title}</span> <span>#{type.title}</span>

View File

@ -110,7 +110,7 @@
</a> </a>
</div> </div>
<libreccm:localizedStringEditor addMethod="CategoriesController#addTitle" <libreccm:localizedStringEditor addMethod="#{mvc.basePath}/categorymanager/categories/#{CategoryDetailsModel.identifier}/title/add"
addButtonLabel="#{AdminMessages['categories.details.title.add']}" addButtonLabel="#{AdminMessages['categories.details.title.add']}"
addDialogCancelLabel="#{AdminMessages['categories.details.title.add.dialog.close']}" addDialogCancelLabel="#{AdminMessages['categories.details.title.add.dialog.close']}"
addDialogLocaleSelectHelp="#{AdminMessages['categories.details.title.add.dialog.locale.help']}" addDialogLocaleSelectHelp="#{AdminMessages['categories.details.title.add.dialog.locale.help']}"
@ -125,7 +125,7 @@
editDialogTitle="#{AdminMessages['categories.details.title.table.actions.edit.dialog.title']}" editDialogTitle="#{AdminMessages['categories.details.title.table.actions.edit.dialog.title']}"
editDialogValueHelp="#{AdminMessages['categories.details.title.edit.dialog.value.help']}" editDialogValueHelp="#{AdminMessages['categories.details.title.edit.dialog.value.help']}"
editDialogValueLabel="#{AdminMessages['categories.details.title.edit.dialog.value.label']}" editDialogValueLabel="#{AdminMessages['categories.details.title.edit.dialog.value.label']}"
editMethod="CategoriesController#editTitle" editMethod="#{mvc.basePath}/categorymanager/categories/#{CategoryDetailsModel.identifier}/title/edit"
editorId="category-title" editorId="category-title"
emptyText="#{AdminMessages['categories.details.title.none']}" emptyText="#{AdminMessages['categories.details.title.none']}"
hasUnusedLocales="#{CategoryDetailsModel.hasUnusedTitleLocales()}" hasUnusedLocales="#{CategoryDetailsModel.hasUnusedTitleLocales()}"
@ -143,7 +143,7 @@
unusedLocales="#{CategoryDetailsModel.unusedTitleLocales}" unusedLocales="#{CategoryDetailsModel.unusedTitleLocales}"
values="#{CategoryDetailsModel.title}" /> values="#{CategoryDetailsModel.title}" />
<libreccm:localizedStringEditor addMethod="CategoriesController#addDescription" <libreccm:localizedStringEditor addMethod="#{mvc.basePath}/categorymanager/categories/#{CategoryDetailsModel.identifier}/description/add"
addButtonLabel="#{AdminMessages['categories.details.description.add']}" addButtonLabel="#{AdminMessages['categories.details.description.add']}"
addDialogCancelLabel="#{AdminMessages['categories.details.description.add.dialog.close']}" addDialogCancelLabel="#{AdminMessages['categories.details.description.add.dialog.close']}"
addDialogLocaleSelectHelp="#{AdminMessages['categories.details.description.add.dialog.locale.help']}" addDialogLocaleSelectHelp="#{AdminMessages['categories.details.description.add.dialog.locale.help']}"
@ -158,7 +158,7 @@
editDialogTitle="#{AdminMessages['categories.details.description.table.actions.edit.dialog.title']}" editDialogTitle="#{AdminMessages['categories.details.description.table.actions.edit.dialog.title']}"
editDialogValueHelp="#{AdminMessages['categories.details.description.edit.dialog.value.help']}" editDialogValueHelp="#{AdminMessages['categories.details.description.edit.dialog.value.help']}"
editDialogValueLabel="#{AdminMessages['categories.details.description.edit.dialog.value.label']}" editDialogValueLabel="#{AdminMessages['categories.details.description.edit.dialog.value.label']}"
editMethod="CategoriesController#editDescription" editMethod="#{mvc.basePath}/categorymanager/categories/#{CategoryDetailsModel.identifier}/description/edit"
editorId="category-description" editorId="category-description"
emptyText="#{AdminMessages['categories.details.description.none']}" emptyText="#{AdminMessages['categories.details.description.none']}"
hasUnusedLocales="#{CategoryDetailsModel.hasUnusedDescriptionLocales()}" hasUnusedLocales="#{CategoryDetailsModel.hasUnusedDescriptionLocales()}"
@ -168,7 +168,7 @@
removeDialogSubmitLabel="#{AdminMessages['categories.details.description.remove.dialog.submit']}" removeDialogSubmitLabel="#{AdminMessages['categories.details.description.remove.dialog.submit']}"
removeDialogText="#{AdminMessages['categories.details.description.remove.dialog.message']}" removeDialogText="#{AdminMessages['categories.details.description.remove.dialog.message']}"
removeDialogTitle="#{AdminMessages['categories.details.description.table.actions.remove.dialog.title']}" removeDialogTitle="#{AdminMessages['categories.details.description.table.actions.remove.dialog.title']}"
removeMethod="CategoriesController#removeDescription" removeMethod="#{mvc.basePath}/categorymanager/categories/#{CategoryDetailsModel.identifier}/description/remove"
tableActionsHeading="#{AdminMessages['categories.details.description.table.headings.actions']}" tableActionsHeading="#{AdminMessages['categories.details.description.table.headings.actions']}"
tableLocaleHeading="#{AdminMessages['categories.details.description.table.headings.locale']}" tableLocaleHeading="#{AdminMessages['categories.details.description.table.headings.locale']}"
tableValueHeading="#{AdminMessages['categories.details.description.table.headings.value']}" tableValueHeading="#{AdminMessages['categories.details.description.table.headings.value']}"

View File

@ -86,7 +86,7 @@
</a> </a>
</div> </div>
<libreccm:localizedStringEditor addMethod="CategorySystemsController#addTitle" <libreccm:localizedStringEditor addMethod="#{mvc.basePath}/categorymanager/categorysystems/#{CategorySystemDetailsModel.identifier}/title/add"
addButtonLabel="#{AdminMessages['categorysystems.details.title.add']}" addButtonLabel="#{AdminMessages['categorysystems.details.title.add']}"
addDialogCancelLabel="#{AdminMessages['categorysystems.details.title.add.dialog.close']}" addDialogCancelLabel="#{AdminMessages['categorysystems.details.title.add.dialog.close']}"
addDialogLocaleSelectHelp="#{AdminMessages['categorysystems.details.title.add.dialog.locale.help']}" addDialogLocaleSelectHelp="#{AdminMessages['categorysystems.details.title.add.dialog.locale.help']}"
@ -101,7 +101,7 @@
editDialogTitle="#{AdminMessages['categorysystems.details.title.table.actions.edit.dialog.title']}" editDialogTitle="#{AdminMessages['categorysystems.details.title.table.actions.edit.dialog.title']}"
editDialogValueHelp="#{AdminMessages['categorysystems.details.title.edit.dialog.value.help']}" editDialogValueHelp="#{AdminMessages['categorysystems.details.title.edit.dialog.value.help']}"
editDialogValueLabel="#{AdminMessages['categorysystems.details.title.edit.dialog.value.label']}" editDialogValueLabel="#{AdminMessages['categorysystems.details.title.edit.dialog.value.label']}"
editMethod="CategorySystemsController#editTitle" editMethod="#{mvc.basePath}/categorymanager/categorysystems/#{CategorySystemDetailsModel.identifier}/title/edit"
editorId="categorysystem-title" editorId="categorysystem-title"
emptyText="#{AdminMessages['categorysystems.details.title.none']}" emptyText="#{AdminMessages['categorysystems.details.title.none']}"
hasUnusedLocales="#{CategorySystemDetailsModel.hasUnusedTitleLocales()}" hasUnusedLocales="#{CategorySystemDetailsModel.hasUnusedTitleLocales()}"
@ -111,7 +111,7 @@
removeDialogSubmitLabel="#{AdminMessages['categorysystems.details.title.remove.dialog.submit']}" removeDialogSubmitLabel="#{AdminMessages['categorysystems.details.title.remove.dialog.submit']}"
removeDialogText="#{AdminMessages['categorysystems.details.title.remove.dialog.message']}" removeDialogText="#{AdminMessages['categorysystems.details.title.remove.dialog.message']}"
removeDialogTitle="#{AdminMessages['categorysystems.details.title.table.actions.remove.dialog.title']}" removeDialogTitle="#{AdminMessages['categorysystems.details.title.table.actions.remove.dialog.title']}"
removeMethod="CategorySystemsController#removeTitle" removeMethod="#{mvc.basePath}/categorymanager/categorysystems/#{CategorySystemDetailsModel.identifier}/title/remove"
tableActionsHeading="#{AdminMessages['categorysystems.details.title.table.headings.actions']}" tableActionsHeading="#{AdminMessages['categorysystems.details.title.table.headings.actions']}"
tableLocaleHeading="#{AdminMessages['categorysystems.details.title.table.headings.locale']}" tableLocaleHeading="#{AdminMessages['categorysystems.details.title.table.headings.locale']}"
tableValueHeading="#{AdminMessages['categorysystems.details.title.table.headings.value']}" tableValueHeading="#{AdminMessages['categorysystems.details.title.table.headings.value']}"
@ -119,7 +119,7 @@
unusedLocales="#{CategorySystemDetailsModel.unusedTitleLocales}" unusedLocales="#{CategorySystemDetailsModel.unusedTitleLocales}"
values="#{CategorySystemDetailsModel.title}" /> values="#{CategorySystemDetailsModel.title}" />
<libreccm:localizedStringEditor addMethod="CategorySystemsController#addDescription" <libreccm:localizedStringEditor addMethod="#{mvc.basePath}/categorymanager/categorysystems/#{CategorySystemDetailsModel.identifier}/description/add"
addButtonLabel="#{AdminMessages['categorysystems.details.description.add']}" addButtonLabel="#{AdminMessages['categorysystems.details.description.add']}"
addDialogCancelLabel="#{AdminMessages['categorysystems.details.description.add.dialog.close']}" addDialogCancelLabel="#{AdminMessages['categorysystems.details.description.add.dialog.close']}"
addDialogLocaleSelectHelp="#{AdminMessages['categorysystems.details.description.add.dialog.locale.help']}" addDialogLocaleSelectHelp="#{AdminMessages['categorysystems.details.description.add.dialog.locale.help']}"
@ -134,7 +134,7 @@
editDialogTitle="#{AdminMessages['categorysystems.details.description.table.actions.edit.dialog.title']}" editDialogTitle="#{AdminMessages['categorysystems.details.description.table.actions.edit.dialog.title']}"
editDialogValueHelp="#{AdminMessages['categorysystems.details.description.edit.dialog.value.help']}" editDialogValueHelp="#{AdminMessages['categorysystems.details.description.edit.dialog.value.help']}"
editDialogValueLabel="#{AdminMessages['categorysystems.details.description.edit.dialog.value.label']}" editDialogValueLabel="#{AdminMessages['categorysystems.details.description.edit.dialog.value.label']}"
editMethod="CategorySystemsController#editDescription" editMethod="#{mvc.basePath}/categorymanager/categorysystems/#{CategorySystemDetailsModel.identifier}/description/edit"
editorId="categorysystem-description" editorId="categorysystem-description"
emptyText="#{AdminMessages['categorysystems.details.description.none']}" emptyText="#{AdminMessages['categorysystems.details.description.none']}"
hasUnusedLocales="#{CategorySystemDetailsModel.hasUnusedDescriptionLocales()}" hasUnusedLocales="#{CategorySystemDetailsModel.hasUnusedDescriptionLocales()}"
@ -144,7 +144,7 @@
removeDialogSubmitLabel="#{AdminMessages['categorysystems.details.description.remove.dialog.submit']}" removeDialogSubmitLabel="#{AdminMessages['categorysystems.details.description.remove.dialog.submit']}"
removeDialogText="#{AdminMessages['categorysystems.details.description.remove.dialog.message']}" removeDialogText="#{AdminMessages['categorysystems.details.description.remove.dialog.message']}"
removeDialogTitle="#{AdminMessages['categorysystems.details.description.table.actions.remove.dialog.title']}" removeDialogTitle="#{AdminMessages['categorysystems.details.description.table.actions.remove.dialog.title']}"
removeMethod="CategorySystemsController#removeDescription" removeMethod="#{mvc.basePath}/categorymanager/categorysystems/#{CategorySystemDetailsModel.identifier}/description/remove"
tableActionsHeading="#{AdminMessages['categorysystems.details.description.table.headings.actions']}" tableActionsHeading="#{AdminMessages['categorysystems.details.description.table.headings.actions']}"
tableLocaleHeading="#{AdminMessages['categorysystems.details.description.table.headings.locale']}" tableLocaleHeading="#{AdminMessages['categorysystems.details.description.table.headings.locale']}"
tableValueHeading="#{AdminMessages['categorysystems.details.description.table.headings.value']}" tableValueHeading="#{AdminMessages['categorysystems.details.description.table.headings.value']}"

View File

@ -12,7 +12,7 @@
<ui:define name="breadcrumb"> <ui:define name="breadcrumb">
<li class="breadcrumb-item"> <li class="breadcrumb-item">
<a href="#{mvc.uri('ImExportController#getImExportDashboard')}"> <a href="#{mvc.basePath}/imexport">
#{AdminMessages['imexport.label']} #{AdminMessages['imexport.label']}
</a> </a>
</li> </li>
@ -26,7 +26,7 @@
<div class="container"> <div class="container">
<h1>#{AdminMessages['imexport.export.label']}</h1> <h1>#{AdminMessages['imexport.export.label']}</h1>
<form action="#{mvc.uri('ImExportController#exportEntities')}" <form action="#{mvc.basePath}/imexport/export"
aria-describedby="export-help" aria-describedby="export-help"
method="post"> method="post">
<p id="export-help">#{AdminMessages['imexport.export.help']}</p> <p id="export-help">#{AdminMessages['imexport.export.help']}</p>
@ -53,7 +53,7 @@
required="treu" /> required="treu" />
<a class="btn btn-warning" <a class="btn btn-warning"
href="#{mvc.uri('ImExportController#getImExportDashboard')}"> href="#{mvc.basePath}/imexport">
#{AdminMessages['imexport.export.cancel']} #{AdminMessages['imexport.export.cancel']}
</a> </a>
<button class="btn btn-success" type="submit"> <button class="btn btn-success" type="submit">

View File

@ -1,9 +1,8 @@
<!DOCTYPE html> <!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" <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:c="http://xmlns.jcp.org/jsp/jstl/core"
xmlns:h="http://xmlns.jcp.org/jsf/html" xmlns:ui="http://xmlns.jcp.org/jsf/facelets">
xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
xmlns:xlink="http://www.w3.org/1999/xlink">
<ui:composition template="/WEB-INF/views/org/libreccm/ui/admin/ccm-admin.xhtml"> <ui:composition template="/WEB-INF/views/org/libreccm/ui/admin/ccm-admin.xhtml">
<ui:param name="activePage" value="imexport" /> <ui:param name="activePage" value="imexport" />
@ -23,16 +22,12 @@
<div aria-describedby="import-card-body" <div aria-describedby="import-card-body"
class="card pt-2" class="card pt-2"
id="import-card"> id="import-card">
<svg aria-hidden="true" <bootstrap:svgIcon icon="download" />
class="card-img-top"
fill="currentColor">
<use xlink:href="#{request.contextPath}/assets/bootstrap/bootstrap-icons.svg#download" />
</svg>
<div class="card-body" <div class="card-body"
id="import-card-body"> id="import-card-body">
<h2 class="card-title"> <h2 class="card-title">
<a class="stretched-link" <a class="stretched-link"
href="#{mvc.uri('ImExportController#importEntities')}"> href="#{mvc.basePath}/imexport/import">
#{AdminMessages['import.label']} #{AdminMessages['import.label']}
</a> </a>
</h2> </h2>
@ -47,16 +42,12 @@
<div aria-describedby="export-card-body" <div aria-describedby="export-card-body"
class="card pt-2" class="card pt-2"
id="export-card"> id="export-card">
<svg aria-hidden="true" <bootstrap:svgIcon icon="download" />
class="card-img-top"
fill="currentColor">
<use xlink:href="#{request.contextPath}/assets/bootstrap/bootstrap-icons.svg#download" />
</svg>
<div class="card-body" <div class="card-body"
id="export-card-body"> id="export-card-body">
<h2 class="card-title"> <h2 class="card-title">
<a class="stretched-link" <a class="stretched-link"
href="#{mvc.uri('ImExportController#exportEntities')}"> href="#{mvc.basePath}/imexport/export">
#{AdminMessages['export.label']} #{AdminMessages['export.label']}
</a> </a>
</h2> </h2>

View File

@ -12,7 +12,7 @@
<ui:define name="breadcrumb"> <ui:define name="breadcrumb">
<li class="breadcrumb-item"> <li class="breadcrumb-item">
<a href="#{mvc.uri('ImExportController#getImExportDashboard')}"> <a href="#{mvc.basePath}/imexport">
#{AdminMessages['imexport.label']} #{AdminMessages['imexport.label']}
</a> </a>
</li> </li>
@ -26,7 +26,7 @@
<div class="container"> <div class="container">
<h1>#{AdminMessages['imexport.import.label']}</h1> <h1>#{AdminMessages['imexport.import.label']}</h1>
<form action="#{mvc.uri('ImExportController#importEntities')}" <form action="#{mvc.basePath}/imexport/import"
aria-described="import-help" aria-described="import-help"
method="post"> method="post">
<p id="import-help">#{AdminMessages['imexport.import.help']}</p> <p id="import-help">#{AdminMessages['imexport.import.help']}</p>
@ -37,7 +37,7 @@
name="archive" name="archive"
options="#{importArchives}" /> options="#{importArchives}" />
<a class="btn btn-warning" <a class="btn btn-warning"
href="#{mvc.uri('ImExportController#getImExportDashboard')}"> href="#{mvc.basePath}/imexport">
#{AdminMessages['imexport.import.cancel']} #{AdminMessages['imexport.import.cancel']}
</a> </a>
<button class="btn btn-success" type="submit"> <button class="btn btn-success" type="submit">

View File

@ -65,6 +65,11 @@ public class ShortcutsApplicationController implements ApplicationController {
return "org/libreccm/ui/admin/applications/shortcuts/shortcuts.xhtml"; return "org/libreccm/ui/admin/applications/shortcuts/shortcuts.xhtml";
} }
@Override
public String getControllerLink() {
return "applications/shortcuts";
}
@POST @POST
@Path("/add") @Path("/add")
@AuthorizationRequired @AuthorizationRequired

View File

@ -13,7 +13,9 @@
<ui:define name="breadcrumb"> <ui:define name="breadcrumb">
<li class="breadcrumb-item"> <li class="breadcrumb-item">
#{AdminMessages['applications.label']} <a href="#{mvc.basePath}/applications">
#{AdminMessages['applications.label']}
</a>
</li> </li>
<li class="breadcrumb-item active"> <li class="breadcrumb-item active">
#{ShortcutAdminMessages['application_title']} #{ShortcutAdminMessages['application_title']}
@ -25,7 +27,7 @@
<h1>#{ShortcutAdminMessages['application_title']}</h1> <h1>#{ShortcutAdminMessages['application_title']}</h1>
<div class="mb-2"> <div class="mb-2">
<bootstrap:modalForm actionTarget="#{mvc.uri('ShortcutsApplicationController#addShortcut')}" <bootstrap:modalForm actionTarget="#{mvc.basePath}/applications/shortcuts/add"
buttonIcon="plus-circle" buttonIcon="plus-circle"
buttonText="#{ShortcutAdminMessages['shortcuts.ui.admin.add_shortcut']}" buttonText="#{ShortcutAdminMessages['shortcuts.ui.admin.add_shortcut']}"
buttonTextClass="text-right" buttonTextClass="text-right"
@ -69,7 +71,7 @@
<td>#{shortcut.urlKey}</td> <td>#{shortcut.urlKey}</td>
<td>#{shortcut.redirect}</td> <td>#{shortcut.redirect}</td>
<td> <td>
<bootstrap:modalForm actionTarget="#{mvc.uri('ShortcutsApplicationController#updateShortcut', { 'shortcutId': shortcut.shortcutId })}" <bootstrap:modalForm actionTarget="#{mvc.basePath}/applications/shortcuts/#{shortcut.shortcutId}/edit"
buttonIcon="pen" buttonIcon="pen"
buttonText="#{ShortcutAdminMessages['shortcuts.ui.admin.shortcuts_table.edit']}" buttonText="#{ShortcutAdminMessages['shortcuts.ui.admin.shortcuts_table.edit']}"
buttonTextClass="text-center" buttonTextClass="text-center"
@ -102,7 +104,7 @@
</bootstrap:modalForm> </bootstrap:modalForm>
</td> </td>
<td> <td>
<libreccm:deleteDialog actionTarget="#{mvc.uri('ShortcutsApplicationController#removeShortcut', { 'shortcutId': shortcut.shortcutId })}" <libreccm:deleteDialog actionTarget="#{mvc.basePath}/applications/shortcuts/#{shortcut.shortcutId}/remove"
buttonText="#{ShortcutAdminMessages['shortcuts.ui.admin.shortcuts_table.delete']}" buttonText="#{ShortcutAdminMessages['shortcuts.ui.admin.shortcuts_table.delete']}"
cancelLabel="#{ShortcutAdminMessages['shortcuts.ui.admin.delete_dialog.cancel']}" cancelLabel="#{ShortcutAdminMessages['shortcuts.ui.admin.delete_dialog.cancel']}"
confirmLabel="#{ShortcutAdminMessages['shortcuts.ui.admin.delete_dialog.confirm']}" confirmLabel="#{ShortcutAdminMessages['shortcuts.ui.admin.delete_dialog.confirm']}"