From: Fabien Pinckaers Date: Tue, 2 Dec 2014 12:47:31 +0000 (+0100) Subject: [IMP] Layout of forum X-Git-Url: http://git.inspyration.org/?p=odoo%2Fodoo.git;a=commitdiff_plain;h=1f0171f8c58ec603febb728eeb2a7077239703a3 [IMP] Layout of forum --- diff --git a/addons/website_forum/models/forum.py b/addons/website_forum/models/forum.py index 1d5bdee..aacc235 100644 --- a/addons/website_forum/models/forum.py +++ b/addons/website_forum/models/forum.py @@ -216,9 +216,14 @@ class Post(models.Model): post.is_self_reply = post in self_replies @api.one - @api.depends('child_ids') + @api.depends('child_ids', 'website_message_ids') def _get_child_count(self): - self.child_count = len(self.child_ids) + def process(node): + total = len(node.website_message_ids) + len(node.child_ids) + for child in node.child_ids: + total += process(child) + return total + self.child_count = process(self) @api.one def _get_uid_has_answered(self): diff --git a/addons/website_forum/static/src/css/website_forum.css b/addons/website_forum/static/src/css/website_forum.css index 1e85705..4d64309 100644 --- a/addons/website_forum/static/src/css/website_forum.css +++ b/addons/website_forum/static/src/css/website_forum.css @@ -1,129 +1,106 @@ -.box { - padding-left: 8px; - padding-right: 8px; - margin-left: 4px; - margin-right: 4px; - border-radius: 4px; - min-width: 80px; -} -.box span { - font-size: 200%; - font-weight: bold; -} -.box div.subtitle { - margin-top: -4px; -} +.vote { + min-width: 38px; + margin-right: 12px; } + .vote .vote_count { + font-size: 160%; + font-weight: bold; + line-height: 12px; } + .vote .vote-up, .vote .vote-down { + font-size: 130%; } + +.author-box { + min-width: 200px; + padding: 4px; + background-color: whitesmoke; } + +.question-block { + margin-left: 50px; } .question .question-name { - font-size: 150%; -} + font-size: 150%; } .question .badge { background-color: #cccccc; - margin-left: 4px; -} + margin-left: 4px; } .question .badge-active { - background-color: #428bca; -} + background-color: #428bca; } .question img { max-width: 600px; - height: auto !important; -} + height: auto !important; } .forum_answer img { max-width: 600px; - height: auto !important; -} + height: auto !important; } img.img-avatar { - max-width: 50px; - margin-right: 10px; -} + max-height: 40px; + margin-right: 10px; } .oe_grey { - background-color: #eeeeee; -} + background-color: #eeeeee; } .badge-gold { - color: #ffcc00; -} + color: #ffcc00; } .badge-silver { - color: #cccccc; -} + color: #cccccc; } .badge-bronze { - color: #eea91e; -} + color: #eea91e; } .oe_answer_true { - color: #3c763d; -} + color: #3c763d; } .oe_answer_false { - color: #bbbbbb; -} + color: #bbbbbb; } .favourite_question { - color: #bbbbbb !important; -} + color: #bbbbbb !important; } .forum_favourite_question { - color: #ffcc00 !important; -} + color: #ffcc00 !important; } .load_tags { - width: 845px !important; -} + width: 845px !important; } a.no-decoration { cursor: pointer; - text-decoration: none !important; -} + text-decoration: none !important; } .faq-question:hover { text-decoration: none !important; - color: #428bca; -} + color: #428bca; } .oe_comment_grey { background-color: whitesmoke; - padding: 4px; -} + padding: 4px; } .close.comment_delete { - font-size: 16px; -} + font-size: 16px; } .country_flag { max-height: 16px; display: inline-block; - margin-left: 2px; -} + margin-left: 2px; } .tag_text .text-core .text-wrap textarea, .tag_text .text-core .text-wrap input, .tag_text .text-core .text-wrap .text-dropdown, .tag_text .text-core .text-wrap .text-prompt { - font: 1.2em "Helvetica Neue", Helvetica, Arial, sans-serif !important; -} + font: 1.2em "Helvetica Neue", Helvetica, Arial, sans-serif !important; } .tag_text .text-core .text-wrap .text-tags .text-tag .text-button { font: 1.2em "Helvetica Neue", Helvetica, Arial, sans-serif !important; - height: 1.2em !important; -} + height: 1.2em !important; } .oe_forum_alert { position: absolute; margin-top: -30px; margin-left: 90px; width: 300px; - z-index: 9999; -} + z-index: 9999; } .oe_forum_email_required { position: absolute; margin-top: 155px; margin-left: 500px; margin-right: 100px; - z-index: 5; -} + z-index: 5; } button.btn-link.text-muted { - color: #999999; -} + color: #999999; } diff --git a/addons/website_forum/static/src/css/website_forum.sass b/addons/website_forum/static/src/css/website_forum.sass index 983b018..999c66d 100644 --- a/addons/website_forum/static/src/css/website_forum.sass +++ b/addons/website_forum/static/src/css/website_forum.sass @@ -1,15 +1,20 @@ -.box - padding-left: 8px - padding-right: 8px - margin-left: 4px - margin-right: 4px - border-radius: 4px - min-width: 80px - span - font-size: 200% +.vote + min-width: 38px + margin-right: 12px + .vote_count + font-size: 160% font-weight: bold - div.subtitle - margin-top: -4px + line-height: 12px + .vote-up,.vote-down + font-size: 130% + +.author-box + min-width: 200px + padding: 4px + background-color: #f5f5f5 + +.question-block + margin-left: 50px .question .question-name @@ -29,10 +34,9 @@ height: auto !important img.img-avatar - max-width: 50px + max-height: 40px margin-right: 10px - .oe_grey background-color: #eeeeee diff --git a/addons/website_forum/views/website_forum.xml b/addons/website_forum/views/website_forum.xml index d893613..12c89e6 100644 --- a/addons/website_forum/views/website_forum.xml +++ b/addons/website_forum/views/website_forum.xml @@ -102,7 +102,7 @@
-