diff --git a/src/main/java/org/olat/repository/_i18n/LocalStrings_de.properties b/src/main/java/org/olat/repository/_i18n/LocalStrings_de.properties index 841127f680fd13c9f7a3ac640c27ea054434e3eb..6b98813ae1005e84cf532ff04ca7458ddea62921 100644 --- a/src/main/java/org/olat/repository/_i18n/LocalStrings_de.properties +++ b/src/main/java/org/olat/repository/_i18n/LocalStrings_de.properties @@ -373,6 +373,7 @@ new.wiki=Wiki erstellen new.wiki.intro=Neues Wiki erstellen no.lifecycle=Keine Einschr\u00E4nkung no.catalog.entries=Diese Resource wurde noch nicht im Katalog registriert. \r\n\r\n Verwenden Sie den "In Katalog einf\u00FCgen" Button in der Toolbar, um die Resource auf einer bestimmten Katalog-Ebenen hinzuzuf\u00FCgen. Der Katalog erlaubt es dem Benutzer je nach Zugriffskonfiguration nach bestimmten Eintr\u00E4gen zu suchen. Sie k\u00F6nnen die Resource auf mehreren Katalog-Ebenen hinzuf\u00FCgen. +info.catalog.entries=Verwenden Sie den "In Katalog einf\u00FCgen" Button in der Toolbar, um die Resource auf einer bestimmten Katalog-Ebenen hinzuzuf\u00FCgen. Der Katalog erlaubt es dem Benutzer je nach Zugriffskonfiguration nach bestimmten Eintr\u00E4gen zu suchen. Sie k\u00F6nnen die Resource auf mehreren Katalog-Ebenen hinzuf\u00FCgen. nomembers=XXX No members notification.mail.added.body=*** Das ist eine automatisch generierte Nachricht. Bitte antworten Sie nicht auf diese Nachricht *** \n\nSie wurden von {0} {1} ({2}) in einen Kurs eingeladen\: \n\nKursname\: $coursename\nBeschreibung\: $coursedescription\n\nBei Fragen kontaktieren Sie bitte {0} {1} ({2}). notification.mail.added.subject=Kurs $coursename diff --git a/src/main/java/org/olat/repository/_i18n/LocalStrings_en.properties b/src/main/java/org/olat/repository/_i18n/LocalStrings_en.properties index 001992d5545646e6ad89fc6f822d61b7555b3e1f..a35e1a54d8748bfca30d2ae74aa489c39be7c38c 100644 --- a/src/main/java/org/olat/repository/_i18n/LocalStrings_en.properties +++ b/src/main/java/org/olat/repository/_i18n/LocalStrings_en.properties @@ -369,7 +369,8 @@ new.test.intro=Create new test new.wiki=Create wiki new.wiki.intro=Create new wiki no.lifecycle=No limitation -no.catalog.entries=This resource has not been added to the catalog yet. \r\n\r\n Use the "Add to catalog" button in the toolbar above to add the resource to a specific level in the catalog. The catalog allows users to browse for available resources depending on th resource access configuration. You can add the resource to multiple catalog levels. +no.catalog.entries=This resource has not been added to the catalog yet. \r\n\r\n Use the "Add to catalog" button in the toolbar above to add the resource to a specific level in the catalog. The catalog allows users to browse for available resources depending on th resource access configuration. You can add the resource to multiple catalog levels. +info.catalog.entries=Use the "Add to catalog" button in the toolbar above to add the resource to a specific level in the catalog. The catalog allows users to browse for available resources depending on th resource access configuration. You can add the resource to multiple catalog levels. nomembers=XXX No members notification.mail.added.body=*** This is an automatically generated message. Please do not answer to this message *** \r\n\r\nYou have been added by {0} {1} ({2}) to a course\:\r\n\r\nCourse name\: $coursename\r\nDescription\: $coursedescription\r\n\r\nIf you have questions regarding this action, please contact {0} {1} ({2}). notification.mail.added.subject=Course $coursename diff --git a/src/main/java/org/olat/repository/ui/author/CatalogSettingsController.java b/src/main/java/org/olat/repository/ui/author/CatalogSettingsController.java index 00e6b86b6ad858f96d60176fe569153c689f786b..61b59717018f35b8e61a519e451c46227d8795e9 100644 --- a/src/main/java/org/olat/repository/ui/author/CatalogSettingsController.java +++ b/src/main/java/org/olat/repository/ui/author/CatalogSettingsController.java @@ -29,6 +29,7 @@ import org.olat.core.gui.components.form.flexible.FormItemContainer; import org.olat.core.gui.components.form.flexible.elements.FlexiTableElement; import org.olat.core.gui.components.form.flexible.impl.FormBasicController; import org.olat.core.gui.components.form.flexible.impl.FormEvent; +import org.olat.core.gui.components.form.flexible.impl.FormLayoutContainer; import org.olat.core.gui.components.form.flexible.impl.elements.table.DefaultFlexiColumnModel; import org.olat.core.gui.components.form.flexible.impl.elements.table.DefaultFlexiTableDataModel; import org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableColumnModel; @@ -62,12 +63,14 @@ public class CatalogSettingsController extends FormBasicController { private FlexiTableElement tableEl; private CategoriesListModel model; private TooledStackedPanel stackPanel; + private FormLayoutContainer catalog; private CloseableModalController cmc; private Controller catalogAdddController; private RepositoryEntry entry; - + protected String velocity_root; + @Autowired private CatalogManager catalogManager; @@ -77,6 +80,7 @@ public class CatalogSettingsController extends FormBasicController { setTranslator(Util.createPackageTranslator(RepositoryService.class, getLocale(), getTranslator())); this.entry = entry; this.stackPanel = stackPanel; + this.velocity_root = Util.getPackageVelocityRoot(this.getClass()); initForm(ureq); stackPanel.pushController(translate("details.categoriesheader"), this); @@ -91,6 +95,11 @@ public class CatalogSettingsController extends FormBasicController { @Override protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) { + String catalogPage = velocity_root + "/catalog_info.html"; + catalog = FormLayoutContainer.createCustomFormLayout("info", getTranslator(), catalogPage); + catalog.setRootForm(mainForm); + formLayout.add(catalog); + FlexiTableColumnModel columnsModel = FlexiTableDataModelFactory.createFlexiTableColumnModel(); columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel("catalog.path", 0)); columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel("remove", translate("remove"), "remove")); @@ -101,7 +110,10 @@ public class CatalogSettingsController extends FormBasicController { tableEl.setCustomizeColumns(false); tableEl.setVisible(true); if (catalogEntries.size() == 0) { + catalog.contextPut("hasContent", false); tableEl.setEmtpyTableMessageKey("no.catalog.entries"); + } else { + catalog.contextPut("hasContent", true); } } @@ -190,6 +202,12 @@ public class CatalogSettingsController extends FormBasicController { private void updateTable() { List<CatalogEntry> catalogEntries = catalogManager.getCatalogCategoriesFor(entry); model.setObjects(catalogEntries); + if (catalogEntries.size() == 0) { + catalog.contextPut("hasContent", false); + tableEl.setEmtpyTableMessageKey("no.catalog.entries"); + } else { + catalog.contextPut("hasContent", true); + } tableEl.reset(); } diff --git a/src/main/java/org/olat/repository/ui/author/_content/catalog_info.html b/src/main/java/org/olat/repository/ui/author/_content/catalog_info.html new file mode 100644 index 0000000000000000000000000000000000000000..1838f2ea6ff3ddb49b909629489cc771cd822cb5 --- /dev/null +++ b/src/main/java/org/olat/repository/ui/author/_content/catalog_info.html @@ -0,0 +1,5 @@ +#if ($hasContent) +<div class="o_info"> +$r.translate("info.catalog.entries") +</div> +#end \ No newline at end of file