mirror of
https://github.com/go-gitea/gitea
synced 2024-12-29 10:04:32 +01:00
Merge branch 'dev' of github.com:gogits/gogs into dev
This commit is contained in:
commit
f92851e347
9 changed files with 103 additions and 24 deletions
|
@ -21,6 +21,7 @@ import (
|
|||
"github.com/gogits/git"
|
||||
|
||||
"github.com/gogits/gogs/modules/base"
|
||||
"github.com/gogits/gogs/modules/log"
|
||||
)
|
||||
|
||||
// RepoFile represents a file object in git repository.
|
||||
|
@ -300,6 +301,13 @@ func ParsePatch(reader io.Reader) (*Diff, error) {
|
|||
}
|
||||
|
||||
i = i + 1
|
||||
|
||||
// Diff data too large.
|
||||
if i == 5000 {
|
||||
log.Warn("Diff data too large")
|
||||
return &Diff{}, nil
|
||||
}
|
||||
|
||||
if line == "" {
|
||||
continue
|
||||
}
|
||||
|
|
|
@ -192,8 +192,10 @@ func CreateRepository(user *User, repoName, desc, repoLang, license string, priv
|
|||
return nil, err
|
||||
}
|
||||
|
||||
if err = NewRepoAction(user, repo); err != nil {
|
||||
log.Error("repo.CreateRepository(NewRepoAction): %v", err)
|
||||
if !repo.IsPrivate {
|
||||
if err = NewRepoAction(user, repo); err != nil {
|
||||
log.Error("repo.CreateRepository(NewRepoAction): %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
if err = WatchRepo(user.Id, repo.Id, true); err != nil {
|
||||
|
|
|
@ -302,9 +302,9 @@ func NewConfigContext() {
|
|||
InstallLock = Cfg.MustBool("security", "INSTALL_LOCK", false)
|
||||
|
||||
RunUser = Cfg.MustValue("", "RUN_USER")
|
||||
curUser := os.Getenv("USERNAME")
|
||||
curUser := os.Getenv("USER")
|
||||
if len(curUser) == 0 {
|
||||
curUser = os.Getenv("USER")
|
||||
curUser = os.Getenv("USERNAME")
|
||||
}
|
||||
// Does not check run user when the install lock is off.
|
||||
if InstallLock && RunUser != curUser {
|
||||
|
|
|
@ -74,6 +74,7 @@ html, body {
|
|||
padding-left: 0;
|
||||
padding-right: 0;
|
||||
margin-right: 10px;
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.nav-item:hover,
|
||||
|
@ -258,14 +259,40 @@ html, body {
|
|||
}
|
||||
|
||||
#social-login {
|
||||
margin-top: 30px;
|
||||
padding-top: 20px;
|
||||
margin-top: 40px;
|
||||
padding-top: 40px;
|
||||
border-top: 1px solid #ccc;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
#social-login .btn {
|
||||
float: none;
|
||||
margin: auto;
|
||||
margin: auto 4px;
|
||||
}
|
||||
|
||||
#social-login .btn .fa {
|
||||
margin-left: 0;
|
||||
margin-right: 4px;
|
||||
}
|
||||
|
||||
#social-login .btn span {
|
||||
display: inline-block;
|
||||
vertical-align: top;
|
||||
font-size: 16px;
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
#social-login h4 {
|
||||
position: absolute;
|
||||
top: -20px;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
#social-login h4 span {
|
||||
background-color: #FFF;
|
||||
padding: 0 12px;
|
||||
}
|
||||
|
||||
/* gogs-user-profile */
|
||||
|
@ -310,6 +337,22 @@ html, body {
|
|||
padding-right: 18px;
|
||||
}
|
||||
|
||||
#user-profile .profile-rel .col-md-6 {
|
||||
text-align: center;
|
||||
padding-bottom: 12px;
|
||||
}
|
||||
|
||||
#user-profile .profile-rel strong {
|
||||
font-size: 24px;
|
||||
color: #444;
|
||||
display: block;
|
||||
}
|
||||
|
||||
#user-profile .profile-rel p {
|
||||
margin-right: 0;
|
||||
color: #888;
|
||||
}
|
||||
|
||||
#user-activity .tab-pane {
|
||||
padding: 20px;
|
||||
}
|
||||
|
|
|
@ -146,9 +146,9 @@ func InstallPost(ctx *middleware.Context, form auth.InstallForm) {
|
|||
}
|
||||
|
||||
// Check run user.
|
||||
curUser := os.Getenv("USERNAME")
|
||||
curUser := os.Getenv("USER")
|
||||
if len(curUser) == 0 {
|
||||
curUser = os.Getenv("USER")
|
||||
curUser = os.Getenv("USERNAME")
|
||||
}
|
||||
// Does not check run user when the install lock is off.
|
||||
if form.RunUser != curUser {
|
||||
|
|
|
@ -50,16 +50,10 @@ func Commits(ctx *middleware.Context, params martini.Params) {
|
|||
nextPage = 0
|
||||
}
|
||||
|
||||
var commits *list.List
|
||||
if models.IsBranchExist(userName, repoName, branchName) {
|
||||
// commits, err = models.GetCommitsByBranch(userName, repoName, branchName)
|
||||
commits, err = models.GetCommitsByRange(repoPath, branchName, page)
|
||||
} else {
|
||||
commits, err = models.GetCommitsByCommitId(userName, repoName, branchName)
|
||||
}
|
||||
|
||||
//both `git log branchName` and `git log commitId` work
|
||||
commits, err := models.GetCommitsByRange(repoPath, branchName, page)
|
||||
if err != nil {
|
||||
ctx.Handle(404, "repo.Commits(get commits)", err)
|
||||
ctx.Handle(500, "repo.Commits(get commits)", err)
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -109,6 +103,7 @@ func Diff(ctx *middleware.Context, params martini.Params) {
|
|||
ctx.Data["Title"] = commit.Message() + " · " + base.ShortSha(commitId)
|
||||
ctx.Data["Commit"] = commit
|
||||
ctx.Data["Diff"] = diff
|
||||
ctx.Data["DiffNotAvailable"] = diff.NumFiles() == 0
|
||||
ctx.Data["IsRepoToolbarCommits"] = true
|
||||
ctx.Data["SourcePath"] = "/" + path.Join(userName, repoName, "src", commitId)
|
||||
ctx.Data["RawPath"] = "/" + path.Join(userName, repoName, "raw", commitId)
|
||||
|
|
|
@ -20,6 +20,9 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
{{if .DiffNotAvailable}}
|
||||
<h4>Diff Data Not Available.</h4>
|
||||
{{else}}
|
||||
<div class="diff-detail-box diff-box">
|
||||
<a class="pull-right btn btn-default" data-toggle="collapse" data-target="#diff-files">Show Diff Stats</a>
|
||||
<p class="showing">
|
||||
|
@ -97,6 +100,7 @@
|
|||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
{{template "base/footer" .}}
|
||||
|
|
|
@ -10,6 +10,18 @@
|
|||
</div>
|
||||
<div class="profile-info">
|
||||
<ul class="list-group">
|
||||
<li class="list-group-item">
|
||||
<div class="profile-rel">
|
||||
<div class="col-md-6 followers">
|
||||
<strong>123</strong>
|
||||
<p>followers</p>
|
||||
</div>
|
||||
<div class="col-md-6 following">
|
||||
<strong>123</strong>
|
||||
<p>following</p>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
{{if .Owner.Location}}
|
||||
<li class="list-group-item"><i class="fa fa-thumb-tack"></i>{{.Owner.Location}}</li>
|
||||
{{end}}
|
||||
|
|
|
@ -4,13 +4,13 @@
|
|||
<form action="/user/login" method="post" class="form-horizontal card" id="login-card">
|
||||
{{.CsrfTokenHtml}}
|
||||
<h3>Log in
|
||||
{{if .OauthEnabled}}
|
||||
<!--{{if .OauthEnabled}}
|
||||
<small class="pull-right">social login:
|
||||
{{if .OauthGitHubEnabled}}
|
||||
<a href="/user/login/github?next=/user/sign_up"><i class="fa fa-github-square fa-2x"></i></a>
|
||||
{{end}}
|
||||
</small>
|
||||
{{end}}
|
||||
{{end}}-->
|
||||
</h3>
|
||||
{{template "base/alert" .}}
|
||||
<div class="form-group {{if .Err_UserName}}has-error has-feedback{{end}}">
|
||||
|
@ -51,12 +51,27 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<!-- {{if .OauthEnabled}}
|
||||
{{if .OauthEnabled}}
|
||||
<div class="form-group text-center" id="social-login">
|
||||
<h4>Log In with Social Accounts</h4>
|
||||
{{if .OauthGitHubEnabled}}<a href="/user/login/github?next=/user/sign_up"><i class="fa fa-github-square fa-3x"></i></a>{{end}}
|
||||
<h4><span>or</span></h4>
|
||||
<!--<a href="/user/login/github?next=/user/sign_up" class="btn btn-default google">
|
||||
<i class="fa fa-google-plus-square fa-2x"></i>
|
||||
<span>Google</span>
|
||||
</a>
|
||||
<a href="/user/login/github?next=/user/sign_up" class="btn btn-default facebbok">
|
||||
<i class="fa fa-facebook-square fa-2x"></i>
|
||||
<span>Facebook</span>
|
||||
</a>
|
||||
<a href="/user/login/github?next=/user/sign_up" class="btn btn-default weibo">
|
||||
<i class="fa fa-weibo fa-2x"></i>
|
||||
<span>Weibo</span>
|
||||
</a>-->
|
||||
{{if .OauthGitHubEnabled}}<a href="/user/login/github?next=/user/sign_up" class="github btn btn-default">
|
||||
<i class="fa fa-github-square fa-2x"></i>
|
||||
<span>GitHub</span>
|
||||
</a>{{end}}
|
||||
</div>
|
||||
{{end}} -->
|
||||
{{end}}
|
||||
</form>
|
||||
</div>
|
||||
{{template "base/footer" .}}
|
||||
|
|
Loading…
Reference in a new issue