@(m: models.Metadata, directive: String, i: Int, tableView: Boolean = false)(implicit user: Option[models.User]) @import java.net.URL @import play.api.libs.json.JsString @import play.api.libs.json.JsObject @import play.api.libs.json.JsValue @import play.api.libs.json.JsArray @import api.Permission @dateFormatter(date: java.util.Date) = @{ val formatter = new java.text.SimpleDateFormat("MMM d, yyyy") formatter.format(date); } @printContentValue(agent: Agent, content: JsValue, contextId: Option[UUID], contextURL: Option[URL], resourceId: UUID, counter: Int, tableView: Boolean = false) = { @content match { case o: JsObject => { } case a: JsArray => { } case s: JsString => { @if(s.value.startsWith("http")) { @s.value } else { @s.value } } case _ => { @content } } } @printPerson(agent: Agent, content: JsValue, contextId: Option[UUID], contextURL: Option[URL], resourceId: UUID) = { @content match { case s: JsString => { @if(play.api.Play.current.plugin[services.StagingAreaPlugin].isDefined) { @s.value } else { @if(s.value.startsWith("http")) { @s.value } else { @s.value } } } case _ => { @content } } } @printHeader(agent: Agent, date: java.util.Date) = { @agent.operation by @if(agent.displayName.length > 0) { @if(agent.typeOfAgent.toLowerCase().indexOf("user") >= 0) { @if(user.isDefined) { @agent.displayName } else { @agent.displayName } } else { @if(agent.url.isDefined) { @agent.displayName } else { @agent.displayName } } } else { @if(agent.url.isDefined) { @agent.url } else { unknown } } on @dateFormatter(date) } @defining(1) { counter: Int => @if(directive == "header") { @printHeader(m.creator, m.createdAt) } else { @printContentValue(m.creator, m.content, m.contextId, m.contextURL, m.attachedTo.id, counter * i + 1, tableView) } }