Skip to content

Commit

Permalink
some mobile layout fixes
Browse files Browse the repository at this point in the history
Fixes #1, improves #4
  • Loading branch information
robfletcher committed Feb 6, 2012
1 parent b0c2f57 commit a0691bb
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 11 deletions.
2 changes: 1 addition & 1 deletion grails-app/conf/Config.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
// }


grails.project.groupId = appName // change this to alter the default package name and Maven publishing destination
grails.project.groupId = 'co.freeside' // change this to alter the default package name and Maven publishing destination
grails.mime.file.extensions = true // enables the parsing of file extensions from URLs into the request format
grails.mime.use.accept.header = false
grails.mime.types = [ html: ['text/html','application/xhtml+xml'],
Expand Down
2 changes: 1 addition & 1 deletion grails-app/views/_fields/localDate/_input.gsp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<%
def attrs = [name: property, value: value, placeholder: 'yyyy-mm-dd', class: 'span2']
def attrs = [name: property, value: value, placeholder: 'yyyy-mm-dd', size: 10]
if (required) attrs.required = ''
out << joda.dateField(attrs)
%>
2 changes: 1 addition & 1 deletion grails-app/views/_fields/person/email/_input.gsp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div class="input-prepend">
<span class="add-on"><i class="icon-envelope"></i></span>
<%
def attrs = [type: 'email', name: property, value: value, class: 'span4']
def attrs = [type: 'email', name: property, value: value]
if (required) attrs.required = ''
out << g.field(attrs)
%>
Expand Down
4 changes: 2 additions & 2 deletions grails-app/views/layouts/bootstrap.gsp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<meta name="description" content="">
<meta name="author" content="">

<meta name="viewport" content="width=device-width; initial-scale=1.0">
<meta name="viewport" content="initial-scale = 1.0">

<!-- Le HTML5 shim, for IE6-8 support of HTML elements -->
<!--[if lt IE 9]>
Expand Down Expand Up @@ -38,7 +38,7 @@
<span class="icon-bar"></span>
</a>

<a class="brand" href="${createLink(uri: '/')}"><g:meta name="app.name"/></a>
<a class="brand" href="${createLink(uri: '/')}">Grails Twitter Bootstrap</a>

<div class="nav-collapse">
<ul class="nav">
Expand Down
6 changes: 4 additions & 2 deletions src/templates/scaffolding/list.gsp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
<table class="table table-striped">
<thead>
<tr>
<th></th>
<% excludedProps = Event.allEvents.toList() << 'id' << 'version'
allowedNames = domainClass.persistentProperties*.name << 'dateCreated' << 'lastUpdated'
props = domainClass.properties.findAll { allowedNames.contains(it.name) && !excludedProps.contains(it.name) && it.type != null && !Collection.isAssignableFrom(it.type) }
Expand All @@ -55,12 +54,12 @@
<% } else { %>
<g:sortableColumn property="${p.name}" title="\${message(code: '${domainClass.propertyName}.${p.name}.label', default: '${p.naturalName}')}" />
<% } } } %>
<th></th>
</tr>
</thead>
<tbody>
<g:each in="\${${propertyName}List}" var="${propertyName}">
<tr>
<td><g:link action="show" id="\${${propertyName}.id}"><i class="icon-eye-open"></g:link></td>
<% props.eachWithIndex { p, i ->
if (i < 6) {
if (p.type == Boolean || p.type == boolean) { %>
Expand All @@ -70,6 +69,9 @@
<% } else { %>
<td>\${fieldValue(bean: ${propertyName}, field: "${p.name}")}</td>
<% } } } %>
<td class="link">
<g:link action="show" id="\${${propertyName}.id}" class="btn btn-small">Show &raquo;</g:link>
</td>
</tr>
</g:each>
</tbody>
Expand Down
26 changes: 22 additions & 4 deletions web-app/css/scaffolding.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
body {
-webkit-text-size-adjust: none;
}

@media (min-width:980px) {
body {
padding-top: 60px;
Expand All @@ -8,21 +12,35 @@

img#github-ribbon {
position: absolute;
top: 40px;
top: 0;
right: 0;
border: 0;
z-index: 1030; /* no idea where this comes from, lowest value that works */
}

@media (max-width: 980px) {
img#github-ribbon {
top: 50px;
@media (max-width: 768px) {
.navbar .brand {
max-width: 75%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}

.hero-unit {
padding: 20px;
}

#application-status {
display: none;
}
}

/* list pages */

table td.link {
white-space: nowrap;
}

/* error page */

pre.snippet code.line {
Expand Down

0 comments on commit a0691bb

Please sign in to comment.