Skip to content

Commit 8b779e7

Browse files
authored
Merge pull request #19 from DuendeSoftware/jmdc/grants
Tweak grants display
2 parents 1452cee + c610ff5 commit 8b779e7

File tree

4 files changed

+108
-47
lines changed

4 files changed

+108
-47
lines changed

src/Pages/Grants/Index.cshtml

Lines changed: 47 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@
2121
}
2222
else
2323
{
24-
foreach (var grant in Model.View.Grants)
24+
foreach (var grant in Model.View.Grants)
2525
{
2626
<div class="card">
27-
<div class="card-header bg-light text-white">
27+
<div class="card-header bg-primary text-white">
2828
<div class="row">
2929
<div class="col-sm-8 card-title">
3030
@if (grant.ClientLogoUrl != null)
@@ -34,56 +34,57 @@
3434
<strong>@grant.ClientName</strong>
3535
</div>
3636

37-
<div class="col-sm-2">
37+
<div class="col-sm-4 d-flex justify-content-end">
3838
<form asp-page="/Grants/Index">
3939
<input type="hidden" name="clientId" value="@grant.ClientId">
40-
<button class="btn btn-danger">Revoke Access</button>
40+
<button class="btn btn-secondary">Revoke Access</button>
4141
</form>
4242
</div>
4343
</div>
4444
</div>
45-
46-
<ul class="list-group list-group-flush">
47-
@if (grant.Description != null)
48-
{
49-
<li class="list-group-item">
50-
<label>Description:</label> @grant.Description
51-
</li>
52-
}
53-
<li class="list-group-item">
54-
<label>Created:</label> @grant.Created.ToString("yyyy-MM-dd")
55-
</li>
56-
@if (grant.Expires.HasValue)
57-
{
58-
<li class="list-group-item">
59-
<label>Expires:</label> @grant.Expires.Value.ToString("yyyy-MM-dd")
60-
</li>
61-
}
62-
@if (grant.IdentityGrantNames.Any())
63-
{
64-
<li class="list-group-item">
65-
<label>Identity Grants</label>
66-
<ul>
67-
@foreach (var name in grant.IdentityGrantNames)
68-
{
69-
<li>@name</li>
70-
}
71-
</ul>
72-
</li>
73-
}
74-
@if (grant.ApiGrantNames.Any())
75-
{
76-
<li class="list-group-item">
77-
<label>API Grants</label>
78-
<ul>
79-
@foreach (var name in grant.ApiGrantNames)
80-
{
81-
<li>@name</li>
82-
}
83-
</ul>
84-
</li>
85-
}
86-
</ul>
45+
46+
<div class="card-body">
47+
<dl>
48+
@if (grant.Description != null)
49+
{
50+
<dt>Description</dt>
51+
<dd>@grant.Description</dd>
52+
}
53+
54+
<dt>Created</dt>
55+
<dd>@grant.Created.ToString("yyyy-MM-dd")</dd>
56+
@if (grant.Expires.HasValue)
57+
{
58+
<dt>Expires</dt>
59+
<dd>@grant.Expires.Value.ToString("yyyy-MM-dd")</dd>
60+
}
61+
@if (grant.IdentityGrantNames.Any())
62+
{
63+
<dt>Identity Grants</dt>
64+
<dd>
65+
<ul>
66+
@foreach (var name in grant.IdentityGrantNames)
67+
{
68+
<li>@name</li>
69+
}
70+
</ul>
71+
</dd>
72+
}
73+
74+
@if (grant.ApiGrantNames.Any())
75+
{
76+
<dt>API Grants</dt>
77+
<dd>
78+
<ul>
79+
@foreach (var name in grant.ApiGrantNames)
80+
{
81+
<li>@name</li>
82+
}
83+
</ul>
84+
</dd>
85+
}
86+
</dl>
87+
</div>
8788
</div>
8889
}
8990
}

src/wwwroot/css/site.css

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,36 @@
66
width: 64px;
77
}
88

9+
/* List group */
10+
.list-group-item {
11+
color: #444;
12+
background-color: #fff;
13+
}
14+
15+
.list-group-item.disabled, .list-group-item:disabled {
16+
color: #5c507c;
17+
background-color: #fff;
18+
}
19+
20+
.list-group-item.active, .list-group-item:hover, .list-group-item:focus {
21+
z-index: 2;
22+
color: #444;
23+
background-color: #eee;
24+
border-color: #eee;
25+
}
26+
27+
.list-group-item.active {
28+
font-weight: 700;
29+
}
30+
31+
.list-group-item.active:hover {
32+
background-color: #fff;
33+
}
34+
35+
.list-group-item.disabled:hover {
36+
color: #5c507c;
37+
}
38+
939
/* Accordion styles */
1040
.collapsible-link::before {
1141
content: "";

src/wwwroot/css/site.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/wwwroot/css/site.scss

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,36 @@
88
}
99
}
1010

11+
/* List group */
12+
.list-group-item {
13+
color: #444;
14+
background-color: #fff;
15+
}
16+
17+
.list-group-item.disabled, .list-group-item:disabled {
18+
color: #5c507c;
19+
background-color: #fff;
20+
}
21+
22+
.list-group-item.active, .list-group-item:hover, .list-group-item:focus {
23+
z-index: 2;
24+
color: #444;
25+
background-color: #eee;
26+
border-color: #eee;
27+
}
28+
29+
.list-group-item.active {
30+
font-weight: 700;
31+
}
32+
33+
.list-group-item.active:hover {
34+
background-color: #fff;
35+
}
36+
37+
.list-group-item.disabled:hover {
38+
color: #5c507c;
39+
}
40+
1141
/* Accordion styles */
1242
.collapsible-link::before {
1343
content: '';

0 commit comments

Comments
 (0)