Skip to content

Instantly share code, notes, and snippets.

@spundun
Forked from raymyers/index.haml
Last active December 20, 2015 12:49
Show Gist options
  • Save spundun/6133637 to your computer and use it in GitHub Desktop.
Save spundun/6133637 to your computer and use it in GitHub Desktop.
This gist replicates Grails 2.2.2 boilerplate index.gsp main.gsp and error.gsp into Haml code.
!!! 5
%html
%head
%title
%g:if(env="development")
Grails Runtime Exception
%meta(name="layout" content="main")
%g:if(env="development")
%link(rel="stylesheet" href="${resource(dir: 'css', file: 'errors.css')}" type="text/css")
%body
%g:if(env="development")
%g:renderException(exception="${exception}") /
%g:else
%ul.errors
%li An error has occurred
!!! 5
%html
%head
%title Welcome to Grails
%meta(name="layout" content="main")
:css
#status {
background-color: #eee;
border: .2em solid #fff;
margin: 2em 2em 1em;
padding: 1em;
width: 12em;
float: left;
-moz-box-shadow: 0px 0px 1.25em #ccc;
-webkit-box-shadow: 0px 0px 1.25em #ccc;
box-shadow: 0px 0px 1.25em #ccc;
-moz-border-radius: 0.6em;
-webkit-border-radius: 0.6em;
border-radius: 0.6em;
}
.ie6 #status {
display: inline;
/* float double margin fix http://www.positioniseverything.net/explorer/doubled-margin.html */
}
#status ul {
font-size: 0.9em;
list-style-type: none;
margin-bottom: 0.6em;
padding: 0;
}
#status li {
line-height: 1.3;
}
#status h1 {
text-transform: uppercase;
font-size: 1.1em;
margin: 0 0 0.3em;
}
#page-body {
margin: 2em 1em 1.25em 18em;
}
h2 {
margin-top: 1em;
margin-bottom: 0.3em;
font-size: 1em;
}
p {
line-height: 1.5;
margin: 0.25em 0;
}
#controller-list ul {
list-style-position: inside;
}
#controller-list li {
line-height: 1.3;
list-style-position: inside;
margin: 0.25em 0;
}
@media screen and (max-width: 480px) {
#status {
display: none;
}
#page-body {
margin: 0 1em 1em;
}
#page-body h1 {
margin-top: 0;
}
}
%body
%a(href="#page-body" class="skip")
%g:message(code="default.link.skip.label", default="Skip to content…")
#status(role="complementary")
%h1 Application Status
%ul
%li
App version:
%g:meta(name="app.version")
%li
Grails version:
%g:meta(name="app.grails.version")
%li
Groovy version:
${GroovySystem.getVersion()}
%li
JVM version:
${System.getProperty('java.version')}
%li
Reloading active:
${grails.util.Environment.reloadingAgentEnabled}
%li
Controllers:
${grailsApplication.controllerClasses.size()}
%li
Domains:
${grailsApplication.domainClasses.size()}
%li
Services:
${grailsApplication.serviceClasses.size()}
%li
Tag Libraries:
${grailsApplication.tagLibClasses.size()}
%h1 Installed Plugins
%ul
%g:set(var="pluginManager" value="${applicationContext.getBean('pluginManager')}")
%g:each(var="plugin" in="${pluginManager.allPlugins}")
%li ${plugin.name} - ${plugin.version}
#page-body(role="main")
%h1 Welcome to Grails
%p
Congratulations, you have successfully started your first Grails application! At the moment
this is the default page, feel free to modify it to either redirect to a controller or display whatever
content you may choose. Below is a list of controllers that are currently deployed in this application,
click on each to execute its default action:
#controller-list(role="navigation")
%h2 Available Controllers:
%ul
%g:each(var="c" in="${grailsApplication.controllerClasses}")
%li.controller
%g:link(controller="${c.logicalPropertyName}") ${c.fullName}
!!! 5
/[if lt IE 7 ] <html lang="en" class="no-js ie6">
/[if IE 7 ]> <html lang="en" class="no-js ie7">
/[if IE 8 ]> <html lang="en" class="no-js ie8">
/[if IE 9 ]> <html lang="en" class="no-js ie9">
:plain
<!--[if (gt IE 9)|!(IE)]><!-->
%html(lang="en", class="no-js")
:plain
<!--<![endif]-->
%head
%meta(http-equiv="Content-type" content="text/html; charset=UTF-8")
%meta(http-equiv="X-UA-Compatible" content="IE=edge,chrome=1")
%title
%g:layoutTitle(default="Grails")
%meta(name="viewport" content="width=device-width, initial-scale=1.0")
%link(rel="shortcut icon" href="${resource(dir:'images',file:'favicon.ico')}" type="image/x-icon")
%link(rel="apple-touch-icon" href="${resource(dir:'images',file:'apple-touch-icon.png')}")
%link(rel="apple-touch-icon" sizes="114x114" href="${resource(dir:'images',file:'apple-touch-icon-retina.png')}")
%link(rel="stylesheet" href="${resource(dir:'css',file:'main.css')}" type="text/css")
%link(rel="stylesheet" href="${resource(dir:'css',file:'mobile.css')}" type="text/css")
%g:layoutHead
%r:layoutResources
%body
#grailsLogo(role="banner")
%a(href="http://grails.org")
%img(src="${resource(dir:'images',file:'grails_logo.png')}" alt="Grails")/
%g:layoutBody/
.footer(role="contentinfo")
#spinner.spinner(style="display:none;")
%g:message(code="spinner.alt" default="Loading&hellip;")
%g:javascript(library="application")/
%r:layoutResources/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment