base/src/sqwl/cms/layout/PrimaryView.scala
changeset 33 fa0f19a74283
parent 19 83fb90bdd15b
equal deleted inserted replaced
32:2d14f02ba3bd 33:fa0f19a74283
       
     1 /*
       
     2  * Copyright 2018-2020 Tomas Zeman <tomas@functionals.cz>
       
     3  *
       
     4  * Licensed under the Apache License, Version 2.0 (the "License");
       
     5  * you may not use this file except in compliance with the License.
       
     6  * You may obtain a copy of the License at
       
     7  *
       
     8  *     http://www.apache.org/licenses/LICENSE-2.0
       
     9  *
       
    10  * Unless required by applicable law or agreed to in writing, software
       
    11  * distributed under the License is distributed on an "AS IS" BASIS,
       
    12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
       
    13  * See the License for the specific language governing permissions and
       
    14  * limitations under the License.
       
    15  */
     1 package sqwl.cms.layout
    16 package sqwl.cms.layout
     2 
    17 
     3 import scalatags.Text.all._
    18 import scalatags.Text.all._
     4 import scalatags.Text.{TypedTag, tags2}
    19 import scalatags.Text.{TypedTag, tags2}
     5 import sqwl.cms._
    20 import sqwl.cms._
    10       case ViewArticle(art) => Some(tags2.section(
    25       case ViewArticle(art) => Some(tags2.section(
    11         h1(a(href:=s"/${http.prefix}/${art.pathSegment}", art.title)),
    26         h1(a(href:=s"/${http.prefix}/${art.pathSegment}", art.title)),
    12         div(cls:="row", div(cls:="col-md-12", art.tags.map(t =>
    27         div(cls:="row", div(cls:="col-md-12", art.tags.map(t =>
    13           a(href:=s"/${http.prefix}/$TAG/${t.pathSegment}", cls:="tag",
    28           a(href:=s"/${http.prefix}/$TAG/${t.pathSegment}", cls:="tag",
    14             t.name)))),
    29             t.name)))),
    15         raw(art.htmlContent)
    30         art.htmlContent
    16       ))
    31       ))
    17       case _ => None
    32       case _ => None
    18     }
    33     }
    19 
    34 
    20 }
    35 }