[from now] 2012/07/23 12:44:48

diff --git a/test/unit/com/github/ganta/groovy/grails/plugins/web/TaglibTagLibSpec.groovy b/test/unit/com/github/ganta/groovy/grails/plugins/web/TaglibTagLibSpec.groovy
deleted file mode 100644
index 8b8c8b9..0000000
--- a/test/unit/com/github/ganta/groovy/grails/plugins/web/TaglibTagLibSpec.groovy
+++ /dev/null
@@ -1,26 +0,0 @@
-package com.github.ganta.groovy.grails.plugins.web
-
-import static org.junit.Assert.*
-
-import grails.test.mixin.*
-import grails.test.mixin.support.*
-import org.junit.*
-
-/**
- * See the API for {@link grails.test.mixin.support.GrailsUnitTestMixin} for usage instructions
- */
-@TestMixin(GrailsUnitTestMixin)
-class TaglibTagLibSpec {
-
-    void setUp() {
-        // Setup logic here
-    }
-
-    void tearDown() {
-        // Tear down logic here
-    }
-
-    void testSomething() {
-        fail "Implement me"
-    }
-}
diff --git a/test/unit/com/github/ganta/groovy/grails/plugins/web/taglib/PaginationTagLibSpec.groovy b/test/unit/com/github/ganta/groovy/grails/plugins/web/taglib/PaginationTagLibSpec.groovy
deleted file mode 100644
index 3621262..0000000
--- a/test/unit/com/github/ganta/groovy/grails/plugins/web/taglib/PaginationTagLibSpec.groovy
+++ /dev/null
@@ -1,26 +0,0 @@
-package com.github.ganta.groovy.grails.plugins.web.taglib
-
-import static org.junit.Assert.*
-
-import grails.test.mixin.*
-import grails.test.mixin.support.*
-import org.junit.*
-
-/**
- * See the API for {@link grails.test.mixin.support.GrailsUnitTestMixin} for usage instructions
- */
-@TestMixin(GrailsUnitTestMixin)
-class PaginationTagLibSpec {
-
-    void setUp() {
-        // Setup logic here
-    }
-
-    void tearDown() {
-        // Tear down logic here
-    }
-
-    void testSomething() {
-        fail "Implement me"
-    }
-}
diff --git a/test/unit/com/github/ganta/groovy/grails/plugins/web/taglib/TwitterBootstrapTagLib/GroovyTagLibSpec.groovy b/test/unit/com/github/ganta/groovy/grails/plugins/web/taglib/TwitterBootstrapTagLib/GroovyTagLibSpec.groovy
deleted file mode 100644
index 22dbc8d..0000000
--- a/test/unit/com/github/ganta/groovy/grails/plugins/web/taglib/TwitterBootstrapTagLib/GroovyTagLibSpec.groovy
+++ /dev/null
@@ -1,26 +0,0 @@
-package com.github.ganta.groovy.grails.plugins.web.taglib.TwitterBootstrapTagLib
-
-import static org.junit.Assert.*
-
-import grails.test.mixin.*
-import grails.test.mixin.support.*
-import org.junit.*
-
-/**
- * See the API for {@link grails.test.mixin.support.GrailsUnitTestMixin} for usage instructions
- */
-@TestMixin(GrailsUnitTestMixin)
-class GroovyTagLibSpec {
-
-    void setUp() {
-        // Setup logic here
-    }
-
-    void tearDown() {
-        // Tear down logic here
-    }
-
-    void testSomething() {
-        fail "Implement me"
-    }
-}
diff --git a/test/unit/twitter/bootstrap/PaginationTagLibSpec.groovy b/test/unit/twitter/bootstrap/PaginationTagLibSpec.groovy
new file mode 100644
index 0000000..df904e9
--- /dev/null
+++ b/test/unit/twitter/bootstrap/PaginationTagLibSpec.groovy
@@ -0,0 +1,26 @@
+package twitter.bootstrap
+
+import static org.junit.Assert.*
+
+import grails.test.mixin.*
+import grails.test.mixin.support.*
+import org.junit.*
+
+/**
+ * See the API for {@link grails.test.mixin.support.GrailsUnitTestMixin} for usage instructions
+ */
+@TestMixin(GrailsUnitTestMixin)
+class PaginationTagLibSpec {
+
+    void setUp() {
+        // Setup logic here
+    }
+
+    void tearDown() {
+        // Tear down logic here
+    }
+
+    void testSomething() {
+        fail "Implement me"
+    }
+}
[from now] 2012/07/23 21:50:24

diff --git a/grails-app/taglib/twitter/bootstrap/ModalsTagLib.groovy b/grails-app/taglib/twitter/bootstrap/ModalsTagLib.groovy
index e36c443..1cb227b 100644
--- a/grails-app/taglib/twitter/bootstrap/ModalsTagLib.groovy
+++ b/grails-app/taglib/twitter/bootstrap/ModalsTagLib.groovy
@@ -7,26 +7,40 @@ class ModalsTagLib {
     /**
      * Create modal for Twitter Bootstrap.
      *
+     * @attr id
+     * @attr buttonClass
+     * @attr header
      * @attr href
      */
     Closure modal = { attrs, body ->
         def writer = out

-        writer << '<a class="btn" data-toggle="modal" href="#myModal" >Launch Modal</a>'
-
-        writer << '<div class="modal hide" id="myModal">'
-        writer << '  <div class="modal-header">'
-        writer << '    <button type="button" class="close" data-dismiss="modal">×</button>'
-        writer << '    <h3>Modal header</h3>'
-        writer << '  </div>'
-        writer << '  <div class="modal-body">'
-        writer << '    <p>One fine body…</p>'
-        writer << '  </div>'
-        writer << '  <div class="modal-footer">'
-        writer << '    <a href="#" class="btn" data-dismiss="modal">Close</a>'
-        writer << '    <a href="#" class="btn btn-primary">Save changes</a>'
+        if (!attrs.id) {
+            throwTagError("Tag [modal] is missing required attribute [id]")
+        }
+
+        def buttonClass = 'btn'
+        if (attrs.buttonClass) {
+            buttonClass += attrs.buttonClass
+        }
+
+        writer << '<a class="' + buttonClass + '" data-toggle="modal" href="#' + attrs.id + '" >Launch Modal</a>'
+
+        writer << '<div class="modal hide" id="' + attrs.id + '">'
+        writer << '<div class="modal-header">'
+        writer << '<button type="button" class="close" data-dismiss="modal">×</button>'
+        if (attrs.header) {
+            writer << "<h3>${attrs.header}</h3>"
+        }
+        writer << '</div>'
+        writer << '<div class="modal-body">'
+        writer << body()
+        writer << '</div>'
+        writer << '<div class="modal-footer">'
+        writer << '<a href="#" class="btn" data-dismiss="modal">Close</a>'
+        writer << '<a href="#" class="btn btn-primary">Save changes</a>'
         writer << actionSubmit(value: 'hoge', action: 'delete', class: 'delete btn btn-danger')
-        writer << '  </div>'
+        writer << '</div>'
         writer << '</div>'
     }

diff --git a/src/templates/scaffolding/show.gsp b/src/templates/scaffolding/show.gsp
index 4aeb342..e0c01eb 100644
--- a/src/templates/scaffolding/show.gsp
+++ b/src/templates/scaffolding/show.gsp
@@ -75,7 +75,7 @@
                         <g:hiddenField name="id" value="\${${propertyName}?.id}"/>
                         <g:link class="edit btn" action="edit" id="\${${propertyName}?.id}"><g:message code="default.button.edit.label" default="Edit"/></g:link>
                         <g:actionSubmit class="delete btn btn-danger" action="delete" value="\${message(code: 'default.button.delete.label', default: 'Delete')}" onclick="return confirm('\${message(code: 'default.button.delete.confirm.message', default: 'Are you sure?')}');"/>
-                        <bootstrap:modal/>
+                        <bootstrap:modal id="delete-modal"/>
                     </fieldset>
                 </g:form>
         </div>