Merge branch 'release20120113'
This commit is contained in:
commit
dcb0afb493
resources/db_update_scripts
src
main/java/se/su/dsv/scipro
activityplan/panels
admin
pages/match
panels
data/dataobjects
match
dao/jpa
panel
project/panels
schedule/templates/panels
supervisor
test/java/se/su/dsv/scipro
checklists/panels
match/dao
3
resources/db_update_scripts/update_db_2012-01-13.sql
Normal file
3
resources/db_update_scripts/update_db_2012-01-13.sql
Normal file
@ -0,0 +1,3 @@
|
||||
projectscheduleevent name öka antalet chars till 500 istället för 50
|
||||
|
||||
mail_event_recipients gör primary av en kombination av båda fälten istället för bara det ena
|
@ -22,17 +22,23 @@
|
||||
<div wicket:id="editDialog">
|
||||
<div wicket:id="addScheduleEventPanel"></div>
|
||||
</div>
|
||||
<div><a href="#" wicket:id="createLink">create new activity>></a></div>
|
||||
|
||||
<!-- <div><a href="#" wicket:id="addFromTemplateLink">add predefined activity plan using an activity plan template>></a></div> -->
|
||||
<div><button wicket:id="addFromTemplateLink">add predefined activity plan using an activity plan template</button></div>
|
||||
|
||||
<!-- <div><a href="#" wicket:id="createLink">create new activity>></a></div> -->
|
||||
<div><button wicket:id="createLink">create new activity</button></div>
|
||||
|
||||
<div wicket:id="addDialog">
|
||||
<div wicket:id="addScheduleEventPanel"></div>
|
||||
</div>
|
||||
<div><a href="#" wicket:id="addFromTemplateLink">add predefined activity plan using an activity plan template>></a></div>
|
||||
|
||||
|
||||
<div wicket:id="saveAsTemplateDialog">
|
||||
<div wicket:id="saveAsTemplatePanel"></div>
|
||||
</div>
|
||||
<div><a href="#" wicket:id="saveAsTemplateLink">save as activity plan template>></a></div>
|
||||
<!-- <div><a href="#" wicket:id="saveAsTemplateLink">save as activity plan template>></a></div> -->
|
||||
<div><button wicket:id="saveAsTemplateLink">save as activity plan template</button></div>
|
||||
|
||||
<div wicket:id=dataViewContainer>
|
||||
<div>
|
||||
|
@ -63,6 +63,7 @@ public class ActivityPlanPanel extends Panel {
|
||||
private final Project project;
|
||||
private final User user;
|
||||
private Label emptyLabel;
|
||||
private AjaxLink saveAsTemplateLink;
|
||||
|
||||
public ActivityPlanPanel(final String id, final Project project, final User user){
|
||||
super(id);
|
||||
@ -315,6 +316,7 @@ public class ActivityPlanPanel extends Panel {
|
||||
emptyLabel.setVisible(sdp.size()==0);
|
||||
target.addComponent(emptyLabel);
|
||||
target.addComponent(dataViewContainer);
|
||||
target.addComponent(saveAsTemplateLink);
|
||||
}
|
||||
@Override
|
||||
public boolean isVisible(){
|
||||
@ -399,7 +401,7 @@ public class ActivityPlanPanel extends Panel {
|
||||
};
|
||||
saveAsTemplatePanel.setOutputMarkupId(true);
|
||||
//Save as template link
|
||||
add(new AjaxLink<Void>("saveAsTemplateLink"){
|
||||
saveAsTemplateLink = new AjaxLink<Void>("saveAsTemplateLink"){
|
||||
private static final long serialVersionUID = 1L;
|
||||
@Override
|
||||
public void onClick(AjaxRequestTarget target) {
|
||||
@ -410,7 +412,8 @@ public class ActivityPlanPanel extends Panel {
|
||||
public boolean isVisible(){
|
||||
return (canSaveAsTemplate() && getProject().getProjectSchedule() != null && sdp.size() > 0);//only show if there is a schedule with events
|
||||
}
|
||||
});
|
||||
};
|
||||
add(saveAsTemplateLink);
|
||||
}
|
||||
private void addSortControls(){
|
||||
//Specify wanted sort specifier fields
|
||||
|
@ -74,6 +74,8 @@ public class AutomaticMatchPanel extends Panel {
|
||||
target.addComponent(getPage().get("feedbackPanel"));
|
||||
target.addComponent(container);
|
||||
hideContainer();
|
||||
|
||||
setResponsePage(AutomaticMatchPage.class);
|
||||
}
|
||||
|
||||
});
|
||||
|
@ -8,16 +8,16 @@
|
||||
<wicket:panel>
|
||||
<div wicket:id="dialog">
|
||||
<form wicket:id="form">
|
||||
<div>
|
||||
<div>Template name</div>
|
||||
<input style="width:500px;" wicket:id="nameField" type="text" />
|
||||
</div>
|
||||
|
||||
<!-- <div style="width:300px; display:table"> -->
|
||||
<!-- <label for="MyInput" style="display:table-cell; width:1px">label text</label> -->
|
||||
<!-- <input type="text" id="MyInput" style="display:table-cell; width:100%" /> -->
|
||||
<!-- </div> -->
|
||||
|
||||
<div>
|
||||
<div>Template name</div>
|
||||
<input style="width: 500px;" wicket:id="nameField" type="text" />
|
||||
</div>
|
||||
|
||||
<!-- <div style="width:300px; display:table"> -->
|
||||
<!-- <label for="MyInput" style="display:table-cell; width:1px">label text</label> -->
|
||||
<!-- <input type="text" id="MyInput" style="display:table-cell; width:100%" /> -->
|
||||
<!-- </div> -->
|
||||
|
||||
<div wicket:id="categoryPanel"></div>
|
||||
<div wicket:id="checkListDialog"></div>
|
||||
<p></p>
|
||||
@ -27,18 +27,29 @@
|
||||
<!-- <span><a href="#" wicket:id="saveLink">Add checklist</a></span>-->
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="info-box rounded-box last">
|
||||
<p>
|
||||
<b>Categories (all templates must be marked with either Bachelor, Master or both to become usable)</b>
|
||||
</p>
|
||||
<ul>
|
||||
<li>Bachelor: can be used for Bachelor level projects.</li>
|
||||
<li>Master: can be used for Master level projects.</li>
|
||||
<li>Supervisor: not visible to students when added to a
|
||||
project.</li>
|
||||
<li>Peer: can be used in the peer section.</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="info-box rounded-box last">
|
||||
<p>
|
||||
<b>Categories:</b>
|
||||
</p>
|
||||
<ul>
|
||||
<li>Bachelor: can be used for Bachelor level projects.</li>
|
||||
<li>Master: can be used for Master level projects.</li>
|
||||
<li>Supervisor: not visible to students when added to a project.</li>
|
||||
<li>Peer: can be used in the peer section.</li>
|
||||
</ul>
|
||||
</div>
|
||||
<p>
|
||||
<b>No delete icon?</b>
|
||||
</p>
|
||||
<p>If there is no delete icon, that means the checklist template is being used in an activity plan template. Removing
|
||||
the checklist template would result in crashes, since the activity plan template would no longer be able to find the
|
||||
checklist template it has references to. In order to delete the checklist template, there must be no references to it
|
||||
in any activity plan templates.</p>
|
||||
</div>
|
||||
|
||||
<div wicket:id="container">
|
||||
<table class="rounded-corner">
|
||||
@ -63,22 +74,21 @@
|
||||
<td><span wicket:id="categories"></span></td>
|
||||
<td><span wicket:id="templateOuestion"></span></td>
|
||||
<td><div class="split-row">
|
||||
<a href="#" wicket:id="moveUpLink"><img
|
||||
wicket:id="upArrowImage" /></a>
|
||||
</div>
|
||||
<div class="split-row">
|
||||
<a href="#" wicket:id="moveDownLink"><img
|
||||
wicket:id="downArrowImage" alt="Down" title="Down" /></a>
|
||||
</div>
|
||||
</td>
|
||||
<td><a href="#" wicket:id="delete">
|
||||
<img wicket:id="deleteIcon" alt="Delete" title="Delete" />
|
||||
<a href="#" wicket:id="moveUpLink"><img
|
||||
wicket:id="upArrowImage" /></a>
|
||||
</div>
|
||||
<div class="split-row">
|
||||
<a href="#" wicket:id="moveDownLink"><img
|
||||
wicket:id="downArrowImage" alt="Down" title="Down" /></a>
|
||||
</div></td>
|
||||
<td><a href="#" wicket:id="delete"> <img
|
||||
wicket:id="deleteIcon" alt="Delete" title="Delete" />
|
||||
</a></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!-- <a wicket:id="newLink">Create new checklist</a> -->
|
||||
<!-- <a wicket:id="newLink">Create new checklist</a> -->
|
||||
<button wicket:id="newLink">Create new checklist</button>
|
||||
</wicket:panel>
|
||||
</body>
|
||||
|
@ -30,9 +30,12 @@ import se.su.dsv.scipro.SciProSession;
|
||||
import se.su.dsv.scipro.checklists.panels.ChecklistCategoryPanel;
|
||||
import se.su.dsv.scipro.data.dao.interfaces.CheckListTemplateDao;
|
||||
import se.su.dsv.scipro.data.dao.interfaces.ProjectDao;
|
||||
import se.su.dsv.scipro.data.dao.interfaces.ScheduleTemplateDao;
|
||||
import se.su.dsv.scipro.data.dataobjects.CheckListQuestion;
|
||||
import se.su.dsv.scipro.data.dataobjects.CheckListTemplate;
|
||||
import se.su.dsv.scipro.data.dataobjects.ChecklistCategory;
|
||||
import se.su.dsv.scipro.data.dataobjects.ProjectEventTemplate;
|
||||
import se.su.dsv.scipro.data.dataobjects.ScheduleTemplate;
|
||||
import se.su.dsv.scipro.data.enums.CheckListRole;
|
||||
import se.su.dsv.scipro.icons.ImageObject;
|
||||
|
||||
@ -48,6 +51,8 @@ public class AdminListCheckListTemplatePanel extends Panel{
|
||||
|
||||
@SpringBean
|
||||
ProjectDao projectDao;
|
||||
@SpringBean
|
||||
ScheduleTemplateDao scheduleDao;
|
||||
|
||||
private Dialog dialog;
|
||||
|
||||
@ -235,6 +240,15 @@ public class AdminListCheckListTemplatePanel extends Panel{
|
||||
item.add(deleteLink);
|
||||
deleteLink.add(new ImageObject("deleteIcon", ImageObject.TWENTYFOUR + ImageObject.DELETE));
|
||||
|
||||
CheckListTemplate clt = item.getModelObject();
|
||||
for (ScheduleTemplate st : scheduleDao.findAll()){
|
||||
for (ProjectEventTemplate pet : st.getProjectEventTemplates()){
|
||||
if (pet.getChecklistTemplate()!= null && pet.getChecklistTemplate().equals(clt)){
|
||||
deleteLink.setVisible(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
AjaxLink<Void> templateLink = new AjaxLink<Void>("templateLink"){
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
@ -43,14 +43,10 @@ public class ManualMatchPanel extends Panel {
|
||||
private Long supervisorId;
|
||||
public ManualMatchPanel(String id, IModel<Match> matchModel) {
|
||||
super(id);
|
||||
|
||||
supervisorId = matchModel.getObject().getSupervisor() != null ? matchModel.getObject().getSupervisor().getId() : 0L;
|
||||
|
||||
setOutputMarkupPlaceholderTag(true);
|
||||
|
||||
currentFragment = createButtonFragment();
|
||||
alternateFragment = createMatchFragment(matchModel);
|
||||
|
||||
add(currentFragment);
|
||||
}
|
||||
|
||||
@ -99,6 +95,7 @@ public class ManualMatchPanel extends Panel {
|
||||
@Override
|
||||
public void onSubmit() {
|
||||
matchModel.getObject().setSupervisor(autocompleteSupervisorField.getModelObject());
|
||||
matchModel.getObject().setStatus(Status.CONFIRMED);
|
||||
matchDao.changeStatus(SciProSession.get().getUser(), matchModel.getObject(), null);
|
||||
}
|
||||
};
|
||||
|
@ -16,38 +16,24 @@ import se.su.dsv.scipro.match.dataobject.Match.Status;
|
||||
public class ProjectIdeaActionPanel extends Panel {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Status status;
|
||||
private ManualMatchPanel manualMatchPanel;
|
||||
private IModel<Match> matchModel__;
|
||||
|
||||
public Status getStatus() {
|
||||
return status;
|
||||
}
|
||||
@SpringBean
|
||||
private MatchDao matchDao;
|
||||
private ManualMatchPanel manualMatchPanel;
|
||||
|
||||
|
||||
public ProjectIdeaActionPanel(String id, final IModel<Match> matchModel) {
|
||||
super(id);
|
||||
|
||||
Form<Match> form = new Form<Match>("form", matchModel) {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Override
|
||||
protected void onSubmit() { // TODO: This onSubmit should be changed
|
||||
status = Status.CONFIRMED;
|
||||
matchModel__.getObject().setStatus(status);
|
||||
}
|
||||
};
|
||||
matchModel__ = new Model<Match>(matchModel.getObject());
|
||||
form.add(manualMatchPanel = new ManualMatchPanel("manualMatchPanel", matchModel__));
|
||||
Form<Match> form = new Form<Match>("form", matchModel);
|
||||
form.add(manualMatchPanel = new ManualMatchPanel("manualMatchPanel", matchModel));
|
||||
|
||||
form.add(new Button("sendBackButton") {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Override
|
||||
public void onSubmit() {
|
||||
status = Status.REFUSED;
|
||||
matchModel__.getObject().setStatus(status);
|
||||
matchModel.getObject().setStatus(Status.REFUSED);
|
||||
matchDao.changeStatus(SciProSession.get().getUser(), matchModel.getObject(), null);
|
||||
}
|
||||
});
|
||||
|
||||
@ -59,8 +45,8 @@ public class ProjectIdeaActionPanel extends Panel {
|
||||
|
||||
@Override
|
||||
public void onSubmit() {
|
||||
status = Status.UNMATCHED;
|
||||
matchModel__.getObject().setStatus(status);
|
||||
matchModel.getObject().setStatus(Status.UNMATCHED);
|
||||
matchDao.changeStatus(SciProSession.get().getUser(), matchModel.getObject(), null);
|
||||
}
|
||||
});
|
||||
|
||||
@ -72,8 +58,8 @@ public class ProjectIdeaActionPanel extends Panel {
|
||||
|
||||
@Override
|
||||
public void onSubmit() {
|
||||
status = Status.REJECTED;
|
||||
matchModel__.getObject().setStatus(status);
|
||||
matchModel.getObject().setStatus(Status.REJECTED);
|
||||
matchDao.changeStatus(SciProSession.get().getUser(), matchModel.getObject(), null);
|
||||
}
|
||||
});
|
||||
add(form);
|
||||
|
@ -37,10 +37,12 @@ public class ProjectScheduleEvent extends LazyDeletableDomainObject {
|
||||
@Column(nullable=false)
|
||||
@SortableField
|
||||
private Date date;
|
||||
@Column(length=50,nullable=false)
|
||||
// @Column(length=50,nullable=false) removed this length rule
|
||||
@Column(nullable=false)
|
||||
@SortableField
|
||||
private String name;
|
||||
@Column(nullable=false,length=512)
|
||||
// @Column(nullable=false,length=512) removed this length rule
|
||||
@Column(nullable=false)
|
||||
@SortableField
|
||||
private String description;
|
||||
@Column(nullable=false)
|
||||
|
@ -191,7 +191,8 @@ public class ProjectIdeaDaoJPAImp extends AbstractDaoJPAImp<ProjectIdea>
|
||||
if (statuses != null) {
|
||||
for (Status status : statuses) {
|
||||
if (status.equals(Match.Status.UNMATCHED)) {
|
||||
filterStatuses.add(Match.Status.REJECTED);
|
||||
// filterStatuses.add(Match.Status.REJECTED); why was this here?
|
||||
filterStatuses.add(Match.Status.UNMATCHED); //why do we need to add this manually and all others can be added like below?
|
||||
hasUnmatched = true;
|
||||
} else {
|
||||
filterStatuses.add(status);
|
||||
|
@ -39,7 +39,7 @@
|
||||
<td wicket:id="title"></td>
|
||||
<td wicket:id="author"></td>
|
||||
<td wicket:id="status"></td>
|
||||
<td><a href="#" wicket:id="editDialog"><img wicket:id="editIcon"></img></a></td>
|
||||
<td><a href="#" wicket:id="editDialog"><img wicket:id="editIcon" /></a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="5" wicket:id="emptyLabel"></td>
|
||||
|
@ -1,6 +1,7 @@
|
||||
package se.su.dsv.scipro.match.panel;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.wicket.ajax.AjaxRequestTarget;
|
||||
@ -61,9 +62,11 @@ public class AdminManageProjectIdeaPanel extends Panel {
|
||||
emptyLabel = new Label("emptyLabel", "No events to show.");
|
||||
allContainer.add(emptyLabel);
|
||||
emptyLabel.setOutputMarkupId(true); //Needs to be AJAX-enabled.
|
||||
|
||||
allProvider = new ProjectIdeaDataProvider();
|
||||
|
||||
allProvider.setSearchMode(SEARCH_MODE.FILTER);
|
||||
ProjectIdeaDao.Params params = new ProjectIdeaDao.Params();
|
||||
params.setStatuses(new ArrayList<Match.Status>(Arrays.asList(Match.Status.CONFIRMED, Match.Status.REFUSED, Match.Status.UNMATCHED)));
|
||||
allProvider.setParams(params);
|
||||
emptyLabel.setVisible(allProvider.size()==0); //Rule for the empty label
|
||||
//Add data view
|
||||
allDataView = new DataView<ProjectIdea>("allDataView", allProvider) {
|
||||
@ -147,7 +150,7 @@ public class AdminManageProjectIdeaPanel extends Panel {
|
||||
}
|
||||
List<Match.Status> status = matchStatusPanel.getSelectedMatchStatus();
|
||||
if(!status.isEmpty()){
|
||||
params.setStatuses(status);
|
||||
params.setStatuses(status);
|
||||
}
|
||||
allProvider.setParams(params);
|
||||
target.addComponent(allContainer);
|
||||
|
@ -3,6 +3,9 @@
|
||||
xmlns:wicket="http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd">
|
||||
<body>
|
||||
<wicket:panel>
|
||||
<div wicket:id="dialog">
|
||||
<div wicket:id="dialogContent"></div>
|
||||
</div>
|
||||
<div wicket:id="container">
|
||||
<p><b>Rejected Ideas</b></p>
|
||||
<table class="rounded-corner">
|
||||
@ -22,7 +25,7 @@
|
||||
<td wicket:id="author"></td>
|
||||
<td wicket:id="rejectedBy"></td>
|
||||
<td wicket:id="comment"></td>
|
||||
<td wicket:id="edit"></td>
|
||||
<td><a href="#" wicket:id="editDialog"><img wicket:id="editIcon" /></a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td wicket:id="emptyLabel" colspan="6"></td>
|
||||
|
@ -1,18 +1,27 @@
|
||||
package se.su.dsv.scipro.match.panel;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.wicket.ajax.AjaxRequestTarget;
|
||||
import org.apache.wicket.ajax.markup.html.AjaxLink;
|
||||
import org.apache.wicket.markup.html.WebMarkupContainer;
|
||||
import org.apache.wicket.markup.html.basic.Label;
|
||||
import org.apache.wicket.markup.html.navigation.paging.PagingNavigator;
|
||||
import org.apache.wicket.markup.html.panel.EmptyPanel;
|
||||
import org.apache.wicket.markup.html.panel.Panel;
|
||||
import org.apache.wicket.markup.repeater.Item;
|
||||
import org.apache.wicket.markup.repeater.data.DataView;
|
||||
import org.apache.wicket.model.Model;
|
||||
|
||||
import org.odlabs.wiquery.ui.dialog.Dialog;
|
||||
import se.su.dsv.scipro.admin.panels.match.AdminEditProjectIdeaPanel;
|
||||
import se.su.dsv.scipro.data.dataobjects.ProjectClass;
|
||||
import se.su.dsv.scipro.data.dataobjects.Student;
|
||||
import se.su.dsv.scipro.icons.ImageObject;
|
||||
import se.su.dsv.scipro.match.dao.interfaces.ProjectIdeaDao;
|
||||
import se.su.dsv.scipro.match.dataobject.Match;
|
||||
import se.su.dsv.scipro.match.dataobject.ProjectIdea;
|
||||
import se.su.dsv.scipro.match.dataprovider.ProjectIdeaDataProvider;
|
||||
import se.su.dsv.scipro.match.dataprovider.ProjectIdeaDataProvider.SEARCH_MODE;
|
||||
@ -25,6 +34,7 @@ public class AdminRejectedProjectIdeaPanel extends Panel {
|
||||
private WebMarkupContainer container;
|
||||
private ProjectIdeaDataProvider rejectedProvider;
|
||||
private Label emptyLabel;
|
||||
private Dialog dialog;
|
||||
|
||||
public AdminRejectedProjectIdeaPanel(String id){
|
||||
super(id);
|
||||
@ -32,7 +42,13 @@ public class AdminRejectedProjectIdeaPanel extends Panel {
|
||||
}
|
||||
|
||||
private void allDataViewSetup(){
|
||||
|
||||
dialog = new Dialog("dialog");
|
||||
dialog.setModal(true);
|
||||
dialog.setAutoOpen(false);
|
||||
dialog.setWidth(550);
|
||||
dialog.setHeight(700);
|
||||
dialog.add(new EmptyPanel("dialogContent"));
|
||||
add(dialog);
|
||||
container = new WebMarkupContainer("container");
|
||||
|
||||
//Add info for the user should there be no events to display.
|
||||
@ -41,7 +57,10 @@ public class AdminRejectedProjectIdeaPanel extends Panel {
|
||||
emptyLabel.setOutputMarkupId(true); //Needs to be AJAX-enabled.
|
||||
|
||||
rejectedProvider = new ProjectIdeaDataProvider();
|
||||
rejectedProvider.setSearchMode(SEARCH_MODE.REJECTED);
|
||||
rejectedProvider.setSearchMode(SEARCH_MODE.FILTER);
|
||||
ProjectIdeaDao.Params params = new ProjectIdeaDao.Params();
|
||||
params.setStatuses(new ArrayList<Match.Status>(Arrays.asList(Match.Status.REJECTED)));
|
||||
rejectedProvider.setParams(params);
|
||||
|
||||
emptyLabel.setVisible(rejectedProvider.size()==0); //Rule for the empty label
|
||||
//Add data view
|
||||
@ -61,7 +80,23 @@ public class AdminRejectedProjectIdeaPanel extends Panel {
|
||||
item.add(new Label("title", new Model<String>(idea.getTitle())));
|
||||
item.add(new Label("rejectedBy", new Model<String>(idea.getMatch().getSupervisor().getUser().getFullName())));
|
||||
item.add(new Label("comment", new Model<String>(idea.getMatch().getCommentForStudent())));
|
||||
item.add(new AdminEditProjectIdeaPanel("edit", item.getModel()));
|
||||
AjaxLink<Void> dialogLink = new AjaxLink<Void>("editDialog") {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Override
|
||||
public void onClick(AjaxRequestTarget target) {
|
||||
if (target != null) {
|
||||
System.out.println("opening dialog and setting title");
|
||||
dialog.replace(new AdminEditProjectIdeaPanel("dialogContent", new Model<ProjectIdea>(idea)) {
|
||||
private static final long serialVersionUID = 1L;});
|
||||
target.addComponent(dialog);
|
||||
dialog.setTitle("Edit project idea: " + idea.getTitle());
|
||||
dialog.open(target);
|
||||
}
|
||||
}
|
||||
};
|
||||
dialogLink.add(new ImageObject("editIcon", ImageObject.SIXTEEN + ImageObject.EDIT));
|
||||
item.add(dialogLink);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -37,11 +37,10 @@ public class PartnerAdditionPanel extends Panel {
|
||||
coAuthor = authorList.get(1);
|
||||
partnerLong = new Model<Long>(roleDao.findStudentRole(coAuthor.getUser()).getId());
|
||||
}
|
||||
|
||||
if(!authorList.isEmpty())
|
||||
setEnabled(false);
|
||||
|
||||
addProjectPartner();
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -52,6 +51,9 @@ public class PartnerAdditionPanel extends Panel {
|
||||
|
||||
@Override
|
||||
public Iterator<Student> getChoices(String input) {
|
||||
input = input.replace("ö", "ö");
|
||||
input = input.replace("Ã¥", "å");
|
||||
input = input.replace("ä", "ä");
|
||||
return roleDao.findStudentQuery(input.toLowerCase(), 6).iterator();
|
||||
}
|
||||
};
|
||||
@ -110,4 +112,5 @@ public class PartnerAdditionPanel extends Panel {
|
||||
public boolean coAuthorExists() {
|
||||
return projectPartnerSelector.getModelObject() != null;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -6,26 +6,41 @@
|
||||
</head>
|
||||
<body>
|
||||
<wicket:panel>
|
||||
<div class="append-bottom">
|
||||
<h5 class="peer-title">
|
||||
Project details
|
||||
<!-- span class="right" wicket:id="helpDialog"></span -->
|
||||
</h5>
|
||||
<ul class="no-list-style">
|
||||
<li><b>Title: </b><span wicket:id="title"></span></li>
|
||||
<li><b>Authors: </b> <span wicket:id="slistview"><span
|
||||
wicket:id="nameLabel"></span> <a href="#" wicket:id="mailLink"><span
|
||||
wicket:id="mailLabel"></span></a> </span></li>
|
||||
<li><b>Head Supervisor: </b><span wicket:id="head_supervisor"></span>
|
||||
<a href="#" wicket:id="hsmailLink"><span wicket:id="hsmailLabel"></span></a></li>
|
||||
<li><b>Co-supervisors: </b><span wicket:id="colistview"><span
|
||||
wicket:id="nameLabel"></span> <a href="#" wicket:id="mailLink"><span
|
||||
wicket:id="mailLabel"></span></a> </span></li>
|
||||
<li><b>Reviewers: </b> <span wicket:id="rlistview"> <span
|
||||
wicket:id="nameLabel"></span> <a href="#" wicket:id="mailLink"><span
|
||||
wicket:id="mailLabel"></span></a>
|
||||
</span></li>
|
||||
<li><b>Status: </b><span wicket:id="status"></span></li>
|
||||
</ul>
|
||||
<div><b>Title: </b></div>
|
||||
<div wicket:id="title"></div>
|
||||
<div><b>Authors: </b></div>
|
||||
<div wicket:id="slistview">
|
||||
<div><span wicket:id="nameLabel"></span>
|
||||
<a href="#" wicket:id="mailLink"><span wicket:id="mailLabel"></span></a></div>
|
||||
</div>
|
||||
<div><b>Head Supervisor: </b></div>
|
||||
<div><span wicket:id="head_supervisor"></span>
|
||||
<a href="#" wicket:id="hsmailLink"><span wicket:id="hsmailLabel"></span></a></div>
|
||||
<div><b>Co-supervisors: </b></div>
|
||||
<div wicket:id="colistview">
|
||||
<div><span wicket:id="nameLabel"></span>
|
||||
<a href="#" wicket:id="mailLink"><span wicket:id="mailLabel"></span></a></div>
|
||||
</div>
|
||||
|
||||
<!-- <span wicket:id="colistview"><span wicket:id="nameLabel"></span> -->
|
||||
<!-- <a href="#" wicket:id="mailLink"><span wicket:id="mailLabel"></span></a> -->
|
||||
<!-- </span> -->
|
||||
<div><b>Reviewers: </b></div>
|
||||
<div wicket:id="rlistview">
|
||||
<div><span wicket:id="nameLabel"></span>
|
||||
<a href="#" wicket:id="mailLink"><span wicket:id="mailLabel"></span></a></div>
|
||||
</div>
|
||||
<!-- <span wicket:id="rlistview"> <span wicket:id="nameLabel"></span> -->
|
||||
<!-- <a href="#" wicket:id="mailLink"><span wicket:id="mailLabel"></span></a> -->
|
||||
<!-- </span> -->
|
||||
<!-- <b>Status: </b> -->
|
||||
<!-- <span wicket:id="status"></span> -->
|
||||
</div>
|
||||
</wicket:panel>
|
||||
</body>
|
||||
</html>
|
@ -9,6 +9,7 @@ import org.apache.wicket.markup.html.list.ListItem;
|
||||
import org.apache.wicket.markup.html.list.ListView;
|
||||
import org.apache.wicket.markup.html.panel.Panel;
|
||||
import org.apache.wicket.model.IModel;
|
||||
import org.apache.wicket.model.Model;
|
||||
import org.apache.wicket.model.PropertyModel;
|
||||
import org.apache.wicket.spring.injection.annot.SpringBean;
|
||||
|
||||
@ -39,7 +40,14 @@ public class ProjectDetailsPanel extends Panel {
|
||||
protected void populateItem(ListItem item) {
|
||||
Student s = (Student)item.getModelObject();
|
||||
item.add(new Label("nameLabel", new PropertyModel<Student>(s, "user.fullName")));
|
||||
item.add(new ExternalLink("mailLink", "mailto:" + new PropertyModel<Student>(s, "user.emailAddress")).add(new Label("mailLabel", new PropertyModel<Student>(s, "user.emailAddress"))));
|
||||
|
||||
IModel<String> mail = new PropertyModel<String>(s, "user.emailAddress");
|
||||
|
||||
// Model<String> mail = new Model<String>(s.getUser().getEmailAddress());
|
||||
|
||||
item.add(new ExternalLink("mailLink", "mailto:" + mail.getObject()).add(new Label("mailLabel", mail)));
|
||||
|
||||
// item.add(new ExternalLink("mailLink", "mailto:" + new PropertyModel<Student>(s, "user.emailAddress")).add(new Label("mailLabel", new PropertyModel<Student>(s, "user.emailAddress"))));
|
||||
}
|
||||
};
|
||||
add(slistview);
|
||||
@ -50,7 +58,7 @@ public class ProjectDetailsPanel extends Panel {
|
||||
addParticipantsDetails(new ArrayList<ProjectFollower>(project.getProjectCoSupervisors()), "colistview");
|
||||
addParticipantsDetails(new ArrayList<ProjectFollower>(project.getProjectReviewers()), "rlistview");
|
||||
|
||||
add(new Label("status", new PropertyModel<Project>(project, "projectStatus.name")));
|
||||
// add(new Label("status", new PropertyModel<Project>(project, "projectStatus.name")));
|
||||
|
||||
}
|
||||
|
||||
|
@ -51,7 +51,7 @@ public class ProjectTabMenuPanel extends AbstractMenuPanel {
|
||||
itemList.add(new MenuItem("Files", ProjectFilePage.class, ProjectFilePanel.getPrefabricatedPageParameters(activeProject)));
|
||||
itemList.add(new MenuItem("Conference", ProjectConferencePage.class));
|
||||
itemList.add(new MenuItem("Checklists", ProjectChecklistPage.class, MenuHighlightChecklist.class));
|
||||
itemList.add(new MenuItem("Notes", ProjectLogPage.class));
|
||||
// itemList.add(new MenuItem("Notes", ProjectLogPage.class)); notes is redundant, removing for now
|
||||
itemList.add(new MenuItem("Opposition & Active participation", ProjectOppositionPage.class));
|
||||
itemList.add(new MenuItem("Peer portal", ProjectPeerPortalPage.class));
|
||||
itemList.add(new MenuItem("All Final Seminars", FinalSeminarProjectListPage.class));
|
||||
|
@ -5,7 +5,7 @@
|
||||
<div class="append-bottom">
|
||||
<div><b>Name: </b><span wicket:id="templateName"></span></div>
|
||||
<div><b>Description: </b><span wicket:id="templateDescription"></span></div>
|
||||
<div><b>Number of events: </b><span wicket:id="templateName"></span></div>
|
||||
<!-- <div><b>Number of events: </b><span wicket:id="templateName"></span></div> -->
|
||||
<div><b>Creator: </b><span wicket:id="templateCreator"></span></div>
|
||||
<div><b>Date created: </b><span wicket:id="templateCreated"></span></div>
|
||||
<div><b>Last updated: </b><span wicket:id="templateUpdated"></span></div>
|
||||
|
@ -6,10 +6,10 @@
|
||||
<!-- Left column -->
|
||||
<div class="span-10 colborder">
|
||||
<div class="span-10 last">
|
||||
<div wicket:id="stateOfMindPanel"></div>
|
||||
<div wicket:id="projectDetails"></div>
|
||||
</div>
|
||||
<div class="span-10 last">
|
||||
<div wicket:id="projectDetails"></div>
|
||||
<div wicket:id="stateOfMindPanel"></div>
|
||||
</div>
|
||||
<div class="span-10 last">
|
||||
<h5 class="peer-title">Peer reviews on this project</h5>
|
||||
|
@ -41,7 +41,7 @@ public class SupervisorSubTabMenuPanel extends AbstractMenuPanel{
|
||||
items.add(new MenuItem("Conference", SupervisorConferencePage.class, projectParams));
|
||||
items.add(new MenuItem("Checklist", SupervisorChecklistPage.class, MenuHighlightSupervisorChecklist.class,projectParams));
|
||||
//items.add(new MenuItem("Add checklist", SupervisorAddCheckListToProjectPage.class,projectParams));
|
||||
items.add(new MenuItem("Notes", SupervisorLogPage.class));
|
||||
// items.add(new MenuItem("Notes", SupervisorLogPage.class)); notes is redundant, removing it for now
|
||||
return items;
|
||||
}
|
||||
|
||||
|
@ -362,7 +362,7 @@ public class TestViewCheckListPanel extends BaseWicketTest implements
|
||||
|
||||
private Document getResponse() {
|
||||
Document doc = Jsoup.parse(tester.getServletResponse().getDocument());
|
||||
System.out.println(doc.html());
|
||||
// System.out.println(doc.html());
|
||||
return doc;
|
||||
}
|
||||
|
||||
|
@ -18,32 +18,33 @@ public class TestViewCheckListPanelByRespondant extends TestViewCheckListPanel {
|
||||
variation = "by_respondent";
|
||||
}
|
||||
|
||||
// @Test
|
||||
// public void testShouldShowComments() {
|
||||
// setActiveUser(student1User);
|
||||
// activeProject.addProjectParticipant(student1);
|
||||
// studyQuestion.addAnswer(new CheckListAnswer(student1User,
|
||||
// CheckListQuestionAnswer.GREEN, "A nice little comment"));
|
||||
//
|
||||
// Document doc = renderPanel();
|
||||
// assertEquals("A nice little comment", doc.select(
|
||||
// ".author-answer .comment").first().text().trim());
|
||||
// assertEquals("No answer from respondent yet.", doc.select(
|
||||
// ".author-answer .comment").get(1).text().trim());
|
||||
//
|
||||
// }
|
||||
//
|
||||
// @Test
|
||||
// public void testShouldShowWaitingForAnswerCommentsWhenNoAnswerGiven() {
|
||||
// setActiveUser(student1User);
|
||||
// activeProject.addProjectParticipant(student1);
|
||||
//
|
||||
// Document doc = renderPanel();
|
||||
// assertEquals("No answer from respondent yet.", doc.select(
|
||||
// ".author-answer .comment").first().text().trim());
|
||||
// assertEquals("No answer from respondent yet.", doc.select(
|
||||
// ".author-answer .comment").get(1).text().trim());
|
||||
//
|
||||
// }
|
||||
@Test
|
||||
public void testShouldShowComments() {
|
||||
setActiveUser(student1User);
|
||||
activeProject.addProjectParticipant(student1);
|
||||
studyQuestion.addAnswer(new CheckListAnswer(student1User,
|
||||
CheckListQuestionAnswer.GREEN, "A nice little comment"));
|
||||
|
||||
Document doc = renderPanel();
|
||||
|
||||
assertEquals("A nice little comment", doc.select(
|
||||
".author-answer .comment").first().text().replace(String.valueOf((char) 160), "").trim());
|
||||
assertEquals("No answer from respondent yet.", doc.select(
|
||||
".author-answer .comment").get(1).text().replace(String.valueOf((char) 160), "").trim());
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testShouldShowWaitingForAnswerCommentsWhenNoAnswerGiven() {
|
||||
setActiveUser(student1User);
|
||||
activeProject.addProjectParticipant(student1);
|
||||
|
||||
Document doc = renderPanel();
|
||||
assertEquals("No answer from respondent yet.", doc.select(
|
||||
".author-answer .comment").first().text().replace(String.valueOf((char) 160), "").trim());
|
||||
assertEquals("No answer from respondent yet.", doc.select(
|
||||
".author-answer .comment").get(1).text().replace(String.valueOf((char) 160), "").trim());
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -280,11 +280,14 @@ public class TestProjectIdeaDao {
|
||||
Match match = matchDao.addPreApprovedMatch(student1, projectIdea2, employee1Role);
|
||||
matchDao.changeStatus(employee1, match, Match.Status.REJECTED);
|
||||
|
||||
List<ProjectIdea> projectIdeas =
|
||||
projectIdeaDao.findUnmatchedProjectIdeas();
|
||||
// commented out old test below, its completely wrong
|
||||
// List<ProjectIdea> projectIdeas = projectIdeaDao.findUnmatchedProjectIdeas();
|
||||
// Assert.assertEquals(Arrays.asList(new ProjectIdea[] { projectIdea1, projectIdea2, projectIdea3 }), projectIdeas);
|
||||
|
||||
params.setStatuses(rejected);
|
||||
List<ProjectIdea> projectIdeas = projectIdeaDao.findProjectIdeas(params);
|
||||
Assert.assertEquals(Arrays.asList(new ProjectIdea[] { projectIdea2}), projectIdeas);
|
||||
|
||||
Assert.assertEquals(Arrays.asList(new ProjectIdea[] { projectIdea1, projectIdea2,
|
||||
projectIdea3 }), projectIdeas);
|
||||
}
|
||||
|
||||
@Test
|
||||
@ -462,20 +465,21 @@ public class TestProjectIdeaDao {
|
||||
projectIdeas);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
@Rollback
|
||||
public void testShouldCountRejectedAsUnmatched() {
|
||||
Match match = matchDao.addPreApprovedMatch(student1, projectIdea1, employee1Role);
|
||||
match = matchDao.changeStatus(employee1, match, Match.Status.REJECTED);
|
||||
matchDao.addPreApprovedMatch(student1, projectIdea2, employee1Role);
|
||||
|
||||
params.setStatuses(unmatched);
|
||||
List<ProjectIdea> projectIdeas =
|
||||
target.findProjectIdeas(params);
|
||||
Assert.assertEquals(Arrays.asList(new ProjectIdea[] { projectIdea1, projectIdea3}),
|
||||
projectIdeas);
|
||||
}
|
||||
// why should rejected ideas count as unmatched? makes no sense
|
||||
// @Test
|
||||
// @Transactional
|
||||
// @Rollback
|
||||
// public void testShouldCountRejectedAsUnmatched() {
|
||||
// Match match = matchDao.addPreApprovedMatch(student1, projectIdea1, employee1Role);
|
||||
// match = matchDao.changeStatus(employee1, match, Match.Status.REJECTED);
|
||||
// matchDao.addPreApprovedMatch(student1, projectIdea2, employee1Role);
|
||||
//
|
||||
// params.setStatuses(unmatched);
|
||||
// List<ProjectIdea> projectIdeas =
|
||||
// target.findProjectIdeas(params);
|
||||
// Assert.assertEquals(Arrays.asList(new ProjectIdea[] { projectIdea1, projectIdea3}),
|
||||
// projectIdeas);
|
||||
// }
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
|
Loading…
x
Reference in New Issue
Block a user