mirror of
https://github.com/bringout/oca-ocb-hr.git
synced 2026-04-24 19:12:06 +02:00
19.0 vanilla
This commit is contained in:
parent
a1137a1456
commit
e1d89e11e3
2789 changed files with 1093187 additions and 605897 deletions
|
|
@ -1,10 +1,14 @@
|
|||
/** @odoo-module */
|
||||
|
||||
import { registry } from '@web/core/registry';
|
||||
|
||||
import { ImageField } from '@web/views/fields/image/image_field';
|
||||
import { ImageField, imageField } from '@web/views/fields/image/image_field';
|
||||
|
||||
export class BackgroundImageField extends ImageField {}
|
||||
BackgroundImageField.template = 'hr.BackgroundImage';
|
||||
export class BackgroundImageField extends ImageField {
|
||||
static template = "hr.BackgroundImage";
|
||||
}
|
||||
|
||||
registry.category("fields").add("background_image", BackgroundImageField);
|
||||
export const backgroundImageField = {
|
||||
...imageField,
|
||||
component: BackgroundImageField,
|
||||
};
|
||||
|
||||
registry.category("fields").add("background_image", backgroundImageField);
|
||||
|
|
|
|||
|
|
@ -1,11 +1,21 @@
|
|||
div.o_field_widget.o_field_background_image {
|
||||
display: inline-block;
|
||||
|
||||
> div {
|
||||
background-position: center;
|
||||
background-repeat: no-repeat;
|
||||
background-size: cover;
|
||||
@include media-breakpoint-down(md) {
|
||||
height: calc(100% + var(--KanbanRecord-padding-v)* 2);
|
||||
margin-top: calc(var(--KanbanRecord-padding-v)* -1);
|
||||
margin-bottom: calc(var(--KanbanRecord-padding-v)* -1);
|
||||
margin-left: calc(var(--KanbanRecord-padding-h)* -1);
|
||||
}
|
||||
|
||||
> img {
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
object-position: center;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,10 +1,13 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<templates id="template" xml:space="preserve">
|
||||
<t t-name="hr.BackgroundImage" owl="1">
|
||||
<div
|
||||
<t t-name="hr.BackgroundImage">
|
||||
<img
|
||||
loading="lazy"
|
||||
t-att-data-tooltip-template="hasTooltip and tooltipAttributes.template"
|
||||
t-att-data-tooltip-info="hasTooltip and tooltipAttributes.info"
|
||||
t-att-data-tooltip-delay="hasTooltip and props.zoomDelay"
|
||||
t-attf-style="background-image: url('#{getUrl(props.previewImage or props.name)}');"/>
|
||||
t-attf-src="#{getUrl(props.previewImage or props.name)}"
|
||||
alt="Binary file"
|
||||
/>
|
||||
</t>
|
||||
</templates>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue