Statistics
| Revision:

root / web-presentation / trunk / eneraptor-web-presentation / grails-app / controllers / com / eneraptor / presentation / ContentController.groovy @ 86

History | View | Annotate | Download (1 KB)

1 86 alexbesir
package com.eneraptor.presentation
2
3
class ContentController {
4
5
    def index = {
6
7
                redirect(action:'view',params:[page:'about'])
8
        }
9
10
        def view = {
11
12
                if(params.page == 'about') {
13
                        Content toDisplay = Content.findByContentId('about')
14
                        return [content: toDisplay]
15
                } else if(params.page == 'faq') {
16
                        Content toDisplay = Content.findByContentId('faq')
17
                        return [content: toDisplay]
18
                } else if(params.page == 'team') {
19
                        Content toDisplay = Content.findByContentId('team')
20
                        return [content: toDisplay]
21
                } else if(params.page == 'contact') {
22
                        Content toDisplay = Content.findByContentId('contact')
23
                        return [content: toDisplay]
24
                } else {
25
                        Content toDisplay = Content.findByContentId('about')
26
                        return [content: toDisplay]
27
                }
28
29
        }
30
31
        def login = {
32
33
        }
34
35
        def loginDo = {
36
37
                if(params.user == "eneraptor" && params.pass == "MaloTokaVelikoMuzike") {
38
                        session.loggedIn = true;
39
                        redirect(controller:'edit')
40
                } else {
41
                        redirect(action:'view')
42
                }
43
44
        }
45
46
}