Skip to content

Commit

Permalink
Show trail text
Browse files Browse the repository at this point in the history
  • Loading branch information
tackley committed Feb 16, 2012
1 parent cff3958 commit 9078e74
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 4 deletions.
1 change: 0 additions & 1 deletion app/assets/js/latest-content.coffee
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
jQuery ->
setVisibility = ->
console.log "setting visibility"
$(".tag-list").toggle($("#tags-toggle").is(":checked"))


Expand Down
2 changes: 2 additions & 0 deletions app/controllers/Application.scala
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ object Application extends Controller {
c.webPublicationDate, c.webUrl, c.webTitle,
currentHits.get(c.webUrl).map(_.toString).getOrElse("0"),
c.sectionName.getOrElse(""),
c.safeFields.get("trailText"),
c.tags
)
}
Expand All @@ -49,6 +50,7 @@ case class PublishedContent(
title: String,
hitsPerSec: String,
section: String,
trailText: Option[String],
tags: List[Tag]
) {
lazy val cssClass = hitsPerSec match {
Expand Down
3 changes: 2 additions & 1 deletion app/lib/LatestContent.scala
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ class LatestContent(implicit sys: ActorSystem) {
log.info("Getting latest content published since "+ lastDateTime + "...")

val apiNewContent: List[Content] =
Api.search.fromDate(lastDateTime).showTags("all").orderBy("oldest").pageSize(50).results.reverse
Api.search.fromDate(lastDateTime).showTags("all")
.orderBy("oldest").showFields("trailText").pageSize(50).results.reverse

// because of the way we handle dates we will always get at least one item of content repeated
// so remove stuff we've already got from the api list
Expand Down
2 changes: 1 addition & 1 deletion app/views/content.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ <h1>Recently Published Content

<div class="row content-controls">
<div class="span11">
<div class="form-inline well">
<div class="form-inline">
<label class="checkbox">
<input type="checkbox" id="tags-toggle">
show tags
Expand Down
3 changes: 2 additions & 1 deletion app/views/snippets/contentChart.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
@for(c <- content) {
<tr>
<td>@c.publicationDate.toString("d MMM HH:mm:ss")</td>
<td><span class="label percent-cps @c.cssClass">@c.hitsPerSec</span></td>
<td>
<span class="label percent-cps @c.cssClass">@c.hitsPerSec</span>&nbsp;
@Html(c.section) <a href="@c.url">@Html(c.title)</a>
<div class="trail-text">@Html(c.trailText.getOrElse(""))</div>
<ol class="tag-list">
@for(t <- c.tags) {
<li><a href="@t.webUrl">@t.webTitle</a></li>
Expand Down

0 comments on commit 9078e74

Please sign in to comment.