Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(print): table layout instead of flex layout for content nodes #2654

Merged
merged 4 commits into from
May 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions print/components/scheduleEntry/ScheduleEntry.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<div class="schedule-entry-title tw-float-left">
<h2
:id="`content_${index}_scheduleEntry_${scheduleEntry.id}`"
class="tw-text-xl tw-font-bold"
class="tw-text-xl tw-font-bold tw-pt-1"
>
{{ scheduleEntry.number }}
<category-label :category="scheduleEntry.activity().category()" />
Expand All @@ -13,13 +13,15 @@
<div class="tw-float-right">
{{ rangeShort(scheduleEntry.start, scheduleEntry.end) }}
</div>
<div class="header tw-clear-both">
<div class="header tw-clear-both tw-mb-4">
<table class="header-table">
<tr>
<th class="header-row left-col">
{{ $tc('entity.activity.fields.location') }}
</th>
<td class="header-row">{{ scheduleEntry.activity().location }}</td>
<td class="header-row">
{{ scheduleEntry.activity().location }}
</td>
</tr>
<tr>
<th class="header-row left-col">
Expand Down Expand Up @@ -106,7 +108,8 @@ export default {

.header-row {
border-bottom: 1px solid black;
padding: 0.1rem;
padding: 0.2rem;
padding-left: 0.4rem;
width: 90%;
}

Expand All @@ -115,5 +118,7 @@ export default {
font-weight: bold;
text-align: left;
width: 10%;
padding-left: 0;
padding-right: 0.4rem;
}
</style>
25 changes: 10 additions & 15 deletions print/components/scheduleEntry/contentNode/ColumnLayout.vue
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
<template>
<div class="wrapper">
<column-layout-column
v-for="column in contentNode.columns"
:key="column.slot"
:content-node="contentNode"
:column-slot="column.slot"
/>
</div>
<table class="tw-w-full">
<tr>
<column-layout-column
v-for="column in contentNode.columns"
:key="column.slot"
:content-node="contentNode"
:column-slot="column.slot"
/>
</tr>
</table>
</template>

<script>
Expand All @@ -18,10 +20,3 @@ export default {
},
}
</script>

<style scoped lang="scss">
.wrapper {
display: flex;
flex-direction: row;
}
</style>
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<template>
<div :style="columnStyles">
<td :style="columnStyles" class="tw-align-top">
<content-node
v-for="child in children"
:key="child.id"
:content-node="child"
/>
</div>
</td>
</template>

<script>
Expand All @@ -26,16 +26,14 @@ export default {
},
columnStyles() {
return {
flex: '0 0 ' + (this.width / 12.0) * 100.0 + '%',
width: (this.width / 12.0) * 100.0 + '%',
borderLeft:
this.columnSlot === this.firstSlot ? 'none' : '1px solid black',
padding:
'4px ' +
(this.columnSlot === this.lastSlot ? '0' : '1%') +
' 4px ' +
(this.columnSlot === this.firstSlot ? '0' : '1%'),
display: 'flex',
flexDirection: 'column',
}
},
firstSlot() {
Expand Down
79 changes: 30 additions & 49 deletions print/components/scheduleEntry/contentNode/Storyboard.vue
Original file line number Diff line number Diff line change
@@ -1,28 +1,30 @@
<template>
<div class="wrapper">
<div v-if="instanceName" class="instance-name">{{ instanceName }}</div>
<div class="storyboard-row">
<div class="column column1 header">
{{ $tc('contentNode.storyboard.entity.section.fields.column1') }}
</div>
<div class="column column2 header">
{{ $tc('contentNode.storyboard.entity.section.fields.column2') }}
</div>
<div class="column column3 header">
{{ $tc('contentNode.storyboard.entity.section.fields.column3') }}
</div>
</div>
<div v-for="section in sections" :key="section.id" class="storyboard-row">
<div class="column column1">
<rich-text :rich-text="section.column1" />
</div>
<div class="column column2">
<rich-text :rich-text="section.column2" />
</div>
<div class="column column3">
<rich-text :rich-text="section.column3" />
</div>
</div>
<div class="tw-mb-3">
<div v-if="instanceName" class="tw-font-bold">{{ instanceName }}</div>
<table class="tw-w-full">
<tr>
<th class="column column1 header tw-w-1/12">
{{ $tc('contentNode.storyboard.entity.section.fields.column1') }}
</th>
<th class="column column2 header tw-w-10/12">
{{ $tc('contentNode.storyboard.entity.section.fields.column2') }}
</th>
<th class="column column3 header tw-w-1/12">
{{ $tc('contentNode.storyboard.entity.section.fields.column3') }}
</th>
</tr>
<tr v-for="section in sections" :key="section.id">
<td class="column column1">
<rich-text :rich-text="section.column1" />
</td>
<td class="column column2">
<rich-text :rich-text="section.column2" />
</td>
<td class="column column3">
<rich-text :rich-text="section.column3" />
</td>
</tr>
</table>
</div>
</template>

Expand Down Expand Up @@ -55,49 +57,28 @@ export default {
</script>

<style scoped lang="scss">
.wrapper {
margin-bottom: 12px;
}

.instance-name {
font-weight: bold;
}

.storyboard-row {
display: flex;
flex-direction: row;
}

.header {
padding-bottom: 0;
border-bottom: 1px solid black;
border-bottom: 1px solid rgb(148 163 184);
}

.column {
flex-grow: 1;
line-height: 1.6;
padding-bottom: 8px;
vertical-align: top;
}

.column1 {
flex-basis: 26px;
flex-shrink: 0;
flex-grow: 0;
padding-right: 4px;
}

.column2 {
flex-grow: 1;
border-left: 1px solid black;
border-left: 1px solid rgb(148 163 184);
padding-left: 4px;
padding-right: 4px;
}

.column3 {
flex-basis: 80px;
flex-shrink: 0;
flex-grow: 0;
border-left: 1px solid black;
border-left: 1px solid rgb(148 163 184);
padding-left: 4px;
}
</style>