1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

Web editor: temporarily disable upload and quick fix for edit and new

Try to merge into develop branch ASAP, then continue minor fixes afterwards.
This commit is contained in:
Unknwon
2016-08-15 01:42:20 -07:00
parent 54e0ada9d5
commit 4a19fd6441
9 changed files with 292 additions and 306 deletions

View File

@@ -33,19 +33,6 @@
{{range .Branches}}
<div class="item {{if eq $.BranchName .}}selected{{end}}" data-url="{{$.RepoLink}}/{{if $.PageIsCommits}}commits{{else}}src{{end}}/{{EscapePound .}}{{if $.TreeName}}/{{EscapePound $.TreeName}}{{end}}">{{.}}</div>
{{end}}
{{if .IsWriter}}
<a href="javascript:void(0)" id="new-branch-item">
<i class="octicon octicon-git-branch"></i>
{{.i18n.Tr "repo.create_branch"}}: <span id="branch-name-text"></span>
<br/>
<span class="description">{{.i18n.Tr "repo.from"}} {{.BranchName}}</span>
<form accept-charset="UTF-8" action="{{.RepoLink}}/branches" method="post">
{{.CsrfTokenHtml}}
<input type="hidden" name="old_branch_name" value="{{.BranchName}}">
<input type="hidden" name="branch_name" id="branch-name" value="">
</form>
</a>
{{end}}
</div>
<div id="tag-list" class="scrolling menu" {{if not .IsViewTag}}style="display: none"{{end}}>
{{range .Tags}}
@@ -55,33 +42,3 @@
</div>
</div>
</div>
{{if .IsWriter}}
<script type="text/javascript">
$(document).ready(function(){
$('#branch-dropdown #new-branch-item').on('click', function(){
$(this).find('form').submit();
return true;
});
$('#branch-dropdown input[name=search]').on('keyup', function(){
var query = $(this).val().toLowerCase();
if(query.length){
var unique = true;
$('#branch-dropdown #branch-list .item').each(function(i, item){
if($(item).text().toLowerCase() == query){
unique = false;
}
});
if(unique){
$('#new-branch-item #branch-name-text').text(query);
$('#new-branch-item #branch-name').val(query);
$('#new-branch-item').css('display', 'block');
return;
}
}
$('#new-branch-item').hide();
});
});
</script>
{{end}}