Browse Source

templates/label: another minor style improve

pull/4330/head
Unknwon 8 years ago
parent
commit
71753cdd46
No known key found for this signature in database
GPG Key ID: 7A02C406FAC875A2
  1. 4
      public/config.codekit
  2. 1
      public/css/gogs.css
  3. 11
      public/js/gogs.js
  4. 1
      public/less/_repository.less
  5. 2
      templates/repo/issue/list.tmpl
  6. 2
      templates/repo/issue/new_form.tmpl

4
public/config.codekit

@ -1,6 +1,6 @@
{ {
"CodeKitInfo": "This is a CodeKit 2.x project configuration file. It is designed to sync project settings across multiple machines. MODIFYING THE CONTENTS OF THIS FILE IS A POOR LIFE DECISION. If you do so, you will likely cause CodeKit to crash. This file is not useful unless accompanied by the project that created it in CodeKit 2. This file is not backwards-compatible with CodeKit 1.x. For more information, see: http:\/\/incident57.com\/codekit", "CodeKitInfo": "This is a CodeKit 2.x project configuration file. It is designed to sync project settings across multiple machines. MODIFYING THE CONTENTS OF THIS FILE IS A POOR LIFE DECISION. If you do so, you will likely cause CodeKit to crash. This file is not useful unless accompanied by the project that created it in CodeKit 2. This file is not backwards-compatible with CodeKit 1.x. For more information, see: http:\/\/incident57.com\/codekit",
"creatorBuild": "19127", "creatorBuild": "19115",
"files": { "files": {
"\/css\/github.min.css": { "\/css\/github.min.css": {
"fileType": 16, "fileType": 16,
@ -66,7 +66,7 @@
"fileType": 32768, "fileType": 32768,
"ignore": 0, "ignore": 0,
"ignoreWasSetByUser": 0, "ignoreWasSetByUser": 0,
"initialSize": 514087, "initialSize": 4048,
"inputAbbreviatedPath": "\/img\/avatar_default.png", "inputAbbreviatedPath": "\/img\/avatar_default.png",
"outputAbbreviatedPath": "\/img\/avatar_default.png", "outputAbbreviatedPath": "\/img\/avatar_default.png",
"outputPathIsOutsideProject": 0, "outputPathIsOutsideProject": 0,

1
public/css/gogs.css

@ -1181,6 +1181,7 @@ footer .ui.language .menu {
float: left; float: left;
margin-left: -5px; margin-left: -5px;
margin-right: -7px; margin-right: -7px;
width: 16px;
} }
.repository .filter.menu .menu { .repository .filter.menu .menu {
max-height: 300px; max-height: 300px;

11
public/js/gogs.js

@ -108,16 +108,21 @@ function initCommentForm() {
}); });
} }
// Add   to each unselected label to keep UI looks good.
// 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 () {
$(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');
$(this).find('.octicon').removeClass('octicon-check'); $(this).find('.octicon').removeClass('octicon-check').html('&nbsp;');
if (hasLabelUpdateAction) { if (hasLabelUpdateAction) {
updateIssueMeta($labelMenu.data('update-url'), "detach", $(this).data('id')); updateIssueMeta($labelMenu.data('update-url'), "detach", $(this).data('id'));
} }
} else { } else {
$(this).addClass('checked'); $(this).addClass('checked');
$(this).find('.octicon').addClass('octicon-check'); $(this).find('.octicon').addClass('octicon-check').html('');
if (hasLabelUpdateAction) { if (hasLabelUpdateAction) {
updateIssueMeta($labelMenu.data('update-url'), "attach", $(this).data('id')); updateIssueMeta($labelMenu.data('update-url'), "attach", $(this).data('id'));
} }
@ -147,7 +152,7 @@ function initCommentForm() {
$(this).parent().find('.item').each(function () { $(this).parent().find('.item').each(function () {
$(this).removeClass('checked'); $(this).removeClass('checked');
$(this).find('.octicon').removeClass('octicon-check'); $(this).find('.octicon').removeClass('octicon-check').html('&nbsp;');
}); });
$list.find('.item').each(function () { $list.find('.item').each(function () {

1
public/less/_repository.less

@ -97,6 +97,7 @@
float: left; float: left;
margin-left: -5px; margin-left: -5px;
margin-right: -7px; margin-right: -7px;
width: 16px;
} }
.menu { .menu {
max-height: 300px; max-height: 300px;

2
templates/repo/issue/list.tmpl

@ -33,7 +33,7 @@
<div class="menu"> <div class="menu">
<a class="item" href="{{$.Link}}?type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}">{{.i18n.Tr "repo.issues.filter_label_no_select"}}</a> <a class="item" href="{{$.Link}}?type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}">{{.i18n.Tr "repo.issues.filter_label_no_select"}}</a>
{{range .Labels}} {{range .Labels}}
<a class="item" href="{{$.Link}}?type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{.ID}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}"><span class="octicon {{if eq $.SelectLabels .ID}}octicon-check{{end}}">&nbsp;</span><span class="label color" style="background-color: {{.Color}}"></span> {{.Name | Sanitize}}</a> <a class="item" href="{{$.Link}}?type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{.ID}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}"><span class="octicon {{if eq $.SelectLabels .ID}}octicon-check{{end}}">{{if not .IsChecked}}&nbsp;{{end}}</span><span class="label color" style="background-color: {{.Color}}"></span> {{.Name | Sanitize}}</a>
{{end}} {{end}}
</div> </div>
</div> </div>

2
templates/repo/issue/new_form.tmpl

@ -41,7 +41,7 @@
<div class="filter menu" data-id="#label_ids"> <div class="filter menu" data-id="#label_ids">
<div class="no-select item">{{.i18n.Tr "repo.issues.new.clear_labels"}}</div> <div class="no-select item">{{.i18n.Tr "repo.issues.new.clear_labels"}}</div>
{{range .Labels}} {{range .Labels}}
<a class="{{if .IsChecked}}checked{{end}} item" href="#" data-id="{{.ID}}" data-id-selector="#label_{{.ID}}"><span class="octicon {{if .IsChecked}}octicon-check{{end}}">&nbsp;</span><span class="label color" style="background-color: {{.Color}}"></span> {{.Name}}</a> <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>
{{end}} {{end}}
</div> </div>
</div> </div>

Loading…
Cancel
Save