re-added the simple repo list to the home page

This commit is contained in:
Brad Rydzewski 2015-10-02 16:47:54 -07:00
parent 130c133b92
commit 71a0879309
6 changed files with 84 additions and 26 deletions

View file

@ -15,35 +15,18 @@ import (
) )
func ShowIndex(c *gin.Context) { func ShowIndex(c *gin.Context) {
// remote := context.Remote(c) db := context.Database(c)
user := session.User(c) user := session.User(c)
if user == nil { if user == nil {
c.HTML(200, "login.html", gin.H{}) c.HTML(200, "login.html", gin.H{})
return return
} }
// attempt to get the repository list from the repos, _ := model.GetRepoList(db, user)
// 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)
c.HTML(200, "repos.html", gin.H{ c.HTML(200, "repos.html", gin.H{
"User": user, "User": user,
// "Repos": repos, "Repos": repos,
}) })
} }

View file

@ -112,6 +112,7 @@ WHERE repo_id IN (
FROM builds FROM builds
WHERE build_author = ? WHERE build_author = ?
) )
ORDER BY repo_full_name
` `
const repoDeleteStmt = ` const repoDeleteStmt = `

View 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;

View file

@ -14,6 +14,7 @@
@import pages/user.sass @import pages/user.sass
@import pages/repo.sass @import pages/repo.sass
@import pages/login.sass @import pages/login.sass
@import pages/feed.sass
@import header @import header
@import search @import search

View file

@ -273,6 +273,22 @@ body.login div.alert { position: fixed; top: 0px; left: 0px; right: 0px; line-he
@keyframes fadein { 0% { opacity: 0; } @keyframes fadein { 0% { opacity: 0; }
100% { opacity: 1; } } 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-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; } .tt-selectable:hover, .tt-cursor { background: #f4f4f4; }

View file

@ -3,11 +3,21 @@ extends base
block append head block append head
title Dashboard title Dashboard
block header
ol
li Dashboard
block content block content
div.container div.container
div.alert.alert-info if len(Repos) == 0
| We haven't decided what to put on the main screen yet. This will div.alert.alert-info
| be decided before we snapshot a beta release. In the mean time, | Your repository list is empty.
| use the search box to find a repository. Make sure you type the
| fully qualified repository name (ie owner/name)
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}