parent
37e4461a22
commit
feef4f09b1
|
|
@ -5,6 +5,7 @@
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
:class="specialClass"
|
:class="specialClass"
|
||||||
|
:style="instrumentStyle"
|
||||||
class="content-block"
|
class="content-block"
|
||||||
data-cy="content-block"
|
data-cy="content-block"
|
||||||
>
|
>
|
||||||
|
|
@ -43,6 +44,7 @@
|
||||||
<h3
|
<h3
|
||||||
class="content-block__instrument-label"
|
class="content-block__instrument-label"
|
||||||
data-cy="instrument-label"
|
data-cy="instrument-label"
|
||||||
|
:style="instrumentLabelStyle"
|
||||||
v-if="instrumentLabel !== ''"
|
v-if="instrumentLabel !== ''"
|
||||||
>
|
>
|
||||||
{{ instrumentLabel }}
|
{{ instrumentLabel }}
|
||||||
|
|
@ -129,13 +131,35 @@
|
||||||
specialClass() {
|
specialClass() {
|
||||||
return `content-block--${this.contentBlock.type.toLowerCase()}`;
|
return `content-block--${this.contentBlock.type.toLowerCase()}`;
|
||||||
},
|
},
|
||||||
|
isInstrumentBlock() {
|
||||||
|
return !!this.contentBlock.instrumentCategory;
|
||||||
|
},
|
||||||
|
instrumentStyle() {
|
||||||
|
if (this.isInstrumentBlock) {
|
||||||
|
return {
|
||||||
|
backgroundColor: this.contentBlock.instrumentCategory.background
|
||||||
|
};
|
||||||
|
}
|
||||||
|
return {};
|
||||||
|
},
|
||||||
instrumentLabel() {
|
instrumentLabel() {
|
||||||
const contentType = this.contentBlock.type.toLowerCase();
|
const contentType = this.contentBlock.type.toLowerCase();
|
||||||
if (contentType.startsWith('base')) { // all instruments start with `base`
|
if (contentType.startsWith('base')) { // all legacy instruments start with `base`
|
||||||
return instrumentCategory(contentType);
|
return instrumentCategory(contentType);
|
||||||
}
|
}
|
||||||
|
if (this.isInstrumentBlock) {
|
||||||
|
return instrumentCategory(this.contentBlock.instrumentCategory.name);
|
||||||
|
}
|
||||||
return '';
|
return '';
|
||||||
},
|
},
|
||||||
|
instrumentLabelStyle() {
|
||||||
|
if (this.isInstrumentBlock) {
|
||||||
|
return {
|
||||||
|
color: this.contentBlock.instrumentCategory.foreground
|
||||||
|
};
|
||||||
|
}
|
||||||
|
return {};
|
||||||
|
},
|
||||||
canEditContentBlock() {
|
canEditContentBlock() {
|
||||||
return this.contentBlock.mine && !this.contentBlock.indent;
|
return this.contentBlock.mine && !this.contentBlock.indent;
|
||||||
},
|
},
|
||||||
|
|
@ -316,6 +340,10 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&--instrument {
|
||||||
|
@include content-box-base;
|
||||||
|
}
|
||||||
|
|
||||||
/deep/ p {
|
/deep/ p {
|
||||||
line-height: 1.5;
|
line-height: 1.5;
|
||||||
margin-bottom: 1em;
|
margin-bottom: 1em;
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,9 @@
|
||||||
<router-link
|
<router-link
|
||||||
:to="{name: 'instrument', params: { slug: value.slug }}"
|
:to="{name: 'instrument', params: { slug: value.slug }}"
|
||||||
class="instrument-widget__button button"
|
class="instrument-widget__button button"
|
||||||
|
:style="{
|
||||||
|
borderColor: value.foreground
|
||||||
|
}"
|
||||||
>
|
>
|
||||||
{{ $flavor.textInstrument }} anzeigen
|
{{ $flavor.textInstrument }} anzeigen
|
||||||
</router-link>
|
</router-link>
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@
|
||||||
},
|
},
|
||||||
category: {
|
category: {
|
||||||
type: Object,
|
type: Object,
|
||||||
default: () => {},
|
default: () => ({}),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ const instrumentType = (instrument) => {
|
||||||
} else {
|
} else {
|
||||||
return instrument.type.category.name;
|
return instrument.type.category.name;
|
||||||
}
|
}
|
||||||
return typeDictionary[category] || '';
|
return typeDictionary[category] || category || '';
|
||||||
};
|
};
|
||||||
|
|
||||||
const instrumentCategory = (instrument) => {
|
const instrumentCategory = (instrument) => {
|
||||||
|
|
|
||||||
|
|
@ -61,18 +61,25 @@
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@mixin content-box($color-list) {
|
@mixin content-box-base {
|
||||||
background-color: nth($color-list, 2);
|
|
||||||
padding: 15px;
|
padding: 15px;
|
||||||
align-items: start;
|
align-items: start;
|
||||||
border-radius: $default-border-radius;
|
border-radius: $default-border-radius;
|
||||||
|
|
||||||
/deep/ .button {
|
/deep/ .button {
|
||||||
border-color: nth($color-list, 1);
|
|
||||||
background-color: $color-white;
|
background-color: $color-white;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@mixin content-box($color-list) {
|
||||||
|
@include content-box-base;
|
||||||
|
background-color: nth($color-list, 2);
|
||||||
|
|
||||||
|
/deep/ .button {
|
||||||
|
border-color: nth($color-list, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@mixin desktop {
|
@mixin desktop {
|
||||||
@media (min-width: 1200px) {
|
@media (min-width: 1200px) {
|
||||||
@content
|
@content
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue