improved css, implemented setting task state directly in project tree
This commit is contained in:
@@ -36,17 +36,24 @@
|
|||||||
router.navigate(`/task/${task.id}/view`);
|
router.navigate(`/task/${task.id}/view`);
|
||||||
}
|
}
|
||||||
|
|
||||||
async function patchTask(newName){
|
async function patchTask(changeset){
|
||||||
console.log('patchTask('+newName+')');
|
|
||||||
const url = api(`task/${task.id}`);
|
const url = api(`task/${task.id}`);
|
||||||
const resp = await fetch(url,{
|
const resp = await fetch(url,{
|
||||||
credentials:'include',
|
credentials:'include',
|
||||||
method: 'PATCH',
|
method: 'PATCH',
|
||||||
body: JSON.stringify({name:newName})
|
body: JSON.stringify(changeset)
|
||||||
});
|
});
|
||||||
let ok = resp.ok;
|
if (resp.ok){
|
||||||
console.log({ok:ok});
|
task = await resp.json();
|
||||||
return ok;
|
return true;
|
||||||
|
} else {
|
||||||
|
error = await resp.text();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function setName(newName){
|
||||||
|
patchTask({name:newName});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (task.estimated_time){
|
if (task.estimated_time){
|
||||||
@@ -58,10 +65,16 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<li class="task {task.status.name.toLowerCase()}">
|
<li class="task {task.status.name.toLowerCase()}">
|
||||||
<LineEditor bind:value={task.name} onclick={openTask} editable={true} onSet={patchTask} type="span" />
|
<LineEditor bind:value={task.name} onclick={openTask} editable={true} onSet={setName} type="span" />
|
||||||
{#if task.estimated_time}
|
{#if task.estimated_time}
|
||||||
<span class="estimated_time">({+task.estimated_time} h)</span>
|
<span class="estimated_time">({+task.estimated_time} h)</span>
|
||||||
{/if}
|
{/if}
|
||||||
|
{#if task.status.code < 60}
|
||||||
|
<button class="symbol" title={t('complete')} onclick={() => patchTask({status:'COMPLETE'})}></button>
|
||||||
|
<button class="symbol" title={t('abort')} onclick={() => patchTask({status:'CANCELLED'})} ></button>
|
||||||
|
{:else}
|
||||||
|
<button class="symbol" title={t('do_open')} onclick={() => patchTask({status:'OPEN'})}></button>
|
||||||
|
{/if}
|
||||||
{#if error}
|
{#if error}
|
||||||
<span class="error">{error}</span>
|
<span class="error">{error}</span>
|
||||||
{/if}
|
{/if}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
import { useTinyRouter } from 'svelte-tiny-router';
|
import { useTinyRouter } from 'svelte-tiny-router';
|
||||||
import { onMount } from 'svelte';
|
import { onMount } from 'svelte';
|
||||||
import { t } from '../../translations.svelte.js';
|
import { t } from '../../translations.svelte.js';
|
||||||
|
import { api } from '../../urls.svelte.js';
|
||||||
|
|
||||||
const router = useTinyRouter();
|
const router = useTinyRouter();
|
||||||
let error = $state(null);
|
let error = $state(null);
|
||||||
@@ -12,7 +13,7 @@
|
|||||||
let sortedProjects = $derived.by(() => Object.values(projects).sort((a, b) => a.name.localeCompare(b.name)));
|
let sortedProjects = $derived.by(() => Object.values(projects).sort((a, b) => a.name.localeCompare(b.name)));
|
||||||
|
|
||||||
async function loadProjects(){
|
async function loadProjects(){
|
||||||
let url = `${location.protocol}//${location.host.replace('5173','8080')}/api/company/list`;
|
let url = api('company/list');
|
||||||
let resp = await fetch(url,{credentials:'include'});
|
let resp = await fetch(url,{credentials:'include'});
|
||||||
if (resp.ok){
|
if (resp.ok){
|
||||||
companies = await resp.json();
|
companies = await resp.json();
|
||||||
@@ -33,7 +34,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function setState(pid,state_name){
|
async function setState(pid,state_name){
|
||||||
const url = `${location.protocol}//${location.host.replace('5173','8080')}/api/project/${pid}`;
|
const url = api(`project/${pid}`);
|
||||||
const resp = await fetch(url,{
|
const resp = await fetch(url,{
|
||||||
credentials:'include',
|
credentials:'include',
|
||||||
method:'PATCH',
|
method:'PATCH',
|
||||||
|
|||||||
@@ -54,6 +54,7 @@
|
|||||||
"document": "Dokumente",
|
"document": "Dokumente",
|
||||||
"documents": "Dokumente",
|
"documents": "Dokumente",
|
||||||
"do_login" : "anmelden",
|
"do_login" : "anmelden",
|
||||||
|
"do_open" : "öffnen",
|
||||||
"do_send" : "versenden",
|
"do_send" : "versenden",
|
||||||
"double_click_to_edit": "Doppel-klicken zum Bearbeiten",
|
"double_click_to_edit": "Doppel-klicken zum Bearbeiten",
|
||||||
"due_date": "Fälligkeitsdatum",
|
"due_date": "Fälligkeitsdatum",
|
||||||
|
|||||||
BIN
translations/src/main/resources/fontawesome-webfont.woff
Normal file
BIN
translations/src/main/resources/fontawesome-webfont.woff
Normal file
Binary file not shown.
@@ -1,6 +1,6 @@
|
|||||||
@font-face {
|
@font-face {
|
||||||
font-family: "awesome";
|
font-family: "awesome";
|
||||||
src: url("../fontawesome-webfont.woff");
|
src: url("/fontawesome-webfont.woff");
|
||||||
}
|
}
|
||||||
|
|
||||||
a {
|
a {
|
||||||
@@ -82,20 +82,20 @@ td, tr{
|
|||||||
background: rgba(0,0,0,0.7);
|
background: rgba(0,0,0,0.7);
|
||||||
backdrop-filter: blur(3px);
|
backdrop-filter: blur(3px);
|
||||||
}
|
}
|
||||||
.task.cancelled > .name {
|
.task.cancelled > span {
|
||||||
text-decoration: line-through;
|
text-decoration: line-through;
|
||||||
color: gray;
|
color: gray;
|
||||||
}
|
}
|
||||||
.task.started > .name {
|
.task.started > span {
|
||||||
color: green;
|
color: green;
|
||||||
}
|
}
|
||||||
.task.pending > .name {
|
.task.pending > span {
|
||||||
color: gray;
|
color: gray;
|
||||||
}
|
}
|
||||||
.task.complete > .name {
|
.task.complete > span {
|
||||||
color: green;
|
color: forestgreen;
|
||||||
}
|
}
|
||||||
.task.complete > .name:before {
|
.task.complete > span:before {
|
||||||
content: "✓ ";
|
content: "✓ ";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -116,8 +116,12 @@ td, tr{
|
|||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.project .name,
|
.project:not(.list) .name,
|
||||||
.task .name{
|
.task .name{
|
||||||
font-size: 32px;
|
font-size: 32px;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.symbol{
|
||||||
|
padding: 1px;
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user