2021-08-07 17:03:06 +00:00
|
|
|
<!--
|
|
|
|
// Copyright © 2020, 2021 Anticrm Platform Contributors.
|
|
|
|
//
|
|
|
|
// Licensed under the Eclipse Public License, Version 2.0 (the "License");
|
|
|
|
// you may not use this file except in compliance with the License. You may
|
|
|
|
// obtain a copy of the License at https://www.eclipse.org/legal/epl-2.0
|
|
|
|
//
|
|
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
//
|
|
|
|
// See the License for the specific language governing permissions and
|
|
|
|
// limitations under the License.
|
|
|
|
-->
|
|
|
|
|
|
|
|
<script lang="ts">
|
2021-11-19 15:05:58 +00:00
|
|
|
import { Avatar } from '@anticrm/presentation'
|
2022-01-11 09:05:53 +00:00
|
|
|
import { showPopup, ActionIcon, IconMoreH } from '@anticrm/ui'
|
2021-09-07 08:36:50 +00:00
|
|
|
import type { WithLookup } from '@anticrm/core'
|
|
|
|
import type { Applicant } from '@anticrm/recruit'
|
2021-08-07 17:03:06 +00:00
|
|
|
|
2021-12-07 09:05:52 +00:00
|
|
|
import { CommentsPresenter } from '@anticrm/chunter-resources'
|
|
|
|
import { AttachmentsPresenter } from '@anticrm/attachment-resources'
|
2021-10-01 12:28:52 +00:00
|
|
|
import { formatName } from '@anticrm/contact'
|
2021-11-19 15:05:20 +00:00
|
|
|
import ApplicationPresenter from './ApplicationPresenter.svelte'
|
2021-12-18 13:59:03 +00:00
|
|
|
import { EditContact } from '@anticrm/contact-resources'
|
2021-09-27 17:24:15 +00:00
|
|
|
|
2021-09-07 08:36:50 +00:00
|
|
|
export let object: WithLookup<Applicant>
|
2021-08-07 17:03:06 +00:00
|
|
|
export let draggable: boolean
|
|
|
|
|
2022-01-11 09:05:53 +00:00
|
|
|
function showCandidate () {
|
2021-12-18 13:59:03 +00:00
|
|
|
showPopup(EditContact, { _id: object.attachedTo }, 'full')
|
2021-09-27 16:44:09 +00:00
|
|
|
}
|
2021-08-07 17:03:06 +00:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<div class="card-container" {draggable} class:draggable on:dragstart on:dragend>
|
2021-12-20 10:18:50 +00:00
|
|
|
<div class="flex-between mb-3">
|
|
|
|
<Avatar avatar={object.$lookup?.attachedTo?.avatar} size={'medium'} />
|
|
|
|
<div class="flex-grow flex-col min-w-0 ml-2">
|
|
|
|
<div class="fs-title over-underline lines-limit-2" on:click={showCandidate}>{formatName(object.$lookup?.attachedTo?.name)}</div>
|
|
|
|
<div class="small-text lines-limit-2">{object.$lookup?.attachedTo?.title ?? ''}</div>
|
2021-09-07 08:36:50 +00:00
|
|
|
</div>
|
2021-12-20 10:18:50 +00:00
|
|
|
<div class="tool"><ActionIcon label={'More...'} icon={IconMoreH} size={'small'} /></div>
|
2021-09-07 08:36:50 +00:00
|
|
|
</div>
|
2021-10-13 20:04:18 +00:00
|
|
|
<div class="flex-between">
|
2021-09-07 08:36:50 +00:00
|
|
|
<div class="flex-row-center">
|
2021-11-19 15:05:20 +00:00
|
|
|
<div class="sm-tool-icon step-lr75">
|
|
|
|
<ApplicationPresenter value={object} />
|
2021-09-07 08:36:50 +00:00
|
|
|
</div>
|
2021-11-30 11:14:30 +00:00
|
|
|
{#if object.attachments ?? 0 > 0}
|
2021-10-23 15:30:22 +00:00
|
|
|
<div class="step-lr75"><AttachmentsPresenter value={object} /></div>
|
2021-10-13 20:04:18 +00:00
|
|
|
{/if}
|
2021-11-30 11:14:30 +00:00
|
|
|
{#if object.comments ?? 0 > 0}
|
|
|
|
<div class="step-lr75"><CommentsPresenter value={object} /></div>
|
|
|
|
{/if}
|
2021-08-07 17:03:06 +00:00
|
|
|
</div>
|
2021-10-13 20:04:18 +00:00
|
|
|
<Avatar size={'x-small'} />
|
2021-08-07 17:03:06 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<style lang="scss">
|
|
|
|
.card-container {
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
2021-10-13 20:04:18 +00:00
|
|
|
padding: 1rem 1.25rem;
|
|
|
|
background-color: rgba(222, 222, 240, .06);
|
2021-08-17 14:46:06 +00:00
|
|
|
border-radius: .75rem;
|
2021-08-07 17:03:06 +00:00
|
|
|
user-select: none;
|
|
|
|
|
2021-09-28 11:59:35 +00:00
|
|
|
&.draggable { cursor: grab; }
|
2021-08-07 17:03:06 +00:00
|
|
|
}
|
2021-12-20 10:18:50 +00:00
|
|
|
.tool { align-self: start; }
|
2021-08-07 17:03:06 +00:00
|
|
|
</style>
|