diff --git a/database/postgres/tasks.go b/database/postgres/tasks.go index 47a8363..2b52404 100644 --- a/database/postgres/tasks.go +++ b/database/postgres/tasks.go @@ -51,7 +51,7 @@ func (r *taskRepository) List(ctx context.Context, filter models.TaskFilter) ([] } sq = sq.InnerJoin("project AS p ON task.project_id = p.project_id") - sq = sq.OrderBy("created_time") + sq = sq.OrderBy("active DESC", "created_time") query, args, err := sq.ToSql() if err != nil { diff --git a/svelte-ui/src/App.svelte b/svelte-ui/src/App.svelte index e8962ca..2e6e64e 100644 --- a/svelte-ui/src/App.svelte +++ b/svelte-ui/src/App.svelte @@ -7,6 +7,7 @@ import LogsPage from "./pages/LogsPage.svelte"; import GroupPage from "./pages/GroupPage.svelte"; import GoalPage from "./pages/GoalPage.svelte"; + import QlPage from "./pages/QLPage.svelte"; import GroupForm from "./forms/GroupForm.svelte"; import GoalForm from "./forms/GoalForm.svelte"; @@ -36,6 +37,7 @@ + diff --git a/svelte-ui/src/components/Menu.svelte b/svelte-ui/src/components/Menu.svelte index 953a198..ac0a000 100644 --- a/svelte-ui/src/components/Menu.svelte +++ b/svelte-ui/src/components/Menu.svelte @@ -1,5 +1,6 @@ @@ -41,4 +46,17 @@ a.selected { color: #AAA; } + + a.mobile { + display: none; + } + + @media screen and (max-width: 600px) { + a.mobile { + display: inline-block; + } + a.desktop { + display: none; + } + } diff --git a/svelte-ui/src/components/ParentEntry.svelte b/svelte-ui/src/components/ParentEntry.svelte index 43328ff..64aa023 100644 --- a/svelte-ui/src/components/ParentEntry.svelte +++ b/svelte-ui/src/components/ParentEntry.svelte @@ -1,10 +1,11 @@ {#if showAllOptions} diff --git a/svelte-ui/src/components/ProjectProgress.svelte b/svelte-ui/src/components/ProjectProgress.svelte new file mode 100644 index 0000000..cfd04d2 --- /dev/null +++ b/svelte-ui/src/components/ProjectProgress.svelte @@ -0,0 +1,21 @@ + + + diff --git a/svelte-ui/src/components/QLList.svelte b/svelte-ui/src/components/QLList.svelte new file mode 100644 index 0000000..bbbad5f --- /dev/null +++ b/svelte-ui/src/components/QLList.svelte @@ -0,0 +1,28 @@ + + +{#if projects.length > 0} +
+

{label}

+ {#each projects as project (project.id)} + + {/each} +
+{/if} + + \ No newline at end of file diff --git a/svelte-ui/src/components/QLListItem.svelte b/svelte-ui/src/components/QLListItem.svelte new file mode 100644 index 0000000..eef1368 --- /dev/null +++ b/svelte-ui/src/components/QLListItem.svelte @@ -0,0 +1,77 @@ + + +
+
+ +
+
+
{project.name}
+ +
+
+ + \ No newline at end of file diff --git a/svelte-ui/src/components/QuestLog.svelte b/svelte-ui/src/components/QuestLog.svelte new file mode 100644 index 0000000..8b5a369 --- /dev/null +++ b/svelte-ui/src/components/QuestLog.svelte @@ -0,0 +1,57 @@ + + +
+
+ + + +
+
+ {#if project != null} + + {/if} +
+
+ + \ No newline at end of file diff --git a/svelte-ui/src/components/RefreshSelection.svelte b/svelte-ui/src/components/RefreshSelection.svelte new file mode 100644 index 0000000..e9639fa --- /dev/null +++ b/svelte-ui/src/components/RefreshSelection.svelte @@ -0,0 +1,8 @@ + \ No newline at end of file diff --git a/svelte-ui/src/pages/FrontPage.svelte b/svelte-ui/src/pages/FrontPage.svelte index 6ed8bd3..8d40d10 100644 --- a/svelte-ui/src/pages/FrontPage.svelte +++ b/svelte-ui/src/pages/FrontPage.svelte @@ -2,10 +2,11 @@ import EmptyList from "../components/EmptyList.svelte"; import GoalEntry from "../components/GoalEntry.svelte"; import ProjectEntry from "../components/ProjectEntry.svelte"; + import RefreshSelection from "../components/RefreshSelection.svelte"; import type { ProjectResult } from "../models/project"; import { fpGoalStore } from "../stores/goal"; - import projectStore, { fpProjectStore } from "../stores/project"; - import taskStore, { fpTaskStore } from "../stores/tasks"; + import { fpProjectStore } from "../stores/project"; + import { fpTaskStore } from "../stores/tasks"; let fakeProject: ProjectResult let sortedProjects: ProjectResult[] @@ -85,6 +86,7 @@ {/if} + \ No newline at end of file diff --git a/svelte-ui/src/stores/selection.ts b/svelte-ui/src/stores/selection.ts new file mode 100644 index 0000000..7f07f91 --- /dev/null +++ b/svelte-ui/src/stores/selection.ts @@ -0,0 +1,32 @@ +import { writable } from "svelte/store"; + +interface SelectionData { + path: string, + hash: string, +} + +function createSelectionStore() { + const {update, set, subscribe} = writable({ + path: window.location.pathname, + hash: window.location.hash.slice(1), + }); + + return { + subscribe, + + refresh() { + set({ + path: window.location.pathname, + hash: window.location.hash.slice(1), + }); + }, + + change(key: keyof(SelectionData), value: string) { + update(d => ({...d, [key]: value})); + }, + } +} + +const selectionStore = createSelectionStore(); + +export default selectionStore; \ No newline at end of file