Enable supervisors to get an overview of forum activity #3
@ -20,7 +20,7 @@ public abstract class AbstractReadStatePanel extends Panel {
|
|||||||
@Override
|
@Override
|
||||||
public void onClick(final Optional<AjaxRequestTarget> target) {
|
public void onClick(final Optional<AjaxRequestTarget> target) {
|
||||||
target.ifPresent(t -> {
|
target.ifPresent(t -> {
|
||||||
toggleReadState(t);
|
onFlagClick(t);
|
||||||
t.add(icon);
|
t.add(icon);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -33,7 +33,7 @@ public abstract class AbstractReadStatePanel extends Panel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected abstract boolean isRead();
|
protected abstract boolean isRead();
|
||||||
protected abstract void toggleReadState(final AjaxRequestTarget target);
|
protected abstract void onFlagClick(final AjaxRequestTarget target);
|
||||||
|
|
||||||
public static final String TOGGLE = "toggle";
|
public static final String TOGGLE = "toggle";
|
||||||
static final String ICON = "icon";
|
static final String ICON = "icon";
|
||||||
|
@ -31,7 +31,7 @@ public class ThreadReadStatePanel extends AbstractReadStatePanel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void toggleReadState(final AjaxRequestTarget target) {
|
protected void onFlagClick(final AjaxRequestTarget target) {
|
||||||
boolean read = isRead();
|
boolean read = isRead();
|
||||||
basicForumService.setThreadRead(SciProSession.get().getUser(), model.getObject(), !read);
|
basicForumService.setThreadRead(SciProSession.get().getUser(), model.getObject(), !read);
|
||||||
|
|
||||||
|
@ -117,7 +117,7 @@ public class NotificationDataPanel extends Panel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void toggleReadState(final AjaxRequestTarget target) {
|
protected void onFlagClick(final AjaxRequestTarget target) {
|
||||||
Notification notification = rowModel.getObject();
|
Notification notification = rowModel.getObject();
|
||||||
notification.setUnread(!notification.isUnread());
|
notification.setUnread(!notification.isUnread());
|
||||||
notificationService.save(notification);
|
notificationService.save(notification);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user