trexima / european-cv

此包提供创建欧洲格式简历的表单。

1.0.4 2022-05-04 13:51 UTC

This package is auto-updated.

Last update: 2024-09-04 18:47:28 UTC


README

此包提供创建欧洲格式简历的表单。它还可选地嵌入所需的JS和预定义的CSS。简历可以保存到数据库,导出为DOC或PDF格式。

安装

添加到 composer.json

composer require trexima/european-cv

JS和CSS库

yarn add bootstrap
yarn add @fortawesome/fontawesome-free
yarn add jquery
yarn add jquery-ui
yarn add blueimp-file-upload
yarn add sortablejs
yarn add jquery.dirtyforms
yarn add select2
yarn add select2-bootstrap-theme
yarn add parsleyjs
yarn add flatpickr
yarn add bs-custom-file-input

注意:对于必需的外部库,请包括

./vendor/trexima/european-cv-bundle/Resources/assets/css/shared.scss

使用Webpack encore安装资源

Encore.addEntry('trexima-european-cv', [
    './vendor/trexima/european-cv/Resources/assets/js/main.js',
    './vendor/trexima/european-cv/Resources/public/build/trexima-european-cv.css'
])

该jQuery.dirtyforms的糟糕处理(webpack.config.js)

const config = Encore.getWebpackConfig();
// Required because of bug in jquery.dirtyforms https://github.com/snikch/jquery.dirtyforms/issues/82
config.externals = {
    window: 'window',
    document: 'document'
};

// export the final configuration
module.exports = config;

将CSS和JS添加到Twig模板中

{% block stylesheets %}
    {{ encore_entry_link_tags('trexima-european-cv') }}
    {{ parent() }}
{% endblock %}

{% block javascripts %}
    {{ encore_entry_script_tags('trexima-european-cv') }}
    {{ parent() }}
{% endblock %}

配置

将上传路由添加到全局配置中

trexima_european_cv_annotations:
    resource: '@TreximaEuropeanCvBundle/Controller/'
    type:     annotation

AJAX图片上传的路由名称

trexima_european_cv_bundle_image

定义与欧洲简历和上传目录相关联的实体

trexima_european_cv:
  upload_url: '/uploads/european-cv/'
  upload_dir: '%kernel.project_dir%/public/uploads/european-cv/'
  user_class: App\Entity\User

trexima_european_cv.yaml

注意:不要忘记更新Doctrine模式。

翻译

如果您希望使用此包提供的默认文本,请确保您在配置中启用了翻译器。

framework:
    translator: ~