fixed merge conflicts
This commit is contained in:
commit
3b160e63cc
src/main
java/se/su/dsv/scipro
admin/pages
checklists/panels
project/pages
webapp
@ -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
|
||||
|
@ -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?");
|
||||
|
@ -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>
|
||||
|
||||
|
||||
|
BIN
src/main/webapp/images/icons/grey_ball_32.png
Normal file
BIN
src/main/webapp/images/icons/grey_ball_32.png
Normal file
Binary file not shown.
After ![]() (image error) Size: 1.1 KiB |
Loading…
x
Reference in New Issue
Block a user