Browse Source

add tips.

tags/v1.21.12.1
Gitea 4 years ago
parent
commit
2d117b6ddc
1 changed files with 78 additions and 5 deletions
  1. +78
    -5
      templates/repo/issue/view_content/pull.tmpl

+ 78
- 5
templates/repo/issue/view_content/pull.tmpl View File

@@ -196,6 +196,8 @@
{{$.i18n.Tr (printf "repo.signing.wont_sign.%s" .WontSignReason) }}
</div>
{{end}}

<!-- 合并请求 -->
{{if .AllowMerge}}
{{$prUnit := .Repository.MustGetUnit $.UnitTypePullRequests}}
{{$approvers := .Issue.PullRequest.GetApprovers}}
@@ -211,7 +213,7 @@
<input type="hidden" name="block_chain_amount">
<div class="default text">项目奖励</div>
<i class="dropdown icon"></i>
<div class="menu">
<div class="menu" >
<div class="item" data-value=0>0</div>
<div class="item" data-value=100>100</div>
<div class="item" data-value=200>200</div>
@@ -239,6 +241,21 @@
<div class="ui form rebase-fields" style="display: none">
<form action="{{.Link}}/merge" method="post">
{{.CsrfTokenHtml}}
<!-- 下拉框 -->
<div class="field">
<div class="ui dropdown selection">
<input type="hidden" name="block_chain_amount">
<div class="default text">项目奖励</div>
<i class="dropdown icon"></i>
<div class="menu" >
<div class="item" data-value=0>0</div>
<div class="item" data-value=100>100</div>
<div class="item" data-value=200>200</div>
<div class="item" data-value=300>300</div>
</div>
</div>
</div>

<button class="ui green button" type="submit" name="do" value="rebase">
{{$.i18n.Tr "repo.pulls.rebase_merge_pull_request"}}
</button>
@@ -252,13 +269,28 @@
<div class="ui form rebase-merge-fields" style="display: none">
<form action="{{.Link}}/merge" method="post">
{{.CsrfTokenHtml}}
<!-- 下拉框 -->
<div class="field">
<div class="ui dropdown selection">
<input type="hidden" name="block_chain_amount">
<div class="default text">项目奖励</div>
<i class="dropdown icon"></i>
<div class="menu" >
<div class="item" data-value=0>0</div>
<div class="item" data-value=100>100</div>
<div class="item" data-value=200>200</div>
<div class="item" data-value=300>300</div>
</div>
</div>
</div>

<div class="field">
<input type="text" name="merge_title_field" value="{{.Issue.PullRequest.GetDefaultMergeMessage}}">
</div>
<div class="field">
<textarea name="merge_message_field" rows="5" placeholder="{{$.i18n.Tr "repo.editor.commit_message_desc"}}">Reviewed-on: {{$.Issue.HTMLURL}}&#13;&#10;{{$approvers}}</textarea>
</div>
<button class="ui green button" type="submit" name="do" value="rebase-merge">
<button class="ui green button merge" type="submit" name="do" value="rebase-merge">
{{$.i18n.Tr "repo.pulls.rebase_merge_commit_pull_request"}}
</button>
<button class="ui button merge-cancel">
@@ -271,6 +303,21 @@
<div class="ui form squash-fields" style="display: none">
<form action="{{.Link}}/merge" method="post">
{{.CsrfTokenHtml}}
<!-- 下拉框 -->
<div class="field">
<div class="ui dropdown selection">
<input type="hidden" name="block_chain_amount">
<div class="default text">项目奖励</div>
<i class="dropdown icon"></i>
<div class="menu" >
<div class="item" data-value=0>0</div>
<div class="item" data-value=100>100</div>
<div class="item" data-value=200>200</div>
<div class="item" data-value=300>300</div>
</div>
</div>
</div>

<div class="field">
<input type="text" name="merge_title_field" value="{{.Issue.PullRequest.GetDefaultSquashMessage}}">
</div>
@@ -401,8 +448,34 @@
</div>
</div>

<script src="https://cdn.jsdelivr.net/npm/jquery@3.2.1/dist/jquery.min.js"></script>
<script>
$('.ui.dropdown.selection')
.dropdown()
;

$(document)
.ready(function() {
$('.ui.dropdown.selection').dropdown();

$('.ui.green.button').click(function(){
$('.ui.form')
.form({
on: 'blur',
inline: true,
fields: {
block_chain_amount: {
identifier: 'block_chain_amount',
rules: [
{
type : 'empty',
prompt : '项目奖励不能为空'
}
]
}
},
onFailure: function(e){
return false;
}
});
});
})

</script>

Loading…
Cancel
Save