re-added the simple repo list to the home page
This commit is contained in:
parent
130c133b92
commit
71a0879309
6 changed files with 84 additions and 26 deletions
|
@ -15,35 +15,18 @@ import (
|
|||
)
|
||||
|
||||
func ShowIndex(c *gin.Context) {
|
||||
// remote := context.Remote(c)
|
||||
db := context.Database(c)
|
||||
user := session.User(c)
|
||||
if user == nil {
|
||||
c.HTML(200, "login.html", gin.H{})
|
||||
return
|
||||
}
|
||||
|
||||
// attempt to get the repository list from the
|
||||
// cache since the operation is expensive
|
||||
// v, ok := cache.Get(user.Login)
|
||||
// if ok {
|
||||
// c.HTML(200, "repos.html", gin.H{
|
||||
// "User": user,
|
||||
// "Repos": v,
|
||||
// })
|
||||
// return
|
||||
// }
|
||||
|
||||
// fetch the repmote repos
|
||||
// repos, err := remote.Repos(user)
|
||||
// if err != nil {
|
||||
// c.AbortWithStatus(http.StatusInternalServerError)
|
||||
// return
|
||||
// }
|
||||
// cache.Add(user.Login, repos)
|
||||
repos, _ := model.GetRepoList(db, user)
|
||||
|
||||
c.HTML(200, "repos.html", gin.H{
|
||||
"User": user,
|
||||
// "Repos": repos,
|
||||
"Repos": repos,
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
@ -112,6 +112,7 @@ WHERE repo_id IN (
|
|||
FROM builds
|
||||
WHERE build_author = ?
|
||||
)
|
||||
ORDER BY repo_full_name
|
||||
`
|
||||
|
||||
const repoDeleteStmt = `
|
||||
|
|
47
static/styles/pages/feed.sass
Normal file
47
static/styles/pages/feed.sass
Normal file
|
@ -0,0 +1,47 @@
|
|||
.repo-row
|
||||
.col-sm-4
|
||||
width:100%;
|
||||
.col-sm-4:last-child .card
|
||||
border-bottom:none
|
||||
.card
|
||||
border: none;
|
||||
border-bottom: 1px solid #EEE;
|
||||
border-radius: 0px;
|
||||
position: relative
|
||||
display: flex;
|
||||
text-decoration:none;
|
||||
.card-block
|
||||
h3
|
||||
font-size: 1.1rem;
|
||||
color:#2b303b;
|
||||
.card-text
|
||||
color: rgba(0,0,0,0.5);
|
||||
font-size:0.95rem;
|
||||
margin:0px;
|
||||
|
||||
.btn-group
|
||||
position: absolute;
|
||||
top: 15px;
|
||||
right: 0px;
|
||||
|
||||
.btn-danger
|
||||
color: #bf616a;
|
||||
background: #FFF;
|
||||
border: 1px solid #bf616a;
|
||||
outline: none;
|
||||
cursor: pointer;
|
||||
width: auto;
|
||||
text-transform: uppercase;
|
||||
padding: 0px 10px;
|
||||
border-radius: 2px;
|
||||
font-size: 11px;
|
||||
line-height: 30px;
|
||||
height: auto;
|
||||
margin-left: 10px;
|
||||
|
||||
.card-header
|
||||
background: #FFF;
|
||||
border-bottom: none;
|
||||
padding-right:0px;
|
||||
padding-left:0px;
|
||||
width:45px;
|
|
@ -14,6 +14,7 @@
|
|||
@import pages/user.sass
|
||||
@import pages/repo.sass
|
||||
@import pages/login.sass
|
||||
@import pages/feed.sass
|
||||
|
||||
@import header
|
||||
@import search
|
||||
|
|
|
@ -273,6 +273,22 @@ body.login div.alert { position: fixed; top: 0px; left: 0px; right: 0px; line-he
|
|||
@keyframes fadein { 0% { opacity: 0; }
|
||||
100% { opacity: 1; } }
|
||||
|
||||
.repo-row .col-sm-4 { width: 100%; }
|
||||
|
||||
.repo-row .col-sm-4:last-child .card { border-bottom: none; }
|
||||
|
||||
.repo-row .card { border: none; border-bottom: 1px solid #EEE; border-radius: 0px; position: relative; display: flex; text-decoration: none; }
|
||||
|
||||
.repo-row .card-block h3 { font-size: 1.1rem; color: #2b303b; }
|
||||
|
||||
.repo-row .card-block .card-text { color: rgba(0, 0, 0, 0.5); font-size: 0.95rem; margin: 0px; }
|
||||
|
||||
.repo-row .card-block .btn-group { position: absolute; top: 15px; right: 0px; }
|
||||
|
||||
.repo-row .card-block .btn-group .btn-danger { color: #bf616a; background: #FFF; border: 1px solid #bf616a; outline: none; cursor: pointer; width: auto; text-transform: uppercase; padding: 0px 10px; border-radius: 2px; font-size: 11px; line-height: 30px; height: auto; margin-left: 10px; }
|
||||
|
||||
.repo-row .card-header { background: #FFF; border-bottom: none; padding-right: 0px; padding-left: 0px; width: 45px; }
|
||||
|
||||
.tt-open { position: absolute; top: 34px; left: 0px; z-index: 100; display: none; background: #FFF; min-width: 100%; border: 1px solid #eee; border-radius: 0px; }
|
||||
|
||||
.tt-selectable:hover, .tt-cursor { background: #f4f4f4; }
|
||||
|
|
|
@ -3,11 +3,21 @@ extends base
|
|||
block append head
|
||||
title Dashboard
|
||||
|
||||
block header
|
||||
ol
|
||||
li Dashboard
|
||||
|
||||
block content
|
||||
div.container
|
||||
if len(Repos) == 0
|
||||
div.alert.alert-info
|
||||
| We haven't decided what to put on the main screen yet. This will
|
||||
| be decided before we snapshot a beta release. In the mean time,
|
||||
| use the search box to find a repository. Make sure you type the
|
||||
| fully qualified repository name (ie owner/name)
|
||||
| Your repository list is empty.
|
||||
|
||||
div.row.repo-row
|
||||
each $repo in Repos
|
||||
div.col-sm-4
|
||||
a.card[href="/"+$repo.FullName]
|
||||
div.card-header
|
||||
img.avatar[src=$repo.Avatar]
|
||||
div.card-block
|
||||
h3.login #{$repo.Name}
|
Loading…
Reference in a new issue