summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorThibault Delavallée <tde@odoo.com>2019-02-15 10:20:24 +0000
committerThibault Delavallée <tde@odoo.com>2019-02-15 17:45:55 +0000
commitbd2dae4f6dcf64983dc86b9ef807e1d2f5fb2976 (patch)
treefaa853ae0ad7b8529715f838cfa77151d06a1c97 /addons
parent1bb7b242c00a726bc5186b45dd97b37c4b988328 (diff)
[IMP] website_profile, website_slides: add user ranking and karma on elearning main pages
Purpose of this commit is to improve karma and gamification inclusion in elearning [1]. * remove a border, replaced by a standard hr, in rank template. It allows to reuse it easier as we don't necessarily want that border in other templates using it; Commit linked to task ID 1941250 and PR #31133. [1] task ID 1922159 (landed at 5fa651cb013ac67d7ba592498c4cf2770dec2483)
Diffstat (limited to 'addons')
-rw-r--r--addons/website_profile/static/src/scss/website_profile.scss1
-rw-r--r--addons/website_profile/views/website_profile.xml1
-rw-r--r--addons/website_slides/static/src/scss/website_slides.scss4
-rw-r--r--addons/website_slides/views/website_slides_templates.xml16
-rw-r--r--addons/website_slides/views/website_slides_templates_homepage.xml18
5 files changed, 24 insertions, 16 deletions
diff --git a/addons/website_profile/static/src/scss/website_profile.scss b/addons/website_profile/static/src/scss/website_profile.scss
index c636bd40d92..b45b58a587c 100644
--- a/addons/website_profile/static/src/scss/website_profile.scss
+++ b/addons/website_profile/static/src/scss/website_profile.scss
@@ -127,7 +127,6 @@ $bronze: #eea91e;
height: 128px;
}
}
- border-bottom: 1px solid lightgray;
.o_wprofile_next_rank_progress {
background-color: lightgray;
.o_wprofile_next_rank_progress_bar {
diff --git a/addons/website_profile/views/website_profile.xml b/addons/website_profile/views/website_profile.xml
index 471cbe6a3f8..2a4752c2830 100644
--- a/addons/website_profile/views/website_profile.xml
+++ b/addons/website_profile/views/website_profile.xml
@@ -181,6 +181,7 @@
<th><span class="float-right" t-field="user.rank_id"/></th>
</tr></tbody></table>
<t t-call="website_profile.profile_next_rank_card"></t>
+ <hr/>
</div>
</div>
</t>
diff --git a/addons/website_slides/static/src/scss/website_slides.scss b/addons/website_slides/static/src/scss/website_slides.scss
index feb6acd6ffb..75dd02662e4 100644
--- a/addons/website_slides/static/src/scss/website_slides.scss
+++ b/addons/website_slides/static/src/scss/website_slides.scss
@@ -149,6 +149,10 @@ div .o_wslides_home_main {
background: linear-gradient(150deg, #875A7B 20%, #62495B 80%) !important;
opacity: 0.95;
+ a {
+ color: #FFFFFF;
+ }
+
nav {
.breadcrumb-item::before {
font-weight: bold;
diff --git a/addons/website_slides/views/website_slides_templates.xml b/addons/website_slides/views/website_slides_templates.xml
index abb22345538..e06e75d0b66 100644
--- a/addons/website_slides/views/website_slides_templates.xml
+++ b/addons/website_slides/views/website_slides_templates.xml
@@ -52,15 +52,11 @@
</li>
</ol>
</nav>
- <div class="col-4 d-flex flex-row">
- <!-- karma -->
-<!-- <ul class="navbar-nav ml-auto float-right pt-2">
- <li class="nav-item">
- <a t-attf-href="/profile/user/#{user.id}?channel_id=#{channel.id}" t-attf-class="text-dark font-weight-bold nav-link}">
- <i class="fa fa-diamond text-secondary" /> <t t-esc="user_id.karma"/>
- </a>
- </li>
- </ul> -->
+ <div class="col-6 d-flex flex-row align-items-center">
+ <!-- karma / profile -->
+ <a t-if="not is_public_user" t-att-href="'/profile/user/%s?channel_id=%s' % (user.id, channel.id)" class="font-weight-bold mr-3">
+ <i class="fa fa-diamond" /> <t t-esc="user_id.karma"/>
+ </a>
<!-- search -->
<form t-attf-action="/slides/#{slug(channel)}" role="search" method="get">
<div class="input-group">
@@ -73,7 +69,7 @@
</div>
</form>
<!-- sort / filter -->
- <small class="dropdown float-right ml-2">
+ <small class="dropdown float-right ml-3">
<h6 class="m-0">
<button class="btn btn-primary dropdown-toggle" type="button" id="slidesChannelDropdownSort"
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
diff --git a/addons/website_slides/views/website_slides_templates_homepage.xml b/addons/website_slides/views/website_slides_templates_homepage.xml
index cafcc9aa71a..4364b486987 100644
--- a/addons/website_slides/views/website_slides_templates_homepage.xml
+++ b/addons/website_slides/views/website_slides_templates_homepage.xml
@@ -142,6 +142,11 @@
</li>
</t>
</ul>
+ <!-- karma / profile -->
+ <a t-if="not is_public_user" t-att-href="'/profile/user/%s' % user.id" class="font-weight-bold mr-3">
+ <i class="fa fa-diamond"/> <t t-esc="user_id.karma"/>
+ </a>
+ <!-- search box -->
<form method="GET" class="form-inline justify-content-center">
<div class="input-group">
<input type="search" name="search" class="form-control"
@@ -366,15 +371,18 @@
<template id='slides_home_user_profile_small' name="User Profile">
<div class="o_wslides_home_aside">
<div class="row mt16 o_wslides_home_aside_title align-items-center">
- <div class="col">
+ <div class="col-12">
<t t-call="website_slides.slides_misc_user_image"/>
- <a t-att-href="'/slides'" class="float-right">Edit</a>
+ <a t-att-href="'/profile/user/%s' % user.id" class="float-right">Edit</a>
<h4 t-esc="user.name" class="font-weight-bold"/>
<hr/>
</div>
- </div>
- <div class="row mt8">
- <p class="col">INSERT DBE TEMPLATE HERE</p>
+ <div class="col-12 mt8">
+ <span class="font-weight-bold text-muted">Current rank:</span>
+ <a href="/profile/ranks" class="float-right" t-field="user.rank_id"/>
+ <t t-call="website_profile.profile_next_rank_card"/>
+ <div t-field="user.next_rank_id.description_motivational"/>
+ </div>
</div>
</div>
</template>