Gisle Aune
4 years ago
15 changed files with 214 additions and 70 deletions
-
7database/postgres/project.go
-
11migrations/postgres/20210120210752_add_project_column_status_tag.sql
-
9migrations/postgres/20210120211301_update_project_inactive_status_tag.sql
-
21models/project.go
-
8svelte-ui/src/components/ParentEntry.svelte
-
5svelte-ui/src/components/Progress.svelte
-
43svelte-ui/src/components/ProjectEntry.svelte
-
41svelte-ui/src/components/ProjectIcon.svelte
-
3svelte-ui/src/components/ProjectProgress.svelte
-
2svelte-ui/src/components/QLList.svelte
-
57svelte-ui/src/components/QLListItem.svelte
-
13svelte-ui/src/components/QuestLog.svelte
-
42svelte-ui/src/components/StatusColor.svelte
-
18svelte-ui/src/forms/ProjectForm.svelte
-
4svelte-ui/src/models/project.ts
@ -0,0 +1,11 @@ |
|||
-- +goose Up |
|||
-- +goose StatementBegin |
|||
ALTER TABLE project |
|||
ADD COLUMN status_tag TEXT DEFAULT NULL; |
|||
-- +goose StatementEnd |
|||
|
|||
-- +goose Down |
|||
-- +goose StatementBegin |
|||
ALTER TABLE project |
|||
DROP COLUMN status_tag; |
|||
-- +goose StatementEnd |
@ -0,0 +1,9 @@ |
|||
-- +goose Up |
|||
-- +goose StatementBegin |
|||
UPDATE project SET status_tag='completed' WHERE active=false; |
|||
-- +goose StatementEnd |
|||
|
|||
-- +goose Down |
|||
-- +goose StatementBegin |
|||
SELECT 'Nothing to do'; |
|||
-- +goose StatementEnd |
@ -0,0 +1,41 @@ |
|||
<script lang="ts"> |
|||
import type { IconName } from "../external/icons"; |
|||
|
|||
import Icon from "./Icon.svelte"; |
|||
|
|||
interface ProjectLike { |
|||
icon?: IconName |
|||
active?: boolean |
|||
statusTag?: string |
|||
} |
|||
|
|||
export let project: ProjectLike |
|||
export let selected: boolean; |
|||
|
|||
let completed: boolean; |
|||
let failed: boolean; |
|||
let postponed: boolean; |
|||
let idea: boolean; |
|||
|
|||
$: completed = !project.active && project.statusTag === "completed"; |
|||
$: failed = !project.active && project.statusTag === "failed"; |
|||
$: postponed = !project.active && project.statusTag === "postponed"; |
|||
$: idea = !project.active && project.statusTag === "idea"; |
|||
</script> |
|||
|
|||
<span class:selected class:completed class:failed class:postponed class:idea> |
|||
<Icon block name={project.icon} /> |
|||
</span> |
|||
|
|||
<style> |
|||
span { color: #444; } |
|||
span.selected { color: #666; } |
|||
span.completed { color: #484; } |
|||
span.completed.selected { color: #78ff78; } |
|||
span.failed { color: #884844; } |
|||
span.failed.selected { color: #ff9878; } |
|||
span.postponed { color: #446d88; } |
|||
span.postponed.selected { color: #78c9ff; } |
|||
span.idea { color: #878844; } |
|||
span.idea.selected { color: #fffd78; } |
|||
</style> |
@ -0,0 +1,42 @@ |
|||
<script lang="ts"> |
|||
interface ProjectLike { |
|||
active: boolean |
|||
statusTag?: string |
|||
} |
|||
|
|||
export let selected = false; |
|||
export let project: ProjectLike; |
|||
|
|||
let completed: boolean; |
|||
let failed: boolean; |
|||
let postponed: boolean; |
|||
let idea: boolean; |
|||
|
|||
$: completed = !project.active && project.statusTag === "completed"; |
|||
$: failed = !project.active && project.statusTag === "failed"; |
|||
$: postponed = !project.active && project.statusTag === "postponed"; |
|||
$: idea = !project.active && project.statusTag === "idea"; |
|||
|
|||
</script> |
|||
|
|||
<div class="status-color-context" class:selected class:completed class:failed class:postponed class:idea> |
|||
<slot></slot> |
|||
</div> |
|||
|
|||
<style> |
|||
.status-color-context :global(.sccfg) { color: #444 !important; } |
|||
.status-color-context.selected :global(.sccfg) { color: #666 !important; } |
|||
.status-color-context :global(.sccpb) { background-color: #78ff78 !important; } |
|||
.status-color-context.completed :global(.sccfg) { color: #484 !important; } |
|||
.status-color-context.completed.selected :global(.sccfg) { color: #78ff78 !important; } |
|||
.status-color-context.completed :global(.sccpb) { background-color: #78ff78 !important; } |
|||
.status-color-context.failed :global(.sccfg) { color: #852a24 !important; } |
|||
.status-color-context.failed.selected :global(.sccfg) { color: #ff4545 !important; } |
|||
.status-color-context.failed :global(.sccpb) { background-color: #ff4545 !important; } |
|||
.status-color-context.postponed :global(.sccfg) { color: #446d88 !important; } |
|||
.status-color-context.postponed.selected :global(.sccfg) { color: #78c9ff !important; } |
|||
.status-color-context.postponed :global(.sccpb) { background-color: #78c9ff !important; } |
|||
.status-color-context.idea :global(.sccfg) { color: #878844 !important; } |
|||
.status-color-context.idea.selected :global(.sccfg) { color: #e7e55e !important; } |
|||
.status-color-context.idea :global(.sccpb) { background-color: #e7e55e !important; } |
|||
</style> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue