some fixes in resume

This commit is contained in:
iIronside 2022-11-08 14:15:31 +03:00
parent 16df34d391
commit 28d33761ca
5 changed files with 61 additions and 42 deletions

View File

@ -296,7 +296,8 @@ class UserCardController extends Controller
// (B) ADD HTML CONTENT
$section = $pw->addSection();
\PhpOffice\PhpWord\Shared\Html::addHtml($section, $model->resume_text, false, false);
$resumeText = str_replace(array('<br/>', '<br>', '</br>'), ' ', $model->resume_text);
\PhpOffice\PhpWord\Shared\Html::addHtml($section, $resumeText, false, false);
// (C) SAVE TO DOCX ON SERVER
// $pw->save("convert.docx", "Word2007");

View File

@ -50,95 +50,110 @@ use yii\widgets\ActiveForm;
</thead>
<tbody>
<tr class="info">
<td>ФИО</td>
<td class="table-cell">ФИО</td>
<td class="table-cell">${fio}</td>
</tr>
<tr class="info">
<td>Паспорт</td>
<td class="table-cell">Паспорт</td>
<td class="table-cell">${passport}</td>
</tr>
<tr class="info">
<td>Электронная почта</td>
<td class="table-cell">Электронная почта</td>
<td class="table-cell">${email}</td>
</tr>
<tr class="info">
<td>Пол</td>
<td class="table-cell">Пол</td>
<td class="table-cell">${gender}</td>
</tr>
<tr class="info">
<td>Резюме</td>
<td class="table-cell">Резюме</td>
<td class="table-cell">${resume}</td>
</tr>
<tr class="info">
<td>Зароботная плата</td>
<td class="table-cell">Зароботная плата</td>
<td class="table-cell">${salary}</td>
</tr>
<tr class="info">
<td>Позиция</td>
<td class="table-cell">Позиция</td>
<td class="table-cell">${position_id}</td>
</tr>
<tr class="info">
<td>Город</td>
<td class="table-cell">Город</td>
<td class="table-cell">${city}</td>
</tr>
<tr class="info">
<td>Ссылка ВК</td>
<td class="table-cell">Ссылка ВК</td>
<td class="table-cell">${link_vk}</td>
</tr>
<tr class="info">
<td>Ссылка Телграм</td>
<td class="table-cell">Ссылка Телграм</td>
<td class="table-cell">${link_telegram}</td>
</tr>
<tr class="info">
<td>Резюме текст</td>
<td class="table-cell">Резюме текст</td>
<td class="table-cell">${vc_text}</td>
</tr>
<tr class="info">
<td>Уровень</td>
<td class="table-cell">Уровень</td>
<td class="table-cell">${level}</td>
</tr>
<tr class="info">
<td>Резюме текст</td>
<td class="table-cell">Резюме текст</td>
<td class="table-cell">${vc_text}</td>
</tr>
<tr class="info">
<td>Резюме короткий текст</td>
<td class="table-cell">Резюме короткий текст</td>
<td class="table-cell">${vc_text_short}</td>
</tr>
<tr class="info">
<td>Лет опыта</td>
<td class="table-cell">Лет опыта</td>
<td class="table-cell">${years_of_exp}</td>
</tr>
<tr class="info">
<td>Спецификация</td>
<td class="table-cell">Спецификация</td>
<td class="table-cell">${specification}</td>
</tr>
<tr class="info">
<td>Навыки</td>
<td class="table-cell">Навыки</td>
<td class="table-cell">${skills}</td>
</tr>
</tbody>
</table>
</div>
<div>
<p>
Нажмите на ячейку чтобы скопировать содержимое
</p>
</div>
</div>
</div>
<!--<script>-->
<!-- document.querySelectorAll(".table-cell").forEach(function(elm){-->
<!-- elm.addEventListener("mouseover", function(e){-->
<!-- e.target.style.backgroundColor = '#76d7c4';-->
<!-- var copyText = e.target.textContent;-->
<!-- const el = document.createElement('textarea');-->
<!-- el.value = copyText;-->
<!-- document.body.appendChild(el);-->
<!-- el.select();-->
<!-- document.execCommand('copy');-->
<!-- document.body.removeChild(el);-->
<!---->
<!-- /* Alert the copied text */-->
<!-- alert("Copied the text: " + el.value);-->
<!-- });-->
<!-- })-->
<!--</script>-->
<script>
const popup = document.createElement('h4')
popup.textContent = 'Скопировано'
popup.style.cssText = `
background: #a6caf0;
position: absolute;
right: 0;
top: 0;
`
document.querySelectorAll('.table-cell').forEach(function (elm) {
elm.style.position = 'relative'
elm.addEventListener('click', function (e) {
e.target.style.backgroundColor = '#76d7c4'
var copyText = e.target.textContent
const el = document.createElement('textarea')
el.value = copyText
document.body.appendChild(el)
el.select()
document.execCommand('copy')
document.body.removeChild(el)
elm.appendChild(popup)
setTimeout(() => {
elm.removeChild(popup)
}, 1000)
})
})
</script>

View File

@ -26,7 +26,7 @@ use yii\widgets\ActiveForm;
</div>
</div>
<div class="row" style="padding-bottom: 15px">add_a_test_task_completion_date_to_ucer_card
<div class="row" style="padding-bottom: 15px">
<div class="imgUpload col-xs-6">
<div class="media__upload_img"><img src="<?= $model->photo; ?>" width="100px"/></div>
<?php
@ -47,7 +47,6 @@ use yii\widgets\ActiveForm;
?>
</div>
<div class="col-xs-6">
<!--<div class="media__upload_img"><img src="<? /*= $model->photo; */ ?>" width="100px"/></div>-->
<?php
echo InputFile::widget([
'language' => 'ru',

View File

@ -16,6 +16,10 @@ $this->params['breadcrumbs'][] = ['label' => $model->id, 'url' => ['view', 'id'
$this->params['breadcrumbs'][] = 'Резюме';
?>
<div class="form-group">
<?= Html::a('Редактировать профиль', ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?>
</div>
<div class="resume-form">
<?php $form = ActiveForm::begin([
'id' => 'text-by-template-form',

View File

@ -7,7 +7,6 @@
foreach ($userStatuses as $key => $status) {
$menuItems[] = ['label' => $status, 'icon' => 'id-card', 'url' => ['/card/user-card?UserCardSearch[status]=' . $key], 'active' => \Yii::$app->controller->id == 'user-card',];
}
$menuItems[] = ['label' => 'Шаблоны резюме', 'icon' => 'file', 'url' => ['/card/resume-template'], 'active' => \Yii::$app->controller->id == 'resume-template'];
$projectStatuses = \common\models\Status::getStatusesArray(\common\models\UseStatus::USE_PROJECT);
$projectItems = [['label' => 'Все', 'icon' => 'cubes', 'url' => ['/project/project'], 'active' => \Yii::$app->controller->id == 'project']];
@ -28,13 +27,14 @@
['label' => 'Доп. поля', 'icon' => 'file-text-o', 'url' => ['/settings/additional-fields'], 'active' => \Yii::$app->controller->id == 'additional-fields'],
['label' => 'Должность', 'icon' => 'spotify', 'url' => ['/settings/position'], 'active' => \Yii::$app->controller->id == 'position'],
['label' => 'Навыки', 'icon' => 'flask', 'url' => ['/settings/skill'], 'active' => \Yii::$app->controller->id == 'skill'],
['label' => 'Шаблоны резюме', 'icon' => 'file', 'url' => ['/card/resume-template'], 'active' => \Yii::$app->controller->id == 'resume-template']
],
//'visible' => Yii::$app->user->can('confidential_information')
'visible' => Yii::$app->user->can('confidential_information')
],
[
'label' => 'Профили', 'icon' => 'address-book-o', 'url' => '#', //'active' => \Yii::$app->controller->id == 'user-card',
'label' => 'Профили', 'icon' => 'address-book-o', 'url' => '#',
'items' => $menuItems,
//'visible' => Yii::$app->user->can('confidential_information')
'visible' => Yii::$app->user->can('confidential_information')
],
[
'label' => 'Сотрудники', 'icon' => 'users', 'url' => '#',
@ -62,7 +62,7 @@
'visible' => Yii::$app->user->can('confidential_information')
],
[
'label' => 'Проекты', 'icon' => 'cubes', 'url' => ['#'], //'active' => \Yii::$app->controller->id == 'project',
'label' => 'Проекты', 'icon' => 'cubes', 'url' => ['#'],
'items' => $projectItems,
'visible' => Yii::$app->user->can('confidential_information')
],