Skip to content

Commit

Permalink
added delete action for superuser
Browse files Browse the repository at this point in the history
  • Loading branch information
ignatov committed Jul 20, 2011
1 parent 8e7785c commit 46a4379
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/main/scala/scala/tools/colladoc/page/Template.scala
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ class Template(tpl: DocTemplateEntity) extends tools.nsc.doc.html.page.Template(
</body>

/** Render discussion block. */
private def discussion =
private def discussion: NodeSeq =
<div id="discussion">
<h3 id="discussion_header">Discussion ({discussionCommentsCount})</h3>
<div id="discussion_wrapper">
Expand Down Expand Up @@ -186,6 +186,7 @@ class Template(tpl: DocTemplateEntity) extends tools.nsc.doc.html.page.Template(
<span class="datetime" title={d.atomDateTime}>{d.humanDateTime}</span>
by
<span class="author">{d.userName}</span>
{ if (User.superUser_?) deleteDiscussionButton(d) }
</div>
</li>

Expand Down Expand Up @@ -237,6 +238,10 @@ class Template(tpl: DocTemplateEntity) extends tools.nsc.doc.html.page.Template(
</html>
}

/** Render delete button for discussion comment. */
def deleteDiscussionButton(d: Discussion) = SHtml.a(
ColladocConfirm("Confirm delete"), () => {d.valid(false).save; reloadDiscussion}, Text("Delete"))

override def memberToHtml(mbr: MemberEntity): NodeSeq =
super.memberToHtml(mbr) \% Map("data-istype" -> (mbr.isAbstractType || mbr.isAliasType).toString)

Expand Down

0 comments on commit 46a4379

Please sign in to comment.