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">
|
|
|
|
import type { Vacancy } from '@anticrm/recruit'
|
2022-03-19 16:17:23 +00:00
|
|
|
import { closePanel, closePopup, closeTooltip, getCurrentLocation, Label, navigate } from '@anticrm/ui'
|
|
|
|
import VacancyIcon from './icons/Vacancy.svelte'
|
|
|
|
import contact, { Organization } from '@anticrm/contact'
|
|
|
|
import recruit from '../plugin'
|
|
|
|
import { getClient } from '@anticrm/presentation'
|
|
|
|
import { Ref } from '@anticrm/core'
|
2021-10-31 09:54:56 +00:00
|
|
|
|
|
|
|
export let vacancy: Vacancy
|
2022-03-19 16:17:23 +00:00
|
|
|
let company: Organization | undefined
|
|
|
|
|
|
|
|
$: getOrganization(vacancy?.company)
|
|
|
|
const client = getClient()
|
|
|
|
|
|
|
|
async function getOrganization (_id: Ref<Organization> | undefined): Promise<void> {
|
|
|
|
if (_id === undefined) {
|
|
|
|
company = undefined
|
|
|
|
} else {
|
|
|
|
company = await client.findOne(contact.class.Organization, { _id })
|
|
|
|
}
|
|
|
|
}
|
2021-10-31 09:54:56 +00:00
|
|
|
</script>
|
|
|
|
|
2021-12-28 09:12:47 +00:00
|
|
|
<div class="flex-col h-full card-container">
|
2022-03-19 16:17:23 +00:00
|
|
|
<div class="label uppercase"><Label label={recruit.string.Vacancy} /></div>
|
2021-10-31 09:54:56 +00:00
|
|
|
<div class="flex-center logo">
|
2022-03-19 16:17:23 +00:00
|
|
|
<VacancyIcon size={'large'} />
|
2021-10-31 09:54:56 +00:00
|
|
|
</div>
|
|
|
|
{#if vacancy}
|
2022-03-04 09:01:46 +00:00
|
|
|
<div class="name lines-limit-2 over-underline" on:click={() => {
|
|
|
|
closeTooltip()
|
|
|
|
closePopup()
|
|
|
|
closePanel()
|
|
|
|
const loc = getCurrentLocation()
|
|
|
|
loc.path[2] = vacancy._id
|
|
|
|
loc.path.length = 3
|
|
|
|
navigate(loc)
|
|
|
|
}}>{vacancy.name}</div>
|
2022-03-19 16:17:23 +00:00
|
|
|
{#if company}
|
|
|
|
<span class="label">{company.name}</span>
|
|
|
|
{/if}
|
2022-02-07 09:39:23 +00:00
|
|
|
<div class="description lines-limit-2">{vacancy.description ?? ''}</div>
|
2021-10-31 09:54:56 +00:00
|
|
|
{/if}
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<style lang="scss">
|
|
|
|
.card-container {
|
|
|
|
padding: 1rem 1.5rem 1.25rem;
|
|
|
|
background-color: var(--theme-button-bg-enabled);
|
|
|
|
border: 1px solid var(--theme-bg-accent-color);
|
|
|
|
border-radius: .75rem;
|
|
|
|
|
|
|
|
.logo {
|
|
|
|
width: 5rem;
|
|
|
|
height: 5rem;
|
|
|
|
color: var(--primary-button-color);
|
|
|
|
background-color: var(--primary-button-enabled);
|
|
|
|
border-radius: 50%;
|
|
|
|
}
|
|
|
|
.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);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|