[IMP] less css rules, cleaned sass
authorFabien Pinckaers <fp@tinyerp.com>
Sun, 9 Mar 2014 08:45:52 +0000 (09:45 +0100)
committerFabien Pinckaers <fp@tinyerp.com>
Sun, 9 Mar 2014 08:45:52 +0000 (09:45 +0100)
bzr revid: fp@tinyerp.com-20140309084552-av4897d8ixxwtfgx

addons/website_forum/controllers/main.py
addons/website_forum/static/src/css/website_forum.css
addons/website_forum/static/src/css/website_forum.sass
addons/website_forum/views/website_forum.xml

index 8630483..50af7e8 100644 (file)
@@ -42,12 +42,8 @@ class website_forum(http.Controller):
         cr, uid, context = request.cr, request.uid, request.context
         Forum = request.registry['website.forum']
         obj_ids = Forum.search(cr, uid, [], context=context)
-        forum_ids = Forum.browse(cr, uid, obj_ids, context=context)
-
-        values = {
-            'forum_ids': forum_ids,
-            'searches': {},
-        }
+        forums = Forum.browse(cr, uid, obj_ids, context=context)
+        values = { 'forums': forums }
         return request.website.render("website_forum.forum_index", values)
 
     @http.route(['/forum/<model("website.forum"):forum>/view'], type='http', auth="public", website=True, multilang=True)
index ef24e46..26fee8e 100644 (file)
   margin-right: 10px;
 }
 
-.forum_button {
-  background-color : #df3f3f;
-  color: white !important;
-  margin-top: 10px;
-  margin-bottom: 10px;
-}
-
 .badge-gold {
-  color: #FFCC00
+  color: #ffcc00;
 }
 
 .badge-silver {
-  color: #CCCCCC
+  color: #cccccc;
 }
 
 .badge-bronze {
-  color: #EEA91E
-}
-
-.speech-bubble {
-  position: relative;
-  background-color: #428bca;
-  width: 200px;
-  line-height: 150px;  
-  color: white;
-  text-align: center;
-  border-radius: 25px;
-}
-.speech-bubble-bottom:after {
-  content: '';
-  position: absolute;
-  border: 15px solid;
-  border-top-color: #428bca;
-  top: 100%;
-  left: 70%;
+  color: #eea91e;
 }
index 0f6df87..c1be33b 100644 (file)
     max-width: 50px
     margin-right: 10px
 
+.badge-gold
+    color: #FFCC00
+
+.badge-silver
+    color: #CCCCCC
+
+.badge-bronze
+    color: #EEA91E
index fa26394..ee97f8f 100644 (file)
 
         <template id="forum_index">
             <t t-call="website.layout">
-                <!--TODO: Improve template -->
-                <t t-set="head">
-                    <link rel='stylesheet' href='/website_forum/static/src/css/website_forum.css' />
-                </t>
                 <div class="container">
-                    <t t-foreach="forum_ids" t-as="forum">
-                        <div class="speech-bubble speech-bubble-bottom mt32 mb32 pull-left" style="margin-left:30px">
-                            <a style="color:white" t-attf-href="/forum/#{ slug(forum) }" t-field="forum.name"/>
+                    <h1 class="mb32">Our forums</h1>
+                    <div class="row">
+                        <div t-foreach="forums" t-as="forum" class="col-sm-3 text-center mb32">
+                            <a t-attf-href="/forum/#{ slug(forum) }">
+                                <div class="fa fa-5x fa-comment mb16"/>
+                                <div t-field="forum.name"/>
+                            </a>
                         </div>
-                    </t>
+                    </div>
                 </div>
-                <!--t t-call="website_forum.faq">
-                    <div t-field="forum.faq"/>
-                </t-->
             </t>
         </template>
 
                         t-attf-value="#{question_content or ''}" id="textarea_ckeditor"/>
                     <input type="text" name="question_tag" t-attf-value="#{question_tag or ''}"
                         class="form-control" style="margin-top: 10px" placeholder="Tags"/>
-                    <button class="btn btn-default forum_button" id="btn_ask_your_question"> Post Your Question </button>
+                    <button class="btn btn-primary" id="btn_ask_your_question">Post Your Question</button>
                 </form>
                 <script type="text/javascript">
                     CKEDITOR.replace("textarea_ckeditor");
                 <textarea name="answer_content" t-attf-value="#{answer_content or ''}"
                     class="form-control" id="textarea_ckeditor" required="True"/>
                 <input name="post_id" t-att-value="question.id" type="hidden"/>
-                <button class="btn btn-default forum_button" id="btn_ask_your_question"> Post Your Answer </button>
+                <button class="btn btn-primary" id="btn_ask_your_question">Post Your Answer</button>
             </form>
             <script type="text/javascript">
                 CKEDITOR.replace("textarea_ckeditor");
                     <textarea name="answer_content" required="True" value="content" class="form-control" id="textarea_ckeditor"/>
                     <input name="post_id" t-att-value="post.id" type="hidden"/>
                     <input name="answer_id" t-att-value="post_answer.id" type="hidden"/>
-                    <button class="btn btn-default btn-lg forum_button"> Save edit </button>
+                    <button class="btn btn-primary btn-lg">Save</button>
                 </form>
                 <script type="text/javascript">
                     CKEDITOR.replace("textarea_ckeditor");
         <template id="comments">
             <div class="row clearfix">
                 <div class="col-sm-10 col-sm-offset-2">
-                    <div t-foreach="object.website_message_ids" t-as="message">
+                    <div t-foreach="object.website_message_ids" t-as="message" class="oe_grey">
                         <small class="text-muted">
                             <div t-field="message.body"/>
                             <a t-attf-href="/forum/#{ slug(forum) }/user/#{ message.author_id.id }" t-field="message.author_id"/>