mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-08 22:45:51 +01:00
Move common view templates to 'helper' package.
This commit is contained in:
10
src/main/twirl/helper/dropdown.scala.html
Normal file
10
src/main/twirl/helper/dropdown.scala.html
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
@(body: Html)
|
||||||
|
<div class="btn-group">
|
||||||
|
<button class="btn btn-mini dropdown-toggle" data-toggle="dropdown">
|
||||||
|
<i class="icon-cog"></i>
|
||||||
|
<span class="caret"></span>
|
||||||
|
</button>
|
||||||
|
<ul class="dropdown-menu">
|
||||||
|
@body
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
@@ -14,39 +14,27 @@
|
|||||||
<div>
|
<div>
|
||||||
<span id="label-assigned">No one is assigned</span>
|
<span id="label-assigned">No one is assigned</span>
|
||||||
<input type="hidden" name="assignedUserName" value=""/>
|
<input type="hidden" name="assignedUserName" value=""/>
|
||||||
<div class="btn-group">
|
@helper.html.dropdown {
|
||||||
<button class="btn dropdown-toggle" data-toggle="dropdown">
|
<li><a href="javascript:void(0);" id="clear-assignee">Clear assignee</a></li>
|
||||||
<i class="icon-cog"></i>
|
<li class="divider"></li>
|
||||||
<span class="caret"></span>
|
@collaborators.map { collaborator =>
|
||||||
</button>
|
<li><a href="javascript:void(0);" class="assign">@collaborator</a></li>
|
||||||
<ul class="dropdown-menu">
|
}
|
||||||
<li><a href="javascript:void(0);" id="clear-assignee">Clear assignee</a></li>
|
}
|
||||||
<li class="divider"></li>
|
|
||||||
@collaborators.map { collaborator =>
|
|
||||||
<li><a href="javascript:void(0);" class="assign">@collaborator</a></li>
|
|
||||||
}
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
<div class="pull-right">
|
<div class="pull-right">
|
||||||
<span id="label-milestone">No milestone</span>
|
<span id="label-milestone">No milestone</span>
|
||||||
<input type="hidden" name="milestoneId" value=""/>
|
<input type="hidden" name="milestoneId" value=""/>
|
||||||
<div class="btn-group">
|
@helper.html.dropdown {
|
||||||
<button class="btn dropdown-toggle" data-toggle="dropdown">
|
<li><a href="javascript:void(0);" class="milestone" data-id="">No milestone</a></li>
|
||||||
<i class="icon-cog"></i>
|
<li class="divider"></li>
|
||||||
<span class="caret"></span>
|
@milestones.map { milestone =>
|
||||||
</button>
|
<li><a href="javascript:void(0);" class="milestone" data-id="@milestone.milestoneId">@milestone.title</a></li>
|
||||||
<ul class="dropdown-menu">
|
}
|
||||||
<li><a href="javascript:void(0);" class="milestone" data-id="">No milestone</a></li>
|
}
|
||||||
<li class="divider"></li>
|
|
||||||
@milestones.map { milestone =>
|
|
||||||
<li><a href="javascript:void(0);" class="milestone" data-id="@milestone.milestoneId">@milestone.title</a></li>
|
|
||||||
}
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<hr>
|
<hr>
|
||||||
@html.preview(repository, "", false, true, true, "width: 650px; height: 200px;")
|
@helper.html.preview(repository, "", false, true, true, "width: 650px; height: 200px;")
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<input type="submit" class="btn btn-success" value="Submit new issue"/>
|
<input type="submit" class="btn btn-success" value="Submit new issue"/>
|
||||||
|
|||||||
@@ -48,7 +48,7 @@
|
|||||||
<form action="@url(repository)/issue_comments/new" method="POST" validate="true">
|
<form action="@url(repository)/issue_comments/new" method="POST" validate="true">
|
||||||
<div class="box">
|
<div class="box">
|
||||||
<div class="box-content">
|
<div class="box-content">
|
||||||
@html.preview(repository, "", false, true, true, "width: 730px; height: 100px;")
|
@helper.html.preview(repository, "", false, true, true, "width: 730px; height: 100px;")
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<input type="hidden" name="issueId" value="@issue.issueId"/>
|
<input type="hidden" name="issueId" value="@issue.issueId"/>
|
||||||
|
|||||||
@@ -41,21 +41,15 @@
|
|||||||
<span class="muted small">Milestone:</span> @milestones.find(_.milestoneId == condition.milestoneId.get.get).map(_.title)
|
<span class="muted small">Milestone:</span> @milestones.find(_.milestoneId == condition.milestoneId.get.get).map(_.title)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
<div class="btn-group">
|
@helper.html.dropdown {
|
||||||
<button class="btn dropdown-toggle" data-toggle="dropdown">
|
@if(condition.milestoneId.isDefined){
|
||||||
<i class="icon-cog"></i>
|
<li><a href="@condition.copy(milestoneId = None).toURL">Clear milestone filter</a></li>
|
||||||
<span class="caret"></span>
|
}
|
||||||
</button>
|
<li><a href="@condition.copy(milestoneId = Some(None)).toURL">Issues with no milestone</a></li>
|
||||||
<ul class="dropdown-menu">
|
@milestones.map { milestone =>
|
||||||
@if(condition.milestoneId.isDefined){
|
<li><a href="@condition.copy(milestoneId = Some(Some(milestone.milestoneId))).toURL">@milestone.title</a></li>
|
||||||
<li><a href="@condition.copy(milestoneId = None).toURL">Clear milestone filter</a></li>
|
}
|
||||||
}
|
}
|
||||||
<li><a href="@condition.copy(milestoneId = Some(None)).toURL">Issues with no milestone</a></li>
|
|
||||||
@milestones.map { milestone =>
|
|
||||||
<li><a href="@condition.copy(milestoneId = Some(Some(milestone.milestoneId))).toURL">@milestone.title</a></li>
|
|
||||||
}
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
@if(condition.milestoneId.isDefined && condition.milestoneId.get.isDefined){
|
@if(condition.milestoneId.isDefined && condition.milestoneId.get.isDefined){
|
||||||
<div class="milestone-progress" style="margin-top: 8px;">
|
<div class="milestone-progress" style="margin-top: 8px;">
|
||||||
@if(closedCount > 0){
|
@if(closedCount > 0){
|
||||||
@@ -97,7 +91,7 @@
|
|||||||
</a>
|
</a>
|
||||||
}
|
}
|
||||||
<div class="pull-right">
|
<div class="pull-right">
|
||||||
@html.paginator(page, (if(condition.state == "open") openCount else closedCount), service.IssuesService.IssueLimit, 7, condition.toURL)
|
@helper.html.paginator(page, (if(condition.state == "open") openCount else closedCount), service.IssuesService.IssueLimit, 7, condition.toURL)
|
||||||
</div>
|
</div>
|
||||||
<div class="btn-group">
|
<div class="btn-group">
|
||||||
<a class="btn@if(condition.state == "open"){ active}" href="@condition.copy(state = "open").toURL">@openCount Open</a>
|
<a class="btn@if(condition.state == "open"){ active}" href="@condition.copy(state = "open").toURL">@openCount Open</a>
|
||||||
@@ -160,7 +154,7 @@
|
|||||||
}
|
}
|
||||||
</table>
|
</table>
|
||||||
<div class="pull-right">
|
<div class="pull-right">
|
||||||
@html.paginator(page, (if(condition.state == "open") openCount else closedCount), service.IssuesService.IssueLimit, 10, condition.toURL)
|
@helper.html.paginator(page, (if(condition.state == "open") openCount else closedCount), service.IssuesService.IssueLimit, 10, condition.toURL)
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
</fieldset>
|
</fieldset>
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<label for="dueDate"><strong>Due Date</strong></label>
|
<label for="dueDate"><strong>Due Date</strong></label>
|
||||||
@html.datepicker("dueDate", milestone.flatMap(_.dueDate))
|
@helper.html.datepicker("dueDate", milestone.flatMap(_.dueDate))
|
||||||
<span id="error-dueDate" class="error"></span>
|
<span id="error-dueDate" class="error"></span>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
<hr>
|
<hr>
|
||||||
|
|||||||
@@ -93,7 +93,7 @@
|
|||||||
</li>
|
</li>
|
||||||
}
|
}
|
||||||
</ul>
|
</ul>
|
||||||
@html.diff(diffs, repository, Some(commit.id))
|
@helper.html.diff(diffs, repository, Some(commit.id))
|
||||||
}
|
}
|
||||||
<script>
|
<script>
|
||||||
$(function(){
|
$(function(){
|
||||||
|
|||||||
@@ -20,5 +20,5 @@
|
|||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
@html.diff(diffs, repository, None)
|
@helper.html.diff(diffs, repository, None)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
<form action="@url(repository)/wiki/@if(pageName == ""){_new} else {_edit}" method="POST" validate="true">
|
<form action="@url(repository)/wiki/@if(pageName == ""){_new} else {_edit}" method="POST" validate="true">
|
||||||
<span id="error-pageName" class="error"></span>
|
<span id="error-pageName" class="error"></span>
|
||||||
<input type="text" name="pageName" value="@pageName" style="width: 900px; font-weight: bold;" placeholder="Input a page name."/>
|
<input type="text" name="pageName" value="@pageName" style="width: 900px; font-weight: bold;" placeholder="Input a page name."/>
|
||||||
@html.preview(repository, page.map(_.content).getOrElse(""), true, false, false, "width: 900px; height: 400px;", "")
|
@helper.html.preview(repository, page.map(_.content).getOrElse(""), true, false, false, "width: 900px; height: 400px;", "")
|
||||||
<input type="text" name="message" value="" style="width: 900px;" placeholder="Write a small message here explaining this change. (Optional)"/>
|
<input type="text" name="message" value="" style="width: 900px;" placeholder="Write a small message here explaining this change. (Optional)"/>
|
||||||
<input type="hidden" name="currentPageName" value="@pageName"/>
|
<input type="hidden" name="currentPageName" value="@pageName"/>
|
||||||
<input type="submit" value="Save" class="btn btn-success">
|
<input type="submit" value="Save" class="btn btn-success">
|
||||||
|
|||||||
Reference in New Issue
Block a user