File tree Expand file tree Collapse file tree 9 files changed +36
-21
lines changed Expand file tree Collapse file tree 9 files changed +36
-21
lines changed Original file line number Diff line number Diff line change @@ -690,8 +690,8 @@ issues.label_templates.info = No labels exist yet. Create a label with 'New Labe
690690issues.label_templates.helper = Select a label set
691691issues.label_templates.use = Use Label Set
692692issues.label_templates.fail_to_load_file = Failed to load label template file ' %s' : %v
693- issues.add_label_at = added the <div class="ui label" style="color: %s\; background-color: %s">%s</div> label %s
694- issues.remove_label_at = removed the <div class="ui label" style="color: %s\; background-color: %s">%s</div> label %s
693+ issues.add_label_at = added the <div class="ui label has-emoji " style="color: %s\; background-color: %s">%s</div> label %s
694+ issues.remove_label_at = removed the <div class="ui label has-emoji " style="color: %s\; background-color: %s">%s</div> label %s
695695issues.add_milestone_at = `added this to the <b>%s</b> milestone %s`
696696issues.change_milestone_at = `modified the milestone from <b>%s</b> to <b>%s</b> %s`
697697issues.remove_milestone_at = `removed this from the <b>%s</b> milestone %s`
Original file line number Diff line number Diff line change 1- .emoji {
2- width : 1.5em ;
3- height : 1.5em ;
4- display : inline-block ;
5- background-size : contain ;
6- }
1+ .emoji {
2+ width : 1.5em ;
3+ height : 1.5em ;
4+ display : inline-block ;
5+ background-size : contain ;
6+ }
7+
8+ .ui.label .emoji {
9+ height : 1.2em !important ;
10+ }
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ func Labels(ctx *context.Context) {
2222 ctx .Data ["PageIsIssueList" ] = true
2323 ctx .Data ["PageIsLabels" ] = true
2424 ctx .Data ["RequireMinicolors" ] = true
25+ ctx .Data ["RequireTribute" ] = true
2526 ctx .Data ["LabelTemplates" ] = models .LabelTemplates
2627 ctx .HTML (200 , tplLabels )
2728}
Original file line number Diff line number Diff line change 6868 }
6969 return itemStr;
7070 }
71- })
72- issuesTribute.attach(document.getElementById('content'))
71+ });
72+ var content = document.getElementById('content');
73+ if (content != null) {
74+ issuesTribute.attach(content);
75+ }
7376 </script>
7477 <script>
7578 var emojiTribute = new Tribute({
9396 return item;
9497 },
9598 selectTemplate: function (item) {
96- if (typeof item === 'undefinied ') return null;
99+ if (typeof item === 'undefined ') return null;
97100 return ':' + item.original + ':';
98101 },
99102 menuItemTemplate: function (item) {
100103 return '<img class="emoji" src="{{AppSubUrl}}/vendor/plugins/emojify/images/' + item.original + '.png"/>' + item.original;
101104 }
102105 }]
103106 });
104- emojiTribute.attach(document.getElementById('content'))
107+ var emojiInputs = document.querySelectorAll('.emoji-input');
108+ if (emojiInputs.length > 0) {
109+ emojiTribute.attach(emojiInputs);
110+ }
111+ var content = document.getElementById('content');
112+ if (content != null) {
113+ emojiTribute.attach(document.getElementById('content'));
114+ }
105115 </script>
106116{{end}}
107117 <script src="{{AppSubUrl}}/vendor/plugins/emojify/emojify.min.js"></script>
Original file line number Diff line number Diff line change 1717 <div class="ui grid">
1818 <div class="three wide column">
1919 <div class="ui small input">
20- <input class="new-label-input" name="title" placeholder="{{.i18n.Tr "repo.issues.new_label_placeholder"}}" autofocus required>
20+ <input class="new-label-input emoji-input " name="title" placeholder="{{.i18n.Tr "repo.issues.new_label_placeholder"}}" autofocus required>
2121 </div>
2222 </div>
2323 <div class="five wide column">
9898 <li class="item">
9999 <div class="ui grid">
100100 <div class="three wide column">
101- <div class="ui label" style="color: {{.ForegroundColor}}; background-color: {{.Color}}"><i class="octicon octicon-tag"></i> {{.Name}}</div>
101+ <div class="ui label has-emoji " style="color: {{.ForegroundColor}}; background-color: {{.Color}}"><i class="octicon octicon-tag"></i> {{.Name}}</div>
102102 </div>
103103 <div class="seven wide column">
104104 {{.Description}}
151151 <div class="ui grid">
152152 <div class="three wide column">
153153 <div class="ui small input">
154- <input class="new-label-input" name="title" placeholder="{{.i18n.Tr "repo.issues.new_label_placeholder"}}" autofocus required>
154+ <input class="new-label-input emoji-input " name="title" placeholder="{{.i18n.Tr "repo.issues.new_label_placeholder"}}" autofocus required>
155155 </div>
156156 </div>
157157 <div class="five wide column">
Original file line number Diff line number Diff line change 192192 <a class="ui label" href="{{$.RepoLink}}/src/branch/{{.Ref}}">{{.Ref}}</a>
193193 {{end}}
194194 {{range .Labels}}
195- <a class="ui label" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&state={{$.State}}&labels={{.ID}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}" style="color: {{.ForegroundColor}}; background-color: {{.Color}}" title="{{.Description}}">{{.Name}}</a>
195+ <a class="ui label has-emoji " href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&state={{$.State}}&labels={{.ID}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}" style="color: {{.ForegroundColor}}; background-color: {{.Color}}" title="{{.Description}}">{{.Name}}</a>
196196 {{end}}
197197
198198 {{if .NumComments}}
Original file line number Diff line number Diff line change 4646 <div class="filter menu" data-id="#label_ids">
4747 <div class="no-select item">{{.i18n.Tr "repo.issues.new.clear_labels"}}</div>
4848 {{range .Labels}}
49- <a class="{{if .IsChecked}}checked{{end}} item" href="#" data-id="{{.ID}}" data-id-selector="#label_{{.ID}}"><span class="octicon {{if .IsChecked}}octicon-check{{end}}"></span><span class="label color" style="background-color: {{.Color}}"></span> {{.Name}}</a>
49+ <a class="{{if .IsChecked}}checked{{end}} item has-emoji " href="#" data-id="{{.ID}}" data-id-selector="#label_{{.ID}}"><span class="octicon {{if .IsChecked}}octicon-check{{end}}"></span><span class="label color" style="background-color: {{.Color}}"></span> {{.Name}}</a>
5050 {{end}}
5151 </div>
5252 </div>
5353 <div class="ui labels list">
5454 <span class="no-select item {{if .HasSelectedLabel}}hide{{end}}">{{.i18n.Tr "repo.issues.new.no_label"}}</span>
5555 {{range .Labels}}
56- <a class="{{if not .IsChecked}}hide{{end}} item" id="label_{{.ID}}" href="{{$.RepoLink}}/issues?labels={{.ID}}"><span class="label color" style="background-color: {{.Color}}"></span> <span class="text">{{.Name}}</span></a>
56+ <a class="{{if not .IsChecked}}hide{{end}} item" id="label_{{.ID}}" href="{{$.RepoLink}}/issues?labels={{.ID}}"><span class="label color" style="background-color: {{.Color}}"></span> <span class="text has-emoji ">{{.Name}}</span></a>
5757 {{end}}
5858 </div>
5959
Original file line number Diff line number Diff line change 1010 <div class="filter menu" data-action="update" data-issue-id="{{$.Issue.ID}}" data-update-url="{{$.RepoLink}}/issues/labels">
1111 <div class="no-select item">{{.i18n.Tr "repo.issues.new.clear_labels"}}</div>
1212 {{range .Labels}}
13- <a class="{{if .IsChecked}}checked{{end}} item" href="#" data-id="{{.ID}}" data-id-selector="#label_{{.ID}}"><span class="octicon {{if .IsChecked}}octicon-check{{end}}"></span><span class="label color" style="background-color: {{.Color}}"></span> {{.Name}}
13+ <a class="{{if .IsChecked}}checked{{end}} item has-emoji " href="#" data-id="{{.ID}}" data-id-selector="#label_{{.ID}}"><span class="octicon {{if .IsChecked}}octicon-check{{end}}"></span><span class="label color" style="background-color: {{.Color}}"></span> {{.Name}}
1414 {{if .Description }}<br><small class="desc">{{.Description}}</small>{{end}}</a>
1515 {{end}}
1616 </div>
1919 <span class="no-select item {{if .HasSelectedLabel}}hide{{end}}">{{.i18n.Tr "repo.issues.new.no_label"}}</span>
2020 {{range .Labels}}
2121 <div class="item">
22- <a class="ui label {{if not .IsChecked}}hide{{end}}" id="label_{{.ID}}" href="{{$.RepoLink}}/issues?labels={{.ID}}" style="color: {{.ForegroundColor}}; background-color: {{.Color}}" title="{{.Description}}">{{.Name}}</a>
22+ <a class="ui label has-emoji {{if not .IsChecked}}hide{{end}}" id="label_{{.ID}}" href="{{$.RepoLink}}/issues?labels={{.ID}}" style="color: {{.ForegroundColor}}; background-color: {{.Color}}" title="{{.Description}}">{{.Name}}</a>
2323 </div>
2424
2525 {{end}}
You can’t perform that action at this time.
0 commit comments