started to implement project tagging, was interrupted.

next on: saving tags for user = null
This commit is contained in:
2025-07-28 08:49:44 +02:00
parent 0aa7aa67dc
commit 382eae000c
7 changed files with 74 additions and 22 deletions

View File

@@ -5,19 +5,21 @@
import CompanySelector from '../../Components/CompanySelector.svelte';
import MarkdownEditor from '../../Components/MarkdownEditor.svelte';
import Settings from './Settings.svelte';
let showSettings = $state(false);
let ready = $derived(!!project.name.trim())
import Tags from '../tags/TagList.svelte';
let error = $state(null);
let ready = $derived(!!project.name.trim())
const router = useTinyRouter();
let showSettings = $state(false);
let project = $state({
name:'',
description : { source : '', rendered : '' },
settings:{
show_closed:false
}
},
tags: []
});
async function onsubmit(ev){
@@ -40,6 +42,11 @@
project.company_id = company.id;
console.log(project);
}
function toggleSettings(ev){
ev.preventDefault();
showSettings = !showSettings;
}
</script>
<style>
@@ -82,22 +89,39 @@
<MarkdownEditor bind:value={project.description} simple={true} />
</td>
</tr>
{#if !showSettings}
{#if showSettings}
<tr>
<th>
{t('settings')}
</th>
<td>
<button onclick={() => showSettings = true}>{t('extended_settings')}</button>
<label>
<input type="checkbox" bind:checked={project.settings.show_closed} />
{t('display_closed_tasks')}
</label>
</td>
</tr>
{:else}
<tr>
<th>
{t('settings')}
</th>
<td>
<button onclick={toggleSettings} >{t('extended_settings')}</button>
</td>
</tr>
{/if}
<tr>
<th>
{t('tags')}
</th>
<td>
<Tags module="project" bind:tags={project.tags} />
</td>
</tr>
</tbody>
</table>
</fieldset>
{#if showSettings}
<Settings bind:settings={project.settings}/>
{/if}
<button type="submit" disabled={!ready}>{t('create')}</button>
</fieldset>
</form>