fix single bare page link

This commit is contained in:
FuXiaoHei 2014-03-20 21:28:12 +08:00
parent 47234f1031
commit 42b08ff261
4 changed files with 28 additions and 25 deletions

View file

@ -79,5 +79,6 @@ func RepoAssignment(redirect bool) martini.Handler {
ctx.Data["CloneLink"] = ctx.Repo.CloneLink
ctx.Data["RepositoryLink"] = ctx.Data["Title"]
ctx.Data["IsRepositoryOwner"] = ctx.Repo.IsOwner
ctx.Data["IsRepositoryWatching"] = ctx.Repo.IsWatching
}
}

View file

@ -74,8 +74,8 @@ var Gogits = {
var $lineNums = $pre.parent().siblings('.lines-num');
if ($lineNums.length > 0) {
var nums = $pre.find('ol.linenums > li').length;
for(var i=0;i < nums;i++){
$lineNums.append('<span id="L'+i+'" rel=".L'+i+'">'+(i+1)+'</span>');
for (var i = 1; i <= nums; i++) {
$lineNums.append('<span id="L' + i + '" rel=".L' + i + '">' + i + '</span>');
}
var last;
@ -183,6 +183,7 @@ function initUserSetting() {
}
function initRepository() {
(function () {
var $guide = $('.guide-box');
if ($guide.length) {
var $url = $('#guide-clone-url');
@ -197,6 +198,7 @@ function initRepository() {
}).eq(0).trigger("click");
// todo copy to clipboard
}
})();
}
(function ($) {

View file

@ -13,7 +13,7 @@
<span class="caret"></span>
</button>
</div>
<div class="btn-group" id="gogs-repo-watching">
<div class="btn-group {{if .IsRepositoryWatching}}watching{{end}}" id="gogs-repo-watching">
<button type="button" class="btn btn-default"><i class="fa fa-eye fa-lg fa-m"></i></button>
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
<span class="caret"></span>

View file

@ -6,8 +6,8 @@
<h3>Clone this repository</h3>
<div class="input-group col-md-8 col-md-offset-2 guide-buttons">
<span class="input-group-btn">
<button class="btn btn-default" data-url="{{.CloneLink.SSH}}" type="button">SSH</button>
<button class="btn btn-default" data-url="{{.CloneLink.HTTPS}}" type="button">HTTPS</button>
<button class="btn btn-default" data-link="{{.CloneLink.SSH}}" type="button">SSH</button>
<button class="btn btn-default" data-link="{{.CloneLink.HTTPS}}" type="button">HTTPS</button>
</span>
<input type="text" class="form-control" id="guide-clone-url" value="" readonly/>
<span class="input-group-btn">