forked from sw360/sw360portal
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(projectportlet): fix issue sw360#417
closes sw360#417 Signed-off-by: Maximilian Huber <[email protected]>
- Loading branch information
Showing
8 changed files
with
70 additions
and
81 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
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
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
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
72 changes: 0 additions & 72 deletions
72
frontend/sw360-portlet/src/main/webapp/html/utils/ajax/mapEditBody.jsp
This file was deleted.
Oops, something went wrong.
66 changes: 64 additions & 2 deletions
66
frontend/sw360-portlet/src/main/webapp/html/utils/includes/mapEdit.jspf
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,23 +1,85 @@ | ||
<%-- | ||
~ Copyright (c) Bosch Software Innovations GmbH 2016. | ||
~ Copyright (c) Bosch Software Innovations GmbH 2016-2017. | ||
~ | ||
~ All rights reserved. This program and the accompanying materials | ||
~ are made available under the terms of the Eclipse Public License v1.0 | ||
~ which accompanies this distribution, and is available at | ||
~ http://www.eclipse.org/legal/epl-v10.html | ||
--%> | ||
|
||
<script src="<%=request.getContextPath()%>/js/external/jquery.validate.min.js" type="text/javascript"></script> | ||
<script src="<%=request.getContextPath()%>/js/external/additional-methods.min.js" type="text/javascript"></script> | ||
|
||
<table class="table info_table" id="mapEditTable"> | ||
<thead> | ||
<tr> | ||
<th colspan="3" class="headlabel">${mapTitle}</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<%@include file="/html/utils/ajax/mapEditBody.jsp" %> | ||
<core_rt:if test="${customMap != null}"> | ||
<core_rt:forEach items="${customMap.entrySet()}" var="mapEntry" varStatus="loop1"> | ||
<core_rt:forEach items="${mapEntry.value}" var="setItem" varStatus="loop2"> | ||
<tr id="mapEditTableRow${loop1.count}_${loop2.count}" > | ||
<td width="46%"> | ||
<select class="toplabelledInput" id="<%=PortalConstants.CUSTOM_MAP_KEY%>${loop1.count}_${loop2.count}" | ||
name="<portlet:namespace/><%=PortalConstants.CUSTOM_MAP_KEY%>${loop1.count}_${loop2.count}" | ||
style="min-width: 162px; min-height: 28px;"> | ||
|
||
<core_rt:forEach items="${keys}" var="key"> | ||
<option value="${key}" class="textlabel stackedLabel" <core_rt:if | ||
test='${mapEntry.key == key}'>selected="selected"</core_rt:if>> ${key} </option> | ||
</core_rt:forEach> | ||
</select> | ||
</td> | ||
<td width="46%"> | ||
<input id="<%=PortalConstants.CUSTOM_MAP_VALUE%>${loop1.count}_${loop2.count}" name="<portlet:namespace/><%=PortalConstants.CUSTOM_MAP_VALUE%>${loop1.count}_${loop2.count}" type="email" class="toplabelledInput" placeholder="${inputSubtitle}" title="${inputSubtitle}" | ||
value="<sw360:out value='${setItem}'/>"/> | ||
</td> | ||
|
||
<td class="deletor"> | ||
<img src="<%=request.getContextPath()%>/images/Trash.png" | ||
onclick="deleteMapItem('mapEditTableRow${loop1.count}_${loop2.count}')" | ||
alt="Delete"> | ||
</td> | ||
</tr> | ||
</core_rt:forEach> | ||
</core_rt:forEach> | ||
</core_rt:if> | ||
</tbody> | ||
</table> | ||
|
||
<input type="button" class="addButton" onclick="addRowToMapEditTable();" value="Click to add row to ${mapTitle} "/> | ||
<br/> | ||
<br/> | ||
|
||
<script> | ||
function deleteMapItem(rowId) { | ||
function deleteMapItemInternal() { | ||
$('#' + rowId).remove(); | ||
}; | ||
|
||
deleteConfirmed("Do you really want to remove this item?", deleteMapItemInternal); | ||
} | ||
|
||
function addRowToMapEditTable() { | ||
var randomRowId = "mapItemRow" + Date.now(); | ||
var newRowAsString = | ||
'<tr id="' + randomRowId + '" >'+ | ||
'<td width="46%">'+ | ||
'<select class="toplabelledInput" id="<%=PortalConstants.CUSTOM_MAP_KEY%>'+randomRowId+'" name="<portlet:namespace/><%=PortalConstants.CUSTOM_MAP_KEY%>'+randomRowId+'" style="min-width: 162px; min-height: 28px;">' + | ||
<core_rt:forEach items="${keys}" var="key"> | ||
'<option value="${key}" class="textlabel stackedLabel"> ${key} </option>'+ | ||
</core_rt:forEach> | ||
'</select>'+ | ||
'</td>'+ | ||
'<td width="46%">'+ | ||
'<input id="<%=PortalConstants.CUSTOM_MAP_VALUE%>'+randomRowId+'" name="<portlet:namespace/><%=PortalConstants.CUSTOM_MAP_VALUE%>'+randomRowId+'" type="email" class="toplabelledInput" placeholder="${inputSubtitle}" title="${inputSubtitle}" />'+ | ||
'</td>'+ | ||
'<td class="deletor">'+ | ||
'<img src="<%=request.getContextPath()%>/images/Trash.png" onclick="deleteMapItem(\''+ randomRowId +'\')" alt="Delete">' + | ||
'</td>'+ | ||
'</tr>'; | ||
$('#mapEditTable tr:last').after(newRowAsString); | ||
} | ||
</script> |