fix: remove reviews label on disabling energy points settings

This commit is contained in:
Mangesh-Khairnar 2020-05-08 12:30:52 +05:30
parent c59418cadb
commit bae02075d6
4 changed files with 11 additions and 6 deletions

View file

@ -16,7 +16,7 @@ frappe.ui.form.ControlRating = frappe.ui.form.ControlInt.extend({
$(this.input_area).find('i').hover((ev) => {
const el = $(ev.currentTarget);
let star_value = el.data('rating');
el.parent().children('i.fa').each( function(e){
el.parent().children('i.fa').each( function(e) {
if (e < star_value) {
$(this).addClass('star-hover');
} else {

View file

@ -21,6 +21,12 @@ frappe.ui.form.Review = class Review {
});
}
make_review_container() {
this.parent.append(`
<ul class="list-unstyled sidebar-menu">
<li class="h6 reviews-label">${__('Reviews')}</li>
<li class="review-list"></li>
</ul>
`);
this.review_list_wrapper = this.parent.find('.review-list');
}
add_review_button() {

View file

@ -69,10 +69,7 @@
<div class="clearfix"></div>
</li>
</ul>
<ul class="list-unstyled sidebar-menu form-reviews">
<li class="h6 attachments-label">{%= __("Reviews") %}</li>
<li class="review-list"></li>
</ul>
<span class="form-reviews"></span>
<ul class="list-unstyled sidebar-menu">
<li class="h6 shared-with-label">{%= __("Shared With") %}</li>
<li class="form-shared"></li>

View file

@ -3,7 +3,9 @@
frappe.ui.form.on('Energy Point Settings', {
refresh: function(frm) {
frm.add_custom_button(__('Give Review Points'), show_review_points_dialog);
if (frm.doc.enabled) {
frm.add_custom_button(__('Give Review Points'), show_review_points_dialog);
}
}
});