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