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'
|
|
|
|
import { ChannelsView } 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-02-07 09:21:59 +00:00
|
|
|
import { showPanel } from '@anticrm/ui'
|
|
|
|
import view from '@anticrm/view'
|
2021-10-31 09:54:56 +00:00
|
|
|
|
|
|
|
export let candidate: Candidate
|
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-02-07 09:21:59 +00:00
|
|
|
<div class="flex-col h-full card-container" on:click={() => {
|
|
|
|
showPanel(view.component.EditDoc, candidate._id, candidate._class, 'full')
|
|
|
|
}}>
|
2021-10-31 09:54:56 +00:00
|
|
|
<div class="label">CANDIDATE</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-02-07 09:39:23 +00:00
|
|
|
<div class="name lines-limit-2">{formatName(candidate.name)}</div>
|
|
|
|
<div class="description lines-limit-2">{candidate.title ?? ''}</div>
|
|
|
|
<div class="description overflow-label">{candidate.city ?? ''}</div>
|
2022-02-07 09:03:14 +00:00
|
|
|
<div class="footer"><ChannelsView value={channels} size={'small'} on:click /></div>
|
2021-10-31 09:54:56 +00:00
|
|
|
{/if}
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<style lang="scss">
|
|
|
|
.card-container {
|
2022-02-07 09:21:59 +00:00
|
|
|
cursor: pointer;
|
2021-10-31 09:54:56 +00:00
|
|
|
padding: 1rem 1.5rem 1.25rem;
|
|
|
|
background-color: var(--theme-button-bg-enabled);
|
|
|
|
border: 1px solid var(--theme-bg-accent-color);
|
|
|
|
border-radius: .75rem;
|
|
|
|
|
2022-02-07 09:21:59 +00:00
|
|
|
&:hover {
|
|
|
|
&:hover .name {
|
|
|
|
text-decoration: underline;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2021-10-31 09:54:56 +00:00
|
|
|
.label {
|
|
|
|
margin-bottom: 1.75rem;
|
|
|
|
font-weight: 500;
|
|
|
|
font-size: .625rem;
|
|
|
|
color: var(--theme-content-dark-color);
|
|
|
|
}
|
|
|
|
.name {
|
|
|
|
margin: 1rem 0 .25rem;
|
|
|
|
font-weight: 500;
|
|
|
|
font-size: 1rem;
|
|
|
|
color: var(--theme-caption-color);
|
|
|
|
}
|
|
|
|
.description {
|
|
|
|
font-size: .75rem;
|
|
|
|
color: var(--theme-content-dark-color);
|
|
|
|
}
|
|
|
|
.footer { margin-top: 1.5rem; }
|
|
|
|
}
|
|
|
|
</style>
|