[IMP] web, *: fix favorite alignment

*: account, hr_recruitment, project, lunch, mrp

By removing the absolute positioning on ".o_favorite" inside kanban
views, we allow it to align naturally with the rest of the elements,
thus removing the custom code that was needed for padding.

By doing so however the icon - which is now only visible on hovering the
card in the Project's kanban view - should remain visible at all times.
The behaviour would be the same as in other kanban views: an outlined
star when not active and a full yellow star when it is.

The margin on the kanban heading in the Manufacturing orders has been
removed to realign the top elements.

task-3462098

closes odoo/odoo#131559

Signed-off-by: Pierre Paridans (app) <app@odoo.com>
This commit is contained in:
Elisabeth Dickinson
2023-11-02 12:03:40 +00:00
parent 7094215e65
commit 89082fbd56
6 changed files with 10 additions and 42 deletions
@@ -206,9 +206,7 @@
</div>
<div groups="account.group_account_manager" class="row o_kanban_card_manage_settings">
<div class="col-6 position-relative mt-n2">
<field name="show_on_dashboard" widget="boolean_favorite"/>
</div>
<field name="show_on_dashboard" widget="boolean_favorite" class="col-6"/>
<div class="col-6 text-end">
<a class="dropdown-item" t-if="widget.editable" type="edit">Configuration</a>
</div>
+6 -6
View File
@@ -73,19 +73,19 @@
</t>
<t t-name="kanban-box">
<div t-attf-class="#{!selection_mode ? kanban_color(record.color.raw_value) : ''}">
<div class="o_kanban_card_header">
<div class="o_kanban_card_header d-flex align-items-baseline gap-1">
<field name="is_favorite" widget="boolean_favorite" nolabel="1"/>
<div class="o_kanban_card_header_title">
<field name="is_favorite" widget="boolean_favorite" nolabel="1"/>
<div class="o_primary ps-3">
<div class="o_primary">
<span class="o_text_overflow"><t t-esc="record.name.value"/></span>
</div>
<div class="ps-3 text-muted">
<div class="text-muted">
<field name="user_id" />
</div>
<div class="ps-3 o_secondary" groups="base.group_multi_company">
<div class="o_secondary" groups="base.group_multi_company">
<small><i class="fa fa-building-o" role="img" aria-label="Company" title="Company"></i> <field name="company_id"/></small>
</div>
<div t-if="record.alias_email.value" class="ps-3 o_secondary o_job_alias">
<div t-if="record.alias_email.value" class="o_secondary o_job_alias">
<small><i class="fa fa-envelope-o" role="img" aria-label="Alias" title="Alias"></i> <field name="alias_id"/></small>
</div>
</div>
+1 -1
View File
@@ -520,7 +520,7 @@
<div t-attf-class="oe_kanban_card oe_kanban_global_click">
<div class="o_kanban_record_top">
<field name="priority" widget="priority"/>
<div class="o_kanban_record_headings mt4 ms-1">
<div class="o_kanban_record_headings ms-1">
<strong class="o_kanban_record_title"><span><t t-esc="record.product_id.value"/></span></strong>
</div>
<span class="float-end text-end"><t t-esc="record.product_qty.value"/> <small><t t-esc="record.product_uom_id.value"/></small></span>
@@ -22,7 +22,6 @@
&:first-child {
margin: 0 5px 0 0;
padding-left: 12px
}
.o_value {
@@ -56,15 +55,6 @@
top: 15%;
}
}
.o_kanban_record {
div[name="is_favorite"] .fa-star-o {
visibility: hidden;
}
&:hover div[name="is_favorite"] .fa-star-o {
visibility: visible;
}
}
}
.o_dow_widget {
@@ -452,7 +452,8 @@
</t>
<t t-name="kanban-box">
<div t-attf-class="#{kanban_color(record.color.raw_value)} oe_kanban_global_click o_has_icon oe_kanban_content oe_kanban_card">
<div class="o_project_kanban_main ">
<div class="o_project_kanban_main d-flex align-items-baseline gap-1">
<field name="is_favorite" widget="boolean_favorite" nolabel="1" force_save="1"/>
<div class="o_kanban_card_content mw-100">
<div class="o_kanban_primary_left">
<div class="o_primary">
@@ -485,9 +486,6 @@
</div>
</div>
</div>
<span>
<field name="is_favorite" widget="boolean_favorite" nolabel="1" force_save="1" />
</span>
</div>
<div class="o_kanban_record_bottom mt-3">
<div class="oe_kanban_bottom_left">
@@ -27,11 +27,6 @@
// ------- Kanban Record Titles -------
// Uniform design across different HTML layouts
// Provide enough room for the dropdown-toggle
.o_primary {
padding-right: calc(var(--KanbanRecord-padding-h) * 2);
}
// Uniform titles
.o_kanban_card_header_title .o_primary,
.o_kanban_primary_left .o_primary > span:first-child,
@@ -47,11 +42,6 @@
color: $text-muted;
}
// Provide enough room to add an icon before the title
&.o_has_icon .o_primary {
padding-left: $o-kanban-record-margin*1.5;
}
// ------- Kanban Content -------
.o_kanban_card_content {
display: inline-block;
@@ -184,14 +174,6 @@
}
}
.o_favorite {
@include o-position-absolute(
$top: 3px,
$left: calc(var(--KanbanRecord-padding-h) - #{$o-horizontal-padding})
);
padding: $o-kanban-record-margin;
}
}
.o_kanban_dashboard.o_emphasize_colors .o_kanban_renderer {