2021-10-31 09:54:56 +00:00
|
|
|
<!--
|
|
|
|
// Copyright © 2020 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">
|
2022-02-07 09:21:59 +00:00
|
|
|
import contact, { Channel, formatName } from '@anticrm/contact'
|
2022-04-21 09:38:09 +00:00
|
|
|
import { ChannelsEditor } from '@anticrm/contact-resources'
|
2022-02-07 09:03:14 +00:00
|
|
|
import { Avatar, createQuery } from '@anticrm/presentation'
|
2021-10-31 09:54:56 +00:00
|
|
|
import type { Candidate } from '@anticrm/recruit'
|
2022-03-19 16:17:23 +00:00
|
|
|
import { Component, Label, showPanel } from '@anticrm/ui'
|
2022-02-07 09:21:59 +00:00
|
|
|
import view from '@anticrm/view'
|
2022-03-01 03:32:18 +00:00
|
|
|
import chunter from '@anticrm/chunter'
|
|
|
|
import attachment from '@anticrm/attachment'
|
2022-03-19 16:17:23 +00:00
|
|
|
import recruit from '../plugin'
|
2021-10-31 09:54:56 +00:00
|
|
|
|
|
|
|
export let candidate: Candidate
|
2022-04-13 04:25:59 +00:00
|
|
|
export let disabled: boolean = false
|
2022-02-07 09:03:14 +00:00
|
|
|
|
|
|
|
let channels: Channel[] = []
|
|
|
|
const channelsQuery = createQuery()
|
|
|
|
channelsQuery.query(
|
|
|
|
contact.class.Channel,
|
|
|
|
{
|
|
|
|
attachedTo: candidate._id
|
|
|
|
},
|
|
|
|
(res) => {
|
|
|
|
channels = res
|
|
|
|
}
|
|
|
|
)
|
2021-10-31 09:54:56 +00:00
|
|
|
</script>
|
|
|
|
|
2022-03-04 09:01:46 +00:00
|
|
|
<div class="flex-col h-full card-container">
|
2022-06-07 13:49:13 +00:00
|
|
|
<div class="label uppercase"><Label label={recruit.string.Talent} /></div>
|
2021-11-15 13:51:24 +00:00
|
|
|
<Avatar avatar={candidate.avatar} size={'large'} />
|
2021-10-31 09:54:56 +00:00
|
|
|
{#if candidate}
|
2022-04-29 05:27:17 +00:00
|
|
|
<div
|
|
|
|
class="name lines-limit-2"
|
|
|
|
class:over-underline={!disabled}
|
|
|
|
on:click={() => {
|
|
|
|
if (!disabled) showPanel(view.component.EditDoc, candidate._id, candidate._class, 'content')
|
|
|
|
}}
|
|
|
|
>
|
|
|
|
{formatName(candidate.name)}
|
|
|
|
</div>
|
2022-02-07 09:39:23 +00:00
|
|
|
<div class="description lines-limit-2">{candidate.title ?? ''}</div>
|
|
|
|
<div class="description overflow-label">{candidate.city ?? ''}</div>
|
2022-03-01 03:32:18 +00:00
|
|
|
<div class="footer flex flex-reverse flex-grow">
|
2022-04-29 05:27:17 +00:00
|
|
|
<div class="flex-center flex-wrap">
|
|
|
|
<Component
|
|
|
|
is={chunter.component.CommentsPresenter}
|
2022-05-19 07:14:05 +00:00
|
|
|
props={{ value: candidate.comments, object: candidate, size: 'medium', showCounter: true }}
|
2022-04-29 05:27:17 +00:00
|
|
|
/>
|
|
|
|
<Component
|
|
|
|
is={attachment.component.AttachmentsPresenter}
|
2022-05-19 07:14:05 +00:00
|
|
|
props={{ value: candidate.attachments, object: candidate, size: 'medium', showCounter: true }}
|
2022-04-29 05:27:17 +00:00
|
|
|
/>
|
2022-03-01 03:32:18 +00:00
|
|
|
</div>
|
2022-04-21 09:38:09 +00:00
|
|
|
{#if channels[0]}
|
2022-04-29 05:27:17 +00:00
|
|
|
<div class="flex flex-grow">
|
|
|
|
<ChannelsEditor
|
|
|
|
attachedTo={channels[0].attachedTo}
|
|
|
|
attachedClass={channels[0].attachedToClass}
|
|
|
|
length={'short'}
|
|
|
|
editable={false}
|
|
|
|
/>
|
2022-04-21 09:38:09 +00:00
|
|
|
</div>
|
|
|
|
{/if}
|
2022-03-01 03:32:18 +00:00
|
|
|
</div>
|
2021-10-31 09:54:56 +00:00
|
|
|
{/if}
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<style lang="scss">
|
|
|
|
.card-container {
|
|
|
|
padding: 1rem 1.5rem 1.25rem;
|
2022-04-05 08:02:08 +00:00
|
|
|
background-color: var(--board-card-bg-color);
|
2022-04-13 04:25:59 +00:00
|
|
|
border: 1px solid var(--divider-color);
|
2022-04-29 05:27:17 +00:00
|
|
|
border-radius: 0.5rem;
|
2022-04-13 04:25:59 +00:00
|
|
|
transition-property: box-shadow, background-color, border-color;
|
|
|
|
transition-timing-function: var(--timing-shadow);
|
2022-04-29 05:27:17 +00:00
|
|
|
transition-duration: 0.15s;
|
2022-05-12 11:29:49 +00:00
|
|
|
user-select: text;
|
2022-04-05 08:02:08 +00:00
|
|
|
|
2022-04-09 07:01:07 +00:00
|
|
|
&:hover {
|
|
|
|
background-color: var(--board-card-bg-hover);
|
2022-04-13 04:25:59 +00:00
|
|
|
border-color: var(--button-border-color);
|
2022-05-12 11:29:49 +00:00
|
|
|
box-shadow: var(--accent-shadow);
|
2022-04-09 07:01:07 +00:00
|
|
|
}
|
2021-10-31 09:54:56 +00:00
|
|
|
|
|
|
|
.label {
|
|
|
|
margin-bottom: 1.75rem;
|
|
|
|
font-weight: 500;
|
2022-04-29 05:27:17 +00:00
|
|
|
font-size: 0.625rem;
|
2021-10-31 09:54:56 +00:00
|
|
|
color: var(--theme-content-dark-color);
|
|
|
|
}
|
|
|
|
.name {
|
2022-04-29 05:27:17 +00:00
|
|
|
margin: 1rem 0 0.25rem;
|
2021-10-31 09:54:56 +00:00
|
|
|
font-weight: 500;
|
|
|
|
font-size: 1rem;
|
|
|
|
color: var(--theme-caption-color);
|
|
|
|
}
|
|
|
|
.description {
|
2022-04-29 05:27:17 +00:00
|
|
|
font-size: 0.75rem;
|
2021-10-31 09:54:56 +00:00
|
|
|
color: var(--theme-content-dark-color);
|
|
|
|
}
|
2022-04-29 05:27:17 +00:00
|
|
|
.footer {
|
2022-03-01 03:32:18 +00:00
|
|
|
margin-top: 1.5rem;
|
2022-04-21 09:38:09 +00:00
|
|
|
// overflow: hidden;
|
2022-03-01 03:32:18 +00:00
|
|
|
}
|
2021-10-31 09:54:56 +00:00
|
|
|
}
|
2022-04-29 05:27:17 +00:00
|
|
|
</style>
|