Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
janfaracik committed Aug 17, 2024
1 parent d4953e4 commit 45e79af
Show file tree
Hide file tree
Showing 5 changed files with 94 additions and 58 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ THE SOFTWARE.
<l:layout permission="${app.ADMINISTER}" title="${%title}">
<st:include page="sidepanel.jelly" it="${it.targetUser}" />
<l:main-panel>
<f:form method="post" action="configSubmit" name="config">
<f:form method="post" action="configSubmit" name="config" class="jenkins-form">
<h1>
${%title}
</h1>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,10 @@ THE SOFTWARE.
<j:set var="creationDateValue" value="${%NoCreationDateValue}" />
<j:if test="${token.creationDate != null}">
<i:formatDate var="creationDateFormat" value="${token.creationDate}" type="both" dateStyle="medium" timeStyle="medium" />
<!--TODO convert to "Today", "Tomorrow", "4 days ago", "2 weeks ago", etc. -->
<j:set var="creationDateValue" value="${%TokenCreation(daysOld)}" />
<j:set var="creationDateValue" value="${%TokenCreation(h.getTimeSpanString(token.creationDate))}" />
</j:if>
<span class="token-creation ${oldClazz}" title="${creationDateFormat}">${creationDateValue}</span>

<span class="to-right">

<div class="areyouawake">
<j:choose>
<j:when test="${isStatisticsEnabled}">
<j:set var="useCounter" value="${token.useCounter}" />
Expand All @@ -93,11 +91,9 @@ THE SOFTWARE.
</j:if>
</j:when>
<j:otherwise>
<span class="token-use-counter">
<strong title="${%TokenNeverUsed.Title}">
<l:icon class="icon-warning icon-sm"/>
${%TokenNeverUsed}
</strong>
<span class="token-use-counter todododolo jenkins-!-warning-color" tooltip="${%TokenNeverUsed.Title}">
<l:icon class="symbol-shield-warning" />
${%TokenNeverUsed}
</span>
</j:otherwise>
</j:choose>
Expand All @@ -108,22 +104,24 @@ THE SOFTWARE.
</span>
</j:otherwise>
</j:choose>
<span class="token-creation todo-meow ${oldClazz}" title="${creationDateFormat}">${creationDateValue}</span>
</div>

<a href="#"
class="jenkins-button jenkins-button--tertiary jenkins-!-destructive-color api-token-property-token-revoke"
data-message-if-legacy-revoked="${%RevokedToken}"
data-confirm="${%ConfirmRevokeSingle}"
data-confirm-title="${%ConfirmRevokeSingleTitle}"
data-target-url="${descriptor.descriptorFullUrl}/revoke">
<local:revokeIcon title="${%RevokeToken}" />
</a>
</span>
<a href="#"
tooltip="${%Revoke token}"
class="jenkins-button jenkins-button--tertiary jenkins-!-destructive-color api-token-property-token-revoke"
data-message-if-legacy-revoked="${%RevokedToken}"
data-confirm="${%ConfirmRevokeSingle}"
data-confirm-title="${%ConfirmRevokeSingleTitle}"
data-target-url="${descriptor.descriptorFullUrl}/revoke">
<l:icon src="symbol-trash" />
</a>
</div>
</j:when>
<j:otherwise>
<div class="token-list-item token-list-new-item">
<input type="hidden" class="token-uuid-input" name="tokenUuid" value="${token.uuid}" />
<f:textbox name="tokenName" clazz="token-name" placeholder="${%Default name}"/>
<f:textbox name="tokenName" clazz="token-name" placeholder="${%Default name}" autofocus="true" />
<st:nbsp /><!-- without this non-breakable space, double click on the div will put the focus on the input -->
<span class="new-token-value"><!--will be filled by javascript--></span>
<span class="token-save">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ TokenNeverUsedTooltip=There is no last use date for that token
TokenNeverUsed.Title=We strongly recommend that you revoke tokens which you do not plan to use
ConfirmRevokeSingle=Are you sure you want to revoke this token? Applications that are using it will be not able to connect anymore.
CurrentTokens=Current token(s)
TokenCreation=Created {0} day(s) ago
TokenCreation=Created {0} ago
RenameToken=Save the new name of the token
LegacyToken=We strongly recommend that you revoke this legacy token and replace it with a newly generated token for increased security.
NoLegacyToken=The user does not have a legacy token
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,6 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
.token-list {
/* reset to get rid of browser default */
margin: 0;
padding: 0;

max-width: 700px;
border: 1px solid #cccccc;
border-color: var(--medium-grey);
border-radius: 3px;
}

.token-list .token-list-item {
min-height: inherit;
padding: 8px 10px;
font-size: 0.875rem;
line-height: 26px;
}
.token-list .token-list-item.legacy-token {
padding: 6px 5px 6px 5px;
border: 2px solid #ffe262;
Expand All @@ -55,13 +38,6 @@
.token-list .token-list-item .token-name-input {
font-weight: bold;
}
.token-list .token-list-item .token-creation {
margin-left: 5px;
font-size: 0.75rem;
}
.token-list .token-list-item .token-creation.age-ok {
color: #6d7680;
}
.token-list .token-list-item .token-creation.age-mmmh {
color: #e09307;
}
Expand All @@ -71,13 +47,77 @@
.token-list .token-list-item .token-hide {
display: none;
}
.token-list .token-list-item .to-right {
float: right;

.areyouawake {
display: flex;
align-items: end;
justify-content: end;
flex-direction: column;
}
.token-list .token-list-item .token-use-counter {
font-size: 0.75rem;
color: #6d7680;

.todododolo {
display: flex;
align-items: center;
justify-content: center;
gap: 5px;

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

.todo-meow {
color: var(--text-color-secondary);
}

.token-list-new-item {
display: grid;
grid-template-columns: 1fr 275px;
gap: 0.5rem;
align-items: center;
margin: 0 -1rem -1rem -1rem !important;
padding: 0.5rem;

input {
border: none;
}
}

.token-list-existing-item {
display: grid;
grid-template-columns: 1fr 275px auto;
gap: 0.5rem;
align-items: center;
margin: 0 -1rem -1rem -1rem !important;
padding: 0.5rem;

input {
font-weight: 500;

&:not(:hover, :active, :focus) {
background: none;
border: 2px solid transparent;
}
}

span {
font-size: 0.75rem;
}

.jenkins-button {
aspect-ratio: 1;
border-radius: 100px;
padding: 0;
}
}

.token-use-counter {
b {
font-weight: inherit;
}
}

.token-list .token-list-item .no-statistics {
font-size: 0.75rem;
color: #6d7680;
Expand Down Expand Up @@ -131,10 +171,7 @@
vertical-align: baseline;
}
.token-list .repeated-chunk {
border-width: 0;
padding: 0;
margin: 0;
}
.token-list .repeatable-add {
margin: 6px 6px 3px 6px;
}
.repeated-chunk__header {
display: none;
}
}
1 change: 1 addition & 0 deletions war/src/main/resources/images/symbols/warning.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 45e79af

Please sign in to comment.