Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extract vacancy item section into a component partial (#94)
In order to have a consistent vacancy item section in all views, extract it into a component partial that can be used in all views. This will fix the problem that the vacancy card from the `My Vacancies` is different from the `All Vacancies` view.
- Loading branch information
1 parent
52ac834
commit be49b86
Showing
5 changed files
with
32 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1 @@ | ||
<section class="vacancy-item "> | ||
<div class="row"> | ||
<div class="col-md-1 col-xs-5"> | ||
<%= image_tag("ico-company-default.png", class: 'img-responsive img-company') %> | ||
</div> | ||
<div class="col-md-9 col-xs-6"> | ||
<div class="vacancy-title"> | ||
<span class="text-primary show-title-vacancy"> | ||
<%= vacancy.job_title %> | ||
</span> | ||
</div> | ||
<div class="vacancy-details"> | ||
<span><i class="fa fa-briefcase" aria-hidden="true"></i><%= vacancy.company_name %></span> | ||
<span><i class="fa fa-map-marker" aria-hidden="true"></i><%= vacancy.location %></span> | ||
</div> | ||
</div> | ||
<div class="col-md-2 col-xs-12"> | ||
<%= link_to t("messages.edit_vacancy"), edit_vacancy_path(vacancy.id), class: "btn btn-primary btn-border-bottom-primary vertical-25 grow" %> | ||
</div> | ||
</div> | ||
</section> | ||
<%= render 'components/vacancy_item', vacancy: vacancy, link: edit_vacancy_path(vacancy.id) %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<%# | ||
Vacancy Item | ||
Provide a card containing job's information, when clicked it gets redirected to the URL specified in the parameter. | ||
@param vacancy [Vacancy] * the vacancy object. | ||
@param link [String] * the string containing the URL that will be redirected when the section is clicked. | ||
%> | ||
|
||
<section class="vacancy-item "> | ||
<%= link_to link do %> | ||
<div class="row"> | ||
<div class="col-md-1 col-xs-5"> | ||
<%= image_tag("ico-company-default.png", class: 'img-responsive img-company') %> | ||
</div> | ||
<div class="col-md-9 col-xs-6"> | ||
<div class="vacancy-title"> | ||
<span class="text-primary show-title-vacancy"> | ||
<%= vacancy.job_title %> | ||
</span> | ||
</div> | ||
<div class="vacancy-details"> | ||
<span><i class="fa fa-briefcase" aria-hidden="true"></i><%= vacancy.company_name %></span> | ||
<span><i class="fa fa-map-marker" aria-hidden="true"></i><%= vacancy.location %></span> | ||
</div> | ||
</div> | ||
</div> | ||
<% end %> | ||
</section> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1 @@ | ||
<section class="vacancy-item "> | ||
<%= link_to vacancy_path(vacancy) do %> | ||
<div class="row"> | ||
<div class="col-md-1 col-xs-5"> | ||
<%= image_tag("ico-company-default.png", class: 'img-responsive img-company') %> | ||
</div> | ||
<div class="col-md-9 col-xs-6"> | ||
<div class="vacancy-title"> | ||
<span class="text-primary show-title-vacancy"> | ||
<%= vacancy.job_title %> | ||
</span> | ||
</div> | ||
<div class="vacancy-details"> | ||
<span><i class="fa fa-briefcase" aria-hidden="true"></i><%= vacancy.company_name %></span> | ||
<span><i class="fa fa-map-marker" aria-hidden="true"></i><%= vacancy.location %></span> | ||
</div> | ||
</div> | ||
</div> | ||
<% end %> | ||
</section> | ||
<%= render 'components/vacancy_item', vacancy: vacancy, link: vacancy_path(vacancy) %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
|
||
<section class="bg-vacancy-intro"> | ||
<div class="row"> | ||
<div class="col-md-12"> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters