Fix and simplify repo branches UI (#1435)

This commit is contained in:
Morlinest 2017-04-06 17:33:57 +02:00 committed by Bo-Yi Wu
parent 410af6971b
commit cbeeaa1b11

View File

@ -7,36 +7,32 @@
<h4 class="ui top attached header"> <h4 class="ui top attached header">
{{.i18n.Tr "repo.default_branch"}} {{.i18n.Tr "repo.default_branch"}}
</h4> </h4>
<div class="ui attached table segment"> <div class="ui attached segment">
<form class="ui hook list form" action="{{.Link}}" method="post"> <p>
{{.i18n.Tr "repo.settings.default_branch_desc"}}
</p>
<form class="ui form" action="{{.Link}}" method="post">
{{.CsrfTokenHtml}} {{.CsrfTokenHtml}}
<input type="hidden" name="action" value="default_branch"> <input type="hidden" name="action" value="default_branch">
<div class="item">
{{.i18n.Tr "repo.settings.default_branch_desc"}}
</div>
{{if not .Repository.IsBare}} {{if not .Repository.IsBare}}
<div class="ui grid padded"> <div class="required inline field">
<div class="eight wide column"> <div class="ui dropdown selection" tabindex="0">
<div class="ui fluid dropdown selection visible" tabindex="0"> <select name="branch">
<select name="branch"> <option value="{{.Repository.DefaultBranch}}">{{.Repository.DefaultBranch}}</option>
<option value="{{.Repository.DefaultBranch}}">{{.Repository.DefaultBranch}}</option> {{range .Branches}}
{{range .Branches}} <option value="{{.}}">{{.}}</option>
<option value="{{.}}">{{.}}</option> {{end}}
{{end}} </select><i class="dropdown icon"></i>
</select><i class="dropdown icon"></i> <div class="default text">{{.Repository.DefaultBranch}}</div>
<div class="default text">{{.Repository.DefaultBranch}}</div> <div class="menu transition hidden" tabindex="-1" style="display: block !important;">
<div class="menu transition hidden" tabindex="-1" style="display: block !important;"> {{range .Branches}}
{{range .Branches}} <div class="item" data-value="{{.}}">{{.}}</div>
<div class="item" data-value="{{.}}">{{.}}</div> {{end}}
{{end}}
</div>
</div> </div>
</div> </div>
</div>
{{end}}
<div class="item field">
<button class="ui green button">{{$.i18n.Tr "repo.settings.update_settings"}}</button> <button class="ui green button">{{$.i18n.Tr "repo.settings.update_settings"}}</button>
</div> </div>
{{end}}
</form> </form>
</div> </div>
@ -46,7 +42,7 @@
<div class="ui attached table segment"> <div class="ui attached table segment">
<div class="ui grid padded"> <div class="ui grid padded">
<div class="eight wide column"> <div class="eight wide column">
<div class="ui fluid dropdown selection visible" tabindex="0"> <div class="ui fluid dropdown selection" tabindex="0">
<select id="protectedBranch" name="branch" data-url="{{.Repository.Link}}/settings/branches?action=protected_branch"> <select id="protectedBranch" name="branch" data-url="{{.Repository.Link}}/settings/branches?action=protected_branch">
{{range .LeftBranches}} {{range .LeftBranches}}
<option value="">{{$.i18n.Tr "repo.settings.choose_branch"}}</option> <option value="">{{$.i18n.Tr "repo.settings.choose_branch"}}</option>