Display error message as a toast

This commit is contained in:
Naoki Takezoe
2018-04-19 18:56:00 +09:00
parent e4520247fc
commit acf5767e4f
3 changed files with 13 additions and 26 deletions

View File

@@ -130,8 +130,8 @@ trait PullRequestsControllerBase extends ControllerBase {
isManageable(repository),
hasDeveloperRole(pullreq.requestUserName, pullreq.requestRepositoryName, context.loginAccount),
repository,
getRepository(pullreq.requestUserName, pullreq.requestRepositoryName)
//flash.toMap.map(f => f._1 -> f._2.toString)
getRepository(pullreq.requestUserName, pullreq.requestRepositoryName),
flash.toMap.map(f => f._1 -> f._2.toString)
)
// html.pullreq(

View File

@@ -11,9 +11,10 @@
isManageable: Boolean,
isManageableForkedRepository: Boolean,
repository: gitbucket.core.service.RepositoryService.RepositoryInfo,
forkedRepository: Option[gitbucket.core.service.RepositoryService.RepositoryInfo])(implicit context: gitbucket.core.controller.Context)
forkedRepository: Option[gitbucket.core.service.RepositoryService.RepositoryInfo],
flash: Map[String, String])(implicit context: gitbucket.core.controller.Context)
@import gitbucket.core.view.helpers
@gitbucket.core.pulls.html.menu("conversation", issue, pullreq, commits, comments, isManageable, repository){
@gitbucket.core.pulls.html.menu("conversation", issue, pullreq, commits, comments, isManageable, repository, flash){
<div class="col-md-9">
<div id="comment-list">
@gitbucket.core.issues.html.commentlist(Some(issue), comments.toList, isManageable, repository, Some(pullreq))

View File

@@ -4,7 +4,8 @@
commits: Seq[gitbucket.core.util.JGitUtil.CommitInfo],
comments: Seq[gitbucket.core.model.Comment],
isManageable: Boolean,
repository: gitbucket.core.service.RepositoryService.RepositoryInfo)(body: => Html)(implicit context: gitbucket.core.controller.Context)
repository: gitbucket.core.service.RepositoryService.RepositoryInfo,
flash: Map[String, String] = Map.empty)(body: => Html)(implicit context: gitbucket.core.controller.Context)
@import gitbucket.core.view.helpers
@import gitbucket.core.model.IssueComment
@gitbucket.core.html.main(s"${issue.title} - Pull request #${issue.issueId} - ${repository.owner}/${repository.name}", Some(repository)) {
@@ -72,28 +73,13 @@
<li @if(active=="files"){class="active"}><a href="@helpers.url(repository)/pull/@issue.issueId/files">Files Changed</a></li>
</ul>
<div class="tab-content fill-width" style="padding-top: 20px;">
@flash.get("error").map { error =>
<div class="alert alert-error">@error</div>
}
@flash.get("info").map { info =>
<div class="alert alert-info">@info</div>
}
@body
@*
<div class="tab-pane" id="conversation">
@flash.get("error").map { error =>
<div class="alert alert-error">@error</div>
}
@flash.get("info").map { info =>
<div class="alert alert-info">@info</div>
}
@gitbucket.core.pulls.html.conversation(issue, pullreq, commits, comments, issueLabels, collaborators, milestones, priorities, labels, isEditable, isManageable, isManageableForkedRepository, repository, forkedRepository)
</div>
<div class="tab-pane" id="commits">
@if(commits.nonEmpty) {
@gitbucket.core.pulls.html.commits(dayByDayCommits, repository)
}
</div>
<div class="tab-pane" id="files">
@if(commits.nonEmpty) {
@gitbucket.core.helper.html.diff(diffs, repository, commits.headOption.map(_.id), commits.lastOption.map(_.id), true, Some(pullreq.issueId), isManageable, true)
}
</div>
*@
</div>
}
}