improve dashboard page

This commit is contained in:
tdurieux
2021-04-07 13:07:49 +02:00
parent 0f747f55b8
commit c0eeb86a9c
5 changed files with 75 additions and 72 deletions

View File

@@ -83,23 +83,20 @@ body {
a:hover {
text-decoration: none;
}
.card-header .btn {
border: none;
}
.btn,
.white_border,
.black_border {
border: 1px solid white;
background: transparent;
color: white;
border-radius: 2px;
}
.card-header .btn {
border: none;
border-radius: 4px;
}
.btn,
.btn:hover,
a.white_border,
a.white_border:hover,
a.black_border,
a.black_border:hover {
.white_border,
.black_border {
color: white;
}
.btn::placeholder,
@@ -110,22 +107,19 @@ a.black_border:hover {
opacity: 1; /* Firefox */
}
.profile-photo {
border-radius: 50%;
height: 30px;
position: relative;
display: inline;
}
.btn,
.black_border {
color: #333333;
border: 1px solid #333333;
}
.btn,
.btn:hover,
a.black_border,
a.black_border:hover {
a.black_border:hover,
a.white_border:hover {
color: #333333;
background-color: #dddddd;
}
.btn::placeholder,
.black_border::placeholder {
/* Chrome, Firefox, Opera, Safari 10.1+ */

View File

@@ -47,7 +47,7 @@
<button
id="submit"
type="submit"
class="btn btn-primary"
class="btn black_border"
ng-click="claim()"
>
Claim

View File

@@ -1,7 +1,41 @@
<div class="container-fluid h-100">
<div class="row h-100">
<div class="leftCol shadow p-1 h-100 overflow-auto">
<a class="btn btn-block black_border" href="/anonymize">
<i class="fa fa-plus-circle" aria-hidden="true"></i> Anonymize
</a>
<a
class="btn btn-block black_border"
href="/claim"
title="Claim the ownership of an existing anonymized repository."
data-toggle="tooltip"
data-placement="bottom"
>
Claim repository
</a>
<h3>Filters</h3>
<div class="form-group">
<label for="search">Search</label>
<input
type="search"
class="form-control"
id="search"
placeholder="Search..."
ng-model="search"
/>
</div>
<div class="form-group">
<label for="order">Order</label>
<select class="custom-select" ng-model="orderBy">
<option value="repoId">Repository ID</option>
<option value="fullName">Repository</option>
<option value="-anonymizeDate">Anonymize Date</option>
<option value="-status">Status</option>
<option value="-lastView">Last View</option>
<option value="-pageView">Page View</option>
</select>
</div>
<h5>Status</h5>
<div class="form-check">
<input
@@ -33,53 +67,7 @@
</div>
<div class="col h-100 overflow-auto">
<div class="row">
<div class="col p-2">
<form>
<div class="form-row">
<div class="col">
<input
type="search"
class="form-control"
id="search"
placeholder="Search repository..."
ng-model="search"
/>
</div>
<div class="col">
<div class="input-group">
<div class="input-group-prepend">
<label class="input-group-text" for="Order">Order</label>
</div>
<select class="custom-select" ng-model="orderBy">
<option value="repoId">Repository ID</option>
<option value="fullName">Repository</option>
<option value="-anonymizeDate">Anonymize Date</option>
<option value="-status">Status</option>
<option value="-lastView">Last View</option>
<option value="-pageView">Page View</option>
</select>
</div>
</div>
<div class="col text-right">
<a
class="btn btn-secondary"
href="/claim"
title="Claim the ownership of an existing anonymized repository."
data-toggle="tooltip"
data-placement="bottom"
>
Claim repository
</a>
<a class="btn btn-primary" href="/anonymize">
<i class="fa fa-plus-circle" aria-hidden="true"></i> Anonymize
</a>
</div>
</div>
</form>
</div>
</div>
<div class="row">
<div class="col p-2">
<div class="col p-0">
<table class="table repositories">
<thead class="thead-light">
<tr>
@@ -107,12 +95,23 @@
>{{repo.repoId}}</a
>
</td>
<td>
<a href="https://github.com/{{repo.fullName}}"
<td
title="Commit: {{repo.commit}}"
data-toggle="tooltip"
data-placement="bottom"
>
<a
href="https://github.com/{{repo.fullName}}/commit/{{repo.commit}}"
>{{repo.fullName}}</a
>
</td>
<td>{{repo.branch}}</td>
<td
title="Commit: {{repo.commit}}"
data-toggle="tooltip"
data-placement="bottom"
>
{{repo.branch}}
</td>
<!-- <td>{{repo.commit.substring(0, 6)}}</td> -->
<td class="text-center">{{repo.terms.length}}</td>
<td class="text-center">{{repo.status | title}}</td>

View File

@@ -250,7 +250,7 @@
<button
id="save"
type="submit"
class="btn btn-primary"
class="btn black_border"
ng-click="saveDefault($event)"
>
Save

View File

@@ -161,7 +161,7 @@ angular
$http.post("/api/user/default", params).then(
() => {
getDefault();
$scope.message = "Saved"
$scope.message = "Saved";
},
(error) => {
$translate("ERRORS." + error.data.error).then((translation) => {
@@ -219,7 +219,9 @@ angular
$location.url("/");
}
$('[data-toggle="tooltip"]').tooltip();
setTimeout(() => {
$('[data-toggle="tooltip"]').tooltip();
}, 250)
$scope.repositories = [];
$scope.search = "";
@@ -232,6 +234,14 @@ angular
$http.get("/api/user/anonymized_repositories").then(
(res) => {
$scope.repositories = res.data;
for (let repo of $scope.repositories) {
if (!repo.pageView) {
repo.pageView = 0;
}
if (!repo.lastView) {
repo.lastView = "";
}
}
},
(err) => {
console.error(err);