2 ~ Copyright 2000-2011 JetBrains s.r.o.
\r
4 ~ Licensed under the Apache License, Version 2.0 (the "License");
\r
5 ~ you may not use this file except in compliance with the License.
\r
6 ~ You may obtain a copy of the License at
\r
8 ~ http://www.apache.org/licenses/LICENSE-2.0
\r
10 ~ Unless required by applicable law or agreed to in writing, software
\r
11 ~ distributed under the License is distributed on an "AS IS" BASIS,
\r
12 ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
13 ~ See the License for the specific language governing permissions and
\r
14 ~ limitations under the License.
\r
16 <%@ include file="/include-internal.jsp"%>
\r
17 <%@ taglib prefix="forms" tagdir="/WEB-INF/tags/forms" %>
\r
18 <%@ taglib prefix="props" tagdir="/WEB-INF/tags/props" %>
\r
19 <%@ taglib prefix="l" tagdir="/WEB-INF/tags/layout" %>
\r
20 <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
\r
21 <jsp:useBean id="name" scope="request" type="java.lang.String"/>
\r
22 <jsp:useBean id="clazz" scope="request" type="java.lang.String"/>
\r
23 <jsp:useBean id="style" scope="request" type="java.lang.String"/>
\r
24 <jsp:useBean id="value" scope="request" type="java.lang.String"/>
\r
25 <jsp:useBean id="customValue" scope="request" type="java.lang.String"/>
\r
26 <jsp:useBean id="settingsUrl" scope="request" type="java.lang.String"/>
\r
27 <jsp:useBean id="items" scope="request" type="java.util.Collection<jetbrains.buildServer.nuget.server.toolRegistry.ui.ToolInfo >"/>
\r
29 <props:hiddenProperty name="${name}" value="${value}"/>
\r
31 <props:selectProperty name="nugetPathSelector" className="${clazz}" style="${style}" onchange="BS.NuGet.RunnerSettings.selectionChanged();">
\r
32 <c:set var="isSelected" value="${value eq ''}"/>
\r
33 <props:option value="" selected="${isSelected}">-- Select NuGet version to run --</props:option>
\r
35 <c:set var="hasSelected" value="${isSelected}"/>
\r
36 <c:forEach var="it" items="${items}">
\r
37 <c:set var="isSelected" value="${it.id eq value}"/>
\r
38 <props:option value="${it.id}" selected="${isSelected}"><c:out value="${it.version}"/></props:option>
\r
39 <c:if test="${isSelected}"><c:set var="hasSelected" value="${true}"/></c:if>
\r
41 <props:option value="custom" selected="${not hasSelected}">Custom</props:option>
\r
42 </props:selectProperty>
\r
43 <span class="smallNote">Specify NuGet.exe version.
\r
44 Check intalled NuGet Commandline tools in <a href="<c:url value="${settingsUrl}"/>" target="_blank">NuGet Settings</a>
\r
47 <div id="customPathContainer">
\r
48 <props:textProperty name="nugetCustomPath" className="${clazz}" style="${style}" onchange="BS.NuGet.RunnerSettings.customPathChanged();"/>
\r
49 <span class="smallNote">Specify custom path to NuGet.exe</span>
\r
51 <span class="error" id="error_${name}"></span>
\r
53 <script type="text/javascript">
\r
55 if (!BS.NuGet) BS.NuGet = {};
\r
56 BS.NuGet.RunnerSettings = {
\r
57 isPackage : function(x) {
\r
58 return x.length > 0 && x.charAt(0) == '?';
\r
61 setValue : function(x) {
\r
62 $('${name}').value = x;
\r
65 getValue : function() {
\r
66 return $('${name}').value;
\r
69 selectionChanged : function() {
\r
70 var selected = $('nugetPathSelector').value;
\r
71 if (this.isPackage(selected)) {
\r
72 this.setValue(selected);
\r
73 BS.Util.hide($('customPathContainer'));
\r
74 } else if(selected == "custom") {
\r
75 var val = this.getValue();
\r
76 $('nugetCustomPath').value = this.isPackage(val) ? "<bs:forJs>${customValue}</bs:forJs>" : val;
\r
77 this.customPathChanged();
\r
78 BS.Util.show($('customPathContainer'));
\r
82 BS.MultilineProperties.updateVisible();
\r
84 customPathChanged : function() {
\r
85 $('${name}').value = $('nugetCustomPath').value;
\r
89 BS.NuGet.RunnerSettings.selectionChanged();
\r