| author | Tomas Zeman <tzeman@volny.cz> |
| Tue, 23 Apr 2013 10:36:04 +0200 | |
| changeset 108 | ef4e3e0ef83f |
| parent 35 | d77d8194ee59 |
| permissions | -rw-r--r-- |
| 27 | 1 |
/* |
2 |
* Copyright 2012 Tomas Zeman <tzeman@volny.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 |
*/ |
|
16 |
package net.tz.lift |
|
17 |
||
18 |
import net.liftweb.common._ |
|
19 |
import net.liftweb.http.S |
|
20 |
import net.liftweb.sitemap.Loc |
|
|
108
ef4e3e0ef83f
84a94fa29a67504b Task/Project notifications
Tomas Zeman <tzeman@volny.cz>
parents:
35
diff
changeset
|
21 |
import net.liftweb.util.DynoVar |
| 27 | 22 |
import net.liftweb.util.Helpers._ |
23 |
import scala.xml.{Elem, NodeSeq, Text}
|
|
24 |
||
25 |
package object snippet {
|
|
26 |
type CssTr = (NodeSeq => NodeSeq) |
|
27 |
||
|
108
ef4e3e0ef83f
84a94fa29a67504b Task/Project notifications
Tomas Zeman <tzeman@volny.cz>
parents:
35
diff
changeset
|
28 |
object withBaseUrl extends DynoVar[String] |
|
ef4e3e0ef83f
84a94fa29a67504b Task/Project notifications
Tomas Zeman <tzeman@volny.cz>
parents:
35
diff
changeset
|
29 |
|
|
ef4e3e0ef83f
84a94fa29a67504b Task/Project notifications
Tomas Zeman <tzeman@volny.cz>
parents:
35
diff
changeset
|
30 |
def a(href: String)(cnt: NodeSeq): Elem = |
|
ef4e3e0ef83f
84a94fa29a67504b Task/Project notifications
Tomas Zeman <tzeman@volny.cz>
parents:
35
diff
changeset
|
31 |
<a href={(withBaseUrl.get openOr "") + href}>{cnt}</a>
|
| 27 | 32 |
|
33 |
def a(href: Box[String])(cnt: NodeSeq): NodeSeq = |
|
|
108
ef4e3e0ef83f
84a94fa29a67504b Task/Project notifications
Tomas Zeman <tzeman@volny.cz>
parents:
35
diff
changeset
|
34 |
href.dmap(cnt) { l => <a href={(withBaseUrl.get openOr "") + l}>{cnt}</a> }
|
| 27 | 35 |
|
| 35 | 36 |
def locTpl(p: String): Loc.Template = LocTpl(p) |
| 27 | 37 |
} |
38 |
||
39 |
||
40 |
// vim: set ts=2 sw=2 et: |