Skip to content

Commit

Permalink
feat: Add username to main lock screen (runatlantis#3597)
Browse files Browse the repository at this point in the history
* Add username to lock screen
  • Loading branch information
tobaker authored Jul 17, 2023
1 parent 3ea2914 commit a791fbf
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
5 changes: 5 additions & 0 deletions server/controllers/templates/web_templates.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ type LockIndexData struct {
PullNum int
Path string
Workspace string
LockedBy string
Time time.Time
TimeFormatted string
}
Expand Down Expand Up @@ -119,6 +120,7 @@ var IndexTemplate = template.Must(template.New("index.html.tmpl").Parse(`
<span>Repository</span>
<span>Project</span>
<span>Workspace</span>
<span>Locked By</span>
<span>Date/Time</span>
<span>Status</span>
</div>
Expand All @@ -133,6 +135,9 @@ var IndexTemplate = template.Must(template.New("index.html.tmpl").Parse(`
<a class="lock-link" tabindex="-1" href="{{ $basePath }}{{.LockPath}}">
<span><code>{{.Workspace}}</code></span>
</a>
<a class="lock-link" tabindex="-1" href="{{ $basePath }}{{.LockPath}}">
<span class="lock-username">{{.LockedBy}}</span>
</a>
<a class="lock-link" tabindex="-1" href="{{ $basePath }}{{.LockPath}}">
<span class="lock-datetime">{{.TimeFormatted}}</span>
</a>
Expand Down
1 change: 1 addition & 0 deletions server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -1037,6 +1037,7 @@ func (s *Server) Index(w http.ResponseWriter, _ *http.Request) {
// query params as part of the lock URL.
LockPath: lockURL.String(),
RepoFullName: v.Project.RepoFullName,
LockedBy: v.Pull.Author,
PullNum: v.Pull.Num,
Path: v.Project.Path,
Workspace: v.Workspace,
Expand Down
6 changes: 5 additions & 1 deletion server/static/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ tbody {
/* Styles for the lock index */
.lock-grid{
display: grid;
grid-template-columns: auto auto auto auto auto;
grid-template-columns: auto auto auto auto auto auto;
border: 1px solid #dbeaf4;
width: 100%;
font-size: 12px;
Expand Down Expand Up @@ -282,6 +282,10 @@ tbody {
word-break: break-all;
}

.lock-username {
word-break: break-all;
}

.lock-path {
padding: .2rem .5rem;
margin: 0 .2rem;
Expand Down

0 comments on commit a791fbf

Please sign in to comment.