[from now] 2012/07/24 10:56:15

diff --git a/grails-app/taglib/twitter/bootstrap/ModalsTagLib.groovy b/grails-app/taglib/twitter/bootstrap/ModalsTagLib.groovy
index 1cb227b..ba6e76f 100644
--- a/grails-app/taglib/twitter/bootstrap/ModalsTagLib.groovy
+++ b/grails-app/taglib/twitter/bootstrap/ModalsTagLib.groovy
@@ -9,6 +9,7 @@ class ModalsTagLib {
      *
      * @attr id
      * @attr buttonClass
+     * @attr buttonLabel
      * @attr header
      * @attr href
      */
@@ -18,21 +19,25 @@ class ModalsTagLib {
         if (!attrs.id) {
             throwTagError("Tag [modal] is missing required attribute [id]")
         }
+        if (!attrs.buttonLabel) {
+            throwTagError("Tag [modal] is missing required attribute [buttonLabel]")
+        }
+

         def buttonClass = 'btn'
         if (attrs.buttonClass) {
             buttonClass += attrs.buttonClass
         }

-        writer << '<a class="' + buttonClass + '" data-toggle="modal" href="#' + attrs.id + '" >Launch Modal</a>'
+        writer << '<a class="' + buttonClass + '" data-toggle="modal" href="#' + attrs.id + '" >' + attrs.buttonLabel + '</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 << '<div class="modal-header">'
+            writer << '<button type="button" class="close" data-dismiss="modal">×</button>'
             writer << "<h3>${attrs.header}</h3>"
+            writer << '</div>'
         }
-        writer << '</div>'
         writer << '<div class="modal-body">'
         writer << body()
         writer << '</div>'
diff --git a/src/templates/scaffolding/show.gsp b/src/templates/scaffolding/show.gsp
index e0c01eb..1fb0979 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 id="delete-modal"/>
+                        <bootstrap:modal id="delete-modal" buttonLabel="Test"/>
                     </fieldset>
                 </g:form>
         </div>
[from now] 2012/07/24 13:07:03

diff --git a/grails-app/taglib/twitter/bootstrap/ModalsTagLib.groovy b/grails-app/taglib/twitter/bootstrap/ModalsTagLib.groovy
index ba6e76f..48ca1f5 100644
--- a/grails-app/taglib/twitter/bootstrap/ModalsTagLib.groovy
+++ b/grails-app/taglib/twitter/bootstrap/ModalsTagLib.groovy
@@ -31,7 +31,7 @@ class ModalsTagLib {

         writer << '<a class="' + buttonClass + '" data-toggle="modal" href="#' + attrs.id + '" >' + attrs.buttonLabel + '</a>'

-        writer << '<div class="modal hide" id="' + attrs.id + '">'
+        writer << '<div class="modal fade hide" id="' + attrs.id + '">'
         if (attrs.header) {
             writer << '<div class="modal-header">'
             writer << '<button type="button" class="close" data-dismiss="modal">×</button>'
diff --git a/src/templates/scaffolding/show.gsp b/src/templates/scaffolding/show.gsp
index 1fb0979..ab67f02 100644
--- a/src/templates/scaffolding/show.gsp
+++ b/src/templates/scaffolding/show.gsp
@@ -69,15 +69,15 @@
                     </dd>
                 </g:if>
                 <% } %>
-            </ol>
-                <g:form class="well">
-                    <fieldset class="buttons">
-                        <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 id="delete-modal" buttonLabel="Test"/>
-                    </fieldset>
-                </g:form>
+            </dl>
+            <g:form class="well">
+                <fieldset class="buttons">
+                    <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 id="delete-modal" buttonLabel="Test"/>
+                </fieldset>
+            </g:form>
         </div>
     </div>
 </div>