1<%--
2  ~ Copyright (c) 2017 Google Inc. All Rights Reserved.
3  ~
4  ~ Licensed under the Apache License, Version 2.0 (the "License"); you
5  ~ may not use this file except in compliance with the License. You may
6  ~ obtain a copy of the License at
7  ~
8  ~     http://www.apache.org/licenses/LICENSE-2.0
9  ~
10  ~ Unless required by applicable law or agreed to in writing, software
11  ~ distributed under the License is distributed on an "AS IS" BASIS,
12  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
13  ~ implied. See the License for the specific language governing
14  ~ permissions and limitations under the License.
15  --%>
16<%@ page contentType='text/html;charset=UTF-8' language='java' %>
17<%@ taglib prefix='fn' uri='http://java.sun.com/jsp/jstl/functions' %>
18<%@ taglib prefix='c' uri='http://java.sun.com/jsp/jstl/core'%>
19
20<html>
21  <link rel='stylesheet' href='/css/show_release.css'>
22  <%@ include file='header.jsp' %>
23  <script type='text/javascript'>
24      $(document).ready(function() {
25          $("li.tab").each(function( index ) {
26              $(this).click(function() {
27                  window.open($(this).children().attr("href"), '_self');
28              });
29          });
30      });
31  </script>
32  <body>
33    <div class='container'>
34      <div class='row'>
35        <div class='col s12'>
36
37          <ul class="tabs z-depth-1">
38            <li class="tab col s6" id="planTabLink">
39              <a class="${testType == 'plan' ? 'active' : 'inactive'}" href="${requestScope['javax.servlet.forward.servlet_path']}?type=plan">Test Plans</a>
40            </li>
41            <li class="tab col s6" id="suiteTabLink">
42              <a class="${testType == 'suite' ? 'active' : 'inactive'}" href="${requestScope['javax.servlet.forward.servlet_path']}?type=suite">Test Suite Plans</a>
43            </li>
44          </ul>
45
46        </div>
47      </div>
48      <div class='row' id='options'>
49        <c:set var="typeParam" scope="session" value="${testType == 'suite' ? '&type=suite' : '&type=plan'}"/>
50
51        <c:forEach items='${planNames}' var='plan'>
52          <c:choose>
53            <c:when test="${isAdmin}">
54              <div class="col s10 center">
55                <a href='/show_plan_release?plan=${plan}${typeParam}'>
56                  <div class='col s12 card hoverable option valign-wrapper waves-effect'>
57                    <span class='entry valign'>${plan}</span>
58                  </div>
59                </a>
60              </div>
61              <div class="col s2 center btn-container" style="margin-top: 9px;">
62                <a href='/show_green_release?plan=${plan}${typeParam}' class="waves-effect waves-light btn">Green</a>
63              </div>
64            </c:when>
65            <c:otherwise>
66              <div class="col s12 center">
67                <a href='/show_plan_release?plan=${plan}${typeParam}'>
68                  <div class='col s12 card hoverable option valign-wrapper waves-effect'>
69                    <span class='entry valign'>${plan}</span>
70                  </div>
71                </a>
72              </div>
73            </c:otherwise>
74          </c:choose>
75        </c:forEach>
76      </div>
77    </div>
78    <%@ include file='footer.jsp' %>
79  </body>
80</html>
81