Permalink
Browse files

Introduce a pretty icon when api says is commentable

Closes issue #15
  • Loading branch information...
1 parent 2ea1319 commit a26d2d2ec468c63b4054dac1d53354247ebd76ef Graham Tackley committed Apr 11, 2012
@@ -15,6 +15,11 @@
background-position:0 0;
}
+.table .narrow-icon {
+ padding-left: 2px;
+ padding-right: 2px;
+}
+
a:visited {
color:#000bcc;
}
@@ -44,7 +44,8 @@ object Application extends Controller {
altTextOfMainImageFor(c),
c.isLead.getOrElse(false),
ukFrontLinks.contains(c.id),
- usFrontLinks.contains(c.id)
+ usFrontLinks.contains(c.id),
+ c.isCommentable
)
}
}
@@ -72,7 +73,8 @@ case class PublishedContent(
altText: Option[String],
isLead: Boolean,
onUkFront: Boolean,
- onUsFront: Boolean
+ onUsFront: Boolean,
+ isCommentable: Boolean
) {
lazy val cpsCssClass = hitsPerSec match {
case "0" => "zero"
@@ -12,7 +12,9 @@ import play.api.libs.concurrent.Promise
case class LiveDashboardContent(
content: Content,
isLead: Option[Boolean] = None
-)
+) {
+ lazy val isCommentable = content.safeFields.get("commentable").exists(_ == "true")
+}
object LiveDashboardContent {
// this is a temporary hack :)
@@ -42,7 +44,7 @@ class LatestContent(implicit sys: ActorSystem) {
val apiNewContent: List[Content] =
Api.search.fromDate(lastDateTime).showTags("all")
- .orderBy("oldest").showFields("trailText")
+ .orderBy("oldest").showFields("trailText,commentable")
.showMedia("picture")
.section(editorialSections)
.pageSize(50).results
@@ -10,29 +10,34 @@
@c.hitsPerSec
</span>
</td>
- <td class="uk-front-referral-status">
+ <td class="narrow-icon">
@if(c.onUkFront) {
<i class="icon-uk" title="On http://www.guardian.co.uk/"></i>
}
</td>
- <td class="us-front-referral-status">
+ <td class="narrow-icon">
@if(c.onUsFront) {
<i class="icon-us" title="On http://www.guardiannews.com/"></i>
}
</td>
- <td class="lead-status">
+ <td class="narrow-icon">
@if(c.isLead) {
<i class="icon-star-empty" title="Lead content for section tag"></i>
}
</td>
+ <td class="narrow-icon">
+ @if(c.isCommentable) {
+ <i class="icon-comment" title="Comments enabled"></i>
+ }
+ </td>
<td>
@Html(c.section) <a href="@c.url" target="_blank">@Html(c.title)</a>
<div class="trail-text">@Html(c.trailText getOrElse "")</div>
<div class="alt-text">
@if(c.altText.isEmpty) {
(no alt text found)
} else {
- <input type="text" class="alt-text-input span10 uneditable-input" value="@c.altText.get">
+ <input type="text" class="alt-text-input span9 uneditable-input" value="@c.altText.get">
}
</div>
<ol class="tag-list">

0 comments on commit a26d2d2

Please sign in to comment.