src/main/scala/net/tz/lift/model/FieldHelp.scala
author Tomas Zeman <tzeman@volny.cz>
Tue, 24 Apr 2012 16:42:34 +0200
changeset 77 8f0eddd7aa85
parent 51 523c5c5b84e5
permissions -rw-r--r--
Datatables DSL
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
51
523c5c5b84e5 [mq]: twitter-bootstrap-forms-error+help.patch
Tomas Zeman <tzeman@volny.cz>
parents:
diff changeset
     1
/*
523c5c5b84e5 [mq]: twitter-bootstrap-forms-error+help.patch
Tomas Zeman <tzeman@volny.cz>
parents:
diff changeset
     2
 * Copyright 2012 Tomas Zeman <tzeman@volny.cz>
523c5c5b84e5 [mq]: twitter-bootstrap-forms-error+help.patch
Tomas Zeman <tzeman@volny.cz>
parents:
diff changeset
     3
 *
523c5c5b84e5 [mq]: twitter-bootstrap-forms-error+help.patch
Tomas Zeman <tzeman@volny.cz>
parents:
diff changeset
     4
 * Licensed under the Apache License, Version 2.0 (the "License");
523c5c5b84e5 [mq]: twitter-bootstrap-forms-error+help.patch
Tomas Zeman <tzeman@volny.cz>
parents:
diff changeset
     5
 * you may not use this file except in compliance with the License.
523c5c5b84e5 [mq]: twitter-bootstrap-forms-error+help.patch
Tomas Zeman <tzeman@volny.cz>
parents:
diff changeset
     6
 * You may obtain a copy of the License at
523c5c5b84e5 [mq]: twitter-bootstrap-forms-error+help.patch
Tomas Zeman <tzeman@volny.cz>
parents:
diff changeset
     7
 *
523c5c5b84e5 [mq]: twitter-bootstrap-forms-error+help.patch
Tomas Zeman <tzeman@volny.cz>
parents:
diff changeset
     8
 *     http://www.apache.org/licenses/LICENSE-2.0
523c5c5b84e5 [mq]: twitter-bootstrap-forms-error+help.patch
Tomas Zeman <tzeman@volny.cz>
parents:
diff changeset
     9
 *
523c5c5b84e5 [mq]: twitter-bootstrap-forms-error+help.patch
Tomas Zeman <tzeman@volny.cz>
parents:
diff changeset
    10
 * Unless required by applicable law or agreed to in writing, software
523c5c5b84e5 [mq]: twitter-bootstrap-forms-error+help.patch
Tomas Zeman <tzeman@volny.cz>
parents:
diff changeset
    11
 * distributed under the License is distributed on an "AS IS" BASIS,
523c5c5b84e5 [mq]: twitter-bootstrap-forms-error+help.patch
Tomas Zeman <tzeman@volny.cz>
parents:
diff changeset
    12
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
523c5c5b84e5 [mq]: twitter-bootstrap-forms-error+help.patch
Tomas Zeman <tzeman@volny.cz>
parents:
diff changeset
    13
 * See the License for the specific language governing permissions and
523c5c5b84e5 [mq]: twitter-bootstrap-forms-error+help.patch
Tomas Zeman <tzeman@volny.cz>
parents:
diff changeset
    14
 * limitations under the License.
523c5c5b84e5 [mq]: twitter-bootstrap-forms-error+help.patch
Tomas Zeman <tzeman@volny.cz>
parents:
diff changeset
    15
 */
523c5c5b84e5 [mq]: twitter-bootstrap-forms-error+help.patch
Tomas Zeman <tzeman@volny.cz>
parents:
diff changeset
    16
package net.tz.lift.model
523c5c5b84e5 [mq]: twitter-bootstrap-forms-error+help.patch
Tomas Zeman <tzeman@volny.cz>
parents:
diff changeset
    17
523c5c5b84e5 [mq]: twitter-bootstrap-forms-error+help.patch
Tomas Zeman <tzeman@volny.cz>
parents:
diff changeset
    18
import net.liftweb.common._
523c5c5b84e5 [mq]: twitter-bootstrap-forms-error+help.patch
Tomas Zeman <tzeman@volny.cz>
parents:
diff changeset
    19
import net.liftweb.record._
523c5c5b84e5 [mq]: twitter-bootstrap-forms-error+help.patch
Tomas Zeman <tzeman@volny.cz>
parents:
diff changeset
    20
import net.liftweb.util.Helpers._
523c5c5b84e5 [mq]: twitter-bootstrap-forms-error+help.patch
Tomas Zeman <tzeman@volny.cz>
parents:
diff changeset
    21
523c5c5b84e5 [mq]: twitter-bootstrap-forms-error+help.patch
Tomas Zeman <tzeman@volny.cz>
parents:
diff changeset
    22
/**
523c5c5b84e5 [mq]: twitter-bootstrap-forms-error+help.patch
Tomas Zeman <tzeman@volny.cz>
parents:
diff changeset
    23
 * Generic field help.
523c5c5b84e5 [mq]: twitter-bootstrap-forms-error+help.patch
Tomas Zeman <tzeman@volny.cz>
parents:
diff changeset
    24
 * Field help is taken from resource bundle.
523c5c5b84e5 [mq]: twitter-bootstrap-forms-error+help.patch
Tomas Zeman <tzeman@volny.cz>
parents:
diff changeset
    25
 */
523c5c5b84e5 [mq]: twitter-bootstrap-forms-error+help.patch
Tomas Zeman <tzeman@volny.cz>
parents:
diff changeset
    26
trait FieldHelp { self: OwnedField[_ <: Record[_]] =>
523c5c5b84e5 [mq]: twitter-bootstrap-forms-error+help.patch
Tomas Zeman <tzeman@volny.cz>
parents:
diff changeset
    27
  override def helpAsHtml = Box !! i18n("%s.%s.help".format(
523c5c5b84e5 [mq]: twitter-bootstrap-forms-error+help.patch
Tomas Zeman <tzeman@volny.cz>
parents:
diff changeset
    28
    camelifyMethod(owner.getClass.getSimpleName),
523c5c5b84e5 [mq]: twitter-bootstrap-forms-error+help.patch
Tomas Zeman <tzeman@volny.cz>
parents:
diff changeset
    29
    camelifyMethod(name)) filterNot {_ == '$'})
523c5c5b84e5 [mq]: twitter-bootstrap-forms-error+help.patch
Tomas Zeman <tzeman@volny.cz>
parents:
diff changeset
    30
}
523c5c5b84e5 [mq]: twitter-bootstrap-forms-error+help.patch
Tomas Zeman <tzeman@volny.cz>
parents:
diff changeset
    31
523c5c5b84e5 [mq]: twitter-bootstrap-forms-error+help.patch
Tomas Zeman <tzeman@volny.cz>
parents:
diff changeset
    32
// vim: set ts=2 sw=2 et: