Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Implemented simple breadcrumb

  • Loading branch information...
commit e136bb780ebf60a77566d2d9c1f335225df8c6f8 1 parent 6d61abf
@danielrohers danielrohers authored
View
2  .gitignore
@@ -10,3 +10,5 @@ web-app/WEB-INF/
plugin.xml
grails-*.zip
*.log
+*.class
+target-eclipse
View
27 grails-app/taglib/org/groovydev/TwitterBootstrapTagLib.groovy
@@ -180,5 +180,32 @@ class TwitterBootstrapTagLib {
writer << '</ul>'
}
+
+ /**
+ *
+ * @attr body REQUIRED The body must be breadcrumbLink
+ */
+ def breadcrumb = { attrs, body ->
+ out << '<ol class="breadcrumb">'
+ out << body()
+ out << '</ol>'
+ }
+
+ /**
+ * @emptyTag
+ *
+ * @attr value REQUIRED The value is the value of the link
+ * @attr active True if the link is active
+ */
+ def breadcrumbLink = { attrs ->
+ def value = attrs.value
+ def active = attrs.boolean('active')
+ def link = attrs.link ?: '#'
+ if (active) {
+ out << "<li class=\"active\">${value}</li>"
+ } else {
+ out << "<li><a href=\"${link}\">${value}</a></li>"
+ }
+ }
}
Please sign in to comment.
Something went wrong with that request. Please try again.