[IMP] add template of answers and improved code

bzr revid: tpa@tinyerp.com-20140224070206-pxxet6kfgpyftclc
This commit is contained in:
Turkesh Patel (Open ERP) 2014-02-24 12:32:06 +05:30
parent eb36ac6be1
commit 6721db92a6
2 changed files with 94 additions and 134 deletions

View File

@ -69,14 +69,14 @@ class website_forum(http.Controller):
}
return request.website.render(page, values)
# @http.route(['/question/<model("website.forum.post"):question>'], type='http', auth="public", website=True, multilang=True)
# def question_register(self, question, **post):
# values = {
# 'question': question,
# 'main_object': question,
# 'range': range,
# }
# return request.website.render("website_forum.question_description_full", values)
@http.route(['/question/<model("website.forum.post"):question>'], type='http', auth="public", website=True, multilang=True)
def question_register(self, question, **post):
values = {
'question': question,
'main_object': question,
'range': range,
}
return request.website.render("website_forum.question_description_full", values)
@http.route('/question/postquestion/', type='http', auth="user", multilang=True, website=True)
def post_question(self, question_name="New question", **kwargs):

View File

@ -97,6 +97,30 @@
</div>
</template>
<template id="answer">
<div class="row">
<t t-call="website_forum.question_vote" />
<div class="col-md-9 col-xs-10">
<div class="row">
<div class="col-xs-12">
<span>
<h6>
There should be a call to the cash drawers API. Read the
technical
manual of the hardware you are using. Thanks.
</h6>
</span>
</div>
</div>
<div class="row">
<t t-call="website_forum.user_detail" />
</div>
<t t-call="website_forum.question_links" />
<t t-call="website_forum.question_vote" />
</div>
</div>
</template>
<template id="question_search">
<form class="navbar-form " role="search">
<div class="form-group search-navbar">
@ -222,6 +246,7 @@
</template>
<template id="question_vote">
<div class="row">
<div class="col-md-1 col-xs-1">
<div class="row">
<div class="col-xs-12 custom-arrow-height">
@ -241,6 +266,7 @@
</div>
</div>
</div>
</div>
</template>
<template id="question_links">
@ -267,8 +293,9 @@
<t t-call="website.layout">
<t t-call="website_forum.question_search" />
<div class="container MainBody">
<div class="row">
<t t-call="website_forum.question_vote" />
<div class="row">
<div class="col-md-9 col-xs-11">
<div class="row">
@ -286,26 +313,9 @@
<span class="badge">cash</span>
</div>
</div>
</div>
</div>
<hr />
<div class="row">
<div class="col-xs-12">
<span>
<h6>
How to send some signal to cash drawer to open it after
click
print receipt or something similar? I don't know whether
this
depends on cash drawer's driver or not ?
</h6>
</span>
</div>
</div>
<div class="row">
<t t-call="website_forum.user_detail" />
</div>
</div>
</div>
<div class="row">
<div class="col-xs-12 page-header">
<span class="badge">2 Answers</span>
@ -327,63 +337,13 @@
</div>
</div>
<div class="row">
<t t-call="website_forum.question_vote" />
<div class="col-md-9 col-xs-10">
<div class="row">
<div class="col-xs-12">
<span>
<h6>
There should be a call to the cash drawers API. Read the
technical
manual of the hardware you are using. Thanks.
</h6>
</span>
</div>
</div>
<div class="row">
<t t-call="website_forum.user_detail" />
</div>
<t t-call="website_forum.question_links" />
</div>
</div>
<hr />
<ul class="media-list">
<li t-foreach="question.child_ids" t-as="answer" class="media">
<t t-call="website_forum.answer" />
</li>
<t t-call="website_forum.answer" />
</ul>
<div class="row">
<t t-call="website_forum.question_vote" />
</div>
<div class="col-md-9 col-xs-10">
<div class="row">
<div class="col-xs-12">
<span>
<h6>
Usually the cash drawer behaves like a printer in the sense
that it
has a RS232 or USB port. However the cash drawer is
dummy and
only uses the port to receive a signal (positive
voltage)
which causes it to open.
So you only need send any
signal to the RS232 or USB port (like
for insance print the
ascii character "a" to the rs232 port)
and it will open!. I the
old days you could test it from
hyperterminal, I guess nowadays
you will have to make a
javascript app that sends a character
to the rs232 port.
</h6>
</span>
</div>
</div>
<div class="row">
<t t-call="website_forum.user_detail" />
</div>
<t t-call="website_forum.question_links" />
</div>
</div>
</t>
</template>