Skip to content

Commit

Permalink
ISSUE #448: Changes at professor institutions show
Browse files Browse the repository at this point in the history
  • Loading branch information
IgorMonardez committed Oct 24, 2024
1 parent 0c3f18f commit 611259b
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions app/helpers/professors_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,38 @@ def professor_advisements_with_points_show_column(record, options)
resp.html_safe
end

def professor_institutions_show_column(record, options)
affiliations = record.affiliations
return "-" if affiliations.empty?

body = ""
count = 0
affiliations.each do |affiliation|
count += 1
tr_class = count.even? ? "even-record" : ""
body += "<tr class=\"record #{tr_class}\">
<td>#{affiliation.institution.name}</td>
<td>#{affiliation.start_date}</td>
<td>#{affiliation.end_date}</td>
</tr>"
end

resp =
"<table class=\"showtable listed-records-table\">
<thead>
<tr>
<th>#{I18n.t("activerecord.attributes.institution.name")}</th>
<th>#{I18n.t("activerecord.attributes.affiliation.start_date")}</th>
<th>#{I18n.t("activerecord.attributes.affiliation.end_date")}</th>
</tr>
</thead>
<tboby class=\"records\">
#{body}
</tbody>
</table>"
resp.html_safe
end

def permit_rs_browse_params
[:page, :update, :utf8]
end
Expand Down

0 comments on commit 611259b

Please sign in to comment.