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.
 
 
 
 
 
 

158 lines
7.0 KiB

@**
* Yobi, Project Hosting SW
*
* Copyright 2012 NAVER Corp.
* http://yobi.io
*
* @Author Ahn Hyeok Jun
*
* 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, issueForm: play.data.Form[Issue], project:Project)
@import helper._
@import scala.collection.mutable.Map
@import models.enumeration.ResourceType
@import models.enumeration.Operation
@import utils.AccessControl._
@import utils.TemplateHelper._
@import controllers.UserApp
@projectLayout(Messages(title), project, utils.MenuType.ISSUE) {
@projectMenu(project, utils.MenuType.ISSUE, "main-menu-only")
<div class="page-wrap-outer">
<div class="project-page-wrap">
<div class="content-wrap frm-wrap">
@form(action = routes.IssueApp.newIssue(project.owner, project.name), 'id -> "issue-form", 'enctype -> "multipart/form-data" ) {
<div class="row-fluid">
<div class="span12">
<dl>
<dt>
<label for="title">@Messages("title")</label>
</dt>
<dd>
@defining(issueForm.errors().get("title")) { errors =>
<input type="text" id="title" name="title" value="" class="text title zen-mode @if(errors != null) {error}" maxlength="250" tabindex="1">
@if(errors != null) {
<div class="message">
@for(error <- errors) {
<div>@Messages(error.message)</div>
}
</div>
}
}
</dd>
</dl>
</div>
<div class="row-fluid">
<div class="span9">
<dl>
<dd style="position: relative;">
@common.editor("body", "", "tabindex=2", "content-body")
</dd>
</dl>
@** fileUploader **@
@if(!UserApp.currentUser.isAnonymous) {
@common.fileUploader(ResourceType.ISSUE_POST, null)
}
@** end of fileUploader **@
<div class="actrow right-txt">
<button type="submit" class="ybtn ybtn-success">@Messages("button.save")</button><!--
--><a href="javascript:history.back();" class="ybtn">@Messages("button.cancel")</a>
</div>
</div>
<div class="span3">
@if(isProjectResourceCreatable(UserApp.currentUser(), project, ResourceType.ISSUE_ASSIGNEE)) {
<dl class="issue-option">
<dt>@Messages("issue.assignee")</dt>
<dd>
@partial_assignee(project, null)
</dd>
</dl>
}
@if(project.menuSetting.milestone && isProjectResourceCreatable(UserApp.currentUser(), project, ResourceType.ISSUE_MILESTONE)) {
<dl id="milestoneOption" class="issue-option">
<dt>@Messages("milestone")</dt>
<dd>
@defining(Milestone.findOpenMilestones(project.id)) { milestones =>
@if(milestones.isEmpty()) {
<a href="@routes.MilestoneApp.newMilestoneForm(project.owner, project.name)"
class="ybtn ybtn-small ybtn-fullsize" target="_blank">
@Messages("milestone.menu.new")
</a>
} else {
<select id="milestoneId" name="milestoneId"
data-toggle="select2" data-format="milestone" data-container-css-class="fullsize">
<option value="@Milestone.NULL_MILESTONE_ID" selected="selected">@Messages("issue.noMilestone")</option>
@for(milestone <- milestones){
<option value="@milestone.id" data-state="@milestone.state">
@milestone.title
</option>
}
</select>
}
}
</dd>
</dl>
}
<dl class="issue-option">
<dt>@Messages("issue.dueDate")</dt>
<dd>
<div class="search search-bar">
<input type="text" id="issueDueDate" data-toggle="calendar" name="dueDate" class="textbox full">
<button type="button" class="search-btn btn-calendar"><i class="yobicon-calendar2"></i></button>
</div>
</dd>
</dl>
@partial_select_label(IssueLabel.findByProject(project), null, "issue-option", "data-close-on-select=false")
</div>
</div>
</div>
} @** end of form **@
</div>
</div>
</div>
@common.markdown(project)
@common.select2()
@common.calendar()
<link rel="stylesheet" type="text/css" media="screen" href="@routes.IssueLabelApp.labelStyles(project.owner, project.name)">
<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.issue.Write
$yobi.loadModule("issue.Write", {
"sMode" : "new",
"sIssueFormURL": "@routes.IssueApp.newIssueForm(project.owner, project.name)",
"sIssueListURL": "@routes.IssueApp.issues(project.owner, project.name)",
"elTextarea" : 'textarea[data-editor-mode="content-body"]',
"elMilestoneRefresh": $("#milestoneOption .yobicon-refresh"),
"elDueDate" : $("#issueDueDate")
});
// yobi.Mention
yobi.Mention({
"target": 'textarea[id^=editor-]',
"url" : "@routes.ProjectApp.mentionList(project.owner, project.name)"
});
});
</script>
}