Skip to content

Commit

Permalink
Merge pull request sakaiproject#430 from baholladay/DAC-77
Browse files Browse the repository at this point in the history
DAC-77 DA: Update layout for new Sakai UI
  • Loading branch information
Bryan Holladay committed May 5, 2015
2 parents d3fb83f + 755ae12 commit d89fc8e
Show file tree
Hide file tree
Showing 10 changed files with 37 additions and 34 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<wicket:panel>
<a wicket:id="advancedOptionsLink"><span wicket:id="advancedOptionsSpan"/></a>
<span wicket:id="advancedOptionsSpan" id="advancedOptionsSpan" style="display:none; width: 450px; position: absolute; left: 200px; top: 130px; z-index: 1000000;">
<span wicket:id="advancedOptionsSpan" id="advancedOptionsSpan" style="display:none; width: 550px; position: absolute; left: 35%; top: 230px; z-index: 1000000;">
<div style="border: 1px solid black; padding: 1px; background-color: #eee">
<div style="overflow: auto; width: 100%">
<div style="float: right; padding: 0.2em; padding-right: 1em; color: black;">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<wicket:panel>
<a wicket:id="inheritedToolsLink"><wicket:message key="inheritedToolsHeader"/></a>
<span wicket:id="inheritedSpan" id="inheritedSpan" style="display:none; width: 450px; position: absolute; left: 200px; top: 130px; z-index: 1000000;">
<span wicket:id="inheritedSpan" id="inheritedSpan" style="display:none; width: 550px; position: absolute; left: 35%; top: 230px; z-index: 1000000;">
<div style="border: 1px solid black; padding: 1px; background-color: #eee">
<div style="overflow: auto; width: 100%">
<div style="float: right; padding: 0.2em; padding-right: 1em; color: black;">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<wicket:panel>
<a wicket:id="advancedOptionsLink"><span wicket:id="advancedOptionsSpan"/></a>
<span wicket:id="advancedOptionsSpan" id="advancedOptionsSpan" style="display:none; width: 450px; position: absolute; left: 200px; top: 130px; z-index: 1000000;">
<span wicket:id="advancedOptionsSpan" id="advancedOptionsSpan" style="display:none; width: 550px; position: absolute; left: 35%; top: 230px; z-index: 1000000;">
<div style="border: 1px solid black; padding: 1px; background-color: #eee">
<div style="overflow: auto; width: 100%">
<div style="float: right; padding: 0.2em; padding-right: 1em; color: black;">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<wicket:panel>
<a wicket:id="inheritedToolsLink"><wicket:message key="inheritedToolsHeader"/></a>
<span wicket:id="inheritedSpan" id="inheritedSpan" style="display:none; width: 450px; position: absolute; left: 200px; top: 130px; z-index: 1000000;">
<span wicket:id="inheritedSpan" id="inheritedSpan" style="display:none; width: 550px; position: absolute; left: 35%; top: 230px; z-index: 1000000;">
<div style="border: 1px solid black; padding: 1px; background-color: #eee">
<div style="overflow: auto; width: 100%">
<div style="float: right; padding: 0.2em; padding-right: 1em; color: black;">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<wicket:panel>
<select name="roleChoices" wicket:id="roleChoices"></select>
<select name="roleChoices" wicket:id="roleChoices" style="font-size: .8em;"></select>
</wicket:panel>
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<wicket:panel>
<a wicket:id="restrictToolsLink"><span wicket:id="restrictToolsSpan"/></a>
<img wicket:id="noToolsSelectedWarning" src="/library/image/silk/exclamation.png"/>
<span wicket:id="editableSpan" id="editableSpan" style="display:none; width: 450px; position: absolute; left: 200px; top: 130px; z-index: 1000000;">
<span wicket:id="editableSpan" id="editableSpan" style="display:none; width: 550px; position: absolute; left: 35%; top: 230px; z-index: 1000000;">
<div style="border: 1px solid black; padding: 1px; background-color: #eee">
<div style="overflow: auto; width: 100%">
<div style="float: right; padding: 0.2em; padding-right: 1em; color: black;">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<wicket:panel>
<a wicket:id="inheritedToolsLink"><wicket:message key="inheritedToolsHeader"/></a>
<span wicket:id="inheritedSpan" id="inheritedSpan" style="display:none; width: 450px; position: absolute; left: 200px; top: 130px; z-index: 1000000;">
<span wicket:id="inheritedSpan" id="inheritedSpan" style="display:none; width: 550px; position: absolute; left: 35%; top: 230px; z-index: 1000000;">
<div style="border: 1px solid black; padding: 1px; background-color: #eee">
<div style="overflow: auto; width: 100%">
<div style="float: right; padding: 0.2em; padding-right: 1em; color: black;">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,21 +190,24 @@ protected void onComponentTag(ComponentTag tag) {
if(hierarchySelectOptions == null || hierarchySelectOptions.size() == 0){
hierarchySelectOptions = new HashMap<String, List<SelectOption>>();
HierarchyNodeSerialized rootNode = projectLogic.getRootNodeId();
Set<HierarchyNodeSerialized> nodes = projectLogic.getDirectNodes(rootNode.id);
List<SelectOption> options = new ArrayList<SelectOption>();
if(nodes != null){
for(HierarchyNodeSerialized node : nodes){
options.add(new SelectOption(node.description, node.id));
}
}
Collections.sort(options, optionComparator);
hierarchySelectOptions.put(rootNode.id, options);
nodeSelects = new HashMap<String, SelectOption>();
//since nothing is selected, set the node selection to null
nodeSelects.put(rootNode.id, null);
//add the root node as the first selection
nodeSelectOrder = new ArrayList<String>();
nodeSelectOrder.add(rootNode.id);
if(rootNode != null && rootNode.id != null && !"".equals(rootNode.id)){
Set<HierarchyNodeSerialized> nodes = projectLogic.getDirectNodes(rootNode.id);
List<SelectOption> options = new ArrayList<SelectOption>();
if(nodes != null){
for(HierarchyNodeSerialized node : nodes){
options.add(new SelectOption(node.description, node.id));
}
}
Collections.sort(options, optionComparator);
hierarchySelectOptions.put(rootNode.id, options);

//since nothing is selected, set the node selection to null
nodeSelects.put(rootNode.id, null);
//add the root node as the first selection
nodeSelectOrder.add(rootNode.id);
}
}
final ChoiceRenderer choiceRenderer = new ChoiceRenderer("label", "value");
DataView dropdowns = new DataView("hierarchyDropdowns", new IDataProvider<String>(){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,9 +219,9 @@ protected void onSubmit(AjaxRequestTarget target, Form<?> arg1) {
}
}
//set the size of the role Column (shopper becomes)
int roleColumnSize = 40 + largestRole.length() * 6;
if(roleColumnSize < 115){
roleColumnSize = 115;
int roleColumnSize = 80 + largestRole.length() * 6;
if(roleColumnSize < 155){
roleColumnSize = 155;
}
boolean singleRoleOptions = false;
if(roleMap.size() == 1){
Expand All @@ -244,11 +244,11 @@ protected void onSubmit(AjaxRequestTarget target, Form<?> arg1) {
columnsList.add(new PropertyEditableColumnDropdown(new ColumnLocation(Alignment.RIGHT, roleColumnSize, Unit.PX), new StringResourceModel("shoppersBecome", null).getString(),
"userObject.roleOption", roleMap, DelegatedAccessConstants.TYPE_ACCESS_SHOPPING_PERIOD_USER, null));
}
columnsList.add(new PropertyEditableColumnDate(new ColumnLocation(Alignment.RIGHT, 100, Unit.PX), new StringResourceModel("startDate", null).getString(), "userObject.shoppingPeriodStartDate", true));
columnsList.add(new PropertyEditableColumnDate(new ColumnLocation(Alignment.RIGHT, 100, Unit.PX), new StringResourceModel("endDate", null).getString(), "userObject.shoppingPeriodEndDate", false));
columnsList.add(new PropertyEditableColumnList(new ColumnLocation(Alignment.RIGHT, 96, Unit.PX), new StringResourceModel("showToolsHeader", null).getString(),
columnsList.add(new PropertyEditableColumnDate(new ColumnLocation(Alignment.RIGHT, 104, Unit.PX), new StringResourceModel("startDate", null).getString(), "userObject.shoppingPeriodStartDate", true));
columnsList.add(new PropertyEditableColumnDate(new ColumnLocation(Alignment.RIGHT, 104, Unit.PX), new StringResourceModel("endDate", null).getString(), "userObject.shoppingPeriodEndDate", false));
columnsList.add(new PropertyEditableColumnList(new ColumnLocation(Alignment.RIGHT, 120, Unit.PX), new StringResourceModel("showToolsHeader", null).getString(),
"userObject.restrictedAuthTools", DelegatedAccessConstants.TYPE_ACCESS_SHOPPING_PERIOD_USER, DelegatedAccessConstants.TYPE_LISTFIELD_TOOLS));
columnsList.add(new PropertyEditableColumnAdvancedOptions(new ColumnLocation(Alignment.RIGHT, 75, Unit.PX), new StringResourceModel("advanced", null).getString(), "userObject.shoppingPeriodRevokeInstructorEditable", DelegatedAccessConstants.TYPE_ACCESS_SHOPPING_PERIOD_USER));
columnsList.add(new PropertyEditableColumnAdvancedOptions(new ColumnLocation(Alignment.RIGHT, 92, Unit.PX), new StringResourceModel("advanced", null).getString(), "userObject.shoppingPeriodRevokeInstructorEditable", DelegatedAccessConstants.TYPE_ACCESS_SHOPPING_PERIOD_USER));
IColumn columns[] = columnsList.toArray(new IColumn[columnsList.size()]);

final boolean activeSiteFlagEnabled = sakaiProxy.isActiveSiteFlagEnabled();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,10 +211,10 @@ protected void onSubmit(AjaxRequestTarget target, Form<?> arg1) {
}
}
//set the size of the role Column (shopper becomes)
int roleColumnSize = 40 + largestRole.length() * 6;
if(roleColumnSize < 115){
int roleColumnSize = 80 + largestRole.length() * 6;
if(roleColumnSize < 155){
//for "Choose One" default option
roleColumnSize = 115;
roleColumnSize = 155;
}
boolean singleRoleOptions = false;
if(roleMap.size() == 1){
Expand All @@ -232,19 +232,19 @@ protected void onSubmit(AjaxRequestTarget target, Form<?> arg1) {
columnsList.add(new PropertyTreeColumn(new ColumnLocation(Alignment.MIDDLE, 100, Unit.PROPORTIONAL), "", "userObject.node.description"));
if(sakaiProxy.isSuperUser()){
columnsList.add(new PropertyEditableColumnCheckbox(new ColumnLocation(Alignment.RIGHT, 70, Unit.PX), new StringResourceModel("accessAdmin", null).getString(), "userObject.accessAdmin", DelegatedAccessConstants.TYPE_ACCESS_ADMIN));
columnsList.add(new PropertyEditableColumnCheckbox(new ColumnLocation(Alignment.RIGHT, 70, Unit.PX), new StringResourceModel("shoppingPeriodAdmin", null).getString(), "userObject.shoppingPeriodAdmin", DelegatedAccessConstants.TYPE_SHOPPING_PERIOD_ADMIN));
columnsList.add(new PropertyEditableColumnCheckbox(new ColumnLocation(Alignment.RIGHT, 90, Unit.PX), new StringResourceModel("shoppingPeriodAdmin", null).getString(), "userObject.shoppingPeriodAdmin", DelegatedAccessConstants.TYPE_SHOPPING_PERIOD_ADMIN));
}
columnsList.add(new PropertyEditableColumnCheckbox(new ColumnLocation(Alignment.RIGHT, 55, Unit.PX), new StringResourceModel("siteAccess", null).getString(), "userObject.directAccess", DelegatedAccessConstants.TYPE_ACCESS));
columnsList.add(new PropertyEditableColumnCheckbox(new ColumnLocation(Alignment.RIGHT, 68, Unit.PX), new StringResourceModel("siteAccess", null).getString(), "userObject.directAccess", DelegatedAccessConstants.TYPE_ACCESS));
if(!singleRoleOptions){
columnsList.add(new PropertyEditableColumnDropdown(new ColumnLocation(Alignment.RIGHT, roleColumnSize, Unit.PX), new StringResourceModel("userBecomes", null).getString(),
"userObject.roleOption", roleMap, DelegatedAccessConstants.TYPE_ACCESS, sakaiProxy.isSuperUser() ? null : sakaiProxy.getSubAdminOrderedRealmRoles()));
}
columnsList.add(new PropertyEditableColumnList(new ColumnLocation(Alignment.RIGHT, 96, Unit.PX), new StringResourceModel("restrictedToolsHeader", null).getString(),
columnsList.add(new PropertyEditableColumnList(new ColumnLocation(Alignment.RIGHT, 134, Unit.PX), new StringResourceModel("restrictedToolsHeader", null).getString(),
"userObject.restrictedAuthTools", DelegatedAccessConstants.TYPE_ACCESS, DelegatedAccessConstants.TYPE_LISTFIELD_TOOLS));
//setup advanced options settings:
Map<String, Object> advSettings = new HashMap<String, Object>();
advSettings.put(PropertyEditableColumnAdvancedUserOptions.SETTINGS_ALLOW_SET_BECOME_USER, sakaiProxy.isSuperUser() || sakaiProxy.allowAccessAdminsSetBecomeUserPerm());
columnsList.add(new PropertyEditableColumnAdvancedUserOptions(new ColumnLocation(Alignment.RIGHT, 75, Unit.PX), new StringResourceModel("advanced", null).getString(), "", advSettings));
columnsList.add(new PropertyEditableColumnAdvancedUserOptions(new ColumnLocation(Alignment.RIGHT, 92, Unit.PX), new StringResourceModel("advanced", null).getString(), "", advSettings));
IColumn columns[] = columnsList.toArray(new IColumn[columnsList.size()]);

//if the user isn't a super user, they should only be able to edit the nodes they
Expand Down

0 comments on commit d89fc8e

Please sign in to comment.