Skip to content

Commit 2831d92

Browse files
committed
[IMP] kicker: add views skeleton
1 parent fd93b92 commit 2831d92

File tree

4 files changed

+39
-4
lines changed

4 files changed

+39
-4
lines changed

kicker/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
from . import controllers
1+
from . import controllers

kicker/__manifest__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
{
23
'name': 'Kicker App',
34
'version': '1.0',
@@ -6,4 +7,7 @@
67
'summary': 'Kicker in the Lunch Room',
78
'website': 'https://kicker.odoo.com',
89
'depends': ['http_routing'],
10+
'data': [
11+
'views/kicker_templates.xml',
12+
]
913
}

kicker/controllers/kicker.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
from odoo import http
22

3-
class KickerAPI(http.Controller):
43

5-
@http.route(['/free'], type='http', auth="none")
4+
class KickerController(http.Controller):
5+
6+
@http.route(['/free'], type='http', auth="public")
67
def is_the_kicker_free(self):
7-
return '1'
8+
return request.render('kicker.page_is_free', {})

kicker/views/kicker_templates.xml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<odoo>
3+
4+
<template id="layout" name="Web layout">&lt;!DOCTYPE html&gt;
5+
<html>
6+
<head>
7+
<meta charset="utf-8"/>
8+
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
9+
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no"/>
10+
11+
<title t-esc="title or 'Odoo'"/>
12+
<link type="image/x-icon" rel="shortcut icon" t-att-href="x_icon or '/web/static/src/img/favicon.ico'"/>
13+
14+
<t t-raw="head or ''"/>
15+
</head>
16+
<body t-att-class="body_classname">
17+
<t t-raw="0"/>
18+
</body>
19+
</html>
20+
</template>
21+
22+
<template id="page_is_free" name="Login Layout">
23+
<t t-call="web.layout">
24+
<div>
25+
<p>TODO: display yes or no</p>
26+
</div>
27+
</t>
28+
</template>
29+
30+
</odoo>

0 commit comments

Comments
 (0)