example/src/sqwl/cms/Articles.scala
changeset 27 8529ce302f7c
parent 21 1fa630ed9b8a
child 33 fa0f19a74283
--- a/example/src/sqwl/cms/Articles.scala	Tue Jan 08 12:28:53 2019 +0100
+++ b/example/src/sqwl/cms/Articles.scala	Tue Jan 15 12:25:19 2019 +0100
@@ -11,7 +11,8 @@
     title: String,
     category: Option[iCategory],
     tags: Seq[iTag] = Seq(),
-    htmlContent: String
+    htmlContent: String,
+    rank: Int = 0
   ) extends iArticle {
     override def assets: Path = Paths.get(s"example/content/${id.v}")
     override def pathSegment: String = id.v
@@ -20,10 +21,10 @@
 
   def values: Seq[iArticle] = all.toIndexedSeq
 
-  def article(title: String, cat: iCategory, tags: Seq[iTag] = Seq())(
-    body: Frag*)(implicit articleId: Id): SeqFrag[Frag] = {
+  def article(title: String, cat: iCategory, tags: Seq[iTag] = Seq(),
+    rank: Int = 0)(body: Frag*)(implicit articleId: Id): SeqFrag[Frag] = {
 
-    all += Article(articleId, title, Option(cat), tags, body.render)
+    all += Article(articleId, title, Option(cat), tags, body.render, rank)
     body
   }
 }