Skip to content

Commit

Permalink
Active link vacancy (#558)
Browse files Browse the repository at this point in the history
* add model member

* active link for vacancy
  • Loading branch information
usernaimandrey committed May 11, 2023
1 parent 85503ef commit eb5e3c6
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
9 changes: 8 additions & 1 deletion app/views/web/vacancies/show.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,21 @@
.col-sm-9
= @vacancy.salary

- %i[link_for_contact contact_name contact_phone contact_telegram contact_email].each do |field_name|
- %i[contact_name contact_phone contact_telegram contact_email].each do |field_name|
- if @vacancy.send :"#{field_name}?"
.row.mb-3
.col-sm-3
b = han('vacancy', field_name)
.col-sm-9.text-break
= @vacancy.send :"#{field_name}"

- if @vacancy.link_for_contact?
.row.mb-3
.col-sm-3
b = han('vacancy', 'link_for_contact')
.col-sm-9
= link_to t('.link_for_contact', title: @vacancy.title), @vacancy.link_for_contact, class: 'text-decoration-none'

- if @vacancy.directions.any?
.row.mb-3
.col-sm-3
Expand Down
1 change: 1 addition & 0 deletions config/locales/en.views.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ en:
similar_vacancies: Related jobs
developers_in_the_city: "%{position_level} %{direction} in %{city_name}"
from_hexlet: When applying for a vacancy, indicate that you are from Hexlet =)
link_for_contact: To apply for the vacancy %{title} follow the link
index:
header: Jobs for developers
title: Jobs for programmers
Expand Down
1 change: 1 addition & 0 deletions config/locales/ru.views.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ ru:
similar_vacancies: Похожие вакансии
developers_in_the_city: "%{position_level} %{direction} в городе %{city_name}"
from_hexlet: При отклике на вакансию указывайте, что вы от Хекслета =)
link_for_contact: Для отклика на вакансию %{title} переходите по ссылке
index:
header: Вакансии для разработчиков
title: Вакансии для программистов
Expand Down

0 comments on commit eb5e3c6

Please sign in to comment.