watch_exts = [".go"] | watch_exts = [".go"] | ||||
build_delay = 1500 | build_delay = 1500 | ||||
cmds = [ | cmds = [ | ||||
["go", "install", "-tags", "sqlite tidb"],# redis memcache cert pam | |||||
["go", "build", "-tags", "sqlite tidb"], | |||||
["go", "install", "-tags", "sqlite"],# redis memcache cert pam tidb | |||||
["go", "build", "-tags", "sqlite"], | |||||
["./gogs", "web"] | ["./gogs", "web"] | ||||
] | ] |
![](public/img/gogs-large-resize.png) | ![](public/img/gogs-large-resize.png) | ||||
##### Current version: 0.6.15 Beta | |||||
##### Current version: 0.6.16 Beta | |||||
<table> | <table> | ||||
<tr> | <tr> |
forked_from = forked from | forked_from = forked from | ||||
fork_from_self = You cannot fork repository you already owned! | fork_from_self = You cannot fork repository you already owned! | ||||
copy_link = Copy | copy_link = Copy | ||||
copy_link_success = Copied! | |||||
copy_link_error = Press ⌘-C or Ctrl-C to copy | |||||
click_to_copy = Copy to clipboard | click_to_copy = Copy to clipboard | ||||
copied = Copied OK | copied = Copied OK | ||||
clone_helper = Need help cloning? Visit <a target="_blank" href="%s">Help</a>! | clone_helper = Need help cloning? Visit <a target="_blank" href="%s">Help</a>! | ||||
clone_this_repo = Clone this repository | clone_this_repo = Clone this repository | ||||
create_new_repo_command = Create a new repository on the command line | create_new_repo_command = Create a new repository on the command line | ||||
push_exist_repo = Push an existing repository from the command line | push_exist_repo = Push an existing repository from the command line | ||||
repo_is_empty = This repository is empty, please come back later! | |||||
branch = Branch | branch = Branch | ||||
tree = Tree | tree = Tree |
"github.com/gogits/gogs/modules/setting" | "github.com/gogits/gogs/modules/setting" | ||||
) | ) | ||||
const APP_VER = "0.6.15.0926 Beta" | |||||
const APP_VER = "0.6.16.1002 Beta" | |||||
func init() { | func init() { | ||||
runtime.GOMAXPROCS(runtime.NumCPU()) | runtime.GOMAXPROCS(runtime.NumCPU()) |
ctx.Data["GoGetImport"] = fmt.Sprintf("%s/%s/%s", setting.Domain, u.Name, repo.Name) | ctx.Data["GoGetImport"] = fmt.Sprintf("%s/%s/%s", setting.Domain, u.Name, repo.Name) | ||||
} | } | ||||
if ctx.IsSigned { | |||||
ctx.Data["IsWatchingRepo"] = models.IsWatching(ctx.User.Id, repo.ID) | |||||
ctx.Data["IsStaringRepo"] = models.IsStaring(ctx.User.Id, repo.ID) | |||||
} | |||||
// repo is bare and display enable | // repo is bare and display enable | ||||
if ctx.Repo.Repository.IsBare { | if ctx.Repo.Repository.IsBare { | ||||
log.Debug("Bare repository: %s", ctx.Repo.RepoLink) | log.Debug("Bare repository: %s", ctx.Repo.RepoLink) | ||||
// NOTE: to prevent templating error | // NOTE: to prevent templating error | ||||
ctx.Data["BranchName"] = "" | ctx.Data["BranchName"] = "" | ||||
if displayBare { | if displayBare { | ||||
if !ctx.Repo.IsAdmin() { | |||||
ctx.Flash.Info(ctx.Tr("repo.repo_is_empty"), true) | |||||
} | |||||
ctx.HTML(200, "repo/bare") | ctx.HTML(200, "repo/bare") | ||||
} | } | ||||
return | return | ||||
} | } | ||||
if ctx.IsSigned { | |||||
ctx.Data["IsWatchingRepo"] = models.IsWatching(ctx.User.Id, repo.ID) | |||||
ctx.Data["IsStaringRepo"] = models.IsStaring(ctx.User.Id, repo.ID) | |||||
} | |||||
ctx.Data["TagName"] = ctx.Repo.TagName | ctx.Data["TagName"] = ctx.Repo.TagName | ||||
brs, err := ctx.Repo.GitRepo.GetBranches() | brs, err := ctx.Repo.GitRepo.GetBranches() | ||||
if err != nil { | if err != nil { |
"outputStyle": 1, | "outputStyle": 1, | ||||
"syntaxCheckerStyle": 1 | "syntaxCheckerStyle": 1 | ||||
}, | }, | ||||
"\/js\/libs\/clipboard-1.3.1.min.js": { | |||||
"fileType": 64, | |||||
"ignore": 0, | |||||
"ignoreWasSetByUser": 0, | |||||
"inputAbbreviatedPath": "\/js\/libs\/clipboard-1.3.1.min.js", | |||||
"outputAbbreviatedPath": "\/js\/libs\/min\/clipboard-1.3.1.min-min.js", | |||||
"outputPathIsOutsideProject": 0, | |||||
"outputPathIsSetByUser": 0, | |||||
"outputStyle": 1, | |||||
"syntaxCheckerStyle": 1 | |||||
}, | |||||
"\/js\/libs\/dropzone-4.0.1.js": { | "\/js\/libs\/dropzone-4.0.1.js": { | ||||
"fileType": 64, | "fileType": 64, | ||||
"ignore": 0, | "ignore": 0, | ||||
"fileType": 1, | "fileType": 1, | ||||
"ieCompatibility": 1, | "ieCompatibility": 1, | ||||
"ignore": 0, | "ignore": 0, | ||||
"ignoreWasSetByUser": 0, | |||||
"ignoreWasSetByUser": 1, | |||||
"inputAbbreviatedPath": "\/less\/gogs.less", | "inputAbbreviatedPath": "\/less\/gogs.less", | ||||
"outputAbbreviatedPath": "\/css\/gogs.min.css", | |||||
"outputAbbreviatedPath": "\/css\/gogs.css", | |||||
"outputPathIsOutsideProject": 0, | "outputPathIsOutsideProject": 0, | ||||
"outputPathIsSetByUser": 1, | "outputPathIsSetByUser": 1, | ||||
"outputStyle": 1, | |||||
"outputStyle": 0, | |||||
"relativeURLS": 0, | "relativeURLS": 0, | ||||
"shouldRunAutoprefixer": 0, | "shouldRunAutoprefixer": 0, | ||||
"shouldRunBless": 0, | "shouldRunBless": 0, |
}); | }); | ||||
} | } | ||||
// Quick start | |||||
if ($('.repository.quickstart').length > 0) { | |||||
$('#repo-clone-ssh').click(function () { | |||||
$('.clone-url').text($(this).data('link')); | |||||
$('#repo-clone-url').val($(this).data('link')); | |||||
$(this).addClass('blue'); | |||||
$('#repo-clone-https').removeClass('blue'); | |||||
}); | |||||
$('#repo-clone-https').click(function () { | |||||
$('.clone-url').text($(this).data('link')); | |||||
$('#repo-clone-url').val($(this).data('link')); | |||||
$(this).addClass('blue'); | |||||
$('#repo-clone-ssh').removeClass('blue'); | |||||
}); | |||||
} | |||||
// Pull request | // Pull request | ||||
if ($('.repository.compare.pull').length > 0) { | if ($('.repository.compare.pull').length > 0) { | ||||
var $branch_dropdown = $('.choose.branch .dropdown'); | var $branch_dropdown = $('.choose.branch .dropdown'); | ||||
$('.local').show(); | $('.local').show(); | ||||
$('#user_name').focus(); | $('#user_name').focus(); | ||||
if($(this).data('password')=="required"){ | |||||
if ($(this).data('password') == "required") { | |||||
$('#password').attr('required', 'required'); | $('#password').attr('required', 'required'); | ||||
} | } | ||||
emojify.run($(this)[0]); | emojify.run($(this)[0]); | ||||
}); | }); | ||||
// Clipboard JS | |||||
var clipboard = new Clipboard('.clipboard'); | |||||
clipboard.on('success', function (e) { | |||||
e.clearSelection(); | |||||
$('#' + e.trigger.getAttribute('id')).popup('destroy'); | |||||
e.trigger.setAttribute('data-content', e.trigger.getAttribute('data-success')) | |||||
$('#' + e.trigger.getAttribute('id')).popup('show'); | |||||
e.trigger.setAttribute('data-content', e.trigger.getAttribute('data-original')) | |||||
}); | |||||
clipboard.on('error', function (e) { | |||||
$('#' + e.trigger.getAttribute('id')).popup('destroy'); | |||||
e.trigger.setAttribute('data-content', e.trigger.getAttribute('data-error')) | |||||
$('#' + e.trigger.getAttribute('id')).popup('show'); | |||||
e.trigger.setAttribute('data-content', e.trigger.getAttribute('data-original')) | |||||
}); | |||||
// Helpers. | // Helpers. | ||||
$('.delete-button').click(function () { | $('.delete-button').click(function () { | ||||
var $this = $(this); | var $this = $(this); |
overflow-x: auto; | overflow-x: auto; | ||||
overflow-y: hidden; | overflow-y: hidden; | ||||
} | } | ||||
&.quickstart { | |||||
.guide { | |||||
.item { | |||||
padding: 1em; | |||||
small { | |||||
font-weight: normal; | |||||
} | |||||
} | |||||
.clone.button:first-child { | |||||
border-radius: .28571429rem 0 0 .28571429rem; | |||||
} | |||||
#repo-clone-url { | |||||
border-radius: 0; | |||||
width: 100%; | |||||
padding: 5px 10px; | |||||
font-size: 1.2em; | |||||
} | |||||
} | |||||
} | |||||
} | } | ||||
// End of .repository | |||||
.issue.list { | .issue.list { | ||||
list-style: none; | list-style: none; |
0.6.15.0926 Beta | |||||
0.6.16.1002 Beta |
<script src="{{AppSubUrl}}/js/libs/dropzone-4.0.1.js"></script> | <script src="{{AppSubUrl}}/js/libs/dropzone-4.0.1.js"></script> | ||||
{{end}} | {{end}} | ||||
<script src="{{AppSubUrl}}/js/libs/emojify-1.1.0.min.js"></script> | <script src="{{AppSubUrl}}/js/libs/emojify-1.1.0.min.js"></script> | ||||
<script src="{{AppSubUrl}}/js/libs/clipboard-1.3.1.min.js"></script> | |||||
</html> | </html> |
<!-- Stylesheet --> | <!-- Stylesheet --> | ||||
<link rel="stylesheet" href="{{AppSubUrl}}/css/semantic-2.1.3.min.css"> | <link rel="stylesheet" href="{{AppSubUrl}}/css/semantic-2.1.3.min.css"> | ||||
<link rel="stylesheet" href="{{AppSubUrl}}/css/gogs.min.css?v={{AppVer}}"> | |||||
<link rel="stylesheet" href="{{AppSubUrl}}/css/gogs.css?v={{AppVer}}"> | |||||
<!-- JavaScript --> | <!-- JavaScript --> | ||||
<script src="{{AppSubUrl}}/js/semantic-2.1.3.min.js"></script> | <script src="{{AppSubUrl}}/js/semantic-2.1.3.min.js"></script> |
{{template "ng/base/head" .}} | |||||
{{template "ng/base/header" .}} | |||||
<div id="repo-wrapper" class="repo-bare"> | |||||
<div id="repo-header" class="clear"> | |||||
<div class="container clear"> | |||||
<h1 id="repo-header-name" class="left public"> | |||||
<i class="mega-octicon octicon-{{if .Repository.IsPrivate}}lock{{else}}repo{{end}}"></i> | |||||
<a class="author" href="{{AppSubUrl}}/{{.Repository.Owner.Name}}">{{.Repository.Owner.Name}}</a> | |||||
<span class="divider">/</span> | |||||
<a class="repo text-bold" href="{{.RepoLink}}">{{.Repository.Name}}</a> | |||||
</h1> | |||||
</div> | |||||
</div> | |||||
<div id="repo-content" class="clear container"> | |||||
<div id="repo-bare"> | |||||
<div id="repo-bare-start" class="panel panel-radius"> | |||||
<div class="panel-header"> | |||||
<a class="btn btn-small btn-black btn-header btn-radius right" href="{{.RepoLink}}/settings">{{.i18n.Tr "repo.settings"}}</a> | |||||
<strong>{{.i18n.Tr "repo.quick_guide"}}</strong> | |||||
</div> | |||||
<div class="panel-content"> | |||||
<div id="repo-clone" class="clear text-center"> | |||||
<h2>{{.i18n.Tr "repo.clone_this_repo"}}</h2> | |||||
{{if not $.DisableSSH}} | |||||
<button class="btn btn-blue btn-first current left btn-left-radius" id="repo-clone-ssh" data-link="{{.CloneLink.SSH}}">SSH</button> | |||||
{{end}} | |||||
<button class="btn {{if $.DisableSSH}}btn-first btn-blue current{{else}}btn-gray{{end}} left" id="repo-clone-https" data-link="{{.CloneLink.HTTPS}}">HTTPS</button> | |||||
<input id="repo-clone-url" type="text" class="ipt ipt-disabled left" value="{{if $.DisableSSH}}{{$.CloneLink.HTTPS}}{{else}}{{$.CloneLink.SSH}}{{end}}" onclick="this.select()" readonly /> | |||||
<button class="btn btn-black left btn-right-radius" id="repo-clone-copy" data-copy-val="val" data-copy-from="#repo-clone-url">{{.i18n.Tr "repo.copy_link"}}</button> | |||||
<p class="text-center" id="repo-clone-help">{{.i18n.Tr "repo.clone_helper" "http://git-scm.com/book/en/Git-Basics-Getting-a-Git-Repository" | Str2html}}</p> | |||||
<hr/> | |||||
</div> | |||||
<div id="repo-bare-cmd" class="text-center"> | |||||
<h2>{{.i18n.Tr "repo.create_new_repo_command"}}</h2> | |||||
<pre class="text-left radius"><code>touch README.md | |||||
{{template "base/head" .}} | |||||
<div class="repository quickstart"> | |||||
{{template "repo/header" .}} | |||||
<div class="ui container"> | |||||
<div class="ui grid"> | |||||
<div class="sixteen wide column content"> | |||||
{{template "base/alert" .}} | |||||
{{if .IsRepositoryAdmin}} | |||||
<h4 class="ui top attached header"> | |||||
{{.i18n.Tr "repo.quick_guide"}} | |||||
<div class="ui right"> | |||||
<a class="ui black tiny button" href="{{.RepoLink}}/settings">{{.i18n.Tr "repo.settings"}}</a> | |||||
</div> | |||||
</h4> | |||||
<div class="ui attached guide table segment"> | |||||
<div class="item"> | |||||
<h3>{{.i18n.Tr "repo.clone_this_repo"}} <small>{{.i18n.Tr "repo.clone_helper" "http://git-scm.com/book/en/Git-Basics-Getting-a-Git-Repository" | Str2html}}</small></h3> | |||||
<div class="ui action small input"> | |||||
{{if not $.DisableSSH}} | |||||
<button class="ui blue basic clone button" id="repo-clone-ssh" data-link="{{.CloneLink.SSH}}"> | |||||
SSH | |||||
</button> | |||||
{{end}} | |||||
<button class="ui {{if $.DisableSSH}}blue{{end}} basic clone button" id="repo-clone-https" data-link="{{.CloneLink.HTTPS}}"> | |||||
HTTPS | |||||
</button> | |||||
<input id="repo-clone-url" value="{{if $.DisableSSH}}{{$.CloneLink.HTTPS}}{{else}}{{$.CloneLink.SSH}}{{end}}" readonly> | |||||
<button class="ui basic button poping up clipboard" id="clipboard-btn" data-original="{{.i18n.Tr "repo.copy_link"}}" data-success="{{.i18n.Tr "repo.copy_link_success"}}" data-error="{{.i18n.Tr "repo.copy_link_error"}}" data-content="{{.i18n.Tr "repo.copy_link"}}" data-variation="inverted tiny" data-clipboard-target="#repo-clone-url"> | |||||
<i class="octicon octicon-clippy"></i> | |||||
</button> | |||||
</div> | |||||
</div> | |||||
<div class="ui divider"></div> | |||||
<div class="item"> | |||||
<h3>{{.i18n.Tr "repo.create_new_repo_command"}}</h3> | |||||
<div class="markdown"> | |||||
<pre><code>touch README.md | |||||
git init | git init | ||||
git add README.md | git add README.md | ||||
git commit -m "first commit" | git commit -m "first commit" | ||||
git remote add origin <span class="clone-url">{{if $.DisableSSH}}{{$.CloneLink.HTTPS}}{{else}}{{$.CloneLink.SSH}}{{end}}</span> | git remote add origin <span class="clone-url">{{if $.DisableSSH}}{{$.CloneLink.HTTPS}}{{else}}{{$.CloneLink.SSH}}{{end}}</span> | ||||
git push -u origin master</code></pre> | git push -u origin master</code></pre> | ||||
<br/> | |||||
<hr/> | |||||
</div> | |||||
<div id="repo-bare-remote" class="text-center"> | |||||
<h2>{{.i18n.Tr "repo.push_exist_repo"}}</h2> | |||||
<pre class="text-left radius"><code>git remote add origin <span class="clone-url">{{if $.DisableSSH}}{{$.CloneLink.HTTPS}}{{else}}{{$.CloneLink.SSH}}{{end}}</span> | |||||
</div> | |||||
</div> | |||||
<div class="ui divider"></div> | |||||
<div class="item"> | |||||
<h3>{{.i18n.Tr "repo.push_exist_repo"}}</h3> | |||||
<div class="markdown"> | |||||
<pre><code>git remote add origin <span class="clone-url">{{if $.DisableSSH}}{{$.CloneLink.HTTPS}}{{else}}{{$.CloneLink.SSH}}{{end}}</span> | |||||
git push -u origin master</code></pre> | git push -u origin master</code></pre> | ||||
<br/> | |||||
</div> | |||||
</div> | |||||
</div> | </div> | ||||
</div> | |||||
{{end}} | |||||
</div> | </div> | ||||
</div> | |||||
</div> | </div> | ||||
</div> | |||||
</div> | </div> | ||||
{{template "ng/base/footer" .}} | |||||
{{template "base/footer" .}} |