Browse Source

Changes to be committed:

modified:   public/css/gogs.css
	modified:   routes/repo/view.go
pull/4590/head
28111600 8 years ago
parent
commit
4d1e4b869a
  1. 15
      public/css/gogs.css
  2. 2
      routes/repo/view.go

15
public/css/gogs.css

@ -1480,6 +1480,21 @@ footer .ui.language .menu {
.repository.file.list #file-content .code-view table {
width: 100%;
}
.repository.file.list #file-content .code-view .line-num {
width: 1%;
min-width: 50px;
padding-right: 10px;
padding-left: 10px;
text-align: right;
white-space: nowrap;
vertical-align: top;
cursor: pointer;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.repository.file.list #file-content .code-view .lines-num {
vertical-align: top;
text-align: right;

2
routes/repo/view.go

@ -186,7 +186,7 @@ func renderFile(c *context.Context, entry *git.TreeEntry, treeLink, rawLink stri
var output bytes.Buffer
lines := strings.Split(fileContent, "\n")
for index, line := range lines {
output.WriteString(fmt.Sprintf(`<tr><td>%d</td><td id="L%d" rel="L%d">%s</td></tr>`, index+1, index+1, index+1, gotemplate.HTMLEscapeString(strings.TrimRight(line, "\r"))) + "\n")
output.WriteString(fmt.Sprintf(`<tr><td class="blob-num">%d</td><td id="L%d" rel="L%d" class="blob-code">%s</td></tr>`, index+1, index+1, index+1, gotemplate.HTMLEscapeString(strings.TrimRight(line, "\r"))) + "\n")
}
c.Data["FileContent"] = gotemplate.HTML(output.String())

Loading…
Cancel
Save