|
1 | | - |
| 1 | +<%# frozen_string_literal: true %> |
2 | 2 | <!DOCTYPE html> |
3 | 3 | <html lang="en"> |
4 | 4 | <head> |
|
51 | 51 | <table class="styled-table" style="min-width: 2000px;"> |
52 | 52 | <thead> |
53 | 53 | <tr> |
| 54 | + <% if session[:role].to_s == "admin" %> |
| 55 | + <th> |
| 56 | + Blacklisted? |
| 57 | + </th> |
| 58 | + <% end %> |
54 | 59 | <th> |
55 | 60 | <%= link_to applicants_path(sort: "name", direction: toggle_direction("name")) do %> |
56 | 61 | Name |
|
169 | 174 | </thead> |
170 | 175 | <tbody> |
171 | 176 | <% @applicants.each do |applicant| %> |
172 | | - <tr id="<%= dom_id applicant %>"> |
173 | | - <td class="<%= 'highlight-name' if applicant.name.start_with?('*') %>"> |
174 | | - <%= applicant.name %> |
175 | | - </td> |
176 | | - <td><%= applicant.email %></td> |
177 | | - <td><%= applicant.degree %></td> |
178 | | - <td><%= applicant.gpa %></td> |
179 | | - <td><%= applicant.positions %></td> |
180 | | - <td><%= applicant.number %></td> |
181 | | - <td><%= applicant.uin %></td> |
182 | | - <td><%= applicant.hours %></td> |
183 | | - <td><%= applicant.citizenship %></td> |
184 | | - <td><%= applicant.cert %></td> |
185 | | - <td><%= applicant.prev_ta %></td> |
186 | | - <td><%= applicant.prev_course %></td> |
187 | | - <td><%= applicant.prev_uni %></td> |
188 | | - <td><%= applicant.advisor %></td> |
189 | | - <td> |
| 177 | + <%= turbo_frame_tag dom_id(applicant) do %> |
| 178 | + <tr id="<%= dom_id applicant %>"> |
190 | 179 | <% if session[:role].to_s == "admin" %> |
191 | | - <%= link_to "Edit this applicant", edit_applicant_path(applicant), class: "action-button" %> |
192 | | - <%end%> |
193 | | - <%= link_to "Show this applicant", applicant_path(applicant), class: "table-link" %> |
194 | | - </td> |
195 | | - </tr> |
| 180 | + <td style="background-color: <%= applicant.blacklisted? ? 'rgb(243, 169, 162)' : 'rgb(162, 246, 156)' %>;"> |
| 181 | + <% if applicant.blacklisted? %> |
| 182 | + <%= button_to "Unblacklist", |
| 183 | + toggle_blacklist_path(id: applicant.id), |
| 184 | + method: :post, remote: true, |
| 185 | + class: "btn btn-warning" %> |
| 186 | + <% else %> |
| 187 | + <%= button_to "Blacklist", |
| 188 | + toggle_blacklist_path(id: applicant.id), |
| 189 | + method: :post, remote: true, |
| 190 | + class: "btn btn-success" %> |
| 191 | + <% end %> |
| 192 | + </td> |
| 193 | + <% end %> |
| 194 | + <td class="<%= 'highlight-name' if applicant.name.start_with?('*') %>"> |
| 195 | + <%= applicant.name %> |
| 196 | + </td> |
| 197 | + <td><%= applicant.email %></td> |
| 198 | + <td><%= applicant.degree %></td> |
| 199 | + <td><%= applicant.gpa %></td> |
| 200 | + <td><%= applicant.positions %></td> |
| 201 | + <td><%= applicant.number %></td> |
| 202 | + <td><%= applicant.uin %></td> |
| 203 | + <td><%= applicant.hours %></td> |
| 204 | + <td><%= applicant.citizenship %></td> |
| 205 | + <td><%= applicant.cert %></td> |
| 206 | + <td><%= applicant.prev_ta %></td> |
| 207 | + <td><%= applicant.prev_course %></td> |
| 208 | + <td><%= applicant.prev_uni %></td> |
| 209 | + <td><%= applicant.advisor %></td> |
| 210 | + <td> |
| 211 | + <% if session[:role].to_s == "admin" %> |
| 212 | + <%= link_to "Edit this applicant", edit_applicant_path(applicant), class: "action-button" %> |
| 213 | + <%end%> |
| 214 | + <%= link_to "Show this applicant", applicant_path(applicant), class: "table-link" %> |
| 215 | + </td> |
| 216 | + </tr> |
| 217 | + <% end %> |
196 | 218 | <% end %> |
197 | 219 | </tbody> |
198 | 220 | </table> |
|
0 commit comments