Skip to content

Commit

Permalink
记录按最新时间显示排序
Browse files Browse the repository at this point in the history
  • Loading branch information
yhy0 committed Feb 2, 2023
1 parent 4e0e514 commit 1a6c51a
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pkg/db/record.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ func AddRecord(record Record) {

func GetRecord() (records []Record) {
globalDBTmp := GlobalDB.Model(&Record{})
globalDBTmp.Order("id asc").Find(&records)
globalDBTmp.Order("id desc").Find(&records)
return
}
4 changes: 2 additions & 2 deletions pkg/web/static/record.css
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
.vertical-timeline-element-content {
position: relative;
margin-left: 90px;
font-size: .8rem;
font-size: 1rem;
}

.vertical-timeline-element-content .timeline-msg {
Expand All @@ -103,7 +103,7 @@
font-size: 1.1rem;
text-transform: uppercase;
margin: 0 0 .5rem;
padding: 2px 75px 0;
padding: 0px 75px 0;
font-weight: bold;
}

Expand Down
1 change: 1 addition & 0 deletions pkg/web/templates/about.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
</div>
</body>
<footer class="text-center text-lg-start fixed-bottom">

<!-- Copyright -->
<div class="text-center p-3">
© {{ .year}} Copyright:
Expand Down
2 changes: 1 addition & 1 deletion pkg/web/templates/record.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
<div class="col-md-6">
<div class="main-card mb-3 card">
<div class="card-body">
<h5 class="card-title">Timeline</h5>
<h5 class="card-title" align="center">Timeline</h5>
<div class="vertical-timeline vertical-timeline--animate vertical-timeline--one-column">
{{ range $key,$value := .records }}
<div class="vertical-timeline-item vertical-timeline-element">
Expand Down

0 comments on commit 1a6c51a

Please sign in to comment.