Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- cvs_controller#show:
- def show
- respond_to do |format|
- format.json { render json: { cv: CvSerializer.new(@cv) } }
- format.pdf do
- set_avatar
- render pdf: "Curriculum vitae for #{@employee.last_name}",
- page_size: 'A4', encoding: 'UTF-8', layout: 'pdf',
- template: 'api/v1/pdf.html.slim', margin: { top: 1, bottom: 0, left: 0, right: 0 }
- end
- format.docx { headers['Content-Disposition'] = "attachment; filename=\"CV for #{@employee.last_name}.docx\"" }
- end
- end
- api/v1/pdf.html.slim
- pdf-wrapper(style='font-family: Arial, Verdana, sans-serif;')
- - if params['with_logo']
- .logo
- = wicked_pdf_image_tag('logo.svg', style: 'height:50px; width:auto;position:absolute;right:80px;top:60px;')
- .cv-container(style='padding: 0px;')
- .left-image-block(style='height:535px;width: 30%; float:left')
- .photo(style='height:510px; position: absolute; z-index:-1')
- = wicked_pdf_image_tag 'red-circle.svg', style: 'height: 100%'
- .photo(style='border-radius: 50%; border-collapse: collapse;border-collapse: separate;position: absolute; top:110px;left:30px;')
- img(style='border-radius: 50%;height:350px;', src=embed_remote_image(@avatar))
- .right-name-block(style='width: 68%; float:right;')
- .top-block-info(style='padding-top:50px;padding-left:12px;')
- h1(style='font-size: 56px;font-weight: normal;color: #EF4523;margin-bottom: 0;') = raw(@cv.info_by_selector '.name')
- h1(style='font-size: 30px;font-weight: normal;color:#434343;text-transform: capitalize;') = raw(@cv.info_by_selector '.position')
- .numeric_values(style='display: -webkit-box;')
- div(style='padding-right: 50px;border-bottom: 3px solid #EF4523;margin-bottom: 20px;')
- = @cv.info_for_table('.years_of_experience').each_slice(2) do |aa|
- span(style='color: #EF4523;font-size: 35px;')= @cv.employee.years_of_experience
- p(style='margin-top:-5px;')= aa[1]
- div(style='border-bottom: 3px solid #EF4523;margin-bottom: 20px;')
- = @cv.info_for_table('.projects').each_slice(2) do |aa|
- span(style='color: #EF4523;font-size: 35px;')= aa[0]
- p(style='margin-top:-5px;')= aa[1]
- .about
- .about__text(style='font-size:21px;color:#212529;')
- = raw @cv.text_content('.about')
- .board(style='clear:both;')
- .left-block-hard-skills(style='float:left; width:20%;margin-left:65px;')
- .hard-skills(style='margin-top: 35px;')
- .hard-skills__title(style='position: relative;border-bottom:1px solid #000000;padding-bottom:0; margin: 35px 10px 35px 0;')
- p(style='color: #EF4523;font-size: 24px;text-transform: uppercase;') = raw @cv.info_by_selector '.hard-skills__title'
- table.hard-skills__table(style='width: 100%;')
- - years = ((DateTime.now.year - 3)..(DateTime.now.year)).to_a
- thead
- tr
- th
- - years.each do |year|
- th = year
- tbody
- - @employee.hard_skills.each do |skill|
- tr
- td = skill.name
- - years.each do |year|
- td = raw dots_to_pdf(skill, year)
- tr
- td style='color:Grey' = hard_skill_duration(skill)
- .soft-skills
- .soft-skills__title(style='position: relative; color: #EF4523;font-size: 24px;text-transform: uppercase;border-bottom:1px solid #000000;padding-bottom:0;margin: 35px 10px 35px 0;')
- p = raw @cv.info_by_selector('.soft-skills__title')
- ul.soft-skills__list(style='white-space: nowrap; list-style-type: none; padding-left: 0;')
- - @cv.info_for_table('.soft-skills__list').map{|el| parse_list(el, 'soft-skills__skill-name') }.each do |soft_skill|
- .li(style='padding-bottom:10px;')
- .soft-skills__bullet(style='vertical-align: middle; display:inline-block; background: #EF4523; border-radius: 50%; width:16px; height:16px;')
- .soft-skills__skill-name(style='vertical-align: middle; white-space: normal; display: inline-block; word-break: break-word;padding-left:20px;')
- = raw soft_skill
- - unless @cv.info_by_selector('.education').empty?
- .education
- .education__title(style='position: relative; color: #EF4523;font-size: 24px;text-transform: uppercase;border-bottom:1px solid #000000;padding-bottom:0;margin: 35px 10px 35px 0;')
- p = raw @cv.info_by_selector('.education__title')
- - @cv.info_for_table('.education').drop(1).each_slice(3) do |education|
- .education__years(style='font-size: 20;margin-bottom: 10px;')
- = raw education[0]
- .education__uni(style='font-size: 20px;margin-bottom: 10px;')
- = raw education[1]
- .education_speciality(style='font-size: 20px;margin-bottom: 20px;')
- = raw education[-1]
- - unless @cv.info_by_selector('.languages').empty?
- .languages__title(style='position: relative; color: #EF4523;font-size: 24px;text-transform: uppercase;border-bottom:1px solid #000000;padding-bottom:0;margin: 35px 10px 35px 0;')
- p = raw @cv.info_by_selector('.languages__title')
- .languages__table(style='display: table;')
- - @cv.info_for_table('.languages__table:last').each do |language|
- .language__level(style='font-size: 20px;margin-bottom: 10px;')
- = raw language
- .publications
- .publications__title(style='position: relative; color: #EF4523;font-size: 24px;text-transform: uppercase;border-bottom:1px solid #000000;padding-bottom:0;margin: 35px 10px 35px 0;')
- p = raw @cv.info_by_selector('.publications__title')
- ul.publications__list(style='white-space: nowrap; list-style-type: none; padding-left: 0;')
- - @cv.info_for_table('.publications__list').map{|el| parse_list(el, 'publication__name') }.each do |publication|
- .li
- .publication__bullet(style='vertical-align: middle; display:inline-block; background: #EF4523; border-radius:50%; width:11px;height:11px;')
- .publication__name(style='vertical-align: middle; white-space: normal; display: inline-block; word-break: break-word;padding-left:20px;')
- = publication
- .interests
- .interests__title(style='position: relative; color: #EF4523;font-size: 24px;text-transform: uppercase;border-bottom:1px solid #000000;padding-bottom:0;margin: 35px 10px 35px 0;')
- p = raw @cv.info_by_selector('.interests__title')
- ul.interests__list(style='white-space: nowrap; list-style-type: none; padding-left: 0;')
- - @cv.info_for_table('.interests__list').map{|el| parse_list(el, 'interests__interest') }.each do |interest|
- .li
- .interests__bullet(style='vertical-align: middle; display:inline-block; background: #EF4523; border-radius: 50%; width:11px; height:11px;')
- .interests__interest(style='vertical-align: middle; white-space: normal; display: inline-block; word-break: break-word;padding-left:20px;')
- = interest
- .right-block(style='float:right; width:71%;position:relative;height:100')
- .general-info
- .experience
- .experience__title(style='position: relative; color: #EF4523;font-size: 24px;text-transform: uppercase;border-bottom:1px solid #000000;padding-bottom:0;margin: 35px 50px;')
- p = raw @cv.info_by_selector('.experience__title')
- .experience__timeline(style='margin-bottom: 30px;')
- - @cv.info_for_table('.experience__timeline').map{|el| parse_work_experience(el) }.each do |work_experience|
- .center-black-line(style='border-left:1px solid #000;')
- .experience__item-info(style='border-left:1px solid #000;padding:0px 20px 0px 50px;position:relative;')
- .peach-circle(style='position: absolute; top: 0;left: -13px;height: 25px;width: 25px;border-radius: 50%;background-color:#EF4523;')
- p.experience__company-name(style='font-weight:bold; text-transform: uppercase; margin-top: -25px;font-size:26px;')
- = raw work_experience[:company]
- p.experience__item-date(style='font-size:18px;')
- = raw work_experience[:date]
- p.experience__description(style='font-size:18px;')
- = raw work_experience[:description]
- p.experience__role(style='font-size:18px;')
- span.font-weight-bold(style='font-weight:bold;')
- = raw work_experience[:role]
- p.experience__responsibilities(style='font-size:18px;')
- span.font-weight-bold(style='font-weight:bold;')
- = raw work_experience[:responsibilities]
- p.experience__environment(style='padding-bottom:60px;font-size:18px;')
- span.font-weight-bold(style='font-weight:bold;')
- = raw work_experience[:environment]
- layouts/pdf.html.slim
- doctype html
- html(style='height: 100%;')
- head
- title
- = t('common.cv')
- = wicked_pdf_stylesheet_pack_tag 'application'
- = wicked_pdf_stylesheet_link_tag 'application'
- body
- = yield
Add Comment
Please, Sign In to add comment