[imp]:View user flag
authorSunil Sharma <ssh@tinyerp.com>
Mon, 7 Apr 2014 06:22:05 +0000 (11:52 +0530)
committerSunil Sharma <ssh@tinyerp.com>
Mon, 7 Apr 2014 06:22:05 +0000 (11:52 +0530)
bzr revid: ssh@tinyerp.com-20140407062205-cue7qq8c2la62fn7

addons/website_forum/static/src/css/website_forum.css
addons/website_forum/views/website_forum.xml

index ca4ec16..c81ab4f 100644 (file)
@@ -71,3 +71,9 @@
   font: 1.2em "Helvetica Neue", Helvetica, Arial, sans-serif !important;
   height: 1.2em !important;
 }
+
+.forum_user_flag {
+  max-width: 25px;
+  display: inline-block;
+  margin-left: 2px;
+}
\ No newline at end of file
index 75298f5..9a3c087 100644 (file)
                             <span t-if="question.state == 'close'"><b> [Closed]</b></span>
                     </div>
                     <div class="text-muted">
-                        by <a t-attf-href="/forum/#{ slug(forum) }/user/#{ question.user_id.id }" t-field="question.user_id"/>, 
+                        by <a t-attf-href="/forum/#{ slug(forum) }/user/#{ question.user_id.id }" t-field="question.user_id"/>
+                        <t t-if="question.user_id.country_id"> 
+                            <span t-field="question.user_id.country_id.image" t-field-options='{"widget": "image", "class":"forum_user_flag"}'/>
+                        </t>
                         on <span t-field="question.write_date" t-field-options='{"format":"short"}'/>
                         <div t-if="question.vote_count">
                             <strong>with <span t-esc="question.vote_count"/> votes</strong>
                 <span t-field="user.image" t-field-options='{"widget": "image", "class":"pull-left img img-circle img-avatar"}'/>
                 <div>
                     <a t-attf-href="/forum/#{ slug(forum) }/user/#{ slug(user) }" t-field="user.name"/>
-                    <t t-raw="separator or ', '"/>
-                    <t t-esc="user.karma"/>
-                    <b> badges:</b>
-                    <span class="fa fa-circle badge-gold"/>
-                    <t t-esc="user.gold_badge"/>
-                    <span class="fa fa-circle badge-silver"/>
-                    <t t-esc="user.silver_badge"/>
-                    <span class="fa fa-circle badge-bronze"/>
-                    <t t-esc="user.bronze_badge"/>
-                    <br/>
-                    <t t-raw="0"/>
+                    <t t-if="user.country_id">
+                        <span t-field="user.country_id.image" t-field-options='{"widget": "image", "class":"forum_user_flag"}'/>
+                    </t>
+                    <b><t t-esc="user.karma"/></b>
+                    <t t-raw="separator"/>
+                        <div>
+                            <b> badges:</b>
+                            <span class="fa fa-circle badge-gold"/>
+                            <t t-esc="user.gold_badge"/>
+                            <span class="fa fa-circle badge-silver"/>
+                            <t t-esc="user.silver_badge"/>
+                            <span class="fa fa-circle badge-bronze"/>
+                            <t t-esc="user.bronze_badge"/>
+                        </div>
+                        <t t-raw="0"/>
                 </div>
             </div>
         </template>
                                     <li><a class="text-muted fa fa-share" href="">share</a></li>
                                 </ul>
                             </div>
-                            <t t-call="website_forum.user_detail">
-                                <t t-set="user" t-value="question.user_id"/>
-                                <span class="text-muted">Asked on <span t-field="question.write_date" t-field-options='{"format":"short"}'/></span>
-                            </t>
+                            <div>
+                                <t t-call="website_forum.user_detail">
+                                    <t t-set="user" t-value="question.user_id"/>
+                                    <span class="text-muted">Asked on <span t-field="question.write_date" t-field-options='{"format":"short"}'/></span>
+                                </t>
+                            </div>
                             <div class="alert alert-info" t-if="question.state == 'close'">
                                 <p class="mt32 mb32 text-center">
                                     <b>The question has been closed for the following reason "<span t-field="question.reason_id.name"/>"
                                 <span t-field="user.city"/>
                                 <span t-if="user.city and user.country_id">, </span>
                                 <span t-field="user.country_id"/>
+                                <t t-if="user.country_id"> <span t-field="user.country_id.image" t-field-options='{"widget": "image", "class":"forum_user_flag"}'/></t>
+                                
                             </td>
                         </tr>
                         <tr>