Skip to content

Commit

Permalink
Fix styling and scroll behavior
Browse files Browse the repository at this point in the history
Signed-off-by: Julius Härtl <jus@bitgrid.net>
  • Loading branch information
juliushaertl committed Aug 25, 2020
1 parent 0b23401 commit 44bf528
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 36 deletions.
91 changes: 55 additions & 36 deletions src/components/overview/Overview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
-->

<template>
<div>
<div class="overview-wrapper">
<Controls :overview-name="filterDisplayName" />

<div v-if="loading" key="loading" class="emptycontent">
Expand All @@ -30,48 +30,46 @@
<p />
</div>

<div v-else>
<div v-if="isValidFilter" class="dashboard">
<div v-if="cardsByDueDate.overdue.length > 0" class="dashboard-column">
<h3>{{ t('deck', 'Overdue') }}</h3>
<div v-for="card in cardsByDueDate.overdue" :key="card.id">
<CardItem :id="card.id" />
</div>
<div v-else-if="isValidFilter" class="overview">
<div v-if="cardsByDueDate.overdue.length > 0" class="dashboard-column">
<h3>{{ t('deck', 'Overdue') }}</h3>
<div v-for="card in cardsByDueDate.overdue" :key="card.id">
<CardItem :id="card.id" />
</div>
</div>

<div class="dashboard-column">
<h3>{{ t('deck', 'Today') }}</h3>
<div v-for="card in cardsByDueDate.today" :key="card.id">
<CardItem :id="card.id" />
</div>
<div class="dashboard-column">
<h3>{{ t('deck', 'Today') }}</h3>
<div v-for="card in cardsByDueDate.today" :key="card.id">
<CardItem :id="card.id" />
</div>
</div>

<div class="dashboard-column">
<h3>{{ t('deck', 'Tomorrow') }}</h3>
<div v-for="card in cardsByDueDate.tomorrow" :key="card.id">
<CardItem :id="card.id" />
</div>
<div class="dashboard-column">
<h3>{{ t('deck', 'Tomorrow') }}</h3>
<div v-for="card in cardsByDueDate.tomorrow" :key="card.id">
<CardItem :id="card.id" />
</div>
</div>

<div class="dashboard-column">
<h3>{{ t('deck', 'This week') }}</h3>
<div v-for="card in cardsByDueDate.thisWeek" :key="card.id">
<CardItem :id="card.id" />
</div>
<div class="dashboard-column">
<h3>{{ t('deck', 'This week') }}</h3>
<div v-for="card in cardsByDueDate.thisWeek" :key="card.id">
<CardItem :id="card.id" />
</div>
</div>

<div class="dashboard-column">
<h3>{{ t('deck', 'Later') }}</h3>
<div v-for="card in cardsByDueDate.later" :key="card.id">
<CardItem :id="card.id" />
</div>
<div class="dashboard-column">
<h3>{{ t('deck', 'Later') }}</h3>
<div v-for="card in cardsByDueDate.later" :key="card.id">
<CardItem :id="card.id" />
</div>
</div>

<div class="dashboard-column">
<h3>{{ t('deck', 'No due') }}</h3>
<div v-for="card in cardsByDueDate.nodue" :key="card.id">
<CardItem :id="card.id" />
</div>
<div class="dashboard-column">
<h3>{{ t('deck', 'No due') }}</h3>
<div v-for="card in cardsByDueDate.nodue" :key="card.id">
<CardItem :id="card.id" />
</div>
</div>
</div>
Expand Down Expand Up @@ -200,18 +198,39 @@ export default {
<style lang="scss" scoped>
@import './../../css/variables';
.dashboard {
.overview-wrapper {
position: relative;
width: 100%;
height: 100%;
max-height: calc(100vh - 50px);
}
.overview {
position: relative;
height: calc(100% - 44px);
overflow-x: scroll;
display: flex;
align-items: stretch;
margin-left: $board-spacing;
margin-right: $board-spacing;
padding-left: $board-spacing;
padding-right: $board-spacing;
.dashboard-column {
display: flex;
flex-direction: column;
min-width: $stack-width;
margin-left: $stack-spacing;
margin-right: $stack-spacing;
h3 {
margin: -6px;
margin-bottom: 12px;
padding: 6px 13px;
position: sticky;
top: 0;
z-index: 100;
background-color: var(--color-main-background);
border: 1px solid var(--color-main-background);
}
}
}
Expand Down
1 change: 1 addition & 0 deletions src/views/Dashboard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

<template>
<DashboardWidget :items="cards"
:show-more-text="t('deck', 'upcoming cards')"
:show-more-url="showMoreUrl"
:loading="loading"
@hide="() => {}"
Expand Down

0 comments on commit 44bf528

Please sign in to comment.