Permalink
Browse files

Fixed layout for twitterbootstrap 2.0

  • Loading branch information...
1 parent 9867c52 commit c4af418c3dcd37d47aed1b2442a6740f59f14373 @chriscantu committed Feb 9, 2012
Showing with 25 additions and 20 deletions.
  1. +3 −2 src/templates/scaffolding/list.gsp
  2. +18 −18 src/templates/scaffolding/show.gsp
  3. +4 −0 web-app/css/twitter.css
@@ -13,7 +13,7 @@
<div class="span3">
<h1><g:message code="default.list.label" args="[entityName]" /></h1>
</div>
- <div class="span8">
+ <div class="span9">
<g:if test="\${flash.message}">
<div class="alert-message info" role="status"><strong>\${flash.message}</strong></div>
</g:if>
@@ -33,14 +33,15 @@
<div class="sidebar span3">
<div class="well" role="navigation">
<ul class="nav nav-list">
+ <li class="nav-header">Options</li>
<li><a class="home" href="\${createLink(uri: '/')}"><i class="icon-list"></i><g:message code="default.list.label" args="[entityName]"/></a></li>
<li><g:link class="create" action="create"><i class="icon-file"></i><g:message code="default.new.label" args="[entityName]" /></g:link></li>
</ul>
</div>
</div>
<div class="content">
<div class="row">
- <div class="span8">
+ <div class="span9">
<div id="list-${domainClass.propertyName}" class="content scaffold-list" role="main">
<table class="table table-striped table-bordered">
<thead>
@@ -10,10 +10,10 @@
<body>
<div class="container">
<div class="row">
- <div class="span4">
+ <div class="span3">
<h1><g:message code="default.show.label" args="[entityName]" /></h1>
</div>
- <div class="span12">
+ <div class="span9">
<g:if test="\${flash.message}">
<div class="alert-message info" role="status"><strong>\${flash.message}</strong></div>
</g:if>
@@ -29,18 +29,18 @@
</div>
</div>
<div class="row">
- <div class="sidebar span4">
+ <div class="sidebar span3">
<div class="well" role="navigation">
- <ul>
- <li><a class="home" href="\${createLink(uri: '/')}"><g:message code="default.home.label"/></a></li>
- <li><g:link class="list" action="list"><g:message code="default.list.label" args="[entityName]" /></g:link></li>
- <li><g:link class="create" action="create"><g:message code="default.new.label" args="[entityName]" /></g:link></li>
+ <ul class="nav nav-list">
+ <li class="nav-header">Options</li>
+ <li><a class="home" href="\${createLink(uri: '/')}"><i class="icon-list"></i><g:message code="default.list.label" args="[entityName]"/></a></li>
+ <li><g:link class="create" action="create"><i class="icon-file"></i><g:message code="default.new.label" args="[entityName]" /></g:link></li>
</ul>
</div>
</div>
<div class="content">
<div class="row">
- <div class="span12">
+ <div class="span9">
<% excludedProps = Event.allEvents.toList() << 'id' << 'version'
allowedNames = domainClass.persistentProperties*.name << 'dateCreated' << 'lastUpdated'
props = domainClass.properties.findAll { allowedNames.contains(it.name) && !excludedProps.contains(it.name) }
@@ -50,29 +50,29 @@
<g:if test="\${${propertyName}?.${p.name}}">
<div id="${p.name}-label" class="property-label span3"><g:message code="${domainClass.propertyName}.${p.name}.label" default="${p.naturalName}" />:</div>
<% if (p.isEnum()) { %>
- <div class="property-value span7" aria-labelledby="${p.name}-label"><g:fieldValue bean="\${${propertyName}}" field="${p.name}"/></div>
+ <div class="property-value span5" aria-labelledby="${p.name}-label"><g:fieldValue bean="\${${propertyName}}" field="${p.name}"/></div>
<% } else if (p.oneToMany || p.manyToMany) { %>
<g:each in="\${${propertyName}.${p.name}}" var="${p.name[0]}">
- <div class="property-value span7" aria-labelledby="${p.name}-label"><g:link controller="${p.referencedDomainClass?.propertyName}" action="show" id="\${${p.name[0]}.id}">\${${p.name[0]}?.encodeAsHTML()}</g:link></div>
+ <div class="property-value span5" aria-labelledby="${p.name}-label"><g:link controller="${p.referencedDomainClass?.propertyName}" action="show" id="\${${p.name[0]}.id}">\${${p.name[0]}?.encodeAsHTML()}</g:link></div>
</g:each>
<% } else if (p.manyToOne || p.oneToOne) { %>
- <div class="property-value span7" aria-labelledby="${p.name}-label"><g:link controller="${p.referencedDomainClass?.propertyName}" action="show" id="\${${propertyName}?.${p.name}?.id}">\${${propertyName}?.${p.name}?.encodeAsHTML()}</g:link></div>
+ <div class="property-value span5" aria-labelledby="${p.name}-label"><g:link controller="${p.referencedDomainClass?.propertyName}" action="show" id="\${${propertyName}?.${p.name}?.id}">\${${propertyName}?.${p.name}?.encodeAsHTML()}</g:link></div>
<% } else if (p.type == Boolean || p.type == boolean) { %>
- <div class="property-value span7" aria-labelledby="${p.name}-label"><g:formatBoolean boolean="\${${propertyName}?.${p.name}}" /></div>
+ <div class="property-value span5" aria-labelledby="${p.name}-label"><g:formatBoolean boolean="\${${propertyName}?.${p.name}}" /></div>
<% } else if (p.type == Date || p.type == java.sql.Date || p.type == java.sql.Time || p.type == Calendar) { %>
- <div class="property-value span7" aria-labelledby="${p.name}-label"><g:formatDate date="\${${propertyName}?.${p.name}}" /></div>
+ <div class="property-value span5" aria-labelledby="${p.name}-label"><g:formatDate date="\${${propertyName}?.${p.name}}" /></div>
<% } else if(!p.type.isArray()) { %>
- <div class="property-value span7" aria-labelledby="${p.name}-label"><g:fieldValue bean="\${${propertyName}}" field="${p.name}"/></div>
+ <div class="property-value span5" aria-labelledby="${p.name}-label"><g:fieldValue bean="\${${propertyName}}" field="${p.name}"/></div>
<% } %>
</g:if>
</div>
<% } %>
<g:form>
- <fieldset class="buttons">
+ <p>
<g:hiddenField name="id" value="\${${propertyName}?.id}" />
- <g:link class="edit" action="edit" id="\${${propertyName}?.id}" class="btn primary"><g:message code="default.button.edit.label" default="Edit" /></g:link>
- <g:actionSubmit class="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?')}');" />
- </fieldset>
+ <g:link action="edit" id="\${${propertyName}?.id}" class="btn btn-primary top-align"><g:message code="default.button.edit.label" default="Edit" /></g:link>
+ <g:actionSubmit class="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?')}');" />
+ </p>
</g:form>
</div>
</div>
@@ -40,6 +40,10 @@ span.currentStep {
border-left-width: 0;
}
+.top-align {
+ vertical-align: top;
+}
+
div.edit-properties.error > input { border-color: #E9322D; }
div.edit-properties.error > select { border-color: #E9322D; }
div.edit-properties.error > textarea { border-color: #E9322D; }

0 comments on commit c4af418

Please sign in to comment.