Forum Message UI Improvement (Thesis Board #3470) #61

Merged
tozh4728 merged 20 commits from 3470-forum-msg-ui-improvement into develop 2024-12-19 15:28:23 +01:00
2 changed files with 49 additions and 6 deletions
Showing only changes of commit 499aaaa402 - Show all commits

View File

@ -41,6 +41,12 @@
</div>
<table class="table table-striped table-hover" wicket:id="dp"></table>
<!-- todo: reconsider name of this id, parentMarkupId, needs improvement. -->
<wicket:fragment wicket:id="parentMarkupId">
<wicket:container wicket:id="flag"></wicket:container>
<wicket:container wicket:id="counter"></wicket:container>
</wicket:fragment>
</wicket:panel>
</body>
</html>

View File

@ -1,5 +1,6 @@
package se.su.dsv.scipro.supervisor.panels;
import jakarta.inject.Inject;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.ajax.form.AjaxFormChoiceComponentUpdatingBehavior;
import org.apache.wicket.ajax.markup.html.form.AjaxCheckBox;
@ -12,13 +13,18 @@ import org.apache.wicket.extensions.markup.html.repeater.util.SortableDataProvid
import org.apache.wicket.markup.html.form.EnumChoiceRenderer;
import org.apache.wicket.markup.html.form.Form;
import org.apache.wicket.markup.html.form.LambdaChoiceRenderer;
import org.apache.wicket.markup.html.panel.Fragment;
import org.apache.wicket.markup.html.panel.Panel;
import org.apache.wicket.markup.repeater.Item;
import org.apache.wicket.model.IModel;
import org.apache.wicket.model.LambdaModel;
import org.apache.wicket.model.LoadableDetachableModel;
import org.apache.wicket.model.Model;
import se.su.dsv.scipro.components.*;
import se.su.dsv.scipro.components.AjaxCheckBoxMultipleChoice;
import se.su.dsv.scipro.components.BootstrapRadioChoice;
import se.su.dsv.scipro.components.ExportableDataPanel;
import se.su.dsv.scipro.components.ListAdapterModel;
import se.su.dsv.scipro.components.TemporalColumn;
import se.su.dsv.scipro.components.datatables.MultipleUsersColumn;
import se.su.dsv.scipro.components.datatables.UserColumn;
import se.su.dsv.scipro.dataproviders.FilteredDataProvider;
@ -27,6 +33,7 @@ import se.su.dsv.scipro.datatables.project.ProjectTitleColumn;
import se.su.dsv.scipro.forum.ProjectForumService;
import se.su.dsv.scipro.forum.pages.threaded.SupervisorThreadedForumPage;
import se.su.dsv.scipro.forum.panels.AbstractReadStatePanel;
import se.su.dsv.scipro.forum.panels.NumberOfMessagesPanel;
import se.su.dsv.scipro.project.Project;
import se.su.dsv.scipro.project.ProjectService;
import se.su.dsv.scipro.project.ProjectStatus;
@ -39,7 +46,6 @@ import se.su.dsv.scipro.system.ProjectType;
import se.su.dsv.scipro.system.ProjectTypeService;
import se.su.dsv.scipro.system.User;
import jakarta.inject.Inject;
import java.util.ArrayList;
import java.util.List;
@ -194,21 +200,52 @@ public class SupervisorMyProjectsPanel extends Panel {
@Override
public void populateItem(Item<ICellPopulator<Project>> item, String id, IModel<Project> projectModel) {
/*
item.add(new AbstractReadStatePanel(id, AbstractReadStatePanel.ShowReadStateTooltip.ENABLED) {
@Override
protected boolean isRead() {
return !projectForumService.hasUnreadThreads(
projectModel.getObject(),
return !projectForumService.hasUnreadThreads(projectModel.getObject(),
SciProSession.get().getUser());
}
@Override
protected void onFlagClick(AjaxRequestTarget target) {
setResponsePage(
SupervisorThreadedForumPage.class,
setResponsePage(SupervisorThreadedForumPage.class,
SupervisorThreadedForumPage.getPageParameters(projectModel.getObject()));
}
});
*/
//WebMarkupContainer container = new WebMarkupContainer(id);
//container.setOutputMarkupId(true);
/*
container
*/
//container.add(new NumberOfMessagesPanel("counter"));
//item.add(container);
// todo: reconsider name of this id, needs to be improved.
Fragment fragment = new Fragment(id, "parentMarkupId", SupervisorMyProjectsPanel.this);
fragment.add(new AbstractReadStatePanel("flag", AbstractReadStatePanel.ShowReadStateTooltip.ENABLED) {
@Override
protected boolean isRead() {
return !projectForumService.hasUnreadThreads(projectModel.getObject(),
SciProSession.get().getUser());
}
@Override
protected void onFlagClick(AjaxRequestTarget target) {
setResponsePage(SupervisorThreadedForumPage.class,
SupervisorThreadedForumPage.getPageParameters(projectModel.getObject()));
}
});
fragment.add(new NumberOfMessagesPanel("counter"));
item.add(fragment);
}
}
}