Skip to content
Snippets Groups Projects
Commit f6d9f911 authored by fkiefer's avatar fkiefer
Browse files

OO-2753 include info message when catalog entries are available

parent 48317537
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
......@@ -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
......
......@@ -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();
}
......
#if ($hasContent)
<div class="o_info">
$r.translate("info.catalog.entries")
</div>
#end
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment