Skip to content

Commit

Permalink
Init
Browse files Browse the repository at this point in the history
  • Loading branch information
janfaracik committed Apr 21, 2022
1 parent 2830b3b commit b8a622c
Show file tree
Hide file tree
Showing 5 changed files with 231 additions and 51 deletions.
28 changes: 14 additions & 14 deletions core/src/main/resources/hudson/PluginManager/installed.jelly
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,23 @@ THE SOFTWARE.
<l:layout title="${%Installed Plugins} - ${%Plugin Manager}" permission="${app.SYSTEM_READ}">
<j:set var="readOnlyMode" value="${!app.hasPermission(app.ADMINISTER)}"/>

<l:app-bar title="${%Plugin Manager}" />

<st:include page="sidepanel.jelly"/>

<l:main-panel>
<div class="jenkins-app-bar jenkins-app-bar--sticky">
<div class="jenkins-app-bar__content">
<div class="app-plugin-manager__search">
<l:icon src="symbol-search"/>
<input type="search"
placeholder="Search available plugins"
id="filter-box"
value="${request.getParameter('filter')}" />
</div>
</div>
<div class="jenkins-app-bar__controls">
</div>
</div>

<st:adjunct includes="hudson.PluginManager._table"/>

<j:if test="${app.updateCenter.isRestartRequiredForCompletion()}">
Expand All @@ -55,18 +67,6 @@ THE SOFTWARE.

<local:tabBar page="installed" xmlns:local="/hudson/PluginManager" />

<div class="jenkins-form-item jenkins-search">
<input
class="jenkins-search__input"
type="search"
id="filter-box"
value="${request.getParameter('filter')}"
placeholder="${filtered == 'true' ? '%Search' : '%Filter'}"/>
<div class="jenkins-search__icon">
<l:icon src="symbol-search"/>
</div>
</div>

<table id="plugins" class="jenkins-table sortable">
<j:choose>
<j:when test="${empty(app.pluginManager.plugins) and empty(app.pluginManager.failedPlugins)}">
Expand Down
36 changes: 0 additions & 36 deletions core/src/main/resources/hudson/PluginManager/sidepanel.groovy

This file was deleted.

91 changes: 91 additions & 0 deletions core/src/main/resources/hudson/PluginManager/sidepanel.jelly
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
<!--
The MIT License
Copyright (c) 2022, Jenkins contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-->

<!--
Sidepanel component for Plugins Manager
-->
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:l="/lib/layout">
<st:documentation>
<st:attribute name="page">
Adds the highlighted class to the current page item in the list
</st:attribute>
</st:documentation>

<!-- TODO - Remove this when all tasks (Jenkins' sidepanel items) are styled like this -->
<style>
#side-panel {
border-right: none;
padding-right: 0;
}
</style>

<div class="jenkins-side-nav">
<div class="jenkins-app-bar">
<div class="jenkins-app-bar__content">
<h1>
${%Plugins}
</h1>
</div>
</div>

<a href="./available" class="jenkins-side-nav__item ${page == 'available' ? 'jenkins-side-nav__item--selected' : ''}">
<div class="jenkins-side-nav__item__icon">
<l:ionicon name="bag-handle-outline" />
</div>
${%Available plugins}
</a>

<a href="./installed" class="jenkins-side-nav__item ${page == 'installed' ? 'jenkins-side-nav__item--selected' : ''}">
<div class="jenkins-side-nav__item__icon">
<l:ionicon name="extension-puzzle-outline" />
</div>
${%Updates and installed plugins}
<j:if test="${app.updateCenter.updates.size() != 0}">
<span class="jenkins-side-nav__item__badge">
${app.updateCenter.updates.size()}
</span>
</j:if>
</a>

<a href="./advanced" class="jenkins-side-nav__item ${page == 'advanced' ? 'jenkins-side-nav__item--selected' : ''}">
<div class="jenkins-side-nav__item__icon">
<l:ionicon name="settings-outline" />
</div>
${%Advanced settings}
</a>
</div>

<div class="app-plugin-manager__restart-panel" id="needRestart" style="display:none;">
<l:ionicon name="warning-outline" />
<form method="post" action="${rootURL}/safeRestart">
You'll need to restart Jenkins for your changes to take effect
<j:if test="${app.lifecycle.canRestart()}">
<button class="jenkins-button">
${%Restart once no jobs are running}
</button>
</j:if>
</form>
</div>
</j:jelly>
31 changes: 31 additions & 0 deletions war/src/main/less/modules/app-bar.less
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,37 @@
border-bottom: 2px solid var(--panel-border-color);
}

&--sticky {
position: sticky;
top: 40px;
padding-top: 2rem;
margin-top: -2rem;
z-index: 2;

&::before,
&::after {
content: "";
position: absolute;
top: 0;
left: -2rem;
bottom: -2rem;
right: -2rem;
z-index: -1;
pointer-events: none;
}

&::before {
background: var(--background);
mask-image: linear-gradient(black 70%, transparent);
opacity: 0.55;
}

&::after {
backdrop-filter: blur(15px);
mask-image: linear-gradient(black 50%, transparent);
}
}

h1 {
margin: 0;
font-size: 1.6rem;
Expand Down
96 changes: 95 additions & 1 deletion war/src/main/less/pages/plugin-manager.less
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
tr.already-upgraded {
background-color: var(--plugin-manager-bg-color-already-upgraded);
}

tr.unavailable {
background-color: var(--plugin-manager-unavailable-bg-color);
}
Expand Down Expand Up @@ -116,3 +116,97 @@
border-radius: 0.25em;
}
}

.app-plugin-manager__search {
position: relative;
display: grid;
grid-template-columns: auto 1fr;
align-items: center;
width: 50vw;
z-index: 1;
padding: 0 1rem;
gap: 0.5rem 0.75rem;

&::before,
&::after {
content: "";
position: absolute;
inset: 0;
border-radius: 10px;
z-index: -1;
}

&::before {
backdrop-filter: brightness(1.2) blur(20px);
}

&::after {
background: currentColor;
box-shadow: inset 0 -2px 0 currentColor, 0 0 0 10px transparent;
opacity: 0.05;
transition: var(--standard-transition);
}

svg {
width: 1.1rem;
height: 1.1rem;
}

input {
background: transparent;
border: none;
outline: none;
font-size: 0.9rem;
font-weight: 500;
padding: 0.75rem 0;

&::placeholder {
color: currentColor;
opacity: 0.5;
}

&::-webkit-search-cancel-button {
-webkit-appearance: none;
height: 1.2rem;
width: 1.2rem;
background: currentColor;
mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Cpath d='M256 48C141.31 48 48 141.31 48 256s93.31 208 208 208 208-93.31 208-208S370.69 48 256 48zm75.31 260.69a16 16 0 11-22.62 22.62L256 278.63l-52.69 52.68a16 16 0 01-22.62-22.62L233.37 256l-52.68-52.69a16 16 0 0122.62-22.62L256 233.37l52.69-52.68a16 16 0 0122.62 22.62L278.63 256z'/%3E%3C/svg%3E");
mask-size: contain;
mask-repeat: no-repeat;
opacity: 0;
pointer-events: none;
transform: scale(0.8);
transition: var(--standard-transition);
cursor: pointer;

&:hover {
opacity: 0.75 !important;
}

&:active {
opacity: 1 !important;
}
}

&:focus {
&::-webkit-search-cancel-button {
opacity: 0.5;
pointer-events: all;
transform: scale(1);
}
}
}

&:hover {
&::after {
opacity: 0.075;
}
}

&:focus-within {
&::after {
opacity: 0.1;
box-shadow: inset 0 -2px 0 currentColor, 0 0 0 5px var(--primary);
}
}
}

0 comments on commit b8a622c

Please sign in to comment.