Merge branch 'develop' of ssh://git.dsv.su.se/git/scipro/scipro into develop

This commit is contained in:
Robin Eklund 2011-08-02 13:34:56 +02:00
commit 1eaf2a733c
22 changed files with 319 additions and 418 deletions

@ -34,7 +34,7 @@ public abstract class AbstractAdminSettingsPage extends AbstractAdminPage {
items.add(new MenuItem("Server Environment", AdminServerEnvironmentSettingsPage.class));
items.add(new MenuItem("Final seminar general settings", AdminFinalSeminarSettingsPage.class));
items.add(new MenuItem("Final seminar project level settings", AdminFinalSeminarSettingsPerProjectClassPage.class));
items.add(new MenuItem("Level settings", AdminPeerSettingsPage.class));
items.add(new MenuItem("Peer portal settings", AdminPeerSettingsPage.class));
items.add(new MenuItem("Edit levels", AdminProjectClassSettingsPage.class));
return items;

@ -19,7 +19,7 @@ import se.su.dsv.scipro.security.auth.roles.Roles;
*
*/
@Authorization(authorizedRoles={Roles.SYSADMIN})
@Authorization(authorizedRoles={Roles.SYSADMIN, Roles.ADMIN})
public class AdminProjectPartnerPage extends AbstractAdminPage {
@SpringBean

@ -25,10 +25,6 @@
<link href='http://fonts.googleapis.com/css?family=Ubuntu:regular,bold' rel='stylesheet' type='text/css' /> -->
<!--<link rel="stylesheet" href="css/scipro.css" media="screen,projection" />-->
<!-- <link type="text/css" href="css/smoothness/jquery-ui-1.8.10.custom.css" rel="stylesheet" />
<script type="text/javascript" src="js/jquery-1.5.2.min.js"></script>
<script type="text/javascript" src="js/jquery-ui-1.8.10.custom.min.js"></script> -->
<script type="text/javascript">
var _gaq = _gaq || [];

@ -6,11 +6,13 @@
</head>
<body>
<wicket:panel>
<div wicket:id="stateOfMindContainer">
<form wicket:id="form">
<table wicket:id="group">
<tr wicket:id="persons">
<div wicket:id="trafficLightContainer">
<div wicket:id="group">
<div wicket:id="lights">
<table >
<tr >
<td><input type="radio" wicket:id="radio" /></td>
<!--
<td><img wicket:id="image" /></td>
</tr>
</table>
@ -24,6 +26,37 @@
</div>
</div>
</div>
-->
<td><img wicket:id="image"/></td>
</tr>
<tr>
</tr>
</table>
</div>
</div>
</div>
</wicket:panel>
</body>
</html>
</html>
<!--
<!DOCTYPE html>
<html
xmlns:wicket="http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd">
<head>
<meta http-equiv="Content-type" content="text/html;charset=UTF-8" />
</head>
<body>
<wicket:panel>
<div wicket:id="trafficLightContainer">
<table wicket:id="group">
<tr wicket:id="lights">
<td><input type="radio" wicket:id="radio" /></td>
<td> <img wicket:id="image"/></td>
</tr>
</table>
</div>
>>>>>>> checklists
</wicket:panel>
</body>
</html> -->

@ -4,9 +4,7 @@ import java.util.ArrayList;
import java.util.List;
import org.apache.wicket.markup.html.WebMarkupContainer;
import org.apache.wicket.markup.html.WebPage;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.form.Form;
import org.apache.wicket.markup.html.form.Radio;
import org.apache.wicket.markup.html.form.RadioGroup;
import org.apache.wicket.markup.html.list.ListItem;
@ -24,9 +22,7 @@ import se.su.dsv.scipro.data.dataobjects.CheckList;
import se.su.dsv.scipro.data.dataobjects.CheckListAnswer;
import se.su.dsv.scipro.data.dataobjects.CheckListQuestion;
import se.su.dsv.scipro.data.enums.CheckListQuestionAnswer;
import se.su.dsv.scipro.data.enums.StateOfMind;
import se.su.dsv.scipro.knol.resource.page.StaticImage;
import edu.emory.mathcs.backport.java.util.Arrays;
/**
* @author fnorbe@dsv.su.se
@ -34,6 +30,12 @@ import edu.emory.mathcs.backport.java.util.Arrays;
public class TrafficLightPanel extends Panel {
private List<TrafficLight> lights;
enum TrafficLight{
GREEN, YELLOW, RED, NOT
}
private static final long serialVersionUID = 8862892008428526067L;
@SpringBean
@ -50,37 +52,51 @@ public class TrafficLightPanel extends Panel {
public TrafficLightPanel(String id) {
super(id);
WebMarkupContainer stateOfMindContainer = new WebMarkupContainer("stateOfMindContainer");
add(stateOfMindContainer);
Form<StateOfMind> f = new Form<StateOfMind>("form");
stateOfMindContainer.add(f);
RadioGroup<StateOfMind> group = new RadioGroup<StateOfMind>("group");
f.add(group);
WebMarkupContainer trafficLightContainer = new WebMarkupContainer(
"trafficLightContainer");
add(trafficLightContainer);
lights = new ArrayList<TrafficLight>();
lights.add(TrafficLight.GREEN);lights.add(TrafficLight.YELLOW);lights.add(TrafficLight.RED);lights.add(TrafficLight.NOT);
RadioGroup<TrafficLight> group = new RadioGroup<TrafficLight>("group");
trafficLightContainer.add(group);
ListView<StateOfMind> persons = new ListView<StateOfMind>("persons",
Arrays.asList(StateOfMind.values())) {
protected void populateItem(ListItem<StateOfMind> item) {
StateOfMind stateOfMind = item.getModelObject();
item.add(new Radio<StateOfMind>("radio", item.getModel()));
ListView<TrafficLight> lightList = new ListView<TrafficLight>("lights", lights) {
private static final long serialVersionUID = 1L;
protected void populateItem(ListItem<TrafficLight> item) {
TrafficLight trafficLight = item.getModelObject();
item.add(new Radio<TrafficLight>("radio", item.getModel()));
StaticImage image = null;
if (stateOfMind.equals(StateOfMind.FINE)) {
if (trafficLight.equals(TrafficLight.GREEN)) {
image = new StaticImage("image", new Model<String>(
"images/icons/green_ball_32.png"));
} else if (stateOfMind.equals(StateOfMind.NEEDHELP)) {
} else if (trafficLight.equals(TrafficLight.YELLOW)) {
image = new StaticImage("image", new Model<String>(
"images/icons/red_ball_32.png"));
} else if (stateOfMind.equals(StateOfMind.NEUTRAL)) {
"images/icons/red_ball_32.png"));
} else if (trafficLight.equals(TrafficLight.RED)) {
image = new StaticImage("image", new Model<String>(
"images/icons/yellow_ball_32.png"));
}
else if (trafficLight.equals(TrafficLight.NOT)) {
image = new StaticImage("image", new Model<String>(
"images/icons/grey_ball_32.png"));
}
item.add(image);
};
};
group.add(persons);
group.add(lightList);
}
List<CheckList> checkLists = checkListDao.findCheckLists(SciProSession.get()
.getActiveProject());
.getActiveProject());{
if (checkLists.size() < 1) {
CheckList checkList = new CheckList("Test", SciProSession.get().getActiveProject());
CheckListQuestion checkListQuestion = new CheckListQuestion("Testquestion?");

@ -56,7 +56,7 @@ public abstract class AbstractMenuPanel extends Panel {
protected void populateItem( ListItem<MenuItem> item ) {
final MenuItem mi = item.getModelObject();
boolean highLightAsCurrentByInterface = false;
Class<?> menuItemInterface = mi.getMenuHilightInterface();
Class<?> menuItemInterface = mi.getMenuHighlightInterface();
if( menuItemInterface != null ){
for( Class<?> actualPageInterface : containerClass.getInterfaces() ){
if( actualPageInterface.equals(menuItemInterface) ){
@ -72,7 +72,7 @@ public abstract class AbstractMenuPanel extends Panel {
&&
mi.getTargetClass().getSuperclass() != menuContainerCommonSuperClass
)
){
){
//item.setMarkupId("current");
//item.setOutputMarkupId(true);
//Replaced the above because it generates invalid markup if two menus are added to the same page (id no longer unique)
@ -99,7 +99,8 @@ public abstract class AbstractMenuPanel extends Panel {
}
/**
* May not rely on anything in the implementing class's constructor as this will not have been initialized yet.
* Items are rendered from left to right as you might expect, first item in the list will be first tab item on the left.
* Items are rendered from left to right (or top to bottom depending on type of menu) as you might expect,
* the first item in the list will be the first menu item on the left/top.
* @return
*/
protected abstract List<MenuItem> getItemList();
@ -118,7 +119,7 @@ public abstract class AbstractMenuPanel extends Panel {
private Class<? extends Page> targetClass;
private PageParameters pp;
private String iconName;
private Class<? extends MenuHighlight> menuHilightInterface;
private Class<? extends MenuHighlight> menuHighlightInterface;
public MenuItem(final String name, final Class<? extends Page> targetClass) {
this(name, targetClass, null, null, null);
@ -148,7 +149,7 @@ public abstract class AbstractMenuPanel extends Panel {
public MenuItem(final String name, final Class<? extends Page> targetClass, final Class<? extends MenuHighlight> menuHilightInterface, PageParameters pp, String iconName) {
this.name = name;
this.targetClass = targetClass;
this.menuHilightInterface = menuHilightInterface;
this.menuHighlightInterface = menuHilightInterface;
this.pp = pp;
this.iconName = iconName == null ? ImageIcon.ICON_EMPTY : iconName;
}
@ -169,13 +170,13 @@ public abstract class AbstractMenuPanel extends Panel {
return iconName;
}
public MenuItem setMenuHilightInterface(Class<? extends MenuHighlight> menuHilightInterface) {
this.menuHilightInterface = menuHilightInterface;
public MenuItem setMenuHighlightInterface(Class<? extends MenuHighlight> menuHighlightInterface) {
this.menuHighlightInterface = menuHighlightInterface;
return this;
}
public Class<? extends MenuHighlight> getMenuHilightInterface() {
return menuHilightInterface;
public Class<? extends MenuHighlight> getMenuHighlightInterface() {
return menuHighlightInterface;
}

@ -92,10 +92,8 @@ public class ConferencePanel extends Panel {
webMarkupContainer.setOutputMarkupId(true);
webMarkupContainer.add(new PagingNavigator("pagingNavigator", dataView));
add(webMarkupContainer);
if (boardMessageModel != null) {
if (boardMessageModel != null) {
int index = boardMessageDao.getBoardMessageSortOrderIndex(boardMessageModel.getObject());
System.out.println(index);
dataView.setCurrentPage(index/BOARDMESSAGESPERPAGE);
}
}

@ -6,11 +6,10 @@ import org.apache.wicket.markup.html.form.upload.FileUpload;
import se.su.dsv.scipro.data.dataobjects.FinalSeminar;
import se.su.dsv.scipro.data.dataobjects.FinalSeminarOpposition;
import se.su.dsv.scipro.data.dataobjects.User;
import se.su.dsv.scipro.repository.util.FileStorageException;
public interface FinalSeminarUploadController extends IClusterable {
void deleteSeminarFilesRecursive(FinalSeminar seminar);
void deleteOpponentFiles(FinalSeminarOpposition opp);
/**
@ -20,6 +19,15 @@ public interface FinalSeminarUploadController extends IClusterable {
* @throws Exception
*/
FinalSeminar deleteSeminarReport(FinalSeminar seminar) throws Exception;
/**
* Delete the upload report for the seminar, adminOverrideMode = true means no intentional exceptions will be thrown
* @param seminar
* @param adminOverrideMode
* @return
* @throws Exception
*/
FinalSeminar deleteSeminarReport(FinalSeminar seminar, boolean adminOverrideMode) throws Exception;
void storeSeminarDocument(FileUpload upload, User uploader, FinalSeminar seminar) throws Exception;

@ -78,17 +78,9 @@ public class FinalSeminarUploadControllerImpl implements FinalSeminarUploadContr
}
private void delete(String path) {
fileRepository.delete(path);
}
public void deleteSeminarFilesRecursive(final FinalSeminar seminar) throws FileStorageException {
if (seminar.getDocument() != null) {
//delete(getRepositorySeminarPath(seminar)); Use of deprecated path/method
delete(seminar.getDocument().getPath());
}
}
public void deleteOpponentFiles(final FinalSeminarOpposition opp) throws FileStorageException {
if (opp.getOpponentReport() != null) {
//delete(getRepositoryOppositionPath(opp)); Use of deprecated path/method
@ -103,18 +95,31 @@ public class FinalSeminarUploadControllerImpl implements FinalSeminarUploadContr
* @return
* @throws Exception
*/
public FinalSeminar deleteSeminarReport(FinalSeminar seminar) throws Exception {
public FinalSeminar deleteSeminarReport(FinalSeminar seminar) throws Exception{
return deleteSeminarReport(seminar, false);
}
/**
* Delete the upload report for the seminar, adminOverrideMode = true means no intentional exceptions will be thrown
* @param seminar
* @param adminOverrideMode
* @return
* @throws Exception
*/
public FinalSeminar deleteSeminarReport(FinalSeminar seminar, boolean adminOverrideMode) throws Exception {
seminar = finalSeminarDao.reLoad(seminar);
if (!seminar.getOppositions().isEmpty() || !seminar.getActiveParticipations().isEmpty()) {
throw new Exception(
"Cannot delete seminar report, seminar has opponents or active participants");
if( !adminOverrideMode ){
if (!seminar.getOppositions().isEmpty() || !seminar.getActiveParticipations().isEmpty()) {
throw new Exception(
"Cannot delete seminar report, seminar has opponents or active participants");
}
}
for (CheckPlagiarismEvent cpe : checkPlagiarismEventDao.getWithFileDescription(seminar
.getDocument())) {
checkPlagiarismEventDao.delete(cpe);
}
fileRepository.delete(seminar.getDocument().getPath());
if(seminar.getDocument() != null)
if(seminar.getDocument().getPath() != null)
fileRepository.delete(seminar.getDocument().getPath());
seminar.setDocument(null);
return finalSeminarDao.save(seminar);
}

@ -2,78 +2,73 @@
<html
xmlns:wicket="http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd">
<body>
<wicket:panel>
<div wicket:id="titleContainer">
<strong>Project Title: </strong> <span wicket:id="projectTitle"></span>
<div>
<strong>Room: </strong> <span wicket:id="room"></span>
</div>
</div>
<div class="append-bottom">
<div>
<strong>Head supervisor:</strong>
</div>
<span wicket:id="headSupervisor"></span>
</div>
<div>
<strong>Author(s): </strong>
<ul class="no-list-style">
<li wicket:id="authorsList"><span wicket:id="author"></span></li>
</ul>
</div>
<wicket:panel>
<div wicket:id="feedback"></div>
<div wicket:id="titleContainer"><strong>Project Title: </strong>
<span wicket:id="projectTitle"></span>
<div><strong>Room: </strong> <span wicket:id="room"></span></div>
</div>
<div class="append-bottom">
<div><strong>Head supervisor:</strong></div>
<span wicket:id="headSupervisor"></span></div>
<div><strong>Author(s): </strong>
<ul class="no-list-style">
<li wicket:id="authorsList"><span wicket:id="author"></span></li>
</ul>
</div>
<div>
<strong>Co-supervisor(s): </strong>
<ul class="no-list-style">
<li wicket:id="coSupervisorsList"><span
wicket:id="coSupervisor"></span></li>
</ul>
</div>
<div><strong>Co-supervisor(s): </strong>
<ul class="no-list-style">
<li wicket:id="coSupervisorsList"><span wicket:id="coSupervisor"></span></li>
</ul>
</div>
<div>
<strong>Reviewer(s): </strong>
<ul class="no-list-style">
<li wicket:id="reviewersList"><span wicket:id="reviewer"></span>
</li>
</ul>
</div>
<div><strong>Reviewer(s): </strong>
<ul class="no-list-style">
<li wicket:id="reviewersList"><span wicket:id="reviewer"></span>
</li>
</ul>
</div>
<div wicket:id="detailsContainer">
<div>
<strong>Opponent(s): </strong>
<ul class="no-list-style">
<li wicket:id="opponentsList"><span wicket:id="opponent"></span>
</li>
</ul>
</div>
<div>
<strong>Active participant(s): </strong>
<ul class="no-list-style">
<li wicket:id="activeParticipantsList"><span
wicket:id="activeParticipant"></span></li>
</ul>
</div>
<div>
<strong>Presentation Language: </strong>
<div wicket:id="seminarLanguage"></div>
</div>
<div>
<strong>Thesis/Report Language: </strong>
<div wicket:id="thesisLanguage"></div>
</div>
<strong>Thesis/Report: </strong>
<div>
<span wicket:id="seminarReportTitle"></span> <span
wicket:id="uploadInfoContainer"> <a href="#"
wicket:id="open"><img
src="images/icons/document-preview_16x16.png" alt="Open/Preview" />
</a> <a href="#" wicket:id="download"><img
src="images/icons/download_16x16.png" alt="Download" /> </a> </span>
</div>
<div wicket:id="detailsContainer">
<div><strong>Opponent(s): </strong>
<ul class="no-list-style">
<li wicket:id="opponentsList"><span wicket:id="opponent"></span>
<div wicket:id="oppositionContainer"><strong>Report:</strong> <span wicket:id="oppositionReportTitle"></span> <a href="#"
wicket:id="open"><img
src="images/icons/document-preview_16x16.png" alt="Open/Preview" />
</a> <a href="#" wicket:id="download"><img
src="images/icons/download_16x16.png" alt="Download" /> </a> <a href="#"
wicket:id="deleteOppositionReport"><img
src="images/icons/delete_16x16.png" alt="delete" /> </a>
</div>
</wicket:panel>
</li>
</ul>
</div>
<div><strong>Active participant(s): </strong>
<ul class="no-list-style">
<li wicket:id="activeParticipantsList"><span
wicket:id="activeParticipant"></span></li>
</ul>
</div>
<div><strong>Presentation Language: </strong>
<div wicket:id="seminarLanguage"></div>
</div>
<div><strong>Thesis/Report Language: </strong>
<div wicket:id="thesisLanguage"></div>
</div>
<strong>Thesis/Report: </strong>
<div><span wicket:id="seminarReportTitle"></span> <span
wicket:id="uploadInfoContainer"> <a href="#" wicket:id="open"><img
src="images/icons/document-preview_16x16.png" alt="Open/Preview" /> </a>
<a href="#" wicket:id="download"><img
src="images/icons/download_16x16.png" alt="Download" /> </a> <a href="#"
wicket:id="deleteSeminarReport"><img
src="images/icons/delete_16x16.png" alt="delete" /> </a> </span></div>
</div>
</wicket:panel>
</body>
</html>

@ -3,16 +3,21 @@ package se.su.dsv.scipro.opponent.panels;
import java.util.ArrayList;
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.list.ListItem;
import org.apache.wicket.markup.html.list.ListView;
import org.apache.wicket.markup.html.panel.EmptyPanel;
import org.apache.wicket.markup.html.panel.FeedbackPanel;
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.controllers.FinalSeminarUploadController;
import se.su.dsv.scipro.data.dao.interfaces.FinalSeminarDao;
import se.su.dsv.scipro.data.dao.interfaces.FinalSeminarOppositionDao;
import se.su.dsv.scipro.data.dataobjects.FinalSeminar;
import se.su.dsv.scipro.data.dataobjects.FinalSeminarActiveParticipation;
import se.su.dsv.scipro.data.dataobjects.FinalSeminarOpposition;
@ -23,6 +28,9 @@ import se.su.dsv.scipro.data.dataobjects.User;
import se.su.dsv.scipro.data.enums.ProjectTeamMemberRoles;
import se.su.dsv.scipro.repository.components.FileDownloadLink;
import se.su.dsv.scipro.repository.components.FileOpenLink;
import se.su.dsv.scipro.security.auth.MetaDataActionStrategy;
import se.su.dsv.scipro.security.auth.roles.Roles;
import se.su.dsv.scipro.util.JavascriptEventConfirmation;
public class FinalSeminarDetailsPanel extends Panel {
@ -30,11 +38,15 @@ public class FinalSeminarDetailsPanel extends Panel {
@SpringBean
private FinalSeminarDao finalSeminarDao;
@SpringBean
private FinalSeminarOppositionDao finalSeminarOppositionDao;
@SpringBean
private FinalSeminarUploadController finalSeminarUploadController;
public FinalSeminarDetailsPanel(final String id, final FinalSeminar seminar2,
final boolean details) {
public FinalSeminarDetailsPanel(final String id, final FinalSeminar seminar2, final boolean details) {
super(id);
this.setOutputMarkupId(true);
add(new FeedbackPanel("feedback"));
final FinalSeminar seminar = finalSeminarDao.reLoad(seminar2);
final Project project = seminar.getProject();
WebMarkupContainer titleContainer = new WebMarkupContainer("titleContainer") {
@ -53,8 +65,7 @@ public class FinalSeminarDetailsPanel extends Panel {
});
titleContainer.add(new Label("room", seminar.getRoom()));
add(titleContainer);
add(new ListView<Student>("authorsList", new ArrayList<Student>(
project.getProjectParticipants())) {
add(new ListView<Student>("authorsList", new ArrayList<Student>(project.getProjectParticipants())) {
private static final long serialVersionUID = 1L;
@Override
@ -111,41 +122,77 @@ public class FinalSeminarDetailsPanel extends Panel {
};
detailsContainer.add(new ListView<FinalSeminarOpposition>("opponentsList", seminar
.getOppositions()) {
detailsContainer.add(new ListView<FinalSeminarOpposition>("opponentsList", seminar.getOppositions()) {
private static final long serialVersionUID = 1L;
@Override
protected void populateItem(ListItem<FinalSeminarOpposition> item) {
item.add(item.getModelObject().getOpponent().getUser()
.getDisplayComponent("opponent", true));
protected void populateItem(final ListItem<FinalSeminarOpposition> item) {
item.add(item.getModelObject().getOpponent().getUser().getDisplayComponent("opponent", true));
WebMarkupContainer oppCon = new WebMarkupContainer("oppositionContainer"){
private static final long serialVersionUID = 1L;
@Override
public boolean isVisible(){
return item.getModelObject().getOpponentReport() != null;
}
};
//Students are not allowed to view other students opposition reports
MetaDataActionStrategy.authorize(oppCon, Roles.EMPLOYEE);
item.add(oppCon);
String reportTitle = "";
if(item.getModelObject().getOpponentReport() != null)
reportTitle = item.getModelObject().getOpponentReport().getName();
oppCon.add(new Label("oppositionReportTitle", reportTitle));
oppCon.add(new FileDownloadLink("download", item.getModelObject().getOpponentReport()));
oppCon.add(new FileOpenLink("open", item.getModelObject().getOpponentReport()));
oppCon.add(new AjaxLink<Void>("deleteOppositionReport"){
private static final long serialVersionUID = 1L;
{
MetaDataActionStrategy.authorize(this, Roles.ADMIN);
this.add(new JavascriptEventConfirmation("onclick", "Do you really want to delete this user-uploaded report?"));
}
@Override
public void onClick(AjaxRequestTarget target) {
try{
finalSeminarUploadController.deleteOpponentFiles(item.getModelObject());
FinalSeminarOpposition opp = item.getModelObject();
opp.setOpponentReport(null);
opp = finalSeminarOppositionDao.save(opp);
item.setModelObject(opp);
info("Opposition report deleted");
} catch(Exception e){
e.printStackTrace();
error("Something went wrong, see log files for stacktrace");
}
target.addComponent(FinalSeminarDetailsPanel.this);
}
});
add(item);
}
});
detailsContainer.add(new ListView<FinalSeminarActiveParticipation>(
"activeParticipantsList", seminar.getActiveParticipations()) {
detailsContainer.add(new ListView<FinalSeminarActiveParticipation>("activeParticipantsList", seminar.getActiveParticipations()) {
private static final long serialVersionUID = 1L;
@Override
protected void populateItem(ListItem<FinalSeminarActiveParticipation> item) {
item.add(item.getModelObject().getUser()
.getDisplayComponent("activeParticipant", true));
item.add(item.getModelObject().getUser().getDisplayComponent("activeParticipant", true));
add(item);
}
});
detailsContainer.add(new Label("seminarLanguage", seminar.getPresentationLanguage()
.toString()));
detailsContainer.add(new Label("seminarLanguage", seminar.getPresentationLanguage().toString()));
detailsContainer.add(new Label("thesisLanguage", seminar.getReportLanguage().toString()));
detailsContainer.add(new Label("seminarReportTitle", new Model<String>() {
private static final long serialVersionUID = 1L;
@Override
public String getObject() {
return seminar.getDocument() == null ? "No thesis/report uploaded" : seminar
.getDocument().getName();
return seminar.getDocument() == null ? "No thesis/report uploaded" : seminar.getDocument().getName();
}
}));
@ -161,6 +208,27 @@ public class FinalSeminarDetailsPanel extends Panel {
uploadInfoContainer.add(new FileDownloadLink("download", seminar.getDocument()));
uploadInfoContainer.add(new FileOpenLink("open", seminar.getDocument()));
uploadInfoContainer.add(new AjaxLink<Void>("deleteSeminarReport") {
private static final long serialVersionUID = 1L;
{
MetaDataActionStrategy.authorize(this, Roles.ADMIN);
this.add(new JavascriptEventConfirmation("onclick", "Do you really want to delete this user-uploaded report?"));
}
@Override
public void onClick(AjaxRequestTarget target) {
try {
finalSeminarUploadController.deleteSeminarReport(seminar, true);
seminar.setDocument(null); //Only to repaint the ajax call without the document icons
info("Report deleted");
} catch (Exception e) {
e.printStackTrace();
error("Deletion failed");
}
target.addComponent(FinalSeminarDetailsPanel.this);
}
});
detailsContainer.add(uploadInfoContainer);
add(detailsContainer);

@ -5,6 +5,7 @@
<wicket:panel>
<div class="span-22 prepend-top last">
<div wicket:id="feedback"></div>
<table class="rounded-table seminar-table even-rows">
<tr>
<th>Date</th>

@ -47,8 +47,8 @@ import se.su.dsv.scipro.opponent.models.OpponentModel;
public class OpponentListViewPanel extends Panel {
/**
*
*/
*
*/
private static final long serialVersionUID = 4988253889884804250L;
@SpringBean
@ -76,6 +76,10 @@ public class OpponentListViewPanel extends Panel {
super(id);
this.adminView = adminView;
loadListView(seminarList);
feedbackPanel = new FeedbackPanel("feedback");
add(feedbackPanel);
this.setOutputMarkupId(true);
editSeminarDialogContainer = new WebMarkupContainer("dialogContainer");
editSeminarDialog = new Dialog("dialog");
editSeminarDialog.setModal(true);
@ -96,7 +100,7 @@ public class OpponentListViewPanel extends Panel {
add(contactsSeminarDialog);
contactsDialogContainer.setOutputMarkupId(true);
contactsDialogContainer.add(contactsSeminarForm = new ContactsSeminarForm(
"contactsSeminarForm"));
"contactsSeminarForm"));
contactsSeminarForm.setOutputMarkupId(true);
add(linkListView);
@ -125,7 +129,7 @@ public class OpponentListViewPanel extends Panel {
User headSupervisor = seminar.getProject().getHeadSupervisor().getUser();
headSupervisorString += headSupervisor.getFirstName() + " "
+ headSupervisor.getLastName();
+ headSupervisor.getLastName();
item.add(new Label("headSupervisor", headSupervisorString));
item.add(new Label("projectClass", seminar.getProject().getProjectClass().getName()));
@ -191,20 +195,25 @@ public class OpponentListViewPanel extends Panel {
@Override
public void onClick(AjaxRequestTarget target) {
FinalSeminar seminar2 = finalSeminarDao.reLoad(seminar);
seminarUploadController.deleteSeminarFilesRecursive(seminar2);
for (FinalSeminarActiveParticipation al : seminar2
.getActiveParticipations()) {
finalSeminarActiveParticipationDao.delete(al);
}
try{
seminarUploadController.deleteSeminarReport(seminar2, true);
for (FinalSeminarActiveParticipation al : seminar2
.getActiveParticipations()) {
finalSeminarActiveParticipationDao.delete(al);
}
for (FinalSeminarOpposition fso : seminar2
.getOppositions()) {
seminarUploadController.deleteOpponentFiles(fso);
finalSeminarOppositionDao.delete(fso);
for (FinalSeminarOpposition fso : seminar2
.getOppositions()) {
seminarUploadController.deleteOpponentFiles(fso);
finalSeminarOppositionDao.delete(fso);
}
finalSeminarDao.delete(seminar2);
info("Final seminar deleted");
} catch (Exception e){
error("Something went wrong, see logs for stacktrace");
e.printStackTrace();
}
finalSeminarDao.delete(seminar2);
setResponsePage(AdminFinalSeminarPage.class);
target.addComponent(OpponentListViewPanel.this);
}
@Override
@ -227,7 +236,7 @@ public class OpponentListViewPanel extends Panel {
@Override
public CharSequence decorateScript(CharSequence script) {
String ret = "if(!confirm('The attendees of this seminar will NOT be notified that the seminar has been deleted, are you sure you wish to delete it?')) return false; "
+ script;
+ script;
return ret;
}
};
@ -243,8 +252,8 @@ public class OpponentListViewPanel extends Panel {
private class EditSeminarForm extends Form<OpponentModel> {
/**
*
*/
*
*/
private static final long serialVersionUID = -5004827722926732419L;
public EditSeminarForm(String name) {
@ -257,8 +266,8 @@ public class OpponentListViewPanel extends Panel {
private class EditForm extends Form<Void> {
/**
*
*/
*
*/
private static final long serialVersionUID = 5882957818616996808L;
public EditForm(String name, final FinalSeminar seminar) {
@ -290,8 +299,8 @@ public class OpponentListViewPanel extends Panel {
private class ContactsSeminarForm extends Form<OpponentModel> {
/**
*
*/
*
*/
private static final long serialVersionUID = -5004827722926732419L;
public ContactsSeminarForm(String name) {
@ -306,8 +315,8 @@ public class OpponentListViewPanel extends Panel {
private class ContactsForm extends Form<Void> {
/**
*
*/
*
*/
private static final long serialVersionUID = -8271761600388217566L;
public ContactsForm(String name, final FinalSeminar seminar) {
@ -316,8 +325,8 @@ public class OpponentListViewPanel extends Panel {
add(new AjaxButton("contacts", new Model<String>("Details")) {
/**
*
*/
*
*/
private static final long serialVersionUID = 1211337464815824507L;
@Override

@ -23,22 +23,15 @@ public class ProjectFinalSeminarContainerPanel extends Panel {
public ProjectFinalSeminarContainerPanel(final String id, final Project project, final boolean isSupervisorView){
super(id);
final List<FinalSeminar> seminars = finalSeminarDao.findFinalSeminarsByProject(project);
List<FinalSeminar> seminars = finalSeminarDao.findFinalSeminarsByProject(project);
if(isSupervisorView && !seminars.isEmpty() ){
if(isSupervisorView && seminars.isEmpty() ){
add(new OpponentPanel("addSeminar", project));
}
else {
add(new EmptyPanel("addSeminar"));
}
add(new Label("noSeminarsMessage", "No final seminar has been created for this project"){
private static final long serialVersionUID = 1L;
@Override
public boolean isVisible(){
return seminars.size() == 0;
}
});
add(new Label("noSeminarsMessage", "No final seminar has been created for this project").setVisible(seminars.isEmpty()));
add(new ListView<FinalSeminar>("seminarList", seminars){
private static final long serialVersionUID = 1L;

@ -221,7 +221,7 @@ public class ProjectFinalSeminarPanel extends Panel {
public boolean isVisible() {
return !isSupervisorView && seminar.getActiveParticipations().isEmpty()
&& seminar.getOppositions().isEmpty() && seminar.getTurnitinId() != null;
&& seminar.getOppositions().isEmpty() && seminar.getTurnitinId() == null;
}
@Override

@ -89,7 +89,7 @@
<span class="box-title">Best rated reviewers</span>
<div wicket:id="bestRatedPanel" class="append-bottom"></div>
</div>
<div>
<div wicket:id="statsTimespanContainer">
<i><span class="small right">Last 12 months</span></i>
</div>
</div>

@ -221,16 +221,23 @@ public class PeerPortalPanel extends Panel {
int displayedReviews = gsettings.getNumberOfLatestReviewsDisplayed();
boolean showStatsTimespan = false;
if(gsettings.isPeerDisplayNumberOfReviewsPerformed()){
add(new MostFrequentReviewersPanel(mostFrequentPanel));
showStatsTimespan = true;
} else {
add(new InvisiblePanel(mostFrequentPanel));
}
if( gsettings.isPeerRatingsEnabled() ){
add(new WebMarkupContainer(bestRatedContainer).add(new BestRatedReviewersPanel("bestRatedPanel") ) );
showStatsTimespan = true;
} else {
add(new InvisiblePanel(bestRatedContainer));
}
WebMarkupContainer statsTimespanContainer = new WebMarkupContainer("statsTimespanContainer");
statsTimespanContainer.setVisible(showStatsTimespan);
add(statsTimespanContainer);
if(gsettings.isPeerDisplayLatestReviews()) {
// Checkbox on the AdminPeerSettingsPage is not visible since it's
// not decided what kind of info that should be public for students.

@ -27,6 +27,7 @@ public abstract class ProjectPage extends MenuPage implements FilePanelContainer
public ProjectPage(PageParameters pp) {
Project activeProject = SciProSession.get().getActiveProject();
User u = SciProSession.get().getUser();
if(activeProject == null && (this.getClass() != NoActiveProjectPage.class && this.getClass() != ProjectPartnerPage.class)){
User user = SciProSession.get().getUser();

@ -64,8 +64,8 @@
<!-- Use deployment for production, development for development -->
<context-param>
<param-name>configuration</param-name>
<!-- <param-value>development</param-value> -->
<param-value>deployment</param-value>
<!--<param-value>development</param-value> -->
<param-value>deployment</param-value>
</context-param>

Binary file not shown.

After

(image error) Size: 1.1 KiB

@ -1,230 +0,0 @@
@CHARSET "UTF-8";
html, body {
font-family: Calibri, Tahoma, Verdana, sans-serif;
margin: 0 0 0 0;
padding: 0 0 0 0;
font-size: 0.94em;
line-height: 1.5em;
padding-top: 30px;
}
h1, h2, h3 {
font-family: Cambria, Tahoma, Verdana, sans-serif;
}
#container {
width: 960px;
margin: auto;
}
#ajax-loader {
z-index:9999;
position: fixed;
top: 0;
left: 0;
width: 80px;
height: 30px;
background-color: #FFFF80;
border-bottom: 1px solid black;
border-right: 1px solid black;
}
#veil {
opacity:0.3;
filter:alpha(opacity=50);
position:absolute;
width: 100%;
height: 100%;
z-index:9998;
background-color: white;
}
#veil-loader {
z-index:9999;
position: absolute;
top: 30%;
left: 45%;
width: 100px;
height: 100px;
background: url(../images/ajax-loader.gif) center no-repeat;
}
p.inline {
display: inline;
}
.connectedSortable {
cursor: move;
}
.float-right {
float:right;
}
.float-left {
float:left;
}
td.icon,
span.icon {
padding-left: 20px;
line-height: 20px; /* To center the text vertically with the icon */
}
span.floating-icon {
width: 20px;
height: 20px;
}
td.icon-button,
span.icon-button {
cursor: pointer;
}
td.icon-user,
span.icon-user { /*The background image*/
background: url(../images/user.png) no-repeat left center;
}
td.icon-project,
span.icon-project { /*The background image*/
background: url(../images/project.png) no-repeat left center;
}
td.icon-arrowDown,
span.icon-arrowDown {
background: url(../images/icons/arrow-down.png) no-repeat left center;
}
td.icon-plus,
span.icon-plus {
background: url(../images/icons/add.gif) no-repeat left center;
}
td.icon-minus,
span.icon-minus {
background: url(../images/icons/minus.gif) no-repeat left center;
}
td.icon-check,
span.icon-check {
background: url(../images/icons/circle-check.png) no-repeat left center;
}
td.icon-pencil,
span.icon-pencil { /*The background image*/
background: url(../images/icons/pencil.png) no-repeat left center;
}
td.icon-delete,
span.icon-delete { /*The background image*/
background: url(../images/icons/circle-delete.png) no-repeat left center;
}
td.icon-zoom-in,
span.icon-zoom-in { /*The background image*/
background: url(../images/icons/zoom-in.png) no-repeat left center;
}
.bordered-box {
border: 1px solid #CCE6FF;
padding: 0.5em 0.5em;
}
.float-left {
float: left;
}
.float-right {
float: right;
}
.boxContent {
margin: 0.5em 0.5em;
}
.boxContent h4 {
border: 1px solid #0099CC;
background-color: #CCE6FF;
padding: 0.3em 0.3em;
}
.dashboardBox {
border: 1px solid #3300CC;
width: 50em;
min-height: 10em;
}
.dashboardBox h3 {
border-bottom: 1px solid #3300CC;
background-color: blue;
color: white;
padding: 0.2em;
margin: 0 0;
}
form.div {
display:block;
}
form.formRow {
display: inline;
}
#schedulePlannerCtrlContainer {
border: 1px solid #CCE6FF;
}
#schedulePlannerCtrlContainer ul {
list-style-type: none;
display: inline;
}
.scheduleEventList {
margin: 1em 0;
}
.scheduleEvent {
padding: 0.2em 0.2em;
-webkit-border-radius: 3px;
background-color: #E5F3FF;
border: 1px solid #B3DBFF;
}
.scheduleEventHeader {
padding: 0.4em 0.2em;
}
.scheduleEventHeaderBar {
margin-left: 0.5em;
}
.scheduleEventHeaderBar img {
float:left;
margin-right: 1em;
margin-left: 0.5em;
}
.scheduleEventHeaderBar span {
display: inline;
margin-left: 0.1em;
}
.scheduleEventIconbar {
margin: 0.4em 1em;
padding: 0.3em;
}
.scheduleEventContent {
padding: 0.3em 0.5em;
width: 45em;
}
.scheduleEventFooter {
margin-top: 1em;
}
form.dialogForm {
font-size: 0.9em;
}

@ -110,7 +110,7 @@ public class TestBoardMessageDaoJPA {
messageBoard = new MessageBoard(presenterProject);
messageBoard.setTitle("test");
messageBoard.getBoardMessages().add(boardMessage);
messageBoard.addToBoardMessages(boardMessage);
messageBoard = messageBoardDao.save(messageBoard);