Mise en page de la vue KANBAN des questions
[OpenERP/faq.git] / views / faq_view.xml
index c9c6339..ae41c49 100644 (file)
@@ -25,6 +25,7 @@
                         <field name="name" invisible="1" />
                         <field name="description" invisible="1" />
                         <field name="questions" invisible="1" />
+                        <field name="question_items" invisible="1" />
                         <t t-name="kanban-box">
                             <div class="oe_kanban_card oe_semantic_html_override oe_resource_details oe_kanban_global_click_edit faq_question_panel">
                                 <div class="oe_dropdown_kanban">
                                 </div>
 
                                 <div t-attf-class="oe_kanban_content faq_question_content">
-                                    <h2><t t-esc="record.name.value" /></h2>
+                                    <h1><t t-esc="record.name.value" /></h1>
 
-                                    <h4>Description</h4>
                                     <t t-esc="record.description.value" />
 
-                                    <h4>Questions</h4>
-                                    <field name="question_items" invisible="1" />
+                                    <h2>Questions :</h2>
+
                                     <ul t-if="record.question_items.value">
                                         <li t-foreach="record.question_items.value" t-as="question" t-att-class="question_parity">
                                             <t t-call="question_template.sub">
                                                 <t t-set="title" t-value="question.name"/>
                                                 <t t-set="id" t-value="question.id"/>
+                                                <t t-set="answers" t-value="question.answer_items"/>
                                             </t>
                                         </li>
                                     </ul>
 
-                                    <p t-if="record.question_items.value == ''">Pas de question pour ce thèmes.</p>
+                                    <p t-if="record.question_items.value == ''">Pas de question pour ce thème.</p>
 
                                 </div>
                             </div>
                         </t>
                         <t t-name="question_template.sub">
                             <p><t t-esc="title"/> (ID : <t t-esc="id"/>)</p>
+                            <ul t-if="answers">
+                                <li t-foreach="answers" t-as="answer" class="bullet">
+                                    <t t-call="answer_template.sub">
+                                        <t t-set="title" t-value="answer.name"/>
+                                        <t t-set="id" t-value="answer.id"/>
+                                    </t>
+                                </li>
+                            </ul>
+                            <ul t-if="answers == ''"><li>Pas de réponse pour cette question.</li></ul>
+                        </t>
+                        <t t-name="answer_template.sub">
+                            <t t-esc="title"/>
                         </t>
+
+
+                        <!-- Exemple sans le template
+                        <t t-name="question_template.sub">
+                            <h4><t t-esc="title"/> (ID : <t t-esc="id"/>)</h4>
+
+                            <ul t-if="answers">
+                                <li t-foreach="answers" t-as="answer" t-att-class="answer_parity">
+                                    <t t-esc="answer.name"/> (ID : <t t-esc="answer.id"/>)
+                                </li>
+                            </ul>
+
+                            <ul t-if="answers == ''"><li>Pas de réponse pour cette question.</li></ul>
+                        </t>-->
                     </templates>
                 </kanban>
             </field>
                                 </div>
 
                                 <div t-attf-class="oe_kanban_content">
-                                    <h2><field name="name" /></h2>
-                                    <h4>Question</h4>
-                                    <field name="description" />
+                                    <h2><field name="name" /> (Thème : <field name="theme_id" />)</h2>
+                                    <h3><field name="description" /></h3>
 
-                                    <h4>Réponses</h4>
+                                    <h4>Réponses :</h4>
                                     <field name="answer_items" invisible="1" />
                                     <ul t-if="record.answer_items.value">
-                                        <li t-foreach="record.answer_items.value" t-as="answer" t-att-class="answer_parity">
+                                        <li t-foreach="record.answer_items.value" t-as="answer"  class="bullet">
                                             <t t-call="answer_template.sub">
                                                 <t t-set="title" t-value="answer.name"/>
                                                 <t t-set="id" t-value="answer.id"/>
                                         </li>
                                     </ul>
 
-                                    <p t-if="record.answer_items.value == ''">Pas de réponse pour l'instant.</p>
-
+                                    <ul t-if="record.answer_items.value == ''"><li>Pas de réponse pour l'instant.</li></ul>
                                 </div>
                             </div>
                         </t>
                         <t t-name="answer_template.sub">
-                            <p><t t-esc="title"/> (ID : <t t-esc="id"/>)</p>
+                            <t t-esc="title"/> (ID : <t t-esc="id"/>)
                         </t>
                     </templates>
                 </kanban>