forked from sakaiproject/sakai
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
More work on the next step of the import process
- Loading branch information
Showing
6 changed files
with
204 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 15 additions & 43 deletions
58
tool/src/java/org/sakaiproject/gradebookng/tool/panels/GradeImportConfirmationStep.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,24 @@ | ||
<wicket:panel xmlns:wicket="http://wicket.apache.org"> | ||
|
||
<div><wicket:message key="importExport.confirmation.heading" /></div> | ||
<div><wicket:message key="importExport.confirmation.description" /></div> | ||
<div><wicket:message key="importExport.confirmation.note" /></div> | ||
<div><wicket:message key="importExport.confirmation.update.description" /></div> | ||
|
||
<!--<form wicket:id="form">--> | ||
<!--<span wicket:id="group">--> | ||
<!--<input type="checkbox" wicket:id="groupselector">check/uncheck all</input>--> | ||
<!--<tr wicket:id="grades">--> | ||
<!--<td><input type="checkbox" wicket:id="checkbox"/></td>--> | ||
<!--<td><span wicket:id="studentId">[this is where name will be]</span></td>--> | ||
<!--<td><span wicket:id="studentName">[this is where lastname will be]</span></td>--> | ||
<!--</tr>--> | ||
<!--</span>--> | ||
<!--</form>--> | ||
<table cellspacing="0" cellpadding="2"> | ||
<tr wicket:id="grades_update"> | ||
<td><span wicket:id="itemTitle">[this is where itemTitle will be]</span></td> | ||
</tr> | ||
</table> | ||
|
||
<div><wicket:message key="importExport.confirmation.create.description" /></div> | ||
|
||
<table cellspacing="0" cellpadding="2"> | ||
<tr wicket:id="grades_create"> | ||
<td><span wicket:id="itemTitle">[this is where itemTitle will be]</span></td> | ||
</tr> | ||
</table> | ||
|
||
<form wicket:id="form"> | ||
<span wicket:id="group"> | ||
<table style="border: 2px dotted #fc0; width: 400px; padding: 5px;"> | ||
<tr> | ||
<td valign="top">Select grades</td> | ||
<td> | ||
<input type="checkbox" wicket:id="groupselector">check/uncheck all</input><br/> | ||
<table cellspacing="0" cellpadding="2"> | ||
<tr> | ||
<td><b>Select</b></td> | ||
<td><b>Title</b></td> | ||
<td><b>Point Value</b></td> | ||
<td><b>Status</b></td> | ||
</tr> | ||
<tr wicket:id="grades"> | ||
<td><input type="checkbox" wicket:id="checkbox"/></td> | ||
<td><span wicket:id="itemTitle">[this is where itemTitle will be]</span></td> | ||
<td><span wicket:id="itemPointValue">[this is where itemPointValue will be]</span></td> | ||
<td><span wicket:id="status">[this is where status will be]</span></td> | ||
</tr> | ||
</table> | ||
<span valign="top"> | ||
</span> | ||
</td> | ||
</tr> | ||
<tr> | ||
<td colspan="2" align="center"> | ||
<input type="submit" value="submit" /> | ||
</td> | ||
</tr> | ||
</table> | ||
</span> | ||
<input type="submit" value="submit" /> | ||
</form> | ||
|
||
</wicket:panel> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
tool/src/java/org/sakaiproject/gradebookng/tool/panels/GradeItemImportSelectionStep.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<wicket:panel xmlns:wicket="http://wicket.apache.org"> | ||
|
||
<div><wicket:message key="importExport.selection.heading" /></div> | ||
<div><wicket:message key="importExport.selection.description" /></div> | ||
<div><wicket:message key="importExport.selection.note" /></div> | ||
|
||
<form wicket:id="form"> | ||
<span wicket:id="group"> | ||
<table style="border: 2px dotted #fc0; width: 400px; padding: 5px;"> | ||
<tr> | ||
<td valign="top">Select grades</td> | ||
<td> | ||
<input type="checkbox" wicket:id="groupselector">check/uncheck all</input><br/> | ||
<table cellspacing="0" cellpadding="2"> | ||
<tr> | ||
<td><b>Select</b></td> | ||
<td><b>Title</b></td> | ||
<td><b>Point Value</b></td> | ||
<td><b>Status</b></td> | ||
</tr> | ||
<tr wicket:id="grades"> | ||
<td><input type="checkbox" wicket:id="checkbox"/></td> | ||
<td><span wicket:id="itemTitle">[this is where itemTitle will be]</span></td> | ||
<td><span wicket:id="itemPointValue">[this is where itemPointValue will be]</span></td> | ||
<td><span wicket:id="status">[this is where status will be]</span></td> | ||
</tr> | ||
</table> | ||
<span valign="top"> | ||
</span> | ||
</td> | ||
</tr> | ||
<tr> | ||
<td colspan="2" align="center"> | ||
<input type="submit" value="submit" /> | ||
</td> | ||
</tr> | ||
</table> | ||
</span> | ||
</form> | ||
|
||
<div><wicket:message key="importExport.selection.details" /></div> | ||
|
||
</wicket:panel> |
82 changes: 82 additions & 0 deletions
82
tool/src/java/org/sakaiproject/gradebookng/tool/panels/GradeItemImportSelectionStep.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
package org.sakaiproject.gradebookng.tool.panels; | ||
|
||
import org.apache.log4j.Logger; | ||
import org.apache.wicket.Component; | ||
import org.apache.wicket.markup.html.basic.Label; | ||
import org.apache.wicket.markup.html.form.Check; | ||
import org.apache.wicket.markup.html.form.CheckGroup; | ||
import org.apache.wicket.markup.html.form.CheckGroupSelector; | ||
import org.apache.wicket.markup.html.form.Form; | ||
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.PropertyModel; | ||
import org.sakaiproject.gradebookng.business.model.ImportedGrade; | ||
import org.sakaiproject.gradebookng.business.model.ProcessedGradeItem; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
/** | ||
* Created by chmaurer on 1/22/15. | ||
*/ | ||
public class GradeItemImportSelectionStep extends Panel { | ||
|
||
private static final Logger log = Logger.getLogger(GradeItemImportSelectionStep.class); | ||
|
||
private String panelId; | ||
|
||
public GradeItemImportSelectionStep(String id, List<ProcessedGradeItem> processedGradeItems) { | ||
super(id); | ||
this.panelId = id; | ||
|
||
final CheckGroup<ImportedGrade> group = new CheckGroup<ImportedGrade>("group", new ArrayList<ImportedGrade>()); | ||
|
||
Form<?> form = new Form("form") | ||
{ | ||
@Override | ||
protected void onSubmit() | ||
{ | ||
info("selected grade(s): " + group.getDefaultModelObjectAsString()); | ||
|
||
//repaint panel | ||
Component newPanel = new GradeImportConfirmationStep(panelId, (List<ProcessedGradeItem>)group.getDefaultModelObject()); | ||
newPanel.setOutputMarkupId(true); | ||
GradeItemImportSelectionStep.this.replaceWith(newPanel); | ||
|
||
} | ||
}; | ||
add(form); | ||
form.add(group); | ||
group.add(new CheckGroupSelector("groupselector")); | ||
ListView<ProcessedGradeItem> gradeList = new ListView<ProcessedGradeItem>("grades", | ||
processedGradeItems) | ||
{ | ||
/** | ||
* @see org.apache.wicket.markup.html.list.ListView#populateItem(org.apache.wicket.markup.html.list.ListItem) | ||
*/ | ||
@Override | ||
protected void populateItem(ListItem<ProcessedGradeItem> item) | ||
{ | ||
|
||
item.add(new Check<ProcessedGradeItem>("checkbox", item.getModel())); | ||
item.add(new Label("itemTitle", | ||
new PropertyModel<String>(item.getDefaultModel(), "itemTitle"))); | ||
item.add(new Label("itemPointValue", new PropertyModel<String>(item.getDefaultModel(), | ||
"itemPointValue"))); | ||
|
||
//Use the status code to look up the text representation | ||
PropertyModel<Integer> statusProp = new PropertyModel<Integer>(item.getDefaultModel(), "status"); | ||
Integer status = statusProp.getObject(); | ||
String statusValue = getString("importExport.status." + status); | ||
item.add(new Label("status", statusValue)); | ||
} | ||
|
||
}; | ||
|
||
gradeList.setReuseItems(true); | ||
group.add(gradeList); | ||
|
||
} | ||
|
||
} |