Changeset 932


Ignore:
Timestamp:
May 19, 2011, 1:38:23 AM (13 years ago)
Author:
gav
Message:

Configure demo mode.

Location:
trunk
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/conf/BootStrap.groovy

    r913 r932  
     1import org.codehaus.groovy.grails.commons.ConfigurationHolder as CH
     2
    13class BootStrap
    24{
     
    1517                createDataService.ensureSystemAndAdminAccess()
    1618                createDataService.createBaseData()
     19                CH.config.demoMode.enabled = true
    1720                createDataService.createDemoData()
    1821                createDataService.startSearchableIndex()
     
    2831                createDataService.ensureSystemAndAdminAccess()
    2932                createDataService.createBaseData()
     33                if(CH.config.demoMode.enabled) createDataService.createDemoData()
    3034                createDataService.startSearchableIndex()
    3135            }
  • trunk/grails-app/taglib/CustomTagLib.groovy

    r918 r932  
    174174//             def messageSource = grailsAttributes.getApplicationContext().getBean("messageSource")
    175175//             def locale = RCU.getLocale(request)
    176 // 
     176//
    177177//             title = messageSource.getMessage(titleKey, null, title, locale)
    178178//         }
     
    374374
    375375    /**
     376     * Returns the correct headerId for the main header div.
     377     */
     378    def headerId = { attrs, body ->
     379        def headerId = ''
     380        if(grails.util.Environment.isDevelopmentMode()) headerId = 'HeaderDev'
     381        else if(grailsApplication.config.demoMode.enabled) headerId = 'HeaderDemo'
     382        else headerId = 'Header'
     383        out << headerId
     384    }
     385
     386    /**
    376387    * Determine if a supplied string is considered a url or not.
    377388    * The scheme/protocol can be adjusted, file:// has been excluded here.
  • trunk/grails-app/views/layouts/main.gsp

    r850 r932  
    3434                    <g:message code="ajax.default.could.not.perform.operation" />
    3535                </div>
    36                 <g:if env="production">
    37                     <div id="Header">
    38                         <a href="javascript: openWindow('http://www.gnumims.org')" id=HeaderLink></a>
    39                     </div>
    40                 </g:if>
    41                 <g:else>
    42                     <div id="HeaderDev">
    43                         <a href="javascript: openWindow('http://www.gnumims.org')" id=HeaderLink></a>
    44                     </div>
    45                 </g:else>
     36                <div id="${custom.headerId()}">
     37                    <a href="javascript: openWindow('http://www.gnumims.org')" id=HeaderLink></a>
     38                </div>
    4639
    4740                <g:isLoggedIn>
  • trunk/grails-app/views/login/auth.gsp

    r221 r932  
    7272        <h1>Welcome to gnuMims please log in</h1>
    7373
    74         <g:if env="development">
     74        <g:if test="${grailsApplication.config.demoMode.enabled}">
    7575        The demo users are <b>user</b>, <b>manager</b> and  <b>admin</b> all having the password: <b>pass</b>
    7676        </g:if>
     
    8585                    <label for='j_username'>Login ID</label>
    8686
    87                     <g:if env="production">
    88                         <input type='text' class='text_' name='j_username' id='j_username'/>
     87                    <g:if test="${grailsApplication.config.demoMode.enabled}">
     88                        <input type='text' class='text_' name='j_username' id='j_username' value='manager'  />
    8989                    </g:if>
    9090                    <g:else >
    91                         <input type='text' class='text_' name='j_username' id='j_username' value='manager'  />
     91                        <input type='text' class='text_' name='j_username' id='j_username'/>
    9292                    </g:else >
    9393
     
    9696                    <label for='j_password'>Password</label>
    9797
    98                     <g:if env="production">
    99                         <input type='password' class='text_' name='j_password' id='j_password' />
     98                    <g:if test="${grailsApplication.config.demoMode.enabled}">
     99                        <input type='password' class='text_' name='j_password' id='j_password' value="pass" />
    100100                    </g:if>
    101101                    <g:else >
    102                         <input type='password' class='text_' name='j_password' id='j_password' value="pass" />
     102                        <input type='password' class='text_' name='j_password' id='j_password' />
    103103                    </g:else >
    104104                </p>
  • trunk/web-app/css/main.css

    r882 r932  
    7676  height: 136px;
    7777}
     78#HeaderDemo {
     79  background: transparent url("../images/logoOnlineDemo.png") no-repeat scroll center;
     80  width: 980px;
     81  height: 136px;
     82}
    7883#HeaderLink{
    7984  display: block;
     
    693698.subnavigation li a:hover {
    694699    /*color: red;*/
    695     /*border-color: black;*/ 
     700    /*border-color: black;*/
    696701    border-width: 1px 0;
    697702}
Note: See TracChangeset for help on using the changeset viewer.