THIS IS A TEST INSTANCE ONLY! REPOSITORIES CAN BE DELETED AT ANY TIME!

test
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

145 lines
6.6 KiB

@**
* Yobi, Project Hosting SW
*
* Copyright 2013 NAVER Corp.
* http://yobi.io
*
* @Author Keesun Baik
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
**@
@(title:String, form: play.data.Form[PullRequest], project:Project, projects:List[Project],
fromProject:Project, toProject:Project,
fromBranches:List[playRepository.GitBranch], toBranches:List[playRepository.GitBranch],
pullRequest:models.PullRequest)
@import scala.collection.Map
@import utils.TemplateHelper._
@import utils.TemplateHelper.Branches._
@implicitField = @{ helper.FieldConstructor(simpleForm) }
@projectLayout(title, project, utils.MenuType.PULL_REQUEST) {
@projectMenu(project, utils.MenuType.PULL_REQUEST, "main-menu-only")
<div class="page-wrap-outer">
<div class="project-page-wrap">
<div class="content-wrap frm-wrap">
@helper.form(action=routes.PullRequestApp.newPullRequest(project.owner, project.name), 'enctype -> "multipart/form-data", 'class->"nm"){
<div class="pull-request-wrap">
<!-- from -->
<div class="pull-left">
<label for="fromProjectId" class="field-title">@Messages("pullRequest.from")</label>
<select id="fromProjectId" name="fromProjectId" data-toggle="select2" class="mr5">
<option></option>
@for(repo <- projects if ProjectUser.isMember(UserApp.currentUser().id, repo.id)) {
<option value="@repo.id" @if(repo.id == fromProject.id){ selected }>
@repo.owner / @repo.name
</option>
}
</select>
<select id="fromBranch" name="fromBranch" data-toggle="select2" data-format="branch"
data-dropdown-css-class="branches" data-placeholder="@Messages("pullRequest.select.branch")">
<option></option>
@for(branch <- fromBranches) {
<option value="@branch.getName" @if(branch.getName == pullRequest.fromBranch){ selected }>@branch.getName</option>
}
</select>
</div>
<!-- // -->
<div class="arrow">
<i class="yobicon-right-2"></i>
</div>
<!-- to -->
<div class="pull-right">
<label for="toProjectId" class="field-title">@Messages("pullRequest.to")</label>
<select id="toProjectId" name="toProjectId" data-toggle="select2" class="mr5">
<option></option>
@for(repo <- projects){
<option value="@repo.id" @if(repo.id == toProject.id){ selected }>
@repo.owner / @repo.name
</option>
}
</select>
<select id="toBranch" name="toBranch" data-toggle="select2" data-format="branch"
data-dropdown-css-class="branches" data-placeholder="@Messages("pullRequest.select.branch")">
<option></option>
@for(branch <- toBranches) {
<option value="@branch.getName" @if(branch.getName == pullRequest.toBranch){ selected }>@branch.getName</option>
}
</select>
</div>
<!-- // -->
</div>
<div id="status" class="alert mt20 mb20">
@Messages("pullRequest.is.merging")
</div>
<div>
<input type="text" id="title" name="title" maxlength="255" class="text" placeholder="@Messages("title")">
<div style="position: relative;">
@common.editor("body", pullRequest.body, "", "content-body")
</div>
@common.fileUploader(ResourceType.PULL_REQUEST, null)
@common.markdown(project)
<div class="actions">
<button type="submit" class="ybtn ybtn-success">@Messages("pullRequest.send")</button>
<a href="javascript:history.back();" class="ybtn">@Messages("button.cancel")</a>
</div>
</div>
<ul class="nav nav-tabs mt20">
<li class="active">
<a href="#__commits" data-toggle="tab">
<span class="vmiddle-inline">@Messages("pullRequest.menu.commit")</span>
<span id="numOfCommits" class="num-badge vmiddle-inline"></span>
</a>
</li>
</ul>
<div class="tab-content">
<div id="__commits" class="code-browse-wrap tab-pane active">
@** this area will be replaced with asynchronously by yobi.git.Write.js after load this page. **@
</div>
</div>
}
</div>
</div>
</div>
@common.select2()
<link rel="stylesheet" type="text/css" media="screen" href="@routes.Assets.at("javascripts/lib/atjs/jquery.atwho.css")">
<script type="text/javascript" src="@routes.Assets.at("javascripts/lib/atjs/jquery.caret.min.js")"></script>
<script type="text/javascript" src="@routes.Assets.at("javascripts/lib/atjs/jquery.atwho.js")"></script>
<script type="text/javascript">
$(function(){
$yobi.loadModule("git.Write", {
"mergeResultURL": "@routes.PullRequestApp.mergeResult(project.owner, project.name)",
"fromProject" : $("#fromProjectId"),
"toProject" : $("#toProjectId"),
"fromBranch" : $("#fromBranch"),
"toBranch" : $("#toBranch")
});
// yobi.Mention
yobi.Mention({
"target": "textarea[id^=editor-]",
"url" : "@routes.ProjectApp.mentionList(project.owner, project.name)"
});
});
</script>
}