diff options
author | kolaente <konrad@kola-entertainments.de> | 2018-05-09 18:29:04 +0200 |
---|---|---|
committer | Lauris BH <lauris@nix.lv> | 2018-05-09 19:29:04 +0300 |
commit | 95f2e2b57beedcdeb2b9623dc86e26f252fdd7bd (patch) | |
tree | ebfeb5b898f72fc57ac1fe9680374fdb4bc91aeb /templates/repo/issue | |
parent | 238a997ec0b5d3e3bed0e55edcacebb44f86d373 (diff) | |
download | gitea-95f2e2b57beedcdeb2b9623dc86e26f252fdd7bd.tar.gz gitea-95f2e2b57beedcdeb2b9623dc86e26f252fdd7bd.zip |
Multiple assignees (#3705)
Diffstat (limited to 'templates/repo/issue')
-rw-r--r-- | templates/repo/issue/list.tmpl | 8 | ||||
-rw-r--r-- | templates/repo/issue/new_form.tmpl | 41 | ||||
-rw-r--r-- | templates/repo/issue/view_content/comments.tmpl | 32 | ||||
-rw-r--r-- | templates/repo/issue/view_content/sidebar.tmpl | 35 |
4 files changed, 88 insertions, 28 deletions
diff --git a/templates/repo/issue/list.tmpl b/templates/repo/issue/list.tmpl index d8e42df12c..40a56b1b32 100644 --- a/templates/repo/issue/list.tmpl +++ b/templates/repo/issue/list.tmpl @@ -156,7 +156,7 @@ </div> </div> - <!-- Assignee --> + <!-- Assignees --> <div class="ui {{if not .Assignees}}disabled{{end}} dropdown jump item"> <span class="text"> {{.i18n.Tr "repo.issues.action_assignee"}} @@ -220,9 +220,9 @@ <span class="octicon octicon-calendar"></span> <span{{if .IsOverdue}} class="overdue"{{end}}>{{.DeadlineUnix.FormatShort}}</span> {{end}} - {{if .Assignee}} - <a class="ui right assignee poping up" href="{{.Assignee.HomeLink}}" data-content="{{.Assignee.Name}}" data-variation="inverted" data-position="left center"> - <img class="ui avatar image" src="{{.Assignee.RelAvatarLink}}"> + {{range .Assignees}} + <a class="ui right assignee poping up" href="{{.HomeLink}}" data-content="{{.Name}}" data-variation="inverted" data-position="left center"> + <img class="ui avatar image" src="{{.RelAvatarLink}}"> </a> {{end}} </p> diff --git a/templates/repo/issue/new_form.tmpl b/templates/repo/issue/new_form.tmpl index 2e3c777d53..e904ca4ba7 100644 --- a/templates/repo/issue/new_form.tmpl +++ b/templates/repo/issue/new_form.tmpl @@ -97,27 +97,56 @@ <div class="ui divider"></div> - <input id="assignee_id" name="assignee_id" type="hidden" value="{{.assignee_id}}"> + <input id="assignee_ids" name="assignee_ids" type="hidden" value="{{.assignee_ids}}"> + <div class="ui {{if not .Assignees}}disabled{{end}} floating jump select-assignees dropdown"> + <span class="text"> + <strong>{{.i18n.Tr "repo.issues.new.assignees"}}</strong> + <span class="octicon octicon-gear"></span> + </span> + <div class="filter menu" data-id="#assignee_ids"> + <div class="no-select item">{{.i18n.Tr "repo.issues.new.clear_assignees"}}</div> + {{range .Assignees}} + <a class="item" href="#" data-id="{{.ID}}" data-id-selector="#assignee_{{.ID}}"> + <span class="octicon"></span> + <span class="text"> + <img class="ui avatar image" src="{{.RelAvatarLink}}"> {{.Name}} + </span> + </a> + {{end}} + </div> + </div> + <div class="ui assignees list"> + <span class="no-select item {{if .HasSelectedLabel}}hide{{end}}"> + {{.i18n.Tr "repo.issues.new.no_assignees"}} + </span> + {{range .Assignees}} + <a style="padding: 5px;color:rgba(0, 0, 0, 0.87);" class="hide item" id="assignee_{{.ID}}" href="{{$.RepoLink}}/issues?assignee={{.ID}}"> + <img class="ui avatar image" src="{{.RelAvatarLink}}" style="vertical-align: middle;"> {{.Name}} + </a> + {{end}} + </div> + + <!-- input id="assignee_ids" name="assignee_ids" type="hidden" value="{{.assignee_id}}"> <div class="ui {{if not .Assignees}}disabled{{end}} floating jump select-assignee dropdown"> <span class="text"> - <strong>{{.i18n.Tr "repo.issues.new.assignee"}}</strong> + <strong>{{.i18n.Tr "repo.issues.new.assignees"}}</strong> <span class="octicon octicon-gear"></span> </span> - <div class="menu"> - <div class="no-select item">{{.i18n.Tr "repo.issues.new.clear_assignee"}}</div> + <div class="filter menu"> + <div class="no-select item">{{.i18n.Tr "repo.issues.new.clear_assignees"}}</div> {{range .Assignees}} <div class="item" data-id="{{.ID}}" data-href="{{$.RepoLink}}/issues?assignee={{.ID}}" data-avatar="{{.RelAvatarLink}}"><img src="{{.RelAvatarLink}}"> {{.Name}}</div> {{end}} </div> </div> <div class="ui select-assignee list"> - <span class="no-select item {{if .Assignee}}hide{{end}}">{{.i18n.Tr "repo.issues.new.no_assignee"}}</span> + <span class="no-select item {{if .Assignee}}hide{{end}}">{{.i18n.Tr "repo.issues.new.no_assignees"}}</span> <div class="selected"> {{if .Assignee}} <a class="item" href="{{.RepoLink}}/issues?assignee={{.Assignee.ID}}"><img class="ui avatar image" src="{{.Assignee.RelAvatarLink}}"> {{.Assignee.Name}}</a> {{end}} </div> - </div> + </div>--> </div> </div> </form> diff --git a/templates/repo/issue/view_content/comments.tmpl b/templates/repo/issue/view_content/comments.tmpl index b6d2c96bb5..dc266218bf 100644 --- a/templates/repo/issue/view_content/comments.tmpl +++ b/templates/repo/issue/view_content/comments.tmpl @@ -118,15 +118,29 @@ {{else if eq .Type 9}} <div class="event"> <span class="octicon octicon-primitive-dot"></span> - {{if gt .AssigneeID 0}}{{if eq .Poster.ID .AssigneeID}}<a class="ui avatar image" href="{{.Poster.HomeLink}}"> - <img src="{{.Poster.RelAvatarLink}}"> - </a> <span class="text grey"><a href="{{.Poster.HomeLink}}">{{.Poster.Name}}</a> {{$.i18n.Tr "repo.issues.self_assign_at" $createdStr | Safe}} </span> - {{else}}<a class="ui avatar image" href="{{.Assignee.HomeLink}}"> - <img src="{{.Assignee.RelAvatarLink}}"> - </a><span class="text grey"><a href="{{.Assignee.HomeLink}}">{{.Assignee.Name}}</a> {{$.i18n.Tr "repo.issues.add_assignee_at" .Poster.Name $createdStr | Safe}} </span>{{end}}{{else if gt .OldAssigneeID 0}} - <a class="ui avatar image" href="{{.Poster.HomeLink}}"> - <img src="{{.Poster.RelAvatarLink}}"> - </a> <span class="text grey"><a href="{{.Poster.HomeLink}}">{{.Poster.Name}}</a> {{$.i18n.Tr "repo.issues.remove_assignee_at" $createdStr | Safe}} </span>{{end}} + {{if gt .AssigneeID 0}} + {{if .RemovedAssignee}} + <a class="ui avatar image" href="{{.Assignee.HomeLink}}"> + <img src="{{.Assignee.RelAvatarLink}}"> + </a> + <span class="text grey"> + <a href="{{.Assignee.HomeLink}}">{{.Assignee.Name}}</a> + {{$.i18n.Tr "repo.issues.remove_assignee_at" $createdStr | Safe}} + </span> + {{else}} + <a class="ui avatar image" href="{{.Assignee.HomeLink}}"> + <img src="{{.Assignee.RelAvatarLink}}"> + </a> + <span class="text grey"> + <a href="{{.Assignee.HomeLink}}">{{.Assignee.Name}}</a> + {{if eq .Poster.ID .AssigneeID}} + {{$.i18n.Tr "repo.issues.self_assign_at" $createdStr | Safe}} + {{else}} + {{$.i18n.Tr "repo.issues.add_assignee_at" .Poster.Name $createdStr | Safe}} + {{end}} + </span> + {{end}} + {{end}} </div> {{else if eq .Type 10}} <div class="event"> diff --git a/templates/repo/issue/view_content/sidebar.tmpl b/templates/repo/issue/view_content/sidebar.tmpl index 648533fca1..f403fa7cc7 100644 --- a/templates/repo/issue/view_content/sidebar.tmpl +++ b/templates/repo/issue/view_content/sidebar.tmpl @@ -68,23 +68,40 @@ <div class="ui divider"></div> <input id="assignee_id" name="assignee_id" type="hidden" value="{{.assignee_id}}"> - <div class="ui {{if not .IsRepositoryWriter}}disabled{{end}} floating jump select-assignee dropdown"> + <div class="ui {{if not .IsRepositoryWriter}}disabled{{end}} floating jump select-assignees-modify dropdown"> <span class="text"> - <strong>{{.i18n.Tr "repo.issues.new.assignee"}}</strong> + <strong>{{.i18n.Tr "repo.issues.new.assignees"}}</strong> <span class="octicon octicon-gear"></span> </span> - <div class="menu" data-action="update" data-issue-id="{{$.Issue.ID}}" data-update-url="{{$.RepoLink}}/issues/assignee"> - <div class="no-select item">{{.i18n.Tr "repo.issues.new.clear_assignee"}}</div> + <div class="filter menu" data-action="" data-issue-id="{{$.Issue.ID}}" data-update-url="{{$.RepoLink}}/issues/assignee"> + <div class="no-select item">{{.i18n.Tr "repo.issues.new.clear_assignees"}}</div> {{range .Assignees}} - <div class="item" data-id="{{.ID}}" data-href="{{$.RepoLink}}/issues?assignee={{.ID}}" data-avatar="{{.RelAvatarLink}}"><img src="{{.RelAvatarLink}}"> {{.Name}}</div> + + {{$AssigneeID := .ID}} + <a class="item{{range $.Issue.Assignees}} + {{if eq .ID $AssigneeID}} + checked + {{end}} + {{end}}" href="#" data-id="{{.ID}}" data-id-selector="#assignee_{{.ID}}"> + <span class="octicon{{range $.Issue.Assignees}} + {{if eq .ID $AssigneeID}} + octicon-check + {{end}} + {{end}}"></span> + <span class="text"> + <img class="ui avatar image" src="{{.RelAvatarLink}}"> {{.Name}} + </span> + </a> {{end}} </div> </div> - <div class="ui select-assignee list"> - <span class="no-select item {{if .Issue.Assignee}}hide{{end}}">{{.i18n.Tr "repo.issues.new.no_assignee"}}</span> + <div class="ui assignees list"> + <span class="no-select item {{if .Issue.Assignees}}hide{{end}}">{{.i18n.Tr "repo.issues.new.no_assignees"}}</span> <div class="selected"> - {{if .Issue.Assignee}} - <a class="item" href="{{$.RepoLink}}/issues?assignee={{.Issue.Assignee.ID}}"><img class="ui avatar image" src="{{.Issue.Assignee.RelAvatarLink}}"> {{.Issue.Assignee.Name}}</a> + {{range .Issue.Assignees}} + <div class="item" style="margin-bottom: 10px;"> + <a href="{{$.RepoLink}}/issues?assignee={{.ID}}"><img class="ui avatar image" src="{{.RelAvatarLink}}"> {{.Name}}</a> + </div> {{end}} </div> </div> |