diff options
| author | Jérome Maes <jem@openerp.com> | 2017-08-17 09:38:16 +0200 |
|---|---|---|
| committer | jem-odoo <jem@openerp.com> | 2017-12-12 14:06:29 +0100 |
| commit | d7d30f69d78e75cb859ec6b5e70b91d78c6e4eaf (patch) | |
| tree | 11e537f68c4f71e7afd82cfb9ddccebea9e971da /addons/project/static/src | |
| parent | 93adbdbb208a29b0a61b97a502bbbadb16e8e60a (diff) | |
[REM] website_rating_project: move feature in project
Displaying the rating of project is moved directly
in project module, since it does not depends on website.
User may want to display rating of its support project
even without website.
Diffstat (limited to 'addons/project/static/src')
| -rw-r--r-- | addons/project/static/src/js/portal_rating.js | 27 | ||||
| -rw-r--r-- | addons/project/static/src/less/portal_rating.less | 34 |
2 files changed, 61 insertions, 0 deletions
diff --git a/addons/project/static/src/js/portal_rating.js b/addons/project/static/src/js/portal_rating.js new file mode 100644 index 00000000000..12740b9bbba --- /dev/null +++ b/addons/project/static/src/js/portal_rating.js @@ -0,0 +1,27 @@ +odoo.define('website_rating_project.rating', function (require) { +'use strict'; + + var time = require('web.time'); + require('web.dom_ready'); + + if(!$('.o_portal_project_rating').length) { + return $.Deferred().reject("DOM doesn't contain '.o_portal_project_rating'"); + } + + /** + * Rating popover with some informations + */ + $('.o_portal_project_rating .o_rating_image').popover({ + placement: 'bottom', + trigger: 'hover', + html: 'true', + content: function () { + var id = $(this).data('id'); + var rating_date = $(this).data('rating-date'); + var base_date = time.auto_str_to_date(rating_date); + var duration = moment(base_date).fromNow(); + $("#rating_"+ id).find(".rating_timeduration").text(duration); + return $("#rating_"+ id).html(); + } + }); +}); diff --git a/addons/project/static/src/less/portal_rating.less b/addons/project/static/src/less/portal_rating.less new file mode 100644 index 00000000000..4ae3290a75b --- /dev/null +++ b/addons/project/static/src/less/portal_rating.less @@ -0,0 +1,34 @@ +.o_portal_project_rating { + .thumbnail{ + height: 240px; + } + .o_top_partner_rating_image { + height: 15px; + } + .o_top_partner_image { + height: 30px; + width: 30px; + } + .o_top_partner_feedback{ + word-wrap: break-word; + } + .o_vertical_separator { + border-left: 1px solid #eeeeee + } + .o_rating_progress { + margin-bottom: 10px; + } + .o_rating_count { + display: inline-block; + min-width: 22px + } + .o_smiley_no_padding_left { + padding-left: 0; + } + .o_smiley_no_padding_right { + padding-right: 0; + } + .o_lighter_smileys { + opacity: 0.4 + } +}
\ No newline at end of file |
