Browse Source

public: minor fix for PR #5276

pull/5317/head
Unknwon 7 years ago
parent
commit
f6bdefe3f3
No known key found for this signature in database
GPG Key ID: 7A02C406FAC875A2
  1. 2
      gogs.go
  2. 4
      models/pull.go
  3. 4
      pkg/bindata/bindata.go
  4. 3
      public/css/gogs.css
  5. 11
      public/js/gogs.js
  6. 3
      public/less/_repository.less
  7. 2
      templates/.VERSION
  8. 12
      templates/repo/issue/view_content.tmpl

2
gogs.go

@ -16,7 +16,7 @@ import (
"github.com/gogs/gogs/pkg/setting" "github.com/gogs/gogs/pkg/setting"
) )
const APP_VER = "0.11.58.0625" const APP_VER = "0.11.59.0626"
func init() { func init() {
setting.AppVer = APP_VER setting.AppVer = APP_VER

4
models/pull.go

@ -193,7 +193,7 @@ const (
// Merge merges pull request to base repository. // Merge merges pull request to base repository.
// FIXME: add repoWorkingPull make sure two merges does not happen at same time. // FIXME: add repoWorkingPull make sure two merges does not happen at same time.
func (pr *PullRequest) Merge(doer *User, baseGitRepo *git.Repository, mergeStyle MergeStyle, CommitDescription string) (err error) { func (pr *PullRequest) Merge(doer *User, baseGitRepo *git.Repository, mergeStyle MergeStyle, commitDescription string) (err error) {
defer func() { defer func() {
go HookQueue.Add(pr.BaseRepo.ID) go HookQueue.Add(pr.BaseRepo.ID)
go AddTestPullRequestTask(doer, pr.BaseRepo.ID, pr.BaseBranch, false) go AddTestPullRequestTask(doer, pr.BaseRepo.ID, pr.BaseBranch, false)
@ -267,7 +267,7 @@ func (pr *PullRequest) Merge(doer *User, baseGitRepo *git.Repository, mergeStyle
fmt.Sprintf("PullRequest.Merge (git merge): %s", tmpBasePath), fmt.Sprintf("PullRequest.Merge (git merge): %s", tmpBasePath),
"git", "commit", fmt.Sprintf("--author='%s <%s>'", sig.Name, sig.Email), "git", "commit", fmt.Sprintf("--author='%s <%s>'", sig.Name, sig.Email),
"-m", fmt.Sprintf("Merge branch '%s' of %s/%s into %s", pr.HeadBranch, pr.HeadUserName, pr.HeadRepo.Name, pr.BaseBranch), "-m", fmt.Sprintf("Merge branch '%s' of %s/%s into %s", pr.HeadBranch, pr.HeadUserName, pr.HeadRepo.Name, pr.BaseBranch),
"-m", CommitDescription); err != nil { "-m", commitDescription); err != nil {
return fmt.Errorf("git commit [%s]: %v - %s", tmpBasePath, err, stderr) return fmt.Errorf("git commit [%s]: %v - %s", tmpBasePath, err, stderr)
} }

4
pkg/bindata/bindata.go

File diff suppressed because one or more lines are too long

3
public/css/gogs.css

@ -1731,6 +1731,9 @@ footer .ui.language .menu {
margin-left: 10px; margin-left: 10px;
margin-top: 10px; margin-top: 10px;
} }
.repository.view.issue .pull .merge.box #commit_description {
height: auto;
}
.repository.view.issue .comment-list:before { .repository.view.issue .comment-list:before {
display: block; display: block;
content: ""; content: "";

11
public/js/gogs.js

@ -111,7 +111,7 @@ function initCommentForm() {
// This should be added directly to HTML but somehow just get empty <span> on this page. // This should be added directly to HTML but somehow just get empty <span> on this page.
$labelMenu.find('.item:not(.no-select) .octicon:not(.octicon-check)').each(function () { $labelMenu.find('.item:not(.no-select) .octicon:not(.octicon-check)').each(function () {
$(this).html('&nbsp;'); $(this).html('&nbsp;');
}) });
$labelMenu.find('.item:not(.no-select)').click(function () { $labelMenu.find('.item:not(.no-select)').click(function () {
if ($(this).hasClass('checked')) { if ($(this).hasClass('checked')) {
$(this).removeClass('checked'); $(this).removeClass('checked');
@ -499,6 +499,15 @@ function initRepository() {
if ($('.repository.compare.pull').length > 0) { if ($('.repository.compare.pull').length > 0) {
initFilterSearchDropdown('.choose.branch .dropdown'); initFilterSearchDropdown('.choose.branch .dropdown');
} }
if ($('.repository.view.pull').length > 0) {
$('.comment.merge.box input[name=merge_style]').change(function () {
if ($(this).val() === 'create_merge_commit') {
$('.commit.description.field').show();
} else {
$('.commit.description.field').hide();
}
})
}
} }
function initWikiForm() { function initWikiForm() {

3
public/less/_repository.less

@ -639,6 +639,9 @@
margin-left: 10px; margin-left: 10px;
margin-top: 10px; margin-top: 10px;
} }
#commit_description {
height: auto;
}
} }
} }
.comment-list { .comment-list {

2
templates/.VERSION

@ -1 +1 @@
0.11.58.0625 0.11.59.0626

12
templates/repo/issue/view_content.tmpl

@ -195,12 +195,6 @@
<div class="ui divider"></div> <div class="ui divider"></div>
<form class="ui form" action="{{.Link}}/merge" method="post"> <form class="ui form" action="{{.Link}}/merge" method="post">
{{.CSRFTokenHTML}} {{.CSRFTokenHTML}}
<div class="field">
<div class="ui top">
<label>{{$.i18n.Tr "repo.pulls.commit_description"}}:</label>
<textarea id="commit_description" class="edit_area" name="commit_description" tabindex="4"></textarea>
</div>
</div>
<div class="field"> <div class="field">
<div class="ui radio checkbox"> <div class="ui radio checkbox">
<input type="radio" name="merge_style" value="create_merge_commit" checked="checked"> <input type="radio" name="merge_style" value="create_merge_commit" checked="checked">
@ -215,6 +209,12 @@
</div> </div>
</div> </div>
{{end}} {{end}}
<div class="commit description field">
<div class="ui top">
<p>{{$.i18n.Tr "repo.pulls.commit_description"}}:</p>
<textarea id="commit_description" name="commit_description" tabindex="4" rows="3"></textarea>
</div>
</div>
<button class="ui green button"> <button class="ui green button">
<span class="octicon octicon-git-merge"></span> {{$.i18n.Tr "repo.pulls.merge_pull_request"}} <span class="octicon octicon-git-merge"></span> {{$.i18n.Tr "repo.pulls.merge_pull_request"}}
</button> </button>

Loading…
Cancel
Save