diff options
author | Zsombor <gzsombor@users.noreply.github.com> | 2017-08-24 14:30:27 +0200 |
---|---|---|
committer | Lauris BH <lauris@nix.lv> | 2017-08-24 15:30:27 +0300 |
commit | da230a287264d38156e950a3149e43f65599e65b (patch) | |
tree | 4c5f4d16186f2d201515f77fdf99e9d3fc90df95 /templates/repo/issue | |
parent | 174255e74ee2c07e685913ab8bce08fc046569f0 (diff) | |
download | gitea-da230a287264d38156e950a3149e43f65599e65b.tar.gz gitea-da230a287264d38156e950a3149e43f65599e65b.zip |
Add possibility to record branch or tag information in an issue (#780)
Diffstat (limited to 'templates/repo/issue')
-rw-r--r-- | templates/repo/issue/branch_selector_field.tmpl | 41 | ||||
-rw-r--r-- | templates/repo/issue/list.tmpl | 3 | ||||
-rw-r--r-- | templates/repo/issue/new_form.tmpl | 2 | ||||
-rw-r--r-- | templates/repo/issue/view_content/sidebar.tmpl | 2 |
4 files changed, 48 insertions, 0 deletions
diff --git a/templates/repo/issue/branch_selector_field.tmpl b/templates/repo/issue/branch_selector_field.tmpl new file mode 100644 index 0000000000..72b953b666 --- /dev/null +++ b/templates/repo/issue/branch_selector_field.tmpl @@ -0,0 +1,41 @@ +<input id="ref_selector" name="ref" type="hidden" value="{{.Issue.Ref}}"> +<div class="ui {{if .ReadOnly}}disabled{{end}} floating filter select-branch dropdown" data-no-results="{{.i18n.Tr "repo.pulls.no_results"}}"> + <div class="ui basic small button"> + <span class="text branch-name">{{if .Issue.Ref}}{{.Issue.Ref}}{{else}}{{.i18n.Tr "repo.issues.no_ref"}}{{end}}</span> + <i class="dropdown icon"></i> + </div> + <div class="menu"> + <div class="ui icon search input"> + <i class="filter icon"></i> + <input name="search" placeholder="{{.i18n.Tr "repo.filter_branch_and_tag"}}..."> + </div> + <div class="header"> + <div class="ui grid"> + <div class="two column row"> + <a class="reference column" href="#" data-target="#branch-list"> + <span class="text black"> + <i class="octicon octicon-git-branch"></i> {{.i18n.Tr "repo.branches"}} + </span> + </a> + <a class="reference column" href="#" data-target="#tag-list"> + <span class="text"> + <i class="reference tags icon"></i> {{.i18n.Tr "repo.tags"}} + </span> + </a> + </div> + </div> + </div> + <div id="branch-list" class="scrolling menu reference-list-menu"> + {{range .Branches}} + <div class="item" data-id="{{.}}" data-id-selector="#ref_selector">{{.}}</div> + {{end}} + </div> + <div id="tag-list" class="scrolling menu reference-list-menu" style="display: none"> + {{range .Tags}} + <div class="item" data-id="{{.}}" data-id-selector="#ref_selector">{{.}}</div> + {{end}} + </div> + </div> +</div> + +<div class="ui divider"></div> diff --git a/templates/repo/issue/list.tmpl b/templates/repo/issue/list.tmpl index 8de52fb23f..5c5a574976 100644 --- a/templates/repo/issue/list.tmpl +++ b/templates/repo/issue/list.tmpl @@ -171,6 +171,9 @@ <div class="ui {{if .IsRead}}black{{else}}green{{end}} label">#{{.Index}}</div> <a class="title has-emoji" href="{{$.Link}}/{{.Index}}">{{.Title}}</a> + {{if .Ref}} + <a class="ui label" href="{{$.RepoLink}}/src/{{.Ref}}">{{.Ref}}</a> + {{end}} {{range .Labels}} <a class="ui label" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&state={{$.State}}&labels={{.ID}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}" style="color: {{.ForegroundColor}}; background-color: {{.Color}}">{{.Name | Sanitize}}</a> {{end}} diff --git a/templates/repo/issue/new_form.tmpl b/templates/repo/issue/new_form.tmpl index bfb97da2da..829f66943b 100644 --- a/templates/repo/issue/new_form.tmpl +++ b/templates/repo/issue/new_form.tmpl @@ -32,6 +32,8 @@ <div class="four wide column"> <div class="ui segment metas"> + {{template "repo/issue/branch_selector_field" .}} + <input id="label_ids" name="label_ids" type="hidden" value="{{.label_ids}}"> <div class="ui {{if not .Labels}}disabled{{end}} floating jump select-label dropdown"> <span class="text"> diff --git a/templates/repo/issue/view_content/sidebar.tmpl b/templates/repo/issue/view_content/sidebar.tmpl index cfb6f183b4..2c6149ed29 100644 --- a/templates/repo/issue/view_content/sidebar.tmpl +++ b/templates/repo/issue/view_content/sidebar.tmpl @@ -1,5 +1,7 @@ <div class="four wide column"> <div class="ui segment metas"> + {{template "repo/issue/branch_selector_field" .}} + <div class="ui {{if not .IsRepositoryWriter}}disabled{{end}} floating jump select-label dropdown"> <span class="text"> <strong>{{.i18n.Tr "repo.issues.new.labels"}}</strong> |