|
| 1 | +<!-- |
| 2 | +The MIT License |
| 3 | +
|
| 4 | +Copyright (c) 2025, Jan Faracik |
| 5 | +
|
| 6 | +Permission is hereby granted, free of charge, to any person obtaining a copy |
| 7 | +of this software and associated documentation files (the "Software"), to deal |
| 8 | +in the Software without restriction, including without limitation the rights |
| 9 | +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 10 | +copies of the Software, and to permit persons to whom the Software is |
| 11 | +furnished to do so, subject to the following conditions: |
| 12 | +
|
| 13 | +The above copyright notice and this permission notice shall be included in |
| 14 | +all copies or substantial portions of the Software. |
| 15 | +
|
| 16 | +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 17 | +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 18 | +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 19 | +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 20 | +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 21 | +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
| 22 | +THE SOFTWARE. |
| 23 | +--> |
| 24 | + |
| 25 | +<?jelly escape-by-default='true'?> |
| 26 | +<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" |
| 27 | + xmlns:l="/lib/layout" xmlns:dd="/lib/layout/dropdowns" xmlns:t="/lib/hudson"> |
| 28 | + <l:layout title="${(it.class.name=='hudson.model.AllView' and it.ownerItemGroup == app) ? '%Dashboard' : it.displayName}${not empty it.ownerItemGroup.fullDisplayName ? ' - ' + it.ownerItemGroup.fullDisplayName : ''}"> |
| 29 | + <l:header> |
| 30 | + <!-- for screen resolution detection --> |
| 31 | + <script id="screenResolution-script" data-use-secure-cookie="${request2.secure}"/> |
| 32 | + <st:adjunct includes="hudson.model.View.screen-resolution"/> |
| 33 | + </l:header> |
| 34 | + |
| 35 | + <j:set var="view" value="${it}"/> <!-- expose view to the scripts we include from owner --> |
| 36 | + <l:main-panel> |
| 37 | + <div class="app-build-bar"> |
| 38 | + <div class="app-build-bar__content"> |
| 39 | + <div class="app-build-bar__content__headline"> |
| 40 | + <j:set var="iconClass" value="${it.owner.iconColor.getIconClassName()}"/> |
| 41 | + <j:if test="${iconClass != null}"> |
| 42 | + <j:set var="iconClass" value="${iconClass} icon-lg"/> |
| 43 | + </j:if> |
| 44 | + <j:choose> |
| 45 | + <j:when test="${iconClass != null}"> |
| 46 | + <l:icon class="${iconClass}" alt="${it.owner.iconColor.description}" tooltip="${it.owner.iconColor.description}" /> |
| 47 | + </j:when> |
| 48 | + <j:when test="${it.owner.iconColor.getImageOf('32x32') != null}"> |
| 49 | + <l:icon src="${it.owner.iconColor.getImageOf('32x32')}" alt="${it.owner.iconColor.description}" tooltip="${it.owner.iconColor.description}" /> |
| 50 | + </j:when> |
| 51 | + </j:choose> |
| 52 | + |
| 53 | + <h1>${it.ownerItemGroup == app ? '%Dashboard' : it.owner == app ? it.displayName : it.owner.displayName}</h1> |
| 54 | + </div> |
| 55 | + </div> |
| 56 | + |
| 57 | + <j:set var="currentView" value="${it}" /> |
| 58 | + <j:set var="views" value="${it.owner.views}" /> |
| 59 | + |
| 60 | + <div class="app-build-bar__tabs"> |
| 61 | + <j:choose> |
| 62 | + <j:when test="${view.class.name eq 'hudson.model.MyViewsProperty'}"> |
| 63 | + <st:include page="viewTabs" it="${view.owner.userViewsTabBar}" /> |
| 64 | + </j:when> |
| 65 | + <j:otherwise> |
| 66 | + <st:include page="viewTabs" it="${view.owner.viewsTabBar}" /> |
| 67 | + </j:otherwise> |
| 68 | + </j:choose> |
| 69 | + </div> |
| 70 | + |
| 71 | + <div class="app-build-bar__controls"> |
| 72 | + <j:if test="${it.hasPermission(it.CREATE)}"> |
| 73 | + <a class="jenkins-button" |
| 74 | + href="${rootURL}/${it.viewUrl}newJob"> |
| 75 | + <l:icon src="symbol-add" /> |
| 76 | + New Item |
| 77 | + </a> |
| 78 | + </j:if> |
| 79 | + |
| 80 | + <j:if test="${it.isEditable() and it.hasPermission(it.CONFIGURE)}"> |
| 81 | + <!-- /configure URL on Jenkins object is overloaded with Jenkins's system config, so always use the explicit name. --> |
| 82 | + <a class="jenkins-button" |
| 83 | + href="${rootURL}/${it.viewUrl}configure"> |
| 84 | + ${%Edit View} |
| 85 | + </a> |
| 86 | + </j:if> |
| 87 | + |
| 88 | + <l:dialog title="${%Legend}" hash="legend"> |
| 89 | + <div> |
| 90 | + <st:include page="_legend.jelly" it="${app}" /> |
| 91 | + </div> |
| 92 | + </l:dialog> |
| 93 | + |
| 94 | + <l:overflowButton> |
| 95 | + <dd:custom> |
| 96 | + <div class="app-build-overflow"> |
| 97 | + <j:set var="mode" value="side-panel" /> |
| 98 | + <st:include page="sidepanel.jelly" it="${it.object}" /> |
| 99 | + </div> |
| 100 | + </dd:custom> |
| 101 | + <dd:separator /> |
| 102 | + <dd:submenu icon="symbol-rss" text="${%Atom feed}"> |
| 103 | + <dd:item icon="symbol-rss" text="${%All}" href="rssAll" /> |
| 104 | + <dd:item icon="symbol-rss" text="${%Failures}" href="rssFailed" /> |
| 105 | + <dd:item icon="symbol-rss" text="${%LatestBuilds}" href="rssLatest" /> |
| 106 | + </dd:submenu> |
| 107 | + <dd:custom> |
| 108 | + <button class="jenkins-dropdown__item" |
| 109 | + data-type="dialog-opener" |
| 110 | + data-dialog-id="${dialogId}"> |
| 111 | + <div class="jenkins-dropdown__item__icon"> |
| 112 | + <l:icon src="symbol-information-circle" /> |
| 113 | + </div> |
| 114 | + ${%Legend} |
| 115 | + </button> |
| 116 | + </dd:custom> |
| 117 | + <j:if test="${it.owner.canDelete(it) and it.hasPermission(it.DELETE)}"> |
| 118 | + <dd:separator /> |
| 119 | + <dd:custom> |
| 120 | + <l:confirmationLink class="jenkins-dropdown__item jenkins-!-destructive-color" |
| 121 | + href="doDelete" |
| 122 | + title="todo" |
| 123 | + message="${%delete.logrecorder(it.displayName)}" |
| 124 | + destructive="true" |
| 125 | + post="true"> |
| 126 | + <div class="jenkins-dropdown__item__icon"> |
| 127 | + <l:icon src="symbol-trash" /> |
| 128 | + </div> |
| 129 | + ${%Delete View} |
| 130 | + </l:confirmationLink> |
| 131 | + </dd:custom> |
| 132 | + </j:if> |
| 133 | + </l:overflowButton> |
| 134 | + </div> |
| 135 | + </div> |
| 136 | + |
| 137 | + <div class="app-build-content" style="padding-top: var(--section-padding)"> |
| 138 | + <t:editableDescription permission="${it.CONFIGURE}" hideButton="true" /> |
| 139 | + |
| 140 | + <j:set var="items" value="${it.items}"/> |
| 141 | + <st:include page="main.jelly" /> |
| 142 | + </div> |
| 143 | + </l:main-panel> |
| 144 | + </l:layout> |
| 145 | +</j:jelly> |
0 commit comments