added new datatable with the authors confirmed supervisor provided ideas under My project idea history
This commit is contained in:
parent
1744c2ffa0
commit
03f7dc1fa7
src/main/java/se/su/dsv/scipro/project
@ -4,7 +4,10 @@
|
||||
<wicket:extend>
|
||||
<div class="prepend-top span-24 last">
|
||||
<div class="span-24" wicket:id="feedback"></div>
|
||||
<div class="span-14" wicket:id="periodPanel"></div>
|
||||
<div class="span-16" wicket:id="myIdeasPanel"></div>
|
||||
<div class="span-16 prepend-top" wicket:id="mySupervisorIdeasPanel"></div>
|
||||
<div class="span-20" wicket:id="noIdeas">No project ideas to show</div>
|
||||
</div>
|
||||
</wicket:extend>
|
||||
</body>
|
||||
|
@ -1,21 +1,46 @@
|
||||
package se.su.dsv.scipro.project.pages;
|
||||
|
||||
import org.apache.wicket.PageParameters;
|
||||
import org.apache.wicket.markup.html.WebMarkupContainer;
|
||||
import org.apache.wicket.markup.html.panel.FeedbackPanel;
|
||||
import org.apache.wicket.spring.injection.annot.SpringBean;
|
||||
|
||||
import se.su.dsv.scipro.components.menuhighlighting.MenuHighlightProjectIdeas;
|
||||
import se.su.dsv.scipro.data.dataobjects.Student;
|
||||
import se.su.dsv.scipro.match.dao.interfaces.ProjectIdeaDao;
|
||||
import se.su.dsv.scipro.project.panels.MyProjectIdeasPanel;
|
||||
import se.su.dsv.scipro.project.panels.MySupervisorIdeasPanel;
|
||||
import se.su.dsv.scipro.project.panels.ProjectIdeaPeriodPanel;
|
||||
import se.su.dsv.scipro.security.auth.Authorization;
|
||||
import se.su.dsv.scipro.security.auth.roles.Roles;
|
||||
import se.su.dsv.scipro.springdata.services.StudentService;
|
||||
import se.su.dsv.scipro.springdata.services.SupervisorIdeaService;
|
||||
|
||||
@Authorization(authorizedRoles={Roles.STUDENT})
|
||||
public class MyProjectIdeasPage extends AbstractProjectIdeaPage implements MenuHighlightProjectIdeas{
|
||||
|
||||
@SpringBean
|
||||
private SupervisorIdeaService ideaService;
|
||||
@SpringBean
|
||||
private StudentService studentService;
|
||||
@SpringBean
|
||||
private ProjectIdeaDao projectIdeaDao;
|
||||
|
||||
public MyProjectIdeasPage(PageParameters pp) {
|
||||
super(pp);
|
||||
add(new FeedbackPanel("feedback"));
|
||||
add(new MyProjectIdeasPanel("myIdeasPanel", getUser()));
|
||||
|
||||
Student author = studentService.findByUser(getUser());
|
||||
add(new ProjectIdeaPeriodPanel("periodPanel"));
|
||||
add(new MyProjectIdeasPanel("myIdeasPanel", getUser()).setVisible(showIdeas(author)));
|
||||
add(new MySupervisorIdeasPanel("mySupervisorIdeasPanel", author).setVisible(ideaService.hasTakenIdeas(getUser(), true)));
|
||||
add(new WebMarkupContainer("noIdeas").setVisible(!showIdeas(author)&&!ideaService.hasTakenIdeas(getUser(), true)));
|
||||
}
|
||||
|
||||
private boolean showIdeas(Student author) {
|
||||
ProjectIdeaDao.Params params = new ProjectIdeaDao.Params();
|
||||
params.setAuthor(author);
|
||||
long ideaNumber = projectIdeaDao.countProjectIdeas(params);
|
||||
return ideaNumber!=0;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -10,8 +10,7 @@
|
||||
<button class="right" wicket:id="closeButton">Close</button>
|
||||
</div>
|
||||
<div class="span-24 last" wicket:id="container">
|
||||
<div class="span-14" wicket:id="periodPanel"></div>
|
||||
|
||||
<div class="span-20 append-bottom"><b>My submitted ideas</b></div>
|
||||
<table class="rounded-corner" >
|
||||
<thead>
|
||||
<tr>
|
||||
|
@ -42,7 +42,6 @@ public class MyProjectIdeasPanel extends Panel {
|
||||
super(id);
|
||||
|
||||
container = new WebMarkupContainer("container");
|
||||
container.add(new ProjectIdeaPeriodPanel("periodPanel"));
|
||||
setUpDialog();
|
||||
setUpDataView(user);
|
||||
add(container);
|
||||
|
@ -0,0 +1,11 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns:wicket="http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd">
|
||||
<body>
|
||||
<wicket:panel>
|
||||
<div wicket:id="container">
|
||||
<div class="span-20"><b>My confirmed supervisor provided ideas</b></div>
|
||||
<div class="span-24" wicket:id="dataTable"></div>
|
||||
</div>
|
||||
</wicket:panel>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,73 @@
|
||||
package se.su.dsv.scipro.project.panels;
|
||||
|
||||
import java.util.Iterator;
|
||||
|
||||
import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;
|
||||
import org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn;
|
||||
import org.apache.wicket.markup.html.WebMarkupContainer;
|
||||
import org.apache.wicket.markup.html.panel.Panel;
|
||||
import org.apache.wicket.model.Model;
|
||||
import org.apache.wicket.spring.injection.annot.SpringBean;
|
||||
|
||||
import se.su.dsv.scipro.data.dataobjects.Student;
|
||||
import se.su.dsv.scipro.datatables.DateColumn;
|
||||
import se.su.dsv.scipro.datatables.GenericDataPanel;
|
||||
import se.su.dsv.scipro.match.dataobject.Idea.IdeaStatus;
|
||||
import se.su.dsv.scipro.match.dataobject.SupervisorIdea;
|
||||
import se.su.dsv.scipro.springdata.services.GenericService;
|
||||
import se.su.dsv.scipro.springdata.services.StudentService;
|
||||
import se.su.dsv.scipro.springdata.services.SupervisorIdeaService;
|
||||
|
||||
public class MySupervisorIdeasPanel extends Panel {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@SpringBean
|
||||
private SupervisorIdeaService ideaService;
|
||||
@SpringBean
|
||||
private StudentService studentService;
|
||||
|
||||
public MySupervisorIdeasPanel(String id, Student author) {
|
||||
super(id);
|
||||
WebMarkupContainer container = new WebMarkupContainer("container");
|
||||
addDataTable(container, author);
|
||||
add(container);
|
||||
|
||||
}
|
||||
|
||||
private void addDataTable(WebMarkupContainer container, final Student author) {
|
||||
container.add(new GenericDataPanel<SupervisorIdea>("dataTable") {
|
||||
|
||||
private static final long serialVersionUID = 7719436073391722494L;
|
||||
|
||||
@Override
|
||||
public GenericService<SupervisorIdea, Long> getService() {
|
||||
return ideaService;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSortString() {
|
||||
return "dateCreated";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterator<SupervisorIdea> getIterator() {
|
||||
return ideaService.findIdeas(IdeaStatus.TAKEN, author, true).iterator();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IColumn[] getColumns() {
|
||||
IColumn[] columns = new IColumn[4];
|
||||
columns[0] = new PropertyColumn<SupervisorIdea>(Model.of("Project level"), "projectClass", "projectClass");
|
||||
columns[1] = new PropertyColumn<SupervisorIdea>(Model.of("Title"), "title", "title");
|
||||
columns[2] = new PropertyColumn<SupervisorIdea>(Model.of("Author(s)"), "ideaParticipations");
|
||||
columns[3] = new DateColumn<SupervisorIdea>(Model.of("Start date"), "applicationPeriod.courseStartDate");
|
||||
return columns;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user