Skip to content

Commit

Permalink
Add checkbox to search for all the branches by commit message (gogs#813)
Browse files Browse the repository at this point in the history
and updating the vendor directory
  • Loading branch information
gzsombor authored and lunny committed Feb 5, 2017
1 parent f35b20b commit e388db3
Show file tree
Hide file tree
Showing 9 changed files with 39 additions and 18 deletions.
1 change: 1 addition & 0 deletions options/locale/locale_en-US.ini
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,7 @@ editor.upload_files_to_dir = Upload files to '%s'

commits.commits = Commits
commits.search = Search commits
commits.search_all = All
commits.find = Find
commits.author = Author
commits.message = Message
Expand Down
6 changes: 5 additions & 1 deletion routers/repo/commit.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,9 @@ func SearchCommits(ctx *context.Context) {
ctx.Redirect(ctx.Repo.RepoLink + "/commits/" + ctx.Repo.BranchName)
return
}
all := ctx.QueryBool("all")

commits, err := ctx.Repo.Commit.SearchCommits(keyword)
commits, err := ctx.Repo.Commit.SearchCommits(keyword, all)
if err != nil {
ctx.Handle(500, "SearchCommits", err)
return
Expand All @@ -122,6 +123,9 @@ func SearchCommits(ctx *context.Context) {
ctx.Data["Commits"] = commits

ctx.Data["Keyword"] = keyword
if all {
ctx.Data["All"] = "checked"
}
ctx.Data["Username"] = ctx.Repo.Owner.Name
ctx.Data["Reponame"] = ctx.Repo.Repository.Name
ctx.Data["CommitCount"] = commits.Len()
Expand Down
1 change: 1 addition & 0 deletions templates/repo/commits_table.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<div class="ui tiny search input">
<input name="q" placeholder="{{.i18n.Tr "repo.commits.search"}}" value="{{.Keyword}}" autofocus>
</div>
<input type="checkbox" name="all" id="all" value="true" {{.All}}><label for="all">{{.i18n.Tr "repo.commits.search_all"}}</label>
<button class="ui black tiny button" data-panel="#add-deploy-key-panel">{{.i18n.Tr "repo.commits.find"}}</button>
</form>
</div>
Expand Down
20 changes: 10 additions & 10 deletions vendor/code.gitea.io/git/CONTRIBUTING.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions vendor/code.gitea.io/git/MAINTAINERS

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions vendor/code.gitea.io/git/commit.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions vendor/code.gitea.io/git/repo_branch.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions vendor/code.gitea.io/git/repo_commit.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions vendor/vendor.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
"ignore": "test",
"package": [
{
"checksumSHA1": "P2wIRW07gnEgqLZAcg7bz+Jw9Oc=",
"checksumSHA1": "km1AOUs34DCwgXT55fh6PrkPdiU=",
"path": "code.gitea.io/git",
"revision": "7477742b3c79d36d099baaf614864b6bbdfdecca",
"revisionTime": "2017-01-09T15:46:57Z"
"revision": "dd951bf625ebf5c16ef403f681aaec6c34324bca",
"revisionTime": "2017-02-05T02:50:57Z"
},
{
"checksumSHA1": "BKj0haFTDebzdC2nACpoGzp3s8A=",
Expand Down

0 comments on commit e388db3

Please sign in to comment.