Merge branch 'main' into module/projects
This commit is contained in:
@@ -179,6 +179,30 @@
|
||||
router.navigate(`/task/${task_id}/view`)
|
||||
}
|
||||
|
||||
async function save_bookmark(){
|
||||
const user_ids = Object.values(project.members).map(member => member.user.id);
|
||||
const data = {
|
||||
url: location.href,
|
||||
tags: ['Kanban', project.name, filter_input],
|
||||
comment: `${project.name}: ${filter_input}`,
|
||||
share: user_ids
|
||||
}
|
||||
const url = api('bookmark');
|
||||
const resp = await fetch(url,{
|
||||
credentials : 'include',
|
||||
method : 'POST',
|
||||
body : JSON.stringify(data)
|
||||
});
|
||||
if (resp.ok) {
|
||||
yikes();
|
||||
router.navigate('/bookmark');
|
||||
} else {
|
||||
error(resp);
|
||||
}
|
||||
|
||||
console.log(data);
|
||||
}
|
||||
|
||||
onMount(load);
|
||||
</script>
|
||||
|
||||
@@ -199,6 +223,9 @@
|
||||
<span class="filter">
|
||||
<input type="text" bind:value={filter_input} autofocus />
|
||||
{t('filter')}
|
||||
<button style="visibility:{filter_input ? 'visible' : 'hidden'}" onclick={save_bookmark}>
|
||||
<span class="symbol"></span> {t('save_object',{object:t('bookmark')})}
|
||||
</button>
|
||||
</span>
|
||||
<div class="head">{t('user')}</div>
|
||||
{#if project.allowed_states}
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
{#if module=='bookmark'}
|
||||
{@html target(object.comment.rendered).replace(/<p>(.*?)<\/p>/, '$1')} <!-- this is a workaround for in-proper formatting of paragraphs within list items in firefox -->
|
||||
<p>
|
||||
<a href={object.url}>{object.url}</a>
|
||||
<a href={object.url} target="_blank">{object.url}</a>
|
||||
</p>
|
||||
<hr/>
|
||||
{:else if module=='task' || module=='project'}
|
||||
|
||||
Reference in New Issue
Block a user