Merge pull request #598 from nextcloud/task-component
Refactor and cleanup task component layout
This commit is contained in:
commit
672d7bd095
2 changed files with 267 additions and 281 deletions
|
@ -136,7 +136,7 @@
|
|||
&:not(:empty).confirmation-confirm {
|
||||
padding: 0 !important;
|
||||
}
|
||||
|
||||
|
||||
span.countdown {
|
||||
background-color: inherit;
|
||||
color: $white;
|
||||
|
@ -377,38 +377,227 @@
|
|||
overflow: hidden;
|
||||
|
||||
.task-list {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.task-body .task-info-wrapper .title span a {
|
||||
cursor: pointer;
|
||||
text-decoration: underline;
|
||||
}
|
||||
}
|
||||
.loadmore {
|
||||
font-size: 11px;
|
||||
margin-top: 10px;
|
||||
text-align: center;
|
||||
height: 21px;
|
||||
|
||||
.task-list {
|
||||
.loadmore {
|
||||
font-size: 11px;
|
||||
margin-top: 10px;
|
||||
text-align: center;
|
||||
span {
|
||||
color: $gray;
|
||||
background-color: $gray_easy;
|
||||
border-radius: 10px;
|
||||
padding: 3px 6px;
|
||||
|
||||
span {
|
||||
color: $gray;
|
||||
background-color: $gray_easy;
|
||||
border-radius: 10px;
|
||||
padding: 3px 6px;
|
||||
|
||||
&:hover {
|
||||
cursor: pointer;
|
||||
color: $gray_dark;
|
||||
&:hover {
|
||||
cursor: pointer;
|
||||
color: $gray_dark;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.grouped-tasks {
|
||||
position: relative;
|
||||
.grouped-tasks {
|
||||
position: relative;
|
||||
padding-top: 2px;
|
||||
|
||||
.task-item {
|
||||
cursor: default;
|
||||
list-style: none outside none;
|
||||
margin-top: -1px;
|
||||
|
||||
&.done .task-body {
|
||||
opacity: .6;
|
||||
|
||||
.title {
|
||||
text-decoration: line-through;
|
||||
}
|
||||
}
|
||||
|
||||
&.add-subtask {
|
||||
border: 1px solid $gray_light;
|
||||
|
||||
input {
|
||||
border: medium none !important;
|
||||
border-radius: 0 !important;
|
||||
box-shadow: none !important;
|
||||
box-sizing: border-box;
|
||||
color: $gray_dark;
|
||||
cursor: text;
|
||||
font-size: 100%;
|
||||
margin: 0;
|
||||
padding: 0 60px 0 32px;
|
||||
width: 100%;
|
||||
min-height: 36px;
|
||||
}
|
||||
}
|
||||
|
||||
&.sortable-ghost .task-body {
|
||||
background-color: rgba( $color-primary, .3 );
|
||||
}
|
||||
|
||||
.subtasks-container {
|
||||
margin-left: 35px;
|
||||
}
|
||||
|
||||
.task-body {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: nowrap;
|
||||
align-items: center;
|
||||
height: 37px;
|
||||
position: relative;
|
||||
border: 1px solid $gray_light;
|
||||
overflow: hidden;
|
||||
|
||||
&:hover,
|
||||
&.active {
|
||||
background-color: $gray_easy;
|
||||
box-shadow: inset 4px 0 var(--color-primary);
|
||||
}
|
||||
|
||||
.task-checkbox {
|
||||
padding: 7px;
|
||||
padding-right: 3px;
|
||||
border-right: 1px dotted $gray;
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
.task-info {
|
||||
display: flex;
|
||||
flex: 1 1 auto;
|
||||
cursor: pointer;
|
||||
color: $gray_dark;
|
||||
line-height: 16px;
|
||||
margin: 0;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
|
||||
.title {
|
||||
cursor: text;
|
||||
display: inline-flex;
|
||||
padding: 10px;
|
||||
overflow: hidden;
|
||||
|
||||
span {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
|
||||
a {
|
||||
cursor: pointer;
|
||||
text-decoration: underline;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.categories-list {
|
||||
padding: 8px;
|
||||
overflow: hidden;
|
||||
|
||||
.category {
|
||||
overflow: hidden;
|
||||
display: inline-flex;
|
||||
min-width: 45px;
|
||||
background-color: $gray_easy;
|
||||
border: 1px solid $gray_light;
|
||||
border-radius: 2px;
|
||||
margin: 0 4px;
|
||||
|
||||
.category-label {
|
||||
color: $gray;
|
||||
font-weight: bold;
|
||||
padding: 2px 4px;
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.percentbar {
|
||||
height: 3px;
|
||||
position: absolute;
|
||||
bottom: 3px;
|
||||
left: 10px;
|
||||
right: 10px;
|
||||
background-color: $gray_light;
|
||||
border-radius: 2px;
|
||||
|
||||
.percentdone {
|
||||
height: 3px;
|
||||
border-radius: 2px 0 0 2px;
|
||||
opacity: .75;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.task-body-icons {
|
||||
display: flex;
|
||||
max-width: 50%;
|
||||
justify-content: flex-end;
|
||||
overflow: hidden;
|
||||
|
||||
&>div {
|
||||
height: 37px;
|
||||
padding: 10px;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
flex-wrap: nowrap;
|
||||
}
|
||||
|
||||
.icon {
|
||||
vertical-align: unset;
|
||||
|
||||
&.icon-add {
|
||||
&:hover {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.duedate {
|
||||
color: $blue_due;
|
||||
font-size: 11px;
|
||||
line-height: 14px;
|
||||
|
||||
&.overdue {
|
||||
color: $red_overdue;
|
||||
}
|
||||
}
|
||||
|
||||
.calendar {
|
||||
color: $gray;
|
||||
font-size: 11px;
|
||||
line-height: 14px;
|
||||
white-space: nowrap;
|
||||
|
||||
.calendar-indicator {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
margin-right: 3px;
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
border: none;
|
||||
border-radius: 50%;
|
||||
cursor: pointer
|
||||
}
|
||||
.calendar-name {
|
||||
max-width: 200px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -433,203 +622,6 @@
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* rules for task-items
|
||||
*/
|
||||
|
||||
.task-item {
|
||||
cursor: default;
|
||||
min-height: 37px;
|
||||
list-style: none outside none;
|
||||
overflow: hidden;
|
||||
margin-top: -1px;
|
||||
|
||||
&:first-child {
|
||||
margin-top: 0;
|
||||
|
||||
.task-body {
|
||||
border-width: 1px;
|
||||
}
|
||||
}
|
||||
|
||||
&.done .task-body {
|
||||
opacity: .6;
|
||||
|
||||
.title {
|
||||
text-decoration: line-through;
|
||||
}
|
||||
}
|
||||
|
||||
&.add-subtask {
|
||||
border: 1px solid $gray_light;
|
||||
|
||||
input {
|
||||
border: medium none !important;
|
||||
border-radius: 0 !important;
|
||||
box-shadow: none !important;
|
||||
box-sizing: border-box;
|
||||
color: $gray_dark;
|
||||
cursor: text;
|
||||
font-size: 100%;
|
||||
margin: 0;
|
||||
padding: 0 60px 0 32px;
|
||||
width: 100%;
|
||||
min-height: 36px;
|
||||
}
|
||||
}
|
||||
|
||||
&.sortable-ghost .task-body {
|
||||
background-color: rgba( $color-primary, .3 );
|
||||
}
|
||||
|
||||
.subtasks-container {
|
||||
margin-left: 35px;
|
||||
|
||||
.task-item {
|
||||
margin-top: -1px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.task-body {
|
||||
height: 37px;
|
||||
list-style: none outside none;
|
||||
margin: 0;
|
||||
position: relative;
|
||||
border-style: solid;
|
||||
border-width: 1px;
|
||||
border-color: $gray_light;
|
||||
overflow: hidden;
|
||||
|
||||
&:hover,
|
||||
&.active {
|
||||
background-color: $gray_easy;
|
||||
box-shadow: inset 4px 0 var(--color-primary);
|
||||
}
|
||||
|
||||
.icon {
|
||||
&.large {
|
||||
margin: 8px;
|
||||
}
|
||||
|
||||
&.task-separator {
|
||||
cursor: default;
|
||||
height: 100%;
|
||||
left: 34px;
|
||||
position: absolute;
|
||||
top: 1px;
|
||||
background: unset;
|
||||
width: 2px;
|
||||
border-left: 1px dotted $gray;
|
||||
}
|
||||
|
||||
&.icon-add {
|
||||
&:hover {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.task-info-wrapper {
|
||||
cursor: pointer;
|
||||
color: $gray_dark;
|
||||
display: flex;
|
||||
line-height: 16px;
|
||||
margin: 0;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
|
||||
.title {
|
||||
cursor: text;
|
||||
display: inline-flex;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.categories-list {
|
||||
padding: 8px;
|
||||
vertical-align: middle;
|
||||
display: inline-flex;
|
||||
text-overflow: ellipsis;
|
||||
flex-wrap: nowrap;
|
||||
overflow: hidden;
|
||||
|
||||
.category {
|
||||
overflow: hidden;
|
||||
display: inline-flex;
|
||||
min-width: 45px;
|
||||
background-color: $gray_easy;
|
||||
border: 1px solid $gray_light;
|
||||
border-radius: 2px;
|
||||
margin: 0 4px;
|
||||
|
||||
.category-label {
|
||||
color: $gray;
|
||||
font-weight: bold;
|
||||
padding: 2px 4px;
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.duedate {
|
||||
color: $blue_due;
|
||||
float: right;
|
||||
font-size: 11px;
|
||||
line-height: 14px;
|
||||
margin: 10px;
|
||||
|
||||
&.overdue {
|
||||
color: $red_overdue;
|
||||
}
|
||||
}
|
||||
|
||||
.listname {
|
||||
color: $gray;
|
||||
float: right;
|
||||
font-size: 11px;
|
||||
line-height: 14px;
|
||||
margin: 10px;
|
||||
|
||||
.calendar-indicator {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
border: none;
|
||||
border-radius: 50%;
|
||||
cursor: pointer
|
||||
}
|
||||
}
|
||||
|
||||
.percentbar {
|
||||
height: 3px;
|
||||
position: relative;
|
||||
top: 28px;
|
||||
left: 42px;
|
||||
margin-right: 103px;
|
||||
margin-bottom: -5px;
|
||||
background-color: $gray_light;
|
||||
border-radius: 2px;
|
||||
|
||||
.percentdone {
|
||||
height: 3px;
|
||||
border-radius: 2px 0 0 2px;
|
||||
opacity: .75;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.template {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/**
|
||||
* rules for app-sidebar
|
||||
*/
|
||||
|
@ -887,7 +879,7 @@
|
|||
margin-left: auto;
|
||||
right: 22px;
|
||||
}
|
||||
|
||||
|
||||
&.icon-privacy {
|
||||
opacity: 1;
|
||||
cursor: unset;
|
||||
|
@ -1152,7 +1144,7 @@
|
|||
cursor: default;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
&.detail-all-day {
|
||||
div,
|
||||
span {
|
||||
|
@ -1190,18 +1182,14 @@
|
|||
}
|
||||
}
|
||||
|
||||
.task-checkbox,
|
||||
.detail-checkbox {
|
||||
float: left;
|
||||
padding: 8px;
|
||||
margin: 7px;
|
||||
margin-right: 3px;
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
.detail-checkbox {
|
||||
padding: 8px;
|
||||
}
|
||||
|
||||
input[type='checkbox'].checkbox {
|
||||
&:checked + label::before {
|
||||
background-image: var(--icon-checkmark-000);
|
||||
|
@ -1366,11 +1354,6 @@ input[type='checkbox'].checkbox {
|
|||
font-family: var(--font-face);
|
||||
}
|
||||
|
||||
.task-status-container {
|
||||
float:right;
|
||||
margin: 8px;
|
||||
}
|
||||
|
||||
.status-display {
|
||||
display: inline-block;
|
||||
width: 16px;
|
||||
|
|
|
@ -33,14 +33,8 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
|||
type="task"
|
||||
@click="navigate($event)"
|
||||
>
|
||||
<div v-if="task.complete > 0" class="percentbar">
|
||||
<div :style="{ width: task.complete + '%', 'background-color': task.calendar.color }"
|
||||
:aria-label="$t('tasks', '{complete} % completed', {complete: task.complete})"
|
||||
class="percentdone"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<span class="task-checkbox">
|
||||
<!-- Checkbox with divider -->
|
||||
<div class="task-checkbox">
|
||||
<input :id="'toggleCompleted_' + task.uid"
|
||||
type="checkbox"
|
||||
class="checkbox"
|
||||
|
@ -53,45 +47,9 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
|||
@click="toggleCompleted(task)"
|
||||
>
|
||||
<label class="reactive no-nav" :for="'toggleCompleted_' + task.uid" />
|
||||
</span>
|
||||
<span class="icon task-separator" />
|
||||
<span class="task-star" @click="toggleStarred(task)">
|
||||
<span :class="[iconStar, {'disabled': task.calendar.readOnly}]" class="icon right large reactive no-nav" />
|
||||
</span>
|
||||
<span v-if="!task.calendar.readOnly"
|
||||
class="task-addsubtask add-subtask"
|
||||
>
|
||||
<span :taskId="task.uri"
|
||||
:title="subtasksCreationPlaceholder" class="icon icon-bw icon-add right large reactive no-nav"
|
||||
@click="showSubtaskInput = true"
|
||||
/>
|
||||
</span>
|
||||
<span v-if="Object.values(task.subTasks).length" @click="toggleSubtasksVisibility(task)">
|
||||
<span :title="$t('tasks', 'Toggle visibility of all subtasks.')"
|
||||
:class="task.hideSubtasks ? 'icon-subtasks-hidden' : 'icon-subtasks-visible'"
|
||||
class="icon icon-bw right large subtasks reactive no-nav"
|
||||
/>
|
||||
</span>
|
||||
<span v-if="hasCompletedSubtasks" @click="toggleCompletedSubtasksVisibility(task)">
|
||||
<span :title="$t('tasks', 'Toggle visibility of completed subtasks.')"
|
||||
:class="{'active': !task.hideCompletedSubtasks}"
|
||||
class="icon icon-bw icon-toggle right large toggle-completed-subtasks reactive no-nav"
|
||||
/>
|
||||
</span>
|
||||
<span v-if="task.note!=''">
|
||||
<span class="icon icon-bw icon-note right large" />
|
||||
</span>
|
||||
<span class="task-status-container">
|
||||
<TaskStatusDisplay :task="task" />
|
||||
</span>
|
||||
<span :class="{overdue: overdue(task.due)}" class="duedate">
|
||||
{{ task.due | formatDate }}
|
||||
</span>
|
||||
<span v-if="$route.params.collectionId=='week'" class="listname">
|
||||
<span :style="{'background-color': task.calendar.color}" class="calendar-indicator" />
|
||||
<span>{{ task.calendar.displayName }}</span>
|
||||
</span>
|
||||
<div class="task-info-wrapper">
|
||||
</div>
|
||||
<!-- Info: title, progress & categories -->
|
||||
<div class="task-info">
|
||||
<div class="title">
|
||||
<span v-linkify="task.summary" />
|
||||
</div>
|
||||
|
@ -102,6 +60,51 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
|||
</span>
|
||||
</span>
|
||||
</div>
|
||||
<div v-if="task.complete > 0" class="percentbar">
|
||||
<div :style="{ width: task.complete + '%', 'background-color': task.calendar.color }"
|
||||
:aria-label="$t('tasks', '{complete} % completed', {complete: task.complete})"
|
||||
class="percentdone"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Icons: sync-status, calendarname, date, note, subtask-show-completed, subtask-visibility, add-subtask, starred -->
|
||||
<div class="task-body-icons">
|
||||
<div class="task-status-container">
|
||||
<TaskStatusDisplay :task="task" />
|
||||
</div>
|
||||
<div v-if="$route.params.collectionId=='week'" class="calendar">
|
||||
<span :style="{'background-color': task.calendar.color}" class="calendar-indicator" />
|
||||
<span class="calendar-name">{{ task.calendar.displayName }}</span>
|
||||
</div>
|
||||
<div v-if="task.due" :class="{overdue: overdue(task.due)}" class="duedate">
|
||||
{{ task.due | formatDate }}
|
||||
</div>
|
||||
<div v-if="task.note!=''">
|
||||
<span class="icon icon-bw icon-note" />
|
||||
</div>
|
||||
<div v-if="hasCompletedSubtasks" @click="toggleCompletedSubtasksVisibility(task)">
|
||||
<span :title="$t('tasks', 'Toggle visibility of completed subtasks.')"
|
||||
:class="{'active': !task.hideCompletedSubtasks}"
|
||||
class="icon icon-bw icon-toggle toggle-completed-subtasks reactive no-nav"
|
||||
/>
|
||||
</div>
|
||||
<div v-if="Object.values(task.subTasks).length" @click="toggleSubtasksVisibility(task)">
|
||||
<span :title="$t('tasks', 'Toggle visibility of all subtasks.')"
|
||||
:class="task.hideSubtasks ? 'icon-subtasks-hidden' : 'icon-subtasks-visible'"
|
||||
class="icon icon-bw subtasks reactive no-nav"
|
||||
/>
|
||||
</div>
|
||||
<div v-if="!task.calendar.readOnly"
|
||||
class="task-addsubtask add-subtask"
|
||||
>
|
||||
<span :taskId="task.uri"
|
||||
:title="subtasksCreationPlaceholder" class="icon icon-bw icon-add reactive no-nav"
|
||||
@click="showSubtaskInput = true"
|
||||
/>
|
||||
</div>
|
||||
<div class="task-star" @click="toggleStarred(task)">
|
||||
<span :class="[iconStar, {'disabled': task.calendar.readOnly}]" class="icon reactive no-nav" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="subtasks-container">
|
||||
|
|
Loading…
Reference in a new issue