support remove and install actions
[teamcity/dotNetPackagesSupport.git] / nuget-server / resources / tool / tools.jsp
1 <%--\r
2   ~ Copyright 2000-2011 JetBrains s.r.o.\r
3   ~\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
7   ~\r
8   ~ http://www.apache.org/licenses/LICENSE-2.0\r
9   ~\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
15   --%>\r
16 <%@ include file="/include-internal.jsp" %>\r
17 <jsp:useBean id="tools" type="java.util.Collection<jetbrains.buildServer.nuget.server.toolRegistry.tab.LocalTool>" scope="request"/>\r
18 <jsp:useBean id="installerUrl" type="java.lang.String" scope="request"/>\r
19 <jsp:useBean id="updateUrl" type="java.lang.String" scope="request"/>\r
20 \r
21 <c:set var="actualUpdateUrl"><c:url value="${updateUrl}"/></c:set>\r
22 <bs:refreshable containerId="nugetPackagesList" pageUrl="${actualUpdateUrl}">\r
23 <c:set var="installedPluginsCount" value="${fn:length(tools)}"/>\r
24 <p>\r
25   TeamCity NuGet plugin requires to configure NuGet.Exe Command Line clients.\r
26   There are\r
27   <strong><c:out value="${installedPluginsCount}"/></strong>\r
28   plugin<bs:s val="${installedPluginsCount}"/> installed.\r
29 </p>\r
30 \r
31 <h2 class="noBorder">Installed NuGet Versions</h2>\r
32 <c:choose>\r
33   <c:when test="${installedPluginsCount eq 0}">\r
34     <div>There are no installed NuGet.exe</div>\r
35   </c:when>\r
36   <c:otherwise>\r
37       <table class="dark borderBottom" cellpadding="0" cellspacing="0" style="width: 30em;">\r
38         <thead>\r
39         <tr>\r
40           <th class="header" style="width: 66%">Version</th>\r
41           <th class="header"></th>\r
42         </tr>\r
43         </thead>\r
44         <tbody>\r
45           <c:forEach var="tool" items="${tools}">\r
46             <tr>\r
47               <td><c:out value="${tool.version}"/></td>\r
48               <td>\r
49                 <c:choose>\r
50                   <c:when test="${tool.state.installed}">\r
51                     <a href="#" onclick="BS.NuGet.Tools.removeTool('<bs:forJs>${tool.id}</bs:forJs>');">Remove</a>\r
52                   </c:when>\r
53                   <c:when test="${tool.state.installing}">\r
54                     <bs:commentIcon text="Messages"/>\r
55                     Installing...\r
56                   </c:when>\r
57                 </c:choose>\r
58               </td>\r
59             </tr>\r
60           </c:forEach>\r
61         </tbody>\r
62     </table>\r
63   </c:otherwise>\r
64 </c:choose>\r
65 </bs:refreshable>\r
66 \r
67 <div class="addNew">\r
68   <a href="#" onclick="return BS.NuGet.Tools.InstallPopup.show();">\r
69     Install\r
70     <c:if test="${installedPluginsCount gt 0}">addintional versions of</c:if>\r
71     NuGet.exe Command Line\r
72     <forms:saving id="nugetInstallLinkSaving"/>\r
73   </a>\r
74 </div>\r
75 \r
76 <c:set var="actualInstallerUrl"><c:url value="${installerUrl}"/></c:set>\r
77 <bs:modalDialog\r
78         formId="nugetInstallForm"\r
79         title="Install NuGet.exe Command Line"\r
80         action="${actualInstallerUrl}"\r
81         closeCommand="BS.NuGet.Tools.InstallPopup.close();"\r
82         saveCommand="BS.NuGet.Tools.InstallPopup.save();">\r
83   <div id="nugetInstallFormLoading">\r
84     <forms:saving style="float: left; display:block;"/>\r
85     Discovering available NuGet.exe Command Line versions\r
86   </div>\r
87 \r
88   <bs:refreshable containerId="nugetInstallFormResresh" pageUrl="${actualInstallerUrl}">\r
89 \r
90   </bs:refreshable>\r
91 \r
92   <div class="popupSaveButtonsBlock">\r
93     <a href="javascript://" onclick="BS.NuGet.Tools.InstallPopup.close();" class="cancel">Cancel</a>\r
94     <input class="submitButton" type="submit" value="Install" id="installNuGetApplyButton" />\r
95     <a href="javascript://" onclick="BS.NuGet.Tools.InstallPopup.refreshForm(true);" class="cancel">Refresh</a>\r
96     <forms:saving id="installNuGetApplyProgress"/>\r
97     <br clear="all"/>\r
98   </div>\r
99 </bs:modalDialog>\r
100 \r
101 <script type="text/javascript">\r
102   BS.NuGet.Tools.installUrl = "<bs:forJs>${actualInstallerUrl}</bs:forJs>";\r
103   BS.NuGet.Tools.InstallPopup.disableSubmit();\r
104 </script>\r